late-sdk 0.0.903 → 0.0.905
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.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/docs/AdAccountsApi.md +70 -0
- data/docs/CheckPhoneNumberAvailability200Response.md +2 -0
- data/docs/CreateAdAccount201Response.md +30 -0
- data/docs/CreateAdAccountRequest.md +46 -0
- data/docs/ListPhoneNumberCountries200ResponseCountriesInner.md +2 -0
- data/docs/ListPhoneNumberCountries200ResponseCountriesInnerTypesInner.md +6 -2
- data/docs/PhoneNumbersApi.md +1 -1
- data/docs/SubmitPhoneNumberKyc200Response.md +2 -0
- data/lib/zernio-sdk/api/ad_accounts_api.rb +68 -0
- data/lib/zernio-sdk/api/phone_numbers_api.rb +2 -2
- data/lib/zernio-sdk/models/check_phone_number_availability200_response.rb +11 -1
- data/lib/zernio-sdk/models/create_ad_account201_response.rb +340 -0
- data/lib/zernio-sdk/models/create_ad_account_request.rb +611 -0
- data/lib/zernio-sdk/models/list_phone_number_countries200_response_countries_inner.rb +11 -1
- data/lib/zernio-sdk/models/list_phone_number_countries200_response_countries_inner_types_inner.rb +38 -4
- data/lib/zernio-sdk/models/submit_phone_number_kyc200_response.rb +11 -1
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +2 -0
- data/openapi.yaml +132 -4
- data/spec/api/ad_accounts_api_spec.rb +12 -0
- data/spec/api/phone_numbers_api_spec.rb +1 -1
- data/spec/models/check_phone_number_availability200_response_spec.rb +6 -0
- data/spec/models/create_ad_account201_response_spec.rb +72 -0
- data/spec/models/create_ad_account_request_spec.rb +120 -0
- data/spec/models/list_phone_number_countries200_response_countries_inner_spec.rb +6 -0
- data/spec/models/list_phone_number_countries200_response_countries_inner_types_inner_spec.rb +16 -0
- data/spec/models/submit_phone_number_kyc200_response_spec.rb +6 -0
- data/zernio-sdk-0.0.905.gem +0 -0
- metadata +10 -2
- data/zernio-sdk-0.0.903.gem +0 -0
|
@@ -0,0 +1,611 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
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 CreateAdAccountRequest < ApiModelBase
|
|
18
|
+
# Zernio metaads SocialAccount ID.
|
|
19
|
+
attr_accessor :account_id
|
|
20
|
+
|
|
21
|
+
# Business portfolio that will own the account.
|
|
22
|
+
attr_accessor :business_id
|
|
23
|
+
|
|
24
|
+
# Ad account name. Whitespace is trimmed.
|
|
25
|
+
attr_accessor :name
|
|
26
|
+
|
|
27
|
+
# Uppercase ISO 4217 currency supported by Meta.
|
|
28
|
+
attr_accessor :currency
|
|
29
|
+
|
|
30
|
+
# Numeric Meta timezone ID from the linked timezone list. For example 1 is America/Los_Angeles.
|
|
31
|
+
attr_accessor :timezone_id
|
|
32
|
+
|
|
33
|
+
# End advertiser business or page ID. NONE uses the owning business.
|
|
34
|
+
attr_accessor :end_advertiser
|
|
35
|
+
|
|
36
|
+
# Media agency business or page ID. NONE for self-serve customers.
|
|
37
|
+
attr_accessor :media_agency
|
|
38
|
+
|
|
39
|
+
# Partner business or page ID. NONE for self-serve customers.
|
|
40
|
+
attr_accessor :partner
|
|
41
|
+
|
|
42
|
+
# Request Meta invoicing. Eligibility is determined by Meta.
|
|
43
|
+
attr_accessor :invoice
|
|
44
|
+
|
|
45
|
+
# Existing Meta invoice group ID.
|
|
46
|
+
attr_accessor :invoice_group_id
|
|
47
|
+
|
|
48
|
+
# Addresses for Meta invoices.
|
|
49
|
+
attr_accessor :invoicing_emails
|
|
50
|
+
|
|
51
|
+
# Meta insertion-order invoicing option.
|
|
52
|
+
attr_accessor :io
|
|
53
|
+
|
|
54
|
+
# Purchase order number.
|
|
55
|
+
attr_accessor :po_number
|
|
56
|
+
|
|
57
|
+
# Existing Meta funding reference. Does not add a payment method.
|
|
58
|
+
attr_accessor :funding_id
|
|
59
|
+
|
|
60
|
+
# Meta Business Manager creation flag.
|
|
61
|
+
attr_accessor :ad_account_created_from_bm_flag
|
|
62
|
+
|
|
63
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
64
|
+
def self.attribute_map
|
|
65
|
+
{
|
|
66
|
+
:'account_id' => :'accountId',
|
|
67
|
+
:'business_id' => :'businessId',
|
|
68
|
+
:'name' => :'name',
|
|
69
|
+
:'currency' => :'currency',
|
|
70
|
+
:'timezone_id' => :'timezoneId',
|
|
71
|
+
:'end_advertiser' => :'endAdvertiser',
|
|
72
|
+
:'media_agency' => :'mediaAgency',
|
|
73
|
+
:'partner' => :'partner',
|
|
74
|
+
:'invoice' => :'invoice',
|
|
75
|
+
:'invoice_group_id' => :'invoiceGroupId',
|
|
76
|
+
:'invoicing_emails' => :'invoicingEmails',
|
|
77
|
+
:'io' => :'io',
|
|
78
|
+
:'po_number' => :'poNumber',
|
|
79
|
+
:'funding_id' => :'fundingId',
|
|
80
|
+
:'ad_account_created_from_bm_flag' => :'adAccountCreatedFromBmFlag'
|
|
81
|
+
}
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Returns attribute mapping this model knows about
|
|
85
|
+
def self.acceptable_attribute_map
|
|
86
|
+
attribute_map
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Returns all the JSON keys this model knows about
|
|
90
|
+
def self.acceptable_attributes
|
|
91
|
+
acceptable_attribute_map.values
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Attribute type mapping.
|
|
95
|
+
def self.openapi_types
|
|
96
|
+
{
|
|
97
|
+
:'account_id' => :'String',
|
|
98
|
+
:'business_id' => :'String',
|
|
99
|
+
:'name' => :'String',
|
|
100
|
+
:'currency' => :'String',
|
|
101
|
+
:'timezone_id' => :'Integer',
|
|
102
|
+
:'end_advertiser' => :'String',
|
|
103
|
+
:'media_agency' => :'String',
|
|
104
|
+
:'partner' => :'String',
|
|
105
|
+
:'invoice' => :'Boolean',
|
|
106
|
+
:'invoice_group_id' => :'String',
|
|
107
|
+
:'invoicing_emails' => :'Array<String>',
|
|
108
|
+
:'io' => :'Boolean',
|
|
109
|
+
:'po_number' => :'String',
|
|
110
|
+
:'funding_id' => :'String',
|
|
111
|
+
:'ad_account_created_from_bm_flag' => :'Boolean'
|
|
112
|
+
}
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# List of attributes with nullable: true
|
|
116
|
+
def self.openapi_nullable
|
|
117
|
+
Set.new([
|
|
118
|
+
])
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Initializes the object
|
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
123
|
+
def initialize(attributes = {})
|
|
124
|
+
if (!attributes.is_a?(Hash))
|
|
125
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateAdAccountRequest` initialize method"
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
129
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
130
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
131
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
132
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreateAdAccountRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
133
|
+
end
|
|
134
|
+
h[k.to_sym] = v
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if attributes.key?(:'account_id')
|
|
138
|
+
self.account_id = attributes[:'account_id']
|
|
139
|
+
else
|
|
140
|
+
self.account_id = nil
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if attributes.key?(:'business_id')
|
|
144
|
+
self.business_id = attributes[:'business_id']
|
|
145
|
+
else
|
|
146
|
+
self.business_id = nil
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if attributes.key?(:'name')
|
|
150
|
+
self.name = attributes[:'name']
|
|
151
|
+
else
|
|
152
|
+
self.name = nil
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if attributes.key?(:'currency')
|
|
156
|
+
self.currency = attributes[:'currency']
|
|
157
|
+
else
|
|
158
|
+
self.currency = nil
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
if attributes.key?(:'timezone_id')
|
|
162
|
+
self.timezone_id = attributes[:'timezone_id']
|
|
163
|
+
else
|
|
164
|
+
self.timezone_id = nil
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
if attributes.key?(:'end_advertiser')
|
|
168
|
+
self.end_advertiser = attributes[:'end_advertiser']
|
|
169
|
+
else
|
|
170
|
+
self.end_advertiser = 'NONE'
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if attributes.key?(:'media_agency')
|
|
174
|
+
self.media_agency = attributes[:'media_agency']
|
|
175
|
+
else
|
|
176
|
+
self.media_agency = 'NONE'
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
if attributes.key?(:'partner')
|
|
180
|
+
self.partner = attributes[:'partner']
|
|
181
|
+
else
|
|
182
|
+
self.partner = 'NONE'
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
if attributes.key?(:'invoice')
|
|
186
|
+
self.invoice = attributes[:'invoice']
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
if attributes.key?(:'invoice_group_id')
|
|
190
|
+
self.invoice_group_id = attributes[:'invoice_group_id']
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
if attributes.key?(:'invoicing_emails')
|
|
194
|
+
if (value = attributes[:'invoicing_emails']).is_a?(Array)
|
|
195
|
+
self.invoicing_emails = value
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
if attributes.key?(:'io')
|
|
200
|
+
self.io = attributes[:'io']
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
if attributes.key?(:'po_number')
|
|
204
|
+
self.po_number = attributes[:'po_number']
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
if attributes.key?(:'funding_id')
|
|
208
|
+
self.funding_id = attributes[:'funding_id']
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
if attributes.key?(:'ad_account_created_from_bm_flag')
|
|
212
|
+
self.ad_account_created_from_bm_flag = attributes[:'ad_account_created_from_bm_flag']
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
217
|
+
# @return Array for valid properties with the reasons
|
|
218
|
+
def list_invalid_properties
|
|
219
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
220
|
+
invalid_properties = Array.new
|
|
221
|
+
if @account_id.nil?
|
|
222
|
+
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
pattern = Regexp.new(/^[a-fA-F0-9]{24}$/)
|
|
226
|
+
if @account_id !~ pattern
|
|
227
|
+
invalid_properties.push("invalid value for \"account_id\", must conform to the pattern #{pattern}.")
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
if @business_id.nil?
|
|
231
|
+
invalid_properties.push('invalid value for "business_id", business_id cannot be nil.')
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
pattern = Regexp.new(/^[1-9][0-9]*$/)
|
|
235
|
+
if @business_id !~ pattern
|
|
236
|
+
invalid_properties.push("invalid value for \"business_id\", must conform to the pattern #{pattern}.")
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
if @name.nil?
|
|
240
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
if @name.to_s.length > 255
|
|
244
|
+
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
if @name.to_s.length < 1
|
|
248
|
+
invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
if @currency.nil?
|
|
252
|
+
invalid_properties.push('invalid value for "currency", currency cannot be nil.')
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
pattern = Regexp.new(/^[A-Z]{3}$/)
|
|
256
|
+
if @currency !~ pattern
|
|
257
|
+
invalid_properties.push("invalid value for \"currency\", must conform to the pattern #{pattern}.")
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
if @timezone_id.nil?
|
|
261
|
+
invalid_properties.push('invalid value for "timezone_id", timezone_id cannot be nil.')
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
if @timezone_id > 4294967295
|
|
265
|
+
invalid_properties.push('invalid value for "timezone_id", must be smaller than or equal to 4294967295.')
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
if @timezone_id < 0
|
|
269
|
+
invalid_properties.push('invalid value for "timezone_id", must be greater than or equal to 0.')
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
pattern = Regexp.new(/^(NONE|[1-9][0-9]*)$/)
|
|
273
|
+
if !@end_advertiser.nil? && @end_advertiser !~ pattern
|
|
274
|
+
invalid_properties.push("invalid value for \"end_advertiser\", must conform to the pattern #{pattern}.")
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
pattern = Regexp.new(/^(NONE|[1-9][0-9]*)$/)
|
|
278
|
+
if !@media_agency.nil? && @media_agency !~ pattern
|
|
279
|
+
invalid_properties.push("invalid value for \"media_agency\", must conform to the pattern #{pattern}.")
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
pattern = Regexp.new(/^(NONE|[1-9][0-9]*)$/)
|
|
283
|
+
if !@partner.nil? && @partner !~ pattern
|
|
284
|
+
invalid_properties.push("invalid value for \"partner\", must conform to the pattern #{pattern}.")
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
pattern = Regexp.new(/^[1-9][0-9]*$/)
|
|
288
|
+
if !@invoice_group_id.nil? && @invoice_group_id !~ pattern
|
|
289
|
+
invalid_properties.push("invalid value for \"invoice_group_id\", must conform to the pattern #{pattern}.")
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
if !@invoicing_emails.nil? && @invoicing_emails.length > 100
|
|
293
|
+
invalid_properties.push('invalid value for "invoicing_emails", number of items must be less than or equal to 100.')
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
if !@invoicing_emails.nil? && @invoicing_emails.length < 1
|
|
297
|
+
invalid_properties.push('invalid value for "invoicing_emails", number of items must be greater than or equal to 1.')
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
if !@po_number.nil? && @po_number.to_s.length > 255
|
|
301
|
+
invalid_properties.push('invalid value for "po_number", the character length must be smaller than or equal to 255.')
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
if !@po_number.nil? && @po_number.to_s.length < 1
|
|
305
|
+
invalid_properties.push('invalid value for "po_number", the character length must be greater than or equal to 1.')
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
pattern = Regexp.new(/^[1-9][0-9]*$/)
|
|
309
|
+
if !@funding_id.nil? && @funding_id !~ pattern
|
|
310
|
+
invalid_properties.push("invalid value for \"funding_id\", must conform to the pattern #{pattern}.")
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
invalid_properties
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
# Check to see if the all the properties in the model are valid
|
|
317
|
+
# @return true if the model is valid
|
|
318
|
+
def valid?
|
|
319
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
320
|
+
return false if @account_id.nil?
|
|
321
|
+
return false if @account_id !~ Regexp.new(/^[a-fA-F0-9]{24}$/)
|
|
322
|
+
return false if @business_id.nil?
|
|
323
|
+
return false if @business_id !~ Regexp.new(/^[1-9][0-9]*$/)
|
|
324
|
+
return false if @name.nil?
|
|
325
|
+
return false if @name.to_s.length > 255
|
|
326
|
+
return false if @name.to_s.length < 1
|
|
327
|
+
return false if @currency.nil?
|
|
328
|
+
return false if @currency !~ Regexp.new(/^[A-Z]{3}$/)
|
|
329
|
+
return false if @timezone_id.nil?
|
|
330
|
+
return false if @timezone_id > 4294967295
|
|
331
|
+
return false if @timezone_id < 0
|
|
332
|
+
return false if !@end_advertiser.nil? && @end_advertiser !~ Regexp.new(/^(NONE|[1-9][0-9]*)$/)
|
|
333
|
+
return false if !@media_agency.nil? && @media_agency !~ Regexp.new(/^(NONE|[1-9][0-9]*)$/)
|
|
334
|
+
return false if !@partner.nil? && @partner !~ Regexp.new(/^(NONE|[1-9][0-9]*)$/)
|
|
335
|
+
return false if !@invoice_group_id.nil? && @invoice_group_id !~ Regexp.new(/^[1-9][0-9]*$/)
|
|
336
|
+
return false if !@invoicing_emails.nil? && @invoicing_emails.length > 100
|
|
337
|
+
return false if !@invoicing_emails.nil? && @invoicing_emails.length < 1
|
|
338
|
+
return false if !@po_number.nil? && @po_number.to_s.length > 255
|
|
339
|
+
return false if !@po_number.nil? && @po_number.to_s.length < 1
|
|
340
|
+
return false if !@funding_id.nil? && @funding_id !~ Regexp.new(/^[1-9][0-9]*$/)
|
|
341
|
+
true
|
|
342
|
+
end
|
|
343
|
+
|
|
344
|
+
# Custom attribute writer method with validation
|
|
345
|
+
# @param [Object] account_id Value to be assigned
|
|
346
|
+
def account_id=(account_id)
|
|
347
|
+
if account_id.nil?
|
|
348
|
+
fail ArgumentError, 'account_id cannot be nil'
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
pattern = Regexp.new(/^[a-fA-F0-9]{24}$/)
|
|
352
|
+
if account_id !~ pattern
|
|
353
|
+
fail ArgumentError, "invalid value for \"account_id\", must conform to the pattern #{pattern}."
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
@account_id = account_id
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
# Custom attribute writer method with validation
|
|
360
|
+
# @param [Object] business_id Value to be assigned
|
|
361
|
+
def business_id=(business_id)
|
|
362
|
+
if business_id.nil?
|
|
363
|
+
fail ArgumentError, 'business_id cannot be nil'
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
pattern = Regexp.new(/^[1-9][0-9]*$/)
|
|
367
|
+
if business_id !~ pattern
|
|
368
|
+
fail ArgumentError, "invalid value for \"business_id\", must conform to the pattern #{pattern}."
|
|
369
|
+
end
|
|
370
|
+
|
|
371
|
+
@business_id = business_id
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
# Custom attribute writer method with validation
|
|
375
|
+
# @param [Object] name Value to be assigned
|
|
376
|
+
def name=(name)
|
|
377
|
+
if name.nil?
|
|
378
|
+
fail ArgumentError, 'name cannot be nil'
|
|
379
|
+
end
|
|
380
|
+
|
|
381
|
+
if name.to_s.length > 255
|
|
382
|
+
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
if name.to_s.length < 1
|
|
386
|
+
fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
|
|
387
|
+
end
|
|
388
|
+
|
|
389
|
+
@name = name
|
|
390
|
+
end
|
|
391
|
+
|
|
392
|
+
# Custom attribute writer method with validation
|
|
393
|
+
# @param [Object] currency Value to be assigned
|
|
394
|
+
def currency=(currency)
|
|
395
|
+
if currency.nil?
|
|
396
|
+
fail ArgumentError, 'currency cannot be nil'
|
|
397
|
+
end
|
|
398
|
+
|
|
399
|
+
pattern = Regexp.new(/^[A-Z]{3}$/)
|
|
400
|
+
if currency !~ pattern
|
|
401
|
+
fail ArgumentError, "invalid value for \"currency\", must conform to the pattern #{pattern}."
|
|
402
|
+
end
|
|
403
|
+
|
|
404
|
+
@currency = currency
|
|
405
|
+
end
|
|
406
|
+
|
|
407
|
+
# Custom attribute writer method with validation
|
|
408
|
+
# @param [Object] timezone_id Value to be assigned
|
|
409
|
+
def timezone_id=(timezone_id)
|
|
410
|
+
if timezone_id.nil?
|
|
411
|
+
fail ArgumentError, 'timezone_id cannot be nil'
|
|
412
|
+
end
|
|
413
|
+
|
|
414
|
+
if timezone_id > 4294967295
|
|
415
|
+
fail ArgumentError, 'invalid value for "timezone_id", must be smaller than or equal to 4294967295.'
|
|
416
|
+
end
|
|
417
|
+
|
|
418
|
+
if timezone_id < 0
|
|
419
|
+
fail ArgumentError, 'invalid value for "timezone_id", must be greater than or equal to 0.'
|
|
420
|
+
end
|
|
421
|
+
|
|
422
|
+
@timezone_id = timezone_id
|
|
423
|
+
end
|
|
424
|
+
|
|
425
|
+
# Custom attribute writer method with validation
|
|
426
|
+
# @param [Object] end_advertiser Value to be assigned
|
|
427
|
+
def end_advertiser=(end_advertiser)
|
|
428
|
+
if end_advertiser.nil?
|
|
429
|
+
fail ArgumentError, 'end_advertiser cannot be nil'
|
|
430
|
+
end
|
|
431
|
+
|
|
432
|
+
pattern = Regexp.new(/^(NONE|[1-9][0-9]*)$/)
|
|
433
|
+
if end_advertiser !~ pattern
|
|
434
|
+
fail ArgumentError, "invalid value for \"end_advertiser\", must conform to the pattern #{pattern}."
|
|
435
|
+
end
|
|
436
|
+
|
|
437
|
+
@end_advertiser = end_advertiser
|
|
438
|
+
end
|
|
439
|
+
|
|
440
|
+
# Custom attribute writer method with validation
|
|
441
|
+
# @param [Object] media_agency Value to be assigned
|
|
442
|
+
def media_agency=(media_agency)
|
|
443
|
+
if media_agency.nil?
|
|
444
|
+
fail ArgumentError, 'media_agency cannot be nil'
|
|
445
|
+
end
|
|
446
|
+
|
|
447
|
+
pattern = Regexp.new(/^(NONE|[1-9][0-9]*)$/)
|
|
448
|
+
if media_agency !~ pattern
|
|
449
|
+
fail ArgumentError, "invalid value for \"media_agency\", must conform to the pattern #{pattern}."
|
|
450
|
+
end
|
|
451
|
+
|
|
452
|
+
@media_agency = media_agency
|
|
453
|
+
end
|
|
454
|
+
|
|
455
|
+
# Custom attribute writer method with validation
|
|
456
|
+
# @param [Object] partner Value to be assigned
|
|
457
|
+
def partner=(partner)
|
|
458
|
+
if partner.nil?
|
|
459
|
+
fail ArgumentError, 'partner cannot be nil'
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
pattern = Regexp.new(/^(NONE|[1-9][0-9]*)$/)
|
|
463
|
+
if partner !~ pattern
|
|
464
|
+
fail ArgumentError, "invalid value for \"partner\", must conform to the pattern #{pattern}."
|
|
465
|
+
end
|
|
466
|
+
|
|
467
|
+
@partner = partner
|
|
468
|
+
end
|
|
469
|
+
|
|
470
|
+
# Custom attribute writer method with validation
|
|
471
|
+
# @param [Object] invoice_group_id Value to be assigned
|
|
472
|
+
def invoice_group_id=(invoice_group_id)
|
|
473
|
+
if invoice_group_id.nil?
|
|
474
|
+
fail ArgumentError, 'invoice_group_id cannot be nil'
|
|
475
|
+
end
|
|
476
|
+
|
|
477
|
+
pattern = Regexp.new(/^[1-9][0-9]*$/)
|
|
478
|
+
if invoice_group_id !~ pattern
|
|
479
|
+
fail ArgumentError, "invalid value for \"invoice_group_id\", must conform to the pattern #{pattern}."
|
|
480
|
+
end
|
|
481
|
+
|
|
482
|
+
@invoice_group_id = invoice_group_id
|
|
483
|
+
end
|
|
484
|
+
|
|
485
|
+
# Custom attribute writer method with validation
|
|
486
|
+
# @param [Object] invoicing_emails Value to be assigned
|
|
487
|
+
def invoicing_emails=(invoicing_emails)
|
|
488
|
+
if invoicing_emails.nil?
|
|
489
|
+
fail ArgumentError, 'invoicing_emails cannot be nil'
|
|
490
|
+
end
|
|
491
|
+
|
|
492
|
+
if invoicing_emails.length > 100
|
|
493
|
+
fail ArgumentError, 'invalid value for "invoicing_emails", number of items must be less than or equal to 100.'
|
|
494
|
+
end
|
|
495
|
+
|
|
496
|
+
if invoicing_emails.length < 1
|
|
497
|
+
fail ArgumentError, 'invalid value for "invoicing_emails", number of items must be greater than or equal to 1.'
|
|
498
|
+
end
|
|
499
|
+
|
|
500
|
+
@invoicing_emails = invoicing_emails
|
|
501
|
+
end
|
|
502
|
+
|
|
503
|
+
# Custom attribute writer method with validation
|
|
504
|
+
# @param [Object] po_number Value to be assigned
|
|
505
|
+
def po_number=(po_number)
|
|
506
|
+
if po_number.nil?
|
|
507
|
+
fail ArgumentError, 'po_number cannot be nil'
|
|
508
|
+
end
|
|
509
|
+
|
|
510
|
+
if po_number.to_s.length > 255
|
|
511
|
+
fail ArgumentError, 'invalid value for "po_number", the character length must be smaller than or equal to 255.'
|
|
512
|
+
end
|
|
513
|
+
|
|
514
|
+
if po_number.to_s.length < 1
|
|
515
|
+
fail ArgumentError, 'invalid value for "po_number", the character length must be greater than or equal to 1.'
|
|
516
|
+
end
|
|
517
|
+
|
|
518
|
+
@po_number = po_number
|
|
519
|
+
end
|
|
520
|
+
|
|
521
|
+
# Custom attribute writer method with validation
|
|
522
|
+
# @param [Object] funding_id Value to be assigned
|
|
523
|
+
def funding_id=(funding_id)
|
|
524
|
+
if funding_id.nil?
|
|
525
|
+
fail ArgumentError, 'funding_id cannot be nil'
|
|
526
|
+
end
|
|
527
|
+
|
|
528
|
+
pattern = Regexp.new(/^[1-9][0-9]*$/)
|
|
529
|
+
if funding_id !~ pattern
|
|
530
|
+
fail ArgumentError, "invalid value for \"funding_id\", must conform to the pattern #{pattern}."
|
|
531
|
+
end
|
|
532
|
+
|
|
533
|
+
@funding_id = funding_id
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
# Checks equality by comparing each attribute.
|
|
537
|
+
# @param [Object] Object to be compared
|
|
538
|
+
def ==(o)
|
|
539
|
+
return true if self.equal?(o)
|
|
540
|
+
self.class == o.class &&
|
|
541
|
+
account_id == o.account_id &&
|
|
542
|
+
business_id == o.business_id &&
|
|
543
|
+
name == o.name &&
|
|
544
|
+
currency == o.currency &&
|
|
545
|
+
timezone_id == o.timezone_id &&
|
|
546
|
+
end_advertiser == o.end_advertiser &&
|
|
547
|
+
media_agency == o.media_agency &&
|
|
548
|
+
partner == o.partner &&
|
|
549
|
+
invoice == o.invoice &&
|
|
550
|
+
invoice_group_id == o.invoice_group_id &&
|
|
551
|
+
invoicing_emails == o.invoicing_emails &&
|
|
552
|
+
io == o.io &&
|
|
553
|
+
po_number == o.po_number &&
|
|
554
|
+
funding_id == o.funding_id &&
|
|
555
|
+
ad_account_created_from_bm_flag == o.ad_account_created_from_bm_flag
|
|
556
|
+
end
|
|
557
|
+
|
|
558
|
+
# @see the `==` method
|
|
559
|
+
# @param [Object] Object to be compared
|
|
560
|
+
def eql?(o)
|
|
561
|
+
self == o
|
|
562
|
+
end
|
|
563
|
+
|
|
564
|
+
# Calculates hash code according to all attributes.
|
|
565
|
+
# @return [Integer] Hash code
|
|
566
|
+
def hash
|
|
567
|
+
[account_id, business_id, name, currency, timezone_id, end_advertiser, media_agency, partner, invoice, invoice_group_id, invoicing_emails, io, po_number, funding_id, ad_account_created_from_bm_flag].hash
|
|
568
|
+
end
|
|
569
|
+
|
|
570
|
+
# Builds the object from hash
|
|
571
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
572
|
+
# @return [Object] Returns the model itself
|
|
573
|
+
def self.build_from_hash(attributes)
|
|
574
|
+
return nil unless attributes.is_a?(Hash)
|
|
575
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
576
|
+
transformed_hash = {}
|
|
577
|
+
openapi_types.each_pair do |key, type|
|
|
578
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
579
|
+
transformed_hash["#{key}"] = nil
|
|
580
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
581
|
+
# check to ensure the input is an array given that the attribute
|
|
582
|
+
# is documented as an array but the input is not
|
|
583
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
584
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
585
|
+
end
|
|
586
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
587
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
588
|
+
end
|
|
589
|
+
end
|
|
590
|
+
new(transformed_hash)
|
|
591
|
+
end
|
|
592
|
+
|
|
593
|
+
# Returns the object in the form of hash
|
|
594
|
+
# @return [Hash] Returns the object in the form of hash
|
|
595
|
+
def to_hash
|
|
596
|
+
hash = {}
|
|
597
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
598
|
+
value = self.send(attr)
|
|
599
|
+
if value.nil?
|
|
600
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
601
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
602
|
+
end
|
|
603
|
+
|
|
604
|
+
hash[param] = _to_hash(value)
|
|
605
|
+
end
|
|
606
|
+
hash
|
|
607
|
+
end
|
|
608
|
+
|
|
609
|
+
end
|
|
610
|
+
|
|
611
|
+
end
|
|
@@ -40,6 +40,9 @@ module Zernio
|
|
|
40
40
|
# Live carrier-stock snapshot (refreshed every 6h + on availability checks): false when NO offered type currently has deliverable inventory, so a purchase would fail. Treat as advisory; the purchase itself re-checks.
|
|
41
41
|
attr_accessor :in_stock
|
|
42
42
|
|
|
43
|
+
# At least one out-of-stock type here can be pre-ordered (see `types[].preOrderable`).
|
|
44
|
+
attr_accessor :pre_orderable
|
|
45
|
+
|
|
43
46
|
# Every number type offered in this country (default first). Capabilities, KYC tier, monthly price, and stock are per type. The country-level fields above mirror the first (default) entry. Pass the chosen `numberType` to POST /v1/phone-numbers/purchase.
|
|
44
47
|
attr_accessor :types
|
|
45
48
|
|
|
@@ -77,6 +80,7 @@ module Zernio
|
|
|
77
80
|
:'sms_available' => :'smsAvailable',
|
|
78
81
|
:'outbound_calling_available' => :'outboundCallingAvailable',
|
|
79
82
|
:'in_stock' => :'inStock',
|
|
83
|
+
:'pre_orderable' => :'preOrderable',
|
|
80
84
|
:'types' => :'types'
|
|
81
85
|
}
|
|
82
86
|
end
|
|
@@ -103,6 +107,7 @@ module Zernio
|
|
|
103
107
|
:'sms_available' => :'Boolean',
|
|
104
108
|
:'outbound_calling_available' => :'Boolean',
|
|
105
109
|
:'in_stock' => :'Boolean',
|
|
110
|
+
:'pre_orderable' => :'Boolean',
|
|
106
111
|
:'types' => :'Array<ListPhoneNumberCountries200ResponseCountriesInnerTypesInner>'
|
|
107
112
|
}
|
|
108
113
|
end
|
|
@@ -165,6 +170,10 @@ module Zernio
|
|
|
165
170
|
self.in_stock = attributes[:'in_stock']
|
|
166
171
|
end
|
|
167
172
|
|
|
173
|
+
if attributes.key?(:'pre_orderable')
|
|
174
|
+
self.pre_orderable = attributes[:'pre_orderable']
|
|
175
|
+
end
|
|
176
|
+
|
|
168
177
|
if attributes.key?(:'types')
|
|
169
178
|
if (value = attributes[:'types']).is_a?(Array)
|
|
170
179
|
self.types = value
|
|
@@ -213,6 +222,7 @@ module Zernio
|
|
|
213
222
|
sms_available == o.sms_available &&
|
|
214
223
|
outbound_calling_available == o.outbound_calling_available &&
|
|
215
224
|
in_stock == o.in_stock &&
|
|
225
|
+
pre_orderable == o.pre_orderable &&
|
|
216
226
|
types == o.types
|
|
217
227
|
end
|
|
218
228
|
|
|
@@ -225,7 +235,7 @@ module Zernio
|
|
|
225
235
|
# Calculates hash code according to all attributes.
|
|
226
236
|
# @return [Integer] Hash code
|
|
227
237
|
def hash
|
|
228
|
-
[code, tier, monthly_cents, needs_kyc, calls_available, whatsapp_available, sms_available, outbound_calling_available, in_stock, types].hash
|
|
238
|
+
[code, tier, monthly_cents, needs_kyc, calls_available, whatsapp_available, sms_available, outbound_calling_available, in_stock, pre_orderable, types].hash
|
|
229
239
|
end
|
|
230
240
|
|
|
231
241
|
# Builds the object from hash
|