Class: Infrawrench::AccountsPreflightNamespace

Inherits:
Object
  • Object
show all
Defined in:
lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs

Overview

client.accounts.preflight

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ AccountsPreflightNamespace

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of AccountsPreflightNamespace.

Parameters:



150
151
152
# File 'lib/infrawrench/client.rb', line 150

def initialize(transport)
  @transport = transport
end

Instance Method Details

#create(body:, org_id: nil, request_options: nil) ⇒ Hash

Probe credentials before creating an account

Runs the plugin's per-capability permission checks against the submitted credentials. Nothing is stored — use it from the add-account flow before committing.

Requires permission: accounts:write.

POST /api/org/orgId/accounts/preflight

Raises on 400: Bad request

Raises on 404: Not found

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • body (Hash)

    Request body, shaped as PreflightRequest.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • body: (preflight_request)
  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as PreflightReport — see sig/infrawrench/sdk.rbs.

Raises:



174
175
176
177
178
179
180
181
182
# File 'lib/infrawrench/client.rb', line 174

def create(body:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/accounts/preflight",
    path_params: { "orgId" => org_id },
    body: body,
    request_options: request_options
  )
end

#post_org_org_id_accounts_id_preflight(id:, org_id: nil, request_options: nil) ⇒ Hash

Re-run credential preflight on a stored account

Requires permission: accounts:write.

POST /api/org/orgId/accounts/id/preflight

Raises on 400: Bad request

Raises on 404: Not found

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • id (String)
  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • id: (String)
  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as PreflightReport — see sig/infrawrench/sdk.rbs.

Raises:



200
201
202
203
204
205
206
207
# File 'lib/infrawrench/client.rb', line 200

def post_org_org_id_accounts_id_preflight(id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/accounts/{id}/preflight",
    path_params: { "orgId" => org_id, "id" => id },
    request_options: request_options
  )
end