late-sdk 0.0.531 → 0.0.533

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 (56) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -0
  3. data/docs/AdsApi.md +287 -0
  4. data/docs/CheckPhoneNumberPortability200ResponseResultsInner.md +5 -1
  5. data/docs/CreatePhoneNumberPortInRequest.md +4 -2
  6. data/docs/CreatePhoneNumberPortInRequestEndUser.md +8 -4
  7. data/docs/CreatePhoneNumberPortInRequestRequirementsInner.md +20 -0
  8. data/docs/CreateRfPrediction201Response.md +22 -0
  9. data/docs/CreateRfPredictionRequest.md +34 -0
  10. data/docs/CreateStandaloneAdRequest.md +4 -0
  11. data/docs/GetPhoneNumberPortInOrderRequirements200Response.md +20 -0
  12. data/docs/GetPhoneNumberPortInOrderRequirements200ResponseRequirementsInner.md +32 -0
  13. data/docs/GetPhoneNumberPortInRequirements200Response.md +24 -0
  14. data/docs/GetPhoneNumberPortInRequirements200ResponseFieldsInner.md +28 -0
  15. data/docs/PhoneNumbersApi.md +149 -5
  16. data/docs/ReserveRfPrediction201Response.md +20 -0
  17. data/docs/ReserveRfPredictionRequest.md +20 -0
  18. data/docs/RfPrediction.md +42 -0
  19. data/lib/zernio-sdk/api/ads_api.rb +294 -0
  20. data/lib/zernio-sdk/api/phone_numbers_api.rb +148 -10
  21. data/lib/zernio-sdk/models/check_phone_number_portability200_response_results_inner.rb +24 -2
  22. data/lib/zernio-sdk/models/create_phone_number_port_in_request.rb +36 -5
  23. data/lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb +65 -23
  24. data/lib/zernio-sdk/models/create_phone_number_port_in_request_requirements_inner.rb +201 -0
  25. data/lib/zernio-sdk/models/create_rf_prediction201_response.rb +165 -0
  26. data/lib/zernio-sdk/models/create_rf_prediction_request.rb +323 -0
  27. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +33 -1
  28. data/lib/zernio-sdk/models/get_phone_number_port_in_order_requirements200_response.rb +158 -0
  29. data/lib/zernio-sdk/models/get_phone_number_port_in_order_requirements200_response_requirements_inner.rb +247 -0
  30. data/lib/zernio-sdk/models/get_phone_number_port_in_requirements200_response.rb +177 -0
  31. data/lib/zernio-sdk/models/get_phone_number_port_in_requirements200_response_fields_inner.rb +231 -0
  32. data/lib/zernio-sdk/models/reserve_rf_prediction201_response.rb +156 -0
  33. data/lib/zernio-sdk/models/reserve_rf_prediction_request.rb +190 -0
  34. data/lib/zernio-sdk/models/rf_prediction.rb +273 -0
  35. data/lib/zernio-sdk/version.rb +1 -1
  36. data/lib/zernio-sdk.rb +10 -0
  37. data/openapi.yaml +283 -16
  38. data/spec/api/ads_api_spec.rb +52 -0
  39. data/spec/api/phone_numbers_api_spec.rb +28 -3
  40. data/spec/models/check_phone_number_portability200_response_results_inner_spec.rb +12 -0
  41. data/spec/models/create_phone_number_port_in_request_end_user_spec.rb +13 -1
  42. data/spec/models/create_phone_number_port_in_request_requirements_inner_spec.rb +42 -0
  43. data/spec/models/create_phone_number_port_in_request_spec.rb +6 -0
  44. data/spec/models/create_rf_prediction201_response_spec.rb +48 -0
  45. data/spec/models/create_rf_prediction_request_spec.rb +84 -0
  46. data/spec/models/create_standalone_ad_request_spec.rb +16 -0
  47. data/spec/models/get_phone_number_port_in_order_requirements200_response_requirements_inner_spec.rb +82 -0
  48. data/spec/models/get_phone_number_port_in_order_requirements200_response_spec.rb +42 -0
  49. data/spec/models/get_phone_number_port_in_requirements200_response_fields_inner_spec.rb +70 -0
  50. data/spec/models/get_phone_number_port_in_requirements200_response_spec.rb +54 -0
  51. data/spec/models/reserve_rf_prediction201_response_spec.rb +42 -0
  52. data/spec/models/reserve_rf_prediction_request_spec.rb +42 -0
  53. data/spec/models/rf_prediction_spec.rb +108 -0
  54. data/zernio-sdk-0.0.533.gem +0 -0
  55. metadata +42 -2
  56. data/zernio-sdk-0.0.531.gem +0 -0
