Class: Twilio::REST::Notify::V1::ServiceInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Notify::V1::ServiceInstance
- Defined in:
- lib/twilio-ruby/rest/notify/v1/service.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that created the resource.
-
#alexa_skill_id ⇒ String
Deprecated.
-
#apn_credential_sid ⇒ String
The SID of the Credential to use for APN Bindings.
-
#bindings ⇒ bindings
Access the bindings.
-
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The RFC 2822 date and time in GMT when the resource was created.
-
#date_updated ⇒ Time
The RFC 2822 date and time in GMT when the resource was last updated.
-
#default_alexa_notification_protocol_version ⇒ String
Deprecated.
-
#default_apn_notification_protocol_version ⇒ String
The protocol version to use for sending APNS notifications.
-
#default_fcm_notification_protocol_version ⇒ String
The protocol version to use for sending FCM notifications.
-
#default_gcm_notification_protocol_version ⇒ String
The protocol version to use for sending GCM notifications.
-
#delete ⇒ Boolean
Deletes the ServiceInstance.
-
#delivery_callback_enabled ⇒ Boolean
Enable delivery callbacks.
-
#delivery_callback_url ⇒ String
Webhook URL.
-
#facebook_messenger_page_id ⇒ String
Deprecated.
-
#fcm_credential_sid ⇒ String
The SID of the Credential to use for FCM Bindings.
-
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the resource.
-
#gcm_credential_sid ⇒ String
The SID of the Credential to use for GCM Bindings.
-
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
constructor
Initialize the ServiceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The URLs of the resources related to the service.
-
#log_enabled ⇒ Boolean
Whether to log notifications.
-
#messaging_service_sid ⇒ String
The SID of the Messaging Service to use for SMS Bindings.
-
#notifications ⇒ notifications
Access the notifications.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset, alexa_skill_id: :unset, default_alexa_notification_protocol_version: :unset, delivery_callback_url: :unset, delivery_callback_enabled: :unset) ⇒ ServiceInstance
Update the ServiceInstance.
-
#url ⇒ String
The absolute URL of the Service resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
Initialize the ServiceInstance
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 384 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'friendly_name' => payload['friendly_name'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'apn_credential_sid' => payload['apn_credential_sid'], 'gcm_credential_sid' => payload['gcm_credential_sid'], 'fcm_credential_sid' => payload['fcm_credential_sid'], 'messaging_service_sid' => payload['messaging_service_sid'], 'facebook_messenger_page_id' => payload['facebook_messenger_page_id'], 'default_apn_notification_protocol_version' => payload['default_apn_notification_protocol_version'], 'default_gcm_notification_protocol_version' => payload['default_gcm_notification_protocol_version'], 'default_fcm_notification_protocol_version' => payload['default_fcm_notification_protocol_version'], 'log_enabled' => payload['log_enabled'], 'url' => payload['url'], 'links' => payload['links'], 'alexa_skill_id' => payload['alexa_skill_id'], 'default_alexa_notification_protocol_version' => payload['default_alexa_notification_protocol_version'], 'delivery_callback_url' => payload['delivery_callback_url'], 'delivery_callback_enabled' => payload['delivery_callback_enabled'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the Account that created the resource.
435 436 437 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 435 def account_sid @properties['account_sid'] end |
#alexa_skill_id ⇒ String
Returns Deprecated.
525 526 527 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 525 def alexa_skill_id @properties['alexa_skill_id'] end |
#apn_credential_sid ⇒ String
Returns The SID of the Credential to use for APN Bindings.
459 460 461 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 459 def apn_credential_sid @properties['apn_credential_sid'] end |
#bindings ⇒ bindings
Access the bindings
621 622 623 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 621 def bindings context.bindings end |
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
420 421 422 423 424 425 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 420 def context unless @instance_context @instance_context = ServiceContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The RFC 2822 date and time in GMT when the resource was created.
447 448 449 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 447 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The RFC 2822 date and time in GMT when the resource was last updated.
453 454 455 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 453 def date_updated @properties['date_updated'] end |
#default_alexa_notification_protocol_version ⇒ String
Returns Deprecated.
531 532 533 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 531 def default_alexa_notification_protocol_version @properties['default_alexa_notification_protocol_version'] end |
#default_apn_notification_protocol_version ⇒ String
Returns The protocol version to use for sending APNS notifications.
489 490 491 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 489 def default_apn_notification_protocol_version @properties['default_apn_notification_protocol_version'] end |
#default_fcm_notification_protocol_version ⇒ String
Returns The protocol version to use for sending FCM notifications.
501 502 503 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 501 def default_fcm_notification_protocol_version @properties['default_fcm_notification_protocol_version'] end |
#default_gcm_notification_protocol_version ⇒ String
Returns The protocol version to use for sending GCM notifications.
495 496 497 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 495 def default_gcm_notification_protocol_version @properties['default_gcm_notification_protocol_version'] end |
#delete ⇒ Boolean
Deletes the ServiceInstance
550 551 552 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 550 def delete context.delete end |
#delivery_callback_enabled ⇒ Boolean
Returns Enable delivery callbacks.
543 544 545 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 543 def delivery_callback_enabled @properties['delivery_callback_enabled'] end |
#delivery_callback_url ⇒ String
Returns Webhook URL.
537 538 539 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 537 def delivery_callback_url @properties['delivery_callback_url'] end |
#facebook_messenger_page_id ⇒ String
Returns Deprecated.
483 484 485 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 483 def facebook_messenger_page_id @properties['facebook_messenger_page_id'] end |
#fcm_credential_sid ⇒ String
Returns The SID of the Credential to use for FCM Bindings.
471 472 473 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 471 def fcm_credential_sid @properties['fcm_credential_sid'] end |
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance
557 558 559 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 557 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the resource.
441 442 443 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 441 def friendly_name @properties['friendly_name'] end |
#gcm_credential_sid ⇒ String
Returns The SID of the Credential to use for GCM Bindings.
465 466 467 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 465 def gcm_credential_sid @properties['gcm_credential_sid'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
641 642 643 644 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 641 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Notify.V1.ServiceInstance #{values}>" end |
#links ⇒ String
Returns The URLs of the resources related to the service.
519 520 521 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 519 def links @properties['links'] end |
#log_enabled ⇒ Boolean
Returns Whether to log notifications.
507 508 509 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 507 def log_enabled @properties['log_enabled'] end |
#messaging_service_sid ⇒ String
Returns The SID of the Messaging Service to use for SMS Bindings.
477 478 479 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 477 def messaging_service_sid @properties['messaging_service_sid'] end |
#notifications ⇒ notifications
Access the notifications
628 629 630 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 628 def notifications context.notifications end |
#sid ⇒ String
Returns The unique string that identifies the resource.
429 430 431 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 429 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
634 635 636 637 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 634 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Notify.V1.ServiceInstance #{values}>" end |
#update(friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset, alexa_skill_id: :unset, default_alexa_notification_protocol_version: :unset, delivery_callback_url: :unset, delivery_callback_enabled: :unset) ⇒ ServiceInstance
Update the ServiceInstance
599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 599 def update(friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset, alexa_skill_id: :unset, default_alexa_notification_protocol_version: :unset, delivery_callback_url: :unset, delivery_callback_enabled: :unset) context.update( friendly_name: friendly_name, apn_credential_sid: apn_credential_sid, gcm_credential_sid: gcm_credential_sid, messaging_service_sid: messaging_service_sid, facebook_messenger_page_id: facebook_messenger_page_id, default_apn_notification_protocol_version: default_apn_notification_protocol_version, default_gcm_notification_protocol_version: default_gcm_notification_protocol_version, fcm_credential_sid: fcm_credential_sid, default_fcm_notification_protocol_version: default_fcm_notification_protocol_version, log_enabled: log_enabled, alexa_skill_id: alexa_skill_id, default_alexa_notification_protocol_version: default_alexa_notification_protocol_version, delivery_callback_url: delivery_callback_url, delivery_callback_enabled: delivery_callback_enabled, ) end |
#url ⇒ String
Returns The absolute URL of the Service resource.
513 514 515 |
# File 'lib/twilio-ruby/rest/notify/v1/service.rb', line 513 def url @properties['url'] end |