shipeasy-sdk 3.8.0 → 4.0.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/docs/skill/SKILL.md +7 -4
- data/lib/shipeasy/admin.rb +23 -20
- data/lib/shipeasy/sdk/see.rb +7 -5
- data/lib/shipeasy/sdk/version.rb +1 -1
- data/lib/shipeasy_admin/api/flags_api.rb +127 -214
- data/lib/shipeasy_admin/api/killswitch_api.rb +25 -525
- data/lib/shipeasy_admin/api/ops_api.rb +44 -351
- data/lib/shipeasy_admin/api_client.rb +2 -2
- data/lib/shipeasy_admin/api_error.rb +2 -2
- data/lib/shipeasy_admin/api_model_base.rb +2 -2
- data/lib/shipeasy_admin/configuration.rb +29 -2
- data/lib/shipeasy_admin/models/{set_killswitch_value_request.rb → add_to_gate_whitelist_request.rb} +37 -42
- data/lib/shipeasy_admin/models/create_public_bug_request.rb +464 -0
- data/lib/shipeasy_admin/models/create_public_feature_request_request.rb +407 -0
- data/lib/shipeasy_admin/models/{file_error_ticket_response.rb → create_public_ticket_response.rb} +22 -29
- data/lib/shipeasy_admin/models/env.rb +2 -2
- data/lib/shipeasy_admin/models/error.rb +41 -7
- data/lib/shipeasy_admin/models/error_code.rb +14 -3
- data/lib/shipeasy_admin/models/{get_experiment_timeseries_response_experiment.rb → gate_whitelist.rb} +51 -42
- data/lib/shipeasy_admin/models/gate_whitelist_attr.rb +40 -0
- data/lib/shipeasy_admin/models/killswitch_value.rb +2 -2
- data/lib/shipeasy_admin/models/notification_target.rb +2 -2
- data/lib/shipeasy_admin/models/notification_target_slack_channel.rb +2 -2
- data/lib/shipeasy_admin/models/ops_item_priority.rb +42 -0
- data/lib/shipeasy_admin/models/ops_item_status.rb +46 -0
- data/lib/shipeasy_admin/models/{discard_config_draft_request.rb → remove_from_gate_whitelist_request.rb} +34 -44
- data/lib/shipeasy_admin/models/{delete_alert_rule_response.rb → set_gate_whitelist_request.rb} +37 -25
- data/lib/shipeasy_admin/models/{set_killswitch_switch_request.rb → toggle_killswitch_request.rb} +30 -72
- data/lib/shipeasy_admin/models/{set_killswitch_value_response.rb → toggle_killswitch_response.rb} +100 -6
- data/lib/shipeasy_admin/version.rb +2 -2
- data/lib/shipeasy_admin.rb +14 -195
- metadata +13 -194
- data/lib/shipeasy_admin/api/alerts_api.rb +0 -352
- data/lib/shipeasy_admin/api/api_keys_api.rb +0 -229
- data/lib/shipeasy_admin/api/attributes_api.rb +0 -82
- data/lib/shipeasy_admin/api/configs_api.rb +0 -757
- data/lib/shipeasy_admin/api/connectors_api.rb +0 -497
- data/lib/shipeasy_admin/api/drafts_api.rb +0 -82
- data/lib/shipeasy_admin/api/errors_api.rb +0 -389
- data/lib/shipeasy_admin/api/events_api.rb +0 -438
- data/lib/shipeasy_admin/api/experiments_api.rb +0 -727
- data/lib/shipeasy_admin/api/keys_api.rb +0 -317
- data/lib/shipeasy_admin/api/metrics_api.rb +0 -281
- data/lib/shipeasy_admin/api/profiles_api.rb +0 -222
- data/lib/shipeasy_admin/api/projects_api.rb +0 -216
- data/lib/shipeasy_admin/api/universes_api.rb +0 -306
- data/lib/shipeasy_admin/models/approve_event_request.rb +0 -198
- data/lib/shipeasy_admin/models/approve_event_response.rb +0 -166
- data/lib/shipeasy_admin/models/claude_trigger_config.rb +0 -204
- data/lib/shipeasy_admin/models/connector_event.rb +0 -40
- data/lib/shipeasy_admin/models/connector_provider.rb +0 -45
- data/lib/shipeasy_admin/models/connector_record.rb +0 -468
- data/lib/shipeasy_admin/models/copilot_trigger_config.rb +0 -276
- data/lib/shipeasy_admin/models/create_alert_rule_request.rb +0 -383
- data/lib/shipeasy_admin/models/create_alert_rule_response.rb +0 -165
- data/lib/shipeasy_admin/models/create_claude_trigger_request.rb +0 -309
- data/lib/shipeasy_admin/models/create_config_request.rb +0 -291
- data/lib/shipeasy_admin/models/create_config_response.rb +0 -201
- data/lib/shipeasy_admin/models/create_connector_request.rb +0 -64
- data/lib/shipeasy_admin/models/create_connector_response.rb +0 -165
- data/lib/shipeasy_admin/models/create_copilot_trigger_request.rb +0 -316
- data/lib/shipeasy_admin/models/create_cursor_trigger_request.rb +0 -352
- data/lib/shipeasy_admin/models/create_event_request.rb +0 -236
- data/lib/shipeasy_admin/models/create_event_response.rb +0 -193
- data/lib/shipeasy_admin/models/create_experiment_request.rb +0 -807
- data/lib/shipeasy_admin/models/create_experiment_response.rb +0 -212
- data/lib/shipeasy_admin/models/create_gate_request.rb +0 -492
- data/lib/shipeasy_admin/models/create_gate_response.rb +0 -212
- data/lib/shipeasy_admin/models/create_i18n_profile_request.rb +0 -188
- data/lib/shipeasy_admin/models/create_i18n_profile_response.rb +0 -193
- data/lib/shipeasy_admin/models/create_jules_trigger_request.rb +0 -352
- data/lib/shipeasy_admin/models/create_key_request.rb +0 -297
- data/lib/shipeasy_admin/models/create_key_response.rb +0 -286
- data/lib/shipeasy_admin/models/create_killswitch_request.rb +0 -274
- data/lib/shipeasy_admin/models/create_killswitch_response.rb +0 -201
- data/lib/shipeasy_admin/models/create_metric_request.rb +0 -403
- data/lib/shipeasy_admin/models/create_metric_response.rb +0 -193
- data/lib/shipeasy_admin/models/create_o_auth_connector_request.rb +0 -273
- data/lib/shipeasy_admin/models/create_ops_item_request.rb +0 -287
- data/lib/shipeasy_admin/models/create_ops_item_response.rb +0 -177
- data/lib/shipeasy_admin/models/create_universe_request.rb +0 -272
- data/lib/shipeasy_admin/models/create_universe_response.rb +0 -212
- data/lib/shipeasy_admin/models/cursor_trigger_config.rb +0 -231
- data/lib/shipeasy_admin/models/delete_config_response.rb +0 -188
- data/lib/shipeasy_admin/models/delete_connector_response.rb +0 -188
- data/lib/shipeasy_admin/models/delete_event_response.rb +0 -189
- data/lib/shipeasy_admin/models/delete_experiment_response.rb +0 -188
- data/lib/shipeasy_admin/models/delete_gate_response.rb +0 -188
- data/lib/shipeasy_admin/models/delete_killswitch_response.rb +0 -188
- data/lib/shipeasy_admin/models/delete_metric_response.rb +0 -189
- data/lib/shipeasy_admin/models/delete_universe_response.rb +0 -188
- data/lib/shipeasy_admin/models/disable_gate_response.rb +0 -190
- data/lib/shipeasy_admin/models/discard_config_draft_response.rb +0 -188
- data/lib/shipeasy_admin/models/enable_gate_response.rb +0 -190
- data/lib/shipeasy_admin/models/error_record.rb +0 -597
- data/lib/shipeasy_admin/models/error_series_request.rb +0 -251
- data/lib/shipeasy_admin/models/error_series_response.rb +0 -195
- data/lib/shipeasy_admin/models/error_series_response_rows_inner.rb +0 -192
- data/lib/shipeasy_admin/models/experiment_inline_metric.rb +0 -337
- data/lib/shipeasy_admin/models/fire_connector_request.rb +0 -149
- data/lib/shipeasy_admin/models/fire_connector_response.rb +0 -176
- data/lib/shipeasy_admin/models/get_config_response.rb +0 -351
- data/lib/shipeasy_admin/models/get_current_project_response.rb +0 -606
- data/lib/shipeasy_admin/models/get_current_project_response_module_translations.rb +0 -104
- data/lib/shipeasy_admin/models/get_event_response.rb +0 -344
- data/lib/shipeasy_admin/models/get_experiment_response.rb +0 -688
- data/lib/shipeasy_admin/models/get_experiment_results_response.rb +0 -243
- data/lib/shipeasy_admin/models/get_experiment_results_response_experiment.rb +0 -248
- data/lib/shipeasy_admin/models/get_experiment_results_response_results_inner.rb +0 -252
- data/lib/shipeasy_admin/models/get_experiment_timeseries_response.rb +0 -192
- data/lib/shipeasy_admin/models/get_experiment_timeseries_response_series_inner.rb +0 -278
- data/lib/shipeasy_admin/models/get_killswitch_response.rb +0 -270
- data/lib/shipeasy_admin/models/get_metric_response.rb +0 -378
- data/lib/shipeasy_admin/models/get_ops_item_response.rb +0 -349
- data/lib/shipeasy_admin/models/jules_trigger_config.rb +0 -240
- data/lib/shipeasy_admin/models/key_record.rb +0 -353
- data/lib/shipeasy_admin/models/link_pr_to_ops_item_request.rb +0 -186
- data/lib/shipeasy_admin/models/link_pr_to_ops_item_response.rb +0 -166
- data/lib/shipeasy_admin/models/list_alert_rules_response_inner.rb +0 -478
- data/lib/shipeasy_admin/models/list_attributes_response_inner.rb +0 -176
- data/lib/shipeasy_admin/models/list_config_activity_response_inner.rb +0 -280
- data/lib/shipeasy_admin/models/list_configs_response.rb +0 -178
- data/lib/shipeasy_admin/models/list_configs_response_data_inner.rb +0 -351
- data/lib/shipeasy_admin/models/list_configs_response_data_inner_drafts_value.rb +0 -237
- data/lib/shipeasy_admin/models/list_configs_response_data_inner_envs_value.rb +0 -237
- data/lib/shipeasy_admin/models/list_events_response_inner.rb +0 -344
- data/lib/shipeasy_admin/models/list_events_response_inner_properties_inner.rb +0 -259
- data/lib/shipeasy_admin/models/list_experiments_response.rb +0 -178
- data/lib/shipeasy_admin/models/list_experiments_response_data_inner.rb +0 -688
- data/lib/shipeasy_admin/models/list_experiments_response_data_inner_groups_inner.rb +0 -241
- data/lib/shipeasy_admin/models/list_gates_response.rb +0 -178
- data/lib/shipeasy_admin/models/list_gates_response_data_inner.rb +0 -395
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_enabled.rb +0 -104
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_rules_inner.rb +0 -238
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner.rb +0 -105
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of.rb +0 -358
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of1.rb +0 -331
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of_ramp.rb +0 -319
- data/lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb +0 -272
- data/lib/shipeasy_admin/models/list_i18n_keys_response.rb +0 -195
- data/lib/shipeasy_admin/models/list_i18n_keys_response_keys_inner.rb +0 -274
- data/lib/shipeasy_admin/models/list_i18n_profiles_response_inner.rb +0 -224
- data/lib/shipeasy_admin/models/list_keys_response.rb +0 -180
- data/lib/shipeasy_admin/models/list_killswitches_response.rb +0 -178
- data/lib/shipeasy_admin/models/list_killswitches_response_data_inner.rb +0 -270
- data/lib/shipeasy_admin/models/list_killswitches_response_data_inner_envs_value.rb +0 -248
- data/lib/shipeasy_admin/models/list_metrics_response_inner.rb +0 -378
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir.rb +0 -288
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg.rb +0 -113
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of.rb +0 -188
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of1.rb +0 -188
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of2.rb +0 -188
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of3.rb +0 -188
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of4.rb +0 -188
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of5.rb +0 -188
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of6.rb +0 -188
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of7.rb +0 -217
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of8.rb +0 -233
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9.rb +0 -240
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator.rb +0 -266
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator_filters_inner.rb +0 -264
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_group_by.rb +0 -228
- data/lib/shipeasy_admin/models/list_ops_items_response_inner.rb +0 -349
- data/lib/shipeasy_admin/models/list_slack_channels_response.rb +0 -195
- data/lib/shipeasy_admin/models/list_slack_channels_response_channels_inner.rb +0 -203
- data/lib/shipeasy_admin/models/list_universes_response.rb +0 -178
- data/lib/shipeasy_admin/models/list_universes_response_data_inner.rb +0 -305
- data/lib/shipeasy_admin/models/notify_ops_request.rb +0 -261
- data/lib/shipeasy_admin/models/notify_ops_response.rb +0 -193
- data/lib/shipeasy_admin/models/publish_config_draft_request.rb +0 -187
- data/lib/shipeasy_admin/models/publish_config_draft_response.rb +0 -257
- data/lib/shipeasy_admin/models/publish_i18n_profile_response.rb +0 -391
- data/lib/shipeasy_admin/models/push_i18n_keys_request.rb +0 -195
- data/lib/shipeasy_admin/models/push_i18n_keys_request_keys_inner.rb +0 -192
- data/lib/shipeasy_admin/models/push_i18n_keys_response.rb +0 -251
- data/lib/shipeasy_admin/models/reanalyze_experiment_response.rb +0 -214
- data/lib/shipeasy_admin/models/revoke_key_response.rb +0 -216
- data/lib/shipeasy_admin/models/save_config_draft_request.rb +0 -199
- data/lib/shipeasy_admin/models/save_config_draft_response.rb +0 -283
- data/lib/shipeasy_admin/models/search_hit.rb +0 -284
- data/lib/shipeasy_admin/models/search_response.rb +0 -167
- data/lib/shipeasy_admin/models/set_experiment_metrics_request.rb +0 -168
- data/lib/shipeasy_admin/models/set_experiment_metrics_request_metrics_inner.rb +0 -216
- data/lib/shipeasy_admin/models/set_experiment_metrics_response.rb +0 -179
- data/lib/shipeasy_admin/models/set_experiment_metrics_response_metrics_inner.rb +0 -201
- data/lib/shipeasy_admin/models/set_experiment_status_request.rb +0 -190
- data/lib/shipeasy_admin/models/set_experiment_status_response.rb +0 -214
- data/lib/shipeasy_admin/models/set_i18n_label_request.rb +0 -213
- data/lib/shipeasy_admin/models/set_i18n_label_response.rb +0 -472
- data/lib/shipeasy_admin/models/set_killswitch_switch_response.rb +0 -285
- data/lib/shipeasy_admin/models/test_connector_response.rb +0 -189
- data/lib/shipeasy_admin/models/unset_killswitch_switch_request.rb +0 -234
- data/lib/shipeasy_admin/models/unset_killswitch_switch_response.rb +0 -286
- data/lib/shipeasy_admin/models/update_alert_rule_request.rb +0 -304
- data/lib/shipeasy_admin/models/update_alert_rule_response.rb +0 -165
- data/lib/shipeasy_admin/models/update_config_request.rb +0 -198
- data/lib/shipeasy_admin/models/update_config_response.rb +0 -165
- data/lib/shipeasy_admin/models/update_config_schema_request.rb +0 -168
- data/lib/shipeasy_admin/models/update_config_schema_response.rb +0 -165
- data/lib/shipeasy_admin/models/update_connector_request.rb +0 -211
- data/lib/shipeasy_admin/models/update_connector_response.rb +0 -166
- data/lib/shipeasy_admin/models/update_error_status_request.rb +0 -190
- data/lib/shipeasy_admin/models/update_event_request.rb +0 -198
- data/lib/shipeasy_admin/models/update_event_response.rb +0 -166
- data/lib/shipeasy_admin/models/update_experiment_request.rb +0 -747
- data/lib/shipeasy_admin/models/update_experiment_response.rb +0 -165
- data/lib/shipeasy_admin/models/update_gate_request.rb +0 -403
- data/lib/shipeasy_admin/models/update_gate_response.rb +0 -166
- data/lib/shipeasy_admin/models/update_i18n_key_request.rb +0 -176
- data/lib/shipeasy_admin/models/update_i18n_key_response.rb +0 -166
- data/lib/shipeasy_admin/models/update_killswitch_request.rb +0 -224
- data/lib/shipeasy_admin/models/update_killswitch_response.rb +0 -165
- data/lib/shipeasy_admin/models/update_ops_item_request.rb +0 -205
- data/lib/shipeasy_admin/models/update_ops_item_response.rb +0 -166
- data/lib/shipeasy_admin/models/update_universe_request.rb +0 -213
- data/lib/shipeasy_admin/models/update_universe_response.rb +0 -165
- data/lib/shipeasy_admin/models/upsert_project_request.rb +0 -222
- data/lib/shipeasy_admin/models/upsert_project_response.rb +0 -260
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
|
-
#Shipeasy Admin API
|
|
2
|
+
#Shipeasy Admin API (server-SDK surface)
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#The slice of the Shipeasy admin API that the published server SDKs expose as their optional `AdminClient`. Authenticate with an admin SDK key (`Authorization: Bearer sdk_admin_…`) and scope every request to a project via the `X-Project-Id` header. Three capabilities, nothing else: - **File a public ticket** — a bug or a feature request onto the project's ops queue. - **Toggle a kill switch** — flip the switch itself, or one of its named sub-switches, on one environment. - **Manage a flag's whitelist** — read, replace, add to, or remove from the allowlist that admits specific identities ahead of every targeting rule. Everything else in the admin API is reachable through the Shipeasy CLI and MCP server, which speak the complete contract (`openapi.yaml`).
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: 2.0.0
|
|
7
7
|
|
|
@@ -19,33 +19,47 @@ module Shipeasy::Admin::Generated
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
# @param
|
|
22
|
+
# Add entries to a gate's whitelist
|
|
23
|
+
# Adds identities to the gate's whitelist, creating the block if the gate doesn't have one yet. Entries already on the list are skipped, so the call is idempotent and safe to retry. Adding to a gate that already has a whitelist keyed on the other attribute is rejected (409) rather than silently re-keying the entries already there — use `PUT` to switch `attr` deliberately. **Use case:** Let one more customer into a private beta without reading the current list first.
|
|
24
|
+
# @param id [String] Stable opaque gate id (`gate_…`) or the gate's `name`.
|
|
25
|
+
# @param add_to_gate_whitelist_request [AddToGateWhitelistRequest]
|
|
25
26
|
# @param [Hash] opts the optional parameters
|
|
26
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).
|
|
27
|
-
# @return [
|
|
28
|
-
def
|
|
29
|
-
data, _status_code, _headers =
|
|
28
|
+
# @return [GateWhitelist]
|
|
29
|
+
def add_to_gate_whitelist(id, add_to_gate_whitelist_request, opts = {})
|
|
30
|
+
data, _status_code, _headers = add_to_gate_whitelist_with_http_info(id, add_to_gate_whitelist_request, opts)
|
|
30
31
|
data
|
|
31
32
|
end
|
|
32
33
|
|
|
33
|
-
#
|
|
34
|
-
#
|
|
35
|
-
# @param
|
|
34
|
+
# Add entries to a gate's whitelist
|
|
35
|
+
# Adds identities to the gate's whitelist, creating the block if the gate doesn't have one yet. Entries already on the list are skipped, so the call is idempotent and safe to retry. Adding to a gate that already has a whitelist keyed on the other attribute is rejected (409) rather than silently re-keying the entries already there — use `PUT` to switch `attr` deliberately. **Use case:** Let one more customer into a private beta without reading the current list first.
|
|
36
|
+
# @param id [String] Stable opaque gate id (`gate_…`) or the gate's `name`.
|
|
37
|
+
# @param add_to_gate_whitelist_request [AddToGateWhitelistRequest]
|
|
36
38
|
# @param [Hash] opts the optional parameters
|
|
37
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).
|
|
38
|
-
# @return [Array<(
|
|
39
|
-
def
|
|
40
|
+
# @return [Array<(GateWhitelist, Integer, Hash)>] GateWhitelist data, response status code and response headers
|
|
41
|
+
def add_to_gate_whitelist_with_http_info(id, add_to_gate_whitelist_request, opts = {})
|
|
40
42
|
if @api_client.config.debugging
|
|
41
|
-
@api_client.config.logger.debug 'Calling API: FlagsApi.
|
|
43
|
+
@api_client.config.logger.debug 'Calling API: FlagsApi.add_to_gate_whitelist ...'
|
|
42
44
|
end
|
|
43
|
-
# verify the required parameter '
|
|
44
|
-
if @api_client.config.client_side_validation &&
|
|
45
|
-
fail ArgumentError, "Missing the required parameter '
|
|
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 FlagsApi.add_to_gate_whitelist"
|
|
48
|
+
end
|
|
49
|
+
if @api_client.config.client_side_validation && id.to_s.length > 128
|
|
50
|
+
fail ArgumentError, 'invalid value for "id" when calling FlagsApi.add_to_gate_whitelist, the character length must be smaller than or equal to 128.'
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
if @api_client.config.client_side_validation && id.to_s.length < 1
|
|
54
|
+
fail ArgumentError, 'invalid value for "id" when calling FlagsApi.add_to_gate_whitelist, the character length must be greater than or equal to 1.'
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# verify the required parameter 'add_to_gate_whitelist_request' is set
|
|
58
|
+
if @api_client.config.client_side_validation && add_to_gate_whitelist_request.nil?
|
|
59
|
+
fail ArgumentError, "Missing the required parameter 'add_to_gate_whitelist_request' when calling FlagsApi.add_to_gate_whitelist"
|
|
46
60
|
end
|
|
47
61
|
# resource path
|
|
48
|
-
local_var_path = '/api/admin/gates'
|
|
62
|
+
local_var_path = '/api/admin/gates/{id}/whitelist'.sub('{id}', CGI.escape(id.to_s))
|
|
49
63
|
|
|
50
64
|
# query parameters
|
|
51
65
|
query_params = opts[:query_params] || {}
|
|
@@ -65,16 +79,16 @@ module Shipeasy::Admin::Generated
|
|
|
65
79
|
form_params = opts[:form_params] || {}
|
|
66
80
|
|
|
67
81
|
# http body (model)
|
|
68
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(
|
|
82
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(add_to_gate_whitelist_request)
|
|
69
83
|
|
|
70
84
|
# return_type
|
|
71
|
-
return_type = opts[:debug_return_type] || '
|
|
85
|
+
return_type = opts[:debug_return_type] || 'GateWhitelist'
|
|
72
86
|
|
|
73
87
|
# auth_names
|
|
74
88
|
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
75
89
|
|
|
76
90
|
new_options = opts.merge(
|
|
77
|
-
:operation => :"FlagsApi.
|
|
91
|
+
:operation => :"FlagsApi.add_to_gate_whitelist",
|
|
78
92
|
:header_params => header_params,
|
|
79
93
|
:query_params => query_params,
|
|
80
94
|
:form_params => form_params,
|
|
@@ -85,100 +99,46 @@ module Shipeasy::Admin::Generated
|
|
|
85
99
|
|
|
86
100
|
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
87
101
|
if @api_client.config.debugging
|
|
88
|
-
@api_client.config.logger.debug "API called: FlagsApi#
|
|
89
|
-
end
|
|
90
|
-
return data, status_code, headers
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
# Delete a feature gate
|
|
94
|
-
# Soft-deletes the gate. Returns 409 if the gate is still referenced by a running experiment as a targeting gate — stop the experiment first. **Use case:** Tear down a gate after a feature has fully shipped and the rollout flag is no longer needed.
|
|
95
|
-
# @param id [String] Stable opaque gate id (`gat_…`) or the gate's `name`.
|
|
96
|
-
# @param [Hash] opts the optional parameters
|
|
97
|
-
# @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).
|
|
98
|
-
# @return [DeleteGateResponse]
|
|
99
|
-
def delete_gate(id, opts = {})
|
|
100
|
-
data, _status_code, _headers = delete_gate_with_http_info(id, opts)
|
|
101
|
-
data
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
# Delete a feature gate
|
|
105
|
-
# Soft-deletes the gate. Returns 409 if the gate is still referenced by a running experiment as a targeting gate — stop the experiment first. **Use case:** Tear down a gate after a feature has fully shipped and the rollout flag is no longer needed.
|
|
106
|
-
# @param id [String] Stable opaque gate id (`gat_…`) or the gate's `name`.
|
|
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
|
-
# @return [Array<(DeleteGateResponse, Integer, Hash)>] DeleteGateResponse data, response status code and response headers
|
|
110
|
-
def delete_gate_with_http_info(id, opts = {})
|
|
111
|
-
if @api_client.config.debugging
|
|
112
|
-
@api_client.config.logger.debug 'Calling API: FlagsApi.delete_gate ...'
|
|
113
|
-
end
|
|
114
|
-
# resource path
|
|
115
|
-
local_var_path = '/api/admin/gates/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
116
|
-
|
|
117
|
-
# query parameters
|
|
118
|
-
query_params = opts[:query_params] || {}
|
|
119
|
-
|
|
120
|
-
# header parameters
|
|
121
|
-
header_params = opts[:header_params] || {}
|
|
122
|
-
# HTTP header 'Accept' (if needed)
|
|
123
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
124
|
-
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
125
|
-
|
|
126
|
-
# form parameters
|
|
127
|
-
form_params = opts[:form_params] || {}
|
|
128
|
-
|
|
129
|
-
# http body (model)
|
|
130
|
-
post_body = opts[:debug_body]
|
|
131
|
-
|
|
132
|
-
# return_type
|
|
133
|
-
return_type = opts[:debug_return_type] || 'DeleteGateResponse'
|
|
134
|
-
|
|
135
|
-
# auth_names
|
|
136
|
-
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
137
|
-
|
|
138
|
-
new_options = opts.merge(
|
|
139
|
-
:operation => :"FlagsApi.delete_gate",
|
|
140
|
-
:header_params => header_params,
|
|
141
|
-
:query_params => query_params,
|
|
142
|
-
:form_params => form_params,
|
|
143
|
-
:body => post_body,
|
|
144
|
-
:auth_names => auth_names,
|
|
145
|
-
:return_type => return_type
|
|
146
|
-
)
|
|
147
|
-
|
|
148
|
-
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
149
|
-
if @api_client.config.debugging
|
|
150
|
-
@api_client.config.logger.debug "API called: FlagsApi#delete_gate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
102
|
+
@api_client.config.logger.debug "API called: FlagsApi#add_to_gate_whitelist\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
151
103
|
end
|
|
152
104
|
return data, status_code, headers
|
|
153
105
|
end
|
|
154
106
|
|
|
155
|
-
#
|
|
156
|
-
#
|
|
157
|
-
# @param id [String] Stable opaque gate id (`
|
|
107
|
+
# Read a gate's whitelist
|
|
108
|
+
# Returns the gate's whitelist — the always-first allowlist that admits the listed identities before any targeting rule or percentage rollout is evaluated. A gate with no whitelist returns `entries: []` (and the default `attr`), never a 404 — so a caller can read-then-write without special-casing the empty gate. **Use case:** Check whether an account is already let through before adding it.
|
|
109
|
+
# @param id [String] Stable opaque gate id (`gate_…`) or the gate's `name`.
|
|
158
110
|
# @param [Hash] opts the optional parameters
|
|
159
111
|
# @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).
|
|
160
|
-
# @return [
|
|
161
|
-
def
|
|
162
|
-
data, _status_code, _headers =
|
|
112
|
+
# @return [GateWhitelist]
|
|
113
|
+
def get_gate_whitelist(id, opts = {})
|
|
114
|
+
data, _status_code, _headers = get_gate_whitelist_with_http_info(id, opts)
|
|
163
115
|
data
|
|
164
116
|
end
|
|
165
117
|
|
|
166
|
-
#
|
|
167
|
-
#
|
|
168
|
-
# @param id [String] Stable opaque gate id (`
|
|
118
|
+
# Read a gate's whitelist
|
|
119
|
+
# Returns the gate's whitelist — the always-first allowlist that admits the listed identities before any targeting rule or percentage rollout is evaluated. A gate with no whitelist returns `entries: []` (and the default `attr`), never a 404 — so a caller can read-then-write without special-casing the empty gate. **Use case:** Check whether an account is already let through before adding it.
|
|
120
|
+
# @param id [String] Stable opaque gate id (`gate_…`) or the gate's `name`.
|
|
169
121
|
# @param [Hash] opts the optional parameters
|
|
170
122
|
# @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).
|
|
171
|
-
# @return [Array<(
|
|
172
|
-
def
|
|
123
|
+
# @return [Array<(GateWhitelist, Integer, Hash)>] GateWhitelist data, response status code and response headers
|
|
124
|
+
def get_gate_whitelist_with_http_info(id, opts = {})
|
|
173
125
|
if @api_client.config.debugging
|
|
174
|
-
@api_client.config.logger.debug 'Calling API: FlagsApi.
|
|
126
|
+
@api_client.config.logger.debug 'Calling API: FlagsApi.get_gate_whitelist ...'
|
|
175
127
|
end
|
|
176
128
|
# verify the required parameter 'id' is set
|
|
177
129
|
if @api_client.config.client_side_validation && id.nil?
|
|
178
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling FlagsApi.
|
|
130
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling FlagsApi.get_gate_whitelist"
|
|
179
131
|
end
|
|
132
|
+
if @api_client.config.client_side_validation && id.to_s.length > 128
|
|
133
|
+
fail ArgumentError, 'invalid value for "id" when calling FlagsApi.get_gate_whitelist, the character length must be smaller than or equal to 128.'
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if @api_client.config.client_side_validation && id.to_s.length < 1
|
|
137
|
+
fail ArgumentError, 'invalid value for "id" when calling FlagsApi.get_gate_whitelist, the character length must be greater than or equal to 1.'
|
|
138
|
+
end
|
|
139
|
+
|
|
180
140
|
# resource path
|
|
181
|
-
local_var_path = '/api/admin/gates/{id}/
|
|
141
|
+
local_var_path = '/api/admin/gates/{id}/whitelist'.sub('{id}', CGI.escape(id.to_s))
|
|
182
142
|
|
|
183
143
|
# query parameters
|
|
184
144
|
query_params = opts[:query_params] || {}
|
|
@@ -196,13 +156,13 @@ module Shipeasy::Admin::Generated
|
|
|
196
156
|
post_body = opts[:debug_body]
|
|
197
157
|
|
|
198
158
|
# return_type
|
|
199
|
-
return_type = opts[:debug_return_type] || '
|
|
159
|
+
return_type = opts[:debug_return_type] || 'GateWhitelist'
|
|
200
160
|
|
|
201
161
|
# auth_names
|
|
202
162
|
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
203
163
|
|
|
204
164
|
new_options = opts.merge(
|
|
205
|
-
:operation => :"FlagsApi.
|
|
165
|
+
:operation => :"FlagsApi.get_gate_whitelist",
|
|
206
166
|
:header_params => header_params,
|
|
207
167
|
:query_params => query_params,
|
|
208
168
|
:form_params => form_params,
|
|
@@ -211,138 +171,83 @@ module Shipeasy::Admin::Generated
|
|
|
211
171
|
:return_type => return_type
|
|
212
172
|
)
|
|
213
173
|
|
|
214
|
-
data, status_code, headers = @api_client.call_api(:
|
|
174
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
215
175
|
if @api_client.config.debugging
|
|
216
|
-
@api_client.config.logger.debug "API called: FlagsApi#
|
|
176
|
+
@api_client.config.logger.debug "API called: FlagsApi#get_gate_whitelist\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
217
177
|
end
|
|
218
178
|
return data, status_code, headers
|
|
219
179
|
end
|
|
220
180
|
|
|
221
|
-
#
|
|
222
|
-
#
|
|
223
|
-
# @param id [String] Stable opaque gate id (`
|
|
181
|
+
# Remove entries from a gate's whitelist
|
|
182
|
+
# Removes identities from the gate's whitelist. Entries that aren't on the list are skipped, so the call is idempotent. Removing the last entry leaves an empty whitelist block in place; to drop the block itself use `PUT` with `entries: []`. **Use case:** Revoke one beta tester's access without touching anyone else's.
|
|
183
|
+
# @param id [String] Stable opaque gate id (`gate_…`) or the gate's `name`.
|
|
184
|
+
# @param remove_from_gate_whitelist_request [RemoveFromGateWhitelistRequest]
|
|
224
185
|
# @param [Hash] opts the optional parameters
|
|
225
186
|
# @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).
|
|
226
|
-
# @return [
|
|
227
|
-
def
|
|
228
|
-
data, _status_code, _headers =
|
|
187
|
+
# @return [GateWhitelist]
|
|
188
|
+
def remove_from_gate_whitelist(id, remove_from_gate_whitelist_request, opts = {})
|
|
189
|
+
data, _status_code, _headers = remove_from_gate_whitelist_with_http_info(id, remove_from_gate_whitelist_request, opts)
|
|
229
190
|
data
|
|
230
191
|
end
|
|
231
192
|
|
|
232
|
-
#
|
|
233
|
-
#
|
|
234
|
-
# @param id [String] Stable opaque gate id (`
|
|
193
|
+
# Remove entries from a gate's whitelist
|
|
194
|
+
# Removes identities from the gate's whitelist. Entries that aren't on the list are skipped, so the call is idempotent. Removing the last entry leaves an empty whitelist block in place; to drop the block itself use `PUT` with `entries: []`. **Use case:** Revoke one beta tester's access without touching anyone else's.
|
|
195
|
+
# @param id [String] Stable opaque gate id (`gate_…`) or the gate's `name`.
|
|
196
|
+
# @param remove_from_gate_whitelist_request [RemoveFromGateWhitelistRequest]
|
|
235
197
|
# @param [Hash] opts the optional parameters
|
|
236
198
|
# @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).
|
|
237
|
-
# @return [Array<(
|
|
238
|
-
def
|
|
199
|
+
# @return [Array<(GateWhitelist, Integer, Hash)>] GateWhitelist data, response status code and response headers
|
|
200
|
+
def remove_from_gate_whitelist_with_http_info(id, remove_from_gate_whitelist_request, opts = {})
|
|
239
201
|
if @api_client.config.debugging
|
|
240
|
-
@api_client.config.logger.debug 'Calling API: FlagsApi.
|
|
202
|
+
@api_client.config.logger.debug 'Calling API: FlagsApi.remove_from_gate_whitelist ...'
|
|
241
203
|
end
|
|
242
204
|
# verify the required parameter 'id' is set
|
|
243
205
|
if @api_client.config.client_side_validation && id.nil?
|
|
244
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling FlagsApi.
|
|
206
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling FlagsApi.remove_from_gate_whitelist"
|
|
245
207
|
end
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
# query parameters
|
|
250
|
-
query_params = opts[:query_params] || {}
|
|
251
|
-
|
|
252
|
-
# header parameters
|
|
253
|
-
header_params = opts[:header_params] || {}
|
|
254
|
-
# HTTP header 'Accept' (if needed)
|
|
255
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
256
|
-
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
257
|
-
|
|
258
|
-
# form parameters
|
|
259
|
-
form_params = opts[:form_params] || {}
|
|
260
|
-
|
|
261
|
-
# http body (model)
|
|
262
|
-
post_body = opts[:debug_body]
|
|
263
|
-
|
|
264
|
-
# return_type
|
|
265
|
-
return_type = opts[:debug_return_type] || 'EnableGateResponse'
|
|
266
|
-
|
|
267
|
-
# auth_names
|
|
268
|
-
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
269
|
-
|
|
270
|
-
new_options = opts.merge(
|
|
271
|
-
:operation => :"FlagsApi.enable_gate",
|
|
272
|
-
:header_params => header_params,
|
|
273
|
-
:query_params => query_params,
|
|
274
|
-
:form_params => form_params,
|
|
275
|
-
:body => post_body,
|
|
276
|
-
:auth_names => auth_names,
|
|
277
|
-
:return_type => return_type
|
|
278
|
-
)
|
|
279
|
-
|
|
280
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
281
|
-
if @api_client.config.debugging
|
|
282
|
-
@api_client.config.logger.debug "API called: FlagsApi#enable_gate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
208
|
+
if @api_client.config.client_side_validation && id.to_s.length > 128
|
|
209
|
+
fail ArgumentError, 'invalid value for "id" when calling FlagsApi.remove_from_gate_whitelist, the character length must be smaller than or equal to 128.'
|
|
283
210
|
end
|
|
284
|
-
return data, status_code, headers
|
|
285
|
-
end
|
|
286
211
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
# @param [Hash] opts the optional parameters
|
|
290
|
-
# @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).
|
|
291
|
-
# @option opts [Integer] :limit Page size (1–500). Defaults to 100. (default to 100)
|
|
292
|
-
# @option opts [String] :cursor Opaque cursor returned in the previous page's `next_cursor`. Omit for the first page.
|
|
293
|
-
# @return [ListGatesResponse]
|
|
294
|
-
def list_gates(opts = {})
|
|
295
|
-
data, _status_code, _headers = list_gates_with_http_info(opts)
|
|
296
|
-
data
|
|
297
|
-
end
|
|
298
|
-
|
|
299
|
-
# List feature gates
|
|
300
|
-
# Returns a single page of gates ordered by `updated_at desc, id desc`. Use the `cursor` query parameter to paginate. **Use case:** Snapshot every gate in the project — for example to render an admin overview or to drive a CI check that asserts no gate is left at 100% in staging.
|
|
301
|
-
# @param [Hash] opts the optional parameters
|
|
302
|
-
# @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).
|
|
303
|
-
# @option opts [Integer] :limit Page size (1–500). Defaults to 100. (default to 100)
|
|
304
|
-
# @option opts [String] :cursor Opaque cursor returned in the previous page's `next_cursor`. Omit for the first page.
|
|
305
|
-
# @return [Array<(ListGatesResponse, Integer, Hash)>] ListGatesResponse data, response status code and response headers
|
|
306
|
-
def list_gates_with_http_info(opts = {})
|
|
307
|
-
if @api_client.config.debugging
|
|
308
|
-
@api_client.config.logger.debug 'Calling API: FlagsApi.list_gates ...'
|
|
309
|
-
end
|
|
310
|
-
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
|
|
311
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling FlagsApi.list_gates, must be smaller than or equal to 500.'
|
|
212
|
+
if @api_client.config.client_side_validation && id.to_s.length < 1
|
|
213
|
+
fail ArgumentError, 'invalid value for "id" when calling FlagsApi.remove_from_gate_whitelist, the character length must be greater than or equal to 1.'
|
|
312
214
|
end
|
|
313
215
|
|
|
314
|
-
|
|
315
|
-
|
|
216
|
+
# verify the required parameter 'remove_from_gate_whitelist_request' is set
|
|
217
|
+
if @api_client.config.client_side_validation && remove_from_gate_whitelist_request.nil?
|
|
218
|
+
fail ArgumentError, "Missing the required parameter 'remove_from_gate_whitelist_request' when calling FlagsApi.remove_from_gate_whitelist"
|
|
316
219
|
end
|
|
317
|
-
|
|
318
220
|
# resource path
|
|
319
|
-
local_var_path = '/api/admin/gates'
|
|
221
|
+
local_var_path = '/api/admin/gates/{id}/whitelist'.sub('{id}', CGI.escape(id.to_s))
|
|
320
222
|
|
|
321
223
|
# query parameters
|
|
322
224
|
query_params = opts[:query_params] || {}
|
|
323
|
-
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
324
|
-
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
|
325
225
|
|
|
326
226
|
# header parameters
|
|
327
227
|
header_params = opts[:header_params] || {}
|
|
328
228
|
# HTTP header 'Accept' (if needed)
|
|
329
229
|
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
230
|
+
# HTTP header 'Content-Type'
|
|
231
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
232
|
+
if !content_type.nil?
|
|
233
|
+
header_params['Content-Type'] = content_type
|
|
234
|
+
end
|
|
330
235
|
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
331
236
|
|
|
332
237
|
# form parameters
|
|
333
238
|
form_params = opts[:form_params] || {}
|
|
334
239
|
|
|
335
240
|
# http body (model)
|
|
336
|
-
post_body = opts[:debug_body]
|
|
241
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(remove_from_gate_whitelist_request)
|
|
337
242
|
|
|
338
243
|
# return_type
|
|
339
|
-
return_type = opts[:debug_return_type] || '
|
|
244
|
+
return_type = opts[:debug_return_type] || 'GateWhitelist'
|
|
340
245
|
|
|
341
246
|
# auth_names
|
|
342
247
|
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
343
248
|
|
|
344
249
|
new_options = opts.merge(
|
|
345
|
-
:operation => :"FlagsApi.
|
|
250
|
+
:operation => :"FlagsApi.remove_from_gate_whitelist",
|
|
346
251
|
:header_params => header_params,
|
|
347
252
|
:query_params => query_params,
|
|
348
253
|
:form_params => form_params,
|
|
@@ -351,46 +256,54 @@ module Shipeasy::Admin::Generated
|
|
|
351
256
|
:return_type => return_type
|
|
352
257
|
)
|
|
353
258
|
|
|
354
|
-
data, status_code, headers = @api_client.call_api(:
|
|
259
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
355
260
|
if @api_client.config.debugging
|
|
356
|
-
@api_client.config.logger.debug "API called: FlagsApi#
|
|
261
|
+
@api_client.config.logger.debug "API called: FlagsApi#remove_from_gate_whitelist\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
357
262
|
end
|
|
358
263
|
return data, status_code, headers
|
|
359
264
|
end
|
|
360
265
|
|
|
361
|
-
#
|
|
362
|
-
#
|
|
363
|
-
# @param id [String] Stable opaque gate id (`
|
|
364
|
-
# @param
|
|
266
|
+
# Replace a gate's whitelist
|
|
267
|
+
# Replaces the gate's whole whitelist with `entries`, creating the block if the gate didn't have one. Idempotent — the same call twice leaves the same list. This is the only whitelist call that can switch `attr` (`email` ⇄ `user_id`) or clear the block: `entries: []` removes the whitelist from the gate entirely. **Use cases** - **Pin an exact list** — `{ \"entries\": [\"alice@acme.dev\", \"bob@acme.dev\"] }`. - **Switch to user ids** — `{ \"attr\": \"user_id\", \"entries\": [\"usr_123\"] }`. - **Drop the whitelist** — `{ \"entries\": [] }`.
|
|
268
|
+
# @param id [String] Stable opaque gate id (`gate_…`) or the gate's `name`.
|
|
269
|
+
# @param set_gate_whitelist_request [SetGateWhitelistRequest]
|
|
365
270
|
# @param [Hash] opts the optional parameters
|
|
366
271
|
# @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 [
|
|
368
|
-
def
|
|
369
|
-
data, _status_code, _headers =
|
|
272
|
+
# @return [GateWhitelist]
|
|
273
|
+
def set_gate_whitelist(id, set_gate_whitelist_request, opts = {})
|
|
274
|
+
data, _status_code, _headers = set_gate_whitelist_with_http_info(id, set_gate_whitelist_request, opts)
|
|
370
275
|
data
|
|
371
276
|
end
|
|
372
277
|
|
|
373
|
-
#
|
|
374
|
-
#
|
|
375
|
-
# @param id [String] Stable opaque gate id (`
|
|
376
|
-
# @param
|
|
278
|
+
# Replace a gate's whitelist
|
|
279
|
+
# Replaces the gate's whole whitelist with `entries`, creating the block if the gate didn't have one. Idempotent — the same call twice leaves the same list. This is the only whitelist call that can switch `attr` (`email` ⇄ `user_id`) or clear the block: `entries: []` removes the whitelist from the gate entirely. **Use cases** - **Pin an exact list** — `{ \"entries\": [\"alice@acme.dev\", \"bob@acme.dev\"] }`. - **Switch to user ids** — `{ \"attr\": \"user_id\", \"entries\": [\"usr_123\"] }`. - **Drop the whitelist** — `{ \"entries\": [] }`.
|
|
280
|
+
# @param id [String] Stable opaque gate id (`gate_…`) or the gate's `name`.
|
|
281
|
+
# @param set_gate_whitelist_request [SetGateWhitelistRequest]
|
|
377
282
|
# @param [Hash] opts the optional parameters
|
|
378
283
|
# @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<(
|
|
380
|
-
def
|
|
284
|
+
# @return [Array<(GateWhitelist, Integer, Hash)>] GateWhitelist data, response status code and response headers
|
|
285
|
+
def set_gate_whitelist_with_http_info(id, set_gate_whitelist_request, opts = {})
|
|
381
286
|
if @api_client.config.debugging
|
|
382
|
-
@api_client.config.logger.debug 'Calling API: FlagsApi.
|
|
287
|
+
@api_client.config.logger.debug 'Calling API: FlagsApi.set_gate_whitelist ...'
|
|
383
288
|
end
|
|
384
289
|
# verify the required parameter 'id' is set
|
|
385
290
|
if @api_client.config.client_side_validation && id.nil?
|
|
386
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling FlagsApi.
|
|
291
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling FlagsApi.set_gate_whitelist"
|
|
292
|
+
end
|
|
293
|
+
if @api_client.config.client_side_validation && id.to_s.length > 128
|
|
294
|
+
fail ArgumentError, 'invalid value for "id" when calling FlagsApi.set_gate_whitelist, the character length must be smaller than or equal to 128.'
|
|
387
295
|
end
|
|
388
|
-
|
|
389
|
-
if @api_client.config.client_side_validation &&
|
|
390
|
-
fail ArgumentError,
|
|
296
|
+
|
|
297
|
+
if @api_client.config.client_side_validation && id.to_s.length < 1
|
|
298
|
+
fail ArgumentError, 'invalid value for "id" when calling FlagsApi.set_gate_whitelist, the character length must be greater than or equal to 1.'
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
# verify the required parameter 'set_gate_whitelist_request' is set
|
|
302
|
+
if @api_client.config.client_side_validation && set_gate_whitelist_request.nil?
|
|
303
|
+
fail ArgumentError, "Missing the required parameter 'set_gate_whitelist_request' when calling FlagsApi.set_gate_whitelist"
|
|
391
304
|
end
|
|
392
305
|
# resource path
|
|
393
|
-
local_var_path = '/api/admin/gates/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
306
|
+
local_var_path = '/api/admin/gates/{id}/whitelist'.sub('{id}', CGI.escape(id.to_s))
|
|
394
307
|
|
|
395
308
|
# query parameters
|
|
396
309
|
query_params = opts[:query_params] || {}
|
|
@@ -410,16 +323,16 @@ module Shipeasy::Admin::Generated
|
|
|
410
323
|
form_params = opts[:form_params] || {}
|
|
411
324
|
|
|
412
325
|
# http body (model)
|
|
413
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(
|
|
326
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(set_gate_whitelist_request)
|
|
414
327
|
|
|
415
328
|
# return_type
|
|
416
|
-
return_type = opts[:debug_return_type] || '
|
|
329
|
+
return_type = opts[:debug_return_type] || 'GateWhitelist'
|
|
417
330
|
|
|
418
331
|
# auth_names
|
|
419
332
|
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
420
333
|
|
|
421
334
|
new_options = opts.merge(
|
|
422
|
-
:operation => :"FlagsApi.
|
|
335
|
+
:operation => :"FlagsApi.set_gate_whitelist",
|
|
423
336
|
:header_params => header_params,
|
|
424
337
|
:query_params => query_params,
|
|
425
338
|
:form_params => form_params,
|
|
@@ -428,9 +341,9 @@ module Shipeasy::Admin::Generated
|
|
|
428
341
|
:return_type => return_type
|
|
429
342
|
)
|
|
430
343
|
|
|
431
|
-
data, status_code, headers = @api_client.call_api(:
|
|
344
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
432
345
|
if @api_client.config.debugging
|
|
433
|
-
@api_client.config.logger.debug "API called: FlagsApi#
|
|
346
|
+
@api_client.config.logger.debug "API called: FlagsApi#set_gate_whitelist\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
434
347
|
end
|
|
435
348
|
return data, status_code, headers
|
|
436
349
|
end
|