示例#1
0
        /// <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));
        }
 private static Request BuildUpdateRequest(UpdateMessageOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Conversations,
                "/v1/Conversations/" + options.PathConversationSid + "/Messages/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
示例#3
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathConversationSid"> The unique id of the Conversation for this message. </param>
        /// <param name="pathSid"> A 34 character string that uniquely identifies this resource. </param>
        /// <param name="author"> The channel specific identifier of the message's author. </param>
        /// <param name="body"> The content of the message. </param>
        /// <param name="dateCreated"> The date that this resource was created. </param>
        /// <param name="dateUpdated"> The date that this resource was last updated. </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 pathConversationSid,
                                                                                      string pathSid,
                                                                                      string author            = null,
                                                                                      string body              = null,
                                                                                      DateTime?dateCreated     = null,
                                                                                      DateTime?dateUpdated     = null,
                                                                                      ITwilioRestClient client = null)
        {
            var options = new UpdateMessageOptions(pathConversationSid, pathSid)
            {
                Author = author, Body = body, DateCreated = dateCreated, DateUpdated = dateUpdated
            };

            return(await UpdateAsync(options, client));
        }
示例#4
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathConversationSid"> The unique id of the Conversation for this message. </param>
        /// <param name="pathSid"> A 34 character string that uniquely identifies this resource. </param>
        /// <param name="author"> The channel specific identifier of the message's author. </param>
        /// <param name="body"> The content of the message. </param>
        /// <param name="dateCreated"> The date that this resource was created. </param>
        /// <param name="dateUpdated"> The date that this resource was last updated. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Message </returns>
        public static MessageResource Update(string pathConversationSid,
                                             string pathSid,
                                             string author            = null,
                                             string body              = null,
                                             DateTime?dateCreated     = null,
                                             DateTime?dateUpdated     = null,
                                             ITwilioRestClient client = null)
        {
            var options = new UpdateMessageOptions(pathConversationSid, pathSid)
            {
                Author = author, Body = body, DateCreated = dateCreated, DateUpdated = dateUpdated
            };

            return(Update(options, client));
        }
        /// <summary>
        /// Update an existing message in the conversation
        /// </summary>
        /// <param name="pathConversationSid"> The unique ID of the Conversation for this message. </param>
        /// <param name="pathSid"> A 34 character string that uniquely identifies this resource. </param>
        /// <param name="author"> The channel specific identifier of the message's author. </param>
        /// <param name="body"> The content of the message. </param>
        /// <param name="dateCreated"> The date that this resource was created. </param>
        /// <param name="dateUpdated"> The date that this resource was last updated. </param>
        /// <param name="attributes"> A string metadata field you can use to store any data you wish. </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 pathConversationSid,
                                             string pathSid,
                                             string author        = null,
                                             string body          = null,
                                             DateTime?dateCreated = null,
                                             DateTime?dateUpdated = null,
                                             string attributes    = null,
                                             MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null,
                                             ITwilioRestClient client = null)
        {
            var options = new UpdateMessageOptions(pathConversationSid, pathSid)
            {
                Author = author, Body = body, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, XTwilioWebhookEnabled = xTwilioWebhookEnabled
            };

            return(Update(options, client));
        }
示例#6
0
        /// <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));
        }