Class: Infrawrench::CurrencyNamespace
- Inherits:
-
Object
- Object
- Infrawrench::CurrencyNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.currency
Instance Attribute Summary collapse
-
#rates ⇒ CurrencyRatesNamespace
readonly
client.currency.rates.
Instance Method Summary collapse
-
#get(org_id: nil, request_options: nil) ⇒ Hash
The org's display currency and exchange rate table.
-
#initialize(transport) ⇒ CurrencyNamespace
constructor
private
A new instance of CurrencyNamespace.
-
#update(body:, org_id: nil, request_options: nil) ⇒ Hash
Set or clear the org's display currency.
Constructor Details
#initialize(transport) ⇒ CurrencyNamespace
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 CurrencyNamespace.
5442 5443 5444 5445 |
# File 'lib/infrawrench/client.rb', line 5442 def initialize(transport) @transport = transport @rates = CurrencyRatesNamespace.new(@transport) end |
Instance Attribute Details
#rates ⇒ CurrencyRatesNamespace (readonly)
Returns client.currency.rates.
5438 5439 5440 |
# File 'lib/infrawrench/client.rb', line 5438 def rates @rates end |
Instance Method Details
#get(org_id: nil, request_options: nil) ⇒ Hash
The org's display currency and exchange rate table
Readable with costs:read rather than a settings permission: anyone who
can see a converted total has to be able to see what it was converted at,
or the number is unauditable.
Requires permission: costs:read.
GET /api/org/orgId/currency
5462 5463 5464 5465 5466 5467 5468 5469 |
# File 'lib/infrawrench/client.rb', line 5462 def get(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/currency", path_params: { "orgId" => org_id }, request_options: ) end |
#update(body:, org_id: nil, request_options: nil) ⇒ Hash
Set or clear the org's display currency
Setting a currency opts the organization into converted totals; null
turns conversion off everywhere and restores the per-currency view.
Clearing does not delete the rate table, so conversion can be turned back
on without re-stating anything. Only currencies with a configured rate are
converted — Infrawrench never fetches live exchange rates.
Requires permission: org:settings:write.
PUT /api/org/orgId/currency
Raises on 400: Bad request
5491 5492 5493 5494 5495 5496 5497 5498 5499 |
# File 'lib/infrawrench/client.rb', line 5491 def update(body:, org_id: nil, request_options: nil) @transport.request( http_method: "PUT", path: "/api/org/{orgId}/currency", path_params: { "orgId" => org_id }, body: body, request_options: ) end |