export type CreateApiV1beta1ProjectsProjectPromotionsPromotionAbortArgs = {project: string, promotion: string}; export type CreateApiV1beta1ProjectsProjectPromotionsPromotionAbortOptions = {baseUrl: string, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Abort a Promotion * * POST /v1beta1/projects/{project}/promotions/{promotion}/abort */ export const createApiV1beta1ProjectsProjectPromotionsPromotionAbort = async (args: CreateApiV1beta1ProjectsProjectPromotionsPromotionAbortArgs, options: CreateApiV1beta1ProjectsProjectPromotionsPromotionAbortOptions) => { 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))}/abort${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 };