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,317 +0,0 @@
1
- =begin
2
- #Shipeasy Admin API
3
-
4
- #REST API for managing feature gates, experiments, configs, universes, and killswitches in a Shipeasy project. Authenticate with an admin SDK key (`Authorization: Bearer sdk_admin_…`) and scope every request to a project via the `X-Project-Id` header. Mint admin keys via `POST /api/admin/keys` with `type: \"admin\"`. Keys expire after 90 days; rotate with the `revoke` action.
5
-
6
- The version of the OpenAPI document: 2.0.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.23.0
10
-
11
- =end
12
-
13
- require 'cgi'
14
-
15
- module Shipeasy::Admin::Generated
16
- class KeysApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
- # List i18n keys
23
- # List keys for a profile, optionally filtered to a name `prefix`. **Use case:** Read the current keys (and values) for a profile — e.g. to diff before a push.
24
- # @param [Hash] opts the optional parameters
25
- # @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
26
- # @option opts [String] :profile_id Profile id to list keys for.
27
- # @option opts [String] :prefix Only keys whose name starts with this.
28
- # @option opts [String] :q Free-text search — matches keys whose name OR value contains this substring (case-insensitive). Use it to find the key behind a piece of on-screen copy.
29
- # @option opts [Integer] :limit Max keys to return (1–500).
30
- # @return [ListI18nKeysResponse]
31
- def list_i18n_keys(opts = {})
32
- data, _status_code, _headers = list_i18n_keys_with_http_info(opts)
33
- data
34
- end
35
-
36
- # List i18n keys
37
- # List keys for a profile, optionally filtered to a name `prefix`. **Use case:** Read the current keys (and values) for a profile — e.g. to diff before a push.
38
- # @param [Hash] opts the optional parameters
39
- # @option opts [String] :x_project_id Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it).
40
- # @option opts [String] :profile_id Profile id to list keys for.
41
- # @option opts [String] :prefix Only keys whose name starts with this.
42
- # @option opts [String] :q Free-text search — matches keys whose name OR value contains this substring (case-insensitive). Use it to find the key behind a piece of on-screen copy.
43
- # @option opts [Integer] :limit Max keys to return (1–500).
44
- # @return [Array<(ListI18nKeysResponse, Integer, Hash)>] ListI18nKeysResponse data, response status code and response headers
45
- def list_i18n_keys_with_http_info(opts = {})
46
- if @api_client.config.debugging
47
- @api_client.config.logger.debug 'Calling API: KeysApi.list_i18n_keys ...'
48
- end
49
- if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
50
- fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling KeysApi.list_i18n_keys, must be smaller than or equal to 500.'
51
- end
52
-
53
- if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
54
- fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling KeysApi.list_i18n_keys, must be greater than or equal to 1.'
55
- end
56
-
57
- # resource path
58
- local_var_path = '/api/admin/i18n/keys'
59
-
60
- # query parameters
61
- query_params = opts[:query_params] || {}
62
- query_params[:'profile_id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
63
- query_params[:'prefix'] = opts[:'prefix'] if !opts[:'prefix'].nil?
64
- query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
65
- query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
66
-
67
- # header parameters
68
- header_params = opts[:header_params] || {}
69
- # HTTP header 'Accept' (if needed)
70
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
71
- header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
72
-
73
- # form parameters
74
- form_params = opts[:form_params] || {}
75
-
76
- # http body (model)
77
- post_body = opts[:debug_body]
78
-
79
- # return_type
80
- return_type = opts[:debug_return_type] || 'ListI18nKeysResponse'
81
-
82
- # auth_names
83
- auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
84
-
85
- new_options = opts.merge(
86
- :operation => :"KeysApi.list_i18n_keys",
87
- :header_params => header_params,
88
- :query_params => query_params,
89
- :form_params => form_params,
90
- :body => post_body,
91
- :auth_names => auth_names,
92
- :return_type => return_type
93
- )
94
-
95
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
96
- if @api_client.config.debugging
97
- @api_client.config.logger.debug "API called: KeysApi#list_i18n_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
98
- end
99
- return data, status_code, headers
100
- end
101
-
102
- # Push new i18n keys (insert-only)
103
- # Add NEW keys to a profile. Insert-only — existing keys are left untouched (overwrite one with `updateI18nKey`). **Use case:** Seed newly-extracted keys without clobbering translations already in the profile.
104
- # @param push_i18n_keys_request [PushI18nKeysRequest]
105
- # @param [Hash] opts the optional parameters
106
- # @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).
107
- # @return [PushI18nKeysResponse]
108
- def push_i18n_keys(push_i18n_keys_request, opts = {})
109
- data, _status_code, _headers = push_i18n_keys_with_http_info(push_i18n_keys_request, opts)
110
- data
111
- end
112
-
113
- # Push new i18n keys (insert-only)
114
- # Add NEW keys to a profile. Insert-only — existing keys are left untouched (overwrite one with &#x60;updateI18nKey&#x60;). **Use case:** Seed newly-extracted keys without clobbering translations already in the profile.
115
- # @param push_i18n_keys_request [PushI18nKeysRequest]
116
- # @param [Hash] opts the optional parameters
117
- # @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).
118
- # @return [Array<(PushI18nKeysResponse, Integer, Hash)>] PushI18nKeysResponse data, response status code and response headers
119
- def push_i18n_keys_with_http_info(push_i18n_keys_request, opts = {})
120
- if @api_client.config.debugging
121
- @api_client.config.logger.debug 'Calling API: KeysApi.push_i18n_keys ...'
122
- end
123
- # verify the required parameter 'push_i18n_keys_request' is set
124
- if @api_client.config.client_side_validation && push_i18n_keys_request.nil?
125
- fail ArgumentError, "Missing the required parameter 'push_i18n_keys_request' when calling KeysApi.push_i18n_keys"
126
- end
127
- # resource path
128
- local_var_path = '/api/admin/i18n/keys'
129
-
130
- # query parameters
131
- query_params = opts[:query_params] || {}
132
-
133
- # header parameters
134
- header_params = opts[:header_params] || {}
135
- # HTTP header 'Accept' (if needed)
136
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
137
- # HTTP header 'Content-Type'
138
- content_type = @api_client.select_header_content_type(['application/json'])
139
- if !content_type.nil?
140
- header_params['Content-Type'] = content_type
141
- end
142
- header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
143
-
144
- # form parameters
145
- form_params = opts[:form_params] || {}
146
-
147
- # http body (model)
148
- post_body = opts[:debug_body] || @api_client.object_to_http_body(push_i18n_keys_request)
149
-
150
- # return_type
151
- return_type = opts[:debug_return_type] || 'PushI18nKeysResponse'
152
-
153
- # auth_names
154
- auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
155
-
156
- new_options = opts.merge(
157
- :operation => :"KeysApi.push_i18n_keys",
158
- :header_params => header_params,
159
- :query_params => query_params,
160
- :form_params => form_params,
161
- :body => post_body,
162
- :auth_names => auth_names,
163
- :return_type => return_type
164
- )
165
-
166
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
167
- if @api_client.config.debugging
168
- @api_client.config.logger.debug "API called: KeysApi#push_i18n_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
169
- end
170
- return data, status_code, headers
171
- end
172
-
173
- # Set a key's value and publish it live
174
- # Upsert a single key's value into a profile and immediately publish the whole profile (KV rebuild + CDN purge) so the new value is live in one call. The key is inserted when new and overwritten when it already exists. `profile` is a profile name — omit it to target the project's default-marked profile, or pass a name to target another locale. **Use case:** Correct or replace one live string and ship it without a separate `push` + `publish`.
175
- # @param set_i18n_label_request [SetI18nLabelRequest]
176
- # @param [Hash] opts the optional parameters
177
- # @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).
178
- # @return [SetI18nLabelResponse]
179
- def set_i18n_label(set_i18n_label_request, opts = {})
180
- data, _status_code, _headers = set_i18n_label_with_http_info(set_i18n_label_request, opts)
181
- data
182
- end
183
-
184
- # Set a key&#39;s value and publish it live
185
- # Upsert a single key&#39;s value into a profile and immediately publish the whole profile (KV rebuild + CDN purge) so the new value is live in one call. The key is inserted when new and overwritten when it already exists. &#x60;profile&#x60; is a profile name — omit it to target the project&#39;s default-marked profile, or pass a name to target another locale. **Use case:** Correct or replace one live string and ship it without a separate &#x60;push&#x60; + &#x60;publish&#x60;.
186
- # @param set_i18n_label_request [SetI18nLabelRequest]
187
- # @param [Hash] opts the optional parameters
188
- # @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).
189
- # @return [Array<(SetI18nLabelResponse, Integer, Hash)>] SetI18nLabelResponse data, response status code and response headers
190
- def set_i18n_label_with_http_info(set_i18n_label_request, opts = {})
191
- if @api_client.config.debugging
192
- @api_client.config.logger.debug 'Calling API: KeysApi.set_i18n_label ...'
193
- end
194
- # verify the required parameter 'set_i18n_label_request' is set
195
- if @api_client.config.client_side_validation && set_i18n_label_request.nil?
196
- fail ArgumentError, "Missing the required parameter 'set_i18n_label_request' when calling KeysApi.set_i18n_label"
197
- end
198
- # resource path
199
- local_var_path = '/api/admin/i18n/set'
200
-
201
- # query parameters
202
- query_params = opts[:query_params] || {}
203
-
204
- # header parameters
205
- header_params = opts[:header_params] || {}
206
- # HTTP header 'Accept' (if needed)
207
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
208
- # HTTP header 'Content-Type'
209
- content_type = @api_client.select_header_content_type(['application/json'])
210
- if !content_type.nil?
211
- header_params['Content-Type'] = content_type
212
- end
213
- header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
214
-
215
- # form parameters
216
- form_params = opts[:form_params] || {}
217
-
218
- # http body (model)
219
- post_body = opts[:debug_body] || @api_client.object_to_http_body(set_i18n_label_request)
220
-
221
- # return_type
222
- return_type = opts[:debug_return_type] || 'SetI18nLabelResponse'
223
-
224
- # auth_names
225
- auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
226
-
227
- new_options = opts.merge(
228
- :operation => :"KeysApi.set_i18n_label",
229
- :header_params => header_params,
230
- :query_params => query_params,
231
- :form_params => form_params,
232
- :body => post_body,
233
- :auth_names => auth_names,
234
- :return_type => return_type
235
- )
236
-
237
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
238
- if @api_client.config.debugging
239
- @api_client.config.logger.debug "API called: KeysApi#set_i18n_label\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
240
- end
241
- return data, status_code, headers
242
- end
243
-
244
- # Update one i18n key
245
- # Overwrite a single existing key's value — the only overwrite path. **Use case:** Correct or re-translate a single string in place.
246
- # @param id [String] The key&#39;s id.
247
- # @param update_i18n_key_request [UpdateI18nKeyRequest]
248
- # @param [Hash] opts the optional parameters
249
- # @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).
250
- # @return [UpdateI18nKeyResponse]
251
- def update_i18n_key(id, update_i18n_key_request, opts = {})
252
- data, _status_code, _headers = update_i18n_key_with_http_info(id, update_i18n_key_request, opts)
253
- data
254
- end
255
-
256
- # Update one i18n key
257
- # Overwrite a single existing key&#39;s value — the only overwrite path. **Use case:** Correct or re-translate a single string in place.
258
- # @param id [String] The key&#39;s id.
259
- # @param update_i18n_key_request [UpdateI18nKeyRequest]
260
- # @param [Hash] opts the optional parameters
261
- # @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).
262
- # @return [Array<(UpdateI18nKeyResponse, Integer, Hash)>] UpdateI18nKeyResponse data, response status code and response headers
263
- def update_i18n_key_with_http_info(id, update_i18n_key_request, opts = {})
264
- if @api_client.config.debugging
265
- @api_client.config.logger.debug 'Calling API: KeysApi.update_i18n_key ...'
266
- end
267
- # verify the required parameter 'update_i18n_key_request' is set
268
- if @api_client.config.client_side_validation && update_i18n_key_request.nil?
269
- fail ArgumentError, "Missing the required parameter 'update_i18n_key_request' when calling KeysApi.update_i18n_key"
270
- end
271
- # resource path
272
- local_var_path = '/api/admin/i18n/keys/{id}'.sub('{id}', CGI.escape(id.to_s))
273
-
274
- # query parameters
275
- query_params = opts[:query_params] || {}
276
-
277
- # header parameters
278
- header_params = opts[:header_params] || {}
279
- # HTTP header 'Accept' (if needed)
280
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
281
- # HTTP header 'Content-Type'
282
- content_type = @api_client.select_header_content_type(['application/json'])
283
- if !content_type.nil?
284
- header_params['Content-Type'] = content_type
285
- end
286
- header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
287
-
288
- # form parameters
289
- form_params = opts[:form_params] || {}
290
-
291
- # http body (model)
292
- post_body = opts[:debug_body] || @api_client.object_to_http_body(update_i18n_key_request)
293
-
294
- # return_type
295
- return_type = opts[:debug_return_type] || 'UpdateI18nKeyResponse'
296
-
297
- # auth_names
298
- auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
299
-
300
- new_options = opts.merge(
301
- :operation => :"KeysApi.update_i18n_key",
302
- :header_params => header_params,
303
- :query_params => query_params,
304
- :form_params => form_params,
305
- :body => post_body,
306
- :auth_names => auth_names,
307
- :return_type => return_type
308
- )
309
-
310
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
311
- if @api_client.config.debugging
312
- @api_client.config.logger.debug "API called: KeysApi#update_i18n_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
313
- end
314
- return data, status_code, headers
315
- end
316
- end
317
- end
@@ -1,281 +0,0 @@
1
- =begin
2
- #Shipeasy Admin API
3
-
4
- #REST API for managing feature gates, experiments, configs, universes, and killswitches in a Shipeasy project. Authenticate with an admin SDK key (`Authorization: Bearer sdk_admin_…`) and scope every request to a project via the `X-Project-Id` header. Mint admin keys via `POST /api/admin/keys` with `type: \"admin\"`. Keys expire after 90 days; rotate with the `revoke` action.
5
-
6
- The version of the OpenAPI document: 2.0.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.23.0
10
-
11
- =end
12
-
13
- require 'cgi'
14
-
15
- module Shipeasy::Admin::Generated
16
- class MetricsApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
- # Create a metric
23
- # Creates an event-backed metric. Pass the query as the DSL string (`query`) **or** the typed IR (`query_ir`) — exactly one. `event_name` must equal the event the query references. Returns `409` if a metric with the same `name` already exists, and `422` if the query is invalid or references an unregistered event / label. **Use cases** - **Track an event** — `count_users(<event>)` for unique-user counts. - **Sum a value** — `sum(<event>, <label>)` for revenue / quantity metrics. - **Experiment success metric** — create the metric, then attach its id to an experiment.
24
- # @param create_metric_request [CreateMetricRequest]
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 [CreateMetricResponse]
28
- def create_metric(create_metric_request, opts = {})
29
- data, _status_code, _headers = create_metric_with_http_info(create_metric_request, opts)
30
- data
31
- end
32
-
33
- # Create a metric
34
- # Creates an event-backed metric. Pass the query as the DSL string (&#x60;query&#x60;) **or** the typed IR (&#x60;query_ir&#x60;) — exactly one. &#x60;event_name&#x60; must equal the event the query references. Returns &#x60;409&#x60; if a metric with the same &#x60;name&#x60; already exists, and &#x60;422&#x60; if the query is invalid or references an unregistered event / label. **Use cases** - **Track an event** — &#x60;count_users(&lt;event&gt;)&#x60; for unique-user counts. - **Sum a value** — &#x60;sum(&lt;event&gt;, &lt;label&gt;)&#x60; for revenue / quantity metrics. - **Experiment success metric** — create the metric, then attach its id to an experiment.
35
- # @param create_metric_request [CreateMetricRequest]
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<(CreateMetricResponse, Integer, Hash)>] CreateMetricResponse data, response status code and response headers
39
- def create_metric_with_http_info(create_metric_request, opts = {})
40
- if @api_client.config.debugging
41
- @api_client.config.logger.debug 'Calling API: MetricsApi.create_metric ...'
42
- end
43
- # verify the required parameter 'create_metric_request' is set
44
- if @api_client.config.client_side_validation && create_metric_request.nil?
45
- fail ArgumentError, "Missing the required parameter 'create_metric_request' when calling MetricsApi.create_metric"
46
- end
47
- # resource path
48
- local_var_path = '/api/admin/metrics'
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_metric_request)
69
-
70
- # return_type
71
- return_type = opts[:debug_return_type] || 'CreateMetricResponse'
72
-
73
- # auth_names
74
- auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
75
-
76
- new_options = opts.merge(
77
- :operation => :"MetricsApi.create_metric",
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: MetricsApi#create_metric\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
- end
90
- return data, status_code, headers
91
- end
92
-
93
- # Archive a metric
94
- # Soft-deletes (archives) the metric. Returns `409` if it is attached to a running experiment — stop those experiments first. **Use case:** Retire a metric once no running experiment depends on it (the user-facing verb is `archive`).
95
- # @param id [String] Stable opaque metric id (&#x60;met_…&#x60;) or the metric&#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 [DeleteMetricResponse]
99
- def delete_metric(id, opts = {})
100
- data, _status_code, _headers = delete_metric_with_http_info(id, opts)
101
- data
102
- end
103
-
104
- # Archive a metric
105
- # Soft-deletes (archives) the metric. Returns &#x60;409&#x60; if it is attached to a running experiment — stop those experiments first. **Use case:** Retire a metric once no running experiment depends on it (the user-facing verb is &#x60;archive&#x60;).
106
- # @param id [String] Stable opaque metric id (&#x60;met_…&#x60;) or the metric&#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<(DeleteMetricResponse, Integer, Hash)>] DeleteMetricResponse data, response status code and response headers
110
- def delete_metric_with_http_info(id, opts = {})
111
- if @api_client.config.debugging
112
- @api_client.config.logger.debug 'Calling API: MetricsApi.delete_metric ...'
113
- end
114
- # verify the required parameter 'id' is set
115
- if @api_client.config.client_side_validation && id.nil?
116
- fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.delete_metric"
117
- end
118
- # resource path
119
- local_var_path = '/api/admin/metrics/{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] || 'DeleteMetricResponse'
138
-
139
- # auth_names
140
- auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
141
-
142
- new_options = opts.merge(
143
- :operation => :"MetricsApi.delete_metric",
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: MetricsApi#delete_metric\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
155
- end
156
- return data, status_code, headers
157
- end
158
-
159
- # Get a metric
160
- # Fetch one metric by its id or name, including the rendered DSL query and the typed IR. **Use case:** Inspect a single metric's full definition before reusing it in an experiment or alert rule.
161
- # @param id [String] Stable opaque metric id (&#x60;met_…&#x60;) or the metric&#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 [GetMetricResponse]
165
- def get_metric(id, opts = {})
166
- data, _status_code, _headers = get_metric_with_http_info(id, opts)
167
- data
168
- end
169
-
170
- # Get a metric
171
- # Fetch one metric by its id or name, including the rendered DSL query and the typed IR. **Use case:** Inspect a single metric&#39;s full definition before reusing it in an experiment or alert rule.
172
- # @param id [String] Stable opaque metric id (&#x60;met_…&#x60;) or the metric&#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<(GetMetricResponse, Integer, Hash)>] GetMetricResponse data, response status code and response headers
176
- def get_metric_with_http_info(id, opts = {})
177
- if @api_client.config.debugging
178
- @api_client.config.logger.debug 'Calling API: MetricsApi.get_metric ...'
179
- end
180
- # resource path
181
- local_var_path = '/api/admin/metrics/{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] || 'GetMetricResponse'
200
-
201
- # auth_names
202
- auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
203
-
204
- new_options = opts.merge(
205
- :operation => :"MetricsApi.get_metric",
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: MetricsApi#get_metric\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
217
- end
218
- return data, status_code, headers
219
- end
220
-
221
- # List metrics
222
- # Returns every metric in the project (not paginated) — name, folder, source event, aggregation, and the rendered query. **Use case:** Audit every metric defined in the project — for example to find the metric id to attach as an experiment's success metric.
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
- # @return [Array<ListMetricsResponseInner>]
226
- def list_metrics(opts = {})
227
- data, _status_code, _headers = list_metrics_with_http_info(opts)
228
- data
229
- end
230
-
231
- # List metrics
232
- # Returns every metric in the project (not paginated) — name, folder, source event, aggregation, and the rendered query. **Use case:** Audit every metric defined in the project — for example to find the metric id to attach as an experiment&#39;s success metric.
233
- # @param [Hash] opts the optional parameters
234
- # @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).
235
- # @return [Array<(Array<ListMetricsResponseInner>, Integer, Hash)>] Array<ListMetricsResponseInner> data, response status code and response headers
236
- def list_metrics_with_http_info(opts = {})
237
- if @api_client.config.debugging
238
- @api_client.config.logger.debug 'Calling API: MetricsApi.list_metrics ...'
239
- end
240
- # resource path
241
- local_var_path = '/api/admin/metrics'
242
-
243
- # query parameters
244
- query_params = opts[:query_params] || {}
245
-
246
- # header parameters
247
- header_params = opts[:header_params] || {}
248
- # HTTP header 'Accept' (if needed)
249
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
250
- header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
251
-
252
- # form parameters
253
- form_params = opts[:form_params] || {}
254
-
255
- # http body (model)
256
- post_body = opts[:debug_body]
257
-
258
- # return_type
259
- return_type = opts[:debug_return_type] || 'Array<ListMetricsResponseInner>'
260
-
261
- # auth_names
262
- auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
263
-
264
- new_options = opts.merge(
265
- :operation => :"MetricsApi.list_metrics",
266
- :header_params => header_params,
267
- :query_params => query_params,
268
- :form_params => form_params,
269
- :body => post_body,
270
- :auth_names => auth_names,
271
- :return_type => return_type
272
- )
273
-
274
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
275
- if @api_client.config.debugging
276
- @api_client.config.logger.debug "API called: MetricsApi#list_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
277
- end
278
- return data, status_code, headers
279
- end
280
- end
281
- end