/// <summary>
        /// Fetch an instance of an Add-on installation currently assigned to this Number.
        /// </summary>
        /// <param name="options"> Fetch AssignedAddOn parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of AssignedAddOn </returns>
        public static AssignedAddOnResource Fetch(FetchAssignedAddOnOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Example #2
0
        /// <summary>
        /// Fetch an instance of an Add-on installation currently assigned to this Number.
        /// </summary>
        ///
        /// <param name="pathResourceSid"> The resource_sid </param>
        /// <param name="pathSid"> The unique Installed Add-on Sid </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 AssignedAddOn </returns>
        public static async System.Threading.Tasks.Task <AssignedAddOnResource> FetchAsync(string pathResourceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null)
        {
            var options = new FetchAssignedAddOnOptions(pathResourceSid, pathSid)
            {
                PathAccountSid = pathAccountSid
            };

            return(await FetchAsync(options, client));
        }
 private static Request BuildFetchRequest(FetchAssignedAddOnOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/IncomingPhoneNumbers/" + options.PathResourceSid + "/AssignedAddOns/" + options.PathSid + ".json",
                queryParams: options.GetParams()
                ));
 }
Example #4
0
        /// <summary>
        /// Fetch an instance of an Add-on installation currently assigned to this Number.
        /// </summary>
        ///
        /// <param name="pathResourceSid"> The resource_sid </param>
        /// <param name="pathSid"> The unique Installed Add-on Sid </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of AssignedAddOn </returns>
        public static AssignedAddOnResource Fetch(string pathResourceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null)
        {
            var options = new FetchAssignedAddOnOptions(pathResourceSid, pathSid)
            {
                PathAccountSid = pathAccountSid
            };

            return(Fetch(options, client));
        }
        /// <summary>
        /// Fetch an instance of an Add-on installation currently assigned to this Number.
        /// </summary>
        /// <param name="options"> Fetch 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 <AssignedAddOnResource> FetchAsync(FetchAssignedAddOnOptions options,
                                                                                           ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }