late-sdk 0.0.569 → 0.0.571

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 (43) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -0
  3. data/docs/AdCampaignsApi.md +92 -0
  4. data/docs/CheckPhoneNumberAvailability200Response.md +3 -1
  5. data/docs/CheckPhoneNumberAvailability200ResponseAreaOptionsInner.md +22 -0
  6. data/docs/CreatePhoneNumberKycLinkRequest.md +2 -0
  7. data/docs/ListAdKeywords200Response.md +20 -0
  8. data/docs/ListAdKeywords200ResponseKeywordsInner.md +48 -0
  9. data/docs/PhoneNumbersApi.md +3 -1
  10. data/docs/PurchasePhoneNumberRequest.md +2 -0
  11. data/docs/SubmitPhoneNumberKycRequest.md +2 -0
  12. data/docs/SubmitWhatsAppNumberKycRequest.md +2 -0
  13. data/docs/WhatsAppPhoneNumbersApi.md +3 -1
  14. data/lib/zernio-sdk/api/ad_campaigns_api.rb +114 -0
  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/check_phone_number_availability200_response.rb +16 -4
  18. data/lib/zernio-sdk/models/check_phone_number_availability200_response_area_options_inner.rb +168 -0
  19. data/lib/zernio-sdk/models/create_phone_number_kyc_link_request.rb +32 -1
  20. data/lib/zernio-sdk/models/list_ad_keywords200_response.rb +158 -0
  21. data/lib/zernio-sdk/models/list_ad_keywords200_response_keywords_inner.rb +348 -0
  22. data/lib/zernio-sdk/models/purchase_phone_number409_response.rb +2 -2
  23. data/lib/zernio-sdk/models/purchase_phone_number_request.rb +32 -1
  24. data/lib/zernio-sdk/models/submit_phone_number_kyc_request.rb +32 -1
  25. data/lib/zernio-sdk/models/submit_whats_app_number_kyc_request.rb +32 -1
  26. data/lib/zernio-sdk/version.rb +1 -1
  27. data/lib/zernio-sdk.rb +3 -0
  28. data/openapi.yaml +120 -10
  29. data/spec/api/ad_campaigns_api_spec.rb +22 -0
  30. data/spec/api/phone_numbers_api_spec.rb +1 -0
  31. data/spec/api/whats_app_phone_numbers_api_spec.rb +1 -0
  32. data/spec/models/check_phone_number_availability200_response_area_options_inner_spec.rb +48 -0
  33. data/spec/models/check_phone_number_availability200_response_spec.rb +6 -0
  34. data/spec/models/create_phone_number_kyc_link_request_spec.rb +6 -0
  35. data/spec/models/list_ad_keywords200_response_keywords_inner_spec.rb +138 -0
  36. data/spec/models/list_ad_keywords200_response_spec.rb +42 -0
  37. data/spec/models/purchase_phone_number409_response_spec.rb +1 -1
  38. data/spec/models/purchase_phone_number_request_spec.rb +6 -0
  39. data/spec/models/submit_phone_number_kyc_request_spec.rb +6 -0
  40. data/spec/models/submit_whats_app_number_kyc_request_spec.rb +6 -0
  41. data/zernio-sdk-0.0.571.gem +0 -0
  42. metadata +15 -3
  43. data/zernio-sdk-0.0.569.gem +0 -0
