plainrouter-sdk 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -0
  3. data/lib/plainrouter/client.rb +343 -3
  4. data/lib/plainrouter/closed_input_objects.json +3896 -0
  5. data/lib/plainrouter/closed_input_validator.rb +246 -0
  6. data/lib/plainrouter/integer_input_fields.json +579 -0
  7. data/lib/plainrouter/openapi/api/action_read_api_api.rb +71 -31
  8. data/lib/plainrouter/openapi/api/action_rule_api_api.rb +350 -0
  9. data/lib/plainrouter/openapi/api/ad_test_api_api.rb +13 -9
  10. data/lib/plainrouter/openapi/api/agent_context_api.rb +93 -0
  11. data/lib/plainrouter/openapi/api/creative_api.rb +241 -0
  12. data/lib/plainrouter/openapi/api/deployment_plan_api.rb +257 -2
  13. data/lib/plainrouter/openapi/api/draft_batch_file_import_api.rb +142 -0
  14. data/lib/plainrouter/openapi/api/launch_policy_api.rb +242 -0
  15. data/lib/plainrouter/openapi/api/meta_inventory_exposure_api.rb +133 -0
  16. data/lib/plainrouter/openapi/api_client.rb +4 -0
  17. data/lib/plainrouter/openapi/api_model_base.rb +2 -0
  18. data/lib/plainrouter/openapi/configuration.rb +34 -0
  19. data/lib/plainrouter/openapi/models/action_batch_read_data.rb +42 -4
  20. data/lib/plainrouter/openapi/models/action_dry_run_read_dry_run.rb +42 -4
  21. data/lib/plainrouter/openapi/models/action_list_read_meta.rb +33 -4
  22. data/lib/plainrouter/openapi/models/action_proposal_input.rb +72 -1
  23. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner.rb +1 -0
  24. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of.rb +2 -0
  25. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of1.rb +2 -0
  26. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of10.rb +2 -0
  27. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of10_params.rb +2 -0
  28. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of11.rb +3 -1
  29. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of12.rb +2 -0
  30. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of12_params.rb +2 -0
  31. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of13.rb +2 -0
  32. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of13_params.rb +2 -0
  33. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of2.rb +2 -0
  34. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of3.rb +2 -0
  35. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of4.rb +2 -0
  36. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of4_target_entity.rb +2 -0
  37. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of5.rb +2 -0
  38. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of6.rb +2 -0
  39. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of7.rb +2 -0
  40. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of8.rb +2 -0
  41. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of9.rb +2 -0
  42. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of_params.rb +2 -0
  43. data/lib/plainrouter/openapi/models/action_proposal_input_actions_inner_any_of_target_entity.rb +2 -0
  44. data/lib/plainrouter/openapi/models/action_proposal_input_evidence_inner.rb +4 -2
  45. data/lib/plainrouter/openapi/models/action_proposal_read_proposal.rb +42 -4
  46. data/lib/plainrouter/openapi/models/action_read_item.rb +11 -1
  47. data/lib/plainrouter/openapi/models/action_read_item_counted_evidence.rb +319 -0
  48. data/lib/plainrouter/openapi/models/action_read_item_counted_evidence_counted.rb +174 -0
  49. data/lib/plainrouter/openapi/models/action_read_item_counted_evidence_coverage.rb +162 -0
  50. data/lib/plainrouter/openapi/models/action_read_item_counted_evidence_meta_reported.rb +198 -0
  51. data/lib/plainrouter/openapi/models/{action_proposal_input_actions_inner_any_of11_params.rb → action_read_item_counted_evidence_target.rb} +41 -24
  52. data/lib/plainrouter/openapi/models/action_read_item_counted_evidence_window.rb +225 -0
  53. data/lib/plainrouter/openapi/models/action_receipt_unavailable.rb +164 -0
  54. data/lib/plainrouter/openapi/models/action_receipt_unavailable_error.rb +214 -0
  55. data/lib/plainrouter/openapi/models/action_rule_detail_read.rb +164 -0
  56. data/lib/plainrouter/openapi/models/action_rule_detail_read_rule.rb +402 -0
  57. data/lib/plainrouter/openapi/models/action_rule_detail_read_rule_current_revision.rb +388 -0
  58. data/lib/plainrouter/openapi/models/action_rule_detail_read_rule_runs_inner.rb +396 -0
  59. data/lib/plainrouter/openapi/models/action_rule_detail_read_rule_runs_inner_decisions_inner.rb +382 -0
  60. data/lib/plainrouter/openapi/models/action_rule_detail_read_rule_window.rb +242 -0
  61. data/lib/plainrouter/openapi/models/action_rule_write_read.rb +164 -0
  62. data/lib/plainrouter/openapi/models/action_rule_write_read_rule.rb +373 -0
  63. data/lib/plainrouter/openapi/models/actions_api_decision_receipt404_response.rb +103 -0
  64. data/lib/plainrouter/openapi/models/actions_rules_index200_response.rb +164 -0
  65. data/lib/plainrouter/openapi/models/actions_rules_index200_response_rules.rb +196 -0
  66. data/lib/plainrouter/openapi/models/actions_rules_index200_response_rules_data_inner.rb +344 -0
  67. data/lib/plainrouter/openapi/models/actions_rules_index200_response_rules_data_inner_account.rb +157 -0
  68. data/lib/plainrouter/openapi/models/actions_rules_index200_response_rules_data_inner_counts.rb +156 -0
  69. data/lib/plainrouter/openapi/models/actions_rules_index403_response.rb +103 -0
  70. data/lib/plainrouter/openapi/models/actions_rules_index403_response_any_of.rb +214 -0
  71. data/lib/plainrouter/openapi/models/actions_rules_store_request.rb +317 -0
  72. data/lib/plainrouter/openapi/models/actions_rules_store_request_definition.rb +105 -0
  73. data/lib/plainrouter/openapi/models/actions_rules_store_request_definition_any_of.rb +317 -0
  74. data/lib/plainrouter/openapi/models/actions_rules_store_request_definition_any_of1.rb +361 -0
  75. data/lib/plainrouter/openapi/models/actions_rules_store_request_definition_any_of2.rb +361 -0
  76. data/lib/plainrouter/openapi/models/actions_rules_store_request_definition_any_of_cost_ratio.rb +104 -0
  77. data/lib/plainrouter/openapi/models/actions_rules_store_request_window.rb +103 -0
  78. data/lib/plainrouter/openapi/models/actions_rules_update_request.rb +267 -0
  79. data/lib/plainrouter/openapi/models/actions_rules_update_request_definition.rb +105 -0
  80. data/lib/plainrouter/openapi/models/actions_rules_update_request_definition_any_of.rb +317 -0
  81. data/lib/plainrouter/openapi/models/actions_rules_update_request_definition_any_of1.rb +361 -0
  82. data/lib/plainrouter/openapi/models/actions_rules_update_request_definition_any_of2.rb +361 -0
  83. data/lib/plainrouter/openapi/models/ad_test_list_read_tests.rb +1 -1
  84. data/lib/plainrouter/openapi/models/agent_context200_response.rb +214 -0
  85. data/lib/plainrouter/openapi/models/agent_context200_response_agent.rb +268 -0
  86. data/lib/plainrouter/openapi/models/agent_context200_response_platform_ad_account.rb +292 -0
  87. data/lib/plainrouter/openapi/models/agent_context200_response_platform_ad_account_workspace.rb +190 -0
  88. data/lib/plainrouter/openapi/models/agent_context401_response.rb +103 -0
  89. data/lib/plainrouter/openapi/models/agent_context_auth_error.rb +190 -0
  90. data/lib/plainrouter/openapi/models/creative_intake_read.rb +1 -1
  91. data/lib/plainrouter/openapi/models/creative_mcp_grant_operation.rb +44 -0
  92. data/lib/plainrouter/openapi/models/creative_mcp_preview.rb +283 -0
  93. data/lib/plainrouter/openapi/models/creative_mcp_refusal.rb +45 -0
  94. data/lib/plainrouter/openapi/models/creative_mcp_tool.rb +44 -0
  95. data/lib/plainrouter/openapi/models/delivery_status.rb +2 -1
  96. data/lib/plainrouter/openapi/models/deployment_plan_read.rb +42 -4
  97. data/lib/plainrouter/openapi/models/destination.rb +73 -9
  98. data/lib/plainrouter/openapi/models/destination_config.rb +103 -0
  99. data/lib/plainrouter/openapi/models/destination_status.rb +2 -1
  100. data/lib/plainrouter/openapi/models/draft_batch_mode.rb +41 -0
  101. data/lib/plainrouter/openapi/models/get_account_inventory200_response.rb +341 -0
  102. data/lib/plainrouter/openapi/models/get_account_inventory200_response_summary.rb +158 -0
  103. data/lib/plainrouter/openapi/models/get_account_inventory404_response.rb +103 -0
  104. data/lib/plainrouter/openapi/models/get_account_inventory404_response_any_of.rb +188 -0
  105. data/lib/plainrouter/openapi/models/get_event200_response_deliveries_inner.rb +25 -1
  106. data/lib/plainrouter/openapi/models/get_event200_response_event_deliveries_inner.rb +25 -1
  107. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response.rb +26 -5
  108. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_pagination_value.rb +202 -0
  109. data/lib/plainrouter/openapi/models/launch_creatives_index200_response.rb +164 -0
  110. data/lib/plainrouter/openapi/models/launch_creatives_index200_response_creatives.rb +196 -0
  111. data/lib/plainrouter/openapi/models/{creative_intake_read_creative.rb → launch_creatives_index200_response_creatives_data_inner.rb} +4 -4
  112. data/lib/plainrouter/openapi/models/{creative_intake_read_creative_tags.rb → launch_creatives_index200_response_creatives_data_inner_tags.rb} +1 -1
  113. data/lib/plainrouter/openapi/models/launch_creatives_status200_response.rb +166 -0
  114. data/lib/plainrouter/openapi/models/launch_plans_copy422_response.rb +103 -0
  115. data/lib/plainrouter/openapi/models/launch_plans_index200_response_plans.rb +107 -4
  116. data/lib/plainrouter/openapi/models/launch_plans_index200_response_plans_next_page_arguments.rb +104 -0
  117. data/lib/plainrouter/openapi/models/launch_plans_index200_response_plans_next_page_arguments_any_of.rb +190 -0
  118. data/lib/plainrouter/openapi/models/launch_plans_index200_response_plans_next_page_arguments_any_of1.rb +190 -0
  119. data/lib/plainrouter/openapi/models/launch_plans_store201_response.rb +166 -0
  120. data/lib/plainrouter/openapi/models/launch_plans_validate422_response.rb +103 -0
  121. data/lib/plainrouter/openapi/models/launch_policies_index200_response.rb +164 -0
  122. data/lib/plainrouter/openapi/models/launch_policies_index200_response_policies.rb +453 -0
  123. data/lib/plainrouter/openapi/models/{list_events200_response_events_links_inner.rb → launch_policies_index200_response_policies_links_inner.rb} +3 -3
  124. data/lib/plainrouter/openapi/models/launch_policies_store201_response.rb +166 -0
  125. data/lib/plainrouter/openapi/models/launch_policy.rb +346 -0
  126. data/lib/plainrouter/openapi/models/launcher_file_import403_response.rb +216 -0
  127. data/lib/plainrouter/openapi/models/launcher_file_import422_response.rb +103 -0
  128. data/lib/plainrouter/openapi/models/launcher_file_import422_response_any_of.rb +242 -0
  129. data/lib/plainrouter/openapi/models/launcher_file_import422_response_any_of_syntactic_row_failures_inner.rb +190 -0
  130. data/lib/plainrouter/openapi/models/list_events200_response_events.rb +1 -1
  131. data/lib/plainrouter/openapi/models/plan_execute_rejected_error.rb +2 -2
  132. data/lib/plainrouter/openapi/models/plan_validate_rejected.rb +164 -0
  133. data/lib/plainrouter/openapi/models/plan_validate_rejected_error.rb +191 -0
  134. data/lib/plainrouter/openapi/models/proposal_unavailable.rb +164 -0
  135. data/lib/plainrouter/openapi/models/proposal_unavailable_error.rb +214 -0
  136. data/lib/plainrouter/openapi/models/set_destination_test_mode200_response_destination.rb +67 -1
  137. data/lib/plainrouter/openapi/models/{deployment_plan.rb → store_deployment_plan_request.rb} +185 -208
  138. data/lib/plainrouter/openapi/models/store_deployment_plan_request_ad_set_spec.rb +220 -0
  139. data/lib/plainrouter/openapi/models/store_deployment_plan_request_copy.rb +266 -0
  140. data/lib/plainrouter/openapi/models/store_deployment_plan_request_creative_overrides_inner.rb +217 -0
  141. data/lib/plainrouter/openapi/models/store_launch_policy_request.rb +260 -0
  142. data/lib/plainrouter/openapi/models/update_creative_status_request.rb +188 -0
  143. data/lib/plainrouter/openapi/models/update_deployment_plan_request.rb +511 -0
  144. data/lib/plainrouter/openapi/version.rb +1 -1
  145. data/lib/plainrouter/openapi.rb +88 -5
  146. data/lib/plainrouter/proposal_errors.rb +31 -0
  147. data/lib/plainrouter/version.rb +1 -1
  148. data/lib/plainrouter.rb +1 -0
  149. metadata +94 -7
