plainrouter-sdk 0.5.0 → 0.6.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 (148) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -0
  3. data/lib/plainrouter/client.rb +337 -3
  4. data/lib/plainrouter/closed_input_objects.json +3896 -0
  5. data/lib/plainrouter/closed_input_validator.rb +246 -0
  6. data/lib/plainrouter/integer_input_fields.json +579 -0
  7. data/lib/plainrouter/openapi/api/action_read_api_api.rb +71 -31
  8. data/lib/plainrouter/openapi/api/action_rule_api_api.rb +350 -0
  9. data/lib/plainrouter/openapi/api/ad_test_api_api.rb +13 -9
  10. data/lib/plainrouter/openapi/api/agent_context_api.rb +93 -0
  11. data/lib/plainrouter/openapi/api/creative_api.rb +241 -0
  12. data/lib/plainrouter/openapi/api/deployment_plan_api.rb +257 -2
  13. data/lib/plainrouter/openapi/api/draft_batch_file_import_api.rb +142 -0
  14. data/lib/plainrouter/openapi/api/launch_policy_api.rb +242 -0
  15. data/lib/plainrouter/openapi/api/meta_inventory_exposure_api.rb +133 -0
  16. data/lib/plainrouter/openapi/api_client.rb +3 -0
  17. data/lib/plainrouter/openapi/api_model_base.rb +2 -0
  18. data/lib/plainrouter/openapi/configuration.rb +34 -0
  19. data/lib/plainrouter/openapi/models/action_batch_read_data.rb +42 -4
  20. data/lib/plainrouter/openapi/models/action_dry_run_read_dry_run.rb +42 -4
  21. data/lib/plainrouter/openapi/models/action_list_read_meta.rb +33 -4
  22. data/lib/plainrouter/openapi/models/action_proposal_input.rb +72 -1
  23. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner.rb +1 -0
  24. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of.rb +2 -0
  25. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of1.rb +2 -0
  26. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of10.rb +2 -0
  27. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of10_params.rb +2 -0
  28. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of11.rb +3 -1
  29. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of12.rb +2 -0
  30. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of12_params.rb +2 -0
  31. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of13.rb +2 -0
  32. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of13_params.rb +2 -0
  33. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of2.rb +2 -0
  34. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of3.rb +2 -0
  35. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of4.rb +2 -0
  36. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of4_target_entity.rb +2 -0
  37. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of5.rb +2 -0
  38. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of6.rb +2 -0
  39. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of7.rb +2 -0
  40. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of8.rb +2 -0
  41. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of9.rb +2 -0
  42. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of_params.rb +2 -0
  43. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of_target_entity.rb +2 -0
  44. data/lib/plainrouter/openapi/models/action_proposal_input_evidence_inner.rb +4 -2
  45. data/lib/plainrouter/openapi/models/action_proposal_read_proposal.rb +42 -4
  46. data/lib/plainrouter/openapi/models/action_read_item.rb +11 -1
  47. data/lib/plainrouter/openapi/models/action_read_item_counted_evidence.rb +319 -0
  48. data/lib/plainrouter/openapi/models/action_read_item_counted_evidence_counted.rb +174 -0
  49. data/lib/plainrouter/openapi/models/action_read_item_counted_evidence_coverage.rb +162 -0
  50. data/lib/plainrouter/openapi/models/action_read_item_counted_evidence_meta_reported.rb +198 -0
  51. data/lib/plainrouter/openapi/models/{action_proposal_input_actions_inner_any_of11_params.rb → action_read_item_counted_evidence_target.rb} +41 -24
  52. data/lib/plainrouter/openapi/models/action_read_item_counted_evidence_window.rb +225 -0
  53. data/lib/plainrouter/openapi/models/action_receipt_unavailable.rb +164 -0
  54. data/lib/plainrouter/openapi/models/action_receipt_unavailable_error.rb +214 -0
  55. data/lib/plainrouter/openapi/models/action_rule_detail_read.rb +164 -0
  56. data/lib/plainrouter/openapi/models/action_rule_detail_read_rule.rb +402 -0
  57. data/lib/plainrouter/openapi/models/action_rule_detail_read_rule_current_revision.rb +388 -0
  58. data/lib/plainrouter/openapi/models/action_rule_detail_read_rule_runs_inner.rb +396 -0
  59. data/lib/plainrouter/openapi/models/action_rule_detail_read_rule_runs_inner_decisions_inner.rb +382 -0
  60. data/lib/plainrouter/openapi/models/action_rule_detail_read_rule_window.rb +242 -0
  61. data/lib/plainrouter/openapi/models/action_rule_write_read.rb +164 -0
  62. data/lib/plainrouter/openapi/models/action_rule_write_read_rule.rb +373 -0
  63. data/lib/plainrouter/openapi/models/actions_api_decision_receipt404_response.rb +103 -0
  64. data/lib/plainrouter/openapi/models/actions_rules_index200_response.rb +164 -0
  65. data/lib/plainrouter/openapi/models/actions_rules_index200_response_rules.rb +196 -0
  66. data/lib/plainrouter/openapi/models/actions_rules_index200_response_rules_data_inner.rb +344 -0
  67. data/lib/plainrouter/openapi/models/actions_rules_index200_response_rules_data_inner_account.rb +157 -0
  68. data/lib/plainrouter/openapi/models/actions_rules_index200_response_rules_data_inner_counts.rb +156 -0
  69. data/lib/plainrouter/openapi/models/actions_rules_index403_response.rb +103 -0
  70. data/lib/plainrouter/openapi/models/actions_rules_index403_response_any_of.rb +214 -0
  71. data/lib/plainrouter/openapi/models/actions_rules_store_request.rb +317 -0
  72. data/lib/plainrouter/openapi/models/actions_rules_store_request_definition.rb +105 -0
  73. data/lib/plainrouter/openapi/models/actions_rules_store_request_definition_any_of.rb +317 -0
  74. data/lib/plainrouter/openapi/models/actions_rules_store_request_definition_any_of1.rb +361 -0
  75. data/lib/plainrouter/openapi/models/actions_rules_store_request_definition_any_of2.rb +361 -0
  76. data/lib/plainrouter/openapi/models/actions_rules_store_request_definition_any_of_cost_ratio.rb +104 -0
  77. data/lib/plainrouter/openapi/models/actions_rules_store_request_window.rb +103 -0
  78. data/lib/plainrouter/openapi/models/actions_rules_update_request.rb +267 -0
  79. data/lib/plainrouter/openapi/models/actions_rules_update_request_definition.rb +105 -0
  80. data/lib/plainrouter/openapi/models/actions_rules_update_request_definition_any_of.rb +317 -0
  81. data/lib/plainrouter/openapi/models/actions_rules_update_request_definition_any_of1.rb +361 -0
  82. data/lib/plainrouter/openapi/models/actions_rules_update_request_definition_any_of2.rb +361 -0
  83. data/lib/plainrouter/openapi/models/ad_test_list_read_tests.rb +1 -1
  84. data/lib/plainrouter/openapi/models/agent_context200_response.rb +214 -0
  85. data/lib/plainrouter/openapi/models/agent_context200_response_agent.rb +268 -0
  86. data/lib/plainrouter/openapi/models/agent_context200_response_platform_ad_account.rb +292 -0
  87. data/lib/plainrouter/openapi/models/agent_context200_response_platform_ad_account_workspace.rb +190 -0
  88. data/lib/plainrouter/openapi/models/agent_context401_response.rb +103 -0
  89. data/lib/plainrouter/openapi/models/agent_context_auth_error.rb +190 -0
  90. data/lib/plainrouter/openapi/models/creative_intake_read.rb +1 -1
  91. data/lib/plainrouter/openapi/models/creative_mcp_grant_operation.rb +44 -0
  92. data/lib/plainrouter/openapi/models/creative_mcp_preview.rb +283 -0
  93. data/lib/plainrouter/openapi/models/creative_mcp_refusal.rb +45 -0
  94. data/lib/plainrouter/openapi/models/creative_mcp_tool.rb +44 -0
  95. data/lib/plainrouter/openapi/models/delivery_status.rb +2 -1
  96. data/lib/plainrouter/openapi/models/deployment_plan_read.rb +42 -4
  97. data/lib/plainrouter/openapi/models/destination.rb +73 -9
  98. data/lib/plainrouter/openapi/models/destination_config.rb +103 -0
  99. data/lib/plainrouter/openapi/models/destination_status.rb +2 -1
  100. data/lib/plainrouter/openapi/models/draft_batch_mode.rb +41 -0
  101. data/lib/plainrouter/openapi/models/get_account_inventory200_response.rb +341 -0
  102. data/lib/plainrouter/openapi/models/get_account_inventory200_response_summary.rb +158 -0
  103. data/lib/plainrouter/openapi/models/get_account_inventory404_response.rb +188 -0
  104. data/lib/plainrouter/openapi/models/get_event200_response_deliveries_inner.rb +25 -1
  105. data/lib/plainrouter/openapi/models/get_event200_response_event_deliveries_inner.rb +25 -1
  106. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response.rb +26 -5
  107. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_pagination_value.rb +202 -0
  108. data/lib/plainrouter/openapi/models/launch_creatives_index200_response.rb +164 -0
  109. data/lib/plainrouter/openapi/models/launch_creatives_index200_response_creatives.rb +196 -0
  110. data/lib/plainrouter/openapi/models/{creative_intake_read_creative.rb → launch_creatives_index200_response_creatives_data_inner.rb} +4 -4
  111. data/lib/plainrouter/openapi/models/{creative_intake_read_creative_tags.rb → launch_creatives_index200_response_creatives_data_inner_tags.rb} +1 -1
  112. data/lib/plainrouter/openapi/models/launch_creatives_status200_response.rb +166 -0
  113. data/lib/plainrouter/openapi/models/launch_plans_copy422_response.rb +103 -0
  114. data/lib/plainrouter/openapi/models/launch_plans_index200_response_plans.rb +107 -4
  115. data/lib/plainrouter/openapi/models/launch_plans_index200_response_plans_next_page_arguments.rb +104 -0
  116. data/lib/plainrouter/openapi/models/launch_plans_index200_response_plans_next_page_arguments_any_of.rb +190 -0
  117. data/lib/plainrouter/openapi/models/launch_plans_index200_response_plans_next_page_arguments_any_of1.rb +190 -0
  118. data/lib/plainrouter/openapi/models/launch_plans_store201_response.rb +166 -0
  119. data/lib/plainrouter/openapi/models/launch_plans_validate422_response.rb +103 -0
  120. data/lib/plainrouter/openapi/models/launch_policies_index200_response.rb +164 -0
  121. data/lib/plainrouter/openapi/models/launch_policies_index200_response_policies.rb +453 -0
  122. data/lib/plainrouter/openapi/models/{list_events200_response_events_links_inner.rb → launch_policies_index200_response_policies_links_inner.rb} +3 -3
  123. data/lib/plainrouter/openapi/models/launch_policies_store201_response.rb +166 -0
  124. data/lib/plainrouter/openapi/models/launch_policy.rb +346 -0
  125. data/lib/plainrouter/openapi/models/launcher_file_import403_response.rb +216 -0
  126. data/lib/plainrouter/openapi/models/launcher_file_import422_response.rb +103 -0
  127. data/lib/plainrouter/openapi/models/launcher_file_import422_response_any_of.rb +242 -0
  128. data/lib/plainrouter/openapi/models/launcher_file_import422_response_any_of_syntactic_row_failures_inner.rb +190 -0
  129. data/lib/plainrouter/openapi/models/list_events200_response_events.rb +1 -1
  130. data/lib/plainrouter/openapi/models/plan_execute_rejected_error.rb +2 -2
  131. data/lib/plainrouter/openapi/models/plan_validate_rejected.rb +164 -0
  132. data/lib/plainrouter/openapi/models/plan_validate_rejected_error.rb +191 -0
  133. data/lib/plainrouter/openapi/models/proposal_unavailable.rb +164 -0
  134. data/lib/plainrouter/openapi/models/proposal_unavailable_error.rb +214 -0
  135. data/lib/plainrouter/openapi/models/set_destination_test_mode200_response_destination.rb +67 -1
  136. data/lib/plainrouter/openapi/models/{deployment_plan.rb → store_deployment_plan_request.rb} +185 -208
  137. data/lib/plainrouter/openapi/models/store_deployment_plan_request_ad_set_spec.rb +220 -0
  138. data/lib/plainrouter/openapi/models/store_deployment_plan_request_copy.rb +266 -0
  139. data/lib/plainrouter/openapi/models/store_deployment_plan_request_creative_overrides_inner.rb +217 -0
  140. data/lib/plainrouter/openapi/models/store_launch_policy_request.rb +260 -0
  141. data/lib/plainrouter/openapi/models/update_creative_status_request.rb +188 -0
  142. data/lib/plainrouter/openapi/models/update_deployment_plan_request.rb +511 -0
  143. data/lib/plainrouter/openapi/version.rb +1 -1
  144. data/lib/plainrouter/openapi.rb +87 -5
  145. data/lib/plainrouter/proposal_errors.rb +31 -0
  146. data/lib/plainrouter/version.rb +1 -1
  147. data/lib/plainrouter.rb +1 -0
  148. metadata +93 -7
