export type Implementation = {type?: string | undefined, id?: string | undefined, attributes?: ({arch?: string | undefined, asciiArmor?: string | undefined, downloadUrl?: string | undefined, filename?: string | undefined, keyId?: string | undefined, os?: string | undefined, shasum?: string | undefined, shasumsSignatureUrl?: string | undefined, shasumsUrl?: string | undefined, source?: string | undefined, sourceUrl?: string | undefined, trustSignature?: string | undefined}) | undefined, relationships?: ({version?: ({id?: string | undefined, type?: 'version' | undefined}) | undefined}) | undefined}; export type PatchApiImplementationImplementationIdArgs = {body: {data?: Implementation | undefined}}; export type PatchApiImplementationImplementationIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Modifies an instance of type implementation * * PATCH /implementation/{implementationId} */ export const patchApiImplementationImplementationId = async (args: PatchApiImplementationImplementationIdArgs, options: PatchApiImplementationImplementationIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/vnd.api+json") const url = `${baseUrl.replace(/\/+$/, '')}/implementation/${encodeURIComponent(String(args.implementationId))}${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 };