diff --git a/.all-contributorsrc b/.all-contributorsrc
index 0315fda2a36e..70dec9709a92 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -868,6 +868,24 @@
"contributions": [
"code"
]
+ },
+ {
+ "login": "psnilesh",
+ "name": "Nilesh PS",
+ "avatar_url": "https://avatars.githubusercontent.com/u/12656997?v=4",
+ "profile": "https://github.com/psnilesh",
+ "contributions": [
+ "code"
+ ]
+ },
+ {
+ "login": "swar8080",
+ "name": "Steven Swartz",
+ "avatar_url": "https://avatars.githubusercontent.com/u/17691679?v=4",
+ "profile": "https://github.com/swar8080",
+ "contributions": [
+ "code"
+ ]
}
],
"contributorsPerLine": 7,
diff --git a/.changes/2.20.144.json b/.changes/2.20.144.json
new file mode 100644
index 000000000000..70e3e02e1526
--- /dev/null
+++ b/.changes/2.20.144.json
@@ -0,0 +1,42 @@
+{
+ "version": "2.20.144",
+ "date": "2023-09-08",
+ "entries": [
+ {
+ "type": "bugfix",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Fixed an issue in async client where the future would get stuck if there is a server error and the server fails to return response body that matches with the content length specified in the response header. See [#4354](https://github.com/aws/aws-sdk-java-v2/issues/4354)"
+ },
+ {
+ "type": "feature",
+ "category": "AWS Single Sign-On Admin",
+ "contributor": "",
+ "description": "Content updates to IAM Identity Center API for China Regions."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon FSx",
+ "contributor": "",
+ "description": "Amazon FSx documentation fixes"
+ },
+ {
+ "type": "feature",
+ "category": "Amazon SageMaker Service",
+ "contributor": "",
+ "description": "Autopilot APIs will now support holiday featurization for Timeseries models. The models will now hold holiday metadata and should be able to accommodate holiday effect during inference."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon WorkSpaces",
+ "contributor": "",
+ "description": "A new field \"ErrorDetails\" will be added to the output of \"DescribeWorkspaceImages\" API call. This field provides in-depth details about the error occurred during image import process. These details include the possible causes of the errors and troubleshooting information."
+ },
+ {
+ "type": "feature",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Updated endpoint and partition metadata."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.changes/2.20.145.json b/.changes/2.20.145.json
new file mode 100644
index 000000000000..b396519f7d3f
--- /dev/null
+++ b/.changes/2.20.145.json
@@ -0,0 +1,24 @@
+{
+ "version": "2.20.145",
+ "date": "2023-09-11",
+ "entries": [
+ {
+ "type": "feature",
+ "category": "AWS Elemental MediaLive",
+ "contributor": "",
+ "description": "AWS Elemental Link now supports attaching a Link UHD device to a MediaConnect flow."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon EC2 Container Registry",
+ "contributor": "",
+ "description": "This release will have ValidationException be thrown from ECR LifecyclePolicy APIs in regions LifecyclePolicy is not supported, this includes existing Amazon Dedicated Cloud (ADC) regions. This release will also change Tag: TagValue and Tag: TagKey to required."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon QuickSight",
+ "contributor": "",
+ "description": "This release launches new updates to QuickSight KPI visuals - support for sparklines, new templated layout and new targets for conditional formatting rules."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.changes/2.20.146.json b/.changes/2.20.146.json
new file mode 100644
index 000000000000..eba3a83c79d4
--- /dev/null
+++ b/.changes/2.20.146.json
@@ -0,0 +1,42 @@
+{
+ "version": "2.20.146",
+ "date": "2023-09-12",
+ "entries": [
+ {
+ "type": "bugfix",
+ "category": "AWS CRT-based S3 Client",
+ "contributor": "",
+ "description": "Improved CRT client uploads by directly passing requestPath, eliminating unnecessary file I/O in the Java SDK Transfer Manager."
+ },
+ {
+ "type": "feature",
+ "category": "AWSKendraFrontendService",
+ "contributor": "",
+ "description": "Amazon Kendra now supports confidence score buckets for retrieved passage results using the Retrieve API."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon DynamoDB Enhanced Client",
+ "contributor": "psnilesh",
+ "description": "This commit introduces DynamoDbTable#getItemWithResponse() that allows customers to specify additional parameters on the request such as ReturnConsumedCapacity to get additional information the service response."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Elastic Compute Cloud",
+ "contributor": "",
+ "description": "This release adds support for restricting public sharing of AMIs through AMI Block Public Access"
+ },
+ {
+ "type": "feature",
+ "category": "Amazon EventBridge",
+ "contributor": "",
+ "description": "Adds sensitive trait to various shapes in Jetstream Connections API model."
+ },
+ {
+ "type": "feature",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Updated endpoint and partition metadata."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.changes/2.20.147.json b/.changes/2.20.147.json
new file mode 100644
index 000000000000..3f00d281a4b6
--- /dev/null
+++ b/.changes/2.20.147.json
@@ -0,0 +1,78 @@
+{
+ "version": "2.20.147",
+ "date": "2023-09-13",
+ "entries": [
+ {
+ "type": "bugfix",
+ "category": "AWS SDK for Java v2",
+ "contributor": "faucct",
+ "description": "Fix `InputStreamSubscriber` to return 0 when reading a length of 0."
+ },
+ {
+ "type": "bugfix",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Allow IamPolicy to read json policies where the principal value is itself an array"
+ },
+ {
+ "type": "feature",
+ "category": "AWS Cloud9",
+ "contributor": "",
+ "description": "Update to include information on Ubuntu 18 deprecation."
+ },
+ {
+ "type": "feature",
+ "category": "AWS SimSpace Weaver",
+ "contributor": "",
+ "description": "Edited the introductory text for the API reference."
+ },
+ {
+ "type": "feature",
+ "category": "AWS X-Ray",
+ "contributor": "",
+ "description": "Add StartTime field in GetTraceSummaries API response for each TraceSummary."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon CloudWatch Internet Monitor",
+ "contributor": "",
+ "description": "This release updates the Amazon CloudWatch Internet Monitor API domain name."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon DynamoDB Enhanced Client",
+ "contributor": "psnilesh",
+ "description": "This commit introduces returnConsumedCapacity input to BatchGetItemEnhancedRequest that allows customers to find out exactly how much read units were consumed by the operation."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon GuardDuty",
+ "contributor": "",
+ "description": "Add `managementType` field to ListCoverage API response."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Interactive Video Service RealTime",
+ "contributor": "",
+ "description": "Doc only update that changes description for ParticipantToken."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Kinesis Firehose",
+ "contributor": "",
+ "description": "DocumentIdOptions has been added for the Amazon OpenSearch destination."
+ },
+ {
+ "type": "feature",
+ "category": "Elastic Disaster Recovery Service",
+ "contributor": "",
+ "description": "Updated existing APIs and added new ones to support using AWS Elastic Disaster Recovery post-launch actions. Added support for new regions."
+ },
+ {
+ "type": "feature",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Updated endpoint and partition metadata."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.changes/2.20.148.json b/.changes/2.20.148.json
new file mode 100644
index 000000000000..b91ff2f48241
--- /dev/null
+++ b/.changes/2.20.148.json
@@ -0,0 +1,36 @@
+{
+ "version": "2.20.148",
+ "date": "2023-09-14",
+ "entries": [
+ {
+ "type": "feature",
+ "category": "AWS CloudFormation",
+ "contributor": "",
+ "description": "Documentation updates for AWS CloudFormation"
+ },
+ {
+ "type": "feature",
+ "category": "AWS EntityResolution",
+ "contributor": "",
+ "description": "Changed \"ResolutionTechniques\" and \"MappedInputFields\" in workflow and schema mapping operations to be required fields."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon AppStream",
+ "contributor": "",
+ "description": "This release introduces multi-session fleets, allowing customers to provision more than one user session on a single fleet instance."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Lookout for Equipment",
+ "contributor": "",
+ "description": "This release adds APIs for the new scheduled retraining feature."
+ },
+ {
+ "type": "feature",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Updated endpoint and partition metadata."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.changes/2.20.149.json b/.changes/2.20.149.json
new file mode 100644
index 000000000000..6a32940b6b8d
--- /dev/null
+++ b/.changes/2.20.149.json
@@ -0,0 +1,36 @@
+{
+ "version": "2.20.149",
+ "date": "2023-09-15",
+ "entries": [
+ {
+ "type": "feature",
+ "category": "AWS DataSync",
+ "contributor": "",
+ "description": "Documentation-only updates for AWS DataSync."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon AppStream",
+ "contributor": "",
+ "description": "This release introduces app block builder, allowing customers to provision a resource to package applications into an app block"
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Connect Service",
+ "contributor": "",
+ "description": "New rule type (OnMetricDataUpdate) has been added"
+ },
+ {
+ "type": "feature",
+ "category": "Amazon SageMaker Service",
+ "contributor": "",
+ "description": "This release introduces Skip Model Validation for Model Packages"
+ },
+ {
+ "type": "feature",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Updated endpoint and partition metadata."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.changes/2.20.150.json b/.changes/2.20.150.json
new file mode 100644
index 000000000000..10a62d2fc16f
--- /dev/null
+++ b/.changes/2.20.150.json
@@ -0,0 +1,30 @@
+{
+ "version": "2.20.150",
+ "date": "2023-09-18",
+ "entries": [
+ {
+ "type": "bugfix",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Do not instruct the CRT Sigv4a signer to do path normalization to avoid signature mismatch errors"
+ },
+ {
+ "type": "feature",
+ "category": "AWS Application Discovery Service",
+ "contributor": "",
+ "description": "Add sensitive protection for customer information"
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Macie 2",
+ "contributor": "",
+ "description": "This release changes the default managedDataIdentifierSelector setting for new classification jobs to RECOMMENDED. By default, new classification jobs now use the recommended set of managed data identifiers."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon WorkMail",
+ "contributor": "",
+ "description": "This release includes four new APIs UpdateUser, UpdateGroup, ListGroupsForEntity and DescribeEntity, along with RemoteUsers and some enhancements to existing APIs."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.changes/2.20.151.json b/.changes/2.20.151.json
new file mode 100644
index 000000000000..d96d134c65c8
--- /dev/null
+++ b/.changes/2.20.151.json
@@ -0,0 +1,30 @@
+{
+ "version": "2.20.151",
+ "date": "2023-09-19",
+ "entries": [
+ {
+ "type": "feature",
+ "category": "AWS Outposts",
+ "contributor": "",
+ "description": "This release adds the InstanceFamilies field to the ListAssets response."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Elastic Compute Cloud",
+ "contributor": "",
+ "description": "This release adds support for C7i, and R7a instance types."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon SageMaker Service",
+ "contributor": "",
+ "description": "This release adds support for one-time model monitoring schedules that are executed immediately without delay, explicit data analysis windows for model monitoring schedules and exclude features attributes to remove features from model monitor analysis."
+ },
+ {
+ "type": "feature",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Updated endpoint and partition metadata."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.changes/2.20.152.json b/.changes/2.20.152.json
new file mode 100644
index 000000000000..f760492ed650
--- /dev/null
+++ b/.changes/2.20.152.json
@@ -0,0 +1,72 @@
+{
+ "version": "2.20.152",
+ "date": "2023-09-20",
+ "entries": [
+ {
+ "type": "bugfix",
+ "category": "S3 Transfer Manager",
+ "contributor": "",
+ "description": "Fix [3839](https://github.com/aws/aws-sdk-java-v2/issues/3839) S3 Transfer Manager issue with transferComplete() not called for AsyncRequestBody.fromFile()"
+ },
+ {
+ "type": "feature",
+ "category": "AWS App Runner",
+ "contributor": "",
+ "description": "This release adds improvements for managing App Runner auto scaling configuration resources. New APIs: UpdateDefaultAutoScalingConfiguration and ListServicesForAutoScalingConfiguration. Updated API: DeleteAutoScalingConfiguration."
+ },
+ {
+ "type": "feature",
+ "category": "AWS Cloud Map",
+ "contributor": "",
+ "description": "Adds a new DiscoverInstancesRevision API and also adds InstanceRevision field to the DiscoverInstances API response."
+ },
+ {
+ "type": "feature",
+ "category": "AWS Lambda",
+ "contributor": "deki",
+ "description": "Update aws-lambda-java-core version to 1.2.3"
+ },
+ {
+ "type": "feature",
+ "category": "AWS SSO OIDC",
+ "contributor": "",
+ "description": "Update FIPS endpoints in aws-us-gov."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon AppConfig",
+ "contributor": "",
+ "description": "Enabling boto3 paginators for list APIs and adding documentation around ServiceQuotaExceededException errors"
+ },
+ {
+ "type": "feature",
+ "category": "Amazon CloudWatch Logs",
+ "contributor": "",
+ "description": "Add ClientToken to QueryDefinition CFN Handler in CWL"
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Kinesis Video Streams",
+ "contributor": "",
+ "description": "Updated DescribeMediaStorageConfiguration, StartEdgeConfigurationUpdate, ImageGenerationConfiguration$SamplingInterval, and UpdateMediaStorageConfiguration to match AWS Docs."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Simple Storage Service",
+ "contributor": "",
+ "description": "Fix an issue where the SDK can fail to unmarshall response due to NumberFormatException"
+ },
+ {
+ "type": "feature",
+ "category": "CodeArtifact",
+ "contributor": "",
+ "description": "Add support for the Swift package format."
+ },
+ {
+ "type": "feature",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Updated endpoint and partition metadata."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.changes/2.20.153.json b/.changes/2.20.153.json
new file mode 100644
index 000000000000..b9e457b875f4
--- /dev/null
+++ b/.changes/2.20.153.json
@@ -0,0 +1,90 @@
+{
+ "version": "2.20.153",
+ "date": "2023-09-22",
+ "entries": [
+ {
+ "type": "bugfix",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Fixed an issue in `InputStreamSubscriber` that could cause NPE to be thrown when close and onSubscribed get invoked concurrently. See [#4081](https://github.com/aws/aws-sdk-java-v2/issues/4081)"
+ },
+ {
+ "type": "bugfix",
+ "category": "Amazon DynamoDB",
+ "contributor": "",
+ "description": "Fixed a bug in DynamoDbTable.createTable, where global secondary indices with a partition key matching the default partition key of the table would be created as local secondary indices."
+ },
+ {
+ "type": "bugfix",
+ "category": "Amazon S3",
+ "contributor": "",
+ "description": "Fixed the issue where SdkException is unnecessarily re-wrapped with SdkClientException in S3 multipart client and AWS CRT-based S3 client. See[#4356](https://github.com/aws/aws-sdk-java-v2/issues/4356)"
+ },
+ {
+ "type": "bugfix",
+ "category": "Amazon Simple Storage Servic",
+ "contributor": "",
+ "description": "Fix for Cross-region calls failure due to AuthorizationHeaderMalformed errors while using clients with configured region as us-east-1."
+ },
+ {
+ "type": "feature",
+ "category": "AWS Database Migration Service",
+ "contributor": "",
+ "description": "new vendors for DMS CSF: MongoDB, MariaDB, DocumentDb and Redshift"
+ },
+ {
+ "type": "feature",
+ "category": "AWS Elemental MediaConvert",
+ "contributor": "",
+ "description": "This release supports the creation of of audio-only tracks in CMAF output groups."
+ },
+ {
+ "type": "feature",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Adds support for non-Json String payloads"
+ },
+ {
+ "type": "feature",
+ "category": "Amazon CloudWatch Events",
+ "contributor": "",
+ "description": "Adds sensitive trait to various shapes in Jetstream Connections API model."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Elastic Compute Cloud",
+ "contributor": "",
+ "description": "EC2 M2 Pro Mac instances are powered by Apple M2 Pro Mac Mini computers featuring 12 core CPU, 19 core GPU, 32 GiB of memory, and 16 core Apple Neural Engine and uniquely enabled by the AWS Nitro System through high-speed Thunderbolt connections."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Elastic File System",
+ "contributor": "",
+ "description": "Documentation updates for Elastic File System"
+ },
+ {
+ "type": "feature",
+ "category": "Amazon GuardDuty",
+ "contributor": "",
+ "description": "Add `EKS_CLUSTER_NAME` to filter and sort key."
+ },
+ {
+ "type": "feature",
+ "category": "Braket",
+ "contributor": "",
+ "description": "This release adds support to view the device queue depth (the number of queued quantum tasks and hybrid jobs on a device) and queue position for a quantum task and hybrid job."
+ },
+ {
+ "type": "feature",
+ "category": "DynamoDB Enhanced Client",
+ "contributor": "",
+ "description": "Adds count, scanned count and returned consumed capacity to Page, used by Scan and Query operations"
+ },
+ {
+ "type": "feature",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Updated endpoint and partition metadata."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.changes/2.20.154.json b/.changes/2.20.154.json
new file mode 100644
index 000000000000..5b17b6b036bd
--- /dev/null
+++ b/.changes/2.20.154.json
@@ -0,0 +1,60 @@
+{
+ "version": "2.20.154",
+ "date": "2023-09-25",
+ "entries": [
+ {
+ "type": "bugfix",
+ "category": "S3TransferManager",
+ "contributor": "graebm",
+ "description": "Fix [aws-crt-java issue [#686](https://github.com/aws/aws-sdk-java-v2/issues/686)](https://github.com/awslabs/aws-crt-java/issues/686) S3AsyncClient ignoring trustAllCertificatesEnabled setting"
+ },
+ {
+ "type": "feature",
+ "category": "AWS Amplify UI Builder",
+ "contributor": "",
+ "description": "Support for generating code that is compatible with future versions of amplify project dependencies."
+ },
+ {
+ "type": "feature",
+ "category": "AWS WAFV2",
+ "contributor": "",
+ "description": "You can now perform an exact match against the web request's JA3 fingerprint."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Chime SDK Media Pipelines",
+ "contributor": "",
+ "description": "Adds support for sending WebRTC audio to Amazon Kineses Video Streams."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon QuickSight",
+ "contributor": "",
+ "description": "Added ability to tag users upon creation."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Simple Systems Manager (SSM)",
+ "contributor": "",
+ "description": "This release updates the enum values for ResourceType in SSM DescribeInstanceInformation input and ConnectionStatus in GetConnectionStatus output."
+ },
+ {
+ "type": "feature",
+ "category": "EMR Serverless",
+ "contributor": "",
+ "description": "This release adds support for application-wide default job configurations."
+ },
+ {
+ "type": "feature",
+ "category": "FinSpace Public API",
+ "contributor": "",
+ "description": "Adding sensitive trait to attributes. Change max SessionDuration from 720 to 60. Correct \"ApiAccess\" attribute to \"apiAccess\" to maintain consistency between APIs."
+ },
+ {
+ "type": "feature",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Updated endpoint and partition metadata."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.changes/2.20.155.json b/.changes/2.20.155.json
new file mode 100644
index 000000000000..6c5830b8cd07
--- /dev/null
+++ b/.changes/2.20.155.json
@@ -0,0 +1,66 @@
+{
+ "version": "2.20.155",
+ "date": "2023-09-26",
+ "entries": [
+ {
+ "type": "bugfix",
+ "category": "Amazon DynamoDB Enhanced Client",
+ "contributor": "swar8080",
+ "description": "Provides a clearer exception message when building a ReadBatch or WriteBatch without setting the mappedTableResource (table)"
+ },
+ {
+ "type": "feature",
+ "category": "AWS App Runner",
+ "contributor": "",
+ "description": "This release allows an App Runner customer to specify a custom source directory to run the build & start command. This change allows App Runner to support monorepo based repositories"
+ },
+ {
+ "type": "feature",
+ "category": "AWS CodeDeploy",
+ "contributor": "",
+ "description": "CodeDeploy now supports In-place and Blue/Green EC2 deployments with multiple Classic Load Balancers and multiple Target Groups."
+ },
+ {
+ "type": "feature",
+ "category": "AWS Lake Formation",
+ "contributor": "",
+ "description": "This release adds three new API support \"CreateLakeFormationOptIn\", \"DeleteLakeFormationOptIn\" and \"ListLakeFormationOptIns\", and also updates the corresponding documentation."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon AppIntegrations Service",
+ "contributor": "",
+ "description": "The Amazon AppIntegrations service adds a set of APIs (in preview) to manage third party applications to be used in Amazon Connect agent workspace."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Connect Service",
+ "contributor": "",
+ "description": "This release updates a set of Amazon Connect APIs that provides the ability to integrate third party applications in the Amazon Connect agent workspace."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon DynamoDB",
+ "contributor": "",
+ "description": "Amazon DynamoDB now supports Incremental Export as an enhancement to the existing Export Table"
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Elastic Compute Cloud",
+ "contributor": "",
+ "description": "The release includes AWS verified access to support FIPs compliance in North America regions"
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Pinpoint",
+ "contributor": "",
+ "description": "Update documentation for RemoveAttributes to more accurately reflect its behavior when attributes are deleted."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Simple Storage Service",
+ "contributor": "",
+ "description": "This release adds a new field COMPLETED to the ReplicationStatus Enum. You can now use this field to validate the replication status of S3 objects using the AWS SDK."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.changes/2.20.156.json b/.changes/2.20.156.json
new file mode 100644
index 000000000000..60b75aaf6ff7
--- /dev/null
+++ b/.changes/2.20.156.json
@@ -0,0 +1,36 @@
+{
+ "version": "2.20.156",
+ "date": "2023-09-27",
+ "entries": [
+ {
+ "type": "feature",
+ "category": "AWS IoT",
+ "contributor": "",
+ "description": "Added support for IoT Rules Engine Kafka Action Headers"
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Cognito Identity Provider",
+ "contributor": "",
+ "description": "The UserPoolType Status field is no longer used."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Kinesis Firehose",
+ "contributor": "",
+ "description": "Features : Adding support for new data ingestion source to Kinesis Firehose - AWS Managed Services Kafka."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Textract",
+ "contributor": "",
+ "description": "This release adds new feature - Layout to Analyze Document API which can automatically extract layout elements such as titles, paragraphs, headers, section headers, lists, page numbers, footers, table areas, key-value areas and figure areas and order the elements as a human would read."
+ },
+ {
+ "type": "feature",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Updated endpoint and partition metadata."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.changes/2.20.157.json b/.changes/2.20.157.json
new file mode 100644
index 000000000000..45de906e9733
--- /dev/null
+++ b/.changes/2.20.157.json
@@ -0,0 +1,60 @@
+{
+ "version": "2.20.157",
+ "date": "2023-09-28",
+ "entries": [
+ {
+ "type": "feature",
+ "category": "AWS Budgets",
+ "contributor": "",
+ "description": "Update DescribeBudgets and DescribeBudgetNotificationsForAccount MaxResults limit to 1000."
+ },
+ {
+ "type": "feature",
+ "category": "AWS IoT FleetWise",
+ "contributor": "",
+ "description": "AWS IoT FleetWise now supports encryption through a customer managed AWS KMS key. The PutEncryptionConfiguration and GetEncryptionConfiguration APIs were added."
+ },
+ {
+ "type": "feature",
+ "category": "AWS WAFV2",
+ "contributor": "",
+ "description": "Correct and improve the documentation for the FieldToMatch option JA3 fingerprint."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Bedrock",
+ "contributor": "",
+ "description": "Model Invocation logging added to enable or disable logs in customer account. Model listing and description support added. Provisioned Throughput feature added. Custom model support added for creating custom models. Also includes list, and delete functions for custom model."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Bedrock Runtime",
+ "contributor": "",
+ "description": "Run Inference: Added support to run the inference on models. Includes set of APIs for running inference in streaming and non-streaming mode."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Elastic Compute Cloud",
+ "contributor": "",
+ "description": "Adds support for Customer Managed Key encryption for Amazon Verified Access resources"
+ },
+ {
+ "type": "feature",
+ "category": "Amazon SageMaker Feature Store Runtime",
+ "contributor": "",
+ "description": "Feature Store supports read/write of records with collection type features."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon SageMaker Service",
+ "contributor": "",
+ "description": "Online store feature groups supports Standard and InMemory tier storage types for low latency storage for real-time data retrieval. The InMemory tier supports collection types List, Set, and Vector."
+ },
+ {
+ "type": "feature",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Updated endpoint and partition metadata."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.changes/2.20.158.json b/.changes/2.20.158.json
new file mode 100644
index 000000000000..6bd07ea00f4d
--- /dev/null
+++ b/.changes/2.20.158.json
@@ -0,0 +1,60 @@
+{
+ "version": "2.20.158",
+ "date": "2023-10-02",
+ "entries": [
+ {
+ "type": "feature",
+ "category": "AWS Security Token Service",
+ "contributor": "",
+ "description": "STS API updates for assumeRole"
+ },
+ {
+ "type": "feature",
+ "category": "AWS Single Sign-On",
+ "contributor": "",
+ "description": "Fix FIPS Endpoints in aws-us-gov."
+ },
+ {
+ "type": "feature",
+ "category": "AWS Transfer Family",
+ "contributor": "",
+ "description": "Documentation updates for AWS Transfer Family"
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Bedrock",
+ "contributor": "",
+ "description": "Provisioned throughput feature with Amazon and third-party base models, and update validators for model identifier and taggable resource ARNs."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Bedrock Runtime",
+ "contributor": "",
+ "description": "Add model timeout exception for InvokeModelWithResponseStream API and update validator for invoke model identifier."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Elastic Compute Cloud",
+ "contributor": "",
+ "description": "Introducing Amazon EC2 R7iz instances with 3.9 GHz sustained all-core turbo frequency and deliver up to 20% better performance than previous generation z1d instances."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Managed Blockchain",
+ "contributor": "",
+ "description": "Remove Rinkeby as option from Ethereum APIs"
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Relational Database Service",
+ "contributor": "",
+ "description": "Adds DefaultCertificateForNewLaunches field in the DescribeCertificates API response."
+ },
+ {
+ "type": "feature",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Updated endpoint and partition metadata."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.changes/2.20.159.json b/.changes/2.20.159.json
new file mode 100644
index 000000000000..9b52039e8e01
--- /dev/null
+++ b/.changes/2.20.159.json
@@ -0,0 +1,48 @@
+{
+ "version": "2.20.159",
+ "date": "2023-10-03",
+ "entries": [
+ {
+ "type": "feature",
+ "category": "AWS Elemental MediaConvert",
+ "contributor": "",
+ "description": "This release adds the ability to replace video frames without modifying the audio essence."
+ },
+ {
+ "type": "feature",
+ "category": "AWS Well-Architected Tool",
+ "contributor": "",
+ "description": "AWS Well-Architected now supports Review Templates that allows you to create templates with pre-filled answers for Well-Architected and Custom Lens best practices."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Connect Service",
+ "contributor": "",
+ "description": "GetMetricDataV2 API: Update to include new metrics CONTACTS_RESOLVED_IN_X , AVG_HOLD_TIME_ALL_CONTACTS , AVG_RESOLUTION_TIME , ABANDONMENT_RATE , AGENT_NON_RESPONSE_WITHOUT_CUSTOMER_ABANDONS with added features: Interval Period, TimeZone, Negate MetricFilters, Extended date time range."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Location Service",
+ "contributor": "",
+ "description": "Amazon Location Service adds support for bounding polygon queries. Additionally, the GeofenceCount field has been added to the DescribeGeofenceCollection API response."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon SageMaker Service",
+ "contributor": "",
+ "description": "This release allows users to run Selective Execution in SageMaker Pipelines without SourcePipelineExecutionArn if selected steps do not have any dependent steps."
+ },
+ {
+ "type": "feature",
+ "category": "CloudWatch Observability Access Manager",
+ "contributor": "",
+ "description": "This release adds support for sharing AWS::ApplicationInsights::Application resources."
+ },
+ {
+ "type": "feature",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Updated endpoint and partition metadata."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.changes/2.20.160.json b/.changes/2.20.160.json
new file mode 100644
index 000000000000..2d319ee802f4
--- /dev/null
+++ b/.changes/2.20.160.json
@@ -0,0 +1,48 @@
+{
+ "version": "2.20.160",
+ "date": "2023-10-04",
+ "entries": [
+ {
+ "type": "feature",
+ "category": "AWS MediaTailor",
+ "contributor": "",
+ "description": "Updates DescribeVodSource to include a list of ad break opportunities in the response"
+ },
+ {
+ "type": "feature",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Add support for building JDK 21."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon AppConfig",
+ "contributor": "",
+ "description": "AWS AppConfig introduces KMS customer-managed key (CMK) encryption support for data saved to AppConfig's hosted configuration store."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon DataZone",
+ "contributor": "",
+ "description": "Initial release of Amazon DataZone"
+ },
+ {
+ "type": "feature",
+ "category": "Amazon SageMaker Service",
+ "contributor": "",
+ "description": "Adding support for AdditionalS3DataSource, a data source used for training or inference that is in addition to the input dataset or model data."
+ },
+ {
+ "type": "feature",
+ "category": "Application Migration Service",
+ "contributor": "",
+ "description": "This release includes the following new APIs: ListConnectors, CreateConnector, UpdateConnector, DeleteConnector and UpdateSourceServer to support the source action framework feature."
+ },
+ {
+ "type": "feature",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Updated endpoint and partition metadata."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.changes/2.20.161.json b/.changes/2.20.161.json
new file mode 100644
index 000000000000..5923320021c2
--- /dev/null
+++ b/.changes/2.20.161.json
@@ -0,0 +1,48 @@
+{
+ "version": "2.20.161",
+ "date": "2023-10-05",
+ "entries": [
+ {
+ "type": "feature",
+ "category": "AWS SecurityHub",
+ "contributor": "",
+ "description": "Added new resource detail objects to ASFF, including resources for AwsEventsEventbus, AwsEventsEndpoint, AwsDmsEndpoint, AwsDmsReplicationTask, AwsDmsReplicationInstance, AwsRoute53HostedZone, and AwsMskCluster"
+ },
+ {
+ "type": "feature",
+ "category": "AWS Storage Gateway",
+ "contributor": "",
+ "description": "Add SoftwareVersion to response of DescribeGatewayInformation."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Omics",
+ "contributor": "",
+ "description": "Add Etag Support for Omics Storage in ListReadSets and GetReadSetMetadata API"
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Relational Database Service",
+ "contributor": "",
+ "description": "Updates Amazon RDS documentation for corrections and minor improvements."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Route 53",
+ "contributor": "",
+ "description": "Add hostedzonetype filter to ListHostedZones API."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon WorkSpaces",
+ "contributor": "",
+ "description": "This release introduces Manage applications. This feature allows users to manage their WorkSpaces applications by associating or disassociating their WorkSpaces with applications. The DescribeWorkspaces API will now additionally return OperatingSystemName in its responses."
+ },
+ {
+ "type": "feature",
+ "category": "AWS SDK for Java v2",
+ "contributor": "",
+ "description": "Updated endpoint and partition metadata."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.changes/2.20.162.json b/.changes/2.20.162.json
new file mode 100644
index 000000000000..24128eee8994
--- /dev/null
+++ b/.changes/2.20.162.json
@@ -0,0 +1,36 @@
+{
+ "version": "2.20.162",
+ "date": "2023-10-06",
+ "entries": [
+ {
+ "type": "feature",
+ "category": "AWS Marketplace Catalog Service",
+ "contributor": "",
+ "description": "This release adds support for Document type as an alternative for stringified JSON for StartChangeSet, DescribeChangeSet and DescribeEntity APIs"
+ },
+ {
+ "type": "feature",
+ "category": "AWS Transfer Family",
+ "contributor": "",
+ "description": "This release updates the max character limit of PreAuthenticationLoginBanner and PostAuthenticationLoginBanner to 4096 characters"
+ },
+ {
+ "type": "feature",
+ "category": "Amazon Elastic Compute Cloud",
+ "contributor": "",
+ "description": "Documentation updates for Elastic Compute Cloud (EC2)."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon FSx",
+ "contributor": "",
+ "description": "After performing steps to repair the Active Directory configuration of a file system, use this action to initiate the process of attempting to recover to the file system."
+ },
+ {
+ "type": "feature",
+ "category": "Amazon QuickSight",
+ "contributor": "",
+ "description": "NullOption in FilterListConfiguration; Dataset schema/table max length increased; Support total placement for pivot table visual; Lenient mode relaxes the validation to create resources with definition; Data sources can be added to folders; Redshift data sources support IAM Role-based authentication"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.github/workflows/codebuild-ci.yml b/.github/workflows/codebuild-ci.yml
index 4cb3e578bf6d..fbe36b781a4c 100644
--- a/.github/workflows/codebuild-ci.yml
+++ b/.github/workflows/codebuild-ci.yml
@@ -59,6 +59,20 @@ jobs:
timeout-minutes: 120
with:
project-name: aws-sdk-java-v2-JDK17
+ jdk21-build:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Configure AWS Credentials
+ uses: aws-actions/configure-aws-credentials@v1
+ with:
+ role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
+ aws-region: us-west-2
+ role-duration-seconds: 7200
+ - name: Run JDK21 build
+ uses: aws-actions/aws-codebuild-run-build@v1
+ timeout-minutes: 120
+ with:
+ project-name: aws-java-sdk-v2-JDK21
windows-jdk8-build:
runs-on: ubuntu-latest
steps:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 222bad8f5c6e..8480a9aca694 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,588 @@
+# __2.20.162__ __2023-10-06__
+## __AWS Marketplace Catalog Service__
+ - ### Features
+ - This release adds support for Document type as an alternative for stringified JSON for StartChangeSet, DescribeChangeSet and DescribeEntity APIs
+
+## __AWS Transfer Family__
+ - ### Features
+ - This release updates the max character limit of PreAuthenticationLoginBanner and PostAuthenticationLoginBanner to 4096 characters
+
+## __Amazon Elastic Compute Cloud__
+ - ### Features
+ - Documentation updates for Elastic Compute Cloud (EC2).
+
+## __Amazon FSx__
+ - ### Features
+ - After performing steps to repair the Active Directory configuration of a file system, use this action to initiate the process of attempting to recover to the file system.
+
+## __Amazon QuickSight__
+ - ### Features
+ - NullOption in FilterListConfiguration; Dataset schema/table max length increased; Support total placement for pivot table visual; Lenient mode relaxes the validation to create resources with definition; Data sources can be added to folders; Redshift data sources support IAM Role-based authentication
+
+# __2.20.161__ __2023-10-05__
+## __AWS SDK for Java v2__
+ - ### Features
+ - Updated endpoint and partition metadata.
+
+## __AWS SecurityHub__
+ - ### Features
+ - Added new resource detail objects to ASFF, including resources for AwsEventsEventbus, AwsEventsEndpoint, AwsDmsEndpoint, AwsDmsReplicationTask, AwsDmsReplicationInstance, AwsRoute53HostedZone, and AwsMskCluster
+
+## __AWS Storage Gateway__
+ - ### Features
+ - Add SoftwareVersion to response of DescribeGatewayInformation.
+
+## __Amazon Omics__
+ - ### Features
+ - Add Etag Support for Omics Storage in ListReadSets and GetReadSetMetadata API
+
+## __Amazon Relational Database Service__
+ - ### Features
+ - Updates Amazon RDS documentation for corrections and minor improvements.
+
+## __Amazon Route 53__
+ - ### Features
+ - Add hostedzonetype filter to ListHostedZones API.
+
+## __Amazon WorkSpaces__
+ - ### Features
+ - This release introduces Manage applications. This feature allows users to manage their WorkSpaces applications by associating or disassociating their WorkSpaces with applications. The DescribeWorkspaces API will now additionally return OperatingSystemName in its responses.
+
+# __2.20.160__ __2023-10-04__
+## __AWS MediaTailor__
+ - ### Features
+ - Updates DescribeVodSource to include a list of ad break opportunities in the response
+
+## __AWS SDK for Java v2__
+ - ### Features
+ - Add support for building JDK 21.
+ - Updated endpoint and partition metadata.
+
+## __Amazon AppConfig__
+ - ### Features
+ - AWS AppConfig introduces KMS customer-managed key (CMK) encryption support for data saved to AppConfig's hosted configuration store.
+
+## __Amazon DataZone__
+ - ### Features
+ - Initial release of Amazon DataZone
+
+## __Amazon SageMaker Service__
+ - ### Features
+ - Adding support for AdditionalS3DataSource, a data source used for training or inference that is in addition to the input dataset or model data.
+
+## __Application Migration Service__
+ - ### Features
+ - This release includes the following new APIs: ListConnectors, CreateConnector, UpdateConnector, DeleteConnector and UpdateSourceServer to support the source action framework feature.
+
+# __2.20.159__ __2023-10-03__
+## __AWS Elemental MediaConvert__
+ - ### Features
+ - This release adds the ability to replace video frames without modifying the audio essence.
+
+## __AWS SDK for Java v2__
+ - ### Features
+ - Updated endpoint and partition metadata.
+
+## __AWS Well-Architected Tool__
+ - ### Features
+ - AWS Well-Architected now supports Review Templates that allows you to create templates with pre-filled answers for Well-Architected and Custom Lens best practices.
+
+## __Amazon Connect Service__
+ - ### Features
+ - GetMetricDataV2 API: Update to include new metrics CONTACTS_RESOLVED_IN_X , AVG_HOLD_TIME_ALL_CONTACTS , AVG_RESOLUTION_TIME , ABANDONMENT_RATE , AGENT_NON_RESPONSE_WITHOUT_CUSTOMER_ABANDONS with added features: Interval Period, TimeZone, Negate MetricFilters, Extended date time range.
+
+## __Amazon Location Service__
+ - ### Features
+ - Amazon Location Service adds support for bounding polygon queries. Additionally, the GeofenceCount field has been added to the DescribeGeofenceCollection API response.
+
+## __Amazon SageMaker Service__
+ - ### Features
+ - This release allows users to run Selective Execution in SageMaker Pipelines without SourcePipelineExecutionArn if selected steps do not have any dependent steps.
+
+## __CloudWatch Observability Access Manager__
+ - ### Features
+ - This release adds support for sharing AWS::ApplicationInsights::Application resources.
+
+# __2.20.158__ __2023-10-02__
+## __AWS SDK for Java v2__
+ - ### Features
+ - Updated endpoint and partition metadata.
+
+## __AWS Security Token Service__
+ - ### Features
+ - STS API updates for assumeRole
+
+## __AWS Single Sign-On__
+ - ### Features
+ - Fix FIPS Endpoints in aws-us-gov.
+
+## __AWS Transfer Family__
+ - ### Features
+ - Documentation updates for AWS Transfer Family
+
+## __Amazon Bedrock__
+ - ### Features
+ - Provisioned throughput feature with Amazon and third-party base models, and update validators for model identifier and taggable resource ARNs.
+
+## __Amazon Bedrock Runtime__
+ - ### Features
+ - Add model timeout exception for InvokeModelWithResponseStream API and update validator for invoke model identifier.
+
+## __Amazon Elastic Compute Cloud__
+ - ### Features
+ - Introducing Amazon EC2 R7iz instances with 3.9 GHz sustained all-core turbo frequency and deliver up to 20% better performance than previous generation z1d instances.
+
+## __Amazon Managed Blockchain__
+ - ### Features
+ - Remove Rinkeby as option from Ethereum APIs
+
+## __Amazon Relational Database Service__
+ - ### Features
+ - Adds DefaultCertificateForNewLaunches field in the DescribeCertificates API response.
+
+# __2.20.157__ __2023-09-28__
+## __AWS Budgets__
+ - ### Features
+ - Update DescribeBudgets and DescribeBudgetNotificationsForAccount MaxResults limit to 1000.
+
+## __AWS IoT FleetWise__
+ - ### Features
+ - AWS IoT FleetWise now supports encryption through a customer managed AWS KMS key. The PutEncryptionConfiguration and GetEncryptionConfiguration APIs were added.
+
+## __AWS SDK for Java v2__
+ - ### Features
+ - Updated endpoint and partition metadata.
+
+## __AWS WAFV2__
+ - ### Features
+ - Correct and improve the documentation for the FieldToMatch option JA3 fingerprint.
+
+## __Amazon Bedrock__
+ - ### Features
+ - Model Invocation logging added to enable or disable logs in customer account. Model listing and description support added. Provisioned Throughput feature added. Custom model support added for creating custom models. Also includes list, and delete functions for custom model.
+
+## __Amazon Bedrock Runtime__
+ - ### Features
+ - Run Inference: Added support to run the inference on models. Includes set of APIs for running inference in streaming and non-streaming mode.
+
+## __Amazon Elastic Compute Cloud__
+ - ### Features
+ - Adds support for Customer Managed Key encryption for Amazon Verified Access resources
+
+## __Amazon SageMaker Feature Store Runtime__
+ - ### Features
+ - Feature Store supports read/write of records with collection type features.
+
+## __Amazon SageMaker Service__
+ - ### Features
+ - Online store feature groups supports Standard and InMemory tier storage types for low latency storage for real-time data retrieval. The InMemory tier supports collection types List, Set, and Vector.
+
+# __2.20.156__ __2023-09-27__
+## __AWS IoT__
+ - ### Features
+ - Added support for IoT Rules Engine Kafka Action Headers
+
+## __AWS SDK for Java v2__
+ - ### Features
+ - Updated endpoint and partition metadata.
+
+## __Amazon Cognito Identity Provider__
+ - ### Features
+ - The UserPoolType Status field is no longer used.
+
+## __Amazon Kinesis Firehose__
+ - ### Features
+ - Features : Adding support for new data ingestion source to Kinesis Firehose - AWS Managed Services Kafka.
+
+## __Amazon Textract__
+ - ### Features
+ - This release adds new feature - Layout to Analyze Document API which can automatically extract layout elements such as titles, paragraphs, headers, section headers, lists, page numbers, footers, table areas, key-value areas and figure areas and order the elements as a human would read.
+
+# __2.20.155__ __2023-09-26__
+## __AWS App Runner__
+ - ### Features
+ - This release allows an App Runner customer to specify a custom source directory to run the build & start command. This change allows App Runner to support monorepo based repositories
+
+## __AWS CodeDeploy__
+ - ### Features
+ - CodeDeploy now supports In-place and Blue/Green EC2 deployments with multiple Classic Load Balancers and multiple Target Groups.
+
+## __AWS Lake Formation__
+ - ### Features
+ - This release adds three new API support "CreateLakeFormationOptIn", "DeleteLakeFormationOptIn" and "ListLakeFormationOptIns", and also updates the corresponding documentation.
+
+## __Amazon AppIntegrations Service__
+ - ### Features
+ - The Amazon AppIntegrations service adds a set of APIs (in preview) to manage third party applications to be used in Amazon Connect agent workspace.
+
+## __Amazon Connect Service__
+ - ### Features
+ - This release updates a set of Amazon Connect APIs that provides the ability to integrate third party applications in the Amazon Connect agent workspace.
+
+## __Amazon DynamoDB__
+ - ### Features
+ - Amazon DynamoDB now supports Incremental Export as an enhancement to the existing Export Table
+
+## __Amazon DynamoDB Enhanced Client__
+ - ### Bugfixes
+ - Provides a clearer exception message when building a ReadBatch or WriteBatch without setting the mappedTableResource (table)
+ - Contributed by: [@swar8080](https://github.com/swar8080)
+
+## __Amazon Elastic Compute Cloud__
+ - ### Features
+ - The release includes AWS verified access to support FIPs compliance in North America regions
+
+## __Amazon Pinpoint__
+ - ### Features
+ - Update documentation for RemoveAttributes to more accurately reflect its behavior when attributes are deleted.
+
+## __Amazon Simple Storage Service__
+ - ### Features
+ - This release adds a new field COMPLETED to the ReplicationStatus Enum. You can now use this field to validate the replication status of S3 objects using the AWS SDK.
+
+## __Contributors__
+Special thanks to the following contributors to this release:
+
+[@swar8080](https://github.com/swar8080)
+# __2.20.154__ __2023-09-25__
+## __AWS Amplify UI Builder__
+ - ### Features
+ - Support for generating code that is compatible with future versions of amplify project dependencies.
+
+## __AWS SDK for Java v2__
+ - ### Features
+ - Updated endpoint and partition metadata.
+
+## __AWS WAFV2__
+ - ### Features
+ - You can now perform an exact match against the web request's JA3 fingerprint.
+
+## __Amazon Chime SDK Media Pipelines__
+ - ### Features
+ - Adds support for sending WebRTC audio to Amazon Kineses Video Streams.
+
+## __Amazon QuickSight__
+ - ### Features
+ - Added ability to tag users upon creation.
+
+## __Amazon Simple Systems Manager (SSM)__
+ - ### Features
+ - This release updates the enum values for ResourceType in SSM DescribeInstanceInformation input and ConnectionStatus in GetConnectionStatus output.
+
+## __EMR Serverless__
+ - ### Features
+ - This release adds support for application-wide default job configurations.
+
+## __FinSpace Public API__
+ - ### Features
+ - Adding sensitive trait to attributes. Change max SessionDuration from 720 to 60. Correct "ApiAccess" attribute to "apiAccess" to maintain consistency between APIs.
+
+## __S3TransferManager__
+ - ### Bugfixes
+ - Fix [aws-crt-java issue [#686](https://github.com/aws/aws-sdk-java-v2/issues/686)](https://github.com/awslabs/aws-crt-java/issues/686) S3AsyncClient ignoring trustAllCertificatesEnabled setting
+ - Contributed by: [@graebm](https://github.com/graebm)
+
+## __Contributors__
+Special thanks to the following contributors to this release:
+
+[@graebm](https://github.com/graebm)
+# __2.20.153__ __2023-09-22__
+## __AWS Database Migration Service__
+ - ### Features
+ - new vendors for DMS CSF: MongoDB, MariaDB, DocumentDb and Redshift
+
+## __AWS Elemental MediaConvert__
+ - ### Features
+ - This release supports the creation of of audio-only tracks in CMAF output groups.
+
+## __AWS SDK for Java v2__
+ - ### Features
+ - Adds support for non-Json String payloads
+ - Updated endpoint and partition metadata.
+
+ - ### Bugfixes
+ - Fixed an issue in `InputStreamSubscriber` that could cause NPE to be thrown when close and onSubscribed get invoked concurrently. See [#4081](https://github.com/aws/aws-sdk-java-v2/issues/4081)
+
+## __Amazon CloudWatch Events__
+ - ### Features
+ - Adds sensitive trait to various shapes in Jetstream Connections API model.
+
+## __Amazon DynamoDB__
+ - ### Bugfixes
+ - Fixed a bug in DynamoDbTable.createTable, where global secondary indices with a partition key matching the default partition key of the table would be created as local secondary indices.
+
+## __Amazon Elastic Compute Cloud__
+ - ### Features
+ - EC2 M2 Pro Mac instances are powered by Apple M2 Pro Mac Mini computers featuring 12 core CPU, 19 core GPU, 32 GiB of memory, and 16 core Apple Neural Engine and uniquely enabled by the AWS Nitro System through high-speed Thunderbolt connections.
+
+## __Amazon Elastic File System__
+ - ### Features
+ - Documentation updates for Elastic File System
+
+## __Amazon GuardDuty__
+ - ### Features
+ - Add `EKS_CLUSTER_NAME` to filter and sort key.
+
+## __Amazon S3__
+ - ### Bugfixes
+ - Fixed the issue where SdkException is unnecessarily re-wrapped with SdkClientException in S3 multipart client and AWS CRT-based S3 client. See[#4356](https://github.com/aws/aws-sdk-java-v2/issues/4356)
+
+## __Amazon Simple Storage Servic__
+ - ### Bugfixes
+ - Fix for Cross-region calls failure due to AuthorizationHeaderMalformed errors while using clients with configured region as us-east-1.
+
+## __Braket__
+ - ### Features
+ - This release adds support to view the device queue depth (the number of queued quantum tasks and hybrid jobs on a device) and queue position for a quantum task and hybrid job.
+
+## __DynamoDB Enhanced Client__
+ - ### Features
+ - Adds count, scanned count and returned consumed capacity to Page, used by Scan and Query operations
+
+# __2.20.152__ __2023-09-20__
+## __AWS App Runner__
+ - ### Features
+ - This release adds improvements for managing App Runner auto scaling configuration resources. New APIs: UpdateDefaultAutoScalingConfiguration and ListServicesForAutoScalingConfiguration. Updated API: DeleteAutoScalingConfiguration.
+
+## __AWS Cloud Map__
+ - ### Features
+ - Adds a new DiscoverInstancesRevision API and also adds InstanceRevision field to the DiscoverInstances API response.
+
+## __AWS Lambda__
+ - ### Features
+ - Update aws-lambda-java-core version to 1.2.3
+ - Contributed by: [@deki](https://github.com/deki)
+
+## __AWS SDK for Java v2__
+ - ### Features
+ - Updated endpoint and partition metadata.
+
+## __AWS SSO OIDC__
+ - ### Features
+ - Update FIPS endpoints in aws-us-gov.
+
+## __Amazon AppConfig__
+ - ### Features
+ - Enabling boto3 paginators for list APIs and adding documentation around ServiceQuotaExceededException errors
+
+## __Amazon CloudWatch Logs__
+ - ### Features
+ - Add ClientToken to QueryDefinition CFN Handler in CWL
+
+## __Amazon Kinesis Video Streams__
+ - ### Features
+ - Updated DescribeMediaStorageConfiguration, StartEdgeConfigurationUpdate, ImageGenerationConfiguration$SamplingInterval, and UpdateMediaStorageConfiguration to match AWS Docs.
+
+## __Amazon Simple Storage Service__
+ - ### Features
+ - Fix an issue where the SDK can fail to unmarshall response due to NumberFormatException
+
+## __CodeArtifact__
+ - ### Features
+ - Add support for the Swift package format.
+
+## __S3 Transfer Manager__
+ - ### Bugfixes
+ - Fix [3839](https://github.com/aws/aws-sdk-java-v2/issues/3839) S3 Transfer Manager issue with transferComplete() not called for AsyncRequestBody.fromFile()
+
+## __Contributors__
+Special thanks to the following contributors to this release:
+
+[@deki](https://github.com/deki)
+# __2.20.151__ __2023-09-19__
+## __AWS Outposts__
+ - ### Features
+ - This release adds the InstanceFamilies field to the ListAssets response.
+
+## __AWS SDK for Java v2__
+ - ### Features
+ - Updated endpoint and partition metadata.
+
+## __Amazon Elastic Compute Cloud__
+ - ### Features
+ - This release adds support for C7i, and R7a instance types.
+
+## __Amazon SageMaker Service__
+ - ### Features
+ - This release adds support for one-time model monitoring schedules that are executed immediately without delay, explicit data analysis windows for model monitoring schedules and exclude features attributes to remove features from model monitor analysis.
+
+# __2.20.150__ __2023-09-18__
+## __AWS Application Discovery Service__
+ - ### Features
+ - Add sensitive protection for customer information
+
+## __AWS SDK for Java v2__
+ - ### Bugfixes
+ - Do not instruct the CRT Sigv4a signer to do path normalization to avoid signature mismatch errors
+
+## __Amazon Macie 2__
+ - ### Features
+ - This release changes the default managedDataIdentifierSelector setting for new classification jobs to RECOMMENDED. By default, new classification jobs now use the recommended set of managed data identifiers.
+
+## __Amazon WorkMail__
+ - ### Features
+ - This release includes four new APIs UpdateUser, UpdateGroup, ListGroupsForEntity and DescribeEntity, along with RemoteUsers and some enhancements to existing APIs.
+
+# __2.20.149__ __2023-09-15__
+## __AWS DataSync__
+ - ### Features
+ - Documentation-only updates for AWS DataSync.
+
+## __AWS SDK for Java v2__
+ - ### Features
+ - Updated endpoint and partition metadata.
+
+## __Amazon AppStream__
+ - ### Features
+ - This release introduces app block builder, allowing customers to provision a resource to package applications into an app block
+
+## __Amazon Connect Service__
+ - ### Features
+ - New rule type (OnMetricDataUpdate) has been added
+
+## __Amazon SageMaker Service__
+ - ### Features
+ - This release introduces Skip Model Validation for Model Packages
+
+# __2.20.148__ __2023-09-14__
+## __AWS CloudFormation__
+ - ### Features
+ - Documentation updates for AWS CloudFormation
+
+## __AWS EntityResolution__
+ - ### Features
+ - Changed "ResolutionTechniques" and "MappedInputFields" in workflow and schema mapping operations to be required fields.
+
+## __AWS SDK for Java v2__
+ - ### Features
+ - Updated endpoint and partition metadata.
+
+## __Amazon AppStream__
+ - ### Features
+ - This release introduces multi-session fleets, allowing customers to provision more than one user session on a single fleet instance.
+
+## __Amazon Lookout for Equipment__
+ - ### Features
+ - This release adds APIs for the new scheduled retraining feature.
+
+# __2.20.147__ __2023-09-13__
+## __AWS Cloud9__
+ - ### Features
+ - Update to include information on Ubuntu 18 deprecation.
+
+## __AWS SDK for Java v2__
+ - ### Features
+ - Updated endpoint and partition metadata.
+
+ - ### Bugfixes
+ - Allow IamPolicy to read json policies where the principal value is itself an array
+ - Fix `InputStreamSubscriber` to return 0 when reading a length of 0.
+ - Contributed by: [@faucct](https://github.com/faucct)
+
+## __AWS SimSpace Weaver__
+ - ### Features
+ - Edited the introductory text for the API reference.
+
+## __AWS X-Ray__
+ - ### Features
+ - Add StartTime field in GetTraceSummaries API response for each TraceSummary.
+
+## __Amazon CloudWatch Internet Monitor__
+ - ### Features
+ - This release updates the Amazon CloudWatch Internet Monitor API domain name.
+
+## __Amazon DynamoDB Enhanced Client__
+ - ### Features
+ - This commit introduces returnConsumedCapacity input to BatchGetItemEnhancedRequest that allows customers to find out exactly how much read units were consumed by the operation.
+ - Contributed by: [@psnilesh](https://github.com/psnilesh)
+
+## __Amazon GuardDuty__
+ - ### Features
+ - Add `managementType` field to ListCoverage API response.
+
+## __Amazon Interactive Video Service RealTime__
+ - ### Features
+ - Doc only update that changes description for ParticipantToken.
+
+## __Amazon Kinesis Firehose__
+ - ### Features
+ - DocumentIdOptions has been added for the Amazon OpenSearch destination.
+
+## __Elastic Disaster Recovery Service__
+ - ### Features
+ - Updated existing APIs and added new ones to support using AWS Elastic Disaster Recovery post-launch actions. Added support for new regions.
+
+## __Contributors__
+Special thanks to the following contributors to this release:
+
+[@psnilesh](https://github.com/psnilesh), [@faucct](https://github.com/faucct)
+# __2.20.146__ __2023-09-12__
+## __AWS CRT-based S3 Client__
+ - ### Bugfixes
+ - Improved CRT client uploads by directly passing requestPath, eliminating unnecessary file I/O in the Java SDK Transfer Manager.
+
+## __AWS SDK for Java v2__
+ - ### Features
+ - Updated endpoint and partition metadata.
+
+## __AWSKendraFrontendService__
+ - ### Features
+ - Amazon Kendra now supports confidence score buckets for retrieved passage results using the Retrieve API.
+
+## __Amazon DynamoDB Enhanced Client__
+ - ### Features
+ - This commit introduces DynamoDbTable#getItemWithResponse() that allows customers to specify additional parameters on the request such as ReturnConsumedCapacity to get additional information the service response.
+ - Contributed by: [@psnilesh](https://github.com/psnilesh)
+
+## __Amazon Elastic Compute Cloud__
+ - ### Features
+ - This release adds support for restricting public sharing of AMIs through AMI Block Public Access
+
+## __Amazon EventBridge__
+ - ### Features
+ - Adds sensitive trait to various shapes in Jetstream Connections API model.
+
+## __Contributors__
+Special thanks to the following contributors to this release:
+
+[@psnilesh](https://github.com/psnilesh)
+# __2.20.145__ __2023-09-11__
+## __AWS Elemental MediaLive__
+ - ### Features
+ - AWS Elemental Link now supports attaching a Link UHD device to a MediaConnect flow.
+
+## __Amazon EC2 Container Registry__
+ - ### Features
+ - This release will have ValidationException be thrown from ECR LifecyclePolicy APIs in regions LifecyclePolicy is not supported, this includes existing Amazon Dedicated Cloud (ADC) regions. This release will also change Tag: TagValue and Tag: TagKey to required.
+
+## __Amazon QuickSight__
+ - ### Features
+ - This release launches new updates to QuickSight KPI visuals - support for sparklines, new templated layout and new targets for conditional formatting rules.
+
+# __2.20.144__ __2023-09-08__
+## __AWS SDK for Java v2__
+ - ### Features
+ - Updated endpoint and partition metadata.
+
+ - ### Bugfixes
+ - Fixed an issue in async client where the future would get stuck if there is a server error and the server fails to return response body that matches with the content length specified in the response header. See [#4354](https://github.com/aws/aws-sdk-java-v2/issues/4354)
+
+## __AWS Single Sign-On Admin__
+ - ### Features
+ - Content updates to IAM Identity Center API for China Regions.
+
+## __Amazon FSx__
+ - ### Features
+ - Amazon FSx documentation fixes
+
+## __Amazon SageMaker Service__
+ - ### Features
+ - Autopilot APIs will now support holiday featurization for Timeseries models. The models will now hold holiday metadata and should be able to accommodate holiday effect during inference.
+
+## __Amazon WorkSpaces__
+ - ### Features
+ - A new field "ErrorDetails" will be added to the output of "DescribeWorkspaceImages" API call. This field provides in-depth details about the error occurred during image import process. These details include the possible causes of the errors and troubleshooting information.
+
# __2.20.143__ __2023-09-07__
## __AWS SDK for Java v2__
- ### Features
diff --git a/README.md b/README.md
index 6550ff19b439..ff23ac79eb0e 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
[![Gitter](https://badges.gitter.im/aws/aws-sdk-java-v2.svg)](https://gitter.im/aws/aws-sdk-java-v2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![codecov](https://codecov.io/gh/aws/aws-sdk-java-v2/branch/master/graph/badge.svg)](https://codecov.io/gh/aws/aws-sdk-java-v2)
-[![All Contributors](https://img.shields.io/badge/all_contributors-96-orange.svg?style=flat-square)](#contributors-)
+[![All Contributors](https://img.shields.io/badge/all_contributors-98-orange.svg?style=flat-square)](#contributors-)
The **AWS SDK for Java 2.0** is a rewrite of 1.0 with some great new features. As with version 1.0,
@@ -52,7 +52,7 @@ To automatically manage module versions (currently all modules have the same ver
software.amazon.awssdkbom
- 2.20.143
+ 2.20.162pomimport
@@ -86,12 +86,12 @@ Alternatively you can add dependencies for the specific services you use only:
software.amazon.awssdkec2
- 2.20.143
+ 2.20.162software.amazon.awssdks3
- 2.20.143
+ 2.20.162
```
@@ -103,7 +103,7 @@ You can import the whole SDK into your project (includes *ALL* services). Please
software.amazon.awssdkaws-sdk-java
- 2.20.143
+ 2.20.162
```
@@ -150,7 +150,7 @@ For information about maintenance and support for SDK major versions and their u
## Maintenance and Support for Java Versions
-We maintain full support on Long-Term Support(LTS) releases: Java 8, Java 11, and Java 17.
+We maintain full support on Long-Term Support(LTS) releases: Java 8, Java 11, Java 17, and Java 21.
## Giving Feedback
We need your help in making this SDK great. Please participate in the community and contribute to this effort by submitting issues, participating in discussion forums and submitting pull requests through the following channels:
@@ -314,6 +314,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
+ *
+ * @param request A {@link GetItemEnhancedRequest} with key and optional directives for retrieving an item from the table.
+ * @return a {@link CompletableFuture} of the item that was persisted in the database before it was deleted.
+ */
+ default CompletableFuture> getItemWithResponse(GetItemEnhancedRequest request) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Retrieves a single item from the mapped table using a supplied primary {@link Key}. This is similar to
+ * {@link #getItem(Consumer)} but returns {@link GetItemEnhancedResponse} for
+ * additional information.
+ *
+ *
+ * The additional configuration parameters that the enhanced client supports are defined
+ * in the {@link GetItemEnhancedRequest}.
+ *
+ * This operation calls the low-level DynamoDB API GetItem operation. Consult the GetItem documentation for
+ * further details and constraints.
+ *
+ * Note: This is a convenience method that creates an instance of the request builder avoiding the need to create one
+ * manually via {@link GetItemEnhancedRequest#builder()}.
+ *
+ *
+ * @param requestConsumer A {@link Consumer} of {@link GetItemEnhancedRequest.Builder} with key and optional directives
+ * for retrieving an item from the table.
+ * @return a {@link CompletableFuture} of the retrieved item
+ */
+ default CompletableFuture> getItemWithResponse(
+ Consumer requestConsumer) {
+ throw new UnsupportedOperationException();
+ }
+
/**
* Executes a query against the primary index of the table using a {@link QueryConditional} expression to retrieve a list of
* items matching the given conditions.
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/DynamoDbEnhancedAsyncClient.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/DynamoDbEnhancedAsyncClient.java
index d198326a8853..0490fa56ac33 100644
--- a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/DynamoDbEnhancedAsyncClient.java
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/DynamoDbEnhancedAsyncClient.java
@@ -262,7 +262,7 @@ default CompletableFuture batchWriteItem(Consumer
* The additional configuration parameters that the enhanced client supports are defined
@@ -298,7 +298,7 @@ default CompletableFuture> transactGetItems(TransactGetItemsEnhan
/**
* Retrieves multiple items from one or more tables in a single atomic transaction. TransactGetItem is a composite operation
- * where the request contains a set of up to 25 get requests, each containing a table reference and a
+ * where the request contains a set of get requests, each containing a table reference and a
* {@link GetItemEnhancedRequest}.
*
* The additional configuration parameters that the enhanced client supports are defined
@@ -336,7 +336,7 @@ default CompletableFuture> transactGetItems(
/**
* Writes and/or modifies multiple items from one or more tables in a single atomic transaction. TransactGetItem is a
- * composite operation where the request contains a set of up to 25 action requests, each containing a table reference and
+ * composite operation where the request contains a set of action requests, each containing a table reference and
* one of the following requests:
*
*
Condition check of item - {@link ConditionCheck}
@@ -384,7 +384,7 @@ default CompletableFuture transactWriteItems(TransactWriteItemsEnhancedReq
/**
* Writes and/or modifies multiple items from one or more tables in a single atomic transaction. TransactGetItem is a
- * composite operation where the request contains a set of up to 25 action requests, each containing a table reference and
+ * composite operation where the request contains a set of action requests, each containing a table reference and
* one of the following requests:
*
*
Condition check of item - {@link ConditionCheck}
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/DynamoDbTable.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/DynamoDbTable.java
index 58af58493bee..6e94e6726c2f 100644
--- a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/DynamoDbTable.java
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/DynamoDbTable.java
@@ -24,6 +24,7 @@
import software.amazon.awssdk.enhanced.dynamodb.model.DeleteItemEnhancedResponse;
import software.amazon.awssdk.enhanced.dynamodb.model.DescribeTableEnhancedResponse;
import software.amazon.awssdk.enhanced.dynamodb.model.GetItemEnhancedRequest;
+import software.amazon.awssdk.enhanced.dynamodb.model.GetItemEnhancedResponse;
import software.amazon.awssdk.enhanced.dynamodb.model.Page;
import software.amazon.awssdk.enhanced.dynamodb.model.PageIterable;
import software.amazon.awssdk.enhanced.dynamodb.model.PutItemEnhancedRequest;
@@ -398,6 +399,64 @@ default T getItem(T keyItem) {
throw new UnsupportedOperationException();
}
+ /**
+ * Retrieves a single item from the mapped table using a supplied primary {@link Key}. This is similar to
+ * {@link #getItem(GetItemEnhancedRequest)} but returns {@link GetItemEnhancedResponse} for additional information.
+ *
+ *
+ * The additional configuration parameters that the enhanced client supports are defined
+ * in the {@link GetItemEnhancedRequest}.
+ *
+ * This operation calls the low-level DynamoDB API GetItem operation. Consult the GetItem documentation for
+ * further details and constraints.
+ *
+ *
+ * @param request A {@link GetItemEnhancedRequest} with key and optional directives for retrieving an item from the
+ * table.
+ * @return The retrieved item
+ */
+ default GetItemEnhancedResponse getItemWithResponse(GetItemEnhancedRequest request) {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Retrieves a single item from the mapped table using a supplied primary {@link Key}. This is similar to
+ * {@link #getItem(Consumer)} but returns {@link GetItemEnhancedResponse} for additional
+ * information.
+ *
+ *
+ * The additional configuration parameters that the enhanced client supports are defined
+ * in the {@link GetItemEnhancedRequest}.
+ *
+ * This operation calls the low-level DynamoDB API GetItem operation. Consult the GetItem documentation for
+ * further details and constraints.
+ *
+ * Note: This is a convenience method that creates an instance of the request builder avoiding the need to
+ * create one manually via {@link GetItemEnhancedRequest#builder()}.
+ *
+ *
+ * @param requestConsumer A {@link Consumer} of {@link GetItemEnhancedRequest.Builder} with key and optional
+ * directives for retrieving an item from the table.
+ * @return The retrieved item
+ */
+ default GetItemEnhancedResponse getItemWithResponse(Consumer requestConsumer) {
+ throw new UnsupportedOperationException();
+ }
+
/**
* Executes a query against the primary index of the table using a {@link QueryConditional} expression to retrieve a
* list of items matching the given conditions.
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/EnhancedClientUtils.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/EnhancedClientUtils.java
index 1036de6eb642..afd719d5a82a 100644
--- a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/EnhancedClientUtils.java
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/EnhancedClientUtils.java
@@ -33,6 +33,7 @@
import software.amazon.awssdk.enhanced.dynamodb.internal.extensions.DefaultDynamoDbExtensionContext;
import software.amazon.awssdk.enhanced.dynamodb.model.Page;
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
+import software.amazon.awssdk.services.dynamodb.model.ConsumedCapacity;
@SdkInternalApi
public final class EnhancedClientUtils {
@@ -110,28 +111,29 @@ public static Page readAndTransformPaginatedItems(
OperationContext operationContext,
DynamoDbEnhancedClientExtension dynamoDbEnhancedClientExtension,
Function>> getItems,
- Function> getLastEvaluatedKey) {
-
- if (getLastEvaluatedKey.apply(response) == null || getLastEvaluatedKey.apply(response).isEmpty()) {
- // Last page
- return Page.create(getItems.apply(response)
- .stream()
- .map(itemMap -> readAndTransformSingleItem(itemMap,
- tableSchema,
- operationContext,
- dynamoDbEnhancedClientExtension))
- .collect(Collectors.toList()));
- } else {
- // More pages to come; add the lastEvaluatedKey
- return Page.create(getItems.apply(response)
- .stream()
- .map(itemMap -> readAndTransformSingleItem(itemMap,
- tableSchema,
- operationContext,
- dynamoDbEnhancedClientExtension))
- .collect(Collectors.toList()),
- getLastEvaluatedKey.apply(response));
+ Function> getLastEvaluatedKey,
+ Function count,
+ Function scannedCount,
+ Function consumedCapacity) {
+
+ List collect = getItems.apply(response)
+ .stream()
+ .map(itemMap -> readAndTransformSingleItem(itemMap,
+ tableSchema,
+ operationContext,
+ dynamoDbEnhancedClientExtension))
+ .collect(Collectors.toList());
+
+ Page.Builder pageBuilder = Page.builder(tableSchema.itemType().rawClass())
+ .items(collect)
+ .count(count.apply(response))
+ .scannedCount(scannedCount.apply(response))
+ .consumedCapacity(consumedCapacity.apply(response));
+
+ if (getLastEvaluatedKey.apply(response) != null && !getLastEvaluatedKey.apply(response).isEmpty()) {
+ pageBuilder.lastEvaluatedKey(getLastEvaluatedKey.apply(response));
}
+ return pageBuilder.build();
}
public static Key createKeyFromItem(T item, TableSchema tableSchema, String indexName) {
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/client/DefaultDynamoDbAsyncTable.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/client/DefaultDynamoDbAsyncTable.java
index 85ebbc156dff..1538e977b4c3 100644
--- a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/client/DefaultDynamoDbAsyncTable.java
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/client/DefaultDynamoDbAsyncTable.java
@@ -41,6 +41,7 @@
import software.amazon.awssdk.enhanced.dynamodb.model.DeleteItemEnhancedResponse;
import software.amazon.awssdk.enhanced.dynamodb.model.DescribeTableEnhancedResponse;
import software.amazon.awssdk.enhanced.dynamodb.model.GetItemEnhancedRequest;
+import software.amazon.awssdk.enhanced.dynamodb.model.GetItemEnhancedResponse;
import software.amazon.awssdk.enhanced.dynamodb.model.PagePublisher;
import software.amazon.awssdk.enhanced.dynamodb.model.PutItemEnhancedRequest;
import software.amazon.awssdk.enhanced.dynamodb.model.PutItemEnhancedResponse;
@@ -156,8 +157,11 @@ public CompletableFuture> deleteItemWithResponse(
@Override
public CompletableFuture getItem(GetItemEnhancedRequest request) {
- TableOperation operation = GetItemOperation.create(request);
- return operation.executeOnPrimaryIndexAsync(tableSchema, tableName, extension, dynamoDbClient);
+ TableOperation> operation = GetItemOperation.create(request);
+ CompletableFuture> future = operation.executeOnPrimaryIndexAsync(
+ tableSchema, tableName, extension, dynamoDbClient
+ );
+ return future.thenApply(GetItemEnhancedResponse::attributes);
}
@Override
@@ -177,6 +181,20 @@ public CompletableFuture getItem(T keyItem) {
return getItem(keyFrom(keyItem));
}
+ @Override
+ public CompletableFuture> getItemWithResponse(GetItemEnhancedRequest request) {
+ TableOperation> operation = GetItemOperation.create(request);
+ return operation.executeOnPrimaryIndexAsync(tableSchema, tableName, extension, dynamoDbClient);
+ }
+
+ @Override
+ public CompletableFuture> getItemWithResponse(
+ Consumer requestConsumer) {
+ GetItemEnhancedRequest.Builder builder = GetItemEnhancedRequest.builder();
+ requestConsumer.accept(builder);
+ return getItemWithResponse(builder.build());
+ }
+
@Override
public PagePublisher query(QueryEnhancedRequest request) {
PaginatedTableOperation operation = QueryOperation.create(request);
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/client/DefaultDynamoDbTable.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/client/DefaultDynamoDbTable.java
index 8b6d8412969b..1bd2638892bd 100644
--- a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/client/DefaultDynamoDbTable.java
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/client/DefaultDynamoDbTable.java
@@ -49,6 +49,7 @@
import software.amazon.awssdk.enhanced.dynamodb.model.EnhancedGlobalSecondaryIndex;
import software.amazon.awssdk.enhanced.dynamodb.model.EnhancedLocalSecondaryIndex;
import software.amazon.awssdk.enhanced.dynamodb.model.GetItemEnhancedRequest;
+import software.amazon.awssdk.enhanced.dynamodb.model.GetItemEnhancedResponse;
import software.amazon.awssdk.enhanced.dynamodb.model.PageIterable;
import software.amazon.awssdk.enhanced.dynamodb.model.PutItemEnhancedRequest;
import software.amazon.awssdk.enhanced.dynamodb.model.PutItemEnhancedResponse;
@@ -133,13 +134,12 @@ public void createTable() {
}
private Map> splitSecondaryIndicesToLocalAndGlobalOnes() {
- String primaryPartitionKeyName = tableSchema.tableMetadata().primaryPartitionKey();
Collection indices = tableSchema.tableMetadata().indices();
return indices.stream()
.filter(index -> !TableMetadata.primaryIndexName().equals(index.name()))
.collect(Collectors.groupingBy(metadata -> {
String partitionKeyName = metadata.partitionKey().map(KeyAttributeMetadata::name).orElse(null);
- if (partitionKeyName == null || primaryPartitionKeyName.equals(partitionKeyName)) {
+ if (partitionKeyName == null) {
return IndexType.LSI;
}
return IndexType.GSI;
@@ -210,8 +210,8 @@ public DeleteItemEnhancedResponse deleteItemWithResponse(Consumer operation = GetItemOperation.create(request);
- return operation.executeOnPrimaryIndex(tableSchema, tableName, extension, dynamoDbClient);
+ TableOperation> operation = GetItemOperation.create(request);
+ return operation.executeOnPrimaryIndex(tableSchema, tableName, extension, dynamoDbClient).attributes();
}
@Override
@@ -231,6 +231,19 @@ public T getItem(T keyItem) {
return getItem(keyFrom(keyItem));
}
+ @Override
+ public GetItemEnhancedResponse getItemWithResponse(Consumer requestConsumer) {
+ GetItemEnhancedRequest.Builder builder = GetItemEnhancedRequest.builder();
+ requestConsumer.accept(builder);
+ return getItemWithResponse(builder.build());
+ }
+
+ @Override
+ public GetItemEnhancedResponse getItemWithResponse(GetItemEnhancedRequest request) {
+ TableOperation> operation = GetItemOperation.create(request);
+ return operation.executeOnPrimaryIndex(tableSchema, tableName, extension, dynamoDbClient);
+ }
+
@Override
public PageIterable query(QueryEnhancedRequest request) {
PaginatedTableOperation operation = QueryOperation.create(request);
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/BatchGetItemOperation.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/BatchGetItemOperation.java
index 7357016d20cc..541f205f6cae 100644
--- a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/BatchGetItemOperation.java
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/BatchGetItemOperation.java
@@ -62,6 +62,7 @@ public BatchGetItemRequest generateRequest(DynamoDbEnhancedClientExtension exten
return BatchGetItemRequest.builder()
.requestItems(Collections.unmodifiableMap(requestItems))
+ .returnConsumedCapacity(request.returnConsumedCapacityAsString())
.build();
}
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/GetItemOperation.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/GetItemOperation.java
index fbef90cf661f..0ebd62538cfb 100644
--- a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/GetItemOperation.java
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/GetItemOperation.java
@@ -25,6 +25,7 @@
import software.amazon.awssdk.enhanced.dynamodb.TableSchema;
import software.amazon.awssdk.enhanced.dynamodb.internal.EnhancedClientUtils;
import software.amazon.awssdk.enhanced.dynamodb.model.GetItemEnhancedRequest;
+import software.amazon.awssdk.enhanced.dynamodb.model.GetItemEnhancedResponse;
import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient;
import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
import software.amazon.awssdk.services.dynamodb.model.Get;
@@ -33,7 +34,7 @@
import software.amazon.awssdk.services.dynamodb.model.TransactGetItem;
@SdkInternalApi
-public class GetItemOperation implements TableOperation,
+public class GetItemOperation implements TableOperation>,
BatchableReadOperation,
TransactableReadOperation {
@@ -74,15 +75,20 @@ public GetItemRequest generateRequest(TableSchema tableSchema,
.tableName(context.tableName())
.key(this.request.key().keyMap(tableSchema, context.indexName()))
.consistentRead(this.request.consistentRead())
+ .returnConsumedCapacity(this.request.returnConsumedCapacityAsString())
.build();
}
@Override
- public T transformResponse(GetItemResponse response,
- TableSchema tableSchema,
- OperationContext context,
- DynamoDbEnhancedClientExtension extension) {
- return EnhancedClientUtils.readAndTransformSingleItem(response.item(), tableSchema, context, extension);
+ public GetItemEnhancedResponse transformResponse(GetItemResponse response,
+ TableSchema tableSchema,
+ OperationContext context,
+ DynamoDbEnhancedClientExtension extension) {
+ T attributes = EnhancedClientUtils.readAndTransformSingleItem(response.item(), tableSchema, context, extension);
+ return GetItemEnhancedResponse.builder()
+ .attributes(attributes)
+ .consumedCapacity(response.consumedCapacity())
+ .build();
}
@Override
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/QueryOperation.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/QueryOperation.java
index 8788cc4f56f5..826feabe4022 100644
--- a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/QueryOperation.java
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/QueryOperation.java
@@ -83,6 +83,7 @@ public QueryRequest generateRequest(TableSchema tableSchema,
.limit(this.request.limit())
.exclusiveStartKey(this.request.exclusiveStartKey())
.consistentRead(this.request.consistentRead())
+ .returnConsumedCapacity(this.request.returnConsumedCapacity())
.projectionExpression(projectionExpressionAsString);
if (!TableMetadata.primaryIndexName().equals(operationContext.indexName())) {
@@ -117,7 +118,10 @@ public Page transformResponse(QueryResponse response,
context,
dynamoDbEnhancedClientExtension,
QueryResponse::items,
- QueryResponse::lastEvaluatedKey);
+ QueryResponse::lastEvaluatedKey,
+ QueryResponse::count,
+ QueryResponse::scannedCount,
+ QueryResponse::consumedCapacity);
}
}
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/ScanOperation.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/ScanOperation.java
index da58e38caf40..e8714a5ac54b 100644
--- a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/ScanOperation.java
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/ScanOperation.java
@@ -81,6 +81,7 @@ public ScanRequest generateRequest(TableSchema tableSchema,
.totalSegments(this.request.totalSegments())
.exclusiveStartKey(this.request.exclusiveStartKey())
.consistentRead(this.request.consistentRead())
+ .returnConsumedCapacity(this.request.returnConsumedCapacity())
.expressionAttributeValues(expressionValues)
.expressionAttributeNames(expressionNames)
.projectionExpression(projectionExpressionAsString);
@@ -107,7 +108,10 @@ public Page transformResponse(ScanResponse response,
context,
dynamoDbEnhancedClientExtension,
ScanResponse::items,
- ScanResponse::lastEvaluatedKey);
+ ScanResponse::lastEvaluatedKey,
+ ScanResponse::count,
+ ScanResponse::scannedCount,
+ ScanResponse::consumedCapacity);
}
@Override
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/mapper/annotations/DynamoDbSecondaryPartitionKey.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/mapper/annotations/DynamoDbSecondaryPartitionKey.java
index 01f285f4d47d..3b5bd2a183db 100644
--- a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/mapper/annotations/DynamoDbSecondaryPartitionKey.java
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/mapper/annotations/DynamoDbSecondaryPartitionKey.java
@@ -23,9 +23,12 @@
import software.amazon.awssdk.enhanced.dynamodb.internal.mapper.BeanTableSchemaAttributeTags;
/**
- * Denotes a partition key for a global secondary index. You must also specify at least one index name, although this
- * name is only referenced internally by the enhanced client to disambiguate the index and does not actually need to
- * match the real name of the index.
+ * Denotes a partition key for a global secondary index.
+ *
+ *
You must also specify at least one index name.
+ *
+ *
The index name will be used if a table is created from this bean. For data-oriented operations like reads and writes, this
+ * name does not need to match the service-side name of the index.
*/
@SdkPublicApi
@Target({ElementType.METHOD})
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/mapper/annotations/DynamoDbSecondarySortKey.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/mapper/annotations/DynamoDbSecondarySortKey.java
index a39b982b4980..9fdee8065196 100644
--- a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/mapper/annotations/DynamoDbSecondarySortKey.java
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/mapper/annotations/DynamoDbSecondarySortKey.java
@@ -23,10 +23,14 @@
import software.amazon.awssdk.enhanced.dynamodb.internal.mapper.BeanTableSchemaAttributeTags;
/**
- * Denotes an optional sort key for a global or local secondary index. You must also specify the index name which in the
- * case of a global secondary index must match the index name supplied with the secondary partition key for the same
- * index. This name is only referenced internally by the enhanced client to disambiguate the index and does not actually
- * need to match the real name of the index.
+ * Denotes an optional sort key for a global or local secondary index.
+ *
+ *
You must also specify at least one index name. For global secondary indices, this must match an index name specified in
+ * a {@link DynamoDbSecondaryPartitionKey}. Any index names specified that do not have an associated
+ * {@link DynamoDbSecondaryPartitionKey} are treated as local secondary indexes.
+ *
+ *
The index name will be used if a table is created from this bean. For data-oriented operations like reads and writes, this
+ * name does not need to match the service-side name of the index.
*/
@SdkPublicApi
@Target({ElementType.METHOD})
@@ -35,6 +39,10 @@
public @interface DynamoDbSecondarySortKey {
/**
* The names of one or more local or global secondary indices that this sort key should participate in.
+ *
+ *
For global secondary indices, this must match an index name specified in a {@link DynamoDbSecondaryPartitionKey}. Any
+ * index names specified that do not have an associated {@link DynamoDbSecondaryPartitionKey} are treated as local
+ * secondary indexes.
*/
String[] indexNames();
}
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/BatchGetItemEnhancedRequest.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/BatchGetItemEnhancedRequest.java
index 9c360aa9f225..ea2bdc8fd1fc 100644
--- a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/BatchGetItemEnhancedRequest.java
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/BatchGetItemEnhancedRequest.java
@@ -20,10 +20,14 @@
import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import java.util.Objects;
import software.amazon.awssdk.annotations.NotThreadSafe;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.annotations.ThreadSafe;
import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient;
+import software.amazon.awssdk.services.dynamodb.model.BatchGetItemRequest;
+import software.amazon.awssdk.services.dynamodb.model.GetItemRequest;
+import software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity;
/**
* Defines parameters used for the batchGetItem() operation (such as
@@ -36,9 +40,11 @@
public final class BatchGetItemEnhancedRequest {
private final List readBatches;
+ private final String returnConsumedCapacity;
private BatchGetItemEnhancedRequest(Builder builder) {
this.readBatches = getListIfExist(builder.readBatches);
+ this.returnConsumedCapacity = builder.returnConsumedCapacity;
}
/**
@@ -52,7 +58,7 @@ public static Builder builder() {
* Returns a builder initialized with all existing values on the request object.
*/
public Builder toBuilder() {
- return new Builder().readBatches(readBatches);
+ return new Builder().readBatches(readBatches).returnConsumedCapacity(this.returnConsumedCapacity);
}
/**
@@ -62,6 +68,25 @@ public Collection readBatches() {
return readBatches;
}
+ /**
+ * Whether to return the capacity consumed by this operation.
+ *
+ * @see GetItemRequest#returnConsumedCapacity()
+ */
+ public ReturnConsumedCapacity returnConsumedCapacity() {
+ return ReturnConsumedCapacity.fromValue(returnConsumedCapacity);
+ }
+
+ /**
+ * Whether to return the capacity consumed by this operation.
+ *
+ * Similar to {@link #returnConsumedCapacity()} but return the value as a string. This is useful in situations where the
+ * value is not defined in {@link ReturnConsumedCapacity}.
+ */
+ public String returnConsumedCapacityAsString() {
+ return returnConsumedCapacity;
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -73,12 +98,15 @@ public boolean equals(Object o) {
BatchGetItemEnhancedRequest that = (BatchGetItemEnhancedRequest) o;
- return readBatches != null ? readBatches.equals(that.readBatches) : that.readBatches == null;
+ return Objects.equals(this.readBatches, that.readBatches) &&
+ Objects.equals(this.returnConsumedCapacity, that.returnConsumedCapacity);
}
@Override
public int hashCode() {
- return readBatches != null ? readBatches.hashCode() : 0;
+ int hc = readBatches != null ? readBatches.hashCode() : 0;
+ hc = 31 * hc + (returnConsumedCapacity != null ? returnConsumedCapacity.hashCode() : 0);
+ return hc;
}
private static List getListIfExist(List readBatches) {
@@ -91,6 +119,7 @@ private static List getListIfExist(List readBatches) {
@NotThreadSafe
public static final class Builder {
private List readBatches;
+ private String returnConsumedCapacity;
private Builder() {
}
@@ -132,9 +161,30 @@ public Builder addReadBatch(ReadBatch readBatch) {
return this;
}
+ /**
+ * Whether to return the capacity consumed by this operation.
+ *
+ * @see BatchGetItemRequest.Builder#returnConsumedCapacity(ReturnConsumedCapacity)
+ * @return a builder of this type
+ */
+ public Builder returnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity) {
+ this.returnConsumedCapacity = returnConsumedCapacity == null ? null : returnConsumedCapacity.toString();
+ return this;
+ }
+
+ /**
+ * Whether to return the capacity consumed by this operation.
+ *
+ * @see BatchGetItemRequest.Builder#returnConsumedCapacity(String)
+ * @return a builder of this type
+ */
+ public Builder returnConsumedCapacity(String returnConsumedCapacity) {
+ this.returnConsumedCapacity = returnConsumedCapacity;
+ return this;
+ }
+
public BatchGetItemEnhancedRequest build() {
return new BatchGetItemEnhancedRequest(this);
}
}
-
}
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/BatchGetResultPage.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/BatchGetResultPage.java
index fbb5000a74b6..adec895c0cf1 100644
--- a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/BatchGetResultPage.java
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/BatchGetResultPage.java
@@ -33,6 +33,7 @@
import software.amazon.awssdk.enhanced.dynamodb.internal.operations.DefaultOperationContext;
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
import software.amazon.awssdk.services.dynamodb.model.BatchGetItemResponse;
+import software.amazon.awssdk.services.dynamodb.model.ConsumedCapacity;
import software.amazon.awssdk.services.dynamodb.model.KeysAndAttributes;
/**
@@ -111,6 +112,10 @@ public List unprocessedKeysForTable(MappedTableResource> mappedTable) {
.collect(Collectors.toList());
}
+ public List consumedCapacity() {
+ return this.batchGetItemResponse.consumedCapacity();
+ }
+
/**
* A builder that is used to create a result object with the desired parameters.
*/
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/GetItemEnhancedRequest.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/GetItemEnhancedRequest.java
index acb6727288c4..88a091b8883d 100644
--- a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/GetItemEnhancedRequest.java
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/GetItemEnhancedRequest.java
@@ -15,6 +15,7 @@
package software.amazon.awssdk.enhanced.dynamodb.model;
+import java.util.Objects;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.NotThreadSafe;
import software.amazon.awssdk.annotations.SdkPublicApi;
@@ -22,6 +23,8 @@
import software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncTable;
import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable;
import software.amazon.awssdk.enhanced.dynamodb.Key;
+import software.amazon.awssdk.services.dynamodb.model.GetItemRequest;
+import software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity;
/**
* Defines parameters used to retrieve an item from a DynamoDb table using the getItem() operation (such as
@@ -35,10 +38,12 @@ public final class GetItemEnhancedRequest {
private final Key key;
private final Boolean consistentRead;
+ private final String returnConsumedCapacity;
private GetItemEnhancedRequest(Builder builder) {
this.key = builder.key;
this.consistentRead = builder.consistentRead;
+ this.returnConsumedCapacity = builder.returnConsumedCapacity;
}
/**
@@ -53,7 +58,7 @@ public static Builder builder() {
* @return a builder with all existing values set
*/
public Builder toBuilder() {
- return builder().key(key).consistentRead(consistentRead);
+ return builder().key(key).consistentRead(consistentRead).returnConsumedCapacity(returnConsumedCapacity);
}
/**
@@ -70,6 +75,25 @@ public Key key() {
return this.key;
}
+ /**
+ * Whether to return the capacity consumed by this operation.
+ *
+ * @see GetItemRequest#returnConsumedCapacity()
+ */
+ public ReturnConsumedCapacity returnConsumedCapacity() {
+ return ReturnConsumedCapacity.fromValue(returnConsumedCapacity);
+ }
+
+ /**
+ * Whether to return the capacity consumed by this operation.
+ *
+ * Similar to {@link #returnConsumedCapacity()} but return the value as a string. This is useful in situations where the
+ * value is not defined in {@link ReturnConsumedCapacity}.
+ */
+ public String returnConsumedCapacityAsString() {
+ return returnConsumedCapacity;
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -79,18 +103,18 @@ public boolean equals(Object o) {
return false;
}
- GetItemEnhancedRequest getItem = (GetItemEnhancedRequest) o;
+ GetItemEnhancedRequest that = (GetItemEnhancedRequest) o;
- if (key != null ? ! key.equals(getItem.key) : getItem.key != null) {
- return false;
- }
- return consistentRead != null ? consistentRead.equals(getItem.consistentRead) : getItem.consistentRead == null;
+ return Objects.equals(key, that.key)
+ && Objects.equals(consistentRead, that.consistentRead)
+ && Objects.equals(returnConsumedCapacity, that.returnConsumedCapacity);
}
@Override
public int hashCode() {
int result = key != null ? key.hashCode() : 0;
result = 31 * result + (consistentRead != null ? consistentRead.hashCode() : 0);
+ result = 31 * result + (returnConsumedCapacity != null ? returnConsumedCapacity.hashCode() : 0);
return result;
}
@@ -103,6 +127,7 @@ public int hashCode() {
public static final class Builder {
private Key key;
private Boolean consistentRead;
+ private String returnConsumedCapacity;
private Builder() {
}
@@ -145,6 +170,26 @@ public Builder key(Consumer keyConsumer) {
return key(builder.build());
}
+ /**
+ * Whether to return the capacity consumed by this operation.
+ *
+ * @see GetItemRequest.Builder#returnConsumedCapacity(ReturnConsumedCapacity)
+ */
+ public Builder returnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity) {
+ this.returnConsumedCapacity = returnConsumedCapacity == null ? null : returnConsumedCapacity.toString();
+ return this;
+ }
+
+ /**
+ * Whether to return the capacity consumed by this operation.
+ *
+ * @see GetItemRequest.Builder#returnConsumedCapacity(String)
+ */
+ public Builder returnConsumedCapacity(String returnConsumedCapacity) {
+ this.returnConsumedCapacity = returnConsumedCapacity;
+ return this;
+ }
+
public GetItemEnhancedRequest build() {
return new GetItemEnhancedRequest(this);
}
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/GetItemEnhancedResponse.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/GetItemEnhancedResponse.java
new file mode 100644
index 000000000000..3c31fb6bde55
--- /dev/null
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/GetItemEnhancedResponse.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright 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.awssdk.enhanced.dynamodb.model;
+
+import java.util.Objects;
+import software.amazon.awssdk.annotations.NotThreadSafe;
+import software.amazon.awssdk.annotations.SdkPublicApi;
+import software.amazon.awssdk.annotations.ThreadSafe;
+import software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncTable;
+import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable;
+import software.amazon.awssdk.services.dynamodb.model.ConsumedCapacity;
+import software.amazon.awssdk.services.dynamodb.model.GetItemResponse;
+
+/**
+ * Defines the elements returned by DynamoDB from a {@code GetItem} operation, such as
+ * {@link DynamoDbTable#getItemWithResponse(GetItemEnhancedRequest)} and
+ * {@link DynamoDbAsyncTable#getItemWithResponse(GetItemEnhancedRequest)}.
+ *
+ * @param The type of the item.
+ */
+@SdkPublicApi
+@ThreadSafe
+public final class GetItemEnhancedResponse {
+ private final T attributes;
+ private final ConsumedCapacity consumedCapacity;
+
+ private GetItemEnhancedResponse(GetItemEnhancedResponse.Builder builder) {
+ this.attributes = builder.attributes;
+ this.consumedCapacity = builder.consumedCapacity;
+ }
+
+ /**
+ * The attribute values returned by {@code GetItem} operation.
+ */
+ public T attributes() {
+ return attributes;
+ }
+
+ /**
+ * The capacity units consumed by the {@code GetItem} operation.
+ *
+ * @see GetItemResponse#consumedCapacity() for more information.
+ */
+ public ConsumedCapacity consumedCapacity() {
+ return consumedCapacity;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+
+ GetItemEnhancedResponse> that = (GetItemEnhancedResponse>) o;
+ return Objects.equals(attributes, that.attributes) && Objects.equals(consumedCapacity, that.consumedCapacity);
+ }
+
+ @Override
+ public int hashCode() {
+ int result = Objects.hashCode(attributes);
+ result = 31 * result + Objects.hashCode(consumedCapacity);
+ return result;
+ }
+
+ public static GetItemEnhancedResponse.Builder builder() {
+ return new GetItemEnhancedResponse.Builder<>();
+ }
+
+ @NotThreadSafe
+ public static final class Builder {
+ private T attributes;
+ private ConsumedCapacity consumedCapacity;
+
+ public GetItemEnhancedResponse.Builder attributes(T attributes) {
+ this.attributes = attributes;
+ return this;
+ }
+
+ public GetItemEnhancedResponse.Builder consumedCapacity(ConsumedCapacity consumedCapacity) {
+ this.consumedCapacity = consumedCapacity;
+ return this;
+ }
+
+ public GetItemEnhancedResponse build() {
+ return new GetItemEnhancedResponse<>(this);
+ }
+ }
+}
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/Page.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/Page.java
index a10808dffa5c..f9c4ba7dcc0e 100644
--- a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/Page.java
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/Page.java
@@ -15,11 +15,14 @@
package software.amazon.awssdk.enhanced.dynamodb.model;
+import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.annotations.ThreadSafe;
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
+import software.amazon.awssdk.services.dynamodb.model.ConsumedCapacity;
import software.amazon.awssdk.utils.ToString;
/**
@@ -33,30 +36,47 @@
public final class Page {
private final List items;
private final Map lastEvaluatedKey;
+ private final Integer count;
+ private final Integer scannedCount;
+ private final ConsumedCapacity consumedCapacity;
private Page(List items, Map lastEvaluatedKey) {
this.items = items;
this.lastEvaluatedKey = lastEvaluatedKey;
+ this.count = null;
+ this.scannedCount = null;
+ this.consumedCapacity = null;
+ }
+
+ private Page(Builder builder) {
+ this.items = builder.items;
+ this.lastEvaluatedKey = builder.lastEvaluatedKey;
+ this.count = builder.count;
+ this.scannedCount = builder.scannedCount;
+ this.consumedCapacity = builder.consumedCapacity;
}
/**
- * Static constructor for this object.
+ * Static constructor for this object. Deprecated in favor of using the builder() pattern to construct this object.
+ *
* @param items A list of items to store for the page.
* @param lastEvaluatedKey A 'lastEvaluatedKey' to store for the page.
* @param The modelled type of the object that has been read.
* @return A newly constructed {@link Page} object.
*/
+ @Deprecated
public static Page create(List items, Map lastEvaluatedKey) {
return new Page<>(items, lastEvaluatedKey);
}
/**
* Static constructor for this object that sets a null 'lastEvaluatedKey' which indicates this is the final page
- * of results.
+ * of results. Deprecated in favor of using the builder() pattern to construct this object.
* @param items A list of items to store for the page.
* @param The modelled type of the object that has been read.
* @return A newly constructed {@link Page} object.
*/
+ @Deprecated
public static Page create(List items) {
return new Page<>(items, null);
}
@@ -78,6 +98,31 @@ public Map lastEvaluatedKey() {
return lastEvaluatedKey;
}
+ /**
+ * The count of the returned items from the last page query or scan, after any filters were applied.
+ */
+ public Integer count() {
+ return count;
+ }
+
+ /**
+ * The scanned count of the returned items from the last page query or scan, before any filters were applied.
+ * This number will be equal or greater than the count.
+ */
+ public Integer scannedCount() {
+ return scannedCount;
+ }
+
+ /**
+ * Returns the capacity units consumed by the last page query or scan. Will only be returned if it has been
+ * explicitly requested by the user when calling the operation.
+ *
+ * @return The 'consumedCapacity' from the last query or scan operation or null if it was not requested.
+ */
+ public ConsumedCapacity consumedCapacity() {
+ return consumedCapacity;
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -92,13 +137,25 @@ public boolean equals(Object o) {
if (items != null ? ! items.equals(page.items) : page.items != null) {
return false;
}
- return lastEvaluatedKey != null ? lastEvaluatedKey.equals(page.lastEvaluatedKey) : page.lastEvaluatedKey == null;
+ if (lastEvaluatedKey != null ? ! lastEvaluatedKey.equals(page.lastEvaluatedKey) : page.lastEvaluatedKey != null) {
+ return false;
+ }
+ if (consumedCapacity != null ? ! consumedCapacity.equals(page.consumedCapacity) : page.consumedCapacity != null) {
+ return false;
+ }
+ if (count != null ? ! count.equals(page.count) : page.count != null) {
+ return false;
+ }
+ return scannedCount != null ? scannedCount.equals(page.scannedCount) : page.scannedCount == null;
}
@Override
public int hashCode() {
int result = items != null ? items.hashCode() : 0;
result = 31 * result + (lastEvaluatedKey != null ? lastEvaluatedKey.hashCode() : 0);
+ result = 31 * result + (consumedCapacity != null ? consumedCapacity.hashCode() : 0);
+ result = 31 * result + (count != null ? count.hashCode() : 0);
+ result = 31 * result + (scannedCount != null ? scannedCount.hashCode() : 0);
return result;
}
@@ -109,4 +166,45 @@ public String toString() {
.add("items", items)
.build();
}
+
+ public static Builder builder(Class itemClass) {
+ return new Builder<>();
+ }
+
+ public static final class Builder {
+ private List items;
+ private Map lastEvaluatedKey;
+ private Integer count;
+ private Integer scannedCount;
+ private ConsumedCapacity consumedCapacity;
+
+ public Builder items(List items) {
+ this.items = new ArrayList<>(items);
+ return this;
+ }
+
+ public Builder lastEvaluatedKey(Map lastEvaluatedKey) {
+ this.lastEvaluatedKey = new HashMap<>(lastEvaluatedKey);
+ return this;
+ }
+
+ public Builder count(Integer count) {
+ this.count = count;
+ return this;
+ }
+
+ public Builder scannedCount(Integer scannedCount) {
+ this.scannedCount = scannedCount;
+ return this;
+ }
+
+ public Builder consumedCapacity(ConsumedCapacity consumedCapacity) {
+ this.consumedCapacity = consumedCapacity;
+ return this;
+ }
+
+ public Page build() {
+ return new Page(this);
+ }
+ }
}
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/QueryEnhancedRequest.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/QueryEnhancedRequest.java
index fbc4736cae3c..21b81868d44f 100644
--- a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/QueryEnhancedRequest.java
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/QueryEnhancedRequest.java
@@ -31,6 +31,9 @@
import software.amazon.awssdk.enhanced.dynamodb.Expression;
import software.amazon.awssdk.enhanced.dynamodb.NestedAttributeName;
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
+import software.amazon.awssdk.services.dynamodb.model.QueryRequest;
+import software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity;
+import software.amazon.awssdk.services.dynamodb.model.ScanRequest;
import software.amazon.awssdk.utils.Validate;
/**
@@ -53,6 +56,7 @@ public final class QueryEnhancedRequest {
private final Boolean consistentRead;
private final Expression filterExpression;
private final List attributesToProject;
+ private final String returnConsumedCapacity;
private QueryEnhancedRequest(Builder builder) {
this.queryConditional = builder.queryConditional;
@@ -61,6 +65,7 @@ private QueryEnhancedRequest(Builder builder) {
this.limit = builder.limit;
this.consistentRead = builder.consistentRead;
this.filterExpression = builder.filterExpression;
+ this.returnConsumedCapacity = builder.returnConsumedCapacity;
this.attributesToProject = builder.attributesToProject != null
? Collections.unmodifiableList(builder.attributesToProject)
: null;
@@ -78,12 +83,13 @@ public static Builder builder() {
*/
public Builder toBuilder() {
return builder().queryConditional(queryConditional)
- .exclusiveStartKey(exclusiveStartKey)
- .scanIndexForward(scanIndexForward)
- .limit(limit)
- .consistentRead(consistentRead)
- .filterExpression(filterExpression)
- .addNestedAttributesToProject(attributesToProject);
+ .exclusiveStartKey(exclusiveStartKey)
+ .scanIndexForward(scanIndexForward)
+ .limit(limit)
+ .consistentRead(consistentRead)
+ .filterExpression(filterExpression)
+ .returnConsumedCapacity(returnConsumedCapacity)
+ .addNestedAttributesToProject(attributesToProject);
}
/**
@@ -149,6 +155,26 @@ public List nestedAttributesToProject() {
return attributesToProject;
}
+
+ /**
+ * Whether to return the capacity consumed by this operation.
+ *
+ * @see ScanRequest#returnConsumedCapacity()
+ */
+ public ReturnConsumedCapacity returnConsumedCapacity() {
+ return ReturnConsumedCapacity.fromValue(returnConsumedCapacity);
+ }
+
+ /**
+ * Whether to return the capacity consumed by this operation.
+ *
+ * Similar to {@link #returnConsumedCapacity()} but return the value as a string. This is useful in situations where the
+ * value is not defined in {@link ReturnConsumedCapacity}.
+ */
+ public String returnConsumedCapacityAsString() {
+ return returnConsumedCapacity;
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -182,6 +208,10 @@ public boolean equals(Object o) {
? !attributesToProject.equals(query.attributesToProject) : query.attributesToProject != null) {
return false;
}
+ if (returnConsumedCapacity != null
+ ? !returnConsumedCapacity.equals(query.returnConsumedCapacity) : query.returnConsumedCapacity != null) {
+ return false;
+ }
return filterExpression != null ? filterExpression.equals(query.filterExpression) : query.filterExpression == null;
}
@@ -194,6 +224,7 @@ public int hashCode() {
result = 31 * result + (consistentRead != null ? consistentRead.hashCode() : 0);
result = 31 * result + (filterExpression != null ? filterExpression.hashCode() : 0);
result = 31 * result + (attributesToProject != null ? attributesToProject.hashCode() : 0);
+ result = 31 * result + (returnConsumedCapacity != null ? returnConsumedCapacity.hashCode() : 0);
return result;
}
@@ -211,6 +242,7 @@ public static final class Builder {
private Boolean consistentRead;
private Expression filterExpression;
private List attributesToProject;
+ private String returnConsumedCapacity;
private Builder() {
}
@@ -419,6 +451,27 @@ public Builder addNestedAttributeToProject(NestedAttributeName nestedAttributeNa
return this;
}
+
+ /**
+ * Whether to return the capacity consumed by this operation.
+ *
+ * @see QueryRequest.Builder#returnConsumedCapacity(ReturnConsumedCapacity)
+ */
+ public Builder returnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity) {
+ this.returnConsumedCapacity = returnConsumedCapacity == null ? null : returnConsumedCapacity.toString();
+ return this;
+ }
+
+ /**
+ * Whether to return the capacity consumed by this operation.
+ *
+ * @see QueryRequest.Builder#returnConsumedCapacity(String)
+ */
+ public Builder returnConsumedCapacity(String returnConsumedCapacity) {
+ this.returnConsumedCapacity = returnConsumedCapacity;
+ return this;
+ }
+
public QueryEnhancedRequest build() {
return new QueryEnhancedRequest(this);
}
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/ReadBatch.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/ReadBatch.java
index 1bdae4d4995c..e9d4364fec81 100644
--- a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/ReadBatch.java
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/ReadBatch.java
@@ -15,6 +15,8 @@
package software.amazon.awssdk.enhanced.dynamodb.model;
+import static java.util.Objects.requireNonNull;
+
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -211,6 +213,9 @@ private static boolean compareNullableBooleans(Boolean one, Boolean two) {
@NotThreadSafe
private static final class BuilderImpl implements Builder {
+ private static final String MAPPED_TABLE_RESOURCE_NOT_NULL_MESSAGE = String.format("A mappedTableResource (table) is "
+ + "required when building a %s",
+ ReadBatch.class.getSimpleName());
private MappedTableResource mappedTableResource;
private List requests = new ArrayList<>();
@@ -243,6 +248,7 @@ public Builder addGetItem(Key key) {
@Override
public Builder addGetItem(T keyItem) {
+ requireNonNull(mappedTableResource, MAPPED_TABLE_RESOURCE_NOT_NULL_MESSAGE);
return addGetItem(this.mappedTableResource.keyFrom(keyItem));
}
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/ScanEnhancedRequest.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/ScanEnhancedRequest.java
index 09b8a55f1f19..624e9beaa9ba 100644
--- a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/ScanEnhancedRequest.java
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/ScanEnhancedRequest.java
@@ -30,6 +30,8 @@
import software.amazon.awssdk.enhanced.dynamodb.Expression;
import software.amazon.awssdk.enhanced.dynamodb.NestedAttributeName;
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
+import software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity;
+import software.amazon.awssdk.services.dynamodb.model.ScanRequest;
import software.amazon.awssdk.utils.Validate;
/**
@@ -49,6 +51,7 @@ public final class ScanEnhancedRequest {
private final List attributesToProject;
private final Integer segment;
private final Integer totalSegments;
+ private final String returnConsumedCapacity;
private ScanEnhancedRequest(Builder builder) {
this.exclusiveStartKey = builder.exclusiveStartKey;
@@ -57,6 +60,7 @@ private ScanEnhancedRequest(Builder builder) {
this.totalSegments = builder.totalSegments;
this.consistentRead = builder.consistentRead;
this.filterExpression = builder.filterExpression;
+ this.returnConsumedCapacity = builder.returnConsumedCapacity;
this.attributesToProject = builder.attributesToProject != null
? Collections.unmodifiableList(builder.attributesToProject)
: null;
@@ -74,10 +78,13 @@ public static Builder builder() {
*/
public Builder toBuilder() {
return builder().exclusiveStartKey(exclusiveStartKey)
- .limit(limit)
- .consistentRead(consistentRead)
- .filterExpression(filterExpression)
- .addNestedAttributesToProject(attributesToProject);
+ .limit(limit)
+ .segment(segment)
+ .totalSegments(totalSegments)
+ .consistentRead(consistentRead)
+ .filterExpression(filterExpression)
+ .returnConsumedCapacity(returnConsumedCapacity)
+ .addNestedAttributesToProject(attributesToProject);
}
/**
@@ -143,6 +150,24 @@ public List nestedAttributesToProject() {
return attributesToProject;
}
+ /**
+ * Whether to return the capacity consumed by this operation.
+ *
+ * @see ScanRequest#returnConsumedCapacity()
+ */
+ public ReturnConsumedCapacity returnConsumedCapacity() {
+ return ReturnConsumedCapacity.fromValue(returnConsumedCapacity);
+ }
+
+ /**
+ * Whether to return the capacity consumed by this operation.
+ *
+ * Similar to {@link #returnConsumedCapacity()} but return the value as a string. This is useful in situations where the
+ * value is not defined in {@link ReturnConsumedCapacity}.
+ */
+ public String returnConsumedCapacityAsString() {
+ return returnConsumedCapacity;
+ }
@Override
public boolean equals(Object o) {
@@ -175,6 +200,10 @@ public boolean equals(Object o) {
? !attributesToProject.equals(scan.attributesToProject) : scan.attributesToProject != null) {
return false;
}
+ if (returnConsumedCapacity != null
+ ? !returnConsumedCapacity.equals(scan.returnConsumedCapacity) : scan.returnConsumedCapacity != null) {
+ return false;
+ }
return filterExpression != null ? filterExpression.equals(scan.filterExpression) : scan.filterExpression == null;
}
@@ -187,6 +216,7 @@ public int hashCode() {
result = 31 * result + (consistentRead != null ? consistentRead.hashCode() : 0);
result = 31 * result + (filterExpression != null ? filterExpression.hashCode() : 0);
result = 31 * result + (attributesToProject != null ? attributesToProject.hashCode() : 0);
+ result = 31 * result + (returnConsumedCapacity != null ? returnConsumedCapacity.hashCode() : 0);
return result;
}
@@ -202,6 +232,7 @@ public static final class Builder {
private List attributesToProject;
private Integer segment;
private Integer totalSegments;
+ private String returnConsumedCapacity;
private Builder() {
}
@@ -428,6 +459,26 @@ public Builder addNestedAttributeToProject(NestedAttributeName nestedAttributeNa
return this;
}
+ /**
+ * Whether to return the capacity consumed by this operation.
+ *
+ * @see ScanRequest.Builder#returnConsumedCapacity(ReturnConsumedCapacity)
+ */
+ public Builder returnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity) {
+ this.returnConsumedCapacity = returnConsumedCapacity == null ? null : returnConsumedCapacity.toString();
+ return this;
+ }
+
+ /**
+ * Whether to return the capacity consumed by this operation.
+ *
+ * @see ScanRequest.Builder#returnConsumedCapacity(String)
+ */
+ public Builder returnConsumedCapacity(String returnConsumedCapacity) {
+ this.returnConsumedCapacity = returnConsumedCapacity;
+ return this;
+ }
+
public ScanEnhancedRequest build() {
return new ScanEnhancedRequest(this);
}
diff --git a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/WriteBatch.java b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/WriteBatch.java
index d8fec912ba84..d2aa68572906 100644
--- a/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/WriteBatch.java
+++ b/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/model/WriteBatch.java
@@ -15,6 +15,7 @@
package software.amazon.awssdk.enhanced.dynamodb.model;
+import static java.util.Objects.requireNonNull;
import static software.amazon.awssdk.enhanced.dynamodb.internal.EnhancedClientUtils.getItemsFromSupplier;
import java.util.ArrayList;
@@ -187,7 +188,9 @@ public interface Builder {
}
private static final class BuilderImpl implements Builder {
-
+ private static final String MAPPED_TABLE_RESOURCE_NOT_NULL_MESSAGE = String.format("A mappedTableResource (table) is "
+ + "required when building a %s",
+ WriteBatch.class.getSimpleName());
private Class extends T> itemClass;
private List> itemSupplierList = new ArrayList<>();
private MappedTableResource mappedTableResource;
@@ -204,6 +207,7 @@ public Builder mappedTableResource(MappedTableResource mappedTableResource
@Override
public Builder addDeleteItem(DeleteItemEnhancedRequest request) {
+ requireNonNull(mappedTableResource, MAPPED_TABLE_RESOURCE_NOT_NULL_MESSAGE);
itemSupplierList.add(() -> generateWriteRequest(() -> mappedTableResource, DeleteItemOperation.create(request)));
return this;
}
@@ -222,11 +226,13 @@ public Builder addDeleteItem(Key key) {
@Override
public Builder addDeleteItem(T keyItem) {
+ requireNonNull(mappedTableResource, MAPPED_TABLE_RESOURCE_NOT_NULL_MESSAGE);
return addDeleteItem(this.mappedTableResource.keyFrom(keyItem));
}
@Override
public Builder addPutItem(PutItemEnhancedRequest request) {
+ requireNonNull(mappedTableResource, MAPPED_TABLE_RESOURCE_NOT_NULL_MESSAGE);
itemSupplierList.add(() -> generateWriteRequest(() -> mappedTableResource, PutItemOperation.create(request)));
return this;
}
diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBatchGetItemTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBatchGetItemTest.java
index 3c90d04562da..c22263f6e4e0 100644
--- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBatchGetItemTest.java
+++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBatchGetItemTest.java
@@ -17,9 +17,14 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsInAnyOrder;
+import static org.hamcrest.Matchers.empty;
+import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.not;
+import static org.hamcrest.Matchers.nullValue;
import static software.amazon.awssdk.enhanced.dynamodb.mapper.StaticAttributeTags.primaryPartitionKey;
+import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -37,58 +42,80 @@
import software.amazon.awssdk.enhanced.dynamodb.model.BatchGetResultPage;
import software.amazon.awssdk.enhanced.dynamodb.model.BatchGetResultPagePublisher;
import software.amazon.awssdk.enhanced.dynamodb.model.ReadBatch;
+import software.amazon.awssdk.services.dynamodb.model.ConsumedCapacity;
import software.amazon.awssdk.services.dynamodb.model.DeleteTableRequest;
+import software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity;
public class AsyncBatchGetItemTest extends LocalDynamoDbAsyncTestBase {
private static class Record1 {
private Integer id;
+ private String stringAttr;
private Integer getId() {
return id;
}
+ private String getStringAttr() {
+ return stringAttr;
+ }
+
private Record1 setId(Integer id) {
this.id = id;
return this;
}
+ private Record1 setStringAttr(String str) {
+ this.stringAttr = str;
+ return this;
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Record1 record1 = (Record1) o;
- return Objects.equals(id, record1.id);
+ return Objects.equals(id, record1.id) && Objects.equals(stringAttr, record1.stringAttr);
}
@Override
public int hashCode() {
- return Objects.hash(id);
+ return Objects.hash(id, stringAttr);
}
}
private static class Record2 {
private Integer id;
+ private String stringAttr;
private Integer getId() {
return id;
}
+ private String getStringAttr() {
+ return stringAttr;
+ }
+
private Record2 setId(Integer id) {
this.id = id;
return this;
}
+ private Record2 setStringAttr(String str) {
+ this.stringAttr = str;
+ return this;
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Record2 record2 = (Record2) o;
- return Objects.equals(id, record2.id);
+ return Objects.equals(id, record2.id) && Objects.equals(stringAttr, record2.stringAttr);
}
@Override
public int hashCode() {
- return Objects.hash(id);
+ return Objects.hash(id, stringAttr);
}
}
@@ -99,6 +126,9 @@ public int hashCode() {
.getter(Record1::getId)
.setter(Record1::setId)
.tags(primaryPartitionKey()))
+ .addAttribute(String.class, a -> a.name("str_1")
+ .getter(Record1::getStringAttr)
+ .setter(Record1::setStringAttr))
.build();
private static final TableSchema TABLE_SCHEMA_2 =
@@ -108,26 +138,29 @@ public int hashCode() {
.getter(Record2::getId)
.setter(Record2::setId)
.tags(primaryPartitionKey()))
+ .addAttribute(String.class, a -> a.name("str_1")
+ .getter(Record2::getStringAttr)
+ .setter(Record2::setStringAttr))
.build();
- private DynamoDbEnhancedAsyncClient enhancedAsyncClient =
+ private final DynamoDbEnhancedAsyncClient enhancedAsyncClient =
DefaultDynamoDbEnhancedAsyncClient.builder()
.dynamoDbClient(getDynamoDbAsyncClient())
.build();
- private DynamoDbAsyncTable mappedTable1 = enhancedAsyncClient.table(getConcreteTableName("table-name-1"),
- TABLE_SCHEMA_1);
- private DynamoDbAsyncTable mappedTable2 = enhancedAsyncClient.table(getConcreteTableName("table-name-2"),
- TABLE_SCHEMA_2);
+ private final String tableName1 = getConcreteTableName("table-name-1");
+ private final String tableName2 = getConcreteTableName("table-name-2");
+ private final DynamoDbAsyncTable mappedTable1 = enhancedAsyncClient.table(tableName1, TABLE_SCHEMA_1);
+ private final DynamoDbAsyncTable mappedTable2 = enhancedAsyncClient.table(tableName2, TABLE_SCHEMA_2);
private static final List RECORDS_1 =
IntStream.range(0, 2)
- .mapToObj(i -> new Record1().setId(i))
+ .mapToObj(i -> new Record1().setId(i).setStringAttr(getStringAttrValue(80_000)))
.collect(Collectors.toList());
private static final List RECORDS_2 =
IntStream.range(0, 2)
- .mapToObj(i -> new Record2().setId(i))
+ .mapToObj(i -> new Record2().setId(i).setStringAttr(getStringAttrValue(40_000)))
.collect(Collectors.toList());
@Before
@@ -139,10 +172,10 @@ public void createTable() {
@After
public void deleteTable() {
getDynamoDbAsyncClient().deleteTable(DeleteTableRequest.builder()
- .tableName(getConcreteTableName("table-name-1"))
+ .tableName(tableName1)
.build()).join();
getDynamoDbAsyncClient().deleteTable(DeleteTableRequest.builder()
- .tableName(getConcreteTableName("table-name-2"))
+ .tableName(tableName2)
.build()).join();
}
@@ -160,6 +193,8 @@ public void getRecordsFromMultipleTables() {
List results = drainPublisher(publisher, 1);
assertThat(results.size(), is(1));
BatchGetResultPage page = results.get(0);
+ assertThat(page.consumedCapacity(), empty());
+
List record1List = page.resultsForTable(mappedTable1);
assertThat(record1List.size(), is(2));
assertThat(record1List, containsInAnyOrder(RECORDS_1.get(0), RECORDS_1.get(1)));
@@ -222,6 +257,61 @@ public void notFoundRecordReturnsNull_viaFlattenedItems() {
assertThat(record2List, containsInAnyOrder(RECORDS_2.toArray()));
}
+ @Test
+ public void getRecordsFromMultipleTables_withReturnConsumedCapacity() {
+ insertRecords();
+
+ SdkPublisher publisher = batchGetResultPageSdkPublisherForBothTables(ReturnConsumedCapacity.TOTAL);
+
+ List results = drainPublisher(publisher, 1);
+ assertThat(results.size(), is(1));
+ BatchGetResultPage page = results.get(0);
+ assertThat(page.consumedCapacity(), not(nullValue()));
+ assertThat(page.consumedCapacity(), hasSize(2));
+
+ assertThat(page.consumedCapacity(), containsInAnyOrder(
+ ConsumedCapacity.builder().tableName(tableName1).capacityUnits(20.0).build(),
+ ConsumedCapacity.builder().tableName(tableName2).capacityUnits(10.0).build()
+ ));
+
+ List record1List = page.resultsForTable(mappedTable1);
+ assertThat(record1List.size(), is(2));
+ assertThat(record1List, containsInAnyOrder(RECORDS_1.get(0), RECORDS_1.get(1)));
+
+ List record2List = page.resultsForTable(mappedTable2);
+ assertThat(record2List.size(), is(2));
+ assertThat(record2List, containsInAnyOrder(RECORDS_2.get(0), RECORDS_2.get(1)));
+ }
+
+ @Test
+ public void notFoundRecords_withReturnConsumedCapacity() {
+ insertRecords();
+
+ BatchGetItemEnhancedRequest batchGetItemEnhancedRequest =
+ requestWithNotFoundRecord().toBuilder()
+ .returnConsumedCapacity(ReturnConsumedCapacity.TOTAL)
+ .build();
+
+ SdkPublisher publisher = enhancedAsyncClient.batchGetItem(batchGetItemEnhancedRequest);
+
+ List results = drainPublisher(publisher, 1);
+ assertThat(results.size(), is(1));
+ BatchGetResultPage page = results.get(0);
+ assertThat(page.consumedCapacity(), containsInAnyOrder(
+ ConsumedCapacity.builder().tableName(tableName1).capacityUnits(10.0).build(),
+ ConsumedCapacity.builder().tableName(tableName2).capacityUnits(10.0).build()
+ ));
+
+ List record1List = page.resultsForTable(mappedTable1);
+ assertThat(record1List.size(), is(1));
+ assertThat(record1List.get(0).getId(), is(0));
+
+ List record2List = page.resultsForTable(mappedTable2);
+ assertThat(record2List.size(), is(2));
+ assertThat(record2List, containsInAnyOrder(RECORDS_2.get(0), RECORDS_2.get(1)));
+
+ }
+
private BatchGetItemEnhancedRequest requestWithNotFoundRecord() {
return BatchGetItemEnhancedRequest.builder()
.readBatches(
@@ -245,23 +335,36 @@ private BatchGetItemEnhancedRequest requestWithNotFoundRecord() {
}
private BatchGetResultPagePublisher batchGetResultPageSdkPublisherForBothTables() {
- return enhancedAsyncClient.batchGetItem(r -> r.readBatches(
- ReadBatch.builder(Record1.class)
- .mappedTableResource(mappedTable1)
- .addGetItem(i -> i.key(k -> k.partitionValue(0)))
- .build(),
- ReadBatch.builder(Record2.class)
- .mappedTableResource(mappedTable2)
- .addGetItem(i -> i.key(k -> k.partitionValue(0)))
- .build(),
- ReadBatch.builder(Record2.class)
- .mappedTableResource(mappedTable2)
- .addGetItem(i -> i.key(k -> k.partitionValue(1)))
- .build(),
- ReadBatch.builder(Record1.class)
- .mappedTableResource(mappedTable1)
- .addGetItem(i -> i.key(k -> k.partitionValue(1)))
- .build()));
+ return batchGetResultPageSdkPublisherForBothTables(null);
+ }
+
+ private BatchGetResultPagePublisher batchGetResultPageSdkPublisherForBothTables(ReturnConsumedCapacity retConsumedCapacity) {
+ return enhancedAsyncClient.batchGetItem(
+ r -> r.returnConsumedCapacity(retConsumedCapacity)
+ .readBatches(
+ ReadBatch.builder(Record1.class)
+ .mappedTableResource(mappedTable1)
+ .addGetItem(i -> i.key(k -> k.partitionValue(0)))
+ .build(),
+ ReadBatch.builder(Record2.class)
+ .mappedTableResource(mappedTable2)
+ .addGetItem(i -> i.key(k -> k.partitionValue(0)))
+ .build(),
+ ReadBatch.builder(Record2.class)
+ .mappedTableResource(mappedTable2)
+ .addGetItem(i -> i.key(k -> k.partitionValue(1)))
+ .build(),
+ ReadBatch.builder(Record1.class)
+ .mappedTableResource(mappedTable1)
+ .addGetItem(i -> i.key(k -> k.partitionValue(1)))
+ .build()
+ )
+ );
}
-}
+ private static String getStringAttrValue(int nChars) {
+ char[] bytes = new char[nChars];
+ Arrays.fill(bytes, 'a');
+ return new String(bytes);
+ }
+}
diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncGetItemWithResponseTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncGetItemWithResponseTest.java
new file mode 100644
index 000000000000..9581233810fa
--- /dev/null
+++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncGetItemWithResponseTest.java
@@ -0,0 +1,200 @@
+/*
+ * Copyright 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.awssdk.enhanced.dynamodb.functionaltests;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static software.amazon.awssdk.enhanced.dynamodb.mapper.StaticAttributeTags.primaryPartitionKey;
+
+import java.util.Arrays;
+import java.util.Objects;
+import org.assertj.core.data.Offset;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncTable;
+import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedAsyncClient;
+import software.amazon.awssdk.enhanced.dynamodb.TableSchema;
+import software.amazon.awssdk.enhanced.dynamodb.mapper.StaticTableSchema;
+import software.amazon.awssdk.enhanced.dynamodb.model.GetItemEnhancedResponse;
+import software.amazon.awssdk.services.dynamodb.model.ConsumedCapacity;
+import software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity;
+
+
+public class AsyncGetItemWithResponseTest extends LocalDynamoDbAsyncTestBase {
+
+ private static final String TEST_TABLE_NAME = "get-item-table-name-2";
+ private static final TableSchema