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