From ddac680d53de51b3b084f899c757b31fd039b28b Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Thu, 29 Oct 2020 15:49:22 -0400 Subject: [PATCH] Partial HTTP protocol implementation (#1) * Add new models to run integration tests against * Add initial support for HTTP protocols * Refactor protocol generation arguments * Add more method comments * Remove some dead code * CR feedback --- build.gradle.kts | 8 + codegen-test/build.gradle.kts | 1 + codegen-test/model/dynamodb.json | 7802 +++++++++++++++++ codegen-test/model/ebs.json | 1350 +++ codegen-test/smithy-build.json | 2 +- codegen/build.gradle.kts | 1 - .../smithy/rust/codegen/lang/RustWriter.kt | 36 +- .../rust/codegen/smithy/CodegenVisitor.kt | 55 +- .../rust/codegen/smithy/RuntimeTypes.kt | 4 + .../rust/codegen/smithy/RustSettings.kt | 1 - .../rust/codegen/smithy/SymbolVisitor.kt | 47 +- .../smithy/generators/EnumGenerator.kt | 5 +- .../smithy/generators/ErrorGenerator.kt | 9 +- .../generators/HttpProtocolGenerator.kt | 58 + ...erator.kt => HttpTraitBindingGenerator.kt} | 171 +- .../smithy/generators/OperationGenerator.kt | 71 - .../smithy/generators/ServiceGenerator.kt | 59 + .../codegen/smithy/protocols/AwsJson10.kt | 47 + .../codegen/smithy/protocols/AwsRestJson.kt | 64 + .../codegen/smithy/traits/SyntheticInput.kt | 29 + .../transformers/OperationNormalizer.kt | 49 + .../amazon/smithy/rust/codegen/util/Exec.kt | 4 +- .../smithy/rust/codegen/util/Strings.kt | 5 - .../codegen/generators/EnumGeneratorTest.kt | 1 - ...st.kt => HttpTraitBindingGeneratorTest.kt} | 90 +- .../generators/StructureGeneratorTest.kt | 9 +- .../transformers/OperationNormalizerTest.kt | 56 + .../amazon/smithy/rust/lang/RustWriterTest.kt | 4 +- .../amazon/smithy/rust/testutil/Rust.kt | 11 +- rust-runtime/.gitignore | 2 +- rust-runtime/smithy-http/src/base64.rs | 77 + rust-runtime/smithy-http/src/label.rs | 28 + rust-runtime/smithy-http/src/lib.rs | 135 +- rust-runtime/smithy-http/src/query.rs | 106 + 34 files changed, 10059 insertions(+), 338 deletions(-) create mode 100644 codegen-test/model/dynamodb.json create mode 100644 codegen-test/model/ebs.json create mode 100644 codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/HttpProtocolGenerator.kt rename codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/{HttpBindingGenerator.kt => HttpTraitBindingGenerator.kt} (51%) delete mode 100644 codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/OperationGenerator.kt create mode 100644 codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/ServiceGenerator.kt create mode 100644 codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/AwsJson10.kt create mode 100644 codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/AwsRestJson.kt create mode 100644 codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/traits/SyntheticInput.kt create mode 100644 codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/transformers/OperationNormalizer.kt rename codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/generators/{HttpBindingGeneratorTest.kt => HttpTraitBindingGeneratorTest.kt} (53%) create mode 100644 codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/smithy/transformers/OperationNormalizerTest.kt create mode 100644 rust-runtime/smithy-http/src/base64.rs create mode 100644 rust-runtime/smithy-http/src/label.rs create mode 100644 rust-runtime/smithy-http/src/query.rs diff --git a/build.gradle.kts b/build.gradle.kts index 12669b2c3..3726cff57 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,6 +14,14 @@ buildscript { } } +subprojects { + tasks.withType { + systemProperties["junit.jupiter.execution.parallel.enabled"] = true + systemProperties["junit.jupiter.execution.parallel.mode.default"] = "concurrent" + maxParallelForks = Runtime.getRuntime().availableProcessors() + } +} + plugins { kotlin("jvm") version "1.3.72" apply false id("org.jetbrains.dokka") version "0.10.0" diff --git a/codegen-test/build.gradle.kts b/codegen-test/build.gradle.kts index 10bc039a8..adcb07081 100644 --- a/codegen-test/build.gradle.kts +++ b/codegen-test/build.gradle.kts @@ -31,6 +31,7 @@ tasks.register("cargoCheck") { tasks.register("cargoClippy") { workingDir("build/smithyprojections/codegen-test/source/rust-codegen/") // disallow warnings + environment("RUSTFLAGS", "-D warnings") commandLine("cargo", "clippy") dependsOn("build") } diff --git a/codegen-test/model/dynamodb.json b/codegen-test/model/dynamodb.json new file mode 100644 index 000000000..2adaae28a --- /dev/null +++ b/codegen-test/model/dynamodb.json @@ -0,0 +1,7802 @@ +{ + "smithy": "1.0", + "metadata": { + "suppressions": [ + { + "id": "HttpMethodSemantics", + "namespace": "*" + }, + { + "id": "HttpResponseCodeSemantics", + "namespace": "*" + }, + { + "id": "PaginatedTrait", + "namespace": "*" + }, + { + "id": "HttpHeaderTrait", + "namespace": "*" + }, + { + "id": "HttpUriConflict", + "namespace": "*" + }, + { + "id": "Service", + "namespace": "*" + } + ] + }, + "shapes": { + "com.amazonaws.dynamodb#ArchivalReason": { + "type": "string" + }, + "com.amazonaws.dynamodb#ArchivalSummary": { + "type": "structure", + "members": { + "ArchivalBackupArn": { + "target": "com.amazonaws.dynamodb#BackupArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the backup the table was archived\n to, when applicable in the archival reason. If you wish to restore this\n backup to the same table name, you will need to delete the original\n table.

" + } + }, + "ArchivalReason": { + "target": "com.amazonaws.dynamodb#ArchivalReason", + "traits": { + "smithy.api#documentation": "

The reason DynamoDB archived the table. Currently, the only\n possible value is:

\n\n
    \n
  • \n

    \n INACCESSIBLE_ENCRYPTION_CREDENTIALS - The\n table was archived due to the table's AWS KMS key being inaccessible\n for more than seven days. An On-Demand backup was created at the archival\n time.

    \n
  • \n
" + } + }, + "ArchivalDateTime": { + "target": "com.amazonaws.dynamodb#Date", + "traits": { + "smithy.api#documentation": "

The date and time when table archival was initiated by DynamoDB,\n in UNIX epoch time format.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Contains details of a table archival operation.

" + } + }, + "com.amazonaws.dynamodb#AttributeAction": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "ADD" + }, + { + "value": "PUT" + }, + { + "value": "DELETE" + } + ] + } + }, + "com.amazonaws.dynamodb#AttributeDefinition": { + "type": "structure", + "members": { + "AttributeType": { + "target": "com.amazonaws.dynamodb#ScalarAttributeType", + "traits": { + "smithy.api#documentation": "

The data type for the attribute, where:

\n
    \n
  • \n

    \n S - the attribute is of type String

    \n
  • \n
  • \n

    \n N - the attribute is of type Number

    \n
  • \n
  • \n

    \n B - the attribute is of type Binary

    \n
  • \n
", + "smithy.api#required": {} + } + }, + "AttributeName": { + "target": "com.amazonaws.dynamodb#KeySchemaAttributeName", + "traits": { + "smithy.api#documentation": "

A name for the attribute.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents an attribute for describing the key schema for the table and indexes.

" + } + }, + "com.amazonaws.dynamodb#AttributeDefinitions": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#AttributeDefinition" + } + }, + "com.amazonaws.dynamodb#AttributeMap": { + "type": "map", + "key": { + "target": "com.amazonaws.dynamodb#AttributeName" + }, + "value": { + "target": "com.amazonaws.dynamodb#AttributeValue" + } + }, + "com.amazonaws.dynamodb#AttributeName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 65535 + } + } + }, + "com.amazonaws.dynamodb#AttributeNameList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#AttributeName" + }, + "traits": { + "smithy.api#length": { + "min": 1 + } + } + }, + "com.amazonaws.dynamodb#AttributeUpdates": { + "type": "map", + "key": { + "target": "com.amazonaws.dynamodb#AttributeName" + }, + "value": { + "target": "com.amazonaws.dynamodb#AttributeValueUpdate" + } + }, + "com.amazonaws.dynamodb#AttributeValue": { + "type": "structure", + "members": { + "BOOL": { + "target": "com.amazonaws.dynamodb#BooleanAttributeValue", + "traits": { + "smithy.api#documentation": "

An attribute of type Boolean. For example:

\n

\n \"BOOL\": true\n

" + } + }, + "NS": { + "target": "com.amazonaws.dynamodb#NumberSetAttributeValue", + "traits": { + "smithy.api#documentation": "

An attribute of type Number Set. For example:

\n

\n \"NS\": [\"42.2\", \"-19\", \"7.5\", \"3.14\"]\n

\n

Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations.

" + } + }, + "S": { + "target": "com.amazonaws.dynamodb#StringAttributeValue", + "traits": { + "smithy.api#documentation": "

An attribute of type String. For example:

\n

\n \"S\": \"Hello\"\n

" + } + }, + "B": { + "target": "com.amazonaws.dynamodb#BinaryAttributeValue", + "traits": { + "smithy.api#documentation": "

An attribute of type Binary. For example:

\n

\n \"B\": \"dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk\"\n

" + } + }, + "BS": { + "target": "com.amazonaws.dynamodb#BinarySetAttributeValue", + "traits": { + "smithy.api#documentation": "

An attribute of type Binary Set. For example:

\n

\n \"BS\": [\"U3Vubnk=\", \"UmFpbnk=\", \"U25vd3k=\"]\n

" + } + }, + "SS": { + "target": "com.amazonaws.dynamodb#StringSetAttributeValue", + "traits": { + "smithy.api#documentation": "

An attribute of type String Set. For example:

\n

\n \"SS\": [\"Giraffe\", \"Hippo\" ,\"Zebra\"]\n

" + } + }, + "N": { + "target": "com.amazonaws.dynamodb#NumberAttributeValue", + "traits": { + "smithy.api#documentation": "

An attribute of type Number. For example:

\n

\n \"N\": \"123.45\"\n

\n

Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations.

" + } + }, + "M": { + "target": "com.amazonaws.dynamodb#MapAttributeValue", + "traits": { + "smithy.api#documentation": "

An attribute of type Map. For example:

\n

\n \"M\": {\"Name\": {\"S\": \"Joe\"}, \"Age\": {\"N\": \"35\"}}\n

" + } + }, + "NULL": { + "target": "com.amazonaws.dynamodb#NullAttributeValue", + "traits": { + "smithy.api#documentation": "

An attribute of type Null. For example:

\n

\n \"NULL\": true\n

" + } + }, + "L": { + "target": "com.amazonaws.dynamodb#ListAttributeValue", + "traits": { + "smithy.api#documentation": "

An attribute of type List. For example:

\n

\n \"L\": [ {\"S\": \"Cookies\"} , {\"S\": \"Coffee\"}, {\"N\", \"3.14159\"}]\n

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the data for an attribute.

\n

Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself.

\n

For more information, see Data Types in the\n Amazon DynamoDB Developer Guide.

" + } + }, + "com.amazonaws.dynamodb#AttributeValueList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#AttributeValue" + } + }, + "com.amazonaws.dynamodb#AttributeValueUpdate": { + "type": "structure", + "members": { + "Action": { + "target": "com.amazonaws.dynamodb#AttributeAction", + "traits": { + "smithy.api#documentation": "

Specifies how to perform the update. Valid values are PUT (default), DELETE,\n and ADD. The behavior depends on whether the specified primary key already exists\n in the table.

\n\n

\n If an item with the specified Key is found in the table:\n

\n\n
    \n
  • \n

    \n PUT - Adds the specified attribute to the item. If the attribute already\n exists, it is replaced by the new value.

    \n
  • \n
  • \n

    \n DELETE - If no value is specified, the attribute and its value are removed\n from the item. The data type of the specified value must match the existing value's data\n type.

    \n

    If a set of values is specified, then those values are subtracted from the old\n set. For example, if the attribute value was the set [a,b,c] and the\n DELETE action specified [a,c], then the final attribute value would\n be [b]. Specifying an empty set is an error.

    \n
  • \n
  • \n

    \n ADD - If the attribute does not already exist, then the attribute and its\n values are added to the item. If the attribute does exist, then the behavior of\n ADD depends on the data type of the attribute:

    \n
      \n
    • \n

      If the existing attribute is a number, and if Value is also a number, then the\n Value is mathematically added to the existing attribute. If Value is a\n negative number, then it is subtracted from the existing attribute.

      \n \n

      If you use ADD to increment or decrement a number value for an item\n that doesn't exist before the update, DynamoDB uses 0 as the initial value.

      \n

      In addition, if you use ADD to update an existing item, and intend to\n increment or decrement an attribute value which does not yet exist, DynamoDB uses\n 0 as the initial value. For example, suppose that the item you want\n to update does not yet have an attribute named itemcount, but you decide to\n ADD the number 3 to this attribute anyway, even though\n it currently does not exist. DynamoDB will create the itemcount attribute, set\n its initial value to 0, and finally add 3 to it. The\n result will be a new itemcount attribute in the item, with a value of\n 3.

      \n
      \n
    • \n
    • \n

      If the existing data type is a set, and if the Value is also a set, then the\n Value is added to the existing set. (This is a set operation, not\n mathematical addition.) For example, if the attribute value was the set\n [1,2], and the ADD action specified [3], then\n the final attribute value would be [1,2,3]. An error occurs if an Add\n action is specified for a set attribute and the attribute type specified does not\n match the existing set type.

      \n

      Both sets must have the same primitive data type. For example, if the existing data\n type is a set of strings, the Value must also be a set of strings. The same\n holds true for number sets and binary sets.

      \n
    • \n
    \n

    This action is only valid for an existing attribute whose data type is number or is a\n set. Do not use ADD for any other data types.

    \n
  • \n
\n\n

\n If no item with the specified Key is found:\n

\n\n
    \n
  • \n

    \n PUT - DynamoDB creates a new item with the specified primary key, and then adds\n the attribute.

    \n
  • \n
  • \n

    \n DELETE - Nothing happens; there is no attribute to delete.

    \n
  • \n
  • \n

    \n ADD - DynamoDB creates an item with the supplied primary key and number (or set\n of numbers) for the attribute value. The only data types allowed are number and number\n set; no other data types can be specified.

    \n
  • \n
" + } + }, + "Value": { + "target": "com.amazonaws.dynamodb#AttributeValue", + "traits": { + "smithy.api#documentation": "

Represents the data for an attribute.

\n

Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself.

\n

For more information, see Data Types in the Amazon DynamoDB Developer Guide.\n

" + } + } + }, + "traits": { + "smithy.api#documentation": "

For the UpdateItem operation, represents the attributes to be modified, the action to\n perform on each, and the new value for each.

\n \n

You cannot use UpdateItem to update any primary key attributes. Instead, you will\n need to delete the item, and then use PutItem to create a new item with new\n attributes.

\n
\n

Attribute values cannot be null; string and binary type attributes must have lengths greater\n than zero; and set type attributes must not be empty. Requests with empty values will be\n rejected with a ValidationException exception.

" + } + }, + "com.amazonaws.dynamodb#AutoScalingPolicyDescription": { + "type": "structure", + "members": { + "PolicyName": { + "target": "com.amazonaws.dynamodb#AutoScalingPolicyName", + "traits": { + "smithy.api#documentation": "

The name of the scaling policy.

" + } + }, + "TargetTrackingScalingPolicyConfiguration": { + "target": "com.amazonaws.dynamodb#AutoScalingTargetTrackingScalingPolicyConfigurationDescription", + "traits": { + "smithy.api#documentation": "

Represents a target tracking scaling policy configuration.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the properties of the scaling policy.

" + } + }, + "com.amazonaws.dynamodb#AutoScalingPolicyDescriptionList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#AutoScalingPolicyDescription" + } + }, + "com.amazonaws.dynamodb#AutoScalingPolicyName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 256 + }, + "smithy.api#pattern": "\\p{Print}+" + } + }, + "com.amazonaws.dynamodb#AutoScalingPolicyUpdate": { + "type": "structure", + "members": { + "PolicyName": { + "target": "com.amazonaws.dynamodb#AutoScalingPolicyName", + "traits": { + "smithy.api#documentation": "

The name of the scaling policy.

" + } + }, + "TargetTrackingScalingPolicyConfiguration": { + "target": "com.amazonaws.dynamodb#AutoScalingTargetTrackingScalingPolicyConfigurationUpdate", + "traits": { + "smithy.api#documentation": "

Represents a target tracking scaling policy configuration.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the auto scaling policy to be modified.

" + } + }, + "com.amazonaws.dynamodb#AutoScalingRoleArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1600 + }, + "smithy.api#pattern": "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDC00-\\uDBFF\\uDFFF\\r\\n\\t]*" + } + }, + "com.amazonaws.dynamodb#AutoScalingSettingsDescription": { + "type": "structure", + "members": { + "MinimumUnits": { + "target": "com.amazonaws.dynamodb#PositiveLongObject", + "traits": { + "smithy.api#documentation": "

The minimum capacity units that a global table or global secondary index should be scaled down to.

" + } + }, + "AutoScalingDisabled": { + "target": "com.amazonaws.dynamodb#BooleanObject", + "traits": { + "smithy.api#documentation": "

Disabled auto scaling for this global table or global secondary index.

" + } + }, + "AutoScalingRoleArn": { + "target": "com.amazonaws.dynamodb#String", + "traits": { + "smithy.api#documentation": "

Role ARN used for configuring the auto scaling policy.

" + } + }, + "ScalingPolicies": { + "target": "com.amazonaws.dynamodb#AutoScalingPolicyDescriptionList", + "traits": { + "smithy.api#documentation": "

Information about the scaling policies.

" + } + }, + "MaximumUnits": { + "target": "com.amazonaws.dynamodb#PositiveLongObject", + "traits": { + "smithy.api#documentation": "

The maximum capacity units that a global table or global secondary index should be scaled up to.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the auto scaling settings for a global table or global secondary\n index.

" + } + }, + "com.amazonaws.dynamodb#AutoScalingSettingsUpdate": { + "type": "structure", + "members": { + "MinimumUnits": { + "target": "com.amazonaws.dynamodb#PositiveLongObject", + "traits": { + "smithy.api#documentation": "

The minimum capacity units that a global table or global secondary index should be scaled down to.

" + } + }, + "ScalingPolicyUpdate": { + "target": "com.amazonaws.dynamodb#AutoScalingPolicyUpdate", + "traits": { + "smithy.api#documentation": "

The scaling policy to apply for scaling target global table or global secondary index capacity units.

" + } + }, + "AutoScalingRoleArn": { + "target": "com.amazonaws.dynamodb#AutoScalingRoleArn", + "traits": { + "smithy.api#documentation": "

Role ARN used for configuring auto scaling policy.

" + } + }, + "MaximumUnits": { + "target": "com.amazonaws.dynamodb#PositiveLongObject", + "traits": { + "smithy.api#documentation": "

The maximum capacity units that a global table or global secondary index should be scaled up to.

" + } + }, + "AutoScalingDisabled": { + "target": "com.amazonaws.dynamodb#BooleanObject", + "traits": { + "smithy.api#documentation": "

Disabled auto scaling for this global table or global secondary index.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the auto scaling settings to be modified for a global table or global\n secondary index.

" + } + }, + "com.amazonaws.dynamodb#AutoScalingTargetTrackingScalingPolicyConfigurationDescription": { + "type": "structure", + "members": { + "ScaleOutCooldown": { + "target": "com.amazonaws.dynamodb#IntegerObject", + "traits": { + "smithy.api#documentation": "

The amount of time, in seconds, after a scale out activity completes before another scale out\n activity can start. While the cooldown period is in effect, the capacity that has been added\n by the previous scale out event that initiated the cooldown is calculated as part of the\n desired capacity for the next scale out. You should continuously (but not excessively)\n scale out.

" + } + }, + "ScaleInCooldown": { + "target": "com.amazonaws.dynamodb#IntegerObject", + "traits": { + "smithy.api#documentation": "

The amount of time, in seconds, after a scale in activity completes before another scale\n in activity can start. The cooldown period is used to block subsequent scale in requests\n until it has expired. You should scale in conservatively to protect your application's\n availability. However, if another alarm triggers a scale out policy during the cooldown\n period after a scale-in, application auto scaling scales out your scalable target\n immediately.

" + } + }, + "DisableScaleIn": { + "target": "com.amazonaws.dynamodb#BooleanObject", + "traits": { + "smithy.api#documentation": "

Indicates whether scale in by the target tracking policy is disabled. If the value is true,\n scale in is disabled and the target tracking policy won't remove capacity from the scalable resource.\n Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource.\n The default value is false.

" + } + }, + "TargetValue": { + "target": "com.amazonaws.dynamodb#Double", + "traits": { + "smithy.api#documentation": "

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).

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the properties of a target tracking scaling policy.

" + } + }, + "com.amazonaws.dynamodb#AutoScalingTargetTrackingScalingPolicyConfigurationUpdate": { + "type": "structure", + "members": { + "ScaleInCooldown": { + "target": "com.amazonaws.dynamodb#IntegerObject", + "traits": { + "smithy.api#documentation": "

The amount of time, in seconds, after a scale in activity completes before another scale\n in activity can start. The cooldown period is used to block subsequent scale in requests\n until it has expired. You should scale in conservatively to protect your application's\n availability. However, if another alarm triggers a scale out policy during the cooldown\n period after a scale-in, application auto scaling scales out your scalable target\n immediately.

" + } + }, + "TargetValue": { + "target": "com.amazonaws.dynamodb#Double", + "traits": { + "smithy.api#documentation": "

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).

", + "smithy.api#required": {} + } + }, + "DisableScaleIn": { + "target": "com.amazonaws.dynamodb#BooleanObject", + "traits": { + "smithy.api#documentation": "

Indicates whether scale in by the target tracking policy is disabled. If the value is true,\n scale in is disabled and the target tracking policy won't remove capacity from the scalable resource.\n Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource.\n The default value is false.

" + } + }, + "ScaleOutCooldown": { + "target": "com.amazonaws.dynamodb#IntegerObject", + "traits": { + "smithy.api#documentation": "

The amount of time, in seconds, after a scale out activity completes before another scale out\n activity can start. While the cooldown period is in effect, the capacity that has been added\n by the previous scale out event that initiated the cooldown is calculated as part of the\n desired capacity for the next scale out. You should continuously (but not excessively)\n scale out.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the settings of a target tracking scaling policy that will be modified.

" + } + }, + "com.amazonaws.dynamodb#Backfilling": { + "type": "boolean", + "traits": { + "smithy.api#box": {} + } + }, + "com.amazonaws.dynamodb#BackupArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 37, + "max": 1024 + } + } + }, + "com.amazonaws.dynamodb#BackupCreationDateTime": { + "type": "timestamp" + }, + "com.amazonaws.dynamodb#BackupDescription": { + "type": "structure", + "members": { + "BackupDetails": { + "target": "com.amazonaws.dynamodb#BackupDetails", + "traits": { + "smithy.api#documentation": "

Contains the details of the backup created for the table.

" + } + }, + "SourceTableFeatureDetails": { + "target": "com.amazonaws.dynamodb#SourceTableFeatureDetails", + "traits": { + "smithy.api#documentation": "

Contains the details of the features enabled on the table when the backup was created. For example, LSIs, GSIs, streams, TTL.

" + } + }, + "SourceTableDetails": { + "target": "com.amazonaws.dynamodb#SourceTableDetails", + "traits": { + "smithy.api#documentation": "

Contains the details of the table when the backup was created.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Contains the description of the backup created for the table.

" + } + }, + "com.amazonaws.dynamodb#BackupDetails": { + "type": "structure", + "members": { + "BackupExpiryDateTime": { + "target": "com.amazonaws.dynamodb#Date", + "traits": { + "smithy.api#documentation": "

Time at which the automatic on-demand backup created by DynamoDB will expire. This SYSTEM\n on-demand backup expires automatically 35 days after its creation.

" + } + }, + "BackupType": { + "target": "com.amazonaws.dynamodb#BackupType", + "traits": { + "smithy.api#documentation": "

BackupType:

\n
    \n
  • \n

    \n USER - You create and manage these using the on-demand backup feature.

    \n
  • \n
  • \n

    \n SYSTEM - If you delete a table with point-in-time recovery enabled, a SYSTEM backup is automatically\n created and is retained for 35 days (at no additional cost). System backups allow you to restore the deleted \n\t\ttable to the state it was in just before the point of deletion.\n\t\t

    \n
  • \n
  • \n

    \n AWS_BACKUP - On-demand backup created by you from AWS Backup service.

    \n
  • \n
", + "smithy.api#required": {} + } + }, + "BackupStatus": { + "target": "com.amazonaws.dynamodb#BackupStatus", + "traits": { + "smithy.api#documentation": "

Backup can be in one of the following states: CREATING, ACTIVE, DELETED.

", + "smithy.api#required": {} + } + }, + "BackupName": { + "target": "com.amazonaws.dynamodb#BackupName", + "traits": { + "smithy.api#documentation": "

Name of the requested backup.

", + "smithy.api#required": {} + } + }, + "BackupCreationDateTime": { + "target": "com.amazonaws.dynamodb#BackupCreationDateTime", + "traits": { + "smithy.api#documentation": "

Time at which the backup was created. This is the request time of the backup.

", + "smithy.api#required": {} + } + }, + "BackupArn": { + "target": "com.amazonaws.dynamodb#BackupArn", + "traits": { + "smithy.api#documentation": "

ARN associated with the backup.

", + "smithy.api#required": {} + } + }, + "BackupSizeBytes": { + "target": "com.amazonaws.dynamodb#BackupSizeBytes", + "traits": { + "smithy.api#documentation": "

Size of the backup in bytes.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Contains the details of the backup created for the table.

" + } + }, + "com.amazonaws.dynamodb#BackupInUseException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

There is another ongoing conflicting backup control plane operation on the table. The backup is either being created, deleted or restored to a table.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#BackupName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 3, + "max": 255 + }, + "smithy.api#pattern": "[a-zA-Z0-9_.-]+" + } + }, + "com.amazonaws.dynamodb#BackupNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

Backup not found for the given BackupARN.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#BackupSizeBytes": { + "type": "long", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 0 + } + } + }, + "com.amazonaws.dynamodb#BackupStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "CREATING" + }, + { + "value": "DELETED" + }, + { + "value": "AVAILABLE" + } + ] + } + }, + "com.amazonaws.dynamodb#BackupSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#BackupSummary" + } + }, + "com.amazonaws.dynamodb#BackupSummary": { + "type": "structure", + "members": { + "BackupArn": { + "target": "com.amazonaws.dynamodb#BackupArn", + "traits": { + "smithy.api#documentation": "

ARN associated with the backup.

" + } + }, + "BackupName": { + "target": "com.amazonaws.dynamodb#BackupName", + "traits": { + "smithy.api#documentation": "

Name of the specified backup.

" + } + }, + "BackupExpiryDateTime": { + "target": "com.amazonaws.dynamodb#Date", + "traits": { + "smithy.api#documentation": "

Time at which the automatic on-demand backup created by DynamoDB will expire. This\n SYSTEM on-demand backup expires automatically 35 days after its\n creation.

" + } + }, + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

Name of the table.

" + } + }, + "TableId": { + "target": "com.amazonaws.dynamodb#TableId", + "traits": { + "smithy.api#documentation": "

Unique identifier for the table.

" + } + }, + "BackupType": { + "target": "com.amazonaws.dynamodb#BackupType", + "traits": { + "smithy.api#documentation": "

BackupType:

\n
    \n
  • \n

    \n USER - You create and manage these using the on-demand backup feature.

    \n
  • \n
  • \n

    \n SYSTEM - If you delete a table with point-in-time recovery enabled, a SYSTEM backup is automatically\n created and is retained for 35 days (at no additional cost). System backups allow you to restore the deleted \n\t\ttable to the state it was in just before the point of deletion.\n\t\t

    \n
  • \n
  • \n

    \n AWS_BACKUP - On-demand backup created by you from AWS Backup service.

    \n
  • \n
" + } + }, + "BackupCreationDateTime": { + "target": "com.amazonaws.dynamodb#BackupCreationDateTime", + "traits": { + "smithy.api#documentation": "

Time at which the backup was created.

" + } + }, + "BackupStatus": { + "target": "com.amazonaws.dynamodb#BackupStatus", + "traits": { + "smithy.api#documentation": "

Backup can be in one of the following states: CREATING, ACTIVE, DELETED.

" + } + }, + "BackupSizeBytes": { + "target": "com.amazonaws.dynamodb#BackupSizeBytes", + "traits": { + "smithy.api#documentation": "

Size of the backup in bytes.

" + } + }, + "TableArn": { + "target": "com.amazonaws.dynamodb#TableArn", + "traits": { + "smithy.api#documentation": "

ARN associated with the table.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Contains details for the backup.

" + } + }, + "com.amazonaws.dynamodb#BackupType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "USER", + "name": "USER" + }, + { + "value": "SYSTEM", + "name": "SYSTEM" + }, + { + "value": "AWS_BACKUP", + "name": "AWS_BACKUP" + } + ] + } + }, + "com.amazonaws.dynamodb#BackupTypeFilter": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "USER", + "name": "USER" + }, + { + "value": "SYSTEM", + "name": "SYSTEM" + }, + { + "value": "AWS_BACKUP", + "name": "AWS_BACKUP" + }, + { + "value": "ALL", + "name": "ALL" + } + ] + } + }, + "com.amazonaws.dynamodb#BackupsInputLimit": { + "type": "integer", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.dynamodb#BatchGetItem": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#BatchGetItemInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#BatchGetItemOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" + }, + { + "target": "com.amazonaws.dynamodb#RequestLimitExceeded" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

The BatchGetItem operation returns the attributes of one or more items from one or\n more tables. You identify requested items by primary key.

\n

A single operation can retrieve up to 16 MB of data, which can contain as many as 100\n items. BatchGetItem returns a partial result if the response size limit is\n exceeded, the table's provisioned throughput is exceeded, or an internal processing\n failure occurs. If a partial result is returned, the operation returns a value for\n UnprocessedKeys. You can use this value to retry the operation starting\n with the next item to get.

\n \n

If you request more than 100 items, BatchGetItem returns a\n ValidationException with the message \"Too many items requested for\n the BatchGetItem call.\"

\n
\n

For example, if you ask to retrieve 100 items, but each individual item is 300 KB in\n size, the system returns 52 items (so as not to exceed the 16 MB limit). It also returns\n an appropriate UnprocessedKeys value so you can get the next page of\n results. If desired, your application can include its own logic to assemble the pages of\n results into one dataset.

\n

If none of the items can be processed due to insufficient\n provisioned throughput on all of the tables in the request, then\n BatchGetItem returns a\n ProvisionedThroughputExceededException. If at least\n one of the items is successfully processed, then\n BatchGetItem completes successfully, while returning the keys of the\n unread items in UnprocessedKeys.

\n \n

If DynamoDB returns any unprocessed items, you should retry the batch operation on those\n items. However, we strongly recommend that you use an exponential backoff algorithm.\n If you retry the batch operation immediately, the underlying read or write requests can\n still fail due to throttling on the individual tables. If you delay the batch operation\n using exponential backoff, the individual requests in the batch are much more likely to\n succeed.

\n

For more information, see Batch\n Operations and Error Handling in the Amazon DynamoDB Developer Guide.

\n
\n

By default, BatchGetItem performs eventually consistent reads on every table in the\n request. If you want strongly consistent reads instead, you can set ConsistentRead to\n true for any or all tables.

\n

In order to minimize response latency, BatchGetItem retrieves items in parallel.

\n

When designing your application, keep in mind that DynamoDB does not return items in any\n particular order. To help parse the response by item, include the primary key values for the\n items in your request in the ProjectionExpression parameter.

\n

If a requested item does not exist, it is not returned in the result. Requests for\n nonexistent items consume the minimum read capacity units according to the type of read.\n For more information, see Working with Tables in the Amazon DynamoDB Developer\n Guide.

" + } + }, + "com.amazonaws.dynamodb#BatchGetItemInput": { + "type": "structure", + "members": { + "ReturnConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ReturnConsumedCapacity" + }, + "RequestItems": { + "target": "com.amazonaws.dynamodb#BatchGetRequestMap", + "traits": { + "smithy.api#documentation": "

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.

\n

Each element in the map of items to retrieve consists of the following:

\n
    \n
  • \n

    \n ConsistentRead - If true, a strongly consistent read is used; if\n false (the default), an eventually consistent read is used.

    \n
  • \n
  • \n

    \n ExpressionAttributeNames - One or more substitution tokens for attribute names in the ProjectionExpression parameter. The following are some use cases for using ExpressionAttributeNames:

    \n
      \n
    • \n

      To access an attribute whose name conflicts with a DynamoDB reserved word.

      \n
    • \n
    • \n

      To create a placeholder for repeating occurrences of an attribute name in an expression.

      \n
    • \n
    • \n

      To prevent special characters in an attribute name from being misinterpreted in an expression.

      \n
    • \n
    \n

    Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:

    \n
      \n
    • \n

      \n Percentile\n

      \n
    • \n
    \n

    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:

    \n
      \n
    • \n

      \n {\"#P\":\"Percentile\"}\n

      \n
    • \n
    \n

    You could then use this substitution in an expression, as in this example:

    \n
      \n
    • \n

      \n #P = :val\n

      \n
    • \n
    \n \n

    Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.

    \n
    \n

    For more information about expression attribute names, see Accessing Item Attributes in the Amazon DynamoDB\n Developer Guide.

    \n
  • \n
  • \n

    \n Keys - An array of primary key attribute values that define specific items in the\n table. For each primary key, you must provide all of the key attributes. For\n example, with a simple primary key, you only need to provide the partition key value. For a\n composite key, you must provide both the partition key value and the sort key value.

    \n
  • \n
  • \n

    \n ProjectionExpression - A string that identifies one or more\n attributes to retrieve from the table. These attributes can include scalars,\n sets, or elements of a JSON document. The attributes in the expression must be\n separated by commas.

    \n

    If no attribute names are specified, then all attributes are returned. If any\n of the requested attributes are not found, they do not appear in the\n result.

    \n

    For more information, see\n Accessing Item Attributes in the Amazon DynamoDB Developer Guide.

    \n
  • \n
  • \n

    \n AttributesToGet - This is a legacy parameter. Use ProjectionExpression instead. For more information, see\n AttributesToGet in the Amazon DynamoDB Developer Guide.\n\n

    \n\n
  • \n
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the input of a BatchGetItem operation.

" + } + }, + "com.amazonaws.dynamodb#BatchGetItemOutput": { + "type": "structure", + "members": { + "Responses": { + "target": "com.amazonaws.dynamodb#BatchGetResponseMap", + "traits": { + "smithy.api#documentation": "

A map of table name to a list of items. Each object in Responses consists of a table\n name, along with a map of attribute data consisting of the data type and attribute value.

" + } + }, + "ConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ConsumedCapacityMultiple", + "traits": { + "smithy.api#documentation": "

The read capacity units consumed by the entire BatchGetItem operation.

\n

Each element consists of:

\n
    \n
  • \n

    \n TableName - The table that consumed the provisioned throughput.

    \n
  • \n
  • \n

    \n CapacityUnits - The total number of capacity units consumed.

    \n
  • \n
" + } + }, + "UnprocessedKeys": { + "target": "com.amazonaws.dynamodb#BatchGetRequestMap", + "traits": { + "smithy.api#documentation": "

A map of tables and their respective keys that were not processed with the current response.\n The UnprocessedKeys value is in the same form as RequestItems, so the value can\n be provided directly to a subsequent BatchGetItem operation. For more information, see\n RequestItems in the Request Parameters section.

\n

Each element consists of:

\n
    \n
  • \n

    \n Keys - An array of primary key attribute values that define specific items in the\n table.

    \n
  • \n
  • \n

    \n ProjectionExpression - One or more attributes to be\n retrieved from the table or index. By default, all attributes are returned. If a\n requested attribute is not found, it does not appear in the result.

    \n
  • \n
  • \n

    \n ConsistentRead - The consistency of a read operation. If set to true,\n then a strongly consistent read is used; otherwise, an eventually consistent read is\n used.

    \n
  • \n
\n

If there are no unprocessed keys remaining, the response contains an empty\n UnprocessedKeys map.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the output of a BatchGetItem operation.

" + } + }, + "com.amazonaws.dynamodb#BatchGetRequestMap": { + "type": "map", + "key": { + "target": "com.amazonaws.dynamodb#TableName" + }, + "value": { + "target": "com.amazonaws.dynamodb#KeysAndAttributes" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.dynamodb#BatchGetResponseMap": { + "type": "map", + "key": { + "target": "com.amazonaws.dynamodb#TableName" + }, + "value": { + "target": "com.amazonaws.dynamodb#ItemList" + } + }, + "com.amazonaws.dynamodb#BatchWriteItem": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#BatchWriteItemInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#BatchWriteItemOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException" + }, + { + "target": "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" + }, + { + "target": "com.amazonaws.dynamodb#RequestLimitExceeded" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

The BatchWriteItem operation puts or deletes multiple items in one or more\n tables. A single call to BatchWriteItem can write up to 16 MB of data,\n which can comprise as many as 25 put or delete requests. Individual items to be written\n can be as large as 400 KB.

\n \n

\n BatchWriteItem cannot update items. To update items, use the UpdateItem\n action.

\n
\n

The individual PutItem and DeleteItem operations specified in\n BatchWriteItem are atomic; however BatchWriteItem as a whole is not. If any\n requested operations fail because the table's provisioned throughput is exceeded or an\n internal processing failure occurs, the failed operations are returned in the\n UnprocessedItems response parameter. You can investigate and optionally resend the\n requests. Typically, you would call BatchWriteItem in a loop. Each iteration would\n check for unprocessed items and submit a new BatchWriteItem request with those\n unprocessed items until all items have been processed.

\n

If none of the items can be processed due to insufficient\n provisioned throughput on all of the tables in the request, then\n BatchWriteItem returns a\n ProvisionedThroughputExceededException.

\n \n

If DynamoDB returns any unprocessed items, you should retry the batch operation on those\n items. However, we strongly recommend that you use an exponential backoff algorithm.\n If you retry the batch operation immediately, the underlying read or write requests can\n still fail due to throttling on the individual tables. If you delay the batch operation\n using exponential backoff, the individual requests in the batch are much more likely to\n succeed.

\n

For more information, see Batch Operations and Error Handling in the Amazon DynamoDB\n Developer Guide.

\n
\n\n

With BatchWriteItem, you can efficiently write or delete large amounts of\n data, such as from Amazon EMR, or copy data from another database into DynamoDB. In\n order to improve performance with these large-scale operations,\n BatchWriteItem does not behave in the same way as individual\n PutItem and DeleteItem calls would. For example, you\n cannot specify conditions on individual put and delete requests, and\n BatchWriteItem does not return deleted items in the response.

\n

If you use a programming language that supports concurrency, you can use\n threads to write items in parallel. Your application must include the necessary logic to\n manage the threads. With languages that don't support threading, you must update\n or delete the specified items one at a time. In both situations, BatchWriteItem\n performs the specified put and delete operations in\n parallel, giving you the power of the thread pool approach without having to introduce\n complexity into your application.

\n

Parallel processing reduces latency, but each specified put and delete request consumes the same number of write capacity units whether it is processed in parallel or not. Delete operations on nonexistent items consume one write capacity unit.

\n

If one or more of the following is true, DynamoDB rejects the entire batch write operation:

\n
    \n
  • \n

    One or more tables specified in the BatchWriteItem request does not exist.

    \n
  • \n
  • \n

    Primary key attributes specified on an item in the request do not match those in the corresponding table's primary key schema.

    \n
  • \n
  • \n

    You try to perform multiple operations on the same item in the same BatchWriteItem\n request. For example, you cannot put and delete the same item in the same\n BatchWriteItem request.

    \n
  • \n
  • \n\t

    \n\t\tYour request contains at least two items with identical hash and range keys (which essentially is two put operations).\n\t

    \n \t
  • \n
  • \n

    There are more than 25 requests in the batch.

    \n
  • \n
  • \n

    Any individual item in a batch exceeds 400 KB.

    \n
  • \n
  • \n

    The total request size exceeds 16 MB.

    \n
  • \n
" + } + }, + "com.amazonaws.dynamodb#BatchWriteItemInput": { + "type": "structure", + "members": { + "ReturnConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ReturnConsumedCapacity" + }, + "RequestItems": { + "target": "com.amazonaws.dynamodb#BatchWriteItemRequestMap", + "traits": { + "smithy.api#documentation": "

A map of one or more table names and, for each table, a list of operations to be performed\n (DeleteRequest or PutRequest). Each element in the map consists of the\n following:

\n
    \n
  • \n

    \n DeleteRequest - Perform a DeleteItem operation on the specified item. The\n item to be deleted is identified by a Key subelement:

    \n
      \n
    • \n

      \n Key - A map of primary key attribute values that uniquely identify the item.\n Each entry in this map consists of an attribute name and an attribute value. For each\n primary key, you must provide all of the key attributes. For example, with a\n simple primary key, you only need to provide a value for the partition key. For a\n composite primary key, you must provide values for both the partition key and the sort key.

      \n
    • \n
    \n
  • \n
  • \n

    \n PutRequest - Perform a PutItem operation on the specified item. The item to\n be put is identified by an Item subelement:

    \n
      \n
    • \n

      \n Item - A map of attributes and their values. Each entry in\n this map consists of an attribute name and an attribute value. Attribute\n values must not be null; string and binary type attributes must have\n lengths greater than zero; and set type attributes must not be empty.\n Requests that contain empty values are rejected with a\n ValidationException exception.

      \n

      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.

      \n
    • \n
    \n
  • \n
", + "smithy.api#required": {} + } + }, + "ReturnItemCollectionMetrics": { + "target": "com.amazonaws.dynamodb#ReturnItemCollectionMetrics", + "traits": { + "smithy.api#documentation": "

Determines whether item collection metrics are returned. If set to SIZE, the response includes statistics about item collections, if any, that were modified during\n the operation are returned in the response. If set to NONE (the default), no statistics are returned.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the input of a BatchWriteItem operation.

" + } + }, + "com.amazonaws.dynamodb#BatchWriteItemOutput": { + "type": "structure", + "members": { + "ItemCollectionMetrics": { + "target": "com.amazonaws.dynamodb#ItemCollectionMetricsPerTable", + "traits": { + "smithy.api#documentation": "

A list of tables that were processed by BatchWriteItem and, for each table,\n information about any item collections that were affected by individual DeleteItem or\n PutItem operations.

\n

Each entry consists of the following subelements:

\n
    \n
  • \n

    \n ItemCollectionKey - The partition key value of the item collection. This is the same as\n the partition key value of the item.

    \n
  • \n
  • \n

    \n SizeEstimateRangeGB - An estimate of item collection size, expressed in GB. This is\n a two-element array containing a lower bound and an upper bound for the estimate. The\n estimate includes the size of all the items in the table, plus the size of all attributes\n projected into all of the local secondary indexes on the table. Use this estimate to measure whether a\n local secondary index is approaching its size limit.

    \n

    The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.

    \n
  • \n
" + } + }, + "ConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ConsumedCapacityMultiple", + "traits": { + "smithy.api#documentation": "

The capacity units consumed by the entire BatchWriteItem operation.

\n

Each element consists of:

\n
    \n
  • \n

    \n TableName - The table that consumed the provisioned throughput.

    \n
  • \n
  • \n

    \n CapacityUnits - The total number of capacity units consumed.

    \n
  • \n
" + } + }, + "UnprocessedItems": { + "target": "com.amazonaws.dynamodb#BatchWriteItemRequestMap", + "traits": { + "smithy.api#documentation": "

A map of tables and requests against those tables that were not processed. The\n UnprocessedItems value is in the same form as RequestItems, so you can provide\n this value directly to a subsequent BatchGetItem operation. For more information, see\n RequestItems in the Request Parameters section.

\n

Each UnprocessedItems entry consists of a table name and, for that table, a list of\n operations to perform (DeleteRequest or PutRequest).

\n
    \n
  • \n

    \n DeleteRequest - Perform a DeleteItem operation on the specified item. The\n item to be deleted is identified by a Key subelement:

    \n
      \n
    • \n

      \n Key - A map of primary key attribute values that uniquely identify the item.\n Each entry in this map consists of an attribute name and an attribute value.

      \n
    • \n
    \n
  • \n
  • \n

    \n PutRequest - Perform a PutItem operation on the specified item. The item to\n be put is identified by an Item subelement:

    \n
      \n
    • \n

      \n Item - A map of attributes and their values. Each entry in this map consists\n of an attribute name and an attribute value. Attribute values must not be null; string\n and binary type attributes must have lengths greater than zero; and set type\n attributes must not be empty. Requests that contain empty values will be rejected with\n a ValidationException exception.

      \n

      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.

      \n
    • \n
    \n
  • \n
\n

If there are no unprocessed items remaining, the response contains an empty\n UnprocessedItems map.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the output of a BatchWriteItem operation.

" + } + }, + "com.amazonaws.dynamodb#BatchWriteItemRequestMap": { + "type": "map", + "key": { + "target": "com.amazonaws.dynamodb#TableName" + }, + "value": { + "target": "com.amazonaws.dynamodb#WriteRequests" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 25 + } + } + }, + "com.amazonaws.dynamodb#BillingMode": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "PROVISIONED" + }, + { + "value": "PAY_PER_REQUEST" + } + ] + } + }, + "com.amazonaws.dynamodb#BillingModeSummary": { + "type": "structure", + "members": { + "BillingMode": { + "target": "com.amazonaws.dynamodb#BillingMode", + "traits": { + "smithy.api#documentation": "

Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.

\n
    \n
  • \n

    \n PROVISIONED - Sets the read/write capacity mode to PROVISIONED. We recommend using PROVISIONED for predictable workloads.

    \n
  • \n
  • \n

    \n PAY_PER_REQUEST - Sets the read/write capacity mode to PAY_PER_REQUEST. We recommend using PAY_PER_REQUEST for unpredictable workloads.\n

    \n
  • \n
" + } + }, + "LastUpdateToPayPerRequestDateTime": { + "target": "com.amazonaws.dynamodb#Date", + "traits": { + "smithy.api#documentation": "

Represents the time when PAY_PER_REQUEST was last set as the read/write capacity mode.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Contains the details for the read/write capacity mode.

" + } + }, + "com.amazonaws.dynamodb#BinaryAttributeValue": { + "type": "blob" + }, + "com.amazonaws.dynamodb#BinarySetAttributeValue": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#BinaryAttributeValue" + } + }, + "com.amazonaws.dynamodb#BooleanAttributeValue": { + "type": "boolean", + "traits": { + "smithy.api#box": {} + } + }, + "com.amazonaws.dynamodb#BooleanObject": { + "type": "boolean", + "traits": { + "smithy.api#box": {} + } + }, + "com.amazonaws.dynamodb#CancellationReason": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.dynamodb#ErrorMessage", + "traits": { + "smithy.api#documentation": "

Cancellation reason message description.

" + } + }, + "Item": { + "target": "com.amazonaws.dynamodb#AttributeMap", + "traits": { + "smithy.api#documentation": "

Item in the request which caused the transaction to get cancelled.

" + } + }, + "Code": { + "target": "com.amazonaws.dynamodb#Code", + "traits": { + "smithy.api#documentation": "

Status code for the result of the cancelled transaction.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

An ordered list of errors for each item in the request which caused the transaction\n to get cancelled. The values of the list are ordered according to the ordering of the\n TransactWriteItems request parameter. If no error\n occurred for the associated item an error with a Null code and Null message will be present.\n

" + } + }, + "com.amazonaws.dynamodb#CancellationReasonList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#CancellationReason" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 25 + } + } + }, + "com.amazonaws.dynamodb#Capacity": { + "type": "structure", + "members": { + "ReadCapacityUnits": { + "target": "com.amazonaws.dynamodb#ConsumedCapacityUnits", + "traits": { + "smithy.api#documentation": "

The total number of read capacity units consumed on a table or an index.

" + } + }, + "CapacityUnits": { + "target": "com.amazonaws.dynamodb#ConsumedCapacityUnits", + "traits": { + "smithy.api#documentation": "

The total number of capacity units consumed on a table or an index.

" + } + }, + "WriteCapacityUnits": { + "target": "com.amazonaws.dynamodb#ConsumedCapacityUnits", + "traits": { + "smithy.api#documentation": "

The total number of write capacity units consumed on a table or an index.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the amount of provisioned throughput capacity consumed on a table or an index.

" + } + }, + "com.amazonaws.dynamodb#ClientRequestToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 36 + } + } + }, + "com.amazonaws.dynamodb#Code": { + "type": "string" + }, + "com.amazonaws.dynamodb#ComparisonOperator": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "EQ" + }, + { + "value": "NE" + }, + { + "value": "IN" + }, + { + "value": "LE" + }, + { + "value": "LT" + }, + { + "value": "GE" + }, + { + "value": "GT" + }, + { + "value": "BETWEEN" + }, + { + "value": "NOT_NULL" + }, + { + "value": "NULL" + }, + { + "value": "CONTAINS" + }, + { + "value": "NOT_CONTAINS" + }, + { + "value": "BEGINS_WITH" + } + ] + } + }, + "com.amazonaws.dynamodb#Condition": { + "type": "structure", + "members": { + "ComparisonOperator": { + "target": "com.amazonaws.dynamodb#ComparisonOperator", + "traits": { + "smithy.api#documentation": "

A comparator for evaluating attributes. For example, equals, greater than, less than, etc.

\n

The following comparison operators are available:

\n

\n EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN\n

\n

The following are descriptions of each comparison operator.

\n
    \n
  • \n

    \n EQ : Equal. EQ is supported for all data types, including lists and maps.

    \n

    \n AttributeValueList can contain only one AttributeValue element of type String,\n Number, Binary, String Set, Number Set, or Binary Set. If an item contains an AttributeValue element of a different\n type than the one provided in the request, the value does not match. For example,\n {\"S\":\"6\"} does not equal {\"N\":\"6\"}. Also,\n {\"N\":\"6\"} does not equal {\"NS\":[\"6\", \"2\", \"1\"]}.

    \n

    \n
  • \n
  • \n

    \n NE : Not equal. NE is supported for all data types, including lists and maps.

    \n

    \n AttributeValueList can contain only one AttributeValue of type String,\n Number, Binary, String Set, Number Set, or Binary Set. If an item contains an AttributeValue of a different\n type than the one provided in the request, the value does not match. For example,\n {\"S\":\"6\"} does not equal {\"N\":\"6\"}. Also,\n {\"N\":\"6\"} does not equal {\"NS\":[\"6\", \"2\", \"1\"]}.

    \n

    \n
  • \n
  • \n

    \n LE : Less than or equal.

    \n

    \n AttributeValueList can contain only one AttributeValue element of type String,\n Number, or Binary (not a set type). If an item contains an AttributeValue element of a different\n type than the one provided in the request, the value does not match. For example,\n {\"S\":\"6\"} does not equal {\"N\":\"6\"}. Also,\n {\"N\":\"6\"} does not compare to {\"NS\":[\"6\", \"2\", \"1\"]}.

    \n

    \n
  • \n
  • \n

    \n LT : Less than.

    \n

    \n AttributeValueList can contain only one AttributeValue of type String,\n Number, or Binary (not a set type). If an item contains an AttributeValue element of a different\n type than the one provided in the request, the value does not match. For example,\n {\"S\":\"6\"} does not equal {\"N\":\"6\"}. Also,\n {\"N\":\"6\"} does not compare to {\"NS\":[\"6\", \"2\", \"1\"]}.

    \n

    \n
  • \n
  • \n

    \n GE : Greater than or equal.

    \n

    \n AttributeValueList can contain only one AttributeValue element of type String,\n Number, or Binary (not a set type). If an item contains an AttributeValue element of a different\n type than the one provided in the request, the value does not match. For example,\n {\"S\":\"6\"} does not equal {\"N\":\"6\"}. Also,\n {\"N\":\"6\"} does not compare to {\"NS\":[\"6\", \"2\", \"1\"]}.

    \n

    \n
  • \n
  • \n

    \n GT : Greater than.

    \n

    \n AttributeValueList can contain only one AttributeValue element of type String,\n Number, or Binary (not a set type). If an item contains an AttributeValue element of a different\n type than the one provided in the request, the value does not match. For example,\n {\"S\":\"6\"} does not equal {\"N\":\"6\"}. Also,\n {\"N\":\"6\"} does not compare to {\"NS\":[\"6\", \"2\", \"1\"]}.

    \n

    \n
  • \n
  • \n

    \n NOT_NULL : The attribute exists. NOT_NULL is supported for all data types, including lists and maps.

    \n \n

    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.

    \n
    \n
  • \n
  • \n

    \n NULL : The attribute does not exist. NULL is supported for all data types, including lists and maps.

    \n \n

    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.

    \n
    \n
  • \n
  • \n

    \n CONTAINS : Checks for a subsequence, or value in a set.

    \n

    \n AttributeValueList can contain only one AttributeValue element of type String,\n Number, or Binary (not a set type). If the target attribute of the comparison is of type String, then\n the operator checks for a substring match. If the target attribute of the comparison is\n of type Binary, then the operator looks for a subsequence of the target that matches the input.\n If the target attribute of the comparison is a set (\"SS\", \"NS\", or \"BS\"), then the\n operator evaluates to true if it finds an exact match with any member of the set.

    \n

    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.

    \n
  • \n
  • \n

    \n NOT_CONTAINS : Checks for absence of a subsequence, or absence of a value in\n a set.

    \n

    \n AttributeValueList can contain only one AttributeValue element of type String,\n Number, or Binary (not a set type). If the target attribute of the comparison is a String, then\n the operator checks for the absence of a substring match. If the target attribute of the\n comparison is Binary, then the operator checks for the absence of a subsequence of the\n target that matches the input. If the target attribute of the comparison is a set (\"SS\",\n \"NS\", or \"BS\"), then the operator evaluates to true if it does not find an exact match with any member of the set.

    \n

    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.

    \n
  • \n
  • \n

    \n BEGINS_WITH : Checks for a prefix.

    \n

    \n AttributeValueList can contain only one AttributeValue of type String or\n Binary (not a Number or a set type). The target attribute of the comparison must be of type String or\n Binary (not a Number or a set type).

    \n

    \n
  • \n
  • \n

    \n IN : Checks for matching elements in a list.

    \n

    \n AttributeValueList can contain one or more AttributeValue\n elements of type String, Number, or Binary. These attributes are compared against an\n existing attribute of an item. If any elements of the input are equal to the item\n attribute, the expression evaluates to true.

    \n
  • \n
  • \n

    \n BETWEEN : Greater than or equal to the first value, and less than or equal\n to the second value.

    \n

    \n AttributeValueList must contain two AttributeValue elements of the same\n type, either String, Number, or Binary (not a set type). A target attribute matches if the\n target value is greater than, or equal to, the first element and less than, or equal to,\n the second element. If an item contains an AttributeValue element of a different type than\n the one provided in the request, the value does not match. For example,\n {\"S\":\"6\"} does not compare to {\"N\":\"6\"}. Also,\n {\"N\":\"6\"} does not compare to {\"NS\":[\"6\", \"2\", \"1\"]}\n

    \n
  • \n
\n

For usage examples of AttributeValueList and ComparisonOperator, see\n Legacy Conditional Parameters\n in the Amazon DynamoDB Developer Guide.

", + "smithy.api#required": {} + } + }, + "AttributeValueList": { + "target": "com.amazonaws.dynamodb#AttributeValueList", + "traits": { + "smithy.api#documentation": "

One or more values to evaluate against the supplied attribute. The number of values in the\n list depends on the ComparisonOperator being used.

\n

For type Number, value comparisons are numeric.

\n

String value comparisons for greater than, equals, or less than are based on ASCII character\n code values. For example, a is greater than A, and a\n is greater than B. For a list of code values, see http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters.

\n

For Binary, DynamoDB treats each byte of the binary data as unsigned when it compares binary values.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the selection criteria for a Query or Scan operation:

\n
    \n
  • \n

    For a Query operation, Condition is used for specifying the\n KeyConditions to use when querying a table or an index. For KeyConditions,\n only the following comparison operators are supported:

    \n

    \n EQ | LE | LT | GE | GT | BEGINS_WITH | BETWEEN\n

    \n

    \n Condition is also used in a QueryFilter, which evaluates the query results\n and returns only the desired values.

    \n
  • \n
  • \n

    For a Scan operation, Condition is used in a ScanFilter, which\n evaluates the scan results and returns only the desired values.

    \n
  • \n
" + } + }, + "com.amazonaws.dynamodb#ConditionCheck": { + "type": "structure", + "members": { + "Key": { + "target": "com.amazonaws.dynamodb#Key", + "traits": { + "smithy.api#documentation": "

The primary key of the item to be checked. Each element consists of an\n attribute name and a value for that attribute.

", + "smithy.api#required": {} + } + }, + "ConditionExpression": { + "target": "com.amazonaws.dynamodb#ConditionExpression", + "traits": { + "smithy.api#documentation": "

A condition that must be satisfied in order for a conditional update to succeed.

", + "smithy.api#required": {} + } + }, + "ExpressionAttributeValues": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeValueMap", + "traits": { + "smithy.api#documentation": "

One or more values that can be substituted in an expression.

" + } + }, + "ReturnValuesOnConditionCheckFailure": { + "target": "com.amazonaws.dynamodb#ReturnValuesOnConditionCheckFailure", + "traits": { + "smithy.api#documentation": "

Use ReturnValuesOnConditionCheckFailure to\n get the item attributes if the ConditionCheck condition fails.\n For ReturnValuesOnConditionCheckFailure, the valid\n values are: NONE and ALL_OLD.

" + } + }, + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

Name of the table for the check item request.

", + "smithy.api#required": {} + } + }, + "ExpressionAttributeNames": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeNameMap", + "traits": { + "smithy.api#documentation": "

One or more substitution tokens for attribute names in an expression.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a request to perform a check that an item exists or to check the condition of\n specific attributes of the item.

" + } + }, + "com.amazonaws.dynamodb#ConditionExpression": { + "type": "string" + }, + "com.amazonaws.dynamodb#ConditionalCheckFailedException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage", + "traits": { + "smithy.api#documentation": "

The conditional request failed.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

A condition specified in the operation could not be evaluated.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#ConditionalOperator": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "AND" + }, + { + "value": "OR" + } + ] + } + }, + "com.amazonaws.dynamodb#ConsistentRead": { + "type": "boolean", + "traits": { + "smithy.api#box": {} + } + }, + "com.amazonaws.dynamodb#ConsumedCapacity": { + "type": "structure", + "members": { + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table that was affected by the operation.

" + } + }, + "CapacityUnits": { + "target": "com.amazonaws.dynamodb#ConsumedCapacityUnits", + "traits": { + "smithy.api#documentation": "

The total number of capacity units consumed by the operation.

" + } + }, + "LocalSecondaryIndexes": { + "target": "com.amazonaws.dynamodb#SecondaryIndexesCapacityMap", + "traits": { + "smithy.api#documentation": "

The amount of throughput consumed on each local index affected by the operation.

" + } + }, + "GlobalSecondaryIndexes": { + "target": "com.amazonaws.dynamodb#SecondaryIndexesCapacityMap", + "traits": { + "smithy.api#documentation": "

The amount of throughput consumed on each global index affected by the operation.

" + } + }, + "ReadCapacityUnits": { + "target": "com.amazonaws.dynamodb#ConsumedCapacityUnits", + "traits": { + "smithy.api#documentation": "

The total number of read capacity units consumed by the operation.

" + } + }, + "WriteCapacityUnits": { + "target": "com.amazonaws.dynamodb#ConsumedCapacityUnits", + "traits": { + "smithy.api#documentation": "

The total number of write capacity units consumed by the operation.

" + } + }, + "Table": { + "target": "com.amazonaws.dynamodb#Capacity", + "traits": { + "smithy.api#documentation": "

The amount of throughput consumed on the table affected by the operation.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The capacity units consumed by an operation. The data returned includes the total\n provisioned throughput consumed, along with statistics for the table and any indexes involved\n in the operation. ConsumedCapacity is only returned if the request asked for it.\n For more information, see Provisioned\n Throughput in the Amazon DynamoDB Developer Guide.

" + } + }, + "com.amazonaws.dynamodb#ConsumedCapacityMultiple": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#ConsumedCapacity" + } + }, + "com.amazonaws.dynamodb#ConsumedCapacityUnits": { + "type": "double", + "traits": { + "smithy.api#box": {} + } + }, + "com.amazonaws.dynamodb#ContinuousBackupsDescription": { + "type": "structure", + "members": { + "PointInTimeRecoveryDescription": { + "target": "com.amazonaws.dynamodb#PointInTimeRecoveryDescription", + "traits": { + "smithy.api#documentation": "

The description of the point in time recovery settings applied to the table.

" + } + }, + "ContinuousBackupsStatus": { + "target": "com.amazonaws.dynamodb#ContinuousBackupsStatus", + "traits": { + "smithy.api#documentation": "

\n ContinuousBackupsStatus can be one of the following states: ENABLED,\n DISABLED

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the continuous backups and point in time recovery settings on the table.

" + } + }, + "com.amazonaws.dynamodb#ContinuousBackupsStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "ENABLED" + }, + { + "value": "DISABLED" + } + ] + } + }, + "com.amazonaws.dynamodb#ContinuousBackupsUnavailableException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

Backups have not yet been enabled for this table.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#ContributorInsightsAction": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "ENABLE" + }, + { + "value": "DISABLE" + } + ] + } + }, + "com.amazonaws.dynamodb#ContributorInsightsRule": { + "type": "string", + "traits": { + "smithy.api#pattern": "[A-Za-z0-9][A-Za-z0-9\\-\\_\\.]{0,126}[A-Za-z0-9]" + } + }, + "com.amazonaws.dynamodb#ContributorInsightsRuleList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#ContributorInsightsRule" + } + }, + "com.amazonaws.dynamodb#ContributorInsightsStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "ENABLING" + }, + { + "value": "ENABLED" + }, + { + "value": "DISABLING" + }, + { + "value": "DISABLED" + }, + { + "value": "FAILED" + } + ] + } + }, + "com.amazonaws.dynamodb#ContributorInsightsSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#ContributorInsightsSummary" + } + }, + "com.amazonaws.dynamodb#ContributorInsightsSummary": { + "type": "structure", + "members": { + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

Name of the table associated with the summary.

" + } + }, + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

Name of the index associated with the summary, if any.

" + } + }, + "ContributorInsightsStatus": { + "target": "com.amazonaws.dynamodb#ContributorInsightsStatus", + "traits": { + "smithy.api#documentation": "

Describes the current status for contributor insights for the given table and index, if applicable.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a Contributor Insights summary entry..

" + } + }, + "com.amazonaws.dynamodb#CreateBackup": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#CreateBackupInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#CreateBackupOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#BackupInUseException" + }, + { + "target": "com.amazonaws.dynamodb#ContinuousBackupsUnavailableException" + }, + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#LimitExceededException" + }, + { + "target": "com.amazonaws.dynamodb#TableInUseException" + }, + { + "target": "com.amazonaws.dynamodb#TableNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates a backup for an existing table.

\n

Each time you create an on-demand backup, the entire table data is backed up. There\n is no limit to the number of on-demand backups that can be taken.

\n

When you create an on-demand backup, a time marker of the request is cataloged, and\n the backup is created asynchronously, by applying all changes until the time of the\n request to the last full table snapshot. Backup requests are processed instantaneously\n and become available for restore within minutes.

\n

You can call CreateBackup at a maximum rate of 50 times per second.

\n

All backups in DynamoDB work without consuming any provisioned throughput on the table.

\n

If you submit a backup request on 2018-12-14 at 14:25:00, the backup is guaranteed\n to contain all data committed to the table up to 14:24:00, and data committed after\n 14:26:00 will not be. The backup might contain data modifications made between 14:24:00\n and 14:26:00. On-demand backup does not support causal consistency.

\n

\n Along with data, the following are also included on the backups:\n

\n
    \n
  • \n

    Global secondary indexes (GSIs)

    \n
  • \n
  • \n

    Local secondary indexes (LSIs)

    \n
  • \n
  • \n

    Streams

    \n
  • \n
  • \n

    Provisioned read and write capacity

    \n
  • \n
" + } + }, + "com.amazonaws.dynamodb#CreateBackupInput": { + "type": "structure", + "members": { + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table.

", + "smithy.api#required": {} + } + }, + "BackupName": { + "target": "com.amazonaws.dynamodb#BackupName", + "traits": { + "smithy.api#documentation": "

Specified name for the backup.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.dynamodb#CreateBackupOutput": { + "type": "structure", + "members": { + "BackupDetails": { + "target": "com.amazonaws.dynamodb#BackupDetails", + "traits": { + "smithy.api#documentation": "

Contains the details of the backup created for the table.

" + } + } + } + }, + "com.amazonaws.dynamodb#CreateGlobalSecondaryIndexAction": { + "type": "structure", + "members": { + "ProvisionedThroughput": { + "target": "com.amazonaws.dynamodb#ProvisionedThroughput", + "traits": { + "smithy.api#documentation": "

Represents the provisioned throughput settings for the specified global secondary index.

\n

For current minimum and maximum provisioned throughput values, see Service, Account, and Table Quotas in the Amazon DynamoDB Developer Guide.

" + } + }, + "Projection": { + "target": "com.amazonaws.dynamodb#Projection", + "traits": { + "smithy.api#documentation": "

Represents attributes that are copied (projected) from the table into an index. These\n are in addition to the primary key attributes and index key attributes, which are\n automatically projected.

", + "smithy.api#required": {} + } + }, + "KeySchema": { + "target": "com.amazonaws.dynamodb#KeySchema", + "traits": { + "smithy.api#documentation": "

The key schema for the global secondary index.

", + "smithy.api#required": {} + } + }, + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of the global secondary index to be created.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a new global secondary index to be added to an existing table.

" + } + }, + "com.amazonaws.dynamodb#CreateGlobalTable": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#CreateGlobalTableInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#CreateGlobalTableOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#GlobalTableAlreadyExistsException" + }, + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#LimitExceededException" + }, + { + "target": "com.amazonaws.dynamodb#TableNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates a global table from an existing table. A global table creates a replication\n relationship between two or more DynamoDB tables with the same table name in the\n provided Regions.

\n \n

This operation only applies to Version 2017.11.29 of global tables.

\n
\n\n

If you want to add a new replica table to a global table, each of the following conditions\n must be true:

\n
    \n
  • \n

    The table must have the same primary key as all of the other replicas.

    \n
  • \n
  • \n

    The table must have the same name as all of the other replicas.

    \n
  • \n
  • \n

    The table must have DynamoDB Streams enabled, with the stream containing both the new and the old\n images of the item.

    \n
  • \n
  • \n

    None of the replica tables in the global table can contain any data.

    \n
  • \n
\n

\n If global secondary indexes are specified, then the following conditions must also be met:\n

\n
    \n
  • \n

    \n The global secondary indexes must have the same name.\n

    \n
  • \n
  • \n

    \n The global secondary indexes must have the same hash key and sort key (if present).\n

    \n
  • \n
\n

\n If local secondary indexes are specified, then the following conditions must also be met:\n

\n
    \n
  • \n

    \n The local secondary indexes must have the same name.\n

    \n
  • \n
  • \n

    \n The local secondary indexes must have the same hash key and sort key (if present).\n

    \n
  • \n
\n\n \n

\n Write capacity settings should be set consistently across your replica tables and\n secondary indexes. DynamoDB strongly recommends enabling auto scaling to manage the write\n capacity settings for all of your global tables replicas and indexes.\n

\n

\n If you prefer to manage write capacity settings manually, you should provision equal\n replicated write capacity units to your replica tables. You should also provision\n equal replicated write capacity units to matching secondary indexes across\n your global table.\n

\n
" + } + }, + "com.amazonaws.dynamodb#CreateGlobalTableInput": { + "type": "structure", + "members": { + "GlobalTableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The global table name.

", + "smithy.api#required": {} + } + }, + "ReplicationGroup": { + "target": "com.amazonaws.dynamodb#ReplicaList", + "traits": { + "smithy.api#documentation": "

The Regions where the global table needs to be created.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.dynamodb#CreateGlobalTableOutput": { + "type": "structure", + "members": { + "GlobalTableDescription": { + "target": "com.amazonaws.dynamodb#GlobalTableDescription", + "traits": { + "smithy.api#documentation": "

Contains the details of the global table.

" + } + } + } + }, + "com.amazonaws.dynamodb#CreateReplicaAction": { + "type": "structure", + "members": { + "RegionName": { + "target": "com.amazonaws.dynamodb#RegionName", + "traits": { + "smithy.api#documentation": "

The Region of the replica to be added.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a replica to be added.

" + } + }, + "com.amazonaws.dynamodb#CreateReplicationGroupMemberAction": { + "type": "structure", + "members": { + "RegionName": { + "target": "com.amazonaws.dynamodb#RegionName", + "traits": { + "smithy.api#documentation": "

The Region where the new replica will be created.

", + "smithy.api#required": {} + } + }, + "KMSMasterKeyId": { + "target": "com.amazonaws.dynamodb#KMSMasterKeyId", + "traits": { + "smithy.api#documentation": "

The AWS KMS customer master key (CMK) that should be used for AWS KMS encryption\n in the new replica. To specify a CMK, use its key ID, Amazon Resource Name (ARN),\n alias name, or alias ARN. Note that you should only provide this parameter if the\n key is different from the default DynamoDB KMS master key alias/aws/dynamodb.

" + } + }, + "GlobalSecondaryIndexes": { + "target": "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexList", + "traits": { + "smithy.api#documentation": "

Replica-specific global secondary index settings.

" + } + }, + "ProvisionedThroughputOverride": { + "target": "com.amazonaws.dynamodb#ProvisionedThroughputOverride", + "traits": { + "smithy.api#documentation": "

Replica-specific provisioned throughput. If not specified, uses the source table's\n provisioned throughput settings.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a replica to be created.

" + } + }, + "com.amazonaws.dynamodb#CreateTable": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#CreateTableInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#CreateTableOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#LimitExceededException" + }, + { + "target": "com.amazonaws.dynamodb#ResourceInUseException" + } + ], + "traits": { + "smithy.api#documentation": "

The CreateTable operation adds a new table to your account. In an AWS\n account, table names must be unique within each Region. That is, you can have two tables\n with same name if you create the tables in different Regions.

\n

\n CreateTable is an asynchronous operation. Upon receiving a CreateTable request,\n DynamoDB immediately returns a response with a TableStatus of CREATING. After\n the table is created, DynamoDB sets the TableStatus to ACTIVE. You can\n perform read and write operations only on an ACTIVE table.

\n

You can optionally define secondary indexes on the new table, as part of the CreateTable\n operation. If you want to create multiple tables with secondary indexes on them, you must create the\n tables sequentially. Only one table with secondary indexes can be in the CREATING state at\n any given time.

\n

You can use the DescribeTable action to check the table status.

" + } + }, + "com.amazonaws.dynamodb#CreateTableInput": { + "type": "structure", + "members": { + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table to create.

", + "smithy.api#required": {} + } + }, + "SSESpecification": { + "target": "com.amazonaws.dynamodb#SSESpecification", + "traits": { + "smithy.api#documentation": "

Represents the settings used to enable server-side encryption.

" + } + }, + "AttributeDefinitions": { + "target": "com.amazonaws.dynamodb#AttributeDefinitions", + "traits": { + "smithy.api#documentation": "

An array of attributes that describe the key schema for the table and indexes.

", + "smithy.api#required": {} + } + }, + "KeySchema": { + "target": "com.amazonaws.dynamodb#KeySchema", + "traits": { + "smithy.api#documentation": "

Specifies the attributes that make up the primary key for a table or an index. The attributes\n in KeySchema must also be defined in the AttributeDefinitions array. For more\n information, see Data Model in the\n Amazon DynamoDB Developer Guide.

\n

Each KeySchemaElement in the array is composed of:

\n
    \n
  • \n

    \n AttributeName - The name of this key attribute.

    \n
  • \n
  • \n

    \n KeyType - The role that the key attribute will assume:

    \n
      \n
    • \n

      \n HASH - partition key

      \n
    • \n
    • \n

      \n RANGE - sort key

      \n
    • \n
    \n
  • \n
\n \n

The partition key of an item is also known as its hash\n attribute. The term \"hash attribute\" derives from the DynamoDB usage of\n an internal hash function to evenly distribute data items across partitions, based\n on their partition key values.

\n

The sort key of an item is also known as its range attribute.\n The term \"range attribute\" derives from the way DynamoDB stores items with the same\n partition key physically close together, in sorted order by the sort key value.

\n
\n\n

For a simple primary key (partition key), you must provide\n exactly one element with a KeyType of HASH.

\n

For a composite primary key (partition key and sort key), you must provide exactly two\n elements, in this order: The first element must have a KeyType of HASH,\n and the second element must have a KeyType of RANGE.

\n

For more information, see Working with Tables in the Amazon DynamoDB Developer\n Guide.

", + "smithy.api#required": {} + } + }, + "GlobalSecondaryIndexes": { + "target": "com.amazonaws.dynamodb#GlobalSecondaryIndexList", + "traits": { + "smithy.api#documentation": "

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:

\n
    \n
  • \n

    \n IndexName - The name of the global secondary index. Must be unique only for this table.

    \n

    \n
  • \n
  • \n

    \n KeySchema - Specifies the key schema for the global secondary index.

    \n
  • \n
  • \n

    \n Projection - Specifies\n attributes that are copied (projected) from the table into the index. These are in\n addition to the primary key attributes and index key\n attributes, which are automatically projected. Each\n attribute specification is composed of:

    \n
      \n
    • \n

      \n ProjectionType - One\n of the following:

      \n
        \n
      • \n

        \n KEYS_ONLY - Only the index and primary keys are projected into the\n index.

        \n
      • \n
      • \n

        \n INCLUDE - Only the specified table attributes are\n projected into the index. The list of projected attributes is in\n NonKeyAttributes.

        \n
      • \n
      • \n

        \n ALL - All of the table attributes are projected into the\n index.

        \n
      • \n
      \n
    • \n
    • \n

      \n NonKeyAttributes - A list of one or more non-key attribute names that are\n 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.

      \n
    • \n
    \n
  • \n
  • \n

    \n ProvisionedThroughput - The provisioned throughput settings for the global secondary index,\n consisting of read and write capacity units.

    \n
  • \n
" + } + }, + "StreamSpecification": { + "target": "com.amazonaws.dynamodb#StreamSpecification", + "traits": { + "smithy.api#documentation": "

The settings for DynamoDB Streams on the table. These settings consist of:

\n
    \n
  • \n

    \n StreamEnabled - Indicates whether DynamoDB Streams is to be enabled\n (true) or disabled (false).

    \n
  • \n
  • \n

    \n StreamViewType - When an item in the table is modified, StreamViewType\n determines what information is written to the table's stream. Valid values for\n StreamViewType are:

    \n
      \n
    • \n

      \n KEYS_ONLY - Only the key attributes of the modified item are written to the\n stream.

      \n
    • \n
    • \n

      \n NEW_IMAGE - The entire item, as it appears after it was modified, is written\n to the stream.

      \n
    • \n
    • \n

      \n OLD_IMAGE - The entire item, as it appeared before it was modified, is\n written to the stream.

      \n
    • \n
    • \n

      \n NEW_AND_OLD_IMAGES - Both the new and the old item images of the item are\n written to the stream.

      \n
    • \n
    \n
  • \n
" + } + }, + "ProvisionedThroughput": { + "target": "com.amazonaws.dynamodb#ProvisionedThroughput", + "traits": { + "smithy.api#documentation": "

Represents the provisioned throughput settings for a specified table or index. The\n settings can be modified using the UpdateTable operation.

\n\t\t

If you set BillingMode as PROVISIONED, you must specify this property. If you\n set BillingMode as PAY_PER_REQUEST, you cannot specify this\n property.

\n

For current minimum and maximum provisioned throughput values, see Service,\n Account, and Table Quotas in the Amazon DynamoDB Developer\n Guide.

" + } + }, + "BillingMode": { + "target": "com.amazonaws.dynamodb#BillingMode", + "traits": { + "smithy.api#documentation": "

Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.

\n
    \n
  • \n

    \n PROVISIONED - We recommend using PROVISIONED for predictable workloads. PROVISIONED sets the billing mode to Provisioned Mode.

    \n
  • \n
  • \n

    \n PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable workloads. PAY_PER_REQUEST sets the billing mode to On-Demand Mode.\n

    \n
  • \n
" + } + }, + "LocalSecondaryIndexes": { + "target": "com.amazonaws.dynamodb#LocalSecondaryIndexList", + "traits": { + "smithy.api#documentation": "

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.

\n

Each local secondary index in the array includes the following:

\n
    \n
  • \n

    \n IndexName - The name of the local secondary index. Must be unique only for this table.

    \n

    \n
  • \n
  • \n

    \n KeySchema - Specifies the key schema for the local secondary index. The key schema must begin with\n the same partition key as the table.

    \n
  • \n
  • \n

    \n Projection - Specifies\n attributes that are copied (projected) from the table into the index. These are in\n addition to the primary key attributes and index key\n attributes, which are automatically projected. Each\n attribute specification is composed of:

    \n
      \n
    • \n

      \n ProjectionType - One\n of the following:

      \n
        \n
      • \n

        \n KEYS_ONLY - Only the index and primary keys are projected into the\n index.

        \n
      • \n
      • \n

        \n INCLUDE - Only the specified table attributes are\n projected into the index. The list of projected attributes is in\n NonKeyAttributes.

        \n
      • \n
      • \n

        \n ALL - All of the table attributes are projected into the\n index.

        \n
      • \n
      \n
    • \n
    • \n

      \n NonKeyAttributes - A list of one or more non-key\n attribute names that are projected into the secondary index. The total\n count of attributes provided in NonKeyAttributes,\n summed across all of the secondary indexes, must not exceed 100. If you\n project the same attribute into two different indexes, this counts as\n two distinct attributes when determining the total.

      \n
    • \n
    \n
  • \n
" + } + }, + "Tags": { + "target": "com.amazonaws.dynamodb#TagList", + "traits": { + "smithy.api#documentation": "

A list of key-value pairs to label the table. For more information, see Tagging for DynamoDB.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the input of a CreateTable operation.

" + } + }, + "com.amazonaws.dynamodb#CreateTableOutput": { + "type": "structure", + "members": { + "TableDescription": { + "target": "com.amazonaws.dynamodb#TableDescription", + "traits": { + "smithy.api#documentation": "

Represents the properties of the table.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the output of a CreateTable operation.

" + } + }, + "com.amazonaws.dynamodb#Date": { + "type": "timestamp" + }, + "com.amazonaws.dynamodb#Delete": { + "type": "structure", + "members": { + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

Name of the table in which the item to be deleted resides.

", + "smithy.api#required": {} + } + }, + "ConditionExpression": { + "target": "com.amazonaws.dynamodb#ConditionExpression", + "traits": { + "smithy.api#documentation": "

A condition that must be satisfied in order for a conditional delete to succeed.

" + } + }, + "Key": { + "target": "com.amazonaws.dynamodb#Key", + "traits": { + "smithy.api#documentation": "

The primary key of the item to be deleted. Each element consists of an\n attribute name and a value for that attribute.

", + "smithy.api#required": {} + } + }, + "ExpressionAttributeValues": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeValueMap", + "traits": { + "smithy.api#documentation": "

One or more values that can be substituted in an expression.

" + } + }, + "ExpressionAttributeNames": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeNameMap", + "traits": { + "smithy.api#documentation": "

One or more substitution tokens for attribute names in an expression.

" + } + }, + "ReturnValuesOnConditionCheckFailure": { + "target": "com.amazonaws.dynamodb#ReturnValuesOnConditionCheckFailure", + "traits": { + "smithy.api#documentation": "

Use ReturnValuesOnConditionCheckFailure to\n get the item attributes if the Delete condition fails.\n For ReturnValuesOnConditionCheckFailure, the valid\n values are: NONE and ALL_OLD.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a request to perform a DeleteItem operation.

" + } + }, + "com.amazonaws.dynamodb#DeleteBackup": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#DeleteBackupInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#DeleteBackupOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#BackupInUseException" + }, + { + "target": "com.amazonaws.dynamodb#BackupNotFoundException" + }, + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#LimitExceededException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes an existing backup of a table.

\n

You can call DeleteBackup at a maximum rate of 10 times per second.

" + } + }, + "com.amazonaws.dynamodb#DeleteBackupInput": { + "type": "structure", + "members": { + "BackupArn": { + "target": "com.amazonaws.dynamodb#BackupArn", + "traits": { + "smithy.api#documentation": "

The ARN associated with the backup.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.dynamodb#DeleteBackupOutput": { + "type": "structure", + "members": { + "BackupDescription": { + "target": "com.amazonaws.dynamodb#BackupDescription", + "traits": { + "smithy.api#documentation": "

Contains the description of the backup created for the table.

" + } + } + } + }, + "com.amazonaws.dynamodb#DeleteGlobalSecondaryIndexAction": { + "type": "structure", + "members": { + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of the global secondary index to be deleted.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a global secondary index to be deleted from an existing table.

" + } + }, + "com.amazonaws.dynamodb#DeleteItem": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#DeleteItemInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#DeleteItemOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#ConditionalCheckFailedException" + }, + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException" + }, + { + "target": "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" + }, + { + "target": "com.amazonaws.dynamodb#RequestLimitExceeded" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.dynamodb#TransactionConflictException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes a single item in a table by primary key. You can perform a conditional delete operation that deletes the item if it exists, or if it has an expected attribute value.

\n

In addition to deleting an item, you can also return the item's attribute values in the same\n operation, using the ReturnValues parameter.

\n

Unless you specify conditions, the DeleteItem is an idempotent operation; running it\n multiple times on the same item or attribute does not result in an error response.

\n

Conditional deletes are useful for deleting items only if specific conditions are met. If those conditions are met, DynamoDB performs the delete. Otherwise, the item is not deleted.

" + } + }, + "com.amazonaws.dynamodb#DeleteItemInput": { + "type": "structure", + "members": { + "Expected": { + "target": "com.amazonaws.dynamodb#ExpectedAttributeMap", + "traits": { + "smithy.api#documentation": "

This is a legacy parameter. Use ConditionExpression instead. For more information, see\n Expected in the Amazon DynamoDB Developer Guide.

" + } + }, + "ReturnConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ReturnConsumedCapacity" + }, + "ConditionalOperator": { + "target": "com.amazonaws.dynamodb#ConditionalOperator", + "traits": { + "smithy.api#documentation": "

This is a legacy parameter. Use ConditionExpression instead. For more information, see\n ConditionalOperator in the Amazon DynamoDB Developer Guide.

" + } + }, + "Key": { + "target": "com.amazonaws.dynamodb#Key", + "traits": { + "smithy.api#documentation": "

A map of attribute names to AttributeValue objects, representing the primary key of\n the item to delete.

\n

For the primary key, you must provide all of the 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.

", + "smithy.api#required": {} + } + }, + "ExpressionAttributeValues": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeValueMap", + "traits": { + "smithy.api#documentation": "

One or more values that can be substituted in an expression.

\n

Use the : (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the ProductStatus attribute was one of the following:

\n

\n Available | Backordered | Discontinued\n

\n

You would first need to specify ExpressionAttributeValues as follows:

\n

\n { \":avail\":{\"S\":\"Available\"}, \":back\":{\"S\":\"Backordered\"}, \":disc\":{\"S\":\"Discontinued\"} }\n

\n

You could then use these values in an expression, such as this:

\n

\n ProductStatus IN (:avail, :back, :disc)\n

\n

For more information on expression attribute values, see Condition Expressions in the Amazon DynamoDB Developer\n Guide.

" + } + }, + "ConditionExpression": { + "target": "com.amazonaws.dynamodb#ConditionExpression", + "traits": { + "smithy.api#documentation": "

A condition that must be satisfied in order for a conditional DeleteItem to\n succeed.

\n

An expression can contain any of the following:

\n
    \n
  • \n

    Functions: attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size\n

    \n

    These function names are case-sensitive.

    \n
  • \n
  • \n

    Comparison operators: = | <> |\n < | > | <= | >= |\n BETWEEN | IN \n

    \n
  • \n
  • \n

    Logical operators: AND | OR | NOT\n

    \n
  • \n
\n

For more information about condition expressions, see Condition Expressions in the Amazon DynamoDB Developer\n Guide.

" + } + }, + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table from which to delete the item.

", + "smithy.api#required": {} + } + }, + "ExpressionAttributeNames": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeNameMap", + "traits": { + "smithy.api#documentation": "

One or more substitution tokens for attribute names in an expression. The following are some use cases for using ExpressionAttributeNames:

\n
    \n
  • \n

    To access an attribute whose name conflicts with a DynamoDB reserved word.

    \n
  • \n
  • \n

    To create a placeholder for repeating occurrences of an attribute name in an expression.

    \n
  • \n
  • \n

    To prevent special characters in an attribute name from being misinterpreted in an expression.

    \n
  • \n
\n

Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:

\n
    \n
  • \n

    \n Percentile\n

    \n
  • \n
\n

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:

\n
    \n
  • \n

    \n {\"#P\":\"Percentile\"}\n

    \n
  • \n
\n

You could then use this substitution in an expression, as in this example:

\n
    \n
  • \n

    \n #P = :val\n

    \n
  • \n
\n \n

Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.

\n
\n

For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer\n Guide.

" + } + }, + "ReturnItemCollectionMetrics": { + "target": "com.amazonaws.dynamodb#ReturnItemCollectionMetrics", + "traits": { + "smithy.api#documentation": "

Determines whether item collection metrics are returned. If set to SIZE, the response includes statistics about item collections, if any, that were modified during\n the operation are returned in the response. If set to NONE (the default), no statistics are returned.

" + } + }, + "ReturnValues": { + "target": "com.amazonaws.dynamodb#ReturnValue", + "traits": { + "smithy.api#documentation": "

Use ReturnValues if you want to get the item attributes as they appeared before they\n were deleted. For DeleteItem, the valid values are:

\n
    \n
  • \n

    \n NONE - If ReturnValues is not specified, or if its value is\n NONE, then nothing is returned. (This setting is the default for\n ReturnValues.)

    \n
  • \n
  • \n

    \n ALL_OLD - The content of the old item is returned.

    \n
  • \n
\n \n

The ReturnValues parameter is used by several DynamoDB operations; however,\n DeleteItem does not recognize any values other than NONE or\n ALL_OLD.

\n
" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the input of a DeleteItem operation.

" + } + }, + "com.amazonaws.dynamodb#DeleteItemOutput": { + "type": "structure", + "members": { + "ConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ConsumedCapacity", + "traits": { + "smithy.api#documentation": "

The capacity units consumed by the DeleteItem operation. The data\n returned includes the total provisioned throughput consumed, along with statistics for\n the table and any indexes involved in the operation. ConsumedCapacity is\n only returned if the ReturnConsumedCapacity parameter was specified. For\n more information, see Provisioned Mode in the Amazon DynamoDB Developer\n Guide.

" + } + }, + "ItemCollectionMetrics": { + "target": "com.amazonaws.dynamodb#ItemCollectionMetrics", + "traits": { + "smithy.api#documentation": "

Information about item collections, if any, that were affected by the\n DeleteItem operation.\n ItemCollectionMetrics is only returned if the\n ReturnItemCollectionMetrics parameter was specified. If the\n table does not have any local secondary indexes, this information is not returned in the\n response.

\n

Each ItemCollectionMetrics\n element consists of:

\n
    \n
  • \n

    \n ItemCollectionKey - The partition key value of the item\n collection. This is the same as the partition key value of the item itself.

    \n
  • \n
  • \n

    \n SizeEstimateRangeGB - An estimate of item collection size,\n in gigabytes. This value is a two-element array\n containing a lower bound and an upper bound for the\n estimate. The estimate includes the size of all the\n items in the table, plus the size of all attributes\n projected into all of the local secondary indexes on that\n table. Use this estimate to measure whether a local secondary index is approaching its size limit.

    \n

    The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.

    \n
  • \n
" + } + }, + "Attributes": { + "target": "com.amazonaws.dynamodb#AttributeMap", + "traits": { + "smithy.api#documentation": "

A map of attribute names to AttributeValue objects, representing the item as it\n appeared before the DeleteItem operation. This map appears in the response only if\n ReturnValues was specified as ALL_OLD in the request.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the output of a DeleteItem operation.

" + } + }, + "com.amazonaws.dynamodb#DeleteReplicaAction": { + "type": "structure", + "members": { + "RegionName": { + "target": "com.amazonaws.dynamodb#RegionName", + "traits": { + "smithy.api#documentation": "

The Region of the replica to be removed.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a replica to be removed.

" + } + }, + "com.amazonaws.dynamodb#DeleteReplicationGroupMemberAction": { + "type": "structure", + "members": { + "RegionName": { + "target": "com.amazonaws.dynamodb#RegionName", + "traits": { + "smithy.api#documentation": "

The Region where the replica exists.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a replica to be deleted.

" + } + }, + "com.amazonaws.dynamodb#DeleteRequest": { + "type": "structure", + "members": { + "Key": { + "target": "com.amazonaws.dynamodb#Key", + "traits": { + "smithy.api#documentation": "

A map of attribute name to attribute values, representing the primary key of the item to delete. All of the table's primary key attributes must be specified, and their data types must match those of the table's key schema.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a request to perform a DeleteItem operation on an item.

" + } + }, + "com.amazonaws.dynamodb#DeleteTable": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#DeleteTableInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#DeleteTableOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#LimitExceededException" + }, + { + "target": "com.amazonaws.dynamodb#ResourceInUseException" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

The DeleteTable operation deletes a table and all of its items. After a\n DeleteTable request, the specified table is in the DELETING state until\n DynamoDB completes the deletion. If the table is in the ACTIVE state, you can delete\n it. If a table is in CREATING or UPDATING states, then DynamoDB returns\n a ResourceInUseException. If the specified table does not exist, DynamoDB returns a\n ResourceNotFoundException. If table is already in the DELETING state, no\n error is returned.

\n \n

DynamoDB might continue to accept data read and write operations, such as GetItem and\n PutItem, on a table in the DELETING state until the table deletion is\n complete.

\n
\n

When you delete a table, any indexes on that table are also deleted.

\n

If you have DynamoDB Streams enabled on the table, then the corresponding stream on that table goes\n into the DISABLED state, and the stream is automatically deleted after 24 hours.

\n\n

Use the DescribeTable action to check the status of the table.

" + } + }, + "com.amazonaws.dynamodb#DeleteTableInput": { + "type": "structure", + "members": { + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table to delete.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the input of a DeleteTable operation.

" + } + }, + "com.amazonaws.dynamodb#DeleteTableOutput": { + "type": "structure", + "members": { + "TableDescription": { + "target": "com.amazonaws.dynamodb#TableDescription", + "traits": { + "smithy.api#documentation": "

Represents the properties of a table.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the output of a DeleteTable operation.

" + } + }, + "com.amazonaws.dynamodb#DescribeBackup": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#DescribeBackupInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#DescribeBackupOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#BackupNotFoundException" + }, + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + } + ], + "traits": { + "smithy.api#documentation": "

Describes an existing backup of a table.

\n

You can call DescribeBackup at a maximum rate of 10 times per second.

" + } + }, + "com.amazonaws.dynamodb#DescribeBackupInput": { + "type": "structure", + "members": { + "BackupArn": { + "target": "com.amazonaws.dynamodb#BackupArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) associated with the backup.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.dynamodb#DescribeBackupOutput": { + "type": "structure", + "members": { + "BackupDescription": { + "target": "com.amazonaws.dynamodb#BackupDescription", + "traits": { + "smithy.api#documentation": "

Contains the description of the backup created for the table.

" + } + } + } + }, + "com.amazonaws.dynamodb#DescribeContinuousBackups": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#DescribeContinuousBackupsInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#DescribeContinuousBackupsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#TableNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Checks the status of continuous backups and point in time recovery on the specified table.\n Continuous backups are ENABLED on all tables at table creation.\n If point in time recovery is enabled, PointInTimeRecoveryStatus will be set to ENABLED.

\n

After continuous backups and point in time recovery are enabled, you can restore to any\n point in time within EarliestRestorableDateTime and\n LatestRestorableDateTime.

\n

\n LatestRestorableDateTime is typically 5 minutes before the current time. You can restore your table to any point\n in time during the last 35 days.\n

\n

You can call DescribeContinuousBackups at a maximum rate of 10 times per second.

" + } + }, + "com.amazonaws.dynamodb#DescribeContinuousBackupsInput": { + "type": "structure", + "members": { + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

Name of the table for which the customer wants to check the continuous backups and point in time recovery settings.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.dynamodb#DescribeContinuousBackupsOutput": { + "type": "structure", + "members": { + "ContinuousBackupsDescription": { + "target": "com.amazonaws.dynamodb#ContinuousBackupsDescription", + "traits": { + "smithy.api#documentation": "

Represents the continuous backups and point in time recovery settings on the table.

" + } + } + } + }, + "com.amazonaws.dynamodb#DescribeContributorInsights": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#DescribeContributorInsightsInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#DescribeContributorInsightsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns information about contributor insights, for a given table or global secondary index.

" + } + }, + "com.amazonaws.dynamodb#DescribeContributorInsightsInput": { + "type": "structure", + "members": { + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of the global secondary index to describe, if applicable.

" + } + }, + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table to describe.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.dynamodb#DescribeContributorInsightsOutput": { + "type": "structure", + "members": { + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table being described.

" + } + }, + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of the global secondary index being described.

" + } + }, + "FailureException": { + "target": "com.amazonaws.dynamodb#FailureException", + "traits": { + "smithy.api#documentation": "

Returns information about the last failure that encountered.

\n

The most common exceptions for a FAILED status are:

\n
    \n
  • \n

    LimitExceededException - \tPer-account Amazon CloudWatch Contributor Insights rule limit reached. Please disable Contributor Insights for\n other tables/indexes OR disable Contributor Insights rules before retrying.

    \n
  • \n
  • \n

    AccessDeniedException - Amazon CloudWatch Contributor Insights rules cannot be modified due to insufficient permissions.

    \n
  • \n
  • \n

    AccessDeniedException - Failed to create service-linked role for Contributor Insights due to insufficient permissions.

    \n
  • \n
  • \n

    InternalServerError - Failed to create Amazon CloudWatch Contributor Insights rules. Please retry request.

    \n
  • \n
" + } + }, + "ContributorInsightsRuleList": { + "target": "com.amazonaws.dynamodb#ContributorInsightsRuleList", + "traits": { + "smithy.api#documentation": "

List of names of the associated Alpine rules.

" + } + }, + "ContributorInsightsStatus": { + "target": "com.amazonaws.dynamodb#ContributorInsightsStatus", + "traits": { + "smithy.api#documentation": "

Current Status contributor insights.

" + } + }, + "LastUpdateDateTime": { + "target": "com.amazonaws.dynamodb#LastUpdateDateTime", + "traits": { + "smithy.api#documentation": "

Timestamp of the last time the status was changed.

" + } + } + } + }, + "com.amazonaws.dynamodb#DescribeEndpoints": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#DescribeEndpointsRequest" + }, + "output": { + "target": "com.amazonaws.dynamodb#DescribeEndpointsResponse" + }, + "traits": { + "smithy.api#documentation": "

Returns the regional endpoint information.

" + } + }, + "com.amazonaws.dynamodb#DescribeEndpointsRequest": { + "type": "structure", + "members": {} + }, + "com.amazonaws.dynamodb#DescribeEndpointsResponse": { + "type": "structure", + "members": { + "Endpoints": { + "target": "com.amazonaws.dynamodb#Endpoints", + "traits": { + "smithy.api#documentation": "

List of endpoints.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.dynamodb#DescribeGlobalTable": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#DescribeGlobalTableInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#DescribeGlobalTableOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#GlobalTableNotFoundException" + }, + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns information about the specified global table.

\n \n

This operation only applies to Version 2017.11.29 of global tables.\n If you are using global tables Version 2019.11.21 you can use DescribeTable instead.

\n
" + } + }, + "com.amazonaws.dynamodb#DescribeGlobalTableInput": { + "type": "structure", + "members": { + "GlobalTableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the global table.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.dynamodb#DescribeGlobalTableOutput": { + "type": "structure", + "members": { + "GlobalTableDescription": { + "target": "com.amazonaws.dynamodb#GlobalTableDescription", + "traits": { + "smithy.api#documentation": "

Contains the details of the global table.

" + } + } + } + }, + "com.amazonaws.dynamodb#DescribeGlobalTableSettings": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#DescribeGlobalTableSettingsInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#DescribeGlobalTableSettingsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#GlobalTableNotFoundException" + }, + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + } + ], + "traits": { + "smithy.api#documentation": "

Describes Region-specific settings for a global table.

\n \n

This operation only applies to Version 2017.11.29 of global tables.

\n
" + } + }, + "com.amazonaws.dynamodb#DescribeGlobalTableSettingsInput": { + "type": "structure", + "members": { + "GlobalTableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the global table to describe.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.dynamodb#DescribeGlobalTableSettingsOutput": { + "type": "structure", + "members": { + "ReplicaSettings": { + "target": "com.amazonaws.dynamodb#ReplicaSettingsDescriptionList", + "traits": { + "smithy.api#documentation": "

The Region-specific settings for the global table.

" + } + }, + "GlobalTableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the global table.

" + } + } + } + }, + "com.amazonaws.dynamodb#DescribeLimits": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#DescribeLimitsInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#DescribeLimitsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns the current provisioned-capacity quotas for your AWS account in a Region, both\n for the Region as a whole and for any one DynamoDB table that you create there.

\n

When you establish an AWS account, the account has initial quotas on the maximum read\n capacity units and write capacity units that you can provision across all of your\n DynamoDB tables in a given Region. Also, there are per-table quotas that apply when you\n create a table there. For more information, see Service, Account, and Table\n Quotas page in the Amazon DynamoDB Developer\n Guide.

\n\n

Although you can increase these quotas by filing a case at AWS Support Center, obtaining the increase is not\n instantaneous. The DescribeLimits action lets you write code to compare the\n capacity you are currently using to those quotas imposed by your account so that you\n have enough time to apply for an increase before you hit a quota.

\n\n

For example, you could use one of the AWS SDKs to do the following:

\n\n
    \n
  1. \n

    Call DescribeLimits for a particular Region to obtain your current\n account quotas on provisioned capacity there.

    \n
  2. \n
  3. \n

    Create a variable to hold the aggregate read capacity units provisioned for all\n your tables in that Region, and one to hold the aggregate write capacity units.\n Zero them both.

    \n
  4. \n
  5. \n

    Call ListTables to obtain a list of all your DynamoDB tables.

    \n
  6. \n
  7. \n

    For each table name listed by ListTables, do the following:

    \n
      \n
    • \n

      Call DescribeTable with the table name.

      \n
    • \n
    • \n

      Use the data returned by DescribeTable to add the read capacity units and write capacity\n units provisioned for the table itself to your variables.

      \n
    • \n
    • \n

      If the table has one or more global secondary indexes (GSIs), loop over these GSIs and add their provisioned capacity values to your variables as well.

      \n
    • \n
    \n
  8. \n
  9. \n

    Report the account quotas for that Region returned by DescribeLimits, along with\n the total current provisioned capacity levels you have calculated.

    \n
  10. \n
\n\n

This will let you see whether you are getting close to your account-level quotas.

\n

The per-table quotas apply only when you are creating a new table. They restrict the sum\n of the provisioned capacity of the new table itself and all its global secondary\n indexes.

\n

For existing tables and their GSIs, DynamoDB doesn't let you increase provisioned\n capacity extremely rapidly, but the only quota that applies is that the aggregate\n provisioned capacity over all your tables and GSIs cannot exceed either of the\n per-account quotas.

\n \n

\n DescribeLimits should only be called periodically. You can expect throttling\n errors if you call it more than once in a minute.

\n
\n

The DescribeLimits Request element has no content.

" + } + }, + "com.amazonaws.dynamodb#DescribeLimitsInput": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#documentation": "

Represents the input of a DescribeLimits operation. Has no content.

" + } + }, + "com.amazonaws.dynamodb#DescribeLimitsOutput": { + "type": "structure", + "members": { + "TableMaxWriteCapacityUnits": { + "target": "com.amazonaws.dynamodb#PositiveLongObject", + "traits": { + "smithy.api#documentation": "

The maximum write capacity units that your account allows you to provision for a new\n table that you are creating in this Region, including the write capacity units\n provisioned for its global secondary indexes (GSIs).

" + } + }, + "AccountMaxWriteCapacityUnits": { + "target": "com.amazonaws.dynamodb#PositiveLongObject", + "traits": { + "smithy.api#documentation": "

The maximum total write capacity units that your account allows you to provision across\n all of your tables in this Region.

" + } + }, + "TableMaxReadCapacityUnits": { + "target": "com.amazonaws.dynamodb#PositiveLongObject", + "traits": { + "smithy.api#documentation": "

The maximum read capacity units that your account allows you to provision for a new\n table that you are creating in this Region, including the read capacity units\n provisioned for its global secondary indexes (GSIs).

" + } + }, + "AccountMaxReadCapacityUnits": { + "target": "com.amazonaws.dynamodb#PositiveLongObject", + "traits": { + "smithy.api#documentation": "

The maximum total read capacity units that your account allows you to provision across\n all of your tables in this Region.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the output of a DescribeLimits operation.

" + } + }, + "com.amazonaws.dynamodb#DescribeTable": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#DescribeTableInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#DescribeTableOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns information about the table, including the current status of the table, when it was created, the primary key schema, and any indexes on the table.

\n \n

If you issue a DescribeTable request immediately after a CreateTable request, DynamoDB might\n return a ResourceNotFoundException. This is because DescribeTable uses an eventually\n consistent query, and the metadata for your table might not be available at that moment.\n Wait for a few seconds, and then try the DescribeTable request again.

\n
" + } + }, + "com.amazonaws.dynamodb#DescribeTableInput": { + "type": "structure", + "members": { + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table to describe.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the input of a DescribeTable operation.

" + } + }, + "com.amazonaws.dynamodb#DescribeTableOutput": { + "type": "structure", + "members": { + "Table": { + "target": "com.amazonaws.dynamodb#TableDescription", + "traits": { + "smithy.api#documentation": "

The properties of the table.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the output of a DescribeTable operation.

" + } + }, + "com.amazonaws.dynamodb#DescribeTableReplicaAutoScaling": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#DescribeTableReplicaAutoScalingInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#DescribeTableReplicaAutoScalingOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Describes auto scaling settings across replicas of the global table at once.

\n \n

This operation only applies to Version 2019.11.21 of global tables.

\n
" + } + }, + "com.amazonaws.dynamodb#DescribeTableReplicaAutoScalingInput": { + "type": "structure", + "members": { + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.dynamodb#DescribeTableReplicaAutoScalingOutput": { + "type": "structure", + "members": { + "TableAutoScalingDescription": { + "target": "com.amazonaws.dynamodb#TableAutoScalingDescription", + "traits": { + "smithy.api#documentation": "

Represents the auto scaling properties of the table.

" + } + } + } + }, + "com.amazonaws.dynamodb#DescribeTimeToLive": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#DescribeTimeToLiveInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#DescribeTimeToLiveOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Gives a description of the Time to Live (TTL) status on the specified table.

" + } + }, + "com.amazonaws.dynamodb#DescribeTimeToLiveInput": { + "type": "structure", + "members": { + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table to be described.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.dynamodb#DescribeTimeToLiveOutput": { + "type": "structure", + "members": { + "TimeToLiveDescription": { + "target": "com.amazonaws.dynamodb#TimeToLiveDescription", + "traits": { + "smithy.api#documentation": "

" + } + } + } + }, + "com.amazonaws.dynamodb#Double": { + "type": "double", + "traits": { + "smithy.api#box": {} + } + }, + "com.amazonaws.dynamodb#DynamoDB_20120810": { + "type": "service", + "version": "2012-08-10", + "operations": [ + { + "target": "com.amazonaws.dynamodb#BatchGetItem" + }, + { + "target": "com.amazonaws.dynamodb#BatchWriteItem" + }, + { + "target": "com.amazonaws.dynamodb#CreateBackup" + }, + { + "target": "com.amazonaws.dynamodb#CreateGlobalTable" + }, + { + "target": "com.amazonaws.dynamodb#CreateTable" + }, + { + "target": "com.amazonaws.dynamodb#DeleteBackup" + }, + { + "target": "com.amazonaws.dynamodb#DeleteItem" + }, + { + "target": "com.amazonaws.dynamodb#DeleteTable" + }, + { + "target": "com.amazonaws.dynamodb#DescribeBackup" + }, + { + "target": "com.amazonaws.dynamodb#DescribeContinuousBackups" + }, + { + "target": "com.amazonaws.dynamodb#DescribeContributorInsights" + }, + { + "target": "com.amazonaws.dynamodb#DescribeEndpoints" + }, + { + "target": "com.amazonaws.dynamodb#DescribeGlobalTable" + }, + { + "target": "com.amazonaws.dynamodb#DescribeGlobalTableSettings" + }, + { + "target": "com.amazonaws.dynamodb#DescribeLimits" + }, + { + "target": "com.amazonaws.dynamodb#DescribeTable" + }, + { + "target": "com.amazonaws.dynamodb#DescribeTableReplicaAutoScaling" + }, + { + "target": "com.amazonaws.dynamodb#DescribeTimeToLive" + }, + { + "target": "com.amazonaws.dynamodb#GetItem" + }, + { + "target": "com.amazonaws.dynamodb#ListBackups" + }, + { + "target": "com.amazonaws.dynamodb#ListContributorInsights" + }, + { + "target": "com.amazonaws.dynamodb#ListGlobalTables" + }, + { + "target": "com.amazonaws.dynamodb#ListTables" + }, + { + "target": "com.amazonaws.dynamodb#ListTagsOfResource" + }, + { + "target": "com.amazonaws.dynamodb#PutItem" + }, + { + "target": "com.amazonaws.dynamodb#Query" + }, + { + "target": "com.amazonaws.dynamodb#RestoreTableFromBackup" + }, + { + "target": "com.amazonaws.dynamodb#RestoreTableToPointInTime" + }, + { + "target": "com.amazonaws.dynamodb#Scan" + }, + { + "target": "com.amazonaws.dynamodb#TagResource" + }, + { + "target": "com.amazonaws.dynamodb#TransactGetItems" + }, + { + "target": "com.amazonaws.dynamodb#TransactWriteItems" + }, + { + "target": "com.amazonaws.dynamodb#UntagResource" + }, + { + "target": "com.amazonaws.dynamodb#UpdateContinuousBackups" + }, + { + "target": "com.amazonaws.dynamodb#UpdateContributorInsights" + }, + { + "target": "com.amazonaws.dynamodb#UpdateGlobalTable" + }, + { + "target": "com.amazonaws.dynamodb#UpdateGlobalTableSettings" + }, + { + "target": "com.amazonaws.dynamodb#UpdateItem" + }, + { + "target": "com.amazonaws.dynamodb#UpdateTable" + }, + { + "target": "com.amazonaws.dynamodb#UpdateTableReplicaAutoScaling" + }, + { + "target": "com.amazonaws.dynamodb#UpdateTimeToLive" + } + ], + "traits": { + "aws.api#clientEndpointDiscovery": { + "operation": "com.amazonaws.dynamodb#DescribeEndpoints", + "error": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + "aws.api#service": { + "sdkId": "DynamoDB", + "arnNamespace": "dynamodb", + "cloudFormationName": "DynamoDB", + "cloudTrailEventSource": "dynamodb.amazonaws.com" + }, + "aws.auth#sigv4": { + "name": "dynamodb" + }, + "aws.protocols#awsJson1_0": {}, + "smithy.api#documentation": "Amazon DynamoDB\n\n\n

Amazon DynamoDB is a fully managed NoSQL database service that provides fast and\n predictable performance with seamless scalability. DynamoDB lets you offload the\n administrative burdens of operating and scaling a distributed database, so that you don't have\n to worry about hardware provisioning, setup and configuration, replication, software patching,\n or cluster scaling.

\n\n

With DynamoDB, you can create database tables that can store and retrieve any amount of\n data, and serve any level of request traffic. You can scale up or scale down your tables'\n throughput capacity without downtime or performance degradation, and use the AWS Management\n Console to monitor resource utilization and performance metrics.

\n\n

DynamoDB automatically spreads the data and traffic for your tables over a sufficient\n number of servers to handle your throughput and storage requirements, while maintaining\n consistent and fast performance. All of your data is stored on solid state disks (SSDs) and\n automatically replicated across multiple Availability Zones in an AWS region, providing\n built-in high availability and data durability.

", + "smithy.api#title": "Amazon DynamoDB", + "smithy.api#xmlNamespace": { + "uri": "http://dynamodb.amazonaws.com/doc/2012-08-10/" + } + } + }, + "com.amazonaws.dynamodb#Endpoint": { + "type": "structure", + "members": { + "CachePeriodInMinutes": { + "target": "com.amazonaws.dynamodb#Long", + "traits": { + "smithy.api#documentation": "

Endpoint cache time to live (TTL) value.

", + "smithy.api#required": {} + } + }, + "Address": { + "target": "com.amazonaws.dynamodb#String", + "traits": { + "smithy.api#documentation": "

IP address of the endpoint.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

An endpoint information details.

" + } + }, + "com.amazonaws.dynamodb#Endpoints": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#Endpoint" + } + }, + "com.amazonaws.dynamodb#ErrorMessage": { + "type": "string" + }, + "com.amazonaws.dynamodb#ExceptionDescription": { + "type": "string" + }, + "com.amazonaws.dynamodb#ExceptionName": { + "type": "string" + }, + "com.amazonaws.dynamodb#ExpectedAttributeMap": { + "type": "map", + "key": { + "target": "com.amazonaws.dynamodb#AttributeName" + }, + "value": { + "target": "com.amazonaws.dynamodb#ExpectedAttributeValue" + } + }, + "com.amazonaws.dynamodb#ExpectedAttributeValue": { + "type": "structure", + "members": { + "Value": { + "target": "com.amazonaws.dynamodb#AttributeValue", + "traits": { + "smithy.api#documentation": "

Represents the data for the expected attribute.

\n

Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself.

\n

For more information, see Data Types in the\n Amazon DynamoDB Developer Guide.

" + } + }, + "AttributeValueList": { + "target": "com.amazonaws.dynamodb#AttributeValueList", + "traits": { + "smithy.api#documentation": "

One or more values to evaluate against the supplied attribute. The number of values in the\n list depends on the ComparisonOperator being used.

\n

For type Number, value comparisons are numeric.

\n

String value comparisons for greater than, equals, or less than are based on ASCII character\n code values. For example, a is greater than A, and a\n is greater than B. For a list of code values, see http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters.

\n

For Binary, DynamoDB treats each byte of the binary data as unsigned when it compares binary values.

\n

For information on specifying data types in JSON, see JSON Data Format in the Amazon DynamoDB Developer Guide.

" + } + }, + "Exists": { + "target": "com.amazonaws.dynamodb#BooleanObject", + "traits": { + "smithy.api#documentation": "

Causes DynamoDB to evaluate the value before attempting a conditional operation:

\n
    \n
  • \n

    If Exists is true, DynamoDB will check to see if that attribute value\n already exists in the table. If it is found, then the operation succeeds. If it is not\n found, the operation fails with a ConditionCheckFailedException.

    \n
  • \n
  • \n

    If Exists is false, DynamoDB assumes that the attribute value does\n not exist in the table. If in fact the value does not exist, then the assumption\n is valid and the operation succeeds. If the value is found, despite the assumption that it\n does not exist, the operation fails with a ConditionCheckFailedException.

    \n
  • \n
\n

The default setting for Exists is true. If you supply a Value all\n by itself, DynamoDB assumes the attribute exists: You don't have to set Exists to\n true, because it is implied.

\n

DynamoDB returns a ValidationException if:

\n
    \n
  • \n

    \n Exists is true but there is no Value to check. (You expect a\n value to exist, but don't specify what that value is.)

    \n
  • \n
  • \n

    \n Exists is false but you also provide a Value. (You cannot\n expect an attribute to have a value, while also expecting it not to exist.)

    \n
  • \n
" + } + }, + "ComparisonOperator": { + "target": "com.amazonaws.dynamodb#ComparisonOperator", + "traits": { + "smithy.api#documentation": "

A comparator for evaluating attributes in the AttributeValueList. For example, equals,\n greater than, less than, etc.

\n

The following comparison operators are available:

\n

\n EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN\n

\n

The following are descriptions of each comparison operator.

\n
    \n
  • \n

    \n EQ : Equal. EQ is supported for all data types, including lists and maps.

    \n

    \n AttributeValueList can contain only one AttributeValue element of type String,\n Number, Binary, String Set, Number Set, or Binary Set. If an item contains an AttributeValue element of a different\n type than the one provided in the request, the value does not match. For example,\n {\"S\":\"6\"} does not equal {\"N\":\"6\"}. Also,\n {\"N\":\"6\"} does not equal {\"NS\":[\"6\", \"2\", \"1\"]}.

    \n

    \n
  • \n
  • \n

    \n NE : Not equal. NE is supported for all data types, including lists and maps.

    \n

    \n AttributeValueList can contain only one AttributeValue of type String,\n Number, Binary, String Set, Number Set, or Binary Set. If an item contains an AttributeValue of a different\n type than the one provided in the request, the value does not match. For example,\n {\"S\":\"6\"} does not equal {\"N\":\"6\"}. Also,\n {\"N\":\"6\"} does not equal {\"NS\":[\"6\", \"2\", \"1\"]}.

    \n

    \n
  • \n
  • \n

    \n LE : Less than or equal.

    \n

    \n AttributeValueList can contain only one AttributeValue element of type String,\n Number, or Binary (not a set type). If an item contains an AttributeValue element of a different\n type than the one provided in the request, the value does not match. For example,\n {\"S\":\"6\"} does not equal {\"N\":\"6\"}. Also,\n {\"N\":\"6\"} does not compare to {\"NS\":[\"6\", \"2\", \"1\"]}.

    \n

    \n
  • \n
  • \n

    \n LT : Less than.

    \n

    \n AttributeValueList can contain only one AttributeValue of type String,\n Number, or Binary (not a set type). If an item contains an AttributeValue element of a different\n type than the one provided in the request, the value does not match. For example,\n {\"S\":\"6\"} does not equal {\"N\":\"6\"}. Also,\n {\"N\":\"6\"} does not compare to {\"NS\":[\"6\", \"2\", \"1\"]}.

    \n

    \n
  • \n
  • \n

    \n GE : Greater than or equal.

    \n

    \n AttributeValueList can contain only one AttributeValue element of type String,\n Number, or Binary (not a set type). If an item contains an AttributeValue element of a different\n type than the one provided in the request, the value does not match. For example,\n {\"S\":\"6\"} does not equal {\"N\":\"6\"}. Also,\n {\"N\":\"6\"} does not compare to {\"NS\":[\"6\", \"2\", \"1\"]}.

    \n

    \n
  • \n
  • \n

    \n GT : Greater than.

    \n

    \n AttributeValueList can contain only one AttributeValue element of type String,\n Number, or Binary (not a set type). If an item contains an AttributeValue element of a different\n type than the one provided in the request, the value does not match. For example,\n {\"S\":\"6\"} does not equal {\"N\":\"6\"}. Also,\n {\"N\":\"6\"} does not compare to {\"NS\":[\"6\", \"2\", \"1\"]}.

    \n

    \n
  • \n
  • \n

    \n NOT_NULL : The attribute exists. NOT_NULL is supported for all data types, including lists and maps.

    \n \n

    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.

    \n
    \n
  • \n
  • \n

    \n NULL : The attribute does not exist. NULL is supported for all data types, including lists and maps.

    \n \n

    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.

    \n
    \n
  • \n
  • \n

    \n CONTAINS : Checks for a subsequence, or value in a set.

    \n

    \n AttributeValueList can contain only one AttributeValue element of type String,\n Number, or Binary (not a set type). If the target attribute of the comparison is of type String, then\n the operator checks for a substring match. If the target attribute of the comparison is\n of type Binary, then the operator looks for a subsequence of the target that matches the input.\n If the target attribute of the comparison is a set (\"SS\", \"NS\", or \"BS\"), then the\n operator evaluates to true if it finds an exact match with any member of the set.

    \n

    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.

    \n
  • \n
  • \n

    \n NOT_CONTAINS : Checks for absence of a subsequence, or absence of a value in\n a set.

    \n

    \n AttributeValueList can contain only one AttributeValue element of type String,\n Number, or Binary (not a set type). If the target attribute of the comparison is a String, then\n the operator checks for the absence of a substring match. If the target attribute of the\n comparison is Binary, then the operator checks for the absence of a subsequence of the\n target that matches the input. If the target attribute of the comparison is a set (\"SS\",\n \"NS\", or \"BS\"), then the operator evaluates to true if it does not find an exact match with any member of the set.

    \n

    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.

    \n
  • \n
  • \n

    \n BEGINS_WITH : Checks for a prefix.

    \n

    \n AttributeValueList can contain only one AttributeValue of type String or\n Binary (not a Number or a set type). The target attribute of the comparison must be of type String or\n Binary (not a Number or a set type).

    \n

    \n
  • \n
  • \n

    \n IN : Checks for matching elements in a list.

    \n

    \n AttributeValueList can contain one or more AttributeValue\n elements of type String, Number, or Binary. These attributes are compared against an\n existing attribute of an item. If any elements of the input are equal to the item\n attribute, the expression evaluates to true.

    \n
  • \n
  • \n

    \n BETWEEN : Greater than or equal to the first value, and less than or equal\n to the second value.

    \n

    \n AttributeValueList must contain two AttributeValue elements of the same\n type, either String, Number, or Binary (not a set type). A target attribute matches if the\n target value is greater than, or equal to, the first element and less than, or equal to,\n the second element. If an item contains an AttributeValue element of a different type than\n the one provided in the request, the value does not match. For example,\n {\"S\":\"6\"} does not compare to {\"N\":\"6\"}. Also,\n {\"N\":\"6\"} does not compare to {\"NS\":[\"6\", \"2\", \"1\"]}\n

    \n
  • \n
" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a condition to be compared with an attribute value. This condition can be\n used with DeleteItem, PutItem, or UpdateItem\n operations; if the comparison evaluates to true, the operation succeeds; if not, the\n operation fails. You can use ExpectedAttributeValue in one of two different\n ways:

\n
    \n
  • \n

    Use AttributeValueList to specify one or more values to compare against an\n attribute. Use ComparisonOperator to specify how you want to perform the\n comparison. If the comparison evaluates to true, then the conditional operation\n succeeds.

    \n
  • \n
  • \n

    Use Value to specify a value that DynamoDB will compare against an attribute. If the\n values match, then ExpectedAttributeValue evaluates to true and the conditional\n operation succeeds. Optionally, you can also set Exists to false, indicating that\n you do not expect to find the attribute value in the table. In this case, the\n conditional operation succeeds only if the comparison evaluates to false.

    \n
  • \n
\n

\n Value and Exists are incompatible with AttributeValueList and\n ComparisonOperator. Note that if you use both sets of parameters at once, DynamoDB will\n return a ValidationException exception.

" + } + }, + "com.amazonaws.dynamodb#ExpressionAttributeNameMap": { + "type": "map", + "key": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeNameVariable" + }, + "value": { + "target": "com.amazonaws.dynamodb#AttributeName" + } + }, + "com.amazonaws.dynamodb#ExpressionAttributeNameVariable": { + "type": "string" + }, + "com.amazonaws.dynamodb#ExpressionAttributeValueMap": { + "type": "map", + "key": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeValueVariable" + }, + "value": { + "target": "com.amazonaws.dynamodb#AttributeValue" + } + }, + "com.amazonaws.dynamodb#ExpressionAttributeValueVariable": { + "type": "string" + }, + "com.amazonaws.dynamodb#FailureException": { + "type": "structure", + "members": { + "ExceptionDescription": { + "target": "com.amazonaws.dynamodb#ExceptionDescription", + "traits": { + "smithy.api#documentation": "

Description of the failure.

" + } + }, + "ExceptionName": { + "target": "com.amazonaws.dynamodb#ExceptionName", + "traits": { + "smithy.api#documentation": "

Exception name.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a failure a contributor insights operation.

" + } + }, + "com.amazonaws.dynamodb#FilterConditionMap": { + "type": "map", + "key": { + "target": "com.amazonaws.dynamodb#AttributeName" + }, + "value": { + "target": "com.amazonaws.dynamodb#Condition" + } + }, + "com.amazonaws.dynamodb#Get": { + "type": "structure", + "members": { + "ExpressionAttributeNames": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeNameMap", + "traits": { + "smithy.api#documentation": "

One or more substitution tokens for attribute names in the\n ProjectionExpression parameter.

" + } + }, + "ProjectionExpression": { + "target": "com.amazonaws.dynamodb#ProjectionExpression", + "traits": { + "smithy.api#documentation": "

A string that identifies one or more attributes of the specified item\n to retrieve from the table. The attributes in the expression must be\n separated by commas. If no attribute names are specified, then all\n attributes of the specified item are returned. If any of the requested\n attributes are not found, they do not appear in the result.

" + } + }, + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table from which to retrieve the specified item.

", + "smithy.api#required": {} + } + }, + "Key": { + "target": "com.amazonaws.dynamodb#Key", + "traits": { + "smithy.api#documentation": "

A map of attribute names to AttributeValue objects that\n specifies the primary key of the item to retrieve.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Specifies an item and related attribute values to retrieve in a\n TransactGetItem object.

" + } + }, + "com.amazonaws.dynamodb#GetItem": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#GetItemInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#GetItemOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" + }, + { + "target": "com.amazonaws.dynamodb#RequestLimitExceeded" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

The GetItem operation returns a set of attributes for the item with the given primary\n key. If there is no matching item, GetItem does not return any data and there will be no Item element in the response.

\n

\n GetItem provides an eventually consistent read by default. If your application\n requires a strongly consistent read, set ConsistentRead to true. Although\n a strongly consistent read might take more time than an eventually consistent read, it always\n returns the last updated value.

" + } + }, + "com.amazonaws.dynamodb#GetItemInput": { + "type": "structure", + "members": { + "ConsistentRead": { + "target": "com.amazonaws.dynamodb#ConsistentRead", + "traits": { + "smithy.api#documentation": "

Determines the read consistency model: If set to true, then the operation uses strongly consistent reads; otherwise, the operation uses eventually consistent reads.

" + } + }, + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table containing the requested item.

", + "smithy.api#required": {} + } + }, + "ReturnConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ReturnConsumedCapacity" + }, + "ExpressionAttributeNames": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeNameMap", + "traits": { + "smithy.api#documentation": "

One or more substitution tokens for attribute names in an expression. The following are some use cases for using ExpressionAttributeNames:

\n
    \n
  • \n

    To access an attribute whose name conflicts with a DynamoDB reserved word.

    \n
  • \n
  • \n

    To create a placeholder for repeating occurrences of an attribute name in an expression.

    \n
  • \n
  • \n

    To prevent special characters in an attribute name from being misinterpreted in an expression.

    \n
  • \n
\n

Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:

\n
    \n
  • \n

    \n Percentile\n

    \n
  • \n
\n

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:

\n
    \n
  • \n

    \n {\"#P\":\"Percentile\"}\n

    \n
  • \n
\n

You could then use this substitution in an expression, as in this example:

\n
    \n
  • \n

    \n #P = :val\n

    \n
  • \n
\n \n

Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.

\n
\n

For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer\n Guide.

" + } + }, + "AttributesToGet": { + "target": "com.amazonaws.dynamodb#AttributeNameList", + "traits": { + "smithy.api#documentation": "

This is a legacy parameter. Use ProjectionExpression instead. For more information, see\n AttributesToGet in the Amazon DynamoDB Developer Guide.

" + } + }, + "Key": { + "target": "com.amazonaws.dynamodb#Key", + "traits": { + "smithy.api#documentation": "

A map of attribute names to AttributeValue objects, representing the primary key of\n the item to retrieve.

\n

For the primary key, you must provide all of the 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.

", + "smithy.api#required": {} + } + }, + "ProjectionExpression": { + "target": "com.amazonaws.dynamodb#ProjectionExpression", + "traits": { + "smithy.api#documentation": "

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.

\n

If no attribute names are specified, then all attributes are returned. If any of the\n requested attributes are not found, they do not appear in the result.

\n

For more information, see Specifying Item Attributes in the Amazon DynamoDB Developer\n Guide.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the input of a GetItem operation.

" + } + }, + "com.amazonaws.dynamodb#GetItemOutput": { + "type": "structure", + "members": { + "Item": { + "target": "com.amazonaws.dynamodb#AttributeMap", + "traits": { + "smithy.api#documentation": "

A map of attribute names to AttributeValue objects, as specified\n by ProjectionExpression.

" + } + }, + "ConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ConsumedCapacity", + "traits": { + "smithy.api#documentation": "

The capacity units consumed by the GetItem operation. The data returned\n includes the total provisioned throughput consumed, along with statistics for the table\n and any indexes involved in the operation. ConsumedCapacity is only\n returned if the ReturnConsumedCapacity parameter was specified. For more\n information, see Read/Write Capacity Mode in the Amazon DynamoDB Developer\n Guide.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the output of a GetItem operation.

" + } + }, + "com.amazonaws.dynamodb#GlobalSecondaryIndex": { + "type": "structure", + "members": { + "Projection": { + "target": "com.amazonaws.dynamodb#Projection", + "traits": { + "smithy.api#documentation": "

Represents attributes that are copied (projected) from the table into the global\n secondary index. These are in addition to the primary key attributes and index key\n attributes, which are automatically projected.

", + "smithy.api#required": {} + } + }, + "ProvisionedThroughput": { + "target": "com.amazonaws.dynamodb#ProvisionedThroughput", + "traits": { + "smithy.api#documentation": "

Represents the provisioned throughput settings for the specified global secondary index.

\n

For current minimum and maximum provisioned throughput values, see Service, Account, and Table Quotas in the Amazon DynamoDB Developer Guide.

" + } + }, + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of the global secondary index. The name must be unique among all other indexes on this table.

", + "smithy.api#required": {} + } + }, + "KeySchema": { + "target": "com.amazonaws.dynamodb#KeySchema", + "traits": { + "smithy.api#documentation": "

The complete key schema for a global secondary index, which consists of one or more pairs of attribute names and key types:

\n
    \n
  • \n

    \n HASH - partition key

    \n
  • \n
  • \n

    \n RANGE - sort key

    \n
  • \n
\n \n

The partition key of an item is also known as its hash attribute. The\n term \"hash attribute\" derives from DynamoDB's usage of an internal hash function to\n evenly distribute data items across partitions, based on their partition key values.

\n

The sort key of an item is also known as its range attribute.\n The term \"range attribute\" derives from the way DynamoDB stores items with the same\n partition key physically close together, in sorted order by the sort key value.

\n
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the properties of a global secondary index.

" + } + }, + "com.amazonaws.dynamodb#GlobalSecondaryIndexAutoScalingUpdate": { + "type": "structure", + "members": { + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of the global secondary index.

" + } + }, + "ProvisionedWriteCapacityAutoScalingUpdate": { + "target": "com.amazonaws.dynamodb#AutoScalingSettingsUpdate" + } + }, + "traits": { + "smithy.api#documentation": "

Represents the auto scaling settings of a global secondary index for a global table\n that will be modified.

" + } + }, + "com.amazonaws.dynamodb#GlobalSecondaryIndexAutoScalingUpdateList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#GlobalSecondaryIndexAutoScalingUpdate" + }, + "traits": { + "smithy.api#length": { + "min": 1 + } + } + }, + "com.amazonaws.dynamodb#GlobalSecondaryIndexDescription": { + "type": "structure", + "members": { + "IndexSizeBytes": { + "target": "com.amazonaws.dynamodb#Long", + "traits": { + "smithy.api#documentation": "

The total size of the specified index, in bytes. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.

" + } + }, + "ProvisionedThroughput": { + "target": "com.amazonaws.dynamodb#ProvisionedThroughputDescription", + "traits": { + "smithy.api#documentation": "

Represents the provisioned throughput settings for the specified global secondary index.

\n

For current minimum and maximum provisioned throughput values, see Service, Account, and Table Quotas in the Amazon DynamoDB Developer Guide.

" + } + }, + "Projection": { + "target": "com.amazonaws.dynamodb#Projection", + "traits": { + "smithy.api#documentation": "

Represents attributes that are copied (projected) from the table into the global\n secondary index. These are in addition to the primary key attributes and index key\n attributes, which are automatically projected.

" + } + }, + "IndexArn": { + "target": "com.amazonaws.dynamodb#String", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) that uniquely identifies the index.

" + } + }, + "KeySchema": { + "target": "com.amazonaws.dynamodb#KeySchema", + "traits": { + "smithy.api#documentation": "

The complete key schema for a global secondary index, which consists of one or more pairs of attribute names and key types:

\n
    \n
  • \n

    \n HASH - partition key

    \n
  • \n
  • \n

    \n RANGE - sort key

    \n
  • \n
\n \n

The partition key of an item is also known as its hash attribute. The\n term \"hash attribute\" derives from DynamoDB's usage of an internal hash function to\n evenly distribute data items across partitions, based on their partition key values.

\n

The sort key of an item is also known as its range attribute.\n The term \"range attribute\" derives from the way DynamoDB stores items with the same\n partition key physically close together, in sorted order by the sort key value.

\n
" + } + }, + "IndexStatus": { + "target": "com.amazonaws.dynamodb#IndexStatus", + "traits": { + "smithy.api#documentation": "

The current state of the global secondary index:

\n
    \n
  • \n

    \n CREATING - The index is being created.

    \n
  • \n
  • \n

    \n UPDATING - The index is being updated.

    \n
  • \n
  • \n

    \n DELETING - The index is being deleted.

    \n
  • \n
  • \n

    \n ACTIVE - The index is ready for use.

    \n
  • \n
" + } + }, + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of the global secondary index.

" + } + }, + "Backfilling": { + "target": "com.amazonaws.dynamodb#Backfilling", + "traits": { + "smithy.api#documentation": "

Indicates whether the index is currently backfilling. Backfilling is the process of reading items from \n the table and determining whether they can be added to the index. (Not all items will qualify: For example, a partition key \n cannot have any duplicate values.) If an item can be added to the index, DynamoDB will do so. After all items have been processed, \n the backfilling operation is complete and Backfilling is false.

\n

You can delete an index that is being created during the Backfilling phase\n when IndexStatus is set to CREATING and Backfilling is true. You\n can't delete the index that is being created when IndexStatus is set to\n CREATING and Backfilling is false.

\n \n

For indexes that were created during a CreateTable operation, the Backfilling attribute does not appear in the DescribeTable output.

\n
" + } + }, + "ItemCount": { + "target": "com.amazonaws.dynamodb#Long", + "traits": { + "smithy.api#documentation": "

The number of items in the specified index. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the properties of a global secondary index.

" + } + }, + "com.amazonaws.dynamodb#GlobalSecondaryIndexDescriptionList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#GlobalSecondaryIndexDescription" + } + }, + "com.amazonaws.dynamodb#GlobalSecondaryIndexInfo": { + "type": "structure", + "members": { + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of the global secondary index.

" + } + }, + "KeySchema": { + "target": "com.amazonaws.dynamodb#KeySchema", + "traits": { + "smithy.api#documentation": "

The complete key schema for a global secondary index, which consists of one or more pairs of attribute names and key types:

\n
    \n
  • \n

    \n HASH - partition key

    \n
  • \n
  • \n

    \n RANGE - sort key

    \n
  • \n
\n \n

The partition key of an item is also known as its hash attribute. The\n term \"hash attribute\" derives from DynamoDB's usage of an internal hash function to\n evenly distribute data items across partitions, based on their partition key values.

\n

The sort key of an item is also known as its range attribute.\n The term \"range attribute\" derives from the way DynamoDB stores items with the same\n partition key physically close together, in sorted order by the sort key value.

\n
" + } + }, + "Projection": { + "target": "com.amazonaws.dynamodb#Projection", + "traits": { + "smithy.api#documentation": "

Represents attributes that are copied (projected) from the table into\n the global secondary index. These are in addition to the primary\n key attributes and index key attributes, which are automatically\n projected.

" + } + }, + "ProvisionedThroughput": { + "target": "com.amazonaws.dynamodb#ProvisionedThroughput", + "traits": { + "smithy.api#documentation": "

Represents the provisioned throughput settings for the specified global secondary index.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the properties of a global secondary index for the table\n when the backup was created.

" + } + }, + "com.amazonaws.dynamodb#GlobalSecondaryIndexList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#GlobalSecondaryIndex" + } + }, + "com.amazonaws.dynamodb#GlobalSecondaryIndexUpdate": { + "type": "structure", + "members": { + "Update": { + "target": "com.amazonaws.dynamodb#UpdateGlobalSecondaryIndexAction", + "traits": { + "smithy.api#documentation": "

The name of an existing global secondary index, along with new provisioned throughput settings to be applied to that index.

" + } + }, + "Delete": { + "target": "com.amazonaws.dynamodb#DeleteGlobalSecondaryIndexAction", + "traits": { + "smithy.api#documentation": "

The name of an existing global secondary index to be removed.

" + } + }, + "Create": { + "target": "com.amazonaws.dynamodb#CreateGlobalSecondaryIndexAction", + "traits": { + "smithy.api#documentation": "

The parameters required for creating a global secondary index on an existing table:

\n
    \n
  • \n

    \n IndexName \n

    \n
  • \n
  • \n

    \n KeySchema \n

    \n
  • \n
  • \n

    \n AttributeDefinitions \n

    \n
  • \n
  • \n

    \n Projection \n

    \n
  • \n
  • \n

    \n ProvisionedThroughput \n

    \n
  • \n
" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents one of the following:

\n
    \n
  • \n

    A new global secondary index to be added to an existing table.

    \n
  • \n
  • \n

    New provisioned throughput parameters for an existing global secondary index.

    \n
  • \n
  • \n

    An existing global secondary index to be removed from an existing table.

    \n
  • \n
" + } + }, + "com.amazonaws.dynamodb#GlobalSecondaryIndexUpdateList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#GlobalSecondaryIndexUpdate" + } + }, + "com.amazonaws.dynamodb#GlobalSecondaryIndexes": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#GlobalSecondaryIndexInfo" + } + }, + "com.amazonaws.dynamodb#GlobalTable": { + "type": "structure", + "members": { + "GlobalTableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The global table name.

" + } + }, + "ReplicationGroup": { + "target": "com.amazonaws.dynamodb#ReplicaList", + "traits": { + "smithy.api#documentation": "

The Regions where the global table has replicas.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the properties of a global table.

" + } + }, + "com.amazonaws.dynamodb#GlobalTableAlreadyExistsException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

The specified global table already exists.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#GlobalTableArnString": { + "type": "string" + }, + "com.amazonaws.dynamodb#GlobalTableDescription": { + "type": "structure", + "members": { + "GlobalTableArn": { + "target": "com.amazonaws.dynamodb#GlobalTableArnString", + "traits": { + "smithy.api#documentation": "

The unique identifier of the global table.

" + } + }, + "ReplicationGroup": { + "target": "com.amazonaws.dynamodb#ReplicaDescriptionList", + "traits": { + "smithy.api#documentation": "

The Regions where the global table has replicas.

" + } + }, + "GlobalTableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The global table name.

" + } + }, + "CreationDateTime": { + "target": "com.amazonaws.dynamodb#Date", + "traits": { + "smithy.api#documentation": "

The creation time of the global table.

" + } + }, + "GlobalTableStatus": { + "target": "com.amazonaws.dynamodb#GlobalTableStatus", + "traits": { + "smithy.api#documentation": "

The current state of the global table:

\n
    \n
  • \n

    \n CREATING - The global table is being created.

    \n
  • \n
  • \n

    \n UPDATING - The global table is being updated.

    \n
  • \n
  • \n

    \n DELETING - The global table is being deleted.

    \n
  • \n
  • \n

    \n ACTIVE - The global table is ready for use.

    \n
  • \n
" + } + } + }, + "traits": { + "smithy.api#documentation": "

Contains details about the global table.

" + } + }, + "com.amazonaws.dynamodb#GlobalTableGlobalSecondaryIndexSettingsUpdate": { + "type": "structure", + "members": { + "ProvisionedWriteCapacityUnits": { + "target": "com.amazonaws.dynamodb#PositiveLongObject", + "traits": { + "smithy.api#documentation": "

The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException.\n

" + } + }, + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of the global secondary index. The name must be unique among all other indexes on this table.

", + "smithy.api#required": {} + } + }, + "ProvisionedWriteCapacityAutoScalingSettingsUpdate": { + "target": "com.amazonaws.dynamodb#AutoScalingSettingsUpdate", + "traits": { + "smithy.api#documentation": "

Auto scaling settings for managing a global secondary index's write capacity\n units.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the settings of a global secondary index for a global table that will be modified.

" + } + }, + "com.amazonaws.dynamodb#GlobalTableGlobalSecondaryIndexSettingsUpdateList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#GlobalTableGlobalSecondaryIndexSettingsUpdate" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 20 + } + } + }, + "com.amazonaws.dynamodb#GlobalTableList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#GlobalTable" + } + }, + "com.amazonaws.dynamodb#GlobalTableNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

The specified global table does not exist.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#GlobalTableStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "CREATING" + }, + { + "value": "ACTIVE" + }, + { + "value": "DELETING" + }, + { + "value": "UPDATING" + } + ] + } + }, + "com.amazonaws.dynamodb#IdempotentParameterMismatchException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.dynamodb#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

DynamoDB rejected the request because you retried a request with a different payload but\n with an idempotent token that was already used.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#IndexName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 3, + "max": 255 + }, + "smithy.api#pattern": "[a-zA-Z0-9_.-]+" + } + }, + "com.amazonaws.dynamodb#IndexNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

The operation tried to access a nonexistent index.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#IndexStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "CREATING" + }, + { + "value": "UPDATING" + }, + { + "value": "DELETING" + }, + { + "value": "ACTIVE" + } + ] + } + }, + "com.amazonaws.dynamodb#Integer": { + "type": "integer" + }, + "com.amazonaws.dynamodb#IntegerObject": { + "type": "integer", + "traits": { + "smithy.api#box": {} + } + }, + "com.amazonaws.dynamodb#InternalServerError": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage", + "traits": { + "smithy.api#documentation": "

The server encountered an internal error trying to fulfill the request.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

An error occurred on the server side.

", + "smithy.api#error": "server" + } + }, + "com.amazonaws.dynamodb#InvalidEndpointException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.dynamodb#String" + } + }, + "traits": { + "smithy.api#error": "client", + "smithy.api#httpError": 421 + } + }, + "com.amazonaws.dynamodb#InvalidRestoreTimeException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

An invalid restore time was specified. RestoreDateTime must be between EarliestRestorableDateTime and LatestRestorableDateTime.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#ItemCollectionKeyAttributeMap": { + "type": "map", + "key": { + "target": "com.amazonaws.dynamodb#AttributeName" + }, + "value": { + "target": "com.amazonaws.dynamodb#AttributeValue" + } + }, + "com.amazonaws.dynamodb#ItemCollectionMetrics": { + "type": "structure", + "members": { + "ItemCollectionKey": { + "target": "com.amazonaws.dynamodb#ItemCollectionKeyAttributeMap", + "traits": { + "smithy.api#documentation": "

The partition key value of the item collection. This value is the same as the partition key value of the item.

" + } + }, + "SizeEstimateRangeGB": { + "target": "com.amazonaws.dynamodb#ItemCollectionSizeEstimateRange", + "traits": { + "smithy.api#documentation": "

An estimate of item collection size, in gigabytes. This value 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 that table. Use this estimate to measure whether a local secondary index is approaching its size limit.

\n

The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about item collections, if any, that were affected by the operation.\n ItemCollectionMetrics is only returned if the request asked for it. If the\n table does not have any local secondary indexes, this information is not returned in the response.

" + } + }, + "com.amazonaws.dynamodb#ItemCollectionMetricsMultiple": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#ItemCollectionMetrics" + } + }, + "com.amazonaws.dynamodb#ItemCollectionMetricsPerTable": { + "type": "map", + "key": { + "target": "com.amazonaws.dynamodb#TableName" + }, + "value": { + "target": "com.amazonaws.dynamodb#ItemCollectionMetricsMultiple" + } + }, + "com.amazonaws.dynamodb#ItemCollectionSizeEstimateBound": { + "type": "double", + "traits": { + "smithy.api#box": {} + } + }, + "com.amazonaws.dynamodb#ItemCollectionSizeEstimateRange": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#ItemCollectionSizeEstimateBound" + } + }, + "com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage", + "traits": { + "smithy.api#documentation": "

The total size of an item collection has exceeded the maximum limit of 10 gigabytes.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

An item collection is too large. This exception is only returned for tables that have one or more local secondary indexes.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#ItemCount": { + "type": "long", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 0 + } + } + }, + "com.amazonaws.dynamodb#ItemList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#AttributeMap" + } + }, + "com.amazonaws.dynamodb#ItemResponse": { + "type": "structure", + "members": { + "Item": { + "target": "com.amazonaws.dynamodb#AttributeMap", + "traits": { + "smithy.api#documentation": "

Map of attribute data consisting of the data type and attribute value.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Details for the requested item.

" + } + }, + "com.amazonaws.dynamodb#ItemResponseList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#ItemResponse" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 25 + } + } + }, + "com.amazonaws.dynamodb#KMSMasterKeyArn": { + "type": "string" + }, + "com.amazonaws.dynamodb#KMSMasterKeyId": { + "type": "string" + }, + "com.amazonaws.dynamodb#Key": { + "type": "map", + "key": { + "target": "com.amazonaws.dynamodb#AttributeName" + }, + "value": { + "target": "com.amazonaws.dynamodb#AttributeValue" + } + }, + "com.amazonaws.dynamodb#KeyConditions": { + "type": "map", + "key": { + "target": "com.amazonaws.dynamodb#AttributeName" + }, + "value": { + "target": "com.amazonaws.dynamodb#Condition" + } + }, + "com.amazonaws.dynamodb#KeyExpression": { + "type": "string" + }, + "com.amazonaws.dynamodb#KeyList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#Key" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.dynamodb#KeySchema": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#KeySchemaElement" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2 + } + } + }, + "com.amazonaws.dynamodb#KeySchemaAttributeName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + } + } + }, + "com.amazonaws.dynamodb#KeySchemaElement": { + "type": "structure", + "members": { + "KeyType": { + "target": "com.amazonaws.dynamodb#KeyType", + "traits": { + "smithy.api#documentation": "

The role that this key attribute will assume:

\n
    \n
  • \n

    \n HASH - partition key

    \n
  • \n
  • \n

    \n RANGE - sort key

    \n
  • \n
\n \n

The partition key of an item is also known as its hash attribute. The\n term \"hash attribute\" derives from DynamoDB's usage of an internal hash function to\n evenly distribute data items across partitions, based on their partition key values.

\n

The sort key of an item is also known as its range attribute.\n The term \"range attribute\" derives from the way DynamoDB stores items with the same\n partition key physically close together, in sorted order by the sort key value.

\n
", + "smithy.api#required": {} + } + }, + "AttributeName": { + "target": "com.amazonaws.dynamodb#KeySchemaAttributeName", + "traits": { + "smithy.api#documentation": "

The name of a key attribute.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a single element of a key schema. A key schema specifies the attributes\n that make up the primary key of a table, or the key attributes of an index.

\n

A KeySchemaElement represents exactly one attribute of the primary key. For example, a\n simple primary key would be represented by one KeySchemaElement (for the partition key). A composite\n primary key would require one KeySchemaElement for the partition key, and another\n KeySchemaElement for the sort key.

\n

A KeySchemaElement must be a scalar, top-level attribute (not a nested attribute). The data type must be one of String, Number, or Binary. The attribute cannot be nested within a List or a Map.

" + } + }, + "com.amazonaws.dynamodb#KeyType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "HASH" + }, + { + "value": "RANGE" + } + ] + } + }, + "com.amazonaws.dynamodb#KeysAndAttributes": { + "type": "structure", + "members": { + "Keys": { + "target": "com.amazonaws.dynamodb#KeyList", + "traits": { + "smithy.api#documentation": "

The primary key attribute values that define the items and the attributes associated with the items.

", + "smithy.api#required": {} + } + }, + "ExpressionAttributeNames": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeNameMap", + "traits": { + "smithy.api#documentation": "

One or more substitution tokens for attribute names in an expression. The following are some use cases for using ExpressionAttributeNames:

\n
    \n
  • \n

    To access an attribute whose name conflicts with a DynamoDB reserved word.

    \n
  • \n
  • \n

    To create a placeholder for repeating occurrences of an attribute name in an expression.

    \n
  • \n
  • \n

    To prevent special characters in an attribute name from being misinterpreted in an expression.

    \n
  • \n
\n

Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:

\n
    \n
  • \n

    \n Percentile\n

    \n
  • \n
\n

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:

\n
    \n
  • \n

    \n {\"#P\":\"Percentile\"}\n

    \n
  • \n
\n

You could then use this substitution in an expression, as in this example:

\n
    \n
  • \n

    \n #P = :val\n

    \n
  • \n
\n \n

Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.

\n
\n

For more information on expression attribute names, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.

" + } + }, + "AttributesToGet": { + "target": "com.amazonaws.dynamodb#AttributeNameList", + "traits": { + "smithy.api#documentation": "

This is a legacy parameter. Use ProjectionExpression instead. For more information, see\n Legacy Conditional Parameters in the Amazon DynamoDB Developer Guide.

" + } + }, + "ConsistentRead": { + "target": "com.amazonaws.dynamodb#ConsistentRead", + "traits": { + "smithy.api#documentation": "

The consistency of a read operation. If set to true, then a strongly consistent\n read is used; otherwise, an eventually consistent read is used.

" + } + }, + "ProjectionExpression": { + "target": "com.amazonaws.dynamodb#ProjectionExpression", + "traits": { + "smithy.api#documentation": "

A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars,\n sets, or elements of a JSON document. The attributes in the ProjectionExpression must be separated by\n commas.

\n

If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.

\n

For more information, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a set of primary keys and, for each key, the attributes to retrieve from the table.

\n

For each primary key, you must provide all of the key attributes. For example, with a\n simple primary key, you only need to provide the partition key. For a composite\n primary key, you must provide both the partition key and the sort key.

" + } + }, + "com.amazonaws.dynamodb#LastUpdateDateTime": { + "type": "timestamp" + }, + "com.amazonaws.dynamodb#LimitExceededException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage", + "traits": { + "smithy.api#documentation": "

Too many operations for a given subscriber.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

There is no limit to the number of daily on-demand backups that can be taken.

\n

Up to 50 simultaneous table operations are allowed per account. These operations\n include CreateTable, UpdateTable,\n DeleteTable,UpdateTimeToLive,\n RestoreTableFromBackup, and RestoreTableToPointInTime.

\n

The only exception is when you are creating a table with one or more secondary indexes. You can have up to \n 25 such requests running at a time; however, if the table or index specifications are complex, DynamoDB might temporarily \n reduce the number of concurrent operations.

\n

There is a soft account quota of 256 tables.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#ListAttributeValue": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#AttributeValue" + } + }, + "com.amazonaws.dynamodb#ListBackups": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#ListBackupsInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#ListBackupsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + } + ], + "traits": { + "smithy.api#documentation": "

List backups associated with an AWS account. To list backups for a given table, specify\n TableName. ListBackups returns a paginated list of results\n with at most 1 MB worth of items in a page. You can also specify a maximum number of\n entries to be returned in a page.

\n

In the request, start time is inclusive, but end time is exclusive. Note that these\n boundaries are for the time at which the original backup was requested.

\n

You can call ListBackups a maximum of five times per second.

" + } + }, + "com.amazonaws.dynamodb#ListBackupsInput": { + "type": "structure", + "members": { + "BackupType": { + "target": "com.amazonaws.dynamodb#BackupTypeFilter", + "traits": { + "smithy.api#documentation": "

The backups from the table specified by BackupType are listed.

\n

Where BackupType can be:

\n
    \n
  • \n

    \n USER - On-demand backup created by you.

    \n
  • \n
  • \n

    \n SYSTEM - On-demand backup automatically created by\n DynamoDB.

    \n
  • \n
  • \n

    \n ALL - All types of on-demand backups (USER and SYSTEM).

    \n
  • \n
" + } + }, + "TimeRangeLowerBound": { + "target": "com.amazonaws.dynamodb#TimeRangeLowerBound", + "traits": { + "smithy.api#documentation": "

Only backups created after this time are listed. TimeRangeLowerBound is inclusive.

" + } + }, + "ExclusiveStartBackupArn": { + "target": "com.amazonaws.dynamodb#BackupArn", + "traits": { + "smithy.api#documentation": "

\n LastEvaluatedBackupArn is the Amazon Resource Name (ARN) of the backup last\n evaluated when the current page of results was returned, inclusive of the current page\n of results. This value may be specified as the ExclusiveStartBackupArn of a\n new ListBackups operation in order to fetch the next page of results.

" + } + }, + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The backups from the table specified by TableName are listed.

" + } + }, + "TimeRangeUpperBound": { + "target": "com.amazonaws.dynamodb#TimeRangeUpperBound", + "traits": { + "smithy.api#documentation": "

Only backups created before this time are listed. TimeRangeUpperBound is exclusive.

" + } + }, + "Limit": { + "target": "com.amazonaws.dynamodb#BackupsInputLimit", + "traits": { + "smithy.api#documentation": "

Maximum number of backups to return at once.

" + } + } + } + }, + "com.amazonaws.dynamodb#ListBackupsOutput": { + "type": "structure", + "members": { + "LastEvaluatedBackupArn": { + "target": "com.amazonaws.dynamodb#BackupArn", + "traits": { + "smithy.api#documentation": "

\n The ARN of the backup last evaluated when the current page of results was returned,\n inclusive of the current page of results. This value may be specified as the\n ExclusiveStartBackupArn of a new ListBackups operation in order to fetch the next page of results.\n

\n

\n If LastEvaluatedBackupArn is empty, then the last page of results has been processed and there are no\n more results to be retrieved.\n

\n

If LastEvaluatedBackupArn is not empty, this may or may not indicate that\n there is more data to be returned. All results are guaranteed to have been returned if\n and only if no value for LastEvaluatedBackupArn is returned.

" + } + }, + "BackupSummaries": { + "target": "com.amazonaws.dynamodb#BackupSummaries", + "traits": { + "smithy.api#documentation": "

List of BackupSummary objects.

" + } + } + } + }, + "com.amazonaws.dynamodb#ListContributorInsights": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#ListContributorInsightsInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#ListContributorInsightsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns a list of ContributorInsightsSummary for a table and all its global secondary indexes.

", + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults" + } + } + }, + "com.amazonaws.dynamodb#ListContributorInsightsInput": { + "type": "structure", + "members": { + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table.

" + } + }, + "NextToken": { + "target": "com.amazonaws.dynamodb#NextTokenString", + "traits": { + "smithy.api#documentation": "

A token to for the desired page, if there is one.

" + } + }, + "MaxResults": { + "target": "com.amazonaws.dynamodb#ListContributorInsightsLimit", + "traits": { + "smithy.api#documentation": "

Maximum number of results to return per page.

" + } + } + } + }, + "com.amazonaws.dynamodb#ListContributorInsightsLimit": { + "type": "integer", + "traits": { + "smithy.api#range": { + "max": 100 + } + } + }, + "com.amazonaws.dynamodb#ListContributorInsightsOutput": { + "type": "structure", + "members": { + "NextToken": { + "target": "com.amazonaws.dynamodb#NextTokenString", + "traits": { + "smithy.api#documentation": "

A token to go to the next page if there is one.

" + } + }, + "ContributorInsightsSummaries": { + "target": "com.amazonaws.dynamodb#ContributorInsightsSummaries", + "traits": { + "smithy.api#documentation": "

A list of ContributorInsightsSummary.

" + } + } + } + }, + "com.amazonaws.dynamodb#ListGlobalTables": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#ListGlobalTablesInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#ListGlobalTablesOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists all global tables that have a replica in the specified Region.

\n \n

This operation only applies to Version 2017.11.29 of global tables.

\n
" + } + }, + "com.amazonaws.dynamodb#ListGlobalTablesInput": { + "type": "structure", + "members": { + "RegionName": { + "target": "com.amazonaws.dynamodb#RegionName", + "traits": { + "smithy.api#documentation": "

Lists the global tables in a specific Region.

" + } + }, + "Limit": { + "target": "com.amazonaws.dynamodb#PositiveIntegerObject", + "traits": { + "smithy.api#documentation": "

The maximum number of table names to return, if the parameter is not specified DynamoDB defaults to 100.

\n

If the number of global tables DynamoDB finds reaches this limit, it stops the operation and returns the table names collected up to that point,\n with a table name in the LastEvaluatedGlobalTableName to apply in a subsequent operation to the ExclusiveStartGlobalTableName parameter.

" + } + }, + "ExclusiveStartGlobalTableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The first global table name that this operation will evaluate.

" + } + } + } + }, + "com.amazonaws.dynamodb#ListGlobalTablesOutput": { + "type": "structure", + "members": { + "GlobalTables": { + "target": "com.amazonaws.dynamodb#GlobalTableList", + "traits": { + "smithy.api#documentation": "

List of global table names.

" + } + }, + "LastEvaluatedGlobalTableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

Last evaluated global table name.

" + } + } + } + }, + "com.amazonaws.dynamodb#ListTables": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#ListTablesInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#ListTablesOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns an array of table names associated with the current account and endpoint. The output\n from ListTables is paginated, with each page returning a maximum of 100 table\n names.

", + "smithy.api#paginated": { + "inputToken": "ExclusiveStartTableName", + "outputToken": "LastEvaluatedTableName", + "items": "TableNames", + "pageSize": "Limit" + } + } + }, + "com.amazonaws.dynamodb#ListTablesInput": { + "type": "structure", + "members": { + "Limit": { + "target": "com.amazonaws.dynamodb#ListTablesInputLimit", + "traits": { + "smithy.api#documentation": "

A maximum number of table names to return. If this parameter is not specified, the limit is 100.

" + } + }, + "ExclusiveStartTableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The first table name that this operation will evaluate. Use the value that was returned for\n LastEvaluatedTableName in a previous operation, so that you can obtain the next page\n of results.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the input of a ListTables operation.

" + } + }, + "com.amazonaws.dynamodb#ListTablesInputLimit": { + "type": "integer", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 1, + "max": 100 + } + } + }, + "com.amazonaws.dynamodb#ListTablesOutput": { + "type": "structure", + "members": { + "LastEvaluatedTableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the last table in the current page of results. Use this value as the\n ExclusiveStartTableName in a new request to obtain the next page of results, until\n all the table names are returned.

\n

If you do not receive a LastEvaluatedTableName value in the response, this means that\n there are no more table names to be retrieved.

" + } + }, + "TableNames": { + "target": "com.amazonaws.dynamodb#TableNameList", + "traits": { + "smithy.api#documentation": "

The names of the tables associated with the current account at the current endpoint. The maximum size of this array is 100.

\n

If LastEvaluatedTableName also appears in the output, you can use this value as the\n ExclusiveStartTableName parameter in a subsequent ListTables request and\n obtain the next page of results.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the output of a ListTables operation.

" + } + }, + "com.amazonaws.dynamodb#ListTagsOfResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#ListTagsOfResourceInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#ListTagsOfResourceOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

List all tags on an Amazon DynamoDB resource. You can call ListTagsOfResource up to 10 times per second, per account.

\n

For an overview on tagging DynamoDB resources, see\n Tagging for DynamoDB\n in the Amazon DynamoDB Developer Guide.

" + } + }, + "com.amazonaws.dynamodb#ListTagsOfResourceInput": { + "type": "structure", + "members": { + "ResourceArn": { + "target": "com.amazonaws.dynamodb#ResourceArnString", + "traits": { + "smithy.api#documentation": "

The Amazon DynamoDB resource with tags to be listed. This value is an Amazon Resource Name (ARN).

", + "smithy.api#required": {} + } + }, + "NextToken": { + "target": "com.amazonaws.dynamodb#NextTokenString", + "traits": { + "smithy.api#documentation": "

An optional string that, if supplied, must be copied from the output of a previous\n call to ListTagOfResource. When provided in this manner, this API fetches the next page of results.

" + } + } + } + }, + "com.amazonaws.dynamodb#ListTagsOfResourceOutput": { + "type": "structure", + "members": { + "NextToken": { + "target": "com.amazonaws.dynamodb#NextTokenString", + "traits": { + "smithy.api#documentation": "

If this value is returned, there are additional results to be displayed. To retrieve them,\n call ListTagsOfResource again, with NextToken set to this value.

" + } + }, + "Tags": { + "target": "com.amazonaws.dynamodb#TagList", + "traits": { + "smithy.api#documentation": "

The tags currently associated with the Amazon DynamoDB resource.

" + } + } + } + }, + "com.amazonaws.dynamodb#LocalSecondaryIndex": { + "type": "structure", + "members": { + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of the local secondary index. The name must be unique among all other indexes on this table.

", + "smithy.api#required": {} + } + }, + "KeySchema": { + "target": "com.amazonaws.dynamodb#KeySchema", + "traits": { + "smithy.api#documentation": "

The complete key schema for the local secondary index, consisting of one or more pairs of attribute names and key types:

\n
    \n
  • \n

    \n HASH - partition key

    \n
  • \n
  • \n

    \n RANGE - sort key

    \n
  • \n
\n \n

The partition key of an item is also known as its hash attribute. The\n term \"hash attribute\" derives from DynamoDB's usage of an internal hash function to\n evenly distribute data items across partitions, based on their partition key values.

\n

The sort key of an item is also known as its range attribute.\n The term \"range attribute\" derives from the way DynamoDB stores items with the same\n partition key physically close together, in sorted order by the sort key value.

\n
", + "smithy.api#required": {} + } + }, + "Projection": { + "target": "com.amazonaws.dynamodb#Projection", + "traits": { + "smithy.api#documentation": "

Represents attributes that are copied (projected) from the table into the local\n secondary index. These are in addition to the primary key attributes and index key\n attributes, which are automatically projected.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the properties of a local secondary index.

" + } + }, + "com.amazonaws.dynamodb#LocalSecondaryIndexDescription": { + "type": "structure", + "members": { + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

Represents the name of the local secondary index.

" + } + }, + "IndexArn": { + "target": "com.amazonaws.dynamodb#String", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) that uniquely identifies the index.

" + } + }, + "IndexSizeBytes": { + "target": "com.amazonaws.dynamodb#Long", + "traits": { + "smithy.api#documentation": "

The total size of the specified index, in bytes. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.

" + } + }, + "Projection": { + "target": "com.amazonaws.dynamodb#Projection", + "traits": { + "smithy.api#documentation": "

Represents attributes that are copied (projected) from the table into the global\n secondary index. These are in addition to the primary key attributes and index key\n attributes, which are automatically projected.

" + } + }, + "KeySchema": { + "target": "com.amazonaws.dynamodb#KeySchema", + "traits": { + "smithy.api#documentation": "

The complete key schema for the local secondary index, consisting of one or more pairs of attribute names and key types:

\n
    \n
  • \n

    \n HASH - partition key

    \n
  • \n
  • \n

    \n RANGE - sort key

    \n
  • \n
\n \n

The partition key of an item is also known as its hash attribute. The\n term \"hash attribute\" derives from DynamoDB's usage of an internal hash function to\n evenly distribute data items across partitions, based on their partition key values.

\n

The sort key of an item is also known as its range attribute.\n The term \"range attribute\" derives from the way DynamoDB stores items with the same\n partition key physically close together, in sorted order by the sort key value.

\n
" + } + }, + "ItemCount": { + "target": "com.amazonaws.dynamodb#Long", + "traits": { + "smithy.api#documentation": "

The number of items in the specified index. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the properties of a local secondary index.

" + } + }, + "com.amazonaws.dynamodb#LocalSecondaryIndexDescriptionList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#LocalSecondaryIndexDescription" + } + }, + "com.amazonaws.dynamodb#LocalSecondaryIndexInfo": { + "type": "structure", + "members": { + "KeySchema": { + "target": "com.amazonaws.dynamodb#KeySchema", + "traits": { + "smithy.api#documentation": "

The complete key schema for a local secondary index, which consists of one or more pairs of attribute names and key types:

\n
    \n
  • \n

    \n HASH - partition key

    \n
  • \n
  • \n

    \n RANGE - sort key

    \n
  • \n
\n \n

The partition key of an item is also known as its hash attribute. The\n term \"hash attribute\" derives from DynamoDB's usage of an internal hash function to\n evenly distribute data items across partitions, based on their partition key values.

\n

The sort key of an item is also known as its range attribute.\n The term \"range attribute\" derives from the way DynamoDB stores items with the same\n partition key physically close together, in sorted order by the sort key value.

\n
" + } + }, + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

Represents the name of the local secondary index.

" + } + }, + "Projection": { + "target": "com.amazonaws.dynamodb#Projection", + "traits": { + "smithy.api#documentation": "

Represents attributes that are copied (projected) from the table into the global secondary index. These are in addition to the primary key attributes and index key attributes, which are automatically projected.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the properties of a local secondary index for the table\n when the backup was created.

" + } + }, + "com.amazonaws.dynamodb#LocalSecondaryIndexList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#LocalSecondaryIndex" + } + }, + "com.amazonaws.dynamodb#LocalSecondaryIndexes": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#LocalSecondaryIndexInfo" + } + }, + "com.amazonaws.dynamodb#Long": { + "type": "long" + }, + "com.amazonaws.dynamodb#MapAttributeValue": { + "type": "map", + "key": { + "target": "com.amazonaws.dynamodb#AttributeName" + }, + "value": { + "target": "com.amazonaws.dynamodb#AttributeValue" + } + }, + "com.amazonaws.dynamodb#NextTokenString": { + "type": "string" + }, + "com.amazonaws.dynamodb#NonKeyAttributeName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + } + } + }, + "com.amazonaws.dynamodb#NonKeyAttributeNameList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#NonKeyAttributeName" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 20 + } + } + }, + "com.amazonaws.dynamodb#NonNegativeLongObject": { + "type": "long", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 0 + } + } + }, + "com.amazonaws.dynamodb#NullAttributeValue": { + "type": "boolean", + "traits": { + "smithy.api#box": {} + } + }, + "com.amazonaws.dynamodb#NumberAttributeValue": { + "type": "string" + }, + "com.amazonaws.dynamodb#NumberSetAttributeValue": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#NumberAttributeValue" + } + }, + "com.amazonaws.dynamodb#PointInTimeRecoveryDescription": { + "type": "structure", + "members": { + "EarliestRestorableDateTime": { + "target": "com.amazonaws.dynamodb#Date", + "traits": { + "smithy.api#documentation": "

Specifies the earliest point in time you can restore your table to. You can restore your\n table to any point in time during the last 35 days.

" + } + }, + "LatestRestorableDateTime": { + "target": "com.amazonaws.dynamodb#Date", + "traits": { + "smithy.api#documentation": "

\n LatestRestorableDateTime is typically 5 minutes before the current time.\n

" + } + }, + "PointInTimeRecoveryStatus": { + "target": "com.amazonaws.dynamodb#PointInTimeRecoveryStatus", + "traits": { + "smithy.api#documentation": "

The current state of point in time recovery:

\n
    \n
  • \n

    \n ENABLING - Point in time recovery is being enabled.

    \n
  • \n
  • \n

    \n ENABLED - Point in time recovery is enabled.

    \n
  • \n
  • \n

    \n DISABLED - Point in time recovery is disabled.

    \n
  • \n
" + } + } + }, + "traits": { + "smithy.api#documentation": "

The description of the point in time settings applied to the table.

" + } + }, + "com.amazonaws.dynamodb#PointInTimeRecoverySpecification": { + "type": "structure", + "members": { + "PointInTimeRecoveryEnabled": { + "target": "com.amazonaws.dynamodb#BooleanObject", + "traits": { + "smithy.api#documentation": "

Indicates whether point in time recovery is enabled (true) or disabled (false) on the table.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the settings used to enable point in time recovery.

" + } + }, + "com.amazonaws.dynamodb#PointInTimeRecoveryStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "ENABLED" + }, + { + "value": "DISABLED" + } + ] + } + }, + "com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

Point in time recovery has not yet been enabled for this source table.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#PositiveIntegerObject": { + "type": "integer", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 1 + } + } + }, + "com.amazonaws.dynamodb#PositiveLongObject": { + "type": "long", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 1 + } + } + }, + "com.amazonaws.dynamodb#Projection": { + "type": "structure", + "members": { + "ProjectionType": { + "target": "com.amazonaws.dynamodb#ProjectionType", + "traits": { + "smithy.api#documentation": "

The set of attributes that are projected into the index:

\n
    \n
  • \n

    \n KEYS_ONLY - Only the index and primary keys are projected into the\n index.

    \n
  • \n
  • \n

    \n INCLUDE - In addition to the attributes described in KEYS_ONLY, the secondary index will include other non-key attributes that you specify.

    \n
  • \n
  • \n

    \n ALL - All of the table attributes are projected into the index.

    \n
  • \n
" + } + }, + "NonKeyAttributes": { + "target": "com.amazonaws.dynamodb#NonKeyAttributeNameList", + "traits": { + "smithy.api#documentation": "

Represents the non-key attribute names which will be projected into the index.

\n

For local secondary indexes, the total count of NonKeyAttributes summed across all of the local secondary indexes,\n must not exceed 20. If you project the same attribute into two\n different indexes, this counts as two distinct attributes when determining the total.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

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.

" + } + }, + "com.amazonaws.dynamodb#ProjectionExpression": { + "type": "string" + }, + "com.amazonaws.dynamodb#ProjectionType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "ALL" + }, + { + "value": "KEYS_ONLY" + }, + { + "value": "INCLUDE" + } + ] + } + }, + "com.amazonaws.dynamodb#ProvisionedThroughput": { + "type": "structure", + "members": { + "ReadCapacityUnits": { + "target": "com.amazonaws.dynamodb#PositiveLongObject", + "traits": { + "smithy.api#documentation": "

The maximum number of strongly consistent reads consumed per second before DynamoDB returns a\n ThrottlingException. For more information, see Specifying Read and Write\n Requirements in the Amazon DynamoDB Developer Guide.

\n

If read/write capacity mode is PAY_PER_REQUEST the value is set to 0.

", + "smithy.api#required": {} + } + }, + "WriteCapacityUnits": { + "target": "com.amazonaws.dynamodb#PositiveLongObject", + "traits": { + "smithy.api#documentation": "

The maximum number of writes consumed per second before DynamoDB returns a\n ThrottlingException. For more information, see Specifying Read and Write\n Requirements in the Amazon DynamoDB Developer Guide.

\n

If read/write capacity mode is PAY_PER_REQUEST the value is set to 0.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the provisioned throughput settings for a specified table or index. The settings\n can be modified using the UpdateTable operation.

\n

For current minimum and maximum provisioned throughput values, see Service, Account, and Table Quotas in the Amazon DynamoDB Developer Guide.

" + } + }, + "com.amazonaws.dynamodb#ProvisionedThroughputDescription": { + "type": "structure", + "members": { + "WriteCapacityUnits": { + "target": "com.amazonaws.dynamodb#NonNegativeLongObject", + "traits": { + "smithy.api#documentation": "

The maximum number of writes consumed per second before DynamoDB returns a\n ThrottlingException.

" + } + }, + "LastIncreaseDateTime": { + "target": "com.amazonaws.dynamodb#Date", + "traits": { + "smithy.api#documentation": "

The date and time of the last provisioned throughput increase for this table.

" + } + }, + "NumberOfDecreasesToday": { + "target": "com.amazonaws.dynamodb#PositiveLongObject", + "traits": { + "smithy.api#documentation": "

The number of provisioned throughput decreases for this table during this UTC calendar day.\n For current maximums on provisioned throughput decreases, see Service, Account, and Table Quotas in the Amazon DynamoDB Developer Guide.

" + } + }, + "ReadCapacityUnits": { + "target": "com.amazonaws.dynamodb#NonNegativeLongObject", + "traits": { + "smithy.api#documentation": "

The maximum number of strongly consistent reads consumed per second before DynamoDB returns a\n ThrottlingException. Eventually consistent reads require less effort than strongly\n consistent reads, so a setting of 50 ReadCapacityUnits per second provides 100\n eventually consistent ReadCapacityUnits per second.

" + } + }, + "LastDecreaseDateTime": { + "target": "com.amazonaws.dynamodb#Date", + "traits": { + "smithy.api#documentation": "

The date and time of the last provisioned throughput decrease for this table.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the provisioned throughput settings for the table, consisting of read and write capacity units, along with data about increases and decreases.

" + } + }, + "com.amazonaws.dynamodb#ProvisionedThroughputExceededException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage", + "traits": { + "smithy.api#documentation": "

You exceeded your maximum allowed provisioned throughput.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Your request rate is too high. The AWS SDKs for DynamoDB automatically retry requests that\n receive this exception. Your request is eventually successful, unless your retry queue is too\n large to finish. Reduce the frequency of requests and use exponential backoff. For more\n information, go to Error Retries and Exponential\n Backoff in the Amazon DynamoDB Developer Guide.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#ProvisionedThroughputOverride": { + "type": "structure", + "members": { + "ReadCapacityUnits": { + "target": "com.amazonaws.dynamodb#PositiveLongObject", + "traits": { + "smithy.api#documentation": "

Replica-specific read capacity units. If not specified, uses the source table's\n read capacity settings.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Replica-specific provisioned throughput settings. If not specified, uses the\n source table's provisioned throughput settings.

" + } + }, + "com.amazonaws.dynamodb#Put": { + "type": "structure", + "members": { + "ExpressionAttributeValues": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeValueMap", + "traits": { + "smithy.api#documentation": "

One or more values that can be substituted in an expression.

" + } + }, + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

Name of the table in which to write the item.

", + "smithy.api#required": {} + } + }, + "ConditionExpression": { + "target": "com.amazonaws.dynamodb#ConditionExpression", + "traits": { + "smithy.api#documentation": "

A condition that must be satisfied in order for a conditional update to succeed.

" + } + }, + "ReturnValuesOnConditionCheckFailure": { + "target": "com.amazonaws.dynamodb#ReturnValuesOnConditionCheckFailure", + "traits": { + "smithy.api#documentation": "

Use ReturnValuesOnConditionCheckFailure to\n get the item attributes if the Put condition fails.\n For ReturnValuesOnConditionCheckFailure, the valid\n values are: NONE and ALL_OLD.

" + } + }, + "ExpressionAttributeNames": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeNameMap", + "traits": { + "smithy.api#documentation": "

One or more substitution tokens for attribute names in an expression.

" + } + }, + "Item": { + "target": "com.amazonaws.dynamodb#PutItemInputAttributeMap", + "traits": { + "smithy.api#documentation": "

A map of attribute name to attribute values, representing the primary key\n of the item to be written by PutItem. All of the table's primary key\n attributes must be specified, and their data types must match those of the table's\n key schema. If any attributes are present in the item that are part of an index\n key schema for the table, their types must match the index key schema.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a request to perform a PutItem operation.

" + } + }, + "com.amazonaws.dynamodb#PutItem": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#PutItemInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#PutItemOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#ConditionalCheckFailedException" + }, + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException" + }, + { + "target": "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" + }, + { + "target": "com.amazonaws.dynamodb#RequestLimitExceeded" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.dynamodb#TransactionConflictException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates a new item, or replaces an old item with a new item. If an item that has the same primary key as the new item already exists in the specified table, the new item completely replaces the existing item. You can perform a conditional put operation (add a new item if one with the specified primary key doesn't exist), or replace an existing item if it has certain attribute values. You can return the item's attribute values in the same operation, using the ReturnValues parameter.

\n \n

This topic provides general information about the PutItem API.

\n

For information on how to call the PutItem API using the AWS SDK in specific languages, see the following:

\n \n
\n\n

When you add an item, the primary key attributes are the only required attributes.\n Attribute values cannot be null.

\n

Empty String and Binary attribute values are allowed. Attribute values of type String and Binary must have a length greater than zero if the attribute is used as a key attribute for a table or index.\n Set type attributes cannot be empty.

\n

Invalid Requests with empty values will\n be rejected with a ValidationException exception.

\n \n

To prevent a new item from replacing an existing item, use a conditional expression\n that contains the attribute_not_exists function with the name of the\n attribute being used as the partition key for the table. Since every record must contain\n that attribute, the attribute_not_exists function will only succeed if\n no matching item exists.

\n
\n

For more information about PutItem, see Working with Items in the Amazon DynamoDB Developer Guide.

" + } + }, + "com.amazonaws.dynamodb#PutItemInput": { + "type": "structure", + "members": { + "ReturnValues": { + "target": "com.amazonaws.dynamodb#ReturnValue", + "traits": { + "smithy.api#documentation": "

Use ReturnValues if you want to get the item attributes as they appeared before they\n were updated with the PutItem request. For PutItem, the valid values are:

\n
    \n
  • \n

    \n NONE - If ReturnValues is not specified, or if its value is\n NONE, then nothing is returned. (This setting is the default for\n ReturnValues.)

    \n
  • \n
  • \n

    \n ALL_OLD - If PutItem overwrote an attribute name-value pair, then the\n content of the old item is returned.

    \n
  • \n
\n \n

The ReturnValues parameter is used by several DynamoDB operations; however,\n PutItem does not recognize any values other than NONE or\n ALL_OLD.

\n
" + } + }, + "ReturnItemCollectionMetrics": { + "target": "com.amazonaws.dynamodb#ReturnItemCollectionMetrics", + "traits": { + "smithy.api#documentation": "

Determines whether item collection metrics are returned. If set to SIZE, the response includes statistics about item collections, if any, that were modified during\n the operation are returned in the response. If set to NONE (the default), no statistics are returned.

" + } + }, + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table to contain the item.

", + "smithy.api#required": {} + } + }, + "Item": { + "target": "com.amazonaws.dynamodb#PutItemInputAttributeMap", + "traits": { + "smithy.api#documentation": "

A map of attribute name/value pairs, one for each attribute. Only the primary key attributes are required; you can optionally provide other attribute name-value pairs for the item.

\n

You must provide all of the attributes for the primary key. 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 both values for both the partition key and the sort key.

\n

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.

\n

Empty String and Binary attribute values are allowed. Attribute values of type String and Binary must have a length greater than zero if the attribute is used as a key attribute for a table or index.

\n \n

For more information about primary keys, see Primary Key in the Amazon DynamoDB Developer\n Guide.

\n

Each element in the Item map is an AttributeValue object.

", + "smithy.api#required": {} + } + }, + "ExpressionAttributeNames": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeNameMap", + "traits": { + "smithy.api#documentation": "

One or more substitution tokens for attribute names in an expression. The following are some use cases for using ExpressionAttributeNames:

\n
    \n
  • \n

    To access an attribute whose name conflicts with a DynamoDB reserved word.

    \n
  • \n
  • \n

    To create a placeholder for repeating occurrences of an attribute name in an expression.

    \n
  • \n
  • \n

    To prevent special characters in an attribute name from being misinterpreted in an expression.

    \n
  • \n
\n

Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:

\n
    \n
  • \n

    \n Percentile\n

    \n
  • \n
\n

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:

\n
    \n
  • \n

    \n {\"#P\":\"Percentile\"}\n

    \n
  • \n
\n

You could then use this substitution in an expression, as in this example:

\n
    \n
  • \n

    \n #P = :val\n

    \n
  • \n
\n \n

Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.

\n
\n

For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer\n Guide.

" + } + }, + "ReturnConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ReturnConsumedCapacity" + }, + "ConditionExpression": { + "target": "com.amazonaws.dynamodb#ConditionExpression", + "traits": { + "smithy.api#documentation": "

A condition that must be satisfied in order for a conditional PutItem operation to\n succeed.

\n

An expression can contain any of the following:

\n
    \n
  • \n

    Functions: attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size\n

    \n

    These function names are case-sensitive.

    \n
  • \n
  • \n

    Comparison operators: = | <> |\n < | > | <= | >= |\n BETWEEN | IN \n

    \n
  • \n
  • \n

    Logical operators: AND | OR | NOT\n

    \n
  • \n
\n

For more information on condition expressions, see Condition Expressions in the Amazon DynamoDB Developer\n Guide.

" + } + }, + "Expected": { + "target": "com.amazonaws.dynamodb#ExpectedAttributeMap", + "traits": { + "smithy.api#documentation": "

This is a legacy parameter. Use ConditionExpression instead. For more information, see\n Expected in the Amazon DynamoDB Developer Guide.

" + } + }, + "ConditionalOperator": { + "target": "com.amazonaws.dynamodb#ConditionalOperator", + "traits": { + "smithy.api#documentation": "

This is a legacy parameter. Use ConditionExpression instead. For more information, see\n ConditionalOperator in the Amazon DynamoDB Developer Guide.

" + } + }, + "ExpressionAttributeValues": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeValueMap", + "traits": { + "smithy.api#documentation": "

One or more values that can be substituted in an expression.

\n

Use the : (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the ProductStatus attribute was one of the following:

\n

\n Available | Backordered | Discontinued\n

\n

You would first need to specify ExpressionAttributeValues as follows:

\n

\n { \":avail\":{\"S\":\"Available\"}, \":back\":{\"S\":\"Backordered\"}, \":disc\":{\"S\":\"Discontinued\"} }\n

\n

You could then use these values in an expression, such as this:

\n

\n ProductStatus IN (:avail, :back, :disc)\n

\n

For more information on expression attribute values, see Condition Expressions in the Amazon DynamoDB Developer\n Guide.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the input of a PutItem operation.

" + } + }, + "com.amazonaws.dynamodb#PutItemInputAttributeMap": { + "type": "map", + "key": { + "target": "com.amazonaws.dynamodb#AttributeName" + }, + "value": { + "target": "com.amazonaws.dynamodb#AttributeValue" + } + }, + "com.amazonaws.dynamodb#PutItemOutput": { + "type": "structure", + "members": { + "ItemCollectionMetrics": { + "target": "com.amazonaws.dynamodb#ItemCollectionMetrics", + "traits": { + "smithy.api#documentation": "

Information about item collections, if any, that were affected by the\n PutItem operation. ItemCollectionMetrics\n is only returned if the ReturnItemCollectionMetrics parameter was specified. If the table does not have any local\n secondary indexes, this information is not returned in the response.

\n

Each ItemCollectionMetrics\n element consists of:

\n
    \n
  • \n

    \n ItemCollectionKey - The partition key value of the item\n collection. This is the same as the partition key value of the item itself.

    \n
  • \n
  • \n

    \n SizeEstimateRangeGB - An estimate of item collection size,\n in gigabytes. This value is a two-element array\n containing a lower bound and an upper bound for the\n estimate. The estimate includes the size of all the\n items in the table, plus the size of all attributes\n projected into all of the local secondary indexes on that\n table. Use this estimate to measure whether a local secondary index is approaching its size limit.

    \n

    The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.

    \n
  • \n
" + } + }, + "ConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ConsumedCapacity", + "traits": { + "smithy.api#documentation": "

The capacity units consumed by the PutItem operation. The data returned\n includes the total provisioned throughput consumed, along with statistics for the table\n and any indexes involved in the operation. ConsumedCapacity is only\n returned if the ReturnConsumedCapacity parameter was specified. For more\n information, see Read/Write Capacity Mode in the Amazon DynamoDB Developer\n Guide.

" + } + }, + "Attributes": { + "target": "com.amazonaws.dynamodb#AttributeMap", + "traits": { + "smithy.api#documentation": "

The attribute values as they appeared before the PutItem operation, but only if\n ReturnValues is specified as ALL_OLD in the request. Each element\n consists of an attribute name and an attribute value.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the output of a PutItem operation.

" + } + }, + "com.amazonaws.dynamodb#PutRequest": { + "type": "structure", + "members": { + "Item": { + "target": "com.amazonaws.dynamodb#PutItemInputAttributeMap", + "traits": { + "smithy.api#documentation": "

A map of attribute name to attribute values, representing the primary key of an item to\n be processed by PutItem. All of the table's primary key attributes must be\n specified, and their data types must match those of the table's key schema. If any\n attributes are present in the item that are part of an index key schema for the table,\n their types must match the index key schema.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a request to perform a PutItem operation on an item.

" + } + }, + "com.amazonaws.dynamodb#Query": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#QueryInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#QueryOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" + }, + { + "target": "com.amazonaws.dynamodb#RequestLimitExceeded" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

The Query operation finds items based on primary key values.\n You can query any table or secondary index that has a composite primary key (a partition\n key and a sort key).\n

\n

Use the KeyConditionExpression parameter to provide a specific value\n for the partition key. The Query operation will return all of the items\n from the table or index with that partition key value. You can optionally narrow the\n scope of the Query operation by specifying a sort key value and a\n comparison operator in KeyConditionExpression. To further refine the Query results,\n you can optionally provide a FilterExpression. A FilterExpression determines which items\n within the results should be returned to you. All of the other results are discarded.\n

\n

\n A Query operation always returns a result set. If no matching items are found,\n the result set will be empty. Queries that do not return results consume the minimum number of\n read capacity units for that type of read operation.\n

\n \n

\n DynamoDB calculates the number of read capacity units consumed based on item size,\n not on the amount of data that is returned to an application. The number of capacity\n units consumed will be the same whether you request all of the attributes (the default behavior)\n or just some of them (using a projection expression). The number will also be the same\n whether or not you use a FilterExpression.\n

\n
\n

\n Query results are always sorted by the sort key value. If the data type of the sort key is Number,\n the results are returned in numeric order; otherwise, the results are returned in order of UTF-8 bytes.\n By default, the sort order is ascending. To reverse the order, set the ScanIndexForward parameter\n to false.\n

\n

A single Query operation will read up to the maximum number of items\n set (if using the Limit parameter) or a maximum of 1 MB of data and then\n apply any filtering to the results using FilterExpression. If\n LastEvaluatedKey is present in the response, you will need to paginate\n the result set. For more information, see Paginating\n the Results in the Amazon DynamoDB Developer Guide.

\n

\n FilterExpression is applied after a Query finishes, but before\n the results are returned.\n A FilterExpression cannot contain partition key or sort key attributes.\n You need to specify those attributes in the KeyConditionExpression.\n

\n \n

\n A Query operation can return an empty result set and a LastEvaluatedKey\n if all the items read for the page of results are filtered out.\n

\n
\n

You can query a table, a local secondary index, or a global secondary index. For a\n query on a table or on a local secondary index, you can set the\n ConsistentRead parameter to true and obtain a\n strongly consistent result. Global secondary indexes support eventually consistent reads\n only, so do not specify ConsistentRead when querying a global\n secondary index.

" + } + }, + "com.amazonaws.dynamodb#QueryInput": { + "type": "structure", + "members": { + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table containing the requested items.

", + "smithy.api#required": {} + } + }, + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of an index to query. This index can be any local secondary index or global secondary index on the table. Note that\n if you use the IndexName parameter, you must also provide TableName.\n

" + } + }, + "KeyConditions": { + "target": "com.amazonaws.dynamodb#KeyConditions", + "traits": { + "smithy.api#documentation": "

This is a legacy parameter. Use KeyConditionExpression instead. For more information, see\n KeyConditions in the Amazon DynamoDB Developer Guide.

" + } + }, + "ScanIndexForward": { + "target": "com.amazonaws.dynamodb#BooleanObject", + "traits": { + "smithy.api#documentation": "

Specifies the order for index traversal: If true (default), the traversal is performed in ascending order; if false, the traversal is performed in descending order.

\n

Items with the same partition key value are stored in sorted order by sort key. If the sort key data type is Number, the results are stored in numeric order. For type String, the results are stored in order of UTF-8 bytes. For type Binary, DynamoDB treats each byte of the binary data as unsigned.

\n

If ScanIndexForward is true, DynamoDB returns the results in the order in which they are stored (by sort key value). This is the default behavior. If ScanIndexForward is false, DynamoDB reads the results in reverse order by sort key value, and then returns the results to the client.

" + } + }, + "ExpressionAttributeNames": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeNameMap", + "traits": { + "smithy.api#documentation": "

One or more substitution tokens for attribute names in an expression. The following are some use cases for using ExpressionAttributeNames:

\n
    \n
  • \n

    To access an attribute whose name conflicts with a DynamoDB reserved word.

    \n
  • \n
  • \n

    To create a placeholder for repeating occurrences of an attribute name in an expression.

    \n
  • \n
  • \n

    To prevent special characters in an attribute name from being misinterpreted in an expression.

    \n
  • \n
\n

Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:

\n
    \n
  • \n

    \n Percentile\n

    \n
  • \n
\n

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\n ExpressionAttributeNames:

\n
    \n
  • \n

    \n {\"#P\":\"Percentile\"}\n

    \n
  • \n
\n

You could then use this substitution in an expression, as in this example:

\n
    \n
  • \n

    \n #P = :val\n

    \n
  • \n
\n \n

Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.

\n
\n

For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer\n Guide.

" + } + }, + "AttributesToGet": { + "target": "com.amazonaws.dynamodb#AttributeNameList", + "traits": { + "smithy.api#documentation": "

This is a legacy parameter. Use ProjectionExpression instead. For more information, see\n AttributesToGet in the Amazon DynamoDB Developer Guide.

" + } + }, + "ReturnConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ReturnConsumedCapacity" + }, + "QueryFilter": { + "target": "com.amazonaws.dynamodb#FilterConditionMap", + "traits": { + "smithy.api#documentation": "

This is a legacy parameter. Use FilterExpression instead. For more information, see\n QueryFilter in the Amazon DynamoDB Developer Guide.

" + } + }, + "ExpressionAttributeValues": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeValueMap", + "traits": { + "smithy.api#documentation": "

One or more values that can be substituted in an expression.

\n

Use the : (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the\n ProductStatus attribute was one of the following:

\n

\n Available | Backordered | Discontinued\n

\n

You would first need to specify ExpressionAttributeValues as follows:

\n

\n { \":avail\":{\"S\":\"Available\"}, \":back\":{\"S\":\"Backordered\"}, \":disc\":{\"S\":\"Discontinued\"} }\n

\n

You could then use these values in an expression, such as this:

\n

\n ProductStatus IN (:avail, :back, :disc)\n

\n

For more information on expression attribute values, see Specifying Conditions in the Amazon DynamoDB Developer Guide.

" + } + }, + "ProjectionExpression": { + "target": "com.amazonaws.dynamodb#ProjectionExpression", + "traits": { + "smithy.api#documentation": "

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.

\n

If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.

\n

For more information, see\n Accessing Item Attributes in the Amazon DynamoDB Developer Guide.

" + } + }, + "ConsistentRead": { + "target": "com.amazonaws.dynamodb#ConsistentRead", + "traits": { + "smithy.api#documentation": "

Determines the read consistency model: If set to true, then the operation uses strongly consistent reads; otherwise, the operation uses eventually consistent reads.

\n

Strongly consistent reads\n are not supported on global secondary indexes. If you query a global secondary index with ConsistentRead set to\n true, you will receive a ValidationException.

" + } + }, + "KeyConditionExpression": { + "target": "com.amazonaws.dynamodb#KeyExpression", + "traits": { + "smithy.api#documentation": "

The condition that specifies the key values for items to be retrieved by the\n Query action.

\n\n

The condition must perform an equality test on a single partition key value.

\n

The condition can optionally perform one of several comparison tests on a single\n sort key value. This allows Query to retrieve one item with a given\n partition key value and sort key value, or several items that have the same partition\n key value but different sort key values.

\n\n

The partition key equality test is required, and must be specified in the following format:

\n\n

\n partitionKeyName\n =\n :partitionkeyval\n

\n\n

If you also want to provide a condition for the sort key, it must be combined using AND with the condition\n for the sort key. Following is an example, using the = comparison operator for the sort key:

\n\n

\n partitionKeyName\n =\n :partitionkeyval\n AND\n sortKeyName\n =\n :sortkeyval\n

\n

Valid comparisons for the sort key condition are as follows:

\n
    \n
  • \n

    \n sortKeyName\n =\n :sortkeyval - true if the sort key value is equal to :sortkeyval.

    \n
  • \n
  • \n

    \n sortKeyName\n <\n :sortkeyval - true if the sort key value is less than :sortkeyval.

    \n
  • \n
  • \n

    \n sortKeyName\n <=\n :sortkeyval - true if the sort key value is less than or equal to\n :sortkeyval.

    \n
  • \n
  • \n

    \n sortKeyName\n >\n :sortkeyval - true if the sort key value is greater than :sortkeyval.

    \n
  • \n
  • \n

    \n sortKeyName\n >= \n :sortkeyval - true if the sort key value is greater than\n or equal to :sortkeyval.

    \n
  • \n
  • \n

    \n sortKeyName\n BETWEEN\n :sortkeyval1\n AND\n :sortkeyval2 - true if the sort key value is greater than or equal to\n :sortkeyval1, and less than or equal to :sortkeyval2.

    \n
  • \n
  • \n

    \n begins_with (\n sortKeyName, :sortkeyval\n ) -\n true if the sort key value begins with a particular operand. (You cannot use this function with a sort key that is of type Number.) Note that the function name\n begins_with is case-sensitive.

    \n\n
  • \n
\n\n

Use the ExpressionAttributeValues parameter to replace tokens such as\n :partitionval and :sortval with actual values at runtime.

\n\n

You can optionally use the ExpressionAttributeNames parameter to replace the names of\n the partition key and sort key with placeholder tokens. This option might be necessary if an attribute\n name conflicts with a DynamoDB reserved word. For example, the following\n KeyConditionExpression parameter causes an error because Size is a reserved\n word:

\n
    \n
  • \n

    \n Size = :myval\n

    \n
  • \n
\n

To work around this, define a placeholder (such a #S) to represent the attribute\n name Size. KeyConditionExpression then is as follows:

\n
    \n
  • \n

    \n #S = :myval\n

    \n
  • \n
\n

For a list of reserved words, see Reserved\n Words in the Amazon DynamoDB Developer Guide.

\n\n

For more information on ExpressionAttributeNames and ExpressionAttributeValues,\n see Using Placeholders for Attribute\n Names and Values in the Amazon DynamoDB Developer Guide.

" + } + }, + "Select": { + "target": "com.amazonaws.dynamodb#Select", + "traits": { + "smithy.api#documentation": "

The attributes to be returned in the\n result. You can retrieve all item attributes, specific item attributes, the count of\n matching items, or in the case of an index, some or all of the attributes projected into\n the index.

\n
    \n
  • \n

    \n ALL_ATTRIBUTES - Returns all of the item attributes from the\n specified table or index. If you query a local secondary index, then for each\n matching item in the index, DynamoDB fetches the entire item from the parent\n table. If the index is configured to project all item attributes, then all of\n the data can be obtained from the local secondary index, and no fetching is\n required.

    \n
  • \n
  • \n

    \n ALL_PROJECTED_ATTRIBUTES - Allowed only when querying an index.\n Retrieves all attributes that have been projected into the index. If the\n index is configured to project all attributes, this return value is\n equivalent to specifying ALL_ATTRIBUTES.

    \n
  • \n
  • \n

    \n COUNT - Returns the number of matching items, rather than the\n matching items themselves.

    \n
  • \n
  • \n

    \n SPECIFIC_ATTRIBUTES - Returns only the attributes listed in\n AttributesToGet. This return value is equivalent to\n specifying AttributesToGet without specifying any value\n for Select.

    \n

    If you query or scan a local secondary index and request only attributes that\n are projected into that index, the operation will read only the index and not\n the table. If any of the requested attributes are not projected into the local\n secondary index, DynamoDB fetches each of these attributes from the parent\n table. This extra fetching incurs additional throughput cost and latency.

    \n

    If you query or scan a global secondary index, you can only request\n attributes that are projected into the index. Global secondary index queries\n cannot fetch attributes from the parent table.

    \n
  • \n
\n

If neither Select nor AttributesToGet\n are specified, DynamoDB defaults to ALL_ATTRIBUTES when accessing a\n table, and ALL_PROJECTED_ATTRIBUTES when accessing an index. You cannot\n use both Select and AttributesToGet\n together in a single request, unless the value for Select is\n SPECIFIC_ATTRIBUTES. (This usage is equivalent to specifying\n AttributesToGet without any value for\n Select.)

\n \n

If you use the ProjectionExpression parameter, then\n the value for Select can only be\n SPECIFIC_ATTRIBUTES. Any other value for\n Select will return an error.

\n
" + } + }, + "ConditionalOperator": { + "target": "com.amazonaws.dynamodb#ConditionalOperator", + "traits": { + "smithy.api#documentation": "

This is a legacy parameter. Use FilterExpression instead. For more information, see\n ConditionalOperator in the Amazon DynamoDB Developer Guide.

" + } + }, + "Limit": { + "target": "com.amazonaws.dynamodb#PositiveIntegerObject", + "traits": { + "smithy.api#documentation": "

The maximum number of items to evaluate (not necessarily the number of matching items).\n If DynamoDB processes the number of items up to the limit while processing the results,\n it stops the operation and returns the matching values up to that point, and a key in\n LastEvaluatedKey to apply in a subsequent operation, so that you can\n pick up where you left off. Also, if the processed dataset size exceeds 1 MB before\n DynamoDB reaches this limit, it stops the operation and returns the matching values up\n to the limit, and a key in LastEvaluatedKey to apply in a subsequent\n operation to continue the operation. For more information, see Query and Scan in the Amazon DynamoDB Developer\n Guide.

" + } + }, + "ExclusiveStartKey": { + "target": "com.amazonaws.dynamodb#Key", + "traits": { + "smithy.api#documentation": "

The primary key of the first item that this operation will evaluate. Use the value that was returned for LastEvaluatedKey in the previous operation.

\n

The data type for ExclusiveStartKey must be String, Number, or Binary. No\n set data types are allowed.

" + } + }, + "FilterExpression": { + "target": "com.amazonaws.dynamodb#ConditionExpression", + "traits": { + "smithy.api#documentation": "

A string that contains conditions that DynamoDB applies after the Query operation, but\n before the data is returned to you. Items that do not satisfy the FilterExpression\n criteria are not returned.

\n

A FilterExpression does not allow key attributes. You cannot define a filter expression based on a partition key or a sort key.

\n \n

A FilterExpression is applied after the items have already been read; the process of\n filtering does not consume any additional read capacity units.

\n
\n

For more information, see Filter\n Expressions in the Amazon DynamoDB Developer Guide.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the input of a Query operation.

" + } + }, + "com.amazonaws.dynamodb#QueryOutput": { + "type": "structure", + "members": { + "Items": { + "target": "com.amazonaws.dynamodb#ItemList", + "traits": { + "smithy.api#documentation": "

An array of item attributes that match the query criteria. Each element in this array consists of an attribute name and the value for that attribute.

" + } + }, + "LastEvaluatedKey": { + "target": "com.amazonaws.dynamodb#Key", + "traits": { + "smithy.api#documentation": "

The primary key of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request.

\n

If LastEvaluatedKey is empty, then the \"last page\" of results has been processed and there is no more data to be retrieved.

\n

If LastEvaluatedKey is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when LastEvaluatedKey is empty.

" + } + }, + "ConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ConsumedCapacity", + "traits": { + "smithy.api#documentation": "

The capacity units consumed by the Query operation. The data returned\n includes the total provisioned throughput consumed, along with statistics for the table\n and any indexes involved in the operation. ConsumedCapacity is only\n returned if the ReturnConsumedCapacity parameter was specified. For more\n information, see Provisioned Throughput in the Amazon DynamoDB Developer\n Guide.

" + } + }, + "ScannedCount": { + "target": "com.amazonaws.dynamodb#Integer", + "traits": { + "smithy.api#documentation": "

The number of items evaluated, before any QueryFilter is applied. A high\n ScannedCount value with few, or no, Count results indicates an inefficient\n Query operation. For more information, see Count and ScannedCount in the\n Amazon DynamoDB Developer Guide.

\n

If you did not use a filter in the request, then ScannedCount is the same as\n Count.

" + } + }, + "Count": { + "target": "com.amazonaws.dynamodb#Integer", + "traits": { + "smithy.api#documentation": "

The number of items in the response.

\n

If you used a QueryFilter in the request, then Count is the number of items\n returned after the filter was applied, and ScannedCount is the number of\n matching items before the filter was applied.

\n

If you did not use a filter in the request, then Count and ScannedCount are the\n same.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the output of a Query operation.

" + } + }, + "com.amazonaws.dynamodb#RegionName": { + "type": "string" + }, + "com.amazonaws.dynamodb#Replica": { + "type": "structure", + "members": { + "RegionName": { + "target": "com.amazonaws.dynamodb#RegionName", + "traits": { + "smithy.api#documentation": "

The Region where the replica needs to be created.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the properties of a replica.

" + } + }, + "com.amazonaws.dynamodb#ReplicaAlreadyExistsException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

The specified replica is already part of the global table.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#ReplicaAutoScalingDescription": { + "type": "structure", + "members": { + "RegionName": { + "target": "com.amazonaws.dynamodb#RegionName", + "traits": { + "smithy.api#documentation": "

The Region where the replica exists.

" + } + }, + "GlobalSecondaryIndexes": { + "target": "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexAutoScalingDescriptionList", + "traits": { + "smithy.api#documentation": "

Replica-specific global secondary index auto scaling settings.

" + } + }, + "ReplicaProvisionedReadCapacityAutoScalingSettings": { + "target": "com.amazonaws.dynamodb#AutoScalingSettingsDescription" + }, + "ReplicaProvisionedWriteCapacityAutoScalingSettings": { + "target": "com.amazonaws.dynamodb#AutoScalingSettingsDescription" + }, + "ReplicaStatus": { + "target": "com.amazonaws.dynamodb#ReplicaStatus", + "traits": { + "smithy.api#documentation": "

The current state of the replica:

\n
    \n
  • \n

    \n CREATING - The replica is being created.

    \n
  • \n
  • \n

    \n UPDATING - The replica is being updated.

    \n
  • \n
  • \n

    \n DELETING - The replica is being deleted.

    \n
  • \n
  • \n

    \n ACTIVE - The replica is ready for use.

    \n
  • \n
" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the auto scaling settings of the replica.

" + } + }, + "com.amazonaws.dynamodb#ReplicaAutoScalingDescriptionList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#ReplicaAutoScalingDescription" + } + }, + "com.amazonaws.dynamodb#ReplicaAutoScalingUpdate": { + "type": "structure", + "members": { + "ReplicaGlobalSecondaryIndexUpdates": { + "target": "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexAutoScalingUpdateList", + "traits": { + "smithy.api#documentation": "

Represents the auto scaling settings of global secondary indexes that will\n be modified.

" + } + }, + "ReplicaProvisionedReadCapacityAutoScalingUpdate": { + "target": "com.amazonaws.dynamodb#AutoScalingSettingsUpdate" + }, + "RegionName": { + "target": "com.amazonaws.dynamodb#RegionName", + "traits": { + "smithy.api#documentation": "

The Region where the replica exists.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the auto scaling settings of a replica that will be modified.

" + } + }, + "com.amazonaws.dynamodb#ReplicaAutoScalingUpdateList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#ReplicaAutoScalingUpdate" + }, + "traits": { + "smithy.api#length": { + "min": 1 + } + } + }, + "com.amazonaws.dynamodb#ReplicaDescription": { + "type": "structure", + "members": { + "GlobalSecondaryIndexes": { + "target": "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexDescriptionList", + "traits": { + "smithy.api#documentation": "

Replica-specific global secondary index settings.

" + } + }, + "ProvisionedThroughputOverride": { + "target": "com.amazonaws.dynamodb#ProvisionedThroughputOverride", + "traits": { + "smithy.api#documentation": "

Replica-specific provisioned throughput. If not described, uses the source table's\n provisioned throughput settings.

" + } + }, + "KMSMasterKeyId": { + "target": "com.amazonaws.dynamodb#KMSMasterKeyId", + "traits": { + "smithy.api#documentation": "

The AWS KMS customer master key (CMK) of the replica that will be used for AWS KMS\n encryption.

" + } + }, + "ReplicaInaccessibleDateTime": { + "target": "com.amazonaws.dynamodb#Date", + "traits": { + "smithy.api#documentation": "

The time at which the replica was first detected as inaccessible. To determine cause of inaccessibility check the ReplicaStatus property.

" + } + }, + "RegionName": { + "target": "com.amazonaws.dynamodb#RegionName", + "traits": { + "smithy.api#documentation": "

The name of the Region.

" + } + }, + "ReplicaStatusDescription": { + "target": "com.amazonaws.dynamodb#ReplicaStatusDescription", + "traits": { + "smithy.api#documentation": "

Detailed information about the replica status.

" + } + }, + "ReplicaStatus": { + "target": "com.amazonaws.dynamodb#ReplicaStatus", + "traits": { + "smithy.api#documentation": "

The current state of the replica:

\n
    \n
  • \n

    \n CREATING - The replica is being created.

    \n
  • \n
  • \n

    \n UPDATING - The replica is being updated.

    \n
  • \n
  • \n

    \n DELETING - The replica is being deleted.

    \n
  • \n
  • \n

    \n ACTIVE - The replica is ready for use.

    \n
  • \n
  • \n

    \n REGION_DISABLED - The replica is inaccessible because the AWS Region has been disabled.

    \n \n

    If the AWS Region remains inaccessible for more than 20 hours, DynamoDB will remove this replica from the replication group. The replica will not be deleted and replication will stop from and to this region.

    \n
    \n
  • \n
" + } + }, + "ReplicaStatusPercentProgress": { + "target": "com.amazonaws.dynamodb#ReplicaStatusPercentProgress", + "traits": { + "smithy.api#documentation": "

Specifies the progress of a Create, Update, or Delete action on the replica\n as a percentage.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Contains the details of the replica.

" + } + }, + "com.amazonaws.dynamodb#ReplicaDescriptionList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#ReplicaDescription" + } + }, + "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndex": { + "type": "structure", + "members": { + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of the global secondary index.

", + "smithy.api#required": {} + } + }, + "ProvisionedThroughputOverride": { + "target": "com.amazonaws.dynamodb#ProvisionedThroughputOverride", + "traits": { + "smithy.api#documentation": "

Replica table GSI-specific provisioned throughput. If not specified, uses the\n source table GSI's read capacity settings.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the properties of a replica global secondary index.

" + } + }, + "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexAutoScalingDescription": { + "type": "structure", + "members": { + "ProvisionedWriteCapacityAutoScalingSettings": { + "target": "com.amazonaws.dynamodb#AutoScalingSettingsDescription" + }, + "ProvisionedReadCapacityAutoScalingSettings": { + "target": "com.amazonaws.dynamodb#AutoScalingSettingsDescription" + }, + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of the global secondary index.

" + } + }, + "IndexStatus": { + "target": "com.amazonaws.dynamodb#IndexStatus", + "traits": { + "smithy.api#documentation": "

The current state of the replica global secondary index:

\n
    \n
  • \n

    \n CREATING - The index is being created.

    \n
  • \n
  • \n

    \n UPDATING - The index is being updated.

    \n
  • \n
  • \n

    \n DELETING - The index is being deleted.

    \n
  • \n
  • \n

    \n ACTIVE - The index is ready for use.

    \n
  • \n
" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the auto scaling configuration for a replica global secondary index.

" + } + }, + "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexAutoScalingDescriptionList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexAutoScalingDescription" + } + }, + "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexAutoScalingUpdate": { + "type": "structure", + "members": { + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of the global secondary index.

" + } + }, + "ProvisionedReadCapacityAutoScalingUpdate": { + "target": "com.amazonaws.dynamodb#AutoScalingSettingsUpdate" + } + }, + "traits": { + "smithy.api#documentation": "

Represents the auto scaling settings of a global secondary index for a replica\n that will be modified.

" + } + }, + "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexAutoScalingUpdateList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexAutoScalingUpdate" + } + }, + "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexDescription": { + "type": "structure", + "members": { + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of the global secondary index.

" + } + }, + "ProvisionedThroughputOverride": { + "target": "com.amazonaws.dynamodb#ProvisionedThroughputOverride", + "traits": { + "smithy.api#documentation": "

If not described, uses the source table GSI's read capacity settings.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the properties of a replica global secondary index.

" + } + }, + "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexDescriptionList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexDescription" + } + }, + "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndex" + }, + "traits": { + "smithy.api#length": { + "min": 1 + } + } + }, + "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexSettingsDescription": { + "type": "structure", + "members": { + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of the global secondary index. The name must be unique among all other indexes on this table.

", + "smithy.api#required": {} + } + }, + "ProvisionedReadCapacityUnits": { + "target": "com.amazonaws.dynamodb#PositiveLongObject", + "traits": { + "smithy.api#documentation": "

The maximum number of strongly consistent reads consumed per second before DynamoDB returns a ThrottlingException.

" + } + }, + "ProvisionedWriteCapacityAutoScalingSettings": { + "target": "com.amazonaws.dynamodb#AutoScalingSettingsDescription", + "traits": { + "smithy.api#documentation": "

Auto scaling settings for a global secondary index replica's write capacity\n units.

" + } + }, + "ProvisionedWriteCapacityUnits": { + "target": "com.amazonaws.dynamodb#PositiveLongObject", + "traits": { + "smithy.api#documentation": "

The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException.

" + } + }, + "IndexStatus": { + "target": "com.amazonaws.dynamodb#IndexStatus", + "traits": { + "smithy.api#documentation": "

\n The current status of the global secondary index:

\n
    \n
  • \n

    \n CREATING - The global secondary index is being created.

    \n
  • \n
  • \n

    \n UPDATING - The global secondary index is being updated.

    \n
  • \n
  • \n

    \n DELETING - The global secondary index is being deleted.

    \n
  • \n
  • \n

    \n ACTIVE - The global secondary index is ready for use.

    \n
  • \n
" + } + }, + "ProvisionedReadCapacityAutoScalingSettings": { + "target": "com.amazonaws.dynamodb#AutoScalingSettingsDescription", + "traits": { + "smithy.api#documentation": "

Auto scaling settings for a global secondary index replica's read capacity units.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the properties of a global secondary index.

" + } + }, + "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexSettingsDescriptionList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexSettingsDescription" + } + }, + "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexSettingsUpdate": { + "type": "structure", + "members": { + "ProvisionedReadCapacityAutoScalingSettingsUpdate": { + "target": "com.amazonaws.dynamodb#AutoScalingSettingsUpdate", + "traits": { + "smithy.api#documentation": "

Auto scaling settings for managing a global secondary index replica's read capacity\n units.

" + } + }, + "ProvisionedReadCapacityUnits": { + "target": "com.amazonaws.dynamodb#PositiveLongObject", + "traits": { + "smithy.api#documentation": "

The maximum number of strongly consistent reads consumed per second before DynamoDB returns a ThrottlingException.

" + } + }, + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of the global secondary index. The name must be unique among all other indexes on this table.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the settings of a global secondary index for a global table that will be modified.

" + } + }, + "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexSettingsUpdateList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexSettingsUpdate" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 20 + } + } + }, + "com.amazonaws.dynamodb#ReplicaList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#Replica" + } + }, + "com.amazonaws.dynamodb#ReplicaNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

The specified replica is no longer part of the global table.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#ReplicaSettingsDescription": { + "type": "structure", + "members": { + "ReplicaProvisionedReadCapacityUnits": { + "target": "com.amazonaws.dynamodb#NonNegativeLongObject", + "traits": { + "smithy.api#documentation": "

The maximum number of strongly consistent reads consumed per second before DynamoDB returns a ThrottlingException.\n For more information, see Specifying Read and Write\n Requirements in the Amazon DynamoDB Developer Guide.\n

" + } + }, + "ReplicaProvisionedReadCapacityAutoScalingSettings": { + "target": "com.amazonaws.dynamodb#AutoScalingSettingsDescription", + "traits": { + "smithy.api#documentation": "

Auto scaling settings for a global table replica's read capacity units.

" + } + }, + "RegionName": { + "target": "com.amazonaws.dynamodb#RegionName", + "traits": { + "smithy.api#documentation": "

The Region name of the replica.

", + "smithy.api#required": {} + } + }, + "ReplicaProvisionedWriteCapacityUnits": { + "target": "com.amazonaws.dynamodb#NonNegativeLongObject", + "traits": { + "smithy.api#documentation": "

The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException.\n For more information, see Specifying Read and Write\n Requirements in the Amazon DynamoDB Developer Guide.

" + } + }, + "ReplicaStatus": { + "target": "com.amazonaws.dynamodb#ReplicaStatus", + "traits": { + "smithy.api#documentation": "

The current state of the Region:

\n
    \n
  • \n

    \n CREATING - The Region is being created.

    \n
  • \n
  • \n

    \n UPDATING - The Region is being updated.

    \n
  • \n
  • \n

    \n DELETING - The Region is being deleted.

    \n
  • \n
  • \n

    \n ACTIVE - The Region is ready for use.

    \n
  • \n
" + } + }, + "ReplicaBillingModeSummary": { + "target": "com.amazonaws.dynamodb#BillingModeSummary", + "traits": { + "smithy.api#documentation": "

The read/write capacity mode of the replica.

" + } + }, + "ReplicaGlobalSecondaryIndexSettings": { + "target": "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexSettingsDescriptionList", + "traits": { + "smithy.api#documentation": "

Replica global secondary index settings for the global table.

" + } + }, + "ReplicaProvisionedWriteCapacityAutoScalingSettings": { + "target": "com.amazonaws.dynamodb#AutoScalingSettingsDescription", + "traits": { + "smithy.api#documentation": "

Auto scaling settings for a global table replica's write capacity units.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the properties of a replica.

" + } + }, + "com.amazonaws.dynamodb#ReplicaSettingsDescriptionList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#ReplicaSettingsDescription" + } + }, + "com.amazonaws.dynamodb#ReplicaSettingsUpdate": { + "type": "structure", + "members": { + "ReplicaGlobalSecondaryIndexSettingsUpdate": { + "target": "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexSettingsUpdateList", + "traits": { + "smithy.api#documentation": "

Represents the settings of a global secondary index for a global table that will be modified.

" + } + }, + "ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate": { + "target": "com.amazonaws.dynamodb#AutoScalingSettingsUpdate", + "traits": { + "smithy.api#documentation": "

Auto scaling settings for managing a global table replica's read capacity units.

" + } + }, + "ReplicaProvisionedReadCapacityUnits": { + "target": "com.amazonaws.dynamodb#PositiveLongObject", + "traits": { + "smithy.api#documentation": "

The maximum number of strongly consistent reads consumed per second before DynamoDB returns a ThrottlingException.\n For more information, see Specifying Read and Write\n Requirements in the Amazon DynamoDB Developer Guide.\n

" + } + }, + "RegionName": { + "target": "com.amazonaws.dynamodb#RegionName", + "traits": { + "smithy.api#documentation": "

The Region of the replica to be added.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the settings for a global table in a Region that will be modified.

" + } + }, + "com.amazonaws.dynamodb#ReplicaSettingsUpdateList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#ReplicaSettingsUpdate" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 50 + } + } + }, + "com.amazonaws.dynamodb#ReplicaStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "CREATING" + }, + { + "value": "CREATION_FAILED" + }, + { + "value": "UPDATING" + }, + { + "value": "DELETING" + }, + { + "value": "ACTIVE" + }, + { + "value": "REGION_DISABLED" + } + ] + } + }, + "com.amazonaws.dynamodb#ReplicaStatusDescription": { + "type": "string" + }, + "com.amazonaws.dynamodb#ReplicaStatusPercentProgress": { + "type": "string" + }, + "com.amazonaws.dynamodb#ReplicaUpdate": { + "type": "structure", + "members": { + "Create": { + "target": "com.amazonaws.dynamodb#CreateReplicaAction", + "traits": { + "smithy.api#documentation": "

The parameters required for creating a replica on an existing global table.

" + } + }, + "Delete": { + "target": "com.amazonaws.dynamodb#DeleteReplicaAction", + "traits": { + "smithy.api#documentation": "

The name of the existing replica to be removed.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents one of the following:

\n
    \n
  • \n

    A new replica to be added to an existing global table.

    \n
  • \n
  • \n

    New parameters for an existing replica.

    \n
  • \n
  • \n

    An existing replica to be removed from an existing global table.

    \n
  • \n
" + } + }, + "com.amazonaws.dynamodb#ReplicaUpdateList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#ReplicaUpdate" + } + }, + "com.amazonaws.dynamodb#ReplicationGroupUpdate": { + "type": "structure", + "members": { + "Delete": { + "target": "com.amazonaws.dynamodb#DeleteReplicationGroupMemberAction", + "traits": { + "smithy.api#documentation": "

The parameters required for deleting a replica for the table.

" + } + }, + "Create": { + "target": "com.amazonaws.dynamodb#CreateReplicationGroupMemberAction", + "traits": { + "smithy.api#documentation": "

The parameters required for creating a replica for the table.

" + } + }, + "Update": { + "target": "com.amazonaws.dynamodb#UpdateReplicationGroupMemberAction", + "traits": { + "smithy.api#documentation": "

The parameters required for updating a replica for the table.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents one of the following:

\n
    \n
  • \n

    A new replica to be added to an existing regional table or global table. This\n request invokes the CreateTableReplica action in the destination\n Region.

    \n
  • \n
  • \n

    New parameters for an existing replica. This request invokes the\n UpdateTable action in the destination Region.

    \n
  • \n
  • \n

    An existing replica to be deleted. The request invokes the \n DeleteTableReplica action in the destination Region, deleting the\n replica and all if its items in the destination Region.

    \n
  • \n
" + } + }, + "com.amazonaws.dynamodb#ReplicationGroupUpdateList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#ReplicationGroupUpdate" + }, + "traits": { + "smithy.api#length": { + "min": 1 + } + } + }, + "com.amazonaws.dynamodb#RequestLimitExceeded": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

Throughput exceeds the current throughput quota for your account. Please contact AWS Support at AWS Support to request a quota increase.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#ResourceArnString": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1283 + } + } + }, + "com.amazonaws.dynamodb#ResourceInUseException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage", + "traits": { + "smithy.api#documentation": "

The resource which is being attempted to be changed is in use.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The operation conflicts with the resource's availability. For example, you attempted to\n recreate an existing table, or tried to delete a table currently in the CREATING\n state.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#ResourceNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage", + "traits": { + "smithy.api#documentation": "

The resource which is being requested does not exist.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The operation tried to access a nonexistent table or index. The resource might not be specified\n correctly, or its status might not be ACTIVE.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#RestoreInProgress": { + "type": "boolean", + "traits": { + "smithy.api#box": {} + } + }, + "com.amazonaws.dynamodb#RestoreSummary": { + "type": "structure", + "members": { + "SourceTableArn": { + "target": "com.amazonaws.dynamodb#TableArn", + "traits": { + "smithy.api#documentation": "

The ARN of the source table of the backup that is being restored.

" + } + }, + "RestoreInProgress": { + "target": "com.amazonaws.dynamodb#RestoreInProgress", + "traits": { + "smithy.api#documentation": "

Indicates if a restore is in progress or not.

", + "smithy.api#required": {} + } + }, + "RestoreDateTime": { + "target": "com.amazonaws.dynamodb#Date", + "traits": { + "smithy.api#documentation": "

Point in time or source backup time.

", + "smithy.api#required": {} + } + }, + "SourceBackupArn": { + "target": "com.amazonaws.dynamodb#BackupArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the backup from which the table was restored.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Contains details for the restore.

" + } + }, + "com.amazonaws.dynamodb#RestoreTableFromBackup": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#RestoreTableFromBackupInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#RestoreTableFromBackupOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#BackupInUseException" + }, + { + "target": "com.amazonaws.dynamodb#BackupNotFoundException" + }, + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#LimitExceededException" + }, + { + "target": "com.amazonaws.dynamodb#TableAlreadyExistsException" + }, + { + "target": "com.amazonaws.dynamodb#TableInUseException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates a new table from an existing backup. Any number of users can execute up to 4 concurrent restores\n (any type of restore) in a given account.\n

\n

You can call RestoreTableFromBackup at a maximum rate of 10 times per second.

\n

You must manually set up the following on the restored table:

\n
    \n
  • \n

    Auto scaling policies

    \n
  • \n
  • \n

    IAM policies

    \n
  • \n
  • \n

    Amazon CloudWatch metrics and alarms

    \n
  • \n
  • \n

    Tags

    \n
  • \n
  • \n

    Stream settings

    \n
  • \n
  • \n

    Time to Live (TTL) settings

    \n
  • \n
" + } + }, + "com.amazonaws.dynamodb#RestoreTableFromBackupInput": { + "type": "structure", + "members": { + "GlobalSecondaryIndexOverride": { + "target": "com.amazonaws.dynamodb#GlobalSecondaryIndexList", + "traits": { + "smithy.api#documentation": "

List of global secondary indexes for the restored table. The indexes\n provided should match existing secondary indexes. You can choose to exclude\n some or all of the indexes at the time of restore.

" + } + }, + "LocalSecondaryIndexOverride": { + "target": "com.amazonaws.dynamodb#LocalSecondaryIndexList", + "traits": { + "smithy.api#documentation": "

List of local secondary indexes for the restored table. The indexes\n provided should match existing secondary indexes. You can choose to exclude\n some or all of the indexes at the time of restore.

" + } + }, + "SSESpecificationOverride": { + "target": "com.amazonaws.dynamodb#SSESpecification", + "traits": { + "smithy.api#documentation": "

The new server-side encryption settings for the restored table.

" + } + }, + "TargetTableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the new table to which the backup must be restored.

", + "smithy.api#required": {} + } + }, + "BackupArn": { + "target": "com.amazonaws.dynamodb#BackupArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) associated with the backup.

", + "smithy.api#required": {} + } + }, + "BillingModeOverride": { + "target": "com.amazonaws.dynamodb#BillingMode", + "traits": { + "smithy.api#documentation": "

The billing mode of the restored table.

" + } + }, + "ProvisionedThroughputOverride": { + "target": "com.amazonaws.dynamodb#ProvisionedThroughput", + "traits": { + "smithy.api#documentation": "

Provisioned throughput settings for the restored table.

" + } + } + } + }, + "com.amazonaws.dynamodb#RestoreTableFromBackupOutput": { + "type": "structure", + "members": { + "TableDescription": { + "target": "com.amazonaws.dynamodb#TableDescription", + "traits": { + "smithy.api#documentation": "

The description of the table created from an existing backup.

" + } + } + } + }, + "com.amazonaws.dynamodb#RestoreTableToPointInTime": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#RestoreTableToPointInTimeInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#RestoreTableToPointInTimeOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#InvalidRestoreTimeException" + }, + { + "target": "com.amazonaws.dynamodb#LimitExceededException" + }, + { + "target": "com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException" + }, + { + "target": "com.amazonaws.dynamodb#TableAlreadyExistsException" + }, + { + "target": "com.amazonaws.dynamodb#TableInUseException" + }, + { + "target": "com.amazonaws.dynamodb#TableNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Restores the specified table to the specified point in time within\n EarliestRestorableDateTime and LatestRestorableDateTime.\n You can restore your table to any point in time during the last 35 days.\n Any number of users can execute up to 4 concurrent restores (any type of restore) in a given account.\n

\n

\n When you restore using point in time recovery, DynamoDB restores your table data to the state based on\n the selected date and time (day:hour:minute:second) to a new table.\n

\n

\n Along with data, the following are also included on the new restored table using point in time recovery:\n

\n
    \n
  • \n

    Global secondary indexes (GSIs)

    \n
  • \n
  • \n

    Local secondary indexes (LSIs)

    \n
  • \n
  • \n

    Provisioned read and write capacity

    \n
  • \n
  • \n

    Encryption settings

    \n \n

    \n All these settings come from the current settings of the source table at the time of restore.\n

    \n
    \n
  • \n
\n\n

You must manually set up the following on the restored table:

\n
    \n
  • \n

    Auto scaling policies

    \n
  • \n
  • \n

    IAM policies

    \n
  • \n
  • \n

    Amazon CloudWatch metrics and alarms

    \n
  • \n
  • \n

    Tags

    \n
  • \n
  • \n

    Stream settings

    \n
  • \n
  • \n

    Time to Live (TTL) settings

    \n
  • \n
  • \n

    Point in time recovery settings

    \n
  • \n
" + } + }, + "com.amazonaws.dynamodb#RestoreTableToPointInTimeInput": { + "type": "structure", + "members": { + "LocalSecondaryIndexOverride": { + "target": "com.amazonaws.dynamodb#LocalSecondaryIndexList", + "traits": { + "smithy.api#documentation": "

List of local secondary indexes for the restored table. The indexes\n provided should match existing secondary indexes. You can choose to exclude\n some or all of the indexes at the time of restore.

" + } + }, + "SSESpecificationOverride": { + "target": "com.amazonaws.dynamodb#SSESpecification", + "traits": { + "smithy.api#documentation": "

The new server-side encryption settings for the restored table.

" + } + }, + "UseLatestRestorableTime": { + "target": "com.amazonaws.dynamodb#BooleanObject", + "traits": { + "smithy.api#documentation": "

Restore the table to the latest possible time. LatestRestorableDateTime\n is typically 5 minutes before the current time.

" + } + }, + "ProvisionedThroughputOverride": { + "target": "com.amazonaws.dynamodb#ProvisionedThroughput", + "traits": { + "smithy.api#documentation": "

Provisioned throughput settings for the restored table.

" + } + }, + "GlobalSecondaryIndexOverride": { + "target": "com.amazonaws.dynamodb#GlobalSecondaryIndexList", + "traits": { + "smithy.api#documentation": "

List of global secondary indexes for the restored table. The indexes\n provided should match existing secondary indexes. You can choose to exclude\n some or all of the indexes at the time of restore.

" + } + }, + "RestoreDateTime": { + "target": "com.amazonaws.dynamodb#Date", + "traits": { + "smithy.api#documentation": "

Time in the past to restore the table to.

" + } + }, + "SourceTableArn": { + "target": "com.amazonaws.dynamodb#TableArn", + "traits": { + "smithy.api#documentation": "

The DynamoDB table that will be restored. This value is an Amazon\n Resource Name (ARN).

" + } + }, + "BillingModeOverride": { + "target": "com.amazonaws.dynamodb#BillingMode", + "traits": { + "smithy.api#documentation": "

The billing mode of the restored table.

" + } + }, + "TargetTableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the new table to which it must be restored to.

", + "smithy.api#required": {} + } + }, + "SourceTableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

Name of the source table that is being restored.

" + } + } + } + }, + "com.amazonaws.dynamodb#RestoreTableToPointInTimeOutput": { + "type": "structure", + "members": { + "TableDescription": { + "target": "com.amazonaws.dynamodb#TableDescription", + "traits": { + "smithy.api#documentation": "

Represents the properties of a table.

" + } + } + } + }, + "com.amazonaws.dynamodb#ReturnConsumedCapacity": { + "type": "string", + "traits": { + "smithy.api#documentation": "

Determines the level of detail about provisioned throughput consumption that is returned in the response:

\n
    \n
  • \n

    \n INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.

    \n

    Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).

    \n
  • \n
  • \n

    \n TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.

    \n
  • \n
  • \n

    \n NONE - No ConsumedCapacity details are included in the response.

    \n
  • \n
", + "smithy.api#enum": [ + { + "value": "INDEXES" + }, + { + "value": "TOTAL" + }, + { + "value": "NONE" + } + ] + } + }, + "com.amazonaws.dynamodb#ReturnItemCollectionMetrics": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "SIZE" + }, + { + "value": "NONE" + } + ] + } + }, + "com.amazonaws.dynamodb#ReturnValue": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "NONE" + }, + { + "value": "ALL_OLD" + }, + { + "value": "UPDATED_OLD" + }, + { + "value": "ALL_NEW" + }, + { + "value": "UPDATED_NEW" + } + ] + } + }, + "com.amazonaws.dynamodb#ReturnValuesOnConditionCheckFailure": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "ALL_OLD" + }, + { + "value": "NONE" + } + ] + } + }, + "com.amazonaws.dynamodb#SSEDescription": { + "type": "structure", + "members": { + "InaccessibleEncryptionDateTime": { + "target": "com.amazonaws.dynamodb#Date", + "traits": { + "smithy.api#documentation": "

Indicates the time, in UNIX epoch date format, when DynamoDB detected that the table's\n AWS KMS key was inaccessible. This attribute will automatically be cleared when DynamoDB\n detects that the table's AWS KMS key is accessible again. DynamoDB will initiate the table\n archival process when table's AWS KMS key remains inaccessible for more than seven days\n from this date.

" + } + }, + "KMSMasterKeyArn": { + "target": "com.amazonaws.dynamodb#KMSMasterKeyArn", + "traits": { + "smithy.api#documentation": "

The AWS KMS customer master key (CMK) ARN used for the AWS KMS encryption.

" + } + }, + "Status": { + "target": "com.amazonaws.dynamodb#SSEStatus", + "traits": { + "smithy.api#documentation": "

Represents the current state of server-side encryption. The only supported values are:

\n
    \n
  • \n

    \n ENABLED - Server-side encryption is enabled.

    \n
  • \n
  • \n

    \n UPDATING - Server-side encryption is being updated.

    \n
  • \n
" + } + }, + "SSEType": { + "target": "com.amazonaws.dynamodb#SSEType", + "traits": { + "smithy.api#documentation": "

Server-side encryption type. The only supported value is:

\n
    \n
  • \n

    \n KMS - Server-side encryption that uses AWS Key Management Service. The\n key is stored in your account and is managed by AWS KMS (AWS KMS charges\n apply).

    \n
  • \n
" + } + } + }, + "traits": { + "smithy.api#documentation": "

The description of the server-side encryption status on the specified table.

" + } + }, + "com.amazonaws.dynamodb#SSEEnabled": { + "type": "boolean", + "traits": { + "smithy.api#box": {} + } + }, + "com.amazonaws.dynamodb#SSESpecification": { + "type": "structure", + "members": { + "KMSMasterKeyId": { + "target": "com.amazonaws.dynamodb#KMSMasterKeyId", + "traits": { + "smithy.api#documentation": "

The AWS KMS customer master key (CMK) that should be used for the AWS KMS encryption. To\n specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. Note\n that you should only provide this parameter if the key is different from the default\n DynamoDB customer master key alias/aws/dynamodb.

" + } + }, + "SSEType": { + "target": "com.amazonaws.dynamodb#SSEType", + "traits": { + "smithy.api#documentation": "

Server-side encryption type. The only supported value is:

\n
    \n
  • \n

    \n KMS - Server-side encryption that uses AWS Key Management Service. The\n key is stored in your account and is managed by AWS KMS (AWS KMS charges\n apply).

    \n
  • \n
" + } + }, + "Enabled": { + "target": "com.amazonaws.dynamodb#SSEEnabled", + "traits": { + "smithy.api#documentation": "

Indicates whether server-side encryption is done using an AWS managed CMK or an AWS owned CMK. If enabled (true),\n server-side encryption type is set to KMS and an AWS managed CMK is used (AWS KMS charges apply). If disabled (false) or not specified, server-side\nencryption is set to AWS owned CMK.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the settings used to enable server-side encryption.

" + } + }, + "com.amazonaws.dynamodb#SSEStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "ENABLING" + }, + { + "value": "ENABLED" + }, + { + "value": "DISABLING" + }, + { + "value": "DISABLED" + }, + { + "value": "UPDATING" + } + ] + } + }, + "com.amazonaws.dynamodb#SSEType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "AES256" + }, + { + "value": "KMS" + } + ] + } + }, + "com.amazonaws.dynamodb#ScalarAttributeType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "S" + }, + { + "value": "N" + }, + { + "value": "B" + } + ] + } + }, + "com.amazonaws.dynamodb#Scan": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#ScanInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#ScanOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" + }, + { + "target": "com.amazonaws.dynamodb#RequestLimitExceeded" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

The Scan operation returns one or more items and item attributes by accessing every\n item in a table or a secondary index. To have DynamoDB return fewer items, you can provide a FilterExpression operation.

\n

If the total number of scanned items exceeds the maximum dataset size limit of 1 MB, the\n scan stops and results are returned to the user as a LastEvaluatedKey value\n to continue the scan in a subsequent operation. The results also include the number of\n items exceeding the limit. A scan can result in no table data meeting the filter\n criteria.

\n

A single Scan operation reads up to the maximum number of items set (if\n using the Limit parameter) or a maximum of 1 MB of data and then apply any\n filtering to the results using FilterExpression. If\n LastEvaluatedKey is present in the response, you need to paginate the\n result set. For more information, see Paginating the\n Results in the Amazon DynamoDB Developer Guide.

\n

\n Scan operations proceed sequentially; however, for faster performance on\n a large table or secondary index, applications can request a parallel Scan\n operation by providing the Segment and TotalSegments\n parameters. For more information, see Parallel\n Scan in the Amazon DynamoDB Developer Guide.

\n

\n Scan uses eventually consistent reads when accessing the data in a\n table; therefore, the result set might not include the changes to data in the table\n immediately before the operation began. If you need a consistent copy of the data, as of\n the time that the Scan begins, you can set the ConsistentRead\n parameter to true.

" + } + }, + "com.amazonaws.dynamodb#ScanInput": { + "type": "structure", + "members": { + "ProjectionExpression": { + "target": "com.amazonaws.dynamodb#ProjectionExpression", + "traits": { + "smithy.api#documentation": "

A string that identifies one or more attributes to retrieve from the specified table or index. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.

\n

If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.

\n

For more information, see Specifying Item Attributes in the Amazon DynamoDB Developer\n Guide.

" + } + }, + "ConsistentRead": { + "target": "com.amazonaws.dynamodb#ConsistentRead", + "traits": { + "smithy.api#documentation": "

A Boolean value that determines the read consistency model during the scan:

\n
    \n
  • \n

    If ConsistentRead is false, then the data returned from\n Scan might not contain the results from other recently\n completed write operations (PutItem, UpdateItem, or\n DeleteItem).

    \n
  • \n
  • \n

    If ConsistentRead is true, then all of the write operations that completed before the Scan began are guaranteed to be contained in the Scan response.

    \n
  • \n
\n

The default setting for ConsistentRead is false.

\n

The ConsistentRead parameter is not supported on global secondary indexes. If you scan a global secondary index with ConsistentRead set to true, you will receive a ValidationException.

" + } + }, + "Select": { + "target": "com.amazonaws.dynamodb#Select", + "traits": { + "smithy.api#documentation": "

The attributes to be returned in the\n result. You can retrieve all item attributes, specific item attributes, the count of\n matching items, or in the case of an index, some or all of the attributes projected into\n the index.

\n
    \n
  • \n

    \n ALL_ATTRIBUTES - Returns all of the item attributes from the\n specified table or index. If you query a local secondary index, then for each\n matching item in the index, DynamoDB fetches the entire item from the parent\n table. If the index is configured to project all item attributes, then all of\n the data can be obtained from the local secondary index, and no fetching is\n required.

    \n
  • \n
  • \n

    \n ALL_PROJECTED_ATTRIBUTES - Allowed only when querying an index.\n Retrieves all attributes that have been projected into the index. If the\n index is configured to project all attributes, this return value is\n equivalent to specifying ALL_ATTRIBUTES.

    \n
  • \n
  • \n

    \n COUNT - Returns the number of matching items, rather than the\n matching items themselves.

    \n
  • \n
  • \n

    \n SPECIFIC_ATTRIBUTES - Returns only the attributes listed in\n AttributesToGet. This return value is equivalent to\n specifying AttributesToGet without specifying any value\n for Select.

    \n

    If you query or scan a local secondary index and request only attributes that\n are projected into that index, the operation reads only the index and not the\n table. If any of the requested attributes are not projected into the local\n secondary index, DynamoDB fetches each of these attributes from the parent\n table. This extra fetching incurs additional throughput cost and latency.

    \n

    If you query or scan a global secondary index, you can only request\n attributes that are projected into the index. Global secondary index queries\n cannot fetch attributes from the parent table.

    \n
  • \n
\n

If neither Select nor AttributesToGet\n are specified, DynamoDB defaults to ALL_ATTRIBUTES when accessing a\n table, and ALL_PROJECTED_ATTRIBUTES when accessing an index. You cannot\n use both Select and AttributesToGet\n together in a single request, unless the value for Select is\n SPECIFIC_ATTRIBUTES. (This usage is equivalent to specifying\n AttributesToGet without any value for\n Select.)

\n \n

If you use the ProjectionExpression parameter, then\n the value for Select can only be\n SPECIFIC_ATTRIBUTES. Any other value for\n Select will return an error.

\n
" + } + }, + "ExpressionAttributeValues": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeValueMap", + "traits": { + "smithy.api#documentation": "

One or more values that can be substituted in an expression.

\n

Use the : (colon) character in an expression to\n dereference an attribute value. For example, suppose that you wanted to check whether\n the value of the ProductStatus attribute was one of the following:

\n

\n Available | Backordered | Discontinued\n

\n

You would first need to specify ExpressionAttributeValues as follows:

\n

\n { \":avail\":{\"S\":\"Available\"}, \":back\":{\"S\":\"Backordered\"}, \":disc\":{\"S\":\"Discontinued\"} }\n

\n

You could then use these values in an expression, such as this:

\n

\n ProductStatus IN (:avail, :back, :disc)\n

\n

For more information on expression attribute values, see Condition Expressions in the Amazon DynamoDB Developer\n Guide.

" + } + }, + "Segment": { + "target": "com.amazonaws.dynamodb#ScanSegment", + "traits": { + "smithy.api#documentation": "

For a parallel Scan request, Segment identifies an individual segment to be\n scanned by an application worker.

\n

Segment IDs are zero-based, so the first segment is always 0. For example, if you want to\n use four application threads to scan a table or an index, then the first thread specifies a Segment value\n of 0, the second thread specifies 1, and so on.

\n

The value of LastEvaluatedKey returned from a parallel Scan request must be\n used as ExclusiveStartKey with the same segment ID in a subsequent Scan\n operation.

\n

The value for Segment must be greater than or equal to 0, and less than the value\n provided for TotalSegments.

\n

If you provide Segment, you must also provide TotalSegments.

" + } + }, + "TotalSegments": { + "target": "com.amazonaws.dynamodb#ScanTotalSegments", + "traits": { + "smithy.api#documentation": "

For a parallel Scan request, TotalSegments represents the total number of\n segments into which the Scan operation will be divided. The value of\n TotalSegments corresponds to the number of application workers that will perform the\n parallel scan. For example, if you want to use four application threads to scan a table or an index,\n specify a TotalSegments value of 4.

\n

The value for TotalSegments must be greater than or equal to 1, and less than or equal\n to 1000000. If you specify a TotalSegments value of 1, the Scan operation will\n be sequential rather than parallel.

\n

If you specify TotalSegments, you must also specify Segment.

" + } + }, + "ScanFilter": { + "target": "com.amazonaws.dynamodb#FilterConditionMap", + "traits": { + "smithy.api#documentation": "

This is a legacy parameter. Use FilterExpression instead. For more information, see\n ScanFilter in the Amazon DynamoDB Developer Guide.

" + } + }, + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of a secondary index to scan. This index can be any local secondary index or global secondary index. Note that if you use the IndexName parameter, you must also provide TableName.

" + } + }, + "ReturnConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ReturnConsumedCapacity" + }, + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table containing the requested items; or, if you provide\n IndexName, the name of the table to which that index belongs.

", + "smithy.api#required": {} + } + }, + "AttributesToGet": { + "target": "com.amazonaws.dynamodb#AttributeNameList", + "traits": { + "smithy.api#documentation": "

This is a legacy parameter. Use ProjectionExpression instead. For more information, see\n AttributesToGet in the Amazon DynamoDB Developer Guide.

" + } + }, + "ExpressionAttributeNames": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeNameMap", + "traits": { + "smithy.api#documentation": "

One or more substitution tokens for attribute names in an expression. The following are some use cases for using ExpressionAttributeNames:

\n
    \n
  • \n

    To access an attribute whose name conflicts with a DynamoDB reserved word.

    \n
  • \n
  • \n

    To create a placeholder for repeating occurrences of an attribute name in an expression.

    \n
  • \n
  • \n

    To prevent special characters in an attribute name from being misinterpreted in an expression.

    \n
  • \n
\n

Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:

\n
    \n
  • \n

    \n Percentile\n

    \n
  • \n
\n

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:

\n
    \n
  • \n

    \n {\"#P\":\"Percentile\"}\n

    \n
  • \n
\n

You could then use this substitution in an expression, as in this example:

\n
    \n
  • \n

    \n #P = :val\n

    \n
  • \n
\n \n

Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.

\n
\n

For more information on expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer\n Guide.

" + } + }, + "ExclusiveStartKey": { + "target": "com.amazonaws.dynamodb#Key", + "traits": { + "smithy.api#documentation": "

The primary key of the first item that this operation will evaluate. Use the value that was returned for LastEvaluatedKey in the previous operation.

\n

The data type for ExclusiveStartKey must be String, Number or Binary. No set data types are allowed.

\n

In a parallel scan, a\n Scan request that includes ExclusiveStartKey must specify the same segment\n whose previous Scan returned the corresponding value of LastEvaluatedKey.

" + } + }, + "FilterExpression": { + "target": "com.amazonaws.dynamodb#ConditionExpression", + "traits": { + "smithy.api#documentation": "

A string that contains conditions that DynamoDB applies after the Scan operation, but\n before the data is returned to you. Items that do not satisfy the FilterExpression\n criteria are not returned.

\n \n

A FilterExpression is applied after the items have already been read; the process of\n filtering does not consume any additional read capacity units.

\n
\n

For more information, see\n Filter Expressions in the Amazon DynamoDB Developer Guide.

" + } + }, + "Limit": { + "target": "com.amazonaws.dynamodb#PositiveIntegerObject", + "traits": { + "smithy.api#documentation": "

The maximum number of items to evaluate (not necessarily the number of matching items).\n If DynamoDB processes the number of items up to the limit while processing the results,\n it stops the operation and returns the matching values up to that point, and a key in\n LastEvaluatedKey to apply in a subsequent operation, so that you can\n pick up where you left off. Also, if the processed dataset size exceeds 1 MB before\n DynamoDB reaches this limit, it stops the operation and returns the matching values up\n to the limit, and a key in LastEvaluatedKey to apply in a subsequent\n operation to continue the operation. For more information, see Working with Queries in the Amazon DynamoDB Developer\n Guide.

" + } + }, + "ConditionalOperator": { + "target": "com.amazonaws.dynamodb#ConditionalOperator", + "traits": { + "smithy.api#documentation": "

This is a legacy parameter. Use FilterExpression instead. For more information, see\n ConditionalOperator in the Amazon DynamoDB Developer Guide.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the input of a Scan operation.

" + } + }, + "com.amazonaws.dynamodb#ScanOutput": { + "type": "structure", + "members": { + "Count": { + "target": "com.amazonaws.dynamodb#Integer", + "traits": { + "smithy.api#documentation": "

The number of items in the response.

\n

If you set ScanFilter in the request, then Count is the number of items\n returned after the filter was applied, and ScannedCount is the number of matching items\n before the filter was applied.

\n

If you did not use a filter in the request, then Count is the same as\n ScannedCount.

" + } + }, + "ScannedCount": { + "target": "com.amazonaws.dynamodb#Integer", + "traits": { + "smithy.api#documentation": "

The number of items evaluated, before any ScanFilter is applied. A high\n ScannedCount value with few, or no, Count results indicates an inefficient\n Scan operation. For more information, see Count and ScannedCount in the\n Amazon DynamoDB Developer Guide.

\n

If you did not use a filter in the request, then ScannedCount is the same as\n Count.

" + } + }, + "ConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ConsumedCapacity", + "traits": { + "smithy.api#documentation": "

The capacity units consumed by the Scan operation. The data returned includes the total\n provisioned throughput consumed, along with statistics for the table and any indexes involved\n in the operation. ConsumedCapacity is only returned if the ReturnConsumedCapacity parameter was specified.\n For more information, see Provisioned\n Throughput in the Amazon DynamoDB Developer Guide.

" + } + }, + "LastEvaluatedKey": { + "target": "com.amazonaws.dynamodb#Key", + "traits": { + "smithy.api#documentation": "

The primary key of the item where the operation stopped, inclusive of the previous\n result set. Use this value to start a new operation, excluding this value in the new\n request.

\n

If LastEvaluatedKey is empty, then the \"last page\" of results\n has been processed and there is no more data to be retrieved.

\n

If LastEvaluatedKey is not empty, it does not necessarily mean\n that there is more data in the result set. The only way to know when you have reached\n the end of the result set is when LastEvaluatedKey is\n empty.

" + } + }, + "Items": { + "target": "com.amazonaws.dynamodb#ItemList", + "traits": { + "smithy.api#documentation": "

An array of item attributes that match the scan criteria. Each element in this array consists of an attribute name and the value for that attribute.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the output of a Scan operation.

" + } + }, + "com.amazonaws.dynamodb#ScanSegment": { + "type": "integer", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 0, + "max": 999999 + } + } + }, + "com.amazonaws.dynamodb#ScanTotalSegments": { + "type": "integer", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 1, + "max": 1000000 + } + } + }, + "com.amazonaws.dynamodb#SecondaryIndexesCapacityMap": { + "type": "map", + "key": { + "target": "com.amazonaws.dynamodb#IndexName" + }, + "value": { + "target": "com.amazonaws.dynamodb#Capacity" + } + }, + "com.amazonaws.dynamodb#Select": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "ALL_ATTRIBUTES" + }, + { + "value": "ALL_PROJECTED_ATTRIBUTES" + }, + { + "value": "SPECIFIC_ATTRIBUTES" + }, + { + "value": "COUNT" + } + ] + } + }, + "com.amazonaws.dynamodb#SourceTableDetails": { + "type": "structure", + "members": { + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table for which the backup was created.

", + "smithy.api#required": {} + } + }, + "TableId": { + "target": "com.amazonaws.dynamodb#TableId", + "traits": { + "smithy.api#documentation": "

Unique identifier for the table for which the backup was created.

", + "smithy.api#required": {} + } + }, + "TableCreationDateTime": { + "target": "com.amazonaws.dynamodb#TableCreationDateTime", + "traits": { + "smithy.api#documentation": "

Time when the source table was created.

", + "smithy.api#required": {} + } + }, + "KeySchema": { + "target": "com.amazonaws.dynamodb#KeySchema", + "traits": { + "smithy.api#documentation": "

Schema of the table.

", + "smithy.api#required": {} + } + }, + "ItemCount": { + "target": "com.amazonaws.dynamodb#ItemCount", + "traits": { + "smithy.api#documentation": "

Number of items in the table. Note that this is an approximate value.

" + } + }, + "TableArn": { + "target": "com.amazonaws.dynamodb#TableArn", + "traits": { + "smithy.api#documentation": "

ARN of the table for which backup was created.

" + } + }, + "ProvisionedThroughput": { + "target": "com.amazonaws.dynamodb#ProvisionedThroughput", + "traits": { + "smithy.api#documentation": "

Read IOPs and Write IOPS on the table when the backup was created.

", + "smithy.api#required": {} + } + }, + "BillingMode": { + "target": "com.amazonaws.dynamodb#BillingMode", + "traits": { + "smithy.api#documentation": "

Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.

\n
    \n
  • \n

    \n PROVISIONED - Sets the read/write capacity mode to PROVISIONED. We recommend using PROVISIONED for predictable workloads.

    \n
  • \n
  • \n

    \n PAY_PER_REQUEST - Sets the read/write capacity mode to PAY_PER_REQUEST. We recommend using PAY_PER_REQUEST for unpredictable workloads.\n

    \n
  • \n
" + } + }, + "TableSizeBytes": { + "target": "com.amazonaws.dynamodb#Long", + "traits": { + "smithy.api#documentation": "

Size of the table in bytes. Note that this is an approximate value.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Contains the details of the table when the backup was created.

" + } + }, + "com.amazonaws.dynamodb#SourceTableFeatureDetails": { + "type": "structure", + "members": { + "TimeToLiveDescription": { + "target": "com.amazonaws.dynamodb#TimeToLiveDescription", + "traits": { + "smithy.api#documentation": "

Time to Live settings on the table when the backup was created.

" + } + }, + "LocalSecondaryIndexes": { + "target": "com.amazonaws.dynamodb#LocalSecondaryIndexes", + "traits": { + "smithy.api#documentation": "

Represents the LSI properties for the table when the backup was created. It includes the IndexName, KeySchema and Projection for the LSIs on the table at the time of backup.

" + } + }, + "SSEDescription": { + "target": "com.amazonaws.dynamodb#SSEDescription", + "traits": { + "smithy.api#documentation": "

The description of the server-side encryption status on the table when the backup was created.

" + } + }, + "StreamDescription": { + "target": "com.amazonaws.dynamodb#StreamSpecification", + "traits": { + "smithy.api#documentation": "

Stream settings on the table when the backup was created.

" + } + }, + "GlobalSecondaryIndexes": { + "target": "com.amazonaws.dynamodb#GlobalSecondaryIndexes", + "traits": { + "smithy.api#documentation": "

Represents the GSI properties for the table when the backup was created. It includes the\n IndexName, KeySchema, Projection, and ProvisionedThroughput for the GSIs on the table at\n the time of backup.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Contains the details of the features enabled on the table when the backup was created. For example, LSIs, GSIs, streams, TTL.

" + } + }, + "com.amazonaws.dynamodb#StreamArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 37, + "max": 1024 + } + } + }, + "com.amazonaws.dynamodb#StreamEnabled": { + "type": "boolean", + "traits": { + "smithy.api#box": {} + } + }, + "com.amazonaws.dynamodb#StreamSpecification": { + "type": "structure", + "members": { + "StreamEnabled": { + "target": "com.amazonaws.dynamodb#StreamEnabled", + "traits": { + "smithy.api#documentation": "

Indicates whether DynamoDB Streams is enabled (true) or disabled (false) on the table.

", + "smithy.api#required": {} + } + }, + "StreamViewType": { + "target": "com.amazonaws.dynamodb#StreamViewType", + "traits": { + "smithy.api#documentation": "

\n When an item in the table is modified, StreamViewType\n determines what information is written to the stream for this table. Valid values for\n StreamViewType are:

\n
    \n
  • \n

    \n KEYS_ONLY - Only the key attributes of the modified item are written to the stream.

    \n
  • \n
  • \n

    \n NEW_IMAGE - The entire item, as it appears after it was modified, is written\n to the stream.

    \n
  • \n
  • \n

    \n OLD_IMAGE - The entire item, as it appeared before it was modified, is\n written to the stream.

    \n
  • \n
  • \n

    \n NEW_AND_OLD_IMAGES - Both the new and the old item images of the item are\n written to the stream.

    \n
  • \n
" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the DynamoDB Streams configuration for a table in DynamoDB.

" + } + }, + "com.amazonaws.dynamodb#StreamViewType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "NEW_IMAGE" + }, + { + "value": "OLD_IMAGE" + }, + { + "value": "NEW_AND_OLD_IMAGES" + }, + { + "value": "KEYS_ONLY" + } + ] + } + }, + "com.amazonaws.dynamodb#String": { + "type": "string" + }, + "com.amazonaws.dynamodb#StringAttributeValue": { + "type": "string" + }, + "com.amazonaws.dynamodb#StringSetAttributeValue": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#StringAttributeValue" + } + }, + "com.amazonaws.dynamodb#TableAlreadyExistsException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

A target table with the specified name already exists.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#TableArn": { + "type": "string" + }, + "com.amazonaws.dynamodb#TableAutoScalingDescription": { + "type": "structure", + "members": { + "TableStatus": { + "target": "com.amazonaws.dynamodb#TableStatus", + "traits": { + "smithy.api#documentation": "

The current state of the table:

\n
    \n
  • \n

    \n CREATING - The table is being created.

    \n
  • \n
  • \n

    \n UPDATING - The table is being updated.

    \n
  • \n
  • \n

    \n DELETING - The table is being deleted.

    \n
  • \n
  • \n

    \n ACTIVE - The table is ready for use.

    \n
  • \n
" + } + }, + "Replicas": { + "target": "com.amazonaws.dynamodb#ReplicaAutoScalingDescriptionList", + "traits": { + "smithy.api#documentation": "

Represents replicas of the global table.

" + } + }, + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the auto scaling configuration for a global table.

" + } + }, + "com.amazonaws.dynamodb#TableCreationDateTime": { + "type": "timestamp" + }, + "com.amazonaws.dynamodb#TableDescription": { + "type": "structure", + "members": { + "BillingModeSummary": { + "target": "com.amazonaws.dynamodb#BillingModeSummary", + "traits": { + "smithy.api#documentation": "

Contains the details for the read/write capacity mode.

" + } + }, + "TableArn": { + "target": "com.amazonaws.dynamodb#String", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) that uniquely identifies the table.

" + } + }, + "SSEDescription": { + "target": "com.amazonaws.dynamodb#SSEDescription", + "traits": { + "smithy.api#documentation": "

The description of the server-side encryption status on the specified table.

" + } + }, + "ArchivalSummary": { + "target": "com.amazonaws.dynamodb#ArchivalSummary", + "traits": { + "smithy.api#documentation": "

Contains information about the table archive.

" + } + }, + "GlobalSecondaryIndexes": { + "target": "com.amazonaws.dynamodb#GlobalSecondaryIndexDescriptionList", + "traits": { + "smithy.api#documentation": "

The global secondary indexes, if any, on the table. Each index is scoped to a given partition key value. Each element is composed of:

\n
    \n
  • \n

    \n Backfilling - If true, then the index is currently in the backfilling\n phase. Backfilling occurs only when a new global secondary index is added to the\n table. It is the process by which DynamoDB populates the new index with data from the\n table. (This attribute does not appear for indexes that were created during a\n CreateTable operation.)

    \n

    You can delete an index that is being created during the Backfilling\n phase when IndexStatus is set to CREATING and Backfilling\n is true. You can't delete the index that is being created when\n IndexStatus is set to CREATING and Backfilling is false.\n (This attribute does not appear for indexes that were created during a\n CreateTable operation.)

    \n
  • \n
  • \n

    \n IndexName - The name of the global secondary index.

    \n
  • \n
  • \n

    \n IndexSizeBytes - The total size of the global secondary index, in bytes. DynamoDB updates this value approximately every six\n hours. Recent changes might not be reflected in this value.\n

    \n
  • \n
  • \n

    \n IndexStatus - The current status of the global secondary index:

    \n
      \n
    • \n

      \n CREATING - The index is being created.

      \n
    • \n
    • \n

      \n UPDATING - The index is being updated.

      \n
    • \n
    • \n

      \n DELETING - The index is being deleted.

      \n
    • \n
    • \n

      \n ACTIVE - The index is ready for use.

      \n
    • \n
    \n
  • \n
  • \n

    \n ItemCount - The number of items in the global secondary index. DynamoDB updates this value approximately every six\n hours. Recent changes might not be reflected in this value.\n

    \n
  • \n
  • \n

    \n KeySchema - Specifies the complete index key schema. The attribute names in the\n key schema must be between 1 and 255 characters (inclusive). The key schema must begin\n with the same partition key as the table.

    \n
  • \n
  • \n

    \n Projection - Specifies\n attributes that are copied (projected) from the table into the index. These are in\n addition to the primary key attributes and index key\n attributes, which are automatically projected. Each\n attribute specification is composed of:

    \n
      \n
    • \n

      \n ProjectionType - One\n of the following:

      \n
        \n
      • \n

        \n KEYS_ONLY - Only the index and primary keys are projected into the\n index.

        \n
      • \n
      • \n

        \n INCLUDE - In addition to the attributes described in KEYS_ONLY, the secondary index will include other non-key attributes that you specify.

        \n
      • \n
      • \n

        \n ALL - All of the table attributes are projected into the\n index.

        \n
      • \n
      \n
    • \n
    • \n

      \n NonKeyAttributes - A list of one or more non-key attribute names that are\n projected into the secondary index. The total count of attributes provided in NonKeyAttributes, summed across all of the secondary indexes, must not exceed 20. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.

      \n
    • \n
    \n
  • \n
  • \n

    \n ProvisionedThroughput - The provisioned throughput settings for the global secondary index,\n consisting of read and write capacity units, along with data about increases and\n decreases.

    \n
  • \n
\n

If the table is in the DELETING state, no information about indexes will be\n returned.

" + } + }, + "GlobalTableVersion": { + "target": "com.amazonaws.dynamodb#String", + "traits": { + "smithy.api#documentation": "

Represents the version of global tables in use, if the table is replicated across AWS Regions.

" + } + }, + "TableId": { + "target": "com.amazonaws.dynamodb#TableId", + "traits": { + "smithy.api#documentation": "

Unique identifier for the table for which the backup was created.

" + } + }, + "ProvisionedThroughput": { + "target": "com.amazonaws.dynamodb#ProvisionedThroughputDescription", + "traits": { + "smithy.api#documentation": "

The provisioned throughput settings for the table, consisting of read and write capacity units, along with data about increases and decreases.

" + } + }, + "KeySchema": { + "target": "com.amazonaws.dynamodb#KeySchema", + "traits": { + "smithy.api#documentation": "

The primary key structure for the table. Each KeySchemaElement consists of:

\n
    \n
  • \n

    \n AttributeName - The name of the attribute.

    \n
  • \n
  • \n

    \n KeyType - The role of the attribute:

    \n
      \n
    • \n

      \n HASH - partition key

      \n
    • \n
    • \n

      \n RANGE - sort key

      \n
    • \n
    \n \n

    The partition key of an item is also known as its hash attribute. The\n term \"hash attribute\" derives from DynamoDB's usage of an internal hash function to\n evenly distribute data items across partitions, based on their partition key values.

    \n

    The sort key of an item is also known as its range attribute.\n The term \"range attribute\" derives from the way DynamoDB stores items with the same\n partition key physically close together, in sorted order by the sort key value.

    \n
    \n\n
  • \n
\n

For more information about primary keys, see Primary Key in the\n Amazon DynamoDB Developer Guide.

" + } + }, + "Replicas": { + "target": "com.amazonaws.dynamodb#ReplicaDescriptionList", + "traits": { + "smithy.api#documentation": "

Represents replicas of the table.

" + } + }, + "TableSizeBytes": { + "target": "com.amazonaws.dynamodb#Long", + "traits": { + "smithy.api#documentation": "

The total size of the specified table, in bytes. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.

" + } + }, + "TableStatus": { + "target": "com.amazonaws.dynamodb#TableStatus", + "traits": { + "smithy.api#documentation": "

The current state of the table:

\n
    \n
  • \n

    \n CREATING - The table is being created.

    \n
  • \n
  • \n

    \n UPDATING - The table is being updated.

    \n
  • \n
  • \n

    \n DELETING - The table is being deleted.

    \n
  • \n
  • \n

    \n ACTIVE - The table is ready for use.

    \n
  • \n
  • \n

    \n INACCESSIBLE_ENCRYPTION_CREDENTIALS - The AWS KMS\n key used to encrypt the table in inaccessible. Table operations\n may fail due to failure to use the AWS KMS key. DynamoDB will\n initiate the table archival process when a table's AWS KMS key\n remains inaccessible for more than seven days.\n

    \n
  • \n
  • \n

    \n ARCHIVING - The table is being archived. Operations\n are not allowed until archival is complete.\n

    \n
  • \n
  • \n

    \n ARCHIVED - The table has been archived. See the\n ArchivalReason for more information.\n

    \n
  • \n
" + } + }, + "StreamSpecification": { + "target": "com.amazonaws.dynamodb#StreamSpecification", + "traits": { + "smithy.api#documentation": "

The current DynamoDB Streams configuration for the table.

" + } + }, + "RestoreSummary": { + "target": "com.amazonaws.dynamodb#RestoreSummary", + "traits": { + "smithy.api#documentation": "

Contains details for the restore.

" + } + }, + "AttributeDefinitions": { + "target": "com.amazonaws.dynamodb#AttributeDefinitions", + "traits": { + "smithy.api#documentation": "

An array of AttributeDefinition objects. Each of these objects describes one attribute\n in the table and index key schema.

\n

Each AttributeDefinition object in this array is composed of:

\n
    \n
  • \n

    \n AttributeName - The name of the attribute.

    \n
  • \n
  • \n

    \n AttributeType - The data type for the attribute.

    \n
  • \n
" + } + }, + "LatestStreamLabel": { + "target": "com.amazonaws.dynamodb#String", + "traits": { + "smithy.api#documentation": "

A timestamp, in ISO 8601 format, for this stream.

\n\n

Note that LatestStreamLabel is not a unique identifier for the stream, because it is possible that a stream from another table might have the same timestamp. However, the combination of the following three elements is guaranteed to be unique:

\n
    \n
  • \n

    AWS customer ID

    \n
  • \n
  • \n

    Table name

    \n
  • \n
  • \n

    \n StreamLabel\n

    \n
  • \n
" + } + }, + "LatestStreamArn": { + "target": "com.amazonaws.dynamodb#StreamArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) that uniquely identifies the latest stream for this table.

" + } + }, + "LocalSecondaryIndexes": { + "target": "com.amazonaws.dynamodb#LocalSecondaryIndexDescriptionList", + "traits": { + "smithy.api#documentation": "

Represents one or more local secondary indexes on the table. Each index is scoped to a given partition key value. Tables with one or more local secondary indexes are subject to an item collection size limit, where the amount of data within a given item collection cannot exceed 10 GB. Each element is composed of:

\n
    \n
  • \n

    \n IndexName - The name of the local secondary index.

    \n
  • \n
  • \n

    \n KeySchema - Specifies the complete index key schema. The attribute names in the\n key schema must be between 1 and 255 characters (inclusive). The key schema must begin\n with the same partition key as the table.

    \n
  • \n
  • \n

    \n Projection - Specifies\n attributes that are copied (projected) from the table into the index. These are in\n addition to the primary key attributes and index key\n attributes, which are automatically projected. Each\n attribute specification is composed of:

    \n
      \n
    • \n

      \n ProjectionType - One\n of the following:

      \n
        \n
      • \n

        \n KEYS_ONLY - Only the index and primary keys are projected into the\n index.

        \n
      • \n
      • \n

        \n INCLUDE - Only the specified table attributes are projected\n into the index. The list of projected attributes is in\n NonKeyAttributes.

        \n
      • \n
      • \n

        \n ALL - All of the table attributes are projected into the\n index.

        \n
      • \n
      \n
    • \n
    • \n

      \n NonKeyAttributes - A list of one or more non-key attribute names that are\n projected into the secondary index. The total count of attributes provided in NonKeyAttributes, summed across all of the secondary indexes, must not exceed 20. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.

      \n
    • \n
    \n
  • \n
  • \n

    \n IndexSizeBytes - Represents the total size of the index, in bytes. DynamoDB updates\n this value approximately every six hours. Recent changes might not be reflected in this\n value.

    \n
  • \n
  • \n

    \n ItemCount - Represents the number of items in the index. DynamoDB updates this value\n approximately every six hours. Recent changes might not be reflected in this value.

    \n
  • \n
\n

If the table is in the DELETING state, no information about indexes will be\n returned.

" + } + }, + "CreationDateTime": { + "target": "com.amazonaws.dynamodb#Date", + "traits": { + "smithy.api#documentation": "

The date and time when the table was created, in UNIX epoch time format.

" + } + }, + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table.

" + } + }, + "ItemCount": { + "target": "com.amazonaws.dynamodb#Long", + "traits": { + "smithy.api#documentation": "

The number of items in the specified table. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the properties of a table.

" + } + }, + "com.amazonaws.dynamodb#TableId": { + "type": "string", + "traits": { + "smithy.api#pattern": "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + } + }, + "com.amazonaws.dynamodb#TableInUseException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

A target table with the specified name is either being created or deleted.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#TableName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 3, + "max": 255 + }, + "smithy.api#pattern": "[a-zA-Z0-9_.-]+" + } + }, + "com.amazonaws.dynamodb#TableNameList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#TableName" + } + }, + "com.amazonaws.dynamodb#TableNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

A source table with the name TableName does not currently exist within the subscriber's account.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#TableStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "CREATING" + }, + { + "value": "UPDATING" + }, + { + "value": "DELETING" + }, + { + "value": "ACTIVE" + }, + { + "value": "INACCESSIBLE_ENCRYPTION_CREDENTIALS" + }, + { + "value": "ARCHIVING" + }, + { + "value": "ARCHIVED" + } + ] + } + }, + "com.amazonaws.dynamodb#Tag": { + "type": "structure", + "members": { + "Key": { + "target": "com.amazonaws.dynamodb#TagKeyString", + "traits": { + "smithy.api#documentation": "

The key of the tag. Tag keys are case sensitive. Each DynamoDB table can only have up to\n one tag with the same key. If you try to add an existing tag (same key), the existing\n tag value will be updated to the new value.

", + "smithy.api#required": {} + } + }, + "Value": { + "target": "com.amazonaws.dynamodb#TagValueString", + "traits": { + "smithy.api#documentation": "

The value of the tag. Tag values are case-sensitive and can be null.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Describes a tag. A tag is a key-value pair. You can add up to 50 tags to a single DynamoDB table.\n

\n

AWS-assigned tag names and values are automatically assigned the aws:\n prefix, which the user cannot assign. AWS-assigned tag names do not count towards the\n tag limit of 50. User-assigned tag names have the prefix user: in the Cost\n Allocation Report. You cannot backdate the application of a tag.

\n

For an overview on tagging DynamoDB resources, see\n Tagging for DynamoDB\n in the Amazon DynamoDB Developer Guide.

" + } + }, + "com.amazonaws.dynamodb#TagKeyList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#TagKeyString" + } + }, + "com.amazonaws.dynamodb#TagKeyString": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 128 + } + } + }, + "com.amazonaws.dynamodb#TagList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#Tag" + } + }, + "com.amazonaws.dynamodb#TagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#TagResourceInput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#LimitExceededException" + }, + { + "target": "com.amazonaws.dynamodb#ResourceInUseException" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Associate a set of tags with an Amazon DynamoDB resource. You can then activate these\n user-defined tags so that they appear on the Billing and Cost Management console for\n cost allocation tracking. You can call TagResource up to five times per second, per\n account.

\n

For an overview on tagging DynamoDB resources, see\n Tagging for DynamoDB\n in the Amazon DynamoDB Developer Guide.

" + } + }, + "com.amazonaws.dynamodb#TagResourceInput": { + "type": "structure", + "members": { + "Tags": { + "target": "com.amazonaws.dynamodb#TagList", + "traits": { + "smithy.api#documentation": "

The tags to be assigned to the Amazon DynamoDB resource.

", + "smithy.api#required": {} + } + }, + "ResourceArn": { + "target": "com.amazonaws.dynamodb#ResourceArnString", + "traits": { + "smithy.api#documentation": "

Identifies the Amazon DynamoDB resource to which tags should be added. This value is an Amazon Resource Name (ARN).

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.dynamodb#TagValueString": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 256 + } + } + }, + "com.amazonaws.dynamodb#TimeRangeLowerBound": { + "type": "timestamp" + }, + "com.amazonaws.dynamodb#TimeRangeUpperBound": { + "type": "timestamp" + }, + "com.amazonaws.dynamodb#TimeToLiveAttributeName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + } + } + }, + "com.amazonaws.dynamodb#TimeToLiveDescription": { + "type": "structure", + "members": { + "TimeToLiveStatus": { + "target": "com.amazonaws.dynamodb#TimeToLiveStatus", + "traits": { + "smithy.api#documentation": "

The TTL status for the table.

" + } + }, + "AttributeName": { + "target": "com.amazonaws.dynamodb#TimeToLiveAttributeName", + "traits": { + "smithy.api#documentation": "

The name of the TTL attribute for items in the table.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The description of the Time to Live (TTL) status on the specified table.

" + } + }, + "com.amazonaws.dynamodb#TimeToLiveEnabled": { + "type": "boolean", + "traits": { + "smithy.api#box": {} + } + }, + "com.amazonaws.dynamodb#TimeToLiveSpecification": { + "type": "structure", + "members": { + "AttributeName": { + "target": "com.amazonaws.dynamodb#TimeToLiveAttributeName", + "traits": { + "smithy.api#documentation": "

The name of the TTL attribute used to store the expiration time for items in the\n table.

", + "smithy.api#required": {} + } + }, + "Enabled": { + "target": "com.amazonaws.dynamodb#TimeToLiveEnabled", + "traits": { + "smithy.api#documentation": "

Indicates whether TTL is to be enabled (true) or disabled (false) on the table.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the settings used to enable or disable Time to Live (TTL) for the specified\n table.

" + } + }, + "com.amazonaws.dynamodb#TimeToLiveStatus": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "ENABLING" + }, + { + "value": "DISABLING" + }, + { + "value": "ENABLED" + }, + { + "value": "DISABLED" + } + ] + } + }, + "com.amazonaws.dynamodb#TransactGetItem": { + "type": "structure", + "members": { + "Get": { + "target": "com.amazonaws.dynamodb#Get", + "traits": { + "smithy.api#documentation": "

Contains the primary key that identifies the item to get, together\n with the name of the table that contains the item, and optionally\n the specific attributes of the item to retrieve.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Specifies an item to be retrieved as part of the transaction.

" + } + }, + "com.amazonaws.dynamodb#TransactGetItemList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#TransactGetItem" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 25 + } + } + }, + "com.amazonaws.dynamodb#TransactGetItems": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#TransactGetItemsInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#TransactGetItemsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" + }, + { + "target": "com.amazonaws.dynamodb#RequestLimitExceeded" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.dynamodb#TransactionCanceledException" + } + ], + "traits": { + "smithy.api#documentation": "

\n TransactGetItems is a synchronous operation that atomically retrieves\n multiple items from one or more tables (but not from indexes) in a single account and\n Region. A TransactGetItems call can contain up to 25\n TransactGetItem objects, each of which contains a Get\n structure that specifies an item to retrieve from a table in the account and Region. A\n call to TransactGetItems cannot retrieve items from tables in more than one\n AWS account or Region. The aggregate size of the items in the transaction cannot exceed\n 4 MB.

\n

DynamoDB rejects the entire TransactGetItems request if any of the following is true:

\n
    \n
  • \n

    A conflicting operation is in the process of updating an\n item to be read.

    \n
  • \n
  • \n

    There is insufficient provisioned capacity for the transaction\n to be completed.

    \n
  • \n
  • \n

    There is a user error, such as an invalid data format.

    \n
  • \n
  • \n

    The aggregate size of the items in the transaction cannot exceed 4 MB.

    \n
  • \n
" + } + }, + "com.amazonaws.dynamodb#TransactGetItemsInput": { + "type": "structure", + "members": { + "TransactItems": { + "target": "com.amazonaws.dynamodb#TransactGetItemList", + "traits": { + "smithy.api#documentation": "

An ordered array of up to 25 TransactGetItem objects,\n each of which contains a Get structure.

", + "smithy.api#required": {} + } + }, + "ReturnConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ReturnConsumedCapacity", + "traits": { + "smithy.api#documentation": "

A value of TOTAL causes consumed capacity information\n to be returned, and a value of NONE prevents that information\n from being returned. No other value is valid.

" + } + } + } + }, + "com.amazonaws.dynamodb#TransactGetItemsOutput": { + "type": "structure", + "members": { + "Responses": { + "target": "com.amazonaws.dynamodb#ItemResponseList", + "traits": { + "smithy.api#documentation": "

An ordered array of up to 25 ItemResponse objects, each of which corresponds\n to the TransactGetItem object in the same position in the\n TransactItems array. Each ItemResponse object\n contains a Map of the name-value pairs that are the projected attributes of\n the requested item.

\n

If a requested item could not be retrieved, the corresponding ItemResponse\n object is Null, or if the requested item has no projected attributes, the corresponding\n ItemResponse object is an empty Map.

" + } + }, + "ConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ConsumedCapacityMultiple", + "traits": { + "smithy.api#documentation": "

If the ReturnConsumedCapacity value was TOTAL,\n this is an array of ConsumedCapacity objects, one for each table\n addressed by TransactGetItem objects in the TransactItems\n parameter. These ConsumedCapacity objects report the read-capacity\n units consumed by the TransactGetItems call in that table.

" + } + } + } + }, + "com.amazonaws.dynamodb#TransactWriteItem": { + "type": "structure", + "members": { + "Put": { + "target": "com.amazonaws.dynamodb#Put", + "traits": { + "smithy.api#documentation": "

A request to perform a PutItem operation.

" + } + }, + "Delete": { + "target": "com.amazonaws.dynamodb#Delete", + "traits": { + "smithy.api#documentation": "

A request to perform a DeleteItem operation.

" + } + }, + "ConditionCheck": { + "target": "com.amazonaws.dynamodb#ConditionCheck", + "traits": { + "smithy.api#documentation": "

A request to perform a check item operation.

" + } + }, + "Update": { + "target": "com.amazonaws.dynamodb#Update", + "traits": { + "smithy.api#documentation": "

A request to perform an UpdateItem operation.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

A list of requests that can perform update, put, delete, or check operations on multiple items in one or more tables atomically.

" + } + }, + "com.amazonaws.dynamodb#TransactWriteItemList": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#TransactWriteItem" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 25 + } + } + }, + "com.amazonaws.dynamodb#TransactWriteItems": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#TransactWriteItemsInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#TransactWriteItemsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#IdempotentParameterMismatchException" + }, + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" + }, + { + "target": "com.amazonaws.dynamodb#RequestLimitExceeded" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.dynamodb#TransactionCanceledException" + }, + { + "target": "com.amazonaws.dynamodb#TransactionInProgressException" + } + ], + "traits": { + "smithy.api#documentation": "

\n TransactWriteItems is a synchronous write operation that groups up to 25\n action requests. These actions can target items in different tables, but not in\n different AWS accounts or Regions, and no two actions can target the same item. For\n example, you cannot both ConditionCheck and Update the same\n item. The aggregate size of the items in the transaction cannot exceed 4 MB.

\n \n

The actions are completed atomically so that either all of\n them succeed, or all of them fail. They are defined by the following objects:

\n\n
    \n
  • \n

    \n Put — Initiates a PutItem operation to write a new\n item. This structure specifies the primary key of the item to be written, the\n name of the table to write it in, an optional condition expression that must be\n satisfied for the write to succeed, a list of the item's attributes, and a field\n indicating whether to retrieve the item's attributes if the condition is not\n met.

    \n
  • \n
  • \n

    \n Update — Initiates an UpdateItem operation to\n update an existing item. This structure specifies the primary key of the item to\n be updated, the name of the table where it resides, an optional condition\n expression that must be satisfied for the update to succeed, an expression that\n defines one or more attributes to be updated, and a field indicating whether to\n retrieve the item's attributes if the condition is not met.

    \n
  • \n
  • \n

    \n Delete — Initiates a DeleteItem operation to\n delete an existing item. This structure specifies the primary key of the item to\n be deleted, the name of the table where it resides, an optional condition\n expression that must be satisfied for the deletion to succeed, and a field\n indicating whether to retrieve the item's attributes if the condition is not\n met.

    \n
  • \n
  • \n

    \n ConditionCheck — Applies a condition to an item that is not\n being modified by the transaction. This structure specifies the primary key of\n the item to be checked, the name of the table where it resides, a condition\n expression that must be satisfied for the transaction to succeed, and a field\n indicating whether to retrieve the item's attributes if the condition is not\n met.

    \n
  • \n
\n\n

DynamoDB rejects the entire TransactWriteItems request if any of the following is true:

\n
    \n
  • \n

    A condition in one of the condition expressions is not met.

    \n
  • \n
  • \n

    An ongoing operation is in the process of updating the same\n item.

    \n
  • \n
  • \n

    There is insufficient provisioned capacity for the transaction\n to be completed.

    \n
  • \n
  • \n

    An item size becomes too large (bigger than 400 KB), a local secondary index (LSI) becomes too\n large, or a similar validation error occurs because of changes made by the\n transaction.

    \n
  • \n
  • \n

    The aggregate size of the items in the transaction exceeds 4 MB.

    \n
  • \n
  • \n

    There is a user error, such as an invalid data format.

    \n
  • \n
" + } + }, + "com.amazonaws.dynamodb#TransactWriteItemsInput": { + "type": "structure", + "members": { + "ReturnItemCollectionMetrics": { + "target": "com.amazonaws.dynamodb#ReturnItemCollectionMetrics", + "traits": { + "smithy.api#documentation": "

Determines whether item collection metrics are returned. If set to\n SIZE, the response includes statistics about item collections (if any), that\n were modified during the operation and are returned in the response.\n If set to NONE (the default), no statistics are returned.\n

" + } + }, + "ReturnConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ReturnConsumedCapacity" + }, + "ClientRequestToken": { + "target": "com.amazonaws.dynamodb#ClientRequestToken", + "traits": { + "smithy.api#documentation": "

Providing a ClientRequestToken makes the call to TransactWriteItems\n idempotent, meaning that multiple identical calls have the same effect as one single call.

\n

Although multiple identical calls using the same client request token produce the same\n result on the server (no side effects), the responses to the calls might not be the\n same. If the ReturnConsumedCapacity> parameter is set, then the initial\n TransactWriteItems call returns the amount of write capacity units\n consumed in making the changes. Subsequent TransactWriteItems calls with\n the same client token return the number of read capacity units consumed in reading the\n item.

\n

A client request token is valid for 10 minutes after the first request that uses it is\n completed. After 10 minutes, any request with the same client token is treated as a new\n request. Do not resubmit the same request with the same client token for more than 10\n minutes, or the result might not be idempotent.

\n

If you submit a request with the same client token but a change in other parameters\n within the 10-minute idempotency window, DynamoDB returns an\n IdempotentParameterMismatch exception.

", + "smithy.api#idempotencyToken": {} + } + }, + "TransactItems": { + "target": "com.amazonaws.dynamodb#TransactWriteItemList", + "traits": { + "smithy.api#documentation": "

An ordered array of up to 25 TransactWriteItem objects, each of which\n contains a ConditionCheck, Put, Update, or\n Delete object. These can operate on items in different tables, but the\n tables must reside in the same AWS account and Region, and no two of them can operate on\n the same item.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.dynamodb#TransactWriteItemsOutput": { + "type": "structure", + "members": { + "ItemCollectionMetrics": { + "target": "com.amazonaws.dynamodb#ItemCollectionMetricsPerTable", + "traits": { + "smithy.api#documentation": "

A list of tables that were processed by TransactWriteItems and, for each\n table, information about any item collections that were affected by individual\n UpdateItem, PutItem, or DeleteItem\n operations.

" + } + }, + "ConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ConsumedCapacityMultiple", + "traits": { + "smithy.api#documentation": "

The capacity units consumed by the entire TransactWriteItems\n operation. The values of the list are ordered according to\n the ordering of the TransactItems request parameter.\n

" + } + } + } + }, + "com.amazonaws.dynamodb#TransactionCanceledException": { + "type": "structure", + "members": { + "CancellationReasons": { + "target": "com.amazonaws.dynamodb#CancellationReasonList", + "traits": { + "smithy.api#documentation": "

A list of cancellation reasons.

" + } + }, + "Message": { + "target": "com.amazonaws.dynamodb#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

The entire transaction request was canceled.

\n

DynamoDB cancels a TransactWriteItems request under the following circumstances:

\n
    \n
  • \n

    A condition in one of the condition expressions is not met.

    \n
  • \n
  • \n

    A table in the TransactWriteItems request is in a different account or region.

    \n
  • \n
  • \n

    More than one action in the TransactWriteItems operation targets the same item.

    \n
  • \n
  • \n

    There is insufficient provisioned capacity for the transaction to be completed.

    \n
  • \n
  • \n

    An item size becomes too large (larger than 400 KB), or a local secondary index (LSI)\n becomes too large, or a similar validation error occurs because of changes made by the transaction.

    \n
  • \n
  • \n

    There is a user error, such as an invalid data format.

    \n
  • \n
\n\n

DynamoDB cancels a TransactGetItems request under the following circumstances:

\n
    \n
  • \n

    There is an ongoing TransactGetItems operation that conflicts with a concurrent\n PutItem, UpdateItem, DeleteItem or TransactWriteItems request.\n In this case the TransactGetItems operation fails with a TransactionCanceledException.

    \n
  • \n
  • \n

    A table in the TransactGetItems request is in a different account or region.

    \n
  • \n
  • \n

    There is insufficient provisioned capacity for the transaction to be completed.

    \n
  • \n
  • \n

    There is a user error, such as an invalid data format.

    \n
  • \n
\n\n \n

If using Java, DynamoDB lists the cancellation reasons on the CancellationReasons property. This property is not set for other languages.\n Transaction cancellation reasons are ordered in the order of requested items, if an item has no error it will have NONE code and Null message.

\n
\n

Cancellation reason codes and possible error messages:

\n
    \n
  • \n

    No Errors:

    \n
      \n
    • \n

      Code: NONE \n

      \n
    • \n
    • \n

      Message: null \n

      \n
    • \n
    \n
  • \n
  • \n

    Conditional Check Failed:

    \n
      \n
    • \n

      Code: ConditionalCheckFailed \n

      \n
    • \n
    • \n

      Message: The conditional request failed.

      \n
    • \n
    \n
  • \n
  • \n

    Item Collection Size Limit Exceeded:

    \n
      \n
    • \n

      Code: ItemCollectionSizeLimitExceeded \n

      \n
    • \n
    • \n

      Message: Collection size exceeded.

      \n
    • \n
    \n
  • \n
  • \n

    Transaction Conflict:

    \n
      \n
    • \n

      Code: TransactionConflict \n

      \n
    • \n
    • \n

      Message: Transaction is ongoing for the item.

      \n
    • \n
    \n
  • \n
  • \n

    Provisioned Throughput Exceeded:

    \n
      \n
    • \n

      Code: ProvisionedThroughputExceeded \n

      \n
    • \n
    • \n

      Messages:

      \n
        \n
      • \n

        The level of configured provisioned throughput for the table was exceeded. Consider increasing your provisioning level with the\n UpdateTable API.

        \n \n

        This Message is received when provisioned throughput is exceeded is on a provisioned DynamoDB table.

        \n
        \n
      • \n
      • \n

        The level of configured provisioned throughput for one or more global secondary indexes of the table was exceeded. \n Consider increasing your provisioning level for the under-provisioned global secondary indexes with the UpdateTable API.

        \n \n

        This message is returned when provisioned throughput is exceeded is on a provisioned GSI.

        \n
        \n
      • \n
      \n\n
    • \n
    \n
  • \n
  • \n

    Throttling Error:

    \n
      \n
    • \n

      Code: ThrottlingError \n

      \n
    • \n
    • \n

      Messages:

      \n
        \n
      • \n

        Throughput exceeds the current capacity of your table or index.\n DynamoDB is automatically scaling your table or index so please try\n again shortly. If exceptions persist, check if you have a hot key:\n https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html.

        \n \n

        This message is returned when writes get throttled on an On-Demand table as DynamoDB is automatically scaling the table.

        \n
        \n
      • \n
      • \n

        Throughput exceeds the current capacity for one or more global secondary indexes. DynamoDB is automatically scaling your index so\n please try again shortly.

        \n \n

        This message is returned when when writes get throttled on an On-Demand GSI as DynamoDB is automatically scaling the GSI.

        \n
        \n
      • \n
      \n\n
    • \n
    \n
  • \n
  • \n

    Validation Error:

    \n
      \n
    • \n

      Code: ValidationError \n

      \n
    • \n
    • \n

      Messages:

      \n
        \n
      • \n

        One or more parameter values were invalid.

        \n
      • \n
      • \n

        The update expression attempted to update the secondary index key beyond allowed size limits.

        \n
      • \n
      • \n

        The update expression attempted to update the secondary index key to unsupported type.

        \n
      • \n
      • \n

        An operand in the update expression has an incorrect data type.

        \n
      • \n
      • \n

        Item size to update has exceeded the maximum allowed size.

        \n
      • \n
      • \n

        Number overflow. Attempting to store a number with magnitude larger than supported range.

        \n
      • \n
      • \n

        Type mismatch for attribute to update.

        \n
      • \n
      • \n

        Nesting Levels have exceeded supported limits.

        \n
      • \n
      • \n

        The document path provided in the update expression is invalid for update.

        \n
      • \n
      • \n

        The provided expression refers to an attribute that does not exist in the item.

        \n
      • \n
      \n\n
    • \n
    \n
  • \n
", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#TransactionConflictException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.dynamodb#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

Operation was rejected because there is an ongoing transaction for the item.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#TransactionInProgressException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.dynamodb#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

The transaction with the given request token is already in progress.

", + "smithy.api#error": "client" + } + }, + "com.amazonaws.dynamodb#UntagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#UntagResourceInput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#LimitExceededException" + }, + { + "target": "com.amazonaws.dynamodb#ResourceInUseException" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Removes the association of tags from an Amazon DynamoDB resource. You can call\n UntagResource up to five times per second, per account.

\n

For an overview on tagging DynamoDB resources, see\n Tagging for DynamoDB\n in the Amazon DynamoDB Developer Guide.

" + } + }, + "com.amazonaws.dynamodb#UntagResourceInput": { + "type": "structure", + "members": { + "ResourceArn": { + "target": "com.amazonaws.dynamodb#ResourceArnString", + "traits": { + "smithy.api#documentation": "

The DynamoDB resource that the tags will be removed from. This value is an Amazon\n Resource Name (ARN).

", + "smithy.api#required": {} + } + }, + "TagKeys": { + "target": "com.amazonaws.dynamodb#TagKeyList", + "traits": { + "smithy.api#documentation": "

A list of tag keys. Existing tags of the resource whose keys are members of this list\n will be removed from the DynamoDB resource.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.dynamodb#Update": { + "type": "structure", + "members": { + "UpdateExpression": { + "target": "com.amazonaws.dynamodb#UpdateExpression", + "traits": { + "smithy.api#documentation": "

An expression that defines one or more attributes to be updated,\n the action to be performed on them, and new value(s) for them.

", + "smithy.api#required": {} + } + }, + "ExpressionAttributeNames": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeNameMap", + "traits": { + "smithy.api#documentation": "

One or more substitution tokens for attribute names in an expression.

" + } + }, + "ReturnValuesOnConditionCheckFailure": { + "target": "com.amazonaws.dynamodb#ReturnValuesOnConditionCheckFailure", + "traits": { + "smithy.api#documentation": "

Use ReturnValuesOnConditionCheckFailure to\n get the item attributes if the Update condition fails.\n For ReturnValuesOnConditionCheckFailure, the valid\n values are: NONE, ALL_OLD, UPDATED_OLD, ALL_NEW, UPDATED_NEW.

" + } + }, + "Key": { + "target": "com.amazonaws.dynamodb#Key", + "traits": { + "smithy.api#documentation": "

The primary key of the item to be updated. Each element consists of\n an attribute name and a value for that attribute.

", + "smithy.api#required": {} + } + }, + "ExpressionAttributeValues": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeValueMap", + "traits": { + "smithy.api#documentation": "

One or more values that can be substituted in an expression.

" + } + }, + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

Name of the table for the UpdateItem request.

", + "smithy.api#required": {} + } + }, + "ConditionExpression": { + "target": "com.amazonaws.dynamodb#ConditionExpression", + "traits": { + "smithy.api#documentation": "

A condition that must be satisfied in order for a conditional update to\n succeed.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a request to perform an UpdateItem operation.

" + } + }, + "com.amazonaws.dynamodb#UpdateContinuousBackups": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#UpdateContinuousBackupsInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#UpdateContinuousBackupsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#ContinuousBackupsUnavailableException" + }, + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#TableNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

\n UpdateContinuousBackups enables or disables point in time recovery for the specified table.\n A successful UpdateContinuousBackups call returns the current ContinuousBackupsDescription.\n Continuous backups are ENABLED on all tables at table creation.\n If point in time recovery is enabled, PointInTimeRecoveryStatus will be set to ENABLED.

\n

\n Once continuous backups and point in time recovery are enabled, you can restore to any point in time within\n EarliestRestorableDateTime and LatestRestorableDateTime.\n

\n

\n LatestRestorableDateTime is typically 5 minutes before the current time.\n You can restore your table to any point in time during the last 35 days.

" + } + }, + "com.amazonaws.dynamodb#UpdateContinuousBackupsInput": { + "type": "structure", + "members": { + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table.

", + "smithy.api#required": {} + } + }, + "PointInTimeRecoverySpecification": { + "target": "com.amazonaws.dynamodb#PointInTimeRecoverySpecification", + "traits": { + "smithy.api#documentation": "

Represents the settings used to enable point in time recovery.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.dynamodb#UpdateContinuousBackupsOutput": { + "type": "structure", + "members": { + "ContinuousBackupsDescription": { + "target": "com.amazonaws.dynamodb#ContinuousBackupsDescription", + "traits": { + "smithy.api#documentation": "

Represents the continuous backups and point in time recovery settings on the table.

" + } + } + } + }, + "com.amazonaws.dynamodb#UpdateContributorInsights": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#UpdateContributorInsightsInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#UpdateContributorInsightsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Updates the status for contributor insights for a specific table or index.

" + } + }, + "com.amazonaws.dynamodb#UpdateContributorInsightsInput": { + "type": "structure", + "members": { + "ContributorInsightsAction": { + "target": "com.amazonaws.dynamodb#ContributorInsightsAction", + "traits": { + "smithy.api#documentation": "

Represents the contributor insights action.

", + "smithy.api#required": {} + } + }, + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The global secondary index name, if applicable.

" + } + }, + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.dynamodb#UpdateContributorInsightsOutput": { + "type": "structure", + "members": { + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table.

" + } + }, + "ContributorInsightsStatus": { + "target": "com.amazonaws.dynamodb#ContributorInsightsStatus", + "traits": { + "smithy.api#documentation": "

The status of contributor insights

" + } + }, + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of the global secondary index, if applicable.

" + } + } + } + }, + "com.amazonaws.dynamodb#UpdateExpression": { + "type": "string" + }, + "com.amazonaws.dynamodb#UpdateGlobalSecondaryIndexAction": { + "type": "structure", + "members": { + "ProvisionedThroughput": { + "target": "com.amazonaws.dynamodb#ProvisionedThroughput", + "traits": { + "smithy.api#documentation": "

Represents the provisioned throughput settings for the specified global secondary index.

\n

For current minimum and maximum provisioned throughput values, see Service, Account, and Table Quotas in the Amazon DynamoDB Developer Guide.

", + "smithy.api#required": {} + } + }, + "IndexName": { + "target": "com.amazonaws.dynamodb#IndexName", + "traits": { + "smithy.api#documentation": "

The name of the global secondary index to be updated.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the new provisioned throughput settings to be applied to a global secondary index.

" + } + }, + "com.amazonaws.dynamodb#UpdateGlobalTable": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#UpdateGlobalTableInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#UpdateGlobalTableOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#GlobalTableNotFoundException" + }, + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#ReplicaAlreadyExistsException" + }, + { + "target": "com.amazonaws.dynamodb#ReplicaNotFoundException" + }, + { + "target": "com.amazonaws.dynamodb#TableNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Adds or removes replicas in the specified global table. The global table must already\n exist to be able to use this operation. Any replica to be added must be empty, have the\n same name as the global table, have the same key schema, have DynamoDB Streams enabled,\n and have the same provisioned and maximum write capacity units.

\n \n

Although you can use UpdateGlobalTable to add replicas and remove replicas in\n a single request, for simplicity we recommend that you issue separate requests for\n adding or removing replicas.

\n
\n \t

\n If global secondary indexes are specified, then the following conditions must also be met:\n

\n
    \n
  • \n

    \n The global secondary indexes must have the same name.\n

    \n
  • \n
  • \n

    \n The global secondary indexes must have the same hash key and sort key (if present).\n

    \n
  • \n
  • \n

    \n The global secondary indexes must have the same provisioned and maximum write capacity units.\n

    \n
  • \n
" + } + }, + "com.amazonaws.dynamodb#UpdateGlobalTableInput": { + "type": "structure", + "members": { + "GlobalTableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The global table name.

", + "smithy.api#required": {} + } + }, + "ReplicaUpdates": { + "target": "com.amazonaws.dynamodb#ReplicaUpdateList", + "traits": { + "smithy.api#documentation": "

A list of Regions that should be added or removed from the global table.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.dynamodb#UpdateGlobalTableOutput": { + "type": "structure", + "members": { + "GlobalTableDescription": { + "target": "com.amazonaws.dynamodb#GlobalTableDescription", + "traits": { + "smithy.api#documentation": "

Contains the details of the global table.

" + } + } + } + }, + "com.amazonaws.dynamodb#UpdateGlobalTableSettings": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#UpdateGlobalTableSettingsInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#UpdateGlobalTableSettingsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#GlobalTableNotFoundException" + }, + { + "target": "com.amazonaws.dynamodb#IndexNotFoundException" + }, + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#LimitExceededException" + }, + { + "target": "com.amazonaws.dynamodb#ReplicaNotFoundException" + }, + { + "target": "com.amazonaws.dynamodb#ResourceInUseException" + } + ], + "traits": { + "smithy.api#documentation": "

Updates settings for a global table.

" + } + }, + "com.amazonaws.dynamodb#UpdateGlobalTableSettingsInput": { + "type": "structure", + "members": { + "GlobalTableProvisionedWriteCapacityUnits": { + "target": "com.amazonaws.dynamodb#PositiveLongObject", + "traits": { + "smithy.api#documentation": "

The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException.\n

" + } + }, + "GlobalTableGlobalSecondaryIndexSettingsUpdate": { + "target": "com.amazonaws.dynamodb#GlobalTableGlobalSecondaryIndexSettingsUpdateList", + "traits": { + "smithy.api#documentation": "

Represents the settings of a global secondary index for a global table that will be modified.

" + } + }, + "ReplicaSettingsUpdate": { + "target": "com.amazonaws.dynamodb#ReplicaSettingsUpdateList", + "traits": { + "smithy.api#documentation": "

Represents the settings for a global table in a Region that will be modified.

" + } + }, + "GlobalTableBillingMode": { + "target": "com.amazonaws.dynamodb#BillingMode", + "traits": { + "smithy.api#documentation": "

The billing mode of the global table. If GlobalTableBillingMode is not specified, the global table defaults to PROVISIONED capacity billing mode.

\n
    \n
  • \n

    \n PROVISIONED - We recommend using PROVISIONED for predictable workloads. PROVISIONED sets the billing mode to Provisioned Mode.

    \n
  • \n
  • \n

    \n PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable workloads. PAY_PER_REQUEST sets the billing mode to On-Demand Mode.\n

    \n
  • \n
" + } + }, + "GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate": { + "target": "com.amazonaws.dynamodb#AutoScalingSettingsUpdate", + "traits": { + "smithy.api#documentation": "

Auto scaling settings for managing provisioned write capacity for the global\n table.

" + } + }, + "GlobalTableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the global table

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.dynamodb#UpdateGlobalTableSettingsOutput": { + "type": "structure", + "members": { + "ReplicaSettings": { + "target": "com.amazonaws.dynamodb#ReplicaSettingsDescriptionList", + "traits": { + "smithy.api#documentation": "

The Region-specific settings for the global table.

" + } + }, + "GlobalTableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the global table.

" + } + } + } + }, + "com.amazonaws.dynamodb#UpdateItem": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#UpdateItemInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#UpdateItemOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#ConditionalCheckFailedException" + }, + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException" + }, + { + "target": "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" + }, + { + "target": "com.amazonaws.dynamodb#RequestLimitExceeded" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.dynamodb#TransactionConflictException" + } + ], + "traits": { + "smithy.api#documentation": "

Edits an existing item's attributes, or adds a new item to the table if it does not already exist. You can put, delete, or add attribute values. You can also perform a conditional update on an existing item (insert a new attribute name-value pair if it doesn't exist, or replace an existing name-value pair if it has certain expected attribute values).

\n

You can also return the item's attribute values in the same UpdateItem\n operation using the ReturnValues parameter.

" + } + }, + "com.amazonaws.dynamodb#UpdateItemInput": { + "type": "structure", + "members": { + "ReturnValues": { + "target": "com.amazonaws.dynamodb#ReturnValue", + "traits": { + "smithy.api#documentation": "

Use ReturnValues if you want to get the item attributes as they appear\n before or after they are updated. For UpdateItem, the valid values\n are:

\n
    \n
  • \n

    \n NONE - If ReturnValues is not specified, or if its value is\n NONE, then nothing is returned. (This setting is the default for\n ReturnValues.)

    \n
  • \n
  • \n

    \n ALL_OLD - Returns all of the attributes of the item, as they appeared before the UpdateItem operation.

    \n
  • \n
  • \n

    \n UPDATED_OLD - Returns only the updated attributes, as they appeared before the UpdateItem operation.

    \n
  • \n
  • \n

    \n ALL_NEW - Returns all of the attributes of the item, as they appear after the UpdateItem operation.

    \n
  • \n
  • \n

    \n UPDATED_NEW - Returns only the updated attributes, as they appear after the UpdateItem operation.

    \n
  • \n
\n

There is no additional cost associated with requesting a return value aside from the\n small network and processing overhead of receiving a larger response. No read capacity\n units are consumed.

\n

The values returned are strongly consistent.

" + } + }, + "UpdateExpression": { + "target": "com.amazonaws.dynamodb#UpdateExpression", + "traits": { + "smithy.api#documentation": "

An expression that defines one or more attributes to be updated, the action to be\n performed on them, and new values for them.

\n

The following action values are available for UpdateExpression.

\n
    \n
  • \n

    \n SET - Adds one or more attributes and values to an item. If any of\n these attributes already exist, they are replaced by the new values. You can\n also use SET to add or subtract from an attribute that is of type\n Number. For example: SET myNum = myNum + :val\n

    \n

    \n SET supports the following functions:

    \n
      \n
    • \n

      \n if_not_exists (path, operand) - if the item does not contain an attribute at the specified path, then if_not_exists evaluates to operand; otherwise, it evaluates to path. You can use this function to avoid overwriting an attribute that may already be present in the item.

      \n
    • \n
    • \n

      \n list_append (operand, operand) - evaluates to a list with a new element added to it. You can append the new element to the start or the end of the list by reversing the order of the operands.

      \n
    • \n
    \n

    These function names are case-sensitive.

    \n
  • \n
  • \n

    \n REMOVE - Removes one or more attributes from an item.

    \n
  • \n
  • \n

    \n ADD - Adds the specified value to the item, if the attribute does not already exist. If the attribute does exist, then the behavior of\n ADD depends on the data type of the attribute:

    \n
      \n
    • \n

      If the existing attribute is a number, and if Value is also a number, then\n Value is mathematically added to the existing attribute. If Value is a\n negative number, then it is subtracted from the existing attribute.

      \n \n

      If you use ADD to increment or decrement a number value for an item\n that doesn't exist before the update, DynamoDB uses 0 as the initial\n value.

      \n

      Similarly, if you use ADD for an existing item to increment\n or decrement an attribute value that doesn't exist before the\n update, DynamoDB uses 0 as the initial value. For\n example, suppose that the item you want to update doesn't have an\n attribute named itemcount, but you decide to\n ADD the number 3 to this attribute\n anyway. DynamoDB will create the itemcount attribute,\n set its initial value to 0, and finally add\n 3 to it. The result will be a new\n itemcount attribute in the item, with a value of\n 3.

      \n
      \n
    • \n
    • \n

      If the existing data type is a set and if Value is also a set, then\n Value is added to the existing set. For example, if the attribute value is the set\n [1,2], and the ADD action specified [3], then\n the final attribute value is [1,2,3]. An error occurs if an ADD\n action is specified for a set attribute and the attribute type specified does not\n match the existing set type.

      \n

      Both sets must have the same primitive data type. For example, if the existing data\n type is a set of strings, the Value must also be a set of strings.

      \n
    • \n
    \n \n

    The ADD action only supports Number and set data types. In addition,\n ADD can only be used on top-level attributes, not nested attributes.

    \n
    \n
  • \n
  • \n

    \n DELETE - Deletes an element from a set.

    \n

    If a set of values is specified, then those values are subtracted from the old\n set. For example, if the attribute value was the set [a,b,c] and the\n DELETE action specifies [a,c], then the final attribute value\n is [b]. Specifying an empty set is an error.

    \n \n

    The DELETE action only supports set data types. In addition,\n DELETE can only be used on top-level attributes, not nested attributes.

    \n
    \n\n
  • \n
\n

You can have many actions in a single expression, such as the following: SET a=:value1,\n b=:value2 DELETE :value3, :value4, :value5\n

\n

For more information on update expressions, see Modifying Items and Attributes in the Amazon DynamoDB Developer Guide.

" + } + }, + "ExpressionAttributeNames": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeNameMap", + "traits": { + "smithy.api#documentation": "

One or more substitution tokens for attribute names in an expression. The following are some use cases for using ExpressionAttributeNames:

\n
    \n
  • \n

    To access an attribute whose name conflicts with a DynamoDB reserved word.

    \n
  • \n
  • \n

    To create a placeholder for repeating occurrences of an attribute name in an expression.

    \n
  • \n
  • \n

    To prevent special characters in an attribute name from being misinterpreted in an expression.

    \n
  • \n
\n

Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:

\n
    \n
  • \n

    \n Percentile\n

    \n
  • \n
\n

The name of this attribute conflicts with a reserved word, so it cannot be used directly\n in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer\n Guide.) To work around this, you could specify the following for\n ExpressionAttributeNames:

\n
    \n
  • \n

    \n {\"#P\":\"Percentile\"}\n

    \n
  • \n
\n

You could then use this substitution in an expression, as in this example:

\n
    \n
  • \n

    \n #P = :val\n

    \n
  • \n
\n \n

Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.

\n
\n

For more information about expression attribute names, see Specifying Item Attributes in the Amazon DynamoDB Developer\n Guide.

" + } + }, + "ConditionalOperator": { + "target": "com.amazonaws.dynamodb#ConditionalOperator", + "traits": { + "smithy.api#documentation": "

This is a legacy parameter. Use ConditionExpression instead. For more information, see\n ConditionalOperator in the Amazon DynamoDB Developer Guide.

" + } + }, + "ConditionExpression": { + "target": "com.amazonaws.dynamodb#ConditionExpression", + "traits": { + "smithy.api#documentation": "

A condition that must be satisfied in order for a conditional update to succeed.

\n

An expression can contain any of the following:

\n
    \n
  • \n

    Functions: attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size\n

    \n

    These function names are case-sensitive.

    \n
  • \n
  • \n

    Comparison operators: = | <> |\n < | > | <= | >= |\n BETWEEN | IN \n

    \n
  • \n
  • \n

    Logical operators: AND | OR | NOT\n

    \n
  • \n
\n

For more information about condition expressions, see Specifying Conditions in the Amazon DynamoDB Developer\n Guide.

" + } + }, + "AttributeUpdates": { + "target": "com.amazonaws.dynamodb#AttributeUpdates", + "traits": { + "smithy.api#documentation": "

This is a legacy parameter. Use UpdateExpression instead. For more information, see\n AttributeUpdates in the Amazon DynamoDB Developer Guide.

" + } + }, + "Expected": { + "target": "com.amazonaws.dynamodb#ExpectedAttributeMap", + "traits": { + "smithy.api#documentation": "

This is a legacy parameter. Use ConditionExpression instead. For more information, see\n Expected in the Amazon DynamoDB Developer Guide.

" + } + }, + "ReturnConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ReturnConsumedCapacity" + }, + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table containing the item to update.

", + "smithy.api#required": {} + } + }, + "Key": { + "target": "com.amazonaws.dynamodb#Key", + "traits": { + "smithy.api#documentation": "

The primary key of the item to be updated. Each element consists of an attribute name and a value for that attribute.

\n

For the primary key, you must provide all of the 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.

", + "smithy.api#required": {} + } + }, + "ReturnItemCollectionMetrics": { + "target": "com.amazonaws.dynamodb#ReturnItemCollectionMetrics", + "traits": { + "smithy.api#documentation": "

Determines whether item collection metrics are returned. If set to SIZE, the response includes statistics about item collections, if any, that were modified during\n the operation are returned in the response. If set to NONE (the default), no statistics are returned.

" + } + }, + "ExpressionAttributeValues": { + "target": "com.amazonaws.dynamodb#ExpressionAttributeValueMap", + "traits": { + "smithy.api#documentation": "

One or more values that can be substituted in an expression.

\n

Use the : (colon) character in an expression to\n dereference an attribute value. For example, suppose that you wanted to check whether\n the value of the ProductStatus attribute was one of the following:

\n

\n Available | Backordered | Discontinued\n

\n

You would first need to specify ExpressionAttributeValues as follows:

\n

\n { \":avail\":{\"S\":\"Available\"}, \":back\":{\"S\":\"Backordered\"}, \":disc\":{\"S\":\"Discontinued\"} }\n

\n

You could then use these values in an expression, such as this:

\n

\n ProductStatus IN (:avail, :back, :disc)\n

\n

For more information on expression attribute values, see Condition Expressions in the Amazon DynamoDB Developer\n Guide.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the input of an UpdateItem operation.

" + } + }, + "com.amazonaws.dynamodb#UpdateItemOutput": { + "type": "structure", + "members": { + "Attributes": { + "target": "com.amazonaws.dynamodb#AttributeMap", + "traits": { + "smithy.api#documentation": "

A map of attribute values as they appear before or after the UpdateItem\n operation, as determined by the ReturnValues parameter.

\n

The Attributes map is only present if ReturnValues was\n specified as something other than NONE in the request. Each element\n represents one attribute.

" + } + }, + "ItemCollectionMetrics": { + "target": "com.amazonaws.dynamodb#ItemCollectionMetrics", + "traits": { + "smithy.api#documentation": "

Information about item collections, if any, that were affected by the\n UpdateItem operation.\n ItemCollectionMetrics is only returned if the ReturnItemCollectionMetrics parameter was specified. If the table\n does not have any local secondary indexes, this information is not\n returned in the response.

\n

Each ItemCollectionMetrics\n element consists of:

\n
    \n
  • \n

    \n ItemCollectionKey - The partition key value of the item\n collection. This is the same as the partition key value of the item itself.

    \n
  • \n
  • \n

    \n SizeEstimateRangeGB - An estimate of item collection size,\n in gigabytes. This value is a two-element array\n containing a lower bound and an upper bound for the\n estimate. The estimate includes the size of all the\n items in the table, plus the size of all attributes\n projected into all of the local secondary indexes on that\n table. Use this estimate to measure whether a local secondary index is approaching its size limit.

    \n

    The estimate is subject to change over time; therefore, do not rely on the precision or accuracy of the estimate.

    \n
  • \n
" + } + }, + "ConsumedCapacity": { + "target": "com.amazonaws.dynamodb#ConsumedCapacity", + "traits": { + "smithy.api#documentation": "

The capacity units consumed by the UpdateItem operation. The data returned includes the total\n provisioned throughput consumed, along with statistics for the table and any indexes involved\n in the operation. ConsumedCapacity is only returned if the ReturnConsumedCapacity parameter was specified.\n For more information, see Provisioned\n Throughput in the Amazon DynamoDB Developer Guide.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the output of an UpdateItem operation.

" + } + }, + "com.amazonaws.dynamodb#UpdateReplicationGroupMemberAction": { + "type": "structure", + "members": { + "RegionName": { + "target": "com.amazonaws.dynamodb#RegionName", + "traits": { + "smithy.api#documentation": "

The Region where the replica exists.

", + "smithy.api#required": {} + } + }, + "GlobalSecondaryIndexes": { + "target": "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexList", + "traits": { + "smithy.api#documentation": "

Replica-specific global secondary index settings.

" + } + }, + "ProvisionedThroughputOverride": { + "target": "com.amazonaws.dynamodb#ProvisionedThroughputOverride", + "traits": { + "smithy.api#documentation": "

Replica-specific provisioned throughput. If not specified, uses the source table's\n provisioned throughput settings.

" + } + }, + "KMSMasterKeyId": { + "target": "com.amazonaws.dynamodb#KMSMasterKeyId", + "traits": { + "smithy.api#documentation": "

The AWS KMS customer master key (CMK) of the replica that should be used for AWS KMS encryption.\n To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or alias\n ARN. Note that you should only provide this parameter if the key is different from\n the default DynamoDB KMS master key alias/aws/dynamodb.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents a replica to be modified.

" + } + }, + "com.amazonaws.dynamodb#UpdateTable": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#UpdateTableInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#UpdateTableOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#LimitExceededException" + }, + { + "target": "com.amazonaws.dynamodb#ResourceInUseException" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Modifies the provisioned throughput settings, global secondary indexes, or DynamoDB Streams settings for a given table.

\n

You can only perform one of the following operations at once:

\n
    \n
  • \n

    Modify the provisioned throughput settings of the table.

    \n
  • \n
  • \n

    Enable or disable DynamoDB Streams on the table.

    \n
  • \n
  • \n

    Remove a global secondary index from the table.

    \n
  • \n
  • \n

    Create a new global secondary index on the table. After the index begins\n backfilling, you can use UpdateTable to perform other\n operations.

    \n
  • \n
\n

\n UpdateTable is an asynchronous operation; while it is executing, the table status\n changes from ACTIVE to UPDATING. While it is UPDATING,\n you cannot issue another UpdateTable request. When the table returns to the\n ACTIVE state, the UpdateTable operation is complete.

" + } + }, + "com.amazonaws.dynamodb#UpdateTableInput": { + "type": "structure", + "members": { + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table to be updated.

", + "smithy.api#required": {} + } + }, + "GlobalSecondaryIndexUpdates": { + "target": "com.amazonaws.dynamodb#GlobalSecondaryIndexUpdateList", + "traits": { + "smithy.api#documentation": "

An array of one or more global secondary indexes for the table. For each index in the array, you can request one action:

\n
    \n
  • \n

    \n Create - add a new global secondary index to the table.

    \n
  • \n
  • \n

    \n Update - modify the provisioned throughput settings of an existing global secondary index.

    \n
  • \n
  • \n

    \n Delete - remove a global secondary index from the table.

    \n
  • \n
\n

You can create or delete only one global secondary index per UpdateTable operation.

\n

For more information, see Managing Global Secondary\n Indexes in the Amazon DynamoDB Developer Guide.

" + } + }, + "AttributeDefinitions": { + "target": "com.amazonaws.dynamodb#AttributeDefinitions", + "traits": { + "smithy.api#documentation": "

An array of attributes that describe the key schema for the table and indexes. If you are adding a new global secondary index to the table, AttributeDefinitions must include the key element(s) of the new index.

" + } + }, + "SSESpecification": { + "target": "com.amazonaws.dynamodb#SSESpecification", + "traits": { + "smithy.api#documentation": "

The new server-side encryption settings for the specified table.

" + } + }, + "BillingMode": { + "target": "com.amazonaws.dynamodb#BillingMode", + "traits": { + "smithy.api#documentation": "

Controls how you are charged for read and write throughput and how you manage capacity. \n When switching from pay-per-request to provisioned capacity, initial provisioned capacity values must be set. The initial\n provisioned capacity values are estimated based on the consumed read and write capacity of your table and global secondary indexes \n over the past 30 minutes.

\n
    \n
  • \n

    \n PROVISIONED - We recommend using PROVISIONED for predictable workloads. PROVISIONED sets the billing mode to Provisioned Mode.

    \n
  • \n
  • \n

    \n PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable workloads. PAY_PER_REQUEST sets the billing mode to On-Demand Mode.\n

    \n
  • \n
" + } + }, + "ReplicaUpdates": { + "target": "com.amazonaws.dynamodb#ReplicationGroupUpdateList", + "traits": { + "smithy.api#documentation": "

A list of replica update actions (create, delete, or update) for the table.

\n \n

This property only applies to Version 2019.11.21 of global tables.

\n
" + } + }, + "ProvisionedThroughput": { + "target": "com.amazonaws.dynamodb#ProvisionedThroughput", + "traits": { + "smithy.api#documentation": "

The new provisioned throughput settings for the specified table or index.

" + } + }, + "StreamSpecification": { + "target": "com.amazonaws.dynamodb#StreamSpecification", + "traits": { + "smithy.api#documentation": "

Represents the DynamoDB Streams configuration for the table.

\n \n

You receive a ResourceInUseException if you try to enable a stream on a\n table that already has a stream, or if you try to disable a stream on a table that\n doesn't have a stream.

\n
" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the input of an UpdateTable operation.

" + } + }, + "com.amazonaws.dynamodb#UpdateTableOutput": { + "type": "structure", + "members": { + "TableDescription": { + "target": "com.amazonaws.dynamodb#TableDescription", + "traits": { + "smithy.api#documentation": "

Represents the properties of the table.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the output of an UpdateTable operation.

" + } + }, + "com.amazonaws.dynamodb#UpdateTableReplicaAutoScaling": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#UpdateTableReplicaAutoScalingInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#UpdateTableReplicaAutoScalingOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#LimitExceededException" + }, + { + "target": "com.amazonaws.dynamodb#ResourceInUseException" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Updates auto scaling settings on your global tables at once.

\n \n

This operation only applies to Version 2019.11.21 of global tables.

\n
" + } + }, + "com.amazonaws.dynamodb#UpdateTableReplicaAutoScalingInput": { + "type": "structure", + "members": { + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the global table to be updated.

", + "smithy.api#required": {} + } + }, + "ProvisionedWriteCapacityAutoScalingUpdate": { + "target": "com.amazonaws.dynamodb#AutoScalingSettingsUpdate" + }, + "GlobalSecondaryIndexUpdates": { + "target": "com.amazonaws.dynamodb#GlobalSecondaryIndexAutoScalingUpdateList", + "traits": { + "smithy.api#documentation": "

Represents the auto scaling settings of the global secondary indexes of the replica\n to be updated.

" + } + }, + "ReplicaUpdates": { + "target": "com.amazonaws.dynamodb#ReplicaAutoScalingUpdateList", + "traits": { + "smithy.api#documentation": "

Represents the auto scaling settings of replicas of the table that will be\n modified.

" + } + } + } + }, + "com.amazonaws.dynamodb#UpdateTableReplicaAutoScalingOutput": { + "type": "structure", + "members": { + "TableAutoScalingDescription": { + "target": "com.amazonaws.dynamodb#TableAutoScalingDescription", + "traits": { + "smithy.api#documentation": "

Returns information about the auto scaling settings of a table with replicas.

" + } + } + } + }, + "com.amazonaws.dynamodb#UpdateTimeToLive": { + "type": "operation", + "input": { + "target": "com.amazonaws.dynamodb#UpdateTimeToLiveInput" + }, + "output": { + "target": "com.amazonaws.dynamodb#UpdateTimeToLiveOutput" + }, + "errors": [ + { + "target": "com.amazonaws.dynamodb#InternalServerError" + }, + { + "target": "com.amazonaws.dynamodb#InvalidEndpointException" + }, + { + "target": "com.amazonaws.dynamodb#LimitExceededException" + }, + { + "target": "com.amazonaws.dynamodb#ResourceInUseException" + }, + { + "target": "com.amazonaws.dynamodb#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

The UpdateTimeToLive method enables or disables Time to Live (TTL) for the\n specified table. A successful UpdateTimeToLive call returns the current\n TimeToLiveSpecification. It can take up to one hour for the change to\n fully process. Any additional UpdateTimeToLive calls for the same table\n during this one hour duration result in a ValidationException.

\n

TTL compares the current time in epoch time format to the time stored in the TTL\n attribute of an item. If the epoch time value stored in the attribute is less than the\n current time, the item is marked as expired and subsequently deleted.

\n \n

The epoch time format is the number of seconds elapsed since 12:00:00 AM January 1,\n 1970 UTC.

\n
\n

DynamoDB deletes expired items on a best-effort basis to ensure availability of\n throughput for other data operations.\n

\n \n

DynamoDB typically deletes expired items within two days of expiration. The exact duration\n within which an item gets deleted after expiration is specific to the\n nature of the workload. Items that have expired and not been deleted will still show up in reads,\n queries, and scans.

\n
\n

As items are deleted, they are removed from any local secondary index and global\n secondary index immediately in the same eventually consistent way as a standard delete\n operation.

\n

For more information, see Time To Live in the Amazon DynamoDB Developer Guide.

" + } + }, + "com.amazonaws.dynamodb#UpdateTimeToLiveInput": { + "type": "structure", + "members": { + "TimeToLiveSpecification": { + "target": "com.amazonaws.dynamodb#TimeToLiveSpecification", + "traits": { + "smithy.api#documentation": "

Represents the settings used to enable or disable Time to Live for the specified table.

", + "smithy.api#required": {} + } + }, + "TableName": { + "target": "com.amazonaws.dynamodb#TableName", + "traits": { + "smithy.api#documentation": "

The name of the table to be configured.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents the input of an UpdateTimeToLive operation.

" + } + }, + "com.amazonaws.dynamodb#UpdateTimeToLiveOutput": { + "type": "structure", + "members": { + "TimeToLiveSpecification": { + "target": "com.amazonaws.dynamodb#TimeToLiveSpecification", + "traits": { + "smithy.api#documentation": "

Represents the output of an UpdateTimeToLive operation.

" + } + } + } + }, + "com.amazonaws.dynamodb#WriteRequest": { + "type": "structure", + "members": { + "DeleteRequest": { + "target": "com.amazonaws.dynamodb#DeleteRequest", + "traits": { + "smithy.api#documentation": "

A request to perform a DeleteItem operation.

" + } + }, + "PutRequest": { + "target": "com.amazonaws.dynamodb#PutRequest", + "traits": { + "smithy.api#documentation": "

A request to perform a PutItem operation.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Represents an operation to perform - either DeleteItem or\n PutItem. You can only request one of these operations, not both, in a\n single WriteRequest. If you do need to perform both of these operations, you\n need to provide two separate WriteRequest objects.

" + } + }, + "com.amazonaws.dynamodb#WriteRequests": { + "type": "list", + "member": { + "target": "com.amazonaws.dynamodb#WriteRequest" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 25 + } + } + } + } +} \ No newline at end of file diff --git a/codegen-test/model/ebs.json b/codegen-test/model/ebs.json new file mode 100644 index 000000000..19154367b --- /dev/null +++ b/codegen-test/model/ebs.json @@ -0,0 +1,1350 @@ +{ + "smithy": "1.0", + "metadata": { + "suppressions": [ + { + "id": "HttpMethodSemantics", + "namespace": "*" + }, + { + "id": "HttpResponseCodeSemantics", + "namespace": "*" + }, + { + "id": "PaginatedTrait", + "namespace": "*" + }, + { + "id": "HttpHeaderTrait", + "namespace": "*" + }, + { + "id": "HttpUriConflict", + "namespace": "*" + }, + { + "id": "Service", + "namespace": "*" + } + ] + }, + "shapes": { + "com.amazonaws.ebs#AccessDeniedException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.ebs#ErrorMessage" + }, + "Reason": { + "target": "com.amazonaws.ebs#AccessDeniedExceptionReason", + "traits": { + "smithy.api#documentation": "

The reason for the exception.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

You do not have sufficient access to perform this action.

", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.amazonaws.ebs#AccessDeniedExceptionReason": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "UNAUTHORIZED_ACCOUNT", + "name": "UNAUTHORIZED_ACCOUNT" + }, + { + "value": "DEPENDENCY_ACCESS_DENIED", + "name": "DEPENDENCY_ACCESS_DENIED" + } + ] + } + }, + "com.amazonaws.ebs#Block": { + "type": "structure", + "members": { + "BlockToken": { + "target": "com.amazonaws.ebs#BlockToken", + "traits": { + "smithy.api#documentation": "

The block token for the block index.

" + } + }, + "BlockIndex": { + "target": "com.amazonaws.ebs#BlockIndex", + "traits": { + "smithy.api#documentation": "

The block index.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

A block of data in an Amazon Elastic Block Store snapshot.

" + } + }, + "com.amazonaws.ebs#BlockData": { + "type": "blob", + "traits": { + "smithy.api#sensitive": {}, + "smithy.api#streaming": {} + } + }, + "com.amazonaws.ebs#BlockIndex": { + "type": "integer", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 0 + } + } + }, + "com.amazonaws.ebs#BlockSize": { + "type": "integer", + "traits": { + "smithy.api#box": {} + } + }, + "com.amazonaws.ebs#BlockToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 256 + }, + "smithy.api#pattern": "^[A-Za-z0-9+/=]+$" + } + }, + "com.amazonaws.ebs#Blocks": { + "type": "list", + "member": { + "target": "com.amazonaws.ebs#Block" + }, + "traits": { + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.ebs#Boolean": { + "type": "boolean", + "traits": { + "smithy.api#box": {} + } + }, + "com.amazonaws.ebs#ChangedBlock": { + "type": "structure", + "members": { + "FirstBlockToken": { + "target": "com.amazonaws.ebs#BlockToken", + "traits": { + "smithy.api#documentation": "

The block token for the block index of the FirstSnapshotId specified in\n the ListChangedBlocks operation. This value is absent if the first snapshot\n does not have the changed block that is on the second snapshot.

" + } + }, + "BlockIndex": { + "target": "com.amazonaws.ebs#BlockIndex", + "traits": { + "smithy.api#documentation": "

The block index.

" + } + }, + "SecondBlockToken": { + "target": "com.amazonaws.ebs#BlockToken", + "traits": { + "smithy.api#documentation": "

The block token for the block index of the SecondSnapshotId specified in\n the ListChangedBlocks operation.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

A block of data in an Amazon Elastic Block Store snapshot that is different from another snapshot of\n the same volume/snapshot lineage.

", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.ebs#ChangedBlocks": { + "type": "list", + "member": { + "target": "com.amazonaws.ebs#ChangedBlock" + } + }, + "com.amazonaws.ebs#ChangedBlocksCount": { + "type": "integer", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 0 + } + } + }, + "com.amazonaws.ebs#Checksum": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 64 + }, + "smithy.api#pattern": "^[A-Za-z0-9+/=]+$" + } + }, + "com.amazonaws.ebs#ChecksumAggregationMethod": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "LINEAR", + "name": "CHECKSUM_AGGREGATION_LINEAR" + } + ], + "smithy.api#length": { + "min": 0, + "max": 32 + }, + "smithy.api#pattern": "^[A-Za-z0-9]+$" + } + }, + "com.amazonaws.ebs#ChecksumAlgorithm": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "SHA256", + "name": "CHECKSUM_ALGORITHM_SHA256" + } + ], + "smithy.api#length": { + "min": 0, + "max": 32 + }, + "smithy.api#pattern": "^[A-Za-z0-9]+$" + } + }, + "com.amazonaws.ebs#CompleteSnapshot": { + "type": "operation", + "input": { + "target": "com.amazonaws.ebs#CompleteSnapshotRequest" + }, + "output": { + "target": "com.amazonaws.ebs#CompleteSnapshotResponse" + }, + "errors": [ + { + "target": "com.amazonaws.ebs#AccessDeniedException" + }, + { + "target": "com.amazonaws.ebs#InternalServerException" + }, + { + "target": "com.amazonaws.ebs#RequestThrottledException" + }, + { + "target": "com.amazonaws.ebs#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.ebs#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.ebs#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Seals and completes the snapshot after all of the required blocks of data have been\n written to it. Completing the snapshot changes the status to completed. You\n cannot write new blocks to a snapshot after it has been completed.

", + "smithy.api#http": { + "method": "POST", + "uri": "/snapshots/completion/{SnapshotId}", + "code": 202 + } + } + }, + "com.amazonaws.ebs#CompleteSnapshotRequest": { + "type": "structure", + "members": { + "ChangedBlocksCount": { + "target": "com.amazonaws.ebs#ChangedBlocksCount", + "traits": { + "smithy.api#documentation": "

The number of blocks that were written to the snapshot.

", + "smithy.api#httpHeader": "x-amz-ChangedBlocksCount", + "smithy.api#required": {} + } + }, + "ChecksumAggregationMethod": { + "target": "com.amazonaws.ebs#ChecksumAggregationMethod", + "traits": { + "smithy.api#documentation": "

The aggregation method used to generate the checksum. Currently, the only supported\n aggregation method is LINEAR.

", + "smithy.api#httpHeader": "x-amz-Checksum-Aggregation-Method" + } + }, + "ChecksumAlgorithm": { + "target": "com.amazonaws.ebs#ChecksumAlgorithm", + "traits": { + "smithy.api#documentation": "

The algorithm used to generate the checksum. Currently, the only supported algorithm\n is SHA256.

", + "smithy.api#httpHeader": "x-amz-Checksum-Algorithm" + } + }, + "SnapshotId": { + "target": "com.amazonaws.ebs#SnapshotId", + "traits": { + "smithy.api#documentation": "

The ID of the snapshot.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "Checksum": { + "target": "com.amazonaws.ebs#Checksum", + "traits": { + "smithy.api#documentation": "

An aggregated Base-64 SHA256 checksum based on the checksums of each written\n block.

\n

To generate the aggregated checksum using the linear aggregation method, arrange the\n checksums for each written block in ascending order of their block index, concatenate\n them to form a single string, and then generate the checksum on the entire string using\n the SHA256 algorithm.

", + "smithy.api#httpHeader": "x-amz-Checksum" + } + } + } + }, + "com.amazonaws.ebs#CompleteSnapshotResponse": { + "type": "structure", + "members": { + "Status": { + "target": "com.amazonaws.ebs#Status", + "traits": { + "smithy.api#documentation": "

The status of the snapshot.

" + } + } + } + }, + "com.amazonaws.ebs#ConcurrentLimitExceededException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.ebs#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

You have reached the limit for concurrent API requests. For more information, see\n Optimizing performance of the EBS direct APIs in the Amazon Elastic Compute Cloud\n User Guide.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.ebs#ConflictException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.ebs#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

The request uses the same client token as a previous, but non-identical\n request.

", + "smithy.api#error": "server", + "smithy.api#httpError": 503 + } + }, + "com.amazonaws.ebs#DataLength": { + "type": "integer", + "traits": { + "smithy.api#box": {} + } + }, + "com.amazonaws.ebs#Description": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 255 + }, + "smithy.api#pattern": "^[\\S\\s]+$" + } + }, + "com.amazonaws.ebs#Ebs": { + "type": "service", + "version": "2019-11-02", + "operations": [ + { + "target": "com.amazonaws.ebs#CompleteSnapshot" + }, + { + "target": "com.amazonaws.ebs#GetSnapshotBlock" + }, + { + "target": "com.amazonaws.ebs#ListChangedBlocks" + }, + { + "target": "com.amazonaws.ebs#ListSnapshotBlocks" + }, + { + "target": "com.amazonaws.ebs#PutSnapshotBlock" + }, + { + "target": "com.amazonaws.ebs#StartSnapshot" + } + ], + "traits": { + "aws.api#service": { + "sdkId": "EBS", + "arnNamespace": "ebs", + "cloudFormationName": "EBS", + "cloudTrailEventSource": "ebs.amazonaws.com" + }, + "aws.auth#sigv4": { + "name": "ebs" + }, + "aws.protocols#restJson1": {}, + "smithy.api#documentation": "

You can use the Amazon Elastic Block Store (Amazon EBS) direct APIs to create EBS snapshots, write data directly to \n \t\tyour snapshots, read data on your snapshots, and identify the differences or changes between \n \t\ttwo snapshots. If you’re an independent software vendor (ISV) who offers backup services for \n \t\tAmazon EBS, the EBS direct APIs make it more efficient and cost-effective to track incremental changes on \n \t\tyour EBS volumes through snapshots. This can be done without having to create new volumes \n \t\tfrom snapshots, and then use Amazon Elastic Compute Cloud (Amazon EC2) instances to compare the differences.

\n \t\t\n \t

You can create incremental snapshots directly from data on-premises into EBS volumes and the \n \t\tcloud to use for quick disaster recovery. With the ability to write and read snapshots, you can \n \t\twrite your on-premises data to an EBS snapshot during a disaster. Then after recovery, you can \n \t\trestore it back to AWS or on-premises from the snapshot. You no longer need to build and \n \t\tmaintain complex mechanisms to copy data to and from Amazon EBS.

\n\n\n

This API reference provides detailed information about the actions, data types,\n parameters, and errors of the EBS direct APIs. For more information about the elements that\n make up the EBS direct APIs, and examples of how to use them effectively, see Accessing the Contents of an EBS Snapshot in the Amazon Elastic Compute Cloud User\n Guide. For more information about the supported AWS Regions, endpoints,\n and service quotas for the EBS direct APIs, see Amazon Elastic Block Store Endpoints and Quotas in\n the AWS General Reference.

", + "smithy.api#title": "Amazon Elastic Block Store" + } + }, + "com.amazonaws.ebs#ErrorMessage": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 256 + } + } + }, + "com.amazonaws.ebs#GetSnapshotBlock": { + "type": "operation", + "input": { + "target": "com.amazonaws.ebs#GetSnapshotBlockRequest" + }, + "output": { + "target": "com.amazonaws.ebs#GetSnapshotBlockResponse" + }, + "errors": [ + { + "target": "com.amazonaws.ebs#AccessDeniedException" + }, + { + "target": "com.amazonaws.ebs#InternalServerException" + }, + { + "target": "com.amazonaws.ebs#RequestThrottledException" + }, + { + "target": "com.amazonaws.ebs#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.ebs#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.ebs#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns the data in a block in an Amazon Elastic Block Store snapshot.

", + "smithy.api#http": { + "method": "GET", + "uri": "/snapshots/{SnapshotId}/blocks/{BlockIndex}", + "code": 200 + } + } + }, + "com.amazonaws.ebs#GetSnapshotBlockRequest": { + "type": "structure", + "members": { + "SnapshotId": { + "target": "com.amazonaws.ebs#SnapshotId", + "traits": { + "smithy.api#documentation": "

The ID of the snapshot containing the block from which to get data.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "BlockToken": { + "target": "com.amazonaws.ebs#BlockToken", + "traits": { + "smithy.api#documentation": "

The block token of the block from which to get data.

\n\n\n

Obtain the BlockToken by running the ListChangedBlocks or\n ListSnapshotBlocks operations.

", + "smithy.api#httpQuery": "blockToken", + "smithy.api#required": {} + } + }, + "BlockIndex": { + "target": "com.amazonaws.ebs#BlockIndex", + "traits": { + "smithy.api#documentation": "

The block index of the block from which to get data.

\n\n\n

Obtain the BlockIndex by running the ListChangedBlocks or\n ListSnapshotBlocks operations.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.ebs#GetSnapshotBlockResponse": { + "type": "structure", + "members": { + "DataLength": { + "target": "com.amazonaws.ebs#DataLength", + "traits": { + "smithy.api#documentation": "

The size of the data in the block.

", + "smithy.api#httpHeader": "x-amz-Data-Length" + } + }, + "ChecksumAlgorithm": { + "target": "com.amazonaws.ebs#ChecksumAlgorithm", + "traits": { + "smithy.api#documentation": "

The algorithm used to generate the checksum for the block, such as SHA256.

", + "smithy.api#httpHeader": "x-amz-Checksum-Algorithm" + } + }, + "Checksum": { + "target": "com.amazonaws.ebs#Checksum", + "traits": { + "smithy.api#documentation": "

The checksum generated for the block, which is Base64 encoded.

", + "smithy.api#httpHeader": "x-amz-Checksum" + } + }, + "BlockData": { + "target": "com.amazonaws.ebs#BlockData", + "traits": { + "smithy.api#documentation": "

The data content of the block.

", + "smithy.api#httpPayload": {} + } + } + } + }, + "com.amazonaws.ebs#IdempotencyToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 255 + }, + "smithy.api#pattern": "^[\\S]+$" + } + }, + "com.amazonaws.ebs#InternalServerException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.ebs#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

An internal error has occurred.

", + "smithy.api#error": "server", + "smithy.api#httpError": 500 + } + }, + "com.amazonaws.ebs#KmsKeyArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#pattern": "arn:aws[a-z\\-]*:kms:.*:[0-9]{12}:key/.*", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.ebs#ListChangedBlocks": { + "type": "operation", + "input": { + "target": "com.amazonaws.ebs#ListChangedBlocksRequest" + }, + "output": { + "target": "com.amazonaws.ebs#ListChangedBlocksResponse" + }, + "errors": [ + { + "target": "com.amazonaws.ebs#AccessDeniedException" + }, + { + "target": "com.amazonaws.ebs#InternalServerException" + }, + { + "target": "com.amazonaws.ebs#RequestThrottledException" + }, + { + "target": "com.amazonaws.ebs#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.ebs#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.ebs#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns information about the blocks that are different between two\n Amazon Elastic Block Store snapshots of the same volume/snapshot lineage.

", + "smithy.api#http": { + "method": "GET", + "uri": "/snapshots/{SecondSnapshotId}/changedblocks", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults" + } + } + }, + "com.amazonaws.ebs#ListChangedBlocksRequest": { + "type": "structure", + "members": { + "SecondSnapshotId": { + "target": "com.amazonaws.ebs#SnapshotId", + "traits": { + "smithy.api#documentation": "

The ID of the second snapshot to use for the comparison.

\n \n

The SecondSnapshotId parameter must be specified with a\n FirstSnapshotID parameter; otherwise, an error occurs.

\n
", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "FirstSnapshotId": { + "target": "com.amazonaws.ebs#SnapshotId", + "traits": { + "smithy.api#documentation": "

The ID of the first snapshot to use for the comparison.

\n \n

The FirstSnapshotID parameter must be specified with a\n SecondSnapshotId parameter; otherwise, an error occurs.

\n
", + "smithy.api#httpQuery": "firstSnapshotId" + } + }, + "NextToken": { + "target": "com.amazonaws.ebs#PageToken", + "traits": { + "smithy.api#documentation": "

The token to request the next page of results.

", + "smithy.api#httpQuery": "pageToken" + } + }, + "MaxResults": { + "target": "com.amazonaws.ebs#MaxResults", + "traits": { + "smithy.api#documentation": "

The number of results to return.

", + "smithy.api#httpQuery": "maxResults" + } + }, + "StartingBlockIndex": { + "target": "com.amazonaws.ebs#BlockIndex", + "traits": { + "smithy.api#documentation": "

The block index from which the comparison should start.

\n

The list in the response will start from this block index or the next valid block\n index in the snapshots.

", + "smithy.api#httpQuery": "startingBlockIndex" + } + } + } + }, + "com.amazonaws.ebs#ListChangedBlocksResponse": { + "type": "structure", + "members": { + "BlockSize": { + "target": "com.amazonaws.ebs#BlockSize", + "traits": { + "smithy.api#documentation": "

The size of the block.

" + } + }, + "ExpiryTime": { + "target": "com.amazonaws.ebs#TimeStamp", + "traits": { + "smithy.api#documentation": "

The time when the BlockToken expires.

" + } + }, + "VolumeSize": { + "target": "com.amazonaws.ebs#VolumeSize", + "traits": { + "smithy.api#documentation": "

The size of the volume in GB.

" + } + }, + "NextToken": { + "target": "com.amazonaws.ebs#PageToken", + "traits": { + "smithy.api#documentation": "

The token to use to retrieve the next page of results. This value is null when there\n are no more results to return.

" + } + }, + "ChangedBlocks": { + "target": "com.amazonaws.ebs#ChangedBlocks", + "traits": { + "smithy.api#documentation": "

An array of objects containing information about the changed blocks.

" + } + } + } + }, + "com.amazonaws.ebs#ListSnapshotBlocks": { + "type": "operation", + "input": { + "target": "com.amazonaws.ebs#ListSnapshotBlocksRequest" + }, + "output": { + "target": "com.amazonaws.ebs#ListSnapshotBlocksResponse" + }, + "errors": [ + { + "target": "com.amazonaws.ebs#AccessDeniedException" + }, + { + "target": "com.amazonaws.ebs#InternalServerException" + }, + { + "target": "com.amazonaws.ebs#RequestThrottledException" + }, + { + "target": "com.amazonaws.ebs#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.ebs#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.ebs#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns information about the blocks in an Amazon Elastic Block Store snapshot.

", + "smithy.api#http": { + "method": "GET", + "uri": "/snapshots/{SnapshotId}/blocks", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults" + } + } + }, + "com.amazonaws.ebs#ListSnapshotBlocksRequest": { + "type": "structure", + "members": { + "MaxResults": { + "target": "com.amazonaws.ebs#MaxResults", + "traits": { + "smithy.api#documentation": "

The number of results to return.

", + "smithy.api#httpQuery": "maxResults" + } + }, + "StartingBlockIndex": { + "target": "com.amazonaws.ebs#BlockIndex", + "traits": { + "smithy.api#documentation": "

The block index from which the list should start. The list in the response will start\n from this block index or the next valid block index in the snapshot.

", + "smithy.api#httpQuery": "startingBlockIndex" + } + }, + "NextToken": { + "target": "com.amazonaws.ebs#PageToken", + "traits": { + "smithy.api#documentation": "

The token to request the next page of results.

", + "smithy.api#httpQuery": "pageToken" + } + }, + "SnapshotId": { + "target": "com.amazonaws.ebs#SnapshotId", + "traits": { + "smithy.api#documentation": "

The ID of the snapshot from which to get block indexes and block tokens.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.ebs#ListSnapshotBlocksResponse": { + "type": "structure", + "members": { + "VolumeSize": { + "target": "com.amazonaws.ebs#VolumeSize", + "traits": { + "smithy.api#documentation": "

The size of the volume in GB.

" + } + }, + "NextToken": { + "target": "com.amazonaws.ebs#PageToken", + "traits": { + "smithy.api#documentation": "

The token to use to retrieve the next page of results. This value is null when there\n are no more results to return.

" + } + }, + "ExpiryTime": { + "target": "com.amazonaws.ebs#TimeStamp", + "traits": { + "smithy.api#documentation": "

The time when the BlockToken expires.

" + } + }, + "Blocks": { + "target": "com.amazonaws.ebs#Blocks", + "traits": { + "smithy.api#documentation": "

An array of objects containing information about the blocks.

" + } + }, + "BlockSize": { + "target": "com.amazonaws.ebs#BlockSize", + "traits": { + "smithy.api#documentation": "

The size of the block.

" + } + } + } + }, + "com.amazonaws.ebs#MaxResults": { + "type": "integer", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 100, + "max": 10000 + } + } + }, + "com.amazonaws.ebs#OwnerId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 24 + }, + "smithy.api#pattern": "\\S+" + } + }, + "com.amazonaws.ebs#PageToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 256 + }, + "smithy.api#pattern": "^[A-Za-z0-9+/=]+$" + } + }, + "com.amazonaws.ebs#Progress": { + "type": "integer", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 0, + "max": 100 + } + } + }, + "com.amazonaws.ebs#PutSnapshotBlock": { + "type": "operation", + "input": { + "target": "com.amazonaws.ebs#PutSnapshotBlockRequest" + }, + "output": { + "target": "com.amazonaws.ebs#PutSnapshotBlockResponse" + }, + "errors": [ + { + "target": "com.amazonaws.ebs#AccessDeniedException" + }, + { + "target": "com.amazonaws.ebs#InternalServerException" + }, + { + "target": "com.amazonaws.ebs#RequestThrottledException" + }, + { + "target": "com.amazonaws.ebs#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.ebs#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.ebs#ValidationException" + } + ], + "traits": { + "aws.auth#unsignedPayload": {}, + "smithy.api#auth": ["aws.auth#sigv4"], + "smithy.api#documentation": "

Writes a block of data to a snapshot. If the specified block contains\n data, the existing data is overwritten. The target snapshot must be in the\n pending state.

\t\n \t

Data written to a snapshot must be aligned with 512-byte sectors.

", + "smithy.api#http": { + "method": "PUT", + "uri": "/snapshots/{SnapshotId}/blocks/{BlockIndex}", + "code": 201 + } + } + }, + "com.amazonaws.ebs#PutSnapshotBlockRequest": { + "type": "structure", + "members": { + "SnapshotId": { + "target": "com.amazonaws.ebs#SnapshotId", + "traits": { + "smithy.api#documentation": "

The ID of the snapshot.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "BlockIndex": { + "target": "com.amazonaws.ebs#BlockIndex", + "traits": { + "smithy.api#documentation": "

The block index of the block in which to write the data. A block index is a logical \n \tindex in units of 512 KiB blocks. To identify the block index, divide \n \tthe logical offset of the data in the logical volume by the block size (logical offset of \n \tdata/524288). The logical offset of the data must be 512 \n \tKiB aligned.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "Checksum": { + "target": "com.amazonaws.ebs#Checksum", + "traits": { + "smithy.api#documentation": "

A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are\n supported.

", + "smithy.api#httpHeader": "x-amz-Checksum", + "smithy.api#required": {} + } + }, + "Progress": { + "target": "com.amazonaws.ebs#Progress", + "traits": { + "smithy.api#documentation": "

The progress of the write process, as a percentage.

", + "smithy.api#httpHeader": "x-amz-Progress" + } + }, + "BlockData": { + "target": "com.amazonaws.ebs#BlockData", + "traits": { + "smithy.api#documentation": "

The data to write to the block.

\n

The block data is not signed as part of the Signature Version 4 signing process. As a\n result, you must generate and provide a Base64-encoded SHA256 checksum for the block\n data using the x-amz-Checksum header. Also, you \n \tmust specify the checksum algorithm using the x-amz-Checksum-Algorithm \n \theader. The checksum that you provide is part of the Signature Version 4 signing process. \n \tIt is validated against a checksum generated by Amazon EBS to ensure the validity and authenticity \n \tof the data. If the checksums do not correspond, the request fails. For more information, \n \tsee \n Using checksums with the EBS direct APIs in the Amazon Elastic Compute Cloud User\n Guide.

", + "smithy.api#httpPayload": {}, + "smithy.api#required": {} + } + }, + "DataLength": { + "target": "com.amazonaws.ebs#DataLength", + "traits": { + "smithy.api#documentation": "

The size of the data to write to the block, in bytes. Currently, the only supported\n size is 524288.

\n

Valid values: 524288\n

", + "smithy.api#httpHeader": "x-amz-Data-Length", + "smithy.api#required": {} + } + }, + "ChecksumAlgorithm": { + "target": "com.amazonaws.ebs#ChecksumAlgorithm", + "traits": { + "smithy.api#documentation": "

The algorithm used to generate the checksum. Currently, the only supported algorithm\n is SHA256.

", + "smithy.api#httpHeader": "x-amz-Checksum-Algorithm", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.ebs#PutSnapshotBlockResponse": { + "type": "structure", + "members": { + "ChecksumAlgorithm": { + "target": "com.amazonaws.ebs#ChecksumAlgorithm", + "traits": { + "smithy.api#documentation": "

The algorithm used by Amazon EBS to generate the checksum.

", + "smithy.api#httpHeader": "x-amz-Checksum-Algorithm" + } + }, + "Checksum": { + "target": "com.amazonaws.ebs#Checksum", + "traits": { + "smithy.api#documentation": "

The SHA256 checksum generated for the block data by Amazon EBS.

", + "smithy.api#httpHeader": "x-amz-Checksum" + } + } + } + }, + "com.amazonaws.ebs#RequestThrottledException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.ebs#ErrorMessage" + }, + "Reason": { + "target": "com.amazonaws.ebs#RequestThrottledExceptionReason", + "traits": { + "smithy.api#documentation": "

The reason for the exception.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The number of API requests has exceed the maximum allowed API request throttling\n limit.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.ebs#RequestThrottledExceptionReason": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "ACCOUNT_THROTTLED", + "name": "ACCOUNT_THROTTLED" + }, + { + "value": "DEPENDENCY_REQUEST_THROTTLED", + "name": "DEPENDENCY_REQUEST_THROTTLED" + } + ] + } + }, + "com.amazonaws.ebs#ResourceNotFoundException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.ebs#ErrorMessage" + }, + "Reason": { + "target": "com.amazonaws.ebs#ResourceNotFoundExceptionReason", + "traits": { + "smithy.api#documentation": "

The reason for the exception.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The specified resource does not exist.

", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.ebs#ResourceNotFoundExceptionReason": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "SNAPSHOT_NOT_FOUND", + "name": "SNAPSHOT_NOT_FOUND" + }, + { + "value": "DEPENDENCY_RESOURCE_NOT_FOUND", + "name": "DEPENDENCY_RESOURCE_NOT_FOUND" + } + ] + } + }, + "com.amazonaws.ebs#ServiceQuotaExceededException": { + "type": "structure", + "members": { + "Reason": { + "target": "com.amazonaws.ebs#ServiceQuotaExceededExceptionReason", + "traits": { + "smithy.api#documentation": "

The reason for the exception.

" + } + }, + "Message": { + "target": "com.amazonaws.ebs#ErrorMessage" + } + }, + "traits": { + "smithy.api#documentation": "

Your current service quotas do not allow you to perform this action.

", + "smithy.api#error": "client", + "smithy.api#httpError": 402 + } + }, + "com.amazonaws.ebs#ServiceQuotaExceededExceptionReason": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "DEPENDENCY_SERVICE_QUOTA_EXCEEDED", + "name": "DEPENDENCY_SERVICE_QUOTA_EXCEEDED" + } + ] + } + }, + "com.amazonaws.ebs#SnapshotId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 64 + }, + "smithy.api#pattern": "^snap-[0-9a-f]+$" + } + }, + "com.amazonaws.ebs#StartSnapshot": { + "type": "operation", + "input": { + "target": "com.amazonaws.ebs#StartSnapshotRequest" + }, + "output": { + "target": "com.amazonaws.ebs#StartSnapshotResponse" + }, + "errors": [ + { + "target": "com.amazonaws.ebs#AccessDeniedException" + }, + { + "target": "com.amazonaws.ebs#ConcurrentLimitExceededException" + }, + { + "target": "com.amazonaws.ebs#ConflictException" + }, + { + "target": "com.amazonaws.ebs#InternalServerException" + }, + { + "target": "com.amazonaws.ebs#RequestThrottledException" + }, + { + "target": "com.amazonaws.ebs#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.ebs#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.ebs#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates a new Amazon EBS snapshot. The new snapshot enters the pending state\n after the request completes.

\n

After creating the snapshot, use PutSnapshotBlock to\n write blocks of data to the snapshot.

", + "smithy.api#http": { + "method": "POST", + "uri": "/snapshots", + "code": 201 + } + } + }, + "com.amazonaws.ebs#StartSnapshotRequest": { + "type": "structure", + "members": { + "Timeout": { + "target": "com.amazonaws.ebs#Timeout", + "traits": { + "smithy.api#documentation": "

The amount of time (in minutes) after which the snapshot is automatically cancelled\n if:

\n
    \n
  • \n

    No blocks are written to the snapshot.

    \n
  • \n
  • \n

    The snapshot is not completed after writing the last block of data.

    \n
  • \n
\n

If no value is specified, the timeout defaults to 60 minutes.

" + } + }, + "ClientToken": { + "target": "com.amazonaws.ebs#IdempotencyToken", + "traits": { + "smithy.api#documentation": "

A unique, case-sensitive identifier that you provide to ensure the idempotency of the\n request. Idempotency ensures that an API request completes only once. With an idempotent \n request, if the original request completes successfully. The subsequent retries with the same \n client token return the result from the original successful request and they have no additional \n effect.

\n

If you do not specify a client token, one is automatically generated by the AWS SDK.

\n

For more information, see \n \t\tIdempotency for StartSnapshot API in the Amazon Elastic Compute Cloud User Guide.

", + "smithy.api#idempotencyToken": {} + } + }, + "VolumeSize": { + "target": "com.amazonaws.ebs#VolumeSize", + "traits": { + "smithy.api#documentation": "

The size of the volume, in GiB. The maximum size is 16384 GiB (16\n TiB).

", + "smithy.api#required": {} + } + }, + "Tags": { + "target": "com.amazonaws.ebs#Tags", + "traits": { + "smithy.api#documentation": "

The tags to apply to the snapshot.

" + } + }, + "Encrypted": { + "target": "com.amazonaws.ebs#Boolean", + "traits": { + "smithy.api#documentation": "

Indicates whether to encrypt the snapshot. To create an encrypted snapshot, specify\n true. To create an unencrypted snapshot, omit this parameter.

\n

If you specify a value for ParentSnapshotId, omit\n this parameter.

\n

If you specify true, the snapshot is encrypted using the CMK specified\n using the KmsKeyArn parameter. If no value is specified\n for KmsKeyArn, the default CMK for your account is \n \tused. If no default CMK has been specified for your account, the AWS managed CMK is used. \n \tTo set a default CMK for your account, use \n \t\tModifyEbsDefaultKmsKeyId.

\n

If your account is enabled for encryption by default, you cannot set this parameter to\n false. In this case, you can omit this parameter.

\n\n

For more information, see \n Using encryption in the Amazon Elastic Compute Cloud User Guide.

" + } + }, + "KmsKeyArn": { + "target": "com.amazonaws.ebs#KmsKeyArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) \n \tcustomer master key (CMK) to be used to encrypt the snapshot. If you do not specify a \n \tCMK, the default AWS managed CMK is used.

\n

If you specify a ParentSnapshotId, omit this\n parameter; the snapshot will be encrypted using the same CMK that was used to encrypt\n the parent snapshot.

\n

If Encrypted is set to true, \n \tyou must specify a CMK ARN.

" + } + }, + "ParentSnapshotId": { + "target": "com.amazonaws.ebs#SnapshotId", + "traits": { + "smithy.api#documentation": "

The ID of the parent snapshot. If there is no parent snapshot, or if you are creating\n the first snapshot for an on-premises volume, omit this parameter.

\n

If your account is enabled for encryption by default, you cannot use an unencrypted\n snapshot as a parent snapshot. You must first create an encrypted copy of the parent\n snapshot using CopySnapshot.

" + } + }, + "Description": { + "target": "com.amazonaws.ebs#Description", + "traits": { + "smithy.api#documentation": "

A description for the snapshot.

" + } + } + } + }, + "com.amazonaws.ebs#StartSnapshotResponse": { + "type": "structure", + "members": { + "Tags": { + "target": "com.amazonaws.ebs#Tags", + "traits": { + "smithy.api#documentation": "

The tags applied to the snapshot. You can specify up to 50 tags per snapshot. For more\n information, see Tagging your Amazon EC2\n resources in the Amazon Elastic Compute Cloud User Guide.

" + } + }, + "KmsKeyArn": { + "target": "com.amazonaws.ebs#KmsKeyArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS) customer\n master key (CMK) used to encrypt the snapshot.

" + } + }, + "OwnerId": { + "target": "com.amazonaws.ebs#OwnerId", + "traits": { + "smithy.api#documentation": "

The AWS account ID of the snapshot owner.

" + } + }, + "VolumeSize": { + "target": "com.amazonaws.ebs#VolumeSize", + "traits": { + "smithy.api#documentation": "

The size of the volume, in GiB.

" + } + }, + "ParentSnapshotId": { + "target": "com.amazonaws.ebs#SnapshotId", + "traits": { + "smithy.api#documentation": "

The ID of the parent snapshot.

" + } + }, + "Description": { + "target": "com.amazonaws.ebs#Description", + "traits": { + "smithy.api#documentation": "

The description of the snapshot.

" + } + }, + "SnapshotId": { + "target": "com.amazonaws.ebs#SnapshotId", + "traits": { + "smithy.api#documentation": "

The ID of the snapshot.

" + } + }, + "BlockSize": { + "target": "com.amazonaws.ebs#BlockSize", + "traits": { + "smithy.api#documentation": "

The size of the blocks in the snapshot, in bytes.

" + } + }, + "StartTime": { + "target": "com.amazonaws.ebs#TimeStamp", + "traits": { + "smithy.api#documentation": "

The timestamp when the snapshot was created.

" + } + }, + "Status": { + "target": "com.amazonaws.ebs#Status", + "traits": { + "smithy.api#documentation": "

The status of the snapshot.

" + } + } + } + }, + "com.amazonaws.ebs#Status": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "completed", + "name": "COMPLETED" + }, + { + "value": "pending", + "name": "PENDING" + }, + { + "value": "error", + "name": "ERROR" + } + ], + "smithy.api#length": { + "min": 0, + "max": 32 + } + } + }, + "com.amazonaws.ebs#Tag": { + "type": "structure", + "members": { + "Key": { + "target": "com.amazonaws.ebs#TagKey", + "traits": { + "smithy.api#documentation": "

The key of the tag.

" + } + }, + "Value": { + "target": "com.amazonaws.ebs#TagValue", + "traits": { + "smithy.api#documentation": "

The value of the tag.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Describes a tag.

" + } + }, + "com.amazonaws.ebs#TagKey": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 127 + }, + "smithy.api#pattern": "^[\\S\\s]+$" + } + }, + "com.amazonaws.ebs#TagValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 255 + }, + "smithy.api#pattern": "^[\\S\\s]+$" + } + }, + "com.amazonaws.ebs#Tags": { + "type": "list", + "member": { + "target": "com.amazonaws.ebs#Tag" + } + }, + "com.amazonaws.ebs#TimeStamp": { + "type": "timestamp" + }, + "com.amazonaws.ebs#Timeout": { + "type": "integer", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 10, + "max": 60 + } + } + }, + "com.amazonaws.ebs#ValidationException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.ebs#ErrorMessage" + }, + "Reason": { + "target": "com.amazonaws.ebs#ValidationExceptionReason", + "traits": { + "smithy.api#documentation": "

The reason for the validation exception.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The input fails to satisfy the constraints of the EBS direct APIs.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.ebs#ValidationExceptionReason": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "INVALID_CUSTOMER_KEY", + "name": "INVALID_CUSTOMER_KEY" + }, + { + "value": "INVALID_PAGE_TOKEN", + "name": "INVALID_PAGE_TOKEN" + }, + { + "value": "INVALID_BLOCK_TOKEN", + "name": "INVALID_BLOCK_TOKEN" + }, + { + "value": "INVALID_SNAPSHOT_ID", + "name": "INVALID_SNAPSHOT_ID" + }, + { + "value": "UNRELATED_SNAPSHOTS", + "name": "UNRELATED_SNAPSHOTS" + }, + { + "value": "INVALID_BLOCK", + "name": "INVALID_BLOCK" + }, + { + "value": "INVALID_CONTENT_ENCODING", + "name": "INVALID_CONTENT_ENCODING" + }, + { + "value": "INVALID_TAG", + "name": "INVALID_TAG" + }, + { + "value": "INVALID_DEPENDENCY_REQUEST", + "name": "INVALID_DEPENDENCY_REQUEST" + }, + { + "value": "INVALID_PARAMETER_VALUE", + "name": "INVALID_PARAMETER_VALUE" + }, + { + "value": "INVALID_VOLUME_SIZE", + "name": "INVALID_VOLUME_SIZE" + } + ] + } + }, + "com.amazonaws.ebs#VolumeSize": { + "type": "long", + "traits": { + "smithy.api#box": {}, + "smithy.api#range": { + "min": 1 + } + } + } + } +} \ No newline at end of file diff --git a/codegen-test/smithy-build.json b/codegen-test/smithy-build.json index 3af90be59..d8f11ec32 100644 --- a/codegen-test/smithy-build.json +++ b/codegen-test/smithy-build.json @@ -6,7 +6,7 @@ "runtimeConfig": { "relativePath": "${REPO_ROOT}/rust-runtime" }, - "service": "example.weather#Weather", + "service": "com.amazonaws.ebs#Ebs", "module": "weather", "moduleVersion": "0.0.1", "build": { diff --git a/codegen/build.gradle.kts b/codegen/build.gradle.kts index 531e377ca..ccd0b22cf 100644 --- a/codegen/build.gradle.kts +++ b/codegen/build.gradle.kts @@ -102,4 +102,3 @@ publishing { } } } - diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/lang/RustWriter.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/lang/RustWriter.kt index 308489056..f5dc76bfe 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/lang/RustWriter.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/lang/RustWriter.kt @@ -10,6 +10,9 @@ import software.amazon.smithy.codegen.core.CodegenException import software.amazon.smithy.codegen.core.Symbol import software.amazon.smithy.codegen.core.writer.CodegenWriter import software.amazon.smithy.codegen.core.writer.CodegenWriterFactory +import software.amazon.smithy.model.shapes.Shape +import software.amazon.smithy.model.shapes.ShapeId +import software.amazon.smithy.model.traits.EnumTrait import software.amazon.smithy.rust.codegen.smithy.RuntimeType import software.amazon.smithy.rust.codegen.smithy.isOptional import software.amazon.smithy.rust.codegen.smithy.rustType @@ -34,22 +37,41 @@ fun T.rustBlock(header: String, vararg args: Any, block: T.() - class RustWriter(filename: String, private val namespace: String, private val commentCharacter: String = "//") : CodegenWriter(null, UseDeclarations(filename, namespace)) { private val formatter = RustSymbolFormatter() + private var n = 0 init { putFormatter('T', formatter) } - fun OptionIter(member: Symbol, outerField: String, block: CodeWriter.(field: String) -> Unit) { + fun safeName(prefix: String = "var"): String { + n += 1 + return "${prefix}_$n" + } + + // TODO: refactor both of these methods & add a parent method to for_each across any field type + // generically + fun OptionForEach(member: Symbol, outerField: String, block: CodeWriter.(field: String) -> Unit) { if (member.isOptional()) { - val derefName = "inner" + val derefName = safeName("inner") // TODO: `inner` should be custom codegenned to avoid shadowing rustBlock("if let Some($derefName) = $outerField") { - block("inner") + block(derefName) } } else { this.block(outerField) } } + fun ListForEach(target: Shape, outerField: String, block: CodeWriter.(field: String, target: ShapeId) -> Unit) { + if (target.isListShape) { + val derefName = safeName("inner") + rustBlock("for $derefName in $outerField") { + block(derefName, target.asListShape().get().member.target) + } + } else { + this.block(outerField, target.toShapeId()) + } + } + override fun toString(): String { val contents = super.toString() // Hack to support TOML @@ -63,6 +85,14 @@ class RustWriter(filename: String, private val namespace: String, private val co return formatter.apply(r, "") } + fun useAs(target: Shape, base: String): String { + return if (target.hasTrait(EnumTrait::class.java)) { + "$base.as_str()" + } else { + base + } + } + inner class RustSymbolFormatter : BiFunction { override fun apply(t: Any, u: String): String { return when (t) { diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/CodegenVisitor.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/CodegenVisitor.kt index d9cbcd7f5..41342d155 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/CodegenVisitor.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/CodegenVisitor.kt @@ -7,9 +7,11 @@ package software.amazon.smithy.rust.codegen.smithy import java.util.logging.Logger import software.amazon.smithy.build.PluginContext +import software.amazon.smithy.codegen.core.SymbolProvider import software.amazon.smithy.codegen.core.writer.CodegenWriterDelegator +import software.amazon.smithy.model.Model import software.amazon.smithy.model.neighbor.Walker -import software.amazon.smithy.model.shapes.OperationShape +import software.amazon.smithy.model.shapes.ServiceShape import software.amazon.smithy.model.shapes.Shape import software.amazon.smithy.model.shapes.ShapeVisitor import software.amazon.smithy.model.shapes.StringShape @@ -21,33 +23,46 @@ import software.amazon.smithy.rust.codegen.lang.RustWriter import software.amazon.smithy.rust.codegen.smithy.generators.CargoTomlGenerator import software.amazon.smithy.rust.codegen.smithy.generators.EnumGenerator import software.amazon.smithy.rust.codegen.smithy.generators.LibRsGenerator -import software.amazon.smithy.rust.codegen.smithy.generators.OperationGenerator +import software.amazon.smithy.rust.codegen.smithy.generators.ServiceGenerator import software.amazon.smithy.rust.codegen.smithy.generators.StructureGenerator import software.amazon.smithy.rust.codegen.smithy.generators.UnionGenerator +import software.amazon.smithy.rust.codegen.smithy.transformers.OperationNormalizer import software.amazon.smithy.rust.codegen.util.runCommand private val PublicModules = listOf("error", "operation", "model") -class CodegenVisitor(private val context: PluginContext) : ShapeVisitor.Default() { +class CodegenVisitor(context: PluginContext) : ShapeVisitor.Default() { private val logger = Logger.getLogger(javaClass.name) private val settings = RustSettings.from(context.model, context.settings) - private val symbolProvider = SymbolVisitor(context.model, config = SymbolVisitorConfig(runtimeConfig = settings.runtimeConfig)) - private val writers = CodegenWriterDelegator( - context.fileManifest, - // TODO: load symbol visitor from integrations - symbolProvider, - RustWriter.Factory - ) + + private val symbolProvider: SymbolProvider + private val writers: CodegenWriterDelegator + private val fileManifest = context.fileManifest + val model: Model + init { + val bootstrapProvider = SymbolVisitor(context.model, config = SymbolVisitorConfig(runtimeConfig = settings.runtimeConfig)) + model = OperationNormalizer(bootstrapProvider).addOperationInputs(context.model) + symbolProvider = SymbolVisitor(model, config = SymbolVisitorConfig(runtimeConfig = settings.runtimeConfig)) + writers = CodegenWriterDelegator( + context.fileManifest, + // TODO: load symbol visitor from integrations; 2d + symbolProvider, + RustWriter.Factory + ) + } fun execute() { logger.info("generating Rust client...") - val modelWithoutTraits = context.modelWithoutTraitShapes - val service = settings.getService(context.model) - val serviceShapes = Walker(modelWithoutTraits).walkShapes(service) + val service = settings.getService(model) + val serviceShapes = Walker(model).walkShapes(service) serviceShapes.forEach { it.accept(this) } writers.useFileWriter("Cargo.toml") { - val cargoToml = CargoTomlGenerator(settings, it, writers.dependencies.map { dep -> RustDependency.fromSymbolDependency(dep) }.distinct()) + val cargoToml = CargoTomlGenerator( + settings, + it, + writers.dependencies.map { dep -> RustDependency.fromSymbolDependency(dep) }.distinct() + ) cargoToml.render() } writers.useFileWriter("src/lib.rs") { @@ -56,7 +71,7 @@ class CodegenVisitor(private val context: PluginContext) : ShapeVisitor.Default< LibRsGenerator(modules, it).render() } writers.flushWriters() - "cargo fmt".runCommand(context.fileManifest.baseDir) + "cargo fmt".runCommand(fileManifest.baseDir) } override fun getDefault(shape: Shape?) { @@ -66,7 +81,7 @@ class CodegenVisitor(private val context: PluginContext) : ShapeVisitor.Default< // super.structureShape(shape) logger.info("generating a structure...") writers.useShapeWriter(shape) { - StructureGenerator(context.model, symbolProvider, it, shape).render() + StructureGenerator(model, symbolProvider, it, shape).render() } } @@ -80,13 +95,11 @@ class CodegenVisitor(private val context: PluginContext) : ShapeVisitor.Default< override fun unionShape(shape: UnionShape) { writers.useShapeWriter(shape) { - UnionGenerator(context.model, symbolProvider, it, shape).render() + UnionGenerator(model, symbolProvider, it, shape).render() } } - override fun operationShape(shape: OperationShape) { - writers.useShapeWriter(shape) { - OperationGenerator(context.model, symbolProvider, settings.runtimeConfig, it, shape).render() - } + override fun serviceShape(shape: ServiceShape) { + ServiceGenerator(model, symbolProvider, settings.runtimeConfig, shape, writers).render() } } diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/RuntimeTypes.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/RuntimeTypes.kt index 67acd8e7d..8703add78 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/RuntimeTypes.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/RuntimeTypes.kt @@ -59,6 +59,9 @@ data class RuntimeType(val name: String, val dependency: RustDependency?, val na fun QueryFormat(runtimeConfig: RuntimeConfig, func: String) = RuntimeType(func, RustDependency.SmithyHttp(runtimeConfig), "${runtimeConfig.cratePrefix}_http::query") + fun Base64Encode(runtimeConfig: RuntimeConfig): RuntimeType = + RuntimeType("encode", RustDependency.SmithyHttp(runtimeConfig), "${runtimeConfig.cratePrefix}_http::base64") + fun TimestampFormat(runtimeConfig: RuntimeConfig, format: TimestampFormatTrait.Format): RuntimeType { val timestampFormat = when (format) { TimestampFormatTrait.Format.EPOCH_SECONDS -> "EpochSeconds" @@ -74,5 +77,6 @@ data class RuntimeType(val name: String, val dependency: RustDependency?, val na } fun Http(path: String): RuntimeType = RuntimeType(name = path, dependency = RustDependency.Http, namespace = "http") + val HttpRequestBuilder = Http("request::Builder") } } diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/RustSettings.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/RustSettings.kt index 4bdbcfb7c..26db80eda 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/RustSettings.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/RustSettings.kt @@ -72,7 +72,6 @@ class RustSettings( val desc = config.getStringMemberOrDefault(MODULE_DESCRIPTION, "$moduleName client") val build = config.getObjectMember(BUILD_SETTINGS) val runtimeConfig = config.getObjectMember(RUNTIME_CONFIG) - println("run config: $runtimeConfig -- ${RuntimeConfig.fromNode(runtimeConfig)}") return RustSettings(service, moduleName, version, desc, RuntimeConfig.fromNode(runtimeConfig), BuildSettings.fromNode(build)) } diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/SymbolVisitor.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/SymbolVisitor.kt index adf889793..4e449c1bc 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/SymbolVisitor.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/SymbolVisitor.kt @@ -5,7 +5,6 @@ package software.amazon.smithy.rust.codegen.smithy -import software.amazon.smithy.codegen.core.CodegenException import software.amazon.smithy.codegen.core.Symbol import software.amazon.smithy.codegen.core.SymbolProvider import software.amazon.smithy.model.Model @@ -40,6 +39,7 @@ import software.amazon.smithy.model.traits.ErrorTrait import software.amazon.smithy.model.traits.HttpLabelTrait import software.amazon.smithy.rust.codegen.lang.RustType import software.amazon.smithy.rust.codegen.smithy.generators.toSnakeCase +import software.amazon.smithy.rust.codegen.smithy.traits.SyntheticInput import software.amazon.smithy.utils.StringUtils // TODO: currently, respecting integer types. @@ -101,25 +101,29 @@ class SymbolVisitor( return RuntimeType.Blob(config.runtimeConfig).toSymbol() } - private fun handleOptionality(symbol: Symbol, shape: Shape): Symbol { - return if (nullableIndex.isNullable(shape) && !shape.hasTrait(HttpLabelTrait::class.java)) { - val builder = Symbol.builder() - val rustType = RustType.Option(symbol.rustType()) - builder.rustType(rustType) - builder.addReference(symbol) - builder.name(rustType.name) - builder.build() + private fun handleOptionality(symbol: Symbol, member: MemberShape, container: Shape): Symbol { + val httpLabeledInput = container.hasTrait(SyntheticInput::class.java) && member.hasTrait(HttpLabelTrait::class.java) + return if (nullableIndex.isNullable(member) && !httpLabeledInput) { + with(Symbol.builder()) { + val rustType = RustType.Option(symbol.rustType()) + rustType(rustType) + addReference(symbol) + name(rustType.name) + putProperty(SHAPE_KEY, member) + build() + } } else symbol } private fun handleRustBoxing(symbol: Symbol, shape: Shape): Symbol { return if (shape.hasTrait(RustBox::class.java)) { - val builder = Symbol.builder() val rustType = RustType.Box(symbol.rustType()) - builder.rustType(rustType) - builder.addReference(symbol) - builder.name(rustType.name) - builder.build() + with(Symbol.builder()) { + rustType(rustType) + addReference(symbol) + name(rustType.name) + build() + } } else symbol } @@ -160,7 +164,7 @@ class SymbolVisitor( } override fun mapShape(shape: MapShape): Symbol { - assert(shape.key.isStringShape) + require(shape.key.isStringShape) val key = this.toSymbol(shape.key) val value = this.toSymbol(shape.value) return symbolBuilder(shape, RustType.HashMap(key.rustType(), value.rustType())).namespace( @@ -195,6 +199,7 @@ class SymbolVisitor( override fun structureShape(shape: StructureShape): Symbol { val isError = shape.hasTrait(ErrorTrait::class.java) + val isInput = shape.hasTrait(SyntheticInput::class.java) val name = StringUtils.capitalize(shape.id.name).letIf(isError) { // TODO: this is should probably be a configurable mixin it.replace("Exception", "Error") @@ -202,6 +207,8 @@ class SymbolVisitor( val builder = symbolBuilder(shape, RustType.Opaque(name)) return when { isError -> builder.locatedIn(Errors) + // Input shapes live with their Operations + isInput -> builder.locatedIn(Operations) else -> builder.locatedIn(Shapes) }.build() } @@ -214,10 +221,10 @@ class SymbolVisitor( } override fun memberShape(shape: MemberShape): Symbol { - val target = model.getShape(shape.target).orElseThrow { CodegenException("Shape not found. this is a bug.") } + val target = model.expectShape(shape.target) val targetSymbol = this.toSymbol(target) return targetSymbol.letIf(config.handleOptionality) { - handleOptionality(it, shape) + handleOptionality(it, shape, model.expectShape(shape.container)) }.letIf(config.handleRustBoxing) { handleRustBoxing(it, shape) } @@ -228,7 +235,7 @@ class SymbolVisitor( } private fun symbolBuilder(shape: Shape?, rustType: RustType): Symbol.Builder { - val builder = Symbol.builder().putProperty("shape", shape) + val builder = Symbol.builder().putProperty(SHAPE_KEY, shape) return builder.rustType(rustType) .name(rustType.name) // Every symbol that actually gets defined somewhere should set a definition file @@ -239,6 +246,7 @@ class SymbolVisitor( // TODO(chore): Move this to a useful place private const val RUST_TYPE_KEY = "rusttype" +private const val SHAPE_KEY = "shape" fun Symbol.Builder.rustType(rustType: RustType): Symbol.Builder { return this.putProperty(RUST_TYPE_KEY, rustType) @@ -249,8 +257,9 @@ fun Symbol.isOptional(): Boolean = when (this.rustType()) { else -> false } -// Symbols should _always_ be created with a Rust type attached +// Symbols should _always_ be created with a Rust type & shape attached fun Symbol.rustType(): RustType = this.getProperty(RUST_TYPE_KEY, RustType::class.java).get() +fun Symbol.shape(): Shape = this.expectProperty(SHAPE_KEY, Shape::class.java) fun T.letIf(cond: Boolean, f: (T) -> T): T { return if (cond) { diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/EnumGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/EnumGenerator.kt index d57ab006a..ffd7c83e7 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/EnumGenerator.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/EnumGenerator.kt @@ -11,7 +11,6 @@ import software.amazon.smithy.model.traits.EnumDefinition import software.amazon.smithy.model.traits.EnumTrait import software.amazon.smithy.rust.codegen.lang.RustWriter import software.amazon.smithy.rust.codegen.lang.rustBlock -import software.amazon.smithy.rust.codegen.lang.withBlock import software.amazon.smithy.rust.codegen.smithy.RuntimeType class EnumGenerator( @@ -74,8 +73,8 @@ class EnumGenerator( private fun renderFromStr() { writer.rustBlock("impl \$T for $enumName where T: \$T", RuntimeType.From, RuntimeType.AsRef) { - writer.withBlock("fn from(s: T) -> Self {", "}") { - writer.withBlock("match s.as_ref() {", "}") { + writer.rustBlock("fn from(s: T) -> Self") { + writer.rustBlock("match s.as_ref()") { sortedMembers.forEach { member -> write(""""${member.value}" => $enumName::${member.derivedName()},""") } diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/ErrorGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/ErrorGenerator.kt index f4e5907a0..019d7b63a 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/ErrorGenerator.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/ErrorGenerator.kt @@ -12,7 +12,6 @@ import software.amazon.smithy.model.traits.ErrorTrait import software.amazon.smithy.model.traits.RetryableTrait import software.amazon.smithy.rust.codegen.lang.RustWriter import software.amazon.smithy.rust.codegen.lang.rustBlock -import software.amazon.smithy.rust.codegen.lang.withBlock import software.amazon.smithy.rust.codegen.smithy.RuntimeType.Companion.StdError import software.amazon.smithy.rust.codegen.smithy.RuntimeType.Companion.StdFmt import software.amazon.smithy.rust.codegen.util.dq @@ -38,7 +37,7 @@ class ErrorGenerator( error.isServerError -> "ErrorCause::Server" else -> "ErrorCause::Unknown(${error.value.dq()})" } - writer.withBlock("impl ${symbol.name} {", "}") { + writer.rustBlock("impl ${symbol.name}") { write("// TODO: create shared runtime crate") write("// fn at_fault(&self) -> ErrorCause { $errorCause }") write("pub fn retryable(&self) -> bool { $retryable }") @@ -46,12 +45,12 @@ class ErrorGenerator( } writer.rustBlock("impl \$T for ${symbol.name}", StdFmt("Display")) { - withBlock("fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {", "}") { + rustBlock("fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result") { val message = shape.getMember("message") write("write!(f, ${symbol.name.dq()})?;") if (message.isPresent) { - withBlock("if let Some(msg) = &self.message {", "}") { - write("""write!(f, ": {}", msg)?;""") + OptionForEach(symbolProvider.toSymbol(message.get()), "&self.message") { field -> + write("""write!(f, ": {}", $field)?;""") } } write("Ok(())") diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/HttpProtocolGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/HttpProtocolGenerator.kt new file mode 100644 index 000000000..c10c79864 --- /dev/null +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/HttpProtocolGenerator.kt @@ -0,0 +1,58 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +package software.amazon.smithy.rust.codegen.smithy.generators + +import software.amazon.smithy.codegen.core.SymbolProvider +import software.amazon.smithy.model.Model +import software.amazon.smithy.model.shapes.OperationShape +import software.amazon.smithy.model.shapes.ServiceShape +import software.amazon.smithy.model.shapes.StructureShape +import software.amazon.smithy.rust.codegen.lang.RustWriter +import software.amazon.smithy.rust.codegen.lang.rustBlock +import software.amazon.smithy.rust.codegen.smithy.RuntimeConfig +import software.amazon.smithy.rust.codegen.smithy.RuntimeType + +data class ProtocolConfig( + val model: Model, + val symbolProvider: SymbolProvider, + val runtimeConfig: RuntimeConfig, + val writer: RustWriter, + val serviceShape: ServiceShape, + val operationShape: OperationShape, + val inputShape: StructureShape +) + +interface ProtocolGeneratorFactory { + fun build(protocolConfig: ProtocolConfig): T +} + +abstract class HttpProtocolGenerator( + private val symbolProvider: SymbolProvider, + private val writer: RustWriter, + private val inputShape: StructureShape +) { + fun render() { + writer.rustBlock("impl ${symbolProvider.toSymbol(inputShape).name}") { + toHttpRequestImpl(this) + } + } + + protected fun httpBuilderFun(implBlockWriter: RustWriter, f: RustWriter.() -> Unit) { + implBlockWriter.rustBlock( + "pub fn build_http_request(&self) -> \$T", + RuntimeType.HttpRequestBuilder + ) { + f(this) + } + } + + /** + * Add necessary methods to the impl block for the input shape. + * + * Your implementation MUST call `httpBuilderFun` to create the public method. + */ + abstract fun toHttpRequestImpl(implBlockWriter: RustWriter) +} diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/HttpBindingGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/HttpTraitBindingGenerator.kt similarity index 51% rename from codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/HttpBindingGenerator.kt rename to codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/HttpTraitBindingGenerator.kt index c5240f3f2..ae4d88733 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/HttpBindingGenerator.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/HttpTraitBindingGenerator.kt @@ -25,6 +25,7 @@ import software.amazon.smithy.model.shapes.OperationShape import software.amazon.smithy.model.shapes.Shape import software.amazon.smithy.model.shapes.StructureShape import software.amazon.smithy.model.traits.HttpTrait +import software.amazon.smithy.model.traits.MediaTypeTrait import software.amazon.smithy.model.traits.TimestampFormatTrait import software.amazon.smithy.rust.codegen.lang.RustWriter import software.amazon.smithy.rust.codegen.lang.rustBlock @@ -32,7 +33,6 @@ import software.amazon.smithy.rust.codegen.smithy.RuntimeConfig import software.amazon.smithy.rust.codegen.smithy.RuntimeType import software.amazon.smithy.rust.codegen.util.doubleQuote import software.amazon.smithy.rust.codegen.util.dq -import software.amazon.smithy.utils.CodeWriter fun HttpTrait.uriFormatString(): String = uri.segments.map { when { @@ -41,9 +41,21 @@ fun HttpTrait.uriFormatString(): String = uri.segments.map { } }.joinToString("/", prefix = "/").doubleQuote() -// TODO: TimestampFormat index that - -class HttpBindingGenerator( +/** + * HttpTraitBindingGenerator + * + * Generates methods to serialize and deserialize requests/responses based on the HTTP trait. Specifically: + * 1. `fn update_http_request(builder: http::request::Builder) -> Builder` + * + * This method takes a builder (perhaps pre configured with some headers) from the caller and sets the HTTP + * headers & URL based on the HTTP trait implementation. + * + * More work is required to implement the entirety of https://awslabs.github.io/smithy/1.0/spec/core/http-traits.html + * Specifically: + * TODO: httpPrefixHeaders; 4h + * TODO: Deserialization of all fields; 1w + */ +class HttpTraitBindingGenerator( val model: Model, private val symbolProvider: SymbolProvider, private val runtimeConfig: RuntimeConfig, @@ -52,30 +64,112 @@ class HttpBindingGenerator( private val inputShape: StructureShape, private val httpTrait: HttpTrait ) { - // TODO: make abstract + // TODO: make defaultTimestampFormat configurable private val defaultTimestampFormat = TimestampFormatTrait.Format.EPOCH_SECONDS private val index = HttpBindingIndex(model) - fun render() { - writer.rustBlock("impl ${inputShape.id.name}") { - uriBase(this) - uriQuery(this) - httpRequestBuilder(this) - } - } - private fun httpRequestBuilder(writer: RustWriter) { - writer.rustBlock("pub fn build_http_request(&self, builder: \$T) -> \$T", RuntimeType.Http("request::Builder"), RuntimeType.Http("request::Builder")) { + /** + * Generates `update_http_builder` and all necessary dependency functions into the impl block provided by + * [implBlockWriter]. The specific behavior is configured by [httpTrait]. + */ + fun renderUpdateHttpBuilder(implBlockWriter: RustWriter) { + uriBase(implBlockWriter) + val hasHeaders = addHeaders(implBlockWriter) + val hasQuery = uriQuery(implBlockWriter) + implBlockWriter.rustBlock("fn update_http_builder(&self, builder: \$T) -> \$T", + RuntimeType.HttpRequestBuilder, + RuntimeType.HttpRequestBuilder) { write("let mut uri = String::new();") write("self.uri_base(&mut uri);") - if (hasQuery()) { + if (hasQuery) { write("self.uri_query(&mut uri);") } + if (hasHeaders) { + write("let builder = self.add_headers(builder);") + } write("builder.method(${httpTrait.method.dq()}).uri(uri)") } } + /** + * Default implementation of HttpTraitBindings. A `build_http_request()` method is added that + * simply calls `update_http_builder()` + */ + inner class Default : HttpProtocolGenerator(symbolProvider, writer, inputShape) { + override fun toHttpRequestImpl(implBlockWriter: RustWriter) { + renderUpdateHttpBuilder(implBlockWriter) + httpBuilderFun(implBlockWriter) { + write("let builder = \$T::new();", RuntimeType.HttpRequestBuilder) + write("self.update_http_builder(builder)") + } + } + } + + /** Header Generation **/ + + /** + * If the protocol sets headers, generate a function to add headers to a request. + * Returns `true` if headers were generated and false if are not required. + */ + private fun addHeaders(writer: RustWriter): Boolean { + val headers = index.getRequestBindings(shape, HttpBinding.Location.HEADER) + if (headers.isEmpty()) { + return false + } + writer.rustBlock("fn add_headers(&self, mut builder: \$T) -> \$T", RuntimeType.HttpRequestBuilder, RuntimeType.HttpRequestBuilder) { + headers.forEach { httpBinding -> + val memberShape = httpBinding.member + val memberType = model.expectShape(memberShape.target) + val memberSymbol = symbolProvider.toSymbol(memberShape) + val memberName = symbolProvider.toMemberName(memberShape) + OptionForEach(memberSymbol, "&self.$memberName") { field -> + ListForEach(memberType, field) { innerField, targetId -> + val innerMemberType = model.expectShape(targetId) + val formatted = headerFmtFun(innerMemberType, memberShape, innerField) + write("builder = builder.header(${httpBinding.locationName.dq()}, $formatted);") + } + } + } + write("builder") + } + return true + } + + /** + * Format [member] in the when used as an HTTP header + */ + private fun headerFmtFun(target: Shape, member: MemberShape, targetName: String): String { + return when { + target.isStringShape -> { + val func = if (target.hasTrait(MediaTypeTrait::class.java)) { + writer.format(RuntimeType.Base64Encode(runtimeConfig)) + } else { + writer.format(RuntimeType.QueryFormat(runtimeConfig, "fmt_string")) + } + "$func(&${writer.useAs(target, targetName)})" + } + target.isTimestampShape -> { + val timestampFormat = + index.determineTimestampFormat(member, HttpBinding.Location.HEADER, defaultTimestampFormat) + val timestampFormatType = RuntimeType.TimestampFormat(runtimeConfig, timestampFormat) + val func = writer.format(RuntimeType.QueryFormat(runtimeConfig, "fmt_timestamp")) + "$func($targetName, ${writer.format(timestampFormatType)})" + } + target.isListShape || target.isMemberShape -> { + throw IllegalArgumentException("lists should be handled at a higher level") + } + else -> { + val func = writer.format(RuntimeType.QueryFormat(runtimeConfig, "fmt_default")) + "$func(&$targetName)" + } + } + } + /** URI Generation **/ + /** + * Generate a function to build the request URI + */ private fun uriBase(writer: RustWriter) { val formatString = httpTrait.uriFormatString() val args = httpTrait.uri.labels.map { label -> @@ -89,31 +183,32 @@ class HttpBindingGenerator( } } - private fun hasQuery(): Boolean = index.getRequestBindings(shape, HttpBinding.Location.QUERY).isNotEmpty() - - private fun uriQuery(writer: RustWriter) { + /** + * When needed, generate a function to build a query string + */ + private fun uriQuery(writer: RustWriter): Boolean { // Don't bother generating the function if we aren't going to make a query string - if (!hasQuery()) return + val queryParams = index.getRequestBindings(shape, HttpBinding.Location.QUERY) + if (queryParams.isEmpty()) { + return false + } writer.rustBlock("fn uri_query(&self, output: &mut String)") { - val queryParams = index.getRequestBindings(shape, HttpBinding.Location.QUERY) - assert(queryParams.isNotEmpty()) write("let mut params = Vec::new();") queryParams.forEach { param -> val memberShape = param.member - val memberType = model.expectShape(memberShape.target) val memberSymbol = symbolProvider.toSymbol(memberShape) val memberName = symbolProvider.toMemberName(memberShape) - OptionIter(memberSymbol, "&self.$memberName") { field -> - if (memberType.isListShape) { - renderUriList(this, param, memberType.asListShape().get().member, field) - } else { + val outerTarget = model.expectShape(memberShape.target) + OptionForEach(memberSymbol, "&self.$memberName") { field -> + ListForEach(outerTarget, field) { innerField, targetId -> + val target = model.expectShape(targetId) write( "params.push((${param.locationName.dq()}, ${ paramFmtFun( - memberType, + target, memberShape, - field + innerField ) }))" ) @@ -122,20 +217,17 @@ class HttpBindingGenerator( } write("\$T(params, output)", RuntimeType.QueryFormat(runtimeConfig, "write")) } + return true } - private fun renderUriList(writer: CodeWriter, param: HttpBinding, innerMember: Shape, memberName: String) { - val member = param.member - writer.rustBlock("for inner in $memberName") { - write("params.push((${param.locationName.dq()}, ${paramFmtFun(innerMember, member, "inner")}))") - } - } - + /** + * Format [member] when used as a queryParam + */ private fun paramFmtFun(target: Shape, member: MemberShape, targetName: String): String { return when { target.isStringShape -> { val func = writer.format(RuntimeType.QueryFormat(runtimeConfig, "fmt_string")) - "$func(&$targetName)" + "$func(&${writer.useAs(target, targetName)})" } target.isTimestampShape -> { val timestampFormat = @@ -144,7 +236,7 @@ class HttpBindingGenerator( val func = writer.format(RuntimeType.QueryFormat(runtimeConfig, "fmt_timestamp")) "$func($targetName, ${writer.format(timestampFormatType)})" } - target.isListShape -> { + target.isListShape || target.isMemberShape -> { throw IllegalArgumentException("lists should be handled at a higher level") } else -> { @@ -154,6 +246,9 @@ class HttpBindingGenerator( } } + /** + * Format [member] when used as an HTTP Label (`/bucket/{key}`) + */ private fun labelFmtFun(target: Shape, member: MemberShape, label: SmithyPattern.Segment): String { val memberName = symbolProvider.toMemberName(member) return when { @@ -170,7 +265,7 @@ class HttpBindingGenerator( } else -> { val func = writer.format(RuntimeType.LabelFormat(runtimeConfig, "fmt_default")) - "$func(self.$memberName)" + "$func(&self.$memberName)" } } } diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/OperationGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/OperationGenerator.kt deleted file mode 100644 index d7216f01b..000000000 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/OperationGenerator.kt +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. - */ - -package software.amazon.smithy.rust.codegen.smithy.generators - -import software.amazon.smithy.codegen.core.Symbol -import software.amazon.smithy.codegen.core.SymbolProvider -import software.amazon.smithy.model.Model -import software.amazon.smithy.model.shapes.MemberShape -import software.amazon.smithy.model.shapes.OperationShape -import software.amazon.smithy.model.shapes.Shape -import software.amazon.smithy.model.shapes.StructureShape -import software.amazon.smithy.model.traits.HttpTrait -import software.amazon.smithy.rust.codegen.lang.RustType -import software.amazon.smithy.rust.codegen.lang.RustWriter -import software.amazon.smithy.rust.codegen.smithy.RuntimeConfig -import software.amazon.smithy.rust.codegen.smithy.letIf -import software.amazon.smithy.rust.codegen.smithy.rustType - -class OperationGenerator( - val model: Model, - private val symbolProvider: SymbolProvider, - private val runtimeConfig: RuntimeConfig, - private val writer: RustWriter, - private val shape: OperationShape -) { - private val operationName: String = symbolProvider.toSymbol(shape).name - inner class InputRenamer(val name: String) : SymbolProvider { - override fun toSymbol(shape: Shape): Symbol { - val baseSymbol = symbolProvider.toSymbol(shape) - return baseSymbol.letIf(shape.isStructureShape) { - it.toBuilder().rustType(RustType.Opaque(name)).name(name).build() - } - } - - override fun toMemberName(shape: MemberShape?): String { - return symbolProvider.toMemberName(shape) - } - } - - fun render() { - val httpTrait = shape.getTrait(HttpTrait::class.java) - shape.input.map { model.expectShape(it, StructureShape::class.java) }.map { - renderInput(it) - httpTrait.map { httpTrait -> - HttpBindingGenerator(model, symbolProvider, runtimeConfig, writer, shape, it, httpTrait).render() - } - } - shape.output.map { model.expectShape(it, StructureShape::class.java) }.map { renderOutput(it) } - } - - fun renderInput(shape: StructureShape) { - StructureGenerator(model, InputRenamer("${operationName}Input"), writer, shape).render() - } - - fun renderOutput(shape: StructureShape) { - StructureGenerator(model, InputRenamer("${operationName}Output"), writer, shape).render() - } -} diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/ServiceGenerator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/ServiceGenerator.kt new file mode 100644 index 000000000..68fe443c9 --- /dev/null +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/ServiceGenerator.kt @@ -0,0 +1,59 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +package software.amazon.smithy.rust.codegen.smithy.generators + +import software.amazon.smithy.aws.traits.protocols.AwsJson1_0Trait +import software.amazon.smithy.aws.traits.protocols.RestJson1Trait +import software.amazon.smithy.codegen.core.CodegenException +import software.amazon.smithy.codegen.core.SymbolProvider +import software.amazon.smithy.codegen.core.writer.CodegenWriterDelegator +import software.amazon.smithy.model.Model +import software.amazon.smithy.model.knowledge.ServiceIndex +import software.amazon.smithy.model.knowledge.TopDownIndex +import software.amazon.smithy.model.shapes.ServiceShape +import software.amazon.smithy.model.shapes.ShapeId +import software.amazon.smithy.model.shapes.StructureShape +import software.amazon.smithy.model.traits.Trait +import software.amazon.smithy.rust.codegen.lang.RustWriter +import software.amazon.smithy.rust.codegen.smithy.RuntimeConfig +import software.amazon.smithy.rust.codegen.smithy.protocols.AwsJson10Factory +import software.amazon.smithy.rust.codegen.smithy.protocols.AwsRestJsonFactory + +class ServiceGenerator( + private val model: Model, + private val symbolProvider: SymbolProvider, + private val runtimeConfig: RuntimeConfig, + private val serviceShape: ServiceShape, + private val writers: CodegenWriterDelegator +) { + // TODO: refactor to be runtime pluggable; 2d + private val index = TopDownIndex(model) + private val supportedProtocols = mapOf( + AwsJson1_0Trait.ID to AwsJson10Factory(), + RestJson1Trait.ID to AwsRestJsonFactory() + + ) + private val protocols: MutableMap = ServiceIndex(model).getProtocols(serviceShape) + private val matchingProtocols = protocols.keys.mapNotNull { supportedProtocols[it] } + + init { + if (matchingProtocols.isEmpty()) { + throw CodegenException("No matching protocol — service offers: ${protocols.keys}. We offer: ${supportedProtocols.keys}") + } + } + + fun render() { + val operations = index.getContainedOperations(serviceShape) + operations.map { operation -> + writers.useShapeWriter(operation) { writer -> + // transform ensures that all models have input shapes + val input = operation.input.get().let { model.expectShape(it, StructureShape::class.java) } + val config = ProtocolConfig(model, symbolProvider, runtimeConfig, writer, serviceShape, operation, input) + matchingProtocols.first().build(config).render() + } + } + } +} diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/AwsJson10.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/AwsJson10.kt new file mode 100644 index 000000000..7729f1cfb --- /dev/null +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/AwsJson10.kt @@ -0,0 +1,47 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +package software.amazon.smithy.rust.codegen.smithy.protocols + +import software.amazon.smithy.codegen.core.SymbolProvider +import software.amazon.smithy.model.shapes.OperationShape +import software.amazon.smithy.model.shapes.ServiceShape +import software.amazon.smithy.model.shapes.StructureShape +import software.amazon.smithy.rust.codegen.lang.RustWriter +import software.amazon.smithy.rust.codegen.lang.rustBlock +import software.amazon.smithy.rust.codegen.smithy.RuntimeType +import software.amazon.smithy.rust.codegen.smithy.generators.HttpProtocolGenerator +import software.amazon.smithy.rust.codegen.smithy.generators.ProtocolConfig +import software.amazon.smithy.rust.codegen.smithy.generators.ProtocolGeneratorFactory + +class AwsJson10Factory : ProtocolGeneratorFactory { + override fun build( + protocolConfig: ProtocolConfig + ): AwsJson10Generator = with(protocolConfig) { + AwsJson10Generator(symbolProvider, writer, serviceShape, operationShape, inputShape) + } +} + +class AwsJson10Generator( + symbolProvider: SymbolProvider, + writer: RustWriter, + private val serviceShape: ServiceShape, + private val operationShape: OperationShape, + inputShape: StructureShape +) : HttpProtocolGenerator(symbolProvider, writer, inputShape) { + override fun toHttpRequestImpl(implBlockWriter: RustWriter) { + implBlockWriter.rustBlock("pub fn build_http_request(&self) -> \$T", RuntimeType.HttpRequestBuilder) { + write("let builder = \$T::new();", RuntimeType.HttpRequestBuilder) + write( + """ + builder + .method("POST") + .header("Content-Type", "application/x-amz-json-1.0") + .header("X-Amz-Target", "${serviceShape.id.name}.${operationShape.id.name}") + """.trimMargin() + ) + } + } +} diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/AwsRestJson.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/AwsRestJson.kt new file mode 100644 index 000000000..5f4e96569 --- /dev/null +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/protocols/AwsRestJson.kt @@ -0,0 +1,64 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +package software.amazon.smithy.rust.codegen.smithy.protocols + +import software.amazon.smithy.codegen.core.SymbolProvider +import software.amazon.smithy.model.Model +import software.amazon.smithy.model.knowledge.HttpBindingIndex +import software.amazon.smithy.model.shapes.OperationShape +import software.amazon.smithy.model.shapes.StructureShape +import software.amazon.smithy.model.traits.HttpTrait +import software.amazon.smithy.rust.codegen.lang.RustWriter +import software.amazon.smithy.rust.codegen.smithy.RuntimeConfig +import software.amazon.smithy.rust.codegen.smithy.RuntimeType +import software.amazon.smithy.rust.codegen.smithy.generators.HttpProtocolGenerator +import software.amazon.smithy.rust.codegen.smithy.generators.HttpTraitBindingGenerator +import software.amazon.smithy.rust.codegen.smithy.generators.ProtocolConfig +import software.amazon.smithy.rust.codegen.smithy.generators.ProtocolGeneratorFactory +import software.amazon.smithy.rust.codegen.util.dq + +class AwsRestJsonFactory : ProtocolGeneratorFactory { + override fun build( + protocolConfig: ProtocolConfig + ): AwsRestJsonGenerator = with(protocolConfig) { + AwsRestJsonGenerator(model, symbolProvider, runtimeConfig, writer, operationShape, inputShape) + } +} + +class AwsRestJsonGenerator( + private val model: Model, + private val symbolProvider: SymbolProvider, + private val runtimeConfig: RuntimeConfig, + private val writer: RustWriter, + private val operationShape: OperationShape, + private val inputShape: StructureShape +) : HttpProtocolGenerator(symbolProvider, writer, inputShape) { + // restJson1 requires all operations to use the HTTP trait + private val httpTrait = operationShape.expectTrait(HttpTrait::class.java) + + private val httpBindingGenerator = HttpTraitBindingGenerator( + model, + symbolProvider, + runtimeConfig, + writer, + operationShape, + inputShape, + httpTrait + ) + + private val httpIndex = HttpBindingIndex(model) + private val requestBuilder = RuntimeType.Http("request::Builder") + + override fun toHttpRequestImpl(implBlockWriter: RustWriter) { + val contentType = httpIndex.determineRequestContentType(operationShape, "application/json").orElse("application/json") + httpBindingGenerator.renderUpdateHttpBuilder(implBlockWriter) + httpBuilderFun(implBlockWriter) { + write("let builder = \$T::new();", requestBuilder) + write("let builder = builder.header(\"Content-Type\", ${contentType.dq()});") + write("self.update_http_builder(builder)") + } + } +} diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/traits/SyntheticInput.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/traits/SyntheticInput.kt new file mode 100644 index 000000000..55b556b6e --- /dev/null +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/traits/SyntheticInput.kt @@ -0,0 +1,29 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +package software.amazon.smithy.rust.codegen.smithy.traits + +import software.amazon.smithy.model.node.Node +import software.amazon.smithy.model.node.ObjectNode +import software.amazon.smithy.model.shapes.ShapeId +import software.amazon.smithy.model.traits.AnnotationTrait + +/** + * Indicates that a shape is a synthetic input (see `OperationNormalizer.kt`) + */ +class SyntheticInput @JvmOverloads constructor(node: ObjectNode? = Node.objectNode()) : + AnnotationTrait(ID, node) { + class Provider : AnnotationTrait.Provider( + ID, + { node: ObjectNode? -> + SyntheticInput( + node + ) + }) + + companion object { + val ID = ShapeId.from("smithy.api.internal#synthetic") + } +} diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/transformers/OperationNormalizer.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/transformers/OperationNormalizer.kt new file mode 100644 index 000000000..4b47730ee --- /dev/null +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/transformers/OperationNormalizer.kt @@ -0,0 +1,49 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +package software.amazon.smithy.rust.codegen.smithy.transformers + +import java.util.Optional +import kotlin.streams.toList +import software.amazon.smithy.codegen.core.SymbolProvider +import software.amazon.smithy.model.Model +import software.amazon.smithy.model.shapes.OperationShape +import software.amazon.smithy.model.shapes.Shape +import software.amazon.smithy.model.shapes.ShapeId +import software.amazon.smithy.model.shapes.StructureShape +import software.amazon.smithy.model.transform.ModelTransformer +import software.amazon.smithy.rust.codegen.smithy.traits.SyntheticInput + +/** + * Generate synthetic Input and Output structures for operations. + */ +// TODO: generate operation outputs as well; 2h +class OperationNormalizer(private val symbolProvider: SymbolProvider) { + fun addOperationInputs(model: Model): Model { + val transformer = ModelTransformer.create() + val newShapes = model.shapes(OperationShape::class.java).map { operation -> + // Generate or modify the input of input `Operation` to be a unique shape + val inputId = ShapeId.fromParts(operation.id.namespace, "${symbolProvider.toSymbol(operation).name}Input") + val newInputShape = operation.input.map { shapeId -> + val shape = model.expectShape(shapeId, StructureShape::class.java) + val renamedMembers = shape.members().map { + it.toBuilder().id(inputId.withMember(it.memberName)).build() + } + shape.toBuilder().id(inputId).members(renamedMembers) + }.orElse(StructureShape.builder().id(inputId)) + newInputShape.addTrait(SyntheticInput()).build() + }.toList() + val modelWithOperationInputs = model.toBuilder().addShapes(newShapes).build() + return transformer.mapShapes(modelWithOperationInputs) { + // Update all operations to point to their new input shape + val transformed: Optional = it.asOperationShape().map { operation -> + val inputId = ShapeId.fromParts(operation.id.namespace, "${symbolProvider.toSymbol(operation).name}Input") + modelWithOperationInputs.expectShape(inputId) + operation.toBuilder().input(inputId).build() + } + transformed.orElse(it) + } + } +} diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/util/Exec.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/util/Exec.kt index ee4e7a989..5719adfe0 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/util/Exec.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/util/Exec.kt @@ -9,6 +9,8 @@ import java.nio.file.Path import java.util.concurrent.TimeUnit import software.amazon.smithy.rust.codegen.smithy.letIf +class CommandFailed(output: String) : Exception("Command Failed\n$output") + fun String.runCommand(workdir: Path? = null): String? { val parts = this.split("\\s".toRegex()) val proc = ProcessBuilder(*parts.toTypedArray()) @@ -22,7 +24,7 @@ fun String.runCommand(workdir: Path? = null): String? { proc.waitFor(60, TimeUnit.MINUTES) if (proc.exitValue() != 0) { val output = proc.errorStream.bufferedReader().readText() - throw AssertionError("Command Failed\n$output") + throw CommandFailed("Command Failed\n$output") } return proc.inputStream.bufferedReader().readText() } diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/util/Strings.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/util/Strings.kt index ef7deade1..f228f92e0 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/util/Strings.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/util/Strings.kt @@ -22,8 +22,3 @@ fun String.singleQuote(): String = "\'$this\'" * Double quote a string, eg. "abc" -> "\"abc\"" */ fun String.dq(): String = this.doubleQuote() - -/** - * Single quote a string - */ -fun String.sq(): String = this.singleQuote() diff --git a/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/generators/EnumGeneratorTest.kt b/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/generators/EnumGeneratorTest.kt index 8392b58e6..02abec8b5 100644 --- a/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/generators/EnumGeneratorTest.kt +++ b/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/generators/EnumGeneratorTest.kt @@ -50,7 +50,6 @@ class EnumGeneratorTest { val generator = EnumGenerator(provider, writer, shape, trait) generator.render() val result = writer.toString() - println(result) result.shouldParseAsRust() result.shouldCompile() result.quickTest(""" diff --git a/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/generators/HttpBindingGeneratorTest.kt b/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/generators/HttpTraitBindingGeneratorTest.kt similarity index 53% rename from codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/generators/HttpBindingGeneratorTest.kt rename to codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/generators/HttpTraitBindingGeneratorTest.kt index 7b02ab85d..98ac52dde 100644 --- a/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/generators/HttpBindingGeneratorTest.kt +++ b/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/generators/HttpTraitBindingGeneratorTest.kt @@ -22,29 +22,38 @@ import software.amazon.smithy.model.shapes.ShapeId import software.amazon.smithy.model.shapes.StructureShape import software.amazon.smithy.model.traits.HttpTrait import software.amazon.smithy.rust.codegen.lang.RustWriter -import software.amazon.smithy.rust.codegen.smithy.generators.OperationGenerator +import software.amazon.smithy.rust.codegen.smithy.generators.HttpTraitBindingGenerator +import software.amazon.smithy.rust.codegen.smithy.generators.StructureGenerator import software.amazon.smithy.rust.codegen.smithy.generators.uriFormatString +import software.amazon.smithy.rust.codegen.smithy.transformers.OperationNormalizer import software.amazon.smithy.rust.codegen.util.dq import software.amazon.smithy.rust.testutil.TestRuntimeConfig import software.amazon.smithy.rust.testutil.asSmithy import software.amazon.smithy.rust.testutil.shouldCompile import software.amazon.smithy.rust.testutil.testSymbolProvider -class HttpBindingGeneratorTest { - private val model = """ +class HttpTraitBindingGeneratorTest { + private val baseModel = """ namespace smithy.example @idempotent @http(method: "PUT", uri: "/{bucketName}/{key}", code: 200) operation PutObject { - input: PutObjectInput + input: PutObjectRequest } list Extras { member: Integer } + + list Dates { + member: Timestamp + } + + @mediaType("video/quicktime") + string Video - structure PutObjectInput { + structure PutObjectRequest { // Sent in the URI label named "key". @required @httpLabel @@ -55,9 +64,15 @@ class HttpBindingGeneratorTest { @httpLabel bucketName: String, - // Sent in the X-Foo header - @httpHeader("X-Foo") - foo: String, + // Sent in the X-Dates header + @httpHeader("X-Dates") + dateHeaderList: Dates, + + @httpHeader("X-Ints") + intList: Extras, + + @httpHeader("X-MediaType") + mediaType: Video, // Sent in the query string as paramName @httpQuery("paramName") @@ -73,35 +88,45 @@ class HttpBindingGeneratorTest { additional: String, } """.asSmithy() + private val model = OperationNormalizer(testSymbolProvider(baseModel)).addOperationInputs(baseModel) - val operationShape = model.expectShape(ShapeId.from("smithy.example#PutObject"), OperationShape::class.java) - val httpTrait = operationShape.expectTrait(HttpTrait::class.java) - val inputShape = model.expectShape(operationShape.input.get(), StructureShape::class.java) + private val operationShape = model.expectShape(ShapeId.from("smithy.example#PutObject"), OperationShape::class.java) + private val inputShape = model.expectShape(operationShape.input.get(), StructureShape::class.java) + private val httpTrait = operationShape.expectTrait(HttpTrait::class.java) + private val symbolProvider = testSymbolProvider(model) private fun renderOperation(writer: RustWriter) { - OperationGenerator(model, testSymbolProvider(model), TestRuntimeConfig, writer, operationShape).render() + StructureGenerator(model, symbolProvider, writer, inputShape).render() + HttpTraitBindingGenerator(model, + symbolProvider, + TestRuntimeConfig, writer, operationShape, inputShape, httpTrait) + .Default().render() } @Test fun `produce correct uri format strings`() { - httpTrait.uriFormatString() shouldBe("/{bucketName}/{key}".dq()) + httpTrait.uriFormatString() shouldBe ("/{bucketName}/{key}".dq()) } + // TODO: when we generate builders, use them to clean up these tests; 1h @Test fun `generate uris`() { val writer = RustWriter("operation.rs", "operation") // currently rendering the operation renders the protocols—I want to separate that at some point. renderOperation(writer) - println(writer.toString()) - writer.shouldCompile(""" + writer.shouldCompile( + """ + let ts = Instant::from_epoch_seconds(10123125); let inp = PutObjectInput { additional: None, bucket_name: "somebucket/ok".to_string(), data: None, - foo: None, - key: Instant::from_epoch_seconds(10123125), - extras: Some(vec![0,1,2,44]), - some_value: Some("svq!!%&".to_string()) + date_header_list: None, + key: ts.clone(), + int_list: None, + extras: Some(vec![0, 1,2,44]), + some_value: Some("svq!!%&".to_string()), + media_type: None }; let mut o = String::new(); inp.uri_base(&mut o); @@ -109,26 +134,41 @@ class HttpBindingGeneratorTest { o.clear(); inp.uri_query(&mut o); assert_eq!(o.as_str(), "?paramName=svq!!%25%26&hello=0&hello=1&hello=2&hello=44") - """.trimIndent()) + """.trimIndent() + ) } @Test fun `build http requests`() { val writer = RustWriter("operation.rs", "operation") renderOperation(writer) - writer.shouldCompile(""" + writer.shouldCompile( + """ + let ts = Instant::from_epoch_seconds(10123125); let inp = PutObjectInput { additional: None, bucket_name: "buk".to_string(), data: None, - foo: None, + date_header_list: Some(vec![ts.clone()]), + int_list: Some(vec![0,1,44]), key: Instant::from_epoch_seconds(10123125), extras: Some(vec![0,1]), - some_value: Some("qp".to_string()) + some_value: Some("qp".to_string()), + media_type: Some("base64encodethis".to_string()), }; - let http_request = inp.build_http_request(::http::Request::builder()).body(()).unwrap(); + let http_request = inp.build_http_request().body(()).unwrap(); assert_eq!(http_request.uri(), "/buk/1970-04-28T03:58:45Z?paramName=qp&hello=0&hello=1"); assert_eq!(http_request.method(), "PUT"); - """) + let mut date_header = http_request.headers().get_all("X-Dates").iter(); + assert_eq!(date_header.next().unwrap(), "Tue, 28 Apr 1970 03:58:45 GMT"); + assert_eq!(date_header.next(), None); + + let int_header = http_request.headers().get_all("X-Ints").iter().map(|hv|hv.to_str().unwrap()).collect::>(); + assert_eq!(int_header, vec!["0", "1", "44"]); + + let base64_header = http_request.headers().get_all("X-MediaType").iter().map(|hv|hv.to_str().unwrap()).collect::>(); + assert_eq!(base64_header, vec!["YmFzZTY0ZW5jb2RldGhpcw=="]); + """ + ) } } diff --git a/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/generators/StructureGeneratorTest.kt b/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/generators/StructureGeneratorTest.kt index 02d5ddf67..7eeb072d5 100644 --- a/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/generators/StructureGeneratorTest.kt +++ b/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/generators/StructureGeneratorTest.kt @@ -16,7 +16,6 @@ import software.amazon.smithy.rust.codegen.lang.RustWriter import software.amazon.smithy.rust.codegen.smithy.SymbolVisitor import software.amazon.smithy.rust.codegen.smithy.generators.StructureGenerator import software.amazon.smithy.rust.testutil.shouldCompile -import software.amazon.smithy.rust.testutil.shouldParseAsRust import software.amazon.smithy.rust.testutil.testSymbolProvider class StructureGeneratorTest { @@ -67,9 +66,6 @@ class StructureGeneratorTest { val writer = RustWriter("model.rs", "model") val generator = StructureGenerator(model, provider, writer, struct) generator.render() - val result = writer.toString() - println(result) - result.shouldParseAsRust() writer.shouldCompile(""" let s: Option = None; s.map(|i|println!("{:?}, {:?}", i.ts, i.byte_value)); @@ -82,9 +78,6 @@ class StructureGeneratorTest { val writer = RustWriter("errors.rs", "errors") val generator = StructureGenerator(model, provider, writer, error) generator.render() - val result = writer.toString() - println(result) - result.shouldParseAsRust() - result.shouldCompile() + writer.shouldCompile() } } diff --git a/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/smithy/transformers/OperationNormalizerTest.kt b/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/smithy/transformers/OperationNormalizerTest.kt new file mode 100644 index 000000000..e50f4c33e --- /dev/null +++ b/codegen/src/test/kotlin/software/amazon/smithy/rust/codegen/smithy/transformers/OperationNormalizerTest.kt @@ -0,0 +1,56 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +package software.amazon.smithy.rust.codegen.smithy.transformers + +import io.kotest.matchers.shouldBe +import org.junit.jupiter.api.Test +import software.amazon.smithy.model.shapes.OperationShape +import software.amazon.smithy.model.shapes.ShapeId +import software.amazon.smithy.model.shapes.StructureShape +import software.amazon.smithy.rust.testutil.asSmithy +import software.amazon.smithy.rust.testutil.testSymbolProvider + +internal class OperationNormalizerTest { + + @Test + fun `add inputs to empty operations`() { + val model = """ + namespace smithy.test + operation Empty {} + """.asSmithy() + val operationId = ShapeId.from("smithy.test#Empty") + model.expectShape(operationId, OperationShape::class.java).input.isPresent shouldBe false + val sut = OperationNormalizer(testSymbolProvider(model)) + val modified = sut.addOperationInputs(model) + val operation = modified.expectShape(operationId, OperationShape::class.java) + operation.input.isPresent shouldBe true + operation.input.get().name shouldBe "EmptyInput" + } + + @Test + fun `create cloned inputs for operations`() { + val model = """ + namespace smithy.test + structure RenameMe { + v: String + } + operation MyOp { + input: RenameMe + } + """.asSmithy() + val operationId = ShapeId.from("smithy.test#MyOp") + model.expectShape(operationId, OperationShape::class.java).input.isPresent shouldBe true + val sut = OperationNormalizer(testSymbolProvider(model)) + val modified = sut.addOperationInputs(model) + val operation = modified.expectShape(operationId, OperationShape::class.java) + operation.input.isPresent shouldBe true + val inputId = operation.input.get() + inputId.name shouldBe "MyOpInput" + val inputShape = modified.expectShape(inputId, StructureShape::class.java) + testSymbolProvider(modified).toSymbol(inputShape).name shouldBe "MyOpInput" + inputShape.memberNames shouldBe listOf("v") + } +} diff --git a/codegen/src/test/kotlin/software/amazon/smithy/rust/lang/RustWriterTest.kt b/codegen/src/test/kotlin/software/amazon/smithy/rust/lang/RustWriterTest.kt index 7672e98ad..92c7ab59b 100644 --- a/codegen/src/test/kotlin/software/amazon/smithy/rust/lang/RustWriterTest.kt +++ b/codegen/src/test/kotlin/software/amazon/smithy/rust/lang/RustWriterTest.kt @@ -12,7 +12,7 @@ import software.amazon.smithy.model.Model import software.amazon.smithy.model.shapes.SetShape import software.amazon.smithy.model.shapes.StringShape import software.amazon.smithy.rust.codegen.lang.RustWriter -import software.amazon.smithy.rust.codegen.lang.withBlock +import software.amazon.smithy.rust.codegen.lang.rustBlock import software.amazon.smithy.rust.codegen.smithy.SymbolVisitor import software.amazon.smithy.rust.testutil.quickTest import software.amazon.smithy.rust.testutil.shouldCompile @@ -44,7 +44,7 @@ class RustWriterTest { val provider: SymbolProvider = SymbolVisitor(model, "test") val setSymbol = provider.toSymbol(set) val stringSymbol = provider.toSymbol(stringShape) - sut.withBlock("struct Test {", "}") { + sut.rustBlock("struct Test") { write("member: \$T,", setSymbol) write("otherMember: \$T,", stringSymbol) } diff --git a/codegen/src/test/kotlin/software/amazon/smithy/rust/testutil/Rust.kt b/codegen/src/test/kotlin/software/amazon/smithy/rust/testutil/Rust.kt index 49c7f8456..32f6d29f3 100644 --- a/codegen/src/test/kotlin/software/amazon/smithy/rust/testutil/Rust.kt +++ b/codegen/src/test/kotlin/software/amazon/smithy/rust/testutil/Rust.kt @@ -7,6 +7,7 @@ package software.amazon.smithy.rust.testutil import software.amazon.smithy.rust.codegen.lang.RustDependency import software.amazon.smithy.rust.codegen.lang.RustWriter +import software.amazon.smithy.rust.codegen.util.CommandFailed import software.amazon.smithy.rust.codegen.util.runCommand // TODO: unify these test helpers a bit @@ -19,10 +20,17 @@ fun String.shouldParseAsRust() { fun RustWriter.shouldCompile(main: String = "") { val deps = this.dependencies.map { RustDependency.fromSymbolDependency(it) } - this.toString().shouldCompile(deps.toSet(), main) + try { + this.toString().shouldCompile(deps.toSet(), main) + } catch (e: CommandFailed) { + // When the test fails, print the code for convenience + println(this.toString()) + throw e + } } fun String.shouldCompile(deps: Set, main: String = "") { + this.shouldParseAsRust() val tempDir = createTempDir() // TODO: unify this with CargoTomlGenerator val cargoToml = """ @@ -56,7 +64,6 @@ fun String.shouldCompile() { if (!this.contains("fn main")) { tempFile.appendText("\nfn main() {}\n") } - println(tempFile.absolutePath) "rustc ${tempFile.absolutePath} -o ${tempDir.absolutePath}/output".runCommand() } diff --git a/rust-runtime/.gitignore b/rust-runtime/.gitignore index 1e7caa9ea..2c96eb1b6 100644 --- a/rust-runtime/.gitignore +++ b/rust-runtime/.gitignore @@ -1,2 +1,2 @@ -Cargo.lock target/ +Cargo.lock diff --git a/rust-runtime/smithy-http/src/base64.rs b/rust-runtime/smithy-http/src/base64.rs new file mode 100644 index 000000000..67787262b --- /dev/null +++ b/rust-runtime/smithy-http/src/base64.rs @@ -0,0 +1,77 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +/// A correct, small, but not especially fast +/// base64 implementation +// TODO: Fuzz and test against the base64 crate +const BASE64_ENCODE_TABLE: &[u8; 64] = + b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +pub fn encode>(inp: T) -> String { + let inp = inp.as_ref(); + encode_inner(inp) +} + +fn encode_inner(inp: &[u8]) -> String { + // Base 64 encodes groups of 6 bits into characters—this means that each + // 3 byte group (24 bits) is encoded into 4 base64 characters. + let char_ct = ((inp.len() + 2) / 3) * 4; + let mut output = String::with_capacity(char_ct); + for chunk in inp.chunks(3) { + let mut block: i32 = 0; + // Write the chunks into the beginning of a 32 bit int + for (idx, chunk) in chunk.iter().enumerate() { + block |= (*chunk as i32) << ((3 - idx) * 8); + } + let num_sextets = ((chunk.len() * 8) + 5) / 6; + for idx in 0..num_sextets { + let slice = block >> (26 - (6 * idx)); + let idx = (slice as u8) & 0b0011_1111; + output.push(BASE64_ENCODE_TABLE[idx as usize] as char); + } + for _ in 0..(4 - num_sextets) { + output.push('='); + } + } + // be sure we got it right + debug_assert_eq!(output.capacity(), char_ct); + output +} + +#[cfg(test)] +mod test { + use crate::base64::encode; + // TODO: base64 decoder + // TODO: round trip testing / fuzzing + // TODO: dev-dependency on base64 crate? to test against it? + + #[test] + fn test_base64() { + assert_eq!(encode("abc"), "YWJj"); + assert_eq!(encode("anything you want."), "YW55dGhpbmcgeW91IHdhbnQu"); + assert_eq!(encode("anything you want"), "YW55dGhpbmcgeW91IHdhbnQ="); + assert_eq!(encode("anything you wan"), "YW55dGhpbmcgeW91IHdhbg=="); + } + + #[test] + fn test_base64_long() { + let decoded = "Alas, eleventy-one years is far too short a time to live among such excellent and admirable hobbits. I don't know half of you half as well as I should like, and I like less than half of you half as well as you deserve."; + let encoded = "QWxhcywgZWxldmVudHktb25lIHllYXJzIGlzIGZhciB0b28gc2hvcnQgYSB0aW1lIHRvIGxpdmUgYW1vbmcgc3VjaCBleGNlbGxlbnQgYW5kIGFkbWlyYWJsZSBob2JiaXRzLiBJIGRvbid0IGtub3cgaGFsZiBvZiB5b3UgaGFsZiBhcyB3ZWxsIGFzIEkgc2hvdWxkIGxpa2UsIGFuZCBJIGxpa2UgbGVzcyB0aGFuIGhhbGYgb2YgeW91IGhhbGYgYXMgd2VsbCBhcyB5b3UgZGVzZXJ2ZS4="; + assert_eq!(encode(decoded), encoded); + } + + #[test] + fn test_base64_utf8() { + let decoded = "ユニコードとはか?"; + let encoded = "44Om44OL44Kz44O844OJ44Go44Gv44GL77yf"; + assert_eq!(encode(decoded), encoded); + } + #[test] + fn test_base64_control_chars() { + let decoded = "hello\tworld\n"; + let encoded = "aGVsbG8Jd29ybGQK"; + assert_eq!(encode(decoded), encoded); + } +} diff --git a/rust-runtime/smithy-http/src/label.rs b/rust-runtime/smithy-http/src/label.rs new file mode 100644 index 000000000..48a464eb5 --- /dev/null +++ b/rust-runtime/smithy-http/src/label.rs @@ -0,0 +1,28 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +/// Formatting values as Smithy +/// [httpLabel](https://awslabs.github.io/smithy/1.0/spec/core/http-traits.html#httplabel-trait) + +use smithy_types::Instant; +use std::fmt::Debug; + +pub fn fmt_default(t: T) -> String { + format!("{:?}", t) +} + +pub fn fmt_string>(t: T, greedy: bool) -> String { + let s = t.as_ref(); + if greedy { + s.to_owned() + } else { + s.replace("/", "%2F") + } +} + +pub fn fmt_timestamp(t: &Instant, format: smithy_types::instant::Format) -> String { + t.fmt(format) +} + diff --git a/rust-runtime/smithy-http/src/lib.rs b/rust-runtime/smithy-http/src/lib.rs index e01ada943..94f675eb5 100644 --- a/rust-runtime/smithy-http/src/lib.rs +++ b/rust-runtime/smithy-http/src/lib.rs @@ -1,135 +1,10 @@ /* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://aws.amazon.com/apache2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. */ // TODO: there is no compelling reason to have this be a shared crate—we should vendor this // module into the individual crates -pub mod label { - use smithy_types::Instant; - use std::fmt::Debug; - - pub fn fmt_default(t: T) -> String { - format!("{:?}", t) - } - - pub fn fmt_string>(t: T, greedy: bool) -> String { - let s = t.as_ref(); - return if greedy { - s.to_owned() - } else { - s.replace("/", "%2F") - }; - } - - pub fn fmt_timestamp(t: &Instant, format: smithy_types::instant::Format) -> String { - t.fmt(format) - } -} - -pub mod query { - use std::fmt::Debug; - use smithy_types::Instant; - - const HEX_CHARS: &[u8; 16] = b"0123456789ABCDEF"; - - pub fn fmt_default(t: T) -> String { - format!("{:?}", t) - } - - pub fn fmt_string>(t: T) -> String { - let bytes = t.as_ref(); - let final_capacity = bytes.chars().map(|c|if is_valid_query(c) { - 1 - } else { - c.len_utf8() * 3 - }).sum(); - let mut out = String::with_capacity(final_capacity); - for char in bytes.chars() { - url_encode(char, &mut out); - } - debug_assert_eq!(out.capacity(), final_capacity); - out - } - - pub fn fmt_timestamp(t: &Instant, format: smithy_types::instant::Format) -> String { - t.fmt(format) - } - - fn is_valid_query(c: char) -> bool { - // unreserved - let explicit_invalid = |c:char| match c{ - '&' | '=' => false, - _ => true - }; - let unreserved = - |c: char| c.is_alphanumeric() || c == '-' || c == '.' || c == '_' || c == '~'; - let sub_delims = |c: char| match c { - '!' | '$' | '\'' | '(' | ')' | '*' | '+' | ',' | ';' => true, - // TODO: should &/= be url encoded? - '&' | '=' => false, - _ => false, - }; - let p_char = |c: char| unreserved(c) || sub_delims(c) || c == ':' || c == '@'; - explicit_invalid(c) && (p_char(c) || c == '/' || c == '?') - } - - fn url_encode(c: char, buff: &mut String) { - if is_valid_query(c) { - buff.push(c) - } else { - let mut inner_buff = [0; 2]; - let u8_slice = c.encode_utf8(&mut inner_buff).as_bytes(); - for c in u8_slice { - let upper = (c & 0xf0) >> 4; - let lower = c & 0x0f; - buff.push('%'); - buff.push(HEX_CHARS[upper as usize] as char); - buff.push(HEX_CHARS[lower as usize] as char); - } - } - } - - pub fn write(inp: Vec<(&str, String)>, out: &mut String) { - let mut prefix = '?'; - for (k,v) in inp { - out.push(prefix); - out.push_str(k); - out.push_str("="); - out.push_str(&v); - prefix = '&'; - }; - } - - - #[cfg(test)] - mod test { - use crate::query::{is_valid_query, fmt_string}; - - #[test] - fn test_valid_query_chars() { - assert_eq!(is_valid_query(' '), false); - assert_eq!(is_valid_query('a'), true); - assert_eq!(is_valid_query('/'), true); - assert_eq!(is_valid_query('%'), false); - } - - #[test] - fn test_url_encode() { - assert_eq!(fmt_string("y̆").as_str(), "y%CC%86"); - assert_eq!(fmt_string(" ").as_str(), "%20"); - assert_eq!(fmt_string("foo/baz%20").as_str(), "foo/baz%2520"); - assert_eq!(fmt_string("&=").as_str(), "%26%3D"); - } - } -} +pub mod base64; +pub mod query; +pub mod label; diff --git a/rust-runtime/smithy-http/src/query.rs b/rust-runtime/smithy-http/src/query.rs new file mode 100644 index 000000000..279770de9 --- /dev/null +++ b/rust-runtime/smithy-http/src/query.rs @@ -0,0 +1,106 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +/// Formatting values into the query string as specified in +/// [httpQuery](https://awslabs.github.io/smithy/1.0/spec/core/http-traits.html#httpquery-trait) + +use smithy_types::Instant; +use std::fmt::Debug; + +const HEX_CHARS: &[u8; 16] = b"0123456789ABCDEF"; + +pub fn fmt_default(t: T) -> String { + format!("{:?}", t) +} + +pub fn fmt_string>(t: T) -> String { + let bytes = t.as_ref(); + let final_capacity = bytes + .chars() + .map(|c| { + if is_valid_query(c) { + 1 + } else { + c.len_utf8() * 3 + } + }) + .sum(); + let mut out = String::with_capacity(final_capacity); + for char in bytes.chars() { + url_encode(char, &mut out); + } + debug_assert_eq!(out.capacity(), final_capacity); + out +} + +pub fn fmt_timestamp(t: &Instant, format: smithy_types::instant::Format) -> String { + t.fmt(format) +} + +fn is_valid_query(c: char) -> bool { + // unreserved + let explicit_invalid = |c: char| match c { + '&' | '=' => false, + _ => true, + }; + let unreserved = + |c: char| c.is_alphanumeric() || c == '-' || c == '.' || c == '_' || c == '~'; + let sub_delims = |c: char| match c { + '!' | '$' | '\'' | '(' | ')' | '*' | '+' | ',' | ';' => true, + // TODO: should &/= be url encoded? + '&' | '=' => false, + _ => false, + }; + let p_char = |c: char| unreserved(c) || sub_delims(c) || c == ':' || c == '@'; + explicit_invalid(c) && (p_char(c) || c == '/' || c == '?') +} + +fn url_encode(c: char, buff: &mut String) { + if is_valid_query(c) { + buff.push(c) + } else { + let mut inner_buff = [0; 2]; + let u8_slice = c.encode_utf8(&mut inner_buff).as_bytes(); + for c in u8_slice { + let upper = (c & 0xf0) >> 4; + let lower = c & 0x0f; + buff.push('%'); + buff.push(HEX_CHARS[upper as usize] as char); + buff.push(HEX_CHARS[lower as usize] as char); + } + } +} + +pub fn write(inp: Vec<(&str, String)>, out: &mut String) { + let mut prefix = '?'; + for (k, v) in inp { + out.push(prefix); + out.push_str(k); + out.push_str("="); + out.push_str(&v); + prefix = '&'; + } +} + +#[cfg(test)] +mod test { + use crate::query::{fmt_string, is_valid_query}; + + #[test] + fn test_valid_query_chars() { + assert_eq!(is_valid_query(' '), false); + assert_eq!(is_valid_query('a'), true); + assert_eq!(is_valid_query('/'), true); + assert_eq!(is_valid_query('%'), false); + } + + #[test] + fn test_url_encode() { + assert_eq!(fmt_string("y̆").as_str(), "y%CC%86"); + assert_eq!(fmt_string(" ").as_str(), "%20"); + assert_eq!(fmt_string("foo/baz%20").as_str(), "foo/baz%2520"); + assert_eq!(fmt_string("&=").as_str(), "%26%3D"); + } +} -- GitLab