@@ -14,10 +14,8 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module PlainRouter::OpenAPI
17
- class DeploymentPlan < ApiModelBase
18
- attr_accessor :id
19
-
20
- attr_accessor :workspace_id
17
+ class StoreDeploymentPlanRequest < ApiModelBase
18
+ attr_accessor :name
21
19
 
22
20
  attr_accessor :platform_ad_account_id
23
21
 
@@ -29,7 +27,6 @@ module PlainRouter::OpenAPI
29
27
 
30
28
  attr_accessor :ad_set_ref
31
29
 
32
- # When present, bid_amount must be a positive integer in Meta minor units for the account currency. Digit-only strings of at most 18 digits are accepted and normalized to integers. Null, zero, negatives, decimals and other strings are refused on ad_set_spec.bid_amount.
33
30
  attr_accessor :ad_set_spec
34
31
 
35
32
  attr_accessor :budget_type
@@ -42,33 +39,40 @@ module PlainRouter::OpenAPI
42
39
 
43
40
  attr_accessor :landing_page
44
41
 
45
- attr_accessor :utm_policy_id
46
-
47
- attr_accessor :naming_policy_id
48
-
49
- attr_accessor :status
42
+ attr_accessor :utm_policy_name
50
43
 
51
- attr_accessor :validation_result
44
+ attr_accessor :naming_policy_name
52
45
 
53
- attr_accessor :diff
46
+ attr_accessor :creative_ids
54
47
 
55
- attr_accessor :validated_at
48
+ attr_accessor :creative_overrides
56
49
 
57
- attr_accessor :approval_id
50
+ class EnumAttributeValidator
51
+ attr_reader :datatype
52
+ attr_reader :allowable_values
58
53
 
59
- attr_accessor :created_at
60
-
61
- attr_accessor :updated_at
62
-
63
- attr_accessor :platform_object_ids
54
+ def initialize(datatype, allowable_values)
55
+ @allowable_values = allowable_values.map do |value|
56
+ case datatype.to_s
57
+ when /Integer/i
58
+ value.to_i
59
+ when /Float/i
60
+ value.to_f
61
+ else
62
+ value
63
+ end
64
+ end
65
+ end
64
66
 
65
- attr_accessor :name
67
+ def valid?(value)
68
+ !value || allowable_values.include?(value)
69
+ end
70
+ end
66
71
 
67
72
  # Attribute mapping from ruby-style variable name to JSON key.
68
73
  def self.attribute_map
69
74
  {
70
- :'id' => :'id',
71
- :'workspace_id' => :'workspace_id',
75
+ :'name' => :'name',
72
76
  :'platform_ad_account_id' => :'platform_ad_account_id',
73
77
  :'platform' => :'platform',
74
78
  :'campaign_ref' => :'campaign_ref',
@@ -80,17 +84,10 @@ module PlainRouter::OpenAPI
80
84
  :'currency' => :'currency',
81
85
  :'copy' => :'copy',
82
86
  :'landing_page' => :'landing_page',
83
- :'utm_policy_id' => :'utm_policy_id',
84
- :'naming_policy_id' => :'naming_policy_id',
85
- :'status' => :'status',
86
- :'validation_result' => :'validation_result',
87
- :'diff' => :'diff',
88
- :'validated_at' => :'validated_at',
89
- :'approval_id' => :'approval_id',
90
- :'created_at' => :'created_at',
91
- :'updated_at' => :'updated_at',
92
- :'platform_object_ids' => :'platform_object_ids',
93
- :'name' => :'name'
87
+ :'utm_policy_name' => :'utm_policy_name',
88
+ :'naming_policy_name' => :'naming_policy_name',
89
+ :'creative_ids' => :'creative_ids',
90
+ :'creative_overrides' => :'creative_overrides'
94
91
  }
95
92
  end
96
93
 
@@ -107,49 +104,35 @@ module PlainRouter::OpenAPI
107
104
  # Attribute type mapping.
108
105
  def self.openapi_types
109
106
  {
110
- :'id' => :'String',
111
- :'workspace_id' => :'Integer',
107
+ :'name' => :'String',
112
108
  :'platform_ad_account_id' => :'Integer',
113
109
  :'platform' => :'String',
114
110
  :'campaign_ref' => :'String',
115
- :'campaign_spec' => :'Array<Object>',
111
+ :'campaign_spec' => :'Array<String>',
116
112
  :'ad_set_ref' => :'String',
117
- :'ad_set_spec' => :'Array<Object>',
113
+ :'ad_set_spec' => :'StoreDeploymentPlanRequestAdSetSpec',
118
114
  :'budget_type' => :'String',
119
115
  :'budget_amount_minor' => :'Integer',
120
116
  :'currency' => :'String',
121
- :'copy' => :'Array<Object>',
117
+ :'copy' => :'StoreDeploymentPlanRequestCopy',
122
118
  :'landing_page' => :'String',
123
- :'utm_policy_id' => :'String',
124
- :'naming_policy_id' => :'String',
125
- :'status' => :'String',
126
- :'validation_result' => :'Array<Object>',
127
- :'diff' => :'Array<Object>',
128
- :'validated_at' => :'Time',
129
- :'approval_id' => :'String',
130
- :'created_at' => :'Time',
131
- :'updated_at' => :'Time',
132
- :'platform_object_ids' => :'Array<Object>',
133
- :'name' => :'String'
119
+ :'utm_policy_name' => :'String',
120
+ :'naming_policy_name' => :'String',
121
+ :'creative_ids' => :'Array<String>',
122
+ :'creative_overrides' => :'Array<StoreDeploymentPlanRequestCreativeOverridesInner>'
134
123
  }
135
124
  end
136
125
 
137
126
  # List of attributes with nullable: true
138
127
  def self.openapi_nullable
139
128
  Set.new([
129
+ :'name',
140
130
  :'campaign_ref',
141
131
  :'campaign_spec',
142
132
  :'ad_set_ref',
143
133
  :'ad_set_spec',
144
- :'utm_policy_id',
145
- :'naming_policy_id',
146
- :'validation_result',
147
- :'diff',
148
- :'validated_at',
149
- :'approval_id',
150
- :'created_at',
151
- :'updated_at',
152
- :'name'
134
+ :'utm_policy_name',
135
+ :'naming_policy_name',
153
136
  ])
154
137
  end
155
138
 
@@ -157,28 +140,20 @@ module PlainRouter::OpenAPI
157
140
  # @param [Hash] attributes Model attributes in the form of hash
158
141
  def initialize(attributes = {})
159
142
  if (!attributes.is_a?(Hash))
160
- fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::DeploymentPlan` initialize method"
143
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::StoreDeploymentPlanRequest` initialize method"
161
144
  end
