/// <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)); }
/// <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="dateCreated"> The date_created </param> /// <param name="dateUpdated"> The date_updated </param> /// <param name="lastUpdatedBy"> The last_updated_by </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, DateTime?dateCreated = null, DateTime?dateUpdated = null, string lastUpdatedBy = null, ITwilioRestClient client = null) { var options = new UpdateMessageOptions(pathServiceSid, pathChannelSid, pathSid) { Body = body, Attributes = attributes, DateCreated = dateCreated, DateUpdated = dateUpdated, LastUpdatedBy = lastUpdatedBy }; return(Update(options, client)); }
private static Request BuildUpdateRequest(UpdateMessageOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.IpMessaging, "/v2/Services/" + options.PathServiceSid + "/Channels/" + options.PathChannelSid + "/Messages/" + options.PathSid + "", postParams: options.GetParams() )); }
/// <summary> /// update /// </summary> /// <param name="pathServiceSid"> Sid of the Service this message belongs to. </param> /// <param name="pathChannelSid"> Key that uniquely defines the channel this message belongs to. </param> /// <param name="pathSid"> Key that uniquely defines the message to update. </param> /// <param name="body"> The message body string. </param> /// <param name="attributes"> The attributes metadata field you can use to store any data you wish. </param> /// <param name="dateCreated"> The ISO8601 time specifying the datetime the Message should be set as being created. /// </param> /// <param name="dateUpdated"> The ISO8601 time specifying the datetime the Message should be set as having been last /// updated. </param> /// <param name="lastUpdatedBy"> Specify the Identity of the User that last updated the Message </param> /// <param name="from"> The identity of the message's author. </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, DateTime?dateCreated = null, DateTime?dateUpdated = null, string lastUpdatedBy = null, string from = null, ITwilioRestClient client = null) { var options = new UpdateMessageOptions(pathServiceSid, pathChannelSid, pathSid) { Body = body, Attributes = attributes, DateCreated = dateCreated, DateUpdated = dateUpdated, LastUpdatedBy = lastUpdatedBy, From = from }; return(await UpdateAsync(options, client)); }
/// <summary> /// update /// </summary> /// <param name="pathServiceSid"> The SID of the Service to update the resource from </param> /// <param name="pathChannelSid"> The SID of the Channel the message belongs to </param> /// <param name="pathSid"> The SID of the Message resource to update </param> /// <param name="body"> The message to send to the channel </param> /// <param name="attributes"> A valid JSON string that contains application-specific data </param> /// <param name="dateCreated"> The ISO 8601 date and time in GMT when the resource was created </param> /// <param name="dateUpdated"> The ISO 8601 date and time in GMT when the resource was updated </param> /// <param name="lastUpdatedBy"> The Identity of the User who last updated the Message, if applicable </param> /// <param name="from"> The Identity of the message's author </param> /// <param name="xTwilioWebhookEnabled"> The X-Twilio-Webhook-Enabled HTTP request header </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, DateTime?dateCreated = null, DateTime?dateUpdated = null, string lastUpdatedBy = null, string from = null, MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) { var options = new UpdateMessageOptions(pathServiceSid, pathChannelSid, pathSid) { Body = body, Attributes = attributes, DateCreated = dateCreated, DateUpdated = dateUpdated, LastUpdatedBy = lastUpdatedBy, From = from, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return(Update(options, client)); }
/// <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)); }