Class: Infrawrench::CurrencyRatesNamespace
- Inherits:
-
Object
- Object
- Infrawrench::CurrencyRatesNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.currency.rates
Instance Method Summary collapse
-
#delete(rate_id:, org_id: nil, request_options: nil) ⇒ Hash
Delete one exchange rate.
-
#initialize(transport) ⇒ CurrencyRatesNamespace
constructor
private
A new instance of CurrencyRatesNamespace.
-
#update(body:, org_id: nil, request_options: nil) ⇒ Hash
Create or replace one exchange rate.
Constructor Details
#initialize(transport) ⇒ CurrencyRatesNamespace
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 CurrencyRatesNamespace.
5373 5374 5375 |
# File 'lib/infrawrench/client.rb', line 5373 def initialize(transport) @transport = transport end |
Instance Method Details
#delete(rate_id:, org_id: nil, request_options: nil) ⇒ Hash
Delete one exchange rate
Removing a rate makes the days it covered fall back to the next-older rate, or to unconverted if none remains. Spend never disappears — it reverts to its own currency.
Requires permission: org:settings:write.
DELETE /api/org/orgId/currency/rates/rateId
Raises on 404: Not found
5395 5396 5397 5398 5399 5400 5401 5402 |
# File 'lib/infrawrench/client.rb', line 5395 def delete(rate_id:, org_id: nil, request_options: nil) @transport.request( http_method: "DELETE", path: "/api/org/{orgId}/currency/rates/{rateId}", path_params: { "orgId" => org_id, "rateId" => rate_id }, request_options: ) end |
#update(body:, org_id: nil, request_options: nil) ⇒ Hash
Create or replace one exchange rate
Upserts on (fromCurrency, toCurrency, effectiveFrom) — one rate per
pair per day, so correcting a rate replaces it rather than adding a second
one whose precedence a reader would have to guess. Rates are stated to the
display currency in one hop: nothing inverts a rate or chains two, because
both produce a number you never stated.
Requires permission: org:settings:write.
PUT /api/org/orgId/currency/rates
Raises on 400: Bad request
5424 5425 5426 5427 5428 5429 5430 5431 5432 |
# File 'lib/infrawrench/client.rb', line 5424 def update(body:, org_id: nil, request_options: nil) @transport.request( http_method: "PUT", path: "/api/org/{orgId}/currency/rates", path_params: { "orgId" => org_id }, body: body, request_options: ) end |