Skip to content

Commit

Permalink
fix(api): customer api create and edit (#1882)
Browse files Browse the repository at this point in the history
  • Loading branch information
tothandras authored Nov 18, 2024
1 parent 2f09b08 commit 7b50d05
Show file tree
Hide file tree
Showing 18 changed files with 2,384 additions and 1,877 deletions.
1,544 changes: 804 additions & 740 deletions api/api.gen.go

Large diffs are not rendered by default.

1,580 changes: 818 additions & 762 deletions api/client/go/client.gen.go

Large diffs are not rendered by default.

155 changes: 131 additions & 24 deletions api/client/node/schemas/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2291,7 +2291,7 @@ export interface components {
*/
customer:
| components['schemas']['CustomerId']
| components['schemas']['Customer']
| components['schemas']['CustomerCreate']
/**
* @description Stripe customer ID.
* If not provided OpenMeter creates a new Stripe customer or
Expand Down Expand Up @@ -2473,6 +2473,56 @@ export interface components {
*/
external?: components['schemas']['CustomerExternalMapping']
}
/** @description Resource create operation model. */
CustomerCreate: {
/**
* Display name
* @description Human-readable name for the resource. Between 1 and 256 characters.
*/
name: string
/**
* Description
* @description Optional description of the resource. Maximum 1024 characters.
*/
description?: string
/**
* Metadata
* @description Additional metadata for the resource.
*/
metadata?: components['schemas']['Metadata'] | null
/**
* Timezone
* @description Timezone of the customer.
*/
timezone?: string
/**
* Usage Attribution
* @description Mapping to attribute metered usage to the customer
*/
usageAttribution: components['schemas']['CustomerUsageAttribution']
/**
* Primary Email
* @description The primary email address of the customer.
*/
primaryEmail?: string
/**
* Currency
* @description Currency of the customer.
* Used for billing, tax and invoicing.
*/
currency?: components['schemas']['CurrencyCode']
/**
* Billing Address
* @description The billing address of the customer.
* Used for tax and invoicing.
*/
billingAddress?: components['schemas']['Address']
/**
* External Mappings
* @description External mappings for the customer.
*/
external?: components['schemas']['CustomerExternalMapping']
}
/** @description External mappings for the customer. */
CustomerExternalMapping: {
/**
Expand All @@ -2491,17 +2541,6 @@ export interface components {
*/
id: string
}
/** @description A page of results. */
CustomerList: {
/** @description The page number. */
page: number
/** @description The number of items in the page. */
pageSize: number
/** @description The total number of items. */
totalCount: number
/** @description The items in the page. */
items: components['schemas']['Customer'][]
}
/**
* @description Order by options for customers.
* @enum {string}
Expand All @@ -2527,6 +2566,76 @@ export interface components {
/** @description The items in the current page. */
items: components['schemas']['BillingCustomerOverride'][]
}
/** @description Paginated response */
CustomerPaginatedResponse: {
/**
* @description The items in the current page.
* @example 500
*/
totalCount: number
/**
* @description The items in the current page.
* @example 1
*/
page: number
/**
* @description The items in the current page.
* @example 100
*/
pageSize: number
/** @description The items in the current page. */
items: components['schemas']['Customer'][]
}
/** @description Resource update operation model. */
CustomerReplaceUpdate: {
/**
* Display name
* @description Human-readable name for the resource. Between 1 and 256 characters.
*/
name: string
/**
* Description
* @description Optional description of the resource. Maximum 1024 characters.
*/
description?: string
/**
* Metadata
* @description Additional metadata for the resource.
*/
metadata?: components['schemas']['Metadata'] | null
/**
* Timezone
* @description Timezone of the customer.
*/
timezone?: string
/**
* Usage Attribution
* @description Mapping to attribute metered usage to the customer
*/
usageAttribution: components['schemas']['CustomerUsageAttribution']
/**
* Primary Email
* @description The primary email address of the customer.
*/
primaryEmail?: string
/**
* Currency
* @description Currency of the customer.
* Used for billing, tax and invoicing.
*/
currency?: components['schemas']['CurrencyCode']
/**
* Billing Address
* @description The billing address of the customer.
* Used for tax and invoicing.
*/
billingAddress?: components['schemas']['Address']
/**
* External Mappings
* @description External mappings for the customer.
*/
external?: components['schemas']['CustomerExternalMapping']
}
/**
* @description Mapping to attribute metered usage to the customer.
* One customer can have multiple subjects,
Expand Down Expand Up @@ -7829,21 +7938,21 @@ export interface operations {
listCustomers: {
parameters: {
query?: {
page?: components['parameters']['PaginatedQuery.page']
pageSize?: components['parameters']['PaginatedQuery.pageSize']
order?: components['parameters']['CustomerOrderByOrdering.order']
orderBy?: components['parameters']['CustomerOrderByOrdering.orderBy']
includeDeleted?: components['parameters']['queryCustomerList.includeDeleted']
name?: components['parameters']['queryCustomerList.name']
primaryEmail?: components['parameters']['queryCustomerList.primaryEmail']
subject?: components['parameters']['queryCustomerList.subject']
page?: components['parameters']['PaginatedQuery.page']
pageSize?: components['parameters']['PaginatedQuery.pageSize']
}
}
responses: {
/** @description The request has succeeded. */
200: {
content: {
'application/json': components['schemas']['CustomerList']
'application/json': components['schemas']['CustomerPaginatedResponse']
}
}
/** @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). */
Expand Down Expand Up @@ -7891,12 +8000,12 @@ export interface operations {
createCustomer: {
requestBody: {
content: {
'application/json': components['schemas']['Customer']
'application/json': components['schemas']['CustomerCreate']
}
}
responses: {
/** @description The request has succeeded. */
200: {
/** @description The request has succeeded and a new resource has been created as a result. */
201: {
content: {
'application/json': components['schemas']['Customer']
}
Expand Down Expand Up @@ -8012,7 +8121,7 @@ export interface operations {
}
requestBody: {
content: {
'application/json': components['schemas']['Customer']
'application/json': components['schemas']['CustomerReplaceUpdate']
}
}
responses: {
Expand Down Expand Up @@ -8077,11 +8186,9 @@ export interface operations {
}
}
responses: {
/** @description The request has succeeded. */
200: {
content: {
'application/json': components['schemas']['Customer']
}
/** @description There is no content to send for this request, but the headers may be useful. */
204: {
content: never
}
/** @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: {
Expand Down
Loading

0 comments on commit 7b50d05

Please sign in to comment.