twilio-ruby 7.8.7 → 7.9.0
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/.github/workflows/test-and-deploy.yml +1 -1
- data/.gitignore +1 -0
- data/CHANGES.md +36 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/base/client_base.rb +28 -1
- data/lib/twilio-ruby/framework/rest/version.rb +20 -2
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +1 -1
- data/lib/twilio-ruby/rest/iam/v1/o_auth_app.rb +462 -0
- data/lib/twilio-ruby/rest/iam/v1.rb +15 -0
- data/lib/twilio-ruby/rest/messaging/v1/domain_validate_dn.rb +208 -0
- data/lib/twilio-ruby/rest/messaging/v1.rb +15 -0
- data/lib/twilio-ruby/rest/messaging/v2/domain_certs.rb +250 -0
- data/lib/twilio-ruby/rest/messaging/v2.rb +15 -0
- data/lib/twilio-ruby/rest/numbers/v1/porting_all_port_in.rb +8 -8
- data/lib/twilio-ruby/rest/oauth/v2/token.rb +6 -1
- data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +1 -1
- data/lib/twilio-ruby/rest/trusthub/v1/compliance_tollfree_inquiries.rb +40 -1
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7d7b336bf9b2991bc49c17ca8c21bf48d30404a3
|
|
4
|
+
data.tar.gz: ebfe33678601bcffdea47d8d9ba87986ba076a57
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 15e023044c5b7f71d47ca46f950be16a9bf92f9953d7934b8b6e57fcaf70a6119d9130642267e1387330ad57cc8f7bfee405c148e32ce48ace22a45abc9d70e2
|
|
7
|
+
data.tar.gz: 5038a92dd9a0d1f862d9778854347fe32e539966bee7cdc8d975f366df059543548369fd6dc70f9a1966be5ca5d63d0e09ecee86c88e5405f80a52fec41a8e40
|
|
@@ -17,7 +17,7 @@ jobs:
|
|
|
17
17
|
timeout-minutes: 20
|
|
18
18
|
strategy:
|
|
19
19
|
matrix:
|
|
20
|
-
ruby: [ '2.
|
|
20
|
+
ruby: [ '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', 'jruby-9.3', 'jruby-9.4' ]
|
|
21
21
|
steps:
|
|
22
22
|
- name: Checkout twilio-ruby
|
|
23
23
|
uses: actions/checkout@v3
|
data/.gitignore
CHANGED
data/CHANGES.md
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
twilio-ruby changelog
|
|
2
2
|
=====================
|
|
3
3
|
|
|
4
|
+
[2025-12-17] Version 7.9.0
|
|
5
|
+
--------------------------
|
|
6
|
+
**Library - Chore**
|
|
7
|
+
- [PR #771](https://github.com/twilio/twilio-ruby/pull/771): Patch support method. Thanks to [@manisha1997](https://github.com/manisha1997)!
|
|
8
|
+
- [PR #766](https://github.com/twilio/twilio-ruby/pull/766): Support all status codes for delete. Thanks to [@manisha1997](https://github.com/manisha1997)!
|
|
9
|
+
- [PR #769](https://github.com/twilio/twilio-ruby/pull/769): URL query percent encoded. Thanks to [@manisha1997](https://github.com/manisha1997)!
|
|
10
|
+
|
|
11
|
+
**Library - Fix**
|
|
12
|
+
- [PR #770](https://github.com/twilio/twilio-ruby/pull/770): bug fix. Thanks to [@manisha1997](https://github.com/manisha1997)!
|
|
13
|
+
|
|
14
|
+
**Trunking**
|
|
15
|
+
- Corrected the type used for phone number capabilities when accessed through a Trunk. **(breaking change)**
|
|
16
|
+
- Corrected the type used for phone number capabilities when accessed through a Trunk. **(breaking change)**
|
|
17
|
+
|
|
18
|
+
**Trusthub**
|
|
19
|
+
- Added new parameters in in toll-free initialize api payload.
|
|
20
|
+
- Remove the invalid status transition to Draft from the examples
|
|
21
|
+
- Change the value of email to a valid one in the examples.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
[2025-12-03] Version 7.8.8
|
|
25
|
+
--------------------------
|
|
26
|
+
**Library - Fix**
|
|
27
|
+
- [PR #765](https://github.com/twilio/twilio-ruby/pull/765): Regional API domain processing. Thanks to [@manisha1997](https://github.com/manisha1997)!
|
|
28
|
+
|
|
29
|
+
**Api**
|
|
30
|
+
- Add `twiml_session` resource for calls
|
|
31
|
+
- Add `twiml_session` resource for calls
|
|
32
|
+
|
|
33
|
+
**Monitor**
|
|
34
|
+
- Update default output properties
|
|
35
|
+
|
|
36
|
+
**Trusthub**
|
|
37
|
+
- Added customer_profile_sid in toll-free initialize api payload.
|
|
38
|
+
|
|
39
|
+
|
|
4
40
|
[2025-11-20] Version 7.8.7
|
|
5
41
|
--------------------------
|
|
6
42
|
**Memory**
|
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.9.0'
|
|
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.9.0
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
To build and install the development branch yourself from the latest source:
|
|
@@ -3,6 +3,19 @@ module Twilio
|
|
|
3
3
|
class ClientBase
|
|
4
4
|
# rubocop:disable Style/ClassVars
|
|
5
5
|
@@default_region = 'us1'
|
|
6
|
+
# Maps region codes to their corresponding edge location names
|
|
7
|
+
# Used to automatically set edge based on region for backward compatibility
|
|
8
|
+
@@region_mappings = {
|
|
9
|
+
'au1' => 'sydney',
|
|
10
|
+
'br1' => 'sao-paulo',
|
|
11
|
+
'de1' => 'frankfurt',
|
|
12
|
+
'ie1' => 'dublin',
|
|
13
|
+
'jp1' => 'tokyo',
|
|
14
|
+
'jp2' => 'osaka',
|
|
15
|
+
'sg1' => 'singapore',
|
|
16
|
+
'us1' => 'ashburn',
|
|
17
|
+
'us2' => 'umatilla'
|
|
18
|
+
}
|
|
6
19
|
# rubocop:enable Style/ClassVars
|
|
7
20
|
|
|
8
21
|
attr_accessor :http_client, :username, :password, :account_sid, :auth_token, :region, :edge, :logger,
|
|
@@ -14,7 +27,12 @@ module Twilio
|
|
|
14
27
|
@username = username || Twilio.account_sid
|
|
15
28
|
@password = password || Twilio.auth_token
|
|
16
29
|
@region = region || Twilio.region
|
|
17
|
-
|
|
30
|
+
if Twilio.edge
|
|
31
|
+
@edge = Twilio.edge
|
|
32
|
+
elsif @region && @@region_mappings[region]
|
|
33
|
+
warn '[DEPRECATION] Setting default `Edge` for the provided `region`.'
|
|
34
|
+
@edge = @@region_mappings[region]
|
|
35
|
+
end
|
|
18
36
|
@account_sid = account_sid || @username
|
|
19
37
|
@auth_token = @password
|
|
20
38
|
@auth = [@username, @password]
|
|
@@ -78,6 +96,15 @@ module Twilio
|
|
|
78
96
|
##
|
|
79
97
|
# Build the final request uri
|
|
80
98
|
def build_uri(uri)
|
|
99
|
+
if (@region.nil? && !@edge.nil?) || (!@region.nil? && @edge.nil?)
|
|
100
|
+
# rubocop:disable Layout/LineLength
|
|
101
|
+
warn '[DEPRECATION] For regional processing, DNS is of format product.<edge>.<region>.twilio.com;otherwise use product.twilio.com.'
|
|
102
|
+
# rubocop:enable Layout/LineLength
|
|
103
|
+
end
|
|
104
|
+
if @edge.nil? && @region && @@region_mappings[@region]
|
|
105
|
+
warn '[DEPRECATION] Setting default `Edge` for the provided `region`.'
|
|
106
|
+
@edge = @@region_mappings[@region]
|
|
107
|
+
end
|
|
81
108
|
return uri if @region.nil? && @edge.nil?
|
|
82
109
|
|
|
83
110
|
parsed_url = URI(uri)
|
|
@@ -94,7 +94,7 @@ module Twilio
|
|
|
94
94
|
response.body
|
|
95
95
|
end
|
|
96
96
|
|
|
97
|
-
def
|
|
97
|
+
def patch(method, uri, params: {}, data: {}, headers: {}, auth: nil, timeout: nil)
|
|
98
98
|
response = request(
|
|
99
99
|
method,
|
|
100
100
|
uri,
|
|
@@ -106,10 +106,28 @@ module Twilio
|
|
|
106
106
|
)
|
|
107
107
|
|
|
108
108
|
if response.status_code < 200 || response.status_code >= 300
|
|
109
|
+
raise exception(response, 'Unable to patch record')
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
response.body
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def delete(method, uri, params: {}, data: {}, headers: {}, auth: nil, timeout: nil)
|
|
116
|
+
response = request(
|
|
117
|
+
method,
|
|
118
|
+
uri,
|
|
119
|
+
params,
|
|
120
|
+
data,
|
|
121
|
+
headers,
|
|
122
|
+
auth,
|
|
123
|
+
timeout
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
if response.status_code < 200 || response.status_code >= 400
|
|
109
127
|
raise exception(response, 'Unable to delete record')
|
|
110
128
|
end
|
|
111
129
|
|
|
112
|
-
response.status_code
|
|
130
|
+
response.status_code >= 200 && response.status_code < 400
|
|
113
131
|
end
|
|
114
132
|
|
|
115
133
|
def read_limits(limit = nil, page_size = nil)
|
|
@@ -40,7 +40,7 @@ module Twilio
|
|
|
40
40
|
# @param [String] region The state or region of the new address.
|
|
41
41
|
# @param [String] postal_code The postal code of the new address.
|
|
42
42
|
# @param [String] iso_country The ISO country code of the new address.
|
|
43
|
-
# @param [String] friendly_name A descriptive string that you create to describe the new address. It can be up to 64 characters long.
|
|
43
|
+
# @param [String] friendly_name A descriptive string that you create to describe the new address. It can be up to 64 characters long for Regulatory Compliance addresses and 32 characters long for Emergency addresses.
|
|
44
44
|
# @param [Boolean] emergency_enabled Whether to enable emergency calling on the new address. Can be: `true` or `false`.
|
|
45
45
|
# @param [Boolean] auto_correct_address Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide.
|
|
46
46
|
# @param [String] street_secondary The additional number and street address of the address.
|
|
@@ -0,0 +1,462 @@
|
|
|
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 OAuthAppList < ListResource
|
|
21
|
+
|
|
22
|
+
class IamV1AccountVendorOauthAppCreateRequest
|
|
23
|
+
# @param [type]: [String]
|
|
24
|
+
# @param [friendly_name]: [String]
|
|
25
|
+
# @param [owner_sid]: [String]
|
|
26
|
+
# @param [description]: [String]
|
|
27
|
+
# @param [client_sid]: [String]
|
|
28
|
+
# @param [policy]: [OAuthAppList.IamV1OrganizationVendoroauthappPolicy]
|
|
29
|
+
# @param [access_token_ttl]: [String]
|
|
30
|
+
attr_accessor :type, :friendly_name, :owner_sid, :description, :client_sid, :policy, :access_token_ttl
|
|
31
|
+
def initialize(payload)
|
|
32
|
+
@type = payload["type"]
|
|
33
|
+
@friendly_name = payload["friendly_name"]
|
|
34
|
+
@owner_sid = payload["owner_sid"]
|
|
35
|
+
@description = payload["description"]
|
|
36
|
+
@client_sid = payload["client_sid"]
|
|
37
|
+
@policy = payload["policy"]
|
|
38
|
+
@access_token_ttl = payload["access_token_ttl"]
|
|
39
|
+
end
|
|
40
|
+
def to_json(options = {})
|
|
41
|
+
{
|
|
42
|
+
"type": @type,
|
|
43
|
+
"friendly_name": @friendly_name,
|
|
44
|
+
"owner_sid": @owner_sid,
|
|
45
|
+
"description": @description,
|
|
46
|
+
"client_sid": @client_sid,
|
|
47
|
+
"policy": @policy,
|
|
48
|
+
"access_token_ttl": @access_token_ttl,
|
|
49
|
+
}.to_json(options)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
class IamV1AccountVendorOauthAppUpdateRequest
|
|
54
|
+
# @param [type]: [String]
|
|
55
|
+
# @param [friendly_name]: [String]
|
|
56
|
+
# @param [description]: [String]
|
|
57
|
+
# @param [policy]: [OAuthAppList.IamV1OrganizationVendorOauthAppUpdateRequestPolicy]
|
|
58
|
+
# @param [access_token_ttl]: [String]
|
|
59
|
+
attr_accessor :type, :friendly_name, :description, :policy, :access_token_ttl
|
|
60
|
+
def initialize(payload)
|
|
61
|
+
@type = payload["type"]
|
|
62
|
+
@friendly_name = payload["friendly_name"]
|
|
63
|
+
@description = payload["description"]
|
|
64
|
+
@policy = payload["policy"]
|
|
65
|
+
@access_token_ttl = payload["access_token_ttl"]
|
|
66
|
+
end
|
|
67
|
+
def to_json(options = {})
|
|
68
|
+
{
|
|
69
|
+
"type": @type,
|
|
70
|
+
"friendly_name": @friendly_name,
|
|
71
|
+
"description": @description,
|
|
72
|
+
"policy": @policy,
|
|
73
|
+
"access_token_ttl": @access_token_ttl,
|
|
74
|
+
}.to_json(options)
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
class IamV1OrganizationVendorOauthAppUpdateRequestPolicy
|
|
79
|
+
# @param [allow]: [Array<String>] Set of permissions explicitly allowed
|
|
80
|
+
# @param [deny]: [Array<String>] Set of permissions explicitly denied
|
|
81
|
+
attr_accessor :allow, :deny
|
|
82
|
+
def initialize(payload)
|
|
83
|
+
@allow = payload["allow"]
|
|
84
|
+
@deny = payload["deny"]
|
|
85
|
+
end
|
|
86
|
+
def to_json(options = {})
|
|
87
|
+
{
|
|
88
|
+
"allow": @allow,
|
|
89
|
+
"deny": @deny,
|
|
90
|
+
}.to_json(options)
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
class IamV1AccountVendorOauthAppCreateRequest
|
|
96
|
+
# @param [type]: [String]
|
|
97
|
+
# @param [friendly_name]: [String]
|
|
98
|
+
# @param [owner_sid]: [String]
|
|
99
|
+
# @param [description]: [String]
|
|
100
|
+
# @param [client_sid]: [String]
|
|
101
|
+
# @param [policy]: [OAuthAppList.IamV1OrganizationVendoroauthappPolicy]
|
|
102
|
+
# @param [access_token_ttl]: [String]
|
|
103
|
+
attr_accessor :type, :friendly_name, :owner_sid, :description, :client_sid, :policy, :access_token_ttl
|
|
104
|
+
def initialize(payload)
|
|
105
|
+
@type = payload["type"]
|
|
106
|
+
@friendly_name = payload["friendly_name"]
|
|
107
|
+
@owner_sid = payload["owner_sid"]
|
|
108
|
+
@description = payload["description"]
|
|
109
|
+
@client_sid = payload["client_sid"]
|
|
110
|
+
@policy = payload["policy"]
|
|
111
|
+
@access_token_ttl = payload["access_token_ttl"]
|
|
112
|
+
end
|
|
113
|
+
def to_json(options = {})
|
|
114
|
+
{
|
|
115
|
+
"type": @type,
|
|
116
|
+
"friendly_name": @friendly_name,
|
|
117
|
+
"owner_sid": @owner_sid,
|
|
118
|
+
"description": @description,
|
|
119
|
+
"client_sid": @client_sid,
|
|
120
|
+
"policy": @policy,
|
|
121
|
+
"access_token_ttl": @access_token_ttl,
|
|
122
|
+
}.to_json(options)
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
class IamV1AccountVendorOauthAppUpdateRequest
|
|
127
|
+
# @param [type]: [String]
|
|
128
|
+
# @param [friendly_name]: [String]
|
|
129
|
+
# @param [description]: [String]
|
|
130
|
+
# @param [policy]: [OAuthAppList.IamV1OrganizationVendorOauthAppUpdateRequestPolicy]
|
|
131
|
+
# @param [access_token_ttl]: [String]
|
|
132
|
+
attr_accessor :type, :friendly_name, :description, :policy, :access_token_ttl
|
|
133
|
+
def initialize(payload)
|
|
134
|
+
@type = payload["type"]
|
|
135
|
+
@friendly_name = payload["friendly_name"]
|
|
136
|
+
@description = payload["description"]
|
|
137
|
+
@policy = payload["policy"]
|
|
138
|
+
@access_token_ttl = payload["access_token_ttl"]
|
|
139
|
+
end
|
|
140
|
+
def to_json(options = {})
|
|
141
|
+
{
|
|
142
|
+
"type": @type,
|
|
143
|
+
"friendly_name": @friendly_name,
|
|
144
|
+
"description": @description,
|
|
145
|
+
"policy": @policy,
|
|
146
|
+
"access_token_ttl": @access_token_ttl,
|
|
147
|
+
}.to_json(options)
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
class IamV1OrganizationVendorOauthAppUpdateRequestPolicy
|
|
152
|
+
# @param [allow]: [Array<String>] Set of permissions explicitly allowed
|
|
153
|
+
# @param [deny]: [Array<String>] Set of permissions explicitly denied
|
|
154
|
+
attr_accessor :allow, :deny
|
|
155
|
+
def initialize(payload)
|
|
156
|
+
@allow = payload["allow"]
|
|
157
|
+
@deny = payload["deny"]
|
|
158
|
+
end
|
|
159
|
+
def to_json(options = {})
|
|
160
|
+
{
|
|
161
|
+
"allow": @allow,
|
|
162
|
+
"deny": @deny,
|
|
163
|
+
}.to_json(options)
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
##
|
|
169
|
+
# Initialize the OAuthAppList
|
|
170
|
+
# @param [Version] version Version that contains the resource
|
|
171
|
+
# @return [OAuthAppList] OAuthAppList
|
|
172
|
+
def initialize(version)
|
|
173
|
+
super(version)
|
|
174
|
+
# Path Solution
|
|
175
|
+
@solution = { }
|
|
176
|
+
@uri = "/Account/OAuthApps"
|
|
177
|
+
|
|
178
|
+
end
|
|
179
|
+
##
|
|
180
|
+
# Create the OAuthAppInstance
|
|
181
|
+
# @param [IamV1AccountVendorOauthAppCreateRequest] iam_v1_account_vendor_oauth_app_create_request
|
|
182
|
+
# @return [OAuthAppInstance] Created OAuthAppInstance
|
|
183
|
+
def create(iam_v1_account_vendor_oauth_app_create_request: nil
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
187
|
+
headers['Content-Type'] = 'application/json'
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
payload = @version.create('POST', @uri, headers: headers, data: iam_v1_account_vendor_oauth_app_create_request.to_json)
|
|
193
|
+
OAuthAppInstance.new(
|
|
194
|
+
@version,
|
|
195
|
+
payload,
|
|
196
|
+
)
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
# Provide a user friendly representation
|
|
203
|
+
def to_s
|
|
204
|
+
'#<Twilio.Iam.V1.OAuthAppList>'
|
|
205
|
+
end
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
class OAuthAppContext < InstanceContext
|
|
210
|
+
##
|
|
211
|
+
# Initialize the OAuthAppContext
|
|
212
|
+
# @param [Version] version Version that contains the resource
|
|
213
|
+
# @param [String] sid Unique ID (sid) of the OAuth app
|
|
214
|
+
# @return [OAuthAppContext] OAuthAppContext
|
|
215
|
+
def initialize(version, sid)
|
|
216
|
+
super(version)
|
|
217
|
+
|
|
218
|
+
# Path Solution
|
|
219
|
+
@solution = { sid: sid, }
|
|
220
|
+
@uri = "/Account/OAuthApps/#{@solution[:sid]}"
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
end
|
|
224
|
+
##
|
|
225
|
+
# Delete the OAuthAppInstance
|
|
226
|
+
# @return [Boolean] True if delete succeeds, false otherwise
|
|
227
|
+
def delete
|
|
228
|
+
|
|
229
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
@version.delete('DELETE', @uri, headers: headers)
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
##
|
|
237
|
+
# Update the OAuthAppInstance
|
|
238
|
+
# @param [IamV1AccountVendorOauthAppUpdateRequest] iam_v1_account_vendor_oauth_app_update_request
|
|
239
|
+
# @return [OAuthAppInstance] Updated OAuthAppInstance
|
|
240
|
+
def update(iam_v1_account_vendor_oauth_app_update_request: nil
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
244
|
+
headers['Content-Type'] = 'application/json'
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
payload = @version.update('PUT', @uri, headers: headers, data: iam_v1_account_vendor_oauth_app_update_request.to_json)
|
|
250
|
+
OAuthAppInstance.new(
|
|
251
|
+
@version,
|
|
252
|
+
payload,
|
|
253
|
+
sid: @solution[:sid],
|
|
254
|
+
)
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
##
|
|
259
|
+
# Provide a user friendly representation
|
|
260
|
+
def to_s
|
|
261
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
|
262
|
+
"#<Twilio.Iam.V1.OAuthAppContext #{context}>"
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
##
|
|
266
|
+
# Provide a detailed, user friendly representation
|
|
267
|
+
def inspect
|
|
268
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
|
269
|
+
"#<Twilio.Iam.V1.OAuthAppContext #{context}>"
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
class OAuthAppPage < Page
|
|
274
|
+
##
|
|
275
|
+
# Initialize the OAuthAppPage
|
|
276
|
+
# @param [Version] version Version that contains the resource
|
|
277
|
+
# @param [Response] response Response from the API
|
|
278
|
+
# @param [Hash] solution Path solution for the resource
|
|
279
|
+
# @return [OAuthAppPage] OAuthAppPage
|
|
280
|
+
def initialize(version, response, solution)
|
|
281
|
+
super(version, response)
|
|
282
|
+
|
|
283
|
+
# Path Solution
|
|
284
|
+
@solution = solution
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
##
|
|
288
|
+
# Build an instance of OAuthAppInstance
|
|
289
|
+
# @param [Hash] payload Payload response from the API
|
|
290
|
+
# @return [OAuthAppInstance] OAuthAppInstance
|
|
291
|
+
def get_instance(payload)
|
|
292
|
+
OAuthAppInstance.new(@version, payload)
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
##
|
|
296
|
+
# Provide a user friendly representation
|
|
297
|
+
def to_s
|
|
298
|
+
'<Twilio.Iam.V1.OAuthAppPage>'
|
|
299
|
+
end
|
|
300
|
+
end
|
|
301
|
+
class OAuthAppInstance < InstanceResource
|
|
302
|
+
##
|
|
303
|
+
# Initialize the OAuthAppInstance
|
|
304
|
+
# @param [Version] version Version that contains the resource
|
|
305
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
306
|
+
# @param [String] account_sid The SID of the
|
|
307
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this OAuthApp
|
|
308
|
+
# resource.
|
|
309
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
|
310
|
+
# @return [OAuthAppInstance] OAuthAppInstance
|
|
311
|
+
def initialize(version, payload , sid: nil)
|
|
312
|
+
super(version)
|
|
313
|
+
|
|
314
|
+
# Marshaled Properties
|
|
315
|
+
@properties = {
|
|
316
|
+
'type' => payload['type'],
|
|
317
|
+
'sid' => payload['sid'],
|
|
318
|
+
'friendly_name' => payload['friendly_name'],
|
|
319
|
+
'description' => payload['description'],
|
|
320
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
|
321
|
+
'created_by' => payload['created_by'],
|
|
322
|
+
'secret' => payload['secret'],
|
|
323
|
+
'status' => payload['status'],
|
|
324
|
+
'policy' => payload['policy'],
|
|
325
|
+
'access_token_ttl' => payload['access_token_ttl'] == nil ? payload['access_token_ttl'] : payload['access_token_ttl'].to_i,
|
|
326
|
+
'code' => payload['code'],
|
|
327
|
+
'message' => payload['message'],
|
|
328
|
+
'more_info' => payload['more_info'],
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
# Context
|
|
332
|
+
@instance_context = nil
|
|
333
|
+
@params = { 'sid' => sid || @properties['sid'] , }
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
##
|
|
337
|
+
# Generate an instance context for the instance, the context is capable of
|
|
338
|
+
# performing various actions. All instance actions are proxied to the context
|
|
339
|
+
# @return [OAuthAppContext] CallContext for this CallInstance
|
|
340
|
+
def context
|
|
341
|
+
unless @instance_context
|
|
342
|
+
@instance_context = OAuthAppContext.new(@version , @params['sid'])
|
|
343
|
+
end
|
|
344
|
+
@instance_context
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
##
|
|
348
|
+
# @return [String]
|
|
349
|
+
def type
|
|
350
|
+
@properties['type']
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
##
|
|
354
|
+
# @return [String]
|
|
355
|
+
def sid
|
|
356
|
+
@properties['sid']
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
##
|
|
360
|
+
# @return [String]
|
|
361
|
+
def friendly_name
|
|
362
|
+
@properties['friendly_name']
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
##
|
|
366
|
+
# @return [String]
|
|
367
|
+
def description
|
|
368
|
+
@properties['description']
|
|
369
|
+
end
|
|
370
|
+
|
|
371
|
+
##
|
|
372
|
+
# @return [Time]
|
|
373
|
+
def date_created
|
|
374
|
+
@properties['date_created']
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
##
|
|
378
|
+
# @return [String]
|
|
379
|
+
def created_by
|
|
380
|
+
@properties['created_by']
|
|
381
|
+
end
|
|
382
|
+
|
|
383
|
+
##
|
|
384
|
+
# @return [String]
|
|
385
|
+
def secret
|
|
386
|
+
@properties['secret']
|
|
387
|
+
end
|
|
388
|
+
|
|
389
|
+
##
|
|
390
|
+
# @return [String]
|
|
391
|
+
def status
|
|
392
|
+
@properties['status']
|
|
393
|
+
end
|
|
394
|
+
|
|
395
|
+
##
|
|
396
|
+
# @return [IamV1OrganizationVendoroauthappPolicy]
|
|
397
|
+
def policy
|
|
398
|
+
@properties['policy']
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
##
|
|
402
|
+
# @return [String]
|
|
403
|
+
def access_token_ttl
|
|
404
|
+
@properties['access_token_ttl']
|
|
405
|
+
end
|
|
406
|
+
|
|
407
|
+
##
|
|
408
|
+
# @return [String] Twilio-specific error code
|
|
409
|
+
def code
|
|
410
|
+
@properties['code']
|
|
411
|
+
end
|
|
412
|
+
|
|
413
|
+
##
|
|
414
|
+
# @return [String] Error message
|
|
415
|
+
def message
|
|
416
|
+
@properties['message']
|
|
417
|
+
end
|
|
418
|
+
|
|
419
|
+
##
|
|
420
|
+
# @return [String] Link to Error Code References
|
|
421
|
+
def more_info
|
|
422
|
+
@properties['more_info']
|
|
423
|
+
end
|
|
424
|
+
|
|
425
|
+
##
|
|
426
|
+
# Delete the OAuthAppInstance
|
|
427
|
+
# @return [Boolean] True if delete succeeds, false otherwise
|
|
428
|
+
def delete
|
|
429
|
+
|
|
430
|
+
context.delete
|
|
431
|
+
end
|
|
432
|
+
|
|
433
|
+
##
|
|
434
|
+
# Update the OAuthAppInstance
|
|
435
|
+
# @param [IamV1AccountVendorOauthAppUpdateRequest] iam_v1_account_vendor_oauth_app_update_request
|
|
436
|
+
# @return [OAuthAppInstance] Updated OAuthAppInstance
|
|
437
|
+
def update(iam_v1_account_vendor_oauth_app_update_request: nil
|
|
438
|
+
)
|
|
439
|
+
|
|
440
|
+
context.update(
|
|
441
|
+
)
|
|
442
|
+
end
|
|
443
|
+
|
|
444
|
+
##
|
|
445
|
+
# Provide a user friendly representation
|
|
446
|
+
def to_s
|
|
447
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
448
|
+
"<Twilio.Iam.V1.OAuthAppInstance #{values}>"
|
|
449
|
+
end
|
|
450
|
+
|
|
451
|
+
##
|
|
452
|
+
# Provide a detailed, user friendly representation
|
|
453
|
+
def inspect
|
|
454
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
455
|
+
"<Twilio.Iam.V1.OAuthAppInstance #{values}>"
|
|
456
|
+
end
|
|
457
|
+
end
|
|
458
|
+
|
|
459
|
+
end
|
|
460
|
+
end
|
|
461
|
+
end
|
|
462
|
+
end
|
|
@@ -24,6 +24,7 @@ module Twilio
|
|
|
24
24
|
@api_key = nil
|
|
25
25
|
@get_api_keys = nil
|
|
26
26
|
@new_api_key = nil
|
|
27
|
+
@o_auth_apps = nil
|
|
27
28
|
@token = nil
|
|
28
29
|
end
|
|
29
30
|
|
|
@@ -52,6 +53,20 @@ module Twilio
|
|
|
52
53
|
@new_api_key ||= NewApiKeyList.new self
|
|
53
54
|
end
|
|
54
55
|
##
|
|
56
|
+
# @param [String] sid Unique ID (sid) of the OAuth app
|
|
57
|
+
# @return [Twilio::REST::Iam::V1::OAuthAppContext] if sid was passed.
|
|
58
|
+
# @return [Twilio::REST::Iam::V1::OAuthAppList]
|
|
59
|
+
def o_auth_apps(sid=:unset)
|
|
60
|
+
if sid.nil?
|
|
61
|
+
raise ArgumentError, 'sid cannot be nil'
|
|
62
|
+
end
|
|
63
|
+
if sid == :unset
|
|
64
|
+
@o_auth_apps ||= OAuthAppList.new self
|
|
65
|
+
else
|
|
66
|
+
OAuthAppContext.new(self, sid)
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
##
|
|
55
70
|
# @return [Twilio::REST::Iam::V1::TokenList]
|
|
56
71
|
def token
|
|
57
72
|
@token ||= TokenList.new self
|