Class: Cadenya::Resources::BulkWorkspaceResources

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/resources/bulk_workspace_resources.rb,
lib/cadenya/resources/bulk_workspace_resources/results.rb

Overview

Apply a declarative bundle of workspace resources — tool sets, memory layers, agents, variations, assignments, and schedules — in a single asynchronous operation.

Defined Under Namespace

Classes: Results

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ BulkWorkspaceResources

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

Parameters:



107
108
109
110
# File 'lib/cadenya/resources/bulk_workspace_resources.rb', line 107

def initialize(client:)
  @client = client
  @results = Cadenya::Resources::BulkWorkspaceResources::Results.new(client: client)
end

Instance Attribute Details

#resultsCadenya::Resources::BulkWorkspaceResources::Results (readonly)

Apply a declarative bundle of workspace resources — tool sets, memory layers, agents, variations, assignments, and schedules — in a single asynchronous operation.



13
14
15
# File 'lib/cadenya/resources/bulk_workspace_resources.rb', line 13

def results
  @results
end

Instance Method Details

#apply(workspace_id, data:, request_options: {}) ⇒ Cadenya::Models::BulkWorkspaceApply

Asynchronously applies a declarative bundle of workspace resources. Returns the operation immediately in PENDING; clients poll Get to track progress.

Parameters:

Returns:

See Also:



93
94
95
96
97
98
99
100
101
102
# File 'lib/cadenya/resources/bulk_workspace_resources.rb', line 93

def apply(workspace_id, params)
  parsed, options = Cadenya::BulkWorkspaceResourceApplyParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/workspaces/%1$s/bulk_workspace_applies", workspace_id],
    body: parsed,
    model: Cadenya::BulkWorkspaceApply,
    options: options
  )
end

#list(workspace_id, bundle_key: nil, cursor: nil, limit: nil, sort_order: nil, state: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::BulkWorkspaceApply>

Lists past and in-flight bulk workspace apply operations in the workspace.

Parameters:

  • workspace_id (String)

    Workspace ID.

  • bundle_key (String)

    Filter by bundle_key — list every apply for a given bundle.

  • cursor (String)

    Pagination cursor from previous response

  • limit (Integer)

    Maximum number of results to return

  • sort_order (String)

    Sort order for results (asc or desc by creation time)

  • state (Symbol, Cadenya::Models::BulkWorkspaceResourceListParams::State)

    Filter by lifecycle state.

  • request_options (Cadenya::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/cadenya/resources/bulk_workspace_resources.rb', line 66

def list(workspace_id, params = {})
  parsed, options = Cadenya::BulkWorkspaceResourceListParams.dump_request(params)
  query = Cadenya::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["v1/workspaces/%1$s/bulk_workspace_applies", workspace_id],
    query: query.transform_keys(bundle_key: "bundleKey", sort_order: "sortOrder"),
    page: Cadenya::Internal::CursorPagination,
    model: Cadenya::BulkWorkspaceApply,
    options: options
  )
end

#retrieve(id, workspace_id:, request_options: {}) ⇒ Cadenya::Models::BulkWorkspaceApply

Some parameter documentations has been truncated, see Models::BulkWorkspaceResourceRetrieveParams for more details.

Retrieves a bulk workspace apply operation by ID.

Parameters:

  • id (String)

    Apply ID in canonical apply_… form. Bulk applies do not support

  • workspace_id (String)

    Workspace ID.

  • request_options (Cadenya::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/cadenya/resources/bulk_workspace_resources.rb', line 31

def retrieve(id, params)
  parsed, options = Cadenya::BulkWorkspaceResourceRetrieveParams.dump_request(params)
  workspace_id =
    parsed.delete(:workspace_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["v1/workspaces/%1$s/bulk_workspace_applies/%2$s", workspace_id, id],
    model: Cadenya::BulkWorkspaceApply,
    options: options
  )
end