export type CreateApiApiAdminStrategiesStrategyNameDeprecateArgs = {strategyName: string}; export type CreateApiApiAdminStrategiesStrategyNameDeprecateOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deprecate a strategy * * POST /api/admin/strategies/{strategyName}/deprecate * * Also accepts auth: bearerToken */ export const createApiApiAdminStrategiesStrategyNameDeprecate = async (args: CreateApiApiAdminStrategiesStrategyNameDeprecateArgs, options?: CreateApiApiAdminStrategiesStrategyNameDeprecateOptions) => { const {baseUrl = "https://app.unleash-instance.example.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/admin/strategies/${encodeURIComponent(String(args.strategyName))}/deprecate${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 };