twilio-ruby 7.0.1 → 7.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +55 -0
  3. data/Gemfile +1 -0
  4. data/README.md +2 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +6 -6
  6. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +1 -1
  7. data/lib/twilio-ruby/rest/client.rb +0 -5
  8. data/lib/twilio-ruby/rest/content/v2/content.rb +259 -0
  9. data/lib/twilio-ruby/rest/content/v2/content_and_approvals.rb +252 -0
  10. data/lib/twilio-ruby/rest/content/v2.rb +46 -0
  11. data/lib/twilio-ruby/rest/content_base.rb +6 -1
  12. data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +1 -1
  13. data/lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb +8 -1
  14. data/lib/twilio-ruby/rest/flex_api/v2/flex_user.rb +289 -0
  15. data/lib/twilio-ruby/rest/flex_api/v2/web_channels.rb +5 -2
  16. data/lib/twilio-ruby/rest/flex_api/v2.rb +37 -0
  17. data/lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb +444 -0
  18. data/lib/twilio-ruby/rest/intelligence/v2/operator.rb +355 -0
  19. data/lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb +215 -0
  20. data/lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb +196 -0
  21. data/lib/twilio-ruby/rest/intelligence/v2/operator_type.rb +357 -0
  22. data/lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb +355 -0
  23. data/lib/twilio-ruby/rest/intelligence/v2/service.rb +9 -8
  24. data/lib/twilio-ruby/rest/intelligence/v2/transcript.rb +18 -18
  25. data/lib/twilio-ruby/rest/intelligence/v2.rb +112 -0
  26. data/lib/twilio-ruby/rest/messaging/v1/service.rb +0 -7
  27. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +154 -4
  28. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb +292 -0
  29. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration.rb +148 -0
  30. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_delete.rb +167 -0
  31. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_fetch.rb +160 -0
  32. data/lib/twilio-ruby/rest/numbers/v1.rb +63 -20
  33. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +1 -1
  34. data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +2 -2
  35. data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +2 -2
  36. data/lib/twilio-ruby/rest/preview/sync/service.rb +2 -2
  37. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +1 -1
  38. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +2 -2
  39. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +2 -2
  40. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +1 -1
  41. data/lib/twilio-ruby/rest/sync/v1/service.rb +3 -3
  42. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +33 -4
  43. data/lib/twilio-ruby/rest/trusthub/v1/compliance_tollfree_inquiries.rb +4 -1
  44. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb +7 -0
  45. data/lib/twilio-ruby/rest/trusthub/v1/trust_products.rb +7 -0
  46. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +1 -1
  47. data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +1 -1
  48. data/lib/twilio-ruby/rest/verify/v2/service.rb +1 -1
  49. data/lib/twilio-ruby/version.rb +1 -1
  50. metadata +16 -9
  51. data/lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb +0 -230
  52. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_fetch.rb +0 -252
  53. data/lib/twilio-ruby/rest/preview_messaging/v1/broadcast.rb +0 -164
  54. data/lib/twilio-ruby/rest/preview_messaging/v1/message.rb +0 -235
  55. data/lib/twilio-ruby/rest/preview_messaging/v1.rb +0 -46
  56. data/lib/twilio-ruby/rest/preview_messaging.rb +0 -12
  57. data/lib/twilio-ruby/rest/preview_messaging_base.rb +0 -38
