plainrouter-sdk 0.1.0 → 0.2.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 (127) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/plainrouter/client.rb +73 -1
  4. data/lib/plainrouter/openapi/api/action_dry_run_api_api.rb +96 -0
  5. data/lib/plainrouter/openapi/api/action_proposal_api_api.rb +96 -0
  6. data/lib/plainrouter/openapi/api/action_read_api_api.rb +404 -0
  7. data/lib/plainrouter/openapi/api/event_api.rb +15 -15
  8. data/lib/plainrouter/openapi/api/operations_api.rb +24 -28
  9. data/lib/plainrouter/openapi/api/sandbox_api.rb +74 -17
  10. data/lib/plainrouter/openapi/api_client.rb +2 -2
  11. data/lib/plainrouter/openapi/api_error.rb +2 -2
  12. data/lib/plainrouter/openapi/api_model_base.rb +2 -2
  13. data/lib/plainrouter/openapi/configuration.rb +10 -3
  14. data/lib/plainrouter/openapi/models/action_batch_read.rb +164 -0
  15. data/lib/plainrouter/openapi/models/action_batch_read_data.rb +450 -0
  16. data/lib/plainrouter/openapi/models/action_current_disposition.rb +294 -0
  17. data/lib/plainrouter/openapi/models/action_decision_receipt_read.rb +244 -0
  18. data/lib/plainrouter/openapi/models/action_decision_receipt_read_chain_entry.rb +190 -0
  19. data/lib/plainrouter/openapi/models/action_detail_read.rb +164 -0
  20. data/lib/plainrouter/openapi/models/action_dry_run_read.rb +164 -0
  21. data/lib/plainrouter/openapi/models/action_dry_run_read_dry_run.rb +166 -0
  22. data/lib/plainrouter/openapi/models/action_dry_run_read_dry_run_actions_inner.rb +103 -0
  23. data/lib/plainrouter/openapi/models/action_dry_run_read_dry_run_actions_inner_any_of.rb +376 -0
  24. data/lib/plainrouter/openapi/models/action_dry_run_read_dry_run_actions_inner_any_of1.rb +268 -0
  25. data/lib/plainrouter/openapi/models/action_dry_run_read_dry_run_actions_inner_any_of_diff.rb +162 -0
  26. data/lib/plainrouter/openapi/models/action_dry_run_read_dry_run_actions_inner_any_of_target_entity.rb +199 -0
  27. data/lib/plainrouter/openapi/models/action_list_read.rb +192 -0
  28. data/lib/plainrouter/openapi/models/action_list_read_meta.rb +242 -0
  29. data/lib/plainrouter/openapi/models/action_policy_read.rb +164 -0
  30. data/lib/plainrouter/openapi/models/action_policy_read_data.rb +380 -0
  31. data/lib/plainrouter/openapi/models/action_proposal_input.rb +378 -0
  32. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner.rb +115 -0
  33. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of.rb +303 -0
  34. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of1.rb +303 -0
  35. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of10.rb +303 -0
  36. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of10_params.rb +356 -0
  37. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of11.rb +303 -0
  38. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of11_params.rb +173 -0
  39. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of12.rb +303 -0
  40. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of12_params.rb +188 -0
  41. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of13.rb +303 -0
  42. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of13_params.rb +259 -0
  43. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of2.rb +303 -0
  44. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of3.rb +303 -0
  45. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of4.rb +303 -0
  46. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of4_target_entity.rb +253 -0
  47. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of5.rb +303 -0
  48. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of6.rb +303 -0
  49. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of7.rb +303 -0
  50. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of8.rb +303 -0
  51. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of9.rb +303 -0
  52. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of_params.rb +173 -0
  53. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of_target_entity.rb +264 -0
  54. data/lib/plainrouter/openapi/models/action_proposal_input_evidence_inner.rb +262 -0
  55. data/lib/plainrouter/openapi/models/action_proposal_read.rb +164 -0
  56. data/lib/plainrouter/openapi/models/action_proposal_read_proposal.rb +452 -0
  57. data/lib/plainrouter/openapi/models/action_proposal_read_proposal_actions_inner.rb +386 -0
  58. data/lib/plainrouter/openapi/models/action_proposal_read_proposal_actions_inner_params.rb +103 -0
  59. data/lib/plainrouter/openapi/models/action_proposal_read_proposal_proposed_by.rb +202 -0
  60. data/lib/plainrouter/openapi/models/action_read_item.rb +516 -0
  61. data/lib/plainrouter/openapi/models/create_event200_response.rb +2 -2
  62. data/lib/plainrouter/openapi/models/create_event202_response.rb +218 -0
  63. data/lib/plainrouter/openapi/models/create_event202_response_warnings_inner.rb +240 -0
  64. data/lib/plainrouter/openapi/models/create_event_request.rb +2 -2
  65. data/lib/plainrouter/openapi/models/create_event_request_any_of.rb +2 -2
  66. data/lib/plainrouter/openapi/models/create_event_request_any_of1.rb +2 -2
  67. data/lib/plainrouter/openapi/models/create_event_request_any_of_event_time.rb +2 -2
  68. data/lib/plainrouter/openapi/models/create_event_request_any_of_value_data.rb +2 -2
  69. data/lib/plainrouter/openapi/models/delete_user_data200_response.rb +2 -2
  70. data/lib/plainrouter/openapi/models/delete_user_data_request.rb +35 -36
  71. data/lib/plainrouter/openapi/models/delivery_status.rb +2 -2
  72. data/lib/plainrouter/openapi/models/destination.rb +30 -3
  73. data/lib/plainrouter/openapi/models/destination_credential_source.rb +3 -4
  74. data/lib/plainrouter/openapi/models/destination_status.rb +2 -2
  75. data/lib/plainrouter/openapi/models/destination_type.rb +2 -2
  76. data/lib/plainrouter/openapi/models/emq_snapshot.rb +30 -3
  77. data/lib/plainrouter/openapi/models/error_message.rb +2 -2
  78. data/lib/plainrouter/openapi/models/event.rb +89 -45
  79. data/lib/plainrouter/openapi/models/get_emq_report200_response.rb +2 -2
  80. data/lib/plainrouter/openapi/models/get_emq_report200_response_snapshots_inner.rb +30 -3
  81. data/lib/plainrouter/openapi/models/get_event200_response.rb +2 -2
  82. data/lib/plainrouter/openapi/models/get_event200_response_deliveries_inner.rb +30 -3
  83. data/lib/plainrouter/openapi/models/get_event200_response_event.rb +31 -4
  84. data/lib/plainrouter/openapi/models/get_event200_response_event_consent.rb +2 -2
  85. data/lib/plainrouter/openapi/models/get_event200_response_event_deliveries_inner.rb +30 -3
  86. data/lib/plainrouter/openapi/models/get_event200_response_event_user_data_hashed.rb +104 -0
  87. data/lib/plainrouter/openapi/models/get_event200_response_lineage.rb +2 -2
  88. data/lib/plainrouter/openapi/models/get_event200_response_lineage_children_inner.rb +31 -4
  89. data/lib/plainrouter/openapi/models/get_event200_response_lineage_parent.rb +31 -4
  90. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response.rb +2 -2
  91. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner.rb +30 -3
  92. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner_buckets_value.rb +2 -2
  93. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner_event_counts.rb +2 -2
  94. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner_event_counts_accepted.rb +2 -2
  95. data/lib/plainrouter/openapi/models/get_sandbox200_response.rb +2 -2
  96. data/lib/plainrouter/openapi/models/get_sandbox200_response_self_serve_key.rb +32 -6
  97. data/lib/plainrouter/openapi/models/{create_sandbox_key201_response.rb → get_sandbox200_response_self_serve_key_issued_key.rb} +6 -6
  98. data/lib/plainrouter/openapi/models/{create_sandbox_key201_response_use.rb → get_sandbox200_response_self_serve_key_issued_key_use.rb} +5 -5
  99. data/lib/plainrouter/openapi/models/get_sandbox200_response_try.rb +2 -2
  100. data/lib/plainrouter/openapi/models/get_sandbox200_response_try_body.rb +2 -2
  101. data/lib/plainrouter/openapi/models/get_sandbox200_response_try_body_value_data.rb +2 -2
  102. data/lib/plainrouter/openapi/models/ingestion_warning_code.rb +39 -0
  103. data/lib/plainrouter/openapi/models/jurisdiction_policy_class.rb +2 -2
  104. data/lib/plainrouter/openapi/models/list_events200_response.rb +2 -2
  105. data/lib/plainrouter/openapi/models/list_events200_response_events.rb +2 -2
  106. data/lib/plainrouter/openapi/models/list_events200_response_events_links_inner.rb +2 -2
  107. data/lib/plainrouter/openapi/models/list_events200_response_metrics.rb +2 -2
  108. data/lib/plainrouter/openapi/models/list_events_by_cursor200_response.rb +2 -2
  109. data/lib/plainrouter/openapi/models/list_events_by_cursor200_response_events.rb +2 -2
  110. data/lib/plainrouter/openapi/models/reconciliation_report.rb +31 -3
  111. data/lib/plainrouter/openapi/models/replay_deliveries202_response.rb +2 -2
  112. data/lib/plainrouter/openapi/models/replay_deliveries_request.rb +2 -2
  113. data/lib/plainrouter/openapi/models/send_test_purchase200_response.rb +2 -2
  114. data/lib/plainrouter/openapi/models/send_test_purchase422_response.rb +2 -2
  115. data/lib/plainrouter/openapi/models/send_test_purchase_request.rb +2 -2
  116. data/lib/plainrouter/openapi/models/set_destination_test_mode200_response.rb +2 -2
  117. data/lib/plainrouter/openapi/models/set_destination_test_mode200_response_destination.rb +30 -3
  118. data/lib/plainrouter/openapi/models/set_destination_test_mode_request.rb +2 -2
  119. data/lib/plainrouter/openapi/models/traffic_class.rb +2 -2
  120. data/lib/plainrouter/openapi/models/validate_sandbox_event200_response.rb +2 -2
  121. data/lib/plainrouter/openapi/models/validate_sandbox_event_request.rb +2 -2
  122. data/lib/plainrouter/openapi/models/validate_sandbox_event_request_value_data.rb +2 -2
  123. data/lib/plainrouter/openapi/models/validation_error.rb +2 -2
  124. data/lib/plainrouter/openapi/version.rb +3 -3
  125. data/lib/plainrouter/openapi.rb +58 -4
  126. data/lib/plainrouter/version.rb +1 -1
  127. metadata +64 -10
