export type DeleteApiIamV2IdentityProvidersProviderIdIdentityPoolsIdArgs = {provider_id: string, id: string}; export type DeleteApiIamV2IdentityProvidersProviderIdIdentityPoolsIdOptions = {baseUrl?: string | undefined, cloudApiKey?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete an Identity Pool * * DELETE /iam/v2/identity-providers/{provider_id}/identity-pools/{id} * * Also accepts auth: confluent-sts-access-token */ export const deleteApiIamV2IdentityProvidersProviderIdIdentityPoolsId = async (args: DeleteApiIamV2IdentityProvidersProviderIdIdentityPoolsIdArgs, options?: DeleteApiIamV2IdentityProvidersProviderIdIdentityPoolsIdOptions) => { const {baseUrl = "https://api.confluent.cloud", fetch: fetchFn = fetch, cloudApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (cloudApiKey !== undefined) headers.set('authorization', `Basic ${btoa(`${cloudApiKey.username}:${cloudApiKey.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/iam/v2/identity-providers/${encodeURIComponent(String(args.provider_id))}/identity-pools/${encodeURIComponent(String(args.id))}${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 };