Class: Infrawrench::CostScenariosGetNamespace

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

Overview

client.cost_scenarios.get

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ CostScenariosGetNamespace

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

Parameters:



4527
4528
4529
# File 'lib/infrawrench/client.rb', line 4527

def initialize(transport)
  @transport = transport
end

Instance Method Details

#get(org_id: nil, request_options: nil) ⇒ Hash

List scenario models

Named, reusable sets of adjustments an organization overlays on a cost forecast — the known future cost a trend fit cannot see. Pass an id as POST /costs/query's scenarioModelId (alongside forecast: true) to get the adjusted projection back beside the unadjusted one, never instead of it.

Requires permission: costs:read.

GET /api/org/orgId/cost-scenarios

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:

  • (Hash)

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

Raises:



4548
4549
4550
4551
4552
4553
4554
4555
# File 'lib/infrawrench/client.rb', line 4548

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

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

Get a scenario model

Requires permission: costs:read.

GET /api/org/orgId/cost-scenarios/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 CostScenarioModel — see sig/infrawrench/sdk.rbs.

Raises:



4571
4572
4573
4574
4575
4576
4577
4578
# File 'lib/infrawrench/client.rb', line 4571

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