plainrouter-sdk 0.2.0 → 0.5.0

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 (125) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -2
  3. data/lib/plainrouter/client.rb +2 -1
  4. data/lib/plainrouter/openapi/api/action_dry_run_api_api.rb +2 -2
  5. data/lib/plainrouter/openapi/api/action_proposal_api_api.rb +2 -2
  6. data/lib/plainrouter/openapi/api/ad_test_api_api.rb +259 -0
  7. data/lib/plainrouter/openapi/api/cookie_declaration_api.rb +90 -0
  8. data/lib/plainrouter/openapi/api/creative_api.rb +181 -0
  9. data/lib/plainrouter/openapi/api/deployment_plan_api.rb +306 -0
  10. data/lib/plainrouter/openapi/api/meta_inventory_exposure_api.rb +121 -0
  11. data/lib/plainrouter/openapi/configuration.rb +42 -0
  12. data/lib/plainrouter/openapi/models/action_current_disposition.rb +13 -1
  13. data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload.rb +238 -0
  14. data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_baseline.rb +103 -0
  15. data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_baseline_any_of.rb +245 -0
  16. data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_inverse.rb +206 -0
  17. data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_metrics.rb +103 -0
  18. data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_metrics_any_of.rb +276 -0
  19. data/lib/plainrouter/openapi/models/action_policy_read_data.rb +3 -105
  20. data/lib/plainrouter/openapi/models/action_policy_result.rb +374 -0
  21. data/lib/plainrouter/openapi/models/action_proposal_input.rb +32 -4
  22. data/lib/plainrouter/openapi/models/action_read_item.rb +62 -4
  23. data/lib/plainrouter/openapi/models/action_read_item_evidence.rb +105 -0
  24. data/lib/plainrouter/openapi/models/action_read_item_evidence_any_of.rb +190 -0
  25. data/lib/plainrouter/openapi/models/action_read_item_evidence_any_of1.rb +242 -0
  26. data/lib/plainrouter/openapi/models/action_read_item_evidence_any_of2.rb +217 -0
  27. data/lib/plainrouter/openapi/models/action_read_item_evidence_any_of_outcome.rb +238 -0
  28. data/lib/plainrouter/openapi/models/action_read_item_proposer.rb +198 -0
  29. data/lib/plainrouter/openapi/models/actions_api_dry_run401_response.rb +103 -0
  30. data/lib/plainrouter/openapi/models/actions_tests_api_index404_response.rb +103 -0
  31. data/lib/plainrouter/openapi/models/actions_tests_api_store_request.rb +467 -0
  32. data/lib/plainrouter/openapi/models/actions_tests_api_store_request_maximum_spend_minor.rb +104 -0
  33. data/lib/plainrouter/openapi/models/ad_test.rb +552 -0
  34. data/lib/plainrouter/openapi/models/ad_test_create_read.rb +164 -0
  35. data/lib/plainrouter/openapi/models/ad_test_create_read_test.rb +675 -0
  36. data/lib/plainrouter/openapi/models/ad_test_create_read_test_members_inner.rb +232 -0
  37. data/lib/plainrouter/openapi/models/ad_test_create_read_test_pause_proposals_inner.rb +286 -0
  38. data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict.rb +336 -0
  39. data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_daily_facts_inner.rb +374 -0
  40. data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_halt_details.rb +285 -0
  41. data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_halt_details_baseline.rb +190 -0
  42. data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_halt_details_observed_destinations_inner.rb +216 -0
  43. data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_members_inner.rb +349 -0
  44. data/lib/plainrouter/openapi/models/ad_test_daily_fact_read.rb +374 -0
  45. data/lib/plainrouter/openapi/models/ad_test_event_choice.rb +190 -0
  46. data/lib/plainrouter/openapi/models/ad_test_list_read.rb +218 -0
  47. data/lib/plainrouter/openapi/models/ad_test_list_read_observed_conversion_events_inner.rb +190 -0
  48. data/lib/plainrouter/openapi/models/ad_test_list_read_tests.rb +396 -0
  49. data/lib/plainrouter/openapi/models/ad_test_read.rb +675 -0
  50. data/lib/plainrouter/openapi/models/ad_test_show_read.rb +164 -0
  51. data/lib/plainrouter/openapi/models/ad_test_verdict_member_read.rb +349 -0
  52. data/lib/plainrouter/openapi/models/ad_test_verdict_read.rb +336 -0
  53. data/lib/plainrouter/openapi/models/agent_credential_error.rb +214 -0
  54. data/lib/plainrouter/openapi/models/api_route_not_found.rb +216 -0
  55. data/lib/plainrouter/openapi/models/api_route_not_found_error.rb +240 -0
  56. data/lib/plainrouter/openapi/models/api_route_not_found_request.rb +190 -0
  57. data/lib/plainrouter/openapi/models/api_route_not_found_resources.rb +190 -0
  58. data/lib/plainrouter/openapi/models/cookie_declaration.rb +177 -0
  59. data/lib/plainrouter/openapi/models/cookie_declaration_categories.rb +268 -0
  60. data/lib/plainrouter/openapi/models/cookie_declaration_categories_necessary.rb +194 -0
  61. data/lib/plainrouter/openapi/models/cookie_declaration_item.rb +280 -0
  62. data/lib/plainrouter/openapi/models/create_event202_response_warnings_inner.rb +2 -2
  63. data/lib/plainrouter/openapi/models/create_event_request_any_of.rb +1 -1
  64. data/lib/plainrouter/openapi/models/create_event_request_any_of1.rb +1 -1
  65. data/lib/plainrouter/openapi/models/creative_intake_read.rb +164 -0
  66. data/lib/plainrouter/openapi/models/creative_intake_read_creative.rb +451 -0
  67. data/lib/plainrouter/openapi/models/creative_intake_read_creative_tags.rb +104 -0
  68. data/lib/plainrouter/openapi/models/creative_intake_rejected.rb +164 -0
  69. data/lib/plainrouter/openapi/models/creative_intake_rejected_error.rb +190 -0
  70. data/lib/plainrouter/openapi/models/creative_intake_tags.rb +257 -0
  71. data/lib/plainrouter/openapi/models/deployment_plan.rb +593 -0
  72. data/lib/plainrouter/openapi/models/deployment_plan_read.rb +268 -0
  73. data/lib/plainrouter/openapi/models/deployment_plan_read_copy.rb +266 -0
  74. data/lib/plainrouter/openapi/models/deployment_plan_read_creatives_inner.rb +320 -0
  75. data/lib/plainrouter/openapi/models/deployment_plan_read_creatives_inner_copy.rb +267 -0
  76. data/lib/plainrouter/openapi/models/destination_type.rb +2 -1
  77. data/lib/plainrouter/openapi/models/execute_deployment_plan_request.rb +200 -0
  78. data/lib/plainrouter/openapi/models/get_cookie_declaration404_response.rb +103 -0
  79. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response.rb +324 -0
  80. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_account.rb +264 -0
  81. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_changes_inner.rb +304 -0
  82. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_effective_range.rb +190 -0
  83. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_metrics_inner.rb +492 -0
  84. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_object_metrics_inner.rb +304 -0
  85. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_object_metrics_inner_meta.rb +268 -0
  86. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_staleness.rb +200 -0
  87. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_sync.rb +186 -0
  88. data/lib/plainrouter/openapi/models/ingestion_warning_code.rb +2 -1
  89. data/lib/plainrouter/openapi/models/launch_intent_read.rb +164 -0
  90. data/lib/plainrouter/openapi/models/launch_intent_read_intent.rb +330 -0
  91. data/lib/plainrouter/openapi/models/launch_intent_read_intent_actions_inner.rb +238 -0
  92. data/lib/plainrouter/openapi/models/launch_intent_status.rb +46 -0
  93. data/lib/plainrouter/openapi/models/launch_plans_copy403_response.rb +103 -0
  94. data/lib/plainrouter/openapi/models/launch_plans_copy404_response.rb +103 -0
  95. data/lib/plainrouter/openapi/models/launch_plans_execute422_response.rb +103 -0
  96. data/lib/plainrouter/openapi/models/launch_plans_index200_response.rb +164 -0
  97. data/lib/plainrouter/openapi/models/launch_plans_index200_response_plans.rb +244 -0
  98. data/lib/plainrouter/openapi/models/launch_plans_show200_response.rb +164 -0
  99. data/lib/plainrouter/openapi/models/plan_copy_forbidden.rb +164 -0
  100. data/lib/plainrouter/openapi/models/plan_copy_forbidden_error.rb +214 -0
  101. data/lib/plainrouter/openapi/models/plan_copy_not_found.rb +164 -0
  102. data/lib/plainrouter/openapi/models/plan_copy_not_found_error.rb +214 -0
  103. data/lib/plainrouter/openapi/models/plan_copy_read.rb +164 -0
  104. data/lib/plainrouter/openapi/models/plan_copy_read_plan.rb +347 -0
  105. data/lib/plainrouter/openapi/models/plan_copy_rejected.rb +164 -0
  106. data/lib/plainrouter/openapi/models/plan_copy_rejected_error.rb +214 -0
  107. data/lib/plainrouter/openapi/models/plan_execute_conflict.rb +164 -0
  108. data/lib/plainrouter/openapi/models/plan_execute_conflict_error.rb +214 -0
  109. data/lib/plainrouter/openapi/models/plan_execute_rejected.rb +164 -0
  110. data/lib/plainrouter/openapi/models/plan_execute_rejected_error.rb +214 -0
  111. data/lib/plainrouter/openapi/models/proposal_replay_conflict.rb +214 -0
  112. data/lib/plainrouter/openapi/models/proposal_replay_conflict_errors.rb +178 -0
  113. data/lib/plainrouter/openapi/models/store_creative403_response.rb +103 -0
  114. data/lib/plainrouter/openapi/models/store_creative413_response.rb +103 -0
  115. data/lib/plainrouter/openapi/models/store_creative422_response.rb +103 -0
  116. data/lib/plainrouter/openapi/models/store_creative_from_url_request.rb +208 -0
  117. data/lib/plainrouter/openapi/models/store_creative_from_url_request_tags.rb +257 -0
  118. data/lib/plainrouter/openapi/models/store_creative_request.rb +219 -0
  119. data/lib/plainrouter/openapi/models/store_creative_request_tags.rb +257 -0
  120. data/lib/plainrouter/openapi/models/workspace_lock_timeout.rb +164 -0
  121. data/lib/plainrouter/openapi/models/workspace_lock_timeout_error.rb +214 -0
  122. data/lib/plainrouter/openapi/version.rb +1 -1
  123. data/lib/plainrouter/openapi.rb +106 -0
  124. data/lib/plainrouter/version.rb +1 -1
  125. metadata +108 -2
