Esempio n. 1
0
        /// <summary>
        /// Create a new IP Access Control List mapping
        /// </summary>
        /// <param name="options"> Create AuthCallsIpAccessControlListMapping parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of AuthCallsIpAccessControlListMapping </returns>
        public static AuthCallsIpAccessControlListMappingResource Create(CreateAuthCallsIpAccessControlListMappingOptions options,
                                                                         ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
 private static Request BuildCreateRequest(CreateAuthCallsIpAccessControlListMappingOptions options,
                                           ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/SIP/Domains/" + options.PathDomainSid + "/Auth/Calls/IpAccessControlListMappings.json",
                postParams: options.GetParams()
                ));
 }
Esempio n. 3
0
        /// <summary>
        /// Create a new IP Access Control List mapping
        /// </summary>
        /// <param name="pathDomainSid"> The SID of the SIP domain that will contain the new resource </param>
        /// <param name="ipAccessControlListSid"> The SID of the IpAccessControlList resource to map to the SIP domain </param>
        /// <param name="pathAccountSid"> The SID of the Account that will create the resource </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of AuthCallsIpAccessControlListMapping </returns>
        public static async System.Threading.Tasks.Task <AuthCallsIpAccessControlListMappingResource> CreateAsync(string pathDomainSid,
                                                                                                                  string ipAccessControlListSid,
                                                                                                                  string pathAccountSid    = null,
                                                                                                                  ITwilioRestClient client = null)
        {
            var options = new CreateAuthCallsIpAccessControlListMappingOptions(pathDomainSid, ipAccessControlListSid)
            {
                PathAccountSid = pathAccountSid
            };

            return(await CreateAsync(options, client));
        }
Esempio n. 4
0
        /// <summary>
        /// Create a new IP Access Control List mapping
        /// </summary>
        /// <param name="pathDomainSid"> The SID of the SIP domain that will contain the new resource </param>
        /// <param name="ipAccessControlListSid"> The SID of the IpAccessControlList resource to map to the SIP domain </param>
        /// <param name="pathAccountSid"> The SID of the Account that will create the resource </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of AuthCallsIpAccessControlListMapping </returns>
        public static AuthCallsIpAccessControlListMappingResource Create(string pathDomainSid,
                                                                         string ipAccessControlListSid,
                                                                         string pathAccountSid    = null,
                                                                         ITwilioRestClient client = null)
        {
            var options = new CreateAuthCallsIpAccessControlListMappingOptions(pathDomainSid, ipAccessControlListSid)
            {
                PathAccountSid = pathAccountSid
            };

            return(Create(options, client));
        }
Esempio n. 5
0
        /// <summary>
        /// Create a new IP Access Control List mapping
        /// </summary>
        /// <param name="options"> Create AuthCallsIpAccessControlListMapping parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of AuthCallsIpAccessControlListMapping </returns>
        public static async System.Threading.Tasks.Task <AuthCallsIpAccessControlListMappingResource> CreateAsync(CreateAuthCallsIpAccessControlListMappingOptions options,
                                                                                                                  ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }