コード例 #1
0
        /// <summary>
        /// create
        /// </summary>
        ///
        /// <param name="options"> Create IpAddress parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of IpAddress </returns>
        public static IpAddressResource Create(CreateIpAddressOptions 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="pathIpAccessControlListSid"> The ip_access_control_list_sid </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="ipAddress"> The ip_address </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of IpAddress </returns>
        public static async System.Threading.Tasks.Task <IpAddressResource> CreateAsync(string pathIpAccessControlListSid, string friendlyName, string ipAddress, string pathAccountSid = null, ITwilioRestClient client = null)
        {
            var options = new CreateIpAddressOptions(pathIpAccessControlListSid, friendlyName, ipAddress)
            {
                PathAccountSid = pathAccountSid
            };

            return(await CreateAsync(options, client));
        }
コード例 #3
0
        /// <summary>
        /// create
        /// </summary>
        ///
        /// <param name="pathIpAccessControlListSid"> The ip_access_control_list_sid </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="ipAddress"> The ip_address </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of IpAddress </returns>
        public static IpAddressResource Create(string pathIpAccessControlListSid, string friendlyName, string ipAddress, string pathAccountSid = null, ITwilioRestClient client = null)
        {
            var options = new CreateIpAddressOptions(pathIpAccessControlListSid, friendlyName, ipAddress)
            {
                PathAccountSid = pathAccountSid
            };

            return(Create(options, client));
        }
コード例 #4
0
 private static Request BuildCreateRequest(CreateIpAddressOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/SIP/IpAccessControlLists/" + options.PathIpAccessControlListSid + "/IpAddresses.json",
                postParams: options.GetParams()
                ));
 }
コード例 #5
0
        /// <summary>
        /// create
        /// </summary>
        ///
        /// <param name="options"> Create IpAddress parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of IpAddress </returns>
        public static async System.Threading.Tasks.Task <IpAddressResource> CreateAsync(CreateIpAddressOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }