twilio-ruby 5.11.1 → 5.11.2
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/CHANGES.md +18 -0
- data/README.md +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +24 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types.rb +133 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping.rb +161 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.rb +349 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_ip_access_control_list_mapping.rb +349 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping.rb +135 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping/auth_registrations_credential_list_mapping.rb +349 -0
- data/lib/twilio-ruby/rest/preview.rb +8 -8
- data/lib/twilio-ruby/rest/preview/marketplace.rb +13 -13
- data/lib/twilio-ruby/rest/preview/understand/assistant.rb +3 -16
- data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +42 -2
- data/lib/twilio-ruby/rest/proxy/v1/service/short_code.rb +33 -0
- data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +27 -19
- data/lib/twilio-ruby/rest/studio/v1/flow/execution/execution_context.rb +11 -11
- data/lib/twilio-ruby/rest/studio/v1/flow/execution/execution_step.rb +18 -18
- data/lib/twilio-ruby/rest/studio/v1/flow/execution/execution_step/execution_step_context.rb +17 -15
- data/lib/twilio-ruby/rest/video.rb +9 -9
- data/lib/twilio-ruby/rest/video/v1.rb +16 -16
- data/lib/twilio-ruby/rest/video/v1/room.rb +2 -1
- data/lib/twilio-ruby/twiml/voice_response.rb +20 -0
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping_spec.rb +220 -0
- data/spec/integration/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_ip_access_control_list_mapping_spec.rb +220 -0
- data/spec/integration/api/v2010/account/sip/domain/auth_types/auth_calls_mapping_spec.rb +12 -0
- data/spec/integration/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping/auth_registrations_credential_list_mapping_spec.rb +220 -0
- data/spec/integration/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping_spec.rb +12 -0
- data/spec/integration/api/v2010/account/sip/domain/auth_types_spec.rb +12 -0
- data/spec/integration/preview/understand/assistant_spec.rb +0 -4
- data/spec/integration/proxy/v1/service/phone_number_spec.rb +51 -3
- data/spec/integration/proxy/v1/service/short_code_spec.rb +50 -3
- metadata +21 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3370981f1ae8e1f167a855e54d22a908759f0646
|
4
|
+
data.tar.gz: 67b40a249b6a2a00f7ceb985a361dd95b2942db8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '05940171d94b54bfca3451de3156bc0ae9150b90eb55149f8b5e1273497d8346f86e156de2d8cb621705dd15179e4180e81ac09a9a47022d2729ad397c91bde4'
|
7
|
+
data.tar.gz: 820b0028c3716493e25ca9fdc6b0006b6d0437d0ece4d980c311292db104e840b06d4ac241bde8c63dda37753aed2de4d00ed15aa8825dc8fc1d3301998f5ff6
|
data/CHANGES.md
CHANGED
@@ -1,6 +1,24 @@
|
|
1
1
|
twilio-ruby changelog
|
2
2
|
=====================
|
3
3
|
|
4
|
+
[2018-07-26] Version 5.11.2
|
5
|
+
----------------------------
|
6
|
+
**Library**
|
7
|
+
- PR #424: Fix Say example in README.md. Thanks to @HuipengRen!
|
8
|
+
|
9
|
+
**Api**
|
10
|
+
- Add support for sip domains to map credential lists for registrations
|
11
|
+
|
12
|
+
**Preview**
|
13
|
+
- Remove `ttl` from Assistants
|
14
|
+
|
15
|
+
**Proxy**
|
16
|
+
- Enable setting a proxy number as reserved
|
17
|
+
|
18
|
+
**Twiml**
|
19
|
+
- Add support for SSML lang tag on Say verb
|
20
|
+
|
21
|
+
|
4
22
|
[2018-07-17] Version 5.11.1
|
5
23
|
----------------------------
|
6
24
|
**Library**
|
data/README.md
CHANGED
@@ -27,13 +27,13 @@ in-line code documentation here in the library.
|
|
27
27
|
To install using [Bundler][bundler] grab the latest stable version:
|
28
28
|
|
29
29
|
```ruby
|
30
|
-
gem 'twilio-ruby', '~> 5.11.
|
30
|
+
gem 'twilio-ruby', '~> 5.11.2'
|
31
31
|
```
|
32
32
|
|
33
33
|
To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
|
34
34
|
|
35
35
|
```bash
|
36
|
-
gem install twilio-ruby -v 5.11.
|
36
|
+
gem install twilio-ruby -v 5.11.2
|
37
37
|
```
|
38
38
|
|
39
39
|
To build and install the development branch yourself from the latest source:
|
@@ -151,7 +151,7 @@ You can construct a TwiML response like this:
|
|
151
151
|
require 'twilio-ruby'
|
152
152
|
|
153
153
|
response = Twilio::TwiML::VoiceResponse.new do |r|
|
154
|
-
r.say('hello there', voice: 'alice')
|
154
|
+
r.say(message: 'hello there', voice: 'alice')
|
155
155
|
r.dial(caller_id: '+14159992222') do |d|
|
156
156
|
d.client 'jenny'
|
157
157
|
end
|
@@ -208,6 +208,7 @@ module Twilio
|
|
208
208
|
# Dependents
|
209
209
|
@ip_access_control_list_mappings = nil
|
210
210
|
@credential_list_mappings = nil
|
211
|
+
@auth = nil
|
211
212
|
end
|
212
213
|
|
213
214
|
##
|
@@ -316,6 +317,22 @@ module Twilio
|
|
316
317
|
@credential_list_mappings
|
317
318
|
end
|
318
319
|
|
320
|
+
##
|
321
|
+
# Access the auth
|
322
|
+
# @return [AuthTypesList]
|
323
|
+
# @return [AuthTypesContext]
|
324
|
+
def auth
|
325
|
+
unless @auth
|
326
|
+
@auth = AuthTypesList.new(
|
327
|
+
@version,
|
328
|
+
account_sid: @solution[:account_sid],
|
329
|
+
domain_sid: @solution[:sid],
|
330
|
+
)
|
331
|
+
end
|
332
|
+
|
333
|
+
@auth
|
334
|
+
end
|
335
|
+
|
319
336
|
##
|
320
337
|
# Provide a user friendly representation
|
321
338
|
def to_s
|
@@ -530,6 +547,13 @@ module Twilio
|
|
530
547
|
context.credential_list_mappings
|
531
548
|
end
|
532
549
|
|
550
|
+
##
|
551
|
+
# Access the auth
|
552
|
+
# @return [auth] auth
|
553
|
+
def auth
|
554
|
+
context.auth
|
555
|
+
end
|
556
|
+
|
533
557
|
##
|
534
558
|
# Provide a user friendly representation
|
535
559
|
def to_s
|
@@ -0,0 +1,133 @@
|
|
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 Api < Domain
|
12
|
+
class V2010 < Version
|
13
|
+
class AccountContext < InstanceContext
|
14
|
+
class SipList < ListResource
|
15
|
+
class DomainContext < InstanceContext
|
16
|
+
class AuthTypesList < ListResource
|
17
|
+
##
|
18
|
+
# Initialize the AuthTypesList
|
19
|
+
# @param [Version] version Version that contains the resource
|
20
|
+
# @param [String] account_sid The unique id of the
|
21
|
+
# [Account](https://www.twilio.com/docs/api/rest/account) that sent this message.
|
22
|
+
# @param [String] domain_sid A 34 character string that uniquely identifies the
|
23
|
+
# SIP domain in Twilio.
|
24
|
+
# @return [AuthTypesList] AuthTypesList
|
25
|
+
def initialize(version, account_sid: nil, domain_sid: nil)
|
26
|
+
super(version)
|
27
|
+
|
28
|
+
# Path Solution
|
29
|
+
@solution = {account_sid: account_sid, domain_sid: domain_sid}
|
30
|
+
|
31
|
+
# Components
|
32
|
+
@calls = nil
|
33
|
+
@registrations = nil
|
34
|
+
end
|
35
|
+
|
36
|
+
##
|
37
|
+
# Access the calls
|
38
|
+
# @return [AuthTypeCallsList]
|
39
|
+
# @return [AuthTypeCallsContext]
|
40
|
+
def calls
|
41
|
+
@calls ||= AuthTypeCallsList.new(
|
42
|
+
@version,
|
43
|
+
account_sid: @solution[:account_sid],
|
44
|
+
domain_sid: @solution[:domain_sid],
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
##
|
49
|
+
# Access the registrations
|
50
|
+
# @return [AuthTypeRegistrationsList]
|
51
|
+
# @return [AuthTypeRegistrationsContext]
|
52
|
+
def registrations
|
53
|
+
@registrations ||= AuthTypeRegistrationsList.new(
|
54
|
+
@version,
|
55
|
+
account_sid: @solution[:account_sid],
|
56
|
+
domain_sid: @solution[:domain_sid],
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
##
|
61
|
+
# Provide a user friendly representation
|
62
|
+
def to_s
|
63
|
+
'#<Twilio.Api.V2010.AuthTypesList>'
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
class AuthTypesPage < Page
|
68
|
+
##
|
69
|
+
# Initialize the AuthTypesPage
|
70
|
+
# @param [Version] version Version that contains the resource
|
71
|
+
# @param [Response] response Response from the API
|
72
|
+
# @param [Hash] solution Path solution for the resource
|
73
|
+
# @return [AuthTypesPage] AuthTypesPage
|
74
|
+
def initialize(version, response, solution)
|
75
|
+
super(version, response)
|
76
|
+
|
77
|
+
# Path Solution
|
78
|
+
@solution = solution
|
79
|
+
end
|
80
|
+
|
81
|
+
##
|
82
|
+
# Build an instance of AuthTypesInstance
|
83
|
+
# @param [Hash] payload Payload response from the API
|
84
|
+
# @return [AuthTypesInstance] AuthTypesInstance
|
85
|
+
def get_instance(payload)
|
86
|
+
AuthTypesInstance.new(
|
87
|
+
@version,
|
88
|
+
payload,
|
89
|
+
account_sid: @solution[:account_sid],
|
90
|
+
domain_sid: @solution[:domain_sid],
|
91
|
+
)
|
92
|
+
end
|
93
|
+
|
94
|
+
##
|
95
|
+
# Provide a user friendly representation
|
96
|
+
def to_s
|
97
|
+
'<Twilio.Api.V2010.AuthTypesPage>'
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
class AuthTypesInstance < InstanceResource
|
102
|
+
##
|
103
|
+
# Initialize the AuthTypesInstance
|
104
|
+
# @param [Version] version Version that contains the resource
|
105
|
+
# @param [Hash] payload payload that contains response from Twilio
|
106
|
+
# @param [String] account_sid The unique id of the
|
107
|
+
# [Account](https://www.twilio.com/docs/api/rest/account) that sent this message.
|
108
|
+
# @param [String] domain_sid A 34 character string that uniquely identifies the
|
109
|
+
# SIP domain in Twilio.
|
110
|
+
# @return [AuthTypesInstance] AuthTypesInstance
|
111
|
+
def initialize(version, payload, account_sid: nil, domain_sid: nil)
|
112
|
+
super(version)
|
113
|
+
end
|
114
|
+
|
115
|
+
##
|
116
|
+
# Provide a user friendly representation
|
117
|
+
def to_s
|
118
|
+
"<Twilio.Api.V2010.AuthTypesInstance>"
|
119
|
+
end
|
120
|
+
|
121
|
+
##
|
122
|
+
# Provide a detailed, user friendly representation
|
123
|
+
def inspect
|
124
|
+
"<Twilio.Api.V2010.AuthTypesInstance>"
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
@@ -0,0 +1,161 @@
|
|
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 Api < Domain
|
12
|
+
class V2010 < Version
|
13
|
+
class AccountContext < InstanceContext
|
14
|
+
class SipList < ListResource
|
15
|
+
class DomainContext < InstanceContext
|
16
|
+
class AuthTypesList < ListResource
|
17
|
+
class AuthTypeCallsList < ListResource
|
18
|
+
##
|
19
|
+
# Initialize the AuthTypeCallsList
|
20
|
+
# @param [Version] version Version that contains the resource
|
21
|
+
# @param [String] account_sid The unique id of the
|
22
|
+
# [Account](https://www.twilio.com/docs/api/rest/account) that sent this message.
|
23
|
+
# @param [String] domain_sid A 34 character string that uniquely identifies the
|
24
|
+
# SIP domain in Twilio.
|
25
|
+
# @return [AuthTypeCallsList] AuthTypeCallsList
|
26
|
+
def initialize(version, account_sid: nil, domain_sid: nil)
|
27
|
+
super(version)
|
28
|
+
|
29
|
+
# Path Solution
|
30
|
+
@solution = {account_sid: account_sid, domain_sid: domain_sid}
|
31
|
+
|
32
|
+
# Components
|
33
|
+
@credential_list_mappings = nil
|
34
|
+
@ip_access_control_list_mappings = nil
|
35
|
+
end
|
36
|
+
|
37
|
+
##
|
38
|
+
# Access the credential_list_mappings
|
39
|
+
# @param [String] sid The credential list Sid that uniquely identifies this
|
40
|
+
# resource
|
41
|
+
# @return [AuthCallsCredentialListMappingList]
|
42
|
+
# @return [AuthCallsCredentialListMappingContext] if sid was passed.
|
43
|
+
def credential_list_mappings(sid=:unset)
|
44
|
+
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
45
|
+
|
46
|
+
if sid != :unset
|
47
|
+
return AuthCallsCredentialListMappingContext.new(
|
48
|
+
@version,
|
49
|
+
@solution[:account_sid],
|
50
|
+
@solution[:domain_sid],
|
51
|
+
sid,
|
52
|
+
)
|
53
|
+
end
|
54
|
+
|
55
|
+
@credential_list_mappings ||= AuthCallsCredentialListMappingList.new(
|
56
|
+
@version,
|
57
|
+
account_sid: @solution[:account_sid],
|
58
|
+
domain_sid: @solution[:domain_sid],
|
59
|
+
)
|
60
|
+
end
|
61
|
+
|
62
|
+
##
|
63
|
+
# Access the ip_access_control_list_mappings
|
64
|
+
# @param [String] sid The IP Access Control List Sid that uniquely identifies this
|
65
|
+
# resource
|
66
|
+
# @return [AuthCallsIpAccessControlListMappingList]
|
67
|
+
# @return [AuthCallsIpAccessControlListMappingContext] if sid was passed.
|
68
|
+
def ip_access_control_list_mappings(sid=:unset)
|
69
|
+
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
70
|
+
|
71
|
+
if sid != :unset
|
72
|
+
return AuthCallsIpAccessControlListMappingContext.new(
|
73
|
+
@version,
|
74
|
+
@solution[:account_sid],
|
75
|
+
@solution[:domain_sid],
|
76
|
+
sid,
|
77
|
+
)
|
78
|
+
end
|
79
|
+
|
80
|
+
@ip_access_control_list_mappings ||= AuthCallsIpAccessControlListMappingList.new(
|
81
|
+
@version,
|
82
|
+
account_sid: @solution[:account_sid],
|
83
|
+
domain_sid: @solution[:domain_sid],
|
84
|
+
)
|
85
|
+
end
|
86
|
+
|
87
|
+
##
|
88
|
+
# Provide a user friendly representation
|
89
|
+
def to_s
|
90
|
+
'#<Twilio.Api.V2010.AuthTypeCallsList>'
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
class AuthTypeCallsPage < Page
|
95
|
+
##
|
96
|
+
# Initialize the AuthTypeCallsPage
|
97
|
+
# @param [Version] version Version that contains the resource
|
98
|
+
# @param [Response] response Response from the API
|
99
|
+
# @param [Hash] solution Path solution for the resource
|
100
|
+
# @return [AuthTypeCallsPage] AuthTypeCallsPage
|
101
|
+
def initialize(version, response, solution)
|
102
|
+
super(version, response)
|
103
|
+
|
104
|
+
# Path Solution
|
105
|
+
@solution = solution
|
106
|
+
end
|
107
|
+
|
108
|
+
##
|
109
|
+
# Build an instance of AuthTypeCallsInstance
|
110
|
+
# @param [Hash] payload Payload response from the API
|
111
|
+
# @return [AuthTypeCallsInstance] AuthTypeCallsInstance
|
112
|
+
def get_instance(payload)
|
113
|
+
AuthTypeCallsInstance.new(
|
114
|
+
@version,
|
115
|
+
payload,
|
116
|
+
account_sid: @solution[:account_sid],
|
117
|
+
domain_sid: @solution[:domain_sid],
|
118
|
+
)
|
119
|
+
end
|
120
|
+
|
121
|
+
##
|
122
|
+
# Provide a user friendly representation
|
123
|
+
def to_s
|
124
|
+
'<Twilio.Api.V2010.AuthTypeCallsPage>'
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
class AuthTypeCallsInstance < InstanceResource
|
129
|
+
##
|
130
|
+
# Initialize the AuthTypeCallsInstance
|
131
|
+
# @param [Version] version Version that contains the resource
|
132
|
+
# @param [Hash] payload payload that contains response from Twilio
|
133
|
+
# @param [String] account_sid The unique id of the
|
134
|
+
# [Account](https://www.twilio.com/docs/api/rest/account) that sent this message.
|
135
|
+
# @param [String] domain_sid A 34 character string that uniquely identifies the
|
136
|
+
# SIP domain in Twilio.
|
137
|
+
# @return [AuthTypeCallsInstance] AuthTypeCallsInstance
|
138
|
+
def initialize(version, payload, account_sid: nil, domain_sid: nil)
|
139
|
+
super(version)
|
140
|
+
end
|
141
|
+
|
142
|
+
##
|
143
|
+
# Provide a user friendly representation
|
144
|
+
def to_s
|
145
|
+
"<Twilio.Api.V2010.AuthTypeCallsInstance>"
|
146
|
+
end
|
147
|
+
|
148
|
+
##
|
149
|
+
# Provide a detailed, user friendly representation
|
150
|
+
def inspect
|
151
|
+
"<Twilio.Api.V2010.AuthTypeCallsInstance>"
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
@@ -0,0 +1,349 @@
|
|
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 Api < Domain
|
12
|
+
class V2010 < Version
|
13
|
+
class AccountContext < InstanceContext
|
14
|
+
class SipList < ListResource
|
15
|
+
class DomainContext < InstanceContext
|
16
|
+
class AuthTypesList < ListResource
|
17
|
+
class AuthTypeCallsList < ListResource
|
18
|
+
class AuthCallsCredentialListMappingList < ListResource
|
19
|
+
##
|
20
|
+
# Initialize the AuthCallsCredentialListMappingList
|
21
|
+
# @param [Version] version Version that contains the resource
|
22
|
+
# @param [String] account_sid The unique id of the
|
23
|
+
# [Account](https://www.twilio.com/docs/api/rest/account) that sent this message.
|
24
|
+
# @param [String] domain_sid A 34 character string that uniquely identifies the
|
25
|
+
# SIP domain in Twilio.
|
26
|
+
# @return [AuthCallsCredentialListMappingList] AuthCallsCredentialListMappingList
|
27
|
+
def initialize(version, account_sid: nil, domain_sid: nil)
|
28
|
+
super(version)
|
29
|
+
|
30
|
+
# Path Solution
|
31
|
+
@solution = {account_sid: account_sid, domain_sid: domain_sid}
|
32
|
+
@uri = "/Accounts/#{@solution[:account_sid]}/SIP/Domains/#{@solution[:domain_sid]}/Auth/Calls/CredentialListMappings.json"
|
33
|
+
end
|
34
|
+
|
35
|
+
##
|
36
|
+
# Retrieve a single page of AuthCallsCredentialListMappingInstance records from the API.
|
37
|
+
# Request is executed immediately.
|
38
|
+
# @param [String] credential_list_sid A 34 character string that uniquely
|
39
|
+
# identifies this credential list resource
|
40
|
+
# @return [AuthCallsCredentialListMappingInstance] Newly created AuthCallsCredentialListMappingInstance
|
41
|
+
def create(credential_list_sid: nil)
|
42
|
+
data = Twilio::Values.of({'CredentialListSid' => credential_list_sid, })
|
43
|
+
|
44
|
+
payload = @version.create(
|
45
|
+
'POST',
|
46
|
+
@uri,
|
47
|
+
data: data
|
48
|
+
)
|
49
|
+
|
50
|
+
AuthCallsCredentialListMappingInstance.new(
|
51
|
+
@version,
|
52
|
+
payload,
|
53
|
+
account_sid: @solution[:account_sid],
|
54
|
+
domain_sid: @solution[:domain_sid],
|
55
|
+
)
|
56
|
+
end
|
57
|
+
|
58
|
+
##
|
59
|
+
# Lists AuthCallsCredentialListMappingInstance 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 [Integer] limit Upper limit for the number of records to return. stream()
|
63
|
+
# guarantees to never return more than limit. Default is no limit
|
64
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
65
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
66
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
67
|
+
# efficient page size, i.e. min(limit, 1000)
|
68
|
+
# @return [Array] Array of up to limit results
|
69
|
+
def list(limit: nil, page_size: nil)
|
70
|
+
self.stream(limit: limit, page_size: page_size).entries
|
71
|
+
end
|
72
|
+
|
73
|
+
##
|
74
|
+
# Streams AuthCallsCredentialListMappingInstance records from the API as an Enumerable.
|
75
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
76
|
+
# is reached.
|
77
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
78
|
+
# guarantees to never return more than limit. Default is no limit.
|
79
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
80
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
81
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
82
|
+
# efficient page size, i.e. min(limit, 1000)
|
83
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
84
|
+
def stream(limit: nil, page_size: nil)
|
85
|
+
limits = @version.read_limits(limit, page_size)
|
86
|
+
|
87
|
+
page = self.page(page_size: limits[:page_size], )
|
88
|
+
|
89
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
90
|
+
end
|
91
|
+
|
92
|
+
##
|
93
|
+
# When passed a block, yields AuthCallsCredentialListMappingInstance records from the API.
|
94
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
95
|
+
# is reached.
|
96
|
+
def each
|
97
|
+
limits = @version.read_limits
|
98
|
+
|
99
|
+
page = self.page(page_size: limits[:page_size], )
|
100
|
+
|
101
|
+
@version.stream(page,
|
102
|
+
limit: limits[:limit],
|
103
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
104
|
+
end
|
105
|
+
|
106
|
+
##
|
107
|
+
# Retrieve a single page of AuthCallsCredentialListMappingInstance records from the API.
|
108
|
+
# Request is executed immediately.
|
109
|
+
# @param [String] page_token PageToken provided by the API
|
110
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
111
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
112
|
+
# @return [Page] Page of AuthCallsCredentialListMappingInstance
|
113
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
114
|
+
params = Twilio::Values.of({
|
115
|
+
'PageToken' => page_token,
|
116
|
+
'Page' => page_number,
|
117
|
+
'PageSize' => page_size,
|
118
|
+
})
|
119
|
+
response = @version.page(
|
120
|
+
'GET',
|
121
|
+
@uri,
|
122
|
+
params
|
123
|
+
)
|
124
|
+
AuthCallsCredentialListMappingPage.new(@version, response, @solution)
|
125
|
+
end
|
126
|
+
|
127
|
+
##
|
128
|
+
# Retrieve a single page of AuthCallsCredentialListMappingInstance records from the API.
|
129
|
+
# Request is executed immediately.
|
130
|
+
# @param [String] target_url API-generated URL for the requested results page
|
131
|
+
# @return [Page] Page of AuthCallsCredentialListMappingInstance
|
132
|
+
def get_page(target_url)
|
133
|
+
response = @version.domain.request(
|
134
|
+
'GET',
|
135
|
+
target_url
|
136
|
+
)
|
137
|
+
AuthCallsCredentialListMappingPage.new(@version, response, @solution)
|
138
|
+
end
|
139
|
+
|
140
|
+
##
|
141
|
+
# Provide a user friendly representation
|
142
|
+
def to_s
|
143
|
+
'#<Twilio.Api.V2010.AuthCallsCredentialListMappingList>'
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
class AuthCallsCredentialListMappingPage < Page
|
148
|
+
##
|
149
|
+
# Initialize the AuthCallsCredentialListMappingPage
|
150
|
+
# @param [Version] version Version that contains the resource
|
151
|
+
# @param [Response] response Response from the API
|
152
|
+
# @param [Hash] solution Path solution for the resource
|
153
|
+
# @return [AuthCallsCredentialListMappingPage] AuthCallsCredentialListMappingPage
|
154
|
+
def initialize(version, response, solution)
|
155
|
+
super(version, response)
|
156
|
+
|
157
|
+
# Path Solution
|
158
|
+
@solution = solution
|
159
|
+
end
|
160
|
+
|
161
|
+
##
|
162
|
+
# Build an instance of AuthCallsCredentialListMappingInstance
|
163
|
+
# @param [Hash] payload Payload response from the API
|
164
|
+
# @return [AuthCallsCredentialListMappingInstance] AuthCallsCredentialListMappingInstance
|
165
|
+
def get_instance(payload)
|
166
|
+
AuthCallsCredentialListMappingInstance.new(
|
167
|
+
@version,
|
168
|
+
payload,
|
169
|
+
account_sid: @solution[:account_sid],
|
170
|
+
domain_sid: @solution[:domain_sid],
|
171
|
+
)
|
172
|
+
end
|
173
|
+
|
174
|
+
##
|
175
|
+
# Provide a user friendly representation
|
176
|
+
def to_s
|
177
|
+
'<Twilio.Api.V2010.AuthCallsCredentialListMappingPage>'
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
class AuthCallsCredentialListMappingContext < InstanceContext
|
182
|
+
##
|
183
|
+
# Initialize the AuthCallsCredentialListMappingContext
|
184
|
+
# @param [Version] version Version that contains the resource
|
185
|
+
# @param [String] account_sid The account_sid
|
186
|
+
# @param [String] domain_sid The domain_sid
|
187
|
+
# @param [String] sid The credential list Sid that uniquely identifies this
|
188
|
+
# resource
|
189
|
+
# @return [AuthCallsCredentialListMappingContext] AuthCallsCredentialListMappingContext
|
190
|
+
def initialize(version, account_sid, domain_sid, sid)
|
191
|
+
super(version)
|
192
|
+
|
193
|
+
# Path Solution
|
194
|
+
@solution = {account_sid: account_sid, domain_sid: domain_sid, sid: sid, }
|
195
|
+
@uri = "/Accounts/#{@solution[:account_sid]}/SIP/Domains/#{@solution[:domain_sid]}/Auth/Calls/CredentialListMappings/#{@solution[:sid]}.json"
|
196
|
+
end
|
197
|
+
|
198
|
+
##
|
199
|
+
# Fetch a AuthCallsCredentialListMappingInstance
|
200
|
+
# @return [AuthCallsCredentialListMappingInstance] Fetched AuthCallsCredentialListMappingInstance
|
201
|
+
def fetch
|
202
|
+
params = Twilio::Values.of({})
|
203
|
+
|
204
|
+
payload = @version.fetch(
|
205
|
+
'GET',
|
206
|
+
@uri,
|
207
|
+
params,
|
208
|
+
)
|
209
|
+
|
210
|
+
AuthCallsCredentialListMappingInstance.new(
|
211
|
+
@version,
|
212
|
+
payload,
|
213
|
+
account_sid: @solution[:account_sid],
|
214
|
+
domain_sid: @solution[:domain_sid],
|
215
|
+
sid: @solution[:sid],
|
216
|
+
)
|
217
|
+
end
|
218
|
+
|
219
|
+
##
|
220
|
+
# Deletes the AuthCallsCredentialListMappingInstance
|
221
|
+
# @return [Boolean] true if delete succeeds, true otherwise
|
222
|
+
def delete
|
223
|
+
@version.delete('delete', @uri)
|
224
|
+
end
|
225
|
+
|
226
|
+
##
|
227
|
+
# Provide a user friendly representation
|
228
|
+
def to_s
|
229
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
230
|
+
"#<Twilio.Api.V2010.AuthCallsCredentialListMappingContext #{context}>"
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
class AuthCallsCredentialListMappingInstance < InstanceResource
|
235
|
+
##
|
236
|
+
# Initialize the AuthCallsCredentialListMappingInstance
|
237
|
+
# @param [Version] version Version that contains the resource
|
238
|
+
# @param [Hash] payload payload that contains response from Twilio
|
239
|
+
# @param [String] account_sid The unique id of the
|
240
|
+
# [Account](https://www.twilio.com/docs/api/rest/account) that sent this message.
|
241
|
+
# @param [String] domain_sid A 34 character string that uniquely identifies the
|
242
|
+
# SIP domain in Twilio.
|
243
|
+
# @param [String] sid The credential list Sid that uniquely identifies this
|
244
|
+
# resource
|
245
|
+
# @return [AuthCallsCredentialListMappingInstance] AuthCallsCredentialListMappingInstance
|
246
|
+
def initialize(version, payload, account_sid: nil, domain_sid: nil, sid: nil)
|
247
|
+
super(version)
|
248
|
+
|
249
|
+
# Marshaled Properties
|
250
|
+
@properties = {
|
251
|
+
'account_sid' => payload['account_sid'],
|
252
|
+
'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
|
253
|
+
'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
|
254
|
+
'friendly_name' => payload['friendly_name'],
|
255
|
+
'sid' => payload['sid'],
|
256
|
+
}
|
257
|
+
|
258
|
+
# Context
|
259
|
+
@instance_context = nil
|
260
|
+
@params = {
|
261
|
+
'account_sid' => account_sid,
|
262
|
+
'domain_sid' => domain_sid,
|
263
|
+
'sid' => sid || @properties['sid'],
|
264
|
+
}
|
265
|
+
end
|
266
|
+
|
267
|
+
##
|
268
|
+
# Generate an instance context for the instance, the context is capable of
|
269
|
+
# performing various actions. All instance actions are proxied to the context
|
270
|
+
# @return [AuthCallsCredentialListMappingContext] AuthCallsCredentialListMappingContext for this AuthCallsCredentialListMappingInstance
|
271
|
+
def context
|
272
|
+
unless @instance_context
|
273
|
+
@instance_context = AuthCallsCredentialListMappingContext.new(
|
274
|
+
@version,
|
275
|
+
@params['account_sid'],
|
276
|
+
@params['domain_sid'],
|
277
|
+
@params['sid'],
|
278
|
+
)
|
279
|
+
end
|
280
|
+
@instance_context
|
281
|
+
end
|
282
|
+
|
283
|
+
##
|
284
|
+
# @return [String] The unique sid that identifies this account
|
285
|
+
def account_sid
|
286
|
+
@properties['account_sid']
|
287
|
+
end
|
288
|
+
|
289
|
+
##
|
290
|
+
# @return [Time] The date this resource was created
|
291
|
+
def date_created
|
292
|
+
@properties['date_created']
|
293
|
+
end
|
294
|
+
|
295
|
+
##
|
296
|
+
# @return [Time] The date this resource was last updated
|
297
|
+
def date_updated
|
298
|
+
@properties['date_updated']
|
299
|
+
end
|
300
|
+
|
301
|
+
##
|
302
|
+
# @return [String] A human readable description of this resource
|
303
|
+
def friendly_name
|
304
|
+
@properties['friendly_name']
|
305
|
+
end
|
306
|
+
|
307
|
+
##
|
308
|
+
# @return [String] A string that uniquely identifies this resource
|
309
|
+
def sid
|
310
|
+
@properties['sid']
|
311
|
+
end
|
312
|
+
|
313
|
+
##
|
314
|
+
# Fetch a AuthCallsCredentialListMappingInstance
|
315
|
+
# @return [AuthCallsCredentialListMappingInstance] Fetched AuthCallsCredentialListMappingInstance
|
316
|
+
def fetch
|
317
|
+
context.fetch
|
318
|
+
end
|
319
|
+
|
320
|
+
##
|
321
|
+
# Deletes the AuthCallsCredentialListMappingInstance
|
322
|
+
# @return [Boolean] true if delete succeeds, true otherwise
|
323
|
+
def delete
|
324
|
+
context.delete
|
325
|
+
end
|
326
|
+
|
327
|
+
##
|
328
|
+
# Provide a user friendly representation
|
329
|
+
def to_s
|
330
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
331
|
+
"<Twilio.Api.V2010.AuthCallsCredentialListMappingInstance #{values}>"
|
332
|
+
end
|
333
|
+
|
334
|
+
##
|
335
|
+
# Provide a detailed, user friendly representation
|
336
|
+
def inspect
|
337
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
338
|
+
"<Twilio.Api.V2010.AuthCallsCredentialListMappingInstance #{values}>"
|
339
|
+
end
|
340
|
+
end
|
341
|
+
end
|
342
|
+
end
|
343
|
+
end
|
344
|
+
end
|
345
|
+
end
|
346
|
+
end
|
347
|
+
end
|
348
|
+
end
|
349
|
+
end
|