Beispiel #1
0
        public static ListSendingDomainResponse CreateFromResponse(Response response)
        {
            var result = new ListSendingDomainResponse();

            LeftRight.SetValuesToMatch(result, response);

            var results = Jsonification.DeserializeObject <dynamic>(response.Content).results;

            result.SendingDomains = BuildTheSendingDomains(results);
            return(result);
        }
        public async Task <ListSendingDomainResponse> List()
        {
            var request = new Request
            {
                Url    = $"/api/{client.Version}/sending-domains",
                Method = "GET"
            };

            var response = await requestSender.Send(request);

            if (response.StatusCode != HttpStatusCode.OK)
            {
                throw new ResponseException(response);
            }

            return(ListSendingDomainResponse.CreateFromResponse(response));
        }