Class: Infrawrench::WorkflowSecretsNamespace

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

Overview

client.workflow_secrets

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ WorkflowSecretsNamespace

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

Parameters:



15059
15060
15061
# File 'lib/infrawrench/client.rb', line 15059

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

Create workflow secret metadata

Creates metadata without a value. Write the value separately through the write-only value endpoint.

Requires permission: secrets:write.

POST /api/org/orgId/workflow-secrets

Raises on 400: Bad request

Raises on 409: Conflict

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

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

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

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

Returns:

  • (Hash)

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

Raises:



15082
15083
15084
15085
15086
15087
15088
15089
15090
# File 'lib/infrawrench/client.rb', line 15082

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

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

Delete a workflow secret

Also removes every workflow assignment through database cascades.

Requires permission: secrets:write.

DELETE /api/org/orgId/workflow-secrets/id

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)

    Workflow secret id

  • 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 Ok — see sig/infrawrench/sdk.rbs.

Raises:



15108
15109
15110
15111
15112
15113
15114
15115
# File 'lib/infrawrench/client.rb', line 15108

def delete(id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "DELETE",
    path: "/api/org/{orgId}/workflow-secrets/{id}",
    path_params: { "orgId" => org_id, "id" => id },
    request_options: request_options
  )
end

#list(org_id: nil, request_options: nil) ⇒ Array<Hash>

List reusable workflow secrets

Returns metadata and hasValue only; plaintext values are never returned.

Requires permission: secrets:read.

GET /api/org/orgId/workflow-secrets

Parameters:

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

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

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

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

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

Returns:

  • (Array<Hash>)

    Parsed JSON, shaped as Array<WorkflowSecret> — see sig/infrawrench/sdk.rbs.

Raises:



15131
15132
15133
15134
15135
15136
15137
15138
# File 'lib/infrawrench/client.rb', line 15131

def list(org_id: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/workflow-secrets",
    path_params: { "orgId" => org_id },
    request_options: request_options
  )
end

#update(id:, body:, org_id: nil, request_options: nil) ⇒ Hash

Update workflow secret metadata

Requires permission: secrets:write.

PATCH /api/org/orgId/workflow-secrets/id

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: Conflict

Parameters:

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

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

  • id (String)

    Workflow secret id

  • body (Hash)

    Request body, shaped as WorkflowSecretUpdate.

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

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

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

Returns:

  • (Hash)

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

Raises:



15159
15160
15161
15162
15163
15164
15165
15166
15167
# File 'lib/infrawrench/client.rb', line 15159

def update(id:, body:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "PATCH",
    path: "/api/org/{orgId}/workflow-secrets/{id}",
    path_params: { "orgId" => org_id, "id" => id },
    body: body,
    request_options: request_options
  )
end

#value(id:, body:, org_id: nil, request_options: nil) ⇒ Hash

Write a workflow secret value

Write-only. The response contains metadata and hasValue, never the supplied plaintext.

Requires permission: secrets:write.

PUT /api/org/orgId/workflow-secrets/id/value

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)

    Workflow secret id

  • body (Hash)

    Request body, shaped as WorkflowSecretValueWrite.

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

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

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

Returns:

  • (Hash)

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

Raises:



15189
15190
15191
15192
15193
15194
15195
15196
15197
# File 'lib/infrawrench/client.rb', line 15189

def value(id:, body:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "PUT",
    path: "/api/org/{orgId}/workflow-secrets/{id}/value",
    path_params: { "orgId" => org_id, "id" => id },
    body: body,
    request_options: request_options
  )
end