class Twilio::REST::IpMessaging::V1::ServiceContext::UserInstance

Public Class Methods

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

Initialize the UserInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] service_sid The service_sid @param [String] sid The sid @return [UserInstance] UserInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
255 def initialize(version, payload, service_sid: nil, sid: nil)
256   super(version)
257 
258   # Marshaled Properties
259   @properties = {
260       'sid' => payload['sid'],
261       'account_sid' => payload['account_sid'],
262       'service_sid' => payload['service_sid'],
263       'attributes' => payload['attributes'],
264       'friendly_name' => payload['friendly_name'],
265       'role_sid' => payload['role_sid'],
266       'identity' => payload['identity'],
267       'is_online' => payload['is_online'],
268       'is_notifiable' => payload['is_notifiable'],
269       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
270       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
271       'joined_channels_count' => payload['joined_channels_count'].to_i,
272       'links' => payload['links'],
273       'url' => payload['url'],
274   }
275 
276   # Context
277   @instance_context = nil
278   @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], }
279 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The account_sid

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
300 def account_sid
301   @properties['account_sid']
302 end
attributes() click to toggle source

@return [String] The attributes

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
312 def attributes
313   @properties['attributes']
314 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [UserContext] UserContext for this UserInstance

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
285 def context
286   unless @instance_context
287     @instance_context = UserContext.new(@version, @params['service_sid'], @params['sid'], )
288   end
289   @instance_context
290 end
date_created() click to toggle source

@return [Time] The date_created

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
348 def date_created
349   @properties['date_created']
350 end
date_updated() click to toggle source

@return [Time] The date_updated

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
354 def date_updated
355   @properties['date_updated']
356 end
delete() click to toggle source

Delete the UserInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
386 def delete
387   context.delete
388 end
fetch() click to toggle source

Fetch the UserInstance @return [UserInstance] Fetched UserInstance

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
379 def fetch
380   context.fetch
381 end
friendly_name() click to toggle source

@return [String] The friendly_name

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
318 def friendly_name
319   @properties['friendly_name']
320 end
identity() click to toggle source

@return [String] The identity

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
330 def identity
331   @properties['identity']
332 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
416 def inspect
417   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
418   "<Twilio.IpMessaging.V1.UserInstance #{values}>"
419 end
is_notifiable() click to toggle source

@return [Boolean] The is_notifiable

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
342 def is_notifiable
343   @properties['is_notifiable']
344 end
is_online() click to toggle source

@return [Boolean] The is_online

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
336 def is_online
337   @properties['is_online']
338 end
joined_channels_count() click to toggle source

@return [String] The joined_channels_count

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
360 def joined_channels_count
361   @properties['joined_channels_count']
362 end
role_sid() click to toggle source

@return [String] The role_sid

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
324 def role_sid
325   @properties['role_sid']
326 end
service_sid() click to toggle source

@return [String] The service_sid

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
306 def service_sid
307   @properties['service_sid']
308 end
sid() click to toggle source

@return [String] The sid

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
294 def sid
295   @properties['sid']
296 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
409 def to_s
410   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
411   "<Twilio.IpMessaging.V1.UserInstance #{values}>"
412 end
update(role_sid: :unset, attributes: :unset, friendly_name: :unset) click to toggle source

Update the UserInstance @param [String] role_sid The role_sid @param [String] attributes The attributes @param [String] friendly_name The friendly_name @return [UserInstance] Updated UserInstance

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
396 def update(role_sid: :unset, attributes: :unset, friendly_name: :unset)
397   context.update(role_sid: role_sid, attributes: attributes, friendly_name: friendly_name, )
398 end
url() click to toggle source

@return [String] The url

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
372 def url
373   @properties['url']
374 end
user_channels() click to toggle source

Access the user_channels @return [user_channels] user_channels

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb
403 def user_channels
404   context.user_channels
405 end