twilio-ruby 7.0.2 → 7.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +58 -0
  3. data/Gemfile +1 -0
  4. data/README.md +2 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +3 -3
  6. data/lib/twilio-ruby/rest/client.rb +3 -3
  7. data/lib/twilio-ruby/rest/content/v2/content.rb +316 -0
  8. data/lib/twilio-ruby/rest/content/v2/content_and_approvals.rb +309 -0
  9. data/lib/twilio-ruby/rest/content/v2.rb +46 -0
  10. data/lib/twilio-ruby/rest/content_base.rb +6 -1
  11. data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +1 -1
  12. data/lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb +8 -1
  13. data/lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb +444 -0
  14. data/lib/twilio-ruby/rest/intelligence/v2/operator.rb +355 -0
  15. data/lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb +215 -0
  16. data/lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb +196 -0
  17. data/lib/twilio-ruby/rest/intelligence/v2/operator_type.rb +357 -0
  18. data/lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb +355 -0
  19. data/lib/twilio-ruby/rest/intelligence/v2/service.rb +9 -8
  20. data/lib/twilio-ruby/rest/intelligence/v2/transcript.rb +18 -18
  21. data/lib/twilio-ruby/rest/intelligence/v2.rb +112 -0
  22. data/lib/twilio-ruby/rest/marketplace/v1/available_add_on/available_add_on_extension.rb +308 -0
  23. data/lib/twilio-ruby/rest/marketplace/v1/available_add_on.rb +335 -0
  24. data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on/installed_add_on_extension.rb +350 -0
  25. data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on/installed_add_on_usage.rb +169 -0
  26. data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb +461 -0
  27. data/lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb +282 -0
  28. data/lib/twilio-ruby/rest/marketplace/v1.rb +79 -0
  29. data/lib/twilio-ruby/rest/marketplace.rb +6 -0
  30. data/lib/twilio-ruby/rest/{preview_messaging_base.rb → marketplace_base.rb} +6 -6
  31. data/lib/twilio-ruby/rest/messaging/v1/service.rb +0 -7
  32. data/lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb +15 -3
  33. data/lib/twilio-ruby/rest/messaging/v1.rb +1 -1
  34. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +86 -1
  35. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb +126 -2
  36. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration.rb +148 -0
  37. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_delete.rb +167 -0
  38. data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_fetch.rb +160 -0
  39. data/lib/twilio-ruby/rest/numbers/v1/signing_request_configuration.rb +176 -0
  40. data/lib/twilio-ruby/rest/numbers/v1.rb +35 -32
  41. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +1 -1
  42. data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +2 -2
  43. data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +2 -2
  44. data/lib/twilio-ruby/rest/preview/sync/service.rb +2 -2
  45. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +1 -1
  46. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +2 -2
  47. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +2 -2
  48. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +1 -1
  49. data/lib/twilio-ruby/rest/sync/v1/service.rb +3 -3
  50. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +33 -4
  51. data/lib/twilio-ruby/rest/trusthub/v1/compliance_tollfree_inquiries.rb +4 -1
  52. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb +7 -0
  53. data/lib/twilio-ruby/rest/trusthub/v1/trust_products.rb +7 -0
  54. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +1 -1
  55. data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +1 -1
  56. data/lib/twilio-ruby/rest/verify/v2/service.rb +1 -1
  57. data/lib/twilio-ruby/version.rb +1 -1
  58. metadata +24 -9
  59. data/lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb +0 -230
  60. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_fetch.rb +0 -252
  61. data/lib/twilio-ruby/rest/preview_messaging/v1/broadcast.rb +0 -164
  62. data/lib/twilio-ruby/rest/preview_messaging/v1/message.rb +0 -235
  63. data/lib/twilio-ruby/rest/preview_messaging/v1.rb +0 -46
  64. data/lib/twilio-ruby/rest/preview_messaging.rb +0 -12
