twilio-ruby 5.75.0 → 5.77.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -75,6 +75,14 @@ module Twilio
75
75
  # Lists ConversationInstance records from the API as a list.
76
76
  # Unlike stream(), this operation is eager and will load `limit` records into
77
77
  # memory before returning.
78
+ # @param [String] start_date Start date or time in ISO8601 format for filtering
79
+ # list of Conversations. If a date is provided, the start time of the date is used
80
+ # (YYYY-MM-DDT00:00:00Z). Can be combined with other filters.
81
+ # @param [String] end_date End date or time in ISO8601 format for filtering list
82
+ # of Conversations. If a date is provided, the end time of the date is used
83
+ # (YYYY-MM-DDT23:59:59Z). Can be combined with other filters.
84
+ # @param [conversation.State] state State for sorting and filtering list of
85
+ # Conversations. Can be `active`, `inactive` or `closed`
78
86
  # @param [Integer] limit Upper limit for the number of records to return. stream()
79
87
  # guarantees to never return more than limit. Default is no limit
80
88
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -82,14 +90,28 @@ module Twilio
82
90
  # but a limit is defined, stream() will attempt to read the limit with the most
83
91
  # efficient page size, i.e. min(limit, 1000)
84
92
  # @return [Array] Array of up to limit results
85
- def list(limit: nil, page_size: nil)
86
- self.stream(limit: limit, page_size: page_size).entries
93
+ def list(start_date: :unset, end_date: :unset, state: :unset, limit: nil, page_size: nil)
94
+ self.stream(
95
+ start_date: start_date,
96
+ end_date: end_date,
97
+ state: state,
98
+ limit: limit,
99
+ page_size: page_size
100
+ ).entries
87
101
  end
88
102
 
89
103
  ##
90
104
  # Streams ConversationInstance records from the API as an Enumerable.
91
105
  # This operation lazily loads records as efficiently as possible until the limit
92
106
  # is reached.
107
+ # @param [String] start_date Start date or time in ISO8601 format for filtering
108
+ # list of Conversations. If a date is provided, the start time of the date is used
109
+ # (YYYY-MM-DDT00:00:00Z). Can be combined with other filters.
110
+ # @param [String] end_date End date or time in ISO8601 format for filtering list
111
+ # of Conversations. If a date is provided, the end time of the date is used
112
+ # (YYYY-MM-DDT23:59:59Z). Can be combined with other filters.
113
+ # @param [conversation.State] state State for sorting and filtering list of
114
+ # Conversations. Can be `active`, `inactive` or `closed`
93
115
  # @param [Integer] limit Upper limit for the number of records to return. stream()
94
116
  # guarantees to never return more than limit. Default is no limit.
95
117
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -97,10 +119,15 @@ module Twilio
97
119
  # but a limit is defined, stream() will attempt to read the limit with the most
98
120
  # efficient page size, i.e. min(limit, 1000)
99
121
  # @return [Enumerable] Enumerable that will yield up to limit results
100
- def stream(limit: nil, page_size: nil)
122
+ def stream(start_date: :unset, end_date: :unset, state: :unset, limit: nil, page_size: nil)
101
123
  limits = @version.read_limits(limit, page_size)
102
124
 
103
- page = self.page(page_size: limits[:page_size], )
125
+ page = self.page(
126
+ start_date: start_date,
127
+ end_date: end_date,
128
+ state: state,
129
+ page_size: limits[:page_size],
130
+ )
104
131
 
105
132
  @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
106
133
  end
@@ -122,12 +149,23 @@ module Twilio
122
149
  ##
123
150
  # Retrieve a single page of ConversationInstance records from the API.
124
151
  # Request is executed immediately.
152
+ # @param [String] start_date Start date or time in ISO8601 format for filtering
153
+ # list of Conversations. If a date is provided, the start time of the date is used
154
+ # (YYYY-MM-DDT00:00:00Z). Can be combined with other filters.
155
+ # @param [String] end_date End date or time in ISO8601 format for filtering list
156
+ # of Conversations. If a date is provided, the end time of the date is used
157
+ # (YYYY-MM-DDT23:59:59Z). Can be combined with other filters.
158
+ # @param [conversation.State] state State for sorting and filtering list of
159
+ # Conversations. Can be `active`, `inactive` or `closed`
125
160
  # @param [String] page_token PageToken provided by the API