@@ -0,0 +1,103 @@
1
+ =begin
2
+ #Plainrouter Conversion API
3
+
4
+ #Plainrouter public Signals Conversion API.
5
+
6
+ The version of the OpenAPI document: 0.5.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PlainRouter::OpenAPI
17
+ module ActionsApiDryRun401Response
18
+ class << self
19
+ # List of class defined in anyOf (OpenAPI v3)
20
+ def openapi_any_of
21
+ [
22
+ :'AgentCredentialError',
23
+ :'ErrorMessage'
24
+ ]
25
+ end
26
+
27
+ # Builds the object
28
+ # @param [Mixed] Data to be matched against the list of anyOf items
29
+ # @return [Object] Returns the model or the data itself
30
+ def build(data)
31
+ # Go through the list of anyOf items and attempt to identify the appropriate one.
32
+ # Note:
33
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
34
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
35
+ # - TODO: scalar values are de facto behaving as if they were nullable.
36
+ # - TODO: logging when debugging is set.
37
+ openapi_any_of.each do |klass|
38
+ begin
39
+ next if klass == :AnyType # "nullable: true"
40
+ return find_and_cast_into_type(klass, data)
41
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
42
+ end
43
+ end
44
+
45
+ openapi_any_of.include?(:AnyType) ? data : nil
46
+ end
47
+
48
+ private
49
+
50
+ SchemaMismatchError = Class.new(StandardError)
51
+
52
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
53
+ def find_and_cast_into_type(klass, data)
54
+ return if data.nil?
55
+
56
+ case klass.to_s
57
+ when 'Boolean'
58
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
59
+ when 'Float'
60
+ return data if data.instance_of?(Float)
61
+ when 'Integer'
62
+ return data if data.instance_of?(Integer)
63
+ when 'Time'
64
+ return Time.parse(data)
65
+ when 'Date'
66
+ return Date.iso8601(data)
67
+ when 'String'
68
+ return data if data.instance_of?(String)
69
+ when 'Object' # "type: object"
70
+ return data if data.instance_of?(Hash)
71
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
72
+ if data.instance_of?(Array)
73
+ sub_type = Regexp.last_match[:sub_type]
74
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
75
+ end
76
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
77
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
78
+ sub_type = Regexp.last_match[:sub_type]
79
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
80
+ end
81
+ else # model
82
+ const = PlainRouter::OpenAPI.const_get(klass)
83
+ if const
84
+ if const.respond_to?(:openapi_any_of) # nested anyOf model
85
+ model = const.build(data)
86
+ return model if model
87
+ else
88
+ # raise if data contains keys that are not known to the model
89
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
90
+ model = const.build_from_hash(data)
91
+ return model if model
92
+ end
93
+ end
94
+ end
95
+
96
+ raise # if no match by now, raise
97
+ rescue
98
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
99
+ end
100
+ end
101
+ end
102
+
103
+ end
@@ -0,0 +1,103 @@
1
+ =begin
2
+ #Plainrouter Conversion API
3
+
4
+ #Plainrouter public Signals Conversion API.
5
+
6
+ The version of the OpenAPI document: 0.5.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PlainRouter::OpenAPI
17
+ module ActionsTestsApiIndex404Response
18
+ class << self
19
+ # List of class defined in anyOf (OpenAPI v3)
20
+ def openapi_any_of
21
+ [
22
+ :'ApiRouteNotFound',
23
+ :'ErrorMessage'
24
+ ]
25
+ end
26
+
27
+ # Builds the object
28
+ # @param [Mixed] Data to be matched against the list of anyOf items
29
+ # @return [Object] Returns the model or the data itself
30
+ def build(data)
31
+ # Go through the list of anyOf items and attempt to identify the appropriate one.
32
+ # Note:
33
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
34
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
35
+ # - TODO: scalar values are de facto behaving as if they were nullable.
36
+ # - TODO: logging when debugging is set.
37
+ openapi_any_of.each do |klass|
38
+ begin
39
+ next if klass == :AnyType # "nullable: true"
40
+ return find_and_cast_into_type(klass, data)
41
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
42
+ end
43
+ end
44
+
45
+ openapi_any_of.include?(:AnyType) ? data : nil
46
+ end
47
+
48
+ private
49
+
50
+ SchemaMismatchError = Class.new(StandardError)
51
+
52
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
53
+ def find_and_cast_into_type(klass, data)
54
+ return if data.nil?
55
+
56
+ case klass.to_s
57
+ when 'Boolean'
58
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
59
+ when 'Float'
60
+ return data if data.instance_of?(Float)
61
+ when 'Integer'
62
+ return data if data.instance_of?(Integer)
63
+ when 'Time'
64
+ return Time.parse(data)
65
+ when 'Date'
66
+ return Date.iso8601(data)
67
+ when 'String'
68
+ return data if data.instance_of?(String)
69
+ when 'Object' # "type: object"
70
+ return data if data.instance_of?(Hash)
71
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
72
+ if data.instance_of?(Array)
73
+ sub_type = Regexp.last_match[:sub_type]
74
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
75
+ end
76
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
77
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
78
+ sub_type = Regexp.last_match[:sub_type]
79
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
80
+ end
81
+ else # model
82
+ const = PlainRouter::OpenAPI.const_get(klass)
83
+ if const
84
+ if const.respond_to?(:openapi_any_of) # nested anyOf model
85
+ model = const.build(data)
86
+ return model if model
87
+ else
88
+ # raise if data contains keys that are not known to the model
89
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
90
+ model = const.build_from_hash(data)
91
+ return model if model
92
+ end
93
+ end
94
+ end
95
+
96
+ raise # if no match by now, raise
97
+ rescue
98
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
99
+ end
100
+ end
101
+ end
102
+
103
+ end
@@ -0,0 +1,467 @@
1
+ =begin
2
+ #Plainrouter Conversion API
3
+
4
+ #Plainrouter public Signals Conversion API.
5
+
6
+ The version of the OpenAPI document: 0.5.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PlainRouter::OpenAPI
17
+ class ActionsTestsApiStoreRequest < ApiModelBase
18
+ attr_accessor :platform_ad_account_id
19
+
20
+ attr_accessor :ad_set_id
21
+
22
+ # Two to four distinct Meta ad IDs shown in the selected ad set inventory.
23
+ attr_accessor :member_ad_ids
24
+
25
+ attr_accessor :axis
26
+
27
+ # An observed workspace conversion event other than PageView.
28
+ attr_accessor :event_name
29
+
30
+ # Optional override; default 50 counted arrivals per member.
31
+ attr_accessor :arrivals_floor
32
+
33
+ # Optional override; default 10 recorded conversions for a winner.
34
+ attr_accessor :minimum_conversions
35
+
36
+ # Optional override; default 14 complete account-local days.
37
+ attr_accessor :maximum_days
38
+
39
+ attr_accessor :maximum_spend_minor
40
+
41
+ class EnumAttributeValidator
42
+ attr_reader :datatype
43
+ attr_reader :allowable_values
44
+
45
+ def initialize(datatype, allowable_values)
46
+ @allowable_values = allowable_values.map do |value|
47
+ case datatype.to_s
48
+ when /Integer/i
49
+ value.to_i
50
+ when /Float/i
51
+ value.to_f
52
+ else
53
+ value
54
+ end
55
+ end
56
+ end
57
+
58
+ def valid?(value)
59
+ !value || allowable_values.include?(value)
60
+ end
61
+ end
62
+
63
+ # Attribute mapping from ruby-style variable name to JSON key.
64
+ def self.attribute_map
65
+ {
66
+ :'platform_ad_account_id' => :'platform_ad_account_id',
67
+ :'ad_set_id' => :'ad_set_id',
68
+ :'member_ad_ids' => :'member_ad_ids',
69
+ :'axis' => :'axis',
70
+ :'event_name' => :'event_name',
71
+ :'arrivals_floor' => :'arrivals_floor',
72
+ :'minimum_conversions' => :'minimum_conversions',
73
+ :'maximum_days' => :'maximum_days',
74
+ :'maximum_spend_minor' => :'maximum_spend_minor'
75
+ }
76
+ end
77
+
78
+ # Returns attribute mapping this model knows about
79
+ def self.acceptable_attribute_map
80
+ attribute_map
81
+ end
82
+
83
+ # Returns all the JSON keys this model knows about
84
+ def self.acceptable_attributes
85
+ acceptable_attribute_map.values
86
+ end
87
+
88
+ # Attribute type mapping.
89
+ def self.openapi_types
90
+ {
91
+ :'platform_ad_account_id' => :'Integer',
92
+ :'ad_set_id' => :'String',
93
+ :'member_ad_ids' => :'Array<String>',
94
+ :'axis' => :'String',
95
+ :'event_name' => :'String',
96
+ :'arrivals_floor' => :'Integer',
97
+ :'minimum_conversions' => :'Integer',
98
+ :'maximum_days' => :'Integer',
99
+ :'maximum_spend_minor' => :'ActionsTestsApiStoreRequestMaximumSpendMinor'
100
+ }
101
+ end
102
+
103
+ # List of attributes with nullable: true
104
+ def self.openapi_nullable
105
+ Set.new([
106
+ :'maximum_spend_minor'
107
+ ])
108
+ end
109
+
110
+ # Initializes the object
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ def initialize(attributes = {})
113
+ if (!attributes.is_a?(Hash))
114
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionsTestsApiStoreRequest` initialize method"
115
+ end
116
+
117
+ # check to see if the attribute exists and convert string to symbol for hash key
118
+ acceptable_attribute_map = self.class.acceptable_attribute_map
119
+ attributes = attributes.each_with_object({}) { |(k, v), h|
120
+ if (!acceptable_attribute_map.key?(k.to_sym))
121
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::ActionsTestsApiStoreRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
122
+ end
123
+ h[k.to_sym] = v
124
+ }
125
+
126
+ if attributes.key?(:'platform_ad_account_id')
127
+ self.platform_ad_account_id = attributes[:'platform_ad_account_id']
128
+ else
129
+ self.platform_ad_account_id = nil
130
+ end
131
+
132
+ if attributes.key?(:'ad_set_id')
133
+ self.ad_set_id = attributes[:'ad_set_id']
134
+ else
135
+ self.ad_set_id = nil
136
+ end
137
+
138
+ if attributes.key?(:'member_ad_ids')
139
+ if (value = attributes[:'member_ad_ids']).is_a?(Array)
140
+ self.member_ad_ids = value
141
+ end
142
+ else
143
+ self.member_ad_ids = nil
144
+ end
145
+
146
+ if attributes.key?(:'axis')
147
+ self.axis = attributes[:'axis']
148
+ else
149
+ self.axis = nil
150
+ end
151
+
152
+ if attributes.key?(:'event_name')
153
+ self.event_name = attributes[:'event_name']
154
+ else
155
+ self.event_name = nil
156
+ end
157
+
158
+ if attributes.key?(:'arrivals_floor')
159
+ self.arrivals_floor = attributes[:'arrivals_floor']
160
+ end
161
+
162
+ if attributes.key?(:'minimum_conversions')
163
+ self.minimum_conversions = attributes[:'minimum_conversions']
164
+ end
165
+
166
+ if attributes.key?(:'maximum_days')
167
+ self.maximum_days = attributes[:'maximum_days']
168
+ end
169
+
170
+ if attributes.key?(:'maximum_spend_minor')
171
+ self.maximum_spend_minor = attributes[:'maximum_spend_minor']
172
+ end
173
+ end
174
+
175
+ # Show invalid properties with the reasons. Usually used together with valid?
176
+ # @return Array for valid properties with the reasons
177
+ def list_invalid_properties
178
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
179
+ invalid_properties = Array.new
180
+ if @platform_ad_account_id.nil?
181
+ invalid_properties.push('invalid value for "platform_ad_account_id", platform_ad_account_id cannot be nil.')
182
+ end
183
+
184
+ if @platform_ad_account_id < 1
185
+ invalid_properties.push('invalid value for "platform_ad_account_id", must be greater than or equal to 1.')
186
+ end
187
+
188
+ if @ad_set_id.nil?
189
+ invalid_properties.push('invalid value for "ad_set_id", ad_set_id cannot be nil.')
190
+ end
191
+
192
+ if @ad_set_id.to_s.length > 128
193
+ invalid_properties.push('invalid value for "ad_set_id", the character length must be smaller than or equal to 128.')
194
+ end
195
+
196
+ pattern = Regexp.new(/^[0-9]+$/)
197
+ if @ad_set_id !~ pattern
198
+ invalid_properties.push("invalid value for \"ad_set_id\", must conform to the pattern #{pattern}.")
199
+ end
200
+
201
+ if @member_ad_ids.nil?
202
+ invalid_properties.push('invalid value for "member_ad_ids", member_ad_ids cannot be nil.')
203
+ end
204
+
205
+ if @member_ad_ids.length > 4
206
+ invalid_properties.push('invalid value for "member_ad_ids", number of items must be less than or equal to 4.')
207
+ end
208
+
209
+ if @member_ad_ids.length < 2
210
+ invalid_properties.push('invalid value for "member_ad_ids", number of items must be greater than or equal to 2.')
211
+ end
212
+
213
+ if @axis.nil?
214
+ invalid_properties.push('invalid value for "axis", axis cannot be nil.')
215
+ end
216
+
217
+ if @event_name.nil?
218
+ invalid_properties.push('invalid value for "event_name", event_name cannot be nil.')
219
+ end
220
+
221
+ if @event_name.to_s.length > 255
222
+ invalid_properties.push('invalid value for "event_name", the character length must be smaller than or equal to 255.')
223
+ end
224
+
225
+ if @event_name.to_s.length < 1
226
+ invalid_properties.push('invalid value for "event_name", the character length must be greater than or equal to 1.')
227
+ end
228
+
229
+ if !@arrivals_floor.nil? && @arrivals_floor < 50
230
+ invalid_properties.push('invalid value for "arrivals_floor", must be greater than or equal to 50.')
231
+ end
232
+
233
+ if !@minimum_conversions.nil? && @minimum_conversions < 1
234
+ invalid_properties.push('invalid value for "minimum_conversions", must be greater than or equal to 1.')
235
+ end
236
+
237
+ if !@maximum_days.nil? && @maximum_days > 30
238
+ invalid_properties.push('invalid value for "maximum_days", must be smaller than or equal to 30.')
239
+ end
240
+
241
+ if !@maximum_days.nil? && @maximum_days < 3
242
+ invalid_properties.push('invalid value for "maximum_days", must be greater than or equal to 3.')
243
+ end
244
+
245
+ invalid_properties
246
+ end
247
+
248
+ # Check to see if the all the properties in the model are valid
249
+ # @return true if the model is valid
250
+ def valid?
251
+ warn '[DEPRECATED] the `valid?` method is obsolete'
252
+ return false if @platform_ad_account_id.nil?
253
+ return false if @platform_ad_account_id < 1
254
+ return false if @ad_set_id.nil?
255
+ return false if @ad_set_id.to_s.length > 128
256
+ return false if @ad_set_id !~ Regexp.new(/^[0-9]+$/)
257
+ return false if @member_ad_ids.nil?
258
+ return false if @member_ad_ids.length > 4
259
+ return false if @member_ad_ids.length < 2
260
+ return false if @axis.nil?
261
+ axis_validator = EnumAttributeValidator.new('String', ["hook", "angle", "visual", "offer", "format", "landing"])
262
+ return false unless axis_validator.valid?(@axis)
263
+ return false if @event_name.nil?
264
+ return false if @event_name.to_s.length > 255
265
+ return false if @event_name.to_s.length < 1
266
+ return false if !@arrivals_floor.nil? && @arrivals_floor < 50
267
+ return false if !@minimum_conversions.nil? && @minimum_conversions < 1
268
+ return false if !@maximum_days.nil? && @maximum_days > 30
269
+ return false if !@maximum_days.nil? && @maximum_days < 3
270
+ true
271
+ end
272
+
273
+ # Custom attribute writer method with validation
274
+ # @param [Object] platform_ad_account_id Value to be assigned
275
+ def platform_ad_account_id=(platform_ad_account_id)
276
+ if platform_ad_account_id.nil?
277
+ fail ArgumentError, 'platform_ad_account_id cannot be nil'
278
+ end
279
+
280
+ if platform_ad_account_id < 1
281
+ fail ArgumentError, 'invalid value for "platform_ad_account_id", must be greater than or equal to 1.'
282
+ end
283
+
284
+ @platform_ad_account_id = platform_ad_account_id
285
+ end
286
+
287
+ # Custom attribute writer method with validation
288
+ # @param [Object] ad_set_id Value to be assigned
289
+ def ad_set_id=(ad_set_id)
290
+ if ad_set_id.nil?
291
+ fail ArgumentError, 'ad_set_id cannot be nil'
292
+ end
293
+
294
+ if ad_set_id.to_s.length > 128
295
+ fail ArgumentError, 'invalid value for "ad_set_id", the character length must be smaller than or equal to 128.'
296
+ end
297
+
298
+ pattern = Regexp.new(/^[0-9]+$/)
299
+ if ad_set_id !~ pattern
300
+ fail ArgumentError, "invalid value for \"ad_set_id\", must conform to the pattern #{pattern}."
301
+ end
302
+
303
+ @ad_set_id = ad_set_id
304
+ end
305
+
306
+ # Custom attribute writer method with validation
307
+ # @param [Object] member_ad_ids Value to be assigned
308
+ def member_ad_ids=(member_ad_ids)
309
+ if member_ad_ids.nil?
310
+ fail ArgumentError, 'member_ad_ids cannot be nil'
311
+ end
312
+
313
+ if member_ad_ids.length > 4
314
+ fail ArgumentError, 'invalid value for "member_ad_ids", number of items must be less than or equal to 4.'
315
+ end
316
+
317
+ if member_ad_ids.length < 2
318
+ fail ArgumentError, 'invalid value for "member_ad_ids", number of items must be greater than or equal to 2.'
319
+ end
320
+
321
+ @member_ad_ids = member_ad_ids
322
+ end
323
+
324
+ # Custom attribute writer method checking allowed values (enum).
325
+ # @param [Object] axis Object to be assigned
326
+ def axis=(axis)
327
+ validator = EnumAttributeValidator.new('String', ["hook", "angle", "visual", "offer", "format", "landing"])
328
+ unless validator.valid?(axis)
329
+ fail ArgumentError, "invalid value for \"axis\", must be one of #{validator.allowable_values}."
330
+ end
331
+ @axis = axis
332
+ end
333
+
334
+ # Custom attribute writer method with validation
335
+ # @param [Object] event_name Value to be assigned
336
+ def event_name=(event_name)
337
+ if event_name.nil?
338
+ fail ArgumentError, 'event_name cannot be nil'
339
+ end
340
+
341
+ if event_name.to_s.length > 255
342
+ fail ArgumentError, 'invalid value for "event_name", the character length must be smaller than or equal to 255.'
343
+ end
344
+
345
+ if event_name.to_s.length < 1
346
+ fail ArgumentError, 'invalid value for "event_name", the character length must be greater than or equal to 1.'
347
+ end
348
+
349
+ @event_name = event_name
350
+ end
351
+
352
+ # Custom attribute writer method with validation
353
+ # @param [Object] arrivals_floor Value to be assigned
354
+ def arrivals_floor=(arrivals_floor)
355
+ if arrivals_floor.nil?
356
+ fail ArgumentError, 'arrivals_floor cannot be nil'
357
+ end
358
+
359
+ if arrivals_floor < 50
360
+ fail ArgumentError, 'invalid value for "arrivals_floor", must be greater than or equal to 50.'
361
+ end
362
+
363
+ @arrivals_floor = arrivals_floor
364
+ end
365
+
366
+ # Custom attribute writer method with validation
367
+ # @param [Object] minimum_conversions Value to be assigned
368
+ def minimum_conversions=(minimum_conversions)
369
+ if minimum_conversions.nil?
370
+ fail ArgumentError, 'minimum_conversions cannot be nil'
371
+ end
372
+
373
+ if minimum_conversions < 1
374
+ fail ArgumentError, 'invalid value for "minimum_conversions", must be greater than or equal to 1.'
375
+ end
376
+
377
+ @minimum_conversions = minimum_conversions
378
+ end
379
+
380
+ # Custom attribute writer method with validation
381
+ # @param [Object] maximum_days Value to be assigned
382
+ def maximum_days=(maximum_days)
383
+ if maximum_days.nil?
384
+ fail ArgumentError, 'maximum_days cannot be nil'
385
+ end
386
+
387
+ if maximum_days > 30
388
+ fail ArgumentError, 'invalid value for "maximum_days", must be smaller than or equal to 30.'
389
+ end
390
+
391
+ if maximum_days < 3
392
+ fail ArgumentError, 'invalid value for "maximum_days", must be greater than or equal to 3.'
393
+ end
394
+
395
+ @maximum_days = maximum_days
396
+ end
397
+
398
+ # Checks equality by comparing each attribute.
399
+ # @param [Object] Object to be compared
400
+ def ==(o)
401
+ return true if self.equal?(o)
402
+ self.class == o.class &&
403
+ platform_ad_account_id == o.platform_ad_account_id &&
404
+ ad_set_id == o.ad_set_id &&
405
+ member_ad_ids == o.member_ad_ids &&
406
+ axis == o.axis &&
407
+ event_name == o.event_name &&
408
+ arrivals_floor == o.arrivals_floor &&
409
+ minimum_conversions == o.minimum_conversions &&
410
+ maximum_days == o.maximum_days &&
411
+ maximum_spend_minor == o.maximum_spend_minor
412
+ end
413
+
414
+ # @see the `==` method
415
+ # @param [Object] Object to be compared
416
+ def eql?(o)
417
+ self == o
418
+ end
419
+
420
+ # Calculates hash code according to all attributes.
421
+ # @return [Integer] Hash code
422
+ def hash
423
+ [platform_ad_account_id, ad_set_id, member_ad_ids, axis, event_name, arrivals_floor, minimum_conversions, maximum_days, maximum_spend_minor].hash
424
+ end
425
+
426
+ # Builds the object from hash
427
+ # @param [Hash] attributes Model attributes in the form of hash
428
+ # @return [Object] Returns the model itself
429
+ def self.build_from_hash(attributes)
430
+ return nil unless attributes.is_a?(Hash)
431
+ attributes = attributes.transform_keys(&:to_sym)
432
+ transformed_hash = {}
433
+ openapi_types.each_pair do |key, type|
434
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
435
+ transformed_hash["#{key}"] = nil
436
+ elsif type =~ /\AArray<(.*)>/i
437
+ # check to ensure the input is an array given that the attribute
438
+ # is documented as an array but the input is not
439
+ if attributes[attribute_map[key]].is_a?(Array)
440
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
441
+ end
442
+ elsif !attributes[attribute_map[key]].nil?
443
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
444
+ end
445
+ end
446
+ new(transformed_hash)
447
+ end
448
+
449
+ # Returns the object in the form of hash
450
+ # @return [Hash] Returns the object in the form of hash
451
+ def to_hash
452
+ hash = {}
453
+ self.class.attribute_map.each_pair do |attr, param|
454
+ value = self.send(attr)
455
+ if value.nil?
456
+ is_nullable = self.class.openapi_nullable.include?(attr)
457
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
458
+ end
459
+
460
+ hash[param] = _to_hash(value)
461
+ end
462
+ hash
463
+ end
464
+
465
+ end
466
+
467
+ end