export type JsonPatchPathsComponentsPathComponent = {Name?: string | undefined, ComponentType?: string | undefined, IsCollection?: boolean | undefined, IsDictionary?: boolean | undefined}; export type JsonPatchJsonPatchOperation = {Operation?: ('add' | 'remove' | 'replace' | 'move' | 'test') | undefined, FromPath?: string | undefined, ParsedFromPath?: Array | undefined, Path?: string | undefined, ParsedPath?: Array | undefined, Value?: Record | undefined}; export type JsonPatchJsonPatchDocumentOfRevAppUpdateModelsCustomerBillMessage = {Operations?: Array | undefined, HasOperations?: boolean | undefined}; export type PatchApiV1CustomersIdBillMessagesArgs = {id: number, body: JsonPatchJsonPatchDocumentOfRevAppUpdateModelsCustomerBillMessage}; export type PatchApiV1CustomersIdBillMessagesOptions = {baseUrl?: string | undefined, basic?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Do a partial update of an existing customer's bill messages * * PATCH /v1/Customers/{id}/BillMessages */ export const patchApiV1CustomersIdBillMessages = async (args: PatchApiV1CustomersIdBillMessagesArgs, options?: PatchApiV1CustomersIdBillMessagesOptions) => { const {baseUrl = "https://restapi.rev.io", fetch: fetchFn = fetch, basic} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (basic !== undefined) headers.set('authorization', `Basic ${btoa(`${basic.username}:${basic.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/Customers/${encodeURIComponent(String(args.id))}/BillMessages${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 };