class Twilio::REST::IpMessaging::V2::ServiceContext::ChannelInstance
Public Class Methods
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
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
@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
@return [String] The attributes
# File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb 425 def attributes 426 @properties['attributes'] 427 end
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
@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
@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
@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 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 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
@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
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
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
@return [String] The links
# File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb 473 def links 474 @properties['links'] 475 end
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
@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
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
@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
@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
@return [String] The sid
# File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb 395 def sid 396 @properties['sid'] 397 end
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
@return [channel.ChannelType] The type
# File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb 431 def type 432 @properties['type'] 433 end
@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 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
@return [String] The url
# File lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb 467 def url 468 @properties['url'] 469 end
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