예제 #1
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create SourceIpMapping parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SourceIpMapping </returns>
        public static SourceIpMappingResource Create(CreateSourceIpMappingOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
예제 #2
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="ipRecordSid"> The unique string that identifies an IP Record </param>
        /// <param name="sipDomainSid"> The unique string that identifies a SIP Domain </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of SourceIpMapping </returns>
        public static async System.Threading.Tasks.Task <SourceIpMappingResource> CreateAsync(string ipRecordSid,
                                                                                              string sipDomainSid,
                                                                                              ITwilioRestClient client = null)
        {
            var options = new CreateSourceIpMappingOptions(ipRecordSid, sipDomainSid);

            return(await CreateAsync(options, client));
        }
예제 #3
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="ipRecordSid"> The unique string that identifies an IP Record </param>
        /// <param name="sipDomainSid"> The unique string that identifies a SIP Domain </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SourceIpMapping </returns>
        public static SourceIpMappingResource Create(string ipRecordSid,
                                                     string sipDomainSid,
                                                     ITwilioRestClient client = null)
        {
            var options = new CreateSourceIpMappingOptions(ipRecordSid, sipDomainSid);

            return(Create(options, client));
        }
예제 #4
0
 private static Request BuildCreateRequest(CreateSourceIpMappingOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Voice,
                "/v1/SourceIpMappings",
                postParams: options.GetParams()
                ));
 }
예제 #5
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create SourceIpMapping parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of SourceIpMapping </returns>
        public static async System.Threading.Tasks.Task <SourceIpMappingResource> CreateAsync(CreateSourceIpMappingOptions options,
                                                                                              ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }