Class: Infrawrench::CostReportFoldersNamespace

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

Overview

client.cost_report_folders

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ CostReportFoldersNamespace

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

Parameters:



4023
4024
4025
# File 'lib/infrawrench/client.rb', line 4023

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

Create a cost-report folder

Requires permission: costs:write.

POST /api/org/orgId/cost-report-folders

Raises on 400: Bad request

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

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

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

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

Returns:

  • (Hash)

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

Raises:



4041
4042
4043
4044
4045
4046
4047
4048
4049
# File 'lib/infrawrench/client.rb', line 4041

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

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

Delete a cost-report folder

Never blocked by contents and never destructive to them: the folder's reports and immediate subfolders fall back to the top level. Deleting a folder cannot delete a report.

Requires permission: costs:write.

DELETE /api/org/orgId/cost-report-folders/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)
  • 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:



4069
4070
4071
4072
4073
4074
4075
4076
# File 'lib/infrawrench/client.rb', line 4069

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

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

List cost-report folders

The org's report folders as a flat list — build the tree from parentFolderId. Folders organize the Reports list and nothing else; a report's id, URL and dashboard cards are unchanged by where it is filed.

Requires permission: costs:read.

GET /api/org/orgId/cost-report-folders

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

Raises:



4094
4095
4096
4097
4098
4099
4100
4101
# File 'lib/infrawrench/client.rb', line 4094

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

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

Update a cost-report folder

Rename and/or reparent. Filing a report is not here — that is PUT /cost-reports/{id} with a different folderId. Reparenting past the 3-level depth limit, or under the folder's own subtree, is a 400.

Requires permission: costs:write.

PUT /api/org/orgId/cost-report-folders/id

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)
  • body (Hash)

    Request body, shaped as CostReportFolderInput.

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

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

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

Returns:

  • (Hash)

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

Raises:



4124
4125
4126
4127
4128
4129
4130
4131
4132
# File 'lib/infrawrench/client.rb', line 4124

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