@@ -0,0 +1,323 @@
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 CreateRfPredictionRequest < ApiModelBase
18
+ # Zernio SocialAccount id (posting or ads variant).
19
+ attr_accessor :account_id
20
+
21
+ # Meta ad account id (act_<n>).
22
+ attr_accessor :ad_account_id
23
+
24
+ # Whole currency units. Exactly one of budgetAmount / reach.
25
+ attr_accessor :budget_amount
26
+
27
+ # Target unique reach. Exactly one of budgetAmount / reach.
28
+ attr_accessor :reach
29
+
30
+ # Campaign window start (must be in the future).
31
+ attr_accessor :start_date
32
+
33
+ attr_accessor :end_date
34
+
35
+ # Max impressions per person over the window.
36
+ attr_accessor :frequency_cap
37
+
38
+ # Canonical camelCase TargetingSpec (same shape as /v1/ads/create's `targeting`). Defaults to countries: [US].
39
+ attr_accessor :targeting
40
+
41
+ # Meta placements object (same shape as /v1/ads/create's `placements`).
42
+ attr_accessor :placements
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'account_id' => :'accountId',
48
+ :'ad_account_id' => :'adAccountId',
49
+ :'budget_amount' => :'budgetAmount',
50
+ :'reach' => :'reach',
51
+ :'start_date' => :'startDate',
52
+ :'end_date' => :'endDate',
53
+ :'frequency_cap' => :'frequencyCap',
54
+ :'targeting' => :'targeting',
55
+ :'placements' => :'placements'
56
+ }
57
+ end
58
+
59
+ # Returns attribute mapping this model knows about
60
+ def self.acceptable_attribute_map
61
+ attribute_map
62
+ end
63
+
64
+ # Returns all the JSON keys this model knows about
65
+ def self.acceptable_attributes
66
+ acceptable_attribute_map.values
67
+ end
68
+
69
+ # Attribute type mapping.
70
+ def self.openapi_types
71
+ {
72
+ :'account_id' => :'String',
73
+ :'ad_account_id' => :'String',
74
+ :'budget_amount' => :'Float',
75
+ :'reach' => :'Integer',
76
+ :'start_date' => :'Time',
77
+ :'end_date' => :'Time',
78
+ :'frequency_cap' => :'Integer',
79
+ :'targeting' => :'Object',
80
+ :'placements' => :'Object'
81
+ }
82
+ end
83
+
84
+ # List of attributes with nullable: true
85
+ def self.openapi_nullable
86
+ Set.new([
87
+ ])
88
+ end
89
+
90
+ # Initializes the object
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ def initialize(attributes = {})
93
+ if (!attributes.is_a?(Hash))
94
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateRfPredictionRequest` initialize method"
95
+ end
96
+
97
+ # check to see if the attribute exists and convert string to symbol for hash key
98
+ acceptable_attribute_map = self.class.acceptable_attribute_map
99
+ attributes = attributes.each_with_object({}) { |(k, v), h|
100
+ if (!acceptable_attribute_map.key?(k.to_sym))
101
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreateRfPredictionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
102
+ end
103
+ h[k.to_sym] = v
104
+ }
105
+
106
+ if attributes.key?(:'account_id')
107
+ self.account_id = attributes[:'account_id']
108
+ else
109
+ self.account_id = nil
110
+ end
111
+
112
+ if attributes.key?(:'ad_account_id')
113
+ self.ad_account_id = attributes[:'ad_account_id']
114
+ else
115
+ self.ad_account_id = nil
116
+ end
117
+
118
+ if attributes.key?(:'budget_amount')
119
+ self.budget_amount = attributes[:'budget_amount']
120
+ end
121
+
122
+ if attributes.key?(:'reach')
123
+ self.reach = attributes[:'reach']
124
+ end
125
+
126
+ if attributes.key?(:'start_date')
127
+ self.start_date = attributes[:'start_date']
128
+ else
129
+ self.start_date = nil
130
+ end
131
+
132
+ if attributes.key?(:'end_date')
133
+ self.end_date = attributes[:'end_date']
134
+ else
135
+ self.end_date = nil
136
+ end
137
+
138
+ if attributes.key?(:'frequency_cap')
139
+ self.frequency_cap = attributes[:'frequency_cap']
140
+ end
141
+
142
+ if attributes.key?(:'targeting')
143
+ self.targeting = attributes[:'targeting']
144
+ end
145
+
146
+ if attributes.key?(:'placements')
147
+ self.placements = attributes[:'placements']
148
+ end
149
+ end
150
+
151
+ # Show invalid properties with the reasons. Usually used together with valid?
152
+ # @return Array for valid properties with the reasons
153
+ def list_invalid_properties
154
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
155
+ invalid_properties = Array.new
156
+ if @account_id.nil?
157
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
158
+ end
159
+
160
+ if @ad_account_id.nil?
161
+ invalid_properties.push('invalid value for "ad_account_id", ad_account_id cannot be nil.')
162
+ end
163
+
164
+ if @start_date.nil?
165
+ invalid_properties.push('invalid value for "start_date", start_date cannot be nil.')
166
+ end
167
+
168
+ if @end_date.nil?
169
+ invalid_properties.push('invalid value for "end_date", end_date cannot be nil.')
170
+ end
171
+
172
+ if !@frequency_cap.nil? && @frequency_cap > 90
173
+ invalid_properties.push('invalid value for "frequency_cap", must be smaller than or equal to 90.')
174
+ end
175
+
176
+ if !@frequency_cap.nil? && @frequency_cap < 1
177
+ invalid_properties.push('invalid value for "frequency_cap", must be greater than or equal to 1.')
178
+ end
179
+
180
+ invalid_properties
181
+ end
182
+
183
+ # Check to see if the all the properties in the model are valid
184
+ # @return true if the model is valid
185
+ def valid?
186
+ warn '[DEPRECATED] the `valid?` method is obsolete'
187
+ return false if @account_id.nil?
188
+ return false if @ad_account_id.nil?
189
+ return false if @start_date.nil?
190
+ return false if @end_date.nil?
191
+ return false if !@frequency_cap.nil? && @frequency_cap > 90
192
+ return false if !@frequency_cap.nil? && @frequency_cap < 1
193
+ true
194
+ end
195
+
196
+ # Custom attribute writer method with validation
197
+ # @param [Object] account_id Value to be assigned
198
+ def account_id=(account_id)
199
+ if account_id.nil?
200
+ fail ArgumentError, 'account_id cannot be nil'
201
+ end
202
+
203
+ @account_id = account_id
204
+ end
205
+
206
+ # Custom attribute writer method with validation
207
+ # @param [Object] ad_account_id Value to be assigned
208
+ def ad_account_id=(ad_account_id)
209
+ if ad_account_id.nil?
210
+ fail ArgumentError, 'ad_account_id cannot be nil'
211
+ end
212
+
213
+ @ad_account_id = ad_account_id
214
+ end
215
+
216
+ # Custom attribute writer method with validation
217
+ # @param [Object] start_date Value to be assigned
218
+ def start_date=(start_date)
219
+ if start_date.nil?
220
+ fail ArgumentError, 'start_date cannot be nil'
221
+ end
222
+
223
+ @start_date = start_date
224
+ end
225
+
226
+ # Custom attribute writer method with validation
227
+ # @param [Object] end_date Value to be assigned
228
+ def end_date=(end_date)
229
+ if end_date.nil?
230
+ fail ArgumentError, 'end_date cannot be nil'
231
+ end
232
+
233
+ @end_date = end_date
234
+ end
235
+
236
+ # Custom attribute writer method with validation
237
+ # @param [Object] frequency_cap Value to be assigned
238
+ def frequency_cap=(frequency_cap)
239
+ if frequency_cap.nil?
240
+ fail ArgumentError, 'frequency_cap cannot be nil'
241
+ end
242
+
243
+ if frequency_cap > 90
244
+ fail ArgumentError, 'invalid value for "frequency_cap", must be smaller than or equal to 90.'
245
+ end
246
+
247
+ if frequency_cap < 1
248
+ fail ArgumentError, 'invalid value for "frequency_cap", must be greater than or equal to 1.'
249
+ end
250
+
251
+ @frequency_cap = frequency_cap
252
+ end
253
+
254
+ # Checks equality by comparing each attribute.
255
+ # @param [Object] Object to be compared
256
+ def ==(o)
257
+ return true if self.equal?(o)
258
+ self.class == o.class &&
259
+ account_id == o.account_id &&
260
+ ad_account_id == o.ad_account_id &&
261
+ budget_amount == o.budget_amount &&
262
+ reach == o.reach &&
263
+ start_date == o.start_date &&
264
+ end_date == o.end_date &&
265
+ frequency_cap == o.frequency_cap &&
266
+ targeting == o.targeting &&
267
+ placements == o.placements
268
+ end
269
+
270
+ # @see the `==` method
271
+ # @param [Object] Object to be compared
272
+ def eql?(o)
273
+ self == o
274
+ end
275
+
276
+ # Calculates hash code according to all attributes.
277
+ # @return [Integer] Hash code
278
+ def hash
279
+ [account_id, ad_account_id, budget_amount, reach, start_date, end_date, frequency_cap, targeting, placements].hash
280
+ end
281
+
282
+ # Builds the object from hash
283
+ # @param [Hash] attributes Model attributes in the form of hash
284
+ # @return [Object] Returns the model itself
285
+ def self.build_from_hash(attributes)
286
+ return nil unless attributes.is_a?(Hash)
287
+ attributes = attributes.transform_keys(&:to_sym)
288
+ transformed_hash = {}
289
+ openapi_types.each_pair do |key, type|
290
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
291
+ transformed_hash["#{key}"] = nil
292
+ elsif type =~ /\AArray<(.*)>/i
293
+ # check to ensure the input is an array given that the attribute
294
+ # is documented as an array but the input is not
295
+ if attributes[attribute_map[key]].is_a?(Array)
296
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
297
+ end
298
+ elsif !attributes[attribute_map[key]].nil?
299
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
300
+ end
301
+ end
302
+ new(transformed_hash)
303
+ end
304
+
305
+ # Returns the object in the form of hash
306
+ # @return [Hash] Returns the object in the form of hash
307
+ def to_hash
308
+ hash = {}
309
+ self.class.attribute_map.each_pair do |attr, param|
310
+ value = self.send(attr)
311
+ if value.nil?
312
+ is_nullable = self.class.openapi_nullable.include?(attr)
313
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
314
+ end
315
+
316
+ hash[param] = _to_hash(value)
317
+ end
318
+ hash
319
+ end
320
+
321
+ end
322
+
323
+ end
@@ -41,6 +41,12 @@ module Zernio
41
41
  # Meta only. Explicit ad-set `billing_event`. Defaults to `IMPRESSIONS`. Forwarded verbatim to Meta, which validates compatibility with the optimization goal.
42
42
  attr_accessor :billing_event
43
43
 
44
+ # Meta only. RESERVED = Reach & Frequency: requires `rfPredictionId` (a RESERVED prediction from /v1/ads/rf-predictions + /reserve). Budget, schedule and pricing come from the reservation, so budgetAmount/budgetType are not required and bid fields are ignored. Only the plain single-ad shape (no creatives[], adSetId, existingCampaignId or dynamicCreative).
45
+ attr_accessor :buying_type
46
+
47
+ # Meta only. The RESERVED prediction id the R&F ad set runs on (reserving mints a new id — pass that one). Requires buyingType RESERVED.
48
+ attr_accessor :rf_prediction_id
49
+
44
50
  # Required on legacy + multi-creative shapes. Inherited on attach.
45
51
  attr_accessor :budget_amount
46
52
 
@@ -251,6 +257,8 @@ module Zernio
251
257
  :'goal' => :'goal',
252
258
  :'optimization_goal' => :'optimizationGoal',
253
259
  :'billing_event' => :'billingEvent',
260
+ :'buying_type' => :'buyingType',
261
+ :'rf_prediction_id' => :'rfPredictionId',
254
262
  :'budget_amount' => :'budgetAmount',
255
263
  :'budget_type' => :'budgetType',
256
264
  :'status' => :'status',
@@ -339,6 +347,8 @@ module Zernio
339
347
  :'goal' => :'String',
340
348
  :'optimization_goal' => :'String',
341
349
  :'billing_event' => :'String',
350
+ :'buying_type' => :'String',
351
+ :'rf_prediction_id' => :'String',
342
352
  :'budget_amount' => :'Float',
343
353
  :'budget_type' => :'String',
344
354
  :'status' => :'String',
@@ -472,6 +482,14 @@ module Zernio
472
482
  self.billing_event = attributes[:'billing_event']
473
483
  end
474
484
 
485
+ if attributes.key?(:'buying_type')
486
+ self.buying_type = attributes[:'buying_type']
487
+ end
488
+
489
+ if attributes.key?(:'rf_prediction_id')
490
+ self.rf_prediction_id = attributes[:'rf_prediction_id']
491
+ end
492
+
475
493
  if attributes.key?(:'budget_amount')
476
494
  self.budget_amount = attributes[:'budget_amount']
477
495
  end
@@ -866,6 +884,8 @@ module Zernio
866
884
  return false if !@ad_name.nil? && @ad_name.to_s.length > 255
867
885
  goal_validator = EnumAttributeValidator.new('String', ["engagement", "traffic", "awareness", "video_views", "lead_generation", "lead_conversion", "conversions", "app_promotion", "catalog_sales", "job_applicants"])
868
886
  return false unless goal_validator.valid?(@goal)
887
+ buying_type_validator = EnumAttributeValidator.new('String', ["AUCTION", "RESERVED"])
888
+ return false unless buying_type_validator.valid?(@buying_type)
869
889
  budget_type_validator = EnumAttributeValidator.new('String', ["daily", "lifetime"])
870
890
  return false unless budget_type_validator.valid?(@budget_type)
871
891
  status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "PAUSED"])
@@ -987,6 +1007,16 @@ module Zernio
987
1007
  @goal = goal
988
1008
  end
989
1009
 
1010
+ # Custom attribute writer method checking allowed values (enum).
1011
+ # @param [Object] buying_type Object to be assigned
1012
+ def buying_type=(buying_type)
1013
+ validator = EnumAttributeValidator.new('String', ["AUCTION", "RESERVED"])
1014
+ unless validator.valid?(buying_type)
1015
+ fail ArgumentError, "invalid value for \"buying_type\", must be one of #{validator.allowable_values}."
1016
+ end
1017
+ @buying_type = buying_type
1018
+ end
1019
+
990
1020
  # Custom attribute writer method checking allowed values (enum).
991
1021
  # @param [Object] budget_type Object to be assigned
992
1022
  def budget_type=(budget_type)
@@ -1248,6 +1278,8 @@ module Zernio
1248
1278
  goal == o.goal &&
1249
1279
  optimization_goal == o.optimization_goal &&
1250
1280
  billing_event == o.billing_event &&
1281
+ buying_type == o.buying_type &&
1282
+ rf_prediction_id == o.rf_prediction_id &&
1251
1283
  budget_amount == o.budget_amount &&
1252
1284
  budget_type == o.budget_type &&
1253
1285
  status == o.status &&
@@ -1321,7 +1353,7 @@ module Zernio
1321
1353
  # Calculates hash code according to all attributes.
1322
1354
  # @return [Integer] Hash code
1323
1355
  def hash
1324
- [account_id, ad_account_id, name, campaign_name, ad_set_name, ad_name, tracking, goal, optimization_goal, billing_event, budget_amount, budget_type, status, budget_level, currency, headline, long_headline, body, description, call_to_action, link_url, lead_gen_form_id, image_url, images, video, creatives, ad_set_id, existing_campaign_id, existing_creative_id, business_name, board_id, organization_id, targeting, countries, cities, regions, age_min, age_max, interests, zips, metros, custom_locations, behaviors, income_tier, languages, placements, saved_targeting_id, raw_targeting, special_ad_categories, end_date, start_date, instagram_account_id, dynamic_creative, carousel_cards, placement_assets, audience_id, campaign_type, keywords, additional_headlines, additional_descriptions, advantage_audience, attribution_spec, gender, bid_strategy, bid_amount, roas_average_floor, platform_specific_data, dsa_beneficiary, dsa_payor, brand_identity, identity_type, promoted_object].hash
1356
+ [account_id, ad_account_id, name, campaign_name, ad_set_name, ad_name, tracking, goal, optimization_goal, billing_event, buying_type, rf_prediction_id, budget_amount, budget_type, status, budget_level, currency, headline, long_headline, body, description, call_to_action, link_url, lead_gen_form_id, image_url, images, video, creatives, ad_set_id, existing_campaign_id, existing_creative_id, business_name, board_id, organization_id, targeting, countries, cities, regions, age_min, age_max, interests, zips, metros, custom_locations, behaviors, income_tier, languages, placements, saved_targeting_id, raw_targeting, special_ad_categories, end_date, start_date, instagram_account_id, dynamic_creative, carousel_cards, placement_assets, audience_id, campaign_type, keywords, additional_headlines, additional_descriptions, advantage_audience, attribution_spec, gender, bid_strategy, bid_amount, roas_average_floor, platform_specific_data, dsa_beneficiary, dsa_payor, brand_identity, identity_type, promoted_object].hash
1325
1357
  end
1326
1358
 
1327
1359
  # Builds the object from hash
@@ -0,0 +1,158 @@
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 GetPhoneNumberPortInOrderRequirements200Response < ApiModelBase
18
+ attr_accessor :country
19
+
20
+ attr_accessor :requirements
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'country' => :'country',
26
+ :'requirements' => :'requirements'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'country' => :'String',
44
+ :'requirements' => :'Array<GetPhoneNumberPortInOrderRequirements200ResponseRequirementsInner>'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetPhoneNumberPortInOrderRequirements200Response` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetPhoneNumberPortInOrderRequirements200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'country')
71
+ self.country = attributes[:'country']
72
+ end
73
+
74
+ if attributes.key?(:'requirements')
75
+ if (value = attributes[:'requirements']).is_a?(Array)
76
+ self.requirements = value
77
+ end
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
+ invalid_properties = Array.new
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ country == o.country &&
102
+ requirements == o.requirements
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [country, requirements].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ attributes = attributes.transform_keys(&:to_sym)
123
+ transformed_hash = {}
124
+ openapi_types.each_pair do |key, type|
125
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = nil
127
+ elsif type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[attribute_map[key]].is_a?(Array)
131
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
132
+ end
133
+ elsif !attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
135
+ end
136
+ end
137
+ new(transformed_hash)
138
+ end
139
+
140
+ # Returns the object in the form of hash
141
+ # @return [Hash] Returns the object in the form of hash
142
+ def to_hash
143
+ hash = {}
144
+ self.class.attribute_map.each_pair do |attr, param|
145
+ value = self.send(attr)
146
+ if value.nil?
147
+ is_nullable = self.class.openapi_nullable.include?(attr)
148
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
149
+ end
150
+
151
+ hash[param] = _to_hash(value)
152
+ end
153
+ hash
154
+ end
155
+
156
+ end
157
+
158
+ end