late-sdk 0.0.658 → 0.0.660

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/AdAccountsApi.md +364 -0
  4. data/docs/AdCampaignsApi.md +1 -1
  5. data/docs/BoostPostRequest.md +3 -1
  6. data/docs/CreateStandaloneAdRequest.md +4 -0
  7. data/docs/CreateValueRuleSet201Response.md +20 -0
  8. data/docs/CreateValueRuleSetRequest.md +24 -0
  9. data/docs/DeleteValueRuleSet200Response.md +20 -0
  10. data/docs/GetValueRuleSet200Response.md +18 -0
  11. data/docs/ListValueRuleSets200Response.md +22 -0
  12. data/docs/ListValueRuleSets200ResponsePaging.md +18 -0
  13. data/docs/UpdateAdSetRequest.md +4 -0
  14. data/docs/UpdateValueRuleSet200Response.md +24 -0
  15. data/docs/UpdateValueRuleSetRequest.md +22 -0
  16. data/docs/ValueRule.md +28 -0
  17. data/docs/ValueRuleCriterion.md +26 -0
  18. data/docs/ValueRuleSet.md +22 -0
  19. data/lib/zernio-sdk/api/ad_accounts_api.rb +367 -0
  20. data/lib/zernio-sdk/api/ad_campaigns_api.rb +2 -2
  21. data/lib/zernio-sdk/models/boost_post_request.rb +14 -4
  22. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +42 -1
  23. data/lib/zernio-sdk/models/create_value_rule_set201_response.rb +158 -0
  24. data/lib/zernio-sdk/models/create_value_rule_set_request.rb +283 -0
  25. data/lib/zernio-sdk/models/delete_value_rule_set200_response.rb +156 -0
  26. data/lib/zernio-sdk/models/get_value_rule_set200_response.rb +147 -0
  27. data/lib/zernio-sdk/models/list_value_rule_sets200_response.rb +167 -0
  28. data/lib/zernio-sdk/models/list_value_rule_sets200_response_paging.rb +149 -0
  29. data/lib/zernio-sdk/models/update_ad_set_request.rb +42 -1
  30. data/lib/zernio-sdk/models/update_value_rule_set200_response.rb +176 -0
  31. data/lib/zernio-sdk/models/update_value_rule_set_request.rb +257 -0
  32. data/lib/zernio-sdk/models/value_rule.rb +346 -0
  33. data/lib/zernio-sdk/models/value_rule_criterion.rb +305 -0
  34. data/lib/zernio-sdk/models/value_rule_set.rb +221 -0
  35. data/lib/zernio-sdk/version.rb +1 -1
  36. data/lib/zernio-sdk.rb +11 -0
  37. data/openapi.yaml +406 -3
  38. data/spec/api/ad_accounts_api_spec.rb +66 -0
  39. data/spec/api/ad_campaigns_api_spec.rb +1 -1
  40. data/spec/models/boost_post_request_spec.rb +6 -0
  41. data/spec/models/create_standalone_ad_request_spec.rb +12 -0
  42. data/spec/models/create_value_rule_set201_response_spec.rb +42 -0
  43. data/spec/models/create_value_rule_set_request_spec.rb +54 -0
  44. data/spec/models/delete_value_rule_set200_response_spec.rb +42 -0
  45. data/spec/models/get_value_rule_set200_response_spec.rb +36 -0
  46. data/spec/models/list_value_rule_sets200_response_paging_spec.rb +36 -0
  47. data/spec/models/list_value_rule_sets200_response_spec.rb +48 -0
  48. data/spec/models/update_ad_set_request_spec.rb +12 -0
  49. data/spec/models/update_value_rule_set200_response_spec.rb +54 -0
  50. data/spec/models/update_value_rule_set_request_spec.rb +48 -0
  51. data/spec/models/value_rule_criterion_spec.rb +68 -0
  52. data/spec/models/value_rule_set_spec.rb +48 -0
  53. data/spec/models/value_rule_spec.rb +70 -0
  54. data/zernio-sdk-0.0.660.gem +0 -0
  55. metadata +46 -2
  56. data/zernio-sdk-0.0.658.gem +0 -0
