Leon4gr45's picture
Upload folder using huggingface_hub (part 2)
1477a90 verified
Raw
History Blame Contribute Delete
2.12 kB
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.
import { type Client, http } from '../core.js'
import { type Result, type RequestOptions } from '../lib/types.js'
import { request } from '../lib/request.js'
import { toWire, fromWire, assertValid } from '../lib/wire.js'
import * as schemas from '../models/schemas.js'
import type {
GetOrganizationDefaultTaxCodesRequest,
GetOrganizationDefaultTaxCodesResponse,
UpdateOrganizationDefaultTaxCodesRequest,
UpdateOrganizationDefaultTaxCodesResponse,
} from '../models/operations/defaults.js'
/**
* Get organization default tax codes
*
* GET /openmeter/defaults/tax-codes
*/
export function getOrganizationDefaultTaxCodes(
client: Client,
req: GetOrganizationDefaultTaxCodesRequest,
options?: RequestOptions,
): Promise<Result<GetOrganizationDefaultTaxCodesResponse>> {
return request(() =>
http(client)
.get('openmeter/defaults/tax-codes', options)
.json()
.then((data) => {
if (client._options.validate) {
assertValid(schemas.getOrganizationDefaultTaxCodesResponseWire, data)
}
return fromWire(data, schemas.getOrganizationDefaultTaxCodesResponse)
}),
)
}
/**
* Update organization default tax codes
*
* PUT /openmeter/defaults/tax-codes
*/
export function updateOrganizationDefaultTaxCodes(
client: Client,
req: UpdateOrganizationDefaultTaxCodesRequest,
options?: RequestOptions,
): Promise<Result<UpdateOrganizationDefaultTaxCodesResponse>> {
return request(() => {
const body = toWire(req, schemas.updateOrganizationDefaultTaxCodesBody)
if (client._options.validate) {
assertValid(schemas.updateOrganizationDefaultTaxCodesBodyWire, body)
}
return http(client)
.put('openmeter/defaults/tax-codes', { ...options, json: body })
.json()
.then((data) => {
if (client._options.validate) {
assertValid(
schemas.updateOrganizationDefaultTaxCodesResponseWire,
data,
)
}
return fromWire(data, schemas.updateOrganizationDefaultTaxCodesResponse)
})
})
}