Class: Shipeasy::Admin::Generated::ConnectorsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/shipeasy_admin/api/connectors_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ConnectorsApi

Returns a new instance of ConnectorsApi.



19
20
21
# File 'lib/shipeasy_admin/api/connectors_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/shipeasy_admin/api/connectors_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_connector(create_connector_request, opts = {}) ⇒ CreateConnectorResponse

Create a connector 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.

Parameters:

Options Hash (opts):

  • :x_project_id (String)

    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).

Returns:



28
29
30
31
# File 'lib/shipeasy_admin/api/connectors_api.rb', line 28

def create_connector(create_connector_request, opts = {})
  data, _status_code, _headers = create_connector_with_http_info(create_connector_request, opts)
  data
end

#create_connector_with_http_info(create_connector_request, opts = {}) ⇒ Array<(CreateConnectorResponse, Integer, Hash)>

Create a connector 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 — `{ &quot;provider&quot;: &quot;github&quot;, &quot;name&quot;: &quot;Bugs → acme/app&quot;, &quot;events&quot;: [&quot;bug.created&quot;] }`, 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.

Parameters:

Options Hash (opts):

  • :x_project_id (String)

    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).

Returns:

  • (Array<(CreateConnectorResponse, Integer, Hash)>)

    CreateConnectorResponse data, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/shipeasy_admin/api/connectors_api.rb', line 39

def create_connector_with_http_info(create_connector_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectorsApi.create_connector ...'
  end
  # verify the required parameter 'create_connector_request' is set
  if @api_client.config.client_side_validation && create_connector_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_connector_request' when calling ConnectorsApi.create_connector"
  end
  # resource path
  local_var_path = '/api/admin/connectors'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_connector_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateConnectorResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerSdkKey']

  new_options = opts.merge(
    :operation => :"ConnectorsApi.create_connector",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConnectorsApi#create_connector\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_connector(id, opts = {}) ⇒ DeleteConnectorResponse

Delete a connector 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.

Parameters:

  • id (String)

    Stable opaque connector id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    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).

Returns:



99
100
101
102
# File 'lib/shipeasy_admin/api/connectors_api.rb', line 99

def delete_connector(id, opts = {})
  data, _status_code, _headers = delete_connector_with_http_info(id, opts)
  data
end

#delete_connector_with_http_info(id, opts = {}) ⇒ Array<(DeleteConnectorResponse, Integer, Hash)>

Delete a connector 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.

Parameters:

  • id (String)

    Stable opaque connector id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    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).

Returns:

  • (Array<(DeleteConnectorResponse, Integer, Hash)>)

    DeleteConnectorResponse data, response status code and response headers



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/shipeasy_admin/api/connectors_api.rb', line 110

def delete_connector_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectorsApi.delete_connector ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ConnectorsApi.delete_connector"
  end
  # resource path
  local_var_path = '/api/admin/connectors/{id}'.sub('{id}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DeleteConnectorResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerSdkKey']

  new_options = opts.merge(
    :operation => :"ConnectorsApi.delete_connector",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConnectorsApi#delete_connector\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#fire_connector(id, opts = {}) ⇒ FireConnectorResponse

Fire a trigger connector 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.

Parameters:

  • id (String)

    Stable opaque connector id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    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).

  • :fire_connector_request (FireConnectorRequest)

Returns:



166
167
168
169
# File 'lib/shipeasy_admin/api/connectors_api.rb', line 166

def fire_connector(id, opts = {})
  data, _status_code, _headers = fire_connector_with_http_info(id, opts)
  data
end

#fire_connector_with_http_info(id, opts = {}) ⇒ Array<(FireConnectorResponse, Integer, Hash)>

Fire a trigger connector 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 &quot;Fire now&quot; button, optionally overriding the routine's default prompt.

Parameters:

  • id (String)

    Stable opaque connector id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    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).

  • :fire_connector_request (FireConnectorRequest)

Returns:

  • (Array<(FireConnectorResponse, Integer, Hash)>)

    FireConnectorResponse data, response status code and response headers



178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/shipeasy_admin/api/connectors_api.rb', line 178

def fire_connector_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectorsApi.fire_connector ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ConnectorsApi.fire_connector"
  end
  # resource path
  local_var_path = '/api/admin/connectors/{id}/fire'.sub('{id}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'fire_connector_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'FireConnectorResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerSdkKey']

  new_options = opts.merge(
    :operation => :"ConnectorsApi.fire_connector",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConnectorsApi#fire_connector\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_connector(id, opts = {}) ⇒ ConnectorRecord

Get a connector 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).

Parameters:

  • id (String)

    Stable opaque connector id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    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).

Returns:



238
239
240
241
# File 'lib/shipeasy_admin/api/connectors_api.rb', line 238

def get_connector(id, opts = {})
  data, _status_code, _headers = get_connector_with_http_info(id, opts)
  data
end

#get_connector_with_http_info(id, opts = {}) ⇒ Array<(ConnectorRecord, Integer, Hash)>

Get a connector 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`).

Parameters:

  • id (String)

    Stable opaque connector id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    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).

Returns:

  • (Array<(ConnectorRecord, Integer, Hash)>)

    ConnectorRecord data, response status code and response headers



249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
# File 'lib/shipeasy_admin/api/connectors_api.rb', line 249

def get_connector_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectorsApi.get_connector ...'
  end
  # resource path
  local_var_path = '/api/admin/connectors/{id}'.sub('{id}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ConnectorRecord'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerSdkKey']

  new_options = opts.merge(
    :operation => :"ConnectorsApi.get_connector",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConnectorsApi#get_connector\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_connectors(opts = {}) ⇒ Array<ConnectorRecord>

List connectors 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.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    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).

Returns:



299
300
301
302
# File 'lib/shipeasy_admin/api/connectors_api.rb', line 299

def list_connectors(opts = {})
  data, _status_code, _headers = list_connectors_with_http_info(opts)
  data
end

#list_connectors_with_http_info(opts = {}) ⇒ Array<(Array<ConnectorRecord>, Integer, Hash)>

List connectors 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.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    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).

Returns:

  • (Array<(Array<ConnectorRecord>, Integer, Hash)>)

    Array data, response status code and response headers



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'lib/shipeasy_admin/api/connectors_api.rb', line 309

def list_connectors_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectorsApi.list_connectors ...'
  end
  # resource path
  local_var_path = '/api/admin/connectors'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<ConnectorRecord>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerSdkKey']

  new_options = opts.merge(
    :operation => :"ConnectorsApi.list_connectors",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConnectorsApi#list_connectors\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#test_connector(id, opts = {}) ⇒ TestConnectorResponse

Test a connector 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.

Parameters:

  • id (String)

    Stable opaque connector id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    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).

Returns:



360
361
362
363
# File 'lib/shipeasy_admin/api/connectors_api.rb', line 360

def test_connector(id, opts = {})
  data, _status_code, _headers = test_connector_with_http_info(id, opts)
  data
end

#test_connector_with_http_info(id, opts = {}) ⇒ Array<(TestConnectorResponse, Integer, Hash)>

Test a connector 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 &quot;Send test&quot; after wiring up a connector to confirm credentials and config are correct before relying on it for real events.

Parameters:

  • id (String)

    Stable opaque connector id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    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).

Returns:

  • (Array<(TestConnectorResponse, Integer, Hash)>)

    TestConnectorResponse data, response status code and response headers



371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
# File 'lib/shipeasy_admin/api/connectors_api.rb', line 371

def test_connector_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectorsApi.test_connector ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ConnectorsApi.test_connector"
  end
  # resource path
  local_var_path = '/api/admin/connectors/{id}/test'.sub('{id}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'TestConnectorResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerSdkKey']

  new_options = opts.merge(
    :operation => :"ConnectorsApi.test_connector",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConnectorsApi#test_connector\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_connector(id, update_connector_request, opts = {}) ⇒ UpdateConnectorResponse

Update a connector 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.

Parameters:

  • id (String)

    Stable opaque connector id.

  • update_connector_request (UpdateConnectorRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    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).

Returns:



427
428
429
430
# File 'lib/shipeasy_admin/api/connectors_api.rb', line 427

def update_connector(id, update_connector_request, opts = {})
  data, _status_code, _headers = update_connector_with_http_info(id, update_connector_request, opts)
  data
end

#update_connector_with_http_info(id, update_connector_request, opts = {}) ⇒ Array<(UpdateConnectorResponse, Integer, Hash)>

Update a connector 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 — `{ &quot;enabled&quot;: 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 — `{ &quot;name&quot;: &quot;Bugs → acme/app issues&quot; }`. - Retarget — send a new `config` (e.g. a different Sheets `sheetTitle`); it replaces the stored config wholesale.

Parameters:

  • id (String)

    Stable opaque connector id.

  • update_connector_request (UpdateConnectorRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_project_id (String)

    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).

Returns:

  • (Array<(UpdateConnectorResponse, Integer, Hash)>)

    UpdateConnectorResponse data, response status code and response headers



439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
# File 'lib/shipeasy_admin/api/connectors_api.rb', line 439

def update_connector_with_http_info(id, update_connector_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConnectorsApi.update_connector ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ConnectorsApi.update_connector"
  end
  # verify the required parameter 'update_connector_request' is set
  if @api_client.config.client_side_validation && update_connector_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_connector_request' when calling ConnectorsApi.update_connector"
  end
  # resource path
  local_var_path = '/api/admin/connectors/{id}'.sub('{id}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Project-Id'] = opts[:'x_project_id'] if !opts[:'x_project_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_connector_request)

  # return_type
  return_type = opts[:debug_return_type] || 'UpdateConnectorResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerSdkKey']

  new_options = opts.merge(
    :operation => :"ConnectorsApi.update_connector",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConnectorsApi#update_connector\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end