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
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Service resource.
-
#alpha_senders ⇒ alpha_senders
Access the alpha_senders.
-
#area_code_geomatch ⇒ Boolean
Whether to enable [Area Code Geomatch](www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance.
-
#channel_senders ⇒ channel_senders
Access the channel_senders.
-
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_updated ⇒ Time
The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#delete ⇒ Boolean
Delete the ServiceInstance.
-
#destination_alpha_senders ⇒ destination_alpha_senders
Access the destination_alpha_senders.
-
#fallback_method ⇒ String
The HTTP method we use to call ‘fallback_url`.
-
#fallback_to_long_code ⇒ Boolean
- OBSOLETE
-
Former feature used to fallback to long code sender after certain short code message failures.
-
#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 the 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 ⇒ Hash
The absolute URLs of related resources.
-
#mms_converter ⇒ Boolean
Whether to enable the [MMS Converter](www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance.
-
#phone_numbers ⇒ phone_numbers
Access the phone_numbers.
- #scan_message_content ⇒ ScanMessageContent
-
#short_codes ⇒ short_codes
Access the short_codes.
-
#sid ⇒ String
The unique string that we created to identify the Service resource.
-
#smart_encoding ⇒ Boolean
Whether to enable [Smart Encoding](www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance.
-
#status_callback ⇒ String
The URL we call to [pass status updates](www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery.
-
#sticky_sender ⇒ Boolean
Whether to enable [Sticky Sender](www.twilio.com/docs/messaging/services#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, usecase: :unset, use_inbound_webhook_on_number: :unset) ⇒ ServiceInstance
Update the ServiceInstance.
-
#url ⇒ String
The absolute URL of the Service resource.
-
#us_app_to_person ⇒ us_app_to_person
Access the us_app_to_person.
-
#us_app_to_person_registered ⇒ Boolean
Whether US A2P campaign is registered for this Service.
-
#us_app_to_person_usecases ⇒ us_app_to_person_usecases
Access the us_app_to_person_usecases.
-
#use_inbound_webhook_on_number ⇒ Boolean
A boolean value that indicates either the webhook url configured on the phone number will be used or ‘inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number.
-
#usecase ⇒ String
A string that describes the scenario in which the Messaging Service will be used.
-
#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
841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 841 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'] == nil ? payload['validity_period'] : payload['validity_period'].to_i, 'url' => payload['url'], 'links' => payload['links'], 'usecase' => payload['usecase'], 'us_app_to_person_registered' => payload['us_app_to_person_registered'], 'use_inbound_webhook_on_number' => payload['use_inbound_webhook_on_number'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Service resource.
896 897 898 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 896 def account_sid @properties['account_sid'] end |
#alpha_senders ⇒ alpha_senders
Access the alpha_senders
1131 1132 1133 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 1131 def alpha_senders context.alpha_senders end |
#area_code_geomatch ⇒ Boolean
Returns Whether to enable [Area Code Geomatch](www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance.
980 981 982 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 980 def area_code_geomatch @properties['area_code_geomatch'] end |
#channel_senders ⇒ channel_senders
Access the channel_senders
1145 1146 1147 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 1145 def channel_senders context.channel_senders 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
881 882 883 884 885 886 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 881 def context unless @instance_context @instance_context = ServiceContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
908 909 910 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 908 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
914 915 916 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 914 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the ServiceInstance
1029 1030 1031 1032 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 1029 def delete context.delete end |
#destination_alpha_senders ⇒ destination_alpha_senders
Access the destination_alpha_senders
1138 1139 1140 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 1138 def destination_alpha_senders context.destination_alpha_senders end |
#fallback_method ⇒ String
Returns The HTTP method we use to call ‘fallback_url`. Can be: `GET` or `POST`.
938 939 940 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 938 def fallback_method @properties['fallback_method'] end |
#fallback_to_long_code ⇒ Boolean
Returns [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures.
974 975 976 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 974 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. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service.
932 933 934 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 932 def fallback_url @properties['fallback_url'] end |
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance
1037 1038 1039 1040 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 1037 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the resource.
902 903 904 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 902 def friendly_name @properties['friendly_name'] end |
#inbound_method ⇒ String
Returns The HTTP method we use to call ‘inbound_request_url`. Can be `GET` or `POST`.
926 927 928 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 926 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. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service.
920 921 922 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 920 def inbound_request_url @properties['inbound_request_url'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
1158 1159 1160 1161 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 1158 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Messaging.V1.ServiceInstance #{values}>" end |
#links ⇒ Hash
Returns The absolute URLs of related resources.
1004 1005 1006 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 1004 def links @properties['links'] end |
#mms_converter ⇒ Boolean
Returns Whether to enable the [MMS Converter](www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance.
956 957 958 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 956 def mms_converter @properties['mms_converter'] end |
#phone_numbers ⇒ phone_numbers
Access the phone_numbers
1124 1125 1126 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 1124 def phone_numbers context.phone_numbers end |
#scan_message_content ⇒ ScanMessageContent
968 969 970 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 968 def @properties['scan_message_content'] end |
#short_codes ⇒ short_codes
Access the short_codes
1110 1111 1112 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 1110 def short_codes context.short_codes end |
#sid ⇒ String
Returns The unique string that we created to identify the Service resource.
890 891 892 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 890 def sid @properties['sid'] end |
#smart_encoding ⇒ Boolean
Returns Whether to enable [Smart Encoding](www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance.
962 963 964 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 962 def smart_encoding @properties['smart_encoding'] end |
#status_callback ⇒ String
Returns The URL we call to [pass status updates](www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery.
944 945 946 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 944 def status_callback @properties['status_callback'] end |
#sticky_sender ⇒ Boolean
Returns Whether to enable [Sticky Sender](www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance.
950 951 952 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 950 def sticky_sender @properties['sticky_sender'] end |
#synchronous_validation ⇒ Boolean
Returns Reserved.
986 987 988 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 986 def synchronous_validation @properties['synchronous_validation'] end |
#to_s ⇒ Object
Provide a user friendly representation
1151 1152 1153 1154 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 1151 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, usecase: :unset, use_inbound_webhook_on_number: :unset) ⇒ ServiceInstance
Update the ServiceInstance
1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 1061 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, usecase: :unset, use_inbound_webhook_on_number: :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, usecase: usecase, use_inbound_webhook_on_number: use_inbound_webhook_on_number, ) end |
#url ⇒ String
Returns The absolute URL of the Service resource.
998 999 1000 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 998 def url @properties['url'] end |
#us_app_to_person ⇒ us_app_to_person
Access the us_app_to_person
1117 1118 1119 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 1117 def us_app_to_person context.us_app_to_person end |
#us_app_to_person_registered ⇒ Boolean
Returns Whether US A2P campaign is registered for this Service.
1016 1017 1018 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 1016 def us_app_to_person_registered @properties['us_app_to_person_registered'] end |
#us_app_to_person_usecases ⇒ us_app_to_person_usecases
Access the us_app_to_person_usecases
1103 1104 1105 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 1103 def us_app_to_person_usecases context.us_app_to_person_usecases end |
#use_inbound_webhook_on_number ⇒ Boolean
Returns A boolean value that indicates either the webhook url configured on the phone number will be used or ‘inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service.
1022 1023 1024 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 1022 def use_inbound_webhook_on_number @properties['use_inbound_webhook_on_number'] end |
#usecase ⇒ String
Returns A string that describes the scenario in which the Messaging Service will be used. Possible values are ‘notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`.
1010 1011 1012 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 1010 def usecase @properties['usecase'] end |
#validity_period ⇒ String
Returns How long, in seconds, messages sent from the Service are valid. Can be an integer from ‘1` to `36,000`. Default value is `36,000`.
992 993 994 |
# File 'lib/twilio-ruby/rest/messaging/v1/service.rb', line 992 def validity_period @properties['validity_period'] end |