shipeasy-sdk 3.7.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.
Files changed (220) hide show
  1. checksums.yaml +4 -4
  2. data/docs/skill/SKILL.md +7 -4
  3. data/lib/shipeasy/admin.rb +23 -20
  4. data/lib/shipeasy/engine.rb +6 -4
  5. data/lib/shipeasy/sdk/see.rb +7 -5
  6. data/lib/shipeasy/sdk/version.rb +1 -1
  7. data/lib/shipeasy_admin/api/flags_api.rb +127 -214
  8. data/lib/shipeasy_admin/api/killswitch_api.rb +25 -525
  9. data/lib/shipeasy_admin/api/ops_api.rb +44 -351
  10. data/lib/shipeasy_admin/api_client.rb +2 -2
  11. data/lib/shipeasy_admin/api_error.rb +2 -2
  12. data/lib/shipeasy_admin/api_model_base.rb +2 -2
  13. data/lib/shipeasy_admin/configuration.rb +29 -2
  14. data/lib/shipeasy_admin/models/{set_killswitch_value_request.rb → add_to_gate_whitelist_request.rb} +37 -42
  15. data/lib/shipeasy_admin/models/create_public_bug_request.rb +464 -0
  16. data/lib/shipeasy_admin/models/create_public_feature_request_request.rb +407 -0
  17. data/lib/shipeasy_admin/models/{file_error_ticket_response.rb → create_public_ticket_response.rb} +22 -29
  18. data/lib/shipeasy_admin/models/env.rb +2 -2
  19. data/lib/shipeasy_admin/models/error.rb +41 -7
  20. data/lib/shipeasy_admin/models/error_code.rb +14 -3
  21. data/lib/shipeasy_admin/models/{get_experiment_timeseries_response_experiment.rb → gate_whitelist.rb} +51 -42
  22. data/lib/shipeasy_admin/models/gate_whitelist_attr.rb +40 -0
  23. data/lib/shipeasy_admin/models/killswitch_value.rb +2 -2
  24. data/lib/shipeasy_admin/models/notification_target.rb +2 -2
  25. data/lib/shipeasy_admin/models/notification_target_slack_channel.rb +2 -2
  26. data/lib/shipeasy_admin/models/ops_item_priority.rb +42 -0
  27. data/lib/shipeasy_admin/models/ops_item_status.rb +46 -0
  28. data/lib/shipeasy_admin/models/{discard_config_draft_request.rb → remove_from_gate_whitelist_request.rb} +34 -44
  29. data/lib/shipeasy_admin/models/{delete_alert_rule_response.rb → set_gate_whitelist_request.rb} +37 -25
  30. data/lib/shipeasy_admin/models/{set_killswitch_switch_request.rb → toggle_killswitch_request.rb} +30 -72
  31. data/lib/shipeasy_admin/models/{set_killswitch_value_response.rb → toggle_killswitch_response.rb} +100 -6
  32. data/lib/shipeasy_admin/version.rb +2 -2
  33. data/lib/shipeasy_admin.rb +14 -195
  34. metadata +14 -195
  35. data/lib/shipeasy_admin/api/alerts_api.rb +0 -352
  36. data/lib/shipeasy_admin/api/api_keys_api.rb +0 -229
  37. data/lib/shipeasy_admin/api/attributes_api.rb +0 -82
  38. data/lib/shipeasy_admin/api/configs_api.rb +0 -757
  39. data/lib/shipeasy_admin/api/connectors_api.rb +0 -497
  40. data/lib/shipeasy_admin/api/drafts_api.rb +0 -82
  41. data/lib/shipeasy_admin/api/errors_api.rb +0 -389
  42. data/lib/shipeasy_admin/api/events_api.rb +0 -438
  43. data/lib/shipeasy_admin/api/experiments_api.rb +0 -727
  44. data/lib/shipeasy_admin/api/keys_api.rb +0 -317
  45. data/lib/shipeasy_admin/api/metrics_api.rb +0 -281
  46. data/lib/shipeasy_admin/api/profiles_api.rb +0 -222
  47. data/lib/shipeasy_admin/api/projects_api.rb +0 -216
  48. data/lib/shipeasy_admin/api/universes_api.rb +0 -306
  49. data/lib/shipeasy_admin/models/approve_event_request.rb +0 -198
  50. data/lib/shipeasy_admin/models/approve_event_response.rb +0 -166
  51. data/lib/shipeasy_admin/models/claude_trigger_config.rb +0 -204
  52. data/lib/shipeasy_admin/models/connector_event.rb +0 -40
  53. data/lib/shipeasy_admin/models/connector_provider.rb +0 -45
  54. data/lib/shipeasy_admin/models/connector_record.rb +0 -468
  55. data/lib/shipeasy_admin/models/copilot_trigger_config.rb +0 -276
  56. data/lib/shipeasy_admin/models/create_alert_rule_request.rb +0 -383
  57. data/lib/shipeasy_admin/models/create_alert_rule_response.rb +0 -165
  58. data/lib/shipeasy_admin/models/create_claude_trigger_request.rb +0 -309
  59. data/lib/shipeasy_admin/models/create_config_request.rb +0 -291
  60. data/lib/shipeasy_admin/models/create_config_response.rb +0 -201
  61. data/lib/shipeasy_admin/models/create_connector_request.rb +0 -64
  62. data/lib/shipeasy_admin/models/create_connector_response.rb +0 -165
  63. data/lib/shipeasy_admin/models/create_copilot_trigger_request.rb +0 -316
  64. data/lib/shipeasy_admin/models/create_cursor_trigger_request.rb +0 -352
  65. data/lib/shipeasy_admin/models/create_event_request.rb +0 -236
  66. data/lib/shipeasy_admin/models/create_event_response.rb +0 -193
  67. data/lib/shipeasy_admin/models/create_experiment_request.rb +0 -807
  68. data/lib/shipeasy_admin/models/create_experiment_response.rb +0 -212
  69. data/lib/shipeasy_admin/models/create_gate_request.rb +0 -492
  70. data/lib/shipeasy_admin/models/create_gate_response.rb +0 -212
  71. data/lib/shipeasy_admin/models/create_i18n_profile_request.rb +0 -188
  72. data/lib/shipeasy_admin/models/create_i18n_profile_response.rb +0 -193
  73. data/lib/shipeasy_admin/models/create_jules_trigger_request.rb +0 -352
  74. data/lib/shipeasy_admin/models/create_key_request.rb +0 -297
  75. data/lib/shipeasy_admin/models/create_key_response.rb +0 -286
  76. data/lib/shipeasy_admin/models/create_killswitch_request.rb +0 -274
  77. data/lib/shipeasy_admin/models/create_killswitch_response.rb +0 -201
  78. data/lib/shipeasy_admin/models/create_metric_request.rb +0 -403
  79. data/lib/shipeasy_admin/models/create_metric_response.rb +0 -193
  80. data/lib/shipeasy_admin/models/create_o_auth_connector_request.rb +0 -273
  81. data/lib/shipeasy_admin/models/create_ops_item_request.rb +0 -287
  82. data/lib/shipeasy_admin/models/create_ops_item_response.rb +0 -177
  83. data/lib/shipeasy_admin/models/create_universe_request.rb +0 -272
  84. data/lib/shipeasy_admin/models/create_universe_response.rb +0 -212
  85. data/lib/shipeasy_admin/models/cursor_trigger_config.rb +0 -231
  86. data/lib/shipeasy_admin/models/delete_config_response.rb +0 -188
  87. data/lib/shipeasy_admin/models/delete_connector_response.rb +0 -188
  88. data/lib/shipeasy_admin/models/delete_event_response.rb +0 -189
  89. data/lib/shipeasy_admin/models/delete_experiment_response.rb +0 -188
  90. data/lib/shipeasy_admin/models/delete_gate_response.rb +0 -188
  91. data/lib/shipeasy_admin/models/delete_killswitch_response.rb +0 -188
  92. data/lib/shipeasy_admin/models/delete_metric_response.rb +0 -189
  93. data/lib/shipeasy_admin/models/delete_universe_response.rb +0 -188
  94. data/lib/shipeasy_admin/models/disable_gate_response.rb +0 -190
  95. data/lib/shipeasy_admin/models/discard_config_draft_response.rb +0 -188
  96. data/lib/shipeasy_admin/models/enable_gate_response.rb +0 -190
  97. data/lib/shipeasy_admin/models/error_record.rb +0 -597
  98. data/lib/shipeasy_admin/models/error_series_request.rb +0 -251
  99. data/lib/shipeasy_admin/models/error_series_response.rb +0 -195
  100. data/lib/shipeasy_admin/models/error_series_response_rows_inner.rb +0 -192
  101. data/lib/shipeasy_admin/models/experiment_inline_metric.rb +0 -337
  102. data/lib/shipeasy_admin/models/fire_connector_request.rb +0 -149
  103. data/lib/shipeasy_admin/models/fire_connector_response.rb +0 -176
  104. data/lib/shipeasy_admin/models/get_config_response.rb +0 -351
  105. data/lib/shipeasy_admin/models/get_current_project_response.rb +0 -606
  106. data/lib/shipeasy_admin/models/get_current_project_response_module_translations.rb +0 -104
  107. data/lib/shipeasy_admin/models/get_event_response.rb +0 -344
  108. data/lib/shipeasy_admin/models/get_experiment_response.rb +0 -688
  109. data/lib/shipeasy_admin/models/get_experiment_results_response.rb +0 -243
  110. data/lib/shipeasy_admin/models/get_experiment_results_response_experiment.rb +0 -248
  111. data/lib/shipeasy_admin/models/get_experiment_results_response_results_inner.rb +0 -252
  112. data/lib/shipeasy_admin/models/get_experiment_timeseries_response.rb +0 -192
  113. data/lib/shipeasy_admin/models/get_experiment_timeseries_response_series_inner.rb +0 -278
  114. data/lib/shipeasy_admin/models/get_killswitch_response.rb +0 -270
  115. data/lib/shipeasy_admin/models/get_metric_response.rb +0 -378
  116. data/lib/shipeasy_admin/models/get_ops_item_response.rb +0 -349
  117. data/lib/shipeasy_admin/models/jules_trigger_config.rb +0 -240
  118. data/lib/shipeasy_admin/models/key_record.rb +0 -353
  119. data/lib/shipeasy_admin/models/link_pr_to_ops_item_request.rb +0 -186
  120. data/lib/shipeasy_admin/models/link_pr_to_ops_item_response.rb +0 -166
  121. data/lib/shipeasy_admin/models/list_alert_rules_response_inner.rb +0 -478
  122. data/lib/shipeasy_admin/models/list_attributes_response_inner.rb +0 -176
  123. data/lib/shipeasy_admin/models/list_config_activity_response_inner.rb +0 -280
  124. data/lib/shipeasy_admin/models/list_configs_response.rb +0 -178
  125. data/lib/shipeasy_admin/models/list_configs_response_data_inner.rb +0 -351
  126. data/lib/shipeasy_admin/models/list_configs_response_data_inner_drafts_value.rb +0 -237
  127. data/lib/shipeasy_admin/models/list_configs_response_data_inner_envs_value.rb +0 -237
  128. data/lib/shipeasy_admin/models/list_events_response_inner.rb +0 -344
  129. data/lib/shipeasy_admin/models/list_events_response_inner_properties_inner.rb +0 -259
  130. data/lib/shipeasy_admin/models/list_experiments_response.rb +0 -178
  131. data/lib/shipeasy_admin/models/list_experiments_response_data_inner.rb +0 -688
  132. data/lib/shipeasy_admin/models/list_experiments_response_data_inner_groups_inner.rb +0 -241
  133. data/lib/shipeasy_admin/models/list_gates_response.rb +0 -178
  134. data/lib/shipeasy_admin/models/list_gates_response_data_inner.rb +0 -395
  135. data/lib/shipeasy_admin/models/list_gates_response_data_inner_enabled.rb +0 -104
  136. data/lib/shipeasy_admin/models/list_gates_response_data_inner_rules_inner.rb +0 -238
  137. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner.rb +0 -105
  138. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of.rb +0 -358
  139. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of1.rb +0 -331
  140. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of_ramp.rb +0 -319
  141. data/lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb +0 -272
  142. data/lib/shipeasy_admin/models/list_i18n_keys_response.rb +0 -195
  143. data/lib/shipeasy_admin/models/list_i18n_keys_response_keys_inner.rb +0 -274
  144. data/lib/shipeasy_admin/models/list_i18n_profiles_response_inner.rb +0 -224
  145. data/lib/shipeasy_admin/models/list_keys_response.rb +0 -180
  146. data/lib/shipeasy_admin/models/list_killswitches_response.rb +0 -178
  147. data/lib/shipeasy_admin/models/list_killswitches_response_data_inner.rb +0 -270
  148. data/lib/shipeasy_admin/models/list_killswitches_response_data_inner_envs_value.rb +0 -248
  149. data/lib/shipeasy_admin/models/list_metrics_response_inner.rb +0 -378
  150. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir.rb +0 -288
  151. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg.rb +0 -113
  152. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of.rb +0 -188
  153. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of1.rb +0 -188
  154. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of2.rb +0 -188
  155. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of3.rb +0 -188
  156. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of4.rb +0 -188
  157. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of5.rb +0 -188
  158. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of6.rb +0 -188
  159. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of7.rb +0 -217
  160. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of8.rb +0 -233
  161. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9.rb +0 -240
  162. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator.rb +0 -266
  163. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator_filters_inner.rb +0 -264
  164. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_group_by.rb +0 -228
  165. data/lib/shipeasy_admin/models/list_ops_items_response_inner.rb +0 -349
  166. data/lib/shipeasy_admin/models/list_slack_channels_response.rb +0 -195
  167. data/lib/shipeasy_admin/models/list_slack_channels_response_channels_inner.rb +0 -203
  168. data/lib/shipeasy_admin/models/list_universes_response.rb +0 -178
  169. data/lib/shipeasy_admin/models/list_universes_response_data_inner.rb +0 -305
  170. data/lib/shipeasy_admin/models/notify_ops_request.rb +0 -261
  171. data/lib/shipeasy_admin/models/notify_ops_response.rb +0 -193
  172. data/lib/shipeasy_admin/models/publish_config_draft_request.rb +0 -187
  173. data/lib/shipeasy_admin/models/publish_config_draft_response.rb +0 -257
  174. data/lib/shipeasy_admin/models/publish_i18n_profile_response.rb +0 -391
  175. data/lib/shipeasy_admin/models/push_i18n_keys_request.rb +0 -195
  176. data/lib/shipeasy_admin/models/push_i18n_keys_request_keys_inner.rb +0 -192
  177. data/lib/shipeasy_admin/models/push_i18n_keys_response.rb +0 -251
  178. data/lib/shipeasy_admin/models/reanalyze_experiment_response.rb +0 -214
  179. data/lib/shipeasy_admin/models/revoke_key_response.rb +0 -216
  180. data/lib/shipeasy_admin/models/save_config_draft_request.rb +0 -199
  181. data/lib/shipeasy_admin/models/save_config_draft_response.rb +0 -283
  182. data/lib/shipeasy_admin/models/search_hit.rb +0 -284
  183. data/lib/shipeasy_admin/models/search_response.rb +0 -167
  184. data/lib/shipeasy_admin/models/set_experiment_metrics_request.rb +0 -168
  185. data/lib/shipeasy_admin/models/set_experiment_metrics_request_metrics_inner.rb +0 -216
  186. data/lib/shipeasy_admin/models/set_experiment_metrics_response.rb +0 -179
  187. data/lib/shipeasy_admin/models/set_experiment_metrics_response_metrics_inner.rb +0 -201
  188. data/lib/shipeasy_admin/models/set_experiment_status_request.rb +0 -190
  189. data/lib/shipeasy_admin/models/set_experiment_status_response.rb +0 -214
  190. data/lib/shipeasy_admin/models/set_i18n_label_request.rb +0 -213
  191. data/lib/shipeasy_admin/models/set_i18n_label_response.rb +0 -472
  192. data/lib/shipeasy_admin/models/set_killswitch_switch_response.rb +0 -285
  193. data/lib/shipeasy_admin/models/test_connector_response.rb +0 -189
  194. data/lib/shipeasy_admin/models/unset_killswitch_switch_request.rb +0 -234
  195. data/lib/shipeasy_admin/models/unset_killswitch_switch_response.rb +0 -286
  196. data/lib/shipeasy_admin/models/update_alert_rule_request.rb +0 -304
  197. data/lib/shipeasy_admin/models/update_alert_rule_response.rb +0 -165
  198. data/lib/shipeasy_admin/models/update_config_request.rb +0 -198
  199. data/lib/shipeasy_admin/models/update_config_response.rb +0 -165
  200. data/lib/shipeasy_admin/models/update_config_schema_request.rb +0 -168
  201. data/lib/shipeasy_admin/models/update_config_schema_response.rb +0 -165
  202. data/lib/shipeasy_admin/models/update_connector_request.rb +0 -211
  203. data/lib/shipeasy_admin/models/update_connector_response.rb +0 -166
  204. data/lib/shipeasy_admin/models/update_error_status_request.rb +0 -190
  205. data/lib/shipeasy_admin/models/update_event_request.rb +0 -198
  206. data/lib/shipeasy_admin/models/update_event_response.rb +0 -166
  207. data/lib/shipeasy_admin/models/update_experiment_request.rb +0 -747
  208. data/lib/shipeasy_admin/models/update_experiment_response.rb +0 -165
  209. data/lib/shipeasy_admin/models/update_gate_request.rb +0 -403
  210. data/lib/shipeasy_admin/models/update_gate_response.rb +0 -166
  211. data/lib/shipeasy_admin/models/update_i18n_key_request.rb +0 -176
  212. data/lib/shipeasy_admin/models/update_i18n_key_response.rb +0 -166
  213. data/lib/shipeasy_admin/models/update_killswitch_request.rb +0 -224
  214. data/lib/shipeasy_admin/models/update_killswitch_response.rb +0 -165
  215. data/lib/shipeasy_admin/models/update_ops_item_request.rb +0 -205
  216. data/lib/shipeasy_admin/models/update_ops_item_response.rb +0 -166
  217. data/lib/shipeasy_admin/models/update_universe_request.rb +0 -213
  218. data/lib/shipeasy_admin/models/update_universe_response.rb +0 -165
  219. data/lib/shipeasy_admin/models/upsert_project_request.rb +0 -222
  220. 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
- #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.
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
- # Create a feature gate
23
- # Creates a new gate. Default `enabled: true` at the supplied `rollout_pct` (`0` = fully dark). Only `name` is required. Request fields use snake_case (`owner_email`); the GET response returns camelCase (`ownerEmail`, `groupName`). Returns `409` if `name` already exists in the project (case-sensitive). **Use cases** - **Dark create + ramp later** `{ \"name\": \"checkout_v2\" }` at 0% rollout. Ramp via PATCH after deploy validation. - **Targeted rollout** — supply `rules` to gate the caller (e.g. only `plan = pro` users) plus a `rollout_pct` to bucket within that audience. - **Gatekeeper stack** supply `stack` instead of `rules`/`rollout_pct` for `internal beta public` fall-through. Stack entries evaluated top-to-bottom; first match wins. - **Dashboard metadata** populate `title`, `description`, `folder`, `group`, `owner_email` so the admin UI is self-documenting from day one. - **Disabled on create** pre-provision with `enabled: false` for a future launch; flip on with `POST /{id}/enable` at go-live.
24
- # @param create_gate_request [CreateGateRequest]
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 thereuse `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 [CreateGateResponse]
28
- def create_gate(create_gate_request, opts = {})
29
- data, _status_code, _headers = create_gate_with_http_info(create_gate_request, opts)
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
- # Create a feature gate
34
- # Creates a new gate. Default `enabled: true` at the supplied `rollout_pct` (`0` = fully dark). Only `name` is required. Request fields use snake_case (`owner_email`); the GET response returns camelCase (`ownerEmail`, `groupName`). Returns `409` if `name` already exists in the project (case-sensitive). **Use cases** - **Dark create + ramp later** `{ \"name\": \"checkout_v2\" }` at 0% rollout. Ramp via PATCH after deploy validation. - **Targeted rollout** — supply `rules` to gate the caller (e.g. only `plan = pro` users) plus a `rollout_pct` to bucket within that audience. - **Gatekeeper stack** supply `stack` instead of `rules`/`rollout_pct` for `internal beta public` fall-through. Stack entries evaluated top-to-bottom; first match wins. - **Dashboard metadata** populate `title`, `description`, `folder`, `group`, `owner_email` so the admin UI is self-documenting from day one. - **Disabled on create** pre-provision with `enabled: false` for a future launch; flip on with `POST /{id}/enable` at go-live.
35
- # @param create_gate_request [CreateGateRequest]
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 thereuse `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<(CreateGateResponse, Integer, Hash)>] CreateGateResponse data, response status code and response headers
39
- def create_gate_with_http_info(create_gate_request, opts = {})
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.create_gate ...'
43
+ @api_client.config.logger.debug 'Calling API: FlagsApi.add_to_gate_whitelist ...'
42
44
  end
43
- # verify the required parameter 'create_gate_request' is set
44
- if @api_client.config.client_side_validation && create_gate_request.nil?
45
- fail ArgumentError, "Missing the required parameter 'create_gate_request' when calling FlagsApi.create_gate"
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(create_gate_request)
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] || 'CreateGateResponse'
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.create_gate",
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#create_gate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
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 (&#x60;gat_…&#x60;) or the gate&#39;s &#x60;name&#x60;.
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 (&#x60;gat_…&#x60;) or the gate&#39;s &#x60;name&#x60;.
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
- # Disable a gate
156
- # Sets `enabled: false` so the gate evaluates to `false` for every caller, regardless of `rollout_pct` or `rules`. Use as a quick kill switch. **Use case:** Flip a gate off in production without redeploying the canonical kill-switch flow.
157
- # @param id [String] Stable opaque gate id (&#x60;gat_…&#x60;) or the gate&#39;s &#x60;name&#x60;.
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 (&#x60;gate_…&#x60;) or the gate&#39;s &#x60;name&#x60;.
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 [DisableGateResponse]
161
- def disable_gate(id, opts = {})
162
- data, _status_code, _headers = disable_gate_with_http_info(id, opts)
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
- # Disable a gate
167
- # Sets &#x60;enabled: false&#x60; so the gate evaluates to &#x60;false&#x60; for every caller, regardless of &#x60;rollout_pct&#x60; or &#x60;rules&#x60;. Use as a quick kill switch. **Use case:** Flip a gate off in production without redeploying the canonical kill-switch flow.
168
- # @param id [String] Stable opaque gate id (&#x60;gat_…&#x60;) or the gate&#39;s &#x60;name&#x60;.
118
+ # Read a gate&#39;s whitelist
119
+ # Returns the gate&#39;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 &#x60;entries: []&#x60; (and the default &#x60;attr&#x60;), 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 (&#x60;gate_…&#x60;) or the gate&#39;s &#x60;name&#x60;.
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<(DisableGateResponse, Integer, Hash)>] DisableGateResponse data, response status code and response headers
172
- def disable_gate_with_http_info(id, opts = {})
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.disable_gate ...'
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.disable_gate"
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}/disable'.sub('{id}', CGI.escape(id.to_s))
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] || 'DisableGateResponse'
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.disable_gate",
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(:POST, local_var_path, new_options)
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#disable_gate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
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
- # Enable a gate
222
- # Sets `enabled: true`. The current `rollout_pct` is preserved. **Use case:** Re-enable a previously disabled gate without re-issuing a full update.
223
- # @param id [String] Stable opaque gate id (&#x60;gat_…&#x60;) or the gate&#39;s &#x60;name&#x60;.
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 (&#x60;gate_…&#x60;) or the gate&#39;s &#x60;name&#x60;.
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 [EnableGateResponse]
227
- def enable_gate(id, opts = {})
228
- data, _status_code, _headers = enable_gate_with_http_info(id, opts)
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
- # Enable a gate
233
- # Sets &#x60;enabled: true&#x60;. The current &#x60;rollout_pct&#x60; is preserved. **Use case:** Re-enable a previously disabled gate without re-issuing a full update.
234
- # @param id [String] Stable opaque gate id (&#x60;gat_…&#x60;) or the gate&#39;s &#x60;name&#x60;.
193
+ # Remove entries from a gate&#39;s whitelist
194
+ # Removes identities from the gate&#39;s whitelist. Entries that aren&#39;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 &#x60;PUT&#x60; with &#x60;entries: []&#x60;. **Use case:** Revoke one beta tester&#39;s access without touching anyone else&#39;s.
195
+ # @param id [String] Stable opaque gate id (&#x60;gate_…&#x60;) or the gate&#39;s &#x60;name&#x60;.
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<(EnableGateResponse, Integer, Hash)>] EnableGateResponse data, response status code and response headers
238
- def enable_gate_with_http_info(id, opts = {})
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.enable_gate ...'
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.enable_gate"
206
+ fail ArgumentError, "Missing the required parameter 'id' when calling FlagsApi.remove_from_gate_whitelist"
245
207
  end
246
- # resource path
247
- local_var_path = '/api/admin/gates/{id}/enable'.sub('{id}', CGI.escape(id.to_s))
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
- # List feature gates
288
- # 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.
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&#39;s &#x60;next_cursor&#x60;. 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 &#x60;updated_at desc, id desc&#x60;. Use the &#x60;cursor&#x60; 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&#39;s &#x60;next_cursor&#x60;. 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
- if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
315
- fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling FlagsApi.list_gates, must be greater than or equal to 1.'
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] || 'ListGatesResponse'
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.list_gates",
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(:GET, local_var_path, new_options)
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#list_gates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
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
- # Update a feature gate
362
- # Partial update only supplied fields change. Array fields (`rules`, `stack`) **replace** wholesale; there is no merge or append. `name` and the gate id are immutable. The response carries only `{ id }` re-fetch via `GET /api/admin/gates` for the new row. **Use cases** - **Ramp rollout** `{ \"rollout_pct\": 5000 }` for 50%. Basis points (0–10000); `100` = 1%. - **Kill switch** `{ \"enabled\": false }`. Forces evaluation to `false` for every caller regardless of rules/rollout. Re-enable with `POST /{id}/enable` or `{ \"enabled\": true }`. - **Modify a rule's `in` set** — send the full new `rules` array. To add `'GB'` to `['US','CA']`: `{ \"rules\": [{ \"attr\": \"country\", \"op\": \"in\", \"value\": [\"US\",\"CA\",\"GB\"] }] }`. No per-rule patch endpoint. - **Add targeting from scratch** — `{ \"rules\": [{ \"attr\": \"email\", \"op\": \"regex\", \"value\": \"@acme\\\\.com$\" }] }`. - **Switch to gatekeeper stack** — send a non-null `stack`. To revert to flat eval, send `{ \"stack\": null }`. - **Update metadata** — any subset of `title`, `description`, `folder`, `group`, `owner_email`.
363
- # @param id [String] Stable opaque gate id (&#x60;gat_…&#x60;) or the gate&#39;s &#x60;name&#x60;.
364
- # @param update_gate_request [UpdateGateRequest]
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. Idempotentthe 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 (&#x60;gate_…&#x60;) or the gate&#39;s &#x60;name&#x60;.
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 [UpdateGateResponse]
368
- def update_gate(id, update_gate_request, opts = {})
369
- data, _status_code, _headers = update_gate_with_http_info(id, update_gate_request, opts)
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
- # Update a feature gate
374
- # Partial update only supplied fields change. Array fields (&#x60;rules&#x60;, &#x60;stack&#x60;) **replace** wholesale; there is no merge or append. &#x60;name&#x60; and the gate id are immutable. The response carries only &#x60;{ id }&#x60; re-fetch via &#x60;GET /api/admin/gates&#x60; for the new row. **Use cases** - **Ramp rollout** &#x60;{ \&quot;rollout_pct\&quot;: 5000 }&#x60; for 50%. Basis points (0–10000); &#x60;100&#x60; &#x3D; 1%. - **Kill switch** — &#x60;{ \&quot;enabled\&quot;: false }&#x60;. Forces evaluation to &#x60;false&#x60; for every caller regardless of rules/rollout. Re-enable with &#x60;POST /{id}/enable&#x60; or &#x60;{ \&quot;enabled\&quot;: true }&#x60;. - **Modify a rule&#39;s &#x60;in&#x60; set** — send the full new &#x60;rules&#x60; array. To add &#x60;&#39;GB&#39;&#x60; to &#x60;[&#39;US&#39;,&#39;CA&#39;]&#x60;: &#x60;{ \&quot;rules\&quot;: [{ \&quot;attr\&quot;: \&quot;country\&quot;, \&quot;op\&quot;: \&quot;in\&quot;, \&quot;value\&quot;: [\&quot;US\&quot;,\&quot;CA\&quot;,\&quot;GB\&quot;] }] }&#x60;. No per-rule patch endpoint. - **Add targeting from scratch** — &#x60;{ \&quot;rules\&quot;: [{ \&quot;attr\&quot;: \&quot;email\&quot;, \&quot;op\&quot;: \&quot;regex\&quot;, \&quot;value\&quot;: \&quot;@acme\\\\.com$\&quot; }] }&#x60;. - **Switch to gatekeeper stack** — send a non-null &#x60;stack&#x60;. To revert to flat eval, send &#x60;{ \&quot;stack\&quot;: null }&#x60;. - **Update metadata** — any subset of &#x60;title&#x60;, &#x60;description&#x60;, &#x60;folder&#x60;, &#x60;group&#x60;, &#x60;owner_email&#x60;.
375
- # @param id [String] Stable opaque gate id (&#x60;gat_…&#x60;) or the gate&#39;s &#x60;name&#x60;.
376
- # @param update_gate_request [UpdateGateRequest]
278
+ # Replace a gate&#39;s whitelist
279
+ # Replaces the gate&#39;s whole whitelist with &#x60;entries&#x60;, creating the block if the gate didn&#39;t have one. Idempotentthe same call twice leaves the same list. This is the only whitelist call that can switch &#x60;attr&#x60; (&#x60;email&#x60; &#x60;user_id&#x60;) or clear the block: &#x60;entries: []&#x60; removes the whitelist from the gate entirely. **Use cases** - **Pin an exact list** — &#x60;{ \&quot;entries\&quot;: [\&quot;alice@acme.dev\&quot;, \&quot;bob@acme.dev\&quot;] }&#x60;. - **Switch to user ids** — &#x60;{ \&quot;attr\&quot;: \&quot;user_id\&quot;, \&quot;entries\&quot;: [\&quot;usr_123\&quot;] }&#x60;. - **Drop the whitelist** — &#x60;{ \&quot;entries\&quot;: [] }&#x60;.
280
+ # @param id [String] Stable opaque gate id (&#x60;gate_…&#x60;) or the gate&#39;s &#x60;name&#x60;.
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<(UpdateGateResponse, Integer, Hash)>] UpdateGateResponse data, response status code and response headers
380
- def update_gate_with_http_info(id, update_gate_request, opts = {})
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.update_gate ...'
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.update_gate"
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
- # verify the required parameter 'update_gate_request' is set
389
- if @api_client.config.client_side_validation && update_gate_request.nil?
390
- fail ArgumentError, "Missing the required parameter 'update_gate_request' when calling FlagsApi.update_gate"
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(update_gate_request)
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] || 'UpdateGateResponse'
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.update_gate",
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(:PATCH, local_var_path, new_options)
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#update_gate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
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