twilio-ruby 7.4.5 → 7.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.dockerignore +1 -1
- data/CHANGES.md +33 -0
- data/Dockerfile +2 -1
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/accounts/v1/safelist.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +9 -3
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +3 -0
- data/lib/twilio-ruby/rest/flex_api/v2/flex_user.rb +0 -39
- data/lib/twilio-ruby/rest/iam/v1/{key.rb → new_api_key.rb} +20 -20
- data/lib/twilio-ruby/rest/iam/v1/token.rb +186 -0
- data/lib/twilio-ruby/rest/iam/v1.rb +10 -4
- data/lib/twilio-ruby/rest/preview_base.rb +0 -5
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +2 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +2 -2
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +4 -1
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +4 -13
- data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +0 -407
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +0 -472
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +0 -467
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +0 -407
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +0 -444
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +0 -470
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +0 -407
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +0 -444
- data/lib/twilio-ruby/rest/preview/sync/service.rb +0 -529
- data/lib/twilio-ruby/rest/preview/sync.rb +0 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aad54e4127225802d5b5d4a1e3711e2237721b9b
|
4
|
+
data.tar.gz: 33661730ed8d04136f1d82c41d06637efacba9f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4ab77c9062fc59a357c9ee328461b8d1d65a940cd90316abe2c1c31e519e2c8929f9185bcd167f4076783f1c355f073945acad8edc45aa6c624608a77ce6b92
|
7
|
+
data.tar.gz: ac5416a1673ba49aafef4a58dc5f5dbb77a88dec86e620c97cf2a04fd9f10f9fc8fa6ba761d9ab22f70375d6fb5816b7aefbc05ccb8e943b74795fd39a0603f7
|
data/.dockerignore
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Gemfile.lock
|
1
|
+
Gemfile.lock
|
data/CHANGES.md
CHANGED
@@ -1,6 +1,39 @@
|
|
1
1
|
twilio-ruby changelog
|
2
2
|
=====================
|
3
3
|
|
4
|
+
[2025-03-20] Version 7.5.1
|
5
|
+
--------------------------
|
6
|
+
**Accounts**
|
7
|
+
- Update Safelist API docs as part of prefix supoort
|
8
|
+
|
9
|
+
**Flex**
|
10
|
+
- Removing `first_name`, `last_name`, and `friendly_name` from the Flex User API
|
11
|
+
|
12
|
+
**Messaging**
|
13
|
+
- Add missing tests under transaction/phone_numbers and transaction/short_code
|
14
|
+
|
15
|
+
|
16
|
+
[2025-03-11] Version 7.5.0
|
17
|
+
--------------------------
|
18
|
+
**Library - Feature**
|
19
|
+
- [PR #745](https://github.com/twilio/twilio-ruby/pull/745): MVR ready. Thanks to [@manisha1997](https://github.com/manisha1997)!
|
20
|
+
|
21
|
+
**Library - Chore**
|
22
|
+
- [PR #744](https://github.com/twilio/twilio-ruby/pull/744): create image with required files. Thanks to [@sbansla](https://github.com/sbansla)!
|
23
|
+
|
24
|
+
**Api**
|
25
|
+
- Add the missing `emergency_enabled` field for `Address Service` endpoints
|
26
|
+
|
27
|
+
**Messaging**
|
28
|
+
- Add missing enums for A2P and TF
|
29
|
+
|
30
|
+
**Numbers**
|
31
|
+
- add missing enum values to hosted_number_order_status
|
32
|
+
|
33
|
+
**Twiml**
|
34
|
+
- Convert Twiml Attribute `speechModel` of type enum to string **(breaking change)**
|
35
|
+
|
36
|
+
|
4
37
|
[2025-02-20] Version 7.4.5
|
5
38
|
--------------------------
|
6
39
|
**Flex**
|
data/Dockerfile
CHANGED
data/README.md
CHANGED
@@ -39,13 +39,13 @@ This library supports the following Ruby implementations:
|
|
39
39
|
To install using [Bundler][bundler] grab the latest stable version:
|
40
40
|
|
41
41
|
```ruby
|
42
|
-
gem 'twilio-ruby', '~> 7.
|
42
|
+
gem 'twilio-ruby', '~> 7.5.1'
|
43
43
|
```
|
44
44
|
|
45
45
|
To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
|
46
46
|
|
47
47
|
```bash
|
48
|
-
gem install twilio-ruby -v 7.
|
48
|
+
gem install twilio-ruby -v 7.5.1
|
49
49
|
```
|
50
50
|
|
51
51
|
To build and install the development branch yourself from the latest source:
|
@@ -32,7 +32,7 @@ module Twilio
|
|
32
32
|
end
|
33
33
|
##
|
34
34
|
# Create the SafelistInstance
|
35
|
-
# @param [String] phone_number The phone number to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
|
35
|
+
# @param [String] phone_number The phone number or phone number 1k prefix to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
|
36
36
|
# @return [SafelistInstance] Created SafelistInstance
|
37
37
|
def create(
|
38
38
|
phone_number: nil
|
@@ -57,7 +57,7 @@ module Twilio
|
|
57
57
|
|
58
58
|
##
|
59
59
|
# Delete the SafelistInstance
|
60
|
-
# @param [String] phone_number The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
|
60
|
+
# @param [String] phone_number The phone number or phone number 1k prefix to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
|
61
61
|
# @return [Boolean] True if delete succeeds, false otherwise
|
62
62
|
def delete(
|
63
63
|
phone_number: :unset
|
@@ -75,7 +75,7 @@ module Twilio
|
|
75
75
|
|
76
76
|
##
|
77
77
|
# Fetch the SafelistInstance
|
78
|
-
# @param [String] phone_number The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
|
78
|
+
# @param [String] phone_number The phone number or phone number 1k prefix to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
|
79
79
|
# @return [SafelistInstance] Fetched SafelistInstance
|
80
80
|
def fetch(
|
81
81
|
phone_number: :unset
|
@@ -162,7 +162,7 @@ module Twilio
|
|
162
162
|
end
|
163
163
|
|
164
164
|
##
|
165
|
-
# @return [String] The phone number in SafeList.
|
165
|
+
# @return [String] The phone number or phone number 1k prefix in SafeList.
|
166
166
|
def phone_number
|
167
167
|
@properties['phone_number']
|
168
168
|
end
|
@@ -92,6 +92,7 @@ module Twilio
|
|
92
92
|
# memory before returning.
|
93
93
|
# @param [String] customer_name The `customer_name` of the Address resources to read.
|
94
94
|
# @param [String] friendly_name The string that identifies the Address resources to read.
|
95
|
+
# @param [Boolean] emergency_enabled Whether the address can be associated to a number for emergency calling.
|
95
96
|
# @param [String] iso_country The ISO country code of the Address resources to read.
|
96
97
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
97
98
|
# guarantees to never return more than limit. Default is no limit
|
@@ -100,10 +101,11 @@ module Twilio
|
|
100
101
|
# but a limit is defined, stream() will attempt to read the limit with the most
|
101
102
|
# efficient page size, i.e. min(limit, 1000)
|
102
103
|
# @return [Array] Array of up to limit results
|
103
|
-
def list(customer_name: :unset, friendly_name: :unset, iso_country: :unset, limit: nil, page_size: nil)
|
104
|
+
def list(customer_name: :unset, friendly_name: :unset, emergency_enabled: :unset, iso_country: :unset, limit: nil, page_size: nil)
|
104
105
|
self.stream(
|
105
106
|
customer_name: customer_name,
|
106
107
|
friendly_name: friendly_name,
|
108
|
+
emergency_enabled: emergency_enabled,
|
107
109
|
iso_country: iso_country,
|
108
110
|
limit: limit,
|
109
111
|
page_size: page_size
|
@@ -116,6 +118,7 @@ module Twilio
|
|
116
118
|
# is reached.
|
117
119
|
# @param [String] customer_name The `customer_name` of the Address resources to read.
|
118
120
|
# @param [String] friendly_name The string that identifies the Address resources to read.
|
121
|
+
# @param [Boolean] emergency_enabled Whether the address can be associated to a number for emergency calling.
|
119
122
|
# @param [String] iso_country The ISO country code of the Address resources to read.
|
120
123
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
121
124
|
# guarantees to never return more than limit. Default is no limit
|
@@ -124,12 +127,13 @@ module Twilio
|
|
124
127
|
# but a limit is defined, stream() will attempt to read the limit with the most
|
125
128
|
# efficient page size, i.e. min(limit, 1000)
|
126
129
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
127
|
-
def stream(customer_name: :unset, friendly_name: :unset, iso_country: :unset, limit: nil, page_size: nil)
|
130
|
+
def stream(customer_name: :unset, friendly_name: :unset, emergency_enabled: :unset, iso_country: :unset, limit: nil, page_size: nil)
|
128
131
|
limits = @version.read_limits(limit, page_size)
|
129
132
|
|
130
133
|
page = self.page(
|
131
134
|
customer_name: customer_name,
|
132
135
|
friendly_name: friendly_name,
|
136
|
+
emergency_enabled: emergency_enabled,
|
133
137
|
iso_country: iso_country,
|
134
138
|
page_size: limits[:page_size], )
|
135
139
|
|
@@ -155,15 +159,17 @@ module Twilio
|
|
155
159
|
# Request is executed immediately.
|
156
160
|
# @param [String] customer_name The `customer_name` of the Address resources to read.
|
157
161
|
# @param [String] friendly_name The string that identifies the Address resources to read.
|
162
|
+
# @param [Boolean] emergency_enabled Whether the address can be associated to a number for emergency calling.
|
158
163
|
# @param [String] iso_country The ISO country code of the Address resources to read.
|
159
164
|
# @param [String] page_token PageToken provided by the API
|
160
165
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
161
166
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
162
167
|
# @return [Page] Page of AddressInstance
|
163
|
-
def page(customer_name: :unset, friendly_name: :unset, iso_country: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
168
|
+
def page(customer_name: :unset, friendly_name: :unset, emergency_enabled: :unset, iso_country: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
164
169
|
params = Twilio::Values.of({
|
165
170
|
'CustomerName' => customer_name,
|
166
171
|
'FriendlyName' => friendly_name,
|
172
|
+
'EmergencyEnabled' => emergency_enabled,
|
167
173
|
'IsoCountry' => iso_country,
|
168
174
|
'PageToken' => page_token,
|
169
175
|
'Page' => page_number,
|
@@ -61,7 +61,7 @@ module Twilio
|
|
61
61
|
# @param [String] recording_status_callback_method The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
|
62
62
|
# @param [String] sip_auth_username The SIP username used for authentication.
|
63
63
|
# @param [String] sip_auth_password The SIP password for authentication.
|
64
|
-
# @param [String] region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`.
|
64
|
+
# @param [String] region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`.
|
65
65
|
# @param [String] conference_recording_status_callback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available.
|
66
66
|
# @param [String] conference_recording_status_callback_method The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
|
67
67
|
# @param [Array[String]] recording_status_callback_event The recording state changes that should generate a call to `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'`.
|
@@ -406,7 +406,7 @@ module Twilio
|
|
406
406
|
end
|
407
407
|
|
408
408
|
##
|
409
|
-
# @return [String] A string that represents the Twilio Region where the conference audio was mixed. May be `us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, and `jp1`. Basic conference audio will always be mixed in `us1`. Global Conference audio will be mixed nearest to the majority of participants.
|
409
|
+
# @return [String] A string that represents the Twilio Region where the conference audio was mixed. May be `us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, and `jp1`. Basic conference audio will always be mixed in `us1`. Global Conference audio will be mixed nearest to the majority of participants.
|
410
410
|
def region
|
411
411
|
@properties['region']
|
412
412
|
end
|
@@ -46,6 +46,7 @@ module Twilio
|
|
46
46
|
# @param [AddressRetention] address_retention
|
47
47
|
# @param [Boolean] smart_encoded Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`.
|
48
48
|
# @param [Array[String]] persistent_action Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp).
|
49
|
+
# @param [TrafficType] traffic_type
|
49
50
|
# @param [Boolean] shorten_urls For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided.
|
50
51
|
# @param [ScheduleType] schedule_type
|
51
52
|
# @param [Time] send_at The time that Twilio will send the message. Must be in ISO 8601 format.
|
@@ -71,6 +72,7 @@ module Twilio
|
|
71
72
|
address_retention: :unset,
|
72
73
|
smart_encoded: :unset,
|
73
74
|
persistent_action: :unset,
|
75
|
+
traffic_type: :unset,
|
74
76
|
shorten_urls: :unset,
|
75
77
|
schedule_type: :unset,
|
76
78
|
send_at: :unset,
|
@@ -97,6 +99,7 @@ module Twilio
|
|
97
99
|
'AddressRetention' => address_retention,
|
98
100
|
'SmartEncoded' => smart_encoded,
|
99
101
|
'PersistentAction' => Twilio.serialize_list(persistent_action) { |e| e },
|
102
|
+
'TrafficType' => traffic_type,
|
100
103
|
'ShortenUrls' => shorten_urls,
|
101
104
|
'ScheduleType' => schedule_type,
|
102
105
|
'SendAt' => Twilio.serialize_iso8601_datetime(send_at),
|
@@ -78,27 +78,18 @@ module Twilio
|
|
78
78
|
|
79
79
|
##
|
80
80
|
# Update the FlexUserInstance
|
81
|
-
# @param [String] first_name First name of the User.
|
82
|
-
# @param [String] last_name Last name of the User.
|
83
81
|
# @param [String] email Email of the User.
|
84
|
-
# @param [String] friendly_name Friendly name of the User.
|
85
82
|
# @param [String] user_sid The unique SID identifier of the Twilio Unified User.
|
86
83
|
# @param [String] locale The locale preference of the user.
|
87
84
|
# @return [FlexUserInstance] Updated FlexUserInstance
|
88
85
|
def update(
|
89
|
-
first_name: :unset,
|
90
|
-
last_name: :unset,
|
91
86
|
email: :unset,
|
92
|
-
friendly_name: :unset,
|
93
87
|
user_sid: :unset,
|
94
88
|
locale: :unset
|
95
89
|
)
|
96
90
|
|
97
91
|
data = Twilio::Values.of({
|
98
|
-
'FirstName' => first_name,
|
99
|
-
'LastName' => last_name,
|
100
92
|
'Email' => email,
|
101
|
-
'FriendlyName' => friendly_name,
|
102
93
|
'UserSid' => user_sid,
|
103
94
|
'Locale' => locale,
|
104
95
|
})
|
@@ -184,11 +175,8 @@ module Twilio
|
|
184
175
|
'worker_sid' => payload['worker_sid'],
|
185
176
|
'workspace_sid' => payload['workspace_sid'],
|
186
177
|
'flex_team_sid' => payload['flex_team_sid'],
|
187
|
-
'first_name' => payload['first_name'],
|
188
|
-
'last_name' => payload['last_name'],
|
189
178
|
'username' => payload['username'],
|
190
179
|
'email' => payload['email'],
|
191
|
-
'friendly_name' => payload['friendly_name'],
|
192
180
|
'locale' => payload['locale'],
|
193
181
|
'roles' => payload['roles'],
|
194
182
|
'created_date' => Twilio.deserialize_iso8601_datetime(payload['created_date']),
|
@@ -255,18 +243,6 @@ module Twilio
|
|
255
243
|
@properties['flex_team_sid']
|
256
244
|
end
|
257
245
|
|
258
|
-
##
|
259
|
-
# @return [String] First name of the User.
|
260
|
-
def first_name
|
261
|
-
@properties['first_name']
|
262
|
-
end
|
263
|
-
|
264
|
-
##
|
265
|
-
# @return [String] Last name of the User.
|
266
|
-
def last_name
|
267
|
-
@properties['last_name']
|
268
|
-
end
|
269
|
-
|
270
246
|
##
|
271
247
|
# @return [String] Username of the User.
|
272
248
|
def username
|
@@ -279,12 +255,6 @@ module Twilio
|
|
279
255
|
@properties['email']
|
280
256
|
end
|
281
257
|
|
282
|
-
##
|
283
|
-
# @return [String] Friendly name of the User.
|
284
|
-
def friendly_name
|
285
|
-
@properties['friendly_name']
|
286
|
-
end
|
287
|
-
|
288
258
|
##
|
289
259
|
# @return [String] The locale preference of the user.
|
290
260
|
def locale
|
@@ -331,27 +301,18 @@ module Twilio
|
|
331
301
|
|
332
302
|
##
|
333
303
|
# Update the FlexUserInstance
|
334
|
-
# @param [String] first_name First name of the User.
|
335
|
-
# @param [String] last_name Last name of the User.
|
336
304
|
# @param [String] email Email of the User.
|
337
|
-
# @param [String] friendly_name Friendly name of the User.
|
338
305
|
# @param [String] user_sid The unique SID identifier of the Twilio Unified User.
|
339
306
|
# @param [String] locale The locale preference of the user.
|
340
307
|
# @return [FlexUserInstance] Updated FlexUserInstance
|
341
308
|
def update(
|
342
|
-
first_name: :unset,
|
343
|
-
last_name: :unset,
|
344
309
|
email: :unset,
|
345
|
-
friendly_name: :unset,
|
346
310
|
user_sid: :unset,
|
347
311
|
locale: :unset
|
348
312
|
)
|
349
313
|
|
350
314
|
context.update(
|
351
|
-
first_name: first_name,
|
352
|
-
last_name: last_name,
|
353
315
|
email: email,
|
354
|
-
friendly_name: friendly_name,
|
355
316
|
user_sid: user_sid,
|
356
317
|
locale: locale,
|
357
318
|
)
|
@@ -17,12 +17,12 @@ module Twilio
|
|
17
17
|
module REST
|
18
18
|
class Iam < IamBase
|
19
19
|
class V1 < Version
|
20
|
-
class
|
20
|
+
class NewApiKeyList < ListResource
|
21
21
|
|
22
22
|
##
|
23
|
-
# Initialize the
|
23
|
+
# Initialize the NewApiKeyList
|
24
24
|
# @param [Version] version Version that contains the resource
|
25
|
-
# @return [
|
25
|
+
# @return [NewApiKeyList] NewApiKeyList
|
26
26
|
def initialize(version)
|
27
27
|
super(version)
|
28
28
|
# Path Solution
|
@@ -31,12 +31,12 @@ module Twilio
|
|
31
31
|
|
32
32
|
end
|
33
33
|
##
|
34
|
-
# Create the
|
34
|
+
# Create the NewApiKeyInstance
|
35
35
|
# @param [String] account_sid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource.
|
36
36
|
# @param [String] friendly_name A descriptive string that you create to describe the resource. It can be up to 64 characters long.
|
37
37
|
# @param [Keytype] key_type
|
38
38
|
# @param [Object] policy The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys).
|
39
|
-
# @return [
|
39
|
+
# @return [NewApiKeyInstance] Created NewApiKeyInstance
|
40
40
|
def create(
|
41
41
|
account_sid: nil,
|
42
42
|
friendly_name: :unset,
|
@@ -58,7 +58,7 @@ module Twilio
|
|
58
58
|
|
59
59
|
|
60
60
|
payload = @version.create('POST', @uri, data: data, headers: headers)
|
61
|
-
|
61
|
+
NewApiKeyInstance.new(
|
62
62
|
@version,
|
63
63
|
payload,
|
64
64
|
)
|
@@ -69,17 +69,17 @@ module Twilio
|
|
69
69
|
|
70
70
|
# Provide a user friendly representation
|
71
71
|
def to_s
|
72
|
-
'#<Twilio.Iam.V1.
|
72
|
+
'#<Twilio.Iam.V1.NewApiKeyList>'
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
-
class
|
76
|
+
class NewApiKeyPage < Page
|
77
77
|
##
|
78
|
-
# Initialize the
|
78
|
+
# Initialize the NewApiKeyPage
|
79
79
|
# @param [Version] version Version that contains the resource
|
80
80
|
# @param [Response] response Response from the API
|
81
81
|
# @param [Hash] solution Path solution for the resource
|
82
|
-
# @return [
|
82
|
+
# @return [NewApiKeyPage] NewApiKeyPage
|
83
83
|
def initialize(version, response, solution)
|
84
84
|
super(version, response)
|
85
85
|
|
@@ -88,29 +88,29 @@ module Twilio
|
|
88
88
|
end
|
89
89
|
|
90
90
|
##
|
91
|
-
# Build an instance of
|
91
|
+
# Build an instance of NewApiKeyInstance
|
92
92
|
# @param [Hash] payload Payload response from the API
|
93
|
-
# @return [
|
93
|
+
# @return [NewApiKeyInstance] NewApiKeyInstance
|
94
94
|
def get_instance(payload)
|
95
|
-
|
95
|
+
NewApiKeyInstance.new(@version, payload)
|
96
96
|
end
|
97
97
|
|
98
98
|
##
|
99
99
|
# Provide a user friendly representation
|
100
100
|
def to_s
|
101
|
-
'<Twilio.Iam.V1.
|
101
|
+
'<Twilio.Iam.V1.NewApiKeyPage>'
|
102
102
|
end
|
103
103
|
end
|
104
|
-
class
|
104
|
+
class NewApiKeyInstance < InstanceResource
|
105
105
|
##
|
106
|
-
# Initialize the
|
106
|
+
# Initialize the NewApiKeyInstance
|
107
107
|
# @param [Version] version Version that contains the resource
|
108
108
|
# @param [Hash] payload payload that contains response from Twilio
|
109
109
|
# @param [String] account_sid The SID of the
|
110
|
-
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this
|
110
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this NewApiKey
|
111
111
|
# resource.
|
112
112
|
# @param [String] sid The SID of the Call resource to fetch.
|
113
|
-
# @return [
|
113
|
+
# @return [NewApiKeyInstance] NewApiKeyInstance
|
114
114
|
def initialize(version, payload )
|
115
115
|
super(version)
|
116
116
|
|
@@ -165,13 +165,13 @@ module Twilio
|
|
165
165
|
##
|
166
166
|
# Provide a user friendly representation
|
167
167
|
def to_s
|
168
|
-
"<Twilio.Iam.V1.
|
168
|
+
"<Twilio.Iam.V1.NewApiKeyInstance>"
|
169
169
|
end
|
170
170
|
|
171
171
|
##
|
172
172
|
# Provide a detailed, user friendly representation
|
173
173
|
def inspect
|
174
|
-
"<Twilio.Iam.V1.
|
174
|
+
"<Twilio.Iam.V1.NewApiKeyInstance>"
|
175
175
|
end
|
176
176
|
end
|
177
177
|
|
@@ -0,0 +1,186 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
4
|
+
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
5
|
+
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
6
|
+
#
|
7
|
+
# Twilio - Iam
|
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 Iam < IamBase
|
19
|
+
class V1 < Version
|
20
|
+
class TokenList < ListResource
|
21
|
+
|
22
|
+
##
|
23
|
+
# Initialize the TokenList
|
24
|
+
# @param [Version] version Version that contains the resource
|
25
|
+
# @return [TokenList] TokenList
|
26
|
+
def initialize(version)
|
27
|
+
super(version)
|
28
|
+
# Path Solution
|
29
|
+
@solution = { }
|
30
|
+
@uri = "/token"
|
31
|
+
|
32
|
+
end
|
33
|
+
##
|
34
|
+
# Create the TokenInstance
|
35
|
+
# @param [String] grant_type Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token.
|
36
|
+
# @param [String] client_id A 34 character string that uniquely identifies this OAuth App.
|
37
|
+
# @param [String] client_secret The credential for confidential OAuth App.
|
38
|
+
# @param [String] code JWT token related to the authorization code grant type.
|
39
|
+
# @param [String] redirect_uri The redirect uri
|
40
|
+
# @param [String] audience The targeted audience uri
|
41
|
+
# @param [String] refresh_token JWT token related to refresh access token.
|
42
|
+
# @param [String] scope The scope of token
|
43
|
+
# @return [TokenInstance] Created TokenInstance
|
44
|
+
def create(
|
45
|
+
grant_type: nil,
|
46
|
+
client_id: nil,
|
47
|
+
client_secret: :unset,
|
48
|
+
code: :unset,
|
49
|
+
redirect_uri: :unset,
|
50
|
+
audience: :unset,
|
51
|
+
refresh_token: :unset,
|
52
|
+
scope: :unset
|
53
|
+
)
|
54
|
+
|
55
|
+
data = Twilio::Values.of({
|
56
|
+
'grant_type' => grant_type,
|
57
|
+
'client_id' => client_id,
|
58
|
+
'client_secret' => client_secret,
|
59
|
+
'code' => code,
|
60
|
+
'redirect_uri' => redirect_uri,
|
61
|
+
'audience' => audience,
|
62
|
+
'refresh_token' => refresh_token,
|
63
|
+
'scope' => scope,
|
64
|
+
})
|
65
|
+
|
66
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
payload = @version.create('POST', @uri, data: data, headers: headers)
|
73
|
+
TokenInstance.new(
|
74
|
+
@version,
|
75
|
+
payload,
|
76
|
+
)
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
# Provide a user friendly representation
|
83
|
+
def to_s
|
84
|
+
'#<Twilio.Iam.V1.TokenList>'
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
class TokenPage < Page
|
89
|
+
##
|
90
|
+
# Initialize the TokenPage
|
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 [TokenPage] TokenPage
|
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 TokenInstance
|
104
|
+
# @param [Hash] payload Payload response from the API
|
105
|
+
# @return [TokenInstance] TokenInstance
|
106
|
+
def get_instance(payload)
|
107
|
+
TokenInstance.new(@version, payload)
|
108
|
+
end
|
109
|
+
|
110
|
+
##
|
111
|
+
# Provide a user friendly representation
|
112
|
+
def to_s
|
113
|
+
'<Twilio.Iam.V1.TokenPage>'
|
114
|
+
end
|
115
|
+
end
|
116
|
+
class TokenInstance < InstanceResource
|
117
|
+
##
|
118
|
+
# Initialize the TokenInstance
|
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 Token
|
123
|
+
# resource.
|
124
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
125
|
+
# @return [TokenInstance] TokenInstance
|
126
|
+
def initialize(version, payload )
|
127
|
+
super(version)
|
128
|
+
|
129
|
+
# Marshaled Properties
|
130
|
+
@properties = {
|
131
|
+
'access_token' => payload['access_token'],
|
132
|
+
'refresh_token' => payload['refresh_token'],
|
133
|
+
'id_token' => payload['id_token'],
|
134
|
+
'token_type' => payload['token_type'],
|
135
|
+
'expires_in' => payload['expires_in'],
|
136
|
+
}
|
137
|
+
end
|
138
|
+
|
139
|
+
|
140
|
+
##
|
141
|
+
# @return [String] Token which carries the necessary information to access a Twilio resource directly.
|
142
|
+
def access_token
|
143
|
+
@properties['access_token']
|
144
|
+
end
|
145
|
+
|
146
|
+
##
|
147
|
+
# @return [String] Token which carries the information necessary to get a new access token.
|
148
|
+
def refresh_token
|
149
|
+
@properties['refresh_token']
|
150
|
+
end
|
151
|
+
|
152
|
+
##
|
153
|
+
# @return [String] Token which carries the information necessary of user profile.
|
154
|
+
def id_token
|
155
|
+
@properties['id_token']
|
156
|
+
end
|
157
|
+
|
158
|
+
##
|
159
|
+
# @return [String] Token type
|
160
|
+
def token_type
|
161
|
+
@properties['token_type']
|
162
|
+
end
|
163
|
+
|
164
|
+
##
|
165
|
+
# @return [String]
|
166
|
+
def expires_in
|
167
|
+
@properties['expires_in']
|
168
|
+
end
|
169
|
+
|
170
|
+
##
|
171
|
+
# Provide a user friendly representation
|
172
|
+
def to_s
|
173
|
+
"<Twilio.Iam.V1.TokenInstance>"
|
174
|
+
end
|
175
|
+
|
176
|
+
##
|
177
|
+
# Provide a detailed, user friendly representation
|
178
|
+
def inspect
|
179
|
+
"<Twilio.Iam.V1.TokenInstance>"
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
186
|
+
end
|
@@ -23,7 +23,8 @@ module Twilio
|
|
23
23
|
@version = 'v1'
|
24
24
|
@api_key = nil
|
25
25
|
@get_api_keys = nil
|
26
|
-
@
|
26
|
+
@new_api_key = nil
|
27
|
+
@token = nil
|
27
28
|
end
|
28
29
|
|
29
30
|
##
|
@@ -46,9 +47,14 @@ module Twilio
|
|
46
47
|
@get_api_keys ||= GetApiKeysList.new self
|
47
48
|
end
|
48
49
|
##
|
49
|
-
# @return [Twilio::REST::Iam::V1::
|
50
|
-
def
|
51
|
-
@
|
50
|
+
# @return [Twilio::REST::Iam::V1::NewApiKeyList]
|
51
|
+
def new_api_key
|
52
|
+
@new_api_key ||= NewApiKeyList.new self
|
53
|
+
end
|
54
|
+
##
|
55
|
+
# @return [Twilio::REST::Iam::V1::TokenList]
|
56
|
+
def token
|
57
|
+
@token ||= TokenList.new self
|
52
58
|
end
|
53
59
|
##
|
54
60
|
# Provide a user friendly representation
|