export type UpdateApiControlClientsEnableClientNameArgs = {client_name: string}; export type UpdateApiControlClientsEnableClientNameOptions = {baseUrl: string, OAuth2PasswordBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Enable Client * * PUT /control/clients/enable/{client_name} */ export const updateApiControlClientsEnableClientName = async (args: UpdateApiControlClientsEnableClientNameArgs, options: UpdateApiControlClientsEnableClientNameOptions) => { const {baseUrl, fetch: fetchFn = fetch, OAuth2PasswordBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth2PasswordBearer !== undefined) headers.set('authorization', `Bearer ${OAuth2PasswordBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/control/clients/enable/${encodeURIComponent(String(args.client_name))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };