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
|
@@ -21,18 +21,6 @@ module PlainRouter::OpenAPI
|
|
|
21
21
|
|
|
22
22
|
attr_accessor :execution_mode
|
|
23
23
|
|
|
24
|
-
attr_accessor :max_spend_delta_percent
|
|
25
|
-
|
|
26
|
-
attr_accessor :hard_account_daily_cap_minor
|
|
27
|
-
|
|
28
|
-
attr_accessor :protected_entities
|
|
29
|
-
|
|
30
|
-
attr_accessor :quiet_hours_start
|
|
31
|
-
|
|
32
|
-
attr_accessor :quiet_hours_end
|
|
33
|
-
|
|
34
|
-
attr_accessor :protect_learning_phase
|
|
35
|
-
|
|
36
24
|
attr_accessor :outcome_check_after_hours
|
|
37
25
|
|
|
38
26
|
attr_accessor :anomaly_threshold_percent
|
|
@@ -65,12 +53,6 @@ module PlainRouter::OpenAPI
|
|
|
65
53
|
:'id' => :'id',
|
|
66
54
|
:'workspace_id' => :'workspace_id',
|
|
67
55
|
:'execution_mode' => :'execution_mode',
|
|
68
|
-
:'max_spend_delta_percent' => :'max_spend_delta_percent',
|
|
69
|
-
:'hard_account_daily_cap_minor' => :'hard_account_daily_cap_minor',
|
|
70
|
-
:'protected_entities' => :'protected_entities',
|
|
71
|
-
:'quiet_hours_start' => :'quiet_hours_start',
|
|
72
|
-
:'quiet_hours_end' => :'quiet_hours_end',
|
|
73
|
-
:'protect_learning_phase' => :'protect_learning_phase',
|
|
74
56
|
:'outcome_check_after_hours' => :'outcome_check_after_hours',
|
|
75
57
|
:'anomaly_threshold_percent' => :'anomaly_threshold_percent'
|
|
76
58
|
}
|
|
@@ -92,12 +74,6 @@ module PlainRouter::OpenAPI
|
|
|
92
74
|
:'id' => :'Integer',
|
|
93
75
|
:'workspace_id' => :'Integer',
|
|
94
76
|
:'execution_mode' => :'String',
|
|
95
|
-
:'max_spend_delta_percent' => :'String',
|
|
96
|
-
:'hard_account_daily_cap_minor' => :'Integer',
|
|
97
|
-
:'protected_entities' => :'Array<Object>',
|
|
98
|
-
:'quiet_hours_start' => :'String',
|
|
99
|
-
:'quiet_hours_end' => :'String',
|
|
100
|
-
:'protect_learning_phase' => :'Boolean',
|
|
101
77
|
:'outcome_check_after_hours' => :'Integer',
|
|
102
78
|
:'anomaly_threshold_percent' => :'String'
|
|
103
79
|
}
|
|
@@ -107,10 +83,6 @@ module PlainRouter::OpenAPI
|
|
|
107
83
|
def self.openapi_nullable
|
|
108
84
|
Set.new([
|
|
109
85
|
:'id',
|
|
110
|
-
:'hard_account_daily_cap_minor',
|
|
111
|
-
:'protected_entities',
|
|
112
|
-
:'quiet_hours_start',
|
|
113
|
-
:'quiet_hours_end',
|
|
114
86
|
])
|
|
115
87
|
end
|
|
116
88
|
|
|
@@ -148,44 +120,6 @@ module PlainRouter::OpenAPI
|
|
|
148
120
|
self.execution_mode = nil
|
|
149
121
|
end
|
|
150
122
|
|
|
151
|
-
if attributes.key?(:'max_spend_delta_percent')
|
|
152
|
-
self.max_spend_delta_percent = attributes[:'max_spend_delta_percent']
|
|
153
|
-
else
|
|
154
|
-
self.max_spend_delta_percent = nil
|
|
155
|
-
end
|
|
156
|
-
|
|
157
|
-
if attributes.key?(:'hard_account_daily_cap_minor')
|
|
158
|
-
self.hard_account_daily_cap_minor = attributes[:'hard_account_daily_cap_minor']
|
|
159
|
-
else
|
|
160
|
-
self.hard_account_daily_cap_minor = nil
|
|
161
|
-
end
|
|
162
|
-
|
|
163
|
-
if attributes.key?(:'protected_entities')
|
|
164
|
-
if (value = attributes[:'protected_entities']).is_a?(Array)
|
|
165
|
-
self.protected_entities = value
|
|
166
|
-
end
|
|
167
|
-
else
|
|
168
|
-
self.protected_entities = nil
|
|
169
|
-
end
|
|
170
|
-
|
|
171
|
-
if attributes.key?(:'quiet_hours_start')
|
|
172
|
-
self.quiet_hours_start = attributes[:'quiet_hours_start']
|
|
173
|
-
else
|
|
174
|
-
self.quiet_hours_start = nil
|
|
175
|
-
end
|
|
176
|
-
|
|
177
|
-
if attributes.key?(:'quiet_hours_end')
|
|
178
|
-
self.quiet_hours_end = attributes[:'quiet_hours_end']
|
|
179
|
-
else
|
|
180
|
-
self.quiet_hours_end = nil
|
|
181
|
-
end
|
|
182
|
-
|
|
183
|
-
if attributes.key?(:'protect_learning_phase')
|
|
184
|
-
self.protect_learning_phase = attributes[:'protect_learning_phase']
|
|
185
|
-
else
|
|
186
|
-
self.protect_learning_phase = nil
|
|
187
|
-
end
|
|
188
|
-
|
|
189
123
|
if attributes.key?(:'outcome_check_after_hours')
|
|
190
124
|
self.outcome_check_after_hours = attributes[:'outcome_check_after_hours']
|
|
191
125
|
else
|
|
@@ -212,14 +146,6 @@ module PlainRouter::OpenAPI
|
|
|
212
146
|
invalid_properties.push('invalid value for "execution_mode", execution_mode cannot be nil.')
|
|
213
147
|
end
|
|
214
148
|
|
|
215
|
-
if @max_spend_delta_percent.nil?
|
|
216
|
-
invalid_properties.push('invalid value for "max_spend_delta_percent", max_spend_delta_percent cannot be nil.')
|
|
217
|
-
end
|
|
218
|
-
|
|
219
|
-
if @protect_learning_phase.nil?
|
|
220
|
-
invalid_properties.push('invalid value for "protect_learning_phase", protect_learning_phase cannot be nil.')
|
|
221
|
-
end
|
|
222
|
-
|
|
223
149
|
if @outcome_check_after_hours.nil?
|
|
224
150
|
invalid_properties.push('invalid value for "outcome_check_after_hours", outcome_check_after_hours cannot be nil.')
|
|
225
151
|
end
|
|
@@ -237,10 +163,8 @@ module PlainRouter::OpenAPI
|
|
|
237
163
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
238
164
|
return false if @workspace_id.nil?
|
|
239
165
|
return false if @execution_mode.nil?
|
|
240
|
-
execution_mode_validator = EnumAttributeValidator.new('String', ["ask", "full"
|
|
166
|
+
execution_mode_validator = EnumAttributeValidator.new('String', ["ask", "full"])
|
|
241
167
|
return false unless execution_mode_validator.valid?(@execution_mode)
|
|
242
|
-
return false if @max_spend_delta_percent.nil?
|
|
243
|
-
return false if @protect_learning_phase.nil?
|
|
244
168
|
return false if @outcome_check_after_hours.nil?
|
|
245
169
|
return false if @anomaly_threshold_percent.nil?
|
|
246
170
|
true
|
|
@@ -259,33 +183,13 @@ module PlainRouter::OpenAPI
|
|
|
259
183
|
# Custom attribute writer method checking allowed values (enum).
|
|
260
184
|
# @param [Object] execution_mode Object to be assigned
|
|
261
185
|
def execution_mode=(execution_mode)
|
|
262
|
-
validator = EnumAttributeValidator.new('String', ["ask", "full"
|
|
186
|
+
validator = EnumAttributeValidator.new('String', ["ask", "full"])
|
|
263
187
|
unless validator.valid?(execution_mode)
|
|
264
188
|
fail ArgumentError, "invalid value for \"execution_mode\", must be one of #{validator.allowable_values}."
|
|
265
189
|
end
|
|
266
190
|
@execution_mode = execution_mode
|
|
267
191
|
end
|
|
268
192
|
|
|
269
|
-
# Custom attribute writer method with validation
|
|
270
|
-
# @param [Object] max_spend_delta_percent Value to be assigned
|
|
271
|
-
def max_spend_delta_percent=(max_spend_delta_percent)
|
|
272
|
-
if max_spend_delta_percent.nil?
|
|
273
|
-
fail ArgumentError, 'max_spend_delta_percent cannot be nil'
|
|
274
|
-
end
|
|
275
|
-
|
|
276
|
-
@max_spend_delta_percent = max_spend_delta_percent
|
|
277
|
-
end
|
|
278
|
-
|
|
279
|
-
# Custom attribute writer method with validation
|
|
280
|
-
# @param [Object] protect_learning_phase Value to be assigned
|
|
281
|
-
def protect_learning_phase=(protect_learning_phase)
|
|
282
|
-
if protect_learning_phase.nil?
|
|
283
|
-
fail ArgumentError, 'protect_learning_phase cannot be nil'
|
|
284
|
-
end
|
|
285
|
-
|
|
286
|
-
@protect_learning_phase = protect_learning_phase
|
|
287
|
-
end
|
|
288
|
-
|
|
289
193
|
# Custom attribute writer method with validation
|
|
290
194
|
# @param [Object] outcome_check_after_hours Value to be assigned
|
|
291
195
|
def outcome_check_after_hours=(outcome_check_after_hours)
|
|
@@ -314,12 +218,6 @@ module PlainRouter::OpenAPI
|
|
|
314
218
|
id == o.id &&
|
|
315
219
|
workspace_id == o.workspace_id &&
|
|
316
220
|
execution_mode == o.execution_mode &&
|
|
317
|
-
max_spend_delta_percent == o.max_spend_delta_percent &&
|
|
318
|
-
hard_account_daily_cap_minor == o.hard_account_daily_cap_minor &&
|
|
319
|
-
protected_entities == o.protected_entities &&
|
|
320
|
-
quiet_hours_start == o.quiet_hours_start &&
|
|
321
|
-
quiet_hours_end == o.quiet_hours_end &&
|
|
322
|
-
protect_learning_phase == o.protect_learning_phase &&
|
|
323
221
|
outcome_check_after_hours == o.outcome_check_after_hours &&
|
|
324
222
|
anomaly_threshold_percent == o.anomaly_threshold_percent
|
|
325
223
|
end
|
|
@@ -333,7 +231,7 @@ module PlainRouter::OpenAPI
|
|
|
333
231
|
# Calculates hash code according to all attributes.
|
|
334
232
|
# @return [Integer] Hash code
|
|
335
233
|
def hash
|
|
336
|
-
[id, workspace_id, execution_mode,
|
|
234
|
+
[id, workspace_id, execution_mode, outcome_check_after_hours, anomaly_threshold_percent].hash
|
|
337
235
|
end
|
|
338
236
|
|
|
339
237
|
# Builds the object from hash
|
|
@@ -0,0 +1,374 @@
|
|
|
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 ActionPolicyResult < ApiModelBase
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
attr_accessor :policy_id
|
|
21
|
+
|
|
22
|
+
attr_accessor :policy_version
|
|
23
|
+
|
|
24
|
+
attr_accessor :phase
|
|
25
|
+
|
|
26
|
+
attr_accessor :outcome
|
|
27
|
+
|
|
28
|
+
attr_accessor :reasons
|
|
29
|
+
|
|
30
|
+
attr_accessor :reason_details
|
|
31
|
+
|
|
32
|
+
attr_accessor :requested_minor
|
|
33
|
+
|
|
34
|
+
attr_accessor :evaluated_at
|
|
35
|
+
|
|
36
|
+
class EnumAttributeValidator
|
|
37
|
+
attr_reader :datatype
|
|
38
|
+
attr_reader :allowable_values
|
|
39
|
+
|
|
40
|
+
def initialize(datatype, allowable_values)
|
|
41
|
+
@allowable_values = allowable_values.map do |value|
|
|
42
|
+
case datatype.to_s
|
|
43
|
+
when /Integer/i
|
|
44
|
+
value.to_i
|
|
45
|
+
when /Float/i
|
|
46
|
+
value.to_f
|
|
47
|
+
else
|
|
48
|
+
value
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def valid?(value)
|
|
54
|
+
!value || allowable_values.include?(value)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
59
|
+
def self.attribute_map
|
|
60
|
+
{
|
|
61
|
+
:'id' => :'id',
|
|
62
|
+
:'policy_id' => :'policy_id',
|
|
63
|
+
:'policy_version' => :'policy_version',
|
|
64
|
+
:'phase' => :'phase',
|
|
65
|
+
:'outcome' => :'outcome',
|
|
66
|
+
:'reasons' => :'reasons',
|
|
67
|
+
:'reason_details' => :'reason_details',
|
|
68
|
+
:'requested_minor' => :'requested_minor',
|
|
69
|
+
:'evaluated_at' => :'evaluated_at'
|
|
70
|
+
}
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Returns attribute mapping this model knows about
|
|
74
|
+
def self.acceptable_attribute_map
|
|
75
|
+
attribute_map
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Returns all the JSON keys this model knows about
|
|
79
|
+
def self.acceptable_attributes
|
|
80
|
+
acceptable_attribute_map.values
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Attribute type mapping.
|
|
84
|
+
def self.openapi_types
|
|
85
|
+
{
|
|
86
|
+
:'id' => :'String',
|
|
87
|
+
:'policy_id' => :'String',
|
|
88
|
+
:'policy_version' => :'Integer',
|
|
89
|
+
:'phase' => :'String',
|
|
90
|
+
:'outcome' => :'String',
|
|
91
|
+
:'reasons' => :'Array<String>',
|
|
92
|
+
:'reason_details' => :'Array<String>',
|
|
93
|
+
:'requested_minor' => :'Integer',
|
|
94
|
+
:'evaluated_at' => :'Time'
|
|
95
|
+
}
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# List of attributes with nullable: true
|
|
99
|
+
def self.openapi_nullable
|
|
100
|
+
Set.new([
|
|
101
|
+
:'reason_details',
|
|
102
|
+
:'requested_minor',
|
|
103
|
+
])
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Initializes the object
|
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
108
|
+
def initialize(attributes = {})
|
|
109
|
+
if (!attributes.is_a?(Hash))
|
|
110
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::ActionPolicyResult` initialize method"
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
114
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
115
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
116
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
117
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::ActionPolicyResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
118
|
+
end
|
|
119
|
+
h[k.to_sym] = v
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'id')
|
|
123
|
+
self.id = attributes[:'id']
|
|
124
|
+
else
|
|
125
|
+
self.id = nil
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'policy_id')
|
|
129
|
+
self.policy_id = attributes[:'policy_id']
|
|
130
|
+
else
|
|
131
|
+
self.policy_id = nil
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'policy_version')
|
|
135
|
+
self.policy_version = attributes[:'policy_version']
|
|
136
|
+
else
|
|
137
|
+
self.policy_version = nil
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'phase')
|
|
141
|
+
self.phase = attributes[:'phase']
|
|
142
|
+
else
|
|
143
|
+
self.phase = nil
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if attributes.key?(:'outcome')
|
|
147
|
+
self.outcome = attributes[:'outcome']
|
|
148
|
+
else
|
|
149
|
+
self.outcome = nil
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if attributes.key?(:'reasons')
|
|
153
|
+
if (value = attributes[:'reasons']).is_a?(Array)
|
|
154
|
+
self.reasons = value
|
|
155
|
+
end
|
|
156
|
+
else
|
|
157
|
+
self.reasons = nil
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if attributes.key?(:'reason_details')
|
|
161
|
+
if (value = attributes[:'reason_details']).is_a?(Array)
|
|
162
|
+
self.reason_details = value
|
|
163
|
+
end
|
|
164
|
+
else
|
|
165
|
+
self.reason_details = nil
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if attributes.key?(:'requested_minor')
|
|
169
|
+
self.requested_minor = attributes[:'requested_minor']
|
|
170
|
+
else
|
|
171
|
+
self.requested_minor = nil
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if attributes.key?(:'evaluated_at')
|
|
175
|
+
self.evaluated_at = attributes[:'evaluated_at']
|
|
176
|
+
else
|
|
177
|
+
self.evaluated_at = nil
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
182
|
+
# @return Array for valid properties with the reasons
|
|
183
|
+
def list_invalid_properties
|
|
184
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
185
|
+
invalid_properties = Array.new
|
|
186
|
+
if @id.nil?
|
|
187
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
if @policy_id.nil?
|
|
191
|
+
invalid_properties.push('invalid value for "policy_id", policy_id cannot be nil.')
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
if @policy_version.nil?
|
|
195
|
+
invalid_properties.push('invalid value for "policy_version", policy_version cannot be nil.')
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
if @phase.nil?
|
|
199
|
+
invalid_properties.push('invalid value for "phase", phase cannot be nil.')
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
if @outcome.nil?
|
|
203
|
+
invalid_properties.push('invalid value for "outcome", outcome cannot be nil.')
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
if @reasons.nil?
|
|
207
|
+
invalid_properties.push('invalid value for "reasons", reasons cannot be nil.')
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
if @evaluated_at.nil?
|
|
211
|
+
invalid_properties.push('invalid value for "evaluated_at", evaluated_at cannot be nil.')
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
invalid_properties
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Check to see if the all the properties in the model are valid
|
|
218
|
+
# @return true if the model is valid
|
|
219
|
+
def valid?
|
|
220
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
221
|
+
return false if @id.nil?
|
|
222
|
+
return false if @policy_id.nil?
|
|
223
|
+
return false if @policy_version.nil?
|
|
224
|
+
return false if @phase.nil?
|
|
225
|
+
phase_validator = EnumAttributeValidator.new('String', ["proposal", "approval", "execution"])
|
|
226
|
+
return false unless phase_validator.valid?(@phase)
|
|
227
|
+
return false if @outcome.nil?
|
|
228
|
+
outcome_validator = EnumAttributeValidator.new('String', ["allowed", "approval_required", "blocked"])
|
|
229
|
+
return false unless outcome_validator.valid?(@outcome)
|
|
230
|
+
return false if @reasons.nil?
|
|
231
|
+
return false if @evaluated_at.nil?
|
|
232
|
+
true
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Custom attribute writer method with validation
|
|
236
|
+
# @param [Object] id Value to be assigned
|
|
237
|
+
def id=(id)
|
|
238
|
+
if id.nil?
|
|
239
|
+
fail ArgumentError, 'id cannot be nil'
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
@id = id
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# Custom attribute writer method with validation
|
|
246
|
+
# @param [Object] policy_id Value to be assigned
|
|
247
|
+
def policy_id=(policy_id)
|
|
248
|
+
if policy_id.nil?
|
|
249
|
+
fail ArgumentError, 'policy_id cannot be nil'
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
@policy_id = policy_id
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# Custom attribute writer method with validation
|
|
256
|
+
# @param [Object] policy_version Value to be assigned
|
|
257
|
+
def policy_version=(policy_version)
|
|
258
|
+
if policy_version.nil?
|
|
259
|
+
fail ArgumentError, 'policy_version cannot be nil'
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
@policy_version = policy_version
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
266
|
+
# @param [Object] phase Object to be assigned
|
|
267
|
+
def phase=(phase)
|
|
268
|
+
validator = EnumAttributeValidator.new('String', ["proposal", "approval", "execution"])
|
|
269
|
+
unless validator.valid?(phase)
|
|
270
|
+
fail ArgumentError, "invalid value for \"phase\", must be one of #{validator.allowable_values}."
|
|
271
|
+
end
|
|
272
|
+
@phase = phase
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
276
|
+
# @param [Object] outcome Object to be assigned
|
|
277
|
+
def outcome=(outcome)
|
|
278
|
+
validator = EnumAttributeValidator.new('String', ["allowed", "approval_required", "blocked"])
|
|
279
|
+
unless validator.valid?(outcome)
|
|
280
|
+
fail ArgumentError, "invalid value for \"outcome\", must be one of #{validator.allowable_values}."
|
|
281
|
+
end
|
|
282
|
+
@outcome = outcome
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
# Custom attribute writer method with validation
|
|
286
|
+
# @param [Object] reasons Value to be assigned
|
|
287
|
+
def reasons=(reasons)
|
|
288
|
+
if reasons.nil?
|
|
289
|
+
fail ArgumentError, 'reasons cannot be nil'
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
@reasons = reasons
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
# Custom attribute writer method with validation
|
|
296
|
+
# @param [Object] evaluated_at Value to be assigned
|
|
297
|
+
def evaluated_at=(evaluated_at)
|
|
298
|
+
if evaluated_at.nil?
|
|
299
|
+
fail ArgumentError, 'evaluated_at cannot be nil'
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
@evaluated_at = evaluated_at
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
# Checks equality by comparing each attribute.
|
|
306
|
+
# @param [Object] Object to be compared
|
|
307
|
+
def ==(o)
|
|
308
|
+
return true if self.equal?(o)
|
|
309
|
+
self.class == o.class &&
|
|
310
|
+
id == o.id &&
|
|
311
|
+
policy_id == o.policy_id &&
|
|
312
|
+
policy_version == o.policy_version &&
|
|
313
|
+
phase == o.phase &&
|
|
314
|
+
outcome == o.outcome &&
|
|
315
|
+
reasons == o.reasons &&
|
|
316
|
+
reason_details == o.reason_details &&
|
|
317
|
+
requested_minor == o.requested_minor &&
|
|
318
|
+
evaluated_at == o.evaluated_at
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
# @see the `==` method
|
|
322
|
+
# @param [Object] Object to be compared
|
|
323
|
+
def eql?(o)
|
|
324
|
+
self == o
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
# Calculates hash code according to all attributes.
|
|
328
|
+
# @return [Integer] Hash code
|
|
329
|
+
def hash
|
|
330
|
+
[id, policy_id, policy_version, phase, outcome, reasons, reason_details, requested_minor, evaluated_at].hash
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
# Builds the object from hash
|
|
334
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
335
|
+
# @return [Object] Returns the model itself
|
|
336
|
+
def self.build_from_hash(attributes)
|
|
337
|
+
return nil unless attributes.is_a?(Hash)
|
|
338
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
339
|
+
transformed_hash = {}
|
|
340
|
+
openapi_types.each_pair do |key, type|
|
|
341
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
342
|
+
transformed_hash["#{key}"] = nil
|
|
343
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
344
|
+
# check to ensure the input is an array given that the attribute
|
|
345
|
+
# is documented as an array but the input is not
|
|
346
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
347
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
348
|
+
end
|
|
349
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
350
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
351
|
+
end
|
|
352
|
+
end
|
|
353
|
+
new(transformed_hash)
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
# Returns the object in the form of hash
|
|
357
|
+
# @return [Hash] Returns the object in the form of hash
|
|
358
|
+
def to_hash
|
|
359
|
+
hash = {}
|
|
360
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
361
|
+
value = self.send(attr)
|
|
362
|
+
if value.nil?
|
|
363
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
364
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
365
|
+
end
|
|
366
|
+
|
|
367
|
+
hash[param] = _to_hash(value)
|
|
368
|
+
end
|
|
369
|
+
hash
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
end
|
|
@@ -27,6 +27,8 @@ module PlainRouter::OpenAPI
|
|
|
27
27
|
|
|
28
28
|
attr_accessor :account_id
|
|
29
29
|
|
|
30
|
+
attr_accessor :workspace_id
|
|
31
|
+
|
|
30
32
|
class EnumAttributeValidator
|
|
31
33
|
attr_reader :datatype
|
|
32
34
|
attr_reader :allowable_values
|
|
@@ -57,7 +59,8 @@ module PlainRouter::OpenAPI
|
|
|
57
59
|
:'idempotency_key' => :'idempotency_key',
|
|
58
60
|
:'evidence' => :'evidence',
|
|
59
61
|
:'target_source' => :'target_source',
|
|
60
|
-
:'account_id' => :'account_id'
|
|
62
|
+
:'account_id' => :'account_id',
|
|
63
|
+
:'workspace_id' => :'workspace_id'
|
|
61
64
|
}
|
|
62
65
|
end
|
|
63
66
|
|
|
@@ -79,7 +82,8 @@ module PlainRouter::OpenAPI
|
|
|
79
82
|
:'idempotency_key' => :'String',
|
|
80
83
|
:'evidence' => :'Array<ActionProposalInputEvidenceInner>',
|
|
81
84
|
:'target_source' => :'String',
|
|
82
|
-
:'account_id' => :'Integer'
|
|
85
|
+
:'account_id' => :'Integer',
|
|
86
|
+
:'workspace_id' => :'Integer'
|
|
83
87
|
}
|
|
84
88
|
end
|
|
85
89
|
|
|
@@ -142,6 +146,10 @@ module PlainRouter::OpenAPI
|
|
|
142
146
|
if attributes.key?(:'account_id')
|
|
143
147
|
self.account_id = attributes[:'account_id']
|
|
144
148
|
end
|
|
149
|
+
|
|
150
|
+
if attributes.key?(:'workspace_id')
|
|
151
|
+
self.workspace_id = attributes[:'workspace_id']
|
|
152
|
+
end
|
|
145
153
|
end
|
|
146
154
|
|
|
147
155
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -197,6 +205,10 @@ module PlainRouter::OpenAPI
|
|
|
197
205
|
invalid_properties.push('invalid value for "account_id", must be greater than or equal to 1.')
|
|
198
206
|
end
|
|
199
207
|
|
|
208
|
+
if !@workspace_id.nil? && @workspace_id < 1
|
|
209
|
+
invalid_properties.push('invalid value for "workspace_id", must be greater than or equal to 1.')
|
|
210
|
+
end
|
|
211
|
+
|
|
200
212
|
invalid_properties
|
|
201
213
|
end
|
|
202
214
|
|
|
@@ -218,6 +230,7 @@ module PlainRouter::OpenAPI
|
|
|
218
230
|
target_source_validator = EnumAttributeValidator.new('String', ["human_supplied"])
|
|
219
231
|
return false unless target_source_validator.valid?(@target_source)
|
|
220
232
|
return false if !@account_id.nil? && @account_id < 1
|
|
233
|
+
return false if !@workspace_id.nil? && @workspace_id < 1
|
|
221
234
|
true
|
|
222
235
|
end
|
|
223
236
|
|
|
@@ -309,6 +322,20 @@ module PlainRouter::OpenAPI
|
|
|
309
322
|
@account_id = account_id
|
|
310
323
|
end
|
|
311
324
|
|
|
325
|
+
# Custom attribute writer method with validation
|
|
326
|
+
# @param [Object] workspace_id Value to be assigned
|
|
327
|
+
def workspace_id=(workspace_id)
|
|
328
|
+
if workspace_id.nil?
|
|
329
|
+
fail ArgumentError, 'workspace_id cannot be nil'
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
if workspace_id < 1
|
|
333
|
+
fail ArgumentError, 'invalid value for "workspace_id", must be greater than or equal to 1.'
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
@workspace_id = workspace_id
|
|
337
|
+
end
|
|
338
|
+
|
|
312
339
|
# Checks equality by comparing each attribute.
|
|
313
340
|
# @param [Object] Object to be compared
|
|
314
341
|
def ==(o)
|
|
@@ -319,7 +346,8 @@ module PlainRouter::OpenAPI
|
|
|
319
346
|
idempotency_key == o.idempotency_key &&
|
|
320
347
|
evidence == o.evidence &&
|
|
321
348
|
target_source == o.target_source &&
|
|
322
|
-
account_id == o.account_id
|
|
349
|
+
account_id == o.account_id &&
|
|
350
|
+
workspace_id == o.workspace_id
|
|
323
351
|
end
|
|
324
352
|
|
|
325
353
|
# @see the `==` method
|
|
@@ -331,7 +359,7 @@ module PlainRouter::OpenAPI
|
|
|
331
359
|
# Calculates hash code according to all attributes.
|
|
332
360
|
# @return [Integer] Hash code
|
|
333
361
|
def hash
|
|
334
|
-
[actions, rationale, idempotency_key, evidence, target_source, account_id].hash
|
|
362
|
+
[actions, rationale, idempotency_key, evidence, target_source, account_id, workspace_id].hash
|
|
335
363
|
end
|
|
336
364
|
|
|
337
365
|
# Builds the object from hash
|