Class: Twilio::REST::Messaging::V1::ServiceInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Messaging::V1::ServiceInstance
- Defined in:
- lib/twilio-ruby/rest/messaging/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.
-
#alpha_senders ⇒ alpha_senders
Access the alpha_senders.
-
#area_code_geomatch ⇒ Boolean
Whether to enable Area Code Geomatch on the Service Instance.
-
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The ISO 8601 date and time in GMT when the resource was created.
-
#date_updated ⇒ Time
The ISO 8601 date and time in GMT when the resource was last updated.
-
#delete ⇒ Boolean
Deletes the ServiceInstance.
-
#fallback_method ⇒ String
The HTTP method we use to call fallback_url.
-
#fallback_to_long_code ⇒ Boolean
Whether to enable Fallback to Long Code for messages sent through the Service instance.
-
#fallback_url ⇒ String
The URL that we call using fallback_method if an error occurs while retrieving or executing the TwiML from the Inbound Request URL.
-
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the resource.
-
#inbound_method ⇒ String
The HTTP method we use to call inbound_request_url.
-
#inbound_request_url ⇒ String
The URL we call using inbound_method when a message is received by any phone number or short code in the Service.
-
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
constructor
Initialize the ServiceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The absolute URLs of related resources.
-
#mms_converter ⇒ Boolean
Whether to enable the MMS Converter for messages sent through the Service instance.
-
#phone_numbers ⇒ phone_numbers
Access the phone_numbers.
-
#scan_message_content ⇒ service.ScanMessageContent
Reserved.
-
#short_codes ⇒ short_codes
Access the short_codes.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#smart_encoding ⇒ Boolean
Whether to enable Encoding for messages sent through the Service instance.
-
#status_callback ⇒ String
The URL we call to pass status updates about message delivery.
-
#sticky_sender ⇒ Boolean
Whether to enable Sticky Sender on the Service instance.
-
#synchronous_validation ⇒ Boolean
Reserved.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset) ⇒ ServiceInstance
Update the ServiceInstance.
-
#url ⇒ String
The absolute URL of the Service resource.
-
#validity_period ⇒ String
How long, in seconds, messages sent from the Service are valid.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
Initialize the ServiceInstance
398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 398 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']), 'inbound_request_url' => payload['inbound_request_url'], 'inbound_method' => payload['inbound_method'], 'fallback_url' => payload['fallback_url'], 'fallback_method' => payload['fallback_method'], 'status_callback' => payload['status_callback'], 'sticky_sender' => payload['sticky_sender'], 'mms_converter' => payload['mms_converter'], 'smart_encoding' => payload['smart_encoding'], 'scan_message_content' => payload['scan_message_content'], 'fallback_to_long_code' => payload['fallback_to_long_code'], 'area_code_geomatch' => payload['area_code_geomatch'], 'synchronous_validation' => payload['synchronous_validation'], 'validity_period' => payload['validity_period'].to_i, 'url' => payload['url'], 'links' => payload['links'], } # 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.
449 450 451 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 449 def account_sid @properties['account_sid'] end |
#alpha_senders ⇒ alpha_senders
Access the alpha_senders
648 649 650 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 648 def alpha_senders context.alpha_senders end |
#area_code_geomatch ⇒ Boolean
Returns Whether to enable Area Code Geomatch on the Service Instance.
533 534 535 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 533 def area_code_geomatch @properties['area_code_geomatch'] 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
434 435 436 437 438 439 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 434 def context unless @instance_context @instance_context = ServiceContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was created.
461 462 463 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 461 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was last updated.
467 468 469 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 467 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the ServiceInstance
627 628 629 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 627 def delete context.delete end |
#fallback_method ⇒ String
Returns The HTTP method we use to call fallback_url.
491 492 493 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 491 def fallback_method @properties['fallback_method'] end |
#fallback_to_long_code ⇒ Boolean
Returns Whether to enable Fallback to Long Code for messages sent through the Service instance.
527 528 529 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 527 def fallback_to_long_code @properties['fallback_to_long_code'] end |
#fallback_url ⇒ String
Returns The URL that we call using fallback_method if an error occurs while retrieving or executing the TwiML from the Inbound Request URL.
485 486 487 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 485 def fallback_url @properties['fallback_url'] end |
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance
620 621 622 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 620 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the resource.
455 456 457 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 455 def friendly_name @properties['friendly_name'] end |
#inbound_method ⇒ String
Returns The HTTP method we use to call inbound_request_url.
479 480 481 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 479 def inbound_method @properties['inbound_method'] end |
#inbound_request_url ⇒ String
Returns The URL we call using inbound_method when a message is received by any phone number or short code in the Service.
473 474 475 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 473 def inbound_request_url @properties['inbound_request_url'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
661 662 663 664 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 661 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Messaging.V1.ServiceInstance #{values}>" end |
#links ⇒ String
Returns The absolute URLs of related resources.
557 558 559 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 557 def links @properties['links'] end |
#mms_converter ⇒ Boolean
Returns Whether to enable the MMS Converter for messages sent through the Service instance.
509 510 511 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 509 def mms_converter @properties['mms_converter'] end |
#phone_numbers ⇒ phone_numbers
Access the phone_numbers
634 635 636 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 634 def phone_numbers context.phone_numbers end |
#scan_message_content ⇒ service.ScanMessageContent
Returns Reserved.
521 522 523 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 521 def @properties['scan_message_content'] end |
#short_codes ⇒ short_codes
Access the short_codes
641 642 643 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 641 def short_codes context.short_codes end |
#sid ⇒ String
Returns The unique string that identifies the resource.
443 444 445 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 443 def sid @properties['sid'] end |
#smart_encoding ⇒ Boolean
Returns Whether to enable Encoding for messages sent through the Service instance.
515 516 517 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 515 def smart_encoding @properties['smart_encoding'] end |
#status_callback ⇒ String
Returns The URL we call to pass status updates about message delivery.
497 498 499 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 497 def status_callback @properties['status_callback'] end |
#sticky_sender ⇒ Boolean
Returns Whether to enable Sticky Sender on the Service instance.
503 504 505 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 503 def sticky_sender @properties['sticky_sender'] end |
#synchronous_validation ⇒ Boolean
Returns Reserved.
539 540 541 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 539 def synchronous_validation @properties['synchronous_validation'] end |
#to_s ⇒ Object
Provide a user friendly representation
654 655 656 657 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 654 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Messaging.V1.ServiceInstance #{values}>" end |
#update(friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset) ⇒ ServiceInstance
Update the ServiceInstance
598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 598 def update(friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset) context.update( friendly_name: friendly_name, inbound_request_url: inbound_request_url, inbound_method: inbound_method, fallback_url: fallback_url, fallback_method: fallback_method, status_callback: status_callback, sticky_sender: sticky_sender, mms_converter: mms_converter, smart_encoding: smart_encoding, scan_message_content: , fallback_to_long_code: fallback_to_long_code, area_code_geomatch: area_code_geomatch, validity_period: validity_period, synchronous_validation: synchronous_validation, ) end |
#url ⇒ String
Returns The absolute URL of the Service resource.
551 552 553 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 551 def url @properties['url'] end |
#validity_period ⇒ String
Returns How long, in seconds, messages sent from the Service are valid.
545 546 547 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 545 def validity_period @properties['validity_period'] end |