Class: Twilio::REST::Chat::V1::ServiceContext::UserContext::UserChannelInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Chat::V1::ServiceContext::UserContext::UserChannelInstance
- Defined in:
- lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/api/rest/account) that created the User Channel resource.
-
#channel_sid ⇒ String
The SID of the [Channel](www.twilio.com/docs/api/chat/rest/channels) the resource belongs to.
-
#initialize(version, payload, service_sid: nil, user_sid: nil) ⇒ UserChannelInstance
constructor
Initialize the UserChannelInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#last_consumed_message_index ⇒ String
The index of the last [Message](www.twilio.com/docs/api/chat/rest/messages) in the [Channel](www.twilio.com/docs/api/chat/rest/channels) that the Member has read.
-
#links ⇒ Hash
The absolute URLs of the [Members](www.twilio.com/docs/chat/api/members), [Messages](www.twilio.com/docs/chat/api/messages) , [Invites](www.twilio.com/docs/chat/api/invites) and, if it exists, the last [Message](www.twilio.com/docs/chat/api/messages) for the Channel.
-
#member_sid ⇒ String
The SID of a [Member](www.twilio.com/docs/api/chat/rest/members) that represents the User on the Channel.
-
#service_sid ⇒ String
The SID of the [Service](www.twilio.com/docs/api/chat/rest/services) the resource is associated with.
- #status ⇒ ChannelStatus
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#unread_messages_count ⇒ String
The number of unread Messages in the Channel for the User.
Constructor Details
#initialize(version, payload, service_sid: nil, user_sid: nil) ⇒ UserChannelInstance
Initialize the UserChannelInstance
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb', line 170 def initialize(version, payload , service_sid: nil, user_sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], 'channel_sid' => payload['channel_sid'], 'member_sid' => payload['member_sid'], 'status' => payload['status'], 'last_consumed_message_index' => payload['last_consumed_message_index'] == nil ? payload['last_consumed_message_index'] : payload['last_consumed_message_index'].to_i, 'unread_messages_count' => payload['unread_messages_count'] == nil ? payload['unread_messages_count'] : payload['unread_messages_count'].to_i, 'links' => payload['links'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/api/rest/account) that created the User Channel resource.
189 190 191 |
# File 'lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb', line 189 def account_sid @properties['account_sid'] end |
#channel_sid ⇒ String
Returns The SID of the [Channel](www.twilio.com/docs/api/chat/rest/channels) the resource belongs to.
201 202 203 |
# File 'lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb', line 201 def channel_sid @properties['channel_sid'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
243 244 245 |
# File 'lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb', line 243 def inspect "<Twilio.Chat.V1.UserChannelInstance>" end |
#last_consumed_message_index ⇒ String
Returns The index of the last [Message](www.twilio.com/docs/api/chat/rest/messages) in the [Channel](www.twilio.com/docs/api/chat/rest/channels) that the Member has read.
219 220 221 |
# File 'lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb', line 219 def @properties['last_consumed_message_index'] end |
#links ⇒ Hash
Returns The absolute URLs of the [Members](www.twilio.com/docs/chat/api/members), [Messages](www.twilio.com/docs/chat/api/messages) , [Invites](www.twilio.com/docs/chat/api/invites) and, if it exists, the last [Message](www.twilio.com/docs/chat/api/messages) for the Channel.
231 232 233 |
# File 'lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb', line 231 def links @properties['links'] end |
#member_sid ⇒ String
Returns The SID of a [Member](www.twilio.com/docs/api/chat/rest/members) that represents the User on the Channel.
207 208 209 |
# File 'lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb', line 207 def member_sid @properties['member_sid'] end |
#service_sid ⇒ String
Returns The SID of the [Service](www.twilio.com/docs/api/chat/rest/services) the resource is associated with.
195 196 197 |
# File 'lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb', line 195 def service_sid @properties['service_sid'] end |
#status ⇒ ChannelStatus
213 214 215 |
# File 'lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb', line 213 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
237 238 239 |
# File 'lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb', line 237 def to_s "<Twilio.Chat.V1.UserChannelInstance>" end |
#unread_messages_count ⇒ String
Returns The number of unread Messages in the Channel for the User. Note that retrieving messages on a client endpoint does not mean that messages are consumed or read. See [Consumption Horizon feature](/docs/api/chat/guides/consumption-horizon) to learn how to mark messages as consumed.
225 226 227 |
# File 'lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb', line 225 def @properties['unread_messages_count'] end |