late-sdk 0.0.568 → 0.0.570

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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -0
  3. data/docs/Ad.md +5 -1
  4. data/docs/AdCampaign.md +1 -1
  5. data/docs/AdReviewStatus.md +15 -0
  6. data/docs/AdTreeCampaign.md +1 -1
  7. data/docs/CheckPhoneNumberAvailability200Response.md +3 -1
  8. data/docs/CheckPhoneNumberAvailability200ResponseAreaOptionsInner.md +22 -0
  9. data/docs/CreatePhoneNumberKycLinkRequest.md +2 -0
  10. data/docs/PhoneNumbersApi.md +3 -1
  11. data/docs/PurchasePhoneNumberRequest.md +2 -0
  12. data/docs/SubmitPhoneNumberKycRequest.md +2 -0
  13. data/docs/SubmitWhatsAppNumberKycRequest.md +2 -0
  14. data/docs/WhatsAppPhoneNumbersApi.md +3 -1
  15. data/lib/zernio-sdk/api/phone_numbers_api.rb +3 -0
  16. data/lib/zernio-sdk/api/whats_app_phone_numbers_api.rb +3 -0
  17. data/lib/zernio-sdk/models/ad.rb +23 -1
  18. data/lib/zernio-sdk/models/ad_campaign.rb +1 -14
  19. data/lib/zernio-sdk/models/ad_review_status.rb +42 -0
  20. data/lib/zernio-sdk/models/ad_tree_campaign.rb +1 -14
  21. data/lib/zernio-sdk/models/check_phone_number_availability200_response.rb +16 -4
  22. data/lib/zernio-sdk/models/check_phone_number_availability200_response_area_options_inner.rb +168 -0
  23. data/lib/zernio-sdk/models/create_phone_number_kyc_link_request.rb +32 -1
  24. data/lib/zernio-sdk/models/purchase_phone_number409_response.rb +2 -2
  25. data/lib/zernio-sdk/models/purchase_phone_number_request.rb +32 -1
  26. data/lib/zernio-sdk/models/submit_phone_number_kyc_request.rb +32 -1
  27. data/lib/zernio-sdk/models/submit_whats_app_number_kyc_request.rb +32 -1
  28. data/lib/zernio-sdk/version.rb +1 -1
  29. data/lib/zernio-sdk.rb +2 -0
  30. data/openapi.yaml +80 -15
  31. data/spec/api/phone_numbers_api_spec.rb +1 -0
  32. data/spec/api/whats_app_phone_numbers_api_spec.rb +1 -0
  33. data/spec/models/ad_campaign_spec.rb +0 -4
  34. data/spec/models/ad_review_status_spec.rb +30 -0
  35. data/spec/models/ad_spec.rb +12 -0
  36. data/spec/models/ad_tree_campaign_spec.rb +0 -4
  37. data/spec/models/check_phone_number_availability200_response_area_options_inner_spec.rb +48 -0
  38. data/spec/models/check_phone_number_availability200_response_spec.rb +6 -0
  39. data/spec/models/create_phone_number_kyc_link_request_spec.rb +6 -0
  40. data/spec/models/purchase_phone_number409_response_spec.rb +1 -1
  41. data/spec/models/purchase_phone_number_request_spec.rb +6 -0
  42. data/spec/models/submit_phone_number_kyc_request_spec.rb +6 -0
  43. data/spec/models/submit_whats_app_number_kyc_request_spec.rb +6 -0
  44. data/zernio-sdk-0.0.570.gem +0 -0
  45. metadata +10 -2
  46. data/zernio-sdk-0.0.568.gem +0 -0