@@ -0,0 +1,516 @@
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 ActionReadItem < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :batch_id
21
+
22
+ attr_accessor :workspace_id
23
+
24
+ attr_accessor :type
25
+
26
+ attr_accessor :target_entity_type
27
+
28
+ attr_accessor :target_entity_id
29
+
30
+ attr_accessor :target_entity_name
31
+
32
+ attr_accessor :params
33
+
34
+ attr_accessor :rationale
35
+
36
+ attr_accessor :status
37
+
38
+ attr_accessor :batch_status
39
+
40
+ attr_accessor :disposition
41
+
42
+ attr_accessor :policy_decision
43
+
44
+ attr_accessor :policy_reasons
45
+
46
+ class EnumAttributeValidator
47
+ attr_reader :datatype
48
+ attr_reader :allowable_values
49
+
50
+ def initialize(datatype, allowable_values)
51
+ @allowable_values = allowable_values.map do |value|
52
+ case datatype.to_s
53
+ when /Integer/i
54
+ value.to_i
55
+ when /Float/i
56
+ value.to_f
57
+ else
58
+ value
59
+ end
60
+ end
61
+ end
62
+
63
+ def valid?(value)
64
+ !value || allowable_values.include?(value)
65
+ end
66
+ end
67
+
68
+ # Attribute mapping from ruby-style variable name to JSON key.
69
+ def self.attribute_map
70
+ {
71
+ :'id' => :'id',
72
+ :'batch_id' => :'batch_id',
73
+ :'workspace_id' => :'workspace_id',
74
+ :'type' => :'type',
75
+ :'target_entity_type' => :'target_entity_type',
76
+ :'target_entity_id' => :'target_entity_id',
77
+ :'target_entity_name' => :'target_entity_name',
78
+ :'params' => :'params',
79
+ :'rationale' => :'rationale',
80
+ :'status' => :'status',
81
+ :'batch_status' => :'batch_status',
82
+ :'disposition' => :'disposition',
83
+ :'policy_decision' => :'policy_decision',
84
+ :'policy_reasons' => :'policy_reasons'
85
+ }
86
+ end
87
+
88
+ # Returns attribute mapping this model knows about
89
+ def self.acceptable_attribute_map
90
+ attribute_map
91
+ end
92
+
93
+ # Returns all the JSON keys this model knows about
94
+ def self.acceptable_attributes
95
+ acceptable_attribute_map.values
96
+ end
97
+
98
+ # Attribute type mapping.
99
+ def self.openapi_types
100
+ {
101
+ :'id' => :'String',
102
+ :'batch_id' => :'String',
103
+ :'workspace_id' => :'Integer',
104
+ :'type' => :'String',
105
+ :'target_entity_type' => :'String',
106
+ :'target_entity_id' => :'String',
107
+ :'target_entity_name' => :'String',
108
+ :'params' => :'ActionProposalReadProposalActionsInnerParams',
109
+ :'rationale' => :'String',
110
+ :'status' => :'String',
111
+ :'batch_status' => :'String',
112
+ :'disposition' => :'ActionCurrentDisposition',
113
+ :'policy_decision' => :'String',
114
+ :'policy_reasons' => :'Array<String>'
115
+ }
116
+ end
117
+
118
+ # List of attributes with nullable: true
119
+ def self.openapi_nullable
120
+ Set.new([
121
+ :'target_entity_name',
122
+ :'policy_decision',
123
+ ])
124
+ end
125
+
126
+ # Initializes the object
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ def initialize(attributes = {})
129
+ if (!attributes.is_a?(Hash))
130
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionReadItem` initialize method"
131
+ end
132
+
133
+ # check to see if the attribute exists and convert string to symbol for hash key
134
+ acceptable_attribute_map = self.class.acceptable_attribute_map
135
+ attributes = attributes.each_with_object({}) { |(k, v), h|
136
+ if (!acceptable_attribute_map.key?(k.to_sym))
137
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::ActionReadItem`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
138
+ end
139
+ h[k.to_sym] = v
140
+ }
141
+
142
+ if attributes.key?(:'id')
143
+ self.id = attributes[:'id']
144
+ else
145
+ self.id = nil
146
+ end
147
+
148
+ if attributes.key?(:'batch_id')
149
+ self.batch_id = attributes[:'batch_id']
150
+ else
151
+ self.batch_id = nil
152
+ end
153
+
154
+ if attributes.key?(:'workspace_id')
155
+ self.workspace_id = attributes[:'workspace_id']
156
+ else
157
+ self.workspace_id = nil
158
+ end
159
+
160
+ if attributes.key?(:'type')
161
+ self.type = attributes[:'type']
162
+ else
163
+ self.type = nil
164
+ end
165
+
166
+ if attributes.key?(:'target_entity_type')
167
+ self.target_entity_type = attributes[:'target_entity_type']
168
+ else
169
+ self.target_entity_type = nil
170
+ end
171
+
172
+ if attributes.key?(:'target_entity_id')
173
+ self.target_entity_id = attributes[:'target_entity_id']
174
+ else
175
+ self.target_entity_id = nil
176
+ end
177
+
178
+ if attributes.key?(:'target_entity_name')
179
+ self.target_entity_name = attributes[:'target_entity_name']
180
+ else
181
+ self.target_entity_name = nil
182
+ end
183
+
184
+ if attributes.key?(:'params')
185
+ self.params = attributes[:'params']
186
+ else
187
+ self.params = nil
188
+ end
189
+
190
+ if attributes.key?(:'rationale')
191
+ self.rationale = attributes[:'rationale']
192
+ else
193
+ self.rationale = nil
194
+ end
195
+
196
+ if attributes.key?(:'status')
197
+ self.status = attributes[:'status']
198
+ else
199
+ self.status = nil
200
+ end
201
+
202
+ if attributes.key?(:'batch_status')
203
+ self.batch_status = attributes[:'batch_status']
204
+ else
205
+ self.batch_status = nil
206
+ end
207
+
208
+ if attributes.key?(:'disposition')
209
+ self.disposition = attributes[:'disposition']
210
+ else
211
+ self.disposition = nil
212
+ end
213
+
214
+ if attributes.key?(:'policy_decision')
215
+ self.policy_decision = attributes[:'policy_decision']
216
+ else
217
+ self.policy_decision = nil
218
+ end
219
+
220
+ if attributes.key?(:'policy_reasons')
221
+ if (value = attributes[:'policy_reasons']).is_a?(Array)
222
+ self.policy_reasons = value
223
+ end
224
+ else
225
+ self.policy_reasons = nil
226
+ end
227
+ end
228
+
229
+ # Show invalid properties with the reasons. Usually used together with valid?
230
+ # @return Array for valid properties with the reasons
231
+ def list_invalid_properties
232
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
233
+ invalid_properties = Array.new
234
+ if @id.nil?
235
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
236
+ end
237
+
238
+ if @batch_id.nil?
239
+ invalid_properties.push('invalid value for "batch_id", batch_id cannot be nil.')
240
+ end
241
+
242
+ if @workspace_id.nil?
243
+ invalid_properties.push('invalid value for "workspace_id", workspace_id cannot be nil.')
244
+ end
245
+
246
+ if @type.nil?
247
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
248
+ end
249
+
250
+ if @target_entity_type.nil?
251
+ invalid_properties.push('invalid value for "target_entity_type", target_entity_type cannot be nil.')
252
+ end
253
+
254
+ if @target_entity_id.nil?
255
+ invalid_properties.push('invalid value for "target_entity_id", target_entity_id cannot be nil.')
256
+ end
257
+
258
+ if @params.nil?
259
+ invalid_properties.push('invalid value for "params", params cannot be nil.')
260
+ end
261
+
262
+ if @rationale.nil?
263
+ invalid_properties.push('invalid value for "rationale", rationale cannot be nil.')
264
+ end
265
+
266
+ if @status.nil?
267
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
268
+ end
269
+
270
+ if @batch_status.nil?
271
+ invalid_properties.push('invalid value for "batch_status", batch_status cannot be nil.')
272
+ end
273
+
274
+ if @disposition.nil?
275
+ invalid_properties.push('invalid value for "disposition", disposition cannot be nil.')
276
+ end
277
+
278
+ if @policy_reasons.nil?
279
+ invalid_properties.push('invalid value for "policy_reasons", policy_reasons cannot be nil.')
280
+ end
281
+
282
+ invalid_properties
283
+ end
284
+
285
+ # Check to see if the all the properties in the model are valid
286
+ # @return true if the model is valid
287
+ def valid?
288
+ warn '[DEPRECATED] the `valid?` method is obsolete'
289
+ return false if @id.nil?
290
+ return false if @batch_id.nil?
291
+ return false if @workspace_id.nil?
292
+ return false if @type.nil?
293
+ type_validator = EnumAttributeValidator.new('String', ["increase_budget", "decrease_budget", "pause", "resume", "replace_creative", "shift_spend", "rollback", "create_campaign", "create_ad_set", "create_ad", "upload_asset", "adjust_budget", "set_status", "duplicate_ad_with_creative", "duplicate_adset", "duplicate_ad_with_creative_v2"])
294
+ return false unless type_validator.valid?(@type)
295
+ return false if @target_entity_type.nil?
296
+ return false if @target_entity_id.nil?
297
+ return false if @params.nil?
298
+ return false if @rationale.nil?
299
+ return false if @status.nil?
300
+ status_validator = EnumAttributeValidator.new('String', ["pending", "approved_without_execution", "rejected", "executing", "executed_pending_verification", "compensating", "measuring", "verified", "failed", "execution_uncertain", "rolled_back", "blocked"])
301
+ return false unless status_validator.valid?(@status)
302
+ return false if @batch_status.nil?
303
+ batch_status_validator = EnumAttributeValidator.new('String', ["pending", "approved", "approved_without_execution", "auto_approved", "rejected", "executing", "executed_pending_verification", "compensating", "measuring", "completed", "failed", "rolled_back", "rollback_incomplete", "blocked", "halted"])
304
+ return false unless batch_status_validator.valid?(@batch_status)
305
+ return false if @disposition.nil?
306
+ policy_decision_validator = EnumAttributeValidator.new('String', ["allow", "require_approval", "block"])
307
+ return false unless policy_decision_validator.valid?(@policy_decision)
308
+ return false if @policy_reasons.nil?
309
+ true
310
+ end
311
+
312
+ # Custom attribute writer method with validation
313
+ # @param [Object] id Value to be assigned
314
+ def id=(id)
315
+ if id.nil?
316
+ fail ArgumentError, 'id cannot be nil'
317
+ end
318
+
319
+ @id = id
320
+ end
321
+
322
+ # Custom attribute writer method with validation
323
+ # @param [Object] batch_id Value to be assigned
324
+ def batch_id=(batch_id)
325
+ if batch_id.nil?
326
+ fail ArgumentError, 'batch_id cannot be nil'
327
+ end
328
+
329
+ @batch_id = batch_id
330
+ end
331
+
332
+ # Custom attribute writer method with validation
333
+ # @param [Object] workspace_id Value to be assigned
334
+ def workspace_id=(workspace_id)
335
+ if workspace_id.nil?
336
+ fail ArgumentError, 'workspace_id cannot be nil'
337
+ end
338
+
339
+ @workspace_id = workspace_id
340
+ end
341
+
342
+ # Custom attribute writer method checking allowed values (enum).
343
+ # @param [Object] type Object to be assigned
344
+ def type=(type)
345
+ validator = EnumAttributeValidator.new('String', ["increase_budget", "decrease_budget", "pause", "resume", "replace_creative", "shift_spend", "rollback", "create_campaign", "create_ad_set", "create_ad", "upload_asset", "adjust_budget", "set_status", "duplicate_ad_with_creative", "duplicate_adset", "duplicate_ad_with_creative_v2"])
346
+ unless validator.valid?(type)
347
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
348
+ end
349
+ @type = type
350
+ end
351
+
352
+ # Custom attribute writer method with validation
353
+ # @param [Object] target_entity_type Value to be assigned
354
+ def target_entity_type=(target_entity_type)
355
+ if target_entity_type.nil?
356
+ fail ArgumentError, 'target_entity_type cannot be nil'
357
+ end
358
+
359
+ @target_entity_type = target_entity_type
360
+ end
361
+
362
+ # Custom attribute writer method with validation
363
+ # @param [Object] target_entity_id Value to be assigned
364
+ def target_entity_id=(target_entity_id)
365
+ if target_entity_id.nil?
366
+ fail ArgumentError, 'target_entity_id cannot be nil'
367
+ end
368
+
369
+ @target_entity_id = target_entity_id
370
+ end
371
+
372
+ # Custom attribute writer method with validation
373
+ # @param [Object] params Value to be assigned
374
+ def params=(params)
375
+ if params.nil?
376
+ fail ArgumentError, 'params cannot be nil'
377
+ end
378
+
379
+ @params = params
380
+ end
381
+
382
+ # Custom attribute writer method with validation
383
+ # @param [Object] rationale Value to be assigned
384
+ def rationale=(rationale)
385
+ if rationale.nil?
386
+ fail ArgumentError, 'rationale cannot be nil'
387
+ end
388
+
389
+ @rationale = rationale
390
+ end
391
+
392
+ # Custom attribute writer method checking allowed values (enum).
393
+ # @param [Object] status Object to be assigned
394
+ def status=(status)
395
+ validator = EnumAttributeValidator.new('String', ["pending", "approved_without_execution", "rejected", "executing", "executed_pending_verification", "compensating", "measuring", "verified", "failed", "execution_uncertain", "rolled_back", "blocked"])
396
+ unless validator.valid?(status)
397
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
398
+ end
399
+ @status = status
400
+ end
401
+
402
+ # Custom attribute writer method checking allowed values (enum).
403
+ # @param [Object] batch_status Object to be assigned
404
+ def batch_status=(batch_status)
405
+ validator = EnumAttributeValidator.new('String', ["pending", "approved", "approved_without_execution", "auto_approved", "rejected", "executing", "executed_pending_verification", "compensating", "measuring", "completed", "failed", "rolled_back", "rollback_incomplete", "blocked", "halted"])
406
+ unless validator.valid?(batch_status)
407
+ fail ArgumentError, "invalid value for \"batch_status\", must be one of #{validator.allowable_values}."
408
+ end
409
+ @batch_status = batch_status
410
+ end
411
+
412
+ # Custom attribute writer method with validation
413
+ # @param [Object] disposition Value to be assigned
414
+ def disposition=(disposition)
415
+ if disposition.nil?
416
+ fail ArgumentError, 'disposition cannot be nil'
417
+ end
418
+
419
+ @disposition = disposition
420
+ end
421
+
422
+ # Custom attribute writer method checking allowed values (enum).
423
+ # @param [Object] policy_decision Object to be assigned
424
+ def policy_decision=(policy_decision)
425
+ validator = EnumAttributeValidator.new('String', ["allow", "require_approval", "block"])
426
+ unless validator.valid?(policy_decision)
427
+ fail ArgumentError, "invalid value for \"policy_decision\", must be one of #{validator.allowable_values}."
428
+ end
429
+ @policy_decision = policy_decision
430
+ end
431
+
432
+ # Custom attribute writer method with validation
433
+ # @param [Object] policy_reasons Value to be assigned
434
+ def policy_reasons=(policy_reasons)
435
+ if policy_reasons.nil?
436
+ fail ArgumentError, 'policy_reasons cannot be nil'
437
+ end
438
+
439
+ @policy_reasons = policy_reasons
440
+ end
441
+
442
+ # Checks equality by comparing each attribute.
443
+ # @param [Object] Object to be compared
444
+ def ==(o)
445
+ return true if self.equal?(o)
446
+ self.class == o.class &&
447
+ id == o.id &&
448
+ batch_id == o.batch_id &&
449
+ workspace_id == o.workspace_id &&
450
+ type == o.type &&
451
+ target_entity_type == o.target_entity_type &&
452
+ target_entity_id == o.target_entity_id &&
453
+ target_entity_name == o.target_entity_name &&
454
+ params == o.params &&
455
+ rationale == o.rationale &&
456
+ status == o.status &&
457
+ batch_status == o.batch_status &&
458
+ disposition == o.disposition &&
459
+ policy_decision == o.policy_decision &&
460
+ policy_reasons == o.policy_reasons
461
+ end
462
+
463
+ # @see the `==` method
464
+ # @param [Object] Object to be compared
465
+ def eql?(o)
466
+ self == o
467
+ end
468
+
469
+ # Calculates hash code according to all attributes.
470
+ # @return [Integer] Hash code
471
+ def hash
472
+ [id, batch_id, workspace_id, type, target_entity_type, target_entity_id, target_entity_name, params, rationale, status, batch_status, disposition, policy_decision, policy_reasons].hash
473
+ end
474
+
475
+ # Builds the object from hash
476
+ # @param [Hash] attributes Model attributes in the form of hash
477
+ # @return [Object] Returns the model itself
478
+ def self.build_from_hash(attributes)
479
+ return nil unless attributes.is_a?(Hash)
480
+ attributes = attributes.transform_keys(&:to_sym)
481
+ transformed_hash = {}
482
+ openapi_types.each_pair do |key, type|
483
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
484
+ transformed_hash["#{key}"] = nil
485
+ elsif type =~ /\AArray<(.*)>/i
486
+ # check to ensure the input is an array given that the attribute
487
+ # is documented as an array but the input is not
488
+ if attributes[attribute_map[key]].is_a?(Array)
489
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
490
+ end
491
+ elsif !attributes[attribute_map[key]].nil?
492
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
493
+ end
494
+ end
495
+ new(transformed_hash)
496
+ end
497
+
498
+ # Returns the object in the form of hash
499
+ # @return [Hash] Returns the object in the form of hash
500
+ def to_hash
501
+ hash = {}
502
+ self.class.attribute_map.each_pair do |attr, param|
503
+ value = self.send(attr)
504
+ if value.nil?
505
+ is_nullable = self.class.openapi_nullable.include?(attr)
506
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
507
+ end
508
+
509
+ hash[param] = _to_hash(value)
510
+ end
511
+ hash
512
+ end
513
+
514
+ end
515
+
516
+ end
@@ -1,7 +1,7 @@
1
1
  =begin
2
- #PlainRouter Conversion API
2
+ #Plainrouter Conversion API
3
3
 
4
- #PlainRouter public Signals Conversion API.
4
+ #Plainrouter public Signals Conversion API.
5
5
 
6
6
  The version of the OpenAPI document: 0.5.0
7
7