twilio-ruby 5.31.1 → 5.31.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +4 -3
- data/CHANGES.md +16 -0
- data/LICENSE.md +1 -1
- data/README.md +2 -2
- data/lib/twilio-ruby.rb +5 -5
- data/lib/twilio-ruby/rest/client.rb +7 -0
- data/lib/twilio-ruby/rest/numbers.rb +44 -0
- data/lib/twilio-ruby/rest/numbers/v2.rb +35 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance.rb +189 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +482 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb +333 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user.rb +361 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb +281 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +374 -0
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb +281 -0
- data/lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb +30 -5
- data/lib/twilio-ruby/rest/studio.rb +16 -3
- data/lib/twilio-ruby/rest/studio/v2.rb +50 -0
- data/lib/twilio-ruby/rest/studio/v2/flow.rb +451 -0
- data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +343 -0
- data/lib/twilio-ruby/rest/studio/v2/flow_validate.rb +126 -0
- data/lib/twilio-ruby/twiml/voice_response.rb +3 -2
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/numbers/v2/regulatory_compliance/bundle/item_assignment_spec.rb +198 -0
- data/spec/integration/numbers/v2/regulatory_compliance/bundle_spec.rb +226 -0
- data/spec/integration/numbers/v2/regulatory_compliance/end_user_spec.rb +214 -0
- data/spec/integration/numbers/v2/regulatory_compliance/end_user_type_spec.rb +143 -0
- data/spec/integration/numbers/v2/regulatory_compliance/supporting_document_spec.rb +226 -0
- data/spec/integration/numbers/v2/regulatory_compliance/supporting_document_type_spec.rb +133 -0
- data/spec/integration/numbers/v2/regulatory_compliance_spec.rb +12 -0
- data/spec/integration/serverless/v1/service/environment/log_spec.rb +2 -2
- data/spec/integration/studio/v2/flow/flow_revision_spec.rb +112 -0
- data/spec/integration/studio/v2/flow_spec.rb +234 -0
- data/spec/integration/studio/v2/flow_validate_spec.rb +42 -0
- data/twilio-ruby.gemspec +2 -2
- metadata +39 -6
@@ -0,0 +1,281 @@
|
|
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 Numbers < Domain
|
12
|
+
class V2 < Version
|
13
|
+
class RegulatoryComplianceList < ListResource
|
14
|
+
class EndUserTypeList < ListResource
|
15
|
+
##
|
16
|
+
# Initialize the EndUserTypeList
|
17
|
+
# @param [Version] version Version that contains the resource
|
18
|
+
# @return [EndUserTypeList] EndUserTypeList
|
19
|
+
def initialize(version)
|
20
|
+
super(version)
|
21
|
+
|
22
|
+
# Path Solution
|
23
|
+
@solution = {}
|
24
|
+
@uri = "/RegulatoryCompliance/EndUserTypes"
|
25
|
+
end
|
26
|
+
|
27
|
+
##
|
28
|
+
# Lists EndUserTypeInstance records from the API as a list.
|
29
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
30
|
+
# memory before returning.
|
31
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
32
|
+
# guarantees to never return more than limit. Default is no limit
|
33
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
34
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
35
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
36
|
+
# efficient page size, i.e. min(limit, 1000)
|
37
|
+
# @return [Array] Array of up to limit results
|
38
|
+
def list(limit: nil, page_size: nil)
|
39
|
+
self.stream(limit: limit, page_size: page_size).entries
|
40
|
+
end
|
41
|
+
|
42
|
+
##
|
43
|
+
# Streams EndUserTypeInstance records from the API as an Enumerable.
|
44
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
45
|
+
# is reached.
|
46
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
47
|
+
# guarantees to never return more than limit. Default is no limit.
|
48
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
49
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
50
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
51
|
+
# efficient page size, i.e. min(limit, 1000)
|
52
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
53
|
+
def stream(limit: nil, page_size: nil)
|
54
|
+
limits = @version.read_limits(limit, page_size)
|
55
|
+
|
56
|
+
page = self.page(page_size: limits[:page_size], )
|
57
|
+
|
58
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
59
|
+
end
|
60
|
+
|
61
|
+
##
|
62
|
+
# When passed a block, yields EndUserTypeInstance records from the API.
|
63
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
64
|
+
# is reached.
|
65
|
+
def each
|
66
|
+
limits = @version.read_limits
|
67
|
+
|
68
|
+
page = self.page(page_size: limits[:page_size], )
|
69
|
+
|
70
|
+
@version.stream(page,
|
71
|
+
limit: limits[:limit],
|
72
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
73
|
+
end
|
74
|
+
|
75
|
+
##
|
76
|
+
# Retrieve a single page of EndUserTypeInstance records from the API.
|
77
|
+
# Request is executed immediately.
|
78
|
+
# @param [String] page_token PageToken provided by the API
|
79
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
80
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
81
|
+
# @return [Page] Page of EndUserTypeInstance
|
82
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
83
|
+
params = Twilio::Values.of({
|
84
|
+
'PageToken' => page_token,
|
85
|
+
'Page' => page_number,
|
86
|
+
'PageSize' => page_size,
|
87
|
+
})
|
88
|
+
response = @version.page(
|
89
|
+
'GET',
|
90
|
+
@uri,
|
91
|
+
params
|
92
|
+
)
|
93
|
+
EndUserTypePage.new(@version, response, @solution)
|
94
|
+
end
|
95
|
+
|
96
|
+
##
|
97
|
+
# Retrieve a single page of EndUserTypeInstance records from the API.
|
98
|
+
# Request is executed immediately.
|
99
|
+
# @param [String] target_url API-generated URL for the requested results page
|
100
|
+
# @return [Page] Page of EndUserTypeInstance
|
101
|
+
def get_page(target_url)
|
102
|
+
response = @version.domain.request(
|
103
|
+
'GET',
|
104
|
+
target_url
|
105
|
+
)
|
106
|
+
EndUserTypePage.new(@version, response, @solution)
|
107
|
+
end
|
108
|
+
|
109
|
+
##
|
110
|
+
# Provide a user friendly representation
|
111
|
+
def to_s
|
112
|
+
'#<Twilio.Numbers.V2.EndUserTypeList>'
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
class EndUserTypePage < Page
|
117
|
+
##
|
118
|
+
# Initialize the EndUserTypePage
|
119
|
+
# @param [Version] version Version that contains the resource
|
120
|
+
# @param [Response] response Response from the API
|
121
|
+
# @param [Hash] solution Path solution for the resource
|
122
|
+
# @return [EndUserTypePage] EndUserTypePage
|
123
|
+
def initialize(version, response, solution)
|
124
|
+
super(version, response)
|
125
|
+
|
126
|
+
# Path Solution
|
127
|
+
@solution = solution
|
128
|
+
end
|
129
|
+
|
130
|
+
##
|
131
|
+
# Build an instance of EndUserTypeInstance
|
132
|
+
# @param [Hash] payload Payload response from the API
|
133
|
+
# @return [EndUserTypeInstance] EndUserTypeInstance
|
134
|
+
def get_instance(payload)
|
135
|
+
EndUserTypeInstance.new(@version, payload, )
|
136
|
+
end
|
137
|
+
|
138
|
+
##
|
139
|
+
# Provide a user friendly representation
|
140
|
+
def to_s
|
141
|
+
'<Twilio.Numbers.V2.EndUserTypePage>'
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
class EndUserTypeContext < InstanceContext
|
146
|
+
##
|
147
|
+
# Initialize the EndUserTypeContext
|
148
|
+
# @param [Version] version Version that contains the resource
|
149
|
+
# @param [String] sid The unique string that identifies the End-User Type
|
150
|
+
# resource.
|
151
|
+
# @return [EndUserTypeContext] EndUserTypeContext
|
152
|
+
def initialize(version, sid)
|
153
|
+
super(version)
|
154
|
+
|
155
|
+
# Path Solution
|
156
|
+
@solution = {sid: sid, }
|
157
|
+
@uri = "/RegulatoryCompliance/EndUserTypes/#{@solution[:sid]}"
|
158
|
+
end
|
159
|
+
|
160
|
+
##
|
161
|
+
# Fetch a EndUserTypeInstance
|
162
|
+
# @return [EndUserTypeInstance] Fetched EndUserTypeInstance
|
163
|
+
def fetch
|
164
|
+
params = Twilio::Values.of({})
|
165
|
+
|
166
|
+
payload = @version.fetch(
|
167
|
+
'GET',
|
168
|
+
@uri,
|
169
|
+
params,
|
170
|
+
)
|
171
|
+
|
172
|
+
EndUserTypeInstance.new(@version, payload, sid: @solution[:sid], )
|
173
|
+
end
|
174
|
+
|
175
|
+
##
|
176
|
+
# Provide a user friendly representation
|
177
|
+
def to_s
|
178
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
179
|
+
"#<Twilio.Numbers.V2.EndUserTypeContext #{context}>"
|
180
|
+
end
|
181
|
+
|
182
|
+
##
|
183
|
+
# Provide a detailed, user friendly representation
|
184
|
+
def inspect
|
185
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
186
|
+
"#<Twilio.Numbers.V2.EndUserTypeContext #{context}>"
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
class EndUserTypeInstance < InstanceResource
|
191
|
+
##
|
192
|
+
# Initialize the EndUserTypeInstance
|
193
|
+
# @param [Version] version Version that contains the resource
|
194
|
+
# @param [Hash] payload payload that contains response from Twilio
|
195
|
+
# @param [String] sid The unique string that identifies the End-User Type
|
196
|
+
# resource.
|
197
|
+
# @return [EndUserTypeInstance] EndUserTypeInstance
|
198
|
+
def initialize(version, payload, sid: nil)
|
199
|
+
super(version)
|
200
|
+
|
201
|
+
# Marshaled Properties
|
202
|
+
@properties = {
|
203
|
+
'sid' => payload['sid'],
|
204
|
+
'friendly_name' => payload['friendly_name'],
|
205
|
+
'machine_name' => payload['machine_name'],
|
206
|
+
'fields' => payload['fields'],
|
207
|
+
'url' => payload['url'],
|
208
|
+
}
|
209
|
+
|
210
|
+
# Context
|
211
|
+
@instance_context = nil
|
212
|
+
@params = {'sid' => sid || @properties['sid'], }
|
213
|
+
end
|
214
|
+
|
215
|
+
##
|
216
|
+
# Generate an instance context for the instance, the context is capable of
|
217
|
+
# performing various actions. All instance actions are proxied to the context
|
218
|
+
# @return [EndUserTypeContext] EndUserTypeContext for this EndUserTypeInstance
|
219
|
+
def context
|
220
|
+
unless @instance_context
|
221
|
+
@instance_context = EndUserTypeContext.new(@version, @params['sid'], )
|
222
|
+
end
|
223
|
+
@instance_context
|
224
|
+
end
|
225
|
+
|
226
|
+
##
|
227
|
+
# @return [String] The unique string that identifies the End-User Type resource
|
228
|
+
def sid
|
229
|
+
@properties['sid']
|
230
|
+
end
|
231
|
+
|
232
|
+
##
|
233
|
+
# @return [String] A human-readable description of the End-User Type resource
|
234
|
+
def friendly_name
|
235
|
+
@properties['friendly_name']
|
236
|
+
end
|
237
|
+
|
238
|
+
##
|
239
|
+
# @return [String] A machine-readable description of the End-User Type resource
|
240
|
+
def machine_name
|
241
|
+
@properties['machine_name']
|
242
|
+
end
|
243
|
+
|
244
|
+
##
|
245
|
+
# @return [Hash] The required information for creating an End-User.
|
246
|
+
def fields
|
247
|
+
@properties['fields']
|
248
|
+
end
|
249
|
+
|
250
|
+
##
|
251
|
+
# @return [String] The absolute URL of the End-User Type resource
|
252
|
+
def url
|
253
|
+
@properties['url']
|
254
|
+
end
|
255
|
+
|
256
|
+
##
|
257
|
+
# Fetch a EndUserTypeInstance
|
258
|
+
# @return [EndUserTypeInstance] Fetched EndUserTypeInstance
|
259
|
+
def fetch
|
260
|
+
context.fetch
|
261
|
+
end
|
262
|
+
|
263
|
+
##
|
264
|
+
# Provide a user friendly representation
|
265
|
+
def to_s
|
266
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
267
|
+
"<Twilio.Numbers.V2.EndUserTypeInstance #{values}>"
|
268
|
+
end
|
269
|
+
|
270
|
+
##
|
271
|
+
# Provide a detailed, user friendly representation
|
272
|
+
def inspect
|
273
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
274
|
+
"<Twilio.Numbers.V2.EndUserTypeInstance #{values}>"
|
275
|
+
end
|
276
|
+
end
|
277
|
+
end
|
278
|
+
end
|
279
|
+
end
|
280
|
+
end
|
281
|
+
end
|
@@ -0,0 +1,374 @@
|
|
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 Numbers < Domain
|
12
|
+
class V2 < Version
|
13
|
+
class RegulatoryComplianceList < ListResource
|
14
|
+
class SupportingDocumentList < ListResource
|
15
|
+
##
|
16
|
+
# Initialize the SupportingDocumentList
|
17
|
+
# @param [Version] version Version that contains the resource
|
18
|
+
# @return [SupportingDocumentList] SupportingDocumentList
|
19
|
+
def initialize(version)
|
20
|
+
super(version)
|
21
|
+
|
22
|
+
# Path Solution
|
23
|
+
@solution = {}
|
24
|
+
@uri = "/RegulatoryCompliance/SupportingDocuments"
|
25
|
+
end
|
26
|
+
|
27
|
+
##
|
28
|
+
# Retrieve a single page of SupportingDocumentInstance records from the API.
|
29
|
+
# Request is executed immediately.
|
30
|
+
# @param [String] friendly_name The string that you assigned to describe the
|
31
|
+
# resource.
|
32
|
+
# @param [String] type The type of the Supporting Document.
|
33
|
+
# @param [Hash] attributes The set of parameters that are the attributes of the
|
34
|
+
# Supporting Documents resource which are derived Supporting Document Types.
|
35
|
+
# @return [SupportingDocumentInstance] Newly created SupportingDocumentInstance
|
36
|
+
def create(friendly_name: nil, type: nil, attributes: :unset)
|
37
|
+
data = Twilio::Values.of({
|
38
|
+
'FriendlyName' => friendly_name,
|
39
|
+
'Type' => type,
|
40
|
+
'Attributes' => Twilio.serialize_object(attributes),
|
41
|
+
})
|
42
|
+
|
43
|
+
payload = @version.create(
|
44
|
+
'POST',
|
45
|
+
@uri,
|
46
|
+
data: data
|
47
|
+
)
|
48
|
+
|
49
|
+
SupportingDocumentInstance.new(@version, payload, )
|
50
|
+
end
|
51
|
+
|
52
|
+
##
|
53
|
+
# Lists SupportingDocumentInstance records from the API as a list.
|
54
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
55
|
+
# memory before returning.
|
56
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
57
|
+
# guarantees to never return more than limit. Default is no limit
|
58
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
59
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
60
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
61
|
+
# efficient page size, i.e. min(limit, 1000)
|
62
|
+
# @return [Array] Array of up to limit results
|
63
|
+
def list(limit: nil, page_size: nil)
|
64
|
+
self.stream(limit: limit, page_size: page_size).entries
|
65
|
+
end
|
66
|
+
|
67
|
+
##
|
68
|
+
# Streams SupportingDocumentInstance records from the API as an Enumerable.
|
69
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
70
|
+
# is reached.
|
71
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
72
|
+
# guarantees to never return more than limit. Default is no limit.
|
73
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
74
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
75
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
76
|
+
# efficient page size, i.e. min(limit, 1000)
|
77
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
78
|
+
def stream(limit: nil, page_size: nil)
|
79
|
+
limits = @version.read_limits(limit, page_size)
|
80
|
+
|
81
|
+
page = self.page(page_size: limits[:page_size], )
|
82
|
+
|
83
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
84
|
+
end
|
85
|
+
|
86
|
+
##
|
87
|
+
# When passed a block, yields SupportingDocumentInstance records from the API.
|
88
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
89
|
+
# is reached.
|
90
|
+
def each
|
91
|
+
limits = @version.read_limits
|
92
|
+
|
93
|
+
page = self.page(page_size: limits[:page_size], )
|
94
|
+
|
95
|
+
@version.stream(page,
|
96
|
+
limit: limits[:limit],
|
97
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
98
|
+
end
|
99
|
+
|
100
|
+
##
|
101
|
+
# Retrieve a single page of SupportingDocumentInstance records from the API.
|
102
|
+
# Request is executed immediately.
|
103
|
+
# @param [String] page_token PageToken provided by the API
|
104
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
105
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
106
|
+
# @return [Page] Page of SupportingDocumentInstance
|
107
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
108
|
+
params = Twilio::Values.of({
|
109
|
+
'PageToken' => page_token,
|
110
|
+
'Page' => page_number,
|
111
|
+
'PageSize' => page_size,
|
112
|
+
})
|
113
|
+
response = @version.page(
|
114
|
+
'GET',
|
115
|
+
@uri,
|
116
|
+
params
|
117
|
+
)
|
118
|
+
SupportingDocumentPage.new(@version, response, @solution)
|
119
|
+
end
|
120
|
+
|
121
|
+
##
|
122
|
+
# Retrieve a single page of SupportingDocumentInstance records from the API.
|
123
|
+
# Request is executed immediately.
|
124
|
+
# @param [String] target_url API-generated URL for the requested results page
|
125
|
+
# @return [Page] Page of SupportingDocumentInstance
|
126
|
+
def get_page(target_url)
|
127
|
+
response = @version.domain.request(
|
128
|
+
'GET',
|
129
|
+
target_url
|
130
|
+
)
|
131
|
+
SupportingDocumentPage.new(@version, response, @solution)
|
132
|
+
end
|
133
|
+
|
134
|
+
##
|
135
|
+
# Provide a user friendly representation
|
136
|
+
def to_s
|
137
|
+
'#<Twilio.Numbers.V2.SupportingDocumentList>'
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
class SupportingDocumentPage < Page
|
142
|
+
##
|
143
|
+
# Initialize the SupportingDocumentPage
|
144
|
+
# @param [Version] version Version that contains the resource
|
145
|
+
# @param [Response] response Response from the API
|
146
|
+
# @param [Hash] solution Path solution for the resource
|
147
|
+
# @return [SupportingDocumentPage] SupportingDocumentPage
|
148
|
+
def initialize(version, response, solution)
|
149
|
+
super(version, response)
|
150
|
+
|
151
|
+
# Path Solution
|
152
|
+
@solution = solution
|
153
|
+
end
|
154
|
+
|
155
|
+
##
|
156
|
+
# Build an instance of SupportingDocumentInstance
|
157
|
+
# @param [Hash] payload Payload response from the API
|
158
|
+
# @return [SupportingDocumentInstance] SupportingDocumentInstance
|
159
|
+
def get_instance(payload)
|
160
|
+
SupportingDocumentInstance.new(@version, payload, )
|
161
|
+
end
|
162
|
+
|
163
|
+
##
|
164
|
+
# Provide a user friendly representation
|
165
|
+
def to_s
|
166
|
+
'<Twilio.Numbers.V2.SupportingDocumentPage>'
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
class SupportingDocumentContext < InstanceContext
|
171
|
+
##
|
172
|
+
# Initialize the SupportingDocumentContext
|
173
|
+
# @param [Version] version Version that contains the resource
|
174
|
+
# @param [String] sid The unique string that we created to identify the Supporting
|
175
|
+
# Document resource.
|
176
|
+
# @return [SupportingDocumentContext] SupportingDocumentContext
|
177
|
+
def initialize(version, sid)
|
178
|
+
super(version)
|
179
|
+
|
180
|
+
# Path Solution
|
181
|
+
@solution = {sid: sid, }
|
182
|
+
@uri = "/RegulatoryCompliance/SupportingDocuments/#{@solution[:sid]}"
|
183
|
+
end
|
184
|
+
|
185
|
+
##
|
186
|
+
# Fetch a SupportingDocumentInstance
|
187
|
+
# @return [SupportingDocumentInstance] Fetched SupportingDocumentInstance
|
188
|
+
def fetch
|
189
|
+
params = Twilio::Values.of({})
|
190
|
+
|
191
|
+
payload = @version.fetch(
|
192
|
+
'GET',
|
193
|
+
@uri,
|
194
|
+
params,
|
195
|
+
)
|
196
|
+
|
197
|
+
SupportingDocumentInstance.new(@version, payload, sid: @solution[:sid], )
|
198
|
+
end
|
199
|
+
|
200
|
+
##
|
201
|
+
# Update the SupportingDocumentInstance
|
202
|
+
# @param [String] friendly_name The string that you assigned to describe the
|
203
|
+
# resource.
|
204
|
+
# @param [Hash] attributes The set of parameters that are the attributes of the
|
205
|
+
# Supporting Document resource which are derived Supporting Document Types.
|
206
|
+
# @return [SupportingDocumentInstance] Updated SupportingDocumentInstance
|
207
|
+
def update(friendly_name: :unset, attributes: :unset)
|
208
|
+
data = Twilio::Values.of({
|
209
|
+
'FriendlyName' => friendly_name,
|
210
|
+
'Attributes' => Twilio.serialize_object(attributes),
|
211
|
+
})
|
212
|
+
|
213
|
+
payload = @version.update(
|
214
|
+
'POST',
|
215
|
+
@uri,
|
216
|
+
data: data,
|
217
|
+
)
|
218
|
+
|
219
|
+
SupportingDocumentInstance.new(@version, payload, sid: @solution[:sid], )
|
220
|
+
end
|
221
|
+
|
222
|
+
##
|
223
|
+
# Provide a user friendly representation
|
224
|
+
def to_s
|
225
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
226
|
+
"#<Twilio.Numbers.V2.SupportingDocumentContext #{context}>"
|
227
|
+
end
|
228
|
+
|
229
|
+
##
|
230
|
+
# Provide a detailed, user friendly representation
|
231
|
+
def inspect
|
232
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
233
|
+
"#<Twilio.Numbers.V2.SupportingDocumentContext #{context}>"
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
class SupportingDocumentInstance < InstanceResource
|
238
|
+
##
|
239
|
+
# Initialize the SupportingDocumentInstance
|
240
|
+
# @param [Version] version Version that contains the resource
|
241
|
+
# @param [Hash] payload payload that contains response from Twilio
|
242
|
+
# @param [String] sid The unique string that we created to identify the Supporting
|
243
|
+
# Document resource.
|
244
|
+
# @return [SupportingDocumentInstance] SupportingDocumentInstance
|
245
|
+
def initialize(version, payload, sid: nil)
|
246
|
+
super(version)
|
247
|
+
|
248
|
+
# Marshaled Properties
|
249
|
+
@properties = {
|
250
|
+
'sid' => payload['sid'],
|
251
|
+
'account_sid' => payload['account_sid'],
|
252
|
+
'friendly_name' => payload['friendly_name'],
|
253
|
+
'mime_type' => payload['mime_type'],
|
254
|
+
'status' => payload['status'],
|
255
|
+
'type' => payload['type'],
|
256
|
+
'attributes' => payload['attributes'],
|
257
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
258
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
259
|
+
'url' => payload['url'],
|
260
|
+
}
|
261
|
+
|
262
|
+
# Context
|
263
|
+
@instance_context = nil
|
264
|
+
@params = {'sid' => sid || @properties['sid'], }
|
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 [SupportingDocumentContext] SupportingDocumentContext for this SupportingDocumentInstance
|
271
|
+
def context
|
272
|
+
unless @instance_context
|
273
|
+
@instance_context = SupportingDocumentContext.new(@version, @params['sid'], )
|
274
|
+
end
|
275
|
+
@instance_context
|
276
|
+
end
|
277
|
+
|
278
|
+
##
|
279
|
+
# @return [String] The unique string that identifies the resource
|
280
|
+
def sid
|
281
|
+
@properties['sid']
|
282
|
+
end
|
283
|
+
|
284
|
+
##
|
285
|
+
# @return [String] The SID of the Account that created the resource
|
286
|
+
def account_sid
|
287
|
+
@properties['account_sid']
|
288
|
+
end
|
289
|
+
|
290
|
+
##
|
291
|
+
# @return [String] The string that you assigned to describe the resource
|
292
|
+
def friendly_name
|
293
|
+
@properties['friendly_name']
|
294
|
+
end
|
295
|
+
|
296
|
+
##
|
297
|
+
# @return [String] The image type of the file
|
298
|
+
def mime_type
|
299
|
+
@properties['mime_type']
|
300
|
+
end
|
301
|
+
|
302
|
+
##
|
303
|
+
# @return [supporting_document.Status] The verification status of the Supporting Document resource
|
304
|
+
def status
|
305
|
+
@properties['status']
|
306
|
+
end
|
307
|
+
|
308
|
+
##
|
309
|
+
# @return [String] The type of the Supporting Document
|
310
|
+
def type
|
311
|
+
@properties['type']
|
312
|
+
end
|
313
|
+
|
314
|
+
##
|
315
|
+
# @return [Hash] The set of parameters that compose the Supporting Documents resource
|
316
|
+
def attributes
|
317
|
+
@properties['attributes']
|
318
|
+
end
|
319
|
+
|
320
|
+
##
|
321
|
+
# @return [Time] The ISO 8601 date and time in GMT when the resource was created
|
322
|
+
def date_created
|
323
|
+
@properties['date_created']
|
324
|
+
end
|
325
|
+
|
326
|
+
##
|
327
|
+
# @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
|
328
|
+
def date_updated
|
329
|
+
@properties['date_updated']
|
330
|
+
end
|
331
|
+
|
332
|
+
##
|
333
|
+
# @return [String] The absolute URL of the Supporting Document resource
|
334
|
+
def url
|
335
|
+
@properties['url']
|
336
|
+
end
|
337
|
+
|
338
|
+
##
|
339
|
+
# Fetch a SupportingDocumentInstance
|
340
|
+
# @return [SupportingDocumentInstance] Fetched SupportingDocumentInstance
|
341
|
+
def fetch
|
342
|
+
context.fetch
|
343
|
+
end
|
344
|
+
|
345
|
+
##
|
346
|
+
# Update the SupportingDocumentInstance
|
347
|
+
# @param [String] friendly_name The string that you assigned to describe the
|
348
|
+
# resource.
|
349
|
+
# @param [Hash] attributes The set of parameters that are the attributes of the
|
350
|
+
# Supporting Document resource which are derived Supporting Document Types.
|
351
|
+
# @return [SupportingDocumentInstance] Updated SupportingDocumentInstance
|
352
|
+
def update(friendly_name: :unset, attributes: :unset)
|
353
|
+
context.update(friendly_name: friendly_name, attributes: attributes, )
|
354
|
+
end
|
355
|
+
|
356
|
+
##
|
357
|
+
# Provide a user friendly representation
|
358
|
+
def to_s
|
359
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
360
|
+
"<Twilio.Numbers.V2.SupportingDocumentInstance #{values}>"
|
361
|
+
end
|
362
|
+
|
363
|
+
##
|
364
|
+
# Provide a detailed, user friendly representation
|
365
|
+
def inspect
|
366
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
367
|
+
"<Twilio.Numbers.V2.SupportingDocumentInstance #{values}>"
|
368
|
+
end
|
369
|
+
end
|
370
|
+
end
|
371
|
+
end
|
372
|
+
end
|
373
|
+
end
|
374
|
+
end
|