public async Task<Response> Create(InboundDomain inboundDomain)
        {
            var request = new Request
            {
                Url = $"api/{client.Version}/inbound-domains",
                Method = "POST",
                Data = dataMapper.ToDictionary(inboundDomain)
            };

            var response = await requestSender.Send(request);
            if (response.StatusCode != HttpStatusCode.OK) throw new ResponseException(response);

            var createInboundDomainResponse = new Response();
            LeftRight.SetValuesToMatch(createInboundDomainResponse, response);
            return createInboundDomainResponse;
        }
Ejemplo n.º 2
0
        public async Task <Response> Create(InboundDomain inboundDomain)
        {
            var request = new Request
            {
                Url    = $"api/{client.Version}/inbound-domains",
                Method = "POST",
                Data   = dataMapper.ToDictionary(inboundDomain)
            };

            var response = await requestSender.Send(request);

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

            var createInboundDomainResponse = new Response();

            LeftRight.SetValuesToMatch(createInboundDomainResponse, response);
            return(createInboundDomainResponse);
        }
Ejemplo n.º 3
0
 public IDictionary <string, object> ToDictionary(InboundDomain inboundDomain)
 {
     return(WithCommonConventions(inboundDomain));
 }