@@ -77,6 +77,9 @@ module Zernio
77
77
  # Legal entity that pays for the ad. Can differ from `dsaBeneficiary` (for example, an agency paying for a client's ads). Same rules as `dsaBeneficiary`: required for EU targeting unless the ad account has a default payor.
78
78
  attr_accessor :dsa_payor
79
79
 
80
+ # Meta only. Explicit ad-set `optimization_goal` override. When omitted, defaults to the value derived from `goal`. The value must be compatible with the objective Meta derives from `goal`, not with the objective used by `POST /v1/ads/create` for the same `goal` name: boost maps `goal: \"engagement\"` to objective `OUTCOME_AWARENESS`, which accepts `REACH`, `IMPRESSIONS`, `AD_RECALL_LIFT`, or THRUPLAY-class values, and rejects `POST_ENGAGEMENT` (that value is only valid under `OUTCOME_ENGAGEMENT`, which create uses for the same goal name).
81
+ attr_accessor :optimization_goal
82
+
80
83
  class EnumAttributeValidator
81
84
  attr_reader :datatype
82
85
  attr_reader :allowable_values
@@ -124,7 +127,8 @@ module Zernio
124
127
  :'call_to_action' => :'callToAction',
125
128
  :'spark_auth_code' => :'sparkAuthCode',
126
129
  :'dsa_beneficiary' => :'dsaBeneficiary',
127
- :'dsa_payor' => :'dsaPayor'
130
+ :'dsa_payor' => :'dsaPayor',
131
+ :'optimization_goal' => :'optimizationGoal'
128
132
  }
129
133
  end
130
134
 
@@ -163,7 +167,8 @@ module Zernio
163
167
  :'call_to_action' => :'String',
164
168
  :'spark_auth_code' => :'String',
165
169
  :'dsa_beneficiary' => :'String',
166
- :'dsa_payor' => :'String'
170
+ :'dsa_payor' => :'String',
171
+ :'optimization_goal' => :'String'
167
172
  }
168
173
  end
169
174
 
@@ -296,6 +301,10 @@ module Zernio
296
301
  if attributes.key?(:'dsa_payor')
297
302
  self.dsa_payor = attributes[:'dsa_payor']
298
303
  end
304
+
305
+ if attributes.key?(:'optimization_goal')
306
+ self.optimization_goal = attributes[:'optimization_goal']
307
+ end
299
308
  end
300
309
 
301
310
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -464,7 +473,8 @@ module Zernio
464
473
  call_to_action == o.call_to_action &&
465
474
  spark_auth_code == o.spark_auth_code &&
466
475
  dsa_beneficiary == o.dsa_beneficiary &&
467
- dsa_payor == o.dsa_payor
476
+ dsa_payor == o.dsa_payor &&
477
+ optimization_goal == o.optimization_goal
468
478
  end
469
479
 
470
480
  # @see the `==` method
@@ -476,7 +486,7 @@ module Zernio
476
486
  # Calculates hash code according to all attributes.
477
487
  # @return [Integer] Hash code
478
488
  def hash
479
- [post_id, platform_post_id, account_id, ad_account_id, name, goal, budget, currency, schedule, targeting, raw_targeting, bid_strategy, bid_amount, roas_average_floor, platform_specific_data, tracking, special_ad_categories, special_ad_category_country, link_url, call_to_action, spark_auth_code, dsa_beneficiary, dsa_payor].hash
489
+ [post_id, platform_post_id, account_id, ad_account_id, name, goal, budget, currency, schedule, targeting, raw_targeting, bid_strategy, bid_amount, roas_average_floor, platform_specific_data, tracking, special_ad_categories, special_ad_category_country, link_url, call_to_action, spark_auth_code, dsa_beneficiary, dsa_payor, optimization_goal].hash
480
490
  end
481
491
 
482
492
  # Builds the object from hash
@@ -222,6 +222,12 @@ module Zernio
222
222
  # Minimum ROAS as a decimal multiplier (e.g. 2.0 = 2.0x ROAS). Required when `bidStrategy` is `LOWEST_COST_WITH_MIN_ROAS`. Sent to Meta as `bid_constraints.roas_average_floor` × 10000.
223
223
  attr_accessor :roas_average_floor
224
224
 
225
+ # Meta only (facebook, instagram; other platforms return 400). Value rule set to attach to the new ad set, from `/v1/ads/value-rule-sets`. Attachment is driven by this id, so `valueRulesApplied` is optional alongside it. Rejected with 400 in `adSetId` attach mode: that shape inherits the existing ad set's attachment, so the field would be silently ignored. Use `PUT /v1/ads/ad-sets/{adSetId}` there instead. Ignored (stripped before the ad-set create) when `buyingType` is `RESERVED`: value rules only apply to auction ad sets on `LOWEST_COST_WITHOUT_CAP` or `COST_CAP`, and a Reach & Frequency reservation has no auction bid strategy. Read back with `GET /v1/ads/ad-sets/{adSetId}?fields=value_rule_set_id`; the attachment is not mirrored onto Zernio's ad documents.
226
+ attr_accessor :value_rule_set_id
227
+
228
+ # Meta only (facebook, instagram; other platforms return 400). Optional when attaching, and requires `valueRuleSetId`. `false` is REJECTED here with 400: a newly created ad set has nothing to detach, so detaching lives on `PUT /v1/ads/ad-sets/{adSetId}`.
229
+ attr_accessor :value_rules_applied
230
+
225
231
  attr_accessor :platform_specific_data
226
232
 
227
233
  # Legal entity that benefits from the ad. Required when targeting EU users (EU DSA, Article 26). Optional if the ad account has a default beneficiary: set it once via `PATCH /v1/ads/accounts` or in Meta Ads Manager, and Meta fills it in whenever the field is omitted.
@@ -335,6 +341,8 @@ module Zernio
335
341
  :'bid_strategy' => :'bidStrategy',
336
342
  :'bid_amount' => :'bidAmount',
337
343
  :'roas_average_floor' => :'roasAverageFloor',
344
+ :'value_rule_set_id' => :'valueRuleSetId',
345
+ :'value_rules_applied' => :'valueRulesApplied',
338
346
  :'platform_specific_data' => :'platformSpecificData',
339
347
  :'dsa_beneficiary' => :'dsaBeneficiary',
340
348
  :'dsa_payor' => :'dsaPayor',
@@ -430,6 +438,8 @@ module Zernio
430
438
  :'bid_strategy' => :'BidStrategy',
431
439
  :'bid_amount' => :'Float',
432
440
  :'roas_average_floor' => :'Float',
441
+ :'value_rule_set_id' => :'String',
442
+ :'value_rules_applied' => :'Boolean',
433
443
  :'platform_specific_data' => :'LinkedInAdsPlatformData',
434
444
  :'dsa_beneficiary' => :'String',
435
445
  :'dsa_payor' => :'String',
@@ -805,6 +815,14 @@ module Zernio
805
815
  self.roas_average_floor = attributes[:'roas_average_floor']
806
816
  end
807
817
 
818
+ if attributes.key?(:'value_rule_set_id')
819
+ self.value_rule_set_id = attributes[:'value_rule_set_id']
820
+ end
821
+
822
+ if attributes.key?(:'value_rules_applied')
823
+ self.value_rules_applied = attributes[:'value_rules_applied']
824
+ end
825
+
808
826
  if attributes.key?(:'platform_specific_data')
809
827
  self.platform_specific_data = attributes[:'platform_specific_data']
810
828
  end
@@ -919,6 +937,11 @@ module Zernio
919
937
  invalid_properties.push('invalid value for "attribution_spec", number of items must be greater than or equal to 1.')
920
938
  end
921
939
 
940
+ pattern = Regexp.new(/^\d+$/)
941
+ if !@value_rule_set_id.nil? && @value_rule_set_id !~ pattern
942
+ invalid_properties.push("invalid value for \"value_rule_set_id\", must conform to the pattern #{pattern}.")
943
+ end
944
+
922
945
  if !@dsa_beneficiary.nil? && @dsa_beneficiary.to_s.length > 100
