export type DeleteApiApiPublicV1ServiceMaintenanceIdArgs = {id: string, organizationId?: string | undefined}; export type DeleteApiApiPublicV1ServiceMaintenanceIdOptions = {baseUrl: string, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a service maintenance window * * DELETE /api/public/v1/service-maintenance/{id} */ export const deleteApiApiPublicV1ServiceMaintenanceId = async (args: DeleteApiApiPublicV1ServiceMaintenanceIdArgs, options: DeleteApiApiPublicV1ServiceMaintenanceIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.organizationId != null) query.append("organizationId", String(args.organizationId)) if (ApiKey !== undefined) headers.set("Authorization", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/public/v1/service-maintenance/${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 };