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.
Files changed (219) 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/sdk/see.rb +7 -5
  5. data/lib/shipeasy/sdk/version.rb +1 -1
  6. data/lib/shipeasy_admin/api/flags_api.rb +127 -214
  7. data/lib/shipeasy_admin/api/killswitch_api.rb +25 -525
  8. data/lib/shipeasy_admin/api/ops_api.rb +44 -351
  9. data/lib/shipeasy_admin/api_client.rb +2 -2
  10. data/lib/shipeasy_admin/api_error.rb +2 -2
  11. data/lib/shipeasy_admin/api_model_base.rb +2 -2
  12. data/lib/shipeasy_admin/configuration.rb +29 -2
  13. data/lib/shipeasy_admin/models/{set_killswitch_value_request.rb → add_to_gate_whitelist_request.rb} +37 -42
  14. data/lib/shipeasy_admin/models/create_public_bug_request.rb +464 -0
  15. data/lib/shipeasy_admin/models/create_public_feature_request_request.rb +407 -0
  16. data/lib/shipeasy_admin/models/{file_error_ticket_response.rb → create_public_ticket_response.rb} +22 -29
  17. data/lib/shipeasy_admin/models/env.rb +2 -2
  18. data/lib/shipeasy_admin/models/error.rb +41 -7
  19. data/lib/shipeasy_admin/models/error_code.rb +14 -3
  20. data/lib/shipeasy_admin/models/{get_experiment_timeseries_response_experiment.rb → gate_whitelist.rb} +51 -42
  21. data/lib/shipeasy_admin/models/gate_whitelist_attr.rb +40 -0
  22. data/lib/shipeasy_admin/models/killswitch_value.rb +2 -2
  23. data/lib/shipeasy_admin/models/notification_target.rb +2 -2
  24. data/lib/shipeasy_admin/models/notification_target_slack_channel.rb +2 -2
  25. data/lib/shipeasy_admin/models/ops_item_priority.rb +42 -0
  26. data/lib/shipeasy_admin/models/ops_item_status.rb +46 -0
  27. data/lib/shipeasy_admin/models/{discard_config_draft_request.rb → remove_from_gate_whitelist_request.rb} +34 -44
  28. data/lib/shipeasy_admin/models/{delete_alert_rule_response.rb → set_gate_whitelist_request.rb} +37 -25
  29. data/lib/shipeasy_admin/models/{set_killswitch_switch_request.rb → toggle_killswitch_request.rb} +30 -72
  30. data/lib/shipeasy_admin/models/{set_killswitch_value_response.rb → toggle_killswitch_response.rb} +100 -6
  31. data/lib/shipeasy_admin/version.rb +2 -2
  32. data/lib/shipeasy_admin.rb +14 -195
  33. metadata +13 -194
  34. data/lib/shipeasy_admin/api/alerts_api.rb +0 -352
  35. data/lib/shipeasy_admin/api/api_keys_api.rb +0 -229
  36. data/lib/shipeasy_admin/api/attributes_api.rb +0 -82
  37. data/lib/shipeasy_admin/api/configs_api.rb +0 -757
  38. data/lib/shipeasy_admin/api/connectors_api.rb +0 -497
  39. data/lib/shipeasy_admin/api/drafts_api.rb +0 -82
  40. data/lib/shipeasy_admin/api/errors_api.rb +0 -389
  41. data/lib/shipeasy_admin/api/events_api.rb +0 -438
  42. data/lib/shipeasy_admin/api/experiments_api.rb +0 -727
  43. data/lib/shipeasy_admin/api/keys_api.rb +0 -317
  44. data/lib/shipeasy_admin/api/metrics_api.rb +0 -281
  45. data/lib/shipeasy_admin/api/profiles_api.rb +0 -222
  46. data/lib/shipeasy_admin/api/projects_api.rb +0 -216
  47. data/lib/shipeasy_admin/api/universes_api.rb +0 -306
  48. data/lib/shipeasy_admin/models/approve_event_request.rb +0 -198
  49. data/lib/shipeasy_admin/models/approve_event_response.rb +0 -166
  50. data/lib/shipeasy_admin/models/claude_trigger_config.rb +0 -204
  51. data/lib/shipeasy_admin/models/connector_event.rb +0 -40
  52. data/lib/shipeasy_admin/models/connector_provider.rb +0 -45
  53. data/lib/shipeasy_admin/models/connector_record.rb +0 -468
  54. data/lib/shipeasy_admin/models/copilot_trigger_config.rb +0 -276
  55. data/lib/shipeasy_admin/models/create_alert_rule_request.rb +0 -383
  56. data/lib/shipeasy_admin/models/create_alert_rule_response.rb +0 -165
  57. data/lib/shipeasy_admin/models/create_claude_trigger_request.rb +0 -309
  58. data/lib/shipeasy_admin/models/create_config_request.rb +0 -291
  59. data/lib/shipeasy_admin/models/create_config_response.rb +0 -201
  60. data/lib/shipeasy_admin/models/create_connector_request.rb +0 -64
  61. data/lib/shipeasy_admin/models/create_connector_response.rb +0 -165
  62. data/lib/shipeasy_admin/models/create_copilot_trigger_request.rb +0 -316
  63. data/lib/shipeasy_admin/models/create_cursor_trigger_request.rb +0 -352
  64. data/lib/shipeasy_admin/models/create_event_request.rb +0 -236
  65. data/lib/shipeasy_admin/models/create_event_response.rb +0 -193
  66. data/lib/shipeasy_admin/models/create_experiment_request.rb +0 -807
  67. data/lib/shipeasy_admin/models/create_experiment_response.rb +0 -212
  68. data/lib/shipeasy_admin/models/create_gate_request.rb +0 -492
  69. data/lib/shipeasy_admin/models/create_gate_response.rb +0 -212
  70. data/lib/shipeasy_admin/models/create_i18n_profile_request.rb +0 -188
  71. data/lib/shipeasy_admin/models/create_i18n_profile_response.rb +0 -193
  72. data/lib/shipeasy_admin/models/create_jules_trigger_request.rb +0 -352
  73. data/lib/shipeasy_admin/models/create_key_request.rb +0 -297
  74. data/lib/shipeasy_admin/models/create_key_response.rb +0 -286
  75. data/lib/shipeasy_admin/models/create_killswitch_request.rb +0 -274
  76. data/lib/shipeasy_admin/models/create_killswitch_response.rb +0 -201
  77. data/lib/shipeasy_admin/models/create_metric_request.rb +0 -403
  78. data/lib/shipeasy_admin/models/create_metric_response.rb +0 -193
  79. data/lib/shipeasy_admin/models/create_o_auth_connector_request.rb +0 -273
  80. data/lib/shipeasy_admin/models/create_ops_item_request.rb +0 -287
  81. data/lib/shipeasy_admin/models/create_ops_item_response.rb +0 -177
  82. data/lib/shipeasy_admin/models/create_universe_request.rb +0 -272
  83. data/lib/shipeasy_admin/models/create_universe_response.rb +0 -212
  84. data/lib/shipeasy_admin/models/cursor_trigger_config.rb +0 -231
  85. data/lib/shipeasy_admin/models/delete_config_response.rb +0 -188
  86. data/lib/shipeasy_admin/models/delete_connector_response.rb +0 -188
  87. data/lib/shipeasy_admin/models/delete_event_response.rb +0 -189
  88. data/lib/shipeasy_admin/models/delete_experiment_response.rb +0 -188
  89. data/lib/shipeasy_admin/models/delete_gate_response.rb +0 -188
  90. data/lib/shipeasy_admin/models/delete_killswitch_response.rb +0 -188
  91. data/lib/shipeasy_admin/models/delete_metric_response.rb +0 -189
  92. data/lib/shipeasy_admin/models/delete_universe_response.rb +0 -188
  93. data/lib/shipeasy_admin/models/disable_gate_response.rb +0 -190
  94. data/lib/shipeasy_admin/models/discard_config_draft_response.rb +0 -188
  95. data/lib/shipeasy_admin/models/enable_gate_response.rb +0 -190
  96. data/lib/shipeasy_admin/models/error_record.rb +0 -597
  97. data/lib/shipeasy_admin/models/error_series_request.rb +0 -251
  98. data/lib/shipeasy_admin/models/error_series_response.rb +0 -195
  99. data/lib/shipeasy_admin/models/error_series_response_rows_inner.rb +0 -192
  100. data/lib/shipeasy_admin/models/experiment_inline_metric.rb +0 -337
  101. data/lib/shipeasy_admin/models/fire_connector_request.rb +0 -149
  102. data/lib/shipeasy_admin/models/fire_connector_response.rb +0 -176
  103. data/lib/shipeasy_admin/models/get_config_response.rb +0 -351
  104. data/lib/shipeasy_admin/models/get_current_project_response.rb +0 -606
  105. data/lib/shipeasy_admin/models/get_current_project_response_module_translations.rb +0 -104
  106. data/lib/shipeasy_admin/models/get_event_response.rb +0 -344
  107. data/lib/shipeasy_admin/models/get_experiment_response.rb +0 -688
  108. data/lib/shipeasy_admin/models/get_experiment_results_response.rb +0 -243
  109. data/lib/shipeasy_admin/models/get_experiment_results_response_experiment.rb +0 -248
  110. data/lib/shipeasy_admin/models/get_experiment_results_response_results_inner.rb +0 -252
  111. data/lib/shipeasy_admin/models/get_experiment_timeseries_response.rb +0 -192
  112. data/lib/shipeasy_admin/models/get_experiment_timeseries_response_series_inner.rb +0 -278
  113. data/lib/shipeasy_admin/models/get_killswitch_response.rb +0 -270
  114. data/lib/shipeasy_admin/models/get_metric_response.rb +0 -378
  115. data/lib/shipeasy_admin/models/get_ops_item_response.rb +0 -349
  116. data/lib/shipeasy_admin/models/jules_trigger_config.rb +0 -240
  117. data/lib/shipeasy_admin/models/key_record.rb +0 -353
  118. data/lib/shipeasy_admin/models/link_pr_to_ops_item_request.rb +0 -186
  119. data/lib/shipeasy_admin/models/link_pr_to_ops_item_response.rb +0 -166
  120. data/lib/shipeasy_admin/models/list_alert_rules_response_inner.rb +0 -478
  121. data/lib/shipeasy_admin/models/list_attributes_response_inner.rb +0 -176
  122. data/lib/shipeasy_admin/models/list_config_activity_response_inner.rb +0 -280
  123. data/lib/shipeasy_admin/models/list_configs_response.rb +0 -178
  124. data/lib/shipeasy_admin/models/list_configs_response_data_inner.rb +0 -351
  125. data/lib/shipeasy_admin/models/list_configs_response_data_inner_drafts_value.rb +0 -237
  126. data/lib/shipeasy_admin/models/list_configs_response_data_inner_envs_value.rb +0 -237
  127. data/lib/shipeasy_admin/models/list_events_response_inner.rb +0 -344
  128. data/lib/shipeasy_admin/models/list_events_response_inner_properties_inner.rb +0 -259
  129. data/lib/shipeasy_admin/models/list_experiments_response.rb +0 -178
  130. data/lib/shipeasy_admin/models/list_experiments_response_data_inner.rb +0 -688
  131. data/lib/shipeasy_admin/models/list_experiments_response_data_inner_groups_inner.rb +0 -241
  132. data/lib/shipeasy_admin/models/list_gates_response.rb +0 -178
  133. data/lib/shipeasy_admin/models/list_gates_response_data_inner.rb +0 -395
  134. data/lib/shipeasy_admin/models/list_gates_response_data_inner_enabled.rb +0 -104
  135. data/lib/shipeasy_admin/models/list_gates_response_data_inner_rules_inner.rb +0 -238
  136. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner.rb +0 -105
  137. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of.rb +0 -358
  138. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of1.rb +0 -331
  139. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of_ramp.rb +0 -319
  140. data/lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb +0 -272
  141. data/lib/shipeasy_admin/models/list_i18n_keys_response.rb +0 -195
  142. data/lib/shipeasy_admin/models/list_i18n_keys_response_keys_inner.rb +0 -274
  143. data/lib/shipeasy_admin/models/list_i18n_profiles_response_inner.rb +0 -224
  144. data/lib/shipeasy_admin/models/list_keys_response.rb +0 -180
  145. data/lib/shipeasy_admin/models/list_killswitches_response.rb +0 -178
  146. data/lib/shipeasy_admin/models/list_killswitches_response_data_inner.rb +0 -270
  147. data/lib/shipeasy_admin/models/list_killswitches_response_data_inner_envs_value.rb +0 -248
  148. data/lib/shipeasy_admin/models/list_metrics_response_inner.rb +0 -378
  149. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir.rb +0 -288
  150. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg.rb +0 -113
  151. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of.rb +0 -188
  152. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of1.rb +0 -188
  153. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of2.rb +0 -188
  154. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of3.rb +0 -188
  155. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of4.rb +0 -188
  156. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of5.rb +0 -188
  157. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of6.rb +0 -188
  158. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of7.rb +0 -217
  159. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of8.rb +0 -233
  160. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9.rb +0 -240
  161. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator.rb +0 -266
  162. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator_filters_inner.rb +0 -264
  163. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_group_by.rb +0 -228
  164. data/lib/shipeasy_admin/models/list_ops_items_response_inner.rb +0 -349
  165. data/lib/shipeasy_admin/models/list_slack_channels_response.rb +0 -195
  166. data/lib/shipeasy_admin/models/list_slack_channels_response_channels_inner.rb +0 -203
  167. data/lib/shipeasy_admin/models/list_universes_response.rb +0 -178
  168. data/lib/shipeasy_admin/models/list_universes_response_data_inner.rb +0 -305
  169. data/lib/shipeasy_admin/models/notify_ops_request.rb +0 -261
  170. data/lib/shipeasy_admin/models/notify_ops_response.rb +0 -193
  171. data/lib/shipeasy_admin/models/publish_config_draft_request.rb +0 -187
  172. data/lib/shipeasy_admin/models/publish_config_draft_response.rb +0 -257
  173. data/lib/shipeasy_admin/models/publish_i18n_profile_response.rb +0 -391
  174. data/lib/shipeasy_admin/models/push_i18n_keys_request.rb +0 -195
  175. data/lib/shipeasy_admin/models/push_i18n_keys_request_keys_inner.rb +0 -192
  176. data/lib/shipeasy_admin/models/push_i18n_keys_response.rb +0 -251
  177. data/lib/shipeasy_admin/models/reanalyze_experiment_response.rb +0 -214
  178. data/lib/shipeasy_admin/models/revoke_key_response.rb +0 -216
  179. data/lib/shipeasy_admin/models/save_config_draft_request.rb +0 -199
  180. data/lib/shipeasy_admin/models/save_config_draft_response.rb +0 -283
  181. data/lib/shipeasy_admin/models/search_hit.rb +0 -284
  182. data/lib/shipeasy_admin/models/search_response.rb +0 -167
  183. data/lib/shipeasy_admin/models/set_experiment_metrics_request.rb +0 -168
  184. data/lib/shipeasy_admin/models/set_experiment_metrics_request_metrics_inner.rb +0 -216
  185. data/lib/shipeasy_admin/models/set_experiment_metrics_response.rb +0 -179
  186. data/lib/shipeasy_admin/models/set_experiment_metrics_response_metrics_inner.rb +0 -201
  187. data/lib/shipeasy_admin/models/set_experiment_status_request.rb +0 -190
  188. data/lib/shipeasy_admin/models/set_experiment_status_response.rb +0 -214
  189. data/lib/shipeasy_admin/models/set_i18n_label_request.rb +0 -213
  190. data/lib/shipeasy_admin/models/set_i18n_label_response.rb +0 -472
  191. data/lib/shipeasy_admin/models/set_killswitch_switch_response.rb +0 -285
  192. data/lib/shipeasy_admin/models/test_connector_response.rb +0 -189
  193. data/lib/shipeasy_admin/models/unset_killswitch_switch_request.rb +0 -234
  194. data/lib/shipeasy_admin/models/unset_killswitch_switch_response.rb +0 -286
  195. data/lib/shipeasy_admin/models/update_alert_rule_request.rb +0 -304
  196. data/lib/shipeasy_admin/models/update_alert_rule_response.rb +0 -165
  197. data/lib/shipeasy_admin/models/update_config_request.rb +0 -198
  198. data/lib/shipeasy_admin/models/update_config_response.rb +0 -165
  199. data/lib/shipeasy_admin/models/update_config_schema_request.rb +0 -168
  200. data/lib/shipeasy_admin/models/update_config_schema_response.rb +0 -165
  201. data/lib/shipeasy_admin/models/update_connector_request.rb +0 -211
  202. data/lib/shipeasy_admin/models/update_connector_response.rb +0 -166
  203. data/lib/shipeasy_admin/models/update_error_status_request.rb +0 -190
  204. data/lib/shipeasy_admin/models/update_event_request.rb +0 -198
  205. data/lib/shipeasy_admin/models/update_event_response.rb +0 -166
  206. data/lib/shipeasy_admin/models/update_experiment_request.rb +0 -747
  207. data/lib/shipeasy_admin/models/update_experiment_response.rb +0 -165
  208. data/lib/shipeasy_admin/models/update_gate_request.rb +0 -403
  209. data/lib/shipeasy_admin/models/update_gate_response.rb +0 -166
  210. data/lib/shipeasy_admin/models/update_i18n_key_request.rb +0 -176
  211. data/lib/shipeasy_admin/models/update_i18n_key_response.rb +0 -166
  212. data/lib/shipeasy_admin/models/update_killswitch_request.rb +0 -224
  213. data/lib/shipeasy_admin/models/update_killswitch_response.rb +0 -165
  214. data/lib/shipeasy_admin/models/update_ops_item_request.rb +0 -205
  215. data/lib/shipeasy_admin/models/update_ops_item_response.rb +0 -166
  216. data/lib/shipeasy_admin/models/update_universe_request.rb +0 -213
  217. data/lib/shipeasy_admin/models/update_universe_response.rb +0 -165
  218. data/lib/shipeasy_admin/models/upsert_project_request.rb +0 -222
  219. 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,466 +19,43 @@ module Shipeasy::Admin::Generated
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # Create a killswitch
23
- # Creates a new killswitch with `value` (default `false`) applied to **every** env at version 1. Returns `409` if `name` already exists in the project. **Use cases** - **Untripped create** — `{ \"name\": \"payments.checkout\" }`. Provision the kill ahead of an incident. - **Pre-tripped** — `{ \"value\": true }` to ship the killswitch already engaged. - **With switches** — seed `switches` to carve out per-region/per-tenant kills from day one.
24
- # @param create_killswitch_request [CreateKillswitchRequest]
25
- # @param [Hash] opts the optional parameters
26
- # @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
27
- # @return [CreateKillswitchResponse]
28
- def create_killswitch(create_killswitch_request, opts = {})
29
- data, _status_code, _headers = create_killswitch_with_http_info(create_killswitch_request, opts)
30
- data
31
- end
32
-
33
- # Create a killswitch
34
- # Creates a new killswitch with `value` (default `false`) applied to **every** env at version 1. Returns `409` if `name` already exists in the project. **Use cases** - **Untripped create** — `{ \"name\": \"payments.checkout\" }`. Provision the kill ahead of an incident. - **Pre-tripped** — `{ \"value\": true }` to ship the killswitch already engaged. - **With switches** — seed `switches` to carve out per-region/per-tenant kills from day one.
35
- # @param create_killswitch_request [CreateKillswitchRequest]
36
- # @param [Hash] opts the optional parameters
37
- # @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
38
- # @return [Array<(CreateKillswitchResponse, Integer, Hash)>] CreateKillswitchResponse data, response status code and response headers
39
- def create_killswitch_with_http_info(create_killswitch_request, opts = {})
40
- if @api_client.config.debugging
41
- @api_client.config.logger.debug 'Calling API: KillswitchApi.create_killswitch ...'
42
- end
43
- # verify the required parameter 'create_killswitch_request' is set
44
- if @api_client.config.client_side_validation && create_killswitch_request.nil?
45
- fail ArgumentError, "Missing the required parameter 'create_killswitch_request' when calling KillswitchApi.create_killswitch"
46
- end
47
- # resource path
48
- local_var_path = '/api/admin/killswitches'
49
-
50
- # query parameters
51
- query_params = opts[:query_params] || {}
52
-
53
- # header parameters
54
- header_params = opts[:header_params] || {}
55
- # HTTP header 'Accept' (if needed)
56
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
57
- # HTTP header 'Content-Type'
58
- content_type = @api_client.select_header_content_type(['application/json'])
59
- if !content_type.nil?
60
- header_params['Content-Type'] = content_type
61
- end
62
- header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
63
-
64
- # form parameters
65
- form_params = opts[:form_params] || {}
66
-
67
- # http body (model)
68
- post_body = opts[:debug_body] || @api_client.object_to_http_body(create_killswitch_request)
69
-
70
- # return_type
71
- return_type = opts[:debug_return_type] || 'CreateKillswitchResponse'
72
-
73
- # auth_names
74
- auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
75
-
76
- new_options = opts.merge(
77
- :operation => :"KillswitchApi.create_killswitch",
78
- :header_params => header_params,
79
- :query_params => query_params,
80
- :form_params => form_params,
81
- :body => post_body,
82
- :auth_names => auth_names,
83
- :return_type => return_type
84
- )
85
-
86
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
87
- if @api_client.config.debugging
88
- @api_client.config.logger.debug "API called: KillswitchApi#create_killswitch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
- end
90
- return data, status_code, headers
91
- end
92
-
93
- # Delete a killswitch
94
- # Soft-deletes the killswitch and rebuilds the project's flags KV blob so SDKs stop seeing it. **Use case:** Tear down a killswitch after the feature it protected has been removed.
22
+ # Toggle a killswitch or one of its switches
23
+ # Flips a killswitch on one environment and publishes a new version there. This is the one-call incident verb: it reads the current value, flips it, and publishes, so you don't have to fetch the killswitch first. Every body field is optional, which is what makes the call widen cleanly: - **Flip the killswitch** — `{}`. Flips the flat `value` on `prod`. - **Flip one sub-switch** — `{ \"switchKey\": \"eu_region\" }`. Flips that entry on `prod`, creating it (from `false`) if it isn't in the map yet. - **Set it idempotently** — `{ \"switchKey\": \"eu_region\", \"value\": true }`. Publishes exactly that value, so a retried call can't undo the first one. A `null` `value` means \"flip\", not \"set to null\". - **Choose the environment** — add `\"env\": \"staging\"`. Omitted, `env` is `prod`. The response reports both `previous` and `value`, so a caller that asked for a flip can see what it actually changed. Prefer this over `PUT /{id}/value` and `PUT /{id}/switch` unless you specifically need those endpoints' unconditional set semantics.
95
24
  # @param id [String] Stable opaque killswitch id (&#x60;ksw_…&#x60;) or the killswitch&#39;s &#x60;name&#x60;.
