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.
6021 6022 6023 |
# File 'lib/infrawrench/client.rb', line 6021 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
6043 6044 6045 6046 6047 6048 6049 6050 |
# File 'lib/infrawrench/client.rb', line 6043 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
6072 6073 6074 6075 6076 6077 6078 6079 6080 |
# File 'lib/infrawrench/client.rb', line 6072 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 |