import { GetItemCommandInput, BatchGetItemCommandInput, GetItemCommandOutput, BatchGetItemCommandOutput } from '@aws-sdk/client-dynamodb'; declare class Getter { private _ddb; private _paramsItem; private _paramsBatch; private _tableName; constructor(config: { region: string; }, table: string, key: { [key: string]: unknown; } | { [key: string]: unknown; }[]); /** * Sets the TableName value of the command input for GetItem. Currently, this is only supported for single get item commands. * This method is not required if the Getter is initialized with a table name. * * @param name - name of the table containing the requested item * @returns Getter with populated params */ table(name: string): Getter; /** * Sets the Key value of the command input for GetItem. This is only for single get item commands. * This method is not required if the Getter is initialized with a key. * * @param key - object of the key of the item to get * @returns Getter with populated params */ key(key: { [key: string]: unknown; }): Getter; /** * Sets the Keys value of the command input for BatchGetItem. This is only for batch get item commands. This method is not required if the Getter is initialized with keys. * * @param keys - the list of objects of the keys of the items to get * @returns Getter with populated params */ keys(keys: { [key: string]: unknown; }[]): Getter; /** * Sets ConsistentRead to be true for BatchGetItem or GetItem input. If set to true, then the operation uses strongly consistent reads; otherwise, the operation uses eventually consistent reads. * * @returns Getter with populated params */ strong(): Getter; /** * Sets the ExpressionAttributeNames of the command input for BatchGetItem or GetItem. * The following are some use cases for using ExpressionAttributeNames: * To access an attribute whose name conflicts with a DynamoDB reserved word: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html * To create a placeholder for repeating occurrences of an attribute name in an expression. * To prevent special characters in an attribute name from being misinterpreted in an expression. * Use the # character in an expression to dereference an attribute name. * * @param obj - object of one or more substitution tokens for attribute names in an expression * @returns Getter with populated params * * @example Using the reserved word 'Percentile' in your request * ```ts * # Usage * Getter.names({"#P":"Percentile"}).condition("#P = 50"); * ``` */ names(obj?: { [key: string]: string; }): Getter; /** * Sets ProjectionExpression of the command input for BatchGetItem or GetItem. * A string or list of strings that identifies one or more attributes to retrieve from the table. * If no attribute names are specified, then all attributes are returned. * If any of the requested attributes are not found, they do not appear in the result. * * @param expr - string or list of strings of the attributes to retrieve * @returns Getter with populated params */ projection(expr: string | string[]): Getter; /** * Helper method to assign projection expression values to single get item command input. * * @param expr - string or list of strings of the attributes to retrieve * @returns Getter with populated params */ private _assignProjectionExressionToSingle; /** * Helper method to assign projection expression values to batch get item command input. * * @param expr - string or list of strings of the attributes to retrieve * @returns Getter with populated params */ private _assignProjectionExressionToBatch; /** * Sets the ReturnConsumedCapacity of the command input for BatchGetItem or GetItem. * Determines the level of detail about either provisioned or on-demand throughput consumption that is returned in the response: * INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed. * TOTAL - The response includes only the aggregate ConsumedCapacity for the operation. * NONE - No ConsumedCapacity details are included in the response. * * @param str - indexes, total, or none (non case sensitive strings) * @returns Getter with populated params */ capacity(str: 'INDEXES' | 'TOTAL' | 'NONE'): Getter; /** * Gets the internal _paramsItems value of the command input. For single get only, obviously. * * @returns The parameters for the GetItemCommandInput * * @example Returning command input * ```ts * # Result * { * Key: {}, * TableName: string, * ConsistentRead?: boolean, * ExpressionAttributeNames?: {}, * ProjectionExpression?: string, * ReturnConsumedCapacity?: 'INDEXES' | 'TOTAL' | 'NONE' * } * ``` */ getItemParams(): GetItemCommandInput | undefined; /** * Gets the internal _paramsBatch value of the command input. For batch get only, obviously. * * @returns The parameters for the BatchGetItemCommandInput * * @example Returning command input * ```ts * # Result * { * RequestItems: { * : { * Keys: [], * ConsistentRead?: boolean, * ExpressionAttributeNames?: {}, * ProjectionExpression?: string * },... * }, * ReturnConsumedCapacity?: 'INDEXES' | 'TOTAL' | 'NONE' * } * ``` */ getBatchParams(): BatchGetItemCommandInput | undefined; /** * Sends the internal parameters as input to the DynamoDB table to execute the GetItem or BatchGetItem request. * Call this after populating the command input params with the above methods. * Each object in Responses consists of a table name, along with a map of attribute data consisting of the data type and attribute value * If UnproccessedKeys is non empty, some request failed. * Item/Responses are returned unmarshalled. * * @returns The output from the get item command or the batch get item command * * @example GetItemCommandOutput * ```ts * # Result * { * ConsumedCapacity?: [], * Item?: {} * } * ``` * * @example BatchGetItemCommandOutput * ```ts * # Result * { * ConsumedCapacity?: [], * Responses?: {}, * UnprocessedKeys: {} * } * ``` * */ execute(): Promise; } export default Getter; //# sourceMappingURL=getter.d.ts.map