twilio-ruby 5.61.1 → 5.61.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -0
- data/.rubocop.yml +1 -1
- data/CHANGES.md +28 -0
- data/Makefile +1 -1
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb +269 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +8 -0
- data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +14 -0
- data/lib/twilio-ruby/rest/supersim/v1/ip_command.rb +416 -0
- data/lib/twilio-ruby/rest/supersim/v1.rb +16 -0
- data/lib/twilio-ruby/rest/supersim.rb +9 -0
- data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +8 -2
- data/lib/twilio-ruby/rest/video/v1/room.rb +12 -1
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0744c60bf47ebe5674a6c2ea371fdda3ae937ef4
|
4
|
+
data.tar.gz: a8d42def7f349fb8a99c035f59c3436d8f969fe9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b62a9817b86b3f5e03c491072907cf359eff878d21b315f92848e9546a6f1f3664d29c1be464e17444bc15754af6079703f3e46d17f7845d9ed460ae9d8ff44
|
7
|
+
data.tar.gz: 5612432558411b78da25b0b6e1dfcb4edd51ed710c3562cb9174fe6e93bcdc0cd88e55aa02dc19a361534dcbe3e88a52d3ca64ed6032ac42af2045547e30d70e
|
data/.github/workflows/test.yml
CHANGED
data/.rubocop.yml
CHANGED
data/CHANGES.md
CHANGED
@@ -1,6 +1,34 @@
|
|
1
1
|
twilio-ruby changelog
|
2
2
|
=====================
|
3
3
|
|
4
|
+
[2021-12-01] Version 5.61.2
|
5
|
+
---------------------------
|
6
|
+
**Library - Chore**
|
7
|
+
- [PR #579](https://github.com/twilio/twilio-ruby/pull/579): make ruby-head test optional. Thanks to [@eshanholtz](https://github.com/eshanholtz)!
|
8
|
+
|
9
|
+
**Conversations**
|
10
|
+
- Add `Service Webhook Configuration` resource
|
11
|
+
|
12
|
+
**Flex**
|
13
|
+
- Adding `flex_insights_drilldown` and `flex_url` objects to Flex Configuration
|
14
|
+
|
15
|
+
**Messaging**
|
16
|
+
- Update us_app_to_person endpoints to remove beta feature flag based access
|
17
|
+
|
18
|
+
**Supersim**
|
19
|
+
- Add IP Commands resource
|
20
|
+
|
21
|
+
**Verify**
|
22
|
+
- Add optional `factor_friendly_name` parameter to the create access token endpoint.
|
23
|
+
|
24
|
+
**Video**
|
25
|
+
- Add maxParticipantDuration param to Rooms
|
26
|
+
|
27
|
+
**Twiml**
|
28
|
+
- Unrevert Add supported SSML children to `<emphasis>`, `<lang>`, `<p>`, `<prosody>`, `<s>`, and `<w>`.
|
29
|
+
- Revert Add supported SSML children to `<emphasis>`, `<lang>`, `<p>`, `<prosody>`, `<s>`, and `<w>`.
|
30
|
+
|
31
|
+
|
4
32
|
[2021-11-17] Version 5.61.1
|
5
33
|
---------------------------
|
6
34
|
**Library - Chore**
|
data/Makefile
CHANGED
data/README.md
CHANGED
@@ -35,13 +35,13 @@ This library supports the following Ruby implementations:
|
|
35
35
|
To install using [Bundler][bundler] grab the latest stable version:
|
36
36
|
|
37
37
|
```ruby
|
38
|
-
gem 'twilio-ruby', '~> 5.61.
|
38
|
+
gem 'twilio-ruby', '~> 5.61.2'
|
39
39
|
```
|
40
40
|
|
41
41
|
To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
|
42
42
|
|
43
43
|
```bash
|
44
|
-
gem install twilio-ruby -v 5.61.
|
44
|
+
gem install twilio-ruby -v 5.61.2
|
45
45
|
```
|
46
46
|
|
47
47
|
To build and install the development branch yourself from the latest source:
|
@@ -0,0 +1,269 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
module Twilio
|
10
|
+
module REST
|
11
|
+
class Conversations < Domain
|
12
|
+
class V1 < Version
|
13
|
+
class ServiceContext < InstanceContext
|
14
|
+
class ConfigurationContext < InstanceContext
|
15
|
+
class WebhookList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the WebhookList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @param [String] chat_service_sid The unique string that we created to identify
|
20
|
+
# the Service configuration resource.
|
21
|
+
# @return [WebhookList] WebhookList
|
22
|
+
def initialize(version, chat_service_sid: nil)
|
23
|
+
super(version)
|
24
|
+
|
25
|
+
# Path Solution
|
26
|
+
@solution = {chat_service_sid: chat_service_sid}
|
27
|
+
end
|
28
|
+
|
29
|
+
##
|
30
|
+
# Provide a user friendly representation
|
31
|
+
def to_s
|
32
|
+
'#<Twilio.Conversations.V1.WebhookList>'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
class WebhookPage < Page
|
37
|
+
##
|
38
|
+
# Initialize the WebhookPage
|
39
|
+
# @param [Version] version Version that contains the resource
|
40
|
+
# @param [Response] response Response from the API
|
41
|
+
# @param [Hash] solution Path solution for the resource
|
42
|
+
# @return [WebhookPage] WebhookPage
|
43
|
+
def initialize(version, response, solution)
|
44
|
+
super(version, response)
|
45
|
+
|
46
|
+
# Path Solution
|
47
|
+
@solution = solution
|
48
|
+
end
|
49
|
+
|
50
|
+
##
|
51
|
+
# Build an instance of WebhookInstance
|
52
|
+
# @param [Hash] payload Payload response from the API
|
53
|
+
# @return [WebhookInstance] WebhookInstance
|
54
|
+
def get_instance(payload)
|
55
|
+
WebhookInstance.new(@version, payload, chat_service_sid: @solution[:chat_service_sid], )
|
56
|
+
end
|
57
|
+
|
58
|
+
##
|
59
|
+
# Provide a user friendly representation
|
60
|
+
def to_s
|
61
|
+
'<Twilio.Conversations.V1.WebhookPage>'
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
class WebhookContext < InstanceContext
|
66
|
+
##
|
67
|
+
# Initialize the WebhookContext
|
68
|
+
# @param [Version] version Version that contains the resource
|
69
|
+
# @param [String] chat_service_sid The unique ID of the {Conversation
|
70
|
+
# Service}[https://www.twilio.com/docs/conversations/api/service-resource] this
|
71
|
+
# conversation belongs to.
|
72
|
+
# @return [WebhookContext] WebhookContext
|
73
|
+
def initialize(version, chat_service_sid)
|
74
|
+
super(version)
|
75
|
+
|
76
|
+
# Path Solution
|
77
|
+
@solution = {chat_service_sid: chat_service_sid, }
|
78
|
+
@uri = "/Services/#{@solution[:chat_service_sid]}/Configuration/Webhooks"
|
79
|
+
end
|
80
|
+
|
81
|
+
##
|
82
|
+
# Update the WebhookInstance
|
83
|
+
# @param [String] pre_webhook_url The absolute url the pre-event webhook request
|
84
|
+
# should be sent to.
|
85
|
+
# @param [String] post_webhook_url The absolute url the post-event webhook request
|
86
|
+
# should be sent to.
|
87
|
+
# @param [Array[String]] filters The list of webhook event triggers that are
|
88
|
+
# enabled for this Service. Possible values are `onParticipantAdd`,
|
89
|
+
# `onParticipantAdded`, `onDeliveryUpdated`, `onConversationUpdated`,
|
90
|
+
# `onConversationRemove`, `onParticipantRemove`, `onConversationUpdate`,
|
91
|
+
# `onMessageAdd`, `onMessageRemoved`, `onParticipantUpdated`,
|
92
|
+
# `onConversationAdded`, `onMessageAdded`, `onConversationAdd`,
|
93
|
+
# `onConversationRemoved`, `onParticipantUpdate`, `onMessageRemove`,
|
94
|
+
# `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate` or
|
95
|
+
# `onConversationStateUpdated`.
|
96
|
+
# @param [String] method The HTTP method to be used when sending a webhook
|
97
|
+
# request. One of `GET` or `POST`.
|
98
|
+
# @return [WebhookInstance] Updated WebhookInstance
|
99
|
+
def update(pre_webhook_url: :unset, post_webhook_url: :unset, filters: :unset, method: :unset)
|
100
|
+
data = Twilio::Values.of({
|
101
|
+
'PreWebhookUrl' => pre_webhook_url,
|
102
|
+
'PostWebhookUrl' => post_webhook_url,
|
103
|
+
'Filters' => Twilio.serialize_list(filters) { |e| e },
|
104
|
+
'Method' => method,
|
105
|
+
})
|
106
|
+
|
107
|
+
payload = @version.update('POST', @uri, data: data)
|
108
|
+
|
109
|
+
WebhookInstance.new(@version, payload, chat_service_sid: @solution[:chat_service_sid], )
|
110
|
+
end
|
111
|
+
|
112
|
+
##
|
113
|
+
# Fetch the WebhookInstance
|
114
|
+
# @return [WebhookInstance] Fetched WebhookInstance
|
115
|
+
def fetch
|
116
|
+
payload = @version.fetch('GET', @uri)
|
117
|
+
|
118
|
+
WebhookInstance.new(@version, payload, chat_service_sid: @solution[:chat_service_sid], )
|
119
|
+
end
|
120
|
+
|
121
|
+
##
|
122
|
+
# Provide a user friendly representation
|
123
|
+
def to_s
|
124
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
125
|
+
"#<Twilio.Conversations.V1.WebhookContext #{context}>"
|
126
|
+
end
|
127
|
+
|
128
|
+
##
|
129
|
+
# Provide a detailed, user friendly representation
|
130
|
+
def inspect
|
131
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
132
|
+
"#<Twilio.Conversations.V1.WebhookContext #{context}>"
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
class WebhookInstance < InstanceResource
|
137
|
+
##
|
138
|
+
# Initialize the WebhookInstance
|
139
|
+
# @param [Version] version Version that contains the resource
|
140
|
+
# @param [Hash] payload payload that contains response from Twilio
|
141
|
+
# @param [String] chat_service_sid The unique string that we created to identify
|
142
|
+
# the Service configuration resource.
|
143
|
+
# @return [WebhookInstance] WebhookInstance
|
144
|
+
def initialize(version, payload, chat_service_sid: nil)
|
145
|
+
super(version)
|
146
|
+
|
147
|
+
# Marshaled Properties
|
148
|
+
@properties = {
|
149
|
+
'account_sid' => payload['account_sid'],
|
150
|
+
'chat_service_sid' => payload['chat_service_sid'],
|
151
|
+
'pre_webhook_url' => payload['pre_webhook_url'],
|
152
|
+
'post_webhook_url' => payload['post_webhook_url'],
|
153
|
+
'filters' => payload['filters'],
|
154
|
+
'method' => payload['method'],
|
155
|
+
'url' => payload['url'],
|
156
|
+
}
|
157
|
+
|
158
|
+
# Context
|
159
|
+
@instance_context = nil
|
160
|
+
@params = {'chat_service_sid' => chat_service_sid, }
|
161
|
+
end
|
162
|
+
|
163
|
+
##
|
164
|
+
# Generate an instance context for the instance, the context is capable of
|
165
|
+
# performing various actions. All instance actions are proxied to the context
|
166
|
+
# @return [WebhookContext] WebhookContext for this WebhookInstance
|
167
|
+
def context
|
168
|
+
unless @instance_context
|
169
|
+
@instance_context = WebhookContext.new(@version, @params['chat_service_sid'], )
|
170
|
+
end
|
171
|
+
@instance_context
|
172
|
+
end
|
173
|
+
|
174
|
+
##
|
175
|
+
# @return [String] The unique ID of the Account responsible for this service.
|
176
|
+
def account_sid
|
177
|
+
@properties['account_sid']
|
178
|
+
end
|
179
|
+
|
180
|
+
##
|
181
|
+
# @return [String] The chat_service_sid
|
182
|
+
def chat_service_sid
|
183
|
+
@properties['chat_service_sid']
|
184
|
+
end
|
185
|
+
|
186
|
+
##
|
187
|
+
# @return [String] The absolute url the pre-event webhook request should be sent to.
|
188
|
+
def pre_webhook_url
|
189
|
+
@properties['pre_webhook_url']
|
190
|
+
end
|
191
|
+
|
192
|
+
##
|
193
|
+
# @return [String] The absolute url the post-event webhook request should be sent to.
|
194
|
+
def post_webhook_url
|
195
|
+
@properties['post_webhook_url']
|
196
|
+
end
|
197
|
+
|
198
|
+
##
|
199
|
+
# @return [Array[String]] The list of webhook event triggers that are enabled for this Service.
|
200
|
+
def filters
|
201
|
+
@properties['filters']
|
202
|
+
end
|
203
|
+
|
204
|
+
##
|
205
|
+
# @return [webhook.Method] The HTTP method to be used when sending a webhook request
|
206
|
+
def method
|
207
|
+
@properties['method']
|
208
|
+
end
|
209
|
+
|
210
|
+
##
|
211
|
+
# @return [String] An absolute URL for this webhook.
|
212
|
+
def url
|
213
|
+
@properties['url']
|
214
|
+
end
|
215
|
+
|
216
|
+
##
|
217
|
+
# Update the WebhookInstance
|
218
|
+
# @param [String] pre_webhook_url The absolute url the pre-event webhook request
|
219
|
+
# should be sent to.
|
220
|
+
# @param [String] post_webhook_url The absolute url the post-event webhook request
|
221
|
+
# should be sent to.
|
222
|
+
# @param [Array[String]] filters The list of webhook event triggers that are
|
223
|
+
# enabled for this Service. Possible values are `onParticipantAdd`,
|
224
|
+
# `onParticipantAdded`, `onDeliveryUpdated`, `onConversationUpdated`,
|
225
|
+
# `onConversationRemove`, `onParticipantRemove`, `onConversationUpdate`,
|
226
|
+
# `onMessageAdd`, `onMessageRemoved`, `onParticipantUpdated`,
|
227
|
+
# `onConversationAdded`, `onMessageAdded`, `onConversationAdd`,
|
228
|
+
# `onConversationRemoved`, `onParticipantUpdate`, `onMessageRemove`,
|
229
|
+
# `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate` or
|
230
|
+
# `onConversationStateUpdated`.
|
231
|
+
# @param [String] method The HTTP method to be used when sending a webhook
|
232
|
+
# request. One of `GET` or `POST`.
|
233
|
+
# @return [WebhookInstance] Updated WebhookInstance
|
234
|
+
def update(pre_webhook_url: :unset, post_webhook_url: :unset, filters: :unset, method: :unset)
|
235
|
+
context.update(
|
236
|
+
pre_webhook_url: pre_webhook_url,
|
237
|
+
post_webhook_url: post_webhook_url,
|
238
|
+
filters: filters,
|
239
|
+
method: method,
|
240
|
+
)
|
241
|
+
end
|
242
|
+
|
243
|
+
##
|
244
|
+
# Fetch the WebhookInstance
|
245
|
+
# @return [WebhookInstance] Fetched WebhookInstance
|
246
|
+
def fetch
|
247
|
+
context.fetch
|
248
|
+
end
|
249
|
+
|
250
|
+
##
|
251
|
+
# Provide a user friendly representation
|
252
|
+
def to_s
|
253
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
254
|
+
"<Twilio.Conversations.V1.WebhookInstance #{values}>"
|
255
|
+
end
|
256
|
+
|
257
|
+
##
|
258
|
+
# Provide a detailed, user friendly representation
|
259
|
+
def inspect
|
260
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
261
|
+
"<Twilio.Conversations.V1.WebhookInstance #{values}>"
|
262
|
+
end
|
263
|
+
end
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
267
|
+
end
|
268
|
+
end
|
269
|
+
end
|
@@ -77,6 +77,7 @@ module Twilio
|
|
77
77
|
|
78
78
|
# Components
|
79
79
|
@notifications = nil
|
80
|
+
@webhooks = nil
|
80
81
|
end
|
81
82
|
|
82
83
|
##
|
@@ -127,6 +128,13 @@ module Twilio
|
|
127
128
|
return NotificationContext.new(@version, @solution[:chat_service_sid], )
|
128
129
|
end
|
129
130
|
|
131
|
+
##
|
132
|
+
# Access the webhooks
|
133
|
+
# @return [WebhookContext] WebhookContext
|
134
|
+
def webhooks
|
135
|
+
return WebhookContext.new(@version, @solution[:chat_service_sid], )
|
136
|
+
end
|
137
|
+
|
130
138
|
##
|
131
139
|
# Provide a user friendly representation
|
132
140
|
def to_s
|
@@ -168,6 +168,8 @@ module Twilio
|
|
168
168
|
'markdown' => payload['markdown'],
|
169
169
|
'url' => payload['url'],
|
170
170
|
'flex_insights_hr' => payload['flex_insights_hr'],
|
171
|
+
'flex_insights_drilldown' => payload['flex_insights_drilldown'],
|
172
|
+
'flex_url' => payload['flex_url'],
|
171
173
|
}
|
172
174
|
|
173
175
|
# Context
|
@@ -426,6 +428,18 @@ module Twilio
|
|
426
428
|
@properties['flex_insights_hr']
|
427
429
|
end
|
428
430
|
|
431
|
+
##
|
432
|
+
# @return [Boolean] Setting to enable Flex UI redirection
|
433
|
+
def flex_insights_drilldown
|
434
|
+
@properties['flex_insights_drilldown']
|
435
|
+
end
|
436
|
+
|
437
|
+
##
|
438
|
+
# @return [String] URL to redirect to in case drilldown is enabled.
|
439
|
+
def flex_url
|
440
|
+
@properties['flex_url']
|
441
|
+
end
|
442
|
+
|
429
443
|
##
|
430
444
|
# Fetch the ConfigurationInstance
|
431
445
|
# @param [String] ui_version The Pinned UI version of the Configuration resource
|
@@ -0,0 +1,416 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
module Twilio
|
10
|
+
module REST
|
11
|
+
class Supersim < Domain
|
12
|
+
class V1 < Version
|
13
|
+
##
|
14
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
15
|
+
class IpCommandList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the IpCommandList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @return [IpCommandList] IpCommandList
|
20
|
+
def initialize(version)
|
21
|
+
super(version)
|
22
|
+
|
23
|
+
# Path Solution
|
24
|
+
@solution = {}
|
25
|
+
@uri = "/IpCommands"
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# Create the IpCommandInstance
|
30
|
+
# @param [String] sim The `sid` or `unique_name` of the {Super
|
31
|
+
# SIM}[https://www.twilio.com/docs/iot/supersim/api/sim-resource] to send the IP
|
32
|
+
# Command to.
|
33
|
+
# @param [String] payload The payload to be delivered to the device.
|
34
|
+
# @param [String] device_port The device port to which the IP Command will be
|
35
|
+
# sent.
|
36
|
+
# @param [ip_command.PayloadType] payload_type Indicates how the payload is
|
37
|
+
# encoded. Either `text` or `binary`. Defaults to `text`.
|
38
|
+
# @param [String] callback_url The URL we should call using the `callback_method`
|
39
|
+
# after we have sent the IP Command.
|
40
|
+
# @param [String] callback_method The HTTP method we should use to call
|
41
|
+
# `callback_url`. Can be `GET` or `POST`, and the default is `POST`.
|
42
|
+
# @return [IpCommandInstance] Created IpCommandInstance
|
43
|
+
def create(sim: nil, payload: nil, device_port: nil, payload_type: :unset, callback_url: :unset, callback_method: :unset)
|
44
|
+
data = Twilio::Values.of({
|
45
|
+
'Sim' => sim,
|
46
|
+
'Payload' => payload,
|
47
|
+
'DevicePort' => device_port,
|
48
|
+
'PayloadType' => payload_type,
|
49
|
+
'CallbackUrl' => callback_url,
|
50
|
+
'CallbackMethod' => callback_method,
|
51
|
+
})
|
52
|
+
|
53
|
+
payload = @version.create('POST', @uri, data: data)
|
54
|
+
|
55
|
+
IpCommandInstance.new(@version, payload, )
|
56
|
+
end
|
57
|
+
|
58
|
+
##
|
59
|
+
# Lists IpCommandInstance records from the API as a list.
|
60
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
61
|
+
# memory before returning.
|
62
|
+
# @param [String] sim The SID or unique name of the Sim resource that IP Command
|
63
|
+
# was sent to or from.
|
64
|
+
# @param [String] sim_iccid The ICCID of the Sim resource that IP Command was sent
|
65
|
+
# to or from.
|
66
|
+
# @param [ip_command.Status] status The status of the IP Command. Can be:
|
67
|
+
# `queued`, `sent`, `received` or `failed`. See the {IP Command Status
|
68
|
+
# Values}[https://www.twilio.com/docs/wireless/api/ipcommand-resource#status-values]
|
69
|
+
# for a description of each.
|
70
|
+
# @param [ip_command.Direction] direction The direction of the IP Command. Can be
|
71
|
+
# `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term
|
72
|
+
# `mobile terminated`, and `from_sim` is synonymous with the term `mobile
|
73
|
+
# originated`.
|
74
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
75
|
+
# guarantees to never return more than limit. Default is no limit
|
76
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
77
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
78
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
79
|
+
# efficient page size, i.e. min(limit, 1000)
|
80
|
+
# @return [Array] Array of up to limit results
|
81
|
+
def list(sim: :unset, sim_iccid: :unset, status: :unset, direction: :unset, limit: nil, page_size: nil)
|
82
|
+
self.stream(
|
83
|
+
sim: sim,
|
84
|
+
sim_iccid: sim_iccid,
|
85
|
+
status: status,
|
86
|
+
direction: direction,
|
87
|
+
limit: limit,
|
88
|
+
page_size: page_size
|
89
|
+
).entries
|
90
|
+
end
|
91
|
+
|
92
|
+
##
|
93
|
+
# Streams IpCommandInstance records from the API as an Enumerable.
|
94
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
95
|
+
# is reached.
|
96
|
+
# @param [String] sim The SID or unique name of the Sim resource that IP Command
|
97
|
+
# was sent to or from.
|
98
|
+
# @param [String] sim_iccid The ICCID of the Sim resource that IP Command was sent
|
99
|
+
# to or from.
|
100
|
+
# @param [ip_command.Status] status The status of the IP Command. Can be:
|
101
|
+
# `queued`, `sent`, `received` or `failed`. See the {IP Command Status
|
102
|
+
# Values}[https://www.twilio.com/docs/wireless/api/ipcommand-resource#status-values]
|
103
|
+
# for a description of each.
|
104
|
+
# @param [ip_command.Direction] direction The direction of the IP Command. Can be
|
105
|
+
# `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term
|
106
|
+
# `mobile terminated`, and `from_sim` is synonymous with the term `mobile
|
107
|
+
# originated`.
|
108
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
109
|
+
# guarantees to never return more than limit. Default is no limit.
|
110
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
111
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
112
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
113
|
+
# efficient page size, i.e. min(limit, 1000)
|
114
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
115
|
+
def stream(sim: :unset, sim_iccid: :unset, status: :unset, direction: :unset, limit: nil, page_size: nil)
|
116
|
+
limits = @version.read_limits(limit, page_size)
|
117
|
+
|
118
|
+
page = self.page(
|
119
|
+
sim: sim,
|
120
|
+
sim_iccid: sim_iccid,
|
121
|
+
status: status,
|
122
|
+
direction: direction,
|
123
|
+
page_size: limits[:page_size],
|
124
|
+
)
|
125
|
+
|
126
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
127
|
+
end
|
128
|
+
|
129
|
+
##
|
130
|
+
# When passed a block, yields IpCommandInstance records from the API.
|
131
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
132
|
+
# is reached.
|
133
|
+
def each
|
134
|
+
limits = @version.read_limits
|
135
|
+
|
136
|
+
page = self.page(page_size: limits[:page_size], )
|
137
|
+
|
138
|
+
@version.stream(page,
|
139
|
+
limit: limits[:limit],
|
140
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
141
|
+
end
|
142
|
+
|
143
|
+
##
|
144
|
+
# Retrieve a single page of IpCommandInstance records from the API.
|
145
|
+
# Request is executed immediately.
|
146
|
+
# @param [String] sim The SID or unique name of the Sim resource that IP Command
|
147
|
+
# was sent to or from.
|
148
|
+
# @param [String] sim_iccid The ICCID of the Sim resource that IP Command was sent
|
149
|
+
# to or from.
|
150
|
+
# @param [ip_command.Status] status The status of the IP Command. Can be:
|
151
|
+
# `queued`, `sent`, `received` or `failed`. See the {IP Command Status
|
152
|
+
# Values}[https://www.twilio.com/docs/wireless/api/ipcommand-resource#status-values]
|
153
|
+
# for a description of each.
|
154
|
+
# @param [ip_command.Direction] direction The direction of the IP Command. Can be
|
155
|
+
# `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term
|
156
|
+
# `mobile terminated`, and `from_sim` is synonymous with the term `mobile
|
157
|
+
# originated`.
|
158
|
+
# @param [String] page_token PageToken provided by the API
|
159
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
160
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
161
|
+
# @return [Page] Page of IpCommandInstance
|
162
|
+
def page(sim: :unset, sim_iccid: :unset, status: :unset, direction: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
163
|
+
params = Twilio::Values.of({
|
164
|
+
'Sim' => sim,
|
165
|
+
'SimIccid' => sim_iccid,
|
166
|
+
'Status' => status,
|
167
|
+
'Direction' => direction,
|
168
|
+
'PageToken' => page_token,
|
169
|
+
'Page' => page_number,
|
170
|
+
'PageSize' => page_size,
|
171
|
+
})
|
172
|
+
|
173
|
+
response = @version.page('GET', @uri, params: params)
|
174
|
+
|
175
|
+
IpCommandPage.new(@version, response, @solution)
|
176
|
+
end
|
177
|
+
|
178
|
+
##
|
179
|
+
# Retrieve a single page of IpCommandInstance records from the API.
|
180
|
+
# Request is executed immediately.
|
181
|
+
# @param [String] target_url API-generated URL for the requested results page
|
182
|
+
# @return [Page] Page of IpCommandInstance
|
183
|
+
def get_page(target_url)
|
184
|
+
response = @version.domain.request(
|
185
|
+
'GET',
|
186
|
+
target_url
|
187
|
+
)
|
188
|
+
IpCommandPage.new(@version, response, @solution)
|
189
|
+
end
|
190
|
+
|
191
|
+
##
|
192
|
+
# Provide a user friendly representation
|
193
|
+
def to_s
|
194
|
+
'#<Twilio.Supersim.V1.IpCommandList>'
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
##
|
199
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
200
|
+
class IpCommandPage < Page
|
201
|
+
##
|
202
|
+
# Initialize the IpCommandPage
|
203
|
+
# @param [Version] version Version that contains the resource
|
204
|
+
# @param [Response] response Response from the API
|
205
|
+
# @param [Hash] solution Path solution for the resource
|
206
|
+
# @return [IpCommandPage] IpCommandPage
|
207
|
+
def initialize(version, response, solution)
|
208
|
+
super(version, response)
|
209
|
+
|
210
|
+
# Path Solution
|
211
|
+
@solution = solution
|
212
|
+
end
|
213
|
+
|
214
|
+
##
|
215
|
+
# Build an instance of IpCommandInstance
|
216
|
+
# @param [Hash] payload Payload response from the API
|
217
|
+
# @return [IpCommandInstance] IpCommandInstance
|
218
|
+
def get_instance(payload)
|
219
|
+
IpCommandInstance.new(@version, payload, )
|
220
|
+
end
|
221
|
+
|
222
|
+
##
|
223
|
+
# Provide a user friendly representation
|
224
|
+
def to_s
|
225
|
+
'<Twilio.Supersim.V1.IpCommandPage>'
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
##
|
230
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
231
|
+
class IpCommandContext < InstanceContext
|
232
|
+
##
|
233
|
+
# Initialize the IpCommandContext
|
234
|
+
# @param [Version] version Version that contains the resource
|
235
|
+
# @param [String] sid The SID of the IP Command resource to fetch.
|
236
|
+
# @return [IpCommandContext] IpCommandContext
|
237
|
+
def initialize(version, sid)
|
238
|
+
super(version)
|
239
|
+
|
240
|
+
# Path Solution
|
241
|
+
@solution = {sid: sid, }
|
242
|
+
@uri = "/IpCommands/#{@solution[:sid]}"
|
243
|
+
end
|
244
|
+
|
245
|
+
##
|
246
|
+
# Fetch the IpCommandInstance
|
247
|
+
# @return [IpCommandInstance] Fetched IpCommandInstance
|
248
|
+
def fetch
|
249
|
+
payload = @version.fetch('GET', @uri)
|
250
|
+
|
251
|
+
IpCommandInstance.new(@version, payload, sid: @solution[:sid], )
|
252
|
+
end
|
253
|
+
|
254
|
+
##
|
255
|
+
# Provide a user friendly representation
|
256
|
+
def to_s
|
257
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
258
|
+
"#<Twilio.Supersim.V1.IpCommandContext #{context}>"
|
259
|
+
end
|
260
|
+
|
261
|
+
##
|
262
|
+
# Provide a detailed, user friendly representation
|
263
|
+
def inspect
|
264
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
265
|
+
"#<Twilio.Supersim.V1.IpCommandContext #{context}>"
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
##
|
270
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
271
|
+
class IpCommandInstance < InstanceResource
|
272
|
+
##
|
273
|
+
# Initialize the IpCommandInstance
|
274
|
+
# @param [Version] version Version that contains the resource
|
275
|
+
# @param [Hash] payload payload that contains response from Twilio
|
276
|
+
# @param [String] sid The SID of the IP Command resource to fetch.
|
277
|
+
# @return [IpCommandInstance] IpCommandInstance
|
278
|
+
def initialize(version, payload, sid: nil)
|
279
|
+
super(version)
|
280
|
+
|
281
|
+
# Marshaled Properties
|
282
|
+
@properties = {
|
283
|
+
'sid' => payload['sid'],
|
284
|
+
'account_sid' => payload['account_sid'],
|
285
|
+
'sim_sid' => payload['sim_sid'],
|
286
|
+
'sim_iccid' => payload['sim_iccid'],
|
287
|
+
'status' => payload['status'],
|
288
|
+
'direction' => payload['direction'],
|
289
|
+
'device_ip' => payload['device_ip'],
|
290
|
+
'device_port' => payload['device_port'].to_i,
|
291
|
+
'payload_type' => payload['payload_type'],
|
292
|
+
'payload' => payload['payload'],
|
293
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
294
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
295
|
+
'url' => payload['url'],
|
296
|
+
}
|
297
|
+
|
298
|
+
# Context
|
299
|
+
@instance_context = nil
|
300
|
+
@params = {'sid' => sid || @properties['sid'], }
|
301
|
+
end
|
302
|
+
|
303
|
+
##
|
304
|
+
# Generate an instance context for the instance, the context is capable of
|
305
|
+
# performing various actions. All instance actions are proxied to the context
|
306
|
+
# @return [IpCommandContext] IpCommandContext for this IpCommandInstance
|
307
|
+
def context
|
308
|
+
unless @instance_context
|
309
|
+
@instance_context = IpCommandContext.new(@version, @params['sid'], )
|
310
|
+
end
|
311
|
+
@instance_context
|
312
|
+
end
|
313
|
+
|
314
|
+
##
|
315
|
+
# @return [String] The unique string that identifies the resource
|
316
|
+
def sid
|
317
|
+
@properties['sid']
|
318
|
+
end
|
319
|
+
|
320
|
+
##
|
321
|
+
# @return [String] The SID of the Account that created the resource
|
322
|
+
def account_sid
|
323
|
+
@properties['account_sid']
|
324
|
+
end
|
325
|
+
|
326
|
+
##
|
327
|
+
# @return [String] The SID of the Super SIM that this IP Command was sent to or from
|
328
|
+
def sim_sid
|
329
|
+
@properties['sim_sid']
|
330
|
+
end
|
331
|
+
|
332
|
+
##
|
333
|
+
# @return [String] The ICCID of the Super SIM that this IP Command was sent to or from
|
334
|
+
def sim_iccid
|
335
|
+
@properties['sim_iccid']
|
336
|
+
end
|
337
|
+
|
338
|
+
##
|
339
|
+
# @return [ip_command.Status] The status of the IP Command
|
340
|
+
def status
|
341
|
+
@properties['status']
|
342
|
+
end
|
343
|
+
|
344
|
+
##
|
345
|
+
# @return [ip_command.Direction] The direction of the IP Command
|
346
|
+
def direction
|
347
|
+
@properties['direction']
|
348
|
+
end
|
349
|
+
|
350
|
+
##
|
351
|
+
# @return [String] The IP address of the device that the IP Command was sent to or received from
|
352
|
+
def device_ip
|
353
|
+
@properties['device_ip']
|
354
|
+
end
|
355
|
+
|
356
|
+
##
|
357
|
+
# @return [String] The port that the IP Command either originated from or was sent to
|
358
|
+
def device_port
|
359
|
+
@properties['device_port']
|
360
|
+
end
|
361
|
+
|
362
|
+
##
|
363
|
+
# @return [ip_command.PayloadType] The payload type of the IP Command
|
364
|
+
def payload_type
|
365
|
+
@properties['payload_type']
|
366
|
+
end
|
367
|
+
|
368
|
+
##
|
369
|
+
# @return [String] The payload of the IP Command sent to or from the Super SIM
|
370
|
+
def payload
|
371
|
+
@properties['payload']
|
372
|
+
end
|
373
|
+
|
374
|
+
##
|
375
|
+
# @return [Time] The ISO 8601 date and time in GMT when the resource was created
|
376
|
+
def date_created
|
377
|
+
@properties['date_created']
|
378
|
+
end
|
379
|
+
|
380
|
+
##
|
381
|
+
# @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
|
382
|
+
def date_updated
|
383
|
+
@properties['date_updated']
|
384
|
+
end
|
385
|
+
|
386
|
+
##
|
387
|
+
# @return [String] The absolute URL of the IP Command resource
|
388
|
+
def url
|
389
|
+
@properties['url']
|
390
|
+
end
|
391
|
+
|
392
|
+
##
|
393
|
+
# Fetch the IpCommandInstance
|
394
|
+
# @return [IpCommandInstance] Fetched IpCommandInstance
|
395
|
+
def fetch
|
396
|
+
context.fetch
|
397
|
+
end
|
398
|
+
|
399
|
+
##
|
400
|
+
# Provide a user friendly representation
|
401
|
+
def to_s
|
402
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
403
|
+
"<Twilio.Supersim.V1.IpCommandInstance #{values}>"
|
404
|
+
end
|
405
|
+
|
406
|
+
##
|
407
|
+
# Provide a detailed, user friendly representation
|
408
|
+
def inspect
|
409
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
410
|
+
"<Twilio.Supersim.V1.IpCommandInstance #{values}>"
|
411
|
+
end
|
412
|
+
end
|
413
|
+
end
|
414
|
+
end
|
415
|
+
end
|
416
|
+
end
|
@@ -17,6 +17,7 @@ module Twilio
|
|
17
17
|
@version = 'v1'
|
18
18
|
@commands = nil
|
19
19
|
@fleets = nil
|
20
|
+
@ip_commands = nil
|
20
21
|
@networks = nil
|
21
22
|
@network_access_profiles = nil
|
22
23
|
@sims = nil
|
@@ -54,6 +55,21 @@ module Twilio
|
|
54
55
|
end
|
55
56
|
end
|
56
57
|
|
58
|
+
##
|
59
|
+
# @param [String] sid The SID of the IP Command resource to fetch.
|
60
|
+
# @return [Twilio::REST::Supersim::V1::IpCommandContext] if sid was passed.
|
61
|
+
# @return [Twilio::REST::Supersim::V1::IpCommandList]
|
62
|
+
def ip_commands(sid=:unset)
|
63
|
+
if sid.nil?
|
64
|
+
raise ArgumentError, 'sid cannot be nil'
|
65
|
+
end
|
66
|
+
if sid == :unset
|
67
|
+
@ip_commands ||= IpCommandList.new self
|
68
|
+
else
|
69
|
+
IpCommandContext.new(self, sid)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
57
73
|
##
|
58
74
|
# @param [String] sid The SID of the Network resource to fetch.
|
59
75
|
# @return [Twilio::REST::Supersim::V1::NetworkContext] if sid was passed.
|
@@ -46,6 +46,15 @@ module Twilio
|
|
46
46
|
self.v1.fleets(sid)
|
47
47
|
end
|
48
48
|
|
49
|
+
##
|
50
|
+
# @param [String] sid The unique string that we created to identify the IP Command
|
51
|
+
# resource.
|
52
|
+
# @return [Twilio::REST::Supersim::V1::IpCommandInstance] if sid was passed.
|
53
|
+
# @return [Twilio::REST::Supersim::V1::IpCommandList]
|
54
|
+
def ip_commands(sid=:unset)
|
55
|
+
self.v1.ip_commands(sid)
|
56
|
+
end
|
57
|
+
|
49
58
|
##
|
50
59
|
# @param [String] sid The unique string that we created to identify the Network
|
51
60
|
# resource.
|
@@ -35,9 +35,15 @@ module Twilio
|
|
35
35
|
# external system, such as your user's UUID, GUID, or SID.
|
36
36
|
# @param [access_token.FactorTypes] factor_type The Type of this Factor. Eg.
|
37
37
|
# `push`
|
38
|
+
# @param [String] factor_friendly_name The friendly name of the factor that is
|
39
|
+
# going to be created with this access token
|
38
40
|
# @return [AccessTokenInstance] Created AccessTokenInstance
|
39
|
-
def create(identity: nil, factor_type: nil)
|
40
|
-
data = Twilio::Values.of({
|
41
|
+
def create(identity: nil, factor_type: nil, factor_friendly_name: :unset)
|
42
|
+
data = Twilio::Values.of({
|
43
|
+
'Identity' => identity,
|
44
|
+
'FactorType' => factor_type,
|
45
|
+
'FactorFriendlyName' => factor_friendly_name,
|
46
|
+
})
|
41
47
|
|
42
48
|
payload = @version.create('POST', @uri, data: data)
|
43
49
|
|
@@ -60,8 +60,11 @@ module Twilio
|
|
60
60
|
# @param [Boolean] audio_only When set to true, indicates that the participants in
|
61
61
|
# the room will only publish audio. No video tracks will be allowed. Group rooms
|
62
62
|
# only.
|
63
|
+
# @param [String] max_participant_duration The maximum number of seconds a
|
64
|
+
# Participant can be connected to the room. The maximum possible value is 86400
|
65
|
+
# seconds (24 hours). The default is 14400 seconds (4 hours).
|
63
66
|
# @return [RoomInstance] Created RoomInstance
|
64
|
-
def create(enable_turn: :unset, type: :unset, unique_name: :unset, status_callback: :unset, status_callback_method: :unset, max_participants: :unset, record_participants_on_connect: :unset, video_codecs: :unset, media_region: :unset, recording_rules: :unset, audio_only: :unset)
|
67
|
+
def create(enable_turn: :unset, type: :unset, unique_name: :unset, status_callback: :unset, status_callback_method: :unset, max_participants: :unset, record_participants_on_connect: :unset, video_codecs: :unset, media_region: :unset, recording_rules: :unset, audio_only: :unset, max_participant_duration: :unset)
|
65
68
|
data = Twilio::Values.of({
|
66
69
|
'EnableTurn' => enable_turn,
|
67
70
|
'Type' => type,
|
@@ -74,6 +77,7 @@ module Twilio
|
|
74
77
|
'MediaRegion' => media_region,
|
75
78
|
'RecordingRules' => Twilio.serialize_object(recording_rules),
|
76
79
|
'AudioOnly' => audio_only,
|
80
|
+
'MaxParticipantDuration' => max_participant_duration,
|
77
81
|
})
|
78
82
|
|
79
83
|
payload = @version.create('POST', @uri, data: data)
|
@@ -364,6 +368,7 @@ module Twilio
|
|
364
368
|
'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i,
|
365
369
|
'type' => payload['type'],
|
366
370
|
'max_participants' => payload['max_participants'].to_i,
|
371
|
+
'max_participant_duration' => payload['max_participant_duration'].to_i,
|
367
372
|
'max_concurrent_published_tracks' => payload['max_concurrent_published_tracks'] == nil ? payload['max_concurrent_published_tracks'] : payload['max_concurrent_published_tracks'].to_i,
|
368
373
|
'record_participants_on_connect' => payload['record_participants_on_connect'],
|
369
374
|
'video_codecs' => payload['video_codecs'],
|
@@ -467,6 +472,12 @@ module Twilio
|
|
467
472
|
@properties['max_participants']
|
468
473
|
end
|
469
474
|
|
475
|
+
##
|
476
|
+
# @return [String] The maximum number of seconds a Participant can be connected to the room
|
477
|
+
def max_participant_duration
|
478
|
+
@properties['max_participant_duration']
|
479
|
+
end
|
480
|
+
|
470
481
|
##
|
471
482
|
# @return [String] The maximum number of published tracks allowed in the room at the same time
|
472
483
|
def max_concurrent_published_tracks
|
data/lib/twilio-ruby/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twilio-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.61.
|
4
|
+
version: 5.61.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Twilio API Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -406,6 +406,7 @@ files:
|
|
406
406
|
- lib/twilio-ruby/rest/conversations/v1/service/binding.rb
|
407
407
|
- lib/twilio-ruby/rest/conversations/v1/service/configuration.rb
|
408
408
|
- lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb
|
409
|
+
- lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb
|
409
410
|
- lib/twilio-ruby/rest/conversations/v1/service/conversation.rb
|
410
411
|
- lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb
|
411
412
|
- lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb
|
@@ -637,6 +638,7 @@ files:
|
|
637
638
|
- lib/twilio-ruby/rest/supersim/v1.rb
|
638
639
|
- lib/twilio-ruby/rest/supersim/v1/command.rb
|
639
640
|
- lib/twilio-ruby/rest/supersim/v1/fleet.rb
|
641
|
+
- lib/twilio-ruby/rest/supersim/v1/ip_command.rb
|
640
642
|
- lib/twilio-ruby/rest/supersim/v1/network.rb
|
641
643
|
- lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb
|
642
644
|
- lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb
|