/// <summary>
        /// Remove the assignment of an Add-on installation from the Number specified.
        /// </summary>
        /// <param name="options"> Delete AssignedAddOn parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of AssignedAddOn </returns>
        public static bool Delete(DeleteAssignedAddOnOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
示例#2
0
        /// <summary>
        /// Remove the assignment of an Add-on installation from the Number specified.
        /// </summary>
        ///
        /// <param name="options"> Delete 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 <bool> DeleteAsync(DeleteAssignedAddOnOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
 private static Request BuildDeleteRequest(DeleteAssignedAddOnOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/IncomingPhoneNumbers/" + options.PathResourceSid + "/AssignedAddOns/" + options.PathSid + ".json",
                queryParams: options.GetParams()
                ));
 }
示例#4
0
        /// <summary>
        /// Remove the assignment of an Add-on installation from the Number specified.
        /// </summary>
        ///
        /// <param name="pathResourceSid"> The resource_sid </param>
        /// <param name="pathSid"> The Installed Add-on Sid to remove </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 <bool> DeleteAsync(string pathResourceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null)
        {
            var options = new DeleteAssignedAddOnOptions(pathResourceSid, pathSid)
            {
                PathAccountSid = pathAccountSid
            };

            return(await DeleteAsync(options, client));
        }
示例#5
0
        /// <summary>
        /// Remove the assignment of an Add-on installation from the Number specified.
        /// </summary>
        ///
        /// <param name="pathResourceSid"> The resource_sid </param>
        /// <param name="pathSid"> The Installed Add-on Sid to remove </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 bool Delete(string pathResourceSid, string pathSid, string pathAccountSid = null, ITwilioRestClient client = null)
        {
            var options = new DeleteAssignedAddOnOptions(pathResourceSid, pathSid)
            {
                PathAccountSid = pathAccountSid
            };

            return(Delete(options, client));
        }