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
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module PlainRouter::OpenAPI
17
+ # Complete projection rows are paged within 80,000 JSON bytes, accounting for both MCP representations. Defaults are bounded. Follow next_cursor with the same scope and filters. One oversized row is explicitly refused; fields are never silently clipped.
17
18
  class ActionListReadMeta < ApiModelBase
18
19
  attr_accessor :current_page
19
20
 
@@ -23,13 +24,22 @@ module PlainRouter::OpenAPI
23
24
 
24
25
  attr_accessor :total
25
26
 
27
+ attr_accessor :next_cursor
28
+
29
+ attr_accessor :truncated
30
+
31
+ attr_accessor :continuation
32
+
26
33
  # Attribute mapping from ruby-style variable name to JSON key.
27
34
  def self.attribute_map
28
35
  {
29
36
  :'current_page' => :'current_page',
30
37
  :'last_page' => :'last_page',
31
38
  :'per_page' => :'per_page',
32
- :'total' => :'total'
39
+ :'total' => :'total',
40
+ :'next_cursor' => :'next_cursor',
41
+ :'truncated' => :'truncated',
42
+ :'continuation' => :'continuation'
33
43
  }
34
44
  end
35
45
 
@@ -49,13 +59,17 @@ module PlainRouter::OpenAPI
49
59
  :'current_page' => :'Integer',
50
60
  :'last_page' => :'Integer',
51
61
  :'per_page' => :'Integer',
52
- :'total' => :'Integer'
62
+ :'total' => :'Integer',
63
+ :'next_cursor' => :'Integer',
64
+ :'truncated' => :'Boolean',
65
+ :'continuation' => :'String'
53
66
  }
54
67
  end
55
68
 
56
69
  # List of attributes with nullable: true
57
70
  def self.openapi_nullable
58
71
  Set.new([
72
+ :'next_cursor',
59
73
  ])
60
74
  end
61
75
 
@@ -98,6 +112,18 @@ module PlainRouter::OpenAPI
98
112
  else
99
113
  self.total = nil
100
114
  end
115
+
116
+ if attributes.key?(:'next_cursor')
117
+ self.next_cursor = attributes[:'next_cursor']
118
+ end
119
+
120
+ if attributes.key?(:'truncated')
121
+ self.truncated = attributes[:'truncated']
122
+ end
123
+
124
+ if attributes.key?(:'continuation')
125
+ self.continuation = attributes[:'continuation']
126
+ end
101
127
  end
102
128
 
103
129
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -183,7 +209,10 @@ module PlainRouter::OpenAPI
183
209
  current_page == o.current_page &&
184
210
  last_page == o.last_page &&
185
211
  per_page == o.per_page &&
186
- total == o.total
212
+ total == o.total &&
213
+ next_cursor == o.next_cursor &&
214
+ truncated == o.truncated &&
215
+ continuation == o.continuation
187
216
  end
188
217
 
189
218
  # @see the `==` method
@@ -195,7 +224,7 @@ module PlainRouter::OpenAPI
195
224
  # Calculates hash code according to all attributes.
196
225
  # @return [Integer] Hash code
197
226
  def hash
198
- [current_page, last_page, per_page, total].hash
227
+ [current_page, last_page, per_page, total, next_cursor, truncated, continuation].hash
199
228
  end
200
229
 
201
230
  # Builds the object from hash
@@ -15,6 +15,12 @@ require 'time'
15
15
 
16
16
  module PlainRouter::OpenAPI
17
17
  class ActionProposalInput < ApiModelBase
18
+ # Maximum complete result actions; the shared JSON byte budget can return fewer.
19
+ attr_accessor :limit
20
+
21
+ # Continue using next_cursor. Read saved proposal actions with get_action_batch to avoid another write; dry runs repeat the same inputs.
22
+ attr_accessor :cursor
23
+
18
24
  attr_accessor :actions
19
25
 
20
26
  attr_accessor :rationale
@@ -54,6 +60,8 @@ module PlainRouter::OpenAPI
54
60
  # Attribute mapping from ruby-style variable name to JSON key.
55
61
  def self.attribute_map
56
62
  {
63
+ :'limit' => :'limit',
64
+ :'cursor' => :'cursor',
57
65
  :'actions' => :'actions',
58
66
  :'rationale' => :'rationale',
59
67
  :'idempotency_key' => :'idempotency_key',
@@ -77,6 +85,8 @@ module PlainRouter::OpenAPI
77
85
  # Attribute type mapping.
78
86
  def self.openapi_types
79
87
  {
88
+ :'limit' => :'Integer',
89
+ :'cursor' => :'Integer',
80
90
  :'actions' => :'Array<ActionProposalInputActionsInner>',
81
91
  :'rationale' => :'String',
82
92
  :'idempotency_key' => :'String',
@@ -96,6 +106,7 @@ module PlainRouter::OpenAPI
96
106
  # Initializes the object
97
107
  # @param [Hash] attributes Model attributes in the form of hash
98
108
  def initialize(attributes = {})
109
+ ClosedInputValidator.validate_model!(self, attributes)
99
110
  if (!attributes.is_a?(Hash))
100
111
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInput` initialize method"
101
112
  end
@@ -109,6 +120,16 @@ module PlainRouter::OpenAPI
109
120
  h[k.to_sym] = v
110
121
  }
111
122
 
123
+ if attributes.key?(:'limit')
124
+ self.limit = attributes[:'limit']
125
+ else
126
+ self.limit = 25
127
+ end
128
+
129
+ if attributes.key?(:'cursor')
130
+ self.cursor = attributes[:'cursor']
131
+ end
132
+
112
133
  if attributes.key?(:'actions')
113
134
  if (value = attributes[:'actions']).is_a?(Array)
114
135
  self.actions = value
@@ -157,6 +178,18 @@ module PlainRouter::OpenAPI
157
178
  def list_invalid_properties
158
179
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
159
180
  invalid_properties = Array.new
181
+ if !@limit.nil? && @limit > 100
182
+ invalid_properties.push('invalid value for "limit", must be smaller than or equal to 100.')
183
+ end
184
+
185
+ if !@limit.nil? && @limit < 1
186
+ invalid_properties.push('invalid value for "limit", must be greater than or equal to 1.')
187
+ end
188
+
189
+ if !@cursor.nil? && @cursor < 0
190
+ invalid_properties.push('invalid value for "cursor", must be greater than or equal to 0.')
191
+ end
192
+
160
193
  if @actions.nil?
161
194
  invalid_properties.push('invalid value for "actions", actions cannot be nil.')
162
195
  end
@@ -216,6 +249,9 @@ module PlainRouter::OpenAPI
216
249
  # @return true if the model is valid
217
250
  def valid?
218
251
  warn '[DEPRECATED] the `valid?` method is obsolete'
252
+ return false if !@limit.nil? && @limit > 100
253
+ return false if !@limit.nil? && @limit < 1
254
+ return false if !@cursor.nil? && @cursor < 0
219
255
  return false if @actions.nil?
220
256
  return false if @actions.length > 25
221
257
  return false if @actions.length < 1
@@ -234,6 +270,38 @@ module PlainRouter::OpenAPI
234
270
  true
235
271
  end
236
272
 
273
+ # Custom attribute writer method with validation
274
+ # @param [Object] limit Value to be assigned
275
+ def limit=(limit)
276
+ if limit.nil?
277
+ fail ArgumentError, 'limit cannot be nil'
278
+ end
279
+
280
+ if limit > 100
281
+ fail ArgumentError, 'invalid value for "limit", must be smaller than or equal to 100.'
282
+ end
283
+
284
+ if limit < 1
285
+ fail ArgumentError, 'invalid value for "limit", must be greater than or equal to 1.'
286
+ end
287
+
288
+ @limit = limit
289
+ end
290
+
291
+ # Custom attribute writer method with validation
292
+ # @param [Object] cursor Value to be assigned
293
+ def cursor=(cursor)
294
+ if cursor.nil?
295
+ fail ArgumentError, 'cursor cannot be nil'
296
+ end
297
+
298
+ if cursor < 0
299
+ fail ArgumentError, 'invalid value for "cursor", must be greater than or equal to 0.'
300
+ end
301
+
302
+ @cursor = cursor
303
+ end
304
+
237
305
  # Custom attribute writer method with validation
238
306
  # @param [Object] actions Value to be assigned
239
307
  def actions=(actions)
@@ -341,6 +409,8 @@ module PlainRouter::OpenAPI
341
409
  def ==(o)
342
410
  return true if self.equal?(o)
343
411
  self.class == o.class &&
412
+ limit == o.limit &&
413
+ cursor == o.cursor &&
344
414
  actions == o.actions &&
345
415
  rationale == o.rationale &&
346
416
  idempotency_key == o.idempotency_key &&
@@ -359,13 +429,14 @@ module PlainRouter::OpenAPI
359
429
  # Calculates hash code according to all attributes.
360
430
  # @return [Integer] Hash code
361
431
  def hash
362
- [actions, rationale, idempotency_key, evidence, target_source, account_id, workspace_id].hash
432
+ [limit, cursor, actions, rationale, idempotency_key, evidence, target_source, account_id, workspace_id].hash
363
433
  end
364
434
 
365
435
  # Builds the object from hash
366
436
  # @param [Hash] attributes Model attributes in the form of hash
367
437
  # @return [Object] Returns the model itself
368
438
  def self.build_from_hash(attributes)
439
+ ClosedInputValidator.validate_model!(self, attributes)
369
440
  return nil unless attributes.is_a?(Hash)
370
441
  attributes = attributes.transform_keys(&:to_sym)
371
442
  transformed_hash = {}
@@ -40,6 +40,7 @@ module PlainRouter::OpenAPI
40
40
  # @param [Mixed] Data to be matched against the list of anyOf items
41
41
  # @return [Object] Returns the model or the data itself
42
42
  def build(data)
43
+ ClosedInputValidator.validate_model!(self, data)
43
44
  # Go through the list of anyOf items and attempt to identify the appropriate one.
44
45
  # Note:
45
46
  # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
@@ -88,6 +88,7 @@ module PlainRouter::OpenAPI
88
88
  # Initializes the object
89
89
  # @param [Hash] attributes Model attributes in the form of hash
90
90
  def initialize(attributes = {})
91
+ ClosedInputValidator.validate_model!(self, attributes)
91
92
  if (!attributes.is_a?(Hash))
92
93
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf` initialize method"
93
94
  end
@@ -263,6 +264,7 @@ module PlainRouter::OpenAPI
263
264
  # @param [Hash] attributes Model attributes in the form of hash
264
265
  # @return [Object] Returns the model itself
265
266
  def self.build_from_hash(attributes)
267
+ ClosedInputValidator.validate_model!(self, attributes)
266
268
  return nil unless attributes.is_a?(Hash)
267
269
  attributes = attributes.transform_keys(&:to_sym)
268
270
  transformed_hash = {}
@@ -88,6 +88,7 @@ module PlainRouter::OpenAPI
88
88
  # Initializes the object
89
89
  # @param [Hash] attributes Model attributes in the form of hash
90
90
  def initialize(attributes = {})
91
+ ClosedInputValidator.validate_model!(self, attributes)
91
92
  if (!attributes.is_a?(Hash))
92
93
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf1` initialize method"
93
94
  end
@@ -263,6 +264,7 @@ module PlainRouter::OpenAPI
263
264
  # @param [Hash] attributes Model attributes in the form of hash
264
265
  # @return [Object] Returns the model itself
265
266
  def self.build_from_hash(attributes)
267
+ ClosedInputValidator.validate_model!(self, attributes)
266
268
  return nil unless attributes.is_a?(Hash)
267
269
  attributes = attributes.transform_keys(&:to_sym)
268
270
  transformed_hash = {}
@@ -88,6 +88,7 @@ module PlainRouter::OpenAPI
88
88
  # Initializes the object
89
89
  # @param [Hash] attributes Model attributes in the form of hash
90
90
  def initialize(attributes = {})
91
+ ClosedInputValidator.validate_model!(self, attributes)
91
92
  if (!attributes.is_a?(Hash))
92
93
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf10` initialize method"
93
94
  end
@@ -263,6 +264,7 @@ module PlainRouter::OpenAPI
263
264
  # @param [Hash] attributes Model attributes in the form of hash
264
265
  # @return [Object] Returns the model itself
265
266
  def self.build_from_hash(attributes)
267
+ ClosedInputValidator.validate_model!(self, attributes)
266
268
  return nil unless attributes.is_a?(Hash)
267
269
  attributes = attributes.transform_keys(&:to_sym)
268
270
  transformed_hash = {}
@@ -94,6 +94,7 @@ module PlainRouter::OpenAPI
94
94
  # Initializes the object
95
95
  # @param [Hash] attributes Model attributes in the form of hash
96
96
  def initialize(attributes = {})
97
+ ClosedInputValidator.validate_model!(self, attributes)
97
98
  if (!attributes.is_a?(Hash))
98
99
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf10Params` initialize method"
99
100
  end
@@ -316,6 +317,7 @@ module PlainRouter::OpenAPI
316
317
  # @param [Hash] attributes Model attributes in the form of hash
317
318
  # @return [Object] Returns the model itself
318
319
  def self.build_from_hash(attributes)
320
+ ClosedInputValidator.validate_model!(self, attributes)
319
321
  return nil unless attributes.is_a?(Hash)
320
322
  attributes = attributes.transform_keys(&:to_sym)
321
323
  transformed_hash = {}
@@ -73,7 +73,7 @@ module PlainRouter::OpenAPI
73
73
  {
74
74
  :'type' => :'String',
75
75
  :'target_entity' => :'ActionProposalInputActionsInnerAnyOf4TargetEntity',
76
- :'params' => :'ActionProposalInputActionsInnerAnyOf11Params',
76
+ :'params' => :'ActionProposalInputActionsInnerAnyOfParams',
77
77
  :'rationale' => :'String',
78
78
  :'idempotency_key' => :'String'
79
79
  }
@@ -88,6 +88,7 @@ module PlainRouter::OpenAPI
88
88
  # Initializes the object
89
89
  # @param [Hash] attributes Model attributes in the form of hash
90
90
  def initialize(attributes = {})
91
+ ClosedInputValidator.validate_model!(self, attributes)
91
92
  if (!attributes.is_a?(Hash))
92
93
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf11` initialize method"
93
94
  end
@@ -263,6 +264,7 @@ module PlainRouter::OpenAPI
263
264
  # @param [Hash] attributes Model attributes in the form of hash
264
265
  # @return [Object] Returns the model itself
265
266
  def self.build_from_hash(attributes)
267
+ ClosedInputValidator.validate_model!(self, attributes)
266
268
  return nil unless attributes.is_a?(Hash)
267
269
  attributes = attributes.transform_keys(&:to_sym)
268
270
  transformed_hash = {}
@@ -88,6 +88,7 @@ module PlainRouter::OpenAPI
88
88
  # Initializes the object
89
89
  # @param [Hash] attributes Model attributes in the form of hash
90
90
  def initialize(attributes = {})
91
+ ClosedInputValidator.validate_model!(self, attributes)
91
92
  if (!attributes.is_a?(Hash))
92
93
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf12` initialize method"
93
94
  end
@@ -263,6 +264,7 @@ module PlainRouter::OpenAPI
263
264
  # @param [Hash] attributes Model attributes in the form of hash
264
265
  # @return [Object] Returns the model itself
265
266
  def self.build_from_hash(attributes)
267
+ ClosedInputValidator.validate_model!(self, attributes)
266
268
  return nil unless attributes.is_a?(Hash)
267
269
  attributes = attributes.transform_keys(&:to_sym)
268
270
  transformed_hash = {}
@@ -72,6 +72,7 @@ module PlainRouter::OpenAPI
72
72
  # Initializes the object
73
73
  # @param [Hash] attributes Model attributes in the form of hash
74
74
  def initialize(attributes = {})
75
+ ClosedInputValidator.validate_model!(self, attributes)
75
76
  if (!attributes.is_a?(Hash))
76
77
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf12Params` initialize method"
77
78
  end
@@ -148,6 +149,7 @@ module PlainRouter::OpenAPI
148
149
  # @param [Hash] attributes Model attributes in the form of hash
149
150
  # @return [Object] Returns the model itself
150
151
  def self.build_from_hash(attributes)
152
+ ClosedInputValidator.validate_model!(self, attributes)
151
153
  return nil unless attributes.is_a?(Hash)
152
154
  attributes = attributes.transform_keys(&:to_sym)
153
155
  transformed_hash = {}
@@ -88,6 +88,7 @@ module PlainRouter::OpenAPI
88
88
  # Initializes the object
89
89
  # @param [Hash] attributes Model attributes in the form of hash
90
90
  def initialize(attributes = {})
91
+ ClosedInputValidator.validate_model!(self, attributes)
91
92
  if (!attributes.is_a?(Hash))
92
93
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf13` initialize method"
93
94
  end
@@ -263,6 +264,7 @@ module PlainRouter::OpenAPI
263
264
  # @param [Hash] attributes Model attributes in the form of hash
264
265
  # @return [Object] Returns the model itself
265
266
  def self.build_from_hash(attributes)
267
+ ClosedInputValidator.validate_model!(self, attributes)
266
268
  return nil unless attributes.is_a?(Hash)
267
269
  attributes = attributes.transform_keys(&:to_sym)
268
270
  transformed_hash = {}
@@ -81,6 +81,7 @@ module PlainRouter::OpenAPI
81
81
  # Initializes the object
82
82
  # @param [Hash] attributes Model attributes in the form of hash
83
83
  def initialize(attributes = {})
84
+ ClosedInputValidator.validate_model!(self, attributes)
84
85
  if (!attributes.is_a?(Hash))
85
86
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf13Params` initialize method"
86
87
  end
@@ -219,6 +220,7 @@ module PlainRouter::OpenAPI
219
220
  # @param [Hash] attributes Model attributes in the form of hash
220
221
  # @return [Object] Returns the model itself
221
222
  def self.build_from_hash(attributes)
223
+ ClosedInputValidator.validate_model!(self, attributes)
222
224
  return nil unless attributes.is_a?(Hash)
223
225
  attributes = attributes.transform_keys(&:to_sym)
224
226
  transformed_hash = {}
@@ -88,6 +88,7 @@ module PlainRouter::OpenAPI
88
88
  # Initializes the object
89
89
  # @param [Hash] attributes Model attributes in the form of hash
90
90
  def initialize(attributes = {})
91
+ ClosedInputValidator.validate_model!(self, attributes)
91
92
  if (!attributes.is_a?(Hash))
92
93
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf2` initialize method"
93
94
  end
@@ -263,6 +264,7 @@ module PlainRouter::OpenAPI
263
264
  # @param [Hash] attributes Model attributes in the form of hash
264
265
  # @return [Object] Returns the model itself
265
266
  def self.build_from_hash(attributes)
267
+ ClosedInputValidator.validate_model!(self, attributes)
266
268
  return nil unless attributes.is_a?(Hash)
267
269
  attributes = attributes.transform_keys(&:to_sym)
268
270
  transformed_hash = {}
@@ -88,6 +88,7 @@ module PlainRouter::OpenAPI
88
88
  # Initializes the object
89
89
  # @param [Hash] attributes Model attributes in the form of hash
90
90
  def initialize(attributes = {})
91
+ ClosedInputValidator.validate_model!(self, attributes)
91
92
  if (!attributes.is_a?(Hash))
92
93
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf3` initialize method"
93
94
  end
@@ -263,6 +264,7 @@ module PlainRouter::OpenAPI
263
264
  # @param [Hash] attributes Model attributes in the form of hash
264
265
  # @return [Object] Returns the model itself
265
266
  def self.build_from_hash(attributes)
267
+ ClosedInputValidator.validate_model!(self, attributes)
266
268
  return nil unless attributes.is_a?(Hash)
267
269
  attributes = attributes.transform_keys(&:to_sym)
268
270
  transformed_hash = {}
@@ -88,6 +88,7 @@ module PlainRouter::OpenAPI
88
88
  # Initializes the object
89
89
  # @param [Hash] attributes Model attributes in the form of hash
90
90
  def initialize(attributes = {})
91
+ ClosedInputValidator.validate_model!(self, attributes)
91
92
  if (!attributes.is_a?(Hash))
92
93
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf4` initialize method"
93
94
  end
@@ -263,6 +264,7 @@ module PlainRouter::OpenAPI
263
264
  # @param [Hash] attributes Model attributes in the form of hash
264
265
  # @return [Object] Returns the model itself
265
266
  def self.build_from_hash(attributes)
267
+ ClosedInputValidator.validate_model!(self, attributes)
266
268
  return nil unless attributes.is_a?(Hash)
267
269
  attributes = attributes.transform_keys(&:to_sym)
268
270
  transformed_hash = {}
@@ -81,6 +81,7 @@ module PlainRouter::OpenAPI
81
81
  # Initializes the object
82
82
  # @param [Hash] attributes Model attributes in the form of hash
83
83
  def initialize(attributes = {})
84
+ ClosedInputValidator.validate_model!(self, attributes)
84
85
  if (!attributes.is_a?(Hash))
85
86
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf4TargetEntity` initialize method"
86
87
  end
@@ -213,6 +214,7 @@ module PlainRouter::OpenAPI
213
214
  # @param [Hash] attributes Model attributes in the form of hash
214
215
  # @return [Object] Returns the model itself
215
216
  def self.build_from_hash(attributes)
217
+ ClosedInputValidator.validate_model!(self, attributes)
216
218
  return nil unless attributes.is_a?(Hash)
217
219
  attributes = attributes.transform_keys(&:to_sym)
218
220
  transformed_hash = {}
@@ -88,6 +88,7 @@ module PlainRouter::OpenAPI
88
88
  # Initializes the object
89
89
  # @param [Hash] attributes Model attributes in the form of hash
90
90
  def initialize(attributes = {})
91
+ ClosedInputValidator.validate_model!(self, attributes)
91
92
  if (!attributes.is_a?(Hash))
92
93
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf5` initialize method"
93
94
  end
@@ -263,6 +264,7 @@ module PlainRouter::OpenAPI
263
264
  # @param [Hash] attributes Model attributes in the form of hash
264
265
  # @return [Object] Returns the model itself
265
266
  def self.build_from_hash(attributes)
267
+ ClosedInputValidator.validate_model!(self, attributes)
266
268
  return nil unless attributes.is_a?(Hash)
267
269
  attributes = attributes.transform_keys(&:to_sym)
268
270
  transformed_hash = {}
@@ -88,6 +88,7 @@ module PlainRouter::OpenAPI
88
88
  # Initializes the object
89
89
  # @param [Hash] attributes Model attributes in the form of hash
90
90
  def initialize(attributes = {})
91
+ ClosedInputValidator.validate_model!(self, attributes)
91
92
  if (!attributes.is_a?(Hash))
92
93
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf6` initialize method"
93
94
  end
@@ -263,6 +264,7 @@ module PlainRouter::OpenAPI
263
264
  # @param [Hash] attributes Model attributes in the form of hash
264
265
  # @return [Object] Returns the model itself
265
266
  def self.build_from_hash(attributes)
267
+ ClosedInputValidator.validate_model!(self, attributes)
266
268
  return nil unless attributes.is_a?(Hash)
267
269
  attributes = attributes.transform_keys(&:to_sym)
268
270
  transformed_hash = {}
@@ -88,6 +88,7 @@ module PlainRouter::OpenAPI
88
88
  # Initializes the object
89
89
  # @param [Hash] attributes Model attributes in the form of hash
90
90
  def initialize(attributes = {})
91
+ ClosedInputValidator.validate_model!(self, attributes)
91
92
  if (!attributes.is_a?(Hash))
92
93
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf7` initialize method"
93
94
  end
@@ -263,6 +264,7 @@ module PlainRouter::OpenAPI
263
264
  # @param [Hash] attributes Model attributes in the form of hash
264
265
  # @return [Object] Returns the model itself
265
266
  def self.build_from_hash(attributes)
267
+ ClosedInputValidator.validate_model!(self, attributes)
266
268
  return nil unless attributes.is_a?(Hash)
267
269
  attributes = attributes.transform_keys(&:to_sym)
268
270
  transformed_hash = {}
@@ -88,6 +88,7 @@ module PlainRouter::OpenAPI
88
88
  # Initializes the object
89
89
  # @param [Hash] attributes Model attributes in the form of hash
90
90
  def initialize(attributes = {})
91
+ ClosedInputValidator.validate_model!(self, attributes)
91
92
  if (!attributes.is_a?(Hash))
92
93
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf8` initialize method"
93
94
  end
@@ -263,6 +264,7 @@ module PlainRouter::OpenAPI
263
264
  # @param [Hash] attributes Model attributes in the form of hash
264
265
  # @return [Object] Returns the model itself
265
266
  def self.build_from_hash(attributes)
267
+ ClosedInputValidator.validate_model!(self, attributes)
266
268
  return nil unless attributes.is_a?(Hash)
267
269
  attributes = attributes.transform_keys(&:to_sym)
268
270
  transformed_hash = {}
@@ -88,6 +88,7 @@ module PlainRouter::OpenAPI
88
88
  # Initializes the object
89
89
  # @param [Hash] attributes Model attributes in the form of hash
90
90
  def initialize(attributes = {})
91
+ ClosedInputValidator.validate_model!(self, attributes)
91
92
  if (!attributes.is_a?(Hash))
92
93
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOf9` initialize method"
93
94
  end
@@ -263,6 +264,7 @@ module PlainRouter::OpenAPI
263
264
  # @param [Hash] attributes Model attributes in the form of hash
264
265
  # @return [Object] Returns the model itself
265
266
  def self.build_from_hash(attributes)
267
+ ClosedInputValidator.validate_model!(self, attributes)
266
268
  return nil unless attributes.is_a?(Hash)
267
269
  attributes = attributes.transform_keys(&:to_sym)
268
270
  transformed_hash = {}
@@ -50,6 +50,7 @@ module PlainRouter::OpenAPI
50
50
  # Initializes the object
51
51
  # @param [Hash] attributes Model attributes in the form of hash
52
52
  def initialize(attributes = {})
53
+ ClosedInputValidator.validate_model!(self, attributes)
53
54
  if (!attributes.is_a?(Hash))
54
55
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOfParams` initialize method"
55
56
  end
@@ -133,6 +134,7 @@ module PlainRouter::OpenAPI
133
134
  # @param [Hash] attributes Model attributes in the form of hash
134
135
  # @return [Object] Returns the model itself
135
136
  def self.build_from_hash(attributes)
137
+ ClosedInputValidator.validate_model!(self, attributes)
136
138
  return nil unless attributes.is_a?(Hash)
137
139
  attributes = attributes.transform_keys(&:to_sym)
138
140
  transformed_hash = {}
@@ -81,6 +81,7 @@ module PlainRouter::OpenAPI
81
81
  # Initializes the object
82
82
  # @param [Hash] attributes Model attributes in the form of hash
83
83
  def initialize(attributes = {})
84
+ ClosedInputValidator.validate_model!(self, attributes)
84
85
  if (!attributes.is_a?(Hash))
85
86
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputActionsInnerAnyOfTargetEntity` initialize method"
86
87
  end
@@ -224,6 +225,7 @@ module PlainRouter::OpenAPI
224
225
  # @param [Hash] attributes Model attributes in the form of hash
225
226
  # @return [Object] Returns the model itself
226
227
  def self.build_from_hash(attributes)
228
+ ClosedInputValidator.validate_model!(self, attributes)
227
229
  return nil unless attributes.is_a?(Hash)
228
230
  attributes = attributes.transform_keys(&:to_sym)
229
231
  transformed_hash = {}
@@ -80,6 +80,7 @@ module PlainRouter::OpenAPI
80
80
  # Initializes the object
81
81
  # @param [Hash] attributes Model attributes in the form of hash
82
82
  def initialize(attributes = {})
83
+ ClosedInputValidator.validate_model!(self, attributes)
83
84
  if (!attributes.is_a?(Hash))
84
85
  fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionProposalInputEvidenceInner` initialize method"
85
86
  end
@@ -145,7 +146,7 @@ module PlainRouter::OpenAPI
145
146
  def valid?
146
147
  warn '[DEPRECATED] the `valid?` method is obsolete'
147
148
  return false if @source_tool.nil?
148
- source_tool_validator = EnumAttributeValidator.new('String', ["get_account_state", "get_signal_health", "get_performance", "get-creative-library", "staged-asset-manifest"])
149
+ source_tool_validator = EnumAttributeValidator.new('String', ["get_account_state", "get_signal_health", "get_performance", "get_inventory_metrics", "get-creative-library", "staged-asset-manifest"])
149
150
  return false unless source_tool_validator.valid?(@source_tool)
150
151
  return false if @fields_used.nil?
151
152
  return false if @fields_used.length > 50
@@ -157,7 +158,7 @@ module PlainRouter::OpenAPI
157
158
  # Custom attribute writer method checking allowed values (enum).
158
159
  # @param [Object] source_tool Object to be assigned
159
160
  def source_tool=(source_tool)
160
- validator = EnumAttributeValidator.new('String', ["get_account_state", "get_signal_health", "get_performance", "get-creative-library", "staged-asset-manifest"])
161
+ validator = EnumAttributeValidator.new('String', ["get_account_state", "get_signal_health", "get_performance", "get_inventory_metrics", "get-creative-library", "staged-asset-manifest"])
161
162
  unless validator.valid?(source_tool)
162
163
  fail ArgumentError, "invalid value for \"source_tool\", must be one of #{validator.allowable_values}."
163
164
  end
@@ -222,6 +223,7 @@ module PlainRouter::OpenAPI
222
223
  # @param [Hash] attributes Model attributes in the form of hash
223
224
  # @return [Object] Returns the model itself
224
225
  def self.build_from_hash(attributes)
226
+ ClosedInputValidator.validate_model!(self, attributes)
225
227
  return nil unless attributes.is_a?(Hash)
226
228
  attributes = attributes.transform_keys(&:to_sym)
227
229
  transformed_hash = {}