shipeasy-sdk 2.1.0 → 2.3.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 +1 -0
- data/docs/skill/SKILL.md +6 -2
- data/lib/generators/shipeasy/install/USAGE +24 -0
- data/lib/generators/shipeasy/install/install_generator.rb +86 -0
- data/lib/generators/shipeasy/install/templates/initializer.rb.tt +41 -0
- data/lib/shipeasy/admin.rb +85 -0
- data/lib/shipeasy/sdk/version.rb +1 -1
- data/lib/shipeasy_admin/api/alert_rules_api.rb +292 -0
- data/lib/shipeasy_admin/api/attributes_api.rb +82 -0
- data/lib/shipeasy_admin/api/configs_api.rb +680 -0
- data/lib/shipeasy_admin/api/events_api.rb +438 -0
- data/lib/shipeasy_admin/api/experiments_api.rb +727 -0
- data/lib/shipeasy_admin/api/gates_api.rb +438 -0
- data/lib/shipeasy_admin/api/i18n_api.rb +507 -0
- data/lib/shipeasy_admin/api/killswitches_api.rb +526 -0
- data/lib/shipeasy_admin/api/metrics_api.rb +281 -0
- data/lib/shipeasy_admin/api/ops_api.rb +525 -0
- data/lib/shipeasy_admin/api/projects_api.rb +153 -0
- data/lib/shipeasy_admin/api/universes_api.rb +306 -0
- data/lib/shipeasy_admin/api_client.rb +441 -0
- data/lib/shipeasy_admin/api_error.rb +58 -0
- data/lib/shipeasy_admin/api_model_base.rb +88 -0
- data/lib/shipeasy_admin/configuration.rb +397 -0
- data/lib/shipeasy_admin/models/approve_event_request.rb +198 -0
- data/lib/shipeasy_admin/models/approve_event_response.rb +166 -0
- data/lib/shipeasy_admin/models/create_alert_rule_request.rb +408 -0
- data/lib/shipeasy_admin/models/create_alert_rule_response.rb +165 -0
- data/lib/shipeasy_admin/models/create_config_request.rb +280 -0
- data/lib/shipeasy_admin/models/create_config_response.rb +201 -0
- data/lib/shipeasy_admin/models/create_event_request.rb +253 -0
- data/lib/shipeasy_admin/models/create_event_response.rb +193 -0
- data/lib/shipeasy_admin/models/create_experiment_request.rb +869 -0
- data/lib/shipeasy_admin/models/create_experiment_request_goal_metric.rb +336 -0
- data/lib/shipeasy_admin/models/create_experiment_response.rb +212 -0
- data/lib/shipeasy_admin/models/create_gate_request.rb +529 -0
- data/lib/shipeasy_admin/models/create_gate_response.rb +212 -0
- data/lib/shipeasy_admin/models/create_i18n_profile_request.rb +188 -0
- data/lib/shipeasy_admin/models/create_i18n_profile_response.rb +193 -0
- data/lib/shipeasy_admin/models/create_killswitch_request.rb +263 -0
- data/lib/shipeasy_admin/models/create_killswitch_response.rb +201 -0
- data/lib/shipeasy_admin/models/create_metric_request.rb +415 -0
- data/lib/shipeasy_admin/models/create_metric_response.rb +193 -0
- data/lib/shipeasy_admin/models/create_ops_item_request.rb +287 -0
- data/lib/shipeasy_admin/models/create_ops_item_response.rb +177 -0
- data/lib/shipeasy_admin/models/create_universe_request.rb +289 -0
- data/lib/shipeasy_admin/models/create_universe_response.rb +212 -0
- data/lib/shipeasy_admin/models/delete_alert_rule_response.rb +188 -0
- data/lib/shipeasy_admin/models/delete_config_response.rb +188 -0
- data/lib/shipeasy_admin/models/delete_event_response.rb +189 -0
- data/lib/shipeasy_admin/models/delete_experiment_response.rb +188 -0
- data/lib/shipeasy_admin/models/delete_gate_response.rb +188 -0
- data/lib/shipeasy_admin/models/delete_killswitch_response.rb +188 -0
- data/lib/shipeasy_admin/models/delete_metric_response.rb +189 -0
- data/lib/shipeasy_admin/models/delete_universe_response.rb +188 -0
- data/lib/shipeasy_admin/models/disable_gate_response.rb +190 -0
- data/lib/shipeasy_admin/models/discard_config_draft_request.rb +190 -0
- data/lib/shipeasy_admin/models/discard_config_draft_response.rb +188 -0
- data/lib/shipeasy_admin/models/enable_gate_response.rb +190 -0
- data/lib/shipeasy_admin/models/error_response.rb +185 -0
- data/lib/shipeasy_admin/models/get_config_response.rb +351 -0
- data/lib/shipeasy_admin/models/get_current_project_response.rb +606 -0
- data/lib/shipeasy_admin/models/get_current_project_response_module_translations.rb +104 -0
- data/lib/shipeasy_admin/models/get_event_response.rb +344 -0
- data/lib/shipeasy_admin/models/get_experiment_response.rb +688 -0
- data/lib/shipeasy_admin/models/get_experiment_results_response.rb +243 -0
- data/lib/shipeasy_admin/models/get_experiment_results_response_experiment.rb +248 -0
- data/lib/shipeasy_admin/models/get_experiment_results_response_results_inner.rb +252 -0
- data/lib/shipeasy_admin/models/get_experiment_timeseries_response.rb +192 -0
- data/lib/shipeasy_admin/models/get_experiment_timeseries_response_experiment.rb +261 -0
- data/lib/shipeasy_admin/models/get_experiment_timeseries_response_series_inner.rb +278 -0
- data/lib/shipeasy_admin/models/get_killswitch_response.rb +270 -0
- data/lib/shipeasy_admin/models/get_metric_response.rb +378 -0
- data/lib/shipeasy_admin/models/get_ops_item_response.rb +349 -0
- data/lib/shipeasy_admin/models/link_pr_to_ops_item_request.rb +186 -0
- data/lib/shipeasy_admin/models/link_pr_to_ops_item_response.rb +166 -0
- data/lib/shipeasy_admin/models/list_alert_rules_response_inner.rb +478 -0
- data/lib/shipeasy_admin/models/list_alert_rules_response_inner_notify.rb +177 -0
- data/lib/shipeasy_admin/models/list_alert_rules_response_inner_notify_slack_channel.rb +211 -0
- data/lib/shipeasy_admin/models/list_attributes_response_inner.rb +176 -0
- data/lib/shipeasy_admin/models/list_config_activity_response_inner.rb +280 -0
- data/lib/shipeasy_admin/models/list_configs_response.rb +178 -0
- data/lib/shipeasy_admin/models/list_configs_response_data_inner.rb +351 -0
- data/lib/shipeasy_admin/models/list_configs_response_data_inner_drafts_value.rb +237 -0
- data/lib/shipeasy_admin/models/list_configs_response_data_inner_envs_value.rb +237 -0
- data/lib/shipeasy_admin/models/list_events_response_inner.rb +344 -0
- data/lib/shipeasy_admin/models/list_events_response_inner_properties_inner.rb +289 -0
- data/lib/shipeasy_admin/models/list_experiments_response.rb +178 -0
- data/lib/shipeasy_admin/models/list_experiments_response_data_inner.rb +688 -0
- data/lib/shipeasy_admin/models/list_experiments_response_data_inner_groups_inner.rb +258 -0
- data/lib/shipeasy_admin/models/list_gates_response.rb +178 -0
- data/lib/shipeasy_admin/models/list_gates_response_data_inner.rb +395 -0
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_enabled.rb +104 -0
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_rules_inner.rb +238 -0
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner.rb +105 -0
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of.rb +375 -0
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of1.rb +331 -0
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of_ramp.rb +319 -0
- data/lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb +272 -0
- data/lib/shipeasy_admin/models/list_i18n_keys_response.rb +195 -0
- data/lib/shipeasy_admin/models/list_i18n_keys_response_keys_inner.rb +284 -0
- data/lib/shipeasy_admin/models/list_i18n_profiles_response_inner.rb +224 -0
- data/lib/shipeasy_admin/models/list_killswitches_response.rb +178 -0
- data/lib/shipeasy_admin/models/list_killswitches_response_data_inner.rb +270 -0
- data/lib/shipeasy_admin/models/list_killswitches_response_data_inner_envs_value.rb +248 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner.rb +378 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir.rb +295 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg.rb +113 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of.rb +188 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of1.rb +188 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of2.rb +188 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of3.rb +188 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of4.rb +188 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of5.rb +188 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of6.rb +188 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of7.rb +217 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of8.rb +233 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9.rb +240 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator.rb +266 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator_filters_inner.rb +264 -0
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_group_by.rb +228 -0
- data/lib/shipeasy_admin/models/list_ops_items_response_inner.rb +349 -0
- data/lib/shipeasy_admin/models/list_slack_channels_response.rb +195 -0
- data/lib/shipeasy_admin/models/list_slack_channels_response_channels_inner.rb +203 -0
- data/lib/shipeasy_admin/models/list_universes_response.rb +178 -0
- data/lib/shipeasy_admin/models/list_universes_response_data_inner.rb +305 -0
- data/lib/shipeasy_admin/models/notify_ops_request.rb +261 -0
- data/lib/shipeasy_admin/models/notify_ops_response.rb +193 -0
- data/lib/shipeasy_admin/models/publish_config_draft_request.rb +190 -0
- data/lib/shipeasy_admin/models/publish_config_draft_response.rb +260 -0
- data/lib/shipeasy_admin/models/publish_i18n_profile_request.rb +149 -0
- data/lib/shipeasy_admin/models/publish_i18n_profile_response.rb +404 -0
- data/lib/shipeasy_admin/models/push_i18n_keys_request.rb +205 -0
- data/lib/shipeasy_admin/models/push_i18n_keys_request_keys_inner.rb +192 -0
- data/lib/shipeasy_admin/models/push_i18n_keys_response.rb +261 -0
- data/lib/shipeasy_admin/models/reanalyze_experiment_response.rb +214 -0
- data/lib/shipeasy_admin/models/save_config_draft_request.rb +202 -0
- data/lib/shipeasy_admin/models/save_config_draft_response.rb +286 -0
- data/lib/shipeasy_admin/models/set_experiment_metrics_request.rb +168 -0
- data/lib/shipeasy_admin/models/set_experiment_metrics_request_metrics_inner.rb +216 -0
- data/lib/shipeasy_admin/models/set_experiment_metrics_response.rb +179 -0
- data/lib/shipeasy_admin/models/set_experiment_metrics_response_metrics_inner.rb +201 -0
- data/lib/shipeasy_admin/models/set_experiment_status_request.rb +190 -0
- data/lib/shipeasy_admin/models/set_experiment_status_response.rb +214 -0
- data/lib/shipeasy_admin/models/set_killswitch_switch_request.rb +264 -0
- data/lib/shipeasy_admin/models/set_killswitch_switch_response.rb +288 -0
- data/lib/shipeasy_admin/models/unset_killswitch_switch_request.rb +237 -0
- data/lib/shipeasy_admin/models/unset_killswitch_switch_response.rb +289 -0
- data/lib/shipeasy_admin/models/update_alert_rule_request.rb +306 -0
- data/lib/shipeasy_admin/models/update_alert_rule_response.rb +165 -0
- data/lib/shipeasy_admin/models/update_config_request.rb +198 -0
- data/lib/shipeasy_admin/models/update_config_response.rb +165 -0
- data/lib/shipeasy_admin/models/update_event_request.rb +198 -0
- data/lib/shipeasy_admin/models/update_event_response.rb +166 -0
- data/lib/shipeasy_admin/models/update_experiment_request.rb +746 -0
- data/lib/shipeasy_admin/models/update_experiment_response.rb +165 -0
- data/lib/shipeasy_admin/models/update_gate_request.rb +403 -0
- data/lib/shipeasy_admin/models/update_gate_response.rb +166 -0
- data/lib/shipeasy_admin/models/update_i18n_key_request.rb +176 -0
- data/lib/shipeasy_admin/models/update_i18n_key_response.rb +166 -0
- data/lib/shipeasy_admin/models/update_killswitch_request.rb +224 -0
- data/lib/shipeasy_admin/models/update_killswitch_response.rb +165 -0
- data/lib/shipeasy_admin/models/update_ops_item_request.rb +205 -0
- data/lib/shipeasy_admin/models/update_ops_item_response.rb +166 -0
- data/lib/shipeasy_admin/models/update_universe_request.rb +213 -0
- data/lib/shipeasy_admin/models/update_universe_response.rb +165 -0
- data/lib/shipeasy_admin/models/upsert_project_request.rb +222 -0
- data/lib/shipeasy_admin/models/upsert_project_response.rb +260 -0
- data/lib/shipeasy_admin/version.rb +15 -0
- data/lib/shipeasy_admin.rb +196 -0
- metadata +230 -2
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Shipeasy Admin API
|
|
3
|
+
|
|
4
|
+
#REST API for managing feature gates, experiments, configs, universes, and killswitches in a Shipeasy project. Authenticate with an admin SDK key (`Authorization: Bearer sdk_admin_…`) and scope every request to a project via the `X-Project-Id` header. Mint admin keys via `POST /api/admin/keys` with `type: \"admin\"`. Keys expire after 90 days; rotate with the `revoke` action.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.23.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Shipeasy::Admin::Generated
|
|
16
|
+
class EventsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Approve a pending event
|
|
23
|
+
# Promotes a pending (auto-discovered) event to usable so metrics can query it (`pending` → `0`). You may optionally declare the event's folder, description, or properties in the same call — the body is the same shape as update, and may be empty. **Use case:** Clear an auto-discovered event out of the pending queue so metrics defined on it start resolving.
|
|
24
|
+
# @param id [String] Stable opaque event id (`evt_…`) or the event's `name`.
|
|
25
|
+
# @param approve_event_request [ApproveEventRequest]
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
28
|
+
# @return [ApproveEventResponse]
|
|
29
|
+
def approve_event(id, approve_event_request, opts = {})
|
|
30
|
+
data, _status_code, _headers = approve_event_with_http_info(id, approve_event_request, opts)
|
|
31
|
+
data
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Approve a pending event
|
|
35
|
+
# Promotes a pending (auto-discovered) event to usable so metrics can query it (`pending` → `0`). You may optionally declare the event's folder, description, or properties in the same call — the body is the same shape as update, and may be empty. **Use case:** Clear an auto-discovered event out of the pending queue so metrics defined on it start resolving.
|
|
36
|
+
# @param id [String] Stable opaque event id (`evt_…`) or the event's `name`.
|
|
37
|
+
# @param approve_event_request [ApproveEventRequest]
|
|
38
|
+
# @param [Hash] opts the optional parameters
|
|
39
|
+
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
40
|
+
# @return [Array<(ApproveEventResponse, Integer, Hash)>] ApproveEventResponse data, response status code and response headers
|
|
41
|
+
def approve_event_with_http_info(id, approve_event_request, opts = {})
|
|
42
|
+
if @api_client.config.debugging
|
|
43
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.approve_event ...'
|
|
44
|
+
end
|
|
45
|
+
# verify the required parameter 'id' is set
|
|
46
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
47
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling EventsApi.approve_event"
|
|
48
|
+
end
|
|
49
|
+
# verify the required parameter 'approve_event_request' is set
|
|
50
|
+
if @api_client.config.client_side_validation && approve_event_request.nil?
|
|
51
|
+
fail ArgumentError, "Missing the required parameter 'approve_event_request' when calling EventsApi.approve_event"
|
|
52
|
+
end
|
|
53
|
+
# resource path
|
|
54
|
+
local_var_path = '/api/admin/events/{id}/approve'.sub('{id}', CGI.escape(id.to_s))
|
|
55
|
+
|
|
56
|
+
# query parameters
|
|
57
|
+
query_params = opts[:query_params] || {}
|
|
58
|
+
|
|
59
|
+
# header parameters
|
|
60
|
+
header_params = opts[:header_params] || {}
|
|
61
|
+
# HTTP header 'Accept' (if needed)
|
|
62
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
63
|
+
# HTTP header 'Content-Type'
|
|
64
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
65
|
+
if !content_type.nil?
|
|
66
|
+
header_params['Content-Type'] = content_type
|
|
67
|
+
end
|
|
68
|
+
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
69
|
+
|
|
70
|
+
# form parameters
|
|
71
|
+
form_params = opts[:form_params] || {}
|
|
72
|
+
|
|
73
|
+
# http body (model)
|
|
74
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(approve_event_request)
|
|
75
|
+
|
|
76
|
+
# return_type
|
|
77
|
+
return_type = opts[:debug_return_type] || 'ApproveEventResponse'
|
|
78
|
+
|
|
79
|
+
# auth_names
|
|
80
|
+
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
81
|
+
|
|
82
|
+
new_options = opts.merge(
|
|
83
|
+
:operation => :"EventsApi.approve_event",
|
|
84
|
+
:header_params => header_params,
|
|
85
|
+
:query_params => query_params,
|
|
86
|
+
:form_params => form_params,
|
|
87
|
+
:body => post_body,
|
|
88
|
+
:auth_names => auth_names,
|
|
89
|
+
:return_type => return_type
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
93
|
+
if @api_client.config.debugging
|
|
94
|
+
@api_client.config.logger.debug "API called: EventsApi#approve_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
95
|
+
end
|
|
96
|
+
return data, status_code, headers
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Register an event
|
|
100
|
+
# Registers a new event name and (optionally) its typed properties. Only `name` is required. If the name matches an existing **pending** (auto-discovered) row, this approves that row instead of returning a conflict. Otherwise an already-registered name returns `409`. **Use cases** - **Register a known event** — `{ \"name\": \"checkout_completed\" }` so metrics can reference it. - **Declare typed properties** — supply `properties` to document the event's payload shape.
|
|
101
|
+
# @param create_event_request [CreateEventRequest]
|
|
102
|
+
# @param [Hash] opts the optional parameters
|
|
103
|
+
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
104
|
+
# @return [CreateEventResponse]
|
|
105
|
+
def create_event(create_event_request, opts = {})
|
|
106
|
+
data, _status_code, _headers = create_event_with_http_info(create_event_request, opts)
|
|
107
|
+
data
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Register an event
|
|
111
|
+
# Registers a new event name and (optionally) its typed properties. Only `name` is required. If the name matches an existing **pending** (auto-discovered) row, this approves that row instead of returning a conflict. Otherwise an already-registered name returns `409`. **Use cases** - **Register a known event** — `{ \"name\": \"checkout_completed\" }` so metrics can reference it. - **Declare typed properties** — supply `properties` to document the event's payload shape.
|
|
112
|
+
# @param create_event_request [CreateEventRequest]
|
|
113
|
+
# @param [Hash] opts the optional parameters
|
|
114
|
+
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
115
|
+
# @return [Array<(CreateEventResponse, Integer, Hash)>] CreateEventResponse data, response status code and response headers
|
|
116
|
+
def create_event_with_http_info(create_event_request, opts = {})
|
|
117
|
+
if @api_client.config.debugging
|
|
118
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.create_event ...'
|
|
119
|
+
end
|
|
120
|
+
# verify the required parameter 'create_event_request' is set
|
|
121
|
+
if @api_client.config.client_side_validation && create_event_request.nil?
|
|
122
|
+
fail ArgumentError, "Missing the required parameter 'create_event_request' when calling EventsApi.create_event"
|
|
123
|
+
end
|
|
124
|
+
# resource path
|
|
125
|
+
local_var_path = '/api/admin/events'
|
|
126
|
+
|
|
127
|
+
# query parameters
|
|
128
|
+
query_params = opts[:query_params] || {}
|
|
129
|
+
|
|
130
|
+
# header parameters
|
|
131
|
+
header_params = opts[:header_params] || {}
|
|
132
|
+
# HTTP header 'Accept' (if needed)
|
|
133
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
134
|
+
# HTTP header 'Content-Type'
|
|
135
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
136
|
+
if !content_type.nil?
|
|
137
|
+
header_params['Content-Type'] = content_type
|
|
138
|
+
end
|
|
139
|
+
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
140
|
+
|
|
141
|
+
# form parameters
|
|
142
|
+
form_params = opts[:form_params] || {}
|
|
143
|
+
|
|
144
|
+
# http body (model)
|
|
145
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_event_request)
|
|
146
|
+
|
|
147
|
+
# return_type
|
|
148
|
+
return_type = opts[:debug_return_type] || 'CreateEventResponse'
|
|
149
|
+
|
|
150
|
+
# auth_names
|
|
151
|
+
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
152
|
+
|
|
153
|
+
new_options = opts.merge(
|
|
154
|
+
:operation => :"EventsApi.create_event",
|
|
155
|
+
:header_params => header_params,
|
|
156
|
+
:query_params => query_params,
|
|
157
|
+
:form_params => form_params,
|
|
158
|
+
:body => post_body,
|
|
159
|
+
:auth_names => auth_names,
|
|
160
|
+
:return_type => return_type
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
164
|
+
if @api_client.config.debugging
|
|
165
|
+
@api_client.config.logger.debug "API called: EventsApi#create_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
166
|
+
end
|
|
167
|
+
return data, status_code, headers
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Archive an event
|
|
171
|
+
# Soft-deletes (archives) the event. Returns `409` if any metric still references it — delete those metrics first. **Use case:** Retire an event from the catalog once no metric depends on it.
|
|
172
|
+
# @param id [String] Stable opaque event id (`evt_…`) or the event's `name`.
|
|
173
|
+
# @param [Hash] opts the optional parameters
|
|
174
|
+
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
175
|
+
# @return [DeleteEventResponse]
|
|
176
|
+
def delete_event(id, opts = {})
|
|
177
|
+
data, _status_code, _headers = delete_event_with_http_info(id, opts)
|
|
178
|
+
data
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Archive an event
|
|
182
|
+
# Soft-deletes (archives) the event. Returns `409` if any metric still references it — delete those metrics first. **Use case:** Retire an event from the catalog once no metric depends on it.
|
|
183
|
+
# @param id [String] Stable opaque event id (`evt_…`) or the event's `name`.
|
|
184
|
+
# @param [Hash] opts the optional parameters
|
|
185
|
+
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
186
|
+
# @return [Array<(DeleteEventResponse, Integer, Hash)>] DeleteEventResponse data, response status code and response headers
|
|
187
|
+
def delete_event_with_http_info(id, opts = {})
|
|
188
|
+
if @api_client.config.debugging
|
|
189
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.delete_event ...'
|
|
190
|
+
end
|
|
191
|
+
# verify the required parameter 'id' is set
|
|
192
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
193
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling EventsApi.delete_event"
|
|
194
|
+
end
|
|
195
|
+
# resource path
|
|
196
|
+
local_var_path = '/api/admin/events/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
197
|
+
|
|
198
|
+
# query parameters
|
|
199
|
+
query_params = opts[:query_params] || {}
|
|
200
|
+
|
|
201
|
+
# header parameters
|
|
202
|
+
header_params = opts[:header_params] || {}
|
|
203
|
+
# HTTP header 'Accept' (if needed)
|
|
204
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
205
|
+
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
206
|
+
|
|
207
|
+
# form parameters
|
|
208
|
+
form_params = opts[:form_params] || {}
|
|
209
|
+
|
|
210
|
+
# http body (model)
|
|
211
|
+
post_body = opts[:debug_body]
|
|
212
|
+
|
|
213
|
+
# return_type
|
|
214
|
+
return_type = opts[:debug_return_type] || 'DeleteEventResponse'
|
|
215
|
+
|
|
216
|
+
# auth_names
|
|
217
|
+
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
218
|
+
|
|
219
|
+
new_options = opts.merge(
|
|
220
|
+
:operation => :"EventsApi.delete_event",
|
|
221
|
+
:header_params => header_params,
|
|
222
|
+
:query_params => query_params,
|
|
223
|
+
:form_params => form_params,
|
|
224
|
+
:body => post_body,
|
|
225
|
+
:auth_names => auth_names,
|
|
226
|
+
:return_type => return_type
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
230
|
+
if @api_client.config.debugging
|
|
231
|
+
@api_client.config.logger.debug "API called: EventsApi#delete_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
232
|
+
end
|
|
233
|
+
return data, status_code, headers
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
# Get an event
|
|
237
|
+
# Returns one event's full detail. Resolves by exact id, unique id-prefix, or exact (unique) name. **Use case:** Inspect one event's declared properties and pending state by id or name.
|
|
238
|
+
# @param id [String] Stable opaque event id (`evt_…`) or the event's `name`.
|
|
239
|
+
# @param [Hash] opts the optional parameters
|
|
240
|
+
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
241
|
+
# @return [GetEventResponse]
|
|
242
|
+
def get_event(id, opts = {})
|
|
243
|
+
data, _status_code, _headers = get_event_with_http_info(id, opts)
|
|
244
|
+
data
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# Get an event
|
|
248
|
+
# Returns one event's full detail. Resolves by exact id, unique id-prefix, or exact (unique) name. **Use case:** Inspect one event's declared properties and pending state by id or name.
|
|
249
|
+
# @param id [String] Stable opaque event id (`evt_…`) or the event's `name`.
|
|
250
|
+
# @param [Hash] opts the optional parameters
|
|
251
|
+
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
252
|
+
# @return [Array<(GetEventResponse, Integer, Hash)>] GetEventResponse data, response status code and response headers
|
|
253
|
+
def get_event_with_http_info(id, opts = {})
|
|
254
|
+
if @api_client.config.debugging
|
|
255
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.get_event ...'
|
|
256
|
+
end
|
|
257
|
+
# resource path
|
|
258
|
+
local_var_path = '/api/admin/events/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
259
|
+
|
|
260
|
+
# query parameters
|
|
261
|
+
query_params = opts[:query_params] || {}
|
|
262
|
+
|
|
263
|
+
# header parameters
|
|
264
|
+
header_params = opts[:header_params] || {}
|
|
265
|
+
# HTTP header 'Accept' (if needed)
|
|
266
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
267
|
+
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
268
|
+
|
|
269
|
+
# form parameters
|
|
270
|
+
form_params = opts[:form_params] || {}
|
|
271
|
+
|
|
272
|
+
# http body (model)
|
|
273
|
+
post_body = opts[:debug_body]
|
|
274
|
+
|
|
275
|
+
# return_type
|
|
276
|
+
return_type = opts[:debug_return_type] || 'GetEventResponse'
|
|
277
|
+
|
|
278
|
+
# auth_names
|
|
279
|
+
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
280
|
+
|
|
281
|
+
new_options = opts.merge(
|
|
282
|
+
:operation => :"EventsApi.get_event",
|
|
283
|
+
:header_params => header_params,
|
|
284
|
+
:query_params => query_params,
|
|
285
|
+
:form_params => form_params,
|
|
286
|
+
:body => post_body,
|
|
287
|
+
:auth_names => auth_names,
|
|
288
|
+
:return_type => return_type
|
|
289
|
+
)
|
|
290
|
+
|
|
291
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
292
|
+
if @api_client.config.debugging
|
|
293
|
+
@api_client.config.logger.debug "API called: EventsApi#get_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
294
|
+
end
|
|
295
|
+
return data, status_code, headers
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
# List events
|
|
299
|
+
# Returns every catalogued event in the project, including pending auto-discovered names. Pass `?pending=true` to return only the unapproved queue. **Use case:** Snapshot the event catalog — for example to review the `pending` auto-discovery queue (`?pending=true`) before approving names, or to confirm which events your metrics can reference.
|
|
300
|
+
# @param [Hash] opts the optional parameters
|
|
301
|
+
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
302
|
+
# @option opts [Boolean] :pending When `true`, return only pending (auto-discovered, unapproved) events. Omit to return the full catalog.
|
|
303
|
+
# @return [Array<ListEventsResponseInner>]
|
|
304
|
+
def list_events(opts = {})
|
|
305
|
+
data, _status_code, _headers = list_events_with_http_info(opts)
|
|
306
|
+
data
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
# List events
|
|
310
|
+
# Returns every catalogued event in the project, including pending auto-discovered names. Pass `?pending=true` to return only the unapproved queue. **Use case:** Snapshot the event catalog — for example to review the `pending` auto-discovery queue (`?pending=true`) before approving names, or to confirm which events your metrics can reference.
|
|
311
|
+
# @param [Hash] opts the optional parameters
|
|
312
|
+
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
313
|
+
# @option opts [Boolean] :pending When `true`, return only pending (auto-discovered, unapproved) events. Omit to return the full catalog.
|
|
314
|
+
# @return [Array<(Array<ListEventsResponseInner>, Integer, Hash)>] Array<ListEventsResponseInner> data, response status code and response headers
|
|
315
|
+
def list_events_with_http_info(opts = {})
|
|
316
|
+
if @api_client.config.debugging
|
|
317
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.list_events ...'
|
|
318
|
+
end
|
|
319
|
+
# resource path
|
|
320
|
+
local_var_path = '/api/admin/events'
|
|
321
|
+
|
|
322
|
+
# query parameters
|
|
323
|
+
query_params = opts[:query_params] || {}
|
|
324
|
+
query_params[:'pending'] = opts[:'pending'] if !opts[:'pending'].nil?
|
|
325
|
+
|
|
326
|
+
# header parameters
|
|
327
|
+
header_params = opts[:header_params] || {}
|
|
328
|
+
# HTTP header 'Accept' (if needed)
|
|
329
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
330
|
+
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
331
|
+
|
|
332
|
+
# form parameters
|
|
333
|
+
form_params = opts[:form_params] || {}
|
|
334
|
+
|
|
335
|
+
# http body (model)
|
|
336
|
+
post_body = opts[:debug_body]
|
|
337
|
+
|
|
338
|
+
# return_type
|
|
339
|
+
return_type = opts[:debug_return_type] || 'Array<ListEventsResponseInner>'
|
|
340
|
+
|
|
341
|
+
# auth_names
|
|
342
|
+
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
343
|
+
|
|
344
|
+
new_options = opts.merge(
|
|
345
|
+
:operation => :"EventsApi.list_events",
|
|
346
|
+
:header_params => header_params,
|
|
347
|
+
:query_params => query_params,
|
|
348
|
+
:form_params => form_params,
|
|
349
|
+
:body => post_body,
|
|
350
|
+
:auth_names => auth_names,
|
|
351
|
+
:return_type => return_type
|
|
352
|
+
)
|
|
353
|
+
|
|
354
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
355
|
+
if @api_client.config.debugging
|
|
356
|
+
@api_client.config.logger.debug "API called: EventsApi#list_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
357
|
+
end
|
|
358
|
+
return data, status_code, headers
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
# Update an event
|
|
362
|
+
# Partial update of an event's folder, description, or properties. `name` is immutable. `properties` replaces the full set (no merge) — omit it to leave properties unchanged. **Use case:** Refile an event, update its description, or redeclare its typed properties.
|
|
363
|
+
# @param id [String] Stable opaque event id (`evt_…`) or the event's `name`.
|
|
364
|
+
# @param update_event_request [UpdateEventRequest]
|
|
365
|
+
# @param [Hash] opts the optional parameters
|
|
366
|
+
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
367
|
+
# @return [UpdateEventResponse]
|
|
368
|
+
def update_event(id, update_event_request, opts = {})
|
|
369
|
+
data, _status_code, _headers = update_event_with_http_info(id, update_event_request, opts)
|
|
370
|
+
data
|
|
371
|
+
end
|
|
372
|
+
|
|
373
|
+
# Update an event
|
|
374
|
+
# Partial update of an event's folder, description, or properties. `name` is immutable. `properties` replaces the full set (no merge) — omit it to leave properties unchanged. **Use case:** Refile an event, update its description, or redeclare its typed properties.
|
|
375
|
+
# @param id [String] Stable opaque event id (`evt_…`) or the event's `name`.
|
|
376
|
+
# @param update_event_request [UpdateEventRequest]
|
|
377
|
+
# @param [Hash] opts the optional parameters
|
|
378
|
+
# @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
|
|
379
|
+
# @return [Array<(UpdateEventResponse, Integer, Hash)>] UpdateEventResponse data, response status code and response headers
|
|
380
|
+
def update_event_with_http_info(id, update_event_request, opts = {})
|
|
381
|
+
if @api_client.config.debugging
|
|
382
|
+
@api_client.config.logger.debug 'Calling API: EventsApi.update_event ...'
|
|
383
|
+
end
|
|
384
|
+
# verify the required parameter 'id' is set
|
|
385
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
386
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling EventsApi.update_event"
|
|
387
|
+
end
|
|
388
|
+
# verify the required parameter 'update_event_request' is set
|
|
389
|
+
if @api_client.config.client_side_validation && update_event_request.nil?
|
|
390
|
+
fail ArgumentError, "Missing the required parameter 'update_event_request' when calling EventsApi.update_event"
|
|
391
|
+
end
|
|
392
|
+
# resource path
|
|
393
|
+
local_var_path = '/api/admin/events/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
394
|
+
|
|
395
|
+
# query parameters
|
|
396
|
+
query_params = opts[:query_params] || {}
|
|
397
|
+
|
|
398
|
+
# header parameters
|
|
399
|
+
header_params = opts[:header_params] || {}
|
|
400
|
+
# HTTP header 'Accept' (if needed)
|
|
401
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
402
|
+
# HTTP header 'Content-Type'
|
|
403
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
404
|
+
if !content_type.nil?
|
|
405
|
+
header_params['Content-Type'] = content_type
|
|
406
|
+
end
|
|
407
|
+
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
408
|
+
|
|
409
|
+
# form parameters
|
|
410
|
+
form_params = opts[:form_params] || {}
|
|
411
|
+
|
|
412
|
+
# http body (model)
|
|
413
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_event_request)
|
|
414
|
+
|
|
415
|
+
# return_type
|
|
416
|
+
return_type = opts[:debug_return_type] || 'UpdateEventResponse'
|
|
417
|
+
|
|
418
|
+
# auth_names
|
|
419
|
+
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
420
|
+
|
|
421
|
+
new_options = opts.merge(
|
|
422
|
+
:operation => :"EventsApi.update_event",
|
|
423
|
+
:header_params => header_params,
|
|
424
|
+
:query_params => query_params,
|
|
425
|
+
:form_params => form_params,
|
|
426
|
+
:body => post_body,
|
|
427
|
+
:auth_names => auth_names,
|
|
428
|
+
:return_type => return_type
|
|
429
|
+
)
|
|
430
|
+
|
|
431
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
432
|
+
if @api_client.config.debugging
|
|
433
|
+
@api_client.config.logger.debug "API called: EventsApi#update_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
434
|
+
end
|
|
435
|
+
return data, status_code, headers
|
|
436
|
+
end
|
|
437
|
+
end
|
|
438
|
+
end
|