Class: Twilio::REST::IpMessaging::V1::ServiceContext::UserContext::UserChannelInstance

Inherits:
Twilio::REST::InstanceResource show all
Defined in:
lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, service_sid: nil, user_sid: nil) ⇒ UserChannelInstance

Initialize the UserChannelInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this UserChannel resource.

  • sid (String)

    The SID of the Call resource to fetch.



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/twilio-ruby/rest/ip_messaging/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_sidString

Returns:

  • (String)


189
190
191
# File 'lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb', line 189

def 
    @properties['account_sid']
end

#channel_sidString

Returns:

  • (String)


201
202
203
# File 'lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb', line 201

def channel_sid
    @properties['channel_sid']
end

#inspectObject

Provide a detailed, user friendly representation



243
244
245
# File 'lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb', line 243

def inspect
    "<Twilio.IpMessaging.V1.UserChannelInstance>"
end

#last_consumed_message_indexString

Returns:

  • (String)


219
220
221
# File 'lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb', line 219

def last_consumed_message_index
    @properties['last_consumed_message_index']
end

Returns:

  • (Hash)


231
232
233
# File 'lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb', line 231

def links
    @properties['links']
end

#member_sidString

Returns:

  • (String)


207
208
209
# File 'lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb', line 207

def member_sid
    @properties['member_sid']
end

#service_sidString

Returns:

  • (String)


195
196
197
# File 'lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb', line 195

def service_sid
    @properties['service_sid']
end

#statusChannelStatus

Returns:

  • (ChannelStatus)


213
214
215
# File 'lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb', line 213

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



237
238
239
# File 'lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb', line 237

def to_s
    "<Twilio.IpMessaging.V1.UserChannelInstance>"
end

#unread_messages_countString

Returns:

  • (String)


225
226
227
# File 'lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb', line 225

def unread_messages_count
    @properties['unread_messages_count']
end