lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb in twilio-ruby-5.45.0 vs lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb in twilio-ruby-5.45.1

- old
+ new

@@ -245,22 +245,30 @@ # the participant. # @param [String] messaging_binding_proxy_address The address of the Twilio phone # number that the participant is in contact with. 'null' value will remove it. # @param [String] messaging_binding_projected_address The address of the Twilio # phone number that is used in Group MMS. 'null' value will remove it. + # @param [String] last_read_message_index Index of last “read” message in the + # {Conversation}[https://www.twilio.com/docs/conversations/api/conversation-resource] + # for the Participant. + # @param [String] last_read_timestamp Timestamp of last “read” message in the + # {Conversation}[https://www.twilio.com/docs/conversations/api/conversation-resource] + # for the Participant. # @param [participant.WebhookEnabledType] x_twilio_webhook_enabled The # X-Twilio-Webhook-Enabled HTTP request header # @return [ParticipantInstance] Updated ParticipantInstance - def update(date_created: :unset, date_updated: :unset, identity: :unset, attributes: :unset, role_sid: :unset, messaging_binding_proxy_address: :unset, messaging_binding_projected_address: :unset, x_twilio_webhook_enabled: :unset) + def update(date_created: :unset, date_updated: :unset, identity: :unset, attributes: :unset, role_sid: :unset, messaging_binding_proxy_address: :unset, messaging_binding_projected_address: :unset, last_read_message_index: :unset, last_read_timestamp: :unset, x_twilio_webhook_enabled: :unset) data = Twilio::Values.of({ 'DateCreated' => Twilio.serialize_iso8601_datetime(date_created), 'DateUpdated' => Twilio.serialize_iso8601_datetime(date_updated), 'Identity' => identity, 'Attributes' => attributes, 'RoleSid' => role_sid, 'MessagingBinding.ProxyAddress' => messaging_binding_proxy_address, 'MessagingBinding.ProjectedAddress' => messaging_binding_projected_address, + 'LastReadMessageIndex' => last_read_message_index, + 'LastReadTimestamp' => last_read_timestamp, }) headers = Twilio::Values.of({'X-Twilio-Webhook-Enabled' => x_twilio_webhook_enabled, }) payload = @version.update('POST', @uri, data: data, headers: headers) @@ -342,10 +350,12 @@ 'messaging_binding' => payload['messaging_binding'], 'role_sid' => payload['role_sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], + 'last_read_message_index' => payload['last_read_message_index'] == nil ? payload['last_read_message_index'] : payload['last_read_message_index'].to_i, + 'last_read_timestamp' => payload['last_read_timestamp'], } # Context @instance_context = nil @params = { @@ -436,10 +446,22 @@ def url @properties['url'] end ## + # @return [String] Index of last “read” message in the Conversation for the Participant. + def last_read_message_index + @properties['last_read_message_index'] + end + + ## + # @return [String] Timestamp of last “read” message in the Conversation for the Participant. + def last_read_timestamp + @properties['last_read_timestamp'] + end + + ## # Update the ParticipantInstance # @param [Time] date_created The date that this resource was created. # @param [Time] date_updated The date that this resource was last updated. # @param [String] identity A unique string identifier for the conversation # participant as {Conversation @@ -455,21 +477,29 @@ # the participant. # @param [String] messaging_binding_proxy_address The address of the Twilio phone # number that the participant is in contact with. 'null' value will remove it. # @param [String] messaging_binding_projected_address The address of the Twilio # phone number that is used in Group MMS. 'null' value will remove it. + # @param [String] last_read_message_index Index of last “read” message in the + # {Conversation}[https://www.twilio.com/docs/conversations/api/conversation-resource] + # for the Participant. + # @param [String] last_read_timestamp Timestamp of last “read” message in the + # {Conversation}[https://www.twilio.com/docs/conversations/api/conversation-resource] + # for the Participant. # @param [participant.WebhookEnabledType] x_twilio_webhook_enabled The # X-Twilio-Webhook-Enabled HTTP request header # @return [ParticipantInstance] Updated ParticipantInstance - def update(date_created: :unset, date_updated: :unset, identity: :unset, attributes: :unset, role_sid: :unset, messaging_binding_proxy_address: :unset, messaging_binding_projected_address: :unset, x_twilio_webhook_enabled: :unset) + def update(date_created: :unset, date_updated: :unset, identity: :unset, attributes: :unset, role_sid: :unset, messaging_binding_proxy_address: :unset, messaging_binding_projected_address: :unset, last_read_message_index: :unset, last_read_timestamp: :unset, x_twilio_webhook_enabled: :unset) context.update( date_created: date_created, date_updated: date_updated, identity: identity, attributes: attributes, role_sid: role_sid, messaging_binding_proxy_address: messaging_binding_proxy_address, messaging_binding_projected_address: messaging_binding_projected_address, + last_read_message_index: last_read_message_index, + last_read_timestamp: last_read_timestamp, x_twilio_webhook_enabled: x_twilio_webhook_enabled, ) end ## \ No newline at end of file