923
946
  invalid_properties.push('invalid value for "dsa_beneficiary", the character length must be smaller than or equal to 100.')
924
947
  end
@@ -975,6 +998,7 @@ module Zernio
975
998
  return false if !@attribution_spec.nil? && @attribution_spec.length < 1
976
999
  gender_validator = EnumAttributeValidator.new('String', ["all", "male", "female"])
977
1000
  return false unless gender_validator.valid?(@gender)
1001
+ return false if !@value_rule_set_id.nil? && @value_rule_set_id !~ Regexp.new(/^\d+$/)
978
1002
  return false if !@dsa_beneficiary.nil? && @dsa_beneficiary.to_s.length > 100
979
1003
  return false if !@dsa_payor.nil? && @dsa_payor.to_s.length > 100
980
1004
  identity_type_validator = EnumAttributeValidator.new('String', ["TT_USER", "CUSTOMIZED_USER"])
@@ -1304,6 +1328,21 @@ module Zernio
1304
1328
  @gender = gender
1305
1329
  end
1306
1330
 
1331
+ # Custom attribute writer method with validation
1332
+ # @param [Object] value_rule_set_id Value to be assigned
1333
+ def value_rule_set_id=(value_rule_set_id)
1334
+ if value_rule_set_id.nil?
1335
+ fail ArgumentError, 'value_rule_set_id cannot be nil'
1336
+ end
1337
+
1338
+ pattern = Regexp.new(/^\d+$/)
1339
+ if value_rule_set_id !~ pattern
1340
+ fail ArgumentError, "invalid value for \"value_rule_set_id\", must conform to the pattern #{pattern}."
1341
+ end
1342
+
1343
+ @value_rule_set_id = value_rule_set_id
1344
+ end
1345
+
1307
1346
  # Custom attribute writer method with validation
1308
1347
  # @param [Object] dsa_beneficiary Value to be assigned
1309
1348
  def dsa_beneficiary=(dsa_beneficiary)
@@ -1420,6 +1459,8 @@ module Zernio
1420
1459
  bid_strategy == o.bid_strategy &&
1421
1460
  bid_amount == o.bid_amount &&
1422
1461
  roas_average_floor == o.roas_average_floor &&
1462
+ value_rule_set_id == o.value_rule_set_id &&
1463
+ value_rules_applied == o.value_rules_applied &&
1423
1464
  platform_specific_data == o.platform_specific_data &&
1424
1465
  dsa_beneficiary == o.dsa_beneficiary &&
1425
1466
  dsa_payor == o.dsa_payor &&
@@ -1437,7 +1478,7 @@ module Zernio
1437
1478
  # Calculates hash code according to all attributes.
1438
1479
  # @return [Integer] Hash code
1439
1480
  def hash
1440
- [account_id, ad_account_id, name, campaign_name, ad_set_name, ad_name, tracking, goal, optimization_goal, billing_event, buying_type, rf_prediction_id, creative_features, validate_only, 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, special_ad_category_country, end_date, start_date, instagram_account_id, dynamic_creative, carousel_cards, default_locale, translations, 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
1481
+ [account_id, ad_account_id, name, campaign_name, ad_set_name, ad_name, tracking, goal, optimization_goal, billing_event, buying_type, rf_prediction_id, creative_features, validate_only, 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, special_ad_category_country, end_date, start_date, instagram_account_id, dynamic_creative, carousel_cards, default_locale, translations, placement_assets, audience_id, campaign_type, keywords, additional_headlines, additional_descriptions, advantage_audience, attribution_spec, gender, bid_strategy, bid_amount, roas_average_floor, value_rule_set_id, value_rules_applied, platform_specific_data, dsa_beneficiary, dsa_payor, brand_identity, identity_type, promoted_object].hash
1441
1482
  end
1442
1483
 
1443
1484
  # 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 CreateValueRuleSet201Response < ApiModelBase
18
+ attr_accessor :ad_account_id
19
+
20
+ # The new rule set id. Meta does not document the create response body, so this is null on the (unobserved) case where it omits the id.
21
+ attr_accessor :value_rule_set_id
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'ad_account_id' => :'adAccountId',
27
+ :'value_rule_set_id' => :'valueRuleSetId'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'ad_account_id' => :'String',
45
+ :'value_rule_set_id' => :'String'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ :'value_rule_set_id'
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateValueRuleSet201Response` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ acceptable_attribute_map = self.class.acceptable_attribute_map
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!acceptable_attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreateValueRuleSet201Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'ad_account_id')
73
+ self.ad_account_id = attributes[:'ad_account_id']
74
+ end
75
+
76
+ if attributes.key?(:'value_rule_set_id')
77
+ self.value_rule_set_id = attributes[:'value_rule_set_id']
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
+ ad_account_id == o.ad_account_id &&
102
+ value_rule_set_id == o.value_rule_set_id
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
+ [ad_account_id, value_rule_set_id].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
@@ -0,0 +1,283 @@
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 CreateValueRuleSetRequest < ApiModelBase
18
+ # Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
19
+ attr_accessor :account_id
20
+
21
+ # Meta ad account id (act_<n>).
22
+ attr_accessor :ad_account_id
23
+
24
+ attr_accessor :name
25
+
26
+ # Evaluated in order; the first matching rule wins.
27
+ attr_accessor :rules
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'account_id' => :'accountId',
33
+ :'ad_account_id' => :'adAccountId',
34
+ :'name' => :'name',
35
+ :'rules' => :'rules'
36
+ }
37
+ end
38
+
39
+ # Returns attribute mapping this model knows about
40
+ def self.acceptable_attribute_map
41
+ attribute_map
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ acceptable_attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'account_id' => :'String',
53
+ :'ad_account_id' => :'String',
54
+ :'name' => :'String',
55
+ :'rules' => :'Array<ValueRule>'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateValueRuleSetRequest` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ acceptable_attribute_map = self.class.acceptable_attribute_map
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!acceptable_attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreateValueRuleSetRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'account_id')
82
+ self.account_id = attributes[:'account_id']
83
+ else
84
+ self.account_id = nil
85
+ end
86
+
87
+ if attributes.key?(:'ad_account_id')
88
+ self.ad_account_id = attributes[:'ad_account_id']
89
+ else
90
+ self.ad_account_id = nil
91
+ end
92
+
93
+ if attributes.key?(:'name')
94
+ self.name = attributes[:'name']
95
+ else
96
+ self.name = nil
97
+ end
98
+
99
+ if attributes.key?(:'rules')
100
+ if (value = attributes[:'rules']).is_a?(Array)
101
+ self.rules = value
102
+ end
103
+ else
104
+ self.rules = nil
105
+ end
106
+ end
107
+
108
+ # Show invalid properties with the reasons. Usually used together with valid?
109
+ # @return Array for valid properties with the reasons
110
+ def list_invalid_properties
111
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
112
+ invalid_properties = Array.new
113
+ if @account_id.nil?
114
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
115
+ end
116
+
117
+ if @ad_account_id.nil?
118
+ invalid_properties.push('invalid value for "ad_account_id", ad_account_id cannot be nil.')
119
+ end
120
+
121
+ if @name.nil?
122
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
123
+ end
124
+
125
+ if @name.to_s.length > 255
126
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
127
+ end
128
+
129
+ if @name.to_s.length < 1
130
+ invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
131
+ end
132
+
133
+ if @rules.nil?
134
+ invalid_properties.push('invalid value for "rules", rules cannot be nil.')
135
+ end
136
+
137
+ if @rules.length > 10
138
+ invalid_properties.push('invalid value for "rules", number of items must be less than or equal to 10.')
139
+ end
140
+
141
+ if @rules.length < 1
142
+ invalid_properties.push('invalid value for "rules", number of items must be greater than or equal to 1.')
143
+ end
144
+
145
+ invalid_properties
146
+ end
147
+
148
+ # Check to see if the all the properties in the model are valid
149
+ # @return true if the model is valid
150
+ def valid?
151
+ warn '[DEPRECATED] the `valid?` method is obsolete'
152
+ return false if @account_id.nil?
153
+ return false if @ad_account_id.nil?
154
+ return false if @name.nil?
155
+ return false if @name.to_s.length > 255
156
+ return false if @name.to_s.length < 1
157
+ return false if @rules.nil?
158
+ return false if @rules.length > 10
159
+ return false if @rules.length < 1
160
+ true
161
+ end
162
+
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] account_id Value to be assigned
165
+ def account_id=(account_id)
166
+ if account_id.nil?
167
+ fail ArgumentError, 'account_id cannot be nil'
168
+ end
169
+
170
+ @account_id = account_id
171
+ end
172
+
173
+ # Custom attribute writer method with validation
174
+ # @param [Object] ad_account_id Value to be assigned
175
+ def ad_account_id=(ad_account_id)
176
+ if ad_account_id.nil?
177
+ fail ArgumentError, 'ad_account_id cannot be nil'
178
+ end
179
+
180
+ @ad_account_id = ad_account_id
181
+ end
182
+
183
+ # Custom attribute writer method with validation
184
+ # @param [Object] name Value to be assigned
185
+ def name=(name)
186
+ if name.nil?
187
+ fail ArgumentError, 'name cannot be nil'
188
+ end
189
+
190
+ if name.to_s.length > 255
191
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
192
+ end
193
+
194
+ if name.to_s.length < 1
195
+ fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
196
+ end
197
+
198
+ @name = name
199
+ end
200
+
201
+ # Custom attribute writer method with validation
202
+ # @param [Object] rules Value to be assigned
203
+ def rules=(rules)
204
+ if rules.nil?
205
+ fail ArgumentError, 'rules cannot be nil'
206
+ end
207
+
208
+ if rules.length > 10
209
+ fail ArgumentError, 'invalid value for "rules", number of items must be less than or equal to 10.'
210
+ end
211
+
212
+ if rules.length < 1
213
+ fail ArgumentError, 'invalid value for "rules", number of items must be greater than or equal to 1.'
214
+ end
215
+
216
+ @rules = rules
217
+ end
218
+
219
+ # Checks equality by comparing each attribute.
220
+ # @param [Object] Object to be compared
221
+ def ==(o)
222
+ return true if self.equal?(o)
223
+ self.class == o.class &&
224
+ account_id == o.account_id &&
225
+ ad_account_id == o.ad_account_id &&
226
+ name == o.name &&
227
+ rules == o.rules
228
+ end
229
+
230
+ # @see the `==` method
231
+ # @param [Object] Object to be compared
232
+ def eql?(o)
233
+ self == o
234
+ end
235
+
236
+ # Calculates hash code according to all attributes.
237
+ # @return [Integer] Hash code
238
+ def hash
239
+ [account_id, ad_account_id, name, rules].hash
240
+ end
241
+
242
+ # Builds the object from hash
243
+ # @param [Hash] attributes Model attributes in the form of hash
244
+ # @return [Object] Returns the model itself
245
+ def self.build_from_hash(attributes)
246
+ return nil unless attributes.is_a?(Hash)
247
+ attributes = attributes.transform_keys(&:to_sym)
248
+ transformed_hash = {}
249
+ openapi_types.each_pair do |key, type|
250
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
251
+ transformed_hash["#{key}"] = nil
252
+ elsif type =~ /\AArray<(.*)>/i
253
+ # check to ensure the input is an array given that the attribute
254
+ # is documented as an array but the input is not
255
+ if attributes[attribute_map[key]].is_a?(Array)
256
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
257
+ end
258
+ elsif !attributes[attribute_map[key]].nil?
259
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
260
+ end
261
+ end
262
+ new(transformed_hash)
263
+ end
264
+
265
+ # Returns the object in the form of hash
266
+ # @return [Hash] Returns the object in the form of hash
267
+ def to_hash
268
+ hash = {}
269
+ self.class.attribute_map.each_pair do |attr, param|
270
+ value = self.send(attr)
271
+ if value.nil?
272
+ is_nullable = self.class.openapi_nullable.include?(attr)
273
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
274
+ end
275
+
276
+ hash[param] = _to_hash(value)
277
+ end
278
+ hash
279
+ end
280
+
281
+ end
282
+
283
+ end