/// <summary>
        /// Update the attributes of a domain
        /// </summary>
        ///
        /// <param name="options"> Update Domain parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Domain </returns>
        public static async System.Threading.Tasks.Task <DomainResource> UpdateAsync(UpdateDomainOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Example #2
0
        /// <summary>
        /// Update the attributes of a domain
        /// </summary>
        /// <param name="options"> Update Domain parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Domain </returns>
        public static DomainResource Update(UpdateDomainOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
        /// <summary>
        /// Update the attributes of a domain
        /// </summary>
        ///
        /// <param name="pathSid"> The sid </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="authType"> The auth_type </param>
        /// <param name="friendlyName"> A user-specified, human-readable name for the trigger. </param>
        /// <param name="voiceFallbackMethod"> The voice_fallback_method </param>
        /// <param name="voiceFallbackUrl"> The voice_fallback_url </param>
        /// <param name="voiceMethod"> HTTP method to use with voice_url </param>
        /// <param name="voiceStatusCallbackMethod"> The voice_status_callback_method </param>
        /// <param name="voiceStatusCallbackUrl"> The voice_status_callback_url </param>
        /// <param name="voiceUrl"> The voice_url </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Domain </returns>
        public static async System.Threading.Tasks.Task <DomainResource> UpdateAsync(string pathSid, string pathAccountSid = null, string authType = null, string friendlyName = null, Twilio.Http.HttpMethod voiceFallbackMethod = null, Uri voiceFallbackUrl = null, Twilio.Http.HttpMethod voiceMethod = null, Twilio.Http.HttpMethod voiceStatusCallbackMethod = null, Uri voiceStatusCallbackUrl = null, Uri voiceUrl = null, ITwilioRestClient client = null)
        {
            var options = new UpdateDomainOptions(pathSid)
            {
                PathAccountSid = pathAccountSid, AuthType = authType, FriendlyName = friendlyName, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceStatusCallbackMethod = voiceStatusCallbackMethod, VoiceStatusCallbackUrl = voiceStatusCallbackUrl, VoiceUrl = voiceUrl
            };

            return(await UpdateAsync(options, client));
        }
Example #4
0
        /// <summary>
        /// Update the attributes of a domain
        /// </summary>
        ///
        /// <param name="pathSid"> The sid </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="authType"> The auth_type </param>
        /// <param name="friendlyName"> A user-specified, human-readable name for the trigger. </param>
        /// <param name="voiceFallbackMethod"> The voice_fallback_method </param>
        /// <param name="voiceFallbackUrl"> The voice_fallback_url </param>
        /// <param name="voiceMethod"> HTTP method to use with voice_url </param>
        /// <param name="voiceStatusCallbackMethod"> The voice_status_callback_method </param>
        /// <param name="voiceStatusCallbackUrl"> The voice_status_callback_url </param>
        /// <param name="voiceUrl"> The voice_url </param>
        /// <param name="sipRegistration"> The sip_registration </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Domain </returns>
        public static DomainResource Update(string pathSid, string pathAccountSid = null, string authType = null, string friendlyName = null, Twilio.Http.HttpMethod voiceFallbackMethod = null, Uri voiceFallbackUrl = null, Twilio.Http.HttpMethod voiceMethod = null, Twilio.Http.HttpMethod voiceStatusCallbackMethod = null, Uri voiceStatusCallbackUrl = null, Uri voiceUrl = null, bool?sipRegistration = null, ITwilioRestClient client = null)
        {
            var options = new UpdateDomainOptions(pathSid)
            {
                PathAccountSid = pathAccountSid, AuthType = authType, FriendlyName = friendlyName, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceStatusCallbackMethod = voiceStatusCallbackMethod, VoiceStatusCallbackUrl = voiceStatusCallbackUrl, VoiceUrl = voiceUrl, SipRegistration = sipRegistration
            };

            return(Update(options, client));
        }
 private static Request BuildUpdateRequest(UpdateDomainOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/SIP/Domains/" + options.PathSid + ".json",
                postParams: options.GetParams()
                ));
 }
Example #6
0
        /// <summary>
        /// Update the attributes of a domain
        /// </summary>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="pathAccountSid"> The SID of the Account that created the resource to update </param>
        /// <param name="friendlyName"> A string to describe the resource </param>
        /// <param name="voiceFallbackMethod"> The HTTP method used with voice_fallback_url </param>
        /// <param name="voiceFallbackUrl"> The URL we should call when an error occurs in executing TwiML </param>
        /// <param name="voiceMethod"> The HTTP method we should use with voice_url </param>
        /// <param name="voiceStatusCallbackMethod"> The HTTP method we should use to call voice_status_callback_url </param>
        /// <param name="voiceStatusCallbackUrl"> The URL that we should call to pass status updates </param>
        /// <param name="voiceUrl"> The URL we should call when receiving a call </param>
        /// <param name="sipRegistration"> Whether SIP registration is allowed </param>
        /// <param name="domainName"> The unique address on Twilio to route SIP traffic </param>
        /// <param name="emergencyCallingEnabled"> Whether emergency calling is enabled for the domain. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Domain </returns>
        public static async System.Threading.Tasks.Task <DomainResource> UpdateAsync(string pathSid,
                                                                                     string pathAccountSid = null,
                                                                                     string friendlyName   = null,
                                                                                     Twilio.Http.HttpMethod voiceFallbackMethod = null,
                                                                                     Uri voiceFallbackUrl = null,
                                                                                     Twilio.Http.HttpMethod voiceMethod = null,
                                                                                     Twilio.Http.HttpMethod voiceStatusCallbackMethod = null,
                                                                                     Uri voiceStatusCallbackUrl = null,
                                                                                     Uri voiceUrl                 = null,
                                                                                     bool?sipRegistration         = null,
                                                                                     string domainName            = null,
                                                                                     bool?emergencyCallingEnabled = null,
                                                                                     ITwilioRestClient client     = null)
        {
            var options = new UpdateDomainOptions(pathSid)
            {
                PathAccountSid = pathAccountSid, FriendlyName = friendlyName, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceStatusCallbackMethod = voiceStatusCallbackMethod, VoiceStatusCallbackUrl = voiceStatusCallbackUrl, VoiceUrl = voiceUrl, SipRegistration = sipRegistration, DomainName = domainName, EmergencyCallingEnabled = emergencyCallingEnabled
            };

            return(await UpdateAsync(options, client));
        }
Example #7
0
        /// <summary>
        /// Update the attributes of a domain
        /// </summary>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="pathAccountSid"> The SID of the Account that created the resource to update </param>
        /// <param name="friendlyName"> A string to describe the resource </param>
        /// <param name="voiceFallbackMethod"> The HTTP method used with voice_fallback_url </param>
        /// <param name="voiceFallbackUrl"> The URL we should call when an error occurs in executing TwiML </param>
        /// <param name="voiceMethod"> The HTTP method we should use with voice_url </param>
        /// <param name="voiceStatusCallbackMethod"> The HTTP method we should use to call voice_status_callback_url </param>
        /// <param name="voiceStatusCallbackUrl"> The URL that we should call to pass status updates </param>
        /// <param name="voiceUrl"> The URL we should call when receiving a call </param>
        /// <param name="sipRegistration"> Whether SIP registration is allowed </param>
        /// <param name="domainName"> The unique address on Twilio to route SIP traffic </param>
        /// <param name="emergencyCallingEnabled"> Whether emergency calling is enabled for the domain. </param>
        /// <param name="secure"> Whether secure SIP is enabled for the domain </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Domain </returns>
        public static DomainResource Update(string pathSid,
                                            string pathAccountSid = null,
                                            string friendlyName   = null,
                                            Twilio.Http.HttpMethod voiceFallbackMethod = null,
                                            Uri voiceFallbackUrl = null,
                                            Twilio.Http.HttpMethod voiceMethod = null,
                                            Twilio.Http.HttpMethod voiceStatusCallbackMethod = null,
                                            Uri voiceStatusCallbackUrl = null,
                                            Uri voiceUrl                 = null,
                                            bool?sipRegistration         = null,
                                            string domainName            = null,
                                            bool?emergencyCallingEnabled = null,
                                            bool?secure = null,
                                            ITwilioRestClient client = null)
        {
            var options = new UpdateDomainOptions(pathSid)
            {
                PathAccountSid = pathAccountSid, FriendlyName = friendlyName, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceStatusCallbackMethod = voiceStatusCallbackMethod, VoiceStatusCallbackUrl = voiceStatusCallbackUrl, VoiceUrl = voiceUrl, SipRegistration = sipRegistration, DomainName = domainName, EmergencyCallingEnabled = emergencyCallingEnabled, Secure = secure
            };

            return(Update(options, client));
        }