class Twilio::REST::IpMessaging::V2::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/v2/service/channel.rb
356 def initialize(version, payload, service_sid: nil, sid: nil)
357   super(version)
358 
359   # Marshaled Properties
360   @properties = {
361       'sid' => payload['sid'],
362       'account_sid' => payload['account_sid'],
363       'service_sid' => payload['service_sid'],
364       'friendly_name' => payload['friendly_name'],
365       'unique_name' => payload['unique_name'],
366       'attributes' => payload['attributes'],
367       'type' => payload['type'],
368       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
369       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
370       'created_by' => payload['created_by'],
371       'members_count' => payload['members_count'].to_i,
372       'messages_count' => payload['messages_count'].to_i,
373       'url' => payload['url'],
374       'links' => payload['links'],
375   }
376 
377   # Context
378   @instance_context = nil
379   @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], }
380 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The account_sid

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
401 def account_sid
402   @properties['account_sid']
403 end
attributes() click to toggle source

@return [String] The attributes

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
425 def attributes
426   @properties['attributes']
427 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/v2/service/channel.rb
386 def context
387   unless @instance_context
388     @instance_context = ChannelContext.new(@version, @params['service_sid'], @params['sid'], )
389   end
390   @instance_context
391 end
created_by() click to toggle source

@return [String] The created_by

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
449 def created_by
450   @properties['created_by']
451 end
date_created() click to toggle source

@return [Time] The date_created

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
437 def date_created
438   @properties['date_created']
439 end
date_updated() click to toggle source

@return [Time] The date_updated

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
443 def date_updated
444   @properties['date_updated']
445 end
delete(x_twilio_webhook_enabled: :unset) click to toggle source

Delete the ChannelInstance @param [channel.WebhookEnabledType] x_twilio_webhook_enabled The

X-Twilio-Webhook-Enabled HTTP request header

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

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
489 def delete(x_twilio_webhook_enabled: :unset)
490   context.delete(x_twilio_webhook_enabled: x_twilio_webhook_enabled, )
491 end
fetch() click to toggle source

Fetch the ChannelInstance @return [ChannelInstance] Fetched ChannelInstance

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
480 def fetch
481   context.fetch
482 end
friendly_name() click to toggle source

@return [String] The friendly_name

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
413 def friendly_name
414   @properties['friendly_name']
415 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
553 def inspect
554   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
555   "<Twilio.IpMessaging.V2.ChannelInstance #{values}>"
556 end
invites() click to toggle source

Access the invites @return [invites] invites

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
533 def invites
534   context.invites
535 end
members() click to toggle source

Access the members @return [members] members

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
519 def members
520   context.members
521 end
members_count() click to toggle source

@return [String] The members_count

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
455 def members_count
456   @properties['members_count']
457 end
messages() click to toggle source

Access the messages @return [messages] messages

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
526 def messages
527   context.messages
528 end
messages_count() click to toggle source

@return [String] The messages_count

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
461 def messages_count
462   @properties['messages_count']
463 end
service_sid() click to toggle source

@return [String] The service_sid

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
407 def service_sid
408   @properties['service_sid']
409 end
sid() click to toggle source

@return [String] The sid

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
395 def sid
396   @properties['sid']
397 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
546 def to_s
547   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
548   "<Twilio.IpMessaging.V2.ChannelInstance #{values}>"
549 end
type() click to toggle source

@return [channel.ChannelType] The type

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
431 def type
432   @properties['type']
433 end
unique_name() click to toggle source

@return [String] The unique_name

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
419 def unique_name
420   @properties['unique_name']
421 end
update(friendly_name: :unset, unique_name: :unset, attributes: :unset, date_created: :unset, date_updated: :unset, created_by: :unset, x_twilio_webhook_enabled: :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 @param [Time] date_created The date_created @param [Time] date_updated The date_updated @param [String] created_by The created_by @param [channel.WebhookEnabledType] x_twilio_webhook_enabled The

X-Twilio-Webhook-Enabled HTTP request header

@return [ChannelInstance] Updated ChannelInstance

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
504 def update(friendly_name: :unset, unique_name: :unset, attributes: :unset, date_created: :unset, date_updated: :unset, created_by: :unset, x_twilio_webhook_enabled: :unset)
505   context.update(
506       friendly_name: friendly_name,
507       unique_name: unique_name,
508       attributes: attributes,
509       date_created: date_created,
510       date_updated: date_updated,
511       created_by: created_by,
512       x_twilio_webhook_enabled: x_twilio_webhook_enabled,
513   )
514 end
url() click to toggle source

@return [String] The url

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
467 def url
468   @properties['url']
469 end
webhooks() click to toggle source

Access the webhooks @return [webhooks] webhooks

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb
540 def webhooks
541   context.webhooks
542 end