Ejemplo n.º 1
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="options"> Update ByocTrunk parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of ByocTrunk </returns>
        public static ByocTrunkResource Update(UpdateByocTrunkOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 2
0
 private static Request BuildUpdateRequest(UpdateByocTrunkOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Voice,
                "/v1/ByocTrunks/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="friendlyName"> A string to describe the resource </param>
        /// <param name="voiceUrl"> The URL we should call when receiving a call </param>
        /// <param name="voiceMethod"> The HTTP method we should use with voice_url </param>
        /// <param name="voiceFallbackUrl"> The URL we should call when an error occurs in executing TwiML </param>
        /// <param name="voiceFallbackMethod"> The HTTP method used with voice_fallback_url </param>
        /// <param name="statusCallbackUrl"> The URL that we should call to pass status updates </param>
        /// <param name="statusCallbackMethod"> The HTTP method we should use to call status_callback_url </param>
        /// <param name="cnamLookupEnabled"> Whether Caller ID Name (CNAM) lookup is enabled for the trunk </param>
        /// <param name="connectionPolicySid"> Origination Connection Policy (to your Carrier) </param>
        /// <param name="fromDomainSid"> The SID of the SIP Domain that should be used in the `From` header of originating
        ///                     calls </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of ByocTrunk </returns>
        public static async System.Threading.Tasks.Task <ByocTrunkResource> UpdateAsync(string pathSid,
                                                                                        string friendlyName = null,
                                                                                        Uri voiceUrl        = null,
                                                                                        Twilio.Http.HttpMethod voiceMethod = null,
                                                                                        Uri voiceFallbackUrl = null,
                                                                                        Twilio.Http.HttpMethod voiceFallbackMethod = null,
                                                                                        Uri statusCallbackUrl = null,
                                                                                        Twilio.Http.HttpMethod statusCallbackMethod = null,
                                                                                        bool?cnamLookupEnabled     = null,
                                                                                        string connectionPolicySid = null,
                                                                                        string fromDomainSid       = null,
                                                                                        ITwilioRestClient client   = null)
        {
            var options = new UpdateByocTrunkOptions(pathSid)
            {
                FriendlyName = friendlyName, VoiceUrl = voiceUrl, VoiceMethod = voiceMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceFallbackMethod = voiceFallbackMethod, StatusCallbackUrl = statusCallbackUrl, StatusCallbackMethod = statusCallbackMethod, CnamLookupEnabled = cnamLookupEnabled, ConnectionPolicySid = connectionPolicySid, FromDomainSid = fromDomainSid
            };

            return(await UpdateAsync(options, client));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="options"> Update ByocTrunk parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of ByocTrunk </returns>
        public static async System.Threading.Tasks.Task <ByocTrunkResource> UpdateAsync(UpdateByocTrunkOptions options,
                                                                                        ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }