export type CreateApiV1beta1ProjectsProjectPromotionsPromotionRefreshArgs = {project: string, promotion: string}; export type CreateApiV1beta1ProjectsProjectPromotionsPromotionRefreshOptions = {baseUrl: string, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Refresh a Promotion * * POST /v1beta1/projects/{project}/promotions/{promotion}/refresh */ export const createApiV1beta1ProjectsProjectPromotionsPromotionRefresh = async (args: CreateApiV1beta1ProjectsProjectPromotionsPromotionRefreshArgs, options: CreateApiV1beta1ProjectsProjectPromotionsPromotionRefreshOptions) => { 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))}/promotions/${encodeURIComponent(String(args.promotion))}/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 };