export type CreateApiV1ApiKeysApiKeyIdDisableArgs = {api_key_id: string}; export type CreateApiV1ApiKeysApiKeyIdDisableOptions = {baseUrl: string, OAuth2AuthorizationCodeBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Disable Organization Api Key * * POST /v1/api-keys/{api_key_id}/disable/ */ export const createApiV1ApiKeysApiKeyIdDisable = async (args: CreateApiV1ApiKeysApiKeyIdDisableArgs, options: CreateApiV1ApiKeysApiKeyIdDisableOptions) => { const {baseUrl, fetch: fetchFn = fetch, OAuth2AuthorizationCodeBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth2AuthorizationCodeBearer !== undefined) headers.set('authorization', `Bearer ${OAuth2AuthorizationCodeBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/api-keys/${encodeURIComponent(String(args.api_key_id))}/disable/${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 };