shipeasy-sdk 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/shipeasy/admin.rb +14 -8
- data/lib/shipeasy/sdk/version.rb +1 -1
- data/lib/shipeasy_admin/api/{alert_rules_api.rb → alerts_api.rb} +77 -17
- data/lib/shipeasy_admin/api/api_keys_api.rb +229 -0
- data/lib/shipeasy_admin/api/attributes_api.rb +1 -1
- data/lib/shipeasy_admin/api/configs_api.rb +78 -1
- data/lib/shipeasy_admin/api/connectors_api.rb +497 -0
- data/lib/shipeasy_admin/api/drafts_api.rb +82 -0
- data/lib/shipeasy_admin/api/errors_api.rb +389 -0
- data/lib/shipeasy_admin/api/events_api.rb +1 -1
- data/lib/shipeasy_admin/api/experiments_api.rb +1 -1
- data/lib/shipeasy_admin/api/{gates_api.rb → flags_api.rb} +27 -27
- data/lib/shipeasy_admin/api/{i18n_api.rb → keys_api.rb} +54 -244
- data/lib/shipeasy_admin/api/{killswitches_api.rb → killswitch_api.rb} +110 -33
- data/lib/shipeasy_admin/api/metrics_api.rb +1 -1
- data/lib/shipeasy_admin/api/ops_api.rb +3 -63
- data/lib/shipeasy_admin/api/profiles_api.rb +226 -0
- data/lib/shipeasy_admin/api/projects_api.rb +64 -1
- data/lib/shipeasy_admin/api/universes_api.rb +1 -1
- data/lib/shipeasy_admin/api_client.rb +1 -1
- data/lib/shipeasy_admin/api_error.rb +1 -1
- data/lib/shipeasy_admin/api_model_base.rb +1 -1
- data/lib/shipeasy_admin/configuration.rb +1 -1
- data/lib/shipeasy_admin/models/approve_event_request.rb +2 -2
- data/lib/shipeasy_admin/models/approve_event_response.rb +1 -1
- data/lib/shipeasy_admin/models/claude_trigger_config.rb +204 -0
- data/lib/shipeasy_admin/models/connector_event.rb +40 -0
- data/lib/shipeasy_admin/models/connector_provider.rb +45 -0
- data/lib/shipeasy_admin/models/connector_record.rb +468 -0
- data/lib/shipeasy_admin/models/copilot_trigger_config.rb +276 -0
- data/lib/shipeasy_admin/models/create_alert_rule_request.rb +6 -31
- data/lib/shipeasy_admin/models/create_alert_rule_response.rb +1 -1
- data/lib/shipeasy_admin/models/create_claude_trigger_request.rb +309 -0
- data/lib/shipeasy_admin/models/create_config_request.rb +14 -3
- data/lib/shipeasy_admin/models/create_config_response.rb +1 -1
- data/lib/shipeasy_admin/models/create_connector_request.rb +64 -0
- data/lib/shipeasy_admin/models/create_connector_response.rb +165 -0
- data/lib/shipeasy_admin/models/create_copilot_trigger_request.rb +316 -0
- data/lib/shipeasy_admin/models/create_cursor_trigger_request.rb +352 -0
- data/lib/shipeasy_admin/models/create_event_request.rb +2 -19
- data/lib/shipeasy_admin/models/create_event_response.rb +1 -1
- data/lib/shipeasy_admin/models/create_experiment_request.rb +39 -101
- data/lib/shipeasy_admin/models/create_experiment_response.rb +1 -1
- data/lib/shipeasy_admin/models/create_gate_request.rb +6 -43
- data/lib/shipeasy_admin/models/create_gate_response.rb +1 -1
- data/lib/shipeasy_admin/models/create_i18n_profile_request.rb +1 -1
- data/lib/shipeasy_admin/models/create_i18n_profile_response.rb +1 -1
- data/lib/shipeasy_admin/models/create_jules_trigger_request.rb +352 -0
- data/lib/shipeasy_admin/models/create_key_request.rb +297 -0
- data/lib/shipeasy_admin/models/create_key_response.rb +286 -0
- data/lib/shipeasy_admin/models/create_killswitch_request.rb +14 -3
- data/lib/shipeasy_admin/models/create_killswitch_response.rb +1 -1
- data/lib/shipeasy_admin/models/create_metric_request.rb +6 -18
- data/lib/shipeasy_admin/models/create_metric_response.rb +1 -1
- data/lib/shipeasy_admin/models/create_o_auth_connector_request.rb +273 -0
- data/lib/shipeasy_admin/models/create_ops_item_request.rb +2 -2
- data/lib/shipeasy_admin/models/create_ops_item_response.rb +2 -2
- data/lib/shipeasy_admin/models/create_universe_request.rb +6 -23
- data/lib/shipeasy_admin/models/create_universe_response.rb +1 -1
- data/lib/shipeasy_admin/models/cursor_trigger_config.rb +231 -0
- data/lib/shipeasy_admin/models/delete_alert_rule_response.rb +1 -1
- data/lib/shipeasy_admin/models/delete_config_response.rb +1 -1
- data/lib/shipeasy_admin/models/delete_connector_response.rb +188 -0
- data/lib/shipeasy_admin/models/delete_event_response.rb +1 -1
- data/lib/shipeasy_admin/models/delete_experiment_response.rb +1 -1
- data/lib/shipeasy_admin/models/delete_gate_response.rb +1 -1
- data/lib/shipeasy_admin/models/delete_killswitch_response.rb +1 -1
- data/lib/shipeasy_admin/models/delete_metric_response.rb +1 -1
- data/lib/shipeasy_admin/models/delete_universe_response.rb +1 -1
- data/lib/shipeasy_admin/models/disable_gate_response.rb +1 -1
- data/lib/shipeasy_admin/models/discard_config_draft_request.rb +7 -10
- data/lib/shipeasy_admin/models/discard_config_draft_response.rb +1 -1
- data/lib/shipeasy_admin/models/enable_gate_response.rb +1 -1
- data/lib/shipeasy_admin/models/env.rb +41 -0
- data/lib/shipeasy_admin/models/{error_response.rb → error.rb} +29 -7
- data/lib/shipeasy_admin/models/error_code.rb +52 -0
- data/lib/shipeasy_admin/models/error_record.rb +597 -0
- data/lib/shipeasy_admin/models/error_series_request.rb +251 -0
- data/lib/shipeasy_admin/models/error_series_response.rb +195 -0
- data/lib/shipeasy_admin/models/error_series_response_rows_inner.rb +192 -0
- data/lib/shipeasy_admin/models/{create_experiment_request_goal_metric.rb → experiment_inline_metric.rb} +9 -8
- data/lib/shipeasy_admin/models/file_error_ticket_response.rb +193 -0
- data/lib/shipeasy_admin/models/fire_connector_request.rb +149 -0
- data/lib/shipeasy_admin/models/fire_connector_response.rb +176 -0
- data/lib/shipeasy_admin/models/get_config_response.rb +1 -1
- data/lib/shipeasy_admin/models/get_current_project_response.rb +1 -1
- data/lib/shipeasy_admin/models/get_current_project_response_module_translations.rb +1 -1
- data/lib/shipeasy_admin/models/get_event_response.rb +1 -1
- data/lib/shipeasy_admin/models/get_experiment_response.rb +1 -1
- data/lib/shipeasy_admin/models/get_experiment_results_response.rb +1 -1
- data/lib/shipeasy_admin/models/get_experiment_results_response_experiment.rb +1 -1
- data/lib/shipeasy_admin/models/get_experiment_results_response_results_inner.rb +1 -1
- data/lib/shipeasy_admin/models/get_experiment_timeseries_response.rb +1 -1
- data/lib/shipeasy_admin/models/get_experiment_timeseries_response_experiment.rb +1 -1
- data/lib/shipeasy_admin/models/get_experiment_timeseries_response_series_inner.rb +1 -1
- data/lib/shipeasy_admin/models/get_killswitch_response.rb +1 -1
- data/lib/shipeasy_admin/models/get_metric_response.rb +1 -1
- data/lib/shipeasy_admin/models/get_ops_item_response.rb +1 -1
- data/lib/shipeasy_admin/models/jules_trigger_config.rb +240 -0
- data/lib/shipeasy_admin/models/key_record.rb +353 -0
- data/lib/shipeasy_admin/models/killswitch_value.rb +178 -0
- data/lib/shipeasy_admin/models/link_pr_to_ops_item_request.rb +1 -1
- data/lib/shipeasy_admin/models/link_pr_to_ops_item_response.rb +1 -1
- data/lib/shipeasy_admin/models/list_alert_rules_response_inner.rb +2 -2
- data/lib/shipeasy_admin/models/list_attributes_response_inner.rb +1 -1
- data/lib/shipeasy_admin/models/list_config_activity_response_inner.rb +1 -1
- data/lib/shipeasy_admin/models/list_configs_response.rb +1 -1
- data/lib/shipeasy_admin/models/list_configs_response_data_inner.rb +1 -1
- data/lib/shipeasy_admin/models/list_configs_response_data_inner_drafts_value.rb +1 -1
- data/lib/shipeasy_admin/models/list_configs_response_data_inner_envs_value.rb +1 -1
- data/lib/shipeasy_admin/models/list_events_response_inner.rb +1 -1
- data/lib/shipeasy_admin/models/list_events_response_inner_properties_inner.rb +1 -31
- data/lib/shipeasy_admin/models/list_experiments_response.rb +1 -1
- data/lib/shipeasy_admin/models/list_experiments_response_data_inner.rb +1 -1
- data/lib/shipeasy_admin/models/list_experiments_response_data_inner_groups_inner.rb +1 -18
- data/lib/shipeasy_admin/models/list_gates_response.rb +1 -1
- data/lib/shipeasy_admin/models/list_gates_response_data_inner.rb +1 -1
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_enabled.rb +1 -1
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_rules_inner.rb +1 -1
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner.rb +1 -1
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of.rb +1 -18
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of1.rb +1 -1
- data/lib/shipeasy_admin/models/list_gates_response_data_inner_stack_inner_one_of_ramp.rb +1 -1
- data/lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb +1 -1
- data/lib/shipeasy_admin/models/list_i18n_keys_response.rb +1 -1
- data/lib/shipeasy_admin/models/list_i18n_keys_response_keys_inner.rb +1 -1
- data/lib/shipeasy_admin/models/list_i18n_profiles_response_inner.rb +1 -1
- data/lib/shipeasy_admin/models/list_keys_response.rb +180 -0
- data/lib/shipeasy_admin/models/list_killswitches_response.rb +1 -1
- data/lib/shipeasy_admin/models/list_killswitches_response_data_inner.rb +1 -1
- data/lib/shipeasy_admin/models/list_killswitches_response_data_inner_envs_value.rb +1 -1
- data/lib/shipeasy_admin/models/list_metrics_response_inner.rb +1 -1
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir.rb +3 -10
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg.rb +1 -1
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of.rb +1 -1
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of1.rb +1 -1
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of2.rb +1 -1
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of3.rb +1 -1
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of4.rb +1 -1
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of5.rb +1 -1
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of6.rb +1 -1
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of7.rb +1 -1
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of8.rb +1 -1
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9.rb +1 -1
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator.rb +1 -1
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_agg_one_of9_numerator_filters_inner.rb +1 -1
- data/lib/shipeasy_admin/models/list_metrics_response_inner_query_ir_group_by.rb +1 -1
- data/lib/shipeasy_admin/models/list_ops_items_response_inner.rb +1 -1
- data/lib/shipeasy_admin/models/list_slack_channels_response.rb +1 -1
- data/lib/shipeasy_admin/models/list_slack_channels_response_channels_inner.rb +1 -1
- data/lib/shipeasy_admin/models/list_universes_response.rb +1 -1
- data/lib/shipeasy_admin/models/list_universes_response_data_inner.rb +1 -1
- data/lib/shipeasy_admin/models/{list_alert_rules_response_inner_notify.rb → notification_target.rb} +6 -24
- data/lib/shipeasy_admin/models/{list_alert_rules_response_inner_notify_slack_channel.rb → notification_target_slack_channel.rb} +4 -7
- data/lib/shipeasy_admin/models/notify_ops_request.rb +1 -1
- data/lib/shipeasy_admin/models/notify_ops_response.rb +1 -1
- data/lib/shipeasy_admin/models/publish_config_draft_request.rb +7 -10
- data/lib/shipeasy_admin/models/publish_config_draft_response.rb +7 -10
- data/lib/shipeasy_admin/models/publish_i18n_profile_request.rb +1 -1
- data/lib/shipeasy_admin/models/publish_i18n_profile_response.rb +1 -1
- data/lib/shipeasy_admin/models/push_i18n_keys_request.rb +1 -1
- data/lib/shipeasy_admin/models/push_i18n_keys_request_keys_inner.rb +1 -1
- data/lib/shipeasy_admin/models/push_i18n_keys_response.rb +1 -1
- data/lib/shipeasy_admin/models/reanalyze_experiment_response.rb +1 -1
- data/lib/shipeasy_admin/models/revoke_key_response.rb +216 -0
- data/lib/shipeasy_admin/models/save_config_draft_request.rb +7 -10
- data/lib/shipeasy_admin/models/save_config_draft_response.rb +7 -10
- data/lib/shipeasy_admin/models/search_hit.rb +284 -0
- data/lib/shipeasy_admin/models/search_response.rb +167 -0
- data/lib/shipeasy_admin/models/set_experiment_metrics_request.rb +1 -1
- data/lib/shipeasy_admin/models/set_experiment_metrics_request_metrics_inner.rb +1 -1
- data/lib/shipeasy_admin/models/set_experiment_metrics_response.rb +1 -1
- data/lib/shipeasy_admin/models/set_experiment_metrics_response_metrics_inner.rb +1 -1
- data/lib/shipeasy_admin/models/set_experiment_status_request.rb +1 -1
- data/lib/shipeasy_admin/models/set_experiment_status_response.rb +1 -1
- data/lib/shipeasy_admin/models/set_i18n_label_request.rb +213 -0
- data/lib/shipeasy_admin/models/set_i18n_label_response.rb +472 -0
- data/lib/shipeasy_admin/models/set_killswitch_switch_request.rb +7 -10
- data/lib/shipeasy_admin/models/set_killswitch_switch_response.rb +7 -10
- data/lib/shipeasy_admin/models/set_killswitch_value_request.rb +214 -0
- data/lib/shipeasy_admin/models/set_killswitch_value_response.rb +283 -0
- data/lib/shipeasy_admin/models/test_connector_response.rb +189 -0
- data/lib/shipeasy_admin/models/unset_killswitch_switch_request.rb +7 -10
- data/lib/shipeasy_admin/models/unset_killswitch_switch_response.rb +7 -10
- data/lib/shipeasy_admin/models/update_alert_rule_request.rb +2 -4
- data/lib/shipeasy_admin/models/update_alert_rule_response.rb +1 -1
- data/lib/shipeasy_admin/models/update_config_request.rb +2 -2
- data/lib/shipeasy_admin/models/update_config_response.rb +1 -1
- data/lib/shipeasy_admin/models/update_config_schema_request.rb +168 -0
- data/lib/shipeasy_admin/models/update_config_schema_response.rb +165 -0
- data/lib/shipeasy_admin/models/update_connector_request.rb +211 -0
- data/lib/shipeasy_admin/models/update_connector_response.rb +166 -0
- data/lib/shipeasy_admin/models/update_error_status_request.rb +190 -0
- data/lib/shipeasy_admin/models/update_event_request.rb +2 -2
- data/lib/shipeasy_admin/models/update_event_response.rb +1 -1
- data/lib/shipeasy_admin/models/update_experiment_request.rb +5 -4
- data/lib/shipeasy_admin/models/update_experiment_response.rb +1 -1
- data/lib/shipeasy_admin/models/update_gate_request.rb +2 -2
- data/lib/shipeasy_admin/models/update_gate_response.rb +1 -1
- data/lib/shipeasy_admin/models/update_i18n_key_request.rb +1 -1
- data/lib/shipeasy_admin/models/update_i18n_key_response.rb +1 -1
- data/lib/shipeasy_admin/models/update_killswitch_request.rb +2 -2
- data/lib/shipeasy_admin/models/update_killswitch_response.rb +1 -1
- data/lib/shipeasy_admin/models/update_ops_item_request.rb +1 -1
- data/lib/shipeasy_admin/models/update_ops_item_response.rb +1 -1
- data/lib/shipeasy_admin/models/update_universe_request.rb +2 -2
- data/lib/shipeasy_admin/models/update_universe_response.rb +1 -1
- data/lib/shipeasy_admin/models/upsert_project_request.rb +1 -1
- data/lib/shipeasy_admin/models/upsert_project_response.rb +1 -1
- data/lib/shipeasy_admin/version.rb +1 -1
- data/lib/shipeasy_admin.rb +56 -9
- metadata +56 -9
|
@@ -0,0 +1,497 @@
|
|
|
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 ConnectorsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create a connector
|
|
23
|
+
# Creates a connector. The request body is discriminated on `provider`. - **OAuth/app providers** (`google_sheets`, `github`, `slack`) — supply `{ provider, name, events }`. The connector is created `enabled: false` with empty `config` and no credentials; the provider's OAuth flow then attaches credentials and enables it. - **Trigger providers** (`claude_trigger`, `cursor_trigger`, `copilot_trigger`, `jules_trigger`) — supply `config` plus the provider's credential field(s) and the connector is fireable immediately. Trigger creates are **idempotent** by their natural key (`config.routineId` / `config.repoUrl` / `config.owner`+`config.repo` / `config.source`): re-creating updates the existing row rather than duplicating it. **Use cases** - **File bugs as GitHub Issues** — `{ \"provider\": \"github\", \"name\": \"Bugs → acme/app\", \"events\": [\"bug.created\"] }`, then finish the GitHub App install. - **Nightly ops sweep** — register a `claude_trigger` with its `routineId` and (optionally) a fire `token`; subscribe `events` later to auto-fire on new bugs. - **Cold cloud-agent run** — register a `cursor_trigger`/`jules_trigger` with the repo coordinates plus both keys, or a `copilot_trigger` with the repo + user PAT.
|
|
24
|
+
# @param create_connector_request [CreateConnectorRequest]
|
|
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 [CreateConnectorResponse]
|
|
28
|
+
def create_connector(create_connector_request, opts = {})
|
|
29
|
+
data, _status_code, _headers = create_connector_with_http_info(create_connector_request, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Create a connector
|
|
34
|
+
# Creates a connector. The request body is discriminated on `provider`. - **OAuth/app providers** (`google_sheets`, `github`, `slack`) — supply `{ provider, name, events }`. The connector is created `enabled: false` with empty `config` and no credentials; the provider's OAuth flow then attaches credentials and enables it. - **Trigger providers** (`claude_trigger`, `cursor_trigger`, `copilot_trigger`, `jules_trigger`) — supply `config` plus the provider's credential field(s) and the connector is fireable immediately. Trigger creates are **idempotent** by their natural key (`config.routineId` / `config.repoUrl` / `config.owner`+`config.repo` / `config.source`): re-creating updates the existing row rather than duplicating it. **Use cases** - **File bugs as GitHub Issues** — `{ \"provider\": \"github\", \"name\": \"Bugs → acme/app\", \"events\": [\"bug.created\"] }`, then finish the GitHub App install. - **Nightly ops sweep** — register a `claude_trigger` with its `routineId` and (optionally) a fire `token`; subscribe `events` later to auto-fire on new bugs. - **Cold cloud-agent run** — register a `cursor_trigger`/`jules_trigger` with the repo coordinates plus both keys, or a `copilot_trigger` with the repo + user PAT.
|
|
35
|
+
# @param create_connector_request [CreateConnectorRequest]
|
|
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<(CreateConnectorResponse, Integer, Hash)>] CreateConnectorResponse data, response status code and response headers
|
|
39
|
+
def create_connector_with_http_info(create_connector_request, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: ConnectorsApi.create_connector ...'
|
|
42
|
+
end
|
|
43
|
+
# verify the required parameter 'create_connector_request' is set
|
|
44
|
+
if @api_client.config.client_side_validation && create_connector_request.nil?
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'create_connector_request' when calling ConnectorsApi.create_connector"
|
|
46
|
+
end
|
|
47
|
+
# resource path
|
|
48
|
+
local_var_path = '/api/admin/connectors'
|
|
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_connector_request)
|
|
69
|
+
|
|
70
|
+
# return_type
|
|
71
|
+
return_type = opts[:debug_return_type] || 'CreateConnectorResponse'
|
|
72
|
+
|
|
73
|
+
# auth_names
|
|
74
|
+
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
75
|
+
|
|
76
|
+
new_options = opts.merge(
|
|
77
|
+
:operation => :"ConnectorsApi.create_connector",
|
|
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: ConnectorsApi#create_connector\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
89
|
+
end
|
|
90
|
+
return data, status_code, headers
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Delete a connector
|
|
94
|
+
# Permanently removes the connector and its stored credentials. **Use case:** Disconnect an integration for good — e.g. tear down a `github` connector after migrating bug routing elsewhere.
|
|
95
|
+
# @param id [String] Stable opaque connector 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 [DeleteConnectorResponse]
|
|
99
|
+
def delete_connector(id, opts = {})
|
|
100
|
+
data, _status_code, _headers = delete_connector_with_http_info(id, opts)
|
|
101
|
+
data
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Delete a connector
|
|
105
|
+
# Permanently removes the connector and its stored credentials. **Use case:** Disconnect an integration for good — e.g. tear down a `github` connector after migrating bug routing elsewhere.
|
|
106
|
+
# @param id [String] Stable opaque connector 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<(DeleteConnectorResponse, Integer, Hash)>] DeleteConnectorResponse data, response status code and response headers
|
|
110
|
+
def delete_connector_with_http_info(id, opts = {})
|
|
111
|
+
if @api_client.config.debugging
|
|
112
|
+
@api_client.config.logger.debug 'Calling API: ConnectorsApi.delete_connector ...'
|
|
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 ConnectorsApi.delete_connector"
|
|
117
|
+
end
|
|
118
|
+
# resource path
|
|
119
|
+
local_var_path = '/api/admin/connectors/{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] || 'DeleteConnectorResponse'
|
|
138
|
+
|
|
139
|
+
# auth_names
|
|
140
|
+
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
141
|
+
|
|
142
|
+
new_options = opts.merge(
|
|
143
|
+
:operation => :"ConnectorsApi.delete_connector",
|
|
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: ConnectorsApi#delete_connector\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
155
|
+
end
|
|
156
|
+
return data, status_code, headers
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Fire a trigger connector
|
|
160
|
+
# Manually kicks a trigger connector's run — Claude (kicks its preconfigured routine) or Cursor / Copilot / Jules (launches a cold cloud-agent run). Firing is event-less: it kicks the run with an optional caller-supplied prompt override rather than dispatching a single lifecycle payload. Only trigger providers can be fired, and only once authenticated (a tokenless trigger cannot fire). The attempt's outcome is recorded on the connector's `lastAttemptAt` / `lastError` / `lastSuccessAt`. **Use case:** Kick a one-off ops sweep on demand from the dashboard's \"Fire now\" button, optionally overriding the routine's default prompt.
|
|
161
|
+
# @param id [String] Stable opaque connector id.
|
|
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
|
+
# @option opts [FireConnectorRequest] :fire_connector_request
|
|
165
|
+
# @return [FireConnectorResponse]
|
|
166
|
+
def fire_connector(id, opts = {})
|
|
167
|
+
data, _status_code, _headers = fire_connector_with_http_info(id, opts)
|
|
168
|
+
data
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Fire a trigger connector
|
|
172
|
+
# Manually kicks a trigger connector's run — Claude (kicks its preconfigured routine) or Cursor / Copilot / Jules (launches a cold cloud-agent run). Firing is event-less: it kicks the run with an optional caller-supplied prompt override rather than dispatching a single lifecycle payload. Only trigger providers can be fired, and only once authenticated (a tokenless trigger cannot fire). The attempt's outcome is recorded on the connector's `lastAttemptAt` / `lastError` / `lastSuccessAt`. **Use case:** Kick a one-off ops sweep on demand from the dashboard's \"Fire now\" button, optionally overriding the routine's default prompt.
|
|
173
|
+
# @param id [String] Stable opaque connector id.
|
|
174
|
+
# @param [Hash] opts the optional parameters
|
|
175
|
+
# @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).
|
|
176
|
+
# @option opts [FireConnectorRequest] :fire_connector_request
|
|
177
|
+
# @return [Array<(FireConnectorResponse, Integer, Hash)>] FireConnectorResponse data, response status code and response headers
|
|
178
|
+
def fire_connector_with_http_info(id, opts = {})
|
|
179
|
+
if @api_client.config.debugging
|
|
180
|
+
@api_client.config.logger.debug 'Calling API: ConnectorsApi.fire_connector ...'
|
|
181
|
+
end
|
|
182
|
+
# verify the required parameter 'id' is set
|
|
183
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
184
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ConnectorsApi.fire_connector"
|
|
185
|
+
end
|
|
186
|
+
# resource path
|
|
187
|
+
local_var_path = '/api/admin/connectors/{id}/fire'.sub('{id}', CGI.escape(id.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(opts[:'fire_connector_request'])
|
|
208
|
+
|
|
209
|
+
# return_type
|
|
210
|
+
return_type = opts[:debug_return_type] || 'FireConnectorResponse'
|
|
211
|
+
|
|
212
|
+
# auth_names
|
|
213
|
+
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
214
|
+
|
|
215
|
+
new_options = opts.merge(
|
|
216
|
+
:operation => :"ConnectorsApi.fire_connector",
|
|
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: ConnectorsApi#fire_connector\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
228
|
+
end
|
|
229
|
+
return data, status_code, headers
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Get a connector
|
|
233
|
+
# Returns a single connector by id. The encrypted credentials are never serialised. **Use case:** Inspect one connector's health — its `enabled` state, subscribed `events`, and last-attempt outcome (`lastError`/`lastSuccessAt`).
|
|
234
|
+
# @param id [String] Stable opaque connector id.
|
|
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
|
+
# @return [ConnectorRecord]
|
|
238
|
+
def get_connector(id, opts = {})
|
|
239
|
+
data, _status_code, _headers = get_connector_with_http_info(id, opts)
|
|
240
|
+
data
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# Get a connector
|
|
244
|
+
# Returns a single connector by id. The encrypted credentials are never serialised. **Use case:** Inspect one connector's health — its `enabled` state, subscribed `events`, and last-attempt outcome (`lastError`/`lastSuccessAt`).
|
|
245
|
+
# @param id [String] Stable opaque connector id.
|
|
246
|
+
# @param [Hash] opts the optional parameters
|
|
247
|
+
# @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).
|
|
248
|
+
# @return [Array<(ConnectorRecord, Integer, Hash)>] ConnectorRecord data, response status code and response headers
|
|
249
|
+
def get_connector_with_http_info(id, opts = {})
|
|
250
|
+
if @api_client.config.debugging
|
|
251
|
+
@api_client.config.logger.debug 'Calling API: ConnectorsApi.get_connector ...'
|
|
252
|
+
end
|
|
253
|
+
# resource path
|
|
254
|
+
local_var_path = '/api/admin/connectors/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
255
|
+
|
|
256
|
+
# query parameters
|
|
257
|
+
query_params = opts[:query_params] || {}
|
|
258
|
+
|
|
259
|
+
# header parameters
|
|
260
|
+
header_params = opts[:header_params] || {}
|
|
261
|
+
# HTTP header 'Accept' (if needed)
|
|
262
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
263
|
+
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
264
|
+
|
|
265
|
+
# form parameters
|
|
266
|
+
form_params = opts[:form_params] || {}
|
|
267
|
+
|
|
268
|
+
# http body (model)
|
|
269
|
+
post_body = opts[:debug_body]
|
|
270
|
+
|
|
271
|
+
# return_type
|
|
272
|
+
return_type = opts[:debug_return_type] || 'ConnectorRecord'
|
|
273
|
+
|
|
274
|
+
# auth_names
|
|
275
|
+
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
276
|
+
|
|
277
|
+
new_options = opts.merge(
|
|
278
|
+
:operation => :"ConnectorsApi.get_connector",
|
|
279
|
+
:header_params => header_params,
|
|
280
|
+
:query_params => query_params,
|
|
281
|
+
:form_params => form_params,
|
|
282
|
+
:body => post_body,
|
|
283
|
+
:auth_names => auth_names,
|
|
284
|
+
:return_type => return_type
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
288
|
+
if @api_client.config.debugging
|
|
289
|
+
@api_client.config.logger.debug "API called: ConnectorsApi#get_connector\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
290
|
+
end
|
|
291
|
+
return data, status_code, headers
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
# List connectors
|
|
295
|
+
# Returns every connector in the project as a bare array (no pagination envelope). The encrypted credentials backing each connector are never serialised — only the connector's non-secret `config`, `accountLabel`, and last-attempt health (`lastError`, `lastAttemptAt`, `lastSuccessAt`) are returned. **Use case:** Render the integrations/triggers settings page, or drive a CI check that asserts every `github` connector is `enabled` and last dispatched without error.
|
|
296
|
+
# @param [Hash] opts the optional parameters
|
|
297
|
+
# @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).
|
|
298
|
+
# @return [Array<ConnectorRecord>]
|
|
299
|
+
def list_connectors(opts = {})
|
|
300
|
+
data, _status_code, _headers = list_connectors_with_http_info(opts)
|
|
301
|
+
data
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
# List connectors
|
|
305
|
+
# Returns every connector in the project as a bare array (no pagination envelope). The encrypted credentials backing each connector are never serialised — only the connector's non-secret `config`, `accountLabel`, and last-attempt health (`lastError`, `lastAttemptAt`, `lastSuccessAt`) are returned. **Use case:** Render the integrations/triggers settings page, or drive a CI check that asserts every `github` connector is `enabled` and last dispatched without error.
|
|
306
|
+
# @param [Hash] opts the optional parameters
|
|
307
|
+
# @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).
|
|
308
|
+
# @return [Array<(Array<ConnectorRecord>, Integer, Hash)>] Array<ConnectorRecord> data, response status code and response headers
|
|
309
|
+
def list_connectors_with_http_info(opts = {})
|
|
310
|
+
if @api_client.config.debugging
|
|
311
|
+
@api_client.config.logger.debug 'Calling API: ConnectorsApi.list_connectors ...'
|
|
312
|
+
end
|
|
313
|
+
# resource path
|
|
314
|
+
local_var_path = '/api/admin/connectors'
|
|
315
|
+
|
|
316
|
+
# query parameters
|
|
317
|
+
query_params = opts[:query_params] || {}
|
|
318
|
+
|
|
319
|
+
# header parameters
|
|
320
|
+
header_params = opts[:header_params] || {}
|
|
321
|
+
# HTTP header 'Accept' (if needed)
|
|
322
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
323
|
+
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
324
|
+
|
|
325
|
+
# form parameters
|
|
326
|
+
form_params = opts[:form_params] || {}
|
|
327
|
+
|
|
328
|
+
# http body (model)
|
|
329
|
+
post_body = opts[:debug_body]
|
|
330
|
+
|
|
331
|
+
# return_type
|
|
332
|
+
return_type = opts[:debug_return_type] || 'Array<ConnectorRecord>'
|
|
333
|
+
|
|
334
|
+
# auth_names
|
|
335
|
+
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
336
|
+
|
|
337
|
+
new_options = opts.merge(
|
|
338
|
+
:operation => :"ConnectorsApi.list_connectors",
|
|
339
|
+
:header_params => header_params,
|
|
340
|
+
:query_params => query_params,
|
|
341
|
+
:form_params => form_params,
|
|
342
|
+
:body => post_body,
|
|
343
|
+
:auth_names => auth_names,
|
|
344
|
+
:return_type => return_type
|
|
345
|
+
)
|
|
346
|
+
|
|
347
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
348
|
+
if @api_client.config.debugging
|
|
349
|
+
@api_client.config.logger.debug "API called: ConnectorsApi#list_connectors\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
350
|
+
end
|
|
351
|
+
return data, status_code, headers
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
# Test a connector
|
|
355
|
+
# Dispatches a single synthetic `bug.created` payload to the connector's destination so you can verify the integration end-to-end. Unlike `fire`, this runs the real dispatch path (posts a Slack message / appends a Sheets row / files a GitHub Issue) with throwaway test content. The attempt's outcome is recorded on the connector's `lastAttemptAt` / `lastError` / `lastSuccessAt`. When the provider produces a linkable artifact (e.g. a GitHub Issue), its URL is returned as `issueUrl`; otherwise `issueUrl` is `null`. **Use case:** Click \"Send test\" after wiring up a connector to confirm credentials and config are correct before relying on it for real events.
|
|
356
|
+
# @param id [String] Stable opaque connector id.
|
|
357
|
+
# @param [Hash] opts the optional parameters
|
|
358
|
+
# @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).
|
|
359
|
+
# @return [TestConnectorResponse]
|
|
360
|
+
def test_connector(id, opts = {})
|
|
361
|
+
data, _status_code, _headers = test_connector_with_http_info(id, opts)
|
|
362
|
+
data
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
# Test a connector
|
|
366
|
+
# Dispatches a single synthetic `bug.created` payload to the connector's destination so you can verify the integration end-to-end. Unlike `fire`, this runs the real dispatch path (posts a Slack message / appends a Sheets row / files a GitHub Issue) with throwaway test content. The attempt's outcome is recorded on the connector's `lastAttemptAt` / `lastError` / `lastSuccessAt`. When the provider produces a linkable artifact (e.g. a GitHub Issue), its URL is returned as `issueUrl`; otherwise `issueUrl` is `null`. **Use case:** Click \"Send test\" after wiring up a connector to confirm credentials and config are correct before relying on it for real events.
|
|
367
|
+
# @param id [String] Stable opaque connector id.
|
|
368
|
+
# @param [Hash] opts the optional parameters
|
|
369
|
+
# @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).
|
|
370
|
+
# @return [Array<(TestConnectorResponse, Integer, Hash)>] TestConnectorResponse data, response status code and response headers
|
|
371
|
+
def test_connector_with_http_info(id, opts = {})
|
|
372
|
+
if @api_client.config.debugging
|
|
373
|
+
@api_client.config.logger.debug 'Calling API: ConnectorsApi.test_connector ...'
|
|
374
|
+
end
|
|
375
|
+
# verify the required parameter 'id' is set
|
|
376
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
377
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ConnectorsApi.test_connector"
|
|
378
|
+
end
|
|
379
|
+
# resource path
|
|
380
|
+
local_var_path = '/api/admin/connectors/{id}/test'.sub('{id}', CGI.escape(id.to_s))
|
|
381
|
+
|
|
382
|
+
# query parameters
|
|
383
|
+
query_params = opts[:query_params] || {}
|
|
384
|
+
|
|
385
|
+
# header parameters
|
|
386
|
+
header_params = opts[:header_params] || {}
|
|
387
|
+
# HTTP header 'Accept' (if needed)
|
|
388
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
389
|
+
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
390
|
+
|
|
391
|
+
# form parameters
|
|
392
|
+
form_params = opts[:form_params] || {}
|
|
393
|
+
|
|
394
|
+
# http body (model)
|
|
395
|
+
post_body = opts[:debug_body]
|
|
396
|
+
|
|
397
|
+
# return_type
|
|
398
|
+
return_type = opts[:debug_return_type] || 'TestConnectorResponse'
|
|
399
|
+
|
|
400
|
+
# auth_names
|
|
401
|
+
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
402
|
+
|
|
403
|
+
new_options = opts.merge(
|
|
404
|
+
:operation => :"ConnectorsApi.test_connector",
|
|
405
|
+
:header_params => header_params,
|
|
406
|
+
:query_params => query_params,
|
|
407
|
+
:form_params => form_params,
|
|
408
|
+
:body => post_body,
|
|
409
|
+
:auth_names => auth_names,
|
|
410
|
+
:return_type => return_type
|
|
411
|
+
)
|
|
412
|
+
|
|
413
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
414
|
+
if @api_client.config.debugging
|
|
415
|
+
@api_client.config.logger.debug "API called: ConnectorsApi#test_connector\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
416
|
+
end
|
|
417
|
+
return data, status_code, headers
|
|
418
|
+
end
|
|
419
|
+
|
|
420
|
+
# Update a connector
|
|
421
|
+
# Partial update — only supplied fields change. `events` and `config` **replace** wholesale; there is no merge or append. Secrets cannot be set through this endpoint (credential rotation goes through the provider-specific re-register flow). The response carries only `{ id }` — re-fetch via `GET /api/admin/connectors/{id}` for the new row. **Use cases** - **Pause a connector** — `{ \"enabled\": false }`. Stops all dispatch / auto-fire without deleting it. - **Change subscribed events** — send the full new `events` array. An empty array unsubscribes the connector from every event. - **Rename** — `{ \"name\": \"Bugs → acme/app issues\" }`. - **Retarget** — send a new `config` (e.g. a different Sheets `sheetTitle`); it replaces the stored config wholesale.
|
|
422
|
+
# @param id [String] Stable opaque connector id.
|
|
423
|
+
# @param update_connector_request [UpdateConnectorRequest]
|
|
424
|
+
# @param [Hash] opts the optional parameters
|
|
425
|
+
# @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).
|
|
426
|
+
# @return [UpdateConnectorResponse]
|
|
427
|
+
def update_connector(id, update_connector_request, opts = {})
|
|
428
|
+
data, _status_code, _headers = update_connector_with_http_info(id, update_connector_request, opts)
|
|
429
|
+
data
|
|
430
|
+
end
|
|
431
|
+
|
|
432
|
+
# Update a connector
|
|
433
|
+
# Partial update — only supplied fields change. `events` and `config` **replace** wholesale; there is no merge or append. Secrets cannot be set through this endpoint (credential rotation goes through the provider-specific re-register flow). The response carries only `{ id }` — re-fetch via `GET /api/admin/connectors/{id}` for the new row. **Use cases** - **Pause a connector** — `{ \"enabled\": false }`. Stops all dispatch / auto-fire without deleting it. - **Change subscribed events** — send the full new `events` array. An empty array unsubscribes the connector from every event. - **Rename** — `{ \"name\": \"Bugs → acme/app issues\" }`. - **Retarget** — send a new `config` (e.g. a different Sheets `sheetTitle`); it replaces the stored config wholesale.
|
|
434
|
+
# @param id [String] Stable opaque connector id.
|
|
435
|
+
# @param update_connector_request [UpdateConnectorRequest]
|
|
436
|
+
# @param [Hash] opts the optional parameters
|
|
437
|
+
# @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).
|
|
438
|
+
# @return [Array<(UpdateConnectorResponse, Integer, Hash)>] UpdateConnectorResponse data, response status code and response headers
|
|
439
|
+
def update_connector_with_http_info(id, update_connector_request, opts = {})
|
|
440
|
+
if @api_client.config.debugging
|
|
441
|
+
@api_client.config.logger.debug 'Calling API: ConnectorsApi.update_connector ...'
|
|
442
|
+
end
|
|
443
|
+
# verify the required parameter 'id' is set
|
|
444
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
445
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ConnectorsApi.update_connector"
|
|
446
|
+
end
|
|
447
|
+
# verify the required parameter 'update_connector_request' is set
|
|
448
|
+
if @api_client.config.client_side_validation && update_connector_request.nil?
|
|
449
|
+
fail ArgumentError, "Missing the required parameter 'update_connector_request' when calling ConnectorsApi.update_connector"
|
|
450
|
+
end
|
|
451
|
+
# resource path
|
|
452
|
+
local_var_path = '/api/admin/connectors/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
453
|
+
|
|
454
|
+
# query parameters
|
|
455
|
+
query_params = opts[:query_params] || {}
|
|
456
|
+
|
|
457
|
+
# header parameters
|
|
458
|
+
header_params = opts[:header_params] || {}
|
|
459
|
+
# HTTP header 'Accept' (if needed)
|
|
460
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
461
|
+
# HTTP header 'Content-Type'
|
|
462
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
463
|
+
if !content_type.nil?
|
|
464
|
+
header_params['Content-Type'] = content_type
|
|
465
|
+
end
|
|
466
|
+
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
467
|
+
|
|
468
|
+
# form parameters
|
|
469
|
+
form_params = opts[:form_params] || {}
|
|
470
|
+
|
|
471
|
+
# http body (model)
|
|
472
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_connector_request)
|
|
473
|
+
|
|
474
|
+
# return_type
|
|
475
|
+
return_type = opts[:debug_return_type] || 'UpdateConnectorResponse'
|
|
476
|
+
|
|
477
|
+
# auth_names
|
|
478
|
+
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
479
|
+
|
|
480
|
+
new_options = opts.merge(
|
|
481
|
+
:operation => :"ConnectorsApi.update_connector",
|
|
482
|
+
:header_params => header_params,
|
|
483
|
+
:query_params => query_params,
|
|
484
|
+
:form_params => form_params,
|
|
485
|
+
:body => post_body,
|
|
486
|
+
:auth_names => auth_names,
|
|
487
|
+
:return_type => return_type
|
|
488
|
+
)
|
|
489
|
+
|
|
490
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
491
|
+
if @api_client.config.debugging
|
|
492
|
+
@api_client.config.logger.debug "API called: ConnectorsApi#update_connector\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
493
|
+
end
|
|
494
|
+
return data, status_code, headers
|
|
495
|
+
end
|
|
496
|
+
end
|
|
497
|
+
end
|
|
@@ -0,0 +1,82 @@
|
|
|
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 DraftsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# List translation drafts
|
|
23
|
+
# List staged translation drafts awaiting review/publish. **Use case:** Review machine-translation drafts before publishing them to a locale.
|
|
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
|
+
# @return [Array<ListI18nDraftsResponseInner>]
|
|
27
|
+
def list_i18n_drafts(opts = {})
|
|
28
|
+
data, _status_code, _headers = list_i18n_drafts_with_http_info(opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# List translation drafts
|
|
33
|
+
# List staged translation drafts awaiting review/publish. **Use case:** Review machine-translation drafts before publishing them to a locale.
|
|
34
|
+
# @param [Hash] opts the optional parameters
|
|
35
|
+
# @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).
|
|
36
|
+
# @return [Array<(Array<ListI18nDraftsResponseInner>, Integer, Hash)>] Array<ListI18nDraftsResponseInner> data, response status code and response headers
|
|
37
|
+
def list_i18n_drafts_with_http_info(opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: DraftsApi.list_i18n_drafts ...'
|
|
40
|
+
end
|
|
41
|
+
# resource path
|
|
42
|
+
local_var_path = '/api/admin/i18n/drafts'
|
|
43
|
+
|
|
44
|
+
# query parameters
|
|
45
|
+
query_params = opts[:query_params] || {}
|
|
46
|
+
|
|
47
|
+
# header parameters
|
|
48
|
+
header_params = opts[:header_params] || {}
|
|
49
|
+
# HTTP header 'Accept' (if needed)
|
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
51
|
+
header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?
|
|
52
|
+
|
|
53
|
+
# form parameters
|
|
54
|
+
form_params = opts[:form_params] || {}
|
|
55
|
+
|
|
56
|
+
# http body (model)
|
|
57
|
+
post_body = opts[:debug_body]
|
|
58
|
+
|
|
59
|
+
# return_type
|
|
60
|
+
return_type = opts[:debug_return_type] || 'Array<ListI18nDraftsResponseInner>'
|
|
61
|
+
|
|
62
|
+
# auth_names
|
|
63
|
+
auth_names = opts[:debug_auth_names] || ['bearerSdkKey']
|
|
64
|
+
|
|
65
|
+
new_options = opts.merge(
|
|
66
|
+
:operation => :"DraftsApi.list_i18n_drafts",
|
|
67
|
+
:header_params => header_params,
|
|
68
|
+
:query_params => query_params,
|
|
69
|
+
:form_params => form_params,
|
|
70
|
+
:body => post_body,
|
|
71
|
+
:auth_names => auth_names,
|
|
72
|
+
:return_type => return_type
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
76
|
+
if @api_client.config.debugging
|
|
77
|
+
@api_client.config.logger.debug "API called: DraftsApi#list_i18n_drafts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
78
|
+
end
|
|
79
|
+
return data, status_code, headers
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|