Skip to content

Commit

Permalink
feat: currencies endpoint v2
Browse files Browse the repository at this point in the history
  • Loading branch information
turip committed Jan 21, 2025
1 parent 0512c10 commit 7426264
Show file tree
Hide file tree
Showing 16 changed files with 1,465 additions and 995 deletions.
322 changes: 161 additions & 161 deletions api/api.gen.go

Large diffs are not rendered by default.

1,696 changes: 932 additions & 764 deletions api/client/go/client.gen.go

Large diffs are not rendered by default.

108 changes: 108 additions & 0 deletions api/client/node/schemas/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,26 @@ export interface paths {
patch?: never
trace?: never
}
'/api/v1/info': {
parameters: {
query?: never
header?: never
path?: never
cookie?: never
}
/**
* List supported currencies
* @description List all supported currencies.
*/
get: operations['listCurrencies']
put?: never
post?: never
delete?: never
options?: never
head?: never
patch?: never
trace?: never
}
'/api/v1/marketplace/listings': {
parameters: {
query?: never
Expand Down Expand Up @@ -2343,6 +2363,20 @@ export interface components {
*/
readonly url: string
} & WithRequired<components['schemas']['InvoiceGenericDocumentRef'], 'type'>
/** @description Currency describes a currency supported by OpenMeter. */
Currency: {
/** @description The currency ISO code. */
code: components['schemas']['CurrencyCode']
/** @description The currency name. */
name: string
/** @description The currency symbol. */
symbol: string
/**
* Format: uint32
* @description Subunit of the currency.
*/
subunits: number
}
/**
* @description Three-letter [ISO4217](https://www.iso.org/iso-4217-currency-codes.html) currency code.
* Custom three-letter currency codes are also supported for convenience.
Expand Down Expand Up @@ -11749,6 +11783,80 @@ export interface operations {
}
}
}
listCurrencies: {
parameters: {
query?: never
header?: never
path?: never
cookie?: never
}
requestBody?: never
responses: {
/** @description The request has succeeded. */
200: {
headers: {
[name: string]: unknown
}
content: {
'application/json': components['schemas']['Currency'][]
}
}
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
400: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['BadRequestProblemResponse']
}
}
/** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */
401: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['UnauthorizedProblemResponse']
}
}
/** @description The server understood the request but refuses to authorize it. */
403: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['ForbiddenProblemResponse']
}
}
/** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */
500: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['InternalServerErrorProblemResponse']
}
}
/** @description The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. */
503: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse']
}
}
/** @description An unexpected error response. */
default: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['UnexpectedProblemResponse']
}
}
}
}
listMarketplaceListings: {
parameters: {
query?: {
Expand Down
108 changes: 108 additions & 0 deletions api/client/web/src/client/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,26 @@ export interface paths {
patch?: never
trace?: never
}
'/api/v1/info': {
parameters: {
query?: never
header?: never
path?: never
cookie?: never
}
/**
* List supported currencies
* @description List all supported currencies.
*/
get: operations['listCurrencies']
put?: never
post?: never
delete?: never
options?: never
head?: never
patch?: never
trace?: never
}
'/api/v1/marketplace/listings': {
parameters: {
query?: never
Expand Down Expand Up @@ -2343,6 +2363,20 @@ export interface components {
*/
readonly url: string
} & WithRequired<components['schemas']['InvoiceGenericDocumentRef'], 'type'>
/** @description Currency describes a currency supported by OpenMeter. */
Currency: {
/** @description The currency ISO code. */
code: components['schemas']['CurrencyCode']
/** @description The currency name. */
name: string
/** @description The currency symbol. */
symbol: string
/**
* Format: uint32
* @description Subunit of the currency.
*/
subunits: number
}
/**
* @description Three-letter [ISO4217](https://www.iso.org/iso-4217-currency-codes.html) currency code.
* Custom three-letter currency codes are also supported for convenience.
Expand Down Expand Up @@ -11758,6 +11792,80 @@ export interface operations {
}
}
}
listCurrencies: {
parameters: {
query?: never
header?: never
path?: never
cookie?: never
}
requestBody?: never
responses: {
/** @description The request has succeeded. */
200: {
headers: {
[name: string]: unknown
}
content: {
'application/json': components['schemas']['Currency'][]
}
}
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
400: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['BadRequestProblemResponse']
}
}
/** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */
401: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['UnauthorizedProblemResponse']
}
}
/** @description The server understood the request but refuses to authorize it. */
403: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['ForbiddenProblemResponse']
}
}
/** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */
500: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['InternalServerErrorProblemResponse']
}
}
/** @description The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. */
503: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse']
}
}
/** @description An unexpected error response. */
default: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['UnexpectedProblemResponse']
}
}
}
}
listMarketplaceListings: {
parameters: {
query?: {
Expand Down
78 changes: 78 additions & 0 deletions api/openapi.cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ tags:
description: Manage your billing profiles and invoices. Currently in private preview - [contact us](mailto:[email protected]) for access.
- name: Apps (Private Preview)
description: Manage integrations for extending OpenMeter's functionality. Currently in private preview - [contact us](mailto:[email protected]) for access.
- name: Lookup Information
description: Lookup information for static data like currencies
paths:
/api/v1/apps:
get:
Expand Down Expand Up @@ -3403,6 +3405,59 @@ paths:
$ref: '#/components/schemas/UnexpectedProblemResponse'
tags:
- Entitlements (Beta)
/api/v1/info:
get:
operationId: listCurrencies
summary: List supported currencies
description: List all supported currencies.
parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Currency'
'400':
description: The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
content:
application/problem+json:
schema:
$ref: '#/components/schemas/BadRequestProblemResponse'
'401':
description: The request has not been applied because it lacks valid authentication credentials for the target resource.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/UnauthorizedProblemResponse'
'403':
description: The server understood the request but refuses to authorize it.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ForbiddenProblemResponse'
'500':
description: The server encountered an unexpected condition that prevented it from fulfilling the request.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/InternalServerErrorProblemResponse'
'503':
description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ServiceUnavailableProblemResponse'
default:
description: An unexpected error response.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/UnexpectedProblemResponse'
tags:
- Lookup Information
/api/v1/marketplace/listings:
get:
operationId: listMarketplaceListings
Expand Down Expand Up @@ -9006,6 +9061,29 @@ components:
allOf:
- $ref: '#/components/schemas/InvoiceGenericDocumentRef'
description: CreditNoteOriginalInvoiceRef is used to reference the original invoice that a credit note is based on.
Currency:
type: object
required:
- code
- name
- symbol
- subunits
properties:
code:
allOf:
- $ref: '#/components/schemas/CurrencyCode'
description: The currency ISO code.
name:
type: string
description: The currency name.
symbol:
type: string
description: The currency symbol.
subunits:
type: integer
format: uint32
description: Subunit of the currency.
description: Currency describes a currency supported by OpenMeter.
CurrencyCode:
type: string
minLength: 3
Expand Down
Loading

0 comments on commit 7426264

Please sign in to comment.