private static Request BuildReadRequest(ReadAssignedAddOnOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/IncomingPhoneNumbers/" + options.PathResourceSid + "/AssignedAddOns.json",
                queryParams: options.GetParams()
                ));
 }
Esempio n. 2
0
        /// <summary>
        /// Retrieve a list of Add-on installations currently assigned to this Number.
        /// </summary>
        ///
        /// <param name="pathResourceSid"> The resource_sid </param>
        /// <param name="pathAccountSid"> The account_sid </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 AssignedAddOn </returns>
        public static ResourceSet <AssignedAddOnResource> Read(string pathResourceSid, string pathAccountSid = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadAssignedAddOnOptions(pathResourceSid)
            {
                PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Esempio n. 3
0
        /// <summary>
        /// Retrieve a list of Add-on installations currently assigned to this Number.
        /// </summary>
        ///
        /// <param name="pathResourceSid"> The resource_sid </param>
        /// <param name="pathAccountSid"> The account_sid </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 AssignedAddOn </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <AssignedAddOnResource> > ReadAsync(string pathResourceSid, string pathAccountSid = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadAssignedAddOnOptions(pathResourceSid)
            {
                PathAccountSid = pathAccountSid, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Esempio n. 4
0
        /// <summary>
        /// Retrieve a list of Add-on installations currently assigned to this Number.
        /// </summary>
        ///
        /// <param name="options"> Read AssignedAddOn parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of AssignedAddOn </returns>
        public static ResourceSet <AssignedAddOnResource> Read(ReadAssignedAddOnOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <AssignedAddOnResource> .FromJson("assigned_add_ons", response.Content);

            return(new ResourceSet <AssignedAddOnResource>(page, options, client));
        }
        /// <summary>
        /// Retrieve a list of Add-on installations currently assigned to this Number.
        /// </summary>
        /// <param name="options"> Read AssignedAddOn parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of AssignedAddOn </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <AssignedAddOnResource> > ReadAsync(ReadAssignedAddOnOptions options,
                                                                                                         ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <AssignedAddOnResource> .FromJson("assigned_add_ons", response.Content);

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