96
25
  # @param [Hash] opts the optional parameters
97
26
  # @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
98
- # @return [DeleteKillswitchResponse]
99
- def delete_killswitch(id, opts = {})
100
- data, _status_code, _headers = delete_killswitch_with_http_info(id, opts)
27
+ # @option opts [ToggleKillswitchRequest] :toggle_killswitch_request
28
+ # @return [ToggleKillswitchResponse]
29
+ def toggle_killswitch(id, opts = {})
30
+ data, _status_code, _headers = toggle_killswitch_with_http_info(id, opts)
101
31
  data
102
32
  end
103
33
 
104
- # Delete a killswitch
105
- # Soft-deletes the killswitch and rebuilds the project&#39;s flags KV blob so SDKs stop seeing it. **Use case:** Tear down a killswitch after the feature it protected has been removed.
34
+ # Toggle a killswitch or one of its switches
35
+ # Flips a killswitch on one environment and publishes a new version there. This is the one-call incident verb: it reads the current value, flips it, and publishes, so you don&#39;t have to fetch the killswitch first. Every body field is optional, which is what makes the call widen cleanly: - **Flip the killswitch** — &#x60;{}&#x60;. Flips the flat &#x60;value&#x60; on &#x60;prod&#x60;. - **Flip one sub-switch** — &#x60;{ \&quot;switchKey\&quot;: \&quot;eu_region\&quot; }&#x60;. Flips that entry on &#x60;prod&#x60;, creating it (from &#x60;false&#x60;) if it isn&#39;t in the map yet. - **Set it idempotently** &#x60;{ \&quot;switchKey\&quot;: \&quot;eu_region\&quot;, \&quot;value\&quot;: true }&#x60;. Publishes exactly that value, so a retried call can&#39;t undo the first one. A &#x60;null&#x60; &#x60;value&#x60; means \&quot;flip\&quot;, not \&quot;set to null\&quot;. - **Choose the environment** — add &#x60;\&quot;env\&quot;: \&quot;staging\&quot;&#x60;. Omitted, &#x60;env&#x60; is &#x60;prod&#x60;. The response reports both &#x60;previous&#x60; and &#x60;value&#x60;, so a caller that asked for a flip can see what it actually changed. Prefer this over &#x60;PUT /{id}/value&#x60; and &#x60;PUT /{id}/switch&#x60; unless you specifically need those endpoints&#39; unconditional set semantics.
106
36
  # @param id [String] Stable opaque killswitch id (&#x60;ksw_…&#x60;) or the killswitch&#39;s &#x60;name&#x60;.
