UNPKG

universal-s3

Version:

Universal S3 SDK for JavaScript, available for Node.js backends

655 lines (640 loc) 182 kB
import DynamoDB = require('../../clients/dynamodb'); import * as stream from 'stream'; import {Request} from '../request'; import {AWSError} from '../error'; interface File {} interface Blob {} /** * The document client simplifies working with items in Amazon DynamoDB * by abstracting away the notion of attribute values. This abstraction * annotates native JavaScript types supplied as input parameters, as well * as converts annotated response data to native JavaScript types. */ export class DocumentClient { /** * Creates a DynamoDB document client with a set of configuration options. */ constructor(options?: DocumentClient.DocumentClientOptions & DynamoDB.Types.ClientConfiguration) /** * Creates a set of elements inferring the type of set from the type of the first element. Amazon DynamoDB currently supports the number sets, string sets, and binary sets. For more information about DynamoDB data types see the documentation on the Amazon DynamoDB Data Model. */ createSet(list: number[]|string[]|DocumentClient.binaryType[], options?: DocumentClient.CreateSetOptions): DocumentClient.DynamoDbSet; /** * Returns the attributes of one or more items from one or more tables by delegating to AWS.DynamoDB.batchGetItem(). */ batchGet(params: DocumentClient.BatchGetItemInput, callback?: (err: AWSError, data: DocumentClient.BatchGetItemOutput) => void): Request<DocumentClient.BatchGetItemOutput, AWSError>; /** * Puts or deletes multiple items in one or more tables by delegating to AWS.DynamoDB.batchWriteItem(). */ batchWrite(params: DocumentClient.BatchWriteItemInput, callback?: (err: AWSError, data: DocumentClient.BatchWriteItemOutput) => void): Request<DocumentClient.BatchWriteItemOutput, AWSError>; /** * Deletes a single item in a table by primary key by delegating to AWS.DynamoDB.deleteItem(). */ delete(params: DocumentClient.DeleteItemInput, callback?: (err: AWSError, data: DocumentClient.DeleteItemOutput) => void): Request<DocumentClient.DeleteItemOutput, AWSError>; /** * Returns a set of attributes for the item with the given primary key by delegating to AWS.DynamoDB.getItem(). */ get(params: DocumentClient.GetItemInput, callback?: (err: AWSError, data: DocumentClient.GetItemOutput) => void): Request<DocumentClient.GetItemOutput, AWSError>; /** * Creates a new item, or replaces an old item with a new item by delegating to AWS.DynamoDB.putItem(). */ put(params: DocumentClient.PutItemInput, callback?: (err: AWSError, data: DocumentClient.PutItemOutput) => void): Request<DocumentClient.PutItemOutput, AWSError>; /** * Directly access items from a table by primary key or a secondary index. */ query(params: DocumentClient.QueryInput, callback?: (err: AWSError, data: DocumentClient.QueryOutput) => void): Request<DocumentClient.QueryOutput, AWSError>; /** * Returns one or more items and item attributes by accessing every item in a table or a secondary index. */ scan(params: DocumentClient.ScanInput, callback?: (err: AWSError, data: DocumentClient.ScanOutput) => void): Request<DocumentClient.ScanOutput, AWSError>; /** * Edits an existing item's attributes, or adds a new item to the table if it does not already exist by delegating to AWS.DynamoDB.updateItem(). */ update(params: DocumentClient.UpdateItemInput, callback?: (err: AWSError, data: DocumentClient.UpdateItemOutput) => void): Request<DocumentClient.UpdateItemOutput, AWSError>; /** * Atomically retrieves multiple items from one or more tables (but not from indexes) in a single account and region. */ transactGet(params: DocumentClient.TransactGetItemsInput, callback?: (err: AWSError, data: DocumentClient.TransactGetItemsOutput) => void): Request<DocumentClient.TransactGetItemsOutput, AWSError>; /** * Synchronous write operation that groups up to 10 action requests */ transactWrite(params: DocumentClient.TransactWriteItemsInput, callback?: (err: AWSError, data: DocumentClient.TransactWriteItemsOutput) => void): Request<DocumentClient.TransactWriteItemsOutput, AWSError>; } export namespace DocumentClient { interface ConverterOptions { /** * An optional flag indicating that the document client should cast * empty strings, buffers, and sets to NULL shapes */ convertEmptyValues?: boolean; /** * Whether to return numbers as a NumberValue object instead of * converting them to native JavaScript numbers. This allows for the * safe round-trip transport of numbers of arbitrary size. */ wrapNumbers?: boolean; } export interface DocumentClientOptions extends ConverterOptions { /** * An optional map of parameters to bind to every request sent by this service object. */ params?: {[key: string]: any} /** * An optional pre-configured instance of the AWS.DynamoDB service object to use for requests. The object may bound parameters used by the document client. */ service?: DynamoDB } export interface CreateSetOptions { /** * Set to true if you want to validate the type of each element in the set. Defaults to false. */ validate?: boolean } export type binaryType = Buffer|File|Blob|ArrayBuffer|DataView|Int8Array|Uint8Array|Uint8ClampedArray|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array|stream.Stream; interface StringSet { type: 'String'; values: Array<string>; } interface NumberSet { type: 'Number'; values: Array<number>; } interface BinarySet { type: 'Binary'; values: Array<binaryType>; } export type DynamoDbSet = StringSet|NumberSet|BinarySet; } export namespace DocumentClient { //<!--auto-generated start--> interface Blob {} export type AttributeAction = "ADD"|"PUT"|"DELETE"|string; export interface AttributeDefinition { /** * A name for the attribute. */ AttributeName: KeySchemaAttributeName; /** * The data type for the attribute, where: S - the attribute is of type String N - the attribute is of type Number B - the attribute is of type Binary */ AttributeType: ScalarAttributeType; } export type AttributeDefinitions = AttributeDefinition[]; export type AttributeMap = {[key: string]: AttributeValue}; export type AttributeName = string; export type AttributeNameList = AttributeName[]; export type AttributeUpdates = {[key: string]: AttributeValueUpdate}; /** * A JavaScript object or native type. */ export type AttributeValue = any; export type AttributeValueList = AttributeValue[]; export interface AttributeValueUpdate { /** * Represents the data for an attribute. Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself. For more information, see Data Types in the Amazon DynamoDB Developer Guide. */ Value?: AttributeValue; /** * Specifies how to perform the update. Valid values are PUT (default), DELETE, and ADD. The behavior depends on whether the specified primary key already exists in the table. If an item with the specified Key is found in the table: PUT - Adds the specified attribute to the item. If the attribute already exists, it is replaced by the new value. DELETE - If no value is specified, the attribute and its value are removed from the item. The data type of the specified value must match the existing value's data type. If a set of values is specified, then those values are subtracted from the old set. For example, if the attribute value was the set [a,b,c] and the DELETE action specified [a,c], then the final attribute value would be [b]. Specifying an empty set is an error. ADD - If the attribute does not already exist, then the attribute and its values are added to the item. If the attribute does exist, then the behavior of ADD depends on the data type of the attribute: If the existing attribute is a number, and if Value is also a number, then the Value is mathematically added to the existing attribute. If Value is a negative number, then it is subtracted from the existing attribute. If you use ADD to increment or decrement a number value for an item that doesn't exist before the update, DynamoDB uses 0 as the initial value. In addition, if you use ADD to update an existing item, and intend to increment or decrement an attribute value which does not yet exist, DynamoDB uses 0 as the initial value. For example, suppose that the item you want to update does not yet have an attribute named itemcount, but you decide to ADD the number 3 to this attribute anyway, even though it currently does not exist. DynamoDB will create the itemcount attribute, set its initial value to 0, and finally add 3 to it. The result will be a new itemcount attribute in the item, with a value of 3. If the existing data type is a set, and if the Value is also a set, then the Value is added to the existing set. (This is a set operation, not mathematical addition.) For example, if the attribute value was the set [1,2], and the ADD action specified [3], then the final attribute value would be [1,2,3]. An error occurs if an Add action is specified for a set attribute and the attribute type specified does not match the existing set type. Both sets must have the same primitive data type. For example, if the existing data type is a set of strings, the Value must also be a set of strings. The same holds true for number sets and binary sets. This action is only valid for an existing attribute whose data type is number or is a set. Do not use ADD for any other data types. If no item with the specified Key is found: PUT - DynamoDB creates a new item with the specified primary key, and then adds the attribute. DELETE - Nothing happens; there is no attribute to delete. ADD - DynamoDB creates an item with the supplied primary key and number (or set of numbers) for the attribute value. The only data types allowed are number and number set; no other data types can be specified. */ Action?: AttributeAction; } export interface AutoScalingPolicyDescription { /** * The name of the scaling policy. */ PolicyName?: AutoScalingPolicyName; /** * Represents a target tracking scaling policy configuration. */ TargetTrackingScalingPolicyConfiguration?: AutoScalingTargetTrackingScalingPolicyConfigurationDescription; } export type AutoScalingPolicyDescriptionList = AutoScalingPolicyDescription[]; export type AutoScalingPolicyName = string; export interface AutoScalingPolicyUpdate { /** * The name of the scaling policy. */ PolicyName?: AutoScalingPolicyName; /** * Represents a target tracking scaling policy configuration. */ TargetTrackingScalingPolicyConfiguration: AutoScalingTargetTrackingScalingPolicyConfigurationUpdate; } export type AutoScalingRoleArn = string; export interface AutoScalingSettingsDescription { /** * The minimum capacity units that a global table or global secondary index should be scaled down to. */ MinimumUnits?: PositiveLongObject; /** * The maximum capacity units that a global table or global secondary index should be scaled up to. */ MaximumUnits?: PositiveLongObject; /** * Disabled autoscaling for this global table or global secondary index. */ AutoScalingDisabled?: BooleanObject; /** * Role ARN used for configuring autoScaling policy. */ AutoScalingRoleArn?: String; /** * Information about the scaling policies. */ ScalingPolicies?: AutoScalingPolicyDescriptionList; } export interface AutoScalingSettingsUpdate { /** * The minimum capacity units that a global table or global secondary index should be scaled down to. */ MinimumUnits?: PositiveLongObject; /** * The maximum capacity units that a global table or global secondary index should be scaled up to. */ MaximumUnits?: PositiveLongObject; /** * Disabled autoscaling for this global table or global secondary index. */ AutoScalingDisabled?: BooleanObject; /** * Role ARN used for configuring autoscaling policy. */ AutoScalingRoleArn?: AutoScalingRoleArn; /** * The scaling policy to apply for scaling target global table or global secondary index capacity units. */ ScalingPolicyUpdate?: AutoScalingPolicyUpdate; } export interface AutoScalingTargetTrackingScalingPolicyConfigurationDescription { /** * Indicates whether scale in by the target tracking policy is disabled. If the value is true, scale in is disabled and the target tracking policy won't remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource. The default value is false. */ DisableScaleIn?: BooleanObject; /** * The amount of time, in seconds, after a scale in activity completes before another scale in activity can start. The cooldown period is used to block subsequent scale in requests until it has expired. You should scale in conservatively to protect your application's availability. However, if another alarm triggers a scale out policy during the cooldown period after a scale-in, application autoscaling scales out your scalable target immediately. */ ScaleInCooldown?: IntegerObject; /** * The amount of time, in seconds, after a scale out activity completes before another scale out activity can start. While the cooldown period is in effect, the capacity that has been added by the previous scale out event that initiated the cooldown is calculated as part of the desired capacity for the next scale out. You should continuously (but not excessively) scale out. */ ScaleOutCooldown?: IntegerObject; /** * The target value for the metric. The range is 8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2). */ TargetValue: Double; } export interface AutoScalingTargetTrackingScalingPolicyConfigurationUpdate { /** * Indicates whether scale in by the target tracking policy is disabled. If the value is true, scale in is disabled and the target tracking policy won't remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource. The default value is false. */ DisableScaleIn?: BooleanObject; /** * The amount of time, in seconds, after a scale in activity completes before another scale in activity can start. The cooldown period is used to block subsequent scale in requests until it has expired. You should scale in conservatively to protect your application's availability. However, if another alarm triggers a scale out policy during the cooldown period after a scale-in, application autoscaling scales out your scalable target immediately. */ ScaleInCooldown?: IntegerObject; /** * The amount of time, in seconds, after a scale out activity completes before another scale out activity can start. While the cooldown period is in effect, the capacity that has been added by the previous scale out event that initiated the cooldown is calculated as part of the desired capacity for the next scale out. You should continuously (but not excessively) scale out. */ ScaleOutCooldown?: IntegerObject; /** * The target value for the metric. The range is 8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2). */ TargetValue: Double; } export type Backfilling = boolean; export type BackupArn = string; export type BackupCreationDateTime = Date; export interface BackupDescription { /** * Contains the details of the backup created for the table. */ BackupDetails?: BackupDetails; /** * Contains the details of the table when the backup was created. */ SourceTableDetails?: SourceTableDetails; /** * Contains the details of the features enabled on the table when the backup was created. For example, LSIs, GSIs, streams, TTL. */ SourceTableFeatureDetails?: SourceTableFeatureDetails; } export interface BackupDetails { /** * ARN associated with the backup. */ BackupArn: BackupArn; /** * Name of the requested backup. */ BackupName: BackupName; /** * Size of the backup in bytes. */ BackupSizeBytes?: BackupSizeBytes; /** * Backup can be in one of the following states: CREATING, ACTIVE, DELETED. */ BackupStatus: BackupStatus; /** * BackupType: USER - You create and manage these using the on-demand backup feature. SYSTEM - If you delete a table with point-in-time recovery enabled, a SYSTEM backup is automatically created and is retained for 35 days (at no additional cost). System backups allow you to restore the deleted table to the state it was in just before the point of deletion. AWS_BACKUP - On-demand backup created by you from AWS Backup service. */ BackupType: BackupType; /** * Time at which the backup was created. This is the request time of the backup. */ BackupCreationDateTime: BackupCreationDateTime; /** * Time at which the automatic on-demand backup created by DynamoDB will expire. This SYSTEM on-demand backup expires automatically 35 days after its creation. */ BackupExpiryDateTime?: _Date; } export type BackupName = string; export type BackupSizeBytes = number; export type BackupStatus = "CREATING"|"DELETED"|"AVAILABLE"|string; export type BackupSummaries = BackupSummary[]; export interface BackupSummary { /** * Name of the table. */ TableName?: TableName; /** * Unique identifier for the table. */ TableId?: TableId; /** * ARN associated with the table. */ TableArn?: TableArn; /** * ARN associated with the backup. */ BackupArn?: BackupArn; /** * Name of the specified backup. */ BackupName?: BackupName; /** * Time at which the backup was created. */ BackupCreationDateTime?: BackupCreationDateTime; /** * Time at which the automatic on-demand backup created by DynamoDB will expire. This SYSTEM on-demand backup expires automatically 35 days after its creation. */ BackupExpiryDateTime?: _Date; /** * Backup can be in one of the following states: CREATING, ACTIVE, DELETED. */ BackupStatus?: BackupStatus; /** * BackupType: USER - You create and manage these using the on-demand backup feature. SYSTEM - If you delete a table with point-in-time recovery enabled, a SYSTEM backup is automatically created and is retained for 35 days (at no additional cost). System backups allow you to restore the deleted table to the state it was in just before the point of deletion. AWS_BACKUP - On-demand backup created by you from AWS Backup service. */ BackupType?: BackupType; /** * Size of the backup in bytes. */ BackupSizeBytes?: BackupSizeBytes; } export type BackupType = "USER"|"SYSTEM"|"AWS_BACKUP"|string; export type BackupTypeFilter = "USER"|"SYSTEM"|"AWS_BACKUP"|"ALL"|string; export type BackupsInputLimit = number; export interface BatchGetItemInput { /** * A map of one or more table names and, for each table, a map that describes one or more items to retrieve from that table. Each table name can be used only once per BatchGetItem request. Each element in the map of items to retrieve consists of the following: ConsistentRead - If true, a strongly consistent read is used; if false (the default), an eventually consistent read is used. ExpressionAttributeNames - One or more substitution tokens for attribute names in the ProjectionExpression parameter. The following are some use cases for using ExpressionAttributeNames: To access an attribute whose name conflicts with a DynamoDB reserved word. 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. For example, consider the following attribute name: Percentile The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for ExpressionAttributeNames: {"#P":"Percentile"} You could then use this substitution in an expression, as in this example: #P = :val Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime. For more information about expression attribute names, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide. Keys - An array of primary key attribute values that define specific items in the table. For each primary key, you must provide all of the key attributes. For example, with a simple primary key, you only need to provide the partition key value. For a composite key, you must provide both the partition key value and the sort key value. ProjectionExpression - A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas. 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. For more information, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide. AttributesToGet - This is a legacy parameter. Use ProjectionExpression instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide. */ RequestItems: BatchGetRequestMap; ReturnConsumedCapacity?: ReturnConsumedCapacity; } export interface BatchGetItemOutput { /** * A map of table name to a list of items. Each object in Responses consists of a table name, along with a map of attribute data consisting of the data type and attribute value. */ Responses?: BatchGetResponseMap; /** * A map of tables and their respective keys that were not processed with the current response. The UnprocessedKeys value is in the same form as RequestItems, so the value can be provided directly to a subsequent BatchGetItem operation. For more information, see RequestItems in the Request Parameters section. Each element consists of: Keys - An array of primary key attribute values that define specific items in the table. ProjectionExpression - One or more attributes to be retrieved from the table or index. By default, all attributes are returned. If a requested attribute is not found, it does not appear in the result. ConsistentRead - The consistency of a read operation. If set to true, then a strongly consistent read is used; otherwise, an eventually consistent read is used. If there are no unprocessed keys remaining, the response contains an empty UnprocessedKeys map. */ UnprocessedKeys?: BatchGetRequestMap; /** * The read capacity units consumed by the entire BatchGetItem operation. Each element consists of: TableName - The table that consumed the provisioned throughput. CapacityUnits - The total number of capacity units consumed. */ ConsumedCapacity?: ConsumedCapacityMultiple; } export type BatchGetRequestMap = {[key: string]: KeysAndAttributes}; export type BatchGetResponseMap = {[key: string]: ItemList}; export interface BatchWriteItemInput { /** * A map of one or more table names and, for each table, a list of operations to be performed (DeleteRequest or PutRequest). Each element in the map consists of the following: DeleteRequest - Perform a DeleteItem operation on the specified item. The item to be deleted is identified by a Key subelement: Key - A map of primary key attribute values that uniquely identify the item. Each entry in this map consists of an attribute name and an attribute value. For each primary key, you must provide all of the key attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key. PutRequest - Perform a PutItem operation on the specified item. The item to be put is identified by an Item subelement: Item - A map of attributes and their values. Each entry in this map consists of an attribute name and an attribute value. Attribute values must not be null; string and binary type attributes must have lengths greater than zero; and set type attributes must not be empty. Requests that contain empty values are rejected with a ValidationException exception. If you specify any attributes that are part of an index key, then the data types for those attributes must match those of the schema in the table's attribute definition. */ RequestItems: BatchWriteItemRequestMap; ReturnConsumedCapacity?: ReturnConsumedCapacity; /** * Determines whether item collection metrics are returned. If set to SIZE, the response includes statistics about item collections, if any, that were modified during the operation are returned in the response. If set to NONE (the default), no statistics are returned. */ ReturnItemCollectionMetrics?: ReturnItemCollectionMetrics; } export interface BatchWriteItemOutput { /** * A map of tables and requests against those tables that were not processed. The UnprocessedItems value is in the same form as RequestItems, so you can provide this value directly to a subsequent BatchGetItem operation. For more information, see RequestItems in the Request Parameters section. Each UnprocessedItems entry consists of a table name and, for that table, a list of operations to perform (DeleteRequest or PutRequest). DeleteRequest - Perform a DeleteItem operation on the specified item. The item to be deleted is identified by a Key subelement: Key - A map of primary key attribute values that uniquely identify the item. Each entry in this map consists of an attribute name and an attribute value. PutRequest - Perform a PutItem operation on the specified item. The item to be put is identified by an Item subelement: Item - A map of attributes and their values. Each entry in this map consists of an attribute name and an attribute value. Attribute values must not be null; string and binary type attributes must have lengths greater than zero; and set type attributes must not be empty. Requests that contain empty values will be rejected with a ValidationException exception. If you specify any attributes that are part of an index key, then the data types for those attributes must match those of the schema in the table's attribute definition. If there are no unprocessed items remaining, the response contains an empty UnprocessedItems map. */ UnprocessedItems?: BatchWriteItemRequestMap; /** * A list of tables that were processed by BatchWriteItem and, for each table, information about any item collections that were affected by individual DeleteItem or PutItem operations. Each entry consists of the following subelements: ItemCollectionKey - The partition key value of the item collection. This is the same as the partition key value of the item. SizeEstimateRangeGB - An estimate of item collection size, expressed in GB. This is a two-element array containing a lower bound and an upper bound for the estimate. The estimate includes the size of all the items in the table, plus the size of all attributes projected into all of the local secondary indexes on the table. Use this estimate to measure whether a local secondary index is approaching its size limit. The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate. */ ItemCollectionMetrics?: ItemCollectionMetricsPerTable; /** * The capacity units consumed by the entire BatchWriteItem operation. Each element consists of: TableName - The table that consumed the provisioned throughput. CapacityUnits - The total number of capacity units consumed. */ ConsumedCapacity?: ConsumedCapacityMultiple; } export type BatchWriteItemRequestMap = {[key: string]: WriteRequests}; export type BillingMode = "PROVISIONED"|"PAY_PER_REQUEST"|string; export interface BillingModeSummary { /** * Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later. PROVISIONED - Sets the read/write capacity mode to PROVISIONED. We recommend using PROVISIONED for predictable workloads. PAY_PER_REQUEST - Sets the read/write capacity mode to PAY_PER_REQUEST. We recommend using PAY_PER_REQUEST for unpredictable workloads. */ BillingMode?: BillingMode; /** * Represents the time when PAY_PER_REQUEST was last set as the read/write capacity mode. */ LastUpdateToPayPerRequestDateTime?: _Date; } export type BinaryAttributeValue = Buffer|Uint8Array|Blob|string; export type BinarySetAttributeValue = BinaryAttributeValue[]; export type BooleanAttributeValue = boolean; export type BooleanObject = boolean; export interface Capacity { /** * The total number of read capacity units consumed on a table or an index. */ ReadCapacityUnits?: ConsumedCapacityUnits; /** * The total number of write capacity units consumed on a table or an index. */ WriteCapacityUnits?: ConsumedCapacityUnits; /** * The total number of capacity units consumed on a table or an index. */ CapacityUnits?: ConsumedCapacityUnits; } export type ClientRequestToken = string; export type ComparisonOperator = "EQ"|"NE"|"IN"|"LE"|"LT"|"GE"|"GT"|"BETWEEN"|"NOT_NULL"|"NULL"|"CONTAINS"|"NOT_CONTAINS"|"BEGINS_WITH"|string; export interface Condition { /** * One or more values to evaluate against the supplied attribute. The number of values in the list depends on the ComparisonOperator being used. For type Number, value comparisons are numeric. String value comparisons for greater than, equals, or less than are based on ASCII character code values. For example, a is greater than A, and a is greater than B. For a list of code values, see http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters. For Binary, DynamoDB treats each byte of the binary data as unsigned when it compares binary values. */ AttributeValueList?: AttributeValueList; /** * A comparator for evaluating attributes. For example, equals, greater than, less than, etc. The following comparison operators are available: EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN The following are descriptions of each comparison operator. EQ : Equal. EQ is supported for all data types, including lists and maps. AttributeValueList can contain only one AttributeValue element of type String, Number, Binary, String Set, Number Set, or Binary Set. If an item contains an AttributeValue element of a different type than the one provided in the request, the value does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}. NE : Not equal. NE is supported for all data types, including lists and maps. AttributeValueList can contain only one AttributeValue of type String, Number, Binary, String Set, Number Set, or Binary Set. If an item contains an AttributeValue of a different type than the one provided in the request, the value does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}. LE : Less than or equal. AttributeValueList can contain only one AttributeValue element of type String, Number, or Binary (not a set type). If an item contains an AttributeValue element of a different type than the one provided in the request, the value does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not compare to {"NS":["6", "2", "1"]}. LT : Less than. AttributeValueList can contain only one AttributeValue of type String, Number, or Binary (not a set type). If an item contains an AttributeValue element of a different type than the one provided in the request, the value does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not compare to {"NS":["6", "2", "1"]}. GE : Greater than or equal. AttributeValueList can contain only one AttributeValue element of type String, Number, or Binary (not a set type). If an item contains an AttributeValue element of a different type than the one provided in the request, the value does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not compare to {"NS":["6", "2", "1"]}. GT : Greater than. AttributeValueList can contain only one AttributeValue element of type String, Number, or Binary (not a set type). If an item contains an AttributeValue element of a different type than the one provided in the request, the value does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not compare to {"NS":["6", "2", "1"]}. NOT_NULL : The attribute exists. NOT_NULL is supported for all data types, including lists and maps. This operator tests for the existence of an attribute, not its data type. If the data type of attribute "a" is null, and you evaluate it using NOT_NULL, the result is a Boolean true. This result is because the attribute "a" exists; its data type is not relevant to the NOT_NULL comparison operator. NULL : The attribute does not exist. NULL is supported for all data types, including lists and maps. This operator tests for the nonexistence of an attribute, not its data type. If the data type of attribute "a" is null, and you evaluate it using NULL, the result is a Boolean false. This is because the attribute "a" exists; its data type is not relevant to the NULL comparison operator. CONTAINS : Checks for a subsequence, or value in a set. AttributeValueList can contain only one AttributeValue element of type String, Number, or Binary (not a set type). If the target attribute of the comparison is of type String, then the operator checks for a substring match. If the target attribute of the comparison is of type Binary, then the operator looks for a subsequence of the target that matches the input. If the target attribute of the comparison is a set ("SS", "NS", or "BS"), then the operator evaluates to true if it finds an exact match with any member of the set. CONTAINS is supported for lists: When evaluating "a CONTAINS b", "a" can be a list; however, "b" cannot be a set, a map, or a list. NOT_CONTAINS : Checks for absence of a subsequence, or absence of a value in a set. AttributeValueList can contain only one AttributeValue element of type String, Number, or Binary (not a set type). If the target attribute of the comparison is a String, then the operator checks for the absence of a substring match. If the target attribute of the comparison is Binary, then the operator checks for the absence of a subsequence of the target that matches the input. If the target attribute of the comparison is a set ("SS", "NS", or "BS"), then the operator evaluates to true if it does not find an exact match with any member of the set. NOT_CONTAINS is supported for lists: When evaluating "a NOT CONTAINS b", "a" can be a list; however, "b" cannot be a set, a map, or a list. BEGINS_WITH : Checks for a prefix. AttributeValueList can contain only one AttributeValue of type String or Binary (not a Number or a set type). The target attribute of the comparison must be of type String or Binary (not a Number or a set type). IN : Checks for matching elements in a list. AttributeValueList can contain one or more AttributeValue elements of type String, Number, or Binary. These attributes are compared against an existing attribute of an item. If any elements of the input are equal to the item attribute, the expression evaluates to true. BETWEEN : Greater than or equal to the first value, and less than or equal to the second value. AttributeValueList must contain two AttributeValue elements of the same type, either String, Number, or Binary (not a set type). A target attribute matches if the target value is greater than, or equal to, the first element and less than, or equal to, the second element. If an item contains an AttributeValue element of a different type than the one provided in the request, the value does not match. For example, {"S":"6"} does not compare to {"N":"6"}. Also, {"N":"6"} does not compare to {"NS":["6", "2", "1"]} For usage examples of AttributeValueList and ComparisonOperator, see Legacy Conditional Parameters in the Amazon DynamoDB Developer Guide. */ ComparisonOperator: ComparisonOperator; } export interface ConditionCheck { /** * The primary key of the item to be checked. Each element consists of an attribute name and a value for that attribute. */ Key: Key; /** * Name of the table for the check item request. */ TableName: TableName; /** * A condition that must be satisfied in order for a conditional update to succeed. */ ConditionExpression: ConditionExpression; /** * One or more substitution tokens for attribute names in an expression. */ ExpressionAttributeNames?: ExpressionAttributeNameMap; /** * One or more values that can be substituted in an expression. */ ExpressionAttributeValues?: ExpressionAttributeValueMap; /** * Use ReturnValuesOnConditionCheckFailure to get the item attributes if the ConditionCheck condition fails. For ReturnValuesOnConditionCheckFailure, the valid values are: NONE and ALL_OLD. */ ReturnValuesOnConditionCheckFailure?: ReturnValuesOnConditionCheckFailure; } export type ConditionExpression = string; export type ConditionalOperator = "AND"|"OR"|string; export type ConsistentRead = boolean; export interface ConsumedCapacity { /** * The name of the table that was affected by the operation. */ TableName?: TableName; /** * The total number of capacity units consumed by the operation. */ CapacityUnits?: ConsumedCapacityUnits; /** * The total number of read capacity units consumed by the operation. */ ReadCapacityUnits?: ConsumedCapacityUnits; /** * The total number of write capacity units consumed by the operation. */ WriteCapacityUnits?: ConsumedCapacityUnits; /** * The amount of throughput consumed on the table affected by the operation. */ Table?: Capacity; /** * The amount of throughput consumed on each local index affected by the operation. */ LocalSecondaryIndexes?: SecondaryIndexesCapacityMap; /** * The amount of throughput consumed on each global index affected by the operation. */ GlobalSecondaryIndexes?: SecondaryIndexesCapacityMap; } export type ConsumedCapacityMultiple = ConsumedCapacity[]; export type ConsumedCapacityUnits = number; export interface ContinuousBackupsDescription { /** * ContinuousBackupsStatus can be one of the following states: ENABLED, DISABLED */ ContinuousBackupsStatus: ContinuousBackupsStatus; /** * The description of the point in time recovery settings applied to the table. */ PointInTimeRecoveryDescription?: PointInTimeRecoveryDescription; } export type ContinuousBackupsStatus = "ENABLED"|"DISABLED"|string; export interface CreateBackupInput { /** * The name of the table. */ TableName: TableName; /** * Specified name for the backup. */ BackupName: BackupName; } export interface CreateBackupOutput { /** * Contains the details of the backup created for the table. */ BackupDetails?: BackupDetails; } export interface CreateGlobalSecondaryIndexAction { /** * The name of the global secondary index to be created. */ IndexName: IndexName; /** * The key schema for the global secondary index. */ KeySchema: KeySchema; /** * Represents attributes that are copied (projected) from the table into an index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. */ Projection: Projection; /** * Represents the provisioned throughput settings for the specified global secondary index. For current minimum and maximum provisioned throughput values, see Limits in the Amazon DynamoDB Developer Guide. */ ProvisionedThroughput?: ProvisionedThroughput; } export interface CreateGlobalTableInput { /** * The global table name. */ GlobalTableName: TableName; /** * The Regions where the global table needs to be created. */ ReplicationGroup: ReplicaList; } export interface CreateGlobalTableOutput { /** * Contains the details of the global table. */ GlobalTableDescription?: GlobalTableDescription; } export interface CreateReplicaAction { /** * The region of the replica to be added. */ RegionName: RegionName; } export interface CreateTableInput { /** * An array of attributes that describe the key schema for the table and indexes. */ AttributeDefinitions: AttributeDefinitions; /** * The name of the table to create. */ TableName: TableName; /** * Specifies the attributes that make up the primary key for a table or an index. The attributes in KeySchema must also be defined in the AttributeDefinitions array. For more information, see Data Model in the Amazon DynamoDB Developer Guide. Each KeySchemaElement in the array is composed of: AttributeName - The name of this key attribute. KeyType - The role that the key attribute will assume: HASH - partition key RANGE - sort key The partition key of an item is also known as its hash attribute. The term "hash attribute" derives from the DynamoDB usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values. The sort key of an item is also known as its range attribute. The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value. For a simple primary key (partition key), you must provide exactly one element with a KeyType of HASH. For a composite primary key (partition key and sort key), you must provide exactly two elements, in this order: The first element must have a KeyType of HASH, and the second element must have a KeyType of RANGE. For more information, see Working with Tables in the Amazon DynamoDB Developer Guide. */ KeySchema: KeySchema; /** * One or more local secondary indexes (the maximum is 5) to be created on the table. Each index is scoped to a given partition key value. There is a 10 GB size limit per partition key value; otherwise, the size of a local secondary index is unconstrained. Each local secondary index in the array includes the following: IndexName - The name of the local secondary index. Must be unique only for this table. KeySchema - Specifies the key schema for the local secondary index. The key schema must begin with the same partition key as the table. Projection - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of: ProjectionType - One of the following: KEYS_ONLY - Only the index and primary keys are projected into the index. INCLUDE - Only the specified table attributes are projected into the index. The list of projected attributes is in NonKeyAttributes. ALL - All of the table attributes are projected into the index. NonKeyAttributes - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in NonKeyAttributes, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total. */ LocalSecondaryIndexes?: LocalSecondaryIndexList; /** * One or more global secondary indexes (the maximum is 20) to be created on the table. Each global secondary index in the array includes the following: IndexName - The name of the global secondary index. Must be unique only for this table. KeySchema - Specifies the key schema for the global secondary index. Projection - Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of: ProjectionType - One of the following: KEYS_ONLY - Only the index and primary keys are projected into the index. INCLUDE - Only the specified table attributes are projected into the index. The list of projected attributes is in NonKeyAttributes. ALL - All of the table attributes are projected into the index. NonKeyAttributes - A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided in NonKeyAttributes, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total. ProvisionedThroughput - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units. */ GlobalSecondaryIndexes?: GlobalSecondaryIndexList; /** * Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later. PROVISIONED - Sets the billing mode to PROVISIONED. We recommend using PROVISIONED for predictable workloads. PAY_PER_REQUEST - Sets the billing mode to PAY_PER_REQUEST. We recommend using PAY_PER_REQUEST for unpredictable workloads. */ BillingMode?: BillingMode; /** * Represents the provisioned throughput settings for a specified table or index. The settings can be modified using the UpdateTable operation. If you set BillingMode as PROVISIONED, you must specify this property. If you set BillingMode as PAY_PER_REQUEST, you cannot specify this property. For current minimum and maximum provisioned throughput values, see Limits in the Amazon DynamoDB Developer Guide. */ ProvisionedThroughput?: ProvisionedThroughput; /** * The settings for DynamoDB Streams on the table. These settings consist of: StreamEnabled - Indicates whether DynamoDB Streams is to be enabled (true) or disabled (false). StreamViewType - When an item in the table is modified, StreamViewType determines what information is written to the table's stream. Valid values for StreamViewType are: KEYS_ONLY - Only the key attributes of the modified item are written to the stream. NEW_IMAGE - The entire item, as it appears after it was modified, is written to the stream. OLD_IMAGE - The entire item, as it appeared before it was modified, is written to the stream. NEW_AND_OLD_IMAGES - Both the new and the old item images of the item are written to the stream. */ StreamSpecification?: StreamSpecification; /** * Represents the settings used to enable server-side encryption. */ SSESpecification?: SSESpecification; /** * A list of key-value pairs to label the table. For more information, see Tagging for DynamoDB. */ Tags?: TagList; } export interface CreateTableOutput { /** * Represents the properties of the table. */ TableDescription?: TableDescription; } export type _Date = Date; export interface Delete { /** * The primary key of the item to be deleted. Each element consists of an attribute name and a value for that attribute. */ Key: Key; /** * Name of the table in which the item to be deleted resides. */ TableName: TableName; /** * A condition that must be satisfied in order for a conditional delete to succeed. */ ConditionExpression?: ConditionExpression; /** * One or more substitution tokens for attribute names in an expression. */ ExpressionAttributeNames?: ExpressionAttributeNameMap; /** * One or more values that can be substituted in an expression. */ ExpressionAttributeValues?: ExpressionAttributeValueMap; /** * Use ReturnValuesOnConditionCheckFailure to get the item attributes if the Delete condition fails. For ReturnValuesOnConditionCheckFailure, the valid values are: NONE and ALL_OLD. */ ReturnValuesOnConditionCheckFailure?: ReturnValuesOnConditionCheckFailure; } export interface DeleteBackupInput { /** * The ARN associated with the backup. */ BackupArn: BackupArn; } export interface DeleteBac