twilio-ruby 7.1.0 → 7.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f71d5659db847a052763617e04e4c70e7f6c6f85
4
- data.tar.gz: 41d828b50f287396e6f396031c60589b93000e47
3
+ metadata.gz: 3df3c763e91edb94440e0a32dec6bc3200b06945
4
+ data.tar.gz: 8c5c80ed0520f2fdbc2dc73fbf5958f4f71eb261
5
5
  SHA512:
6
- metadata.gz: ad4b018328b80cba16bf6a84fba4bd91ee983fd7190766b8d5ea07f71dc0720804a80074f00dbb087a4a8f0bc8e94579acca90a302fc5fbbe761fdba7d3af538
7
- data.tar.gz: c39823aeb05c0be4a37eaae418b0424e1ad408a333234ddc6ded603797626698ce6ed7c3eb7cf4c7a8517d3d772862d7036bfe7b029b8ec9cb8558b21278c945
6
+ metadata.gz: 87dee824b6e9c61c9469e8f6ab18cab181c6a734943041dc94fcf03991fe165f77d71eae5c6080240420644564dcc4ed807dc37d4a944a33cd5677f3f6655964
7
+ data.tar.gz: 66d6eca434fc78e086c70bb5861d71344858f9a9307cf35cccde69baa3af65591c80f50d54dd7948e830facf10172773d27d4aa39a246362c4337b3733bdad4e
data/CHANGES.md CHANGED
@@ -1,6 +1,21 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2024-06-06] Version 7.1.1
5
+ --------------------------
6
+ **Library - Chore**
7
+ - [PR #721](https://github.com/twilio/twilio-ruby/pull/721): adding rexml to Gemfile. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)!
8
+
9
+ **Api**
10
+ - Mark MaxPrice as obsolete
11
+
12
+ **Lookups**
13
+ - Update examples for `phone_number_quality_score`
14
+
15
+ **Messaging**
16
+ - List tollfree verifications on parent account and all sub-accounts
17
+
18
+
4
19
  [2024-05-24] Version 7.1.0
5
20
  --------------------------
6
21
  **Library - Chore**
data/README.md CHANGED
@@ -39,13 +39,13 @@ This library supports the following Ruby implementations:
39
39
  To install using [Bundler][bundler] grab the latest stable version:
40
40
 
41
41
  ```ruby
42
- gem 'twilio-ruby', '~> 7.1.0'
42
+ gem 'twilio-ruby', '~> 7.1.1'
43
43
  ```
44
44
 
45
45
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
46
46
 
47
47
  ```bash
48
- gem install twilio-ruby -v 7.1.0
48
+ gem install twilio-ruby -v 7.1.1
49
49
  ```
50
50
 
51
51
  To build and install the development branch yourself from the latest source:
@@ -37,10 +37,10 @@ module Twilio
37
37
  # @param [String] to The recipient's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (for SMS/MMS) or [channel address](https://www.twilio.com/docs/messaging/channels), e.g. `whatsapp:+15552229999`.
38
38
  # @param [String] status_callback The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource).
39
39
  # @param [String] application_sid The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. Note that the `status_callback` parameter of a request takes priority over the `application_sid` parameter; if both are included `application_sid` is ignored.
40
- # @param [Float] max_price [DEPRECATED] This parameter will no longer have any effect as of 2024-06-03.
40
+ # @param [Float] max_price [OBSOLETE] This parameter will no longer have any effect as of 2024-06-03.
41
41
  # @param [Boolean] provide_feedback Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`.
42
42
  # @param [String] attempt Total number of attempts made (including this request) to send the message regardless of the provider used
43
- # @param [String] validity_period The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `14400`. Default value is `14400`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html)
43
+ # @param [String] validity_period The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `36000`. Default value is `36000`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html)
44
44
  # @param [Boolean] force_delivery Reserved
45
45
  # @param [ContentRetention] content_retention
46
46
  # @param [AddressRetention] address_retention
@@ -82,6 +82,11 @@ module Twilio
82
82
  @lookups ||= Lookups.new self
83
83
  end
84
84
  ##
85
+ # Access the Marketplace Twilio Domain
86
+ def marketplace
87
+ @marketplace ||= Marketplace.new self
88
+ end
89
+ ##
85
90
  # Access the Messaging Twilio Domain
86
91
  def messaging
87
92
  @messaging ||= Messaging.new self
@@ -35,6 +35,15 @@ module Twilio
35
35
  # Lists ContentInstance records from the API as a list.
36
36
  # Unlike stream(), this operation is eager and will load `limit` records into
37
37
  # memory before returning.
38
+ # @param [String] sort_by_date Whether to sort by ascending or descending date updated
39
+ # @param [String] sort_by_content_name Whether to sort by ascending or descending content name
40
+ # @param [Time] date_created_after Filter by >=[date-time]
41
+ # @param [Time] date_created_before Filter by <=[date-time]
42
+ # @param [String] content_name Filter by Regex Pattern in content name
43
+ # @param [String] content Filter by Regex Pattern in template content
44
+ # @param [Array[String]] language Filter by array of valid language(s)
45
+ # @param [Array[String]] content_type Filter by array of contentType(s)
46
+ # @param [Array[String]] channel_eligibility Filter by array of ChannelEligibility(s), where ChannelEligibility=<channel>:<status>
38
47
  # @param [Integer] limit Upper limit for the number of records to return. stream()
39
48
  # guarantees to never return more than limit. Default is no limit
40
49
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -42,8 +51,17 @@ module Twilio
42
51
  # but a limit is defined, stream() will attempt to read the limit with the most
43
52
  # efficient page size, i.e. min(limit, 1000)
44
53
  # @return [Array] Array of up to limit results
45
- def list(limit: nil, page_size: nil)
54
+ def list(sort_by_date: :unset, sort_by_content_name: :unset, date_created_after: :unset, date_created_before: :unset, content_name: :unset, content: :unset, language: :unset, content_type: :unset, channel_eligibility: :unset, limit: nil, page_size: nil)
46
55
  self.stream(
56
+ sort_by_date: sort_by_date,
57
+ sort_by_content_name: sort_by_content_name,
58
+ date_created_after: date_created_after,
59
+ date_created_before: date_created_before,
60
+ content_name: content_name,
61
+ content: content,
62
+ language: language,
63
+ content_type: content_type,
64
+ channel_eligibility: channel_eligibility,
47
65
  limit: limit,
48
66
  page_size: page_size
49
67
  ).entries
@@ -53,6 +71,15 @@ module Twilio
53
71
  # Streams Instance records from the API as an Enumerable.
54
72
  # This operation lazily loads records as efficiently as possible until the limit
55
73
  # is reached.
74
+ # @param [String] sort_by_date Whether to sort by ascending or descending date updated
75
+ # @param [String] sort_by_content_name Whether to sort by ascending or descending content name
76
+ # @param [Time] date_created_after Filter by >=[date-time]
77
+ # @param [Time] date_created_before Filter by <=[date-time]
78
+ # @param [String] content_name Filter by Regex Pattern in content name
79
+ # @param [String] content Filter by Regex Pattern in template content
80
+ # @param [Array[String]] language Filter by array of valid language(s)
81
+ # @param [Array[String]] content_type Filter by array of contentType(s)
82
+ # @param [Array[String]] channel_eligibility Filter by array of ChannelEligibility(s), where ChannelEligibility=<channel>:<status>
56
83
  # @param [Integer] limit Upper limit for the number of records to return. stream()
57
84
  # guarantees to never return more than limit. Default is no limit
58
85
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -60,10 +87,19 @@ module Twilio
60
87
  # but a limit is defined, stream() will attempt to read the limit with the most
61
88
  # efficient page size, i.e. min(limit, 1000)
62
89
  # @return [Enumerable] Enumerable that will yield up to limit results
63
- def stream(limit: nil, page_size: nil)
90
+ def stream(sort_by_date: :unset, sort_by_content_name: :unset, date_created_after: :unset, date_created_before: :unset, content_name: :unset, content: :unset, language: :unset, content_type: :unset, channel_eligibility: :unset, limit: nil, page_size: nil)
64
91
  limits = @version.read_limits(limit, page_size)
65
92
 
66
93
  page = self.page(
94
+ sort_by_date: sort_by_date,
95
+ sort_by_content_name: sort_by_content_name,
96
+ date_created_after: date_created_after,
97
+ date_created_before: date_created_before,
98
+ content_name: content_name,
99
+ content: content,
100
+ language: language,
101
+ content_type: content_type,
102
+ channel_eligibility: channel_eligibility,
67
103
  page_size: limits[:page_size], )
68
104
 
69
105
  @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
@@ -86,12 +122,33 @@ module Twilio
86
122
  ##
87
123
  # Retrieve a single page of ContentInstance records from the API.
88
124
  # Request is executed immediately.
125
+ # @param [String] sort_by_date Whether to sort by ascending or descending date updated
126
+ # @param [String] sort_by_content_name Whether to sort by ascending or descending content name
127
+ # @param [Time] date_created_after Filter by >=[date-time]
128
+ # @param [Time] date_created_before Filter by <=[date-time]
129
+ # @param [String] content_name Filter by Regex Pattern in content name
130
+ # @param [String] content Filter by Regex Pattern in template content
131
+ # @param [Array[String]] language Filter by array of valid language(s)
132
+ # @param [Array[String]] content_type Filter by array of contentType(s)
133
+ # @param [Array[String]] channel_eligibility Filter by array of ChannelEligibility(s), where ChannelEligibility=<channel>:<status>
89
134
  # @param [String] page_token PageToken provided by the API
90
135
  # @param [Integer] page_number Page Number, this value is simply for client state
91
136
  # @param [Integer] page_size Number of records to return, defaults to 50
92
137
  # @return [Page] Page of ContentInstance
93
- def page(page_token: :unset, page_number: :unset, page_size: :unset)
138
+ def page(sort_by_date: :unset, sort_by_content_name: :unset, date_created_after: :unset, date_created_before: :unset, content_name: :unset, content: :unset, language: :unset, content_type: :unset, channel_eligibility: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
94
139
  params = Twilio::Values.of({
140
+ 'SortByDate' => sort_by_date,
141
+ 'SortByContentName' => sort_by_content_name,
142
+ 'DateCreatedAfter' => Twilio.serialize_iso8601_datetime(date_created_after),
143
+ 'DateCreatedBefore' => Twilio.serialize_iso8601_datetime(date_created_before),
144
+ 'ContentName' => content_name,
145
+ 'Content' => content,
146
+
147
+ 'Language' => Twilio.serialize_list(language) { |e| e },
148
+
149
+ 'ContentType' => Twilio.serialize_list(content_type) { |e| e },
150
+
151
+ 'ChannelEligibility' => Twilio.serialize_list(channel_eligibility) { |e| e },
95
152
  'PageToken' => page_token,
96
153
  'Page' => page_number,
97
154
  'PageSize' => page_size,
@@ -35,6 +35,15 @@ module Twilio
35
35
  # Lists ContentAndApprovalsInstance records from the API as a list.
36
36
  # Unlike stream(), this operation is eager and will load `limit` records into
37
37
  # memory before returning.
38
+ # @param [String] sort_by_date Whether to sort by ascending or descending date updated
39
+ # @param [String] sort_by_content_name Whether to sort by ascending or descending content name
40
+ # @param [Time] date_created_after Filter by >=[date-time]
41
+ # @param [Time] date_created_before Filter by <=[date-time]
42
+ # @param [String] content_name Filter by Regex Pattern in content name
43
+ # @param [String] content Filter by Regex Pattern in template content
44
+ # @param [Array[String]] language Filter by array of valid language(s)
45
+ # @param [Array[String]] content_type Filter by array of contentType(s)
46
+ # @param [Array[String]] channel_eligibility Filter by array of ChannelEligibility(s), where ChannelEligibility=<channel>:<status>
38
47
  # @param [Integer] limit Upper limit for the number of records to return. stream()
39
48
  # guarantees to never return more than limit. Default is no limit
40
49
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -42,8 +51,17 @@ module Twilio
42
51
  # but a limit is defined, stream() will attempt to read the limit with the most
43
52
  # efficient page size, i.e. min(limit, 1000)
44
53
  # @return [Array] Array of up to limit results
45
- def list(limit: nil, page_size: nil)
54
+ def list(sort_by_date: :unset, sort_by_content_name: :unset, date_created_after: :unset, date_created_before: :unset, content_name: :unset, content: :unset, language: :unset, content_type: :unset, channel_eligibility: :unset, limit: nil, page_size: nil)
46
55
  self.stream(
56
+ sort_by_date: sort_by_date,
57
+ sort_by_content_name: sort_by_content_name,
58
+ date_created_after: date_created_after,
59
+ date_created_before: date_created_before,
60
+ content_name: content_name,
61
+ content: content,
62
+ language: language,
63
+ content_type: content_type,
64
+ channel_eligibility: channel_eligibility,
47
65
  limit: limit,
48
66
  page_size: page_size
49
67
  ).entries
@@ -53,6 +71,15 @@ module Twilio
53
71
  # Streams Instance records from the API as an Enumerable.
54
72
  # This operation lazily loads records as efficiently as possible until the limit
55
73
  # is reached.
74
+ # @param [String] sort_by_date Whether to sort by ascending or descending date updated
75
+ # @param [String] sort_by_content_name Whether to sort by ascending or descending content name
76
+ # @param [Time] date_created_after Filter by >=[date-time]
77
+ # @param [Time] date_created_before Filter by <=[date-time]
78
+ # @param [String] content_name Filter by Regex Pattern in content name
79
+ # @param [String] content Filter by Regex Pattern in template content
80
+ # @param [Array[String]] language Filter by array of valid language(s)
81
+ # @param [Array[String]] content_type Filter by array of contentType(s)
82
+ # @param [Array[String]] channel_eligibility Filter by array of ChannelEligibility(s), where ChannelEligibility=<channel>:<status>
56
83
  # @param [Integer] limit Upper limit for the number of records to return. stream()
57
84
  # guarantees to never return more than limit. Default is no limit
58
85
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -60,10 +87,19 @@ module Twilio
60
87
  # but a limit is defined, stream() will attempt to read the limit with the most
61
88
  # efficient page size, i.e. min(limit, 1000)
62
89
  # @return [Enumerable] Enumerable that will yield up to limit results
63
- def stream(limit: nil, page_size: nil)
90
+ def stream(sort_by_date: :unset, sort_by_content_name: :unset, date_created_after: :unset, date_created_before: :unset, content_name: :unset, content: :unset, language: :unset, content_type: :unset, channel_eligibility: :unset, limit: nil, page_size: nil)
64
91
  limits = @version.read_limits(limit, page_size)
65
92
 
66
93
  page = self.page(
94
+ sort_by_date: sort_by_date,
95
+ sort_by_content_name: sort_by_content_name,
96
+ date_created_after: date_created_after,
97
+ date_created_before: date_created_before,
98
+ content_name: content_name,
99
+ content: content,
100
+ language: language,
101
+ content_type: content_type,
102
+ channel_eligibility: channel_eligibility,
67
103
  page_size: limits[:page_size], )
68
104
 
69
105
  @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
@@ -86,12 +122,33 @@ module Twilio
86
122
  ##
87
123
  # Retrieve a single page of ContentAndApprovalsInstance records from the API.
88
124
  # Request is executed immediately.
125
+ # @param [String] sort_by_date Whether to sort by ascending or descending date updated
126
+ # @param [String] sort_by_content_name Whether to sort by ascending or descending content name
127
+ # @param [Time] date_created_after Filter by >=[date-time]
128
+ # @param [Time] date_created_before Filter by <=[date-time]
129
+ # @param [String] content_name Filter by Regex Pattern in content name
130
+ # @param [String] content Filter by Regex Pattern in template content
131
+ # @param [Array[String]] language Filter by array of valid language(s)
132
+ # @param [Array[String]] content_type Filter by array of contentType(s)
133
+ # @param [Array[String]] channel_eligibility Filter by array of ChannelEligibility(s), where ChannelEligibility=<channel>:<status>
89
134
  # @param [String] page_token PageToken provided by the API
90
135
  # @param [Integer] page_number Page Number, this value is simply for client state
91
136
  # @param [Integer] page_size Number of records to return, defaults to 50
92
137
  # @return [Page] Page of ContentAndApprovalsInstance
93
- def page(page_token: :unset, page_number: :unset, page_size: :unset)
138
+ def page(sort_by_date: :unset, sort_by_content_name: :unset, date_created_after: :unset, date_created_before: :unset, content_name: :unset, content: :unset, language: :unset, content_type: :unset, channel_eligibility: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
94
139
  params = Twilio::Values.of({
140
+ 'SortByDate' => sort_by_date,
141
+ 'SortByContentName' => sort_by_content_name,
142
+ 'DateCreatedAfter' => Twilio.serialize_iso8601_datetime(date_created_after),
143
+ 'DateCreatedBefore' => Twilio.serialize_iso8601_datetime(date_created_before),
144
+ 'ContentName' => content_name,
145
+ 'Content' => content,
146
+
147
+ 'Language' => Twilio.serialize_list(language) { |e| e },
148
+
149
+ 'ContentType' => Twilio.serialize_list(content_type) { |e| e },
150
+
151
+ 'ChannelEligibility' => Twilio.serialize_list(channel_eligibility) { |e| e },
95
152
  'PageToken' => page_token,
96
153
  'Page' => page_number,
97
154
  'PageSize' => page_size,
@@ -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
+