class Twilio::REST::Chat::V1::ServiceContext::UserContext::UserChannelInstance

Public Class Methods

new(version, payload, service_sid: nil, user_sid: nil) click to toggle source

Initialize the UserChannelInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] service_sid The SID of the

{Service}[https://www.twilio.com/docs/api/chat/rest/services] the resource is
associated with.

@param [String] user_sid The unique string that we created to identify the User

resource.

@return [UserChannelInstance] UserChannelInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb
165 def initialize(version, payload, service_sid: nil, user_sid: nil)
166   super(version)
167 
168   # Marshaled Properties
169   @properties = {
170       'account_sid' => payload['account_sid'],
171       'service_sid' => payload['service_sid'],
172       'channel_sid' => payload['channel_sid'],
173       'member_sid' => payload['member_sid'],
174       'status' => payload['status'],
175       'last_consumed_message_index' => payload['last_consumed_message_index'] == nil ? payload['last_consumed_message_index'] : payload['last_consumed_message_index'].to_i,
176       'unread_messages_count' => payload['unread_messages_count'] == nil ? payload['unread_messages_count'] : payload['unread_messages_count'].to_i,
177       'links' => payload['links'],
178   }
179 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb
183 def account_sid
184   @properties['account_sid']
185 end
channel_sid() click to toggle source

@return [String] The SID of the Channel the resource belongs to

    # File lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb
195 def channel_sid
196   @properties['channel_sid']
197 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb
237 def inspect
238   "<Twilio.Chat.V1.UserChannelInstance>"
239 end
last_consumed_message_index() click to toggle source

@return [String] The index of the last Message in the Channel the Member has read

    # File lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb
213 def last_consumed_message_index
214   @properties['last_consumed_message_index']
215 end
member_sid() click to toggle source

@return [String] The SID of the User as a Member in the Channel

    # File lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb
201 def member_sid
202   @properties['member_sid']
203 end
service_sid() click to toggle source

@return [String] The SID of the Service that the resource is associated with

    # File lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb
189 def service_sid
190   @properties['service_sid']
191 end
status() click to toggle source

@return [user_channel.ChannelStatus] The status of the User on the Channel

    # File lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb
207 def status
208   @properties['status']
209 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb
231 def to_s
232   "<Twilio.Chat.V1.UserChannelInstance>"
233 end
unread_messages_count() click to toggle source

@return [String] The number of unread Messages in the Channel for the User

    # File lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb
219 def unread_messages_count
220   @properties['unread_messages_count']
221 end