export type DeleteApiApiTestDistributionAgentPoolsPoolIdRegistrationKeysKeyPrefixOptions = {baseUrl?: string | undefined, DevelocityAccessKeyOrToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Revoke a Test Distribution pool-specific agent registration key. * * DELETE /api/test-distribution/agent-pools/{poolId}/registration-keys/{keyPrefix} */ export const deleteApiApiTestDistributionAgentPoolsPoolIdRegistrationKeysKeyPrefix = async (options?: DeleteApiApiTestDistributionAgentPoolsPoolIdRegistrationKeysKeyPrefixOptions) => { const {baseUrl = "https://develocity.example.com", fetch: fetchFn = fetch, DevelocityAccessKeyOrToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (DevelocityAccessKeyOrToken !== undefined) headers.set('authorization', `Bearer ${DevelocityAccessKeyOrToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/test-distribution/agent-pools/${encodeURIComponent(String(args.poolId))}/registration-keys/${encodeURIComponent(String(args.keyPrefix))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };