shipeasy-sdk 2.1.0 → 2.3.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 (171) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/docs/skill/SKILL.md +6 -2
  4. data/lib/generators/shipeasy/install/USAGE +24 -0
  5. data/lib/generators/shipeasy/install/install_generator.rb +86 -0
  6. data/lib/generators/shipeasy/install/templates/initializer.rb.tt +41 -0
  7. data/lib/shipeasy/admin.rb +85 -0
  8. data/lib/shipeasy/sdk/version.rb +1 -1
  9. data/lib/shipeasy_admin/api/alert_rules_api.rb +292 -0
  10. data/lib/shipeasy_admin/api/attributes_api.rb +82 -0
  11. data/lib/shipeasy_admin/api/configs_api.rb +680 -0
  12. data/lib/shipeasy_admin/api/events_api.rb +438 -0
  13. data/lib/shipeasy_admin/api/experiments_api.rb +727 -0
  14. data/lib/shipeasy_admin/api/gates_api.rb +438 -0
  15. data/lib/shipeasy_admin/api/i18n_api.rb +507 -0
  16. data/lib/shipeasy_admin/api/killswitches_api.rb +526 -0
  17. data/lib/shipeasy_admin/api/metrics_api.rb +281 -0
  18. data/lib/shipeasy_admin/api/ops_api.rb +525 -0
  19. data/lib/shipeasy_admin/api/projects_api.rb +153 -0
  20. data/lib/shipeasy_admin/api/universes_api.rb +306 -0
  21. data/lib/shipeasy_admin/api_client.rb +441 -0
  22. data/lib/shipeasy_admin/api_error.rb +58 -0
  23. data/lib/shipeasy_admin/api_model_base.rb +88 -0
  24. data/lib/shipeasy_admin/configuration.rb +397 -0
  25. data/lib/shipeasy_admin/models/approve_event_request.rb +198 -0
  26. data/lib/shipeasy_admin/models/approve_event_response.rb +166 -0
  27. data/lib/shipeasy_admin/models/create_alert_rule_request.rb +408 -0
  28. data/lib/shipeasy_admin/models/create_alert_rule_response.rb +165 -0
  29. data/lib/shipeasy_admin/models/create_config_request.rb +280 -0
  30. data/lib/shipeasy_admin/models/create_config_response.rb +201 -0
  31. data/lib/shipeasy_admin/models/create_event_request.rb +253 -0
  32. data/lib/shipeasy_admin/models/create_event_response.rb +193 -0
  33. data/lib/shipeasy_admin/models/create_experiment_request.rb +869 -0
  34. data/lib/shipeasy_admin/models/create_experiment_request_goal_metric.rb +336 -0
  35. data/lib/shipeasy_admin/models/create_experiment_response.rb +212 -0
  36. data/lib/shipeasy_admin/models/create_gate_request.rb +529 -0
  37. data/lib/shipeasy_admin/models/create_gate_response.rb +212 -0
  38. data/lib/shipeasy_admin/models/create_i18n_profile_request.rb +188 -0
  39. data/lib/shipeasy_admin/models/create_i18n_profile_response.rb +193 -0
  40. data/lib/shipeasy_admin/models/create_killswitch_request.rb +263 -0
  41. data/lib/shipeasy_admin/models/create_killswitch_response.rb +201 -0
  42. data/lib/shipeasy_admin/models/create_metric_request.rb +415 -0
  43. data/lib/shipeasy_admin/models/create_metric_response.rb +193 -0
  44. data/lib/shipeasy_admin/models/create_ops_item_request.rb +287 -0
  45. data/lib/shipeasy_admin/models/create_ops_item_response.rb +177 -0
  46. data/lib/shipeasy_admin/models/create_universe_request.rb +289 -0
  47. data/lib/shipeasy_admin/models/create_universe_response.rb +212 -0
  48. data/lib/shipeasy_admin/models/delete_alert_rule_response.rb +188 -0
  49. data/lib/shipeasy_admin/models/delete_config_response.rb +188 -0
  50. data/lib/shipeasy_admin/models/delete_event_response.rb +189 -0
  51. data/lib/shipeasy_admin/models/delete_experiment_response.rb +188 -0
  52. data/lib/shipeasy_admin/models/delete_gate_response.rb +188 -0
  53. data/lib/shipeasy_admin/models/delete_killswitch_response.rb +188 -0
  54. data/lib/shipeasy_admin/models/delete_metric_response.rb +189 -0
  55. data/lib/shipeasy_admin/models/delete_universe_response.rb +188 -0
  56. data/lib/shipeasy_admin/models/disable_gate_response.rb +190 -0
  57. data/lib/shipeasy_admin/models/discard_config_draft_request.rb +190 -0
  58. data/lib/shipeasy_admin/models/discard_config_draft_response.rb +188 -0
  59. data/lib/shipeasy_admin/models/enable_gate_response.rb +190 -0
  60. data/lib/shipeasy_admin/models/error_response.rb +185 -0
  61. data/lib/shipeasy_admin/models/get_config_response.rb +351 -0
  62. data/lib/shipeasy_admin/models/get_current_project_response.rb +606 -0
  63. data/lib/shipeasy_admin/models/get_current_project_response_module_translations.rb +104 -0
  64. data/lib/shipeasy_admin/models/get_event_response.rb +344 -0
  65. data/lib/shipeasy_admin/models/get_experiment_response.rb +688 -0
  66. data/lib/shipeasy_admin/models/get_experiment_results_response.rb +243 -0
  67. data/lib/shipeasy_admin/models/get_experiment_results_response_experiment.rb +248 -0
  68. data/lib/shipeasy_admin/models/get_experiment_results_response_results_inner.rb +252 -0
  69. data/lib/shipeasy_admin/models/get_experiment_timeseries_response.rb +192 -0
  70. data/lib/shipeasy_admin/models/get_experiment_timeseries_response_experiment.rb +261 -0
  71. data/lib/shipeasy_admin/models/get_experiment_timeseries_response_series_inner.rb +278 -0
  72. data/lib/shipeasy_admin/models/get_killswitch_response.rb +270 -0
  73. data/lib/shipeasy_admin/models/get_metric_response.rb +378 -0
  74. data/lib/shipeasy_admin/models/get_ops_item_response.rb +349 -0
  75. data/lib/shipeasy_admin/models/link_pr_to_ops_item_request.rb +186 -0
  76. data/lib/shipeasy_admin/models/link_pr_to_ops_item_response.rb +166 -0
  77. data/lib/shipeasy_admin/models/list_alert_rules_response_inner.rb +478 -0
  78. data/lib/shipeasy_admin/models/list_alert_rules_response_inner_notify.rb +177 -0
  79. data/lib/shipeasy_admin/models/list_alert_rules_response_inner_notify_slack_channel.rb +211 -0
  80. data/lib/shipeasy_admin/models/list_attributes_response_inner.rb +176 -0
  81. data/lib/shipeasy_admin/models/list_config_activity_response_inner.rb +280 -0
  82. data/lib/shipeasy_admin/models/list_configs_response.rb +178 -0
  83. data/lib/shipeasy_admin/models/list_configs_response_data_inner.rb +351 -0
  84. data/lib/shipeasy_admin/models/list_configs_response_data_inner_drafts_value.rb +237 -0
  85. data/lib/shipeasy_admin/models/list_configs_response_data_inner_envs_value.rb +237 -0
  86. data/lib/shipeasy_admin/models/list_events_response_inner.rb +344 -0
  87. data/lib/shipeasy_admin/models/list_events_response_inner_properties_inner.rb +289 -0
  88. data/lib/shipeasy_admin/models/list_experiments_response.rb +178 -0
  89. data/lib/shipeasy_admin/models/list_experiments_response_data_inner.rb +688 -0
  90. data/lib/shipeasy_admin/models/list_experiments_response_data_inner_groups_inner.rb +258 -0
  91. data/lib/shipeasy_admin/models/list_gates_response.rb +178 -0
  92. data/lib/shipeasy_admin/models/list_gates_response_data_inner.rb +395 -0
  93. data/lib/shipeasy_admin/models/list_gates_response_data_inner_enabled.rb +104 -0
  94. data/lib/shipeasy_admin/models/list_gates_response_data_inner_rules_inner.rb +238 -0
  95. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner.rb +105 -0
  96. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of.rb +375 -0
  97. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of1.rb +331 -0
  98. data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of_ramp.rb +319 -0
  99. data/lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb +272 -0
  100. data/lib/shipeasy_admin/models/list_i18n_keys_response.rb +195 -0
  101. data/lib/shipeasy_admin/models/list_i18n_keys_response_keys_inner.rb +284 -0
  102. data/lib/shipeasy_admin/models/list_i18n_profiles_response_inner.rb +224 -0
  103. data/lib/shipeasy_admin/models/list_killswitches_response.rb +178 -0
  104. data/lib/shipeasy_admin/models/list_killswitches_response_data_inner.rb +270 -0
  105. data/lib/shipeasy_admin/models/list_killswitches_response_data_inner_envs_value.rb +248 -0
  106. data/lib/shipeasy_admin/models/list_metrics_response_inner.rb +378 -0
  107. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir.rb +295 -0
  108. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg.rb +113 -0
  109. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of.rb +188 -0
  110. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of1.rb +188 -0
  111. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of2.rb +188 -0
  112. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of3.rb +188 -0
  113. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of4.rb +188 -0
  114. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of5.rb +188 -0
  115. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of6.rb +188 -0
  116. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of7.rb +217 -0
  117. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of8.rb +233 -0
  118. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9.rb +240 -0
  119. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator.rb +266 -0
  120. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator_filters_inner.rb +264 -0
  121. data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_group_by.rb +228 -0
  122. data/lib/shipeasy_admin/models/list_ops_items_response_inner.rb +349 -0
  123. data/lib/shipeasy_admin/models/list_slack_channels_response.rb +195 -0
  124. data/lib/shipeasy_admin/models/list_slack_channels_response_channels_inner.rb +203 -0
  125. data/lib/shipeasy_admin/models/list_universes_response.rb +178 -0
  126. data/lib/shipeasy_admin/models/list_universes_response_data_inner.rb +305 -0
  127. data/lib/shipeasy_admin/models/notify_ops_request.rb +261 -0
  128. data/lib/shipeasy_admin/models/notify_ops_response.rb +193 -0
  129. data/lib/shipeasy_admin/models/publish_config_draft_request.rb +190 -0
  130. data/lib/shipeasy_admin/models/publish_config_draft_response.rb +260 -0
  131. data/lib/shipeasy_admin/models/publish_i18n_profile_request.rb +149 -0
  132. data/lib/shipeasy_admin/models/publish_i18n_profile_response.rb +404 -0
  133. data/lib/shipeasy_admin/models/push_i18n_keys_request.rb +205 -0
  134. data/lib/shipeasy_admin/models/push_i18n_keys_request_keys_inner.rb +192 -0
  135. data/lib/shipeasy_admin/models/push_i18n_keys_response.rb +261 -0
  136. data/lib/shipeasy_admin/models/reanalyze_experiment_response.rb +214 -0
  137. data/lib/shipeasy_admin/models/save_config_draft_request.rb +202 -0
  138. data/lib/shipeasy_admin/models/save_config_draft_response.rb +286 -0
  139. data/lib/shipeasy_admin/models/set_experiment_metrics_request.rb +168 -0
  140. data/lib/shipeasy_admin/models/set_experiment_metrics_request_metrics_inner.rb +216 -0
  141. data/lib/shipeasy_admin/models/set_experiment_metrics_response.rb +179 -0
  142. data/lib/shipeasy_admin/models/set_experiment_metrics_response_metrics_inner.rb +201 -0
  143. data/lib/shipeasy_admin/models/set_experiment_status_request.rb +190 -0
  144. data/lib/shipeasy_admin/models/set_experiment_status_response.rb +214 -0
  145. data/lib/shipeasy_admin/models/set_killswitch_switch_request.rb +264 -0
  146. data/lib/shipeasy_admin/models/set_killswitch_switch_response.rb +288 -0
  147. data/lib/shipeasy_admin/models/unset_killswitch_switch_request.rb +237 -0
  148. data/lib/shipeasy_admin/models/unset_killswitch_switch_response.rb +289 -0
  149. data/lib/shipeasy_admin/models/update_alert_rule_request.rb +306 -0
  150. data/lib/shipeasy_admin/models/update_alert_rule_response.rb +165 -0
  151. data/lib/shipeasy_admin/models/update_config_request.rb +198 -0
  152. data/lib/shipeasy_admin/models/update_config_response.rb +165 -0
  153. data/lib/shipeasy_admin/models/update_event_request.rb +198 -0
  154. data/lib/shipeasy_admin/models/update_event_response.rb +166 -0
  155. data/lib/shipeasy_admin/models/update_experiment_request.rb +746 -0
  156. data/lib/shipeasy_admin/models/update_experiment_response.rb +165 -0
  157. data/lib/shipeasy_admin/models/update_gate_request.rb +403 -0
  158. data/lib/shipeasy_admin/models/update_gate_response.rb +166 -0
  159. data/lib/shipeasy_admin/models/update_i18n_key_request.rb +176 -0
  160. data/lib/shipeasy_admin/models/update_i18n_key_response.rb +166 -0
  161. data/lib/shipeasy_admin/models/update_killswitch_request.rb +224 -0
  162. data/lib/shipeasy_admin/models/update_killswitch_response.rb +165 -0
  163. data/lib/shipeasy_admin/models/update_ops_item_request.rb +205 -0
  164. data/lib/shipeasy_admin/models/update_ops_item_response.rb +166 -0
  165. data/lib/shipeasy_admin/models/update_universe_request.rb +213 -0
  166. data/lib/shipeasy_admin/models/update_universe_response.rb +165 -0
  167. data/lib/shipeasy_admin/models/upsert_project_request.rb +222 -0
  168. data/lib/shipeasy_admin/models/upsert_project_response.rb +260 -0
  169. data/lib/shipeasy_admin/version.rb +15 -0
  170. data/lib/shipeasy_admin.rb +196 -0
  171. metadata +230 -2
@@ -0,0 +1,525 @@
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: 1.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 OpsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # File a queue item
23
+ # Files one queue item — a bug report or a feature request — and fires the project's connectors (GitHub issue / Slack). `type` selects which; only the two user-fileable types are accepted (`error`/`alert` tickets are auto-filed). Returns the new id and per-project number. **Use case:** File a bug or feature request programmatically so it lands in the same queue the dashboard shows.
24
+ # @param create_ops_item_request [CreateOpsItemRequest]
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 [CreateOpsItemResponse]
28
+ def create_ops_item(create_ops_item_request, opts = {})
29
+ data, _status_code, _headers = create_ops_item_with_http_info(create_ops_item_request, opts)
30
+ data
31
+ end
32
+
33
+ # File a queue item
34
+ # Files one queue item — a bug report or a feature request — and fires the project's connectors (GitHub issue / Slack). `type` selects which; only the two user-fileable types are accepted (`error`/`alert` tickets are auto-filed). Returns the new id and per-project number. **Use case:** File a bug or feature request programmatically so it lands in the same queue the dashboard shows.
35
+ # @param create_ops_item_request [CreateOpsItemRequest]
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<(CreateOpsItemResponse, Integer, Hash)>] CreateOpsItemResponse data, response status code and response headers
39
+ def create_ops_item_with_http_info(create_ops_item_request, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: OpsApi.create_ops_item ...'
42
+ end
43
+ # verify the required parameter 'create_ops_item_request' is set
44
+ if @api_client.config.client_side_validation && create_ops_item_request.nil?
45
+ fail ArgumentError, "Missing the required parameter 'create_ops_item_request' when calling OpsApi.create_ops_item"
46
+ end
47
+ # resource path
48
+ local_var_path = '/api/admin/ops'
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_ops_item_request)
69
+
70
+ # return_type
71
+ return_type = opts[:debug_return_type] || 'CreateOpsItemResponse'
72
+
73
+ # auth_names
74
+ auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
75
+
76
+ new_options = opts.merge(
77
+ :operation => :"OpsApi.create_ops_item",
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: OpsApi#create_ops_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
+ end
90
+ return data, status_code, headers
91
+ end
92
+
93
+ # Get one queue item
94
+ # Fetch a single queue item by its per-project `number` or full id. **Use case:** Inspect one item's full detail before updating its status or linking a PR.
95
+ # @param handle [String] Per-project item number (e.g. &#x60;7&#x60;) or the full ops item id.
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 [GetOpsItemResponse]
99
+ def get_ops_item(handle, opts = {})
100
+ data, _status_code, _headers = get_ops_item_with_http_info(handle, opts)
101
+ data
102
+ end
103
+
104
+ # Get one queue item
105
+ # Fetch a single queue item by its per-project &#x60;number&#x60; or full id. **Use case:** Inspect one item&#39;s full detail before updating its status or linking a PR.
106
+ # @param handle [String] Per-project item number (e.g. &#x60;7&#x60;) or the full ops item id.
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<(GetOpsItemResponse, Integer, Hash)>] GetOpsItemResponse data, response status code and response headers
110
+ def get_ops_item_with_http_info(handle, opts = {})
111
+ if @api_client.config.debugging
112
+ @api_client.config.logger.debug 'Calling API: OpsApi.get_ops_item ...'
113
+ end
114
+ # resource path
115
+ local_var_path = '/api/admin/ops/{handle}'.sub('{handle}', CGI.escape(handle.to_s))
116
+
117
+ # query parameters
118
+ query_params = opts[:query_params] || {}
119
+
120
+ # header parameters
121
+ header_params = opts[:header_params] || {}
122
+ # HTTP header 'Accept' (if needed)
123
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
124
+ header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
125
+
126
+ # form parameters
127
+ form_params = opts[:form_params] || {}
128
+
129
+ # http body (model)
130
+ post_body = opts[:debug_body]
131
+
132
+ # return_type
133
+ return_type = opts[:debug_return_type] || 'GetOpsItemResponse'
134
+
135
+ # auth_names
136
+ auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
137
+
138
+ new_options = opts.merge(
139
+ :operation => :"OpsApi.get_ops_item",
140
+ :header_params => header_params,
141
+ :query_params => query_params,
142
+ :form_params => form_params,
143
+ :body => post_body,
144
+ :auth_names => auth_names,
145
+ :return_type => return_type
146
+ )
147
+
148
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
149
+ if @api_client.config.debugging
150
+ @api_client.config.logger.debug "API called: OpsApi#get_ops_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
151
+ end
152
+ return data, status_code, headers
153
+ end
154
+
155
+ # Link a fixing PR
156
+ # Record the pull request that fixes a queue item (and clears the link with `prNumber: null`). **Use case:** Tie the fixing PR to the item so closing the PR can flip it to ready_for_qa.
157
+ # @param handle [String] Per-project item number (e.g. &#x60;7&#x60;) or the full ops item id.
158
+ # @param link_pr_to_ops_item_request [LinkPrToOpsItemRequest]
159
+ # @param [Hash] opts the optional parameters
160
+ # @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).
161
+ # @return [LinkPrToOpsItemResponse]
162
+ def link_pr_to_ops_item(handle, link_pr_to_ops_item_request, opts = {})
163
+ data, _status_code, _headers = link_pr_to_ops_item_with_http_info(handle, link_pr_to_ops_item_request, opts)
164
+ data
165
+ end
166
+
167
+ # Link a fixing PR
168
+ # Record the pull request that fixes a queue item (and clears the link with &#x60;prNumber: null&#x60;). **Use case:** Tie the fixing PR to the item so closing the PR can flip it to ready_for_qa.
169
+ # @param handle [String] Per-project item number (e.g. &#x60;7&#x60;) or the full ops item id.
170
+ # @param link_pr_to_ops_item_request [LinkPrToOpsItemRequest]
171
+ # @param [Hash] opts the optional parameters
172
+ # @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).
173
+ # @return [Array<(LinkPrToOpsItemResponse, Integer, Hash)>] LinkPrToOpsItemResponse data, response status code and response headers
174
+ def link_pr_to_ops_item_with_http_info(handle, link_pr_to_ops_item_request, opts = {})
175
+ if @api_client.config.debugging
176
+ @api_client.config.logger.debug 'Calling API: OpsApi.link_pr_to_ops_item ...'
177
+ end
178
+ # verify the required parameter 'handle' is set
179
+ if @api_client.config.client_side_validation && handle.nil?
180
+ fail ArgumentError, "Missing the required parameter 'handle' when calling OpsApi.link_pr_to_ops_item"
181
+ end
182
+ # verify the required parameter 'link_pr_to_ops_item_request' is set
183
+ if @api_client.config.client_side_validation && link_pr_to_ops_item_request.nil?
184
+ fail ArgumentError, "Missing the required parameter 'link_pr_to_ops_item_request' when calling OpsApi.link_pr_to_ops_item"
185
+ end
186
+ # resource path
187
+ local_var_path = '/api/admin/ops/{handle}/link-pr'.sub('{handle}', CGI.escape(handle.to_s))
188
+
189
+ # query parameters
190
+ query_params = opts[:query_params] || {}
191
+
192
+ # header parameters
193
+ header_params = opts[:header_params] || {}
194
+ # HTTP header 'Accept' (if needed)
195
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
196
+ # HTTP header 'Content-Type'
197
+ content_type = @api_client.select_header_content_type(['application/json'])
198
+ if !content_type.nil?
199
+ header_params['Content-Type'] = content_type
200
+ end
201
+ header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
202
+
203
+ # form parameters
204
+ form_params = opts[:form_params] || {}
205
+
206
+ # http body (model)
207
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(link_pr_to_ops_item_request)
208
+
209
+ # return_type
210
+ return_type = opts[:debug_return_type] || 'LinkPrToOpsItemResponse'
211
+
212
+ # auth_names
213
+ auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
214
+
215
+ new_options = opts.merge(
216
+ :operation => :"OpsApi.link_pr_to_ops_item",
217
+ :header_params => header_params,
218
+ :query_params => query_params,
219
+ :form_params => form_params,
220
+ :body => post_body,
221
+ :auth_names => auth_names,
222
+ :return_type => return_type
223
+ )
224
+
225
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
226
+ if @api_client.config.debugging
227
+ @api_client.config.logger.debug "API called: OpsApi#link_pr_to_ops_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
228
+ end
229
+ return data, status_code, headers
230
+ end
231
+
232
+ # List the operational queue
233
+ # Returns the unified ops queue (bugs, feature requests, errors, alerts), newest first. Filter by `type` and/or `status`, and cap with `limit`. **Use case:** Pull the open queue to triage — e.g. every `bug` still `open` — before working items down one by one.
234
+ # @param [Hash] opts the optional parameters
235
+ # @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).
236
+ # @option opts [String] :type Filter by item type (&#x60;bug&#x60;/&#x60;feature_request&#x60;/&#x60;error&#x60;/&#x60;alert&#x60;), or &#x60;all&#x60;.
237
+ # @option opts [String] :status Filter by lifecycle status, or &#x60;all&#x60;.
238
+ # @option opts [Integer] :limit Max items to return (1–500).
239
+ # @return [Array<ListOpsItemsResponseInner>]
240
+ def list_ops_items(opts = {})
241
+ data, _status_code, _headers = list_ops_items_with_http_info(opts)
242
+ data
243
+ end
244
+
245
+ # List the operational queue
246
+ # Returns the unified ops queue (bugs, feature requests, errors, alerts), newest first. Filter by &#x60;type&#x60; and/or &#x60;status&#x60;, and cap with &#x60;limit&#x60;. **Use case:** Pull the open queue to triage — e.g. every &#x60;bug&#x60; still &#x60;open&#x60; — before working items down one by one.
247
+ # @param [Hash] opts the optional parameters
248
+ # @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).
249
+ # @option opts [String] :type Filter by item type (&#x60;bug&#x60;/&#x60;feature_request&#x60;/&#x60;error&#x60;/&#x60;alert&#x60;), or &#x60;all&#x60;.
250
+ # @option opts [String] :status Filter by lifecycle status, or &#x60;all&#x60;.
251
+ # @option opts [Integer] :limit Max items to return (1–500).
252
+ # @return [Array<(Array<ListOpsItemsResponseInner>, Integer, Hash)>] Array<ListOpsItemsResponseInner> data, response status code and response headers
253
+ def list_ops_items_with_http_info(opts = {})
254
+ if @api_client.config.debugging
255
+ @api_client.config.logger.debug 'Calling API: OpsApi.list_ops_items ...'
256
+ end
257
+ allowable_values = ["bug", "feature_request", "error", "alert", "all"]
258
+ if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
259
+ fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
260
+ end
261
+ allowable_values = ["open", "triaged", "in_progress", "ready_for_qa", "resolved", "wont_fix", "all"]
262
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
263
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
264
+ end
265
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
266
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OpsApi.list_ops_items, must be smaller than or equal to 500.'
267
+ end
268
+
269
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
270
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling OpsApi.list_ops_items, must be greater than or equal to 1.'
271
+ end
272
+
273
+ # resource path
274
+ local_var_path = '/api/admin/ops'
275
+
276
+ # query parameters
277
+ query_params = opts[:query_params] || {}
278
+ query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
279
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
280
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
281
+
282
+ # header parameters
283
+ header_params = opts[:header_params] || {}
284
+ # HTTP header 'Accept' (if needed)
285
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
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]
293
+
294
+ # return_type
295
+ return_type = opts[:debug_return_type] || 'Array<ListOpsItemsResponseInner>'
296
+
297
+ # auth_names
298
+ auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
299
+
300
+ new_options = opts.merge(
301
+ :operation => :"OpsApi.list_ops_items",
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(:GET, local_var_path, new_options)
311
+ if @api_client.config.debugging
312
+ @api_client.config.logger.debug "API called: OpsApi#list_ops_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
313
+ end
314
+ return data, status_code, headers
315
+ end
316
+
317
+ # List Slack channels
318
+ # List the project's connected Slack channels — used to resolve an alert rule's notification target. **Use case:** Populate a channel picker, or validate an alert rule's `--slack-channel` before saving.
319
+ # @param [Hash] opts the optional parameters
320
+ # @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).
321
+ # @return [ListSlackChannelsResponse]
322
+ def list_slack_channels(opts = {})
323
+ data, _status_code, _headers = list_slack_channels_with_http_info(opts)
324
+ data
325
+ end
326
+
327
+ # List Slack channels
328
+ # List the project&#39;s connected Slack channels — used to resolve an alert rule&#39;s notification target. **Use case:** Populate a channel picker, or validate an alert rule&#39;s &#x60;--slack-channel&#x60; before saving.
329
+ # @param [Hash] opts the optional parameters
330
+ # @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).
331
+ # @return [Array<(ListSlackChannelsResponse, Integer, Hash)>] ListSlackChannelsResponse data, response status code and response headers
332
+ def list_slack_channels_with_http_info(opts = {})
333
+ if @api_client.config.debugging
334
+ @api_client.config.logger.debug 'Calling API: OpsApi.list_slack_channels ...'
335
+ end
336
+ # resource path
337
+ local_var_path = '/api/admin/slack/channels'
338
+
339
+ # query parameters
340
+ query_params = opts[:query_params] || {}
341
+
342
+ # header parameters
343
+ header_params = opts[:header_params] || {}
344
+ # HTTP header 'Accept' (if needed)
345
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
346
+ header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
347
+
348
+ # form parameters
349
+ form_params = opts[:form_params] || {}
350
+
351
+ # http body (model)
352
+ post_body = opts[:debug_body]
353
+
354
+ # return_type
355
+ return_type = opts[:debug_return_type] || 'ListSlackChannelsResponse'
356
+
357
+ # auth_names
358
+ auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
359
+
360
+ new_options = opts.merge(
361
+ :operation => :"OpsApi.list_slack_channels",
362
+ :header_params => header_params,
363
+ :query_params => query_params,
364
+ :form_params => form_params,
365
+ :body => post_body,
366
+ :auth_names => auth_names,
367
+ :return_type => return_type
368
+ )
369
+
370
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
371
+ if @api_client.config.debugging
372
+ @api_client.config.logger.debug "API called: OpsApi#list_slack_channels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
373
+ end
374
+ return data, status_code, headers
375
+ end
376
+
377
+ # Raise an attention notification
378
+ # Raise a 'needs your attention' bell notification. Create-only and idempotent on `dedupeKey`. **Use case:** Escalate something that needs a human, deduped so repeats don't spam the bell.
379
+ # @param notify_ops_request [NotifyOpsRequest]
380
+ # @param [Hash] opts the optional parameters
381
+ # @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).
382
+ # @return [NotifyOpsResponse]
383
+ def notify_ops(notify_ops_request, opts = {})
384
+ data, _status_code, _headers = notify_ops_with_http_info(notify_ops_request, opts)
385
+ data
386
+ end
387
+
388
+ # Raise an attention notification
389
+ # Raise a &#39;needs your attention&#39; bell notification. Create-only and idempotent on &#x60;dedupeKey&#x60;. **Use case:** Escalate something that needs a human, deduped so repeats don&#39;t spam the bell.
390
+ # @param notify_ops_request [NotifyOpsRequest]
391
+ # @param [Hash] opts the optional parameters
392
+ # @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).
393
+ # @return [Array<(NotifyOpsResponse, Integer, Hash)>] NotifyOpsResponse data, response status code and response headers
394
+ def notify_ops_with_http_info(notify_ops_request, opts = {})
395
+ if @api_client.config.debugging
396
+ @api_client.config.logger.debug 'Calling API: OpsApi.notify_ops ...'
397
+ end
398
+ # verify the required parameter 'notify_ops_request' is set
399
+ if @api_client.config.client_side_validation && notify_ops_request.nil?
400
+ fail ArgumentError, "Missing the required parameter 'notify_ops_request' when calling OpsApi.notify_ops"
401
+ end
402
+ # resource path
403
+ local_var_path = '/api/admin/notifications'
404
+
405
+ # query parameters
406
+ query_params = opts[:query_params] || {}
407
+
408
+ # header parameters
409
+ header_params = opts[:header_params] || {}
410
+ # HTTP header 'Accept' (if needed)
411
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
412
+ # HTTP header 'Content-Type'
413
+ content_type = @api_client.select_header_content_type(['application/json'])
414
+ if !content_type.nil?
415
+ header_params['Content-Type'] = content_type
416
+ end
417
+ header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
418
+
419
+ # form parameters
420
+ form_params = opts[:form_params] || {}
421
+
422
+ # http body (model)
423
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(notify_ops_request)
424
+
425
+ # return_type
426
+ return_type = opts[:debug_return_type] || 'NotifyOpsResponse'
427
+
428
+ # auth_names
429
+ auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
430
+
431
+ new_options = opts.merge(
432
+ :operation => :"OpsApi.notify_ops",
433
+ :header_params => header_params,
434
+ :query_params => query_params,
435
+ :form_params => form_params,
436
+ :body => post_body,
437
+ :auth_names => auth_names,
438
+ :return_type => return_type
439
+ )
440
+
441
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
442
+ if @api_client.config.debugging
443
+ @api_client.config.logger.debug "API called: OpsApi#notify_ops\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
444
+ end
445
+ return data, status_code, headers
446
+ end
447
+
448
+ # Update a queue item
449
+ # Update a queue item's `status` and/or `priority`. Other fields are immutable. **Use case:** Move an item through its lifecycle (triage → in_progress → resolved) as you work it.
450
+ # @param handle [String] Per-project item number (e.g. &#x60;7&#x60;) or the full ops item id.
451
+ # @param update_ops_item_request [UpdateOpsItemRequest]
452
+ # @param [Hash] opts the optional parameters
453
+ # @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).
454
+ # @return [UpdateOpsItemResponse]
455
+ def update_ops_item(handle, update_ops_item_request, opts = {})
456
+ data, _status_code, _headers = update_ops_item_with_http_info(handle, update_ops_item_request, opts)
457
+ data
458
+ end
459
+
460
+ # Update a queue item
461
+ # Update a queue item&#39;s &#x60;status&#x60; and/or &#x60;priority&#x60;. Other fields are immutable. **Use case:** Move an item through its lifecycle (triage → in_progress → resolved) as you work it.
462
+ # @param handle [String] Per-project item number (e.g. &#x60;7&#x60;) or the full ops item id.
463
+ # @param update_ops_item_request [UpdateOpsItemRequest]
464
+ # @param [Hash] opts the optional parameters
465
+ # @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).
466
+ # @return [Array<(UpdateOpsItemResponse, Integer, Hash)>] UpdateOpsItemResponse data, response status code and response headers
467
+ def update_ops_item_with_http_info(handle, update_ops_item_request, opts = {})
468
+ if @api_client.config.debugging
469
+ @api_client.config.logger.debug 'Calling API: OpsApi.update_ops_item ...'
470
+ end
471
+ # verify the required parameter 'handle' is set
472
+ if @api_client.config.client_side_validation && handle.nil?
473
+ fail ArgumentError, "Missing the required parameter 'handle' when calling OpsApi.update_ops_item"
474
+ end
475
+ # verify the required parameter 'update_ops_item_request' is set
476
+ if @api_client.config.client_side_validation && update_ops_item_request.nil?
477
+ fail ArgumentError, "Missing the required parameter 'update_ops_item_request' when calling OpsApi.update_ops_item"
478
+ end
479
+ # resource path
480
+ local_var_path = '/api/admin/ops/{handle}'.sub('{handle}', CGI.escape(handle.to_s))
481
+
482
+ # query parameters
483
+ query_params = opts[:query_params] || {}
484
+
485
+ # header parameters
486
+ header_params = opts[:header_params] || {}
487
+ # HTTP header 'Accept' (if needed)
488
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
489
+ # HTTP header 'Content-Type'
490
+ content_type = @api_client.select_header_content_type(['application/json'])
491
+ if !content_type.nil?
492
+ header_params['Content-Type'] = content_type
493
+ end
494
+ header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
495
+
496
+ # form parameters
497
+ form_params = opts[:form_params] || {}
498
+
499
+ # http body (model)
500
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_ops_item_request)
501
+
502
+ # return_type
503
+ return_type = opts[:debug_return_type] || 'UpdateOpsItemResponse'
504
+
505
+ # auth_names
506
+ auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
507
+
508
+ new_options = opts.merge(
509
+ :operation => :"OpsApi.update_ops_item",
510
+ :header_params => header_params,
511
+ :query_params => query_params,
512
+ :form_params => form_params,
513
+ :body => post_body,
514
+ :auth_names => auth_names,
515
+ :return_type => return_type
516
+ )
517
+
518
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
519
+ if @api_client.config.debugging
520
+ @api_client.config.logger.debug "API called: OpsApi#update_ops_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
521
+ end
522
+ return data, status_code, headers
523
+ end
524
+ end
525
+ end