/// <summary> /// Update an existing participant in the conversation /// </summary> /// <param name="options"> Update Participant parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Participant </returns> public static ParticipantResource Update(UpdateParticipantOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildUpdateRequest(UpdateParticipantOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Conversations, "/v1/Services/" + options.PathChatServiceSid + "/Conversations/" + options.PathConversationSid + "/Participants/" + options.PathSid + "", postParams: options.GetParams(), headerParams: options.GetHeaderParams() )); }
/// <summary> /// Update an existing participant 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 participant. </param> /// <param name="pathSid"> A 34 character string that uniquely identifies this resource. </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="identity"> A unique string identifier for the conversation participant as Conversation User. </param> /// <param name="attributes"> An optional string metadata field you can use to store any data you wish. </param> /// <param name="roleSid"> The SID of a conversation-level Role to assign to the participant </param> /// <param name="messagingBindingProxyAddress"> The address of the Twilio phone number that the participant is in /// contact with. </param> /// <param name="messagingBindingProjectedAddress"> The address of the Twilio phone number that is used in Group MMS. /// </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 Participant </returns> public static async System.Threading.Tasks.Task <ParticipantResource> UpdateAsync(string pathChatServiceSid, string pathConversationSid, string pathSid, DateTime?dateCreated = null, DateTime?dateUpdated = null, string identity = null, string attributes = null, string roleSid = null, string messagingBindingProxyAddress = null, string messagingBindingProjectedAddress = null, ParticipantResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) { var options = new UpdateParticipantOptions(pathChatServiceSid, pathConversationSid, pathSid) { DateCreated = dateCreated, DateUpdated = dateUpdated, Identity = identity, Attributes = attributes, RoleSid = roleSid, MessagingBindingProxyAddress = messagingBindingProxyAddress, MessagingBindingProjectedAddress = messagingBindingProjectedAddress, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return(await UpdateAsync(options, client)); }
/// <summary> /// Update an existing participant 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 participant. </param> /// <param name="pathSid"> A 34 character string that uniquely identifies this resource. </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="identity"> A unique string identifier for the conversation participant as Conversation User. </param> /// <param name="attributes"> An optional string metadata field you can use to store any data you wish. </param> /// <param name="roleSid"> The SID of a conversation-level Role to assign to the participant </param> /// <param name="messagingBindingProxyAddress"> The address of the Twilio phone number that the participant is in /// contact with. </param> /// <param name="messagingBindingProjectedAddress"> The address of the Twilio phone number that is used in Group MMS. /// </param> /// <param name="lastReadMessageIndex"> Index of last “read” message in the Conversation for the Participant. </param> /// <param name="lastReadTimestamp"> Timestamp of last “read” message in the Conversation for the Participant. </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 Participant </returns> public static ParticipantResource Update(string pathChatServiceSid, string pathConversationSid, string pathSid, DateTime?dateCreated = null, DateTime?dateUpdated = null, string identity = null, string attributes = null, string roleSid = null, string messagingBindingProxyAddress = null, string messagingBindingProjectedAddress = null, int?lastReadMessageIndex = null, string lastReadTimestamp = null, ParticipantResource.WebhookEnabledTypeEnum xTwilioWebhookEnabled = null, ITwilioRestClient client = null) { var options = new UpdateParticipantOptions(pathChatServiceSid, pathConversationSid, pathSid) { DateCreated = dateCreated, DateUpdated = dateUpdated, Identity = identity, Attributes = attributes, RoleSid = roleSid, MessagingBindingProxyAddress = messagingBindingProxyAddress, MessagingBindingProjectedAddress = messagingBindingProjectedAddress, LastReadMessageIndex = lastReadMessageIndex, LastReadTimestamp = lastReadTimestamp, XTwilioWebhookEnabled = xTwilioWebhookEnabled }; return(Update(options, client)); }
/// <summary> /// Update an existing participant in the conversation /// </summary> /// <param name="options"> Update Participant parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Participant </returns> public static async System.Threading.Tasks.Task <ParticipantResource> UpdateAsync(UpdateParticipantOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }