Class: Infrawrench::BudgetsNamespace
- Inherits:
-
Object
- Object
- Infrawrench::BudgetsNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.budgets
Instance Method Summary collapse
-
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Create a budget.
-
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Delete a budget.
-
#events(id:, org_id: nil, request_options: nil) ⇒ Array<Hash>
Alert event history for a budget.
-
#get(id:, org_id: nil, request_options: nil) ⇒ Hash
Get a budget with current-month status.
-
#initialize(transport) ⇒ BudgetsNamespace
constructor
private
A new instance of BudgetsNamespace.
-
#list(org_id: nil, request_options: nil) ⇒ Array<Hash>
List budgets with current-month actuals and forecasts.
-
#update(id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Update a budget.
Constructor Details
#initialize(transport) ⇒ BudgetsNamespace
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 BudgetsNamespace.
2095 2096 2097 |
# File 'lib/infrawrench/client.rb', line 2095 def initialize(transport) @transport = transport end |
Instance Method Details
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Create a budget
POST /api/org/orgId/budgets
Raises on 400: Bad request
2111 2112 2113 2114 2115 2116 2117 2118 2119 |
# File 'lib/infrawrench/client.rb', line 2111 def create(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/budgets", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Delete a budget
DELETE /api/org/orgId/budgets/id
Raises on 404: Not found
2133 2134 2135 2136 2137 2138 2139 2140 |
# File 'lib/infrawrench/client.rb', line 2133 def delete(id:, org_id: nil, request_options: nil) @transport.request( http_method: "DELETE", path: "/api/org/{orgId}/budgets/{id}", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#events(id:, org_id: nil, request_options: nil) ⇒ Array<Hash>
Alert event history for a budget
GET /api/org/orgId/budgets/id/events
Raises on 404: Not found
2155 2156 2157 2158 2159 2160 2161 2162 |
# File 'lib/infrawrench/client.rb', line 2155 def events(id:, org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/budgets/{id}/events", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#get(id:, org_id: nil, request_options: nil) ⇒ Hash
Get a budget with current-month status
GET /api/org/orgId/budgets/id
Raises on 404: Not found
2176 2177 2178 2179 2180 2181 2182 2183 |
# File 'lib/infrawrench/client.rb', line 2176 def get(id:, org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/budgets/{id}", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#list(org_id: nil, request_options: nil) ⇒ Array<Hash>
List budgets with current-month actuals and forecasts
GET /api/org/orgId/budgets
2195 2196 2197 2198 2199 2200 2201 2202 |
# File 'lib/infrawrench/client.rb', line 2195 def list(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/budgets", path_params: { "orgId" => org_id }, request_options: ) end |
#update(id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Update a budget
PUT /api/org/orgId/budgets/id
Raises on 400: Bad request
Raises on 404: Not found
2219 2220 2221 2222 2223 2224 2225 2226 2227 |
# File 'lib/infrawrench/client.rb', line 2219 def update(id:, body:, org_id: nil, request_options: nil) @transport.request( http_method: "PUT", path: "/api/org/{orgId}/budgets/{id}", path_params: { "orgId" => org_id, "id" => id }, body: body, request_options: ) end |