@@ -0,0 +1,348 @@
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 ListAdKeywords200ResponseKeywordsInner < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ # Social account ID owning the sync
21
+ attr_accessor :account_id
22
+
23
+ attr_accessor :profile_id
24
+
25
+ attr_accessor :platform
26
+
27
+ # Google customer ID
28
+ attr_accessor :ad_account_id
29
+
30
+ attr_accessor :campaign_id
31
+
32
+ attr_accessor :campaign_name
33
+
34
+ attr_accessor :campaign_status
35
+
36
+ # Google ad group ID
37
+ attr_accessor :ad_set_id
38
+
39
+ attr_accessor :ad_set_name
40
+
41
+ attr_accessor :ad_set_status
42
+
43
+ attr_accessor :keyword
44
+
45
+ attr_accessor :match_type
46
+
47
+ attr_accessor :status
48
+
49
+ attr_accessor :negative
50
+
51
+ attr_accessor :synced_at
52
+
53
+ class EnumAttributeValidator
54
+ attr_reader :datatype
55
+ attr_reader :allowable_values
56
+
57
+ def initialize(datatype, allowable_values)
58
+ @allowable_values = allowable_values.map do |value|
59
+ case datatype.to_s
60
+ when /Integer/i
61
+ value.to_i
62
+ when /Float/i
63
+ value.to_f
64
+ else
65
+ value
66
+ end
67
+ end
68
+ end
69
+
70
+ def valid?(value)
71
+ !value || allowable_values.include?(value)
72
+ end
73
+ end
74
+
75
+ # Attribute mapping from ruby-style variable name to JSON key.
76
+ def self.attribute_map
77
+ {
78
+ :'id' => :'id',
79
+ :'account_id' => :'accountId',
80
+ :'profile_id' => :'profileId',
81
+ :'platform' => :'platform',
82
+ :'ad_account_id' => :'adAccountId',
83
+ :'campaign_id' => :'campaignId',
84
+ :'campaign_name' => :'campaignName',
85
+ :'campaign_status' => :'campaignStatus',
86
+ :'ad_set_id' => :'adSetId',
87
+ :'ad_set_name' => :'adSetName',
88
+ :'ad_set_status' => :'adSetStatus',
89
+ :'keyword' => :'keyword',
90
+ :'match_type' => :'matchType',
91
+ :'status' => :'status',
92
+ :'negative' => :'negative',
93
+ :'synced_at' => :'syncedAt'
94
+ }
95
+ end
96
+
97
+ # Returns attribute mapping this model knows about
98
+ def self.acceptable_attribute_map
99
+ attribute_map
100
+ end
101
+
102
+ # Returns all the JSON keys this model knows about
103
+ def self.acceptable_attributes
104
+ acceptable_attribute_map.values
105
+ end
106
+
107
+ # Attribute type mapping.
108
+ def self.openapi_types
109
+ {
110
+ :'id' => :'String',
111
+ :'account_id' => :'String',
112
+ :'profile_id' => :'String',
113
+ :'platform' => :'String',
114
+ :'ad_account_id' => :'String',
115
+ :'campaign_id' => :'String',
116
+ :'campaign_name' => :'String',
117
+ :'campaign_status' => :'String',
118
+ :'ad_set_id' => :'String',
119
+ :'ad_set_name' => :'String',
120
+ :'ad_set_status' => :'String',
121
+ :'keyword' => :'String',
122
+ :'match_type' => :'String',
123
+ :'status' => :'String',
124
+ :'negative' => :'Boolean',
125
+ :'synced_at' => :'Time'
126
+ }
127
+ end
128
+
129
+ # List of attributes with nullable: true
130
+ def self.openapi_nullable
131
+ Set.new([
132
+ :'campaign_name',
133
+ :'campaign_status',
134
+ :'ad_set_name',
135
+ :'ad_set_status',
136
+ :'synced_at'
137
+ ])
138
+ end
139
+
140
+ # Initializes the object
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ def initialize(attributes = {})
143
+ if (!attributes.is_a?(Hash))
144
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::ListAdKeywords200ResponseKeywordsInner` initialize method"
145
+ end
146
+
147
+ # check to see if the attribute exists and convert string to symbol for hash key
148
+ acceptable_attribute_map = self.class.acceptable_attribute_map
149
+ attributes = attributes.each_with_object({}) { |(k, v), h|
150
+ if (!acceptable_attribute_map.key?(k.to_sym))
151
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::ListAdKeywords200ResponseKeywordsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
152
+ end
153
+ h[k.to_sym] = v
154
+ }
155
+
156
+ if attributes.key?(:'id')
157
+ self.id = attributes[:'id']
158
+ end
159
+
160
+ if attributes.key?(:'account_id')
161
+ self.account_id = attributes[:'account_id']
162
+ end
163
+
164
+ if attributes.key?(:'profile_id')
165
+ self.profile_id = attributes[:'profile_id']
166
+ end
167
+
168
+ if attributes.key?(:'platform')
169
+ self.platform = attributes[:'platform']
170
+ end
171
+
172
+ if attributes.key?(:'ad_account_id')
173
+ self.ad_account_id = attributes[:'ad_account_id']
174
+ end
175
+
176
+ if attributes.key?(:'campaign_id')
177
+ self.campaign_id = attributes[:'campaign_id']
178
+ end
179
+
180
+ if attributes.key?(:'campaign_name')
181
+ self.campaign_name = attributes[:'campaign_name']
182
+ end
183
+
184
+ if attributes.key?(:'campaign_status')
185
+ self.campaign_status = attributes[:'campaign_status']
186
+ end
187
+
188
+ if attributes.key?(:'ad_set_id')
189
+ self.ad_set_id = attributes[:'ad_set_id']
190
+ end
191
+
192
+ if attributes.key?(:'ad_set_name')
193
+ self.ad_set_name = attributes[:'ad_set_name']
194
+ end
195
+
196
+ if attributes.key?(:'ad_set_status')
197
+ self.ad_set_status = attributes[:'ad_set_status']
198
+ end
199
+
200
+ if attributes.key?(:'keyword')
201
+ self.keyword = attributes[:'keyword']
202
+ end
203
+
204
+ if attributes.key?(:'match_type')
205
+ self.match_type = attributes[:'match_type']
206
+ end
207
+
208
+ if attributes.key?(:'status')
209
+ self.status = attributes[:'status']
210
+ end
211
+
212
+ if attributes.key?(:'negative')
213
+ self.negative = attributes[:'negative']
214
+ end
215
+
216
+ if attributes.key?(:'synced_at')
217
+ self.synced_at = attributes[:'synced_at']
218
+ end
219
+ end
220
+
221
+ # Show invalid properties with the reasons. Usually used together with valid?
222
+ # @return Array for valid properties with the reasons
223
+ def list_invalid_properties
224
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
225
+ invalid_properties = Array.new
226
+ invalid_properties
227
+ end
228
+
229
+ # Check to see if the all the properties in the model are valid
230
+ # @return true if the model is valid
231
+ def valid?
232
+ warn '[DEPRECATED] the `valid?` method is obsolete'
233
+ platform_validator = EnumAttributeValidator.new('String', ["google"])
234
+ return false unless platform_validator.valid?(@platform)
235
+ match_type_validator = EnumAttributeValidator.new('String', ["exact", "phrase", "broad", "unknown"])
236
+ return false unless match_type_validator.valid?(@match_type)
237
+ status_validator = EnumAttributeValidator.new('String', ["active", "paused"])
238
+ return false unless status_validator.valid?(@status)
239
+ true
240
+ end
241
+
242
+ # Custom attribute writer method checking allowed values (enum).
243
+ # @param [Object] platform Object to be assigned
244
+ def platform=(platform)
245
+ validator = EnumAttributeValidator.new('String', ["google"])
246
+ unless validator.valid?(platform)
247
+ fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
248
+ end
249
+ @platform = platform
250
+ end
251
+
252
+ # Custom attribute writer method checking allowed values (enum).
253
+ # @param [Object] match_type Object to be assigned
254
+ def match_type=(match_type)
255
+ validator = EnumAttributeValidator.new('String', ["exact", "phrase", "broad", "unknown"])
256
+ unless validator.valid?(match_type)
257
+ fail ArgumentError, "invalid value for \"match_type\", must be one of #{validator.allowable_values}."
258
+ end
259
+ @match_type = match_type
260
+ end
261
+
262
+ # Custom attribute writer method checking allowed values (enum).
263
+ # @param [Object] status Object to be assigned
264
+ def status=(status)
265
+ validator = EnumAttributeValidator.new('String', ["active", "paused"])
266
+ unless validator.valid?(status)
267
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
268
+ end
269
+ @status = status
270
+ end
271
+
272
+ # Checks equality by comparing each attribute.
273
+ # @param [Object] Object to be compared
274
+ def ==(o)
275
+ return true if self.equal?(o)
276
+ self.class == o.class &&
277
+ id == o.id &&
278
+ account_id == o.account_id &&
279
+ profile_id == o.profile_id &&
280
+ platform == o.platform &&
281
+ ad_account_id == o.ad_account_id &&
282
+ campaign_id == o.campaign_id &&
283
+ campaign_name == o.campaign_name &&
284
+ campaign_status == o.campaign_status &&
285
+ ad_set_id == o.ad_set_id &&
286
+ ad_set_name == o.ad_set_name &&
287
+ ad_set_status == o.ad_set_status &&
288
+ keyword == o.keyword &&
289
+ match_type == o.match_type &&
290
+ status == o.status &&
291
+ negative == o.negative &&
292
+ synced_at == o.synced_at
293
+ end
294
+
295
+ # @see the `==` method
296
+ # @param [Object] Object to be compared
297
+ def eql?(o)
298
+ self == o
299
+ end
300
+
301
+ # Calculates hash code according to all attributes.
302
+ # @return [Integer] Hash code
303
+ def hash
304
+ [id, account_id, profile_id, platform, ad_account_id, campaign_id, campaign_name, campaign_status, ad_set_id, ad_set_name, ad_set_status, keyword, match_type, status, negative, synced_at].hash
305
+ end
306
+
307
+ # Builds the object from hash
308
+ # @param [Hash] attributes Model attributes in the form of hash
309
+ # @return [Object] Returns the model itself
310
+ def self.build_from_hash(attributes)
311
+ return nil unless attributes.is_a?(Hash)
312
+ attributes = attributes.transform_keys(&:to_sym)
313
+ transformed_hash = {}
314
+ openapi_types.each_pair do |key, type|
315
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
316
+ transformed_hash["#{key}"] = nil
317
+ elsif type =~ /\AArray<(.*)>/i
318
+ # check to ensure the input is an array given that the attribute
319
+ # is documented as an array but the input is not
320
+ if attributes[attribute_map[key]].is_a?(Array)
321
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
322
+ end
323
+ elsif !attributes[attribute_map[key]].nil?
324
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
325
+ end
326
+ end
327
+ new(transformed_hash)
328
+ end
329
+
330
+ # Returns the object in the form of hash
331
+ # @return [Hash] Returns the object in the form of hash
332
+ def to_hash
333
+ hash = {}
334
+ self.class.attribute_map.each_pair do |attr, param|
335
+ value = self.send(attr)
336
+ if value.nil?
337
+ is_nullable = self.class.openapi_nullable.include?(attr)
338
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
339
+ end
340
+
341
+ hash[param] = _to_hash(value)
342
+ end
343
+ hash
344
+ end
345
+
346
+ end
347
+
348
+ end
@@ -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.569'
14
+ VERSION = '0.0.571'
15
15
  end
data/lib/zernio-sdk.rb CHANGED
@@ -124,6 +124,7 @@ require 'zernio-sdk/models/call_record_transcript_inner'
124
124
  require 'zernio-sdk/models/cancel_broadcast200_response'
125
125
  require 'zernio-sdk/models/cancel_phone_number_port_in200_response'
126
126
  require 'zernio-sdk/models/check_phone_number_availability200_response'
127
+ require 'zernio-sdk/models/check_phone_number_availability200_response_area_options_inner'
127
128
  require 'zernio-sdk/models/check_phone_number_portability200_response'
128
129
  require 'zernio-sdk/models/check_phone_number_portability200_response_results_inner'
129
130
  require 'zernio-sdk/models/check_phone_number_portability_request'
@@ -794,6 +795,8 @@ require 'zernio-sdk/models/list_ad_catalogs200_response'
794
795
  require 'zernio-sdk/models/list_ad_catalogs200_response_catalogs_inner'
795
796
  require 'zernio-sdk/models/list_ad_creatives200_response'
796
797
  require 'zernio-sdk/models/list_ad_images200_response'
798
+ require 'zernio-sdk/models/list_ad_keywords200_response'
799
+ require 'zernio-sdk/models/list_ad_keywords200_response_keywords_inner'
797
800
  require 'zernio-sdk/models/list_ad_labels200_response'
798
801
  require 'zernio-sdk/models/list_ad_studies200_response'
799
802
  require 'zernio-sdk/models/list_ads200_response'