Esempio n. 1
0
        public static ListInboundDomainResponse CreateFromResponse(Response response)
        {
            var thisResponse = new ListInboundDomainResponse();

            LeftRight.SetValuesToMatch(thisResponse, response);

            thisResponse.InboundDomains = BuildTheInboundDomainsFrom(response);

            return(thisResponse);
        }
        public static InboundDomainResponse CreateFromResponse(Response response)
        {
            var result = new InboundDomainResponse();

            LeftRight.SetValuesToMatch(result, response);

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

            result.InboundDomain = ListInboundDomainResponse.ConvertToAInboundDomain(results);

            return(result);
        }
Esempio n. 3
0
        public async Task <ListInboundDomainResponse> List(object query = null)
        {
            if (query == null)
            {
                query = new {}
            }
            ;
            var request = new Request
            {
                Url    = $"/api/{client.Version}/inbound-domains",
                Method = "GET",
                Data   = query
            };

            var response = await requestSender.Send(request);

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

            return(ListInboundDomainResponse.CreateFromResponse(response));
        }