@@ -1,252 +0,0 @@
1
- ##
2
- # This code was generated by
3
- # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
- # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
- # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
- #
7
- # Twilio - Numbers
8
- # This is the public Twilio REST API.
9
- #
10
- # NOTE: This class is auto generated by OpenAPI Generator.
11
- # https://openapi-generator.tech
12
- # Do not edit the class manually.
13
- #
14
-
15
-
16
- module Twilio
17
- module REST
18
- class Numbers < NumbersBase
19
- class V1 < Version
20
- class PortingPortInFetchList < ListResource
21
-
22
- ##
23
- # Initialize the PortingPortInFetchList
24
- # @param [Version] version Version that contains the resource
25
- # @return [PortingPortInFetchList] PortingPortInFetchList
26
- def initialize(version)
27
- super(version)
28
- # Path Solution
29
- @solution = { }
30
-
31
-
32
- end
33
-
34
-
35
-
36
- # Provide a user friendly representation
37
- def to_s
38
- '#<Twilio.Numbers.V1.PortingPortInFetchList>'
39
- end
40
- end
41
-
42
-
43
- class PortingPortInFetchContext < InstanceContext
44
- ##
45
- # Initialize the PortingPortInFetchContext
46
- # @param [Version] version Version that contains the resource
47
- # @param [String] port_in_request_sid The SID of the Port In request. This is a unique identifier of the port in request.
48
- # @return [PortingPortInFetchContext] PortingPortInFetchContext
49
- def initialize(version, port_in_request_sid)
50
- super(version)
51
-
52
- # Path Solution
53
- @solution = { port_in_request_sid: port_in_request_sid, }
54
- @uri = "/Porting/PortIn/#{@solution[:port_in_request_sid]}"
55
-
56
-
57
- end
58
- ##
59
- # Fetch the PortingPortInFetchInstance
60
- # @return [PortingPortInFetchInstance] Fetched PortingPortInFetchInstance
61
- def fetch
62
-
63
-
64
- payload = @version.fetch('GET', @uri)
65
- PortingPortInFetchInstance.new(
66
- @version,
67
- payload,
68
- port_in_request_sid: @solution[:port_in_request_sid],
69
- )
70
- end
71
-
72
-
73
- ##
74
- # Provide a user friendly representation
75
- def to_s
76
- context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
77
- "#<Twilio.Numbers.V1.PortingPortInFetchContext #{context}>"
78
- end
79
-
80
- ##
81
- # Provide a detailed, user friendly representation
82
- def inspect
83
- context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
84
- "#<Twilio.Numbers.V1.PortingPortInFetchContext #{context}>"
85
- end
86
- end
87
-
88
- class PortingPortInFetchPage < Page
89
- ##
90
- # Initialize the PortingPortInFetchPage
91
- # @param [Version] version Version that contains the resource
92
- # @param [Response] response Response from the API
93
- # @param [Hash] solution Path solution for the resource
94
- # @return [PortingPortInFetchPage] PortingPortInFetchPage
95
- def initialize(version, response, solution)
96
- super(version, response)
97
-
98
- # Path Solution
99
- @solution = solution
100
- end
101
-
102
- ##
103
- # Build an instance of PortingPortInFetchInstance
104
- # @param [Hash] payload Payload response from the API
105
- # @return [PortingPortInFetchInstance] PortingPortInFetchInstance
106
- def get_instance(payload)
107
- PortingPortInFetchInstance.new(@version, payload)
108
- end
109
-
110
- ##
111
- # Provide a user friendly representation
112
- def to_s
113
- '<Twilio.Numbers.V1.PortingPortInFetchPage>'
114
- end
115
- end
116
- class PortingPortInFetchInstance < InstanceResource
117
- ##
118
- # Initialize the PortingPortInFetchInstance
119
- # @param [Version] version Version that contains the resource
120
- # @param [Hash] payload payload that contains response from Twilio
121
- # @param [String] account_sid The SID of the
122
- # {Account}[https://www.twilio.com/docs/iam/api/account] that created this PortingPortInFetch
123
- # resource.
124
- # @param [String] sid The SID of the Call resource to fetch.
125
- # @return [PortingPortInFetchInstance] PortingPortInFetchInstance
126
- def initialize(version, payload , port_in_request_sid: nil)
127
- super(version)
128
-
129
- # Marshaled Properties
130
- @properties = {
131
- 'port_in_request_sid' => payload['port_in_request_sid'],
132
- 'url' => payload['url'],
133
- 'account_sid' => payload['account_sid'],
134
- 'notification_emails' => payload['notification_emails'],
135
- 'target_port_in_date' => Twilio.deserialize_iso8601_date(payload['target_port_in_date']),
136
- 'target_port_in_time_range_start' => payload['target_port_in_time_range_start'],
137
- 'target_port_in_time_range_end' => payload['target_port_in_time_range_end'],
138
- 'port_in_request_status' => payload['port_in_request_status'],
139
- 'losing_carrier_information' => payload['losing_carrier_information'],
140
- 'phone_numbers' => payload['phone_numbers'],
141
- 'documents' => payload['documents'],
142
- }
143
-
144
- # Context
145
- @instance_context = nil
146
- @params = { 'port_in_request_sid' => port_in_request_sid || @properties['port_in_request_sid'] , }
147
- end
148
-
149
- ##
150
- # Generate an instance context for the instance, the context is capable of
151
- # performing various actions. All instance actions are proxied to the context
152
- # @return [PortingPortInFetchContext] CallContext for this CallInstance
153
- def context
154
- unless @instance_context
155
- @instance_context = PortingPortInFetchContext.new(@version , @params['port_in_request_sid'])
156
- end
157
- @instance_context
158
- end
159
-
160
- ##
161
- # @return [String] The SID of the Port In request. This is a unique identifier of the port in request.
162
- def port_in_request_sid
163
- @properties['port_in_request_sid']
164
- end
165
-
166
- ##
167
- # @return [String] The URL of this Port In request
168
- def url
169
- @properties['url']
170
- end
171
-
172
- ##
173
- # @return [String] The Account SID that the numbers will be added to after they are ported into Twilio.
174
- def account_sid
175
- @properties['account_sid']
176
- end
177
-
178
- ##
179
- # @return [Array<String>] List of emails for getting notifications about the LOA signing process. Allowed Max 10 emails.
180
- def notification_emails
181
- @properties['notification_emails']
182
- end
183
-
184
- ##
185
- # @return [Date] Minimum number of days in the future (at least 2 days) needs to be established with the Ops team for validation.
186
- def target_port_in_date
187
- @properties['target_port_in_date']
188
- end
189
-
190
- ##
191
- # @return [String] Minimum hour in the future needs to be established with the Ops team for validation.
192
- def target_port_in_time_range_start
193
- @properties['target_port_in_time_range_start']
194
- end
195
-
196
- ##
197
- # @return [String] Maximum hour in the future needs to be established with the Ops team for validation.
198
- def target_port_in_time_range_end
199
- @properties['target_port_in_time_range_end']
200
- end
201
-
202
- ##
203
- # @return [String] The status of the port in request. The possible values are: In progress, Completed, Expired, In review, Waiting for Signature, Action Required, and Canceled.
204
- def port_in_request_status
205
- @properties['port_in_request_status']
206
- end
207
-
208
- ##
209
- # @return [Hash] The information for the losing carrier.
210
- def losing_carrier_information
211
- @properties['losing_carrier_information']
212
- end
213
-
214
- ##
215
- # @return [Array<Hash>] The list of phone numbers to Port in. Phone numbers are in E.164 format (e.g. +16175551212).
216
- def phone_numbers
217
- @properties['phone_numbers']
218
- end
219
-
220
- ##
221
- # @return [Array<String>] The list of documents SID referencing a utility bills
222
- def documents
223
- @properties['documents']
224
- end
225
-
226
- ##
227
- # Fetch the PortingPortInFetchInstance
228
- # @return [PortingPortInFetchInstance] Fetched PortingPortInFetchInstance
229
- def fetch
230
-
231
- context.fetch
232
- end
233
-
234
- ##
235
- # Provide a user friendly representation
236
- def to_s
237
- values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
238
- "<Twilio.Numbers.V1.PortingPortInFetchInstance #{values}>"
239
- end
240
-
241
- ##
242
- # Provide a detailed, user friendly representation
243
- def inspect
244
- values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
245
- "<Twilio.Numbers.V1.PortingPortInFetchInstance #{values}>"
246
- end
247
- end
248
-
249
- end
250
- end
251
- end
252
- end
@@ -1,164 +0,0 @@
1
- ##
2
- # This code was generated by
3
- # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
- # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
- # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
- #
7
- # Bulk Messaging and Broadcast
8
- # Bulk Sending is a public Twilio REST API for 1:Many Message creation up to 100 recipients. Broadcast is a public Twilio REST API for 1:Many Message creation up to 10,000 recipients via file upload.
9
- #
10
- # NOTE: This class is auto generated by OpenAPI Generator.
11
- # https://openapi-generator.tech
12
- # Do not edit the class manually.
13
- #
14
-
15
-
16
- module Twilio
17
- module REST
18
- class PreviewMessaging < PreviewMessagingBase
19
- class V1 < Version
20
- class BroadcastList < ListResource
21
-
22
- ##
23
- # Initialize the BroadcastList
24
- # @param [Version] version Version that contains the resource
25
- # @return [BroadcastList] BroadcastList
26
- def initialize(version)
27
- super(version)
28
- # Path Solution
29
- @solution = { }
30
- @uri = "/Broadcasts"
31
-
32
- end
33
- ##
34
- # Create the BroadcastInstance
35
- # @param [String] x_twilio_request_key Idempotency key provided by the client
36
- # @return [BroadcastInstance] Created BroadcastInstance
37
- def create(
38
- x_twilio_request_key: :unset
39
- )
40
-
41
-
42
- headers = Twilio::Values.of({ 'X-Twilio-Request-Key' => x_twilio_request_key, })
43
- payload = @version.create('POST', @uri, headers: headers)
44
- BroadcastInstance.new(
45
- @version,
46
- payload,
47
- )
48
- end
49
-
50
-
51
-
52
-
53
- # Provide a user friendly representation
54
- def to_s
55
- '#<Twilio.PreviewMessaging.V1.BroadcastList>'
56
- end
57
- end
58
-
59
- class BroadcastPage < Page
60
- ##
61
- # Initialize the BroadcastPage
62
- # @param [Version] version Version that contains the resource
63
- # @param [Response] response Response from the API
64
- # @param [Hash] solution Path solution for the resource
65
- # @return [BroadcastPage] BroadcastPage
66
- def initialize(version, response, solution)
67
- super(version, response)
68
-
69
- # Path Solution
70
- @solution = solution
71
- end
72
-
73
- ##
74
- # Build an instance of BroadcastInstance
75
- # @param [Hash] payload Payload response from the API
76
- # @return [BroadcastInstance] BroadcastInstance
77
- def get_instance(payload)
78
- BroadcastInstance.new(@version, payload)
79
- end
80
-
81
- ##
82
- # Provide a user friendly representation
83
- def to_s
84
- '<Twilio.PreviewMessaging.V1.BroadcastPage>'
85
- end
86
- end
87
- class BroadcastInstance < InstanceResource
88
- ##
89
- # Initialize the BroadcastInstance
90
- # @param [Version] version Version that contains the resource
91
- # @param [Hash] payload payload that contains response from Twilio
92
- # @param [String] account_sid The SID of the
93
- # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Broadcast
94
- # resource.
95
- # @param [String] sid The SID of the Call resource to fetch.
96
- # @return [BroadcastInstance] BroadcastInstance
97
- def initialize(version, payload )
98
- super(version)
99
-
100
- # Marshaled Properties
101
- @properties = {
102
- 'broadcast_sid' => payload['broadcast_sid'],
103
- 'created_date' => Twilio.deserialize_iso8601_datetime(payload['created_date']),
104
- 'updated_date' => Twilio.deserialize_iso8601_datetime(payload['updated_date']),
105
- 'broadcast_status' => payload['broadcast_status'],
106
- 'execution_details' => payload['execution_details'],
107
- 'results_file' => payload['results_file'],
108
- }
109
- end
110
-
111
-
112
- ##
113
- # @return [String] Numeric ID indentifying individual Broadcast requests
114
- def broadcast_sid
115
- @properties['broadcast_sid']
116
- end
117
-
118
- ##
119
- # @return [Time] Timestamp of when the Broadcast was created
120
- def created_date
121
- @properties['created_date']
122
- end
123
-
124
- ##
125
- # @return [Time] Timestamp of when the Broadcast was last updated
126
- def updated_date
127
- @properties['updated_date']
128
- end
129
-
130
- ##
131
- # @return [String] Status of the Broadcast request. Valid values are None, Pending-Upload, Uploaded, Queued, Executing, Execution-Failure, Execution-Completed, Cancelation-Requested, and Canceled
132
- def broadcast_status
133
- @properties['broadcast_status']
134
- end
135
-
136
- ##
137
- # @return [MessagingV1BroadcastExecutionDetails]
138
- def execution_details
139
- @properties['execution_details']
140
- end
141
-
142
- ##
143
- # @return [String] Path to a file detailing successful requests and errors from Broadcast execution
144
- def results_file
145
- @properties['results_file']
146
- end
147
-
148
- ##
149
- # Provide a user friendly representation
150
- def to_s
151
- "<Twilio.PreviewMessaging.V1.BroadcastInstance>"
152
- end
153
-
154
- ##
155
- # Provide a detailed, user friendly representation
156
- def inspect
157
- "<Twilio.PreviewMessaging.V1.BroadcastInstance>"
158
- end
159
- end
160
-
161
- end
162
- end
163
- end
164
- end
@@ -1,235 +0,0 @@
1
- ##
2
- # This code was generated by
3
- # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
- # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
- # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
- #
7
- # Bulk Messaging and Broadcast
8
- # Bulk Sending is a public Twilio REST API for 1:Many Message creation up to 100 recipients. Broadcast is a public Twilio REST API for 1:Many Message creation up to 10,000 recipients via file upload.
9
- #
10
- # NOTE: This class is auto generated by OpenAPI Generator.
11
- # https://openapi-generator.tech
12
- # Do not edit the class manually.
13
- #
14
-
15
-
16
- module Twilio
17
- module REST
18
- class PreviewMessaging < PreviewMessagingBase
19
- class V1 < Version
20
- class MessageList < ListResource
21
-
22
- class CreateMessagesRequest
23
- # @param [messages]: [Array<MessageList.MessagingV1Message>]
24
- # @param [from]: [String] A Twilio phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](https://www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](https://www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using `messaging_service_sid`, this parameter must be empty.
25
- # @param [messaging_service_sid]: [String] The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) you have configured and leave the `from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery.
26
- # @param [body]: [String] The text of the message you want to send. Can be up to 1,600 characters in length.
27
- # @param [content_sid]: [String] The SID of the preconfigured [Content Template](https://www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided `ContentVariables`. This Twilio product is currently in Private Beta.
28
- # @param [media_url]: [Array<String>] The URL of the media to send with the message. The media can be of type `gif`, `png`, and `jpeg` and will be formatted correctly on the recipient's device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple `media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada.
29
- # @param [status_callback]: [String] The URL we should call using the \"status_callback_method\" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](https://www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including \"MessageSid\", \"MessageStatus\", and \"ErrorCode\". If you include this parameter with the \"messaging_service_sid\", we use this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed.
30
- # @param [validity_period]: [String] How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.
31
- # @param [send_at]: [String] The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format.
32
- # @param [schedule_type]: [String] This parameter indicates your intent to schedule a message. Pass the value `fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter.
33
- # @param [shorten_urls]: [Boolean] Determines the usage of Click Tracking. Setting it to `true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`.
34
- # @param [send_as_mms]: [Boolean] If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.
35
- # @param [max_price]: [Float] The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked.
36
- # @param [attempt]: [String] Total number of attempts made ( including this ) to send out the message regardless of the provider used
37
- # @param [smart_encoded]: [Boolean] This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false.
38
- # @param [force_delivery]: [Boolean] This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline.
39
- # @param [application_sid]: [String] The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application's message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application's message_status_callback parameter will be used.
40
- attr_accessor :messages, :from, :messaging_service_sid, :body, :content_sid, :media_url, :status_callback, :validity_period, :send_at, :schedule_type, :shorten_urls, :send_as_mms, :max_price, :attempt, :smart_encoded, :force_delivery, :application_sid
41
- def initialize(payload)
42
- @messages = payload["messages"]
43
- @from = payload["from"]
44
- @messaging_service_sid = payload["messaging_service_sid"]
45
- @body = payload["body"]
46
- @content_sid = payload["content_sid"]
47
- @media_url = payload["media_url"]
48
- @status_callback = payload["status_callback"]
49
- @validity_period = payload["validity_period"]
50
- @send_at = payload["send_at"]
51
- @schedule_type = payload["schedule_type"]
52
- @shorten_urls = payload["shorten_urls"]
53
- @send_as_mms = payload["send_as_mms"]
54
- @max_price = payload["max_price"]
55
- @attempt = payload["attempt"]
56
- @smart_encoded = payload["smart_encoded"]
57
- @force_delivery = payload["force_delivery"]
58
- @application_sid = payload["application_sid"]
59
- end
60
- def to_json(options = {})
61
- {
62
- messages: @messages,
63
- from: @from,
64
- messaging_service_sid: @messaging_service_sid,
65
- body: @body,
66
- content_sid: @content_sid,
67
- media_url: @media_url,
68
- status_callback: @status_callback,
69
- validity_period: @validity_period,
70
- send_at: @send_at,
71
- schedule_type: @schedule_type,
72
- shorten_urls: @shorten_urls,
73
- send_as_mms: @send_as_mms,
74
- max_price: @max_price,
75
- attempt: @attempt,
76
- smart_encoded: @smart_encoded,
77
- force_delivery: @force_delivery,
78
- application_sid: @application_sid,
79
- }.to_json(options)
80
- end
81
- end
82
-
83
- class MessagingV1Message
84
- # @param [to]: [String] The destination phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format for SMS/MMS or [Channel user address](https://www.twilio.com/docs/sms/channels#channel-addresses) for other 3rd-party channels.
85
- # @param [body]: [String] The text of the message you want to send. Can be up to 1,600 characters in length. Overrides the request-level body and content template if provided.
86
- # @param [content_variables]: [Hash<String, String>] Key-value pairs of variable names to substitution values. Refer to the [Twilio Content API Resources](https://www.twilio.com/docs/content-api/content-api-resources#send-a-message-with-preconfigured-content) for more details.
87
- attr_accessor :to, :body, :content_variables
88
- def initialize(payload)
89
- @to = payload["to"]
90
- @body = payload["body"]
91
- @content_variables = payload["content_variables"]
92
- end
93
- def to_json(options = {})
94
- {
95
- to: @to,
96
- body: @body,
97
- content_variables: @content_variables,
98
- }.to_json(options)
99
- end
100
- end
101
-
102
- ##
103
- # Initialize the MessageList
104
- # @param [Version] version Version that contains the resource
105
- # @return [MessageList] MessageList
106
- def initialize(version)
107
- super(version)
108
- # Path Solution
109
- @solution = { }
110
- @uri = "/Messages"
111
-
112
- end
113
- ##
114
- # Create the MessageInstance
115
- # @param [CreateMessagesRequest] create_messages_request
116
- # @return [MessageInstance] Created MessageInstance
117
- def create(create_messages_request: nil
118
- )
119
-
120
- headers = Twilio::Values.of({"Content-Type"=> "application/json"})
121
- payload = @version.create('POST', @uri, data: create_messages_request.to_json, headers: headers)
122
- MessageInstance.new(
123
- @version,
124
- payload,
125
- )
126
- end
127
-
128
-
129
-
130
-
131
- # Provide a user friendly representation
132
- def to_s
133
- '#<Twilio.PreviewMessaging.V1.MessageList>'
134
- end
135
- end
136
-
137
- class MessagePage < Page
138
- ##
139
- # Initialize the MessagePage
140
- # @param [Version] version Version that contains the resource
141
- # @param [Response] response Response from the API
142
- # @param [Hash] solution Path solution for the resource
143
- # @return [MessagePage] MessagePage
144
- def initialize(version, response, solution)
145
- super(version, response)
146
-
147
- # Path Solution
148
- @solution = solution
149
- end
150
-
151
- ##
152
- # Build an instance of MessageInstance
153
- # @param [Hash] payload Payload response from the API
154
- # @return [MessageInstance] MessageInstance
155
- def get_instance(payload)
156
- MessageInstance.new(@version, payload)
157
- end
158
-
159
- ##
160
- # Provide a user friendly representation
161
- def to_s
162
- '<Twilio.PreviewMessaging.V1.MessagePage>'
163
- end
164
- end
165
- class MessageInstance < InstanceResource
166
- ##
167
- # Initialize the MessageInstance
168
- # @param [Version] version Version that contains the resource
169
- # @param [Hash] payload payload that contains response from Twilio
170
- # @param [String] account_sid The SID of the
171
- # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Message
172
- # resource.
173
- # @param [String] sid The SID of the Call resource to fetch.
174
- # @return [MessageInstance] MessageInstance
175
- def initialize(version, payload )
176
- super(version)
177
-
178
- # Marshaled Properties
179
- @properties = {
180
- 'total_message_count' => payload['total_message_count'] == nil ? payload['total_message_count'] : payload['total_message_count'].to_i,
181
- 'success_count' => payload['success_count'] == nil ? payload['success_count'] : payload['success_count'].to_i,
182
- 'error_count' => payload['error_count'] == nil ? payload['error_count'] : payload['error_count'].to_i,
183
- 'message_receipts' => payload['message_receipts'],
184
- 'failed_message_receipts' => payload['failed_message_receipts'],
185
- }
186
- end
187
-
188
-
189
- ##
190
- # @return [String] The number of Messages processed in the request, equal to the sum of success_count and error_count.
191
- def total_message_count
192
- @properties['total_message_count']
193
- end
194
-
195
- ##
196
- # @return [String] The number of Messages successfully created.
197
- def success_count
198
- @properties['success_count']
199
- end
200
-
201
- ##
202
- # @return [String] The number of Messages unsuccessfully processed in the request.
203
- def error_count
204
- @properties['error_count']
205
- end
206
-
207
- ##
208
- # @return [Array<MessagingV1MessageReceipt>]
209
- def message_receipts
210
- @properties['message_receipts']
211
- end
212
-
213
- ##
214
- # @return [Array<MessagingV1FailedMessageReceipt>]
215
- def failed_message_receipts
216
- @properties['failed_message_receipts']
217
- end
218
-
219
- ##
220
- # Provide a user friendly representation
221
- def to_s
222
- "<Twilio.PreviewMessaging.V1.MessageInstance>"
223
- end
224
-
225
- ##
226
- # Provide a detailed, user friendly representation
227
- def inspect
228
- "<Twilio.PreviewMessaging.V1.MessageInstance>"
229
- end
230
- end
231
-
232
- end
233
- end
234
- end
235
- end