126
161
  # @param [Integer] page_number Page Number, this value is simply for client state
127
162
  # @param [Integer] page_size Number of records to return, defaults to 50
128
163
  # @return [Page] Page of ConversationInstance
129
- def page(page_token: :unset, page_number: :unset, page_size: :unset)
164
+ def page(start_date: :unset, end_date: :unset, state: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
130
165
  params = Twilio::Values.of({
166
+ 'StartDate' => start_date,
167
+ 'EndDate' => end_date,
168
+ 'State' => state,
131
169
  'PageToken' => page_token,
132
170
  'Page' => page_number,
133
171
  'PageSize' => page_size,
@@ -46,6 +46,7 @@ module Twilio
46
46
  # @param [call_summaries.SortBy] sort_by The sort_by
47
47
  # @param [String] subaccount The subaccount
48
48
  # @param [Boolean] abnormal_session The abnormal_session
49
+ # @param [call_summaries.AnsweredBy] answered_by The answered_by
49
50
  # @param [Integer] limit Upper limit for the number of records to return. stream()
50
51
  # guarantees to never return more than limit. Default is no limit
51
52
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -53,7 +54,7 @@ module Twilio
53
54
  # but a limit is defined, stream() will attempt to read the limit with the most
54
55
  # efficient page size, i.e. min(limit, 1000)
55
56
  # @return [Array] Array of up to limit results
56
- def list(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, abnormal_session: :unset, limit: nil, page_size: nil)
57
+ def list(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, abnormal_session: :unset, answered_by: :unset, limit: nil, page_size: nil)
57
58
  self.stream(
58
59
  from: from,
59
60
  to: to,
@@ -73,6 +74,7 @@ module Twilio
73
74
  sort_by: sort_by,
74
75
  subaccount: subaccount,
75
76
  abnormal_session: abnormal_session,
77
+ answered_by: answered_by,
76
78
  limit: limit,
77
79
  page_size: page_size
78
80
  ).entries
@@ -101,6 +103,7 @@ module Twilio
101
103
  # @param [call_summaries.SortBy] sort_by The sort_by
102
104
  # @param [String] subaccount The subaccount
103
105
  # @param [Boolean] abnormal_session The abnormal_session
106
+ # @param [call_summaries.AnsweredBy] answered_by The answered_by
104
107
  # @param [Integer] limit Upper limit for the number of records to return. stream()
105
108
  # guarantees to never return more than limit. Default is no limit.
106
109
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -108,7 +111,7 @@ module Twilio
108
111
  # but a limit is defined, stream() will attempt to read the limit with the most
109
112
  # efficient page size, i.e. min(limit, 1000)
110
113
  # @return [Enumerable] Enumerable that will yield up to limit results
111
- def stream(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, abnormal_session: :unset, limit: nil, page_size: nil)
114
+ def stream(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, abnormal_session: :unset, answered_by: :unset, limit: nil, page_size: nil)
112
115
  limits = @version.read_limits(limit, page_size)
113
116
 
114
117
  page = self.page(
@@ -130,6 +133,7 @@ module Twilio
130
133
  sort_by: sort_by,
131
134
  subaccount: subaccount,
132
135
  abnormal_session: abnormal_session,
136
+ answered_by: answered_by,
133
137
  page_size: limits[:page_size],
134
138
  )
135
139
 
@@ -172,11 +176,12 @@ module Twilio
172
176
  # @param [call_summaries.SortBy] sort_by The sort_by
173
177
  # @param [String] subaccount The subaccount
174
178
  # @param [Boolean] abnormal_session The abnormal_session
179
+ # @param [call_summaries.AnsweredBy] answered_by The answered_by
175
180
  # @param [String] page_token PageToken provided by the API
176
181
  # @param [Integer] page_number Page Number, this value is simply for client state
177
182
  # @param [Integer] page_size Number of records to return, defaults to 50
178
183
  # @return [Page] Page of CallSummariesInstance
179
- def page(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, abnormal_session: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
184
+ def page(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, abnormal_session: :unset, answered_by: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
180
185
  params = Twilio::Values.of({
181
186
  'From' => from,
182
187
  'To' => to,
@@ -196,6 +201,7 @@ module Twilio
196
201
  'SortBy' => sort_by,
197
202
  'Subaccount' => subaccount,
198
203
  'AbnormalSession' => abnormal_session,
204
+ 'AnsweredBy' => answered_by,
199
205
  'PageToken' => page_token,
200
206
  'Page' => page_number,
201
207
  'PageSize' => page_size,
@@ -173,7 +173,6 @@ module Twilio
173
173
  'line_type_intelligence' => payload['line_type_intelligence'],
174
174
  'identity_match' => payload['identity_match'],
175
175
  'sms_pumping_risk' => payload['sms_pumping_risk'],
176
- 'disposable_phone_number_risk' => payload['disposable_phone_number_risk'],
177
176
  'url' => payload['url'],
178
177
  }
179
178
 
@@ -271,12 +270,6 @@ module Twilio
271
270
  @properties['sms_pumping_risk']
272
271
  end
273
272
 
274
- ##
275
- # @return [Hash] An object that contains disposable phone number risk information
276
- def disposable_phone_number_risk
277
- @properties['disposable_phone_number_risk']
278
- end
279
-
280
273
  ##
281
274
  # @return [String] The absolute URL of the resource
282
275
  def url
@@ -0,0 +1,134 @@
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 Messaging < Domain
12
+ class V1 < Version
13
+ class BrandRegistrationContext < InstanceContext
14
+ ##
15
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
16
+ class BrandRegistrationOtpList < ListResource
17
+ ##
18
+ # Initialize the BrandRegistrationOtpList
19
+ # @param [Version] version Version that contains the resource
20
+ # @param [String] brand_registration_sid The unique string to identify Brand
21
+ # Registration of Sole Proprietor Brand
22
+ # @return [BrandRegistrationOtpList] BrandRegistrationOtpList
23
+ def initialize(version, brand_registration_sid: nil)
24
+ super(version)
25
+
26
+ # Path Solution
27
+ @solution = {brand_registration_sid: brand_registration_sid}
28
+ @uri = "/a2p/BrandRegistrations/#{@solution[:brand_registration_sid]}/SmsOtp"
29
+ end
30
+
31
+ ##
32
+ # Create the BrandRegistrationOtpInstance
33
+ # @return [BrandRegistrationOtpInstance] Created BrandRegistrationOtpInstance
34
+ def create
35
+ payload = @version.create('POST', @uri)
36
+
37
+ BrandRegistrationOtpInstance.new(
38
+ @version,
39
+ payload,
40
+ brand_registration_sid: @solution[:brand_registration_sid],
41
+ )
42
+ end
43
+
44
+ ##
45
+ # Provide a user friendly representation
46
+ def to_s
47
+ '#<Twilio.Messaging.V1.BrandRegistrationOtpList>'
48
+ end
49
+ end
50
+
51
+ ##
52
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
53
+ class BrandRegistrationOtpPage < Page
54
+ ##
55
+ # Initialize the BrandRegistrationOtpPage
56
+ # @param [Version] version Version that contains the resource
57
+ # @param [Response] response Response from the API
58
+ # @param [Hash] solution Path solution for the resource
59
+ # @return [BrandRegistrationOtpPage] BrandRegistrationOtpPage
60
+ def initialize(version, response, solution)
61
+ super(version, response)
62
+
63
+ # Path Solution
64
+ @solution = solution
65
+ end
66
+
67
+ ##
68
+ # Build an instance of BrandRegistrationOtpInstance
69
+ # @param [Hash] payload Payload response from the API
70
+ # @return [BrandRegistrationOtpInstance] BrandRegistrationOtpInstance
71
+ def get_instance(payload)
72
+ BrandRegistrationOtpInstance.new(
73
+ @version,
74
+ payload,
75
+ brand_registration_sid: @solution[:brand_registration_sid],
76
+ )
77
+ end
78
+
79
+ ##
80
+ # Provide a user friendly representation
81
+ def to_s
82
+ '<Twilio.Messaging.V1.BrandRegistrationOtpPage>'
83
+ end
84
+ end
85
+
86
+ ##
87
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
88
+ class BrandRegistrationOtpInstance < InstanceResource
89
+ ##
90
+ # Initialize the BrandRegistrationOtpInstance
91
+ # @param [Version] version Version that contains the resource
92
+ # @param [Hash] payload payload that contains response from Twilio
93
+ # @param [String] brand_registration_sid The unique string to identify Brand
94
+ # Registration of Sole Proprietor Brand
95
+ # @return [BrandRegistrationOtpInstance] BrandRegistrationOtpInstance
96
+ def initialize(version, payload, brand_registration_sid: nil)
97
+ super(version)
98
+
99
+ # Marshaled Properties
100
+ @properties = {
101
+ 'account_sid' => payload['account_sid'],
102
+ 'brand_registration_sid' => payload['brand_registration_sid'],
103
+ }
104
+ end
105
+
106
+ ##
107
+ # @return [String] The SID of the Account that created the vetting
108
+ def account_sid
109
+ @properties['account_sid']
110
+ end
111
+
112
+ ##
113
+ # @return [String] Brand Registration Sid
114
+ def brand_registration_sid
115
+ @properties['brand_registration_sid']
116
+ end
117
+
118
+ ##
119
+ # Provide a user friendly representation
120
+ def to_s
121
+ "<Twilio.Messaging.V1.BrandRegistrationOtpInstance>"
122
+ end
123
+
124
+ ##
125
+ # Provide a detailed, user friendly representation
126
+ def inspect
127
+ "<Twilio.Messaging.V1.BrandRegistrationOtpInstance>"
128
+ end
129
+ end
130
+ end
131
+ end
132
+ end
133
+ end
134
+ end
@@ -110,8 +110,8 @@ module Twilio
110
110
  # @param [String] customer_profile_bundle_sid Customer Profile Bundle Sid.
111
111
  # @param [String] a2p_profile_bundle_sid A2P Messaging Profile Bundle Sid.
112
112
  # @param [String] brand_type Type of brand being created. One of: "STANDARD",
113
- # "STARTER". STARTER is for low volume, starter use cases. STANDARD is for all
114
- # other use cases.
113
+ # "SOLE_PROPRIETOR". SOLE_PROPRIETOR is for low volume, SOLE_PROPRIETOR use cases.
114
+ # STANDARD is for all other use cases.
115
115
  # @param [Boolean] mock A boolean that specifies whether brand should be a mock or
116
116
  # not. If true, brand will be registered as a mock brand. Defaults to false if no
117
117
  # value is provided.
@@ -187,6 +187,7 @@ module Twilio
187
187
 
188
188
  # Dependents
189
189
  @brand_vettings = nil
190
+ @brand_registration_otps = nil
190
191
  end
191
192
 
192
193
  ##
@@ -225,6 +226,21 @@ module Twilio
225
226
  @brand_vettings
226
227
  end
227
228
 
229
+ ##
230
+ # Access the brand_registration_otps
231
+ # @return [BrandRegistrationOtpList]
232
+ # @return [BrandRegistrationOtpContext]
233
+ def brand_registration_otps
234
+ unless @brand_registration_otps
235
+ @brand_registration_otps = BrandRegistrationOtpList.new(
236
+ @version,
237
+ brand_registration_sid: @solution[:sid],
238
+ )
239
+ end
240
+
241
+ @brand_registration_otps
242
+ end
243
+
228
244
  ##
229
245
  # Provide a user friendly representation
230
246
  def to_s
@@ -329,7 +345,7 @@ module Twilio
329
345
  end
330
346
 
331
347
  ##
332
- # @return [String] Type of brand. One of: "STANDARD", "STARTER".
348
+ # @return [String] Type of brand. One of: "STANDARD", "SOLE_PROPRIETOR".
333
349
  def brand_type
334
350
  @properties['brand_type']
335
351
  end
@@ -433,6 +449,13 @@ module Twilio
433
449
  context.brand_vettings
434
450
  end
435
451
 
452
+ ##
453
+ # Access the brand_registration_otps
454
+ # @return [brand_registration_otps] brand_registration_otps
455
+ def brand_registration_otps
456
+ context.brand_registration_otps
457
+ end
458
+
436
459
  ##
437
460
  # Provide a user friendly representation
438
461
  def to_s
@@ -81,24 +81,15 @@ module Twilio
81
81
 
82
82
  ##
83
83
  # Update the DomainConfigInstance
84
- # @param [Array[String]] messaging_service_sids A list of messagingServiceSids
85
- # (with prefix MG)
86
84
  # @param [String] fallback_url Any requests we receive to this domain that do not
87
85
  # match an existing shortened message will be redirected to the fallback url.
88
86
  # These will likely be either expired messages, random misdirected traffic, or
89
87
  # intentional scraping.
90
88
  # @param [String] callback_url URL to receive click events to your webhook
91
89
  # whenever the recipients click on the shortened links
92
- # @param [String] messaging_service_sids_action An action type for
93
- # messaging_service_sids operation (ADD, DELETE, REPLACE)
94
90
  # @return [DomainConfigInstance] Updated DomainConfigInstance
95
- def update(messaging_service_sids: nil, fallback_url: :unset, callback_url: :unset, messaging_service_sids_action: :unset)
96
- data = Twilio::Values.of({
97
- 'MessagingServiceSids' => Twilio.serialize_list(messaging_service_sids) { |e| e },
98
- 'FallbackUrl' => fallback_url,
99
- 'CallbackUrl' => callback_url,
100
- 'MessagingServiceSidsAction' => messaging_service_sids_action,
101
- })
91
+ def update(fallback_url: :unset, callback_url: :unset)
92
+ data = Twilio::Values.of({'FallbackUrl' => fallback_url, 'CallbackUrl' => callback_url, })
102
93
 
103
94
  payload = @version.update('POST', @uri, data: data)
104
95
 
@@ -146,7 +137,6 @@ module Twilio
146
137
  @properties = {
147
138
  'domain_sid' => payload['domain_sid'],
148
139
  'config_sid' => payload['config_sid'],
149
- 'messaging_service_sids' => payload['messaging_service_sids'],
150
140
  'fallback_url' => payload['fallback_url'],
151
141
  'callback_url' => payload['callback_url'],
152
142
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
@@ -182,12 +172,6 @@ module Twilio
182
172
  @properties['config_sid']
183
173
  end
184
174
 
185
- ##
186
- # @return [Array[String]] A list of messagingServiceSids (with prefix MG).
187
- def messaging_service_sids
188
- @properties['messaging_service_sids']
189
- end
190
-
191
175
  ##
192
176
  # @return [String] We will redirect requests to urls we are unable to identify to this url.
193
177
  def fallback_url
@@ -220,24 +204,15 @@ module Twilio
220
204
 
221
205
  ##
222
206
  # Update the DomainConfigInstance
223
- # @param [Array[String]] messaging_service_sids A list of messagingServiceSids
224
- # (with prefix MG)
225
207
  # @param [String] fallback_url Any requests we receive to this domain that do not
226
208
  # match an existing shortened message will be redirected to the fallback url.
227
209
  # These will likely be either expired messages, random misdirected traffic, or
228
210
  # intentional scraping.
229
211
  # @param [String] callback_url URL to receive click events to your webhook
230
212
  # whenever the recipients click on the shortened links
231
- # @param [String] messaging_service_sids_action An action type for
232
- # messaging_service_sids operation (ADD, DELETE, REPLACE)
233
213
  # @return [DomainConfigInstance] Updated DomainConfigInstance
234
- def update(messaging_service_sids: nil, fallback_url: :unset, callback_url: :unset, messaging_service_sids_action: :unset)
235
- context.update(
236
- messaging_service_sids: messaging_service_sids,
237
- fallback_url: fallback_url,
238
- callback_url: callback_url,
239
- messaging_service_sids_action: messaging_service_sids_action,
240
- )
214
+ def update(fallback_url: :unset, callback_url: :unset)
215
+ context.update(fallback_url: fallback_url, callback_url: callback_url, )
241
216
  end
242
217
 
243
218
  ##
@@ -402,6 +402,8 @@ module Twilio
402
402
  'tollfree_phone_number_sid' => payload['tollfree_phone_number_sid'],
403
403
  'status' => payload['status'],
404
404
  'url' => payload['url'],
405
+ 'rejection_reason' => payload['rejection_reason'],
406
+ 'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i,
405
407
  'resource_links' => payload['resource_links'],
406
408
  'external_reference_id' => payload['external_reference_id'],
407
409
  }
@@ -602,6 +604,18 @@ module Twilio
602
604
  @properties['url']
603
605
  end
604
606
 
607
+ ##
608
+ # @return [String] The rejection reason given when a Tollfree Verification has been rejected.
609
+ def rejection_reason
610
+ @properties['rejection_reason']
611
+ end
612
+
613
+ ##
614
+ # @return [String] The error code given when a Tollfree Verification has been rejected.
615
+ def error_code
616
+ @properties['error_code']
617
+ end
618
+
605
619
  ##
606
620
  # @return [Hash] The URLs of the documents associated with the Tollfree Verification resource
607
621
  def resource_links
@@ -0,0 +1,111 @@
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 V1 < Version
13
+ ##
14
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
15
+ class EligibilityList < ListResource
16
+ ##
17
+ # Initialize the EligibilityList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [EligibilityList] EligibilityList
20
+ def initialize(version)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {}
25
+ @uri = "/HostedNumber/Eligibility"
26
+ end
27
+
28
+ ##
29
+ # Create the EligibilityInstance
30
+ # @return [EligibilityInstance] Created EligibilityInstance
31
+ def create
32
+ payload = @version.create('POST', @uri)
33
+
34
+ EligibilityInstance.new(@version, payload, )
35
+ end
36
+
37
+ ##
38
+ # Provide a user friendly representation
39
+ def to_s
40
+ '#<Twilio.Numbers.V1.EligibilityList>'
41
+ end
42
+ end
43
+
44
+ ##
45
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
46
+ class EligibilityPage < Page
47
+ ##
48
+ # Initialize the EligibilityPage
49
+ # @param [Version] version Version that contains the resource
50
+ # @param [Response] response Response from the API
51
+ # @param [Hash] solution Path solution for the resource
52
+ # @return [EligibilityPage] EligibilityPage
53
+ def initialize(version, response, solution)
54
+ super(version, response)
55
+
56
+ # Path Solution
57
+ @solution = solution
58
+ end
59
+
60
+ ##
61
+ # Build an instance of EligibilityInstance
62
+ # @param [Hash] payload Payload response from the API
63
+ # @return [EligibilityInstance] EligibilityInstance
64
+ def get_instance(payload)
65
+ EligibilityInstance.new(@version, payload, )
66
+ end
67
+
68
+ ##
69
+ # Provide a user friendly representation
70
+ def to_s
71
+ '<Twilio.Numbers.V1.EligibilityPage>'
72
+ end
73
+ end
74
+
75
+ ##
76
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
77
+ class EligibilityInstance < InstanceResource
78
+ ##
79
+ # Initialize the EligibilityInstance
80
+ # @param [Version] version Version that contains the resource
81
+ # @param [Hash] payload payload that contains response from Twilio
82
+ # @return [EligibilityInstance] EligibilityInstance
83
+ def initialize(version, payload)
84
+ super(version)
85
+
86
+ # Marshaled Properties
87
+ @properties = {'results' => payload['results'], }
88
+ end
89
+
90
+ ##
91
+ # @return [Array[Hash]] The result set of the requested number in the eligibility check.
92
+ def results
93
+ @properties['results']
94
+ end
95
+
96
+ ##
97
+ # Provide a user friendly representation
98
+ def to_s
99
+ "<Twilio.Numbers.V1.EligibilityInstance>"
100
+ end
101
+
102
+ ##
103
+ # Provide a detailed, user friendly representation
104
+ def inspect
105
+ "<Twilio.Numbers.V1.EligibilityInstance>"
106
+ end
107
+ end
108
+ end
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,35 @@
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
12
+ class V1 < Version
13
+ ##
14
+ # Initialize the V1 version of Numbers
15
+ def initialize(domain)
16
+ super
17
+ @version = 'v1'
18
+ @eligibilities = nil
19
+ end
20
+
21
+ ##
22
+ # @return [Twilio::REST::Numbers::V1::EligibilityContext]
23
+ def eligibilities
24
+ @eligibilities ||= EligibilityList.new self
25
+ end
26
+
27
+ ##
28
+ # Provide a user friendly representation
29
+ def to_s
30
+ '<Twilio::REST::Numbers::V1>'
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -19,15 +19,28 @@ module Twilio
19
19
  @port = 443
20
20
 
21
21
  # Versions
22
+ @v1 = nil
22
23
  @v2 = nil
23
24
  end
24
25
 
26
+ ##
27
+ # Version v1 of numbers
28
+ def v1
29
+ @v1 ||= V1.new self
30
+ end
31
+
25
32
  ##
26
33
  # Version v2 of numbers
27
34
  def v2
28
35
  @v2 ||= V2.new self
29
36
  end
30
37
 
38
+ ##
39
+ # @return [Twilio::REST::Numbers::V1::EligibilityInstance]
40
+ def eligibilities
41
+ self.v1.eligibilities()
42
+ end
43
+
31
44
  ##
32
45
  # @return [Twilio::REST::Numbers::V2::RegulatoryComplianceInstance]
33
46
  def regulatory_compliance