/// <summary>
        /// To redact a message-body from a post-flight message record, post to the message instance resource with an empty body
        /// </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>
 /// To redact a message-body from a post-flight message record, post to the message instance resource with an empty body
 /// </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);
 }
 /// <summary>
 /// To redact a message-body from a post-flight message record, post to the message instance resource with an empty body
 /// </summary>
 /// <param name="pathSid"> The unique string that identifies the resource </param>
 /// <param name="body"> The text of the message you want to send </param>
 /// <param name="pathAccountSid"> The SID of the Account that created the resources to update </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 pathSid,
                                                                              string body,
                                                                              string pathAccountSid = null,
                                                                              ITwilioRestClient client = null)
 {
     var options = new UpdateMessageOptions(pathSid, body){PathAccountSid = pathAccountSid};
     return await UpdateAsync(options, client);
 }
 /// <summary>
 /// To redact a message-body from a post-flight message record, post to the message instance resource with an empty body
 /// </summary>
 /// <param name="pathSid"> The unique string that identifies the resource </param>
 /// <param name="body"> The text of the message you want to send </param>
 /// <param name="pathAccountSid"> The SID of the Account that created the resources to update </param>
 /// <param name="client"> Client to make requests to Twilio </param>
 /// <returns> A single instance of Message </returns>
 public static MessageResource Update(string pathSid,
                                      string body,
                                      string pathAccountSid = null,
                                      ITwilioRestClient client = null)
 {
     var options = new UpdateMessageOptions(pathSid, body){PathAccountSid = pathAccountSid};
     return Update(options, client);
 }
Example #5
0
 private static Request BuildUpdateRequest(UpdateMessageOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Api,
                "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Messages/" + options.PathSid + ".json",
                postParams: options.GetParams()
                ));
 }