107
37
  # @param [Hash] opts the optional parameters
108
38
  # @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<(DeleteKillswitchResponse, Integer, Hash)>] DeleteKillswitchResponse data, response status code and response headers
110
- def delete_killswitch_with_http_info(id, opts = {})
39
+ # @option opts [ToggleKillswitchRequest] :toggle_killswitch_request
40
+ # @return [Array<(ToggleKillswitchResponse, Integer, Hash)>] ToggleKillswitchResponse data, response status code and response headers
41
+ def toggle_killswitch_with_http_info(id, opts = {})
111
42
  if @api_client.config.debugging
112
- @api_client.config.logger.debug 'Calling API: KillswitchApi.delete_killswitch ...'
43
+ @api_client.config.logger.debug 'Calling API: KillswitchApi.toggle_killswitch ...'
113
44
  end
114
45
  # verify the required parameter 'id' is set
115
46
  if @api_client.config.client_side_validation && id.nil?
116
- fail ArgumentError, "Missing the required parameter 'id' when calling KillswitchApi.delete_killswitch"
47
+ fail ArgumentError, "Missing the required parameter 'id' when calling KillswitchApi.toggle_killswitch"
117
48
  end
118
- # resource path
119
- local_var_path = '/api/admin/killswitches/{id}'.sub('{id}', CGI.escape(id.to_s))
120
-
121
- # query parameters
122
- query_params = opts[:query_params] || {}
123
-
124
- # header parameters
125
- header_params = opts[:header_params] || {}
126
- # HTTP header 'Accept' (if needed)
127
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
128
- header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
129
-
130
- # form parameters
131
- form_params = opts[:form_params] || {}
132
-
133
- # http body (model)
134
- post_body = opts[:debug_body]
135
-
136
- # return_type
137
- return_type = opts[:debug_return_type] || 'DeleteKillswitchResponse'
138
-
139
- # auth_names
140
- auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
141
-
142
- new_options = opts.merge(
143
- :operation => :"KillswitchApi.delete_killswitch",
144
- :header_params => header_params,
145
- :query_params => query_params,
146
- :form_params => form_params,
147
- :body => post_body,
148
- :auth_names => auth_names,
149
- :return_type => return_type
150
- )
151
-
152
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
153
- if @api_client.config.debugging
154
- @api_client.config.logger.debug "API called: KillswitchApi#delete_killswitch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
49
+ if @api_client.config.client_side_validation && id.to_s.length > 128
50
+ fail ArgumentError, 'invalid value for "id" when calling KillswitchApi.toggle_killswitch, the character length must be smaller than or equal to 128.'
155
51
  end
156
- return data, status_code, headers
157
- end
158
-
159
- # Get one killswitch
160
- # Returns the killswitch metadata plus the latest published `value`/`switches`/`version` per env. **Use case:** Fetch the current state of one killswitch — e.g. to verify a trip propagated before declaring an incident mitigated.
161
- # @param id [String] Stable opaque killswitch id (&#x60;ksw_…&#x60;) or the killswitch&#39;s &#x60;name&#x60;.
162
- # @param [Hash] opts the optional parameters
163
- # @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).
164
- # @return [GetKillswitchResponse]
165
- def get_killswitch(id, opts = {})
166
- data, _status_code, _headers = get_killswitch_with_http_info(id, opts)
167
- data
168
- end
169
52
 
170
- # Get one killswitch
171
- # Returns the killswitch metadata plus the latest published &#x60;value&#x60;/&#x60;switches&#x60;/&#x60;version&#x60; per env. **Use case:** Fetch the current state of one killswitch e.g. to verify a trip propagated before declaring an incident mitigated.
172
- # @param id [String] Stable opaque killswitch id (&#x60;ksw_…&#x60;) or the killswitch&#39;s &#x60;name&#x60;.
173
- # @param [Hash] opts the optional parameters
174
- # @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
175
- # @return [Array<(GetKillswitchResponse, Integer, Hash)>] GetKillswitchResponse data, response status code and response headers
176
- def get_killswitch_with_http_info(id, opts = {})
177
- if @api_client.config.debugging
178
- @api_client.config.logger.debug 'Calling API: KillswitchApi.get_killswitch ...'
179
- end
180
- # resource path
181
- local_var_path = '/api/admin/killswitches/{id}'.sub('{id}', CGI.escape(id.to_s))
182
-
183
- # query parameters
184
- query_params = opts[:query_params] || {}
185
-
186
- # header parameters
187
- header_params = opts[:header_params] || {}
188
- # HTTP header 'Accept' (if needed)
189
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
190
- header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
191
-
192
- # form parameters
193
- form_params = opts[:form_params] || {}
194
-
195
- # http body (model)
196
- post_body = opts[:debug_body]
197
-
198
- # return_type
199
- return_type = opts[:debug_return_type] || 'GetKillswitchResponse'
200
-
201
- # auth_names
202
- auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
203
-
204
- new_options = opts.merge(
205
- :operation => :"KillswitchApi.get_killswitch",
206
- :header_params => header_params,
207
- :query_params => query_params,
208
- :form_params => form_params,
209
- :body => post_body,
210
- :auth_names => auth_names,
211
- :return_type => return_type
212
- )
213
-
214
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
215
- if @api_client.config.debugging
216
- @api_client.config.logger.debug "API called: KillswitchApi#get_killswitch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
217
- end
218
- return data, status_code, headers
219
- end
220
-
221
- # List killswitches
222
- # Returns a single page of killswitches ordered by `updated_at desc, id desc`. Each row includes the latest published `value`/`switches`/`version` per env. **Use case:** Snapshot every killswitch in the project — e.g. to render an incident-response runbook listing every kill and its current trip state.
223
- # @param [Hash] opts the optional parameters
224
- # @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).
225
- # @option opts [Integer] :limit Page size (1–500). Defaults to 100. (default to 100)
226
- # @option opts [String] :cursor Opaque cursor returned in the previous page&#39;s &#x60;next_cursor&#x60;. Omit for the first page.
227
- # @return [ListKillswitchesResponse]
228
- def list_killswitches(opts = {})
229
- data, _status_code, _headers = list_killswitches_with_http_info(opts)
230
- data
231
- end
232
-
233
- # List killswitches
234
- # Returns a single page of killswitches ordered by &#x60;updated_at desc, id desc&#x60;. Each row includes the latest published &#x60;value&#x60;/&#x60;switches&#x60;/&#x60;version&#x60; per env. **Use case:** Snapshot every killswitch in the project — e.g. to render an incident-response runbook listing every kill and its current trip state.
235
- # @param [Hash] opts the optional parameters
236
- # @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
- # @option opts [Integer] :limit Page size (1–500). Defaults to 100. (default to 100)
238
- # @option opts [String] :cursor Opaque cursor returned in the previous page&#39;s &#x60;next_cursor&#x60;. Omit for the first page.
239
- # @return [Array<(ListKillswitchesResponse, Integer, Hash)>] ListKillswitchesResponse data, response status code and response headers
240
- def list_killswitches_with_http_info(opts = {})
241
- if @api_client.config.debugging
242
- @api_client.config.logger.debug 'Calling API: KillswitchApi.list_killswitches ...'
243
- end
244
- if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
245
- fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling KillswitchApi.list_killswitches, must be smaller than or equal to 500.'
246
- end
247
-
248
- if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
249
- fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling KillswitchApi.list_killswitches, must be greater than or equal to 1.'
53
+ if @api_client.config.client_side_validation && id.to_s.length < 1
54
+ fail ArgumentError, 'invalid value for "id" when calling KillswitchApi.toggle_killswitch, the character length must be greater than or equal to 1.'
250
55
  end
251
56
 
252
57
  # resource path
253
- local_var_path = '/api/admin/killswitches'
254
-
255
- # query parameters
256
- query_params = opts[:query_params] || {}
257
- query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
258
- query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
259
-
260
- # header parameters
261
- header_params = opts[:header_params] || {}
262
- # HTTP header 'Accept' (if needed)
263
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
264
- header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
265
-
266
- # form parameters
267
- form_params = opts[:form_params] || {}
268
-
269
- # http body (model)
270
- post_body = opts[:debug_body]
271
-
272
- # return_type
273
- return_type = opts[:debug_return_type] || 'ListKillswitchesResponse'
274
-
275
- # auth_names
276
- auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
277
-
278
- new_options = opts.merge(
279
- :operation => :"KillswitchApi.list_killswitches",
280
- :header_params => header_params,
281
- :query_params => query_params,
282
- :form_params => form_params,
283
- :body => post_body,
284
- :auth_names => auth_names,
285
- :return_type => return_type
286
- )
287
-
288
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
289
- if @api_client.config.debugging
290
- @api_client.config.logger.debug "API called: KillswitchApi#list_killswitches\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
291
- end
292
- return data, status_code, headers
293
- end
294
-
295
- # Set one switch entry
296
- # Sets or updates a single `switchKey` on a single `env`. Publishes one new version on that env only — other envs untouched. Use this for surgical per-env, per-key flips during incident response (e.g. trip `eu_region` on prod without touching the flat `value` or other envs). **Use cases** - **Trip a region** — `{ \"env\": \"prod\", \"switchKey\": \"eu_region\", \"value\": true }`. - **Untrip without removing** — same payload with `value: false`. To remove the entry entirely use `DELETE /{id}/switch`.
297
- # @param id [String] Stable opaque killswitch id (&#x60;ksw_…&#x60;) or the killswitch&#39;s &#x60;name&#x60;.
298
- # @param set_killswitch_switch_request [SetKillswitchSwitchRequest]
299
- # @param [Hash] opts the optional parameters
300
- # @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).
301
- # @return [SetKillswitchSwitchResponse]
302
- def set_killswitch_switch(id, set_killswitch_switch_request, opts = {})
303
- data, _status_code, _headers = set_killswitch_switch_with_http_info(id, set_killswitch_switch_request, opts)
304
- data
305
- end
306
-
307
- # Set one switch entry
308
- # Sets or updates a single &#x60;switchKey&#x60; on a single &#x60;env&#x60;. Publishes one new version on that env only — other envs untouched. Use this for surgical per-env, per-key flips during incident response (e.g. trip &#x60;eu_region&#x60; on prod without touching the flat &#x60;value&#x60; or other envs). **Use cases** - **Trip a region** — &#x60;{ \&quot;env\&quot;: \&quot;prod\&quot;, \&quot;switchKey\&quot;: \&quot;eu_region\&quot;, \&quot;value\&quot;: true }&#x60;. - **Untrip without removing** — same payload with &#x60;value: false&#x60;. To remove the entry entirely use &#x60;DELETE /{id}/switch&#x60;.
309
- # @param id [String] Stable opaque killswitch id (&#x60;ksw_…&#x60;) or the killswitch&#39;s &#x60;name&#x60;.
310
- # @param set_killswitch_switch_request [SetKillswitchSwitchRequest]
311
- # @param [Hash] opts the optional parameters
312
- # @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
313
- # @return [Array<(SetKillswitchSwitchResponse, Integer, Hash)>] SetKillswitchSwitchResponse data, response status code and response headers
314
- def set_killswitch_switch_with_http_info(id, set_killswitch_switch_request, opts = {})
315
- if @api_client.config.debugging
316
- @api_client.config.logger.debug 'Calling API: KillswitchApi.set_killswitch_switch ...'
317
- end
318
- # verify the required parameter 'id' is set
319
- if @api_client.config.client_side_validation && id.nil?
320
- fail ArgumentError, "Missing the required parameter 'id' when calling KillswitchApi.set_killswitch_switch"
321
- end
322
- # verify the required parameter 'set_killswitch_switch_request' is set
323
- if @api_client.config.client_side_validation && set_killswitch_switch_request.nil?
324
- fail ArgumentError, "Missing the required parameter 'set_killswitch_switch_request' when calling KillswitchApi.set_killswitch_switch"
325
- end
326
- # resource path
327
- local_var_path = '/api/admin/killswitches/{id}/switch'.sub('{id}', CGI.escape(id.to_s))
328
-
329
- # query parameters
330
- query_params = opts[:query_params] || {}
331
-
332
- # header parameters
333
- header_params = opts[:header_params] || {}
334
- # HTTP header 'Accept' (if needed)
335
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
336
- # HTTP header 'Content-Type'
337
- content_type = @api_client.select_header_content_type(['application/json'])
338
- if !content_type.nil?
339
- header_params['Content-Type'] = content_type
340
- end
341
- header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
342
-
343
- # form parameters
344
- form_params = opts[:form_params] || {}
345
-
346
- # http body (model)
347
- post_body = opts[:debug_body] || @api_client.object_to_http_body(set_killswitch_switch_request)
348
-
349
- # return_type
350
- return_type = opts[:debug_return_type] || 'SetKillswitchSwitchResponse'
351
-
352
- # auth_names
353
- auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
354
-
355
- new_options = opts.merge(
356
- :operation => :"KillswitchApi.set_killswitch_switch",
357
- :header_params => header_params,
358
- :query_params => query_params,
359
- :form_params => form_params,
360
- :body => post_body,
361
- :auth_names => auth_names,
362
- :return_type => return_type
363
- )
364
-
365
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
366
- if @api_client.config.debugging
367
- @api_client.config.logger.debug "API called: KillswitchApi#set_killswitch_switch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
368
- end
369
- return data, status_code, headers
370
- end
371
-
372
- # Set the flat value on one env
373
- # Sets the flat `value` on a single `env`, publishing one new version on that env only. `switches` and other envs are untouched. Use this to trip (or untrip) a killswitch on one environment without replacing its per-key overrides. **Use cases** - **Trip on prod** — `{ \"env\": \"prod\", \"value\": true }`. - **Untrip on prod** — `{ \"env\": \"prod\", \"value\": false }`.
374
- # @param id [String] Stable opaque killswitch id (&#x60;ksw_…&#x60;) or the killswitch&#39;s &#x60;name&#x60;.
375
- # @param set_killswitch_value_request [SetKillswitchValueRequest]
376
- # @param [Hash] opts the optional parameters
377
- # @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).
378
- # @return [SetKillswitchValueResponse]
379
- def set_killswitch_value(id, set_killswitch_value_request, opts = {})
380
- data, _status_code, _headers = set_killswitch_value_with_http_info(id, set_killswitch_value_request, opts)
381
- data
382
- end
383
-
384
- # Set the flat value on one env
385
- # Sets the flat &#x60;value&#x60; on a single &#x60;env&#x60;, publishing one new version on that env only. &#x60;switches&#x60; and other envs are untouched. Use this to trip (or untrip) a killswitch on one environment without replacing its per-key overrides. **Use cases** - **Trip on prod** — &#x60;{ \&quot;env\&quot;: \&quot;prod\&quot;, \&quot;value\&quot;: true }&#x60;. - **Untrip on prod** — &#x60;{ \&quot;env\&quot;: \&quot;prod\&quot;, \&quot;value\&quot;: false }&#x60;.
386
- # @param id [String] Stable opaque killswitch id (&#x60;ksw_…&#x60;) or the killswitch&#39;s &#x60;name&#x60;.
387
- # @param set_killswitch_value_request [SetKillswitchValueRequest]
388
- # @param [Hash] opts the optional parameters
389
- # @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).
390
- # @return [Array<(SetKillswitchValueResponse, Integer, Hash)>] SetKillswitchValueResponse data, response status code and response headers
391
- def set_killswitch_value_with_http_info(id, set_killswitch_value_request, opts = {})
392
- if @api_client.config.debugging
393
- @api_client.config.logger.debug 'Calling API: KillswitchApi.set_killswitch_value ...'
394
- end
395
- # verify the required parameter 'id' is set
396
- if @api_client.config.client_side_validation && id.nil?
397
- fail ArgumentError, "Missing the required parameter 'id' when calling KillswitchApi.set_killswitch_value"
398
- end
399
- # verify the required parameter 'set_killswitch_value_request' is set
400
- if @api_client.config.client_side_validation && set_killswitch_value_request.nil?
401
- fail ArgumentError, "Missing the required parameter 'set_killswitch_value_request' when calling KillswitchApi.set_killswitch_value"
402
- end
403
- # resource path
404
- local_var_path = '/api/admin/killswitches/{id}/value'.sub('{id}', CGI.escape(id.to_s))
405
-
406
- # query parameters
407
- query_params = opts[:query_params] || {}
408
-
409
- # header parameters
410
- header_params = opts[:header_params] || {}
411
- # HTTP header 'Accept' (if needed)
412
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
413
- # HTTP header 'Content-Type'
414
- content_type = @api_client.select_header_content_type(['application/json'])
415
- if !content_type.nil?
416
- header_params['Content-Type'] = content_type
417
- end
418
- header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
419
-
420
- # form parameters
421
- form_params = opts[:form_params] || {}
422
-
423
- # http body (model)
424
- post_body = opts[:debug_body] || @api_client.object_to_http_body(set_killswitch_value_request)
425
-
426
- # return_type
427
- return_type = opts[:debug_return_type] || 'SetKillswitchValueResponse'
428
-
429
- # auth_names
430
- auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
431
-
432
- new_options = opts.merge(
433
- :operation => :"KillswitchApi.set_killswitch_value",
434
- :header_params => header_params,
435
- :query_params => query_params,
436
- :form_params => form_params,
437
- :body => post_body,
438
- :auth_names => auth_names,
439
- :return_type => return_type
440
- )
441
-
442
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
443
- if @api_client.config.debugging
444
- @api_client.config.logger.debug "API called: KillswitchApi#set_killswitch_value\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
445
- end
446
- return data, status_code, headers
447
- end
448
-
449
- # Remove one switch entry
450
- # Removes a single `switchKey` from the `switches` map on a single `env`. Publishes a new version on that env. Returns `{ removed: false }` if the entry didn't exist (idempotent no-op). **Use case:** Clean up a per-region override after the incident is resolved so the flat `value` governs again.
451
- # @param id [String] Stable opaque killswitch id (&#x60;ksw_…&#x60;) or the killswitch&#39;s &#x60;name&#x60;.
452
- # @param unset_killswitch_switch_request [UnsetKillswitchSwitchRequest]
453
- # @param [Hash] opts the optional parameters
454
- # @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).
455
- # @return [UnsetKillswitchSwitchResponse]
456
- def unset_killswitch_switch(id, unset_killswitch_switch_request, opts = {})
457
- data, _status_code, _headers = unset_killswitch_switch_with_http_info(id, unset_killswitch_switch_request, opts)
458
- data
459
- end
460
-
461
- # Remove one switch entry
462
- # Removes a single &#x60;switchKey&#x60; from the &#x60;switches&#x60; map on a single &#x60;env&#x60;. Publishes a new version on that env. Returns &#x60;{ removed: false }&#x60; if the entry didn&#39;t exist (idempotent no-op). **Use case:** Clean up a per-region override after the incident is resolved so the flat &#x60;value&#x60; governs again.
463
- # @param id [String] Stable opaque killswitch id (&#x60;ksw_…&#x60;) or the killswitch&#39;s &#x60;name&#x60;.
464
- # @param unset_killswitch_switch_request [UnsetKillswitchSwitchRequest]
465
- # @param [Hash] opts the optional parameters
466
- # @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).
467
- # @return [Array<(UnsetKillswitchSwitchResponse, Integer, Hash)>] UnsetKillswitchSwitchResponse data, response status code and response headers
468
- def unset_killswitch_switch_with_http_info(id, unset_killswitch_switch_request, opts = {})
469
- if @api_client.config.debugging
470
- @api_client.config.logger.debug 'Calling API: KillswitchApi.unset_killswitch_switch ...'
471
- end
472
- # verify the required parameter 'id' is set
473
- if @api_client.config.client_side_validation && id.nil?
474
- fail ArgumentError, "Missing the required parameter 'id' when calling KillswitchApi.unset_killswitch_switch"
475
- end
476
- # verify the required parameter 'unset_killswitch_switch_request' is set
477
- if @api_client.config.client_side_validation && unset_killswitch_switch_request.nil?
478
- fail ArgumentError, "Missing the required parameter 'unset_killswitch_switch_request' when calling KillswitchApi.unset_killswitch_switch"
479
- end
480
- # resource path
481
- local_var_path = '/api/admin/killswitches/{id}/switch'.sub('{id}', CGI.escape(id.to_s))
58
+ local_var_path = '/api/admin/killswitches/{id}/toggle'.sub('{id}', CGI.escape(id.to_s))
482
59
 
