Class: Twilio::REST::Messaging::V2::ChannelsSenderInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Messaging::V2::ChannelsSenderInstance
- Defined in:
- lib/twilio-ruby/rest/messaging/v2/channels_sender.rb
Instance Method Summary collapse
- #configuration ⇒ MessagingV2ChannelsSenderConfiguration
-
#context ⇒ ChannelsSenderContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#delete ⇒ Boolean
Delete the ChannelsSenderInstance.
-
#fetch ⇒ ChannelsSenderInstance
Fetch the ChannelsSenderInstance.
-
#initialize(version, payload, sid: nil) ⇒ ChannelsSenderInstance
constructor
Initialize the ChannelsSenderInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#offline_reasons ⇒ Array<MessagingV2ChannelsSenderOfflineReasonsItems>
Reasons why the sender is offline., e.g., ["21211400", "message": "Whatsapp business account is banned by provider {provider_name | Credit line is assigned to another BSP", "more_info": "www.twilio.com/docs/errors/21211400"}].
- #profile ⇒ MessagingV2ChannelsSenderProfile
- #properties ⇒ MessagingV2ChannelsSenderProperties
-
#sender_id ⇒ String
The ID of this Sender prefixed with the channel, e.g., ‘whatsapp:E.164`.
-
#sid ⇒ String
A 34 character string that uniquely identifies this Sender.
- #status ⇒ Status
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(messaging_v2_channels_sender_requests_update: :unset) ⇒ ChannelsSenderInstance
Update the ChannelsSenderInstance.
-
#url ⇒ String
The URL of this resource, relative to ‘messaging.twilio.com`.
- #webhook ⇒ MessagingV2ChannelsSenderWebhook
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ChannelsSenderInstance
Initialize the ChannelsSenderInstance
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 361 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'status' => payload['status'], 'sender_id' => payload['sender_id'], 'configuration' => payload['configuration'], 'webhook' => payload['webhook'], 'profile' => payload['profile'], 'properties' => payload['properties'], 'offline_reasons' => payload['offline_reasons'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#configuration ⇒ MessagingV2ChannelsSenderConfiguration
413 414 415 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 413 def configuration @properties['configuration'] end |
#context ⇒ ChannelsSenderContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
386 387 388 389 390 391 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 386 def context unless @instance_context @instance_context = ChannelsSenderContext.new(@version , @params['sid']) end @instance_context end |
#delete ⇒ Boolean
Delete the ChannelsSenderInstance
450 451 452 453 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 450 def delete context.delete end |
#fetch ⇒ ChannelsSenderInstance
Fetch the ChannelsSenderInstance
458 459 460 461 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 458 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
483 484 485 486 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 483 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Messaging.V2.ChannelsSenderInstance #{values}>" end |
#offline_reasons ⇒ Array<MessagingV2ChannelsSenderOfflineReasonsItems>
Returns Reasons why the sender is offline., e.g., ["21211400", "message": "Whatsapp business account is banned by provider {provider_name | Credit line is assigned to another BSP", "more_info": "www.twilio.com/docs/errors/21211400"}].
437 438 439 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 437 def offline_reasons @properties['offline_reasons'] end |
#profile ⇒ MessagingV2ChannelsSenderProfile
425 426 427 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 425 def profile @properties['profile'] end |
#properties ⇒ MessagingV2ChannelsSenderProperties
431 432 433 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 431 def properties @properties['properties'] end |
#sender_id ⇒ String
Returns The ID of this Sender prefixed with the channel, e.g., ‘whatsapp:E.164`.
407 408 409 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 407 def sender_id @properties['sender_id'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this Sender.
395 396 397 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 395 def sid @properties['sid'] end |
#status ⇒ Status
401 402 403 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 401 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
476 477 478 479 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 476 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Messaging.V2.ChannelsSenderInstance #{values}>" end |
#update(messaging_v2_channels_sender_requests_update: :unset) ⇒ ChannelsSenderInstance
Update the ChannelsSenderInstance
467 468 469 470 471 472 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 467 def update(messaging_v2_channels_sender_requests_update: :unset ) context.update( ) end |
#url ⇒ String
Returns The URL of this resource, relative to ‘messaging.twilio.com`.
443 444 445 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 443 def url @properties['url'] end |
#webhook ⇒ MessagingV2ChannelsSenderWebhook
419 420 421 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 419 def webhook @properties['webhook'] end |