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