Ejemplo n.º 1
0
        /// <summary>
        /// Remove a message from the conversation
        /// </summary>
        /// <param name="pathChatServiceSid"> The SID of the Conversation Service that the resource is associated with. </param>
        /// <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="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 bool Delete(string pathChatServiceSid,
                                  string pathConversationSid,
                                  string pathSid,
                                  MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null,
                                  ITwilioRestClient client = null)
        {
            var options = new DeleteMessageOptions(pathChatServiceSid, pathConversationSid, pathSid)
            {
                XTwilioWebhookEnabled = xTwilioWebhookEnabled
            };

            return(Delete(options, client));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Remove a message from the conversation
        /// </summary>
        /// <param name="pathChatServiceSid"> The SID of the Conversation Service that the resource is associated with. </param>
        /// <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="xTwilioWebhookEnabled"> The X-Twilio-Webhook-Enabled HTTP request header </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 <bool> DeleteAsync(string pathChatServiceSid,
                                                                           string pathConversationSid,
                                                                           string pathSid,
                                                                           MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null,
                                                                           ITwilioRestClient client = null)
        {
            var options = new DeleteMessageOptions(pathChatServiceSid, pathConversationSid, pathSid)
            {
                XTwilioWebhookEnabled = xTwilioWebhookEnabled
            };

            return(await DeleteAsync(options, client));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Add a new message to the conversation in a specific service
        /// </summary>
        /// <param name="pathChatServiceSid"> The SID of the Conversation Service that the resource is associated with. </param>
        /// <param name="pathConversationSid"> The unique ID of the Conversation for this message. </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="mediaSid"> The Media SID to be attached to the new Message. </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 Create(string pathChatServiceSid,
                                             string pathConversationSid,
                                             string author        = null,
                                             string body          = null,
                                             DateTime?dateCreated = null,
                                             DateTime?dateUpdated = null,
                                             string attributes    = null,
                                             string mediaSid      = null,
                                             MessageResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null,
                                             ITwilioRestClient client = null)
        {
            var options = new CreateMessageOptions(pathChatServiceSid, pathConversationSid)
            {
                Author = author, Body = body, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, MediaSid = mediaSid, XTwilioWebhookEnabled = xTwilioWebhookEnabled
            };

            return(Create(options, client));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Update an existing message in the conversation
        /// </summary>
        /// <param name="pathChatServiceSid"> The SID of the Conversation Service that the resource is associated with. </param>
        /// <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> Task that resolves to A single instance of Message </returns>
        public static async System.Threading.Tasks.Task <MessageResource> UpdateAsync(string pathChatServiceSid,
                                                                                      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(pathChatServiceSid, pathConversationSid, pathSid)
            {
                Author = author, Body = body, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, XTwilioWebhookEnabled = xTwilioWebhookEnabled
            };

            return(await UpdateAsync(options, client));
        }