export type UpdateClientDTO = {name: string, licenseKey?: string | undefined, licensePublicKey?: string | undefined, status?: ('active' | 'send_suspended' | 'suspended') | undefined, licenseAuthToken?: string | undefined}; export type PatchApiV1ClientsClientIdArgs = {clientId: number, body: UpdateClientDTO}; export type PatchApiV1ClientsClientIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * PATCH /v1/clients/{clientId} */ export const patchApiV1ClientsClientId = async (args: PatchApiV1ClientsClientIdArgs, options: PatchApiV1ClientsClientIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v1/clients/${encodeURIComponent(String(args.clientId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };