export type CreateApiV1beta1ProjectsProjectConfigRefreshArgs = {project: string}; export type CreateApiV1beta1ProjectsProjectConfigRefreshOptions = {baseUrl: string, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Refresh ProjectConfig * * POST /v1beta1/projects/{project}/config/refresh */ export const createApiV1beta1ProjectsProjectConfigRefresh = async (args: CreateApiV1beta1ProjectsProjectConfigRefreshArgs, options: CreateApiV1beta1ProjectsProjectConfigRefreshOptions) => { const {baseUrl, fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (BearerAuth !== undefined) headers.set("Authorization", BearerAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1beta1/projects/${encodeURIComponent(String(args.project))}/config/refresh${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 };