Пример #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));
        }