export type TaskLogCleanupConfig = {'cleanup-period'?: (string | null) | undefined, 'retention-period'?: (string | null) | undefined}; export type SetTaskLogCleanupConfig = {'max-seconds-since-last-heartbeat'?: (number | null) | undefined, 'queue-config': TaskLogCleanupConfig}; export type CreateApiManagementV1ProjectTaskQueueTaskLogCleanupConfigArgs = {'x-project-id'?: (string | null) | undefined, body: SetTaskLogCleanupConfig}; export type CreateApiManagementV1ProjectTaskQueueTaskLogCleanupConfigOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Set the configuration for a Project-level Task Queue. * * POST /management/v1/project/task-queue/task_log_cleanup/config */ export const createApiManagementV1ProjectTaskQueueTaskLogCleanupConfig = async (args: CreateApiManagementV1ProjectTaskQueueTaskLogCleanupConfigArgs, options?: CreateApiManagementV1ProjectTaskQueueTaskLogCleanupConfigOptions) => { const {baseUrl = "https://localhost", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['x-project-id'] != null) headers.set("x-project-id", String(args['x-project-id'])) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/management/v1/project/task-queue/task_log_cleanup/config${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };