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.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -2
  3. data/lib/plainrouter/client.rb +2 -1
  4. data/lib/plainrouter/openapi/api/action_dry_run_api_api.rb +2 -2
  5. data/lib/plainrouter/openapi/api/action_proposal_api_api.rb +2 -2
  6. data/lib/plainrouter/openapi/api/ad_test_api_api.rb +259 -0
  7. data/lib/plainrouter/openapi/api/cookie_declaration_api.rb +90 -0
  8. data/lib/plainrouter/openapi/api/creative_api.rb +181 -0
  9. data/lib/plainrouter/openapi/api/deployment_plan_api.rb +306 -0
  10. data/lib/plainrouter/openapi/api/meta_inventory_exposure_api.rb +121 -0
  11. data/lib/plainrouter/openapi/configuration.rb +42 -0
  12. data/lib/plainrouter/openapi/models/action_current_disposition.rb +13 -1
  13. data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload.rb +238 -0
  14. data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_baseline.rb +103 -0
  15. data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_baseline_any_of.rb +245 -0
  16. data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_inverse.rb +206 -0
  17. data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_metrics.rb +103 -0
  18. data/lib/plainrouter/openapi/models/action_current_disposition_outcome_payload_metrics_any_of.rb +276 -0
  19. data/lib/plainrouter/openapi/models/action_policy_read_data.rb +3 -105
  20. data/lib/plainrouter/openapi/models/action_policy_result.rb +374 -0
  21. data/lib/plainrouter/openapi/models/action_proposal_input.rb +32 -4
  22. data/lib/plainrouter/openapi/models/action_read_item.rb +62 -4
  23. data/lib/plainrouter/openapi/models/action_read_item_evidence.rb +105 -0
  24. data/lib/plainrouter/openapi/models/action_read_item_evidence_any_of.rb +190 -0
  25. data/lib/plainrouter/openapi/models/action_read_item_evidence_any_of1.rb +242 -0
  26. data/lib/plainrouter/openapi/models/action_read_item_evidence_any_of2.rb +217 -0
  27. data/lib/plainrouter/openapi/models/action_read_item_evidence_any_of_outcome.rb +238 -0
  28. data/lib/plainrouter/openapi/models/action_read_item_proposer.rb +198 -0
  29. data/lib/plainrouter/openapi/models/actions_api_dry_run401_response.rb +103 -0
  30. data/lib/plainrouter/openapi/models/actions_tests_api_index404_response.rb +103 -0
  31. data/lib/plainrouter/openapi/models/actions_tests_api_store_request.rb +467 -0
  32. data/lib/plainrouter/openapi/models/actions_tests_api_store_request_maximum_spend_minor.rb +104 -0
  33. data/lib/plainrouter/openapi/models/ad_test.rb +552 -0
  34. data/lib/plainrouter/openapi/models/ad_test_create_read.rb +164 -0
  35. data/lib/plainrouter/openapi/models/ad_test_create_read_test.rb +675 -0
  36. data/lib/plainrouter/openapi/models/ad_test_create_read_test_members_inner.rb +232 -0
  37. data/lib/plainrouter/openapi/models/ad_test_create_read_test_pause_proposals_inner.rb +286 -0
  38. data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict.rb +336 -0
  39. data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_daily_facts_inner.rb +374 -0
  40. data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_halt_details.rb +285 -0
  41. data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_halt_details_baseline.rb +190 -0
  42. data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_halt_details_observed_destinations_inner.rb +216 -0
  43. data/lib/plainrouter/openapi/models/ad_test_create_read_test_verdict_members_inner.rb +349 -0
  44. data/lib/plainrouter/openapi/models/ad_test_daily_fact_read.rb +374 -0
  45. data/lib/plainrouter/openapi/models/ad_test_event_choice.rb +190 -0
  46. data/lib/plainrouter/openapi/models/ad_test_list_read.rb +218 -0
  47. data/lib/plainrouter/openapi/models/ad_test_list_read_observed_conversion_events_inner.rb +190 -0
  48. data/lib/plainrouter/openapi/models/ad_test_list_read_tests.rb +396 -0
  49. data/lib/plainrouter/openapi/models/ad_test_read.rb +675 -0
  50. data/lib/plainrouter/openapi/models/ad_test_show_read.rb +164 -0
  51. data/lib/plainrouter/openapi/models/ad_test_verdict_member_read.rb +349 -0
  52. data/lib/plainrouter/openapi/models/ad_test_verdict_read.rb +336 -0
  53. data/lib/plainrouter/openapi/models/agent_credential_error.rb +214 -0
  54. data/lib/plainrouter/openapi/models/api_route_not_found.rb +216 -0
  55. data/lib/plainrouter/openapi/models/api_route_not_found_error.rb +240 -0
  56. data/lib/plainrouter/openapi/models/api_route_not_found_request.rb +190 -0
  57. data/lib/plainrouter/openapi/models/api_route_not_found_resources.rb +190 -0
  58. data/lib/plainrouter/openapi/models/cookie_declaration.rb +177 -0
  59. data/lib/plainrouter/openapi/models/cookie_declaration_categories.rb +268 -0
  60. data/lib/plainrouter/openapi/models/cookie_declaration_categories_necessary.rb +194 -0
  61. data/lib/plainrouter/openapi/models/cookie_declaration_item.rb +280 -0
  62. data/lib/plainrouter/openapi/models/create_event202_response_warnings_inner.rb +2 -2
  63. data/lib/plainrouter/openapi/models/create_event_request_any_of.rb +1 -1
  64. data/lib/plainrouter/openapi/models/create_event_request_any_of1.rb +1 -1
  65. data/lib/plainrouter/openapi/models/creative_intake_read.rb +164 -0
  66. data/lib/plainrouter/openapi/models/creative_intake_read_creative.rb +451 -0
  67. data/lib/plainrouter/openapi/models/creative_intake_read_creative_tags.rb +104 -0
  68. data/lib/plainrouter/openapi/models/creative_intake_rejected.rb +164 -0
  69. data/lib/plainrouter/openapi/models/creative_intake_rejected_error.rb +190 -0
  70. data/lib/plainrouter/openapi/models/creative_intake_tags.rb +257 -0
  71. data/lib/plainrouter/openapi/models/deployment_plan.rb +593 -0
  72. data/lib/plainrouter/openapi/models/deployment_plan_read.rb +268 -0
  73. data/lib/plainrouter/openapi/models/deployment_plan_read_copy.rb +266 -0
  74. data/lib/plainrouter/openapi/models/deployment_plan_read_creatives_inner.rb +320 -0
  75. data/lib/plainrouter/openapi/models/deployment_plan_read_creatives_inner_copy.rb +267 -0
  76. data/lib/plainrouter/openapi/models/destination_type.rb +2 -1
  77. data/lib/plainrouter/openapi/models/execute_deployment_plan_request.rb +200 -0
  78. data/lib/plainrouter/openapi/models/get_cookie_declaration404_response.rb +103 -0
  79. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response.rb +324 -0
  80. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_account.rb +264 -0
  81. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_changes_inner.rb +304 -0
  82. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_effective_range.rb +190 -0
  83. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_metrics_inner.rb +492 -0
  84. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_object_metrics_inner.rb +304 -0
  85. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_object_metrics_inner_meta.rb +268 -0
  86. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_staleness.rb +200 -0
  87. data/lib/plainrouter/openapi/models/get_inventory_metrics200_response_sync.rb +186 -0
  88. data/lib/plainrouter/openapi/models/ingestion_warning_code.rb +2 -1
  89. data/lib/plainrouter/openapi/models/launch_intent_read.rb +164 -0
  90. data/lib/plainrouter/openapi/models/launch_intent_read_intent.rb +330 -0
  91. data/lib/plainrouter/openapi/models/launch_intent_read_intent_actions_inner.rb +238 -0
  92. data/lib/plainrouter/openapi/models/launch_intent_status.rb +46 -0
  93. data/lib/plainrouter/openapi/models/launch_plans_copy403_response.rb +103 -0
  94. data/lib/plainrouter/openapi/models/launch_plans_copy404_response.rb +103 -0
  95. data/lib/plainrouter/openapi/models/launch_plans_execute422_response.rb +103 -0
  96. data/lib/plainrouter/openapi/models/launch_plans_index200_response.rb +164 -0
  97. data/lib/plainrouter/openapi/models/launch_plans_index200_response_plans.rb +244 -0
  98. data/lib/plainrouter/openapi/models/launch_plans_show200_response.rb +164 -0
  99. data/lib/plainrouter/openapi/models/plan_copy_forbidden.rb +164 -0
  100. data/lib/plainrouter/openapi/models/plan_copy_forbidden_error.rb +214 -0
  101. data/lib/plainrouter/openapi/models/plan_copy_not_found.rb +164 -0
  102. data/lib/plainrouter/openapi/models/plan_copy_not_found_error.rb +214 -0
  103. data/lib/plainrouter/openapi/models/plan_copy_read.rb +164 -0
  104. data/lib/plainrouter/openapi/models/plan_copy_read_plan.rb +347 -0
  105. data/lib/plainrouter/openapi/models/plan_copy_rejected.rb +164 -0
  106. data/lib/plainrouter/openapi/models/plan_copy_rejected_error.rb +214 -0
  107. data/lib/plainrouter/openapi/models/plan_execute_conflict.rb +164 -0
  108. data/lib/plainrouter/openapi/models/plan_execute_conflict_error.rb +214 -0
  109. data/lib/plainrouter/openapi/models/plan_execute_rejected.rb +164 -0
  110. data/lib/plainrouter/openapi/models/plan_execute_rejected_error.rb +214 -0
  111. data/lib/plainrouter/openapi/models/proposal_replay_conflict.rb +214 -0
  112. data/lib/plainrouter/openapi/models/proposal_replay_conflict_errors.rb +178 -0
  113. data/lib/plainrouter/openapi/models/store_creative403_response.rb +103 -0
  114. data/lib/plainrouter/openapi/models/store_creative413_response.rb +103 -0
  115. data/lib/plainrouter/openapi/models/store_creative422_response.rb +103 -0
  116. data/lib/plainrouter/openapi/models/store_creative_from_url_request.rb +208 -0
  117. data/lib/plainrouter/openapi/models/store_creative_from_url_request_tags.rb +257 -0
  118. data/lib/plainrouter/openapi/models/store_creative_request.rb +219 -0
  119. data/lib/plainrouter/openapi/models/store_creative_request_tags.rb +257 -0
  120. data/lib/plainrouter/openapi/models/workspace_lock_timeout.rb +164 -0
  121. data/lib/plainrouter/openapi/models/workspace_lock_timeout_error.rb +214 -0
  122. data/lib/plainrouter/openapi/version.rb +1 -1
  123. data/lib/plainrouter/openapi.rb +106 -0
  124. data/lib/plainrouter/version.rb +1 -1
  125. metadata +108 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3af4afbf5b335f3602353873f9cffac36d4d183a2528ca3f9966fe22ed971642
4
- data.tar.gz: c9dba9aef741159204bf5eefa3b845ef24a7c7801631b5b8523824abf6c1e9da
3
+ metadata.gz: df224f0dc73b39e6a6a2858032da5d51e03c22f577a80685a0369fbb9b7bc2de
4
+ data.tar.gz: 3b2b161e563636a585b6f465ad6c911f865716a918829c508ed520648c7b45b0
5
5
  SHA512:
6
- metadata.gz: 16cefffc78d545efd2809b141e9f2fec84e7bc3e3a5bd326203a606f911bb94974b901a29ed903938a35e840ef11404faf78880ce08deb8f86326448b92317e2
7
- data.tar.gz: 2ff1a28fbe3c4f75cbf45fd9ec50b1be157a83f147f7d7f009863628deca79ea5c7dbb95d940a1fe5b53f66d9fbfa09eaf1a29120a9b8a680d51027107c745fb
6
+ metadata.gz: 60ce380c81df2427e5f7a9ae893fd8a3ff98799c7dc03b2287938d5f16a07809300a7a698bbbd8cc8c60738f23a806fdf090313ace52f83b357b5fce2bfd85bb
7
+ data.tar.gz: 8860b378192926ceb32774bf5e9a03fdb3ecd0d744e511a32bc0e0485ec9841b6c39396ac70083b6e0cde6e4cde75ad188a7cb7ccf669fdc419906f40348b2d4
data/README.md CHANGED
@@ -7,14 +7,14 @@ The official Ruby SDK for the Plainrouter Signals Conversion API. It is generate
7
7
  Add the gem to your bundle:
8
8
 
9
9
  ```ruby
10
- gem "plainrouter-sdk", "~> 0.1"
10
+ gem "plainrouter-sdk", "~> 0.4"
11
11
  ```
12
12
 
13
13
  Then run `bundle install`. Ruby 3.2 or newer is required.
14
14
 
15
15
  ## Use
16
16
 
17
- Create one client with a Signal Tracker secret and call one of the three API groups:
17
+ Create one client with a Signal Tracker secret and call an API group:
18
18
 
19
19
  ```ruby
20
20
  require "plainrouter"
@@ -29,6 +29,13 @@ event = client.events.get_event("event-id")
29
29
 
30
30
  The default base URL is `https://plainrouter.com/api/v1` and the default timeout is 30 seconds. Credentials are supplied by the caller and are never embedded in the SDK.
31
31
 
32
+ To copy a failed plan to a fresh draft, configure a client with a plan-writer bearer token:
33
+
34
+ ```ruby
35
+ client = PlainRouter::Client.new(token: ENV.fetch("PLAINROUTER_TOKEN"))
36
+ draft = client.plans.launch_plans_copy(1, "failed-plan-id")
37
+ ```
38
+
32
39
  The zero-auth sandbox uses the same client without a token:
33
40
 
34
41
  ```ruby
@@ -76,7 +76,7 @@ module PlainRouter
76
76
  end
77
77
  end
78
78
 
79
- attr_reader :events, :operations, :sandbox
79
+ attr_reader :events, :operations, :sandbox, :plans
80
80
 
81
81
  def initialize(token: nil, base_url: DEFAULT_BASE_URL, timeout: 30, user_agent: nil)
82
82
  configuration = OpenAPI::Configuration.new
@@ -92,6 +92,7 @@ module PlainRouter
92
92
  @events.singleton_class.prepend(EventsValidation)
93
93
  @operations = OpenAPI::OperationsApi.new(api_client)
94
94
  @sandbox = OpenAPI::SandboxApi.new(api_client)
95
+ @plans = OpenAPI::DeploymentPlanApi.new(api_client)
95
96
  end
96
97
 
97
98
  private
@@ -20,7 +20,7 @@ module PlainRouter::OpenAPI
20
20
  @api_client = api_client
21
21
  end
22
22
  # Preview actions
23
- # Evaluate a governed proposal for the approved account and preview each policy decision and execution diff without creating a batch or action.
23
+ # Preview policy decisions and execution diffs for the approved account without saving a proposal. A kill switch returns blocked policy decisions.
24
24
  # @param workspace [Integer] The workspace ID
25
25
  # @param action_proposal_input [ActionProposalInput]
26
26
  # @param [Hash] opts the optional parameters
@@ -31,7 +31,7 @@ module PlainRouter::OpenAPI
31
31
  end
32
32
 
33
33
  # Preview actions
34
- # Evaluate a governed proposal for the approved account and preview each policy decision and execution diff without creating a batch or action.
34
+ # Preview policy decisions and execution diffs for the approved account without saving a proposal. A kill switch returns blocked policy decisions.
35
35
  # @param workspace [Integer] The workspace ID
36
36
  # @param action_proposal_input [ActionProposalInput]
37
37
  # @param [Hash] opts the optional parameters
@@ -20,7 +20,7 @@ module PlainRouter::OpenAPI
20
20
  @api_client = api_client
21
21
  end
22
22
  # Propose actions
23
- # Submit a governed proposal for an advertising account available to this workspace key. A matching idempotency key returns the saved batch.
23
+ # Submit or replay a governed proposal for an account available to this key. A kill switch saves a blocked proposal without executing provider writes.
24
24
  # @param workspace [Integer] The workspace ID
25
25
  # @param action_proposal_input [ActionProposalInput]
26
26
  # @param [Hash] opts the optional parameters
@@ -31,7 +31,7 @@ module PlainRouter::OpenAPI
31
31
  end
32
32
 
33
33
  # Propose actions
34
- # Submit a governed proposal for an advertising account available to this workspace key. A matching idempotency key returns the saved batch.
34
+ # Submit or replay a governed proposal for an account available to this key. A kill switch saves a blocked proposal without executing provider writes.
35
35
  # @param workspace [Integer] The workspace ID
36
36
  # @param action_proposal_input [ActionProposalInput]
37
37
  # @param [Hash] opts the optional parameters
@@ -0,0 +1,259 @@
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 'cgi'
14
+
15
+ module PlainRouter::OpenAPI
16
+ class AdTestApiApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # List Tests and observed conversion event choices
23
+ # Lists scoped Tests, their loser pause candidate status and reasons, and observed conversion event choices with last-30-day recorded counts.
24
+ # @param workspace [Integer] The workspace ID
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [Integer] :page
27
+ # @option opts [Integer] :per_page
28
+ # @return [AdTestListRead]
29
+ def actions_tests_api_index(workspace, opts = {})
30
+ data, _status_code, _headers = actions_tests_api_index_with_http_info(workspace, opts)
31
+ data
32
+ end
33
+
34
+ # List Tests and observed conversion event choices
35
+ # Lists scoped Tests, their loser pause candidate status and reasons, and observed conversion event choices with last-30-day recorded counts.
36
+ # @param workspace [Integer] The workspace ID
37
+ # @param [Hash] opts the optional parameters
38
+ # @option opts [Integer] :page
39
+ # @option opts [Integer] :per_page
40
+ # @return [Array<(AdTestListRead, Integer, Hash)>] AdTestListRead data, response status code and response headers
41
+ def actions_tests_api_index_with_http_info(workspace, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: AdTestApiApi.actions_tests_api_index ...'
44
+ end
45
+ # verify the required parameter 'workspace' is set
46
+ if @api_client.config.client_side_validation && workspace.nil?
47
+ fail ArgumentError, "Missing the required parameter 'workspace' when calling AdTestApiApi.actions_tests_api_index"
48
+ end
49
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
50
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AdTestApiApi.actions_tests_api_index, must be greater than or equal to 1.'
51
+ end
52
+
53
+ if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
54
+ fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling AdTestApiApi.actions_tests_api_index, must be smaller than or equal to 100.'
55
+ end
56
+
57
+ if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
58
+ fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling AdTestApiApi.actions_tests_api_index, must be greater than or equal to 1.'
59
+ end
60
+
61
+ # resource path
62
+ local_var_path = '/agent/workspaces/{workspace}/tests'.sub('{workspace}', CGI.escape(workspace.to_s))
63
+
64
+ # query parameters
65
+ query_params = opts[:query_params] || {}
66
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
67
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
68
+
69
+ # header parameters
70
+ header_params = opts[:header_params] || {}
71
+ # HTTP header 'Accept' (if needed)
72
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
73
+
74
+ # form parameters
75
+ form_params = opts[:form_params] || {}
76
+
77
+ # http body (model)
78
+ post_body = opts[:debug_body]
79
+
80
+ # return_type
81
+ return_type = opts[:debug_return_type] || 'AdTestListRead'
82
+
83
+ # auth_names
84
+ auth_names = opts[:debug_auth_names] || ['testReader']
85
+
86
+ new_options = opts.merge(
87
+ :operation => :"AdTestApiApi.actions_tests_api_index",
88
+ :header_params => header_params,
89
+ :query_params => query_params,
90
+ :form_params => form_params,
91
+ :body => post_body,
92
+ :auth_names => auth_names,
93
+ :return_type => return_type
94
+ )
95
+
96
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
97
+ if @api_client.config.debugging
98
+ @api_client.config.logger.debug "API called: AdTestApiApi#actions_tests_api_index\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
99
+ end
100
+ return data, status_code, headers
101
+ end
102
+
103
+ # Read a Test, verdict, and pause candidates
104
+ # Reads a scoped Test, its stored daily facts and verdict, and loser pause candidate status and reason; recorded counts rank members only within this Test.
105
+ # @param workspace [Integer] The workspace ID
106
+ # @param ad_test [String]
107
+ # @param [Hash] opts the optional parameters
108
+ # @return [AdTestShowRead]
109
+ def actions_tests_api_show(workspace, ad_test, opts = {})
110
+ data, _status_code, _headers = actions_tests_api_show_with_http_info(workspace, ad_test, opts)
111
+ data
112
+ end
113
+
114
+ # Read a Test, verdict, and pause candidates
115
+ # Reads a scoped Test, its stored daily facts and verdict, and loser pause candidate status and reason; recorded counts rank members only within this Test.
116
+ # @param workspace [Integer] The workspace ID
117
+ # @param ad_test [String]
118
+ # @param [Hash] opts the optional parameters
119
+ # @return [Array<(AdTestShowRead, Integer, Hash)>] AdTestShowRead data, response status code and response headers
120
+ def actions_tests_api_show_with_http_info(workspace, ad_test, opts = {})
121
+ if @api_client.config.debugging
122
+ @api_client.config.logger.debug 'Calling API: AdTestApiApi.actions_tests_api_show ...'
123
+ end
124
+ # verify the required parameter 'workspace' is set
125
+ if @api_client.config.client_side_validation && workspace.nil?
126
+ fail ArgumentError, "Missing the required parameter 'workspace' when calling AdTestApiApi.actions_tests_api_show"
127
+ end
128
+ # verify the required parameter 'ad_test' is set
129
+ if @api_client.config.client_side_validation && ad_test.nil?
130
+ fail ArgumentError, "Missing the required parameter 'ad_test' when calling AdTestApiApi.actions_tests_api_show"
131
+ end
132
+ if @api_client.config.client_side_validation && ad_test.to_s.length > 26
133
+ fail ArgumentError, 'invalid value for "ad_test" when calling AdTestApiApi.actions_tests_api_show, the character length must be smaller than or equal to 26.'
134
+ end
135
+
136
+ if @api_client.config.client_side_validation && ad_test.to_s.length < 26
137
+ fail ArgumentError, 'invalid value for "ad_test" when calling AdTestApiApi.actions_tests_api_show, the character length must be greater than or equal to 26.'
138
+ end
139
+
140
+ pattern = Regexp.new(/^[0-7][0-9a-hjkmnp-tv-z]{25}$/)
141
+ if @api_client.config.client_side_validation && ad_test !~ pattern
142
+ fail ArgumentError, "invalid value for 'ad_test' when calling AdTestApiApi.actions_tests_api_show, must conform to the pattern #{pattern}."
143
+ end
144
+
145
+ # resource path
146
+ local_var_path = '/agent/workspaces/{workspace}/tests/{ad_test}'.sub('{workspace}', CGI.escape(workspace.to_s)).sub('{ad_test}', CGI.escape(ad_test.to_s))
147
+
148
+ # query parameters
149
+ query_params = opts[:query_params] || {}
150
+
151
+ # header parameters
152
+ header_params = opts[:header_params] || {}
153
+ # HTTP header 'Accept' (if needed)
154
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
155
+
156
+ # form parameters
157
+ form_params = opts[:form_params] || {}
158
+
159
+ # http body (model)
160
+ post_body = opts[:debug_body]
161
+
162
+ # return_type
163
+ return_type = opts[:debug_return_type] || 'AdTestShowRead'
164
+
165
+ # auth_names
166
+ auth_names = opts[:debug_auth_names] || ['testReader']
167
+
168
+ new_options = opts.merge(
169
+ :operation => :"AdTestApiApi.actions_tests_api_show",
170
+ :header_params => header_params,
171
+ :query_params => query_params,
172
+ :form_params => form_params,
173
+ :body => post_body,
174
+ :auth_names => auth_names,
175
+ :return_type => return_type
176
+ )
177
+
178
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
179
+ if @api_client.config.debugging
180
+ @api_client.config.logger.debug "API called: AdTestApiApi#actions_tests_api_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
181
+ end
182
+ return data, status_code, headers
183
+ end
184
+
185
+ # Create a judging Test
186
+ # Creates a judging Test with frozen event, settings, axis, and 2 to 4 ads from one mirrored ad set; it creates no proposal or Meta write.
187
+ # @param workspace [Integer] The workspace ID
188
+ # @param actions_tests_api_store_request [ActionsTestsApiStoreRequest] A Test using ads present in the selected mirrored Meta ad set.
189
+ # @param [Hash] opts the optional parameters
190
+ # @return [AdTestCreateRead]
191
+ def actions_tests_api_store(workspace, actions_tests_api_store_request, opts = {})
192
+ data, _status_code, _headers = actions_tests_api_store_with_http_info(workspace, actions_tests_api_store_request, opts)
193
+ data
194
+ end
195
+
196
+ # Create a judging Test
197
+ # Creates a judging Test with frozen event, settings, axis, and 2 to 4 ads from one mirrored ad set; it creates no proposal or Meta write.
198
+ # @param workspace [Integer] The workspace ID
199
+ # @param actions_tests_api_store_request [ActionsTestsApiStoreRequest] A Test using ads present in the selected mirrored Meta ad set.
200
+ # @param [Hash] opts the optional parameters
201
+ # @return [Array<(AdTestCreateRead, Integer, Hash)>] AdTestCreateRead data, response status code and response headers
202
+ def actions_tests_api_store_with_http_info(workspace, actions_tests_api_store_request, opts = {})
203
+ if @api_client.config.debugging
204
+ @api_client.config.logger.debug 'Calling API: AdTestApiApi.actions_tests_api_store ...'
205
+ end
206
+ # verify the required parameter 'workspace' is set
207
+ if @api_client.config.client_side_validation && workspace.nil?
208
+ fail ArgumentError, "Missing the required parameter 'workspace' when calling AdTestApiApi.actions_tests_api_store"
209
+ end
210
+ # verify the required parameter 'actions_tests_api_store_request' is set
211
+ if @api_client.config.client_side_validation && actions_tests_api_store_request.nil?
212
+ fail ArgumentError, "Missing the required parameter 'actions_tests_api_store_request' when calling AdTestApiApi.actions_tests_api_store"
213
+ end
214
+ # resource path
215
+ local_var_path = '/agent/workspaces/{workspace}/tests'.sub('{workspace}', CGI.escape(workspace.to_s))
216
+
217
+ # query parameters
218
+ query_params = opts[:query_params] || {}
219
+
220
+ # header parameters
221
+ header_params = opts[:header_params] || {}
222
+ # HTTP header 'Accept' (if needed)
223
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
224
+ # HTTP header 'Content-Type'
225
+ content_type = @api_client.select_header_content_type(['application/json'])
226
+ if !content_type.nil?
227
+ header_params['Content-Type'] = content_type
228
+ end
229
+
230
+ # form parameters
231
+ form_params = opts[:form_params] || {}
232
+
233
+ # http body (model)
234
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(actions_tests_api_store_request)
235
+
236
+ # return_type
237
+ return_type = opts[:debug_return_type] || 'AdTestCreateRead'
238
+
239
+ # auth_names
240
+ auth_names = opts[:debug_auth_names] || ['testWriter']
241
+
242
+ new_options = opts.merge(
243
+ :operation => :"AdTestApiApi.actions_tests_api_store",
244
+ :header_params => header_params,
245
+ :query_params => query_params,
246
+ :form_params => form_params,
247
+ :body => post_body,
248
+ :auth_names => auth_names,
249
+ :return_type => return_type
250
+ )
251
+
252
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
253
+ if @api_client.config.debugging
254
+ @api_client.config.logger.debug "API called: AdTestApiApi#actions_tests_api_store\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
255
+ end
256
+ return data, status_code, headers
257
+ end
258
+ end
259
+ end
@@ -0,0 +1,90 @@
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 'cgi'
14
+
15
+ module PlainRouter::OpenAPI
16
+ class CookieDeclarationApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Read the public cookie declaration
23
+ # Public on every plan. Returns latest completed scan metadata, never values. Invalid keys return 404 before the 300/minute per-key limiter.
24
+ # @param publishable_key [String] Workspace publishable key from the customer page source; pk_live_ followed by 32 alphanumeric characters.
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [CookieDeclaration]
27
+ def get_cookie_declaration(publishable_key, opts = {})
28
+ data, _status_code, _headers = get_cookie_declaration_with_http_info(publishable_key, opts)
29
+ data
30
+ end
31
+
32
+ # Read the public cookie declaration
33
+ # Public on every plan. Returns latest completed scan metadata, never values. Invalid keys return 404 before the 300/minute per-key limiter.
34
+ # @param publishable_key [String] Workspace publishable key from the customer page source; pk_live_ followed by 32 alphanumeric characters.
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(CookieDeclaration, Integer, Hash)>] CookieDeclaration data, response status code and response headers
37
+ def get_cookie_declaration_with_http_info(publishable_key, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: CookieDeclarationApi.get_cookie_declaration ...'
40
+ end
41
+ # verify the required parameter 'publishable_key' is set
42
+ if @api_client.config.client_side_validation && publishable_key.nil?
43
+ fail ArgumentError, "Missing the required parameter 'publishable_key' when calling CookieDeclarationApi.get_cookie_declaration"
44
+ end
45
+ pattern = Regexp.new(/^pk_live_[A-Za-z0-9]{32}$/)
46
+ if @api_client.config.client_side_validation && publishable_key !~ pattern
47
+ fail ArgumentError, "invalid value for 'publishable_key' when calling CookieDeclarationApi.get_cookie_declaration, must conform to the pattern #{pattern}."
48
+ end
49
+
50
+ # resource path
51
+ local_var_path = '/cookie-declarations/{publishableKey}'.sub('{publishableKey}', CGI.escape(publishable_key.to_s))
52
+
53
+ # query parameters
54
+ query_params = opts[:query_params] || {}
55
+
56
+ # header parameters
57
+ header_params = opts[:header_params] || {}
58
+ # HTTP header 'Accept' (if needed)
59
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
60
+
61
+ # form parameters
62
+ form_params = opts[:form_params] || {}
63
+
64
+ # http body (model)
65
+ post_body = opts[:debug_body]
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'CookieDeclaration'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || []
72
+
73
+ new_options = opts.merge(
74
+ :operation => :"CookieDeclarationApi.get_cookie_declaration",
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: CookieDeclarationApi#get_cookie_declaration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,181 @@
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 'cgi'
14
+
15
+ module PlainRouter::OpenAPI
16
+ class CreativeApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Upload a creative
23
+ # Store a creative in the credential-bound workspace. Set generator, generator_job and parent_creative tags for output from an outside tool.
24
+ # @param workspace [Integer] The workspace ID
25
+ # @param file [File] JPEG, PNG, MP4 or QuickTime bytes, at most 4 GiB.
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [StoreCreativeRequestTags] :tags
28
+ # @option opts [String] :source_ref
29
+ # @return [CreativeIntakeRead]
30
+ def store_creative(workspace, file, opts = {})
31
+ data, _status_code, _headers = store_creative_with_http_info(workspace, file, opts)
32
+ data
33
+ end
34
+
35
+ # Upload a creative
36
+ # Store a creative in the credential-bound workspace. Set generator, generator_job and parent_creative tags for output from an outside tool.
37
+ # @param workspace [Integer] The workspace ID
38
+ # @param file [File] JPEG, PNG, MP4 or QuickTime bytes, at most 4 GiB.
39
+ # @param [Hash] opts the optional parameters
40
+ # @option opts [StoreCreativeRequestTags] :tags
41
+ # @option opts [String] :source_ref
42
+ # @return [Array<(CreativeIntakeRead, Integer, Hash)>] CreativeIntakeRead data, response status code and response headers
43
+ def store_creative_with_http_info(workspace, file, opts = {})
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug 'Calling API: CreativeApi.store_creative ...'
46
+ end
47
+ # verify the required parameter 'workspace' is set
48
+ if @api_client.config.client_side_validation && workspace.nil?
49
+ fail ArgumentError, "Missing the required parameter 'workspace' when calling CreativeApi.store_creative"
50
+ end
51
+ # verify the required parameter 'file' is set
52
+ if @api_client.config.client_side_validation && file.nil?
53
+ fail ArgumentError, "Missing the required parameter 'file' when calling CreativeApi.store_creative"
54
+ end
55
+ if @api_client.config.client_side_validation && !opts[:'source_ref'].nil? && opts[:'source_ref'].to_s.length > 255
56
+ fail ArgumentError, 'invalid value for "opts[:"source_ref"]" when calling CreativeApi.store_creative, the character length must be smaller than or equal to 255.'
57
+ end
58
+
59
+ # resource path
60
+ local_var_path = '/workspaces/{workspace}/admin/creatives'.sub('{workspace}', CGI.escape(workspace.to_s))
61
+
62
+ # query parameters
63
+ query_params = opts[:query_params] || {}
64
+
65
+ # header parameters
66
+ header_params = opts[:header_params] || {}
67
+ # HTTP header 'Accept' (if needed)
68
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
69
+ # HTTP header 'Content-Type'
70
+ content_type = @api_client.select_header_content_type(['multipart/form-data'])
71
+ if !content_type.nil?
72
+ header_params['Content-Type'] = content_type
73
+ end
74
+
75
+ # form parameters
76
+ form_params = opts[:form_params] || {}
77
+ form_params['file'] = file
78
+ form_params['tags'] = opts[:'tags'] if !opts[:'tags'].nil?
79
+ form_params['source_ref'] = opts[:'source_ref'] if !opts[:'source_ref'].nil?
80
+
81
+ # http body (model)
82
+ post_body = opts[:debug_body]
83
+
84
+ # return_type
85
+ return_type = opts[:debug_return_type] || 'CreativeIntakeRead'
86
+
87
+ # auth_names
88
+ auth_names = opts[:debug_auth_names] || ['creativeWriter']
89
+
90
+ new_options = opts.merge(
91
+ :operation => :"CreativeApi.store_creative",
92
+ :header_params => header_params,
93
+ :query_params => query_params,
94
+ :form_params => form_params,
95
+ :body => post_body,
96
+ :auth_names => auth_names,
97
+ :return_type => return_type
98
+ )
99
+
100
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
101
+ if @api_client.config.debugging
102
+ @api_client.config.logger.debug "API called: CreativeApi#store_creative\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
103
+ end
104
+ return data, status_code, headers
105
+ end
106
+
107
+ # Store a creative from a URL
108
+ # Store a creative in the credential-bound workspace. Set generator, generator_job and parent_creative tags for output from an outside tool.
109
+ # @param workspace [Integer] The workspace ID
110
+ # @param store_creative_from_url_request [StoreCreativeFromUrlRequest]
111
+ # @param [Hash] opts the optional parameters
112
+ # @return [CreativeIntakeRead]
113
+ def store_creative_from_url(workspace, store_creative_from_url_request, opts = {})
114
+ data, _status_code, _headers = store_creative_from_url_with_http_info(workspace, store_creative_from_url_request, opts)
115
+ data
116
+ end
117
+
118
+ # Store a creative from a URL
119
+ # Store a creative in the credential-bound workspace. Set generator, generator_job and parent_creative tags for output from an outside tool.
120
+ # @param workspace [Integer] The workspace ID
121
+ # @param store_creative_from_url_request [StoreCreativeFromUrlRequest]
122
+ # @param [Hash] opts the optional parameters
123
+ # @return [Array<(CreativeIntakeRead, Integer, Hash)>] CreativeIntakeRead data, response status code and response headers
124
+ def store_creative_from_url_with_http_info(workspace, store_creative_from_url_request, opts = {})
125
+ if @api_client.config.debugging
126
+ @api_client.config.logger.debug 'Calling API: CreativeApi.store_creative_from_url ...'
127
+ end
128
+ # verify the required parameter 'workspace' is set
129
+ if @api_client.config.client_side_validation && workspace.nil?
130
+ fail ArgumentError, "Missing the required parameter 'workspace' when calling CreativeApi.store_creative_from_url"
131
+ end
132
+ # verify the required parameter 'store_creative_from_url_request' is set
133
+ if @api_client.config.client_side_validation && store_creative_from_url_request.nil?
134
+ fail ArgumentError, "Missing the required parameter 'store_creative_from_url_request' when calling CreativeApi.store_creative_from_url"
135
+ end
136
+ # resource path
137
+ local_var_path = '/workspaces/{workspace}/admin/creatives/from-url'.sub('{workspace}', CGI.escape(workspace.to_s))
138
+
139
+ # query parameters
140
+ query_params = opts[:query_params] || {}
141
+
142
+ # header parameters
143
+ header_params = opts[:header_params] || {}
144
+ # HTTP header 'Accept' (if needed)
145
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
146
+ # HTTP header 'Content-Type'
147
+ content_type = @api_client.select_header_content_type(['application/json'])
148
+ if !content_type.nil?
149
+ header_params['Content-Type'] = content_type
150
+ end
151
+
152
+ # form parameters
153
+ form_params = opts[:form_params] || {}
154
+
155
+ # http body (model)
156
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(store_creative_from_url_request)
157
+
158
+ # return_type
159
+ return_type = opts[:debug_return_type] || 'CreativeIntakeRead'
160
+
161
+ # auth_names
162
+ auth_names = opts[:debug_auth_names] || ['creativeWriter']
163
+
164
+ new_options = opts.merge(
165
+ :operation => :"CreativeApi.store_creative_from_url",
166
+ :header_params => header_params,
167
+ :query_params => query_params,
168
+ :form_params => form_params,
169
+ :body => post_body,
170
+ :auth_names => auth_names,
171
+ :return_type => return_type
172
+ )
173
+
174
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
175
+ if @api_client.config.debugging
176
+ @api_client.config.logger.debug "API called: CreativeApi#store_creative_from_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
177
+ end
178
+ return data, status_code, headers
179
+ end
180
+ end
181
+ end