/// <summary>
        /// update
        /// </summary>
        /// <param name="options"> Update Conversation parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Conversation </returns>
        public static ConversationResource Update(UpdateConversationOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Exemple #2
0
 private static Request BuildUpdateRequest(UpdateConversationOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Conversations,
                "/v1/Conversations/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
Exemple #3
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathSid"> A 34 character string that uniquely identifies this resource. </param>
        /// <param name="friendlyName"> The human-readable name of this conversation. </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 Conversation </returns>
        public static async System.Threading.Tasks.Task <ConversationResource> UpdateAsync(string pathSid,
                                                                                           string friendlyName      = null,
                                                                                           DateTime?dateCreated     = null,
                                                                                           DateTime?dateUpdated     = null,
                                                                                           ITwilioRestClient client = null)
        {
            var options = new UpdateConversationOptions(pathSid)
            {
                FriendlyName = friendlyName, DateCreated = dateCreated, DateUpdated = dateUpdated
            };

            return(await UpdateAsync(options, client));
        }
Exemple #4
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathSid"> A 34 character string that uniquely identifies this resource. </param>
        /// <param name="friendlyName"> The human-readable name of this conversation. </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 Conversation </returns>
        public static ConversationResource Update(string pathSid,
                                                  string friendlyName      = null,
                                                  DateTime?dateCreated     = null,
                                                  DateTime?dateUpdated     = null,
                                                  ITwilioRestClient client = null)
        {
            var options = new UpdateConversationOptions(pathSid)
            {
                FriendlyName = friendlyName, DateCreated = dateCreated, DateUpdated = dateUpdated
            };

            return(Update(options, client));
        }
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathSid"> A 34 character string that uniquely identifies this resource. </param>
        /// <param name="friendlyName"> The human-readable name of this conversation. </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"> An optional string metadata field you can use to store any data you wish. </param>
        /// <param name="messagingServiceSid"> The unique id of the SMS Service this conversation belongs to. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Conversation </returns>
        public static ConversationResource Update(string pathSid,
                                                  string friendlyName        = null,
                                                  DateTime?dateCreated       = null,
                                                  DateTime?dateUpdated       = null,
                                                  string attributes          = null,
                                                  string messagingServiceSid = null,
                                                  ITwilioRestClient client   = null)
        {
            var options = new UpdateConversationOptions(pathSid)
            {
                FriendlyName = friendlyName, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, MessagingServiceSid = messagingServiceSid
            };

            return(Update(options, client));
        }
Exemple #6
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathSid"> A 34 character string that uniquely identifies this resource. </param>
        /// <param name="friendlyName"> The human-readable name of this conversation. </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"> An optional string metadata field you can use to store any data you wish. </param>
        /// <param name="messagingServiceSid"> The unique id of the SMS Service this conversation belongs to. </param>
        /// <param name="state"> Current state of this conversation. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Conversation </returns>
        public static async System.Threading.Tasks.Task <ConversationResource> UpdateAsync(string pathSid,
                                                                                           string friendlyName                  = null,
                                                                                           DateTime?dateCreated                 = null,
                                                                                           DateTime?dateUpdated                 = null,
                                                                                           string attributes                    = null,
                                                                                           string messagingServiceSid           = null,
                                                                                           ConversationResource.StateEnum state = null,
                                                                                           ITwilioRestClient client             = null)
        {
            var options = new UpdateConversationOptions(pathSid)
            {
                FriendlyName = friendlyName, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, MessagingServiceSid = messagingServiceSid, State = state
            };

            return(await UpdateAsync(options, client));
        }
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathSid"> A 34 character string that uniquely identifies this resource. </param>
        /// <param name="friendlyName"> The human-readable name of this conversation. </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"> An optional string metadata field you can use to store any data you wish. </param>
        /// <param name="messagingServiceSid"> The unique id of the SMS Service this conversation belongs to. </param>
        /// <param name="state"> Current state of this conversation. </param>
        /// <param name="timersInactive"> ISO8601 duration when conversation will be switched to `inactive` state. </param>
        /// <param name="timersClosed"> ISO8601 duration when conversation will be switched to `closed` state. </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 Conversation </returns>
        public static ConversationResource Update(string pathSid,
                                                  string friendlyName                  = null,
                                                  DateTime?dateCreated                 = null,
                                                  DateTime?dateUpdated                 = null,
                                                  string attributes                    = null,
                                                  string messagingServiceSid           = null,
                                                  ConversationResource.StateEnum state = null,
                                                  string timersInactive                = null,
                                                  string timersClosed                  = null,
                                                  ConversationResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null,
                                                  ITwilioRestClient client = null)
        {
            var options = new UpdateConversationOptions(pathSid)
            {
                FriendlyName = friendlyName, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, MessagingServiceSid = messagingServiceSid, State = state, TimersInactive = timersInactive, TimersClosed = timersClosed, XTwilioWebhookEnabled = xTwilioWebhookEnabled
            };

            return(Update(options, client));
        }
        /// <summary>
        /// Update an existing conversation in your account's default service
        /// </summary>
        /// <param name="pathSid"> A 34 character string that uniquely identifies this resource. </param>
        /// <param name="friendlyName"> The human-readable name of this conversation. </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"> An optional string metadata field you can use to store any data you wish. </param>
        /// <param name="messagingServiceSid"> The unique ID of the Messaging Service this conversation belongs to. </param>
        /// <param name="state"> Current state of this conversation. </param>
        /// <param name="timersInactive"> ISO8601 duration when conversation will be switched to `inactive` state. </param>
        /// <param name="timersClosed"> ISO8601 duration when conversation will be switched to `closed` state. </param>
        /// <param name="uniqueName"> An application-defined string that uniquely identifies the 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 Conversation </returns>
        public static async System.Threading.Tasks.Task <ConversationResource> UpdateAsync(string pathSid,
                                                                                           string friendlyName                  = null,
                                                                                           DateTime?dateCreated                 = null,
                                                                                           DateTime?dateUpdated                 = null,
                                                                                           string attributes                    = null,
                                                                                           string messagingServiceSid           = null,
                                                                                           ConversationResource.StateEnum state = null,
                                                                                           string timersInactive                = null,
                                                                                           string timersClosed                  = null,
                                                                                           string uniqueName                    = null,
                                                                                           ConversationResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null,
                                                                                           ITwilioRestClient client = null)
        {
            var options = new UpdateConversationOptions(pathSid)
            {
                FriendlyName = friendlyName, DateCreated = dateCreated, DateUpdated = dateUpdated, Attributes = attributes, MessagingServiceSid = messagingServiceSid, State = state, TimersInactive = timersInactive, TimersClosed = timersClosed, UniqueName = uniqueName, XTwilioWebhookEnabled = xTwilioWebhookEnabled
            };

            return(await UpdateAsync(options, client));
        }
        /// <summary>
        /// update
        /// </summary>
        /// <param name="options"> Update Conversation parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Conversation </returns>
        public static async System.Threading.Tasks.Task <ConversationResource> UpdateAsync(UpdateConversationOptions options,
                                                                                           ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }