export type ObjectID = string; export type CreateApiV1ProjectsProjectIdActionsRestartArgs = {teamID?: ObjectID | undefined, project_id: string}; export type CreateApiV1ProjectsProjectIdActionsRestartOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Restart an app * * POST /v1/projects/{project_id}/actions/restart */ export const createApiV1ProjectsProjectIdActionsRestart = async (args: CreateApiV1ProjectsProjectIdActionsRestartArgs, options?: CreateApiV1ProjectsProjectIdActionsRestartOptions) => { const {baseUrl = "https://api.liara.ir", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.teamID != null) query.append("teamID", String(args.teamID)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/projects/${encodeURIComponent(String(args.project_id))}/actions/restart${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };