twilio-ruby 7.8.2 → 7.8.3

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.
@@ -0,0 +1,270 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Numbers
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 Numbers < NumbersBase
19
+ class V1 < Version
20
+ class PortingAllPortInList < ListResource
21
+
22
+ ##
23
+ # Initialize the PortingAllPortInList
24
+ # @param [Version] version Version that contains the resource
25
+ # @return [PortingAllPortInList] PortingAllPortInList
26
+ def initialize(version)
27
+ super(version)
28
+ # Path Solution
29
+ @solution = { }
30
+ @uri = "/Porting/PortIn/PortInRequests"
31
+
32
+ end
33
+
34
+ ##
35
+ # Lists PortingAllPortInInstance 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 [String] token Page start token, if null then it will start from the beginning
39
+ # @param [String] size Number of items per page
40
+ # @param [String] port_in_request_sid Filter by Port in request SID, supports multiple values separated by comma
41
+ # @param [String] port_in_request_status Filter by Port In request status
42
+ # @param [Time] created_before Find all created before a certain date
43
+ # @param [Time] created_after Find all created after a certain date
44
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
45
+ # guarantees to never return more than limit. Default is no limit
46
+ # @param [Integer] page_size Number of records to fetch per request, when
47
+ # not set will use the default value of 50 records. If no page_size is defined
48
+ # but a limit is defined, stream() will attempt to read the limit with the most
49
+ # efficient page size, i.e. min(limit, 1000)
50
+ # @return [Array] Array of up to limit results
51
+ def list(token: :unset, size: :unset, port_in_request_sid: :unset, port_in_request_status: :unset, created_before: :unset, created_after: :unset, limit: nil, page_size: nil)
52
+ self.stream(
53
+ token: token,
54
+ size: size,
55
+ port_in_request_sid: port_in_request_sid,
56
+ port_in_request_status: port_in_request_status,
57
+ created_before: created_before,
58
+ created_after: created_after,
59
+ limit: limit,
60
+ page_size: page_size
61
+ ).entries
62
+ end
63
+
64
+ ##
65
+ # Streams Instance records from the API as an Enumerable.
66
+ # This operation lazily loads records as efficiently as possible until the limit
67
+ # is reached.
68
+ # @param [String] token Page start token, if null then it will start from the beginning
69
+ # @param [String] size Number of items per page
70
+ # @param [String] port_in_request_sid Filter by Port in request SID, supports multiple values separated by comma
71
+ # @param [String] port_in_request_status Filter by Port In request status
72
+ # @param [Time] created_before Find all created before a certain date
73
+ # @param [Time] created_after Find all created after a certain date
74
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
75
+ # guarantees to never return more than limit. Default is no limit
76
+ # @param [Integer] page_size Number of records to fetch per request, when
77
+ # not set will use the default value of 50 records. If no page_size is defined
78
+ # but a limit is defined, stream() will attempt to read the limit with the most
79
+ # efficient page size, i.e. min(limit, 1000)
80
+ # @return [Enumerable] Enumerable that will yield up to limit results
81
+ def stream(token: :unset, size: :unset, port_in_request_sid: :unset, port_in_request_status: :unset, created_before: :unset, created_after: :unset, limit: nil, page_size: nil)
82
+ limits = @version.read_limits(limit, page_size)
83
+
84
+ page = self.page(
85
+ token: token,
86
+ size: size,
87
+ port_in_request_sid: port_in_request_sid,
88
+ port_in_request_status: port_in_request_status,
89
+ created_before: created_before,
90
+ created_after: created_after,
91
+ page_size: limits[:page_size], )
92
+
93
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
94
+ end
95
+
96
+ ##
97
+ # When passed a block, yields PortingAllPortInInstance records from the API.
98
+ # This operation lazily loads records as efficiently as possible until the limit
99
+ # is reached.
100
+ def each
101
+ limits = @version.read_limits
102
+
103
+ page = self.page(page_size: limits[:page_size], )
104
+
105
+ @version.stream(page,
106
+ limit: limits[:limit],
107
+ page_limit: limits[:page_limit]).each {|x| yield x}
108
+ end
109
+
110
+ ##
111
+ # Retrieve a single page of PortingAllPortInInstance records from the API.
112
+ # Request is executed immediately.
113
+ # @param [String] token Page start token, if null then it will start from the beginning
114
+ # @param [String] size Number of items per page
115
+ # @param [String] port_in_request_sid Filter by Port in request SID, supports multiple values separated by comma
116
+ # @param [String] port_in_request_status Filter by Port In request status
117
+ # @param [Time] created_before Find all created before a certain date
118
+ # @param [Time] created_after Find all created after a certain date
119
+ # @param [String] page_token PageToken provided by the API
120
+ # @param [Integer] page_number Page Number, this value is simply for client state
121
+ # @param [Integer] page_size Number of records to return, defaults to 50
122
+ # @return [Page] Page of PortingAllPortInInstance
123
+ def page(token: :unset, size: :unset, port_in_request_sid: :unset, port_in_request_status: :unset, created_before: :unset, created_after: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
124
+ params = Twilio::Values.of({
125
+ 'Token' => token,
126
+ 'Size' => size,
127
+ 'PortInRequestSid' => port_in_request_sid,
128
+ 'PortInRequestStatus' => port_in_request_status,
129
+ 'CreatedBefore' => Twilio.serialize_iso8601_datetime(created_before),
130
+ 'CreatedAfter' => Twilio.serialize_iso8601_datetime(created_after),
131
+ 'PageToken' => page_token,
132
+ 'Page' => page_number,
133
+ 'PageSize' => page_size,
134
+ })
135
+ headers = Twilio::Values.of({})
136
+
137
+
138
+
139
+ response = @version.page('GET', @uri, params: params, headers: headers)
140
+
141
+ PortingAllPortInPage.new(@version, response, @solution)
142
+ end
143
+
144
+ ##
145
+ # Retrieve a single page of PortingAllPortInInstance records from the API.
146
+ # Request is executed immediately.
147
+ # @param [String] target_url API-generated URL for the requested results page
148
+ # @return [Page] Page of PortingAllPortInInstance
149
+ def get_page(target_url)
150
+ response = @version.domain.request(
151
+ 'GET',
152
+ target_url
153
+ )
154
+ PortingAllPortInPage.new(@version, response, @solution)
155
+ end
156
+
157
+
158
+
159
+ # Provide a user friendly representation
160
+ def to_s
161
+ '#<Twilio.Numbers.V1.PortingAllPortInList>'
162
+ end
163
+ end
164
+
165
+ class PortingAllPortInPage < Page
166
+ ##
167
+ # Initialize the PortingAllPortInPage
168
+ # @param [Version] version Version that contains the resource
169
+ # @param [Response] response Response from the API
170
+ # @param [Hash] solution Path solution for the resource
171
+ # @return [PortingAllPortInPage] PortingAllPortInPage
172
+ def initialize(version, response, solution)
173
+ super(version, response)
174
+
175
+ # Path Solution
176
+ @solution = solution
177
+ end
178
+
179
+ ##
180
+ # Build an instance of PortingAllPortInInstance
181
+ # @param [Hash] payload Payload response from the API
182
+ # @return [PortingAllPortInInstance] PortingAllPortInInstance
183
+ def get_instance(payload)
184
+ PortingAllPortInInstance.new(@version, payload)
185
+ end
186
+
187
+ ##
188
+ # Provide a user friendly representation
189
+ def to_s
190
+ '<Twilio.Numbers.V1.PortingAllPortInPage>'
191
+ end
192
+ end
193
+ class PortingAllPortInInstance < InstanceResource
194
+ ##
195
+ # Initialize the PortingAllPortInInstance
196
+ # @param [Version] version Version that contains the resource
197
+ # @param [Hash] payload payload that contains response from Twilio
198
+ # @param [String] account_sid The SID of the
199
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this PortingAllPortIn
200
+ # resource.
201
+ # @param [String] sid The SID of the Call resource to fetch.
202
+ # @return [PortingAllPortInInstance] PortingAllPortInInstance
203
+ def initialize(version, payload )
204
+ super(version)
205
+
206
+ # Marshaled Properties
207
+ @properties = {
208
+ 'port_in_request_sid' => payload['port_in_request_sid'],
209
+ 'port_in_request_status' => payload['port_in_request_status'],
210
+ 'status_last_updated_timestamp' => payload['status_last_updated_timestamp'],
211
+ 'phone_numbers_requested' => payload['phone_numbers_requested'] == nil ? payload['phone_numbers_requested'] : payload['phone_numbers_requested'].to_i,
212
+ 'phone_numbers_ported' => payload['phone_numbers_ported'] == nil ? payload['phone_numbers_ported'] : payload['phone_numbers_ported'].to_i,
213
+ 'suggested_action' => payload['suggested_action'],
214
+ }
215
+ end
216
+
217
+
218
+ ##
219
+ # @return [String] The SID of the Port-in request
220
+ def port_in_request_sid
221
+ @properties['port_in_request_sid']
222
+ end
223
+
224
+ ##
225
+ # @return [String] Status of the Port In Request
226
+ def port_in_request_status
227
+ @properties['port_in_request_status']
228
+ end
229
+
230
+ ##
231
+ # @return [String] The last updated timestamp of the request
232
+ def status_last_updated_timestamp
233
+ @properties['status_last_updated_timestamp']
234
+ end
235
+
236
+ ##
237
+ # @return [String] Amount of phone numbers requested
238
+ def phone_numbers_requested
239
+ @properties['phone_numbers_requested']
240
+ end
241
+
242
+ ##
243
+ # @return [String] Amount of phone numbers ported
244
+ def phone_numbers_ported
245
+ @properties['phone_numbers_ported']
246
+ end
247
+
248
+ ##
249
+ # @return [String] Suggested action on this ticket
250
+ def suggested_action
251
+ @properties['suggested_action']
252
+ end
253
+
254
+ ##
255
+ # Provide a user friendly representation
256
+ def to_s
257
+ "<Twilio.Numbers.V1.PortingAllPortInInstance>"
258
+ end
259
+
260
+ ##
261
+ # Provide a detailed, user friendly representation
262
+ def inspect
263
+ "<Twilio.Numbers.V1.PortingAllPortInInstance>"
264
+ end
265
+ end
266
+
267
+ end
268
+ end
269
+ end
270
+ end
@@ -261,6 +261,7 @@ module Twilio
261
261
  'target_port_in_time_range_start' => payload['target_port_in_time_range_start'],
262
262
  'target_port_in_time_range_end' => payload['target_port_in_time_range_end'],
263
263
  'port_in_request_status' => payload['port_in_request_status'],
264
+ 'order_cancellation_reason' => payload['order_cancellation_reason'],
264
265
  'losing_carrier_information' => payload['losing_carrier_information'],
265
266
  'phone_numbers' => payload['phone_numbers'],
266
267
  'bundle_sid' => payload['bundle_sid'],
@@ -334,6 +335,12 @@ module Twilio
334
335
  @properties['port_in_request_status']
335
336
  end
336
337
 
338
+ ##
339
+ # @return [String] If the order is cancelled this field will provide further context on the cause of the cancellation.
340
+ def order_cancellation_reason
341
+ @properties['order_cancellation_reason']
342
+ end
343
+
337
344
  ##
338
345
  # @return [NumbersV1PortingLosingCarrierInformation]
339
346
  def losing_carrier_information
@@ -23,6 +23,7 @@ module Twilio
23
23
  @version = 'v1'
24
24
  @bulk_eligibilities = nil
25
25
  @eligibilities = nil
26
+ @porting_all_port_ins = nil
26
27
  @porting_port_ins = nil
27
28
  @porting_port_in_phone_number = nil
28
29
  @porting_portabilities = nil
@@ -52,6 +53,11 @@ module Twilio
52
53
  @eligibilities ||= EligibilityList.new self
53
54
  end
54
55
  ##
56
+ # @return [Twilio::REST::Numbers::V1::PortingAllPortInList]
57
+ def porting_all_port_ins
58
+ @porting_all_port_ins ||= PortingAllPortInList.new self
59
+ end
60
+ ##
55
61
  # @param [String] port_in_request_sid The SID of the Port In request. This is a unique identifier of the port in request.
56
62
  # @return [Twilio::REST::Numbers::V1::PortingPortInContext] if portInRequestSid was passed.
57
63
  # @return [Twilio::REST::Numbers::V1::PortingPortInList]
@@ -81,155 +81,6 @@ module Twilio
81
81
  end
82
82
  end
83
83
 
84
- class VerifyPasskeysFactorRequest
85
- # @param [id]: [String] A [base64url](https://base64.guru/standards/base64url) encoded representation of `rawId`.
86
- # @param [raw_id]: [String] The globally unique identifier for this `PublicKeyCredential`.
87
- # @param [authenticator_attachment]: [String] A string that indicates the mechanism by which the WebAuthn implementation is attached to the authenticator at the time the associated `navigator.credentials.create()` or `navigator.credentials.get()` call completes.
88
- # @param [type]: [String] The valid credential types supported by the API. The values of this enumeration are used for versioning the `AuthenticatorAssertion` and `AuthenticatorAttestation` structures according to the type of the authenticator.
89
- # @param [response]: [NewFactorList.VerifyPasskeysFactorRequestResponse]
90
- attr_accessor :id, :raw_id, :authenticator_attachment, :type, :response
91
- def initialize(payload)
92
- @id = payload["id"]
93
- @raw_id = payload["raw_id"]
94
- @authenticator_attachment = payload["authenticator_attachment"]
95
- @type = payload["type"]
96
- @response = payload["response"]
97
- end
98
- def to_json(options = {})
99
- {
100
- "id": @id,
101
- "rawId": @raw_id,
102
- "authenticatorAttachment": @authenticator_attachment,
103
- "type": @type,
104
- "response": @response,
105
- }.to_json(options)
106
- end
107
- end
108
-
109
- class VerifyPasskeysFactorRequestResponse
110
- # @param [attestation_object]: [String] The authenticator data and an attestation statement for a new key pair generated by the authenticator.
111
- # @param [client_data_json]: [String] This property contains the JSON-compatible serialization of the data passed from the browser to the authenticator in order to generate this credential.
112
- # @param [transports]: [Array<String>] An array of strings providing hints as to the methods the client could use to communicate with the relevant authenticator of the public key credential to retrieve.
113
- attr_accessor :attestation_object, :client_data_json, :transports
114
- def initialize(payload)
115
- @attestation_object = payload["attestation_object"]
116
- @client_data_json = payload["client_data_json"]
117
- @transports = payload["transports"]
118
- end
119
- def to_json(options = {})
120
- {
121
- "attestationObject": @attestation_object,
122
- "clientDataJSON": @client_data_json,
123
- "transports": @transports,
124
- }.to_json(options)
125
- end
126
- end
127
-
128
-
129
- class CreateNewPasskeysFactorRequest
130
- # @param [friendly_name]: [String]
131
- # @param [identity]: [String]
132
- # @param [config]: [NewFactorList.CreateNewPasskeysFactorRequestConfig]
133
- attr_accessor :friendly_name, :identity, :config
134
- def initialize(payload)
135
- @friendly_name = payload["friendly_name"]
136
- @identity = payload["identity"]
137
- @config = payload["config"]
138
- end
139
- def to_json(options = {})
140
- {
141
- "friendly_name": @friendly_name,
142
- "identity": @identity,
143
- "config": @config,
144
- }.to_json(options)
145
- end
146
- end
147
-
148
- class CreateNewPasskeysFactorRequestConfig
149
- # @param [relying_party]: [NewFactorList.CreateNewPasskeysFactorRequestConfigRelyingParty]
150
- # @param [authenticator_attachment]: [String]
151
- # @param [discoverable_credentials]: [String]
152
- # @param [user_verification]: [String]
153
- attr_accessor :relying_party, :authenticator_attachment, :discoverable_credentials, :user_verification
154
- def initialize(payload)
155
- @relying_party = payload["relying_party"]
156
- @authenticator_attachment = payload["authenticator_attachment"]
157
- @discoverable_credentials = payload["discoverable_credentials"]
158
- @user_verification = payload["user_verification"]
159
- end
160
- def to_json(options = {})
161
- {
162
- "relying_party": @relying_party,
163
- "authenticator_attachment": @authenticator_attachment,
164
- "discoverable_credentials": @discoverable_credentials,
165
- "user_verification": @user_verification,
166
- }.to_json(options)
167
- end
168
- end
169
-
170
- class CreateNewPasskeysFactorRequestConfigRelyingParty
171
- # @param [id]: [String]
172
- # @param [name]: [String]
173
- # @param [origins]: [Array<String>]
174
- attr_accessor :id, :name, :origins
175
- def initialize(payload)
176
- @id = payload["id"]
177
- @name = payload["name"]
178
- @origins = payload["origins"]
179
- end
180
- def to_json(options = {})
181
- {
182
- "id": @id,
183
- "name": @name,
184
- "origins": @origins,
185
- }.to_json(options)
186
- end
187
- end
188
-
189
- class VerifyPasskeysFactorRequest
190
- # @param [id]: [String] A [base64url](https://base64.guru/standards/base64url) encoded representation of `rawId`.
191
- # @param [raw_id]: [String] The globally unique identifier for this `PublicKeyCredential`.
192
- # @param [authenticator_attachment]: [String] A string that indicates the mechanism by which the WebAuthn implementation is attached to the authenticator at the time the associated `navigator.credentials.create()` or `navigator.credentials.get()` call completes.
193
- # @param [type]: [String] The valid credential types supported by the API. The values of this enumeration are used for versioning the `AuthenticatorAssertion` and `AuthenticatorAttestation` structures according to the type of the authenticator.
194
- # @param [response]: [NewFactorList.VerifyPasskeysFactorRequestResponse]
195
- attr_accessor :id, :raw_id, :authenticator_attachment, :type, :response
196
- def initialize(payload)
197
- @id = payload["id"]
198
- @raw_id = payload["raw_id"]
199
- @authenticator_attachment = payload["authenticator_attachment"]
200
- @type = payload["type"]
201
- @response = payload["response"]
202
- end
203
- def to_json(options = {})
204
- {
205
- "id": @id,
206
- "rawId": @raw_id,
207
- "authenticatorAttachment": @authenticator_attachment,
208
- "type": @type,
209
- "response": @response,
210
- }.to_json(options)
211
- end
212
- end
213
-
214
- class VerifyPasskeysFactorRequestResponse
215
- # @param [attestation_object]: [String] The authenticator data and an attestation statement for a new key pair generated by the authenticator.
216
- # @param [client_data_json]: [String] This property contains the JSON-compatible serialization of the data passed from the browser to the authenticator in order to generate this credential.
217
- # @param [transports]: [Array<String>] An array of strings providing hints as to the methods the client could use to communicate with the relevant authenticator of the public key credential to retrieve.
218
- attr_accessor :attestation_object, :client_data_json, :transports
219
- def initialize(payload)
220
- @attestation_object = payload["attestation_object"]
221
- @client_data_json = payload["client_data_json"]
222
- @transports = payload["transports"]
223
- end
224
- def to_json(options = {})
225
- {
226
- "attestationObject": @attestation_object,
227
- "clientDataJSON": @client_data_json,
228
- "transports": @transports,
229
- }.to_json(options)
230
- end
231
- end
232
-
233
84
 
234
85
  ##
235
86
  # Initialize the NewFactorList
@@ -239,7 +90,7 @@ module Twilio
239
90
  super(version)
240
91
  # Path Solution
241
92
  @solution = { service_sid: service_sid }
242
- @uri = "/Services/#{@solution[:service_sid]}/Passkeys/VerifyFactor"
93
+ @uri = "/Services/#{@solution[:service_sid]}/Passkeys/Factors"
243
94
 
244
95
  end
245
96
  ##
@@ -263,27 +114,6 @@ module Twilio
263
114
  )
264
115
  end
265
116
 
266
- ##
267
- # Update the NewFactorInstance
268
- # @param [VerifyPasskeysFactorRequest] verify_passkeys_factor_request
269
- # @return [NewFactorInstance] Updated NewFactorInstance
270
- def update(verify_passkeys_factor_request: nil
271
- )
272
-
273
- headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
274
- headers['Content-Type'] = 'application/json'
275
-
276
-
277
-
278
-
279
- payload = @version.update('POST', @uri, headers: headers, data: verify_passkeys_factor_request.to_json)
280
- NewFactorInstance.new(
281
- @version,
282
- payload,
283
- service_sid: @solution[:service_sid],
284
- )
285
- end
286
-
287
117
 
288
118
 
289
119