@@ -0,0 +1,168 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class CheckPhoneNumberAvailability200ResponseAreaOptionsInner < ApiModelBase
18
+ # Area code (national destination code), e.g. \"11\".
19
+ attr_accessor :ndc
20
+
21
+ # Human-readable area name, e.g. \"Sao Paulo\".
22
+ attr_accessor :name
23
+
24
+ # Deliverable numbers seen in this area on the latest inventory page.
25
+ attr_accessor :count
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'ndc' => :'ndc',
31
+ :'name' => :'name',
32
+ :'count' => :'count'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'ndc' => :'String',
50
+ :'name' => :'String',
51
+ :'count' => :'Integer'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CheckPhoneNumberAvailability200ResponseAreaOptionsInner` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CheckPhoneNumberAvailability200ResponseAreaOptionsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'ndc')
78
+ self.ndc = attributes[:'ndc']
79
+ end
80
+
81
+ if attributes.key?(:'name')
82
+ self.name = attributes[:'name']
83
+ end
84
+
85
+ if attributes.key?(:'count')
86
+ self.count = attributes[:'count']
87
+ end
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
94
+ invalid_properties = Array.new
95
+ invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ warn '[DEPRECATED] the `valid?` method is obsolete'
102
+ true
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ ndc == o.ndc &&
111
+ name == o.name &&
112
+ count == o.count
113
+ end
114
+
115
+ # @see the `==` method
116
+ # @param [Object] Object to be compared
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Integer] Hash code
123
+ def hash
124
+ [ndc, name, count].hash
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def self.build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ attributes = attributes.transform_keys(&:to_sym)
133
+ transformed_hash = {}
134
+ openapi_types.each_pair do |key, type|
135
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
136
+ transformed_hash["#{key}"] = nil
137
+ elsif type =~ /\AArray<(.*)>/i
138
+ # check to ensure the input is an array given that the attribute
139
+ # is documented as an array but the input is not
140
+ if attributes[attribute_map[key]].is_a?(Array)
141
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
142
+ end
143
+ elsif !attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
145
+ end
146
+ end
147
+ new(transformed_hash)
148
+ end
149
+
150
+ # Returns the object in the form of hash
151
+ # @return [Hash] Returns the object in the form of hash
152
+ def to_hash
153
+ hash = {}
154
+ self.class.attribute_map.each_pair do |attr, param|
155
+ value = self.send(attr)
156
+ if value.nil?
157
+ is_nullable = self.class.openapi_nullable.include?(attr)
158
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
159
+ end
160
+
161
+ hash[param] = _to_hash(value)
162
+ end
163
+ hash
164
+ end
165
+
166
+ end
167
+
168
+ end
@@ -20,6 +20,9 @@ module Zernio
20
20
  # ISO 3166-1 alpha-2 country code (must be a regulated/KYC country).
21
21
  attr_accessor :country
22
22
 
23
+ # Area code (NDC) the eventual number must be in. Hard constraint carried by the link; the end customer filling the form makes no area choice. Options come from GET /v1/phone-numbers/availability (areaOptions).
24
+ attr_accessor :area_code
25
+
23
26
  attr_accessor :branding
24
27
 
25
28
  # Where to send the end customer's browser after a successful submit. On completion Zernio appends `kyc=submitted` and `country=<ISO-2>` as query params. When omitted, the hosted page shows a built-in confirmation screen instead.
@@ -30,6 +33,7 @@ module Zernio
30
33
  {
31
34
  :'profile_id' => :'profileId',
32
35
  :'country' => :'country',
36
+ :'area_code' => :'areaCode',
33
37
  :'branding' => :'branding',
34
38
  :'redirect_url' => :'redirect_url'
35
39
  }
@@ -50,6 +54,7 @@ module Zernio
50
54
  {
51
55
  :'profile_id' => :'String',
52
56
  :'country' => :'String',
57
+ :'area_code' => :'String',
53
58
  :'branding' => :'CreatePhoneNumberKycLinkRequestBranding',
54
59
  :'redirect_url' => :'String'
55
60
  }
@@ -89,6 +94,10 @@ module Zernio
89
94
  self.country = nil
90
95
  end
91
96
 
97
+ if attributes.key?(:'area_code')
98
+ self.area_code = attributes[:'area_code']
99
+ end
100
+
92
101
  if attributes.key?(:'branding')
93
102
  self.branding = attributes[:'branding']
94
103
  end
@@ -119,6 +128,11 @@ module Zernio
119
128
  invalid_properties.push('invalid value for "country", the character length must be greater than or equal to 2.')
120
129
  end
121
130
 
131
+ pattern = Regexp.new(/^\d{1,4}$/)
132
+ if !@area_code.nil? && @area_code !~ pattern
133
+ invalid_properties.push("invalid value for \"area_code\", must conform to the pattern #{pattern}.")
134
+ end
135
+
122
136
  invalid_properties
123
137
  end
124
138
 
@@ -130,6 +144,7 @@ module Zernio
130
144
  return false if @country.nil?
131
145
  return false if @country.to_s.length > 2
132
146
  return false if @country.to_s.length < 2
147
+ return false if !@area_code.nil? && @area_code !~ Regexp.new(/^\d{1,4}$/)
133
148
  true
134
149
  end
135
150
 
@@ -161,6 +176,21 @@ module Zernio
161
176
  @country = country
162
177
  end
163
178
 
179
+ # Custom attribute writer method with validation
180
+ # @param [Object] area_code Value to be assigned
181
+ def area_code=(area_code)
182
+ if area_code.nil?
183
+ fail ArgumentError, 'area_code cannot be nil'
184
+ end
185
+
186
+ pattern = Regexp.new(/^\d{1,4}$/)
187
+ if area_code !~ pattern
188
+ fail ArgumentError, "invalid value for \"area_code\", must conform to the pattern #{pattern}."
189
+ end
190
+
191
+ @area_code = area_code
192
+ end
193
+
164
194
  # Checks equality by comparing each attribute.
165
195
  # @param [Object] Object to be compared
166
196
  def ==(o)
@@ -168,6 +198,7 @@ module Zernio
168
198
  self.class == o.class &&
169
199
  profile_id == o.profile_id &&
170
200
  country == o.country &&
201
+ area_code == o.area_code &&
171
202
  branding == o.branding &&
172
203
  redirect_url == o.redirect_url
173
204
  end
@@ -181,7 +212,7 @@ module Zernio
181
212
  # Calculates hash code according to all attributes.
182
213
  # @return [Integer] Hash code
183
214
  def hash
184
- [profile_id, country, branding, redirect_url].hash
215
+ [profile_id, country, area_code, branding, redirect_url].hash
185
216
  end
186
217
 
187
218
  # Builds the object from hash
@@ -110,7 +110,7 @@ module Zernio
110
110
  # @return true if the model is valid
111
111
  def valid?
112
112
  warn '[DEPRECATED] the `valid?` method is obsolete'
113
- code_validator = EnumAttributeValidator.new('String', ["PURCHASE_VELOCITY"])
113
+ code_validator = EnumAttributeValidator.new('String', ["PURCHASE_VELOCITY", "AREA_CODE_UNAVAILABLE"])
114
114
  return false unless code_validator.valid?(@code)
115
115
  true
116
116
  end
@@ -118,7 +118,7 @@ module Zernio
118
118
  # Custom attribute writer method checking allowed values (enum).
119
119
  # @param [Object] code Object to be assigned
120
120
  def code=(code)
121
- validator = EnumAttributeValidator.new('String', ["PURCHASE_VELOCITY"])
121
+ validator = EnumAttributeValidator.new('String', ["PURCHASE_VELOCITY", "AREA_CODE_UNAVAILABLE"])
122
122
  unless validator.valid?(code)
123
123
  fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
124
124
  end
@@ -24,6 +24,9 @@ module Zernio
24
24
  # Which of the country's offered number types to order (see `types[]` on GET /v1/phone-numbers/countries). Omitted = the country's default type, which is always the WhatsApp-safe choice. Capabilities, price, and KYC requirements are per (country, type): toll_free can never connect WhatsApp (400 when combined with connectWhatsapp:true), and wantsSms:true requires an SMS-capable type.
25
25
  attr_accessor :number_type
26
26
 
27
+ # Area code (national destination code, e.g. 11 for Sao Paulo) the number must be in. Hard constraint: when the area has no deliverable inventory the purchase fails with 409 code AREA_CODE_UNAVAILABLE instead of assigning a number from another area, and later replacements stay in this area too. Omit for any area. Get live options from GET /v1/phone-numbers/availability (areaOptions).
28
+ attr_accessor :area_code
29
+
27
30
  # A phone number is the unit; WhatsApp is one optional feature. Pass false to buy a STANDALONE number (Calls/SMS only): provisioning skips the Meta pre-verify/OTP steps and the number activates immediately. Omitted defaults to the WhatsApp provisioning path. WhatsApp can be connected to a standalone number later from the connect flow.
28
31
  attr_accessor :connect_whatsapp
29
32
 
@@ -67,6 +70,7 @@ module Zernio
67
70
  :'profile_id' => :'profileId',
68
71
  :'country' => :'country',
69
72
  :'number_type' => :'numberType',
73
+ :'area_code' => :'areaCode',
70
74
  :'connect_whatsapp' => :'connectWhatsapp',
71
75
  :'wants_sms' => :'wantsSms',
72
76
  :'wants_whatsapp' => :'wantsWhatsapp',
@@ -91,6 +95,7 @@ module Zernio
91
95
  :'profile_id' => :'String',
92
96
  :'country' => :'String',
93
97
  :'number_type' => :'String',
98
+ :'area_code' => :'String',
94
99
  :'connect_whatsapp' => :'Boolean',
95
100
  :'wants_sms' => :'Boolean',
96
101
  :'wants_whatsapp' => :'Boolean',
@@ -137,6 +142,10 @@ module Zernio
137
142
  self.number_type = attributes[:'number_type']
138
143
  end
139
144
 
145
+ if attributes.key?(:'area_code')
146
+ self.area_code = attributes[:'area_code']
147
+ end
148
+
140
149
  if attributes.key?(:'connect_whatsapp')
141
150
  self.connect_whatsapp = attributes[:'connect_whatsapp']
142
151
  else
@@ -175,6 +184,11 @@ module Zernio
175
184
  invalid_properties.push('invalid value for "profile_id", profile_id cannot be nil.')
176
185
  end
177
186
 
187
+ pattern = Regexp.new(/^\d{1,4}$/)
188
+ if !@area_code.nil? && @area_code !~ pattern
189
+ invalid_properties.push("invalid value for \"area_code\", must conform to the pattern #{pattern}.")
190
+ end
191
+
178
192
  if !@purchase_intent_id.nil? && @purchase_intent_id.to_s.length > 100
179
193
  invalid_properties.push('invalid value for "purchase_intent_id", the character length must be smaller than or equal to 100.')
180
194
  end
@@ -189,6 +203,7 @@ module Zernio
189
203
  return false if @profile_id.nil?
190
204
  number_type_validator = EnumAttributeValidator.new('String', ["local", "mobile", "national", "toll_free"])
191
205
  return false unless number_type_validator.valid?(@number_type)
206
+ return false if !@area_code.nil? && @area_code !~ Regexp.new(/^\d{1,4}$/)
192
207
  return false if !@purchase_intent_id.nil? && @purchase_intent_id.to_s.length > 100
193
208
  true
194
209
  end
@@ -213,6 +228,21 @@ module Zernio
213
228
  @number_type = number_type
214
229
  end
215
230
 
231
+ # Custom attribute writer method with validation
232
+ # @param [Object] area_code Value to be assigned
233
+ def area_code=(area_code)
234
+ if area_code.nil?
235
+ fail ArgumentError, 'area_code cannot be nil'
236
+ end
237
+
238
+ pattern = Regexp.new(/^\d{1,4}$/)
239
+ if area_code !~ pattern
240
+ fail ArgumentError, "invalid value for \"area_code\", must conform to the pattern #{pattern}."
241
+ end
242
+
243
+ @area_code = area_code
244
+ end
245
+
216
246
  # Custom attribute writer method with validation
217
247
  # @param [Object] purchase_intent_id Value to be assigned
218
248
  def purchase_intent_id=(purchase_intent_id)
@@ -235,6 +265,7 @@ module Zernio
235
265
  profile_id == o.profile_id &&
236
266
  country == o.country &&
237
267
  number_type == o.number_type &&
268
+ area_code == o.area_code &&
238
269
  connect_whatsapp == o.connect_whatsapp &&
239
270
  wants_sms == o.wants_sms &&
240
271
  wants_whatsapp == o.wants_whatsapp &&
@@ -251,7 +282,7 @@ module Zernio
251
282
  # Calculates hash code according to all attributes.
252
283
  # @return [Integer] Hash code
253
284
  def hash
254
- [profile_id, country, number_type, connect_whatsapp, wants_sms, wants_whatsapp, purchase_intent_id, allow_multiple].hash
285
+ [profile_id, country, number_type, area_code, connect_whatsapp, wants_sms, wants_whatsapp, purchase_intent_id, allow_multiple].hash
255
286
  end
256
287
 
257
288
  # Builds the object from hash
@@ -34,6 +34,9 @@ module Zernio
34
34
  # Legacy fallback for `reuseOptionId`: the source phone number (GET reusable.options[].fromPhoneNumber). Ambiguous when a number labels two verifications — prefer `reuseOptionId`. Omitted = the approved default. No match = 409.
35
35
  attr_accessor :reuse_from
36
36
 
37
+ # Area code (NDC) the number must be in. Hard constraint: an empty area pool fails with 409 code AREA_CODE_UNAVAILABLE instead of ordering from another area. Omit for any area. Options come from GET /v1/phone-numbers/availability (areaOptions); the purchase 202 kycUrl echoes the areaCode picked at purchase time so it can be passed here.
38
+ attr_accessor :area_code
39
+
37
40
  # End user's legal first name. Required when the country has an action/ID-verification (Onfido) requirement.
38
41
  attr_accessor :end_user_first_name
39
42
 
@@ -58,6 +61,7 @@ module Zernio
58
61
  :'reuse' => :'reuse',
59
62
  :'reuse_option_id' => :'reuseOptionId',
60
63
  :'reuse_from' => :'reuseFrom',
64
+ :'area_code' => :'areaCode',
61
65
  :'end_user_first_name' => :'endUserFirstName',
62
66
  :'end_user_last_name' => :'endUserLastName',
63
67
  :'values' => :'values',
@@ -86,6 +90,7 @@ module Zernio
86
90
  :'reuse' => :'Boolean',
87
91
  :'reuse_option_id' => :'String',
88
92
  :'reuse_from' => :'String',
93
+ :'area_code' => :'String',
89
94
  :'end_user_first_name' => :'String',
90
95
  :'end_user_last_name' => :'String',
91
96
  :'values' => :'Hash<String, String>',
@@ -150,6 +155,10 @@ module Zernio
150
155
  self.reuse_from = attributes[:'reuse_from']
151
156
  end
152
157
 
158
+ if attributes.key?(:'area_code')
159
+ self.area_code = attributes[:'area_code']
160
+ end
161
+
153
162
  if attributes.key?(:'end_user_first_name')
154
163
  self.end_user_first_name = attributes[:'end_user_first_name']
155
164
  end
@@ -196,6 +205,11 @@ module Zernio
196
205
  invalid_properties.push('invalid value for "quantity", must be greater than or equal to 1.')
197
206
  end
198
207
 
208
+ pattern = Regexp.new(/^\d{1,4}$/)
209
+ if !@area_code.nil? && @area_code !~ pattern
210
+ invalid_properties.push("invalid value for \"area_code\", must conform to the pattern #{pattern}.")
211
+ end
212
+
199
213
  invalid_properties
200
214
  end
201
215
 
@@ -207,6 +221,7 @@ module Zernio
207
221
  return false if @country.nil?
208
222
  return false if !@quantity.nil? && @quantity > 5
209
223
  return false if !@quantity.nil? && @quantity < 1
224
+ return false if !@area_code.nil? && @area_code !~ Regexp.new(/^\d{1,4}$/)
210
225
  true
211
226
  end
212
227
 
@@ -248,6 +263,21 @@ module Zernio
248
263
  @quantity = quantity
249
264
  end
250
265
 
266
+ # Custom attribute writer method with validation
267
+ # @param [Object] area_code Value to be assigned
268
+ def area_code=(area_code)
269
+ if area_code.nil?
270
+ fail ArgumentError, 'area_code cannot be nil'
271
+ end
272
+
273
+ pattern = Regexp.new(/^\d{1,4}$/)
274
+ if area_code !~ pattern
275
+ fail ArgumentError, "invalid value for \"area_code\", must conform to the pattern #{pattern}."
276
+ end
277
+
278
+ @area_code = area_code
279
+ end
280
+
251
281
  # Checks equality by comparing each attribute.
252
282
  # @param [Object] Object to be compared
253
283
  def ==(o)
@@ -260,6 +290,7 @@ module Zernio
260
290
  reuse == o.reuse &&
261
291
  reuse_option_id == o.reuse_option_id &&
262
292
  reuse_from == o.reuse_from &&
293
+ area_code == o.area_code &&
263
294
  end_user_first_name == o.end_user_first_name &&
264
295
  end_user_last_name == o.end_user_last_name &&
265
296
  values == o.values &&
@@ -276,7 +307,7 @@ module Zernio
276
307
  # Calculates hash code according to all attributes.
277
308
  # @return [Integer] Hash code
278
309
  def hash
279
- [profile_id, country, submission_id, quantity, reuse, reuse_option_id, reuse_from, end_user_first_name, end_user_last_name, values, documents, address].hash
310
+ [profile_id, country, submission_id, quantity, reuse, reuse_option_id, reuse_from, area_code, end_user_first_name, end_user_last_name, values, documents, address].hash
280
311
  end
281
312
 
282
313
  # Builds the object from hash
@@ -34,6 +34,9 @@ module Zernio
34
34
  # Legacy fallback for `reuseOptionId`: the source phone number (GET reusable.options[].fromPhoneNumber). Ambiguous when a number labels two verifications — prefer `reuseOptionId`. Omitted = the approved default. No match = 409.
35
35
  attr_accessor :reuse_from
36
36
 
37
+ # Area code (NDC) the number must be in. Hard constraint: an empty area pool fails with 409 code AREA_CODE_UNAVAILABLE instead of ordering from another area. Omit for any area. Options come from GET /v1/phone-numbers/availability (areaOptions); the purchase 202 kycUrl echoes the areaCode picked at purchase time so it can be passed here.
38
+ attr_accessor :area_code
39
+
37
40
  # End user's legal first name. Required when the country has an action/ID-verification (Onfido) requirement.
38
41
  attr_accessor :end_user_first_name
39
42
 
@@ -58,6 +61,7 @@ module Zernio
58
61
  :'reuse' => :'reuse',
59
62
  :'reuse_option_id' => :'reuseOptionId',
60
63
  :'reuse_from' => :'reuseFrom',
64
+ :'area_code' => :'areaCode',
61
65
  :'end_user_first_name' => :'endUserFirstName',
62
66
  :'end_user_last_name' => :'endUserLastName',
63
67
  :'values' => :'values',
@@ -86,6 +90,7 @@ module Zernio
86
90
  :'reuse' => :'Boolean',
87
91
  :'reuse_option_id' => :'String',
88
92
  :'reuse_from' => :'String',
93
+ :'area_code' => :'String',
89
94
  :'end_user_first_name' => :'String',
90
95
  :'end_user_last_name' => :'String',
91
96
  :'values' => :'Hash<String, String>',
@@ -150,6 +155,10 @@ module Zernio
150
155
  self.reuse_from = attributes[:'reuse_from']
151
156
  end
152
157
 
158
+ if attributes.key?(:'area_code')
159
+ self.area_code = attributes[:'area_code']
160
+ end
161
+
153
162
  if attributes.key?(:'end_user_first_name')
154
163
  self.end_user_first_name = attributes[:'end_user_first_name']
155
164
  end
@@ -196,6 +205,11 @@ module Zernio
196
205
  invalid_properties.push('invalid value for "quantity", must be greater than or equal to 1.')
197
206
  end
198
207
 
208
+ pattern = Regexp.new(/^\d{1,4}$/)
209
+ if !@area_code.nil? && @area_code !~ pattern
210
+ invalid_properties.push("invalid value for \"area_code\", must conform to the pattern #{pattern}.")
211
+ end
212
+
199
213
  invalid_properties
200
214
  end
201
215
 
@@ -207,6 +221,7 @@ module Zernio
207
221
  return false if @country.nil?
208
222
  return false if !@quantity.nil? && @quantity > 5
209
223
  return false if !@quantity.nil? && @quantity < 1
224
+ return false if !@area_code.nil? && @area_code !~ Regexp.new(/^\d{1,4}$/)
210
225
  true
211
226
  end
212
227
 
@@ -248,6 +263,21 @@ module Zernio
248
263
  @quantity = quantity
249
264
  end
250
265
 
266
+ # Custom attribute writer method with validation
267
+ # @param [Object] area_code Value to be assigned
268
+ def area_code=(area_code)
269
+ if area_code.nil?
270
+ fail ArgumentError, 'area_code cannot be nil'
271
+ end
272
+
273
+ pattern = Regexp.new(/^\d{1,4}$/)
274
+ if area_code !~ pattern
275
+ fail ArgumentError, "invalid value for \"area_code\", must conform to the pattern #{pattern}."
276
+ end
277
+
278
+ @area_code = area_code
279
+ end
280
+
251
281
  # Checks equality by comparing each attribute.
252
282
  # @param [Object] Object to be compared
253
283
  def ==(o)
@@ -260,6 +290,7 @@ module Zernio
260
290
  reuse == o.reuse &&
261
291
  reuse_option_id == o.reuse_option_id &&
262
292
  reuse_from == o.reuse_from &&
293
+ area_code == o.area_code &&
263
294
  end_user_first_name == o.end_user_first_name &&
264
295
  end_user_last_name == o.end_user_last_name &&
265
296
  values == o.values &&
@@ -276,7 +307,7 @@ module Zernio
276
307
  # Calculates hash code according to all attributes.
277
308
  # @return [Integer] Hash code
278
309
  def hash
279
- [profile_id, country, submission_id, quantity, reuse, reuse_option_id, reuse_from, end_user_first_name, end_user_last_name, values, documents, address].hash
310
+ [profile_id, country, submission_id, quantity, reuse, reuse_option_id, reuse_from, area_code, end_user_first_name, end_user_last_name, values, documents, address].hash
280
311
  end
281
312
 
282
313
  # Builds the object from hash
@@ -11,5 +11,5 @@ Generator version: 7.19.0
11
11
  =end
12
12
 
13
13
  module Zernio
14
- VERSION = '0.0.568'
14
+ VERSION = '0.0.570'
15
15
  end
data/lib/zernio-sdk.rb CHANGED
@@ -33,6 +33,7 @@ require 'zernio-sdk/models/ad_creative'
33
33
  require 'zernio-sdk/models/ad_daily_metrics'
34
34
  require 'zernio-sdk/models/ad_metrics'
35
35
  require 'zernio-sdk/models/ad_promoted_object'
36
+ require 'zernio-sdk/models/ad_review_status'
36
37
  require 'zernio-sdk/models/ad_schedule'
37
38
  require 'zernio-sdk/models/ad_status'
38
39
  require 'zernio-sdk/models/ad_tree_ad_set'
@@ -123,6 +124,7 @@ require 'zernio-sdk/models/call_record_transcript_inner'
123
124
  require 'zernio-sdk/models/cancel_broadcast200_response'
124
125
  require 'zernio-sdk/models/cancel_phone_number_port_in200_response'
125
126
  require 'zernio-sdk/models/check_phone_number_availability200_response'
127
+ require 'zernio-sdk/models/check_phone_number_availability200_response_area_options_inner'
126
128
  require 'zernio-sdk/models/check_phone_number_portability200_response'
127
129
  require 'zernio-sdk/models/check_phone_number_portability200_response_results_inner'
128
130
  require 'zernio-sdk/models/check_phone_number_portability_request'