예제 #1
0
        /// <summary>
        /// Retrieve a list of IP Access Control List mappings belonging to the domain used in the request
        /// </summary>
        /// <param name="options"> Read AuthCallsIpAccessControlListMapping parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of AuthCallsIpAccessControlListMapping </returns>
        public static ResourceSet <AuthCallsIpAccessControlListMappingResource> Read(ReadAuthCallsIpAccessControlListMappingOptions options,
                                                                                     ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <AuthCallsIpAccessControlListMappingResource> .FromJson("contents", response.Content);

            return(new ResourceSet <AuthCallsIpAccessControlListMappingResource>(page, options, client));
        }
 private static Request BuildReadRequest(ReadAuthCallsIpAccessControlListMappingOptions options,
                                         ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/SIP/Domains/" + options.PathDomainSid + "/Auth/Calls/IpAccessControlListMappings.json",
                queryParams: options.GetParams()
                ));
 }
예제 #3
0
        /// <summary>
        /// Retrieve a list of IP Access Control List mappings belonging to the domain used in the request
        /// </summary>
        /// <param name="pathDomainSid"> The SID of the SIP domain that contains the resources to read </param>
        /// <param name="pathAccountSid"> The SID of the Account that created the resources to read </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </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 <ResourceSet <AuthCallsIpAccessControlListMappingResource> > ReadAsync(string pathDomainSid,
                                                                                                                               string pathAccountSid    = null,
                                                                                                                               int?pageSize             = null,
                                                                                                                               long?limit               = null,
                                                                                                                               ITwilioRestClient client = null)
        {
            var options = new ReadAuthCallsIpAccessControlListMappingOptions(pathDomainSid)
            {
                PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
예제 #4
0
        /// <summary>
        /// Retrieve a list of IP Access Control List mappings belonging to the domain used in the request
        /// </summary>
        /// <param name="pathDomainSid"> The SID of the SIP domain that contains the resources to read </param>
        /// <param name="pathAccountSid"> The SID of the Account that created the resources to read </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of AuthCallsIpAccessControlListMapping </returns>
        public static ResourceSet <AuthCallsIpAccessControlListMappingResource> Read(string pathDomainSid,
                                                                                     string pathAccountSid    = null,
                                                                                     int?pageSize             = null,
                                                                                     long?limit               = null,
                                                                                     ITwilioRestClient client = null)
        {
            var options = new ReadAuthCallsIpAccessControlListMappingOptions(pathDomainSid)
            {
                PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
예제 #5
0
        /// <summary>
        /// Retrieve a list of IP Access Control List mappings belonging to the domain used in the request
        /// </summary>
        /// <param name="options"> Read 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 <ResourceSet <AuthCallsIpAccessControlListMappingResource> > ReadAsync(ReadAuthCallsIpAccessControlListMappingOptions options,
                                                                                                                               ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <AuthCallsIpAccessControlListMappingResource> .FromJson("contents", response.Content);

            return(new ResourceSet <AuthCallsIpAccessControlListMappingResource>(page, options, client));
        }