/// <summary> /// update /// </summary> /// /// <param name="options"> Update Message parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Message </returns> public static MessageResource Update(UpdateMessageOptions 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="pathChannelSid"> The channel_sid </param> /// <param name="pathSid"> The sid </param> /// <param name="body"> The body </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 Message </returns> public static async System.Threading.Tasks.Task <MessageResource> UpdateAsync(string pathServiceSid, string pathChannelSid, string pathSid, string body = null, string attributes = null, ITwilioRestClient client = null) { var options = new UpdateMessageOptions(pathServiceSid, pathChannelSid, pathSid) { Body = body, Attributes = attributes }; return(await UpdateAsync(options, client)); }
/// <summary> /// update /// </summary> /// /// <param name="pathServiceSid"> The service_sid </param> /// <param name="pathChannelSid"> The channel_sid </param> /// <param name="pathSid"> The sid </param> /// <param name="body"> The body </param> /// <param name="attributes"> The attributes </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Message </returns> public static MessageResource Update(string pathServiceSid, string pathChannelSid, string pathSid, string body = null, string attributes = null, ITwilioRestClient client = null) { var options = new UpdateMessageOptions(pathServiceSid, pathChannelSid, pathSid) { Body = body, Attributes = attributes }; return(Update(options, client)); }
private static Request BuildUpdateRequest(UpdateMessageOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Chat, "/v1/Services/" + options.PathServiceSid + "/Channels/" + options.PathChannelSid + "/Messages/" + options.PathSid + "", postParams: options.GetParams() )); }
/// <summary> /// update /// </summary> /// /// <param name="options"> Update Message parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Message </returns> public static async System.Threading.Tasks.Task <MessageResource> UpdateAsync(UpdateMessageOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }