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:



14804
14805
14806
# File 'lib/infrawrench/client.rb', line 14804

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:



14827
14828
14829
14830
14831
14832
14833
14834
14835
# File 'lib/infrawrench/client.rb', line 14827

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:



14853
14854
14855
14856
14857
14858
14859
14860
# File 'lib/infrawrench/client.rb', line 14853

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:



14876
14877
14878
14879
14880
14881
14882
14883
# File 'lib/infrawrench/client.rb', line 14876

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:



14904
14905
14906
14907
14908
14909
14910
14911
14912
# File 'lib/infrawrench/client.rb', line 14904

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:



14934
14935
14936
14937
14938
14939
14940
14941
14942
# File 'lib/infrawrench/client.rb', line 14934

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