plainrouter-sdk 0.2.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -2
- data/lib/plainrouter/client.rb +2 -1
- data/lib/plainrouter/openapi/api/action_dry_run_api_api.rb +2 -2
- data/lib/plainrouter/openapi/api/action_proposal_api_api.rb +2 -2
- data/lib/plainrouter/openapi/api/ad_test_api_api.rb +259 -0
- data/lib/plainrouter/openapi/api/cookie_declaration_api.rb +90 -0
- data/lib/plainrouter/openapi/api/creative_api.rb +181 -0
- data/lib/plainrouter/openapi/api/deployment_plan_api.rb +306 -0
- data/lib/plainrouter/openapi/api/meta_inventory_exposure_api.rb +121 -0
- data/lib/plainrouter/openapi/configuration.rb +42 -0
- data/lib/plainrouter/openapi/models/action_current_disposition.rb +13 -1
- data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload.rb +238 -0
- data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_baseline.rb +103 -0
- data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_baseline_any_of.rb +245 -0
- data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_inverse.rb +206 -0
- data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_metrics.rb +103 -0
- data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_metrics_any_of.rb +276 -0
- data/lib/plainrouter/openapi/models/action_policy_read_data.rb +3 -105
- data/lib/plainrouter/openapi/models/action_policy_result.rb +374 -0
- data/lib/plainrouter/openapi/models/action_proposal_input.rb +32 -4
- data/lib/plainrouter/openapi/models/action_read_item.rb +62 -4
- data/lib/plainrouter/openapi/models/action_read_item_evidence.rb +105 -0
- data/lib/plainrouter/openapi/models/action_read_item_evidence_any_of.rb +190 -0
- data/lib/plainrouter/openapi/models/action_read_item_evidence_any_of1.rb +242 -0
- data/lib/plainrouter/openapi/models/action_read_item_evidence_any_of2.rb +217 -0
- data/lib/plainrouter/openapi/models/action_read_item_evidence_any_of_outcome.rb +238 -0
- data/lib/plainrouter/openapi/models/action_read_item_proposer.rb +198 -0
- data/lib/plainrouter/openapi/models/actions_api_dry_run401_response.rb +103 -0
- data/lib/plainrouter/openapi/models/actions_tests_api_index404_response.rb +103 -0
- data/lib/plainrouter/openapi/models/actions_tests_api_store_request.rb +467 -0
- data/lib/plainrouter/openapi/models/actions_tests_api_store_request_maximum_spend_minor.rb +104 -0
- data/lib/plainrouter/openapi/models/ad_test.rb +552 -0
- data/lib/plainrouter/openapi/models/ad_test_create_read.rb +164 -0
- data/lib/plainrouter/openapi/models/ad_test_create_read_test.rb +675 -0
- data/lib/plainrouter/openapi/models/ad_test_create_read_test_members_inner.rb +232 -0
- data/lib/plainrouter/openapi/models/ad_test_create_read_test_pause_proposals_inner.rb +286 -0
- data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict.rb +336 -0
- data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_daily_facts_inner.rb +374 -0
- data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_halt_details.rb +285 -0
- data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_halt_details_baseline.rb +190 -0
- data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_halt_details_observed_destinations_inner.rb +216 -0
- data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_members_inner.rb +349 -0
- data/lib/plainrouter/openapi/models/ad_test_daily_fact_read.rb +374 -0
- data/lib/plainrouter/openapi/models/ad_test_event_choice.rb +190 -0
- data/lib/plainrouter/openapi/models/ad_test_list_read.rb +218 -0
- data/lib/plainrouter/openapi/models/ad_test_list_read_observed_conversion_events_inner.rb +190 -0
- data/lib/plainrouter/openapi/models/ad_test_list_read_tests.rb +396 -0
- data/lib/plainrouter/openapi/models/ad_test_read.rb +675 -0
- data/lib/plainrouter/openapi/models/ad_test_show_read.rb +164 -0
- data/lib/plainrouter/openapi/models/ad_test_verdict_member_read.rb +349 -0
- data/lib/plainrouter/openapi/models/ad_test_verdict_read.rb +336 -0
- data/lib/plainrouter/openapi/models/agent_credential_error.rb +214 -0
- data/lib/plainrouter/openapi/models/api_route_not_found.rb +216 -0
- data/lib/plainrouter/openapi/models/api_route_not_found_error.rb +240 -0
- data/lib/plainrouter/openapi/models/api_route_not_found_request.rb +190 -0
- data/lib/plainrouter/openapi/models/api_route_not_found_resources.rb +190 -0
- data/lib/plainrouter/openapi/models/cookie_declaration.rb +177 -0
- data/lib/plainrouter/openapi/models/cookie_declaration_categories.rb +268 -0
- data/lib/plainrouter/openapi/models/cookie_declaration_categories_necessary.rb +194 -0
- data/lib/plainrouter/openapi/models/cookie_declaration_item.rb +280 -0
- data/lib/plainrouter/openapi/models/create_event202_response_warnings_inner.rb +2 -2
- data/lib/plainrouter/openapi/models/create_event_request_any_of.rb +1 -1
- data/lib/plainrouter/openapi/models/create_event_request_any_of1.rb +1 -1
- data/lib/plainrouter/openapi/models/creative_intake_read.rb +164 -0
- data/lib/plainrouter/openapi/models/creative_intake_read_creative.rb +451 -0
- data/lib/plainrouter/openapi/models/creative_intake_read_creative_tags.rb +104 -0
- data/lib/plainrouter/openapi/models/creative_intake_rejected.rb +164 -0
- data/lib/plainrouter/openapi/models/creative_intake_rejected_error.rb +190 -0
- data/lib/plainrouter/openapi/models/creative_intake_tags.rb +257 -0
- data/lib/plainrouter/openapi/models/deployment_plan.rb +593 -0
- data/lib/plainrouter/openapi/models/deployment_plan_read.rb +268 -0
- data/lib/plainrouter/openapi/models/deployment_plan_read_copy.rb +266 -0
- data/lib/plainrouter/openapi/models/deployment_plan_read_creatives_inner.rb +320 -0
- data/lib/plainrouter/openapi/models/deployment_plan_read_creatives_inner_copy.rb +267 -0
- data/lib/plainrouter/openapi/models/destination_type.rb +2 -1
- data/lib/plainrouter/openapi/models/execute_deployment_plan_request.rb +200 -0
- data/lib/plainrouter/openapi/models/get_cookie_declaration404_response.rb +103 -0
- data/lib/plainrouter/openapi/models/get_inventory_metrics200_response.rb +324 -0
- data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_account.rb +264 -0
- data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_changes_inner.rb +304 -0
- data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_effective_range.rb +190 -0
- data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_metrics_inner.rb +492 -0
- data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_object_metrics_inner.rb +304 -0
- data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_object_metrics_inner_meta.rb +268 -0
- data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_staleness.rb +200 -0
- data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_sync.rb +186 -0
- data/lib/plainrouter/openapi/models/ingestion_warning_code.rb +2 -1
- data/lib/plainrouter/openapi/models/launch_intent_read.rb +164 -0
- data/lib/plainrouter/openapi/models/launch_intent_read_intent.rb +330 -0
- data/lib/plainrouter/openapi/models/launch_intent_read_intent_actions_inner.rb +238 -0
- data/lib/plainrouter/openapi/models/launch_intent_status.rb +46 -0
- data/lib/plainrouter/openapi/models/launch_plans_copy403_response.rb +103 -0
- data/lib/plainrouter/openapi/models/launch_plans_copy404_response.rb +103 -0
- data/lib/plainrouter/openapi/models/launch_plans_execute422_response.rb +103 -0
- data/lib/plainrouter/openapi/models/launch_plans_index200_response.rb +164 -0
- data/lib/plainrouter/openapi/models/launch_plans_index200_response_plans.rb +244 -0
- data/lib/plainrouter/openapi/models/launch_plans_show200_response.rb +164 -0
- data/lib/plainrouter/openapi/models/plan_copy_forbidden.rb +164 -0
- data/lib/plainrouter/openapi/models/plan_copy_forbidden_error.rb +214 -0
- data/lib/plainrouter/openapi/models/plan_copy_not_found.rb +164 -0
- data/lib/plainrouter/openapi/models/plan_copy_not_found_error.rb +214 -0
- data/lib/plainrouter/openapi/models/plan_copy_read.rb +164 -0
- data/lib/plainrouter/openapi/models/plan_copy_read_plan.rb +347 -0
- data/lib/plainrouter/openapi/models/plan_copy_rejected.rb +164 -0
- data/lib/plainrouter/openapi/models/plan_copy_rejected_error.rb +214 -0
- data/lib/plainrouter/openapi/models/plan_execute_conflict.rb +164 -0
- data/lib/plainrouter/openapi/models/plan_execute_conflict_error.rb +214 -0
- data/lib/plainrouter/openapi/models/plan_execute_rejected.rb +164 -0
- data/lib/plainrouter/openapi/models/plan_execute_rejected_error.rb +214 -0
- data/lib/plainrouter/openapi/models/proposal_replay_conflict.rb +214 -0
- data/lib/plainrouter/openapi/models/proposal_replay_conflict_errors.rb +178 -0
- data/lib/plainrouter/openapi/models/store_creative403_response.rb +103 -0
- data/lib/plainrouter/openapi/models/store_creative413_response.rb +103 -0
- data/lib/plainrouter/openapi/models/store_creative422_response.rb +103 -0
- data/lib/plainrouter/openapi/models/store_creative_from_url_request.rb +208 -0
- data/lib/plainrouter/openapi/models/store_creative_from_url_request_tags.rb +257 -0
- data/lib/plainrouter/openapi/models/store_creative_request.rb +219 -0
- data/lib/plainrouter/openapi/models/store_creative_request_tags.rb +257 -0
- data/lib/plainrouter/openapi/models/workspace_lock_timeout.rb +164 -0
- data/lib/plainrouter/openapi/models/workspace_lock_timeout_error.rb +214 -0
- data/lib/plainrouter/openapi/version.rb +1 -1
- data/lib/plainrouter/openapi.rb +106 -0
- data/lib/plainrouter/version.rb +1 -1
- metadata +108 -2
|
@@ -33,6 +33,10 @@ module PlainRouter::OpenAPI
|
|
|
33
33
|
|
|
34
34
|
attr_accessor :rationale
|
|
35
35
|
|
|
36
|
+
attr_accessor :proposer
|
|
37
|
+
|
|
38
|
+
attr_accessor :evidence
|
|
39
|
+
|
|
36
40
|
attr_accessor :status
|
|
37
41
|
|
|
38
42
|
attr_accessor :batch_status
|
|
@@ -43,6 +47,10 @@ module PlainRouter::OpenAPI
|
|
|
43
47
|
|
|
44
48
|
attr_accessor :policy_reasons
|
|
45
49
|
|
|
50
|
+
attr_accessor :policy_result
|
|
51
|
+
|
|
52
|
+
attr_accessor :policy_results
|
|
53
|
+
|
|
46
54
|
class EnumAttributeValidator
|
|
47
55
|
attr_reader :datatype
|
|
48
56
|
attr_reader :allowable_values
|
|
@@ -77,11 +85,15 @@ module PlainRouter::OpenAPI
|
|
|
77
85
|
:'target_entity_name' => :'target_entity_name',
|
|
78
86
|
:'params' => :'params',
|
|
79
87
|
:'rationale' => :'rationale',
|
|
88
|
+
:'proposer' => :'proposer',
|
|
89
|
+
:'evidence' => :'evidence',
|
|
80
90
|
:'status' => :'status',
|
|
81
91
|
:'batch_status' => :'batch_status',
|
|
82
92
|
:'disposition' => :'disposition',
|
|
83
93
|
:'policy_decision' => :'policy_decision',
|
|
84
|
-
:'policy_reasons' => :'policy_reasons'
|
|
94
|
+
:'policy_reasons' => :'policy_reasons',
|
|
95
|
+
:'policy_result' => :'policy_result',
|
|
96
|
+
:'policy_results' => :'policy_results'
|
|
85
97
|
}
|
|
86
98
|
end
|
|
87
99
|
|
|
@@ -107,11 +119,15 @@ module PlainRouter::OpenAPI
|
|
|
107
119
|
:'target_entity_name' => :'String',
|
|
108
120
|
:'params' => :'ActionProposalReadProposalActionsInnerParams',
|
|
109
121
|
:'rationale' => :'String',
|
|
122
|
+
:'proposer' => :'ActionReadItemProposer',
|
|
123
|
+
:'evidence' => :'ActionReadItemEvidence',
|
|
110
124
|
:'status' => :'String',
|
|
111
125
|
:'batch_status' => :'String',
|
|
112
126
|
:'disposition' => :'ActionCurrentDisposition',
|
|
113
127
|
:'policy_decision' => :'String',
|
|
114
|
-
:'policy_reasons' => :'Array<String>'
|
|
128
|
+
:'policy_reasons' => :'Array<String>',
|
|
129
|
+
:'policy_result' => :'ActionPolicyResult',
|
|
130
|
+
:'policy_results' => :'Array<ActionPolicyResult>'
|
|
115
131
|
}
|
|
116
132
|
end
|
|
117
133
|
|
|
@@ -120,6 +136,7 @@ module PlainRouter::OpenAPI
|
|
|
120
136
|
Set.new([
|
|
121
137
|
:'target_entity_name',
|
|
122
138
|
:'policy_decision',
|
|
139
|
+
:'policy_result',
|
|
123
140
|
])
|
|
124
141
|
end
|
|
125
142
|
|
|
@@ -193,6 +210,14 @@ module PlainRouter::OpenAPI
|
|
|
193
210
|
self.rationale = nil
|
|
194
211
|
end
|
|
195
212
|
|
|
213
|
+
if attributes.key?(:'proposer')
|
|
214
|
+
self.proposer = attributes[:'proposer']
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
if attributes.key?(:'evidence')
|
|
218
|
+
self.evidence = attributes[:'evidence']
|
|
219
|
+
end
|
|
220
|
+
|
|
196
221
|
if attributes.key?(:'status')
|
|
197
222
|
self.status = attributes[:'status']
|
|
198
223
|
else
|
|
@@ -224,6 +249,20 @@ module PlainRouter::OpenAPI
|
|
|
224
249
|
else
|
|
225
250
|
self.policy_reasons = nil
|
|
226
251
|
end
|
|
252
|
+
|
|
253
|
+
if attributes.key?(:'policy_result')
|
|
254
|
+
self.policy_result = attributes[:'policy_result']
|
|
255
|
+
else
|
|
256
|
+
self.policy_result = nil
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
if attributes.key?(:'policy_results')
|
|
260
|
+
if (value = attributes[:'policy_results']).is_a?(Array)
|
|
261
|
+
self.policy_results = value
|
|
262
|
+
end
|
|
263
|
+
else
|
|
264
|
+
self.policy_results = nil
|
|
265
|
+
end
|
|
227
266
|
end
|
|
228
267
|
|
|
229
268
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -279,6 +318,10 @@ module PlainRouter::OpenAPI
|
|
|
279
318
|
invalid_properties.push('invalid value for "policy_reasons", policy_reasons cannot be nil.')
|
|
280
319
|
end
|
|
281
320
|
|
|
321
|
+
if @policy_results.nil?
|
|
322
|
+
invalid_properties.push('invalid value for "policy_results", policy_results cannot be nil.')
|
|
323
|
+
end
|
|
324
|
+
|
|
282
325
|
invalid_properties
|
|
283
326
|
end
|
|
284
327
|
|
|
@@ -306,6 +349,7 @@ module PlainRouter::OpenAPI
|
|
|
306
349
|
policy_decision_validator = EnumAttributeValidator.new('String', ["allow", "require_approval", "block"])
|
|
307
350
|
return false unless policy_decision_validator.valid?(@policy_decision)
|
|
308
351
|
return false if @policy_reasons.nil?
|
|
352
|
+
return false if @policy_results.nil?
|
|
309
353
|
true
|
|
310
354
|
end
|
|
311
355
|
|
|
@@ -439,6 +483,16 @@ module PlainRouter::OpenAPI
|
|
|
439
483
|
@policy_reasons = policy_reasons
|
|
440
484
|
end
|
|
441
485
|
|
|
486
|
+
# Custom attribute writer method with validation
|
|
487
|
+
# @param [Object] policy_results Value to be assigned
|
|
488
|
+
def policy_results=(policy_results)
|
|
489
|
+
if policy_results.nil?
|
|
490
|
+
fail ArgumentError, 'policy_results cannot be nil'
|
|
491
|
+
end
|
|
492
|
+
|
|
493
|
+
@policy_results = policy_results
|
|
494
|
+
end
|
|
495
|
+
|
|
442
496
|
# Checks equality by comparing each attribute.
|
|
443
497
|
# @param [Object] Object to be compared
|
|
444
498
|
def ==(o)
|
|
@@ -453,11 +507,15 @@ module PlainRouter::OpenAPI
|
|
|
453
507
|
target_entity_name == o.target_entity_name &&
|
|
454
508
|
params == o.params &&
|
|
455
509
|
rationale == o.rationale &&
|
|
510
|
+
proposer == o.proposer &&
|
|
511
|
+
evidence == o.evidence &&
|
|
456
512
|
status == o.status &&
|
|
457
513
|
batch_status == o.batch_status &&
|
|
458
514
|
disposition == o.disposition &&
|
|
459
515
|
policy_decision == o.policy_decision &&
|
|
460
|
-
policy_reasons == o.policy_reasons
|
|
516
|
+
policy_reasons == o.policy_reasons &&
|
|
517
|
+
policy_result == o.policy_result &&
|
|
518
|
+
policy_results == o.policy_results
|
|
461
519
|
end
|
|
462
520
|
|
|
463
521
|
# @see the `==` method
|
|
@@ -469,7 +527,7 @@ module PlainRouter::OpenAPI
|
|
|
469
527
|
# Calculates hash code according to all attributes.
|
|
470
528
|
# @return [Integer] Hash code
|
|
471
529
|
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
|
|
530
|
+
[id, batch_id, workspace_id, type, target_entity_type, target_entity_id, target_entity_name, params, rationale, proposer, evidence, status, batch_status, disposition, policy_decision, policy_reasons, policy_result, policy_results].hash
|
|
473
531
|
end
|
|
474
532
|
|
|
475
533
|
# Builds the object from hash
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
# System evidence cites either the original action and its counted outcome or the rule, revision, run and decision.
|
|
18
|
+
module ActionReadItemEvidence
|
|
19
|
+
class << self
|
|
20
|
+
# List of class defined in anyOf (OpenAPI v3)
|
|
21
|
+
def openapi_any_of
|
|
22
|
+
[
|
|
23
|
+
:'ActionReadItemEvidenceAnyOf',
|
|
24
|
+
:'ActionReadItemEvidenceAnyOf1',
|
|
25
|
+
:'ActionReadItemEvidenceAnyOf2'
|
|
26
|
+
]
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Builds the object
|
|
30
|
+
# @param [Mixed] Data to be matched against the list of anyOf items
|
|
31
|
+
# @return [Object] Returns the model or the data itself
|
|
32
|
+
def build(data)
|
|
33
|
+
# Go through the list of anyOf items and attempt to identify the appropriate one.
|
|
34
|
+
# Note:
|
|
35
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
36
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
37
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
38
|
+
# - TODO: logging when debugging is set.
|
|
39
|
+
openapi_any_of.each do |klass|
|
|
40
|
+
begin
|
|
41
|
+
next if klass == :AnyType # "nullable: true"
|
|
42
|
+
return find_and_cast_into_type(klass, data)
|
|
43
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
openapi_any_of.include?(:AnyType) ? data : nil
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
private
|
|
51
|
+
|
|
52
|
+
SchemaMismatchError = Class.new(StandardError)
|
|
53
|
+
|
|
54
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
55
|
+
def find_and_cast_into_type(klass, data)
|
|
56
|
+
return if data.nil?
|
|
57
|
+
|
|
58
|
+
case klass.to_s
|
|
59
|
+
when 'Boolean'
|
|
60
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
61
|
+
when 'Float'
|
|
62
|
+
return data if data.instance_of?(Float)
|
|
63
|
+
when 'Integer'
|
|
64
|
+
return data if data.instance_of?(Integer)
|
|
65
|
+
when 'Time'
|
|
66
|
+
return Time.parse(data)
|
|
67
|
+
when 'Date'
|
|
68
|
+
return Date.iso8601(data)
|
|
69
|
+
when 'String'
|
|
70
|
+
return data if data.instance_of?(String)
|
|
71
|
+
when 'Object' # "type: object"
|
|
72
|
+
return data if data.instance_of?(Hash)
|
|
73
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
74
|
+
if data.instance_of?(Array)
|
|
75
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
76
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
77
|
+
end
|
|
78
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
79
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
80
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
81
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
82
|
+
end
|
|
83
|
+
else # model
|
|
84
|
+
const = PlainRouter::OpenAPI.const_get(klass)
|
|
85
|
+
if const
|
|
86
|
+
if const.respond_to?(:openapi_any_of) # nested anyOf model
|
|
87
|
+
model = const.build(data)
|
|
88
|
+
return model if model
|
|
89
|
+
else
|
|
90
|
+
# raise if data contains keys that are not known to the model
|
|
91
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
92
|
+
model = const.build_from_hash(data)
|
|
93
|
+
return model if model
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
raise # if no match by now, raise
|
|
99
|
+
rescue
|
|
100
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
end
|
|
@@ -0,0 +1,190 @@
|
|
|
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 ActionReadItemEvidenceAnyOf < ApiModelBase
|
|
18
|
+
attr_accessor :original_action_id
|
|
19
|
+
|
|
20
|
+
attr_accessor :outcome
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'original_action_id' => :'original_action_id',
|
|
26
|
+
:'outcome' => :'outcome'
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Returns attribute mapping this model knows about
|
|
31
|
+
def self.acceptable_attribute_map
|
|
32
|
+
attribute_map
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Returns all the JSON keys this model knows about
|
|
36
|
+
def self.acceptable_attributes
|
|
37
|
+
acceptable_attribute_map.values
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Attribute type mapping.
|
|
41
|
+
def self.openapi_types
|
|
42
|
+
{
|
|
43
|
+
:'original_action_id' => :'String',
|
|
44
|
+
:'outcome' => :'ActionReadItemEvidenceAnyOfOutcome'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# List of attributes with nullable: true
|
|
49
|
+
def self.openapi_nullable
|
|
50
|
+
Set.new([
|
|
51
|
+
])
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Initializes the object
|
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
|
+
def initialize(attributes = {})
|
|
57
|
+
if (!attributes.is_a?(Hash))
|
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionReadItemEvidenceAnyOf` initialize method"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
64
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::ActionReadItemEvidenceAnyOf`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
66
|
+
end
|
|
67
|
+
h[k.to_sym] = v
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'original_action_id')
|
|
71
|
+
self.original_action_id = attributes[:'original_action_id']
|
|
72
|
+
else
|
|
73
|
+
self.original_action_id = nil
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'outcome')
|
|
77
|
+
self.outcome = attributes[:'outcome']
|
|
78
|
+
else
|
|
79
|
+
self.outcome = nil
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
84
|
+
# @return Array for valid properties with the reasons
|
|
85
|
+
def list_invalid_properties
|
|
86
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
|
+
invalid_properties = Array.new
|
|
88
|
+
if @original_action_id.nil?
|
|
89
|
+
invalid_properties.push('invalid value for "original_action_id", original_action_id cannot be nil.')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if @outcome.nil?
|
|
93
|
+
invalid_properties.push('invalid value for "outcome", outcome cannot be nil.')
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
invalid_properties
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Check to see if the all the properties in the model are valid
|
|
100
|
+
# @return true if the model is valid
|
|
101
|
+
def valid?
|
|
102
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
103
|
+
return false if @original_action_id.nil?
|
|
104
|
+
return false if @outcome.nil?
|
|
105
|
+
true
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Custom attribute writer method with validation
|
|
109
|
+
# @param [Object] original_action_id Value to be assigned
|
|
110
|
+
def original_action_id=(original_action_id)
|
|
111
|
+
if original_action_id.nil?
|
|
112
|
+
fail ArgumentError, 'original_action_id cannot be nil'
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
@original_action_id = original_action_id
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Custom attribute writer method with validation
|
|
119
|
+
# @param [Object] outcome Value to be assigned
|
|
120
|
+
def outcome=(outcome)
|
|
121
|
+
if outcome.nil?
|
|
122
|
+
fail ArgumentError, 'outcome cannot be nil'
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
@outcome = outcome
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Checks equality by comparing each attribute.
|
|
129
|
+
# @param [Object] Object to be compared
|
|
130
|
+
def ==(o)
|
|
131
|
+
return true if self.equal?(o)
|
|
132
|
+
self.class == o.class &&
|
|
133
|
+
original_action_id == o.original_action_id &&
|
|
134
|
+
outcome == o.outcome
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# @see the `==` method
|
|
138
|
+
# @param [Object] Object to be compared
|
|
139
|
+
def eql?(o)
|
|
140
|
+
self == o
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Calculates hash code according to all attributes.
|
|
144
|
+
# @return [Integer] Hash code
|
|
145
|
+
def hash
|
|
146
|
+
[original_action_id, outcome].hash
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Builds the object from hash
|
|
150
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
151
|
+
# @return [Object] Returns the model itself
|
|
152
|
+
def self.build_from_hash(attributes)
|
|
153
|
+
return nil unless attributes.is_a?(Hash)
|
|
154
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
155
|
+
transformed_hash = {}
|
|
156
|
+
openapi_types.each_pair do |key, type|
|
|
157
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
158
|
+
transformed_hash["#{key}"] = nil
|
|
159
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
160
|
+
# check to ensure the input is an array given that the attribute
|
|
161
|
+
# is documented as an array but the input is not
|
|
162
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
163
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
164
|
+
end
|
|
165
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
166
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
new(transformed_hash)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Returns the object in the form of hash
|
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
|
174
|
+
def to_hash
|
|
175
|
+
hash = {}
|
|
176
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
177
|
+
value = self.send(attr)
|
|
178
|
+
if value.nil?
|
|
179
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
180
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
hash[param] = _to_hash(value)
|
|
184
|
+
end
|
|
185
|
+
hash
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
end
|
|
@@ -0,0 +1,242 @@
|
|
|
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 ActionReadItemEvidenceAnyOf1 < ApiModelBase
|
|
18
|
+
attr_accessor :rule_id
|
|
19
|
+
|
|
20
|
+
attr_accessor :revision_id
|
|
21
|
+
|
|
22
|
+
attr_accessor :run_id
|
|
23
|
+
|
|
24
|
+
attr_accessor :decision_id
|
|
25
|
+
|
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
27
|
+
def self.attribute_map
|
|
28
|
+
{
|
|
29
|
+
:'rule_id' => :'rule_id',
|
|
30
|
+
:'revision_id' => :'revision_id',
|
|
31
|
+
:'run_id' => :'run_id',
|
|
32
|
+
:'decision_id' => :'decision_id'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns attribute mapping this model knows about
|
|
37
|
+
def self.acceptable_attribute_map
|
|
38
|
+
attribute_map
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns all the JSON keys this model knows about
|
|
42
|
+
def self.acceptable_attributes
|
|
43
|
+
acceptable_attribute_map.values
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute type mapping.
|
|
47
|
+
def self.openapi_types
|
|
48
|
+
{
|
|
49
|
+
:'rule_id' => :'String',
|
|
50
|
+
:'revision_id' => :'String',
|
|
51
|
+
:'run_id' => :'String',
|
|
52
|
+
:'decision_id' => :'String'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionReadItemEvidenceAnyOf1` initialize method"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::ActionReadItemEvidenceAnyOf1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
|
+
end
|
|
75
|
+
h[k.to_sym] = v
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'rule_id')
|
|
79
|
+
self.rule_id = attributes[:'rule_id']
|
|
80
|
+
else
|
|
81
|
+
self.rule_id = nil
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'revision_id')
|
|
85
|
+
self.revision_id = attributes[:'revision_id']
|
|
86
|
+
else
|
|
87
|
+
self.revision_id = nil
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'run_id')
|
|
91
|
+
self.run_id = attributes[:'run_id']
|
|
92
|
+
else
|
|
93
|
+
self.run_id = nil
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'decision_id')
|
|
97
|
+
self.decision_id = attributes[:'decision_id']
|
|
98
|
+
else
|
|
99
|
+
self.decision_id = nil
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
104
|
+
# @return Array for valid properties with the reasons
|
|
105
|
+
def list_invalid_properties
|
|
106
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
107
|
+
invalid_properties = Array.new
|
|
108
|
+
if @rule_id.nil?
|
|
109
|
+
invalid_properties.push('invalid value for "rule_id", rule_id cannot be nil.')
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if @revision_id.nil?
|
|
113
|
+
invalid_properties.push('invalid value for "revision_id", revision_id cannot be nil.')
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if @run_id.nil?
|
|
117
|
+
invalid_properties.push('invalid value for "run_id", run_id cannot be nil.')
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if @decision_id.nil?
|
|
121
|
+
invalid_properties.push('invalid value for "decision_id", decision_id cannot be nil.')
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
invalid_properties
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Check to see if the all the properties in the model are valid
|
|
128
|
+
# @return true if the model is valid
|
|
129
|
+
def valid?
|
|
130
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
131
|
+
return false if @rule_id.nil?
|
|
132
|
+
return false if @revision_id.nil?
|
|
133
|
+
return false if @run_id.nil?
|
|
134
|
+
return false if @decision_id.nil?
|
|
135
|
+
true
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Custom attribute writer method with validation
|
|
139
|
+
# @param [Object] rule_id Value to be assigned
|
|
140
|
+
def rule_id=(rule_id)
|
|
141
|
+
if rule_id.nil?
|
|
142
|
+
fail ArgumentError, 'rule_id cannot be nil'
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
@rule_id = rule_id
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Custom attribute writer method with validation
|
|
149
|
+
# @param [Object] revision_id Value to be assigned
|
|
150
|
+
def revision_id=(revision_id)
|
|
151
|
+
if revision_id.nil?
|
|
152
|
+
fail ArgumentError, 'revision_id cannot be nil'
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
@revision_id = revision_id
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Custom attribute writer method with validation
|
|
159
|
+
# @param [Object] run_id Value to be assigned
|
|
160
|
+
def run_id=(run_id)
|
|
161
|
+
if run_id.nil?
|
|
162
|
+
fail ArgumentError, 'run_id cannot be nil'
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
@run_id = run_id
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Custom attribute writer method with validation
|
|
169
|
+
# @param [Object] decision_id Value to be assigned
|
|
170
|
+
def decision_id=(decision_id)
|
|
171
|
+
if decision_id.nil?
|
|
172
|
+
fail ArgumentError, 'decision_id cannot be nil'
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
@decision_id = decision_id
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Checks equality by comparing each attribute.
|
|
179
|
+
# @param [Object] Object to be compared
|
|
180
|
+
def ==(o)
|
|
181
|
+
return true if self.equal?(o)
|
|
182
|
+
self.class == o.class &&
|
|
183
|
+
rule_id == o.rule_id &&
|
|
184
|
+
revision_id == o.revision_id &&
|
|
185
|
+
run_id == o.run_id &&
|
|
186
|
+
decision_id == o.decision_id
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# @see the `==` method
|
|
190
|
+
# @param [Object] Object to be compared
|
|
191
|
+
def eql?(o)
|
|
192
|
+
self == o
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Calculates hash code according to all attributes.
|
|
196
|
+
# @return [Integer] Hash code
|
|
197
|
+
def hash
|
|
198
|
+
[rule_id, revision_id, run_id, decision_id].hash
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Builds the object from hash
|
|
202
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
203
|
+
# @return [Object] Returns the model itself
|
|
204
|
+
def self.build_from_hash(attributes)
|
|
205
|
+
return nil unless attributes.is_a?(Hash)
|
|
206
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
207
|
+
transformed_hash = {}
|
|
208
|
+
openapi_types.each_pair do |key, type|
|
|
209
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
210
|
+
transformed_hash["#{key}"] = nil
|
|
211
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
212
|
+
# check to ensure the input is an array given that the attribute
|
|
213
|
+
# is documented as an array but the input is not
|
|
214
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
215
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
216
|
+
end
|
|
217
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
218
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
new(transformed_hash)
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Returns the object in the form of hash
|
|
225
|
+
# @return [Hash] Returns the object in the form of hash
|
|
226
|
+
def to_hash
|
|
227
|
+
hash = {}
|
|
228
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
229
|
+
value = self.send(attr)
|
|
230
|
+
if value.nil?
|
|
231
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
232
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
hash[param] = _to_hash(value)
|
|
236
|
+
end
|
|
237
|
+
hash
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
end
|