162
145
 
163
146
  # check to see if the attribute exists and convert string to symbol for hash key
164
147
  acceptable_attribute_map = self.class.acceptable_attribute_map
165
148
  attributes = attributes.each_with_object({}) { |(k, v), h|
166
149
  if (!acceptable_attribute_map.key?(k.to_sym))
167
- fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::DeploymentPlan`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
150
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::StoreDeploymentPlanRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
168
151
  end
169
152
  h[k.to_sym] = v
170
153
  }
171
154
 
172
- if attributes.key?(:'id')
173
- self.id = attributes[:'id']
174
- else
175
- self.id = nil
176
- end
177
-
178
- if attributes.key?(:'workspace_id')
179
- self.workspace_id = attributes[:'workspace_id']
180
- else
181
- self.workspace_id = nil
155
+ if attributes.key?(:'name')
156
+ self.name = attributes[:'name']
182
157
  end
183
158
 
184
159
  if attributes.key?(:'platform_ad_account_id')
@@ -195,30 +170,20 @@ module PlainRouter::OpenAPI
195
170
 
196
171
  if attributes.key?(:'campaign_ref')
197
172
  self.campaign_ref = attributes[:'campaign_ref']
198
- else
199
- self.campaign_ref = nil
200
173
  end
201
174
 
202
175
  if attributes.key?(:'campaign_spec')
203
176
  if (value = attributes[:'campaign_spec']).is_a?(Array)
204
177
  self.campaign_spec = value
205
178
  end
206
- else
207
- self.campaign_spec = nil
208
179
  end
209
180
 
210
181
  if attributes.key?(:'ad_set_ref')
211
182
  self.ad_set_ref = attributes[:'ad_set_ref']
212
- else
213
- self.ad_set_ref = nil
214
183
  end
215
184
 
216
185
  if attributes.key?(:'ad_set_spec')
217
- if (value = attributes[:'ad_set_spec']).is_a?(Array)
218
- self.ad_set_spec = value
219
- end
220
- else
221
- self.ad_set_spec = nil
186
+ self.ad_set_spec = attributes[:'ad_set_spec']
222
187
  end
223
188
 
224
189
  if attributes.key?(:'budget_type')
@@ -240,9 +205,7 @@ module PlainRouter::OpenAPI
240
205
  end
241
206
 
242
207
  if attributes.key?(:'copy')
243
- if (value = attributes[:'copy']).is_a?(Array)
244
- self.copy = value
245
- end
208
+ self.copy = attributes[:'copy']
246
209
  else
247
210
  self.copy = nil
248
211
  end
@@ -253,76 +216,24 @@ module PlainRouter::OpenAPI
253
216
  self.landing_page = nil
254
217
  end
255
218
 
256
- if attributes.key?(:'utm_policy_id')
257
- self.utm_policy_id = attributes[:'utm_policy_id']
258
- else
259
- self.utm_policy_id = nil
260
- end
261
-
262
- if attributes.key?(:'naming_policy_id')
263
- self.naming_policy_id = attributes[:'naming_policy_id']
264
- else
265
- self.naming_policy_id = nil
219
+ if attributes.key?(:'utm_policy_name')
220
+ self.utm_policy_name = attributes[:'utm_policy_name']
266
221
  end
267
222
 
268
- if attributes.key?(:'status')
269
- self.status = attributes[:'status']
270
- else
271
- self.status = nil
223
+ if attributes.key?(:'naming_policy_name')
224
+ self.naming_policy_name = attributes[:'naming_policy_name']
272
225
  end
273
226
 
274
- if attributes.key?(:'validation_result')
275
- if (value = attributes[:'validation_result']).is_a?(Array)
276
- self.validation_result = value
227
+ if attributes.key?(:'creative_ids')
228
+ if (value = attributes[:'creative_ids']).is_a?(Array)
229
+ self.creative_ids = value
277
230
  end
278
- else
279
- self.validation_result = nil
280
231
  end
281
232
 
282
- if attributes.key?(:'diff')
283
- if (value = attributes[:'diff']).is_a?(Array)
284
- self.diff = value
233
+ if attributes.key?(:'creative_overrides')
234
+ if (value = attributes[:'creative_overrides']).is_a?(Array)
235
+ self.creative_overrides = value
285
236
  end
286
- else
287
- self.diff = nil
288
- end
289
-
290
- if attributes.key?(:'validated_at')
291
- self.validated_at = attributes[:'validated_at']
292
- else
293
- self.validated_at = nil
294
- end
295
-
296
- if attributes.key?(:'approval_id')
297
- self.approval_id = attributes[:'approval_id']
298
- else
299
- self.approval_id = nil
300
- end
301
-
302
- if attributes.key?(:'created_at')
303
- self.created_at = attributes[:'created_at']
304
- else
305
- self.created_at = nil
306
- end
307
-
308
- if attributes.key?(:'updated_at')
309
- self.updated_at = attributes[:'updated_at']
310
- else
311
- self.updated_at = nil
312
- end
313
-
314
- if attributes.key?(:'platform_object_ids')
315
- if (value = attributes[:'platform_object_ids']).is_a?(Array)
316
- self.platform_object_ids = value
317
- end
318
- else
319
- self.platform_object_ids = nil
320
- end
321
-
322
- if attributes.key?(:'name')
323
- self.name = attributes[:'name']
324
- else
325
- self.name = nil
326
237
  end
327
238
  end
328
239
 
@@ -331,22 +242,30 @@ module PlainRouter::OpenAPI
331
242
  def list_invalid_properties
332
243
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
333
244
  invalid_properties = Array.new
334
- if @id.nil?
335
- invalid_properties.push('invalid value for "id", id cannot be nil.')
336
- end
337
-
338
- if @workspace_id.nil?
339
- invalid_properties.push('invalid value for "workspace_id", workspace_id cannot be nil.')
245
+ if !@name.nil? && @name.to_s.length > 255
246
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
340
247
  end
341
248
 
342
249
  if @platform_ad_account_id.nil?
343
250
  invalid_properties.push('invalid value for "platform_ad_account_id", platform_ad_account_id cannot be nil.')
344
251
  end
345
252
 
253
+ if @platform_ad_account_id < 1
254
+ invalid_properties.push('invalid value for "platform_ad_account_id", must be greater than or equal to 1.')
255
+ end
256
+
346
257
  if @platform.nil?
347
258
  invalid_properties.push('invalid value for "platform", platform cannot be nil.')
348
259
  end
349
260
 
261
+ if !@campaign_ref.nil? && @campaign_ref.to_s.length > 255
262
+ invalid_properties.push('invalid value for "campaign_ref", the character length must be smaller than or equal to 255.')
263
+ end
264
+
265
+ if !@ad_set_ref.nil? && @ad_set_ref.to_s.length > 255
266
+ invalid_properties.push('invalid value for "ad_set_ref", the character length must be smaller than or equal to 255.')
267
+ end
268
+
350
269
  if @budget_type.nil?
351
270
  invalid_properties.push('invalid value for "budget_type", budget_type cannot be nil.')
352
271
  end
@@ -355,10 +274,22 @@ module PlainRouter::OpenAPI
355
274
  invalid_properties.push('invalid value for "budget_amount_minor", budget_amount_minor cannot be nil.')
356
275
  end
357
276
 
277
+ if @budget_amount_minor < 1
278
+ invalid_properties.push('invalid value for "budget_amount_minor", must be greater than or equal to 1.')
279
+ end
280
+
358
281
  if @currency.nil?
359
282
  invalid_properties.push('invalid value for "currency", currency cannot be nil.')
360
283
  end
361
284
 
285
+ if @currency.to_s.length > 3
286
+ invalid_properties.push('invalid value for "currency", the character length must be smaller than or equal to 3.')
287
+ end
288
+
289
+ if @currency.to_s.length < 3
290
+ invalid_properties.push('invalid value for "currency", the character length must be greater than or equal to 3.')
291
+ end
292
+
362
293
  if @copy.nil?
363
294
  invalid_properties.push('invalid value for "copy", copy cannot be nil.')
364
295
  end
@@ -367,12 +298,16 @@ module PlainRouter::OpenAPI
367
298
  invalid_properties.push('invalid value for "landing_page", landing_page cannot be nil.')
368
299
  end
369
300
 
370
- if @status.nil?
371
- invalid_properties.push('invalid value for "status", status cannot be nil.')
301
+ if @landing_page.to_s.length > 2048
302
+ invalid_properties.push('invalid value for "landing_page", the character length must be smaller than or equal to 2048.')
372
303
  end
373
304
 
374
- if @platform_object_ids.nil?
375
- invalid_properties.push('invalid value for "platform_object_ids", platform_object_ids cannot be nil.')
305
+ if !@utm_policy_name.nil? && @utm_policy_name.to_s.length > 255
306
+ invalid_properties.push('invalid value for "utm_policy_name", the character length must be smaller than or equal to 255.')
307
+ end
308
+
309
+ if !@naming_policy_name.nil? && @naming_policy_name.to_s.length > 255
310
+ invalid_properties.push('invalid value for "naming_policy_name", the character length must be smaller than or equal to 255.')
376
311
  end
377
312
 
378
313
  invalid_properties
@@ -382,38 +317,38 @@ module PlainRouter::OpenAPI
382
317
  # @return true if the model is valid
383
318
  def valid?
384
319
  warn '[DEPRECATED] the `valid?` method is obsolete'
385
- return false if @id.nil?
386
- return false if @workspace_id.nil?
320
+ return false if !@name.nil? && @name.to_s.length > 255
387
321
  return false if @platform_ad_account_id.nil?
322
+ return false if @platform_ad_account_id < 1
388
323
  return false if @platform.nil?
324
+ platform_validator = EnumAttributeValidator.new('String', ["google", "meta", "microsoft"])
325
+ return false unless platform_validator.valid?(@platform)
326
+ return false if !@campaign_ref.nil? && @campaign_ref.to_s.length > 255
327
+ return false if !@ad_set_ref.nil? && @ad_set_ref.to_s.length > 255
389
328
  return false if @budget_type.nil?
329
+ budget_type_validator = EnumAttributeValidator.new('String', ["daily", "lifetime"])
330
+ return false unless budget_type_validator.valid?(@budget_type)
390
331
  return false if @budget_amount_minor.nil?
332
+ return false if @budget_amount_minor < 1
391
333
  return false if @currency.nil?
334
+ return false if @currency.to_s.length > 3
335
+ return false if @currency.to_s.length < 3
392
336
  return false if @copy.nil?
393
337
  return false if @landing_page.nil?
394
- return false if @status.nil?
395
- return false if @platform_object_ids.nil?
338
+ return false if @landing_page.to_s.length > 2048
339
+ return false if !@utm_policy_name.nil? && @utm_policy_name.to_s.length > 255
340
+ return false if !@naming_policy_name.nil? && @naming_policy_name.to_s.length > 255
396
341
  true
397
342
  end
398
343
 
399
344
  # Custom attribute writer method with validation
400
- # @param [Object] id Value to be assigned
401
- def id=(id)
402
- if id.nil?
403
- fail ArgumentError, 'id cannot be nil'
404
- end
405
-
406
- @id = id
407
- end
408
-
409
- # Custom attribute writer method with validation
410
- # @param [Object] workspace_id Value to be assigned
411
- def workspace_id=(workspace_id)
412
- if workspace_id.nil?
413
- fail ArgumentError, 'workspace_id cannot be nil'
345
+ # @param [Object] name Value to be assigned
346
+ def name=(name)
347
+ if !name.nil? && name.to_s.length > 255
348
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
414
349
  end
415
350
 
416
- @workspace_id = workspace_id
351
+ @name = name
417
352
  end
418
353
 
419
354
  # Custom attribute writer method with validation
@@ -423,26 +358,50 @@ module PlainRouter::OpenAPI
423
358
  fail ArgumentError, 'platform_ad_account_id cannot be nil'
424
359
  end
425
360
 
361
+ if platform_ad_account_id < 1
362
+ fail ArgumentError, 'invalid value for "platform_ad_account_id", must be greater than or equal to 1.'
363
+ end
364
+
426
365
  @platform_ad_account_id = platform_ad_account_id
427
366
  end
428
367
 
429
- # Custom attribute writer method with validation
430
- # @param [Object] platform Value to be assigned
368
+ # Custom attribute writer method checking allowed values (enum).
369
+ # @param [Object] platform Object to be assigned
431
370
  def platform=(platform)
432
- if platform.nil?
433
- fail ArgumentError, 'platform cannot be nil'
371
+ validator = EnumAttributeValidator.new('String', ["google", "meta", "microsoft"])
372
+ unless validator.valid?(platform)
373
+ fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
434
374
  end
435
-
436
375
  @platform = platform
437
376
  end
438
377
 
439
378
  # Custom attribute writer method with validation
440
- # @param [Object] budget_type Value to be assigned
441
- def budget_type=(budget_type)
442
- if budget_type.nil?
443
- fail ArgumentError, 'budget_type cannot be nil'
379
+ # @param [Object] campaign_ref Value to be assigned
380
+ def campaign_ref=(campaign_ref)
381
+ if !campaign_ref.nil? && campaign_ref.to_s.length > 255
382
+ fail ArgumentError, 'invalid value for "campaign_ref", the character length must be smaller than or equal to 255.'
444
383
  end
445
384
 
385
+ @campaign_ref = campaign_ref
386
+ end
387
+
388
+ # Custom attribute writer method with validation
389
+ # @param [Object] ad_set_ref Value to be assigned
390
+ def ad_set_ref=(ad_set_ref)
391
+ if !ad_set_ref.nil? && ad_set_ref.to_s.length > 255
392
+ fail ArgumentError, 'invalid value for "ad_set_ref", the character length must be smaller than or equal to 255.'
393
+ end
394
+
395
+ @ad_set_ref = ad_set_ref
396
+ end
397
+
398
+ # Custom attribute writer method checking allowed values (enum).
399
+ # @param [Object] budget_type Object to be assigned
400
+ def budget_type=(budget_type)
401
+ validator = EnumAttributeValidator.new('String', ["daily", "lifetime"])
402
+ unless validator.valid?(budget_type)
403
+ fail ArgumentError, "invalid value for \"budget_type\", must be one of #{validator.allowable_values}."
404
+ end
446
405
  @budget_type = budget_type
447
406
  end
448
407
 
@@ -453,6 +412,10 @@ module PlainRouter::OpenAPI
453
412
  fail ArgumentError, 'budget_amount_minor cannot be nil'
454
413
  end
455
414
 
415
+ if budget_amount_minor < 1
416
+ fail ArgumentError, 'invalid value for "budget_amount_minor", must be greater than or equal to 1.'
417
+ end
418
+
456
419
  @budget_amount_minor = budget_amount_minor
457
420
  end
458
421
 
@@ -463,6 +426,14 @@ module PlainRouter::OpenAPI
463
426
  fail ArgumentError, 'currency cannot be nil'
464
427
  end
465
428
 
429
+ if currency.to_s.length > 3
430
+ fail ArgumentError, 'invalid value for "currency", the character length must be smaller than or equal to 3.'
431
+ end
432
+
433
+ if currency.to_s.length < 3
434
+ fail ArgumentError, 'invalid value for "currency", the character length must be greater than or equal to 3.'
435
+ end
436
+
466
437
  @currency = currency
467
438
  end
468
439
 
@@ -483,27 +454,41 @@ module PlainRouter::OpenAPI
483
454
  fail ArgumentError, 'landing_page cannot be nil'
484
455
  end
485
456
 
457
+ if landing_page.to_s.length > 2048
458
+ fail ArgumentError, 'invalid value for "landing_page", the character length must be smaller than or equal to 2048.'
459
+ end
460
+
486
461
  @landing_page = landing_page
487
462
  end
488
463
 
489
464
  # Custom attribute writer method with validation
490
- # @param [Object] status Value to be assigned
491
- def status=(status)
492
- if status.nil?
493
- fail ArgumentError, 'status cannot be nil'
465
+ # @param [Object] utm_policy_name Value to be assigned
466
+ def utm_policy_name=(utm_policy_name)
467
+ if !utm_policy_name.nil? && utm_policy_name.to_s.length > 255
468
+ fail ArgumentError, 'invalid value for "utm_policy_name", the character length must be smaller than or equal to 255.'
469
+ end
470
+
471
+ @utm_policy_name = utm_policy_name
472
+ end
473
+
474
+ # Custom attribute writer method with validation
475
+ # @param [Object] naming_policy_name Value to be assigned
476
+ def naming_policy_name=(naming_policy_name)
477
+ if !naming_policy_name.nil? && naming_policy_name.to_s.length > 255
478
+ fail ArgumentError, 'invalid value for "naming_policy_name", the character length must be smaller than or equal to 255.'
494
479
  end
495
480
 
496
- @status = status
481
+ @naming_policy_name = naming_policy_name
497
482
  end
498
483
 
499
484
  # Custom attribute writer method with validation
500
- # @param [Object] platform_object_ids Value to be assigned
501
- def platform_object_ids=(platform_object_ids)
502
- if platform_object_ids.nil?
503
- fail ArgumentError, 'platform_object_ids cannot be nil'
485
+ # @param [Object] creative_overrides Value to be assigned
486
+ def creative_overrides=(creative_overrides)
487
+ if creative_overrides.nil?
488
+ fail ArgumentError, 'creative_overrides cannot be nil'
504
489
  end
505
490
 
506
- @platform_object_ids = platform_object_ids
491
+ @creative_overrides = creative_overrides
507
492
  end
508
493
 
509
494
  # Checks equality by comparing each attribute.
@@ -511,8 +496,7 @@ module PlainRouter::OpenAPI
511
496
  def ==(o)
512
497
  return true if self.equal?(o)
513
498
  self.class == o.class &&
514
- id == o.id &&
515
- workspace_id == o.workspace_id &&
499
+ name == o.name &&
516
500
  platform_ad_account_id == o.platform_ad_account_id &&
517
501
  platform == o.platform &&
518
502
  campaign_ref == o.campaign_ref &&
@@ -524,17 +508,10 @@ module PlainRouter::OpenAPI
524
508
  currency == o.currency &&
525
509
  copy == o.copy &&
526
510
  landing_page == o.landing_page &&
527
- utm_policy_id == o.utm_policy_id &&
528
- naming_policy_id == o.naming_policy_id &&
529
- status == o.status &&
530
- validation_result == o.validation_result &&
531
- diff == o.diff &&
532
- validated_at == o.validated_at &&
533
- approval_id == o.approval_id &&
534
- created_at == o.created_at &&
535
- updated_at == o.updated_at &&
536
- platform_object_ids == o.platform_object_ids &&
537
- name == o.name
511
+ utm_policy_name == o.utm_policy_name &&
512
+ naming_policy_name == o.naming_policy_name &&
513
+ creative_ids == o.creative_ids &&
514
+ creative_overrides == o.creative_overrides
538
515
  end
539
516
 
540
517
  # @see the `==` method
@@ -546,7 +523,7 @@ module PlainRouter::OpenAPI
546
523
  # Calculates hash code according to all attributes.
547
524
  # @return [Integer] Hash code
548
525
  def hash
549
- [id, workspace_id, platform_ad_account_id, platform, campaign_ref, campaign_spec, ad_set_ref, ad_set_spec, budget_type, budget_amount_minor, currency, copy, landing_page, utm_policy_id, naming_policy_id, status, validation_result, diff, validated_at, approval_id, created_at, updated_at, platform_object_ids, name].hash
526
+ [name, platform_ad_account_id, platform, campaign_ref, campaign_spec, ad_set_ref, ad_set_spec, budget_type, budget_amount_minor, currency, copy, landing_page, utm_policy_name, naming_policy_name, creative_ids, creative_overrides].hash
550
527
  end
551
528
 
552
529
  # Builds the object from hash