export type Template = {type?: string | undefined, id?: string | undefined, attributes?: ({createdBy?: string | undefined, createdDate?: string | undefined, description?: string | undefined, name?: string | undefined, tcl?: string | undefined, updatedBy?: string | undefined, updatedDate?: string | undefined, version?: string | undefined}) | undefined, relationships?: ({organization?: ({id?: string | undefined, type?: 'organization' | undefined}) | undefined}) | undefined}; export type PatchApiOrganizationOrganizationIdTemplateTemplateIdArgs = {body: {data?: Template | undefined}}; export type PatchApiOrganizationOrganizationIdTemplateTemplateIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Modifies an instance of type template * * PATCH /organization/{organizationId}/template/{templateId} */ export const patchApiOrganizationOrganizationIdTemplateTemplateId = async (args: PatchApiOrganizationOrganizationIdTemplateTemplateIdArgs, options: PatchApiOrganizationOrganizationIdTemplateTemplateIdOptions) => { 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(/\/+$/, '')}/organization/${encodeURIComponent(String(args.organizationId))}/template/${encodeURIComponent(String(args.templateId))}${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 };