class Twilio::REST::IpMessaging::V1::ServiceContext::ChannelInstance

Public Class Methods

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

Initialize the ChannelInstance @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 [ChannelInstance] ChannelInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
311 def initialize(version, payload, service_sid: nil, sid: nil)
312   super(version)
313 
314   # Marshaled Properties
315   @properties = {
316       'sid' => payload['sid'],
317       'account_sid' => payload['account_sid'],
318       'service_sid' => payload['service_sid'],
319       'friendly_name' => payload['friendly_name'],
320       'unique_name' => payload['unique_name'],
321       'attributes' => payload['attributes'],
322       'type' => payload['type'],
323       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
324       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
325       'created_by' => payload['created_by'],
326       'members_count' => payload['members_count'].to_i,
327       'messages_count' => payload['messages_count'].to_i,
328       'url' => payload['url'],
329       'links' => payload['links'],
330   }
331 
332   # Context
333   @instance_context = nil
334   @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], }
335 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The account_sid

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
356 def account_sid
357   @properties['account_sid']
358 end
attributes() click to toggle source

@return [String] The attributes

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
380 def attributes
381   @properties['attributes']
382 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 [ChannelContext] ChannelContext for this ChannelInstance

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
341 def context
342   unless @instance_context
343     @instance_context = ChannelContext.new(@version, @params['service_sid'], @params['sid'], )
344   end
345   @instance_context
346 end
created_by() click to toggle source

@return [String] The created_by

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
404 def created_by
405   @properties['created_by']
406 end
date_created() click to toggle source

@return [Time] The date_created

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
392 def date_created
393   @properties['date_created']
394 end
date_updated() click to toggle source

@return [Time] The date_updated

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
398 def date_updated
399   @properties['date_updated']
400 end
delete() click to toggle source

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

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
442 def delete
443   context.delete
444 end
fetch() click to toggle source

Fetch the ChannelInstance @return [ChannelInstance] Fetched ChannelInstance

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
435 def fetch
436   context.fetch
437 end
friendly_name() click to toggle source

@return [String] The friendly_name

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
368 def friendly_name
369   @properties['friendly_name']
370 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
486 def inspect
487   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
488   "<Twilio.IpMessaging.V1.ChannelInstance #{values}>"
489 end
invites() click to toggle source

Access the invites @return [invites] invites

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
473 def invites
474   context.invites
475 end
members() click to toggle source

Access the members @return [members] members

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
459 def members
460   context.members
461 end
members_count() click to toggle source

@return [String] The members_count

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
410 def members_count
411   @properties['members_count']
412 end
messages() click to toggle source

Access the messages @return [messages] messages

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
466 def messages
467   context.messages
468 end
messages_count() click to toggle source

@return [String] The messages_count

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
416 def messages_count
417   @properties['messages_count']
418 end
service_sid() click to toggle source

@return [String] The service_sid

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
362 def service_sid
363   @properties['service_sid']
364 end
sid() click to toggle source

@return [String] The sid

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
350 def sid
351   @properties['sid']
352 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
479 def to_s
480   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
481   "<Twilio.IpMessaging.V1.ChannelInstance #{values}>"
482 end
type() click to toggle source

@return [channel.ChannelType] The type

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
386 def type
387   @properties['type']
388 end
unique_name() click to toggle source

@return [String] The unique_name

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
374 def unique_name
375   @properties['unique_name']
376 end
update(friendly_name: :unset, unique_name: :unset, attributes: :unset) click to toggle source

Update the ChannelInstance @param [String] friendly_name The friendly_name @param [String] unique_name The unique_name @param [String] attributes The attributes @return [ChannelInstance] Updated ChannelInstance

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
452 def update(friendly_name: :unset, unique_name: :unset, attributes: :unset)
453   context.update(friendly_name: friendly_name, unique_name: unique_name, attributes: attributes, )
454 end
url() click to toggle source

@return [String] The url

    # File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb
422 def url
423   @properties['url']
424 end