class Twilio::REST::IpMessaging::V1::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/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
@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
@return [String] The attributes
# File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb 380 def attributes 381 @properties['attributes'] 382 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/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
@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
@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
@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 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 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
@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
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
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
@return [String] The links
# File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb 428 def links 429 @properties['links'] 430 end
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
@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
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
@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
@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
@return [String] The sid
# File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb 350 def sid 351 @properties['sid'] 352 end
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
@return [channel.ChannelType] The type
# File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb 386 def type 387 @properties['type'] 388 end
@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 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
@return [String] The url
# File lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb 422 def url 423 @properties['url'] 424 end