twilio-ruby 6.0.0.pre.rc.3 → 6.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +103 -47
- data/CONTRIBUTING.md +10 -8
- data/README.md +128 -46
- data/UPGRADE.md +7 -4
- data/advanced-examples/custom-http-client.md +170 -0
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +1 -6
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb +7 -42
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +8 -42
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +2 -10
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +1 -6
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +1 -5
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +2 -11
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +1 -5
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +1 -6
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +2 -10
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +1 -5
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +3 -16
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +1 -5
- data/lib/twilio-ruby/rest/api/v2010/account.rb +24 -103
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb +1 -5
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task.rb +2 -10
- data/lib/twilio-ruby/rest/autopilot/v1/assistant.rb +6 -24
- data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +2 -9
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +3 -15
- data/lib/twilio-ruby/rest/chat/v1/service/user.rb +1 -6
- data/lib/twilio-ruby/rest/chat/v1/service.rb +3 -12
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +4 -20
- data/lib/twilio-ruby/rest/chat/v2/service/user.rb +2 -10
- data/lib/twilio-ruby/rest/chat/v2/service.rb +4 -16
- data/lib/twilio-ruby/rest/conversations/v1/address_configuration.rb +11 -1
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +1 -5
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +3 -12
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +1 -6
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +3 -15
- data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +1 -5
- data/lib/twilio-ruby/rest/conversations/v1/service.rb +5 -21
- data/lib/twilio-ruby/rest/conversations/v1/user.rb +1 -4
- data/lib/twilio-ruby/rest/events/v1/schema.rb +1 -4
- data/lib/twilio-ruby/rest/events/v1/sink.rb +2 -10
- data/lib/twilio-ruby/rest/events/v1/subscription.rb +1 -4
- data/lib/twilio-ruby/rest/flex_api/v1/assessments.rb +38 -44
- data/lib/twilio-ruby/rest/flex_api/v1/insights_assessments_comment.rb +17 -23
- data/lib/twilio-ruby/rest/flex_api/v1/insights_conversations.rb +9 -9
- data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb +53 -53
- data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb +37 -37
- data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb +52 -52
- data/lib/twilio-ruby/rest/flex_api/v1/insights_segments.rb +19 -92
- data/lib/twilio-ruby/rest/flex_api/v1/insights_settings_answer_sets.rb +4 -4
- data/lib/twilio-ruby/rest/flex_api/v1/insights_settings_comment.rb +4 -4
- data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb +2 -11
- data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +1 -4
- data/lib/twilio-ruby/rest/flex_api/v1.rb +30 -39
- data/lib/twilio-ruby/rest/insights/v1/call.rb +2 -10
- data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +31 -3
- data/lib/twilio-ruby/rest/insights/v1/conference.rb +1 -4
- data/lib/twilio-ruby/rest/insights/v1/room.rb +1 -4
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +3 -15
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +1 -6
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +3 -12
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +4 -20
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +2 -10
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +4 -16
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +2 -9
- data/lib/twilio-ruby/rest/messaging/v1/domain_config.rb +28 -2
- data/lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb +7 -0
- data/lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service_domain_association.rb +196 -0
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +31 -47
- data/lib/twilio-ruby/rest/messaging/v1.rb +15 -15
- data/lib/twilio-ruby/rest/messaging.rb +1 -1
- data/lib/twilio-ruby/rest/microvisor/v1/device.rb +2 -8
- data/lib/twilio-ruby/rest/microvisor.rb +2 -1
- data/lib/twilio-ruby/rest/notify/v1/service.rb +2 -9
- data/lib/twilio-ruby/rest/numbers/v1/bulk_eligibility.rb +224 -0
- data/lib/twilio-ruby/rest/numbers/v1.rb +49 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +4 -18
- data/lib/twilio-ruby/rest/oauth.rb +1 -1
- data/lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb +4 -16
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +1 -5
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +1 -4
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +1 -4
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +1 -5
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +2 -10
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +2 -10
- data/lib/twilio-ruby/rest/preview/sync/service.rb +3 -12
- data/lib/twilio-ruby/rest/preview/understand/assistant/field_type.rb +1 -5
- data/lib/twilio-ruby/rest/preview/understand/assistant/task.rb +2 -10
- data/lib/twilio-ruby/rest/preview/understand/assistant.rb +5 -20
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +1 -6
- data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +2 -10
- data/lib/twilio-ruby/rest/proxy/v1/service.rb +3 -12
- data/lib/twilio-ruby/rest/serverless/v1/service/asset.rb +1 -5
- data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +3 -15
- data/lib/twilio-ruby/rest/serverless/v1/service/function.rb +1 -5
- data/lib/twilio-ruby/rest/serverless/v1/service.rb +4 -16
- data/lib/twilio-ruby/rest/studio/v1/flow/engagement.rb +1 -5
- data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +1 -5
- data/lib/twilio-ruby/rest/studio/v1/flow.rb +2 -8
- data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +1 -5
- data/lib/twilio-ruby/rest/studio/v2/flow.rb +2 -8
- data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +1 -4
- data/lib/twilio-ruby/rest/supersim/v1/sim.rb +2 -10
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +1 -5
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +2 -10
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +2 -10
- data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +1 -6
- data/lib/twilio-ruby/rest/sync/v1/service.rb +4 -16
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +1 -5
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +2 -10
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +7 -28
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +4 -16
- data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb +3 -12
- data/lib/twilio-ruby/rest/trusthub/v1/trust_products.rb +3 -12
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +1 -7
- data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +3 -16
- data/lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb +1 -5
- data/lib/twilio-ruby/rest/verify/v2/service.rb +7 -29
- data/lib/twilio-ruby/rest/video/v1/room/participant.rb +3 -16
- data/lib/twilio-ruby/rest/video/v1/room.rb +3 -13
- data/lib/twilio-ruby/rest/voice/v1/connection_policy.rb +1 -4
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb +1 -5
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +2 -10
- data/lib/twilio-ruby/rest.rb +1 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/twilio-ruby.gemspec +1 -1
- metadata +12 -9
- data/lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb +0 -744
@@ -0,0 +1,170 @@
|
|
1
|
+
# Custom HTTP Clients for the Twilio Ruby Helper Library
|
2
|
+
|
3
|
+
If you are working with the Twilio Ruby Helper Library, and you need to be able to modify the HTTP requests that the library makes to the Twilio servers, you’re in the right place. The most common need to alter the HTTP request is to connect and authenticate with an enterprise’s proxy server. We’ll provide sample code that you can drop right into your app to handle this use case.
|
4
|
+
|
5
|
+
Connect and authenticate with a proxy server
|
6
|
+
To connect and provide credentials to a proxy server that may be between your app and Twilio, you need a way to modify the HTTP requests that the Twilio helper library makes on your behalf to invoke the Twilio REST API.
|
7
|
+
|
8
|
+
The Twilio Ruby helper library uses the [Faraday](https://rubygems.org/gems/faraday) gem under the hood to make the HTTP requests. The following example shows a typical request, without a custom `http_client`:
|
9
|
+
|
10
|
+
```rb
|
11
|
+
@client = Twilio::REST::Client.new(account_sid, auth_token)
|
12
|
+
|
13
|
+
message = @client.messages
|
14
|
+
.create(
|
15
|
+
to: "+15558675310",
|
16
|
+
body: "Hey there!",
|
17
|
+
from: "+15017122661",
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
21
|
+
Out of the box, the helper library is creating a default `Twilio::Http::Client` for you, using the Twilio credentials you provide. However, you can create your own `Twilio::Http::Client`, and pass it to any Twilio REST API resource action you want.
|
22
|
+
|
23
|
+
Here’s an example of sending an SMS message with a custom client:
|
24
|
+
|
25
|
+
```rb
|
26
|
+
# Download the helper library from https://www.twilio.com/docs/ruby/install
|
27
|
+
require "rubygems"
|
28
|
+
require "twilio-ruby"
|
29
|
+
require "dotenv/load"
|
30
|
+
|
31
|
+
# Custom HTTP Client
|
32
|
+
require_relative "MyRequestClass"
|
33
|
+
|
34
|
+
# Your Account Sid and Auth Token from twilio.com/console
|
35
|
+
account_sid = ENV["ACCOUNT_SID"]
|
36
|
+
auth_token = ENV["AUTH_TOKEN"]
|
37
|
+
proxy_address = ENV["PROXY_ADDRESS"]
|
38
|
+
proxy_protocol = ENV["PROXY_PROTOCOL"]
|
39
|
+
proxy_port = ENV["PROXY_PORT"]
|
40
|
+
|
41
|
+
my_request_client = MyRequestClass.new(proxy_protocol, proxy_address, proxy_port)
|
42
|
+
|
43
|
+
@client = Twilio::REST::Client.new(account_sid, auth_token,
|
44
|
+
nil, nil, my_request_client)
|
45
|
+
|
46
|
+
message = @client.messages
|
47
|
+
.create(
|
48
|
+
to: "+593978613041",
|
49
|
+
body: "RB This is the ship that made the Kesssssel Run in fourteen parsecs?",
|
50
|
+
from: "+13212855389",
|
51
|
+
)
|
52
|
+
|
53
|
+
puts "Message SID: #{message.sid}"
|
54
|
+
```
|
55
|
+
|
56
|
+
## Create your custom TwilioRestClient
|
57
|
+
|
58
|
+
When you take a closer look at the constructor for `Twilio::Http::Client`, you see that this class provides it to the Twilio helper library to make the necessary HTTP requests.
|
59
|
+
|
60
|
+
## Call Twilio through the proxy server
|
61
|
+
|
62
|
+
Now that we understand how all the components fit together, we can create our own `http_client` that can connect through a proxy server. To make this reusable, here’s a class that you can use to create this `http_client` whenever you need one.
|
63
|
+
|
64
|
+
```rb
|
65
|
+
class MyRequestClass
|
66
|
+
attr_accessor :adapter
|
67
|
+
attr_reader :timeout, :last_response, :last_request
|
68
|
+
|
69
|
+
def initialize(proxy_prot = nil, proxy_addr = nil, proxy_port = nil, timeout: nil)
|
70
|
+
@proxy_prot = proxy_prot
|
71
|
+
@proxy_addr = proxy_addr
|
72
|
+
@proxy_port = proxy_port
|
73
|
+
@timeout = timeout
|
74
|
+
@adapter = Faraday.default_adapter
|
75
|
+
end
|
76
|
+
|
77
|
+
def _request(request)
|
78
|
+
@connection = Faraday.new(url: request.host + ":" + request.port.to_s, ssl: { verify: true }) do |f|
|
79
|
+
f.options.params_encoder = Faraday::FlatParamsEncoder
|
80
|
+
f.request :url_encoded
|
81
|
+
f.adapter @adapter
|
82
|
+
f.headers = request.headers
|
83
|
+
f.basic_auth(request.auth[0], request.auth[1])
|
84
|
+
if @proxy_addr
|
85
|
+
f.proxy = "#{@proxy_prot}://#{@proxy_addr}:#{@proxy_port}"
|
86
|
+
end
|
87
|
+
f.options.open_timeout = request.timeout || @timeout
|
88
|
+
f.options.timeout = request.timeout || @timeout
|
89
|
+
end
|
90
|
+
|
91
|
+
@last_request = request
|
92
|
+
@last_response = nil
|
93
|
+
response = @connection.send(request.method.downcase.to_sym,
|
94
|
+
request.url,
|
95
|
+
request.method == "GET" ? request.params : request.data)
|
96
|
+
|
97
|
+
if response.body && !response.body.empty?
|
98
|
+
object = response.body
|
99
|
+
elsif response.status == 400
|
100
|
+
object = { message: "Bad request", code: 400 }.to_json
|
101
|
+
end
|
102
|
+
|
103
|
+
twilio_response = Twilio::Response.new(response.status, object, headers: response.headers)
|
104
|
+
@last_response = twilio_response
|
105
|
+
|
106
|
+
twilio_response
|
107
|
+
end
|
108
|
+
|
109
|
+
def request(host, port, method, url, params = {}, data = {}, headers = {}, auth = nil, timeout = nil)
|
110
|
+
request = Twilio::Request.new(host, port, method, url, params, data, headers, auth, timeout)
|
111
|
+
_request(request)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
```
|
115
|
+
|
116
|
+
In this example, we are using some environment variables loaded at the program startup to retrieve various configuration settings:
|
117
|
+
|
118
|
+
- Your Twilio Account Sid and Auth Token ([found here, in the Twilio console](https://console.twilio.com))
|
119
|
+
- A proxy address in the form of `http://127.0.0.1:8888`
|
120
|
+
|
121
|
+
These settings are located in a file like `.env` like so:
|
122
|
+
|
123
|
+
```env
|
124
|
+
ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
125
|
+
AUTH_TOKEN= your_auth_token
|
126
|
+
|
127
|
+
HTTPS_PROXY=https://127.0.0.1:8888
|
128
|
+
HTTP_PROXY=http://127.0.0.1:8888
|
129
|
+
```
|
130
|
+
|
131
|
+
Here’s the full console program that sends a text message and shows how it all can work together. It loads the `.env` file.
|
132
|
+
|
133
|
+
```rb
|
134
|
+
# Download the helper library from https://www.twilio.com/docs/ruby/install
|
135
|
+
require "rubygems"
|
136
|
+
require "twilio-ruby"
|
137
|
+
require "dotenv/load"
|
138
|
+
|
139
|
+
# Custom HTTP Client
|
140
|
+
require_relative "MyRequestClass"
|
141
|
+
|
142
|
+
# Your Account Sid and Auth Token from twilio.com/console
|
143
|
+
account_sid = ENV["ACCOUNT_SID"]
|
144
|
+
auth_token = ENV["AUTH_TOKEN"]
|
145
|
+
proxy_address = ENV["PROXY_ADDRESS"]
|
146
|
+
proxy_protocol = ENV["PROXY_PROTOCOL"]
|
147
|
+
proxy_port = ENV["PROXY_PORT"]
|
148
|
+
|
149
|
+
my_request_client = MyRequestClass.new(proxy_protocol, proxy_address, proxy_port)
|
150
|
+
|
151
|
+
@client = Twilio::REST::Client.new(account_sid, auth_token,
|
152
|
+
nil, nil, my_request_client)
|
153
|
+
|
154
|
+
message = @client.messages
|
155
|
+
.create(
|
156
|
+
to: "+593978613041",
|
157
|
+
body: "RB This is the ship that made the Kesssssel Run in fourteen parsecs?",
|
158
|
+
from: "+13212855389",
|
159
|
+
)
|
160
|
+
|
161
|
+
puts "Message SID: #{message.sid}"
|
162
|
+
```
|
163
|
+
|
164
|
+
## What else can this technique be used for?
|
165
|
+
|
166
|
+
Now that you know how to inject your own `http_client` into the Twilio API request pipeline, you could use this technique to add custom HTTP headers and authorization to the requests (perhaps as required by an upstream proxy server).
|
167
|
+
|
168
|
+
You could also implement your own `http_client` to mock the Twilio API responses so your unit and integration tests can run quickly without the need to make a connection to Twilio. In fact, there’s already an example online showing [how to do exactly that with Node.js and Prism](https://www.twilio.com/docs/openapi/mock-api-generation-with-twilio-openapi-spec).
|
169
|
+
|
170
|
+
We can’t wait to see what you build!
|
@@ -285,13 +285,8 @@ module Twilio
|
|
285
285
|
def dependent_phone_numbers
|
286
286
|
unless @dependent_phone_numbers
|
287
287
|
@dependent_phone_numbers = DependentPhoneNumberList.new(
|
288
|
-
@version,
|
289
|
-
account_sid: @solution[:account_sid],
|
290
|
-
address_sid: @solution[:sid]
|
291
|
-
|
292
|
-
)
|
288
|
+
@version, account_sid: @solution[:account_sid], address_sid: @solution[:sid], )
|
293
289
|
end
|
294
|
-
|
295
290
|
@dependent_phone_numbers
|
296
291
|
end
|
297
292
|
|
@@ -170,13 +170,8 @@ module Twilio
|
|
170
170
|
def voip
|
171
171
|
unless @voip
|
172
172
|
@voip = VoipList.new(
|
173
|
-
@version,
|
174
|
-
account_sid: @solution[:account_sid],
|
175
|
-
available_phone_number_country_country_code: @solution[:country_code]
|
176
|
-
|
177
|
-
)
|
173
|
+
@version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], )
|
178
174
|
end
|
179
|
-
|
180
175
|
@voip
|
181
176
|
end
|
182
177
|
##
|
@@ -186,13 +181,8 @@ module Twilio
|
|
186
181
|
def national
|
187
182
|
unless @national
|
188
183
|
@national = NationalList.new(
|
189
|
-
@version,
|
190
|
-
account_sid: @solution[:account_sid],
|
191
|
-
available_phone_number_country_country_code: @solution[:country_code]
|
192
|
-
|
193
|
-
)
|
184
|
+
@version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], )
|
194
185
|
end
|
195
|
-
|
196
186
|
@national
|
197
187
|
end
|
198
188
|
##
|
@@ -202,13 +192,8 @@ module Twilio
|
|
202
192
|
def mobile
|
203
193
|
unless @mobile
|
204
194
|
@mobile = MobileList.new(
|
205
|
-
@version,
|
206
|
-
account_sid: @solution[:account_sid],
|
207
|
-
available_phone_number_country_country_code: @solution[:country_code]
|
208
|
-
|
209
|
-
)
|
195
|
+
@version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], )
|
210
196
|
end
|
211
|
-
|
212
197
|
@mobile
|
213
198
|
end
|
214
199
|
##
|
@@ -218,13 +203,8 @@ module Twilio
|
|
218
203
|
def machine_to_machine
|
219
204
|
unless @machine_to_machine
|
220
205
|
@machine_to_machine = MachineToMachineList.new(
|
221
|
-
@version,
|
222
|
-
account_sid: @solution[:account_sid],
|
223
|
-
available_phone_number_country_country_code: @solution[:country_code]
|
224
|
-
|
225
|
-
)
|
206
|
+
@version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], )
|
226
207
|
end
|
227
|
-
|
228
208
|
@machine_to_machine
|
229
209
|
end
|
230
210
|
##
|
@@ -234,13 +214,8 @@ module Twilio
|
|
234
214
|
def toll_free
|
235
215
|
unless @toll_free
|
236
216
|
@toll_free = TollFreeList.new(
|
237
|
-
@version,
|
238
|
-
account_sid: @solution[:account_sid],
|
239
|
-
available_phone_number_country_country_code: @solution[:country_code]
|
240
|
-
|
241
|
-
)
|
217
|
+
@version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], )
|
242
218
|
end
|
243
|
-
|
244
219
|
@toll_free
|
245
220
|
end
|
246
221
|
##
|
@@ -250,13 +225,8 @@ module Twilio
|
|
250
225
|
def shared_cost
|
251
226
|
unless @shared_cost
|
252
227
|
@shared_cost = SharedCostList.new(
|
253
|
-
@version,
|
254
|
-
account_sid: @solution[:account_sid],
|
255
|
-
available_phone_number_country_country_code: @solution[:country_code]
|
256
|
-
|
257
|
-
)
|
228
|
+
@version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], )
|
258
229
|
end
|
259
|
-
|
260
230
|
@shared_cost
|
261
231
|
end
|
262
232
|
##
|
@@ -266,13 +236,8 @@ module Twilio
|
|
266
236
|
def local
|
267
237
|
unless @local
|
268
238
|
@local = LocalList.new(
|
269
|
-
@version,
|
270
|
-
account_sid: @solution[:account_sid],
|
271
|
-
available_phone_number_country_country_code: @solution[:country_code]
|
272
|
-
|
273
|
-
)
|
239
|
+
@version, account_sid: @solution[:account_sid], country_code: @solution[:country_code], )
|
274
240
|
end
|
275
|
-
|
276
241
|
@local
|
277
242
|
end
|
278
243
|
|
@@ -431,13 +431,8 @@ module Twilio
|
|
431
431
|
def events
|
432
432
|
unless @events
|
433
433
|
@events = EventList.new(
|
434
|
-
@version,
|
435
|
-
account_sid: @solution[:account_sid],
|
436
|
-
call_sid: @solution[:sid]
|
437
|
-
|
438
|
-
)
|
434
|
+
@version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
|
439
435
|
end
|
440
|
-
|
441
436
|
@events
|
442
437
|
end
|
443
438
|
##
|
@@ -447,13 +442,8 @@ module Twilio
|
|
447
442
|
def user_defined_messages
|
448
443
|
unless @user_defined_messages
|
449
444
|
@user_defined_messages = UserDefinedMessageList.new(
|
450
|
-
@version,
|
451
|
-
account_sid: @solution[:account_sid],
|
452
|
-
call_sid: @solution[:sid]
|
453
|
-
|
454
|
-
)
|
445
|
+
@version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
|
455
446
|
end
|
456
|
-
|
457
447
|
@user_defined_messages
|
458
448
|
end
|
459
449
|
##
|
@@ -470,11 +460,7 @@ module Twilio
|
|
470
460
|
|
471
461
|
unless @siprec
|
472
462
|
@siprec = SiprecList.new(
|
473
|
-
@version,
|
474
|
-
account_sid: @solution[:account_sid],
|
475
|
-
call_sid: @solution[:sid]
|
476
|
-
|
477
|
-
)
|
463
|
+
@version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
|
478
464
|
end
|
479
465
|
|
480
466
|
@siprec
|
@@ -493,11 +479,7 @@ module Twilio
|
|
493
479
|
|
494
480
|
unless @user_defined_message_subscriptions
|
495
481
|
@user_defined_message_subscriptions = UserDefinedMessageSubscriptionList.new(
|
496
|
-
@version,
|
497
|
-
account_sid: @solution[:account_sid],
|
498
|
-
call_sid: @solution[:sid]
|
499
|
-
|
500
|
-
)
|
482
|
+
@version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
|
501
483
|
end
|
502
484
|
|
503
485
|
@user_defined_message_subscriptions
|
@@ -516,11 +498,7 @@ module Twilio
|
|
516
498
|
|
517
499
|
unless @payments
|
518
500
|
@payments = PaymentList.new(
|
519
|
-
@version,
|
520
|
-
account_sid: @solution[:account_sid],
|
521
|
-
call_sid: @solution[:sid]
|
522
|
-
|
523
|
-
)
|
501
|
+
@version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
|
524
502
|
end
|
525
503
|
|
526
504
|
@payments
|
@@ -539,11 +517,7 @@ module Twilio
|
|
539
517
|
|
540
518
|
unless @recordings
|
541
519
|
@recordings = RecordingList.new(
|
542
|
-
@version,
|
543
|
-
account_sid: @solution[:account_sid],
|
544
|
-
call_sid: @solution[:sid]
|
545
|
-
|
546
|
-
)
|
520
|
+
@version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
|
547
521
|
end
|
548
522
|
|
549
523
|
@recordings
|
@@ -562,11 +536,7 @@ module Twilio
|
|
562
536
|
|
563
537
|
unless @notifications
|
564
538
|
@notifications = NotificationList.new(
|
565
|
-
@version,
|
566
|
-
account_sid: @solution[:account_sid],
|
567
|
-
call_sid: @solution[:sid]
|
568
|
-
|
569
|
-
)
|
539
|
+
@version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
|
570
540
|
end
|
571
541
|
|
572
542
|
@notifications
|
@@ -596,11 +566,7 @@ module Twilio
|
|
596
566
|
|
597
567
|
unless @streams
|
598
568
|
@streams = StreamList.new(
|
599
|
-
@version,
|
600
|
-
account_sid: @solution[:account_sid],
|
601
|
-
call_sid: @solution[:sid]
|
602
|
-
|
603
|
-
)
|
569
|
+
@version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
|
604
570
|
end
|
605
571
|
|
606
572
|
@streams
|
@@ -255,11 +255,7 @@ module Twilio
|
|
255
255
|
|
256
256
|
unless @recordings
|
257
257
|
@recordings = RecordingList.new(
|
258
|
-
@version,
|
259
|
-
account_sid: @solution[:account_sid],
|
260
|
-
conference_sid: @solution[:sid]
|
261
|
-
|
262
|
-
)
|
258
|
+
@version, account_sid: @solution[:account_sid], conference_sid: @solution[:sid], )
|
263
259
|
end
|
264
260
|
|
265
261
|
@recordings
|
@@ -278,11 +274,7 @@ module Twilio
|
|
278
274
|
|
279
275
|
unless @participants
|
280
276
|
@participants = ParticipantList.new(
|
281
|
-
@version,
|
282
|
-
account_sid: @solution[:account_sid],
|
283
|
-
conference_sid: @solution[:sid]
|
284
|
-
|
285
|
-
)
|
277
|
+
@version, account_sid: @solution[:account_sid], conference_sid: @solution[:sid], )
|
286
278
|
end
|
287
279
|
|
288
280
|
@participants
|
@@ -205,12 +205,7 @@ module Twilio
|
|
205
205
|
|
206
206
|
unless @extensions
|
207
207
|
@extensions = AssignedAddOnExtensionList.new(
|
208
|
-
@version,
|
209
|
-
account_sid: @solution[:account_sid],
|
210
|
-
resource_sid: @solution[:resource_sid],
|
211
|
-
assigned_add_on_sid: @solution[:sid]
|
212
|
-
|
213
|
-
)
|
208
|
+
@version, account_sid: @solution[:account_sid], resource_sid: @solution[:resource_sid], assigned_add_on_sid: @solution[:sid], )
|
214
209
|
end
|
215
210
|
|
216
211
|
@extensions
|
@@ -407,11 +407,7 @@ module Twilio
|
|
407
407
|
|
408
408
|
unless @assigned_add_ons
|
409
409
|
@assigned_add_ons = AssignedAddOnList.new(
|
410
|
-
@version,
|
411
|
-
account_sid: @solution[:account_sid],
|
412
|
-
incoming_phone_number_sid: @solution[:sid]
|
413
|
-
|
414
|
-
)
|
410
|
+
@version, account_sid: @solution[:account_sid], resource_sid: @solution[:sid], )
|
415
411
|
end
|
416
412
|
|
417
413
|
@assigned_add_ons
|
@@ -315,13 +315,8 @@ module Twilio
|
|
315
315
|
def feedback
|
316
316
|
unless @feedback
|
317
317
|
@feedback = FeedbackList.new(
|
318
|
-
@version,
|
319
|
-
account_sid: @solution[:account_sid],
|
320
|
-
message_sid: @solution[:sid]
|
321
|
-
|
322
|
-
)
|
318
|
+
@version, account_sid: @solution[:account_sid], message_sid: @solution[:sid], )
|
323
319
|
end
|
324
|
-
|
325
320
|
@feedback
|
326
321
|
end
|
327
322
|
##
|
@@ -338,11 +333,7 @@ module Twilio
|
|
338
333
|
|
339
334
|
unless @media
|
340
335
|
@media = MediaList.new(
|
341
|
-
@version,
|
342
|
-
account_sid: @solution[:account_sid],
|
343
|
-
message_sid: @solution[:sid]
|
344
|
-
|
345
|
-
)
|
336
|
+
@version, account_sid: @solution[:account_sid], message_sid: @solution[:sid], )
|
346
337
|
end
|
347
338
|
|
348
339
|
@media
|
@@ -226,11 +226,7 @@ module Twilio
|
|
226
226
|
|
227
227
|
unless @members
|
228
228
|
@members = MemberList.new(
|
229
|
-
@version,
|
230
|
-
account_sid: @solution[:account_sid],
|
231
|
-
queue_sid: @solution[:sid]
|
232
|
-
|
233
|
-
)
|
229
|
+
@version, account_sid: @solution[:account_sid], queue_sid: @solution[:sid], )
|
234
230
|
end
|
235
231
|
|
236
232
|
@members
|
@@ -182,12 +182,7 @@ module Twilio
|
|
182
182
|
|
183
183
|
unless @payloads
|
184
184
|
@payloads = PayloadList.new(
|
185
|
-
@version,
|
186
|
-
account_sid: @solution[:account_sid],
|
187
|
-
reference_sid: @solution[:reference_sid],
|
188
|
-
add_on_result_sid: @solution[:sid]
|
189
|
-
|
190
|
-
)
|
185
|
+
@version, account_sid: @solution[:account_sid], reference_sid: @solution[:reference_sid], add_on_result_sid: @solution[:sid], )
|
191
186
|
end
|
192
187
|
|
193
188
|
@payloads
|
@@ -228,11 +228,7 @@ module Twilio
|
|
228
228
|
|
229
229
|
unless @add_on_results
|
230
230
|
@add_on_results = AddOnResultList.new(
|
231
|
-
@version,
|
232
|
-
account_sid: @solution[:account_sid],
|
233
|
-
recording_sid: @solution[:sid]
|
234
|
-
|
235
|
-
)
|
231
|
+
@version, account_sid: @solution[:account_sid], reference_sid: @solution[:sid], )
|
236
232
|
end
|
237
233
|
|
238
234
|
@add_on_results
|
@@ -251,11 +247,7 @@ module Twilio
|
|
251
247
|
|
252
248
|
unless @transcriptions
|
253
249
|
@transcriptions = TranscriptionList.new(
|
254
|
-
@version,
|
255
|
-
account_sid: @solution[:account_sid],
|
256
|
-
recording_sid: @solution[:sid]
|
257
|
-
|
258
|
-
)
|
250
|
+
@version, account_sid: @solution[:account_sid], recording_sid: @solution[:sid], )
|
259
251
|
end
|
260
252
|
|
261
253
|
@transcriptions
|
@@ -221,11 +221,7 @@ module Twilio
|
|
221
221
|
|
222
222
|
unless @credentials
|
223
223
|
@credentials = CredentialList.new(
|
224
|
-
@version,
|
225
|
-
account_sid: @solution[:account_sid],
|
226
|
-
credential_list_sid: @solution[:sid]
|
227
|
-
|
228
|
-
)
|
224
|
+
@version, account_sid: @solution[:account_sid], credential_list_sid: @solution[:sid], )
|
229
225
|
end
|
230
226
|
|
231
227
|
@credentials
|
@@ -288,13 +288,8 @@ module Twilio
|
|
288
288
|
def auth
|
289
289
|
unless @auth
|
290
290
|
@auth = AuthTypesList.new(
|
291
|
-
@version,
|
292
|
-
account_sid: @solution[:account_sid],
|
293
|
-
domain_sid: @solution[:sid]
|
294
|
-
|
295
|
-
)
|
291
|
+
@version, account_sid: @solution[:account_sid], domain_sid: @solution[:sid], )
|
296
292
|
end
|
297
|
-
|
298
293
|
@auth
|
299
294
|
end
|
300
295
|
##
|
@@ -311,11 +306,7 @@ module Twilio
|
|
311
306
|
|
312
307
|
unless @ip_access_control_list_mappings
|
313
308
|
@ip_access_control_list_mappings = IpAccessControlListMappingList.new(
|
314
|
-
@version,
|
315
|
-
account_sid: @solution[:account_sid],
|
316
|
-
domain_sid: @solution[:sid]
|
317
|
-
|
318
|
-
)
|
309
|
+
@version, account_sid: @solution[:account_sid], domain_sid: @solution[:sid], )
|
319
310
|
end
|
320
311
|
|
321
312
|
@ip_access_control_list_mappings
|
@@ -334,11 +325,7 @@ module Twilio
|
|
334
325
|
|
335
326
|
unless @credential_list_mappings
|
336
327
|
@credential_list_mappings = CredentialListMappingList.new(
|
337
|
-
@version,
|
338
|
-
account_sid: @solution[:account_sid],
|
339
|
-
domain_sid: @solution[:sid]
|
340
|
-
|
341
|
-
)
|
328
|
+
@version, account_sid: @solution[:account_sid], domain_sid: @solution[:sid], )
|
342
329
|
end
|
343
330
|
|
344
331
|
@credential_list_mappings
|
@@ -221,11 +221,7 @@ module Twilio
|
|
221
221
|
|
222
222
|
unless @ip_addresses
|
223
223
|
@ip_addresses = IpAddressList.new(
|
224
|
-
@version,
|
225
|
-
account_sid: @solution[:account_sid],
|
226
|
-
ip_access_control_list_sid: @solution[:sid]
|
227
|
-
|
228
|
-
)
|
224
|
+
@version, account_sid: @solution[:account_sid], ip_access_control_list_sid: @solution[:sid], )
|
229
225
|
end
|
230
226
|
|
231
227
|
@ip_addresses
|