shipeasy-sdk 2.1.0 → 2.3.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.
- 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 +91 -0
- data/lib/shipeasy/sdk/version.rb +1 -1
- data/lib/shipeasy_admin/api/alerts_api.rb +352 -0
- data/lib/shipeasy_admin/api/api_keys_api.rb +229 -0
- data/lib/shipeasy_admin/api/attributes_api.rb +82 -0
- data/lib/shipeasy_admin/api/configs_api.rb +757 -0
- data/lib/shipeasy_admin/api/connectors_api.rb +497 -0
- data/lib/shipeasy_admin/api/drafts_api.rb +82 -0
- data/lib/shipeasy_admin/api/errors_api.rb +389 -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/flags_api.rb +438 -0
- data/lib/shipeasy_admin/api/keys_api.rb +317 -0
- data/lib/shipeasy_admin/api/killswitch_api.rb +603 -0
- data/lib/shipeasy_admin/api/metrics_api.rb +281 -0
- data/lib/shipeasy_admin/api/ops_api.rb +465 -0
- data/lib/shipeasy_admin/api/profiles_api.rb +226 -0
- data/lib/shipeasy_admin/api/projects_api.rb +216 -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/claude_trigger_config.rb +204 -0
- data/lib/shipeasy_admin/models/connector_event.rb +40 -0
- data/lib/shipeasy_admin/models/connector_provider.rb +45 -0
- data/lib/shipeasy_admin/models/connector_record.rb +468 -0
- data/lib/shipeasy_admin/models/copilot_trigger_config.rb +276 -0
- data/lib/shipeasy_admin/models/create_alert_rule_request.rb +383 -0
- data/lib/shipeasy_admin/models/create_alert_rule_response.rb +165 -0
- data/lib/shipeasy_admin/models/create_claude_trigger_request.rb +309 -0
- data/lib/shipeasy_admin/models/create_config_request.rb +291 -0
- data/lib/shipeasy_admin/models/create_config_response.rb +201 -0
- data/lib/shipeasy_admin/models/create_connector_request.rb +64 -0
- data/lib/shipeasy_admin/models/create_connector_response.rb +165 -0
- data/lib/shipeasy_admin/models/create_copilot_trigger_request.rb +316 -0
- data/lib/shipeasy_admin/models/create_cursor_trigger_request.rb +352 -0
- data/lib/shipeasy_admin/models/create_event_request.rb +236 -0
- data/lib/shipeasy_admin/models/create_event_response.rb +193 -0
- data/lib/shipeasy_admin/models/create_experiment_request.rb +807 -0
- data/lib/shipeasy_admin/models/create_experiment_response.rb +212 -0
- data/lib/shipeasy_admin/models/create_gate_request.rb +492 -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_jules_trigger_request.rb +352 -0
- data/lib/shipeasy_admin/models/create_key_request.rb +297 -0
- data/lib/shipeasy_admin/models/create_key_response.rb +286 -0
- data/lib/shipeasy_admin/models/create_killswitch_request.rb +274 -0
- data/lib/shipeasy_admin/models/create_killswitch_response.rb +201 -0
- data/lib/shipeasy_admin/models/create_metric_request.rb +403 -0
- data/lib/shipeasy_admin/models/create_metric_response.rb +193 -0
- data/lib/shipeasy_admin/models/create_o_auth_connector_request.rb +273 -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 +272 -0
- data/lib/shipeasy_admin/models/create_universe_response.rb +212 -0
- data/lib/shipeasy_admin/models/cursor_trigger_config.rb +231 -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_connector_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 +187 -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/env.rb +41 -0
- data/lib/shipeasy_admin/models/error.rb +207 -0
- data/lib/shipeasy_admin/models/error_code.rb +52 -0
- data/lib/shipeasy_admin/models/error_record.rb +597 -0
- data/lib/shipeasy_admin/models/error_series_request.rb +251 -0
- data/lib/shipeasy_admin/models/error_series_response.rb +195 -0
- data/lib/shipeasy_admin/models/error_series_response_rows_inner.rb +192 -0
- data/lib/shipeasy_admin/models/experiment_inline_metric.rb +337 -0
- data/lib/shipeasy_admin/models/file_error_ticket_response.rb +193 -0
- data/lib/shipeasy_admin/models/fire_connector_request.rb +149 -0
- data/lib/shipeasy_admin/models/fire_connector_response.rb +176 -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/jules_trigger_config.rb +240 -0
- data/lib/shipeasy_admin/models/key_record.rb +353 -0
- data/lib/shipeasy_admin/models/killswitch_value.rb +178 -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_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 +259 -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 +241 -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 +358 -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_keys_response.rb +180 -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 +288 -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/notification_target.rb +159 -0
- data/lib/shipeasy_admin/models/notification_target_slack_channel.rb +208 -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 +187 -0
- data/lib/shipeasy_admin/models/publish_config_draft_response.rb +257 -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/revoke_key_response.rb +216 -0
- data/lib/shipeasy_admin/models/save_config_draft_request.rb +199 -0
- data/lib/shipeasy_admin/models/save_config_draft_response.rb +283 -0
- data/lib/shipeasy_admin/models/search_hit.rb +284 -0
- data/lib/shipeasy_admin/models/search_response.rb +167 -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_i18n_label_request.rb +213 -0
- data/lib/shipeasy_admin/models/set_i18n_label_response.rb +472 -0
- data/lib/shipeasy_admin/models/set_killswitch_switch_request.rb +261 -0
- data/lib/shipeasy_admin/models/set_killswitch_switch_response.rb +285 -0
- data/lib/shipeasy_admin/models/set_killswitch_value_request.rb +214 -0
- data/lib/shipeasy_admin/models/set_killswitch_value_response.rb +283 -0
- data/lib/shipeasy_admin/models/test_connector_response.rb +189 -0
- data/lib/shipeasy_admin/models/unset_killswitch_switch_request.rb +234 -0
- data/lib/shipeasy_admin/models/unset_killswitch_switch_response.rb +286 -0
- data/lib/shipeasy_admin/models/update_alert_rule_request.rb +304 -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_config_schema_request.rb +168 -0
- data/lib/shipeasy_admin/models/update_config_schema_response.rb +165 -0
- data/lib/shipeasy_admin/models/update_connector_request.rb +211 -0
- data/lib/shipeasy_admin/models/update_connector_response.rb +166 -0
- data/lib/shipeasy_admin/models/update_error_status_request.rb +190 -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 +747 -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 +243 -0
- metadata +277 -2
|
@@ -0,0 +1,229 @@
|
|
|
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: 2.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 APIKeysApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create an API key
|
|
23
|
+
# Mints a new API key and returns the plaintext token **once** — it is stored hashed and can never be retrieved again, so capture it on creation. Only `type` is required. `env` is **required** for `server` and `client` keys (the key is bound to one environment, which is the read-env isolation boundary); for `admin` and `ops` keys `env` is ignored and the key is pinned to `prod`. Expiry is fixed for some types: `admin` keys always get a 90-day expiry and `ops` keys a short sliding window, regardless of `expiresInDays`. Only `server`/`client` keys count toward the plan key limit. **Use cases** - **Back-end key** — `{ \"type\": \"server\", \"env\": \"prod\" }` for the production server SDK. - **Public browser key** — `{ \"type\": \"client\", \"env\": \"prod\", \"name\": \"marketing site\" }` to embed in the browser SDK. - **Scoped, expiring key** — `{ \"type\": \"server\", \"env\": \"staging\", \"scopes\": [\"gates:evaluate\"], \"expiresInDays\": 30 }` for a time-boxed integration.
|
|
24
|
+
# @param create_key_request [CreateKeyRequest]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @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).
|
|
27
|
+
# @return [CreateKeyResponse]
|
|
28
|
+
def create_key(create_key_request, opts = {})
|
|
29
|
+
data, _status_code, _headers = create_key_with_http_info(create_key_request, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Create an API key
|
|
34
|
+
# Mints a new API key and returns the plaintext token **once** — it is stored hashed and can never be retrieved again, so capture it on creation. Only `type` is required. `env` is **required** for `server` and `client` keys (the key is bound to one environment, which is the read-env isolation boundary); for `admin` and `ops` keys `env` is ignored and the key is pinned to `prod`. Expiry is fixed for some types: `admin` keys always get a 90-day expiry and `ops` keys a short sliding window, regardless of `expiresInDays`. Only `server`/`client` keys count toward the plan key limit. **Use cases** - **Back-end key** — `{ \"type\": \"server\", \"env\": \"prod\" }` for the production server SDK. - **Public browser key** — `{ \"type\": \"client\", \"env\": \"prod\", \"name\": \"marketing site\" }` to embed in the browser SDK. - **Scoped, expiring key** — `{ \"type\": \"server\", \"env\": \"staging\", \"scopes\": [\"gates:evaluate\"], \"expiresInDays\": 30 }` for a time-boxed integration.
|
|
35
|
+
# @param create_key_request [CreateKeyRequest]
|
|
36
|
+
# @param [Hash] opts the optional parameters
|
|
37
|
+
# @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).
|
|
38
|
+
# @return [Array<(CreateKeyResponse, Integer, Hash)>] CreateKeyResponse data, response status code and response headers
|
|
39
|
+
def create_key_with_http_info(create_key_request, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: APIKeysApi.create_key ...'
|
|
42
|
+
end
|
|
43
|
+
# verify the required parameter 'create_key_request' is set
|
|
44
|
+
if @api_client.config.client_side_validation && create_key_request.nil?
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'create_key_request' when calling APIKeysApi.create_key"
|
|
46
|
+
end
|
|
47
|
+
# resource path
|
|
48
|
+
local_var_path = '/api/admin/keys'
|
|
49
|
+
|
|
50
|
+
# query parameters
|
|
51
|
+
query_params = opts[:query_params] || {}
|
|
52
|
+
|
|
53
|
+
# header parameters
|
|
54
|
+
header_params = opts[:header_params] || {}
|
|
55
|
+
# HTTP header 'Accept' (if needed)
|
|
56
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
57
|
+
# HTTP header 'Content-Type'
|
|
58
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
59
|
+
if !content_type.nil?
|
|
60
|
+
header_params['Content-Type'] = content_type
|
|
61
|
+
end
|
|
62
|
+
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
63
|
+
|
|
64
|
+
# form parameters
|
|
65
|
+
form_params = opts[:form_params] || {}
|
|
66
|
+
|
|
67
|
+
# http body (model)
|
|
68
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_key_request)
|
|
69
|
+
|
|
70
|
+
# return_type
|
|
71
|
+
return_type = opts[:debug_return_type] || 'CreateKeyResponse'
|
|
72
|
+
|
|
73
|
+
# auth_names
|
|
74
|
+
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
75
|
+
|
|
76
|
+
new_options = opts.merge(
|
|
77
|
+
:operation => :"APIKeysApi.create_key",
|
|
78
|
+
:header_params => header_params,
|
|
79
|
+
:query_params => query_params,
|
|
80
|
+
:form_params => form_params,
|
|
81
|
+
:body => post_body,
|
|
82
|
+
:auth_names => auth_names,
|
|
83
|
+
:return_type => return_type
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
87
|
+
if @api_client.config.debugging
|
|
88
|
+
@api_client.config.logger.debug "API called: APIKeysApi#create_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
89
|
+
end
|
|
90
|
+
return data, status_code, headers
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# List API keys
|
|
94
|
+
# Returns a single page of the project's API keys ordered by `created_at desc, id desc`, in the standard `{ data, next_cursor }` envelope. Use the `cursor` query parameter to paginate. Response fields are **snake_case** (`created_at`, `revoked_at`, `created_by_email`, `last4`). The raw token is never returned — only its `last4` tail, so a held key can be matched against the masked row. Revoked keys are included (with a non-null `revoked_at`). **Use case:** Audit which keys exist for a project — surface stale or never-expiring keys, or drive a CI check that asserts no `client` key is still active in `prod` after a rotation.
|
|
95
|
+
# @param [Hash] opts the optional parameters
|
|
96
|
+
# @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).
|
|
97
|
+
# @option opts [Integer] :limit Page size (1–500). Defaults to 100. (default to 100)
|
|
98
|
+
# @option opts [String] :cursor Opaque cursor returned in the previous page's `next_cursor`. Omit for the first page.
|
|
99
|
+
# @return [ListKeysResponse]
|
|
100
|
+
def list_keys(opts = {})
|
|
101
|
+
data, _status_code, _headers = list_keys_with_http_info(opts)
|
|
102
|
+
data
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# List API keys
|
|
106
|
+
# Returns a single page of the project's API keys ordered by `created_at desc, id desc`, in the standard `{ data, next_cursor }` envelope. Use the `cursor` query parameter to paginate. Response fields are **snake_case** (`created_at`, `revoked_at`, `created_by_email`, `last4`). The raw token is never returned — only its `last4` tail, so a held key can be matched against the masked row. Revoked keys are included (with a non-null `revoked_at`). **Use case:** Audit which keys exist for a project — surface stale or never-expiring keys, or drive a CI check that asserts no `client` key is still active in `prod` after a rotation.
|
|
107
|
+
# @param [Hash] opts the optional parameters
|
|
108
|
+
# @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).
|
|
109
|
+
# @option opts [Integer] :limit Page size (1–500). Defaults to 100. (default to 100)
|
|
110
|
+
# @option opts [String] :cursor Opaque cursor returned in the previous page's `next_cursor`. Omit for the first page.
|
|
111
|
+
# @return [Array<(ListKeysResponse, Integer, Hash)>] ListKeysResponse data, response status code and response headers
|
|
112
|
+
def list_keys_with_http_info(opts = {})
|
|
113
|
+
if @api_client.config.debugging
|
|
114
|
+
@api_client.config.logger.debug 'Calling API: APIKeysApi.list_keys ...'
|
|
115
|
+
end
|
|
116
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
|
|
117
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling APIKeysApi.list_keys, must be smaller than or equal to 500.'
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
121
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling APIKeysApi.list_keys, must be greater than or equal to 1.'
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# resource path
|
|
125
|
+
local_var_path = '/api/admin/keys'
|
|
126
|
+
|
|
127
|
+
# query parameters
|
|
128
|
+
query_params = opts[:query_params] || {}
|
|
129
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
130
|
+
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
|
131
|
+
|
|
132
|
+
# header parameters
|
|
133
|
+
header_params = opts[:header_params] || {}
|
|
134
|
+
# HTTP header 'Accept' (if needed)
|
|
135
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
136
|
+
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
137
|
+
|
|
138
|
+
# form parameters
|
|
139
|
+
form_params = opts[:form_params] || {}
|
|
140
|
+
|
|
141
|
+
# http body (model)
|
|
142
|
+
post_body = opts[:debug_body]
|
|
143
|
+
|
|
144
|
+
# return_type
|
|
145
|
+
return_type = opts[:debug_return_type] || 'ListKeysResponse'
|
|
146
|
+
|
|
147
|
+
# auth_names
|
|
148
|
+
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
149
|
+
|
|
150
|
+
new_options = opts.merge(
|
|
151
|
+
:operation => :"APIKeysApi.list_keys",
|
|
152
|
+
:header_params => header_params,
|
|
153
|
+
:query_params => query_params,
|
|
154
|
+
:form_params => form_params,
|
|
155
|
+
:body => post_body,
|
|
156
|
+
:auth_names => auth_names,
|
|
157
|
+
:return_type => return_type
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
161
|
+
if @api_client.config.debugging
|
|
162
|
+
@api_client.config.logger.debug "API called: APIKeysApi#list_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
163
|
+
end
|
|
164
|
+
return data, status_code, headers
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Revoke an API key
|
|
168
|
+
# Revokes a key by id — stamps its `revoked_at` and deletes the hot-path KV entry so the token stops authenticating immediately. Takes no body. Idempotent: revoking an already-revoked key is a no-op and returns the same `{ id, revoked: true }`. Returns `404` if no such key exists in the project. **Use case:** Rotate a leaked or stale credential — mint the replacement, then revoke the old key.
|
|
169
|
+
# @param id [String] Stable opaque key id (UUID) returned by `create` / `list`.
|
|
170
|
+
# @param [Hash] opts the optional parameters
|
|
171
|
+
# @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).
|
|
172
|
+
# @return [RevokeKeyResponse]
|
|
173
|
+
def revoke_key(id, opts = {})
|
|
174
|
+
data, _status_code, _headers = revoke_key_with_http_info(id, opts)
|
|
175
|
+
data
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Revoke an API key
|
|
179
|
+
# Revokes a key by id — stamps its `revoked_at` and deletes the hot-path KV entry so the token stops authenticating immediately. Takes no body. Idempotent: revoking an already-revoked key is a no-op and returns the same `{ id, revoked: true }`. Returns `404` if no such key exists in the project. **Use case:** Rotate a leaked or stale credential — mint the replacement, then revoke the old key.
|
|
180
|
+
# @param id [String] Stable opaque key id (UUID) returned by `create` / `list`.
|
|
181
|
+
# @param [Hash] opts the optional parameters
|
|
182
|
+
# @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).
|
|
183
|
+
# @return [Array<(RevokeKeyResponse, Integer, Hash)>] RevokeKeyResponse data, response status code and response headers
|
|
184
|
+
def revoke_key_with_http_info(id, opts = {})
|
|
185
|
+
if @api_client.config.debugging
|
|
186
|
+
@api_client.config.logger.debug 'Calling API: APIKeysApi.revoke_key ...'
|
|
187
|
+
end
|
|
188
|
+
# resource path
|
|
189
|
+
local_var_path = '/api/admin/keys/{id}/revoke'.sub('{id}', CGI.escape(id.to_s))
|
|
190
|
+
|
|
191
|
+
# query parameters
|
|
192
|
+
query_params = opts[:query_params] || {}
|
|
193
|
+
|
|
194
|
+
# header parameters
|
|
195
|
+
header_params = opts[:header_params] || {}
|
|
196
|
+
# HTTP header 'Accept' (if needed)
|
|
197
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
198
|
+
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
199
|
+
|
|
200
|
+
# form parameters
|
|
201
|
+
form_params = opts[:form_params] || {}
|
|
202
|
+
|
|
203
|
+
# http body (model)
|
|
204
|
+
post_body = opts[:debug_body]
|
|
205
|
+
|
|
206
|
+
# return_type
|
|
207
|
+
return_type = opts[:debug_return_type] || 'RevokeKeyResponse'
|
|
208
|
+
|
|
209
|
+
# auth_names
|
|
210
|
+
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
211
|
+
|
|
212
|
+
new_options = opts.merge(
|
|
213
|
+
:operation => :"APIKeysApi.revoke_key",
|
|
214
|
+
:header_params => header_params,
|
|
215
|
+
:query_params => query_params,
|
|
216
|
+
:form_params => form_params,
|
|
217
|
+
:body => post_body,
|
|
218
|
+
:auth_names => auth_names,
|
|
219
|
+
:return_type => return_type
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
223
|
+
if @api_client.config.debugging
|
|
224
|
+
@api_client.config.logger.debug "API called: APIKeysApi#revoke_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
225
|
+
end
|
|
226
|
+
return data, status_code, headers
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
end
|
|
@@ -0,0 +1,82 @@
|
|
|
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: 2.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 AttributesApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# List targeting attributes
|
|
23
|
+
# Returns every auto-inferred targeting attribute in the project — the `name` and (when known) the value `type` — for building gate/experiment targeting rules. **Use case:** Discover which user-context keys are available before authoring a targeting rule, instead of guessing attribute names.
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @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).
|
|
26
|
+
# @return [Array<ListAttributesResponseInner>]
|
|
27
|
+
def list_attributes(opts = {})
|
|
28
|
+
data, _status_code, _headers = list_attributes_with_http_info(opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# List targeting attributes
|
|
33
|
+
# Returns every auto-inferred targeting attribute in the project — the `name` and (when known) the value `type` — for building gate/experiment targeting rules. **Use case:** Discover which user-context keys are available before authoring a targeting rule, instead of guessing attribute names.
|
|
34
|
+
# @param [Hash] opts the optional parameters
|
|
35
|
+
# @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).
|
|
36
|
+
# @return [Array<(Array<ListAttributesResponseInner>, Integer, Hash)>] Array<ListAttributesResponseInner> data, response status code and response headers
|
|
37
|
+
def list_attributes_with_http_info(opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: AttributesApi.list_attributes ...'
|
|
40
|
+
end
|
|
41
|
+
# resource path
|
|
42
|
+
local_var_path = '/api/admin/attributes'
|
|
43
|
+
|
|
44
|
+
# query parameters
|
|
45
|
+
query_params = opts[:query_params] || {}
|
|
46
|
+
|
|
47
|
+
# header parameters
|
|
48
|
+
header_params = opts[:header_params] || {}
|
|
49
|
+
# HTTP header 'Accept' (if needed)
|
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
51
|
+
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
52
|
+
|
|
53
|
+
# form parameters
|
|
54
|
+
form_params = opts[:form_params] || {}
|
|
55
|
+
|
|
56
|
+
# http body (model)
|
|
57
|
+
post_body = opts[:debug_body]
|
|
58
|
+
|
|
59
|
+
# return_type
|
|
60
|
+
return_type = opts[:debug_return_type] || 'Array<ListAttributesResponseInner>'
|
|
61
|
+
|
|
62
|
+
# auth_names
|
|
63
|
+
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
64
|
+
|
|
65
|
+
new_options = opts.merge(
|
|
66
|
+
:operation => :"AttributesApi.list_attributes",
|
|
67
|
+
:header_params => header_params,
|
|
68
|
+
:query_params => query_params,
|
|
69
|
+
:form_params => form_params,
|
|
70
|
+
:body => post_body,
|
|
71
|
+
:auth_names => auth_names,
|
|
72
|
+
:return_type => return_type
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
76
|
+
if @api_client.config.debugging
|
|
77
|
+
@api_client.config.logger.debug "API called: AttributesApi#list_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
78
|
+
end
|
|
79
|
+
return data, status_code, headers
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|