@cloud-copilot/iam-collect
Version:
Collect IAM information from AWS Accounts
49 lines • 2.12 kB
TypeScript
import type { Client } from '@smithy/smithy-client';
import { type AwsService } from '../services.js';
import { type AwsCredentialProviderWithMetaData } from './coreAuth.js';
export type ClientConstructor<T> = new (args: any) => T;
export type AnyClient = Client<any, any, any, any>;
export declare class AwsClientPool {
static defaultInstance: AwsClientPool;
private clientCache;
private defaultRetryStrategy;
constructor();
/**
* Returns a client of the specified type with the specified credentials and region.
* Will create a new client if one does not already exist in the cache.
*
* @param ClientType The client constructor to create an instance of.
* @param credentials The credentials to use for the client.
* @param region The region to use for the client.
* @returns A client of the specified type with the specified credentials and region.
*/
client<T extends AnyClient>(ClientType: ClientConstructor<T>, credentials: AwsCredentialProviderWithMetaData, region: string | undefined, endpoint: string | undefined): T;
private getCacheKey;
/**
* Destroys all clients in the pool and empties the cache.
*
* NOT THREAD SAFE, this should only be called when all other operations are complete.
*/
clear(): void;
/**
* Do any async initialization required for the client pool. Should be called
* before the first use of the pool.
*/
init(): Promise<void>;
/**
* Whether this client pool requires valid AWS credentials for each instance.
*/
requiresAwsCredentials(): boolean;
/**
* Determine if a given sync is supported by this client pool for the given service and region.
*
* @param service the AWS service
* @param syncName the name of the sync operation
* @param region the AWS region
* @returns true if the sync is supported, false otherwise
*/
isSyncSupported(service: AwsService, syncName: string, region: string): boolean;
private retryStrategyForClient;
private makeRetryStrategy;
}
//# sourceMappingURL=ClientPool.d.ts.map