/// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="options"> Update Channel parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Channel </returns>
        public static ChannelResource Update(UpdateChannelOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="uniqueName"> The unique_name </param>
        /// <param name="attributes"> The attributes </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Channel </returns>
        public static async System.Threading.Tasks.Task <ChannelResource> UpdateAsync(string pathServiceSid, string pathSid, string friendlyName = null, string uniqueName = null, string attributes = null, ITwilioRestClient client = null)
        {
            var options = new UpdateChannelOptions(pathServiceSid, pathSid)
            {
                FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes
            };

            return(await UpdateAsync(options, client));
        }
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="uniqueName"> The unique_name </param>
        /// <param name="attributes"> The attributes </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Channel </returns>
        public static ChannelResource Update(string pathServiceSid, string pathSid, string friendlyName = null, string uniqueName = null, string attributes = null, ITwilioRestClient client = null)
        {
            var options = new UpdateChannelOptions(pathServiceSid, pathSid)
            {
                FriendlyName = friendlyName, UniqueName = uniqueName, Attributes = attributes
            };

            return(Update(options, client));
        }
Beispiel #4
0
 private static Request BuildUpdateRequest(UpdateChannelOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Chat,
                "/v1/Services/" + options.PathServiceSid + "/Channels/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="options"> Update Channel parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Channel </returns>
        public static async System.Threading.Tasks.Task <ChannelResource> UpdateAsync(UpdateChannelOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }