public async Task <Result <SuccessfulDomainWhitelistAdd> > Add(AddDomainName request,
                                                                       AccessToken accessToken             = default,
                                                                       CancellationToken cancellationToken = default)
        {
            var requestUri = GetUri(path);

            return(await HttpPost <SuccessfulDomainWhitelistAdd>(requestUri, data : request, administrationOrApiKey : AdministrationKey,
                                                                 token : accessToken, cancellationToken : cancellationToken));
        }
Exemplo n.º 2
0
        public async Task Given_Valid_Domain_Add_Get_Remove_Return_Successful_Results()
        {
            var api = Helpers.ApiHelper.GetApiWithDomainWhitelistKeys();

            var listResult = await api.Security.DomainWhitelist.Get();

            listResult.IsSuccess.ShouldBeTrue();

            foreach (var ip in listResult.Success)
            {
                var remove = await api.Security.DomainWhitelist.Remove(ip.Id);

                remove.IsSuccess.ShouldBeTrue();
            }

            var request = new AddDomainName
            {
                DomainName = "https://testing.getaddress.io"
            };

            var addResult = await api.Security.DomainWhitelist.Add(request);

            addResult.IsSuccess.ShouldBeTrue();

            var getResult = await api.Security.DomainWhitelist.Get(addResult.Success.Id);

            getResult.IsSuccess.ShouldBeTrue();



            listResult.IsSuccess.ShouldBeTrue();

            var removeResult = await api.Security.DomainWhitelist.Remove(getResult.Success.Id);

            removeResult.IsSuccess.ShouldBeTrue();
        }