@@ -0,0 +1,308 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Marketplace
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 Marketplace < MarketplaceBase
19
+ class V1 < Version
20
+ class AvailableAddOnContext < InstanceContext
21
+
22
+ class AvailableAddOnExtensionList < ListResource
23
+
24
+ ##
25
+ # Initialize the AvailableAddOnExtensionList
26
+ # @param [Version] version Version that contains the resource
27
+ # @return [AvailableAddOnExtensionList] AvailableAddOnExtensionList
28
+ def initialize(version, available_add_on_sid: nil)
29
+ super(version)
30
+ # Path Solution
31
+ @solution = { available_add_on_sid: available_add_on_sid }
32
+ @uri = "/AvailableAddOns/#{@solution[:available_add_on_sid]}/Extensions"
33
+
34
+ end
35
+
36
+ ##
37
+ # Lists AvailableAddOnExtensionInstance records from the API as a list.
38
+ # Unlike stream(), this operation is eager and will load `limit` records into
39
+ # memory before returning.
40
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
41
+ # guarantees to never return more than limit. Default is no limit
42
+ # @param [Integer] page_size Number of records to fetch per request, when
43
+ # not set will use the default value of 50 records. If no page_size is defined
44
+ # but a limit is defined, stream() will attempt to read the limit with the most
45
+ # efficient page size, i.e. min(limit, 1000)
46
+ # @return [Array] Array of up to limit results
47
+ def list(limit: nil, page_size: nil)
48
+ self.stream(
49
+ limit: limit,
50
+ page_size: page_size
51
+ ).entries
52
+ end
53
+
54
+ ##
55
+ # Streams Instance records from the API as an Enumerable.
56
+ # This operation lazily loads records as efficiently as possible until the limit
57
+ # is reached.
58
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
59
+ # guarantees to never return more than limit. Default is no limit
60
+ # @param [Integer] page_size Number of records to fetch per request, when
61
+ # not set will use the default value of 50 records. If no page_size is defined
62
+ # but a limit is defined, stream() will attempt to read the limit with the most
63
+ # efficient page size, i.e. min(limit, 1000)
64
+ # @return [Enumerable] Enumerable that will yield up to limit results
65
+ def stream(limit: nil, page_size: nil)
66
+ limits = @version.read_limits(limit, page_size)
67
+
68
+ page = self.page(
69
+ page_size: limits[:page_size], )
70
+
71
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
72
+ end
73
+
74
+ ##
75
+ # When passed a block, yields AvailableAddOnExtensionInstance records from the API.
76
+ # This operation lazily loads records as efficiently as possible until the limit
77
+ # is reached.
78
+ def each
79
+ limits = @version.read_limits
80
+
81
+ page = self.page(page_size: limits[:page_size], )
82
+
83
+ @version.stream(page,
84
+ limit: limits[:limit],
85
+ page_limit: limits[:page_limit]).each {|x| yield x}
86
+ end
87
+
88
+ ##
89
+ # Retrieve a single page of AvailableAddOnExtensionInstance records from the API.
90
+ # Request is executed immediately.
91
+ # @param [String] page_token PageToken provided by the API
92
+ # @param [Integer] page_number Page Number, this value is simply for client state
93
+ # @param [Integer] page_size Number of records to return, defaults to 50
94
+ # @return [Page] Page of AvailableAddOnExtensionInstance
95
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
96
+ params = Twilio::Values.of({
97
+ 'PageToken' => page_token,
98
+ 'Page' => page_number,
99
+ 'PageSize' => page_size,
100
+ })
101
+
102
+ response = @version.page('GET', @uri, params: params)
103
+
104
+ AvailableAddOnExtensionPage.new(@version, response, @solution)
105
+ end
106
+
107
+ ##
108
+ # Retrieve a single page of AvailableAddOnExtensionInstance records from the API.
109
+ # Request is executed immediately.
110
+ # @param [String] target_url API-generated URL for the requested results page
111
+ # @return [Page] Page of AvailableAddOnExtensionInstance
112
+ def get_page(target_url)
113
+ response = @version.domain.request(
114
+ 'GET',
115
+ target_url
116
+ )
117
+ AvailableAddOnExtensionPage.new(@version, response, @solution)
118
+ end
119
+
120
+
121
+
122
+ # Provide a user friendly representation
123
+ def to_s
124
+ '#<Twilio.Marketplace.V1.AvailableAddOnExtensionList>'
125
+ end
126
+ end
127
+
128
+
129
+ class AvailableAddOnExtensionContext < InstanceContext
130
+ ##
131
+ # Initialize the AvailableAddOnExtensionContext
132
+ # @param [Version] version Version that contains the resource
133
+ # @param [String] available_add_on_sid The SID of the AvailableAddOn resource with the extension to fetch.
134
+ # @param [String] sid The SID of the AvailableAddOn Extension resource to fetch.
135
+ # @return [AvailableAddOnExtensionContext] AvailableAddOnExtensionContext
136
+ def initialize(version, available_add_on_sid, sid)
137
+ super(version)
138
+
139
+ # Path Solution
140
+ @solution = { available_add_on_sid: available_add_on_sid, sid: sid, }
141
+ @uri = "/AvailableAddOns/#{@solution[:available_add_on_sid]}/Extensions/#{@solution[:sid]}"
142
+
143
+
144
+ end
145
+ ##
146
+ # Fetch the AvailableAddOnExtensionInstance
147
+ # @return [AvailableAddOnExtensionInstance] Fetched AvailableAddOnExtensionInstance
148
+ def fetch
149
+
150
+
151
+ payload = @version.fetch('GET', @uri)
152
+ AvailableAddOnExtensionInstance.new(
153
+ @version,
154
+ payload,
155
+ available_add_on_sid: @solution[:available_add_on_sid],
156
+ sid: @solution[:sid],
157
+ )
158
+ end
159
+
160
+
161
+ ##
162
+ # Provide a user friendly representation
163
+ def to_s
164
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
165
+ "#<Twilio.Marketplace.V1.AvailableAddOnExtensionContext #{context}>"
166
+ end
167
+
168
+ ##
169
+ # Provide a detailed, user friendly representation
170
+ def inspect
171
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
172
+ "#<Twilio.Marketplace.V1.AvailableAddOnExtensionContext #{context}>"
173
+ end
174
+ end
175
+
176
+ class AvailableAddOnExtensionPage < Page
177
+ ##
178
+ # Initialize the AvailableAddOnExtensionPage
179
+ # @param [Version] version Version that contains the resource
180
+ # @param [Response] response Response from the API
181
+ # @param [Hash] solution Path solution for the resource
182
+ # @return [AvailableAddOnExtensionPage] AvailableAddOnExtensionPage
183
+ def initialize(version, response, solution)
184
+ super(version, response)
185
+
186
+ # Path Solution
187
+ @solution = solution
188
+ end
189
+
190
+ ##
191
+ # Build an instance of AvailableAddOnExtensionInstance
192
+ # @param [Hash] payload Payload response from the API
193
+ # @return [AvailableAddOnExtensionInstance] AvailableAddOnExtensionInstance
194
+ def get_instance(payload)
195
+ AvailableAddOnExtensionInstance.new(@version, payload, available_add_on_sid: @solution[:available_add_on_sid])
196
+ end
197
+
198
+ ##
199
+ # Provide a user friendly representation
200
+ def to_s
201
+ '<Twilio.Marketplace.V1.AvailableAddOnExtensionPage>'
202
+ end
203
+ end
204
+ class AvailableAddOnExtensionInstance < InstanceResource
205
+ ##
206
+ # Initialize the AvailableAddOnExtensionInstance
207
+ # @param [Version] version Version that contains the resource
208
+ # @param [Hash] payload payload that contains response from Twilio
209
+ # @param [String] account_sid The SID of the
210
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this AvailableAddOnExtension
211
+ # resource.
212
+ # @param [String] sid The SID of the Call resource to fetch.
213
+ # @return [AvailableAddOnExtensionInstance] AvailableAddOnExtensionInstance
214
+ def initialize(version, payload , available_add_on_sid: nil, sid: nil)
215
+ super(version)
216
+
217
+ # Marshaled Properties
218
+ @properties = {
219
+ 'sid' => payload['sid'],
220
+ 'available_add_on_sid' => payload['available_add_on_sid'],
221
+ 'friendly_name' => payload['friendly_name'],
222
+ 'product_name' => payload['product_name'],
223
+ 'unique_name' => payload['unique_name'],
224
+ 'url' => payload['url'],
225
+ }
226
+
227
+ # Context
228
+ @instance_context = nil
229
+ @params = { 'available_add_on_sid' => available_add_on_sid || @properties['available_add_on_sid'] ,'sid' => sid || @properties['sid'] , }
230
+ end
231
+
232
+ ##
233
+ # Generate an instance context for the instance, the context is capable of
234
+ # performing various actions. All instance actions are proxied to the context
235
+ # @return [AvailableAddOnExtensionContext] CallContext for this CallInstance
236
+ def context
237
+ unless @instance_context
238
+ @instance_context = AvailableAddOnExtensionContext.new(@version , @params['available_add_on_sid'], @params['sid'])
239
+ end
240
+ @instance_context
241
+ end
242
+
243
+ ##
244
+ # @return [String] The unique string that we created to identify the AvailableAddOnExtension resource.
245
+ def sid
246
+ @properties['sid']
247
+ end
248
+
249
+ ##
250
+ # @return [String] The SID of the AvailableAddOn resource to which this extension applies.
251
+ def available_add_on_sid
252
+ @properties['available_add_on_sid']
253
+ end
254
+
255
+ ##
256
+ # @return [String] The string that you assigned to describe the resource.
257
+ def friendly_name
258
+ @properties['friendly_name']
259
+ end
260
+
261
+ ##
262
+ # @return [String] The name of the Product this Extension is used within.
263
+ def product_name
264
+ @properties['product_name']
265
+ end
266
+
267
+ ##
268
+ # @return [String] An application-defined string that uniquely identifies the resource.
269
+ def unique_name
270
+ @properties['unique_name']
271
+ end
272
+
273
+ ##
274
+ # @return [String] The absolute URL of the resource.
275
+ def url
276
+ @properties['url']
277
+ end
278
+
279
+ ##
280
+ # Fetch the AvailableAddOnExtensionInstance
281
+ # @return [AvailableAddOnExtensionInstance] Fetched AvailableAddOnExtensionInstance
282
+ def fetch
283
+
284
+ context.fetch
285
+ end
286
+
287
+ ##
288
+ # Provide a user friendly representation
289
+ def to_s
290
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
291
+ "<Twilio.Marketplace.V1.AvailableAddOnExtensionInstance #{values}>"
292
+ end
293
+
294
+ ##
295
+ # Provide a detailed, user friendly representation
296
+ def inspect
297
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
298
+ "<Twilio.Marketplace.V1.AvailableAddOnExtensionInstance #{values}>"
299
+ end
300
+ end
301
+
302
+ end
303
+ end
304
+ end
305
+ end
306
+ end
307
+
308
+
@@ -0,0 +1,335 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Marketplace
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 Marketplace < MarketplaceBase
19
+ class V1 < Version
20
+ class AvailableAddOnList < ListResource
21
+
22
+ ##
23
+ # Initialize the AvailableAddOnList
24
+ # @param [Version] version Version that contains the resource
25
+ # @return [AvailableAddOnList] AvailableAddOnList
26
+ def initialize(version)
27
+ super(version)
28
+ # Path Solution
29
+ @solution = { }
30
+ @uri = "/AvailableAddOns"
31
+
32
+ end
33
+
34
+ ##
35
+ # Lists AvailableAddOnInstance records from the API as a list.
36
+ # Unlike stream(), this operation is eager and will load `limit` records into
37
+ # memory before returning.
38
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
39
+ # guarantees to never return more than limit. Default is no limit
40
+ # @param [Integer] page_size Number of records to fetch per request, when
41
+ # not set will use the default value of 50 records. If no page_size is defined
42
+ # but a limit is defined, stream() will attempt to read the limit with the most
43
+ # efficient page size, i.e. min(limit, 1000)
44
+ # @return [Array] Array of up to limit results
45
+ def list(limit: nil, page_size: nil)
46
+ self.stream(
47
+ limit: limit,
48
+ page_size: page_size
49
+ ).entries
50
+ end
51
+
52
+ ##
53
+ # Streams Instance records from the API as an Enumerable.
54
+ # This operation lazily loads records as efficiently as possible until the limit
55
+ # is reached.
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 [Enumerable] Enumerable that will yield up to limit results
63
+ def stream(limit: nil, page_size: nil)
64
+ limits = @version.read_limits(limit, page_size)
65
+
66
+ page = self.page(
67
+ page_size: limits[:page_size], )
68
+
69
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
70
+ end
71
+
72
+ ##
73
+ # When passed a block, yields AvailableAddOnInstance records from the API.
74
+ # This operation lazily loads records as efficiently as possible until the limit
75
+ # is reached.
76
+ def each
77
+ limits = @version.read_limits
78
+
79
+ page = self.page(page_size: limits[:page_size], )
80
+
81
+ @version.stream(page,
82
+ limit: limits[:limit],
83
+ page_limit: limits[:page_limit]).each {|x| yield x}
84
+ end
85
+
86
+ ##
87
+ # Retrieve a single page of AvailableAddOnInstance records from the API.
88
+ # Request is executed immediately.
89
+ # @param [String] page_token PageToken provided by the API
90
+ # @param [Integer] page_number Page Number, this value is simply for client state
91
+ # @param [Integer] page_size Number of records to return, defaults to 50
92
+ # @return [Page] Page of AvailableAddOnInstance
93
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
94
+ params = Twilio::Values.of({
95
+ 'PageToken' => page_token,
96
+ 'Page' => page_number,
97
+ 'PageSize' => page_size,
98
+ })
99
+
100
+ response = @version.page('GET', @uri, params: params)
101
+
102
+ AvailableAddOnPage.new(@version, response, @solution)
103
+ end
104
+
105
+ ##
106
+ # Retrieve a single page of AvailableAddOnInstance records from the API.
107
+ # Request is executed immediately.
108
+ # @param [String] target_url API-generated URL for the requested results page
109
+ # @return [Page] Page of AvailableAddOnInstance
110
+ def get_page(target_url)
111
+ response = @version.domain.request(
112
+ 'GET',
113
+ target_url
114
+ )
115
+ AvailableAddOnPage.new(@version, response, @solution)
116
+ end
117
+
118
+
119
+
120
+ # Provide a user friendly representation
121
+ def to_s
122
+ '#<Twilio.Marketplace.V1.AvailableAddOnList>'
123
+ end
124
+ end
125
+
126
+
127
+ class AvailableAddOnContext < InstanceContext
128
+ ##
129
+ # Initialize the AvailableAddOnContext
130
+ # @param [Version] version Version that contains the resource
131
+ # @param [String] sid The SID of the AvailableAddOn resource to fetch.
132
+ # @return [AvailableAddOnContext] AvailableAddOnContext
133
+ def initialize(version, sid)
134
+ super(version)
135
+
136
+ # Path Solution
137
+ @solution = { sid: sid, }
138
+ @uri = "/AvailableAddOns/#{@solution[:sid]}"
139
+
140
+ # Dependents
141
+ @extensions = nil
142
+ end
143
+ ##
144
+ # Fetch the AvailableAddOnInstance
145
+ # @return [AvailableAddOnInstance] Fetched AvailableAddOnInstance
146
+ def fetch
147
+
148
+
149
+ payload = @version.fetch('GET', @uri)
150
+ AvailableAddOnInstance.new(
151
+ @version,
152
+ payload,
153
+ sid: @solution[:sid],
154
+ )
155
+ end
156
+
157
+ ##
158
+ # Access the extensions
159
+ # @return [AvailableAddOnExtensionList]
160
+ # @return [AvailableAddOnExtensionContext] if sid was passed.
161
+ def extensions(sid=:unset)
162
+
163
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
164
+
165
+ if sid != :unset
166
+ return AvailableAddOnExtensionContext.new(@version, @solution[:sid],sid )
167
+ end
168
+
169
+ unless @extensions
170
+ @extensions = AvailableAddOnExtensionList.new(
171
+ @version, available_add_on_sid: @solution[:sid], )
172
+ end
173
+
174
+ @extensions
175
+ end
176
+
177
+ ##
178
+ # Provide a user friendly representation
179
+ def to_s
180
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
181
+ "#<Twilio.Marketplace.V1.AvailableAddOnContext #{context}>"
182
+ end
183
+
184
+ ##
185
+ # Provide a detailed, user friendly representation
186
+ def inspect
187
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
188
+ "#<Twilio.Marketplace.V1.AvailableAddOnContext #{context}>"
189
+ end
190
+ end
191
+
192
+ class AvailableAddOnPage < Page
193
+ ##
194
+ # Initialize the AvailableAddOnPage
195
+ # @param [Version] version Version that contains the resource
196
+ # @param [Response] response Response from the API
197
+ # @param [Hash] solution Path solution for the resource
198
+ # @return [AvailableAddOnPage] AvailableAddOnPage
199
+ def initialize(version, response, solution)
200
+ super(version, response)
201
+
202
+ # Path Solution
203
+ @solution = solution
204
+ end
205
+
206
+ ##
207
+ # Build an instance of AvailableAddOnInstance
208
+ # @param [Hash] payload Payload response from the API
209
+ # @return [AvailableAddOnInstance] AvailableAddOnInstance
210
+ def get_instance(payload)
211
+ AvailableAddOnInstance.new(@version, payload)
212
+ end
213
+
214
+ ##
215
+ # Provide a user friendly representation
216
+ def to_s
217
+ '<Twilio.Marketplace.V1.AvailableAddOnPage>'
218
+ end
219
+ end
220
+ class AvailableAddOnInstance < InstanceResource
221
+ ##
222
+ # Initialize the AvailableAddOnInstance
223
+ # @param [Version] version Version that contains the resource
224
+ # @param [Hash] payload payload that contains response from Twilio
225
+ # @param [String] account_sid The SID of the
226
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this AvailableAddOn
227
+ # resource.
228
+ # @param [String] sid The SID of the Call resource to fetch.
229
+ # @return [AvailableAddOnInstance] AvailableAddOnInstance
230
+ def initialize(version, payload , sid: nil)
231
+ super(version)
232
+
233
+ # Marshaled Properties
234
+ @properties = {
235
+ 'sid' => payload['sid'],
236
+ 'friendly_name' => payload['friendly_name'],
237
+ 'description' => payload['description'],
238
+ 'pricing_type' => payload['pricing_type'],
239
+ 'configuration_schema' => payload['configuration_schema'],
240
+ 'url' => payload['url'],
241
+ 'links' => payload['links'],
242
+ }
243
+
244
+ # Context
245
+ @instance_context = nil
246
+ @params = { 'sid' => sid || @properties['sid'] , }
247
+ end
248
+
249
+ ##
250
+ # Generate an instance context for the instance, the context is capable of
251
+ # performing various actions. All instance actions are proxied to the context
252
+ # @return [AvailableAddOnContext] CallContext for this CallInstance
253
+ def context
254
+ unless @instance_context
255
+ @instance_context = AvailableAddOnContext.new(@version , @params['sid'])
256
+ end
257
+ @instance_context
258
+ end
259
+
260
+ ##
261
+ # @return [String] The unique string that we created to identify the AvailableAddOn resource.
262
+ def sid
263
+ @properties['sid']
264
+ end
265
+
266
+ ##
267
+ # @return [String] The string that you assigned to describe the resource.
268
+ def friendly_name
269
+ @properties['friendly_name']
270
+ end
271
+
272
+ ##
273
+ # @return [String] A short description of the Add-on's functionality.
274
+ def description
275
+ @properties['description']
276
+ end
277
+
278
+ ##
279
+ # @return [String] How customers are charged for using this Add-on.
280
+ def pricing_type
281
+ @properties['pricing_type']
282
+ end
283
+
284
+ ##
285
+ # @return [Hash] The JSON object with the configuration that must be provided when installing a given Add-on.
286
+ def configuration_schema
287
+ @properties['configuration_schema']
288
+ end
289
+
290
+ ##
291
+ # @return [String] The absolute URL of the resource.
292
+ def url
293
+ @properties['url']
294
+ end
295
+
296
+ ##
297
+ # @return [Hash] The URLs of related resources.
298
+ def links
299
+ @properties['links']
300
+ end
301
+
302
+ ##
303
+ # Fetch the AvailableAddOnInstance
304
+ # @return [AvailableAddOnInstance] Fetched AvailableAddOnInstance
305
+ def fetch
306
+
307
+ context.fetch
308
+ end
309
+
310
+ ##
311
+ # Access the extensions
312
+ # @return [extensions] extensions
313
+ def extensions
314
+ context.extensions
315
+ end
316
+
317
+ ##
318
+ # Provide a user friendly representation
319
+ def to_s
320
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
321
+ "<Twilio.Marketplace.V1.AvailableAddOnInstance #{values}>"
322
+ end
323
+
324
+ ##
325
+ # Provide a detailed, user friendly representation
326
+ def inspect
327
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
328
+ "<Twilio.Marketplace.V1.AvailableAddOnInstance #{values}>"
329
+ end
330
+ end
331
+
332
+ end
333
+ end
334
+ end
335
+ end