@@ -0,0 +1,220 @@
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
+ # Budget fields use positive whole Meta minor units. JSON booleans return 422 with field errors; digit-only strings retain their existing normalization.
18
+ class StoreDeploymentPlanRequestAdSetSpec < ApiModelBase
19
+ attr_accessor :daily_budget
20
+
21
+ attr_accessor :bid_amount
22
+
23
+ attr_accessor :lifetime_budget
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'daily_budget' => :'daily_budget',
29
+ :'bid_amount' => :'bid_amount',
30
+ :'lifetime_budget' => :'lifetime_budget'
31
+ }
32
+ end
33
+
34
+ # Returns attribute mapping this model knows about
35
+ def self.acceptable_attribute_map
36
+ attribute_map
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ acceptable_attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'daily_budget' => :'Integer',
48
+ :'bid_amount' => :'Integer',
49
+ :'lifetime_budget' => :'Integer'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ :'lifetime_budget'
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::StoreDeploymentPlanRequestAdSetSpec` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ acceptable_attribute_map = self.class.acceptable_attribute_map
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!acceptable_attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::StoreDeploymentPlanRequestAdSetSpec`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'daily_budget')
77
+ self.daily_budget = attributes[:'daily_budget']
78
+ end
79
+
80
+ if attributes.key?(:'bid_amount')
81
+ self.bid_amount = attributes[:'bid_amount']
82
+ end
83
+
84
+ if attributes.key?(:'lifetime_budget')
85
+ self.lifetime_budget = attributes[:'lifetime_budget']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
93
+ invalid_properties = Array.new
94
+ if !@daily_budget.nil? && @daily_budget < 1
95
+ invalid_properties.push('invalid value for "daily_budget", must be greater than or equal to 1.')
96
+ end
97
+
98
+ if !@bid_amount.nil? && @bid_amount < 1
99
+ invalid_properties.push('invalid value for "bid_amount", must be greater than or equal to 1.')
100
+ end
101
+
102
+ if !@lifetime_budget.nil? && @lifetime_budget < 1
103
+ invalid_properties.push('invalid value for "lifetime_budget", must be greater than or equal to 1.')
104
+ end
105
+
106
+ invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ warn '[DEPRECATED] the `valid?` method is obsolete'
113
+ return false if !@daily_budget.nil? && @daily_budget < 1
114
+ return false if !@bid_amount.nil? && @bid_amount < 1
115
+ return false if !@lifetime_budget.nil? && @lifetime_budget < 1
116
+ true
117
+ end
118
+
119
+ # Custom attribute writer method with validation
120
+ # @param [Object] daily_budget Value to be assigned
121
+ def daily_budget=(daily_budget)
122
+ if daily_budget.nil?
123
+ fail ArgumentError, 'daily_budget cannot be nil'
124
+ end
125
+
126
+ if daily_budget < 1
127
+ fail ArgumentError, 'invalid value for "daily_budget", must be greater than or equal to 1.'
128
+ end
129
+
130
+ @daily_budget = daily_budget
131
+ end
132
+
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] bid_amount Value to be assigned
135
+ def bid_amount=(bid_amount)
136
+ if bid_amount.nil?
137
+ fail ArgumentError, 'bid_amount cannot be nil'
138
+ end
139
+
140
+ if bid_amount < 1
141
+ fail ArgumentError, 'invalid value for "bid_amount", must be greater than or equal to 1.'
142
+ end
143
+
144
+ @bid_amount = bid_amount
145
+ end
146
+
147
+ # Custom attribute writer method with validation
148
+ # @param [Object] lifetime_budget Value to be assigned
149
+ def lifetime_budget=(lifetime_budget)
150
+ if !lifetime_budget.nil? && lifetime_budget < 1
151
+ fail ArgumentError, 'invalid value for "lifetime_budget", must be greater than or equal to 1.'
152
+ end
153
+
154
+ @lifetime_budget = lifetime_budget
155
+ end
156
+
157
+ # Checks equality by comparing each attribute.
158
+ # @param [Object] Object to be compared
159
+ def ==(o)
160
+ return true if self.equal?(o)
161
+ self.class == o.class &&
162
+ daily_budget == o.daily_budget &&
163
+ bid_amount == o.bid_amount &&
164
+ lifetime_budget == o.lifetime_budget
165
+ end
166
+
167
+ # @see the `==` method
168
+ # @param [Object] Object to be compared
169
+ def eql?(o)
170
+ self == o
171
+ end
172
+
173
+ # Calculates hash code according to all attributes.
174
+ # @return [Integer] Hash code
175
+ def hash
176
+ [daily_budget, bid_amount, lifetime_budget].hash
177
+ end
178
+
179
+ # Builds the object from hash
180
+ # @param [Hash] attributes Model attributes in the form of hash
181
+ # @return [Object] Returns the model itself
182
+ def self.build_from_hash(attributes)
183
+ return nil unless attributes.is_a?(Hash)
184
+ attributes = attributes.transform_keys(&:to_sym)
185
+ transformed_hash = {}
186
+ openapi_types.each_pair do |key, type|
187
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
188
+ transformed_hash["#{key}"] = nil
189
+ elsif type =~ /\AArray<(.*)>/i
190
+ # check to ensure the input is an array given that the attribute
191
+ # is documented as an array but the input is not
192
+ if attributes[attribute_map[key]].is_a?(Array)
193
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
194
+ end
195
+ elsif !attributes[attribute_map[key]].nil?
196
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
197
+ end
198
+ end
199
+ new(transformed_hash)
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ if value.nil?
209
+ is_nullable = self.class.openapi_nullable.include?(attr)
210
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
211
+ end
212
+
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ end
219
+
220
+ end
@@ -0,0 +1,266 @@
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 StoreDeploymentPlanRequestCopy < ApiModelBase
18
+ attr_accessor :primary_text
19
+
20
+ attr_accessor :headline
21
+
22
+ attr_accessor :description
23
+
24
+ attr_accessor :cta
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'primary_text' => :'primary_text',
52
+ :'headline' => :'headline',
53
+ :'description' => :'description',
54
+ :'cta' => :'cta'
55
+ }
56
+ end
57
+
58
+ # Returns attribute mapping this model knows about
59
+ def self.acceptable_attribute_map
60
+ attribute_map
61
+ end
62
+
63
+ # Returns all the JSON keys this model knows about
64
+ def self.acceptable_attributes
65
+ acceptable_attribute_map.values
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.openapi_types
70
+ {
71
+ :'primary_text' => :'String',
72
+ :'headline' => :'String',
73
+ :'description' => :'String',
74
+ :'cta' => :'String'
75
+ }
76
+ end
77
+
78
+ # List of attributes with nullable: true
79
+ def self.openapi_nullable
80
+ Set.new([
81
+ ])
82
+ end
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ def initialize(attributes = {})
87
+ if (!attributes.is_a?(Hash))
88
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::StoreDeploymentPlanRequestCopy` initialize method"
89
+ end
90
+
91
+ # check to see if the attribute exists and convert string to symbol for hash key
92
+ acceptable_attribute_map = self.class.acceptable_attribute_map
93
+ attributes = attributes.each_with_object({}) { |(k, v), h|
94
+ if (!acceptable_attribute_map.key?(k.to_sym))
95
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::StoreDeploymentPlanRequestCopy`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
96
+ end
97
+ h[k.to_sym] = v
98
+ }
99
+
100
+ if attributes.key?(:'primary_text')
101
+ self.primary_text = attributes[:'primary_text']
102
+ else
103
+ self.primary_text = nil
104
+ end
105
+
106
+ if attributes.key?(:'headline')
107
+ self.headline = attributes[:'headline']
108
+ else
109
+ self.headline = nil
110
+ end
111
+
112
+ if attributes.key?(:'description')
113
+ self.description = attributes[:'description']
114
+ else
115
+ self.description = nil
116
+ end
117
+
118
+ if attributes.key?(:'cta')
119
+ self.cta = attributes[:'cta']
120
+ else
121
+ self.cta = nil
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
129
+ invalid_properties = Array.new
130
+ if @primary_text.nil?
131
+ invalid_properties.push('invalid value for "primary_text", primary_text cannot be nil.')
132
+ end
133
+
134
+ if @headline.nil?
135
+ invalid_properties.push('invalid value for "headline", headline cannot be nil.')
136
+ end
137
+
138
+ if @description.nil?
139
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
140
+ end
141
+
142
+ if @cta.nil?
143
+ invalid_properties.push('invalid value for "cta", cta cannot be nil.')
144
+ end
145
+
146
+ invalid_properties
147
+ end
148
+
149
+ # Check to see if the all the properties in the model are valid
150
+ # @return true if the model is valid
151
+ def valid?
152
+ warn '[DEPRECATED] the `valid?` method is obsolete'
153
+ return false if @primary_text.nil?
154
+ return false if @headline.nil?
155
+ return false if @description.nil?
156
+ return false if @cta.nil?
157
+ cta_validator = EnumAttributeValidator.new('String', ["learn_more", "shop_now", "sign_up"])
158
+ return false unless cta_validator.valid?(@cta)
159
+ true
160
+ end
161
+
162
+ # Custom attribute writer method with validation
163
+ # @param [Object] primary_text Value to be assigned
164
+ def primary_text=(primary_text)
165
+ if primary_text.nil?
166
+ fail ArgumentError, 'primary_text cannot be nil'
167
+ end
168
+
169
+ @primary_text = primary_text
170
+ end
171
+
172
+ # Custom attribute writer method with validation
173
+ # @param [Object] headline Value to be assigned
174
+ def headline=(headline)
175
+ if headline.nil?
176
+ fail ArgumentError, 'headline cannot be nil'
177
+ end
178
+
179
+ @headline = headline
180
+ end
181
+
182
+ # Custom attribute writer method with validation
183
+ # @param [Object] description Value to be assigned
184
+ def description=(description)
185
+ if description.nil?
186
+ fail ArgumentError, 'description cannot be nil'
187
+ end
188
+
189
+ @description = description
190
+ end
191
+
192
+ # Custom attribute writer method checking allowed values (enum).
193
+ # @param [Object] cta Object to be assigned
194
+ def cta=(cta)
195
+ validator = EnumAttributeValidator.new('String', ["learn_more", "shop_now", "sign_up"])
196
+ unless validator.valid?(cta)
197
+ fail ArgumentError, "invalid value for \"cta\", must be one of #{validator.allowable_values}."
198
+ end
199
+ @cta = cta
200
+ end
201
+
202
+ # Checks equality by comparing each attribute.
203
+ # @param [Object] Object to be compared
204
+ def ==(o)
205
+ return true if self.equal?(o)
206
+ self.class == o.class &&
207
+ primary_text == o.primary_text &&
208
+ headline == o.headline &&
209
+ description == o.description &&
210
+ cta == o.cta
211
+ end
212
+
213
+ # @see the `==` method
214
+ # @param [Object] Object to be compared
215
+ def eql?(o)
216
+ self == o
217
+ end
218
+
219
+ # Calculates hash code according to all attributes.
220
+ # @return [Integer] Hash code
221
+ def hash
222
+ [primary_text, headline, description, cta].hash
223
+ end
224
+
225
+ # Builds the object from hash
226
+ # @param [Hash] attributes Model attributes in the form of hash
227
+ # @return [Object] Returns the model itself
228
+ def self.build_from_hash(attributes)
229
+ return nil unless attributes.is_a?(Hash)
230
+ attributes = attributes.transform_keys(&:to_sym)
231
+ transformed_hash = {}
232
+ openapi_types.each_pair do |key, type|
233
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
234
+ transformed_hash["#{key}"] = nil
235
+ elsif type =~ /\AArray<(.*)>/i
236
+ # check to ensure the input is an array given that the attribute
237
+ # is documented as an array but the input is not
238
+ if attributes[attribute_map[key]].is_a?(Array)
239
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
240
+ end
241
+ elsif !attributes[attribute_map[key]].nil?
242
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
243
+ end
244
+ end
245
+ new(transformed_hash)
246
+ end
247
+
248
+ # Returns the object in the form of hash
249
+ # @return [Hash] Returns the object in the form of hash
250
+ def to_hash
251
+ hash = {}
252
+ self.class.attribute_map.each_pair do |attr, param|
253
+ value = self.send(attr)
254
+ if value.nil?
255
+ is_nullable = self.class.openapi_nullable.include?(attr)
256
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
257
+ end
258
+
259
+ hash[param] = _to_hash(value)
260
+ end
261
+ hash
262
+ end
263
+
264
+ end
265
+
266
+ end
@@ -0,0 +1,217 @@
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 StoreDeploymentPlanRequestCreativeOverridesInner < ApiModelBase
18
+ attr_accessor :creative_id
19
+
20
+ attr_accessor :copy
21
+
22
+ attr_accessor :landing_page
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'creative_id' => :'creative_id',
28
+ :'copy' => :'copy',
29
+ :'landing_page' => :'landing_page'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'creative_id' => :'String',
47
+ :'copy' => :'StoreDeploymentPlanRequestCopy',
48
+ :'landing_page' => :'String'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ :'landing_page'
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::StoreDeploymentPlanRequestCreativeOverridesInner` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ acceptable_attribute_map = self.class.acceptable_attribute_map
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!acceptable_attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::StoreDeploymentPlanRequestCreativeOverridesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'creative_id')
76
+ self.creative_id = attributes[:'creative_id']
77
+ else
78
+ self.creative_id = nil
79
+ end
80
+
81
+ if attributes.key?(:'copy')
82
+ self.copy = attributes[:'copy']
83
+ else
84
+ self.copy = nil
85
+ end
86
+
87
+ if attributes.key?(:'landing_page')
88
+ self.landing_page = attributes[:'landing_page']
89
+ else
90
+ self.landing_page = nil
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
98
+ invalid_properties = Array.new
99
+ if @creative_id.nil?
100
+ invalid_properties.push('invalid value for "creative_id", creative_id cannot be nil.')
101
+ end
102
+
103
+ if @copy.nil?
104
+ invalid_properties.push('invalid value for "copy", copy cannot be nil.')
105
+ end
106
+
107
+ if @landing_page.to_s.length > 2048
108
+ invalid_properties.push('invalid value for "landing_page", the character length must be smaller than or equal to 2048.')
109
+ end
110
+
111
+ invalid_properties
112
+ end
113
+
114
+ # Check to see if the all the properties in the model are valid
115
+ # @return true if the model is valid
116
+ def valid?
117
+ warn '[DEPRECATED] the `valid?` method is obsolete'
118
+ return false if @creative_id.nil?
119
+ return false if @copy.nil?
120
+ return false if @landing_page.to_s.length > 2048
121
+ true
122
+ end
123
+
124
+ # Custom attribute writer method with validation
125
+ # @param [Object] creative_id Value to be assigned
126
+ def creative_id=(creative_id)
127
+ if creative_id.nil?
128
+ fail ArgumentError, 'creative_id cannot be nil'
129
+ end
130
+
131
+ @creative_id = creative_id
132
+ end
133
+
134
+ # Custom attribute writer method with validation
135
+ # @param [Object] copy Value to be assigned
136
+ def copy=(copy)
137
+ if copy.nil?
138
+ fail ArgumentError, 'copy cannot be nil'
139
+ end
140
+
141
+ @copy = copy
142
+ end
143
+
144
+ # Custom attribute writer method with validation
145
+ # @param [Object] landing_page Value to be assigned
146
+ def landing_page=(landing_page)
147
+ if !landing_page.nil? && landing_page.to_s.length > 2048
148
+ fail ArgumentError, 'invalid value for "landing_page", the character length must be smaller than or equal to 2048.'
149
+ end
150
+
151
+ @landing_page = landing_page
152
+ end
153
+
154
+ # Checks equality by comparing each attribute.
155
+ # @param [Object] Object to be compared
156
+ def ==(o)
157
+ return true if self.equal?(o)
158
+ self.class == o.class &&
159
+ creative_id == o.creative_id &&
160
+ copy == o.copy &&
161
+ landing_page == o.landing_page
162
+ end
163
+
164
+ # @see the `==` method
165
+ # @param [Object] Object to be compared
166
+ def eql?(o)
167
+ self == o
168
+ end
169
+
170
+ # Calculates hash code according to all attributes.
171
+ # @return [Integer] Hash code
172
+ def hash
173
+ [creative_id, copy, landing_page].hash
174
+ end
175
+
176
+ # Builds the object from hash
177
+ # @param [Hash] attributes Model attributes in the form of hash
178
+ # @return [Object] Returns the model itself
179
+ def self.build_from_hash(attributes)
180
+ return nil unless attributes.is_a?(Hash)
181
+ attributes = attributes.transform_keys(&:to_sym)
182
+ transformed_hash = {}
183
+ openapi_types.each_pair do |key, type|
184
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
185
+ transformed_hash["#{key}"] = nil
186
+ elsif type =~ /\AArray<(.*)>/i
187
+ # check to ensure the input is an array given that the attribute
188
+ # is documented as an array but the input is not
189
+ if attributes[attribute_map[key]].is_a?(Array)
190
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
191
+ end
192
+ elsif !attributes[attribute_map[key]].nil?
193
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
194
+ end
195
+ end
196
+ new(transformed_hash)
197
+ end
198
+
199
+ # Returns the object in the form of hash
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_hash
202
+ hash = {}
203
+ self.class.attribute_map.each_pair do |attr, param|
204
+ value = self.send(attr)
205
+ if value.nil?
206
+ is_nullable = self.class.openapi_nullable.include?(attr)
207
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
208
+ end
209
+
210
+ hash[param] = _to_hash(value)
211
+ end
212
+ hash
213
+ end
214
+
215
+ end
216
+
217
+ end