483
60
  # query parameters
484
61
  query_params = opts[:query_params] || {}
@@ -498,16 +75,16 @@ module Shipeasy::Admin::Generated
498
75
  form_params = opts[:form_params] || {}
499
76
 
500
77
  # http body (model)
501
- post_body = opts[:debug_body] || @api_client.object_to_http_body(unset_killswitch_switch_request)
78
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'toggle_killswitch_request'])
502
79
 
503
80
  # return_type
504
- return_type = opts[:debug_return_type] || 'UnsetKillswitchSwitchResponse'
81
+ return_type = opts[:debug_return_type] || 'ToggleKillswitchResponse'
505
82
 
506
83
  # auth_names
507
84
  auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
508
85
 
509
86
  new_options = opts.merge(
510
- :operation => :"KillswitchApi.unset_killswitch_switch",
87
+ :operation => :"KillswitchApi.toggle_killswitch",
511
88
  :header_params => header_params,
512
89
  :query_params => query_params,
513
90
  :form_params => form_params,
@@ -516,86 +93,9 @@ module Shipeasy::Admin::Generated
516
93
  :return_type => return_type
517
94
  )
518
95
 
519
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
520
- if @api_client.config.debugging
521
- @api_client.config.logger.debug "API called: KillswitchApi#unset_killswitch_switch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
522
- end
523
- return data, status_code, headers
524
- end
525
-
526
- # Update a killswitch
527
- # Partial update applied to **every** env. Setting `value`/`switches` publishes a new version per env. Description-only patches don't bump versions. To change a single switch on a single env, use `PUT /{id}/switch` instead. **Use cases** - **Trip everywhere** — `{ \"value\": true }`. Kills the feature across dev/stage/prod in one call. - **Untrip everywhere** — `{ \"value\": false }`. - **Replace switches** — send the full new map; per-key edits use `PUT /{id}/switch`. - **Update description** — metadata-only patches don't bump versions.
528
- # @param id [String] Stable opaque killswitch id (&#x60;ksw_…&#x60;) or the killswitch&#39;s &#x60;name&#x60;.
529
- # @param update_killswitch_request [UpdateKillswitchRequest]
530
- # @param [Hash] opts the optional parameters
531
- # @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).
532
- # @return [UpdateKillswitchResponse]
533
- def update_killswitch(id, update_killswitch_request, opts = {})
534
- data, _status_code, _headers = update_killswitch_with_http_info(id, update_killswitch_request, opts)
535
- data
536
- end
537
-
538
- # Update a killswitch
539
- # Partial update applied to **every** env. Setting &#x60;value&#x60;/&#x60;switches&#x60; publishes a new version per env. Description-only patches don&#39;t bump versions. To change a single switch on a single env, use &#x60;PUT /{id}/switch&#x60; instead. **Use cases** - **Trip everywhere** — &#x60;{ \&quot;value\&quot;: true }&#x60;. Kills the feature across dev/stage/prod in one call. - **Untrip everywhere** — &#x60;{ \&quot;value\&quot;: false }&#x60;. - **Replace switches** — send the full new map; per-key edits use &#x60;PUT /{id}/switch&#x60;. - **Update description** — metadata-only patches don&#39;t bump versions.
540
- # @param id [String] Stable opaque killswitch id (&#x60;ksw_…&#x60;) or the killswitch&#39;s &#x60;name&#x60;.
541
- # @param update_killswitch_request [UpdateKillswitchRequest]
542
- # @param [Hash] opts the optional parameters
543
- # @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).
544
- # @return [Array<(UpdateKillswitchResponse, Integer, Hash)>] UpdateKillswitchResponse data, response status code and response headers
545
- def update_killswitch_with_http_info(id, update_killswitch_request, opts = {})
546
- if @api_client.config.debugging
547
- @api_client.config.logger.debug 'Calling API: KillswitchApi.update_killswitch ...'
548
- end
549
- # verify the required parameter 'id' is set
550
- if @api_client.config.client_side_validation && id.nil?
551
- fail ArgumentError, "Missing the required parameter 'id' when calling KillswitchApi.update_killswitch"
552
- end
553
- # verify the required parameter 'update_killswitch_request' is set
554
- if @api_client.config.client_side_validation && update_killswitch_request.nil?
555
- fail ArgumentError, "Missing the required parameter 'update_killswitch_request' when calling KillswitchApi.update_killswitch"
556
- end
557
- # resource path
558
- local_var_path = '/api/admin/killswitches/{id}'.sub('{id}', CGI.escape(id.to_s))
559
-
560
- # query parameters
561
- query_params = opts[:query_params] || {}
562
-
563
- # header parameters
564
- header_params = opts[:header_params] || {}
565
- # HTTP header 'Accept' (if needed)
566
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
567
- # HTTP header 'Content-Type'
568
- content_type = @api_client.select_header_content_type(['application/json'])
569
- if !content_type.nil?
570
- header_params['Content-Type'] = content_type
571
- end
572
- header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
573
-
574
- # form parameters
575
- form_params = opts[:form_params] || {}
576
-
577
- # http body (model)
578
- post_body = opts[:debug_body] || @api_client.object_to_http_body(update_killswitch_request)
579
-
580
- # return_type
581
- return_type = opts[:debug_return_type] || 'UpdateKillswitchResponse'
582
-
583
- # auth_names
584
- auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
585
-
586
- new_options = opts.merge(
587
- :operation => :"KillswitchApi.update_killswitch",
588
- :header_params => header_params,
589
- :query_params => query_params,
590
- :form_params => form_params,
591
- :body => post_body,
592
- :auth_names => auth_names,
593
- :return_type => return_type
594
- )
595
-
596
- data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
96
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
597
97
  if @api_client.config.debugging
598
- @api_client.config.logger.debug "API called: KillswitchApi#update_killswitch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
98
+ @api_client.config.logger.debug "API called: KillswitchApi#toggle_killswitch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
599
99
  end
600
100
  return data, status_code, headers
601
101
  end