export type DeleteApiV1OrganizationsOrgIdContractTemplatesIdArgs = {orgId: string, id: string}; export type DeleteApiV1OrganizationsOrgIdContractTemplatesIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove contract template * * DELETE /v1/organizations/{orgId}/contract-templates/{id} * * Also accepts auth: apiKeyAuth */ export const deleteApiV1OrganizationsOrgIdContractTemplatesId = async (args: DeleteApiV1OrganizationsOrgIdContractTemplatesIdArgs, options?: DeleteApiV1OrganizationsOrgIdContractTemplatesIdOptions) => { const {baseUrl = "https://api.timesheet.io", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/organizations/${encodeURIComponent(String(args.orgId))}/contract-templates/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };