diff --git a/.changes/2.10.21.json b/.changes/2.10.21.json index 440fa04fbf2f..b4c55737c270 100644 --- a/.changes/2.10.21.json +++ b/.changes/2.10.21.json @@ -86,6 +86,11 @@ "type": "feature", "category": "AWS CodeCommit", "description": "This release adds support for creating pull request approval rules and pull request approval rule templates in AWS CodeCommit. This allows developers to block merges of pull requests, contingent on the approval rules being satisfiied." + }, + { + "type": "feature", + "category": "Amazon Elastic Compute Cloud", + "description": "Upgrades to Instance Metadata Service version 2 (IMDS v2). With IMDS v2, a session token is used to make requests for EC2 instance metadata and credentials." } ] -} \ No newline at end of file +} diff --git a/.changes/2.15.10.json b/.changes/2.15.10.json new file mode 100644 index 000000000000..ad3529cf9916 --- /dev/null +++ b/.changes/2.15.10.json @@ -0,0 +1,36 @@ +{ + "version": "2.15.10", + "date": "2020-10-19", + "entries": [ + { + "type": "feature", + "category": "AWS Service Catalog", + "description": "An Admin can now update the launch role associated with a Provisioned Product. Admins and End Users can now view the launch role associated with a Provisioned Product." + }, + { + "type": "feature", + "category": "Amazon Simple Systems Manager (SSM)", + "description": "This Patch Manager release now supports Common Vulnerabilities and Exposure (CVE) Ids for missing packages via the DescribeInstancePatches API." + }, + { + "type": "feature", + "category": "HTTP Client SPI", + "description": "Calling the SdkHttpFullRequest uri() builder method, query parameters of the provided URI will be kept.\nThis can be useful in case you want to provide an already fully formed URI like a callback URI." + }, + { + "type": "feature", + "category": "Amazon CloudFront", + "description": "Amazon CloudFront adds support for Origin Shield." + }, + { + "type": "feature", + "category": "Amazon DocumentDB with MongoDB compatibility", + "description": "Documentation updates for docdb" + }, + { + "type": "feature", + "category": "AWS Backup", + "description": "Documentation updates for Cryo" + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.11.json b/.changes/2.15.11.json new file mode 100644 index 000000000000..5f5b3016ea01 --- /dev/null +++ b/.changes/2.15.11.json @@ -0,0 +1,46 @@ +{ + "version": "2.15.11", + "date": "2020-10-20", + "entries": [ + { + "type": "bugfix", + "category": "Amazon S3", + "description": "Fixed an issue where metrics were not being collected for Amazon S3 (or other XML services)" + }, + { + "type": "feature", + "category": "AWS Batch", + "description": "Adding evaluateOnExit to job retry strategies." + }, + { + "type": "bugfix", + "category": "AWS SDK for Java v2", + "description": "Fixed an issue where requestBody and asyncRequestBody were not visible in ExecutionInterceptor.afterMarshalling." + }, + { + "type": "feature", + "category": "AWS Elastic Beanstalk", + "description": "EnvironmentStatus enum update to include Aborting, LinkingFrom and LinkingTo" + }, + { + "type": "feature", + "category": "AWS AppSync", + "description": "Documentation updates to AppSync to correct several typos." + }, + { + "type": "feature", + "category": "Amazon S3", + "description": "Moved the logic for calculating the Content-MD5 checksums from s3 to sdk-core. As always, make sure to use a version of 'sdk-core' greater than or equal to your version of 's3'. If you use an old version of 'sdk-core' and a new version of 's3', you will receive errors that Content-MD5 is required." + }, + { + "type": "bugfix", + "category": "Amazon DynamoDB Enhanced Client", + "description": "Fix for handling special characters in attribute names with WRITE_IF_NOT_EXISTS update behavior" + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "description": "Updated service endpoint metadata." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.12.json b/.changes/2.15.12.json new file mode 100644 index 000000000000..dd77de617bf4 --- /dev/null +++ b/.changes/2.15.12.json @@ -0,0 +1,36 @@ +{ + "version": "2.15.12", + "date": "2020-10-21", + "entries": [ + { + "type": "feature", + "category": "AWS Global Accelerator", + "description": "This release adds support for specifying port overrides on AWS Global Accelerator endpoint groups." + }, + { + "type": "feature", + "category": "AWS Organizations", + "description": "AWS Organizations renamed the 'master account' to 'management account'." + }, + { + "type": "feature", + "category": "AWSKendraFrontendService", + "description": "This release adds custom data sources: a new data source type that gives you full control of the documents added, modified or deleted during a data source sync while providing run history metrics." + }, + { + "type": "feature", + "category": "AWS Glue", + "description": "AWS Glue crawlers now support incremental crawls for the Amazon Simple Storage Service (Amazon S3) data source." + }, + { + "type": "feature", + "category": "Amazon Elastic Compute Cloud", + "description": "instance-storage-info nvmeSupport added to DescribeInstanceTypes API" + }, + { + "type": "feature", + "category": "Amazon CloudFront", + "description": "CloudFront adds support for managing the public keys for signed URLs and signed cookies directly in CloudFront (it no longer requires the AWS root account)." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.13.json b/.changes/2.15.13.json new file mode 100644 index 000000000000..293eccb6f4cb --- /dev/null +++ b/.changes/2.15.13.json @@ -0,0 +1,31 @@ +{ + "version": "2.15.13", + "date": "2020-10-22", + "entries": [ + { + "type": "feature", + "category": "Amazon Appflow", + "description": "Salesforce connector creation with customer provided client id and client secret, incremental pull configuration, salesforce upsert write operations and execution ID when on-demand flows are executed." + }, + { + "type": "feature", + "category": "Amazon Simple Notification Service", + "description": "SNS now supports a new class of topics: FIFO (First-In-First-Out). FIFO topics provide strictly-ordered, deduplicated, filterable, encryptable, many-to-many messaging at scale." + }, + { + "type": "feature", + "category": "Access Analyzer", + "description": "API Documentation updates for IAM Access Analyzer." + }, + { + "type": "feature", + "category": "AWS Service Catalog", + "description": "Documentation updates for servicecatalog" + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "description": "Updated service endpoint metadata." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.14.json b/.changes/2.15.14.json new file mode 100644 index 000000000000..1fcb96571caa --- /dev/null +++ b/.changes/2.15.14.json @@ -0,0 +1,21 @@ +{ + "version": "2.15.14", + "date": "2020-10-23", + "entries": [ + { + "type": "feature", + "category": "Amazon Macie 2", + "description": "This release of the Amazon Macie API includes miscellaneous updates and improvements to the documentation." + }, + { + "type": "feature", + "category": "Amazon QuickSight", + "description": "Support description on columns." + }, + { + "type": "feature", + "category": "AWS MediaTailor", + "description": "MediaTailor now supports ad marker passthrough for HLS. Use AdMarkerPassthrough to pass EXT-X-CUE-IN, EXT-X-CUE-OUT, and EXT-X-SPLICEPOINT-SCTE35 from origin manifests into personalized manifests." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.15.json b/.changes/2.15.15.json new file mode 100644 index 000000000000..2d738bc63a8a --- /dev/null +++ b/.changes/2.15.15.json @@ -0,0 +1,30 @@ +{ + "version": "2.15.15", + "date": "2020-10-26", + "entries": [ + { + "type": "feature", + "category": "Amazon SageMaker Service", + "contributor": "", + "description": "This release enables customers to bring custom images for use with SageMaker Studio notebooks." + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Updated service endpoint metadata." + }, + { + "type": "feature", + "category": "AWSKendraFrontendService", + "contributor": "", + "description": "Amazon Kendra now supports indexing data from Confluence Server." + }, + { + "type": "feature", + "category": "Amazon Neptune", + "contributor": "", + "description": "This feature enables custom endpoints for Amazon Neptune clusters. Custom endpoints simplify connection management when clusters contain instances with different capacities and configuration settings." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.16.json b/.changes/2.15.16.json new file mode 100644 index 000000000000..11bf666c2268 --- /dev/null +++ b/.changes/2.15.16.json @@ -0,0 +1,18 @@ +{ + "version": "2.15.16", + "date": "2020-10-27", + "entries": [ + { + "type": "feature", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Updated service endpoint metadata." + }, + { + "type": "feature", + "category": "AWS Glue", + "contributor": "", + "description": "AWS Glue machine learning transforms now support encryption-at-rest for labels and trained models." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.17.json b/.changes/2.15.17.json new file mode 100644 index 000000000000..bd993a2fa2ee --- /dev/null +++ b/.changes/2.15.17.json @@ -0,0 +1,42 @@ +{ + "version": "2.15.17", + "date": "2020-10-28", + "entries": [ + { + "type": "feature", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Updated service endpoint metadata." + }, + { + "type": "feature", + "category": "AWS IoT", + "contributor": "", + "description": "This release adds support for GG-Managed Job Namespace" + }, + { + "type": "feature", + "category": "Amazon WorkMail", + "contributor": "", + "description": "Documentation update for Amazon WorkMail" + }, + { + "type": "bugfix", + "category": "AWS SDK for Java v2", + "contributor": null, + "description": "Fixed an issue where marshalling of a modeled object was not honoring the has* method on a list/map." + }, + { + "type": "feature", + "category": "Amazon Elastic Compute Cloud", + "contributor": "", + "description": "AWS Nitro Enclaves general availability. Added support to RunInstances for creating enclave-enabled EC2 instances. New APIs to associate an ACM certificate with an IAM role, for enclave consumption." + }, + { + "type": "bugfix", + "category": "AWS SDK for Java v2", + "contributor": null, + "description": "Fixed an issue where the toString/equals/hashCode on a modeled object were not honoring the has* methods for lists and maps." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.18.json b/.changes/2.15.18.json new file mode 100644 index 000000000000..8cbbc17e81db --- /dev/null +++ b/.changes/2.15.18.json @@ -0,0 +1,48 @@ +{ + "version": "2.15.18", + "date": "2020-10-29", + "entries": [ + { + "type": "feature", + "category": "AWS Marketplace Commerce Analytics", + "contributor": "", + "description": "Documentation updates for marketplacecommerceanalytics to specify four data sets which are deprecated." + }, + { + "type": "feature", + "category": "Amazon Simple Email Service", + "contributor": "", + "description": "This release enables customers to manage their own contact lists and end-user subscription preferences." + }, + { + "type": "feature", + "category": "Elastic Load Balancing", + "contributor": "", + "description": "Application Load Balancer (ALB) now supports the gRPC protocol-version. With this release, customers can use ALB to route and load balance gRPC traffic between gRPC enabled clients and microservices." + }, + { + "type": "feature", + "category": "AWS Storage Gateway", + "contributor": "", + "description": "Adding support for access based enumeration on SMB file shares, file share visibility on SMB file shares, and file upload notifications for all file shares" + }, + { + "type": "feature", + "category": "Amazon Elastic Compute Cloud", + "contributor": "", + "description": "Support for Appliance mode on Transit Gateway that simplifies deployment of stateful network appliances. Added support for AWS Client VPN Self-Service Portal." + }, + { + "type": "feature", + "category": "Amazon API Gateway", + "contributor": "", + "description": "Support disabling the default execute-api endpoint for REST APIs." + }, + { + "type": "feature", + "category": "CodeArtifact", + "contributor": "", + "description": "Add support for tagging of CodeArtifact domain and repository resources." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.19.json b/.changes/2.15.19.json new file mode 100644 index 000000000000..16c9e44bb4c6 --- /dev/null +++ b/.changes/2.15.19.json @@ -0,0 +1,54 @@ +{ + "version": "2.15.19", + "date": "2020-10-30", + "entries": [ + { + "type": "feature", + "category": "Braket", + "contributor": "", + "description": "This release supports tagging for Amazon Braket quantum-task resources. It also supports tag-based access control for quantum-task APIs." + }, + { + "type": "bugfix", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Fixing FilteringSubscriber and LimitingSubscriber to complete when subscribing criteria is completed." + }, + { + "type": "feature", + "category": "AWS Database Migration Service", + "contributor": "", + "description": "Adding DocDbSettings to support DocumentDB as a source." + }, + { + "type": "feature", + "category": "EC2 Image Builder", + "contributor": "", + "description": "This feature increases the number of accounts that can be added to the Launch permissions within an Image Builder Distribution configuration." + }, + { + "type": "feature", + "category": "Amazon ElastiCache", + "contributor": "", + "description": "Documentation updates for AWS ElastiCache" + }, + { + "type": "feature", + "category": "Amazon Simple Notification Service", + "contributor": "", + "description": "Documentation updates for Amazon SNS" + }, + { + "type": "feature", + "category": "Amazon Macie 2", + "contributor": "", + "description": "This release of the Amazon Macie API adds an eqExactMatch operator for filtering findings. With this operator you can increase the precision of your finding filters and suppression rules." + }, + { + "type": "feature", + "category": "AWS Elemental MediaLive", + "contributor": "", + "description": "Support for HLS discontinuity tags in the child manifests. Support for incomplete segment behavior in the media output. Support for automatic input failover condition settings." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.20.json b/.changes/2.15.20.json new file mode 100644 index 000000000000..01a97f5581b6 --- /dev/null +++ b/.changes/2.15.20.json @@ -0,0 +1,48 @@ +{ + "version": "2.15.20", + "date": "2020-11-02", + "entries": [ + { + "type": "bugfix", + "category": "AWS DynamoDB Enhanced Client", + "contributor": "", + "description": "Publisher streams returned by async resources in the DynamoDB Enhanced Client now correctly handle mapping errors when they are encountered in the stream by calling onError on the subscriber and then implicitly cancelling the subscription. Previously the stream would just permanently hang and never complete." + }, + { + "type": "deprecation", + "category": "AWS SSO OIDC", + "contributor": "", + "description": "Renamed/deprecated 'error_description' fields in exceptions in favor of 'errorDescription'." + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Added code generation validation that customer-visible identifiers are idiomatic (do not contain underscores). Services with underscores in their models can use rename customizations to fix these issues, or apply the 'underscoresInNameBehavior = ALLOW' customization." + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Upgrade `org.apache.httpcomponents:httpclient` version to `4.5.13`" + }, + { + "type": "bugfix", + "category": "AWS SDK for Java v2", + "contributor": null, + "description": "Fixing race condition in EventStreamAsyncResponseTransformer. Field eventsToDeliver is a LinkedList, i.e., not thread-safe. Accesses to field eventsToDeliver are protected by synchronization on itself, but not in 1 location." + }, + { + "type": "bugfix", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "The mapped publisher returned by SdkPublisher.map will now handle exceptions thrown by the mapping function by calling onError on its subscriber and then cancelling the subscription rather than throwing it back to the publishing process when it attempts to publish data." + }, + { + "type": "feature", + "category": "Amazon Elastic Compute Cloud", + "contributor": "", + "description": "This release adds support for the following features: 1. P4d instances based on NVIDIA A100 GPUs. 2. NetworkCardIndex attribute to support multiple network cards." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.21.json b/.changes/2.15.21.json new file mode 100644 index 000000000000..6251577513f5 --- /dev/null +++ b/.changes/2.15.21.json @@ -0,0 +1,72 @@ +{ + "version": "2.15.21", + "date": "2020-11-04", + "entries": [ + { + "type": "feature", + "category": "AWS Service Catalog", + "contributor": "", + "description": "Service Catalog API ListPortfolioAccess can now support a maximum PageSize of 100." + }, + { + "type": "feature", + "category": "Amazon Elasticsearch Service", + "contributor": "", + "description": "Amazon Elasticsearch Service now supports native SAML authentication that seamlessly integrates with the customers' existing SAML 2.0 Identity Provider (IdP)." + }, + { + "type": "feature", + "category": "AWSMarketplace Metering", + "contributor": "", + "description": "Adding Vendor Tagging Support in MeterUsage and BatchMeterUsage API." + }, + { + "type": "feature", + "category": "AmazonMQ", + "contributor": "", + "description": "Amazon MQ introduces support for RabbitMQ, a popular message-broker with native support for AMQP 0.9.1. You can now create fully-managed RabbitMQ brokers in the cloud." + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Updated service endpoint metadata." + }, + { + "type": "feature", + "category": "Auto Scaling", + "contributor": "", + "description": "Capacity Rebalance helps you manage and maintain workload availability during Spot interruptions by proactively augmenting your Auto Scaling group with a new instance before interrupting an old one." + }, + { + "type": "feature", + "category": "Amazon Elastic Compute Cloud", + "contributor": "", + "description": "Added support for Client Connect Handler for AWS Client VPN. Fleet supports launching replacement instances in response to Capacity Rebalance recommendation." + }, + { + "type": "feature", + "category": "AWS X-Ray", + "contributor": "", + "description": "Releasing new APIs GetInsightSummaries, GetInsightEvents, GetInsight, GetInsightImpactGraph and updating GetTimeSeriesServiceStatistics API for AWS X-Ray Insights feature" + }, + { + "type": "feature", + "category": "Amazon CloudWatch", + "contributor": "", + "description": "Documentation updates for monitoring" + }, + { + "type": "feature", + "category": "Amazon Transcribe Streaming Service", + "contributor": "", + "description": "With this release, Amazon Transcribe now supports real-time transcription from audio sources in Italian (it-IT) and German(de-DE)." + }, + { + "type": "feature", + "category": "AWS IoT", + "contributor": "", + "description": "Updated API documentation and added paginator for AWS Iot Registry ListThingPrincipals API." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.22.json b/.changes/2.15.22.json new file mode 100644 index 000000000000..ca04f429f1d0 --- /dev/null +++ b/.changes/2.15.22.json @@ -0,0 +1,72 @@ +{ + "version": "2.15.22", + "date": "2020-11-05", + "entries": [ + { + "type": "feature", + "category": "Amazon Fraud Detector", + "contributor": "", + "description": "Added support for deleting resources like Variables, ExternalModels, Outcomes, Models, ModelVersions, Labels, EventTypes and EntityTypes. Updated DeleteEvent operation to catch missing exceptions." + }, + { + "type": "feature", + "category": "AWS App Mesh", + "contributor": "", + "description": "This release adds circuit breaking capabilities to your mesh with connection pooling and outlier detection support." + }, + { + "type": "feature", + "category": "Amazon DynamoDB", + "contributor": "", + "description": "This release adds a new ReplicaStatus INACCESSIBLE_ENCRYPTION_CREDENTIALS for the Table description, indicating when a key used to encrypt a regional replica table is not accessible." + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Updated service endpoint metadata." + }, + { + "type": "feature", + "category": "Amazon EventBridge", + "contributor": "", + "description": "With this release, customers can now reprocess past events by storing the events published on event bus in an encrypted archive." + }, + { + "type": "feature", + "category": "Amazon CloudWatch Events", + "contributor": "", + "description": "With this release, customers can now reprocess past events by storing the events published on event bus in an encrypted archive." + }, + { + "type": "feature", + "category": "Amazon Elasticsearch Service", + "contributor": "", + "description": "Amazon Elasticsearch Service now provides the ability to define a custom endpoint for your domain and link an SSL certificate from ACM, making it easier to refer to Kibana and the domain endpoint." + }, + { + "type": "feature", + "category": "Amazon Relational Database Service", + "contributor": "", + "description": "Supports a new parameter to set the max allocated storage in gigabytes for the CreateDBInstanceReadReplica API." + }, + { + "type": "feature", + "category": "AWS Lambda", + "contributor": "", + "description": "Support Amazon MQ as an Event Source." + }, + { + "type": "feature", + "category": "Amazon Elastic Compute Cloud", + "contributor": "", + "description": "Documentation updates for EC2." + }, + { + "type": "feature", + "category": "AWSKendraFrontendService", + "contributor": "", + "description": "Amazon Kendra now supports providing user context in your query requests, Tokens can be JSON or JWT format. This release also introduces support for Confluence cloud datasources." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.23.json b/.changes/2.15.23.json new file mode 100644 index 000000000000..403b6fb79a9d --- /dev/null +++ b/.changes/2.15.23.json @@ -0,0 +1,36 @@ +{ + "version": "2.15.23", + "date": "2020-11-06", + "entries": [ + { + "type": "feature", + "category": "AWS IoT SiteWise", + "contributor": "", + "description": "Remove the CreatePresignedPortalUrl API" + }, + { + "type": "feature", + "category": "AWS Elemental MediaLive", + "contributor": "", + "description": "Support for SCTE35 ad markers in OnCuePoint style in RTMP outputs." + }, + { + "type": "feature", + "category": "Amazon Data Lifecycle Manager", + "contributor": "", + "description": "Amazon Data Lifecycle Manager now supports the creation and retention of EBS-backed Amazon Machine Images" + }, + { + "type": "feature", + "category": "Amazon Simple Systems Manager (SSM)", + "contributor": "", + "description": "Documentation updates for Systems Manager" + }, + { + "type": "feature", + "category": "Amazon Elastic Compute Cloud", + "contributor": "", + "description": "Network card support with four new attributes: NetworkCardIndex, NetworkPerformance, DefaultNetworkCardIndex, and MaximumNetworkInterfaces, added to the DescribeInstanceTypes API." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.24.json b/.changes/2.15.24.json new file mode 100644 index 000000000000..47b0cda8e15c --- /dev/null +++ b/.changes/2.15.24.json @@ -0,0 +1,66 @@ +{ + "version": "2.15.24", + "date": "2020-11-09", + "entries": [ + { + "type": "feature", + "category": "Amazon Elasticsearch Service", + "contributor": "", + "description": "Adding support for package versioning in Amazon Elasticsearch Service" + }, + { + "type": "feature", + "category": "AWS Storage Gateway", + "contributor": "", + "description": "Added bandwidth rate limit schedule for Tape and Volume Gateways" + }, + { + "type": "feature", + "category": "Amazon DynamoDB", + "contributor": "", + "description": "This release adds supports for exporting Amazon DynamoDB table data to Amazon S3 to perform analytics at any scale." + }, + { + "type": "feature", + "category": "AWS DataSync", + "contributor": "", + "description": "DataSync now enables customers to adjust the network bandwidth used by a running AWS DataSync task." + }, + { + "type": "feature", + "category": "Amazon Simple Storage Service", + "contributor": "", + "description": "S3 Intelligent-Tiering adds support for Archive and Deep Archive Access tiers; S3 Replication adds replication metrics and failure notifications, brings feature parity for delete marker replication" + }, + { + "type": "feature", + "category": "Amazon FSx", + "contributor": "", + "description": "This release adds support for creating DNS aliases for Amazon FSx for Windows File Server, and using AWS Backup to automate scheduled, policy-driven backup plans for Amazon FSx file systems." + }, + { + "type": "feature", + "category": "Amazon Simple Systems Manager (SSM)", + "contributor": "", + "description": "add a new filter to allow customer to filter automation executions by using resource-group which used for execute automation" + }, + { + "type": "feature", + "category": "AWS IoT Analytics", + "contributor": "", + "description": "AWS IoT Analytics now supports Late Data Notifications for datasets, dataset content creation using previous version IDs, and includes the LastMessageArrivalTime attribute for channels and datastores." + }, + { + "type": "feature", + "category": "Amazon EC2 Container Service", + "contributor": "", + "description": "This release provides native support for specifying Amazon FSx for Windows File Server file systems as volumes in your Amazon ECS task definitions." + }, + { + "type": "feature", + "category": "Amazon Macie 2", + "contributor": "", + "description": "Sensitive data findings in Amazon Macie now include enhanced location data for Apache Avro object containers and Apache Parquet files." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.25.json b/.changes/2.15.25.json new file mode 100644 index 000000000000..5dbb8443dabe --- /dev/null +++ b/.changes/2.15.25.json @@ -0,0 +1,42 @@ +{ + "version": "2.15.25", + "date": "2020-11-10", + "entries": [ + { + "type": "feature", + "category": "Amazon Elastic Compute Cloud", + "contributor": "", + "description": "This release adds support for Gateway Load Balancer VPC endpoints and VPC endpoint services" + }, + { + "type": "feature", + "category": "Amazon Simple Systems Manager (SSM)", + "contributor": "", + "description": "Add SessionId as a filter for DescribeSessions API" + }, + { + "type": "feature", + "category": "Elastic Load Balancing", + "contributor": "", + "description": "Added support for Gateway Load Balancers, which make it easy to deploy, scale, and run third-party virtual networking appliances." + }, + { + "type": "feature", + "category": "Auto Scaling", + "contributor": "", + "description": "Documentation updates and corrections for Amazon EC2 Auto Scaling API Reference and SDKs." + }, + { + "type": "bugfix", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Replaced class loading from Thread.currentThread().getContextClassLoader() to ClassLoaderHelper in ProfileCredentialsUtils and WebIdentityCredentialsUtils, since it was causing Class not found error." + }, + { + "type": "bugfix", + "category": "AWS SDK for Java v2", + "contributor": "@frosforever", + "description": "Fix default client error to have spaces between words." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.26.json b/.changes/2.15.26.json new file mode 100644 index 000000000000..57558403b69d --- /dev/null +++ b/.changes/2.15.26.json @@ -0,0 +1,54 @@ +{ + "version": "2.15.26", + "date": "2020-11-11", + "entries": [ + { + "type": "feature", + "category": "AWS Service Catalog", + "contributor": "", + "description": "Adding support to remove a Provisioned Product launch role via UpdateProvisionedProductProperties" + }, + { + "type": "feature", + "category": "Netty NIO HTTP Client", + "contributor": "", + "description": "Upgrade Netty libraries to `4.1.53.Final`, and `netty-tcnative-boringssl-static` to `2.0.34.Final`." + }, + { + "type": "feature", + "category": "AWS Glue DataBrew", + "contributor": "", + "description": "This is the initial SDK release for AWS Glue DataBrew. DataBrew is a visual data preparation tool that enables users to clean and normalize data without writing any code." + }, + { + "type": "feature", + "category": "AWS Elemental MediaConvert", + "contributor": "", + "description": "AWS Elemental MediaConvert SDK has added support for Automated ABR encoding and improved the reliability of embedded captions in accelerated outputs." + }, + { + "type": "bugfix", + "category": "Netty NIO HTTP Client", + "contributor": "", + "description": "Fix a bug where the Netty HTTP client can leak memory when a response stream is cancelled prematurely but the upstream publisher continues to invoke onNext for some time before stopping. Fixes [#2051](https://github.com/aws/aws-sdk-java-v2/issues/2051)." + }, + { + "type": "feature", + "category": "AWS Amplify", + "contributor": "", + "description": "Whereas previously custom headers were set via the app's buildspec, custom headers can now be set directly on the Amplify app for both ci/cd and manual deploy apps." + }, + { + "type": "feature", + "category": "Amazon Forecast Service", + "contributor": "", + "description": "Providing support of custom quantiles in CreatePredictor API." + }, + { + "type": "feature", + "category": "Amazon QuickSight", + "contributor": "", + "description": "QuickSight now supports Column-level security and connecting to Oracle data source." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.27.json b/.changes/2.15.27.json new file mode 100644 index 000000000000..cc9e30fd7cbf --- /dev/null +++ b/.changes/2.15.27.json @@ -0,0 +1,48 @@ +{ + "version": "2.15.27", + "date": "2020-11-12", + "entries": [ + { + "type": "feature", + "category": "AWS IoT", + "contributor": "", + "description": "This release adds a batchMode parameter to the IotEvents, IotAnalytics, and Firehose actions which allows customers to send an array of messages to the corresponding services" + }, + { + "type": "feature", + "category": "Amazon Personalize Runtime", + "contributor": "", + "description": "Adds support to use dynamic filters with Personalize." + }, + { + "type": "feature", + "category": "Amazon Lex Model Building Service", + "contributor": "", + "description": "Lex now supports es-ES, it-IT, fr-FR and fr-CA locales" + }, + { + "type": "feature", + "category": "AWS RoboMaker", + "contributor": "", + "description": "This release introduces Robomaker Worldforge TagsOnCreate which allows customers to tag worlds as they are being generated by providing the tags while configuring a world generation job." + }, + { + "type": "feature", + "category": "AWS Service Catalog App Registry", + "contributor": "", + "description": "AWS Service Catalog AppRegistry provides a repository of your applications, their resources, and the application metadata that you use within your enterprise." + }, + { + "type": "feature", + "category": "Amazon Lightsail", + "contributor": "", + "description": "This release adds support for Amazon Lightsail container services. You can now create a Lightsail container service, and deploy Docker images to it." + }, + { + "type": "feature", + "category": "Amazon Polly", + "contributor": "", + "description": "Amazon Polly adds new Australian English female voice - Olivia. Olivia is available as Neural voice only." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.28.json b/.changes/2.15.28.json new file mode 100644 index 000000000000..324074327277 --- /dev/null +++ b/.changes/2.15.28.json @@ -0,0 +1,30 @@ +{ + "version": "2.15.28", + "date": "2020-11-13", + "entries": [ + { + "type": "feature", + "category": "Elastic Load Balancing", + "contributor": "", + "description": "Adds dualstack support for Network Load Balancers (TCP/TLS only), an attribute for WAF fail open for Application Load Balancers, and an attribute for connection draining for Network Load Balancers." + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Updated service endpoint metadata." + }, + { + "type": "feature", + "category": "AWS Shield", + "contributor": "", + "description": "This release adds APIs for two new features: 1) Allow customers to bundle resources into protection groups and treat as a single unit. 2) Provide per-account event summaries to all AWS customers." + }, + { + "type": "feature", + "category": "Amazon Textract", + "contributor": "", + "description": "AWS Textract now allows customers to specify their own KMS key to be used for asynchronous jobs output results, AWS Textract now also recognizes handwritten text from English documents." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.29.json b/.changes/2.15.29.json new file mode 100644 index 000000000000..2e5641407367 --- /dev/null +++ b/.changes/2.15.29.json @@ -0,0 +1,60 @@ +{ + "version": "2.15.29", + "date": "2020-11-16", + "entries": [ + { + "type": "feature", + "category": "AWS Database Migration Service", + "contributor": "", + "description": "Adding MoveReplicationTask feature to move replication tasks between instances" + }, + { + "type": "feature", + "category": "AWS IoT Secure Tunneling", + "contributor": "", + "description": "Support using multiple data streams per tunnel using the Secure Tunneling multiplexing feature." + }, + { + "type": "feature", + "category": "Synthetics", + "contributor": "", + "description": "AWS Synthetics now supports Environment Variables to assign runtime parameters in the canary scripts." + }, + { + "type": "feature", + "category": "Amazon SageMaker Service", + "contributor": "", + "description": "This feature enables customers to encrypt their Amazon SageMaker Studio storage volumes with customer master keys (CMKs) managed by them in AWS Key Management Service (KMS)." + }, + { + "type": "feature", + "category": "AWS IoT SiteWise", + "contributor": "", + "description": "This release supports Unicode characters for string operations in formulae computes in SiteWise. For more information, search for SiteWise in Amazon What's new or refer the SiteWise documentation." + }, + { + "type": "feature", + "category": "AWS CodePipeline", + "contributor": "", + "description": "We show details about inbound executions and id of action executions in GetPipelineState API. We also add ConflictException to StartPipelineExecution, RetryStageExecution, StopPipelineExecution APIs." + }, + { + "type": "feature", + "category": "AWS Service Catalog", + "contributor": "", + "description": "Support import of CloudFormation stacks into Service Catalog provisioned products." + }, + { + "type": "feature", + "category": "Amazon QuickSight", + "contributor": "", + "description": "Adding new parameters for dashboard persistence" + }, + { + "type": "feature", + "category": "Amazon Simple Notification Service", + "contributor": "", + "description": "Documentation updates for Amazon SNS." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.30.json b/.changes/2.15.30.json new file mode 100644 index 000000000000..9bcbb635553e --- /dev/null +++ b/.changes/2.15.30.json @@ -0,0 +1,42 @@ +{ + "version": "2.15.30", + "date": "2020-11-17", + "entries": [ + { + "type": "feature", + "category": "Amazon Relational Database Service", + "contributor": "", + "description": "Support copy-db-snapshot in the one region on cross clusters and local cluster for RDSonVmware. Add target-custom-availability-zone parameter to specify where a snapshot should be copied." + }, + { + "type": "feature", + "category": "Firewall Management Service", + "contributor": "", + "description": "Added Firewall Manager policy support for AWS Network Firewall resources." + }, + { + "type": "feature", + "category": "Amazon Connect Service", + "contributor": "", + "description": "This release adds support for user hierarchy group and user hierarchy structure. For details, see the Release Notes in the Amazon Connect Administrator Guide." + }, + { + "type": "feature", + "category": "Amazon Macie 2", + "contributor": "", + "description": "The Amazon Macie API now has a lastRunErrorStatus property to indicate if account- or bucket-level errors occurred during the run of a one-time classification job or the latest run of a recurring job." + }, + { + "type": "feature", + "category": "AWS Network Firewall", + "contributor": "", + "description": "(New Service) AWS Network Firewall is a managed network layer firewall service that makes it easy to secure your virtual private cloud (VPC) networks and block malicious traffic." + }, + { + "type": "feature", + "category": "Amazon Chime", + "contributor": "", + "description": "This release adds CRUD APIs for Amazon Chime SipMediaApplications and SipRules. It also adds the API for creating outbound PSTN calls for Amazon Chime meetings." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.31.json b/.changes/2.15.31.json new file mode 100644 index 000000000000..de3ca883f608 --- /dev/null +++ b/.changes/2.15.31.json @@ -0,0 +1,54 @@ +{ + "version": "2.15.31", + "date": "2020-11-18", + "entries": [ + { + "type": "feature", + "category": "AWS S3 Control", + "contributor": "", + "description": "AWS S3 Storage Lens provides visibility into your storage usage and activity trends at the organization or account level, with aggregations by Region, storage class, bucket, and prefix." + }, + { + "type": "feature", + "category": "Amazon ElastiCache", + "contributor": "", + "description": "Adding Memcached 1.6 to parameter family" + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Updated service endpoint metadata." + }, + { + "type": "feature", + "category": "AWS Outposts", + "contributor": "", + "description": "Mark the Name parameter in CreateOutpost as required." + }, + { + "type": "feature", + "category": "AWS Backup", + "contributor": "", + "description": "AWS Backup now supports cross-account backup, enabling AWS customers to securely copy their backups across their AWS accounts within their AWS organizations." + }, + { + "type": "feature", + "category": "Amazon Elastic Compute Cloud", + "contributor": "", + "description": "EC2 Fleet adds support of DeleteFleets API for instant type fleets. Now you can delete an instant type fleet and terminate all associated instances with a single API call." + }, + { + "type": "feature", + "category": "AWS CodeBuild", + "contributor": "", + "description": "AWS CodeBuild - Adding Status field for Report Group" + }, + { + "type": "feature", + "category": "AWS CloudFormation", + "contributor": "", + "description": "This release adds ChangeSets support for Nested Stacks. ChangeSets offer a preview of how proposed changes to a stack might impact existing resources or create new ones." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.32.json b/.changes/2.15.32.json new file mode 100644 index 000000000000..1659d30f59fd --- /dev/null +++ b/.changes/2.15.32.json @@ -0,0 +1,84 @@ +{ + "version": "2.15.32", + "date": "2020-11-19", + "entries": [ + { + "type": "feature", + "category": "Auto Scaling", + "contributor": "", + "description": "You can now create Auto Scaling groups with multiple launch templates using a mixed instances policy, making it easy to deploy an AMI with an architecture that is different from the rest of the group." + }, + { + "type": "feature", + "category": "Amazon Lex Model Building Service", + "contributor": "", + "description": "Amazon Lex supports managing input and output contexts as well as default values for slots." + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Updated service endpoint metadata." + }, + { + "type": "feature", + "category": "AWS Elemental MediaLive", + "contributor": "", + "description": "The AWS Elemental MediaLive APIs and SDKs now support the ability to see the software update status on Link devices" + }, + { + "type": "feature", + "category": "Amazon Redshift", + "contributor": "", + "description": "Amazon Redshift support for returning ClusterNamespaceArn in describeClusters" + }, + { + "type": "feature", + "category": "Amazon EventBridge", + "contributor": "", + "description": "EventBridge now supports Resource-based policy authorization on event buses. This enables cross-account PutEvents API calls, creating cross-account rules, and simplifies permission management." + }, + { + "type": "feature", + "category": "AWS Directory Service", + "contributor": "", + "description": "Adding multi-region replication feature for AWS Managed Microsoft AD" + }, + { + "type": "feature", + "category": "Amazon Kinesis Analytics", + "contributor": "", + "description": "Amazon Kinesis Data Analytics now supports building and running streaming applications using Apache Flink 1.11 and provides a way to access the Apache Flink dashboard for supported Flink versions." + }, + { + "type": "feature", + "category": "AWS Lambda", + "contributor": "", + "description": "Added the starting position and starting position timestamp to ESM Configuration. Now customers will be able to view these fields for their ESM." + }, + { + "type": "feature", + "category": "Amazon Lex Runtime Service", + "contributor": "", + "description": "Amazon Lex now supports the ability to view and manage active contexts associated with a user session." + }, + { + "type": "feature", + "category": "AWS Cost Explorer Service", + "contributor": "", + "description": "Additional metadata that may be applicable to the recommendation." + }, + { + "type": "feature", + "category": "Amazon CloudWatch Events", + "contributor": "", + "description": "EventBridge now supports Resource-based policy authorization on event buses. This enables cross-account PutEvents API calls, creating cross-account rules, and simplifies permission management." + }, + { + "type": "feature", + "category": "AWS Glue", + "contributor": "", + "description": "Adding support for Glue Schema Registry. The AWS Glue Schema Registry is a new feature that allows you to centrally discover, control, and evolve data stream schemas." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.33.json b/.changes/2.15.33.json new file mode 100644 index 000000000000..19d7726cfee1 --- /dev/null +++ b/.changes/2.15.33.json @@ -0,0 +1,78 @@ +{ + "version": "2.15.33", + "date": "2020-11-20", + "entries": [ + { + "type": "feature", + "category": "AWS CloudHSM V2", + "contributor": "", + "description": "Added managed backup retention, a feature that enables customers to retain backups for a configurable period after which CloudHSM service will automatically delete them." + }, + { + "type": "feature", + "category": "Amazon Cognito Identity", + "contributor": "", + "description": "Added SDK pagination support for ListIdentityPools" + }, + { + "type": "feature", + "category": "Managed Streaming for Kafka", + "contributor": "", + "description": "This release adds support for PER TOPIC PER PARTITION monitoring on AWS MSK clusters." + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Updated service endpoint metadata." + }, + { + "type": "feature", + "category": "Amazon Connect Service", + "contributor": "", + "description": "This release adds a set of Amazon Connect APIs to programmatically control instance creation, modification, description and deletion." + }, + { + "type": "feature", + "category": "Amazon Macie 2", + "contributor": "", + "description": "The Amazon Macie API now provides S3 bucket metadata that indicates whether any one-time or recurring classification jobs are configured to analyze data in a bucket." + }, + { + "type": "feature", + "category": "Amazon Simple Storage Service", + "contributor": "", + "description": "Add new documentation regarding automatically generated Content-MD5 headers when using the SDK or CLI." + }, + { + "type": "feature", + "category": "Amazon Chime", + "contributor": "", + "description": "The Amazon Chime SDK for messaging provides the building blocks needed to build chat and other real-time collaboration features." + }, + { + "type": "feature", + "category": "AWS Service Catalog App Registry", + "contributor": "", + "description": "AWS Service Catalog AppRegistry Documentation update" + }, + { + "type": "feature", + "category": "Amazon CodeGuru Reviewer", + "contributor": "", + "description": "This release supports tagging repository association resources in Amazon CodeGuru Reviewer." + }, + { + "type": "feature", + "category": "AWS Single Sign-on", + "contributor": "", + "description": "Added support for retrieving SSO credentials: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html." + }, + { + "type": "feature", + "category": "AWS App Mesh", + "contributor": "", + "description": "This release makes tag value a required attribute of the tag's key-value pair." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.34.json b/.changes/2.15.34.json new file mode 100644 index 000000000000..bf6631bf63c0 --- /dev/null +++ b/.changes/2.15.34.json @@ -0,0 +1,138 @@ +{ + "version": "2.15.34", + "date": "2020-11-23", + "entries": [ + { + "type": "feature", + "category": "Amazon DynamoDB", + "contributor": "", + "description": "With this release, you can capture data changes in any Amazon DynamoDB table as an Amazon Kinesis data stream. You also can use PartiQL (SQL-compatible language) to manipulate data in DynamoDB tables." + }, + { + "type": "feature", + "category": "AWS Outposts", + "contributor": "", + "description": "Support specifying tags during the creation of the Outpost resource. Tags are now returned in the response body of Outpost APIs." + }, + { + "type": "feature", + "category": "AWS Single Sign-On Admin", + "contributor": "", + "description": "AWS Single Sign-On now enables attribute-based access control for workforce identities to simplify permissions in AWS" + }, + { + "type": "feature", + "category": "AWS Glue", + "contributor": "", + "description": "Feature1 - Glue crawler adds data lineage configuration option. Feature2 - AWS Glue Data Catalog adds APIs for PartitionIndex creation and deletion as part of Enhancement Partition Management feature." + }, + { + "type": "feature", + "category": "AWS IoT", + "contributor": "", + "description": "This release enables users to identify different file types in the over-the-air update (OTA) functionality using fileType parameter for CreateOTAUpdate API" + }, + { + "type": "feature", + "category": "Amazon Elastic MapReduce", + "contributor": "", + "description": "Add API support for EMR Studio, a new notebook-first IDE for data scientists and data engineers with single sign-on, Jupyter notebooks, automated infrastructure provisioning, and job diagnosis." + }, + { + "type": "feature", + "category": "Amazon Translate", + "contributor": "", + "description": "This update adds new operations to create and manage parallel data in Amazon Translate. Parallel data is a resource that you can use to run Active Custom Translation jobs." + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Updated service endpoint metadata." + }, + { + "type": "feature", + "category": "Amazon EC2 Container Service", + "contributor": "", + "description": "This release adds support for updating capacity providers, specifying custom instance warmup periods for capacity providers, and using deployment circuit breaker for your ECS Services." + }, + { + "type": "feature", + "category": "CodeArtifact", + "contributor": "", + "description": "Add support for the NuGet package format." + }, + { + "type": "feature", + "category": "AWS License Manager", + "contributor": "", + "description": "AWS License Manager now provides the ability for license administrators to be able to associate license configurations to AMIs shared with their AWS account" + }, + { + "type": "feature", + "category": "Auto Scaling", + "contributor": "", + "description": "Documentation updates and corrections for Amazon EC2 Auto Scaling API Reference and SDKs." + }, + { + "type": "feature", + "category": "AWS CodeStar connections", + "contributor": "", + "description": "Added support for the UpdateHost API." + }, + { + "type": "feature", + "category": "Managed Streaming for Kafka", + "contributor": "", + "description": "Adding MAINTENANCE and REBOOTING_BROKER to Cluster states." + }, + { + "type": "feature", + "category": "Amazon Timestream Query", + "contributor": "", + "description": "Amazon Timestream now supports \"QueryStatus\" in Query API which has information about cumulative bytes scanned, metered, as well as progress percentage for the query." + }, + { + "type": "feature", + "category": "Amazon ElastiCache", + "contributor": "", + "description": "Documentation updates for elasticache" + }, + { + "type": "feature", + "category": "AWS SecurityHub", + "contributor": "", + "description": "Updated the account management API to support the integration with AWS Organizations. Added new methods to allow users to view and manage the delegated administrator account for Security Hub." + }, + { + "type": "feature", + "category": "Amazon Forecast Service", + "contributor": "", + "description": "Releasing the set of PredictorBacktestExportJob APIs which allow customers to export backtest values and item-level metrics data from Predictor training." + }, + { + "type": "feature", + "category": "Amazon CloudWatch Application Insights", + "contributor": "", + "description": "Add Detected Workload to ApplicationComponent which shows the workloads that installed in the component" + }, + { + "type": "feature", + "category": "AWS Signer", + "contributor": "", + "description": "AWS Signer is launching code-signing for AWS Lambda. Now customers can cryptographically sign Lambda code to ensure trust, integrity, and functionality." + }, + { + "type": "feature", + "category": "AWS Lambda", + "contributor": "", + "description": "This release includes support for new feature: Code Signing for AWS Lambda. This adds new resources and APIs to configure Lambda functions to accept and verify signed code artifacts at deployment." + }, + { + "type": "feature", + "category": "Amazon Elastic Compute Cloud", + "contributor": "", + "description": "This release adds support for Multiple Private DNS names to DescribeVpcEndpointServices response." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.35.json b/.changes/2.15.35.json new file mode 100644 index 000000000000..27df17571e74 --- /dev/null +++ b/.changes/2.15.35.json @@ -0,0 +1,120 @@ +{ + "version": "2.15.35", + "date": "2020-11-24", + "entries": [ + { + "type": "feature", + "category": "Amazon QuickSight", + "contributor": "", + "description": "Support for embedding without user registration. New enum EmbeddingIdentityType. A potential breaking change. Affects code that refers IdentityType enum type directly instead of literal string value." + }, + { + "type": "feature", + "category": "AWS Batch", + "contributor": "", + "description": "Add Ec2Configuration in ComputeEnvironment.ComputeResources. Use in CreateComputeEnvironment API to enable AmazonLinux2 support." + }, + { + "type": "feature", + "category": "AWS CloudTrail", + "contributor": "", + "description": "CloudTrail now includes advanced event selectors, which give you finer-grained control over the events that are logged to your trail." + }, + { + "type": "feature", + "category": "AWS Elemental MediaConvert", + "contributor": "", + "description": "AWS Elemental MediaConvert SDK has added support for Vorbis and Opus audio in OGG/OGA containers." + }, + { + "type": "feature", + "category": "Amazon GameLift", + "contributor": "", + "description": "GameLift FlexMatch is now available as a standalone matchmaking solution. FlexMatch now provides customizable matchmaking for games hosted peer-to-peer, on-premises, or on cloud compute primitives." + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Updated service endpoint metadata." + }, + { + "type": "feature", + "category": "AWS CodeBuild", + "contributor": "", + "description": "Adding GetReportGroupTrend API for Test Reports." + }, + { + "type": "feature", + "category": "Amazon Comprehend", + "contributor": "", + "description": "Support Comprehend events detection APIs" + }, + { + "type": "feature", + "category": "Amazon Transcribe Streaming Service", + "contributor": "", + "description": "Amazon Transcribe Medical streaming added medical specialties and HTTP/2 support. Amazon Transcribe streaming supports additional languages. Both support OGG/OPUS and FLAC codecs for streaming." + }, + { + "type": "feature", + "category": "Amazon Appflow", + "contributor": "", + "description": "Upsolver as a destination connector and documentation update." + }, + { + "type": "feature", + "category": "Amazon Cognito Identity Provider", + "contributor": "", + "description": "This release adds ability to configure Cognito User Pools with third party sms and email providers for sending notifications to users." + }, + { + "type": "feature", + "category": "Amazon FSx", + "contributor": "", + "description": "This release adds the capability to increase storage capacity of Amazon FSx for Lustre file systems, providing the flexibility to meet evolving storage needs over time." + }, + { + "type": "feature", + "category": "AWS CloudFormation", + "contributor": "", + "description": "Adds support for the new Modules feature for CloudFormation. A module encapsulates one or more resources and their respective configurations for reuse across your organization." + }, + { + "type": "feature", + "category": "AmazonMWAA", + "contributor": "", + "description": "(New Service) Amazon MWAA is a managed service for Apache Airflow that makes it easy for data engineers and data scientists to execute data processing workflows in the cloud." + }, + { + "type": "feature", + "category": "Amazon Timestream Write", + "contributor": "", + "description": "Adds support of upserts for idempotent updates to Timestream." + }, + { + "type": "feature", + "category": "Amazon Lex Model Building Service", + "contributor": "", + "description": "Lex now supports es-419, de-DE locales" + }, + { + "type": "feature", + "category": "AWS IoT SiteWise", + "contributor": "", + "description": "This release adds support for customer managed customer master key (CMK) based encryption in IoT SiteWise." + }, + { + "type": "feature", + "category": "AWS Step Functions", + "contributor": "", + "description": "This release of the AWS Step Functions SDK introduces support for Synchronous Express Workflows" + }, + { + "type": "feature", + "category": "AWS Elastic Beanstalk", + "contributor": "", + "description": "Updates the Integer constraint of DescribeEnvironmentManagedActionHistory's MaxItems parameter to [1, 100]." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.36.json b/.changes/2.15.36.json new file mode 100644 index 000000000000..8094b61486c6 --- /dev/null +++ b/.changes/2.15.36.json @@ -0,0 +1,30 @@ +{ + "version": "2.15.36", + "date": "2020-11-30", + "entries": [ + { + "type": "bugfix", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Fixed a resource leak that could occur when closing the default credentials provider (or a client using the default credentials provider), when `closeable` credentials like STS or SSO were in use. Fixes [#2149](https://github.com/aws/aws-sdk-java-v2/issues/2149)." + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Updated service endpoint metadata." + }, + { + "type": "feature", + "category": "Amazon Elastic Compute Cloud", + "contributor": "", + "description": "This release introduces Amazon EC2 Mac1 instances, a new Amazon EC2 instance family built on Apple Mac mini computers, powered by AWS Nitro System, and support running macOS workloads on Amazon EC2" + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Add LICENSE.txt and NOTICE.txt to META-INF directory of generated JARs" + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.37.json b/.changes/2.15.37.json new file mode 100644 index 000000000000..a6db8da9a1cc --- /dev/null +++ b/.changes/2.15.37.json @@ -0,0 +1,102 @@ +{ + "version": "2.15.37", + "date": "2020-12-01", + "entries": [ + { + "type": "feature", + "category": "Amazon Elastic Compute Cloud", + "contributor": "", + "description": "This release adds support for: EBS gp3 volumes; and D3/D3en/R5b/M5zn instances powered by Intel Cascade Lake CPUs" + }, + { + "type": "feature", + "category": "AmplifyBackend", + "contributor": "", + "description": "(New Service) The Amplify Admin UI offers an accessible way to develop app backends and manage app content. We recommend that you use the Amplify Admin UI to manage the backend of your Amplify app." + }, + { + "type": "feature", + "category": "Amazon Connect Service", + "contributor": "", + "description": "This release adds an Amazon Connect API that provides the ability to create tasks, and a set of APIs (in preview) to configure AppIntegrations associations with Amazon Connect instances." + }, + { + "type": "feature", + "category": "Amazon AppIntegrations Service", + "contributor": "", + "description": "The Amazon AppIntegrations service (in preview release) enables you to configure and reuse connections to external applications." + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Updated service endpoint metadata." + }, + { + "type": "feature", + "category": "Amazon Connect Contact Lens", + "contributor": "", + "description": "Contact Lens for Amazon Connect analyzes conversations, both real-time and post-call. The ListRealtimeContactAnalysisSegments API returns a list of analysis segments for a real-time analysis session." + }, + { + "type": "feature", + "category": "Amazon SageMaker Feature Store Runtime", + "contributor": "", + "description": "This release adds support for Amazon SageMaker Feature Store, which makes it easy for customers to create, version, share, and manage curated data for machine learning (ML) development." + }, + { + "type": "feature", + "category": "Amazon Simple Storage Service", + "contributor": "", + "description": "S3 adds support for multiple-destination replication, option to sync replica modifications; S3 Bucket Keys to reduce cost of S3 SSE with AWS KMS" + }, + { + "type": "feature", + "category": "Amazon SageMaker Service", + "contributor": "", + "description": "Amazon SageMaker Pipelines for ML workflows. Amazon SageMaker Feature Store, a fully managed repository for ML features." + }, + { + "type": "feature", + "category": "Amazon Elastic Kubernetes Service", + "contributor": "", + "description": "Amazon EKS now allows you to define and manage the lifecycle for Kubernetes add-ons for your clusters. This release adds support for the AWS VPC CNI (vpc-cni)." + }, + { + "type": "feature", + "category": "Amazon DevOps Guru", + "contributor": "", + "description": "(New Service) Amazon DevOps Guru is available in public preview. It's a fully managed service that uses machine learning to analyze your operational solutions to help you find and troubleshoot issues." + }, + { + "type": "feature", + "category": "AWS Lambda", + "contributor": "", + "description": "This release includes support for a new feature: Container images support in AWS Lambda. This adds APIs for deploying functions as container images. AWS Lambda now supports memory up to 10240MB." + }, + { + "type": "feature", + "category": "AWS Directory Service", + "contributor": "", + "description": "Adding client authentication feature for AWS AD Connector" + }, + { + "type": "feature", + "category": "Amazon Lookout for Vision", + "contributor": "", + "description": "This release introduces support for Amazon Lookout for Vision." + }, + { + "type": "feature", + "category": "Amazon Honeycode", + "contributor": "", + "description": "Introducing APIs to read and write directly from Honeycode tables. Use APIs to pull table and column metadata, then use the read and write APIs to programmatically read and write from the tables." + }, + { + "type": "feature", + "category": "Amazon Elastic Container Registry Public", + "contributor": "", + "description": "Supports Amazon Elastic Container Registry (Amazon ECR) Public, a fully managed registry that makes it easy for a developer to publicly share container software worldwide for anyone to download." + } + ] +} diff --git a/.changes/2.15.38.json b/.changes/2.15.38.json new file mode 100644 index 000000000000..28f4e9b06414 --- /dev/null +++ b/.changes/2.15.38.json @@ -0,0 +1,18 @@ +{ + "version": "2.15.38", + "date": "2020-12-01", + "entries": [ + { + "type": "feature", + "category": "Amazon Connect Customer Profiles", + "contributor": "", + "description": "This is the first release of Amazon Connect Customer Profiles, a unified customer profile for your Amazon Connect contact center." + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Updated service endpoint metadata." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.39.json b/.changes/2.15.39.json new file mode 100644 index 000000000000..d3e28bac8e74 --- /dev/null +++ b/.changes/2.15.39.json @@ -0,0 +1,36 @@ +{ + "version": "2.15.39", + "date": "2020-12-03", + "entries": [ + { + "type": "feature", + "category": "AWS License Manager", + "contributor": "", + "description": "AWS License Manager enables managed entitlements for AWS customers and Software Vendors (ISV). You can track and distribute license entitlements from AWS Marketplace and supported ISVs." + }, + { + "type": "feature", + "category": "AWS Batch", + "contributor": "", + "description": "This release adds support for customer to run Batch Jobs on ECS Fargate, the serverless compute engine built for containers on AWS. Customer can also propagate Job and Job Definition Tags to ECS Task." + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "contributor": "", + "description": "Updated service endpoint metadata." + }, + { + "type": "feature", + "category": "AmplifyBackend", + "contributor": "", + "description": "Regular documentation updates." + }, + { + "type": "feature", + "category": "AWS Compute Optimizer", + "contributor": "", + "description": "This release enables AWS Compute Optimizer to analyze and generate optimization recommendations for EBS volumes that are attached to instances." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.8.json b/.changes/2.15.8.json new file mode 100644 index 000000000000..61104ed6bd0a --- /dev/null +++ b/.changes/2.15.8.json @@ -0,0 +1,96 @@ +{ + "version": "2.15.8", + "date": "2020-10-15", + "entries": [ + { + "type": "bugfix", + "category": "AWS Lambda Maven Archetype", + "description": "Fixed an issue where archetype generation failed with latest maven-archetype-plugin. See [#1981](https://github.com/aws/aws-sdk-java-v2/issues/1981)" + }, + { + "type": "feature", + "category": "Amazon Rekognition", + "description": "This SDK Release introduces new API (DetectProtectiveEquipment) for Amazon Rekognition. This release also adds ServiceQuotaExceeded exception to Amazon Rekognition IndexFaces API." + }, + { + "type": "feature", + "category": "AWS Ground Station", + "description": "Adds error message attribute to DescribeContact DataflowDetails" + }, + { + "type": "feature", + "category": "AWS Database Migration Service", + "description": "When creating Endpoints, Replication Instances, and Replication Tasks, the feature provides you the option to specify friendly name to the resources." + }, + { + "type": "feature", + "category": "Amazon WorkSpaces", + "description": "Documentation updates for WorkSpaces" + }, + { + "type": "feature", + "category": "Amazon Simple Systems Manager (SSM)", + "description": "This Patch Manager release now supports searching for available packages from Amazon Linux and Amazon Linux 2 via the DescribeAvailablePatches API." + }, + { + "type": "feature", + "category": "Amazon WorkMail", + "description": "Add CreateOrganization and DeleteOrganization API operations." + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "description": "Add support for plus (+) character in profile names" + }, + { + "type": "feature", + "category": "AWS Transfer Family", + "description": "Add support to associate VPC Security Groups at server creation." + }, + { + "type": "feature", + "category": "AWS Glue", + "description": "API Documentation updates for Glue Get-Plan API" + }, + { + "type": "feature", + "category": "AWS Cost Explorer Service", + "description": "This release improves email validation for subscriptions on the SDK endpoints." + }, + { + "type": "feature", + "category": "AWS IoT", + "description": "Add new variable, lastStatusChangeDate, to DescribeDomainConfiguration API" + }, + { + "type": "feature", + "category": "AWS X-Ray", + "description": "Enhancing CreateGroup, UpdateGroup, GetGroup and GetGroups APIs to support configuring X-Ray Insights Notifications. Adding TraceLimit information into X-Ray BatchGetTraces API response." + }, + { + "type": "feature", + "category": "Amazon Relational Database Service", + "description": "Return tags for all resources in the output of DescribeDBInstances, DescribeDBSnapshots, DescribeDBClusters, and DescribeDBClusterSnapshots API operations." + }, + { + "type": "feature", + "category": "AWS Budgets", + "description": "This release introduces AWS Budgets Actions, allowing you to define an explicit response(or set of responses) to take when your budget exceeds it's action threshold." + }, + { + "type": "feature", + "category": "Access Analyzer", + "description": "This release adds support for the ApplyArchiveRule api in IAM Access Analyzer. The ApplyArchiveRule api allows users to apply an archive rule retroactively to existing findings in an analyzer." + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "description": "Updated service endpoint metadata." + }, + { + "type": "feature", + "category": "Amazon Macie 2", + "description": "This release of the Amazon Macie API adds support for pausing and resuming classification jobs. Also, sensitive data findings now include location data for up to 15 occurrences of sensitive data." + } + ] +} \ No newline at end of file diff --git a/.changes/2.15.9.json b/.changes/2.15.9.json new file mode 100644 index 000000000000..3bc1c441b5f2 --- /dev/null +++ b/.changes/2.15.9.json @@ -0,0 +1,21 @@ +{ + "version": "2.15.9", + "date": "2020-10-16", + "entries": [ + { + "type": "feature", + "category": "AWS Organizations", + "description": "Documentation updates for AWS Organizations." + }, + { + "type": "feature", + "category": "AWS Elemental MediaLive", + "description": "The AWS Elemental MediaLive APIs and SDKs now support the ability to transfer the ownership of MediaLive Link devices across AWS accounts." + }, + { + "type": "feature", + "category": "AWS SDK for Java v2", + "description": "Updated service endpoint metadata." + } + ] +} \ No newline at end of file diff --git a/.changes/next-release/bugfix-AWSLambdaMavenArchetype-9037fcf.json b/.changes/next-release/bugfix-AWSLambdaMavenArchetype-9037fcf.json deleted file mode 100644 index 2469ca1874ae..000000000000 --- a/.changes/next-release/bugfix-AWSLambdaMavenArchetype-9037fcf.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "category": "AWS Lambda Maven Archetype", - "type": "bugfix", - "description": "Fixed an issue where archetype generation failed with latest maven-archetype-plugin. See [#1981](https://github.com/aws/aws-sdk-java-v2/issues/1981)" -} diff --git a/.github/workflows/closed-issue-message.yml b/.github/workflows/closed-issue-message.yml new file mode 100644 index 000000000000..e1137cf61719 --- /dev/null +++ b/.github/workflows/closed-issue-message.yml @@ -0,0 +1,17 @@ +name: Closed Issue Message +on: + issues: + types: [closed] +jobs: + auto_comment: + runs-on: ubuntu-latest + steps: + - uses: aws-actions/closed-issue-message@v1 + with: + # These inputs are both required + repo-token: "${{ secrets.GITHUB_TOKEN }}" + message: | + ### ⚠️COMMENT VISIBILITY WARNING⚠️ + Comments on closed issues are hard for our team to see. + If you need more assistance, please open a new issue that references this one. + If you wish to keep having a conversation with other community members under this issue feel free to do so. diff --git a/CHANGELOG.md b/CHANGELOG.md index 4065d4d91a4a..28039567cc6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,1061 @@ +# __2.15.39__ __2020-12-03__ +## __AWS Batch__ + - ### Features + - This release adds support for customer to run Batch Jobs on ECS Fargate, the serverless compute engine built for containers on AWS. Customer can also propagate Job and Job Definition Tags to ECS Task. + +## __AWS Compute Optimizer__ + - ### Features + - This release enables AWS Compute Optimizer to analyze and generate optimization recommendations for EBS volumes that are attached to instances. + +## __AWS License Manager__ + - ### Features + - AWS License Manager enables managed entitlements for AWS customers and Software Vendors (ISV). You can track and distribute license entitlements from AWS Marketplace and supported ISVs. + +## __AWS SDK for Java v2__ + - ### Features + - Updated service endpoint metadata. + +## __AmplifyBackend__ + - ### Features + - Regular documentation updates. + +# __2.15.38__ __2020-12-01__ +## __AWS SDK for Java v2__ + - ### Features + - Updated service endpoint metadata. + +## __Amazon Connect Customer Profiles__ + - ### Features + - This is the first release of Amazon Connect Customer Profiles, a unified customer profile for your Amazon Connect contact center. + +# __2.15.37__ __2020-12-01__ +## __AWS Directory Service__ + - ### Features + - Adding client authentication feature for AWS AD Connector + +## __AWS Lambda__ + - ### Features + - This release includes support for a new feature: Container images support in AWS Lambda. This adds APIs for deploying functions as container images. AWS Lambda now supports memory up to 10240MB. + +## __AWS SDK for Java v2__ + - ### Features + - Updated service endpoint metadata. + +## __Amazon AppIntegrations Service__ + - ### Features + - The Amazon AppIntegrations service (in preview release) enables you to configure and reuse connections to external applications. + +## __Amazon Connect Contact Lens__ + - ### Features + - Contact Lens for Amazon Connect analyzes conversations, both real-time and post-call. The ListRealtimeContactAnalysisSegments API returns a list of analysis segments for a real-time analysis session. + +## __Amazon Connect Service__ + - ### Features + - This release adds an Amazon Connect API that provides the ability to create tasks, and a set of APIs (in preview) to configure AppIntegrations associations with Amazon Connect instances. + +## __Amazon DevOps Guru__ + - ### Features + - (New Service) Amazon DevOps Guru is available in public preview. It's a fully managed service that uses machine learning to analyze your operational solutions to help you find and troubleshoot issues. + +## __Amazon Elastic Compute Cloud__ + - ### Features + - This release adds support for: EBS gp3 volumes; and D3/D3en/R5b/M5zn instances powered by Intel Cascade Lake CPUs + +## __Amazon Elastic Container Registry Public__ + - ### Features + - Supports Amazon Elastic Container Registry (Amazon ECR) Public, a fully managed registry that makes it easy for a developer to publicly share container software worldwide for anyone to download. + +## __Amazon Elastic Kubernetes Service__ + - ### Features + - Amazon EKS now allows you to define and manage the lifecycle for Kubernetes add-ons for your clusters. This release adds support for the AWS VPC CNI (vpc-cni). + +## __Amazon Honeycode__ + - ### Features + - Introducing APIs to read and write directly from Honeycode tables. Use APIs to pull table and column metadata, then use the read and write APIs to programmatically read and write from the tables. + +## __Amazon Lookout for Vision__ + - ### Features + - This release introduces support for Amazon Lookout for Vision. + +## __Amazon SageMaker Feature Store Runtime__ + - ### Features + - This release adds support for Amazon SageMaker Feature Store, which makes it easy for customers to create, version, share, and manage curated data for machine learning (ML) development. + +## __Amazon SageMaker Service__ + - ### Features + - Amazon SageMaker Pipelines for ML workflows. Amazon SageMaker Feature Store, a fully managed repository for ML features. + +## __Amazon Simple Storage Service__ + - ### Features + - S3 adds support for multiple-destination replication, option to sync replica modifications; S3 Bucket Keys to reduce cost of S3 SSE with AWS KMS + +## __AmplifyBackend__ + - ### Features + - (New Service) The Amplify Admin UI offers an accessible way to develop app backends and manage app content. We recommend that you use the Amplify Admin UI to manage the backend of your Amplify app. + +# __2.15.36__ __2020-11-30__ +## __AWS SDK for Java v2__ + - ### Features + - Add LICENSE.txt and NOTICE.txt to META-INF directory of generated JARs + - Updated service endpoint metadata. + + - ### Bugfixes + - Fixed a resource leak that could occur when closing the default credentials provider (or a client using the default credentials provider), when `closeable` credentials like STS or SSO were in use. Fixes [#2149](https://github.com/aws/aws-sdk-java-v2/issues/2149). + +## __Amazon Elastic Compute Cloud__ + - ### Features + - This release introduces Amazon EC2 Mac1 instances, a new Amazon EC2 instance family built on Apple Mac mini computers, powered by AWS Nitro System, and support running macOS workloads on Amazon EC2 + +# __2.15.35__ __2020-11-24__ +## __AWS Batch__ + - ### Features + - Add Ec2Configuration in ComputeEnvironment.ComputeResources. Use in CreateComputeEnvironment API to enable AmazonLinux2 support. + +## __AWS CloudFormation__ + - ### Features + - Adds support for the new Modules feature for CloudFormation. A module encapsulates one or more resources and their respective configurations for reuse across your organization. + +## __AWS CloudTrail__ + - ### Features + - CloudTrail now includes advanced event selectors, which give you finer-grained control over the events that are logged to your trail. + +## __AWS CodeBuild__ + - ### Features + - Adding GetReportGroupTrend API for Test Reports. + +## __AWS Elastic Beanstalk__ + - ### Features + - Updates the Integer constraint of DescribeEnvironmentManagedActionHistory's MaxItems parameter to [1, 100]. + +## __AWS Elemental MediaConvert__ + - ### Features + - AWS Elemental MediaConvert SDK has added support for Vorbis and Opus audio in OGG/OGA containers. + +## __AWS IoT SiteWise__ + - ### Features + - This release adds support for customer managed customer master key (CMK) based encryption in IoT SiteWise. + +## __AWS SDK for Java v2__ + - ### Features + - Updated service endpoint metadata. + +## __AWS Step Functions__ + - ### Features + - This release of the AWS Step Functions SDK introduces support for Synchronous Express Workflows + +## __Amazon Appflow__ + - ### Features + - Upsolver as a destination connector and documentation update. + +## __Amazon Cognito Identity Provider__ + - ### Features + - This release adds ability to configure Cognito User Pools with third party sms and email providers for sending notifications to users. + +## __Amazon Comprehend__ + - ### Features + - Support Comprehend events detection APIs + +## __Amazon FSx__ + - ### Features + - This release adds the capability to increase storage capacity of Amazon FSx for Lustre file systems, providing the flexibility to meet evolving storage needs over time. + +## __Amazon GameLift__ + - ### Features + - GameLift FlexMatch is now available as a standalone matchmaking solution. FlexMatch now provides customizable matchmaking for games hosted peer-to-peer, on-premises, or on cloud compute primitives. + +## __Amazon Lex Model Building Service__ + - ### Features + - Lex now supports es-419, de-DE locales + +## __Amazon QuickSight__ + - ### Features + - Support for embedding without user registration. New enum EmbeddingIdentityType. A potential breaking change. Affects code that refers IdentityType enum type directly instead of literal string value. + +## __Amazon Timestream Write__ + - ### Features + - Adds support of upserts for idempotent updates to Timestream. + +## __Amazon Transcribe Streaming Service__ + - ### Features + - Amazon Transcribe Medical streaming added medical specialties and HTTP/2 support. Amazon Transcribe streaming supports additional languages. Both support OGG/OPUS and FLAC codecs for streaming. + +## __AmazonMWAA__ + - ### Features + - (New Service) Amazon MWAA is a managed service for Apache Airflow that makes it easy for data engineers and data scientists to execute data processing workflows in the cloud. + +# __2.15.34__ __2020-11-23__ +## __AWS CodeStar connections__ + - ### Features + - Added support for the UpdateHost API. + +## __AWS Glue__ + - ### Features + - Feature1 - Glue crawler adds data lineage configuration option. Feature2 - AWS Glue Data Catalog adds APIs for PartitionIndex creation and deletion as part of Enhancement Partition Management feature. + +## __AWS IoT__ + - ### Features + - This release enables users to identify different file types in the over-the-air update (OTA) functionality using fileType parameter for CreateOTAUpdate API + +## __AWS Lambda__ + - ### Features + - This release includes support for new feature: Code Signing for AWS Lambda. This adds new resources and APIs to configure Lambda functions to accept and verify signed code artifacts at deployment. + +## __AWS License Manager__ + - ### Features + - AWS License Manager now provides the ability for license administrators to be able to associate license configurations to AMIs shared with their AWS account + +## __AWS Outposts__ + - ### Features + - Support specifying tags during the creation of the Outpost resource. Tags are now returned in the response body of Outpost APIs. + +## __AWS SDK for Java v2__ + - ### Features + - Updated service endpoint metadata. + +## __AWS SecurityHub__ + - ### Features + - Updated the account management API to support the integration with AWS Organizations. Added new methods to allow users to view and manage the delegated administrator account for Security Hub. + +## __AWS Signer__ + - ### Features + - AWS Signer is launching code-signing for AWS Lambda. Now customers can cryptographically sign Lambda code to ensure trust, integrity, and functionality. + +## __AWS Single Sign-On Admin__ + - ### Features + - AWS Single Sign-On now enables attribute-based access control for workforce identities to simplify permissions in AWS + +## __Amazon CloudWatch Application Insights__ + - ### Features + - Add Detected Workload to ApplicationComponent which shows the workloads that installed in the component + +## __Amazon DynamoDB__ + - ### Features + - With this release, you can capture data changes in any Amazon DynamoDB table as an Amazon Kinesis data stream. You also can use PartiQL (SQL-compatible language) to manipulate data in DynamoDB tables. + +## __Amazon EC2 Container Service__ + - ### Features + - This release adds support for updating capacity providers, specifying custom instance warmup periods for capacity providers, and using deployment circuit breaker for your ECS Services. + +## __Amazon ElastiCache__ + - ### Features + - Documentation updates for elasticache + +## __Amazon Elastic Compute Cloud__ + - ### Features + - This release adds support for Multiple Private DNS names to DescribeVpcEndpointServices response. + +## __Amazon Elastic MapReduce__ + - ### Features + - Add API support for EMR Studio, a new notebook-first IDE for data scientists and data engineers with single sign-on, Jupyter notebooks, automated infrastructure provisioning, and job diagnosis. + +## __Amazon Forecast Service__ + - ### Features + - Releasing the set of PredictorBacktestExportJob APIs which allow customers to export backtest values and item-level metrics data from Predictor training. + +## __Amazon Timestream Query__ + - ### Features + - Amazon Timestream now supports "QueryStatus" in Query API which has information about cumulative bytes scanned, metered, as well as progress percentage for the query. + +## __Amazon Translate__ + - ### Features + - This update adds new operations to create and manage parallel data in Amazon Translate. Parallel data is a resource that you can use to run Active Custom Translation jobs. + +## __Auto Scaling__ + - ### Features + - Documentation updates and corrections for Amazon EC2 Auto Scaling API Reference and SDKs. + +## __CodeArtifact__ + - ### Features + - Add support for the NuGet package format. + +## __Managed Streaming for Kafka__ + - ### Features + - Adding MAINTENANCE and REBOOTING_BROKER to Cluster states. + +# __2.15.33__ __2020-11-20__ +## __AWS App Mesh__ + - ### Features + - This release makes tag value a required attribute of the tag's key-value pair. + +## __AWS CloudHSM V2__ + - ### Features + - Added managed backup retention, a feature that enables customers to retain backups for a configurable period after which CloudHSM service will automatically delete them. + +## __AWS SDK for Java v2__ + - ### Features + - Updated service endpoint metadata. + +## __AWS Service Catalog App Registry__ + - ### Features + - AWS Service Catalog AppRegistry Documentation update + +## __AWS Single Sign-on__ + - ### Features + - Added support for retrieving SSO credentials: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html. + +## __Amazon Chime__ + - ### Features + - The Amazon Chime SDK for messaging provides the building blocks needed to build chat and other real-time collaboration features. + +## __Amazon CodeGuru Reviewer__ + - ### Features + - This release supports tagging repository association resources in Amazon CodeGuru Reviewer. + +## __Amazon Cognito Identity__ + - ### Features + - Added SDK pagination support for ListIdentityPools + +## __Amazon Connect Service__ + - ### Features + - This release adds a set of Amazon Connect APIs to programmatically control instance creation, modification, description and deletion. + +## __Amazon Macie 2__ + - ### Features + - The Amazon Macie API now provides S3 bucket metadata that indicates whether any one-time or recurring classification jobs are configured to analyze data in a bucket. + +## __Amazon Simple Storage Service__ + - ### Features + - Add new documentation regarding automatically generated Content-MD5 headers when using the SDK or CLI. + +## __Managed Streaming for Kafka__ + - ### Features + - This release adds support for PER TOPIC PER PARTITION monitoring on AWS MSK clusters. + +# __2.15.32__ __2020-11-19__ +## __AWS Cost Explorer Service__ + - ### Features + - Additional metadata that may be applicable to the recommendation. + +## __AWS Directory Service__ + - ### Features + - Adding multi-region replication feature for AWS Managed Microsoft AD + +## __AWS Elemental MediaLive__ + - ### Features + - The AWS Elemental MediaLive APIs and SDKs now support the ability to see the software update status on Link devices + +## __AWS Glue__ + - ### Features + - Adding support for Glue Schema Registry. The AWS Glue Schema Registry is a new feature that allows you to centrally discover, control, and evolve data stream schemas. + +## __AWS Lambda__ + - ### Features + - Added the starting position and starting position timestamp to ESM Configuration. Now customers will be able to view these fields for their ESM. + +## __AWS SDK for Java v2__ + - ### Features + - Updated service endpoint metadata. + +## __Amazon CloudWatch Events__ + - ### Features + - EventBridge now supports Resource-based policy authorization on event buses. This enables cross-account PutEvents API calls, creating cross-account rules, and simplifies permission management. + +## __Amazon EventBridge__ + - ### Features + - EventBridge now supports Resource-based policy authorization on event buses. This enables cross-account PutEvents API calls, creating cross-account rules, and simplifies permission management. + +## __Amazon Kinesis Analytics__ + - ### Features + - Amazon Kinesis Data Analytics now supports building and running streaming applications using Apache Flink 1.11 and provides a way to access the Apache Flink dashboard for supported Flink versions. + +## __Amazon Lex Model Building Service__ + - ### Features + - Amazon Lex supports managing input and output contexts as well as default values for slots. + +## __Amazon Lex Runtime Service__ + - ### Features + - Amazon Lex now supports the ability to view and manage active contexts associated with a user session. + +## __Amazon Redshift__ + - ### Features + - Amazon Redshift support for returning ClusterNamespaceArn in describeClusters + +## __Auto Scaling__ + - ### Features + - You can now create Auto Scaling groups with multiple launch templates using a mixed instances policy, making it easy to deploy an AMI with an architecture that is different from the rest of the group. + +# __2.15.31__ __2020-11-18__ +## __AWS Backup__ + - ### Features + - AWS Backup now supports cross-account backup, enabling AWS customers to securely copy their backups across their AWS accounts within their AWS organizations. + +## __AWS CloudFormation__ + - ### Features + - This release adds ChangeSets support for Nested Stacks. ChangeSets offer a preview of how proposed changes to a stack might impact existing resources or create new ones. + +## __AWS CodeBuild__ + - ### Features + - AWS CodeBuild - Adding Status field for Report Group + +## __AWS Outposts__ + - ### Features + - Mark the Name parameter in CreateOutpost as required. + +## __AWS S3 Control__ + - ### Features + - AWS S3 Storage Lens provides visibility into your storage usage and activity trends at the organization or account level, with aggregations by Region, storage class, bucket, and prefix. + +## __AWS SDK for Java v2__ + - ### Features + - Updated service endpoint metadata. + +## __Amazon ElastiCache__ + - ### Features + - Adding Memcached 1.6 to parameter family + +## __Amazon Elastic Compute Cloud__ + - ### Features + - EC2 Fleet adds support of DeleteFleets API for instant type fleets. Now you can delete an instant type fleet and terminate all associated instances with a single API call. + +# __2.15.30__ __2020-11-17__ +## __AWS Network Firewall__ + - ### Features + - (New Service) AWS Network Firewall is a managed network layer firewall service that makes it easy to secure your virtual private cloud (VPC) networks and block malicious traffic. + +## __Amazon Chime__ + - ### Features + - This release adds CRUD APIs for Amazon Chime SipMediaApplications and SipRules. It also adds the API for creating outbound PSTN calls for Amazon Chime meetings. + +## __Amazon Connect Service__ + - ### Features + - This release adds support for user hierarchy group and user hierarchy structure. For details, see the Release Notes in the Amazon Connect Administrator Guide. + +## __Amazon Macie 2__ + - ### Features + - The Amazon Macie API now has a lastRunErrorStatus property to indicate if account- or bucket-level errors occurred during the run of a one-time classification job or the latest run of a recurring job. + +## __Amazon Relational Database Service__ + - ### Features + - Support copy-db-snapshot in the one region on cross clusters and local cluster for RDSonVmware. Add target-custom-availability-zone parameter to specify where a snapshot should be copied. + +## __Firewall Management Service__ + - ### Features + - Added Firewall Manager policy support for AWS Network Firewall resources. + +# __2.15.29__ __2020-11-16__ +## __AWS CodePipeline__ + - ### Features + - We show details about inbound executions and id of action executions in GetPipelineState API. We also add ConflictException to StartPipelineExecution, RetryStageExecution, StopPipelineExecution APIs. + +## __AWS Database Migration Service__ + - ### Features + - Adding MoveReplicationTask feature to move replication tasks between instances + +## __AWS IoT Secure Tunneling__ + - ### Features + - Support using multiple data streams per tunnel using the Secure Tunneling multiplexing feature. + +## __AWS IoT SiteWise__ + - ### Features + - This release supports Unicode characters for string operations in formulae computes in SiteWise. For more information, search for SiteWise in Amazon What's new or refer the SiteWise documentation. + +## __AWS Service Catalog__ + - ### Features + - Support import of CloudFormation stacks into Service Catalog provisioned products. + +## __Amazon QuickSight__ + - ### Features + - Adding new parameters for dashboard persistence + +## __Amazon SageMaker Service__ + - ### Features + - This feature enables customers to encrypt their Amazon SageMaker Studio storage volumes with customer master keys (CMKs) managed by them in AWS Key Management Service (KMS). + +## __Amazon Simple Notification Service__ + - ### Features + - Documentation updates for Amazon SNS. + +## __Synthetics__ + - ### Features + - AWS Synthetics now supports Environment Variables to assign runtime parameters in the canary scripts. + +# __2.15.28__ __2020-11-13__ +## __AWS SDK for Java v2__ + - ### Features + - Updated service endpoint metadata. + +## __AWS Shield__ + - ### Features + - This release adds APIs for two new features: 1) Allow customers to bundle resources into protection groups and treat as a single unit. 2) Provide per-account event summaries to all AWS customers. + +## __Amazon Textract__ + - ### Features + - AWS Textract now allows customers to specify their own KMS key to be used for asynchronous jobs output results, AWS Textract now also recognizes handwritten text from English documents. + +## __Elastic Load Balancing__ + - ### Features + - Adds dualstack support for Network Load Balancers (TCP/TLS only), an attribute for WAF fail open for Application Load Balancers, and an attribute for connection draining for Network Load Balancers. + +# __2.15.27__ __2020-11-12__ +## __AWS IoT__ + - ### Features + - This release adds a batchMode parameter to the IotEvents, IotAnalytics, and Firehose actions which allows customers to send an array of messages to the corresponding services + +## __AWS RoboMaker__ + - ### Features + - This release introduces Robomaker Worldforge TagsOnCreate which allows customers to tag worlds as they are being generated by providing the tags while configuring a world generation job. + +## __AWS Service Catalog App Registry__ + - ### Features + - AWS Service Catalog AppRegistry provides a repository of your applications, their resources, and the application metadata that you use within your enterprise. + +## __Amazon Lex Model Building Service__ + - ### Features + - Lex now supports es-ES, it-IT, fr-FR and fr-CA locales + +## __Amazon Lightsail__ + - ### Features + - This release adds support for Amazon Lightsail container services. You can now create a Lightsail container service, and deploy Docker images to it. + +## __Amazon Personalize Runtime__ + - ### Features + - Adds support to use dynamic filters with Personalize. + +## __Amazon Polly__ + - ### Features + - Amazon Polly adds new Australian English female voice - Olivia. Olivia is available as Neural voice only. + +# __2.15.26__ __2020-11-11__ +## __AWS Amplify__ + - ### Features + - Whereas previously custom headers were set via the app's buildspec, custom headers can now be set directly on the Amplify app for both ci/cd and manual deploy apps. + +## __AWS Elemental MediaConvert__ + - ### Features + - AWS Elemental MediaConvert SDK has added support for Automated ABR encoding and improved the reliability of embedded captions in accelerated outputs. + +## __AWS Glue DataBrew__ + - ### Features + - This is the initial SDK release for AWS Glue DataBrew. DataBrew is a visual data preparation tool that enables users to clean and normalize data without writing any code. + +## __AWS Service Catalog__ + - ### Features + - Adding support to remove a Provisioned Product launch role via UpdateProvisionedProductProperties + +## __Amazon Forecast Service__ + - ### Features + - Providing support of custom quantiles in CreatePredictor API. + +## __Amazon QuickSight__ + - ### Features + - QuickSight now supports Column-level security and connecting to Oracle data source. + +## __Netty NIO HTTP Client__ + - ### Features + - Upgrade Netty libraries to `4.1.53.Final`, and `netty-tcnative-boringssl-static` to `2.0.34.Final`. + + - ### Bugfixes + - Fix a bug where the Netty HTTP client can leak memory when a response stream is cancelled prematurely but the upstream publisher continues to invoke onNext for some time before stopping. Fixes [#2051](https://github.com/aws/aws-sdk-java-v2/issues/2051). + +# __2.15.25__ __2020-11-10__ +## __AWS SDK for Java v2__ + - ### Bugfixes + - Fix default client error to have spaces between words. + - Contributed by: @frosforever + - Replaced class loading from Thread.currentThread().getContextClassLoader() to ClassLoaderHelper in ProfileCredentialsUtils and WebIdentityCredentialsUtils, since it was causing Class not found error. + +## __Amazon Elastic Compute Cloud__ + - ### Features + - This release adds support for Gateway Load Balancer VPC endpoints and VPC endpoint services + +## __Amazon Simple Systems Manager (SSM)__ + - ### Features + - Add SessionId as a filter for DescribeSessions API + +## __Auto Scaling__ + - ### Features + - Documentation updates and corrections for Amazon EC2 Auto Scaling API Reference and SDKs. + +## __Elastic Load Balancing__ + - ### Features + - Added support for Gateway Load Balancers, which make it easy to deploy, scale, and run third-party virtual networking appliances. + +## __Contributors__ +Special thanks to the following contributors to this release: + +@frosforever +# __2.15.24__ __2020-11-09__ +## __AWS DataSync__ + - ### Features + - DataSync now enables customers to adjust the network bandwidth used by a running AWS DataSync task. + +## __AWS IoT Analytics__ + - ### Features + - AWS IoT Analytics now supports Late Data Notifications for datasets, dataset content creation using previous version IDs, and includes the LastMessageArrivalTime attribute for channels and datastores. + +## __AWS Storage Gateway__ + - ### Features + - Added bandwidth rate limit schedule for Tape and Volume Gateways + +## __Amazon DynamoDB__ + - ### Features + - This release adds supports for exporting Amazon DynamoDB table data to Amazon S3 to perform analytics at any scale. + +## __Amazon EC2 Container Service__ + - ### Features + - This release provides native support for specifying Amazon FSx for Windows File Server file systems as volumes in your Amazon ECS task definitions. + +## __Amazon Elasticsearch Service__ + - ### Features + - Adding support for package versioning in Amazon Elasticsearch Service + +## __Amazon FSx__ + - ### Features + - This release adds support for creating DNS aliases for Amazon FSx for Windows File Server, and using AWS Backup to automate scheduled, policy-driven backup plans for Amazon FSx file systems. + +## __Amazon Macie 2__ + - ### Features + - Sensitive data findings in Amazon Macie now include enhanced location data for Apache Avro object containers and Apache Parquet files. + +## __Amazon Simple Storage Service__ + - ### Features + - S3 Intelligent-Tiering adds support for Archive and Deep Archive Access tiers; S3 Replication adds replication metrics and failure notifications, brings feature parity for delete marker replication + +## __Amazon Simple Systems Manager (SSM)__ + - ### Features + - add a new filter to allow customer to filter automation executions by using resource-group which used for execute automation + +# __2.15.23__ __2020-11-06__ +## __AWS Elemental MediaLive__ + - ### Features + - Support for SCTE35 ad markers in OnCuePoint style in RTMP outputs. + +## __AWS IoT SiteWise__ + - ### Features + - Remove the CreatePresignedPortalUrl API + +## __Amazon Data Lifecycle Manager__ + - ### Features + - Amazon Data Lifecycle Manager now supports the creation and retention of EBS-backed Amazon Machine Images + +## __Amazon Elastic Compute Cloud__ + - ### Features + - Network card support with four new attributes: NetworkCardIndex, NetworkPerformance, DefaultNetworkCardIndex, and MaximumNetworkInterfaces, added to the DescribeInstanceTypes API. + +## __Amazon Simple Systems Manager (SSM)__ + - ### Features + - Documentation updates for Systems Manager + +# __2.15.22__ __2020-11-05__ +## __AWS App Mesh__ + - ### Features + - This release adds circuit breaking capabilities to your mesh with connection pooling and outlier detection support. + +## __AWS Lambda__ + - ### Features + - Support Amazon MQ as an Event Source. + +## __AWS SDK for Java v2__ + - ### Features + - Updated service endpoint metadata. + +## __AWSKendraFrontendService__ + - ### Features + - Amazon Kendra now supports providing user context in your query requests, Tokens can be JSON or JWT format. This release also introduces support for Confluence cloud datasources. + +## __Amazon CloudWatch Events__ + - ### Features + - With this release, customers can now reprocess past events by storing the events published on event bus in an encrypted archive. + +## __Amazon DynamoDB__ + - ### Features + - This release adds a new ReplicaStatus INACCESSIBLE_ENCRYPTION_CREDENTIALS for the Table description, indicating when a key used to encrypt a regional replica table is not accessible. + +## __Amazon Elastic Compute Cloud__ + - ### Features + - Documentation updates for EC2. + +## __Amazon Elasticsearch Service__ + - ### Features + - Amazon Elasticsearch Service now provides the ability to define a custom endpoint for your domain and link an SSL certificate from ACM, making it easier to refer to Kibana and the domain endpoint. + +## __Amazon EventBridge__ + - ### Features + - With this release, customers can now reprocess past events by storing the events published on event bus in an encrypted archive. + +## __Amazon Fraud Detector__ + - ### Features + - Added support for deleting resources like Variables, ExternalModels, Outcomes, Models, ModelVersions, Labels, EventTypes and EntityTypes. Updated DeleteEvent operation to catch missing exceptions. + +## __Amazon Relational Database Service__ + - ### Features + - Supports a new parameter to set the max allocated storage in gigabytes for the CreateDBInstanceReadReplica API. + +# __2.15.21__ __2020-11-04__ +## __AWS IoT__ + - ### Features + - Updated API documentation and added paginator for AWS Iot Registry ListThingPrincipals API. + +## __AWS SDK for Java v2__ + - ### Features + - Updated service endpoint metadata. + +## __AWS Service Catalog__ + - ### Features + - Service Catalog API ListPortfolioAccess can now support a maximum PageSize of 100. + +## __AWS X-Ray__ + - ### Features + - Releasing new APIs GetInsightSummaries, GetInsightEvents, GetInsight, GetInsightImpactGraph and updating GetTimeSeriesServiceStatistics API for AWS X-Ray Insights feature + +## __AWSMarketplace Metering__ + - ### Features + - Adding Vendor Tagging Support in MeterUsage and BatchMeterUsage API. + +## __Amazon CloudWatch__ + - ### Features + - Documentation updates for monitoring + +## __Amazon Elastic Compute Cloud__ + - ### Features + - Added support for Client Connect Handler for AWS Client VPN. Fleet supports launching replacement instances in response to Capacity Rebalance recommendation. + +## __Amazon Elasticsearch Service__ + - ### Features + - Amazon Elasticsearch Service now supports native SAML authentication that seamlessly integrates with the customers' existing SAML 2.0 Identity Provider (IdP). + +## __Amazon Transcribe Streaming Service__ + - ### Features + - With this release, Amazon Transcribe now supports real-time transcription from audio sources in Italian (it-IT) and German(de-DE). + +## __AmazonMQ__ + - ### Features + - Amazon MQ introduces support for RabbitMQ, a popular message-broker with native support for AMQP 0.9.1. You can now create fully-managed RabbitMQ brokers in the cloud. + +## __Auto Scaling__ + - ### Features + - Capacity Rebalance helps you manage and maintain workload availability during Spot interruptions by proactively augmenting your Auto Scaling group with a new instance before interrupting an old one. + +# __2.15.20__ __2020-11-02__ +## __AWS DynamoDB Enhanced Client__ + - ### Bugfixes + - Publisher streams returned by async resources in the DynamoDB Enhanced Client now correctly handle mapping errors when they are encountered in the stream by calling onError on the subscriber and then implicitly cancelling the subscription. Previously the stream would just permanently hang and never complete. + +## __AWS SDK for Java v2__ + - ### Features + - Added code generation validation that customer-visible identifiers are idiomatic (do not contain underscores). Services with underscores in their models can use rename customizations to fix these issues, or apply the 'underscoresInNameBehavior = ALLOW' customization. + - Upgrade `org.apache.httpcomponents:httpclient` version to `4.5.13` + + - ### Bugfixes + - Fixing race condition in EventStreamAsyncResponseTransformer. Field eventsToDeliver is a LinkedList, i.e., not thread-safe. Accesses to field eventsToDeliver are protected by synchronization on itself, but not in 1 location. + - The mapped publisher returned by SdkPublisher.map will now handle exceptions thrown by the mapping function by calling onError on its subscriber and then cancelling the subscription rather than throwing it back to the publishing process when it attempts to publish data. + +## __AWS SSO OIDC__ + - ### Deprecations + - Renamed/deprecated 'error_description' fields in exceptions in favor of 'errorDescription'. + +## __Amazon Elastic Compute Cloud__ + - ### Features + - This release adds support for the following features: 1. P4d instances based on NVIDIA A100 GPUs. 2. NetworkCardIndex attribute to support multiple network cards. + +# __2.15.19__ __2020-10-30__ +## __AWS Database Migration Service__ + - ### Features + - Adding DocDbSettings to support DocumentDB as a source. + +## __AWS Elemental MediaLive__ + - ### Features + - Support for HLS discontinuity tags in the child manifests. Support for incomplete segment behavior in the media output. Support for automatic input failover condition settings. + +## __AWS SDK for Java v2__ + - ### Bugfixes + - Fixing FilteringSubscriber and LimitingSubscriber to complete when subscribing criteria is completed. + +## __Amazon ElastiCache__ + - ### Features + - Documentation updates for AWS ElastiCache + +## __Amazon Macie 2__ + - ### Features + - This release of the Amazon Macie API adds an eqExactMatch operator for filtering findings. With this operator you can increase the precision of your finding filters and suppression rules. + +## __Amazon Simple Notification Service__ + - ### Features + - Documentation updates for Amazon SNS + +## __Braket__ + - ### Features + - This release supports tagging for Amazon Braket quantum-task resources. It also supports tag-based access control for quantum-task APIs. + +## __EC2 Image Builder__ + - ### Features + - This feature increases the number of accounts that can be added to the Launch permissions within an Image Builder Distribution configuration. + +# __2.15.18__ __2020-10-29__ +## __AWS Marketplace Commerce Analytics__ + - ### Features + - Documentation updates for marketplacecommerceanalytics to specify four data sets which are deprecated. + +## __AWS Storage Gateway__ + - ### Features + - Adding support for access based enumeration on SMB file shares, file share visibility on SMB file shares, and file upload notifications for all file shares + +## __Amazon API Gateway__ + - ### Features + - Support disabling the default execute-api endpoint for REST APIs. + +## __Amazon Elastic Compute Cloud__ + - ### Features + - Support for Appliance mode on Transit Gateway that simplifies deployment of stateful network appliances. Added support for AWS Client VPN Self-Service Portal. + +## __Amazon Simple Email Service__ + - ### Features + - This release enables customers to manage their own contact lists and end-user subscription preferences. + +## __CodeArtifact__ + - ### Features + - Add support for tagging of CodeArtifact domain and repository resources. + +## __Elastic Load Balancing__ + - ### Features + - Application Load Balancer (ALB) now supports the gRPC protocol-version. With this release, customers can use ALB to route and load balance gRPC traffic between gRPC enabled clients and microservices. + +# __2.15.17__ __2020-10-28__ +## __AWS IoT__ + - ### Features + - This release adds support for GG-Managed Job Namespace + +## __AWS SDK for Java v2__ + - ### Features + - Updated service endpoint metadata. + + - ### Bugfixes + - Fixed an issue where marshalling of a modeled object was not honoring the has* method on a list/map. + - Fixed an issue where the toString/equals/hashCode on a modeled object were not honoring the has* methods for lists and maps. + +## __Amazon Elastic Compute Cloud__ + - ### Features + - AWS Nitro Enclaves general availability. Added support to RunInstances for creating enclave-enabled EC2 instances. New APIs to associate an ACM certificate with an IAM role, for enclave consumption. + +## __Amazon WorkMail__ + - ### Features + - Documentation update for Amazon WorkMail + +# __2.15.16__ __2020-10-27__ +## __AWS Glue__ + - ### Features + - AWS Glue machine learning transforms now support encryption-at-rest for labels and trained models. + +## __AWS SDK for Java v2__ + - ### Features + - Updated service endpoint metadata. + +# __2.15.15__ __2020-10-26__ +## __AWS SDK for Java v2__ + - ### Features + - Updated service endpoint metadata. + +## __AWSKendraFrontendService__ + - ### Features + - Amazon Kendra now supports indexing data from Confluence Server. + +## __Amazon Neptune__ + - ### Features + - This feature enables custom endpoints for Amazon Neptune clusters. Custom endpoints simplify connection management when clusters contain instances with different capacities and configuration settings. + +## __Amazon SageMaker Service__ + - ### Features + - This release enables customers to bring custom images for use with SageMaker Studio notebooks. + +# __2.15.14__ __2020-10-23__ +## __AWS MediaTailor__ + - ### Features + - MediaTailor now supports ad marker passthrough for HLS. Use AdMarkerPassthrough to pass EXT-X-CUE-IN, EXT-X-CUE-OUT, and EXT-X-SPLICEPOINT-SCTE35 from origin manifests into personalized manifests. + +## __Amazon Macie 2__ + - ### Features + - This release of the Amazon Macie API includes miscellaneous updates and improvements to the documentation. + +## __Amazon QuickSight__ + - ### Features + - Support description on columns. + +# __2.15.13__ __2020-10-22__ +## __AWS SDK for Java v2__ + - ### Features + - Updated service endpoint metadata. + +## __AWS Service Catalog__ + - ### Features + - Documentation updates for servicecatalog + +## __Access Analyzer__ + - ### Features + - API Documentation updates for IAM Access Analyzer. + +## __Amazon Appflow__ + - ### Features + - Salesforce connector creation with customer provided client id and client secret, incremental pull configuration, salesforce upsert write operations and execution ID when on-demand flows are executed. + +## __Amazon Simple Notification Service__ + - ### Features + - SNS now supports a new class of topics: FIFO (First-In-First-Out). FIFO topics provide strictly-ordered, deduplicated, filterable, encryptable, many-to-many messaging at scale. + +# __2.15.12__ __2020-10-21__ +## __AWS Global Accelerator__ + - ### Features + - This release adds support for specifying port overrides on AWS Global Accelerator endpoint groups. + +## __AWS Glue__ + - ### Features + - AWS Glue crawlers now support incremental crawls for the Amazon Simple Storage Service (Amazon S3) data source. + +## __AWS Organizations__ + - ### Features + - AWS Organizations renamed the 'master account' to 'management account'. + +## __AWSKendraFrontendService__ + - ### Features + - This release adds custom data sources: a new data source type that gives you full control of the documents added, modified or deleted during a data source sync while providing run history metrics. + +## __Amazon CloudFront__ + - ### Features + - CloudFront adds support for managing the public keys for signed URLs and signed cookies directly in CloudFront (it no longer requires the AWS root account). + +## __Amazon Elastic Compute Cloud__ + - ### Features + - instance-storage-info nvmeSupport added to DescribeInstanceTypes API + +# __2.15.11__ __2020-10-20__ +## __AWS AppSync__ + - ### Features + - Documentation updates to AppSync to correct several typos. + +## __AWS Batch__ + - ### Features + - Adding evaluateOnExit to job retry strategies. + +## __AWS Elastic Beanstalk__ + - ### Features + - EnvironmentStatus enum update to include Aborting, LinkingFrom and LinkingTo + +## __AWS SDK for Java v2__ + - ### Features + - Updated service endpoint metadata. + + - ### Bugfixes + - Fixed an issue where requestBody and asyncRequestBody were not visible in ExecutionInterceptor.afterMarshalling. + +## __Amazon DynamoDB Enhanced Client__ + - ### Bugfixes + - Fix for handling special characters in attribute names with WRITE_IF_NOT_EXISTS update behavior + +## __Amazon S3__ + - ### Features + - Moved the logic for calculating the Content-MD5 checksums from s3 to sdk-core. As always, make sure to use a version of 'sdk-core' greater than or equal to your version of 's3'. If you use an old version of 'sdk-core' and a new version of 's3', you will receive errors that Content-MD5 is required. + + - ### Bugfixes + - Fixed an issue where metrics were not being collected for Amazon S3 (or other XML services) + +# __2.15.10__ __2020-10-19__ +## __AWS Backup__ + - ### Features + - Documentation updates for Cryo + +## __AWS Service Catalog__ + - ### Features + - An Admin can now update the launch role associated with a Provisioned Product. Admins and End Users can now view the launch role associated with a Provisioned Product. + +## __Amazon CloudFront__ + - ### Features + - Amazon CloudFront adds support for Origin Shield. + +## __Amazon DocumentDB with MongoDB compatibility__ + - ### Features + - Documentation updates for docdb + +## __Amazon Simple Systems Manager (SSM)__ + - ### Features + - This Patch Manager release now supports Common Vulnerabilities and Exposure (CVE) Ids for missing packages via the DescribeInstancePatches API. + +## __HTTP Client SPI__ + - ### Features + - Calling the SdkHttpFullRequest uri() builder method, query parameters of the provided URI will be kept. + This can be useful in case you want to provide an already fully formed URI like a callback URI. + +# __2.15.9__ __2020-10-16__ +## __AWS Elemental MediaLive__ + - ### Features + - The AWS Elemental MediaLive APIs and SDKs now support the ability to transfer the ownership of MediaLive Link devices across AWS accounts. + +## __AWS Organizations__ + - ### Features + - Documentation updates for AWS Organizations. + +## __AWS SDK for Java v2__ + - ### Features + - Updated service endpoint metadata. + +# __2.15.8__ __2020-10-15__ +## __AWS Budgets__ + - ### Features + - This release introduces AWS Budgets Actions, allowing you to define an explicit response(or set of responses) to take when your budget exceeds it's action threshold. + +## __AWS Cost Explorer Service__ + - ### Features + - This release improves email validation for subscriptions on the SDK endpoints. + +## __AWS Database Migration Service__ + - ### Features + - When creating Endpoints, Replication Instances, and Replication Tasks, the feature provides you the option to specify friendly name to the resources. + +## __AWS Glue__ + - ### Features + - API Documentation updates for Glue Get-Plan API + +## __AWS Ground Station__ + - ### Features + - Adds error message attribute to DescribeContact DataflowDetails + +## __AWS IoT__ + - ### Features + - Add new variable, lastStatusChangeDate, to DescribeDomainConfiguration API + +## __AWS Lambda Maven Archetype__ + - ### Bugfixes + - Fixed an issue where archetype generation failed with latest maven-archetype-plugin. See [#1981](https://github.com/aws/aws-sdk-java-v2/issues/1981) + +## __AWS SDK for Java v2__ + - ### Features + - Add support for plus (+) character in profile names + - Updated service endpoint metadata. + +## __AWS Transfer Family__ + - ### Features + - Add support to associate VPC Security Groups at server creation. + +## __AWS X-Ray__ + - ### Features + - Enhancing CreateGroup, UpdateGroup, GetGroup and GetGroups APIs to support configuring X-Ray Insights Notifications. Adding TraceLimit information into X-Ray BatchGetTraces API response. + +## __Access Analyzer__ + - ### Features + - This release adds support for the ApplyArchiveRule api in IAM Access Analyzer. The ApplyArchiveRule api allows users to apply an archive rule retroactively to existing findings in an analyzer. + +## __Amazon Macie 2__ + - ### Features + - This release of the Amazon Macie API adds support for pausing and resuming classification jobs. Also, sensitive data findings now include location data for up to 15 occurrences of sensitive data. + +## __Amazon Rekognition__ + - ### Features + - This SDK Release introduces new API (DetectProtectiveEquipment) for Amazon Rekognition. This release also adds ServiceQuotaExceeded exception to Amazon Rekognition IndexFaces API. + +## __Amazon Relational Database Service__ + - ### Features + - Return tags for all resources in the output of DescribeDBInstances, DescribeDBSnapshots, DescribeDBClusters, and DescribeDBClusterSnapshots API operations. + +## __Amazon Simple Systems Manager (SSM)__ + - ### Features + - This Patch Manager release now supports searching for available packages from Amazon Linux and Amazon Linux 2 via the DescribeAvailablePatches API. + +## __Amazon WorkMail__ + - ### Features + - Add CreateOrganization and DeleteOrganization API operations. + +## __Amazon WorkSpaces__ + - ### Features + - Documentation updates for WorkSpaces + # __2.15.7__ __2020-10-09__ ## __AWS Amplify__ - ### Features @@ -4834,6 +5892,7 @@ ## __Amazon Elastic Compute Cloud__ - ### Features - This release of Amazon Elastic Compute Cloud (Amazon EC2) introduces support for Amazon Elastic Block Store (Amazon EBS) fast snapshot restores. + - Upgrades to Instance Metadata Service version 2 (IMDS v2). With IMDS v2, a session token is used to make requests for EC2 instance metadata and credentials. ## __Amazon FSx__ - ### Features diff --git a/README.md b/README.md index 6d1f6bc4bcb9..56801935eced 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ To automatically manage module versions (currently all modules have the same ver software.amazon.awssdk bom - 2.15.7 + 2.15.39 pom import @@ -83,12 +83,12 @@ Alternatively you can add dependencies for the specific services you use only: software.amazon.awssdk ec2 - 2.15.7 + 2.15.39 software.amazon.awssdk s3 - 2.15.7 + 2.15.39 ``` @@ -100,7 +100,7 @@ You can import the whole SDK into your project (includes *ALL* services). Please software.amazon.awssdk aws-sdk-java - 2.15.7 + 2.15.39 ``` @@ -132,6 +132,12 @@ You can find sample code for v2 in the following places: * [aws-doc-sdk-examples] repo. * Integration tests in this repo. They are located in the `it` directory under each service module, eg: [s3-integration-tests] +## Maintenance and Support for SDK Major Versions +For information about maintenance and support for SDK major versions and their underlying dependencies, see the following in the AWS SDKs and Tools Shared Configuration and Credentials Reference Guide: + +* [AWS SDKs and Tools Maintenance Policy][maintenance-policy] +* [AWS SDKs and Tools Version Support Matrix][version-matrix] + ## 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: @@ -161,3 +167,5 @@ We need your help in making this SDK great. Please participate in the community [bom]: http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22software.amazon.awssdk%22%20AND%20a%3A%22bom%22 [aws-doc-sdk-examples]: https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javav2 [s3-integration-tests]: https://github.com/aws/aws-sdk-java-v2/tree/master/services/s3/src/it/java/software/amazon/awssdk/services/s3 +[maintenance-policy]: https://docs.aws.amazon.com/credref/latest/refdocs/maint-policy.html +[version-matrix]: https://docs.aws.amazon.com/credref/latest/refdocs/version-support-matrix.html diff --git a/archetypes/archetype-lambda/pom.xml b/archetypes/archetype-lambda/pom.xml index 4cbb805e531b..f2ee36b2cbf9 100644 --- a/archetypes/archetype-lambda/pom.xml +++ b/archetypes/archetype-lambda/pom.xml @@ -20,7 +20,7 @@ archetypes software.amazon.awssdk - 2.15.8-SNAPSHOT + 2.15.40-SNAPSHOT 4.0.0 archetype-lambda diff --git a/archetypes/pom.xml b/archetypes/pom.xml index bde44685ed5d..9b16828cc70f 100644 --- a/archetypes/pom.xml +++ b/archetypes/pom.xml @@ -20,7 +20,7 @@ aws-sdk-java-pom software.amazon.awssdk - 2.15.8-SNAPSHOT + 2.15.40-SNAPSHOT 4.0.0 archetypes diff --git a/aws-sdk-java/pom.xml b/aws-sdk-java/pom.xml index 6ba53e8f4e66..9db31c6c9d67 100644 --- a/aws-sdk-java/pom.xml +++ b/aws-sdk-java/pom.xml @@ -17,7 +17,7 @@ software.amazon.awssdk aws-sdk-java-pom - 2.15.8-SNAPSHOT + 2.15.40-SNAPSHOT ../pom.xml aws-sdk-java @@ -1178,6 +1178,66 @@ Amazon AutoScaling, etc). s3outposts ${awsjavasdk.version} + + software.amazon.awssdk + databrew + ${awsjavasdk.version} + + + software.amazon.awssdk + servicecatalogappregistry + ${awsjavasdk.version} + + + software.amazon.awssdk + networkfirewall + ${awsjavasdk.version} + + + software.amazon.awssdk + mwaa + ${awsjavasdk.version} + + + software.amazon.awssdk + devopsguru + ${awsjavasdk.version} + + + software.amazon.awssdk + sagemakerfeaturestoreruntime + ${awsjavasdk.version} + + + software.amazon.awssdk + appintegrations + ${awsjavasdk.version} + + + software.amazon.awssdk + ecrpublic + ${awsjavasdk.version} + + + software.amazon.awssdk + amplifybackend + ${awsjavasdk.version} + + + software.amazon.awssdk + connectcontactlens + ${awsjavasdk.version} + + + software.amazon.awssdk + lookoutvision + ${awsjavasdk.version} + + + software.amazon.awssdk + customerprofiles + ${awsjavasdk.version} + ${project.artifactId}-${project.version} diff --git a/bom-internal/pom.xml b/bom-internal/pom.xml index aff1190450c5..2011c90c086f 100644 --- a/bom-internal/pom.xml +++ b/bom-internal/pom.xml @@ -20,7 +20,7 @@ aws-sdk-java-pom software.amazon.awssdk - 2.15.8-SNAPSHOT + 2.15.40-SNAPSHOT 4.0.0 diff --git a/bom/pom.xml b/bom/pom.xml index f29d383a2061..64c362c9f1c8 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -17,7 +17,7 @@ software.amazon.awssdk aws-sdk-java-pom - 2.15.8-SNAPSHOT + 2.15.40-SNAPSHOT ../pom.xml bom @@ -1298,6 +1298,71 @@ s3outposts ${awsjavasdk.version} + + software.amazon.awssdk + metrics-spi + ${awsjavasdk.version} + + + software.amazon.awssdk + databrew + ${awsjavasdk.version} + + + software.amazon.awssdk + servicecatalogappregistry + ${awsjavasdk.version} + + + software.amazon.awssdk + networkfirewall + ${awsjavasdk.version} + + + software.amazon.awssdk + mwaa + ${awsjavasdk.version} + + + software.amazon.awssdk + devopsguru + ${awsjavasdk.version} + + + software.amazon.awssdk + sagemakerfeaturestoreruntime + ${awsjavasdk.version} + + + software.amazon.awssdk + appintegrations + ${awsjavasdk.version} + + + software.amazon.awssdk + ecrpublic + ${awsjavasdk.version} + + + software.amazon.awssdk + amplifybackend + ${awsjavasdk.version} + + + software.amazon.awssdk + connectcontactlens + ${awsjavasdk.version} + + + software.amazon.awssdk + lookoutvision + ${awsjavasdk.version} + + + software.amazon.awssdk + customerprofiles + ${awsjavasdk.version} + diff --git a/build-tools/src/main/resources/software/amazon/awssdk/checkstyle-suppressions.xml b/build-tools/src/main/resources/software/amazon/awssdk/checkstyle-suppressions.xml index 394a616bb1ed..f4093089227f 100644 --- a/build-tools/src/main/resources/software/amazon/awssdk/checkstyle-suppressions.xml +++ b/build-tools/src/main/resources/software/amazon/awssdk/checkstyle-suppressions.xml @@ -42,4 +42,12 @@ + + + + + + diff --git a/build-tools/src/main/resources/software/amazon/awssdk/checkstyle.xml b/build-tools/src/main/resources/software/amazon/awssdk/checkstyle.xml index 05001c3fba7b..f02fa4c0f460 100644 --- a/build-tools/src/main/resources/software/amazon/awssdk/checkstyle.xml +++ b/build-tools/src/main/resources/software/amazon/awssdk/checkstyle.xml @@ -365,6 +365,16 @@ + + + + + + + + + @@ -373,6 +383,14 @@ + + + + + + + + diff --git a/build-tools/src/main/resources/software/amazon/awssdk/spotbugs-suppressions.xml b/build-tools/src/main/resources/software/amazon/awssdk/spotbugs-suppressions.xml index dd7633f47658..448b951a533d 100644 --- a/build-tools/src/main/resources/software/amazon/awssdk/spotbugs-suppressions.xml +++ b/build-tools/src/main/resources/software/amazon/awssdk/spotbugs-suppressions.xml @@ -212,8 +212,10 @@ + - - + + + diff --git a/bundle/pom.xml b/bundle/pom.xml index 7d6f1936123f..82380f3b5afb 100644 --- a/bundle/pom.xml +++ b/bundle/pom.xml @@ -21,7 +21,7 @@ software.amazon.awssdk aws-sdk-java-pom - 2.15.8-SNAPSHOT + 2.15.40-SNAPSHOT bundle jar diff --git a/codegen-lite-maven-plugin/pom.xml b/codegen-lite-maven-plugin/pom.xml index 3477de2cc99c..a071b0fd253d 100644 --- a/codegen-lite-maven-plugin/pom.xml +++ b/codegen-lite-maven-plugin/pom.xml @@ -22,7 +22,7 @@ software.amazon.awssdk aws-sdk-java-pom - 2.15.8-SNAPSHOT + 2.15.40-SNAPSHOT ../pom.xml codegen-lite-maven-plugin diff --git a/codegen-lite/pom.xml b/codegen-lite/pom.xml index 84f4bb764c41..9434a1e8e4a2 100644 --- a/codegen-lite/pom.xml +++ b/codegen-lite/pom.xml @@ -21,7 +21,7 @@ software.amazon.awssdk aws-sdk-java-pom - 2.15.8-SNAPSHOT + 2.15.40-SNAPSHOT codegen-lite AWS Java SDK :: Code Generator Lite diff --git a/codegen-maven-plugin/pom.xml b/codegen-maven-plugin/pom.xml index 980a88f62b7c..6e1d6d25e5b6 100644 --- a/codegen-maven-plugin/pom.xml +++ b/codegen-maven-plugin/pom.xml @@ -22,7 +22,7 @@ software.amazon.awssdk aws-sdk-java-pom - 2.15.8-SNAPSHOT + 2.15.40-SNAPSHOT ../pom.xml codegen-maven-plugin diff --git a/codegen/pom.xml b/codegen/pom.xml index 99d6d095e68d..d9d6248df79a 100644 --- a/codegen/pom.xml +++ b/codegen/pom.xml @@ -21,7 +21,7 @@ software.amazon.awssdk aws-sdk-java-pom - 2.15.8-SNAPSHOT + 2.15.40-SNAPSHOT codegen AWS Java SDK :: Code Generator diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/AddCustomAuthorizers.java b/codegen/src/main/java/software/amazon/awssdk/codegen/AddCustomAuthorizers.java deleted file mode 100644 index 011d5bb88dcd..000000000000 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/AddCustomAuthorizers.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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.codegen; - -import java.util.Map; -import java.util.stream.Collectors; -import software.amazon.awssdk.codegen.model.intermediate.AuthorizerModel; -import software.amazon.awssdk.codegen.model.service.ServiceModel; -import software.amazon.awssdk.codegen.naming.NamingStrategy; - -public class AddCustomAuthorizers { - private final ServiceModel service; - private final NamingStrategy namingStrategy; - - public AddCustomAuthorizers(ServiceModel service, NamingStrategy namingStrategy) { - this.service = service; - this.namingStrategy = namingStrategy; - } - - public Map constructAuthorizers() { - return service.getAuthorizers().values().stream() - .map(a -> new AuthorizerModel(a.getName(), - namingStrategy.getAuthorizerClassName(a.getName()), a.getTokenLocation(), - a.getTokenName())) - .collect(Collectors.toMap(AuthorizerModel::getName, a -> a)); - } -} diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/AddMetadata.java b/codegen/src/main/java/software/amazon/awssdk/codegen/AddMetadata.java index 0f2bd2ea6627..3dbb1f02aa8c 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/AddMetadata.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/AddMetadata.java @@ -20,7 +20,6 @@ import software.amazon.awssdk.codegen.model.intermediate.Metadata; import software.amazon.awssdk.codegen.model.intermediate.Protocol; import software.amazon.awssdk.codegen.model.service.AuthType; -import software.amazon.awssdk.codegen.model.service.Operation; import software.amazon.awssdk.codegen.model.service.ServiceMetadata; import software.amazon.awssdk.codegen.model.service.ServiceModel; import software.amazon.awssdk.codegen.naming.DefaultNamingStrategy; @@ -38,21 +37,11 @@ private AddMetadata() { public static Metadata constructMetadata(ServiceModel serviceModel, CustomizationConfig customizationConfig) { - Metadata metadata = new Metadata(); NamingStrategy namingStrategy = new DefaultNamingStrategy(serviceModel, customizationConfig); ServiceMetadata serviceMetadata = serviceModel.getMetadata(); - - String serviceName; - String rootPackageName; - - if (serviceMetadata.getProtocol().equals(Protocol.API_GATEWAY.getValue())) { - throw new UnsupportedOperationException("Java SDK V2 doesn't support api-gateway protocol yet"); - } else { - serviceName = namingStrategy.getServiceName(); - rootPackageName = AWS_PACKAGE_PREFIX; - } + String serviceName = namingStrategy.getServiceName(); metadata.withApiVersion(serviceMetadata.getApiVersion()) .withAsyncClient(String.format(Constant.ASYNC_CLIENT_CLASS_NAME_PATTERN, serviceName)) @@ -62,7 +51,7 @@ public static Metadata constructMetadata(ServiceModel serviceModel, .withBaseBuilderInterface(String.format(Constant.BASE_BUILDER_INTERFACE_NAME_PATTERN, serviceName)) .withBaseBuilder(String.format(Constant.BASE_BUILDER_CLASS_NAME_PATTERN, serviceName)) .withDocumentation(serviceModel.getDocumentation()) - .withRootPackageName(rootPackageName) + .withRootPackageName(AWS_PACKAGE_PREFIX) .withClientPackageName(namingStrategy.getClientPackageName(serviceName)) .withModelPackageName(namingStrategy.getModelPackageName(serviceName)) .withTransformPackageName(namingStrategy.getTransformPackageName(serviceName)) @@ -84,13 +73,10 @@ public static Metadata constructMetadata(ServiceModel serviceModel, .withEndpointPrefix(serviceMetadata.getEndpointPrefix()) .withSigningName(serviceMetadata.getSigningName()) .withAuthType(AuthType.fromValue(serviceMetadata.getSignatureVersion())) - .withRequiresApiKey(requiresApiKey(serviceModel)) .withUid(serviceMetadata.getUid()) .withServiceId(serviceMetadata.getServiceId()) - .withSupportsH2(supportsH2(serviceMetadata)); - - String jsonVersion = getJsonVersion(metadata, serviceMetadata); - metadata.setJsonVersion(jsonVersion); + .withSupportsH2(supportsH2(serviceMetadata)) + .withJsonVersion(getJsonVersion(metadata, serviceMetadata)); return metadata; } @@ -107,14 +93,4 @@ private static String getJsonVersion(Metadata metadata, ServiceMetadata serviceM return serviceMetadata.getJsonVersion(); } } - - /** - * If any operation requires an API key we generate a setter on the builder. - * - * @return True if any operation requires an API key. False otherwise. - */ - private static boolean requiresApiKey(ServiceModel serviceModel) { - return serviceModel.getOperations().values().stream() - .anyMatch(Operation::requiresApiKey); - } } diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/AddModelShapes.java b/codegen/src/main/java/software/amazon/awssdk/codegen/AddModelShapes.java index 92664189df4b..8a2492c3d003 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/AddModelShapes.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/AddModelShapes.java @@ -53,7 +53,7 @@ private Map constructModelShapes(Set shapesToSkip) { ShapeType shapeType = getModelShapeType(shape); if (shapeType != null) { - String javaClassName = getNamingStrategy().getJavaClassName(shapeName); + String javaClassName = getNamingStrategy().getShapeClassName(shapeName); if (shapesToSkip.contains(javaClassName)) { continue; } diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/AddOperations.java b/codegen/src/main/java/software/amazon/awssdk/codegen/AddOperations.java index e6a2c3cac520..db3068630790 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/AddOperations.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/AddOperations.java @@ -162,6 +162,7 @@ public Map constructOperations() { operationModel.setEndpointOperation(op.isEndpointoperation()); operationModel.setEndpointDiscovery(op.getEndpointdiscovery()); operationModel.setEndpointTrait(op.getEndpoint()); + operationModel.setHttpChecksumRequired(op.isHttpChecksumRequired()); Input input = op.getInput(); if (input != null) { diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/AddShapes.java b/codegen/src/main/java/software/amazon/awssdk/codegen/AddShapes.java index 678198a22f2f..f5da83363eac 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/AddShapes.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/AddShapes.java @@ -159,7 +159,6 @@ private MemberModel generateMemberModel(String c2jMemberName, Member c2jMemberDe variableType + " type."); } - MemberModel memberModel = new MemberModel(); memberModel.withC2jName(c2jMemberName) @@ -443,7 +442,7 @@ private void fillContainerTypeMemberMetadata(Map c2jShapes, mapValueModel)); } else if (memberC2jShape.getEnumValues() != null) { // enum values - memberModel.withEnumType(getNamingStrategy().getJavaClassName(memberC2jShapeName)); + memberModel.withEnumType(getNamingStrategy().getShapeClassName(memberC2jShapeName)); } } diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/CodeGenerator.java b/codegen/src/main/java/software/amazon/awssdk/codegen/CodeGenerator.java index 41317040a59f..f8b12acbf705 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/CodeGenerator.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/CodeGenerator.java @@ -26,7 +26,6 @@ import software.amazon.awssdk.codegen.internal.Jackson; import software.amazon.awssdk.codegen.internal.Utils; import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel; -import software.amazon.awssdk.codegen.model.intermediate.Protocol; public class CodeGenerator { @@ -125,14 +124,8 @@ private void emitCode(IntermediateModel intermediateModel) { } private GeneratorTask createGeneratorTasks(IntermediateModel intermediateModel) { - // For clients built internally, the output directory and source directory are the same. - GeneratorTaskParams params = GeneratorTaskParams.create(intermediateModel, sourcesDirectory, testsDirectory); + return new AwsGeneratorTasks(GeneratorTaskParams.create(intermediateModel, sourcesDirectory, testsDirectory)); - if (params.getModel().getMetadata().getProtocol() == Protocol.API_GATEWAY) { - throw new UnsupportedOperationException("Unsupported protocol: " + Protocol.API_GATEWAY); - } else { - return new AwsGeneratorTasks(params); - } } /** diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/IntermediateModelBuilder.java b/codegen/src/main/java/software/amazon/awssdk/codegen/IntermediateModelBuilder.java index 3b13b00b63a7..e722b421fe92 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/IntermediateModelBuilder.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/IntermediateModelBuilder.java @@ -32,11 +32,9 @@ import software.amazon.awssdk.codegen.internal.TypeUtils; import software.amazon.awssdk.codegen.internal.Utils; import software.amazon.awssdk.codegen.model.config.customization.CustomizationConfig; -import software.amazon.awssdk.codegen.model.intermediate.AuthorizerModel; import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel; import software.amazon.awssdk.codegen.model.intermediate.MemberModel; import software.amazon.awssdk.codegen.model.intermediate.OperationModel; -import software.amazon.awssdk.codegen.model.intermediate.Protocol; import software.amazon.awssdk.codegen.model.intermediate.ShapeModel; import software.amazon.awssdk.codegen.model.service.AuthType; import software.amazon.awssdk.codegen.model.service.Operation; @@ -96,8 +94,6 @@ public IntermediateModel build() { Map shapes = new HashMap<>(); Map operations = new TreeMap<>(new AddOperations(this).constructOperations()); - Map authorizers = - new HashMap<>(new AddCustomAuthorizers(this.service, getNamingStrategy()).constructAuthorizers()); // Iterate through every operation and build an 'endpointOperation' if at least one operation that supports // endpoint discovery is found. If -any operations that require- endpoint discovery are found, then the flag @@ -133,7 +129,7 @@ public IntermediateModel build() { IntermediateModel fullModel = new IntermediateModel( constructMetadata(service, customConfig), operations, shapes, - customConfig, endpointOperation, authorizers, paginators.getPagination(), namingStrategy, + customConfig, endpointOperation, paginators.getPagination(), namingStrategy, waiters.getWaiters()); customization.postprocess(fullModel); @@ -151,7 +147,6 @@ public IntermediateModel build() { trimmedShapes, fullModel.getCustomizationConfig(), endpointOperation, - fullModel.getCustomAuthorizers(), fullModel.getPaginators(), namingStrategy, fullModel.getWaiters()); @@ -162,6 +157,8 @@ public IntermediateModel build() { setSimpleMethods(trimmedModel); + namingStrategy.validateCustomerVisibleNaming(trimmedModel); + return trimmedModel; } @@ -210,33 +207,15 @@ private void linkCustomAuthorizationToRequestShapes(IntermediateModel model) { operation.getOperationName())); } - if (model.getMetadata().getProtocol() == Protocol.API_GATEWAY) { - linkAuthorizationToRequestShapeForApiGatewayProtocol(model, c2jOperation, shape); - } else { - linkAuthorizationToRequestShapeForAwsProtocol(c2jOperation.getAuthtype(), shape); - } + linkAuthorizationToRequestShapeForAwsProtocol(c2jOperation.getAuthtype(), shape); }); } - private void linkAuthorizationToRequestShapeForApiGatewayProtocol(IntermediateModel model, - Operation c2jOperation, - ShapeModel shape) { - if (AuthType.CUSTOM.equals(c2jOperation.getAuthtype())) { - AuthorizerModel auth = model.getCustomAuthorizers().get(c2jOperation.getAuthorizer()); - if (auth == null) { - throw new RuntimeException(String.format("Required custom auth not defined: %s", - c2jOperation.getAuthorizer())); - } - shape.setRequestSignerClassFqcn(model.getMetadata().getAuthPolicyPackageName() + '.' + - auth.getInterfaceName()); - } else if (AuthType.IAM.equals(c2jOperation.getAuthtype())) { - model.getMetadata().setRequiresIamSigners(true); - // TODO IamRequestSigner does not exist - shape.setRequestSignerClassFqcn("software.amazon.awssdk.opensdk.protect.auth.IamRequestSigner"); + private void linkAuthorizationToRequestShapeForAwsProtocol(AuthType authType, ShapeModel shape) { + if (authType == null) { + return; } - } - private void linkAuthorizationToRequestShapeForAwsProtocol(AuthType authType, ShapeModel shape) { switch (authType) { case V4: shape.setRequestSignerClassFqcn("software.amazon.awssdk.auth.signer.Aws4Signer"); @@ -245,8 +224,6 @@ private void linkAuthorizationToRequestShapeForAwsProtocol(AuthType authType, Sh shape.setRequestSignerClassFqcn("software.amazon.awssdk.auth.signer.Aws4UnsignedPayloadSigner"); break; case NONE: - case IAM: - // just ignore this, this is the default value but only applicable to APIG generated clients break; default: throw new IllegalArgumentException("Unsupported authtype for AWS Request: " + authType); diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/internal/TypeUtils.java b/codegen/src/main/java/software/amazon/awssdk/codegen/internal/TypeUtils.java index 1d6b554bd99e..ccbb8a39338f 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/internal/TypeUtils.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/internal/TypeUtils.java @@ -133,7 +133,7 @@ public String getJavaDataType(Map shapes, String shapeName, String shapeType = shape.getType(); if (Structure.getName().equals(shapeType)) { - return namingStrategy.getJavaClassName(shapeName); + return namingStrategy.getShapeClassName(shapeName); } else if (List.getName().equals(shapeType)) { String listContainerType = DATA_TYPE_MAPPINGS.get(TypeKey.LIST_INTERFACE); return listContainerType + "<" + diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/model/config/customization/CustomizationConfig.java b/codegen/src/main/java/software/amazon/awssdk/codegen/model/config/customization/CustomizationConfig.java index 7a90070f5548..c9fd9f339967 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/model/config/customization/CustomizationConfig.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/model/config/customization/CustomizationConfig.java @@ -119,10 +119,6 @@ public class CustomizationConfig { private Map modelMarshallerDefaultValueSupplier = new HashMap<>(); - private boolean useAutoConstructList = true; - - private boolean useAutoConstructMap = true; - /** * Custom Retry Policy */ @@ -169,6 +165,7 @@ public class CustomizationConfig { * Arnable fields used in s3 control */ private Map s3ArnableFields; + /** * Allow a customer to set an endpoint override AND bypass endpoint discovery on their client even when endpoint discovery * enabled is true and endpoint discovery is required for an operation. This customization should almost never be "true" @@ -185,6 +182,11 @@ public class CustomizationConfig { */ private Map> useLegacyEventGenerationScheme = new HashMap<>(); + /** + * How the code generator should behave when it encounters shapes with underscores in the name. + */ + private UnderscoresInNameBehavior underscoresInNameBehavior; + private CustomizationConfig() { } @@ -361,22 +363,6 @@ public void setModelMarshallerDefaultValueSupplier(Map modelMars this.modelMarshallerDefaultValueSupplier = modelMarshallerDefaultValueSupplier; } - public boolean isUseAutoConstructList() { - return useAutoConstructList; - } - - public void setUseAutoConstructList(boolean useAutoConstructList) { - this.useAutoConstructList = useAutoConstructList; - } - - public boolean isUseAutoConstructMap() { - return useAutoConstructMap; - } - - public void setUseAutoConstructMap(boolean useAutoConstructMap) { - this.useAutoConstructMap = useAutoConstructMap; - } - public String getCustomRetryPolicy() { return customRetryPolicy; } @@ -471,4 +457,17 @@ public Map> getUseLegacyEventGenerationScheme() { public void setUseLegacyEventGenerationScheme(Map> useLegacyEventGenerationScheme) { this.useLegacyEventGenerationScheme = useLegacyEventGenerationScheme; } + + public UnderscoresInNameBehavior getUnderscoresInNameBehavior() { + return underscoresInNameBehavior; + } + + public void setUnderscoresInNameBehavior(UnderscoresInNameBehavior behavior) { + this.underscoresInNameBehavior = behavior; + } + + public CustomizationConfig withUnderscoresInShapeNameBehavior(UnderscoresInNameBehavior behavior) { + this.underscoresInNameBehavior = behavior; + return this; + } } diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/model/config/customization/UnderscoresInNameBehavior.java b/codegen/src/main/java/software/amazon/awssdk/codegen/model/config/customization/UnderscoresInNameBehavior.java new file mode 100644 index 000000000000..428ae41babae --- /dev/null +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/model/config/customization/UnderscoresInNameBehavior.java @@ -0,0 +1,26 @@ +/* + * 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.codegen.model.config.customization; + +/** + * Valid values for the {@link CustomizationConfig#setUnderscoresInNameBehavior} customization. + */ +public enum UnderscoresInNameBehavior { + /** + * Allow the underscores in names, and generating shapes with names that are non-idiomatic to the language. + */ + ALLOW +} diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/IntermediateModel.java b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/IntermediateModel.java index 29f335017e7c..4948ac406dae 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/IntermediateModel.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/IntermediateModel.java @@ -20,6 +20,7 @@ import java.io.InputStream; import java.io.UncheckedIOException; import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; @@ -43,8 +44,6 @@ public final class IntermediateModel { private CustomizationConfig customizationConfig; - private Map customAuthorizers; - private Optional endpointOperation; private Map paginators; @@ -59,9 +58,11 @@ public final class IntermediateModel { } public IntermediateModel() { + this.operations = new HashMap<>(); + this.shapes = new HashMap<>(); this.endpointOperation = Optional.empty(); - this.paginators = Collections.emptyMap(); - this.waiters = Collections.emptyMap(); + this.paginators = new HashMap<>(); + this.waiters = new HashMap<>(); this.namingStrategy = null; } @@ -70,7 +71,7 @@ public IntermediateModel(Metadata metadata, Map shapes, CustomizationConfig customizationConfig) { this(metadata, operations, shapes, customizationConfig, null, - Collections.emptyMap(), Collections.emptyMap(), null, Collections.emptyMap()); + Collections.emptyMap(), null, Collections.emptyMap()); } public IntermediateModel( @@ -79,7 +80,6 @@ public IntermediateModel( Map shapes, CustomizationConfig customizationConfig, OperationModel endpointOperation, - Map customAuthorizers, Map paginators, NamingStrategy namingStrategy, Map waiters) { @@ -88,7 +88,6 @@ public IntermediateModel( this.shapes = shapes; this.customizationConfig = customizationConfig; this.endpointOperation = Optional.ofNullable(endpointOperation); - this.customAuthorizers = customAuthorizers; this.paginators = paginators; this.namingStrategy = namingStrategy; this.waiters = waiters; @@ -215,13 +214,9 @@ private static String loadDefaultFileHeader() { } public String getSdkBaseResponseFqcn() { - if (metadata.getProtocol() == Protocol.API_GATEWAY) { - return "software.amazon.awssdk.opensdk.BaseResult"; - } else { - return String.format("%s<%s>", - AwsResponse.class.getName(), - getResponseMetadataClassName()); - } + return String.format("%s<%s>", + AwsResponse.class.getName(), + getResponseMetadataClassName()); } private String getResponseMetadataClassName() { @@ -235,14 +230,6 @@ public List simpleMethodsRequiringTesting() { .collect(Collectors.toList()); } - public Map getCustomAuthorizers() { - return customAuthorizers; - } - - public void setCustomAuthorizers(Map customAuthorizers) { - this.customAuthorizers = customAuthorizers; - } - public Optional getEndpointOperation() { return endpointOperation; } diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/MemberModel.java b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/MemberModel.java index f4ccd26fbd5d..a82127f17509 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/MemberModel.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/MemberModel.java @@ -220,22 +220,6 @@ public MemberModel withBeanStyleSetterMethodName(String beanStyleSetterName) { return this; } - // TODO: Remove when all marshallers switch over to new style - public String getSetterMethodName() { - return getBeanStyleSetterMethodName(); - } - - // TODO: Remove when all marshallers switch over to new style - public void setSetterMethodName(String setterMethodName) { - setBeanStyleGetterMethodName(setterMethodName); - } - - // TODO: Remove when all marshallers switch over to new style - public MemberModel withSetterMethodName(String setterMethodName) { - setSetterMethodName(setterMethodName); - return this; - } - public String getFluentSetterMethodName() { return fluentSetterMethodName; } diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/Metadata.java b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/Metadata.java index 447e3ac012aa..eb3a83d9fb20 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/Metadata.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/Metadata.java @@ -511,7 +511,6 @@ public boolean isJsonProtocol() { return protocol == Protocol.CBOR || protocol == Protocol.ION || protocol == Protocol.AWS_JSON || - protocol == Protocol.API_GATEWAY || protocol == Protocol.REST_JSON; } @@ -531,7 +530,6 @@ public boolean isQueryProtocol() { */ public static boolean isNotRestProtocol(String protocol) { switch (Protocol.fromValue(protocol)) { - case API_GATEWAY: case REST_JSON: case REST_XML: return false; diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/OperationModel.java b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/OperationModel.java index aa1b55f8a906..eb0532056712 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/OperationModel.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/OperationModel.java @@ -62,6 +62,8 @@ public class OperationModel extends DocumentationModel { private EndpointTrait endpointTrait; + private boolean httpChecksumRequired; + public String getOperationName() { return operationName; } @@ -272,4 +274,12 @@ private boolean containsEventStream(ShapeModel shapeModel) { .filter(m -> m.getShape() != null) .anyMatch(m -> m.getShape().isEventStream()); } + + public boolean isHttpChecksumRequired() { + return httpChecksumRequired; + } + + public void setHttpChecksumRequired(boolean httpChecksumRequired) { + this.httpChecksumRequired = httpChecksumRequired; + } } diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/Protocol.java b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/Protocol.java index 9dff6efd810b..c24898551033 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/Protocol.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/model/intermediate/Protocol.java @@ -25,7 +25,6 @@ public enum Protocol { CBOR("cbor"), QUERY("query"), REST_XML("rest-xml"), - API_GATEWAY("api-gateway"), ION("ion"); private String protocol; diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/model/service/Operation.java b/codegen/src/main/java/software/amazon/awssdk/codegen/model/service/Operation.java index fe1aefdd5863..d60eb076d2fb 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/model/service/Operation.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/model/service/Operation.java @@ -36,15 +36,15 @@ public class Operation { private List errors; - private boolean requiresApiKey; - private EndpointDiscovery endpointdiscovery; private boolean endpointoperation; private EndpointTrait endpoint; - private AuthType authtype = AuthType.IAM; + private AuthType authtype; + + private boolean httpChecksumRequired; public String getName() { return name; @@ -133,14 +133,6 @@ public void setAuthorizer(String authorizer) { this.authorizer = authorizer; } - public boolean requiresApiKey() { - return requiresApiKey; - } - - public void setRequiresApiKey(boolean requiresApiKey) { - this.requiresApiKey = requiresApiKey; - } - public EndpointDiscovery getEndpointdiscovery() { return endpointdiscovery; } @@ -164,4 +156,12 @@ public EndpointTrait getEndpoint() { public void setEndpoint(EndpointTrait endpoint) { this.endpoint = endpoint; } + + public boolean isHttpChecksumRequired() { + return httpChecksumRequired; + } + + public void setHttpChecksumRequired(boolean httpChecksumRequired) { + this.httpChecksumRequired = httpChecksumRequired; + } } diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/model/service/Shape.java b/codegen/src/main/java/software/amazon/awssdk/codegen/model/service/Shape.java index c615d66fe57c..70971f8ad5a2 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/model/service/Shape.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/model/service/Shape.java @@ -20,7 +20,6 @@ import java.util.Map; public class Shape { - private String type; private Map members = Collections.emptyMap(); diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/naming/DefaultNamingStrategy.java b/codegen/src/main/java/software/amazon/awssdk/codegen/naming/DefaultNamingStrategy.java index b6bed715e3e7..0a996a7fbdf2 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/naming/DefaultNamingStrategy.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/naming/DefaultNamingStrategy.java @@ -16,7 +16,6 @@ package software.amazon.awssdk.codegen.naming; import static java.util.stream.Collectors.joining; -import static software.amazon.awssdk.codegen.internal.Constant.AUTHORIZER_NAME_PREFIX; import static software.amazon.awssdk.codegen.internal.Constant.CONFLICTING_NAME_SUFFIX; import static software.amazon.awssdk.codegen.internal.Constant.EXCEPTION_CLASS_SUFFIX; import static software.amazon.awssdk.codegen.internal.Constant.FAULT_CLASS_SUFFIX; @@ -33,22 +32,30 @@ import java.util.Objects; import java.util.Optional; import java.util.Set; +import java.util.regex.Pattern; import java.util.stream.Stream; import software.amazon.awssdk.codegen.internal.Constant; import software.amazon.awssdk.codegen.internal.Utils; import software.amazon.awssdk.codegen.model.config.customization.CustomizationConfig; +import software.amazon.awssdk.codegen.model.config.customization.UnderscoresInNameBehavior; +import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel; import software.amazon.awssdk.codegen.model.intermediate.MemberModel; +import software.amazon.awssdk.codegen.model.intermediate.Metadata; import software.amazon.awssdk.codegen.model.service.ServiceModel; import software.amazon.awssdk.codegen.model.service.Shape; import software.amazon.awssdk.utils.Logger; import software.amazon.awssdk.utils.StringUtils; +import software.amazon.awssdk.utils.Validate; /** * Default implementation of naming strategy respecting. */ public class DefaultNamingStrategy implements NamingStrategy { - private static Logger log = Logger.loggerFor(DefaultNamingStrategy.class); + private static final Logger log = Logger.loggerFor(DefaultNamingStrategy.class); + + private static final Pattern VALID_IDENTIFIER_NAME = + Pattern.compile("\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*"); private static final String COLLISION_DISAMBIGUATION_PREFIX = "Default"; @@ -97,7 +104,7 @@ public class DefaultNamingStrategy implements NamingStrategy { public DefaultNamingStrategy(ServiceModel serviceModel, CustomizationConfig customizationConfig) { this.serviceModel = serviceModel; - this.customizationConfig = customizationConfig; + this.customizationConfig = customizationConfig == null ? CustomizationConfig.create() : customizationConfig; } private static boolean isJavaKeyword(String word) { @@ -179,7 +186,6 @@ public String getSmokeTestPackageName(String serviceName) { * if provided or service name with the shared service name. */ private String concatServiceNameIfShareModel(String serviceName) { - if (customizationConfig.getShareModelConfig() != null) { return customizationConfig.getShareModelConfig().getShareModelWith() + "." + Optional.ofNullable(customizationConfig.getShareModelConfig().getPackageName()).orElse(serviceName); @@ -269,20 +275,8 @@ public String getEnumValueName(String enumValue) { } @Override - public String getJavaClassName(String shapeName) { - return Arrays.stream(shapeName.split("[._-]|\\W")) - .filter(s -> !StringUtils.isEmpty(s)) - .map(Utils::capitalize) - .collect(joining()); - } - - @Override - public String getAuthorizerClassName(String shapeName) { - String converted = getJavaClassName(shapeName); - if (converted.length() > 0 && !Character.isLetter(converted.charAt(0))) { - return AUTHORIZER_NAME_PREFIX + converted; - } - return converted; + public String getShapeClassName(String shapeName) { + return Utils.capitalize(shapeName); } @Override @@ -384,4 +378,63 @@ private boolean isDisallowedNameForShape(String name, Shape parentShape) { return RESERVED_STRUCTURE_METHOD_NAMES.contains(name); } } + + @Override + public void validateCustomerVisibleNaming(IntermediateModel trimmedModel) { + Metadata metadata = trimmedModel.getMetadata(); + validateCustomerVisibleName(metadata.getSyncInterface(), "metadata-derived interface name"); + validateCustomerVisibleName(metadata.getSyncBuilderInterface(), "metadata-derived builder interface name"); + validateCustomerVisibleName(metadata.getAsyncInterface(), "metadata-derived async interface name"); + validateCustomerVisibleName(metadata.getAsyncBuilderInterface(), "metadata-derived async builder interface name"); + validateCustomerVisibleName(metadata.getBaseBuilderInterface(), "metadata-derived builder interface name"); + validateCustomerVisibleName(metadata.getBaseExceptionName(), "metadata-derived exception name"); + validateCustomerVisibleName(metadata.getBaseRequestName(), "metadata-derived request name"); + validateCustomerVisibleName(metadata.getBaseResponseName(), "metadata-derived response name"); + + trimmedModel.getOperations().values().forEach(operation -> { + validateCustomerVisibleName(operation.getOperationName(), "operations"); + }); + + trimmedModel.getWaiters().forEach((name, waiter) -> { + validateCustomerVisibleName(name, "waiters"); + }); + + trimmedModel.getShapes().values().forEach(shape -> { + String shapeName = shape.getShapeName(); + validateCustomerVisibleName(shapeName, "shapes"); + shape.getMembers().forEach(member -> { + validateCustomerVisibleName(member.getFluentGetterMethodName(), shapeName + " shape"); + validateCustomerVisibleName(member.getFluentSetterMethodName(), shapeName + " shape"); + validateCustomerVisibleName(member.getFluentEnumGetterMethodName(), shapeName + " shape"); + validateCustomerVisibleName(member.getFluentEnumSetterMethodName(), shapeName + " shape"); + validateCustomerVisibleName(member.getExistenceCheckMethodName(), shapeName + " shape"); + validateCustomerVisibleName(member.getBeanStyleGetterMethodName(), shapeName + " shape"); + validateCustomerVisibleName(member.getBeanStyleSetterMethodName(), shapeName + " shape"); + validateCustomerVisibleName(member.getEnumType(), shapeName + " shape"); + }); + }); + } + + private void validateCustomerVisibleName(String name, String location) { + if (name == null) { + return; + } + + if (name.contains("_")) { + UnderscoresInNameBehavior behavior = customizationConfig.getUnderscoresInNameBehavior(); + + String supportedBehaviors = Arrays.toString(UnderscoresInNameBehavior.values()); + Validate.notNull(behavior, + "Encountered a name or identifier that the customer will see (%s in the %s) with an underscore. " + + "This isn't idiomatic in Java. Please either remove the underscores or apply the " + + "'underscoresInNameBehavior' customization for this service (Supported " + + "'underscoresInNameBehavior' values: %s).", name, location, supportedBehaviors); + Validate.isTrue(behavior == UnderscoresInNameBehavior.ALLOW, + "Unsupported underscoresInShapeNameBehavior: %s. Supported values: %s", behavior, supportedBehaviors); + } + + Validate.isTrue(VALID_IDENTIFIER_NAME.matcher(name).matches(), + "Encountered a name or identifier that is invalid within Java (%s in %s). Please remove invalid " + + "characters.", name, location); + } } diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/naming/NamingStrategy.java b/codegen/src/main/java/software/amazon/awssdk/codegen/naming/NamingStrategy.java index 2af31ff106b3..d59a34df29b6 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/naming/NamingStrategy.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/naming/NamingStrategy.java @@ -15,6 +15,7 @@ package software.amazon.awssdk.codegen.naming; +import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel; import software.amazon.awssdk.codegen.model.intermediate.MemberModel; import software.amazon.awssdk.codegen.model.service.Shape; @@ -97,13 +98,7 @@ public interface NamingStrategy { * @param shapeName Name of structure used to derive Java class name. * @return Appropriate name to use for a Java class for an arbitrary (not a request, response, error) structure. */ - String getJavaClassName(String shapeName); - - /** - * @param shapeName Name of an authorizer shape used to derive the authorizer name - * @return Appropriate name to use for a Java class for an Authorizer - */ - String getAuthorizerClassName(String shapeName); + String getShapeClassName(String shapeName); /** * @param memberName Member name to name getter for. @@ -160,4 +155,9 @@ public interface NamingStrategy { * @return Name of an existence check method. */ String getExistenceCheckMethodName(String memberName, Shape parentShape); + + /** + * Verify the customer-visible naming in the provided intermediate model will compile and is idiomatic to Java. + */ + void validateCustomerVisibleNaming(IntermediateModel trimmedModel); } diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/AsyncClientClass.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/AsyncClientClass.java index ef46146eb90d..50a9a32cc366 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/AsyncClientClass.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/AsyncClientClass.java @@ -53,7 +53,6 @@ import software.amazon.awssdk.codegen.model.config.customization.UtilitiesMethod; import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel; import software.amazon.awssdk.codegen.model.intermediate.OperationModel; -import software.amazon.awssdk.codegen.model.intermediate.Protocol; import software.amazon.awssdk.codegen.model.intermediate.ShapeModel; import software.amazon.awssdk.codegen.model.service.AuthType; import software.amazon.awssdk.codegen.poet.PoetExtensions; @@ -243,7 +242,7 @@ protected MethodSpec.Builder operationBody(MethodSpec.Builder builder, Operation builder.addStatement("apiCallMetricCollector.reportMetric($T.$L, $S)", CoreMetric.class, "OPERATION_NAME", opModel.getOperationName()); - if (model.getMetadata().getProtocol() != Protocol.API_GATEWAY && shouldUseAsyncWithBodySigner(opModel)) { + if (shouldUseAsyncWithBodySigner(opModel)) { builder.addCode(applyAsyncWithBodyV4SignerOverride(opModel)); } else { builder.addCode(ClientClassUtils.callApplySignerOverrideMethod(opModel)); @@ -445,7 +444,7 @@ private boolean shouldUseAsyncWithBodySigner(OperationModel opModel) { AuthType authTypeForOperation = opModel.getAuthType(); - if (authTypeForOperation == AuthType.IAM) { + if (authTypeForOperation == null) { authTypeForOperation = model.getMetadata().getAuthType(); } diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/SyncClientClass.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/SyncClientClass.java index eb9c392a8855..95724e518af9 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/SyncClientClass.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/SyncClientClass.java @@ -335,8 +335,6 @@ static ProtocolSpec getProtocolSpecs(PoetExtensions poetExtensions, Intermediate case CBOR: case ION: return new JsonProtocolSpec(poetExtensions, model); - case API_GATEWAY: - throw new UnsupportedOperationException("Not yet supported."); default: throw new RuntimeException("Unknown protocol: " + protocol.name()); } diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/Ec2ProtocolSpec.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/Ec2ProtocolSpec.java index e595f6739719..19ab56530848 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/Ec2ProtocolSpec.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/Ec2ProtocolSpec.java @@ -29,54 +29,4 @@ public Ec2ProtocolSpec(IntermediateModel model, PoetExtensions poetExtensions) { protected Class> protocolFactoryClass() { return AwsEc2ProtocolFactory.class; } - - /* - TODO Dry run support - private MethodSpec dryRunMethod() { - TypeVariableName typeVariableName = TypeVariableName.get("X", AmazonWebServiceRequest.class); - ClassName dryRunResult = poetExtensions.getModelClass("DryRunResult"); - TypeName dryRunResultGeneric = ParameterizedTypeName.get(dryRunResult, typeVariableName); - ClassName dryRunRequest = poetExtensions.getModelClass("DryRunSupportedRequest"); - TypeName dryRunRequestGeneric = ParameterizedTypeName.get(dryRunRequest, typeVariableName); - return MethodSpec.methodBuilder("dryRun") - .returns(dryRunResultGeneric) - .addModifiers(Modifier.PUBLIC) - .addParameter(dryRunRequestGeneric, "request") - .addTypeVariable(typeVariableName) - .addStatement("$T dryRunRequest = request.getDryRunRequest()", - Request.class) - .beginControlFlow("try") - .addStatement("$T<$T> responseHandler = new $T<$T>(new $T())", - StaxResponseHandler.class, - dryRunResult, - StaxResponseHandler.class, - dryRunResult, - VoidStaxUnmarshaller.class) - .addStatement("\nclientHandler.execute(new $T<$T, $T>().marshaller($L).withResponseHandler($N)" + - ".withInput($L))", - ClientExecutionParams.class, - Request.class, - dryRunResult, - "null", - "responseHandler", - "dryRunRequest") - .addStatement("throw new $T($S)", SdkClientException.class, - "Unrecognized service response for the dry-run request.") - .endControlFlow() - .beginControlFlow("catch (AwsServiceException exception)") - .beginControlFlow("if (exception.errorCode().equals($S) && exception.statusCode() == 412)", - "DryRunOperation") - .addStatement("return new $T(true, request, exception.getMessage(), exception)", dryRunResultGeneric) - .endControlFlow() - .beginControlFlow("else if (exception.errorCode().equals($S) && exception.statusCode() == 403)", - "UnauthorizedOperation") - .addStatement("return new $T(false, request, exception.getMessage(), exception)", dryRunResultGeneric) - .endControlFlow() - .addStatement("throw new $T($S, exception)", SdkClientException.class, - "Unrecognized service response for the dry-run request.") - .endControlFlow() - .build(); - - } - */ } diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/JsonProtocolSpec.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/JsonProtocolSpec.java index f4438a674eb5..679876843a0c 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/JsonProtocolSpec.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/JsonProtocolSpec.java @@ -39,6 +39,7 @@ import software.amazon.awssdk.codegen.model.intermediate.Protocol; import software.amazon.awssdk.codegen.model.intermediate.ShapeModel; import software.amazon.awssdk.codegen.poet.PoetExtensions; +import software.amazon.awssdk.codegen.poet.client.traits.HttpChecksumRequiredTrait; import software.amazon.awssdk.codegen.poet.eventstream.EventStreamUtils; import software.amazon.awssdk.core.SdkPojoBuilder; import software.amazon.awssdk.core.SdkResponse; @@ -79,21 +80,18 @@ public MethodSpec initProtocolFactory(IntermediateModel model) { TypeVariableName.get("T")); TypeVariableName typeVariableName = TypeVariableName.get("T", upperBound); - MethodSpec.Builder methodSpec = MethodSpec.methodBuilder("init") - .addTypeVariable(typeVariableName) - .addParameter(typeVariableName, "builder") - .returns(typeVariableName) - .addModifiers(Modifier.PRIVATE) - .addCode( - "return builder\n" + - ".clientConfiguration(clientConfiguration)\n" + - ".defaultServiceExceptionSupplier($T::builder)\n" + - ".protocol($T.$L)\n" + - ".protocolVersion($S)\n" - + "$L", - baseException, AwsJsonProtocol.class, - protocolEnumName(metadata.getProtocol()), metadata.getJsonVersion(), - customErrorCodeFieldName()); + MethodSpec.Builder methodSpec = + MethodSpec.methodBuilder("init") + .addTypeVariable(typeVariableName) + .addParameter(typeVariableName, "builder") + .returns(typeVariableName) + .addModifiers(Modifier.PRIVATE) + .addCode("return builder\n") + .addCode(".clientConfiguration(clientConfiguration)\n") + .addCode(".defaultServiceExceptionSupplier($T::builder)\n", baseException) + .addCode(".protocol($T.$L)\n", AwsJsonProtocol.class, protocolEnumName(metadata.getProtocol())) + .addCode(".protocolVersion($S)\n", metadata.getJsonVersion()) + .addCode("$L", customErrorCodeFieldName()); if (metadata.getContentType() != null) { methodSpec.addCode(".withContentTypeOverride($S)", metadata.getContentType()); @@ -126,12 +124,13 @@ public CodeBlock responseHandler(IntermediateModel model, OperationModel opModel TypeName pojoResponseType = getPojoResponseType(opModel, poetExtensions); String protocolFactory = protocolFactoryLiteral(model, opModel); - CodeBlock.Builder builder = CodeBlock.builder(); - builder.add("$T operationMetadata = $T.builder()\n" - + ".hasStreamingSuccessResponse($L)\n" - + ".isPayloadJson($L)\n" - + ".build();", JsonOperationMetadata.class, JsonOperationMetadata.class, - opModel.hasStreamingOutput(), !opModel.getHasBlobMemberAsPayload()); + CodeBlock.Builder builder = + CodeBlock.builder() + .add("$T operationMetadata = $T.builder()\n", JsonOperationMetadata.class, JsonOperationMetadata.class) + .add(".hasStreamingSuccessResponse($L)\n", opModel.hasStreamingOutput()) + .add(".isPayloadJson($L)\n", !opModel.getHasBlobMemberAsPayload()) + .add(".build();"); + if (opModel.hasEventStreamOutput()) { responseHandlersForEventStreaming(opModel, pojoResponseType, protocolFactory, builder); } else { @@ -161,24 +160,18 @@ public CodeBlock executionHandler(OperationModel opModel) { ClassName requestType = poetExtensions.getModelClass(opModel.getInput().getVariableType()); ClassName marshaller = poetExtensions.getRequestTransformClass(opModel.getInputShape().getShapeName() + "Marshaller"); - CodeBlock.Builder codeBlock = CodeBlock - .builder() - .add("\n\nreturn clientHandler.execute(new $T<$T, $T>()\n" + - ".withOperationName(\"$N\")\n" + - ".withResponseHandler($N)\n" + - ".withErrorResponseHandler($N)\n" + - hostPrefixExpression(opModel) + - discoveredEndpoint(opModel) + - ".withInput($L)\n", - ClientExecutionParams.class, - requestType, - responseType, - opModel.getOperationName(), - "responseHandler", - "errorResponseHandler", - opModel.getInput().getVariableName()); - - codeBlock.add(".withMetricCollector($N)", "apiCallMetricCollector"); + CodeBlock.Builder codeBlock = + CodeBlock.builder() + .add("\n\nreturn clientHandler.execute(new $T<$T, $T>()\n", + ClientExecutionParams.class, requestType, responseType) + .add(".withOperationName(\"$N\")\n", opModel.getOperationName()) + .add(".withResponseHandler(responseHandler)\n") + .add(".withErrorResponseHandler(errorResponseHandler)\n") + .add(hostPrefixExpression(opModel)) + .add(discoveredEndpoint(opModel)) + .add(".withInput($L)\n", opModel.getInput().getVariableName()) + .add(".withMetricCollector(apiCallMetricCollector)") + .add(HttpChecksumRequiredTrait.putHttpChecksumAttribute(opModel)); if (opModel.hasStreamingInput()) { codeBlock.add(".withRequestBody(requestBody)") @@ -206,22 +199,19 @@ public CodeBlock asyncExecutionHandler(IntermediateModel intermediateModel, Oper ClassName eventStreamBaseClass = poetExtensions.getModelClassFromShape(shapeModel); ParameterizedTypeName transformerType = ParameterizedTypeName.get( ClassName.get(EventStreamAsyncResponseTransformer.class), pojoResponseType, eventStreamBaseClass); - builder.addStatement("$1T<$2T> future = new $1T<>()", - ClassName.get(CompletableFuture.class), - ClassName.get(Void.class)); - builder.add("$T asyncResponseTransformer = $T.<$T, $T>builder()\n" + - " .eventStreamResponseHandler(asyncResponseHandler)\n" - + " .eventResponseHandler(eventResponseHandler)\n" - + " .initialResponseHandler(responseHandler)\n" - + " .exceptionResponseHandler(errorResponseHandler)\n" - + " .future(future)\n" - + " .executor(executor)\n" - + " .serviceName(serviceName())\n" - + " .build();", - transformerType, - ClassName.get(EventStreamAsyncResponseTransformer.class), - pojoResponseType, - eventStreamBaseClass); + + builder.add("$1T<$2T> future = new $1T<>();", ClassName.get(CompletableFuture.class), ClassName.get(Void.class)) + .add("$T asyncResponseTransformer = $T.<$T, $T>builder()\n", + transformerType, ClassName.get(EventStreamAsyncResponseTransformer.class), pojoResponseType, + eventStreamBaseClass) + .add(".eventStreamResponseHandler(asyncResponseHandler)\n") + .add(".eventResponseHandler(eventResponseHandler)\n") + .add(".initialResponseHandler(responseHandler)\n") + .add(".exceptionResponseHandler(errorResponseHandler)\n") + .add(".future(future)\n") + .add(".executor(executor)\n") + .add(".serviceName(serviceName())\n") + .add(".build();"); if (isRestJson) { builder.add(restAsyncResponseTransformer(pojoResponseType, eventStreamBaseClass)); @@ -235,36 +225,23 @@ public CodeBlock asyncExecutionHandler(IntermediateModel intermediateModel, Oper : pojoResponseType; TypeName executeFutureValueType = executeFutureValueType(opModel, poetExtensions); - builder.add("\n\n$T<$T> executeFuture = clientHandler.execute(new $T<$T, $T>()\n" + - ".withOperationName(\"$N\")\n" + - ".withMarshaller($L)\n" + - "$L" + - "$L" + - ".withResponseHandler($L)\n" + - ".withErrorResponseHandler(errorResponseHandler)\n" + - ".withMetricCollector(apiCallMetricCollector)\n" + - hostPrefixExpression(opModel) + - discoveredEndpoint(opModel) + - asyncRequestBody + - ".withInput($L)$L);", - CompletableFuture.class, - executeFutureValueType, - ClientExecutionParams.class, - requestType, - responseType, - opModel.getOperationName(), - asyncMarshaller(model, opModel, marshaller, protocolFactory), - opModel.hasEventStreamInput() ? CodeBlock.builder() - .add(".withAsyncRequestBody($T.fromPublisher(adapted))", - AsyncRequestBody.class) - .build() - .toString() - : "", - opModel.hasEventStreamInput() && opModel.hasEventStreamOutput() ? CodeBlock - .builder().add(".withFullDuplex(true)").build() : "", - opModel.hasEventStreamOutput() && !isRestJson ? "voidResponseHandler" : "responseHandler", - opModel.getInput().getVariableName(), - asyncResponseTransformerVariable(isStreaming, isRestJson, opModel)); + builder.add("\n\n$T<$T> executeFuture = clientHandler.execute(new $T<$T, $T>()\n", + CompletableFuture.class, executeFutureValueType, ClientExecutionParams.class, requestType, responseType) + .add(".withOperationName(\"$N\")\n", opModel.getOperationName()) + .add(".withMarshaller($L)\n", asyncMarshaller(model, opModel, marshaller, protocolFactory)) + .add(asyncRequestBody(opModel)) + .add(fullDuplex(opModel)) + .add(".withResponseHandler($L)\n", responseHandlerName(opModel, isRestJson)) + .add(".withErrorResponseHandler(errorResponseHandler)\n") + .add(".withMetricCollector(apiCallMetricCollector)\n") + .add(hostPrefixExpression(opModel)) + .add(discoveredEndpoint(opModel)) + .add(asyncRequestBody) + .add(HttpChecksumRequiredTrait.putHttpChecksumAttribute(opModel)) + .add(".withInput($L)$L);", + opModel.getInput().getVariableName(), asyncResponseTransformerVariable(isStreaming, isRestJson, opModel)); + + String whenComplete = whenCompleteBody(opModel, customerResponseHandler); if (!whenComplete.isEmpty()) { String whenCompletedFutureName = "whenCompleted"; @@ -283,6 +260,22 @@ public CodeBlock asyncExecutionHandler(IntermediateModel intermediateModel, Oper return builder.build(); } + private String responseHandlerName(OperationModel opModel, boolean isRestJson) { + return opModel.hasEventStreamOutput() && !isRestJson ? "voidResponseHandler" + : "responseHandler"; + } + + private CodeBlock fullDuplex(OperationModel opModel) { + return opModel.hasEventStreamInput() && opModel.hasEventStreamOutput() ? CodeBlock.of(".withFullDuplex(true)") + : CodeBlock.of(""); + } + + private CodeBlock asyncRequestBody(OperationModel opModel) { + return opModel.hasEventStreamInput() ? CodeBlock.of(".withAsyncRequestBody($T.fromPublisher(adapted))", + AsyncRequestBody.class) + : CodeBlock.of(""); + } + private String asyncResponseTransformerVariable(boolean isStreaming, boolean isRestJson, OperationModel opModel) { if (isStreaming) { if (opModel.hasEventStreamOutput() && isRestJson) { @@ -306,14 +299,12 @@ private CodeBlock restAsyncResponseTransformer(TypeName pojoResponseType, ClassN ParameterizedTypeName restTransformerType = ParameterizedTypeName.get( ClassName.get(RestEventStreamAsyncResponseTransformer.class), pojoResponseType, eventStreamBaseClass); return CodeBlock.builder() - .add("$T restAsyncResponseTransformer = $T.<$T, $T>builder()\n" - + ".eventStreamAsyncResponseTransformer(asyncResponseTransformer)\n" - + ".eventStreamResponseHandler(asyncResponseHandler)\n" - + ".build();", - restTransformerType, - ClassName.get(RestEventStreamAsyncResponseTransformer.class), - pojoResponseType, + .add("$T restAsyncResponseTransformer = $T.<$T, $T>builder()\n", + restTransformerType, ClassName.get(RestEventStreamAsyncResponseTransformer.class), pojoResponseType, eventStreamBaseClass) + .add(".eventStreamAsyncResponseTransformer(asyncResponseTransformer)\n") + .add(".eventStreamResponseHandler(asyncResponseHandler)\n") + .add(".build();") .build(); } diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/QueryProtocolSpec.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/QueryProtocolSpec.java index 1c6327a0e063..2ea4cfc385a8 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/QueryProtocolSpec.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/QueryProtocolSpec.java @@ -29,6 +29,7 @@ import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel; import software.amazon.awssdk.codegen.model.intermediate.OperationModel; import software.amazon.awssdk.codegen.poet.PoetExtensions; +import software.amazon.awssdk.codegen.poet.client.traits.HttpChecksumRequiredTrait; import software.amazon.awssdk.core.client.handler.ClientExecutionParams; import software.amazon.awssdk.core.http.HttpResponseHandler; import software.amazon.awssdk.protocols.query.AwsQueryProtocolFactory; @@ -99,24 +100,18 @@ public CodeBlock executionHandler(OperationModel opModel) { TypeName responseType = poetExtensions.getModelClass(opModel.getReturnType().getReturnType()); ClassName requestType = poetExtensions.getModelClass(opModel.getInput().getVariableType()); ClassName marshaller = poetExtensions.getTransformClass(opModel.getInputShape().getShapeName() + "Marshaller"); - CodeBlock.Builder codeBlock = CodeBlock - .builder() - .add("\n\nreturn clientHandler.execute(new $T<$T, $T>()" + - ".withOperationName(\"$N\")\n" + - ".withResponseHandler($N)" + - ".withErrorResponseHandler($N)" + - hostPrefixExpression(opModel) + - discoveredEndpoint(opModel) + - ".withInput($L)", - ClientExecutionParams.class, - requestType, - responseType, - opModel.getOperationName(), - "responseHandler", - "errorResponseHandler", - opModel.getInput().getVariableName()); - - codeBlock.add(".withMetricCollector($N)", "apiCallMetricCollector"); + CodeBlock.Builder codeBlock = + CodeBlock.builder() + .add("\n\nreturn clientHandler.execute(new $T<$T, $T>()", + ClientExecutionParams.class, requestType, responseType) + .add(".withOperationName($S)\n", opModel.getOperationName()) + .add(".withResponseHandler(responseHandler)\n") + .add(".withErrorResponseHandler(errorResponseHandler)\n") + .add(hostPrefixExpression(opModel)) + .add(discoveredEndpoint(opModel)) + .add(".withInput($L)", opModel.getInput().getVariableName()) + .add(".withMetricCollector(apiCallMetricCollector)") + .add(HttpChecksumRequiredTrait.putHttpChecksumAttribute(opModel)); if (opModel.hasStreamingInput()) { return codeBlock.add(".withRequestBody(requestBody)") @@ -136,27 +131,23 @@ public CodeBlock asyncExecutionHandler(IntermediateModel intermediateModel, Oper String asyncRequestBody = opModel.hasStreamingInput() ? ".withAsyncRequestBody(requestBody)" : ""; TypeName executeFutureValueType = executeFutureValueType(opModel, poetExtensions); - CodeBlock.Builder builder = CodeBlock.builder().add("\n\n$T<$T> executeFuture = clientHandler.execute(new $T<$T, $T>()" - + "\n" + - ".withOperationName(\"$N\")\n" + - ".withMarshaller($L)" + - ".withResponseHandler(responseHandler)" + - ".withErrorResponseHandler($N)\n" + - ".withMetricCollector(apiCallMetricCollector)\n" + - hostPrefixExpression(opModel) + - asyncRequestBody + - ".withInput($L) $L);", - CompletableFuture.class, - executeFutureValueType, - ClientExecutionParams.class, - requestType, - pojoResponseType, - opModel.getOperationName(), - asyncMarshaller(intermediateModel, opModel, marshaller, - "protocolFactory"), - "errorResponseHandler", - opModel.getInput().getVariableName(), - opModel.hasStreamingOutput() ? ", asyncResponseTransformer" : ""); + CodeBlock.Builder builder = + CodeBlock.builder() + .add("\n\n$T<$T> executeFuture = clientHandler.execute(new $T<$T, $T>()\n", + CompletableFuture.class, executeFutureValueType, ClientExecutionParams.class, + requestType, pojoResponseType) + .add(".withOperationName(\"$N\")\n", opModel.getOperationName()) + .add(".withMarshaller($L)\n", + asyncMarshaller(intermediateModel, opModel, marshaller, "protocolFactory")) + .add(".withResponseHandler(responseHandler)\n") + .add(".withErrorResponseHandler(errorResponseHandler)\n") + .add(".withMetricCollector(apiCallMetricCollector)\n") + .add(HttpChecksumRequiredTrait.putHttpChecksumAttribute(opModel)); + + builder.add(hostPrefixExpression(opModel) + asyncRequestBody + ".withInput($L)$L);", + opModel.getInput().getVariableName(), + opModel.hasStreamingOutput() ? ", asyncResponseTransformer" : ""); + builder.addStatement("$T requestOverrideConfig = $L.overrideConfiguration().orElse(null)", AwsRequestOverrideConfiguration.class, opModel.getInput().getVariableName()); diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/XmlProtocolSpec.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/XmlProtocolSpec.java index 58341ff1ddc7..df92aca61ce0 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/XmlProtocolSpec.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/XmlProtocolSpec.java @@ -29,6 +29,8 @@ import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel; import software.amazon.awssdk.codegen.model.intermediate.OperationModel; import software.amazon.awssdk.codegen.poet.PoetExtensions; +import software.amazon.awssdk.codegen.poet.client.traits.HttpChecksumRequiredTrait; +import software.amazon.awssdk.core.client.handler.ClientExecutionParams; import software.amazon.awssdk.core.http.HttpResponseHandler; import software.amazon.awssdk.protocols.xml.AwsXmlProtocolFactory; import software.amazon.awssdk.protocols.xml.XmlOperationMetadata; @@ -71,13 +73,9 @@ public CodeBlock responseHandler(IntermediateModel model, ParameterizedTypeName.get(ClassName.get(software.amazon.awssdk.core.Response.class), responseType)); return CodeBlock.builder() - .addStatement("\n\n$T responseHandler = protocolFactory.createCombinedResponseHandler" - + "($T::builder," + .addStatement("\n\n$T responseHandler = protocolFactory.createCombinedResponseHandler($T::builder, " + "new $T().withHasStreamingSuccessResponse($L))", - handlerType, - responseType, - XmlOperationMetadata.class, - opModel.hasStreamingOutput()) + handlerType, responseType, XmlOperationMetadata.class, opModel.hasStreamingOutput()) .build(); } @@ -85,12 +83,9 @@ private CodeBlock streamingResponseHandler(OperationModel opModel) { ClassName responseType = poetExtensions.getModelClass(opModel.getReturnType().getReturnType()); return CodeBlock.builder() - .addStatement("\n\n$T<$T> responseHandler = protocolFactory.createResponseHandler($T::builder," + .addStatement("\n\n$T<$T> responseHandler = protocolFactory.createResponseHandler($T::builder, " + "new $T().withHasStreamingSuccessResponse($L))", - HttpResponseHandler.class, - responseType, - responseType, - XmlOperationMetadata.class, + HttpResponseHandler.class, responseType, responseType, XmlOperationMetadata.class, opModel.hasStreamingOutput()) .build(); } @@ -113,23 +108,16 @@ public CodeBlock executionHandler(OperationModel opModel) { TypeName responseType = poetExtensions.getModelClass(opModel.getReturnType().getReturnType()); ClassName requestType = poetExtensions.getModelClass(opModel.getInput().getVariableType()); ClassName marshaller = poetExtensions.getTransformClass(opModel.getInputShape().getShapeName() + "Marshaller"); - CodeBlock.Builder codeBlock = CodeBlock - .builder() - .add("\n\nreturn clientHandler.execute(new $T<$T, $T>()" + - ".withOperationName(\"$N\")\n" + - ".withCombinedResponseHandler($N)" + - ".withMetricCollector(apiCallMetricCollector)\n" + - hostPrefixExpression(opModel) + - discoveredEndpoint(opModel) + - ".withInput($L)", - software.amazon.awssdk.core.client.handler.ClientExecutionParams.class, - requestType, - responseType, - opModel.getOperationName(), - "responseHandler", - opModel.getInput().getVariableName()); - - codeBlock.add(".withMetricCollector($N)", "apiCallMetricCollector"); + CodeBlock.Builder codeBlock = CodeBlock.builder() + .add("\n\nreturn clientHandler.execute(new $T<$T, $T>()\n", + ClientExecutionParams.class, requestType, responseType) + .add(".withOperationName($S)\n", opModel.getOperationName()) + .add(".withCombinedResponseHandler(responseHandler)\n") + .add(".withMetricCollector(apiCallMetricCollector)\n" + + hostPrefixExpression(opModel) + + discoveredEndpoint(opModel)) + .add(".withInput($L)", opModel.getInput().getVariableName()) + .add(HttpChecksumRequiredTrait.putHttpChecksumAttribute(opModel)); s3ArnableFields(opModel, model).ifPresent(codeBlock::add); @@ -173,25 +161,20 @@ public CodeBlock asyncExecutionHandler(IntermediateModel intermediateModel, Oper ClassName requestType = poetExtensions.getModelClass(opModel.getInput().getVariableType()); ClassName marshaller = poetExtensions.getRequestTransformClass(opModel.getInputShape().getShapeName() + "Marshaller"); - String asyncRequestBody = opModel.hasStreamingInput() ? ".withAsyncRequestBody(requestBody)" - : ""; TypeName executeFutureValueType = executeFutureValueType(opModel, poetExtensions); CodeBlock.Builder builder = - CodeBlock.builder().add("\n\n$T<$T> executeFuture = clientHandler.execute(new $T<$T, $T>()" - + "\n" + - ".withOperationName(\"$N\")\n" + - ".withMarshaller($L)" + - ".withCombinedResponseHandler($N)" + - hostPrefixExpression(opModel) + - asyncRequestBody, - java.util.concurrent.CompletableFuture.class, - executeFutureValueType, - software.amazon.awssdk.core.client.handler.ClientExecutionParams.class, - requestType, - pojoResponseType, - opModel.getOperationName(), - asyncMarshaller(intermediateModel, opModel, marshaller, "protocolFactory"), - "responseHandler"); + CodeBlock.builder() + .add("\n\n$T<$T> executeFuture = clientHandler.execute(new $T<$T, $T>()\n", + CompletableFuture.class, executeFutureValueType, + ClientExecutionParams.class, requestType, pojoResponseType) + .add(".withOperationName(\"$N\")\n", opModel.getOperationName()) + .add(".withMarshaller($L)\n", asyncMarshaller(intermediateModel, opModel, marshaller, "protocolFactory")) + .add(".withCombinedResponseHandler(responseHandler)\n") + .add(hostPrefixExpression(opModel)) + .add(".withMetricCollector(apiCallMetricCollector)\n") + .add(asyncRequestBody(opModel)) + .add(HttpChecksumRequiredTrait.putHttpChecksumAttribute(opModel)); + s3ArnableFields(opModel, model).ifPresent(builder::add); builder.add(".withInput($L) $L);", opModel.getInput().getVariableName(), opModel.hasStreamingOutput() ? ", asyncResponseTransformer" : ""); @@ -212,6 +195,10 @@ public CodeBlock asyncExecutionHandler(IntermediateModel intermediateModel, Oper return builder.build(); } + private String asyncRequestBody(OperationModel opModel) { + return opModel.hasStreamingInput() ? ".withAsyncRequestBody(requestBody)" : ""; + } + private CodeBlock asyncStreamingExecutionHandler(IntermediateModel intermediateModel, OperationModel opModel) { return super.asyncExecutionHandler(intermediateModel, opModel); } diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/traits/HttpChecksumRequiredTrait.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/traits/HttpChecksumRequiredTrait.java new file mode 100644 index 000000000000..69abf57d5f93 --- /dev/null +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/traits/HttpChecksumRequiredTrait.java @@ -0,0 +1,44 @@ +/* + * 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.codegen.poet.client.traits; + +import com.squareup.javapoet.CodeBlock; +import software.amazon.awssdk.codegen.model.intermediate.OperationModel; +import software.amazon.awssdk.core.client.handler.ClientExecutionParams; +import software.amazon.awssdk.core.interceptor.SdkInternalExecutionAttribute; +import software.amazon.awssdk.core.interceptor.trait.HttpChecksumRequired; + +/** + * The logic for handling the "httpChecksumRequired" trait within the code generator. + */ +public class HttpChecksumRequiredTrait { + private HttpChecksumRequiredTrait() { + } + + /** + * Generate a ".putExecutionAttribute(...)" code-block for the provided operation model. This should be used within the + * context of initializing {@link ClientExecutionParams}. If HTTP checksums are not required by the operation, this will + * return an empty code-block. + */ + public static CodeBlock putHttpChecksumAttribute(OperationModel operationModel) { + if (operationModel.isHttpChecksumRequired()) { + return CodeBlock.of(".putExecutionAttribute($T.HTTP_CHECKSUM_REQUIRED, $T.create())\n", + SdkInternalExecutionAttribute.class, HttpChecksumRequired.class); + } + + return CodeBlock.of(""); + } +} diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/BeanGetterHelper.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/BeanGetterHelper.java index c9a2db4777fd..d54740b12452 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/BeanGetterHelper.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/BeanGetterHelper.java @@ -63,20 +63,20 @@ public MethodSpec beanStyleGetter(MemberModel memberModel) { private MethodSpec byteBufferGetter(MemberModel memberModel) { return basicGetter(memberModel, ClassName.get(ByteBuffer.class), - CodeBlock.of("return $1N == null ? null : $1N.asByteBuffer()", + CodeBlock.of("return $1N == null ? null : $1N.asByteBuffer();", memberModel.getVariable().getVariableName())); } private MethodSpec listByteBufferGetter(MemberModel memberModel) { return basicGetter(memberModel, ParameterizedTypeName.get(List.class, ByteBuffer.class), - CodeBlock.of("return $1N == null ? null : $1N.stream().map($2T::asByteBuffer).collect($3T.toList())", + CodeBlock.of("return $1N == null ? null : $1N.stream().map($2T::asByteBuffer).collect($3T.toList());", memberModel.getVariable().getVariableName(), SdkBytes.class, Collectors.class)); } private MethodSpec mapByteBufferGetter(MemberModel memberModel) { String body = "return $1N == null ? null : " + - "$1N.entrySet().stream().collect($2T.toMap(e -> e.getKey(), e -> e.getValue().asByteBuffer()))"; + "$1N.entrySet().stream().collect($2T.toMap(e -> e.getKey(), e -> e.getValue().asByteBuffer()));"; String keyType = memberModel.getMapModel().getKeyModel().getVariable().getVariableType(); return basicGetter(memberModel, PoetUtils.createParameterizedTypeName(Map.class, keyType, ByteBuffer.class.getSimpleName()), @@ -86,15 +86,14 @@ private MethodSpec mapByteBufferGetter(MemberModel memberModel) { private MethodSpec regularGetter(MemberModel memberModel) { return basicGetter(memberModel, typeProvider.parameterType(memberModel), - CodeBlock.of("return $N", memberModel.getVariable().getVariableName())); + CodeBlock.of("return $N;", memberModel.getVariable().getVariableName())); } private MethodSpec builderGetter(MemberModel memberModel) { return basicGetter(memberModel, poetExtensions.getModelClass(memberModel.getC2jShape()).nestedClass("Builder"), - CodeBlock.builder().add("return $1N != null ? $1N.toBuilder() : null", - memberModel.getVariable().getVariableName()) - .build()); + CodeBlock.of("return $1N != null ? $1N.toBuilder() : null;", + memberModel.getVariable().getVariableName())); } private MethodSpec mapOfBuildersGetter(MemberModel memberModel) { @@ -105,11 +104,10 @@ private MethodSpec mapOfBuildersGetter(MemberModel memberModel) { return basicGetter(memberModel, returnType, - CodeBlock.builder().add("return $1N != null ? $2T.mapValues($1N, $3T::toBuilder) : null", + CodeBlock.of("return $1N != null ? $2T.mapValues($1N, $3T::toBuilder) : null;", memberModel.getVariable().getVariableName(), CollectionUtils.class, - valueType) - .build()); + valueType)); } private MethodSpec listOfBuildersGetter(MemberModel memberModel) { @@ -118,19 +116,27 @@ private MethodSpec listOfBuildersGetter(MemberModel memberModel) { return basicGetter(memberModel, returnType, - CodeBlock.builder().add( - "return $1N != null ? $1N.stream().map($2T::toBuilder).collect($3T.toList()) : null", - memberModel.getVariable().getVariableName(), - memberType, - Collectors.class) - .build()); + CodeBlock.of("return $1N != null ? $1N.stream().map($2T::toBuilder).collect($3T.toList()) : null;", + memberModel.getVariable().getVariableName(), + memberType, + Collectors.class)); } - private MethodSpec basicGetter(MemberModel memberModel, TypeName returnType, CodeBlock statement) { + private MethodSpec basicGetter(MemberModel memberModel, TypeName returnType, CodeBlock body) { + CodeBlock.Builder getterBody = CodeBlock.builder(); + + memberModel.getAutoConstructClassIfExists().ifPresent(autoConstructClass -> { + getterBody.add("if ($N instanceof $T) {", memberModel.getVariable().getVariableName(), autoConstructClass) + .add("return null;") + .add("}"); + }); + + getterBody.add(body); + return MethodSpec.methodBuilder(memberModel.getBeanStyleGetterMethodName()) .addModifiers(Modifier.PUBLIC, Modifier.FINAL) .returns(returnType) - .addStatement(statement) + .addCode(getterBody.build()) .build(); } } diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/MemberCopierSpec.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/MemberCopierSpec.java index ab95b64346dd..4825001efe12 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/MemberCopierSpec.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/MemberCopierSpec.java @@ -209,8 +209,9 @@ private MethodSpec builderCopyMethodForMap() { CodeBlock code = CodeBlock.builder() - .beginControlFlow("if ($N == null)", memberParamName()) - .addStatement("return null") + .beginControlFlow("if ($1N == null || $1N instanceof $2T)", + memberParamName(), DefaultSdkAutoConstructMap.class) + .addStatement("return $T.getInstance()", DefaultSdkAutoConstructMap.class) .endControlFlow() .addStatement("return $N($N.entrySet().stream().collect(toMap($T::getKey, e -> e.getValue().build())))", serviceModelCopiers.copyMethodName(), @@ -234,8 +235,9 @@ private MethodSpec builderCopyMethodForList() { ParameterizedTypeName.get(ClassName.get(Collection.class), WildcardTypeName.subtypeOf(builderForParameter)); CodeBlock code = CodeBlock.builder() - .beginControlFlow("if ($N == null)", memberParamName()) - .addStatement("return null") + .beginControlFlow("if ($1N == null || $1N instanceof $2T)", + memberParamName(), DefaultSdkAutoConstructList.class) + .addStatement("return $T.getInstance()", DefaultSdkAutoConstructList.class) .endControlFlow() .addStatement("return $N($N.stream().map($T::$N).collect(toList()))", serviceModelCopiers.copyMethodName(), @@ -270,16 +272,9 @@ private CodeBlock listCopyBody(EnumTransform enumTransform) { CodeBlock.Builder builder = CodeBlock.builder(); - if (typeProvider.useAutoConstructLists()) { - builder.beginControlFlow("if ($1N == null || $1N instanceof $2T)", memberParamName(), SdkAutoConstructList.class) - .addStatement("return $T.getInstance()", DefaultSdkAutoConstructList.class) - .endControlFlow(); - - } else { - builder.beginControlFlow("if ($N == null)", memberParamName()) - .addStatement("return null") - .endControlFlow(); - } + builder.beginControlFlow("if ($1N == null || $1N instanceof $2T)", memberParamName(), SdkAutoConstructList.class) + .addStatement("return $T.getInstance()", DefaultSdkAutoConstructList.class) + .endControlFlow(); Optional copierClass = serviceModelCopiers.copierClassFor(memberModel.getListModel().getListMemberModel()); boolean hasCopier = copierClass.isPresent(); @@ -367,15 +362,9 @@ private CodeBlock mapCopyBody(EnumTransform enumTransform) { CodeBlock valueCopyExpr = mapKeyValCopyExpr(valueModel, "getValue", valueTransform); CodeBlock.Builder builder = CodeBlock.builder(); - if (typeProvider.useAutoConstructMaps()) { - builder.beginControlFlow("if ($1N == null || $1N instanceof $2T)", memberParamName(), SdkAutoConstructMap.class) - .addStatement("return $T.getInstance()", DefaultSdkAutoConstructMap.class) - .endControlFlow(); - } else { - builder.beginControlFlow("if ($1N == null)", memberParamName()) - .addStatement("return null") - .endControlFlow(); - } + builder.beginControlFlow("if ($1N == null || $1N instanceof $2T)", memberParamName(), SdkAutoConstructMap.class) + .addStatement("return $T.getInstance()", DefaultSdkAutoConstructMap.class) + .endControlFlow(); TypeName copyType; if (enumTransform == EnumTransform.STRING_TO_ENUM) { diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/ModelBuilderSpecs.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/ModelBuilderSpecs.java index a4385f6e945e..3d5d7ef992c9 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/ModelBuilderSpecs.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/ModelBuilderSpecs.java @@ -169,11 +169,11 @@ private List fields() { List fields = shapeModel.getNonStreamingMembers().stream() .map(m -> { FieldSpec fieldSpec = typeProvider.asField(m, Modifier.PRIVATE); - if (m.isList() && typeProvider.useAutoConstructLists()) { + if (m.isList()) { fieldSpec = fieldSpec.toBuilder() .initializer("$T.getInstance()", DefaultSdkAutoConstructList.class) .build(); - } else if (m.isMap() && typeProvider.useAutoConstructMaps()) { + } else if (m.isMap()) { fieldSpec = fieldSpec.toBuilder() .initializer("$T.getInstance()", DefaultSdkAutoConstructMap.class) .build(); diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/ModelMethodOverrides.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/ModelMethodOverrides.java index 64b802db329b..dcba831d24b3 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/ModelMethodOverrides.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/ModelMethodOverrides.java @@ -70,7 +70,15 @@ public MethodSpec equalsBySdkFieldsMethod(ShapeModel shapeModel) { memberEqualsStmt.add("return "); memberEqualsStmt.add(memberModels.stream().map(m -> { String getterName = m.getFluentGetterMethodName(); - return CodeBlock.builder().add("$T.equals($N(), other.$N())", Objects.class, getterName, getterName).build(); + + CodeBlock.Builder result = CodeBlock.builder(); + if (m.getAutoConstructClassIfExists().isPresent()) { + String existenceCheckMethodName = m.getExistenceCheckMethodName(); + result.add("$1N() == other.$1N() && ", existenceCheckMethodName); + } + + return result.add("$T.equals($N(), other.$N())", Objects.class, getterName, getterName) + .build(); }).collect(PoetCollectors.toDelimitedCodeBlock("&&"))); memberEqualsStmt.add(";"); } @@ -119,13 +127,19 @@ public MethodSpec toStringMethod(ShapeModel shapeModel) { } public CodeBlock toStringValue(MemberModel member) { - if (!member.isSensitive()) { - return CodeBlock.of("$L()", member.getFluentGetterMethodName()); + if (member.isSensitive()) { + return CodeBlock.of("$L() == null ? null : $S", + member.getFluentGetterMethodName(), + "*** Sensitive Data Redacted ***"); + } + + if (member.getAutoConstructClassIfExists().isPresent()) { + return CodeBlock.of("$N() ? $N() : null", + member.getExistenceCheckMethodName(), + member.getFluentGetterMethodName()); } - return CodeBlock.of("$L() == null ? null : $S", - member.getFluentGetterMethodName(), - "*** Sensitive Data Redacted ***"); + return CodeBlock.of("$L()", member.getFluentGetterMethodName()); } public MethodSpec hashCodeMethod(ShapeModel shapeModel) { @@ -141,13 +155,22 @@ public MethodSpec hashCodeMethod(ShapeModel shapeModel) { } shapeModel.getNonStreamingMembers() - .forEach(m -> methodBuilder.addStatement( - "hashCode = 31 * hashCode + $T.hashCode($N())", - Objects.class, - m.getFluentGetterMethodName())); + .forEach(m -> methodBuilder.addCode("hashCode = 31 * hashCode + $T.hashCode(", Objects.class) + .addCode(hashCodeValue(m)) + .addCode(");\n")); methodBuilder.addStatement("return hashCode"); return methodBuilder.build(); } + + public CodeBlock hashCodeValue(MemberModel member) { + if (member.getAutoConstructClassIfExists().isPresent()) { + return CodeBlock.of("$N() ? $N() : null", + member.getExistenceCheckMethodName(), + member.getFluentGetterMethodName()); + } + + return CodeBlock.of("$N()", member.getFluentGetterMethodName()); + } } diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/TypeProvider.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/TypeProvider.java index a759463165a6..f315bc74d15f 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/TypeProvider.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/model/TypeProvider.java @@ -53,14 +53,6 @@ public ClassName listImplClassName() { return ClassName.get(ArrayList.class); } - public boolean useAutoConstructLists() { - return intermediateModel.getCustomizationConfig().isUseAutoConstructList(); - } - - public boolean useAutoConstructMaps() { - return intermediateModel.getCustomizationConfig().isUseAutoConstructMap(); - } - public TypeName enumReturnType(MemberModel memberModel) { return fieldType(memberModel, true); } diff --git a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/transform/MarshallerSpec.java b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/transform/MarshallerSpec.java index ddf7f221f386..3024048cd15c 100644 --- a/codegen/src/main/java/software/amazon/awssdk/codegen/poet/transform/MarshallerSpec.java +++ b/codegen/src/main/java/software/amazon/awssdk/codegen/poet/transform/MarshallerSpec.java @@ -128,8 +128,6 @@ private MarshallerProtocolSpec getProtocolSpecs(software.amazon.awssdk.codegen.m case REST_XML: return new XmlMarshallerSpec(intermediateModel, shapeModel); - case API_GATEWAY: - throw new UnsupportedOperationException("Not yet supported."); default: throw new RuntimeException("Unknown protocol: " + protocol.name()); } diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/customization/processors/UseLegacyEventGenerationSchemeProcessorTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/customization/processors/UseLegacyEventGenerationSchemeProcessorTest.java index c853141d1fef..ff041882bbc7 100644 --- a/codegen/src/test/java/software/amazon/awssdk/codegen/customization/processors/UseLegacyEventGenerationSchemeProcessorTest.java +++ b/codegen/src/test/java/software/amazon/awssdk/codegen/customization/processors/UseLegacyEventGenerationSchemeProcessorTest.java @@ -68,15 +68,11 @@ public void testPostProcess_customizationIsValid_succeeds() { private static IntermediateModel intermediateModelWithConfig(String configName) { - IntermediateModel intermediateModel = new IntermediateModelBuilder(C2jModels.builder() + return new IntermediateModelBuilder(C2jModels.builder() .serviceModel(serviceModel) - .customizationConfig(CustomizationConfig.create()) + .customizationConfig(loadCustomizationConfig(configName)) .build()) .build(); - - intermediateModel.setCustomizationConfig(loadCustomizationConfig(configName)); - - return intermediateModel; } private static CustomizationConfig loadCustomizationConfig(String configName) { diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/naming/DefaultNamingStrategyTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/naming/DefaultNamingStrategyTest.java index f30c642cbeb6..d3da6d10a28e 100644 --- a/codegen/src/test/java/software/amazon/awssdk/codegen/naming/DefaultNamingStrategyTest.java +++ b/codegen/src/test/java/software/amazon/awssdk/codegen/naming/DefaultNamingStrategyTest.java @@ -15,7 +15,9 @@ package software.amazon.awssdk.codegen.naming; +import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.Matchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.mock; @@ -24,15 +26,20 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Map; - +import java.util.function.Consumer; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import software.amazon.awssdk.codegen.model.config.customization.CustomizationConfig; +import software.amazon.awssdk.codegen.model.config.customization.UnderscoresInNameBehavior; import software.amazon.awssdk.codegen.model.config.customization.ShareModelConfig; +import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel; import software.amazon.awssdk.codegen.model.intermediate.MemberModel; +import software.amazon.awssdk.codegen.model.intermediate.Metadata; +import software.amazon.awssdk.codegen.model.intermediate.OperationModel; +import software.amazon.awssdk.codegen.model.intermediate.ShapeModel; import software.amazon.awssdk.codegen.model.service.Member; import software.amazon.awssdk.codegen.model.service.ServiceMetadata; import software.amazon.awssdk.codegen.model.service.ServiceModel; @@ -40,6 +47,7 @@ @RunWith(MockitoJUnitRunner.class) public class DefaultNamingStrategyTest { + private CustomizationConfig customizationConfig = CustomizationConfig.create(); private ServiceModel serviceModel = mock(ServiceModel.class); @@ -61,23 +69,10 @@ public class DefaultNamingStrategyTest { @Mock private ServiceMetadata serviceMetadata; - private DefaultNamingStrategy strat = new DefaultNamingStrategy(serviceModel, null); + private DefaultNamingStrategy strat = new DefaultNamingStrategy(serviceModel, customizationConfig); @Before public void setUp() { - - } - - @Test - public void canConvertStringsWithNonAlphasToClassNames() { - String anInvalidClassName = "a phrase-With_other.delimiters"; - assertThat(strat.getJavaClassName(anInvalidClassName)).isEqualTo("APhraseWithOtherDelimiters"); - } - - @Test - public void canConvertAuthorizerStartingWithNumber() { - String anInvalidClassName = "35-authorizer-implementation"; - assertThat(strat.getAuthorizerClassName(anInvalidClassName)).isEqualTo("I35AuthorizerImplementation"); } @Test @@ -323,51 +318,64 @@ private void validateConversion(String input, String expectedOutput) { } @Test - public void getJavaClassName_ReturnsSanitizedName_ClassStartingWithUnderscore() { - NamingStrategy strategy = new DefaultNamingStrategy(null, null); - String javaClassName = strategy.getJavaClassName("_MyClass"); - assertThat(javaClassName).isEqualTo("MyClass"); + public void validateDisallowsUnderscoresWithCustomization() { + String invalidName = "foo_bar"; + verifyFailure(i -> i.getMetadata().setAsyncBuilderInterface(invalidName)); + verifyFailure(i -> i.getMetadata().setSyncBuilderInterface(invalidName)); + verifyFailure(i -> i.getMetadata().setAsyncInterface(invalidName)); + verifyFailure(i -> i.getMetadata().setSyncInterface(invalidName)); + verifyFailure(i -> i.getMetadata().setBaseBuilderInterface(invalidName)); + verifyFailure(i -> i.getMetadata().setBaseExceptionName(invalidName)); + verifyFailure(i -> i.getOperations().put(invalidName, opModel(o -> o.setOperationName(invalidName)))); + verifyFailure(i -> i.getWaiters().put(invalidName, null)); + verifyFailure(i -> i.getShapes().put(invalidName, shapeModel(s -> s.setShapeName(invalidName)))); + verifyFailure(i -> i.getShapes().put(invalidName, shapeWithMember(m -> m.setBeanStyleGetterMethodName(invalidName)))); + verifyFailure(i -> i.getShapes().put(invalidName, shapeWithMember(m -> m.setBeanStyleSetterMethodName(invalidName)))); + verifyFailure(i -> i.getShapes().put(invalidName, shapeWithMember(m -> m.setFluentEnumGetterMethodName(invalidName)))); + verifyFailure(i -> i.getShapes().put(invalidName, shapeWithMember(m -> m.setFluentEnumSetterMethodName(invalidName)))); + verifyFailure(i -> i.getShapes().put(invalidName, shapeWithMember(m -> m.setFluentGetterMethodName(invalidName)))); + verifyFailure(i -> i.getShapes().put(invalidName, shapeWithMember(m -> m.setFluentSetterMethodName(invalidName)))); + verifyFailure(i -> i.getShapes().put(invalidName, shapeWithMember(m -> m.setEnumType(invalidName)))); } @Test - public void getJavaClassName_ReturnsSanitizedName_ClassStartingWithDoubleUnderscore() { - NamingStrategy strategy = new DefaultNamingStrategy(null, null); - String javaClassName = strategy.getJavaClassName("__MyClass"); - assertThat(javaClassName).isEqualTo("MyClass"); - } + public void validateAllowsUnderscoresWithCustomization() { + CustomizationConfig customization = + CustomizationConfig.create() + .withUnderscoresInShapeNameBehavior(UnderscoresInNameBehavior.ALLOW); + NamingStrategy strategy = new DefaultNamingStrategy(serviceModel, customization); - @Test - public void getJavaClassName_ReturnsSanitizedName_ClassStartingWithDoublePeriods() { - NamingStrategy strategy = new DefaultNamingStrategy(null, null); - String javaClassName = strategy.getJavaClassName("..MyClass"); - assertThat(javaClassName).isEqualTo("MyClass"); + Metadata metadata = new Metadata(); + metadata.setAsyncBuilderInterface("foo_bar"); + + IntermediateModel model = new IntermediateModel(); + model.setMetadata(metadata); + + strategy.validateCustomerVisibleNaming(model); } - @Test - public void getJavaClassName_ReturnsSanitizedName_ClassStartingWithDoubleDashes() { - NamingStrategy strategy = new DefaultNamingStrategy(null, null); - String javaClassName = strategy.getJavaClassName("--MyClass"); - assertThat(javaClassName).isEqualTo("MyClass"); + private void verifyFailure(Consumer modelModifier) { + IntermediateModel model = new IntermediateModel(); + model.setMetadata(new Metadata()); + modelModifier.accept(model); + assertThatThrownBy(() -> strat.validateCustomerVisibleNaming(model)).isInstanceOf(RuntimeException.class); } - @Test - public void getJavaClassName_ReturnsSanitizedName_DoubleUnderscoresInClass() { - NamingStrategy strategy = new DefaultNamingStrategy(null, null); - String javaClassName = strategy.getJavaClassName("My__Class"); - assertThat(javaClassName).isEqualTo("MyClass"); + private OperationModel opModel(Consumer operationModifier) { + OperationModel model = new OperationModel(); + operationModifier.accept(model); + return model; } - @Test - public void getJavaClassName_ReturnsSanitizedName_DoublePeriodsInClass() { - NamingStrategy strategy = new DefaultNamingStrategy(null, null); - String javaClassName = strategy.getJavaClassName("My..Class"); - assertThat(javaClassName).isEqualTo("MyClass"); + private ShapeModel shapeModel(Consumer shapeModifier) { + ShapeModel model = new ShapeModel(); + shapeModifier.accept(model); + return model; } - @Test - public void getJavaClassName_ReturnsSanitizedName_DoubleDashesInClass() { - NamingStrategy strategy = new DefaultNamingStrategy(null, null); - String javaClassName = strategy.getJavaClassName("My--Class"); - assertThat(javaClassName).isEqualTo("MyClass"); + private ShapeModel shapeWithMember(Consumer memberModifier) { + MemberModel model = new MemberModel(); + memberModifier.accept(model); + return shapeModel(s -> s.setMembers(singletonList(model))); } } diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/ClientTestModels.java b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/ClientTestModels.java index 25c34a37d3d4..6bc0740757ff 100644 --- a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/ClientTestModels.java +++ b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/ClientTestModels.java @@ -59,6 +59,20 @@ public static IntermediateModel queryServiceModels() { return new IntermediateModelBuilder(models).build(); } + public static IntermediateModel xmlServiceModels() { + File serviceModel = new File(ClientTestModels.class.getResource("client/c2j/xml/service-2.json").getFile()); + File customizationModel = new File(ClientTestModels.class.getResource("client/c2j/xml/customization.config").getFile()); + + + C2jModels models = C2jModels + .builder() + .serviceModel(getServiceModel(serviceModel)) + .customizationConfig(getCustomizationConfig(customizationModel)) + .build(); + + return new IntermediateModelBuilder(models).build(); + } + public static IntermediateModel endpointDiscoveryModels() { File serviceModel = new File(ClientTestModels.class.getResource("client/c2j/endpointdiscovery/service-2.json").getFile()); File customizationModel = new File(ClientTestModels.class.getResource("client/c2j/endpointdiscovery/customization.config").getFile()); diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/client/PoetClientFunctionalTests.java b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/client/PoetClientFunctionalTests.java index bddf732ff708..7a0fd95ff76a 100644 --- a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/client/PoetClientFunctionalTests.java +++ b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/client/PoetClientFunctionalTests.java @@ -65,6 +65,19 @@ public void asyncClientClassQuery() throws Exception { assertThat(syncClientClass, generatesTo("test-query-async-client-class.java")); } + @Test + public void syncClientClassXml() throws Exception { + SyncClientClass syncClientClass = createSyncClientClass(ClientTestModels.xmlServiceModels()); + assertThat(syncClientClass, generatesTo("test-xml-client-class.java")); + } + + + @Test + public void asyncClientClassXml() throws Exception { + AsyncClientClass syncClientClass = createAsyncClientClass(ClientTestModels.xmlServiceModels()); + assertThat(syncClientClass, generatesTo("test-xml-async-client-class.java")); + } + private SyncClientClass createSyncClientClass(IntermediateModel model) { return new SyncClientClass(GeneratorTaskParams.create(model, "sources/", "tests/")); } diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/eventstream/EventModelSpecTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/eventstream/EventModelSpecTest.java index bb018a062350..8a30f15bfede 100644 --- a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/eventstream/EventModelSpecTest.java +++ b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/eventstream/EventModelSpecTest.java @@ -14,6 +14,7 @@ import org.junit.runners.Parameterized; import software.amazon.awssdk.codegen.C2jModels; import software.amazon.awssdk.codegen.IntermediateModelBuilder; +import software.amazon.awssdk.codegen.customization.processors.UseLegacyEventGenerationSchemeProcessorTest; import software.amazon.awssdk.codegen.model.config.customization.CustomizationConfig; import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel; import software.amazon.awssdk.codegen.model.intermediate.MemberModel; @@ -58,14 +59,20 @@ private String referenceFileForShape() { } private static void setUp() { - File serviceModelFile = new File(AwsModelSpecTest.class.getResource("service-2.json").getFile()); + File serviceModelFile = new File(EventModelSpecTest.class.getResource("service-2.json").getFile()); ServiceModel serviceModel = ModelLoaderUtils.loadModel(ServiceModel.class, serviceModelFile); intermediateModel = new IntermediateModelBuilder( C2jModels.builder() .serviceModel(serviceModel) - .customizationConfig(CustomizationConfig.create()) + .customizationConfig(loadCustomizationConfig("customization.config")) .build()) .build(); } + + private static CustomizationConfig loadCustomizationConfig(String configName) { + String c2jFilePath = EventModelSpecTest.class.getResource(configName).getFile(); + File file = new File(c2jFilePath); + return ModelLoaderUtils.loadModel(CustomizationConfig.class, file); + } } diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/AwsModelSpecWithoutAutoConstructContainersTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/AwsModelSpecWithoutAutoConstructContainersTest.java deleted file mode 100644 index 834b9fc6ceb2..000000000000 --- a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/AwsModelSpecWithoutAutoConstructContainersTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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.codegen.poet.model; - -import static java.util.stream.Collectors.toList; -import static org.hamcrest.MatcherAssert.assertThat; -import static software.amazon.awssdk.codegen.poet.PoetMatchers.generatesTo; -import static software.amazon.awssdk.utils.FunctionalUtils.invokeSafely; - -import java.io.File; -import java.io.IOException; -import java.util.Collection; -import java.util.Locale; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import software.amazon.awssdk.codegen.C2jModels; -import software.amazon.awssdk.codegen.IntermediateModelBuilder; -import software.amazon.awssdk.codegen.model.config.customization.CustomizationConfig; -import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel; -import software.amazon.awssdk.codegen.model.intermediate.ShapeModel; -import software.amazon.awssdk.codegen.model.service.ServiceModel; -import software.amazon.awssdk.codegen.utils.ModelLoaderUtils; - -/** - * Similar to {@link AwsModelSpecTest} but tests correct generation when auto construct containers are disabled. - */ -@RunWith(Parameterized.class) -public class AwsModelSpecWithoutAutoConstructContainersTest { - private static IntermediateModel intermediateModel; - - private final ShapeModel shapeModel; - - @Parameterized.Parameters(name = "{0}") - public static Collection data() { - invokeSafely(AwsModelSpecWithoutAutoConstructContainersTest::setUp); - return intermediateModel.getShapes().values().stream().map(shape -> new Object[] { shape }).collect(toList()); - } - - public AwsModelSpecWithoutAutoConstructContainersTest(ShapeModel shapeModel) { - this.shapeModel = shapeModel; - } - - @Test - public void generationWithAutoConstructList() { - assertThat(new AwsServiceModel(intermediateModel, shapeModel), generatesTo(referenceFileForShape())); - } - - private String referenceFileForShape() { - String name = shapeModel.getShapeName().toLowerCase(Locale.ENGLISH) + ".java"; - String autoConstructVariant = "./nonautoconstructcontainers/" + name; - if (getClass().getResource(autoConstructVariant) != null) { - return autoConstructVariant; - } - return name; - } - - private static void setUp() throws IOException { - File serviceModelFile = new File(AwsModelSpecWithoutAutoConstructContainersTest.class.getResource("service-2.json").getFile()); - File customizationConfigFile = new File(AwsModelSpecWithoutAutoConstructContainersTest.class - .getResource("customization.config") - .getFile()); - ServiceModel serviceModel = ModelLoaderUtils.loadModel(ServiceModel.class, serviceModelFile); - CustomizationConfig autoConstructListConfig = ModelLoaderUtils.loadModel(CustomizationConfig.class, customizationConfigFile); - autoConstructListConfig.setUseAutoConstructList(false); - autoConstructListConfig.setUseAutoConstructMap(false); - - intermediateModel = new IntermediateModelBuilder( - C2jModels.builder() - .serviceModel(serviceModel) - .customizationConfig(autoConstructListConfig) - .build()) - .build(); - - } -} diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/ModelCopierSpecWithoutAutoConstructContainersTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/ModelCopierSpecWithoutAutoConstructContainersTest.java deleted file mode 100644 index 27f1cbb6eabe..000000000000 --- a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/ModelCopierSpecWithoutAutoConstructContainersTest.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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.codegen.poet.model; - -import static java.util.stream.Collectors.toList; -import static org.hamcrest.MatcherAssert.assertThat; -import static software.amazon.awssdk.codegen.poet.PoetMatchers.generatesTo; -import static software.amazon.awssdk.utils.FunctionalUtils.invokeSafely; - -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.Collection; -import java.util.Locale; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import software.amazon.awssdk.codegen.C2jModels; -import software.amazon.awssdk.codegen.IntermediateModelBuilder; -import software.amazon.awssdk.codegen.model.config.customization.CustomizationConfig; -import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel; -import software.amazon.awssdk.codegen.model.service.ServiceModel; -import software.amazon.awssdk.codegen.poet.ClassSpec; -import software.amazon.awssdk.codegen.utils.ModelLoaderUtils; - -/** - * Similar to {@link ModelCopierSpecTest} but tests correct generation when auto construct containers are disabled. - */ -@RunWith(Parameterized.class) -public class ModelCopierSpecWithoutAutoConstructContainersTest { - private static File serviceModelFile; - private static IntermediateModel intermediateModel; - private final ClassSpec spec; - private final String specName; - - private static void setUp() throws URISyntaxException, IOException { - serviceModelFile = new File(AwsModelSpecTest.class - .getResource("service-2.json") - .getFile()); - - File customizationConfigFile = new File(AwsModelSpecTest.class - .getResource("customization.config") - .getFile()); - - CustomizationConfig customizationConfig = ModelLoaderUtils.loadModel(CustomizationConfig.class, customizationConfigFile); - customizationConfig.setUseAutoConstructList(false); - customizationConfig.setUseAutoConstructMap(false); - - intermediateModel = new IntermediateModelBuilder( - C2jModels.builder() - .serviceModel(ModelLoaderUtils.loadModel(ServiceModel.class, serviceModelFile)) - .customizationConfig(customizationConfig) - .build()) - .build(); - } - - @Parameterized.Parameters(name = "{1}") - public static Collection data() { - invokeSafely(ModelCopierSpecWithoutAutoConstructContainersTest::setUp); - return new ServiceModelCopiers(intermediateModel).copierSpecs().stream() - .map(spec -> new Object[] { spec, spec.className().simpleName().toLowerCase(Locale.ENGLISH) }) - .collect(toList()); - } - - public ModelCopierSpecWithoutAutoConstructContainersTest(ClassSpec spec, String specName) { - this.spec = spec; - this.specName = specName; - } - - @Test - public void basicGeneration() { - assertThat(spec, generatesTo(expectedFile())); - } - - private String expectedFile() { - String name = specName + ".java"; - String autoConstructVariant = "./nonautoconstructcontainers/" + name; - if (getClass().getResource(autoConstructVariant) != null) { - return autoConstructVariant; - } - return name; - } -} diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/emitters/customizations/processors/uselegacyeventgenerationscheme/happy-case-customization.config b/codegen/src/test/resources/software/amazon/awssdk/codegen/emitters/customizations/processors/uselegacyeventgenerationscheme/happy-case-customization.config index 202834524210..8c8a414fcc24 100644 --- a/codegen/src/test/resources/software/amazon/awssdk/codegen/emitters/customizations/processors/uselegacyeventgenerationscheme/happy-case-customization.config +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/emitters/customizations/processors/uselegacyeventgenerationscheme/happy-case-customization.config @@ -1,5 +1,6 @@ { "useLegacyEventGenerationScheme": { "EventStream": ["EventOne"] - } + }, + "underscoresInNameBehavior": "ALLOW" } diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/emitters/customizations/processors/uselegacyeventgenerationscheme/service-2.json b/codegen/src/test/resources/software/amazon/awssdk/codegen/emitters/customizations/processors/uselegacyeventgenerationscheme/service-2.json index 4b862fd96839..9d013117fcad 100644 --- a/codegen/src/test/resources/software/amazon/awssdk/codegen/emitters/customizations/processors/uselegacyeventgenerationscheme/service-2.json +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/emitters/customizations/processors/uselegacyeventgenerationscheme/service-2.json @@ -404,16 +404,16 @@ "EventOne": { "shape": "EventOne" }, - "event-two": { + "event_two": { "shape": "EventTwo" }, "secondEventOne": { "shape": "EventOne" }, - "second-event-two": { + "second_event_two": { "shape": "EventTwo" }, - "third-event-two-customizedVisitMethod": { + "third_event_two_customizedVisitMethod": { "shape": "EventTwo" } }, diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/json/service-2.json b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/json/service-2.json index 4670a30fdfa3..d2a5578398b7 100644 --- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/json/service-2.json +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/json/service-2.json @@ -13,6 +13,14 @@ "xmlNamespace": "https://json-service.amazonaws.com/doc/2010-05-08/" }, "operations": { + "OperationWithChecksumRequired": { + "name": "APostOperation", + "http": { + "method": "POST", + "requestUri": "/" + }, + "httpChecksumRequired": true + }, "APostOperation": { "name": "APostOperation", "http": { @@ -404,14 +412,11 @@ "EventOne": { "shape": "EventOne" }, - "event-two": { + "EventTheSecond": { "shape": "EventTwo" }, "secondEventOne": { "shape": "EventOne" - }, - "second-event-two": { - "shape": "EventTwo" } }, "eventstream": true diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/query/service-2.json b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/query/service-2.json index f1771745a533..2cc6c02c3825 100644 --- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/query/service-2.json +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/query/service-2.json @@ -13,6 +13,14 @@ "xmlNamespace": "https://query-service.amazonaws.com/doc/2010-05-08/" }, "operations": { + "OperationWithChecksumRequired": { + "name": "APostOperation", + "http": { + "method": "POST", + "requestUri": "/" + }, + "httpChecksumRequired": true + }, "APostOperation": { "name": "APostOperation", "http": { diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/xml/customization.config b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/xml/customization.config new file mode 100644 index 000000000000..dda643384baa --- /dev/null +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/xml/customization.config @@ -0,0 +1,5 @@ +{ + "authPolicyActions" : { + "skip" : true + } +} diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/xml/service-2.json b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/xml/service-2.json new file mode 100644 index 000000000000..bbf395164f8a --- /dev/null +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/xml/service-2.json @@ -0,0 +1,193 @@ +{ + "version": "2.0", + "metadata": { + "apiVersion": "2010-05-08", + "endpointPrefix": "xml-service", + "globalEndpoint": "xml-service.amazonaws.com", + "protocol": "rest-xml", + "serviceAbbreviation": "xml Service", + "serviceFullName": "Some Service That Uses xml Protocol", + "serviceId":"Xml Service", + "signatureVersion": "v4", + "uid": "xml-service-2010-05-08", + "xmlNamespace": "https://xml-service.amazonaws.com/doc/2010-05-08/" + }, + "operations": { + "OperationWithChecksumRequired": { + "name": "APostOperation", + "http": { + "method": "POST", + "requestUri": "/" + }, + "httpChecksumRequired": true + }, + "APostOperation": { + "name": "APostOperation", + "http": { + "method": "POST", + "requestUri": "/" + }, + "endpoint": { + "hostPrefix": "foo-" + }, + "input": { + "shape": "APostOperationRequest" + }, + "errors": [ + { + "shape": "InvalidInputException" + } + ], + "documentation": "Performs a post operation to the xml service and has no output" + }, + "APostOperationWithOutput": { + "name": "APostOperation", + "http": { + "method": "POST", + "requestUri": "/" + }, + "input": { + "shape": "APostOperationWithOutputRequest" + }, + "output": { + "shape": "APostOperationWithOutputResponse", + "resultWrapper": "APostOperationWithOutputResult" + }, + "errors": [ + { + "shape": "InvalidInputException" + } + ], + "documentation": "Performs a post operation to the xml service and has modelled output" + }, + "StreamingInputOperation": { + "name": "StreamingInputOperation", + "http": { + "method": "POST", + "requestUri": "/2016-03-11/streamingInputOperation" + }, + "input": { + "shape": "StructureWithStreamingMember" + }, + "documentation": "Some operation with a streaming input" + }, + "StreamingOutputOperation": { + "name": "StreamingOutputOperation", + "http": { + "method": "POST", + "requestUri": "/2016-03-11/streamingOutputOperation" + }, + "output": { + "shape": "StructureWithStreamingMember" + }, + "documentation": "Some operation with a streaming output" + } + }, + "shapes": { + "APostOperationRequest": { + "type": "structure", + "required": [ + "SomeNestedMember" + ], + "members": { + "SomeNestedMember": { + "shape": "nestedMember", + "documentation": "a member that has nested members" + }, + "OptionalMember": { + "shape": "dateType", + "documentation": "An optional member" + } + } + }, + "APostOperationWithOutputRequest": { + "type": "structure", + "required": [ + "SomeNestedMember" + ], + "members": { + "SomeNestedMember": { + "shape": "nestedMember", + "documentation": "a member that has nested members" + }, + "OptionalMember": { + "shape": "dateType", + "documentation": "An optional member" + } + } + }, + "APostOperationWithOutputResponse": { + "type": "structure", + "required": [ + "NestedMember" + ], + "members": { + "NestedMember": { + "shape": "nestedMember", + "documentation": "A structure containing nested members" + } + }, + "documentation": "Contains the response to a successful APostOperationWithOutput request. " + }, + "InvalidInputException": { + "type": "structure", + "members": { + "message": { + "shape": "invalidInputMessage" + } + }, + "documentation": "The request was rejected because an invalid or out-of-range value was supplied for an input parameter.", + "error": { + "code": "InvalidInput", + "httpStatusCode": 400, + "senderFault": true + }, + "exception": true + }, + "nestedMember": { + "type": "structure", + "required": [ + "SubMember", + "CreateDate" + ], + "members": { + "SubMember": { + "shape": "subMember", + "documentation": "A sub-member" + }, + "CreateDate": { + "shape": "dateType", + "documentation": "The date and time, in ISO 8601 date-time format, when the member was created." + } + }, + "documentation": "A shape with nested sub-members" + }, + "subMember": { + "type": "string", + "max": 63, + "min": 3, + "pattern": "^[a-z0-9](([a-z0-9]|-(?!-))*[a-z0-9])?$" + }, + "dateType": { + "type": "timestamp" + }, + "invalidInputMessage": { + "type": "string" + }, + "StreamType": { + "type": "blob", + "streaming": true + }, + "StructureWithStreamingMember": { + "type": "structure", + "members": { + "StreamingMember": { + "shape": "StreamType", + "documentation": "This be a stream" + } + }, + "payload": "StreamingMember" + } + }, + "documentation": "A service that is implemented using the xml protocol" +} diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-async-client-class.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-async-client-class.java index f8b0a8eac9c0..721b3fa897e4 100644 --- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-async-client-class.java +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-async-client-class.java @@ -38,6 +38,8 @@ import software.amazon.awssdk.core.client.handler.AttachHttpMetadataResponseHandler; import software.amazon.awssdk.core.client.handler.ClientExecutionParams; import software.amazon.awssdk.core.http.HttpResponseHandler; +import software.amazon.awssdk.core.interceptor.SdkInternalExecutionAttribute; +import software.amazon.awssdk.core.interceptor.trait.HttpChecksumRequired; import software.amazon.awssdk.core.metrics.CoreMetric; import software.amazon.awssdk.core.protocol.VoidSdkResponse; import software.amazon.awssdk.core.runtime.transform.AsyncStreamingRequestMarshaller; @@ -75,6 +77,8 @@ import software.amazon.awssdk.services.json.model.InvalidInputException; import software.amazon.awssdk.services.json.model.JsonException; import software.amazon.awssdk.services.json.model.JsonRequest; +import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredRequest; +import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredResponse; import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyRequest; import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyResponse; import software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyRequest; @@ -95,6 +99,7 @@ import software.amazon.awssdk.services.json.transform.GetWithoutRequiredMembersRequestMarshaller; import software.amazon.awssdk.services.json.transform.InputEventMarshaller; import software.amazon.awssdk.services.json.transform.InputEventTwoMarshaller; +import software.amazon.awssdk.services.json.transform.OperationWithChecksumRequiredRequestMarshaller; import software.amazon.awssdk.services.json.transform.PaginatedOperationWithResultKeyRequestMarshaller; import software.amazon.awssdk.services.json.transform.PaginatedOperationWithoutResultKeyRequestMarshaller; import software.amazon.awssdk.services.json.transform.StreamingInputOperationRequestMarshaller; @@ -300,9 +305,8 @@ public CompletableFuture eventStreamOperation(EventStreamOperationRequest HttpResponseHandler extends EventStream> eventResponseHandler = protocolFactory.createResponseHandler( JsonOperationMetadata.builder().isPayloadJson(true).hasStreamingSuccessResponse(false).build(), EventStreamTaggedUnionPojoSupplier.builder().putSdkPojoSupplier("EventOne", EventOne::builder) - .putSdkPojoSupplier("event-two", EventTwo::builder) + .putSdkPojoSupplier("EventTheSecond", EventTwo::builder) .putSdkPojoSupplier("secondEventOne", EventOne::builder) - .putSdkPojoSupplier("second-event-two", EventTwo::builder) .defaultSdkPojoSupplier(() -> new SdkPojoBuilder(EventStream.UNKNOWN)).build()); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, @@ -327,10 +331,10 @@ public CompletableFuture eventStreamOperation(EventStreamOperationRequest new ClientExecutionParams() .withOperationName("EventStreamOperation") .withMarshaller(new EventStreamOperationRequestMarshaller(protocolFactory)) - .withAsyncRequestBody(software.amazon.awssdk.core.async.AsyncRequestBody.fromPublisher(adapted)) - .withFullDuplex(true).withResponseHandler(responseHandler) - .withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector) - .withInput(eventStreamOperationRequest), restAsyncResponseTransformer); + .withAsyncRequestBody(AsyncRequestBody.fromPublisher(adapted)).withFullDuplex(true) + .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) + .withMetricCollector(apiCallMetricCollector).withInput(eventStreamOperationRequest), + restAsyncResponseTransformer); AwsRequestOverrideConfiguration requestOverrideConfig = eventStreamOperationRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { @@ -405,9 +409,9 @@ public CompletableFuture eventStreamO .execute(new ClientExecutionParams() .withOperationName("EventStreamOperationWithOnlyInput") .withMarshaller(new EventStreamOperationWithOnlyInputRequestMarshaller(protocolFactory)) - .withAsyncRequestBody(software.amazon.awssdk.core.async.AsyncRequestBody.fromPublisher(adapted)) - .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) - .withMetricCollector(apiCallMetricCollector).withInput(eventStreamOperationWithOnlyInputRequest)); + .withAsyncRequestBody(AsyncRequestBody.fromPublisher(adapted)).withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector) + .withInput(eventStreamOperationWithOnlyInputRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = eventStreamOperationWithOnlyInputRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { @@ -464,9 +468,8 @@ public CompletableFuture eventStreamOperationWithOnlyOutput( HttpResponseHandler extends EventStream> eventResponseHandler = protocolFactory.createResponseHandler( JsonOperationMetadata.builder().isPayloadJson(true).hasStreamingSuccessResponse(false).build(), EventStreamTaggedUnionPojoSupplier.builder().putSdkPojoSupplier("EventOne", EventOne::builder) - .putSdkPojoSupplier("event-two", EventTwo::builder) + .putSdkPojoSupplier("EventTheSecond", EventTwo::builder) .putSdkPojoSupplier("secondEventOne", EventOne::builder) - .putSdkPojoSupplier("second-event-two", EventTwo::builder) .defaultSdkPojoSupplier(() -> new SdkPojoBuilder(EventStream.UNKNOWN)).build()); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, @@ -573,6 +576,67 @@ public CompletableFuture getWithoutRequiredMe } } + /** + * Invokes the OperationWithChecksumRequired operation asynchronously. + * + * @param operationWithChecksumRequiredRequest + * @return A Java Future containing the result of the OperationWithChecksumRequired operation returned by the + * service. + * The CompletableFuture returned by this method can be completed exceptionally with the following + * exceptions. + * + * SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). + * Can be used for catch all scenarios. + * SdkClientException If any client side error occurs such as an IO related failure, failure to get + * credentials, etc. + * JsonException Base class for all service exceptions. Unknown exceptions will be thrown as an instance + * of this type. + * + * @sample JsonAsyncClient.OperationWithChecksumRequired + * @see AWS API Documentation + */ + @Override + public CompletableFuture operationWithChecksumRequired( + OperationWithChecksumRequiredRequest operationWithChecksumRequiredRequest) { + List metricPublishers = resolveMetricPublishers(clientConfiguration, + operationWithChecksumRequiredRequest.overrideConfiguration().orElse(null)); + MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector + .create("ApiCall"); + try { + apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); + apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "OperationWithChecksumRequired"); + JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) + .isPayloadJson(true).build(); + + HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( + operationMetadata, OperationWithChecksumRequiredResponse::builder); + + HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, + operationMetadata); + + CompletableFuture executeFuture = clientHandler + .execute(new ClientExecutionParams() + .withOperationName("OperationWithChecksumRequired") + .withMarshaller(new OperationWithChecksumRequiredRequestMarshaller(protocolFactory)) + .withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler) + .withMetricCollector(apiCallMetricCollector) + .putExecutionAttribute(SdkInternalExecutionAttribute.HTTP_CHECKSUM_REQUIRED, + HttpChecksumRequired.create()).withInput(operationWithChecksumRequiredRequest)); + AwsRequestOverrideConfiguration requestOverrideConfig = operationWithChecksumRequiredRequest.overrideConfiguration() + .orElse(null); + CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { + metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); + }); + executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); + return executeFuture; + } catch (Throwable t) { + metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); + return CompletableFutureUtils.failedFuture(t); + } + } + /** * Some paginated operation with result_key in paginators.json file * @@ -653,7 +717,7 @@ public CompletableFuture paginatedOpera * The following are few ways to use the response class: * * 1) Using the subscribe helper method - * + * * * {@code * software.amazon.awssdk.services.json.paginators.PaginatedOperationWithResultKeyPublisher publisher = client.paginatedOperationWithResultKeyPaginator(request); @@ -663,19 +727,19 @@ public CompletableFuture paginatedOpera * * * 2) Using a custom subscriber - * + * * * {@code * software.amazon.awssdk.services.json.paginators.PaginatedOperationWithResultKeyPublisher publisher = client.paginatedOperationWithResultKeyPaginator(request); * publisher.subscribe(new Subscriber() { - * + * * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; - * - * + * + * * public void onNext(software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyResponse response) { //... }; * });} * - * + * * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. * * Please notice that the configuration of MaxResults won't limit the number of results you get with the @@ -788,7 +852,7 @@ public CompletableFuture paginatedOp * The following are few ways to use the response class: * * 1) Using the subscribe helper method - * + * * * {@code * software.amazon.awssdk.services.json.paginators.PaginatedOperationWithoutResultKeyPublisher publisher = client.paginatedOperationWithoutResultKeyPaginator(request); @@ -798,19 +862,19 @@ public CompletableFuture paginatedOp * * * 2) Using a custom subscriber - * + * * * {@code * software.amazon.awssdk.services.json.paginators.PaginatedOperationWithoutResultKeyPublisher publisher = client.paginatedOperationWithoutResultKeyPaginator(request); * publisher.subscribe(new Subscriber() { - * + * * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; - * - * + * + * * public void onNext(software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyResponse response) { //... }; * });} * - * + * * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. * * Please notice that the configuration of MaxResults won't limit the number of results you get with the @@ -1129,3 +1193,4 @@ private HttpResponseHandler createErrorResponseHandler(Base return protocolFactory.createErrorResponseHandler(operationMetadata); } } + diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-async-client-interface.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-async-client-interface.java index e97f69cd5896..43455c17f37e 100644 --- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-async-client-interface.java +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-async-client-interface.java @@ -22,6 +22,8 @@ import software.amazon.awssdk.services.json.model.GetWithoutRequiredMembersResponse; import software.amazon.awssdk.services.json.model.InputEventStream; import software.amazon.awssdk.services.json.model.InputEventStreamTwo; +import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredRequest; +import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredResponse; import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyRequest; import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyResponse; import software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyRequest; @@ -145,7 +147,7 @@ default CompletableFuture aPostOperation(ConsumerAWS API Documentation */ default CompletableFuture aPostOperationWithOutput( - APostOperationWithOutputRequest aPostOperationWithOutputRequest) { + APostOperationWithOutputRequest aPostOperationWithOutputRequest) { throw new UnsupportedOperationException(); } @@ -180,9 +182,9 @@ default CompletableFuture aPostOperationWithOu * target="_top">AWS API Documentation */ default CompletableFuture aPostOperationWithOutput( - Consumer aPostOperationWithOutputRequest) { + Consumer aPostOperationWithOutputRequest) { return aPostOperationWithOutput(APostOperationWithOutputRequest.builder().applyMutation(aPostOperationWithOutputRequest) - .build()); + .build()); } /** @@ -205,7 +207,7 @@ default CompletableFuture aPostOperationWithOu * target="_top">AWS API Documentation */ default CompletableFuture eventStreamOperation(EventStreamOperationRequest eventStreamOperationRequest, - Publisher requestStream, EventStreamOperationResponseHandler asyncResponseHandler) { + Publisher requestStream, EventStreamOperationResponseHandler asyncResponseHandler) { throw new UnsupportedOperationException(); } @@ -235,10 +237,10 @@ default CompletableFuture eventStreamOperation(EventStreamOperationRequest * target="_top">AWS API Documentation */ default CompletableFuture eventStreamOperation( - Consumer eventStreamOperationRequest, Publisher requestStream, - EventStreamOperationResponseHandler asyncResponseHandler) { + Consumer eventStreamOperationRequest, Publisher requestStream, + EventStreamOperationResponseHandler asyncResponseHandler) { return eventStreamOperation(EventStreamOperationRequest.builder().applyMutation(eventStreamOperationRequest).build(), - requestStream, asyncResponseHandler); + requestStream, asyncResponseHandler); } /** @@ -262,8 +264,8 @@ default CompletableFuture eventStreamOperation( * target="_top">AWS API Documentation */ default CompletableFuture eventStreamOperationWithOnlyInput( - EventStreamOperationWithOnlyInputRequest eventStreamOperationWithOnlyInputRequest, - Publisher requestStream) { + EventStreamOperationWithOnlyInputRequest eventStreamOperationWithOnlyInputRequest, + Publisher requestStream) { throw new UnsupportedOperationException(); } @@ -294,11 +296,11 @@ default CompletableFuture eventStream * target="_top">AWS API Documentation */ default CompletableFuture eventStreamOperationWithOnlyInput( - Consumer eventStreamOperationWithOnlyInputRequest, - Publisher requestStream) { + Consumer eventStreamOperationWithOnlyInputRequest, + Publisher requestStream) { return eventStreamOperationWithOnlyInput( - EventStreamOperationWithOnlyInputRequest.builder().applyMutation(eventStreamOperationWithOnlyInputRequest) - .build(), requestStream); + EventStreamOperationWithOnlyInputRequest.builder().applyMutation(eventStreamOperationWithOnlyInputRequest) + .build(), requestStream); } /** @@ -322,8 +324,8 @@ default CompletableFuture eventStream * target="_top">AWS API Documentation */ default CompletableFuture eventStreamOperationWithOnlyOutput( - EventStreamOperationWithOnlyOutputRequest eventStreamOperationWithOnlyOutputRequest, - EventStreamOperationWithOnlyOutputResponseHandler asyncResponseHandler) { + EventStreamOperationWithOnlyOutputRequest eventStreamOperationWithOnlyOutputRequest, + EventStreamOperationWithOnlyOutputResponseHandler asyncResponseHandler) { throw new UnsupportedOperationException(); } @@ -354,11 +356,11 @@ default CompletableFuture eventStreamOperationWithOnlyOutput( * target="_top">AWS API Documentation */ default CompletableFuture eventStreamOperationWithOnlyOutput( - Consumer eventStreamOperationWithOnlyOutputRequest, - EventStreamOperationWithOnlyOutputResponseHandler asyncResponseHandler) { + Consumer eventStreamOperationWithOnlyOutputRequest, + EventStreamOperationWithOnlyOutputResponseHandler asyncResponseHandler) { return eventStreamOperationWithOnlyOutput( - EventStreamOperationWithOnlyOutputRequest.builder().applyMutation(eventStreamOperationWithOnlyOutputRequest) - .build(), asyncResponseHandler); + EventStreamOperationWithOnlyOutputRequest.builder().applyMutation(eventStreamOperationWithOnlyOutputRequest) + .build(), asyncResponseHandler); } /** @@ -385,7 +387,7 @@ default CompletableFuture eventStreamOperationWithOnlyOutput( * target="_top">AWS API Documentation */ default CompletableFuture getWithoutRequiredMembers( - GetWithoutRequiredMembersRequest getWithoutRequiredMembersRequest) { + GetWithoutRequiredMembersRequest getWithoutRequiredMembersRequest) { throw new UnsupportedOperationException(); } @@ -420,9 +422,66 @@ default CompletableFuture getWithoutRequiredM * target="_top">AWS API Documentation */ default CompletableFuture getWithoutRequiredMembers( - Consumer getWithoutRequiredMembersRequest) { + Consumer getWithoutRequiredMembersRequest) { return getWithoutRequiredMembers(GetWithoutRequiredMembersRequest.builder() - .applyMutation(getWithoutRequiredMembersRequest).build()); + .applyMutation(getWithoutRequiredMembersRequest).build()); + } + + /** + * Invokes the OperationWithChecksumRequired operation asynchronously. + * + * @param operationWithChecksumRequiredRequest + * @return A Java Future containing the result of the OperationWithChecksumRequired operation returned by the + * service. + * The CompletableFuture returned by this method can be completed exceptionally with the following + * exceptions. + * + * SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). + * Can be used for catch all scenarios. + * SdkClientException If any client side error occurs such as an IO related failure, failure to get + * credentials, etc. + * JsonException Base class for all service exceptions. Unknown exceptions will be thrown as an instance + * of this type. + * + * @sample JsonAsyncClient.OperationWithChecksumRequired + * @see AWS API Documentation + */ + default CompletableFuture operationWithChecksumRequired( + OperationWithChecksumRequiredRequest operationWithChecksumRequiredRequest) { + throw new UnsupportedOperationException(); + } + + /** + * Invokes the OperationWithChecksumRequired operation asynchronously. + * + * This is a convenience which creates an instance of the {@link OperationWithChecksumRequiredRequest.Builder} + * avoiding the need to create one manually via {@link OperationWithChecksumRequiredRequest#builder()} + * + * + * @param operationWithChecksumRequiredRequest + * A {@link Consumer} that will call methods on {@link OperationWithChecksumRequiredRequest.Builder} to + * create a request. + * @return A Java Future containing the result of the OperationWithChecksumRequired operation returned by the + * service. + * The CompletableFuture returned by this method can be completed exceptionally with the following + * exceptions. + * + * SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). + * Can be used for catch all scenarios. + * SdkClientException If any client side error occurs such as an IO related failure, failure to get + * credentials, etc. + * JsonException Base class for all service exceptions. Unknown exceptions will be thrown as an instance + * of this type. + * + * @sample JsonAsyncClient.OperationWithChecksumRequired + * @see AWS API Documentation + */ + default CompletableFuture operationWithChecksumRequired( + Consumer operationWithChecksumRequiredRequest) { + return operationWithChecksumRequired(OperationWithChecksumRequiredRequest.builder() + .applyMutation(operationWithChecksumRequiredRequest).build()); } /** @@ -446,7 +505,7 @@ default CompletableFuture getWithoutRequiredM * target="_top">AWS API Documentation */ default CompletableFuture paginatedOperationWithResultKey( - PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) { + PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) { throw new UnsupportedOperationException(); } @@ -477,9 +536,9 @@ default CompletableFuture paginatedOper * target="_top">AWS API Documentation */ default CompletableFuture paginatedOperationWithResultKey( - Consumer paginatedOperationWithResultKeyRequest) { + Consumer paginatedOperationWithResultKeyRequest) { return paginatedOperationWithResultKey(PaginatedOperationWithResultKeyRequest.builder() - .applyMutation(paginatedOperationWithResultKeyRequest).build()); + .applyMutation(paginatedOperationWithResultKeyRequest).build()); } /** @@ -653,7 +712,7 @@ default PaginatedOperationWithResultKeyPublisher paginatedOperationWithResultKey * target="_top">AWS API Documentation */ default PaginatedOperationWithResultKeyPublisher paginatedOperationWithResultKeyPaginator( - PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) { + PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) { throw new UnsupportedOperationException(); } @@ -736,9 +795,9 @@ default PaginatedOperationWithResultKeyPublisher paginatedOperationWithResultKey * target="_top">AWS API Documentation */ default PaginatedOperationWithResultKeyPublisher paginatedOperationWithResultKeyPaginator( - Consumer paginatedOperationWithResultKeyRequest) { + Consumer paginatedOperationWithResultKeyRequest) { return paginatedOperationWithResultKeyPaginator(PaginatedOperationWithResultKeyRequest.builder() - .applyMutation(paginatedOperationWithResultKeyRequest).build()); + .applyMutation(paginatedOperationWithResultKeyRequest).build()); } /** @@ -762,7 +821,7 @@ default PaginatedOperationWithResultKeyPublisher paginatedOperationWithResultKey * target="_top">AWS API Documentation */ default CompletableFuture paginatedOperationWithoutResultKey( - PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) { + PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) { throw new UnsupportedOperationException(); } @@ -793,9 +852,9 @@ default CompletableFuture paginatedO * target="_top">AWS API Documentation */ default CompletableFuture paginatedOperationWithoutResultKey( - Consumer paginatedOperationWithoutResultKeyRequest) { + Consumer paginatedOperationWithoutResultKeyRequest) { return paginatedOperationWithoutResultKey(PaginatedOperationWithoutResultKeyRequest.builder() - .applyMutation(paginatedOperationWithoutResultKeyRequest).build()); + .applyMutation(paginatedOperationWithoutResultKeyRequest).build()); } /** @@ -871,7 +930,7 @@ default CompletableFuture paginatedO * target="_top">AWS API Documentation */ default PaginatedOperationWithoutResultKeyPublisher paginatedOperationWithoutResultKeyPaginator( - PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) { + PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) { throw new UnsupportedOperationException(); } @@ -954,9 +1013,9 @@ default PaginatedOperationWithoutResultKeyPublisher paginatedOperationWithoutRes * target="_top">AWS API Documentation */ default PaginatedOperationWithoutResultKeyPublisher paginatedOperationWithoutResultKeyPaginator( - Consumer paginatedOperationWithoutResultKeyRequest) { + Consumer paginatedOperationWithoutResultKeyRequest) { return paginatedOperationWithoutResultKeyPaginator(PaginatedOperationWithoutResultKeyRequest.builder() - .applyMutation(paginatedOperationWithoutResultKeyRequest).build()); + .applyMutation(paginatedOperationWithoutResultKeyRequest).build()); } /** @@ -984,7 +1043,7 @@ default PaginatedOperationWithoutResultKeyPublisher paginatedOperationWithoutRes * target="_top">AWS API Documentation */ default CompletableFuture streamingInputOperation( - StreamingInputOperationRequest streamingInputOperationRequest, AsyncRequestBody requestBody) { + StreamingInputOperationRequest streamingInputOperationRequest, AsyncRequestBody requestBody) { throw new UnsupportedOperationException(); } @@ -1019,9 +1078,9 @@ default CompletableFuture streamingInputOperati * target="_top">AWS API Documentation */ default CompletableFuture streamingInputOperation( - Consumer streamingInputOperationRequest, AsyncRequestBody requestBody) { + Consumer streamingInputOperationRequest, AsyncRequestBody requestBody) { return streamingInputOperation(StreamingInputOperationRequest.builder().applyMutation(streamingInputOperationRequest) - .build(), requestBody); + .build(), requestBody); } /** @@ -1049,7 +1108,7 @@ default CompletableFuture streamingInputOperati * target="_top">AWS API Documentation */ default CompletableFuture streamingInputOperation( - StreamingInputOperationRequest streamingInputOperationRequest, Path sourcePath) { + StreamingInputOperationRequest streamingInputOperationRequest, Path sourcePath) { return streamingInputOperation(streamingInputOperationRequest, AsyncRequestBody.fromFile(sourcePath)); } @@ -1084,9 +1143,9 @@ default CompletableFuture streamingInputOperati * target="_top">AWS API Documentation */ default CompletableFuture streamingInputOperation( - Consumer streamingInputOperationRequest, Path sourcePath) { + Consumer streamingInputOperationRequest, Path sourcePath) { return streamingInputOperation(StreamingInputOperationRequest.builder().applyMutation(streamingInputOperationRequest) - .build(), sourcePath); + .build(), sourcePath); } /** @@ -1119,8 +1178,8 @@ default CompletableFuture streamingInputOperati * target="_top">AWS API Documentation */ default CompletableFuture streamingInputOutputOperation( - StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, AsyncRequestBody requestBody, - AsyncResponseTransformer asyncResponseTransformer) { + StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, AsyncRequestBody requestBody, + AsyncResponseTransformer asyncResponseTransformer) { throw new UnsupportedOperationException(); } @@ -1160,12 +1219,12 @@ default CompletableFuture streamingInputOutputOperation( * target="_top">AWS API Documentation */ default CompletableFuture streamingInputOutputOperation( - Consumer streamingInputOutputOperationRequest, - AsyncRequestBody requestBody, - AsyncResponseTransformer asyncResponseTransformer) { + Consumer streamingInputOutputOperationRequest, + AsyncRequestBody requestBody, + AsyncResponseTransformer asyncResponseTransformer) { return streamingInputOutputOperation( - StreamingInputOutputOperationRequest.builder().applyMutation(streamingInputOutputOperationRequest).build(), - requestBody, asyncResponseTransformer); + StreamingInputOutputOperationRequest.builder().applyMutation(streamingInputOutputOperationRequest).build(), + requestBody, asyncResponseTransformer); } /** @@ -1197,9 +1256,9 @@ default CompletableFuture streamingInputOutputOperation( * target="_top">AWS API Documentation */ default CompletableFuture streamingInputOutputOperation( - StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, Path sourcePath, Path destinationPath) { + StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, Path sourcePath, Path destinationPath) { return streamingInputOutputOperation(streamingInputOutputOperationRequest, AsyncRequestBody.fromFile(sourcePath), - AsyncResponseTransformer.toFile(destinationPath)); + AsyncResponseTransformer.toFile(destinationPath)); } /** @@ -1237,11 +1296,11 @@ default CompletableFuture streamingInputO * target="_top">AWS API Documentation */ default CompletableFuture streamingInputOutputOperation( - Consumer streamingInputOutputOperationRequest, Path sourcePath, - Path destinationPath) { + Consumer streamingInputOutputOperationRequest, Path sourcePath, + Path destinationPath) { return streamingInputOutputOperation( - StreamingInputOutputOperationRequest.builder().applyMutation(streamingInputOutputOperationRequest).build(), - sourcePath, destinationPath); + StreamingInputOutputOperationRequest.builder().applyMutation(streamingInputOutputOperationRequest).build(), + sourcePath, destinationPath); } /** @@ -1269,8 +1328,8 @@ default CompletableFuture streamingInputO * target="_top">AWS API Documentation */ default CompletableFuture streamingOutputOperation( - StreamingOutputOperationRequest streamingOutputOperationRequest, - AsyncResponseTransformer asyncResponseTransformer) { + StreamingOutputOperationRequest streamingOutputOperationRequest, + AsyncResponseTransformer asyncResponseTransformer) { throw new UnsupportedOperationException(); } @@ -1305,10 +1364,10 @@ default CompletableFuture streamingOutputOperation( * target="_top">AWS API Documentation */ default CompletableFuture streamingOutputOperation( - Consumer streamingOutputOperationRequest, - AsyncResponseTransformer asyncResponseTransformer) { + Consumer streamingOutputOperationRequest, + AsyncResponseTransformer asyncResponseTransformer) { return streamingOutputOperation(StreamingOutputOperationRequest.builder().applyMutation(streamingOutputOperationRequest) - .build(), asyncResponseTransformer); + .build(), asyncResponseTransformer); } /** @@ -1335,7 +1394,7 @@ default CompletableFuture streamingOutputOperation( * target="_top">AWS API Documentation */ default CompletableFuture streamingOutputOperation( - StreamingOutputOperationRequest streamingOutputOperationRequest, Path destinationPath) { + StreamingOutputOperationRequest streamingOutputOperationRequest, Path destinationPath) { return streamingOutputOperation(streamingOutputOperationRequest, AsyncResponseTransformer.toFile(destinationPath)); } @@ -1369,9 +1428,9 @@ default CompletableFuture streamingOutputOpera * target="_top">AWS API Documentation */ default CompletableFuture streamingOutputOperation( - Consumer streamingOutputOperationRequest, Path destinationPath) { + Consumer streamingOutputOperationRequest, Path destinationPath) { return streamingOutputOperation(StreamingOutputOperationRequest.builder().applyMutation(streamingOutputOperationRequest) - .build(), destinationPath); + .build(), destinationPath); } /** diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-class.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-class.java index 14c934f5b859..b1c99a29788f 100644 --- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-class.java +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-class.java @@ -17,6 +17,8 @@ import software.amazon.awssdk.core.client.handler.SyncClientHandler; import software.amazon.awssdk.core.exception.SdkClientException; import software.amazon.awssdk.core.http.HttpResponseHandler; +import software.amazon.awssdk.core.interceptor.SdkInternalExecutionAttribute; +import software.amazon.awssdk.core.interceptor.trait.HttpChecksumRequired; import software.amazon.awssdk.core.metrics.CoreMetric; import software.amazon.awssdk.core.runtime.transform.StreamingRequestMarshaller; import software.amazon.awssdk.core.signer.Signer; @@ -40,6 +42,8 @@ import software.amazon.awssdk.services.json.model.InvalidInputException; import software.amazon.awssdk.services.json.model.JsonException; import software.amazon.awssdk.services.json.model.JsonRequest; +import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredRequest; +import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredResponse; import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyRequest; import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyResponse; import software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyRequest; @@ -55,6 +59,7 @@ import software.amazon.awssdk.services.json.transform.APostOperationRequestMarshaller; import software.amazon.awssdk.services.json.transform.APostOperationWithOutputRequestMarshaller; import software.amazon.awssdk.services.json.transform.GetWithoutRequiredMembersRequestMarshaller; +import software.amazon.awssdk.services.json.transform.OperationWithChecksumRequiredRequestMarshaller; import software.amazon.awssdk.services.json.transform.PaginatedOperationWithResultKeyRequestMarshaller; import software.amazon.awssdk.services.json.transform.PaginatedOperationWithoutResultKeyRequestMarshaller; import software.amazon.awssdk.services.json.transform.StreamingInputOperationRequestMarshaller; @@ -112,32 +117,32 @@ public final String serviceName() { */ @Override public APostOperationResponse aPostOperation(APostOperationRequest aPostOperationRequest) throws InvalidInputException, - AwsServiceException, SdkClientException, JsonException { + AwsServiceException, SdkClientException, JsonException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) - .isPayloadJson(true).build(); + .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, - APostOperationResponse::builder); + APostOperationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, - operationMetadata); + operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, aPostOperationRequest - .overrideConfiguration().orElse(null)); + .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector - .create("ApiCall"); + .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "APostOperation"); String hostPrefix = "{StringMember}-foo."; HostnameValidator.validateHostnameCompliant(aPostOperationRequest.stringMember(), "StringMember", - "aPostOperationRequest"); + "aPostOperationRequest"); String resolvedHostExpression = String.format("%s-foo.", aPostOperationRequest.stringMember()); return clientHandler.execute(new ClientExecutionParams() - .withOperationName("APostOperation").withResponseHandler(responseHandler) - .withErrorResponseHandler(errorResponseHandler).hostPrefixExpression(resolvedHostExpression) - .withInput(aPostOperationRequest).withMetricCollector(apiCallMetricCollector) - .withMarshaller(new APostOperationRequestMarshaller(protocolFactory))); + .withOperationName("APostOperation").withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler).hostPrefixExpression(resolvedHostExpression) + .withInput(aPostOperationRequest).withMetricCollector(apiCallMetricCollector) + .withMarshaller(new APostOperationRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } @@ -165,30 +170,30 @@ public APostOperationResponse aPostOperation(APostOperationRequest aPostOperatio */ @Override public APostOperationWithOutputResponse aPostOperationWithOutput( - APostOperationWithOutputRequest aPostOperationWithOutputRequest) throws InvalidInputException, AwsServiceException, - SdkClientException, JsonException { + APostOperationWithOutputRequest aPostOperationWithOutputRequest) throws InvalidInputException, AwsServiceException, + SdkClientException, JsonException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) - .isPayloadJson(true).build(); + .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( - operationMetadata, APostOperationWithOutputResponse::builder); + operationMetadata, APostOperationWithOutputResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, - operationMetadata); + operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, aPostOperationWithOutputRequest - .overrideConfiguration().orElse(null)); + .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector - .create("ApiCall"); + .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "APostOperationWithOutput"); return clientHandler - .execute(new ClientExecutionParams() - .withOperationName("APostOperationWithOutput").withResponseHandler(responseHandler) - .withErrorResponseHandler(errorResponseHandler).withInput(aPostOperationWithOutputRequest) - .withMetricCollector(apiCallMetricCollector) - .withMarshaller(new APostOperationWithOutputRequestMarshaller(protocolFactory))); + .execute(new ClientExecutionParams() + .withOperationName("APostOperationWithOutput").withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler).withInput(aPostOperationWithOutputRequest) + .withMetricCollector(apiCallMetricCollector) + .withMarshaller(new APostOperationWithOutputRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } @@ -216,30 +221,81 @@ public APostOperationWithOutputResponse aPostOperationWithOutput( */ @Override public GetWithoutRequiredMembersResponse getWithoutRequiredMembers( - GetWithoutRequiredMembersRequest getWithoutRequiredMembersRequest) throws InvalidInputException, AwsServiceException, - SdkClientException, JsonException { + GetWithoutRequiredMembersRequest getWithoutRequiredMembersRequest) throws InvalidInputException, AwsServiceException, + SdkClientException, JsonException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) - .isPayloadJson(true).build(); + .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( - operationMetadata, GetWithoutRequiredMembersResponse::builder); + operationMetadata, GetWithoutRequiredMembersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, - operationMetadata); + operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, getWithoutRequiredMembersRequest - .overrideConfiguration().orElse(null)); + .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector - .create("ApiCall"); + .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetWithoutRequiredMembers"); return clientHandler - .execute(new ClientExecutionParams() - .withOperationName("GetWithoutRequiredMembers").withResponseHandler(responseHandler) - .withErrorResponseHandler(errorResponseHandler).withInput(getWithoutRequiredMembersRequest) - .withMetricCollector(apiCallMetricCollector) - .withMarshaller(new GetWithoutRequiredMembersRequestMarshaller(protocolFactory))); + .execute(new ClientExecutionParams() + .withOperationName("GetWithoutRequiredMembers").withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler).withInput(getWithoutRequiredMembersRequest) + .withMetricCollector(apiCallMetricCollector) + .withMarshaller(new GetWithoutRequiredMembersRequestMarshaller(protocolFactory))); + } finally { + metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); + } + } + + /** + * Invokes the OperationWithChecksumRequired operation. + * + * @param operationWithChecksumRequiredRequest + * @return Result of the OperationWithChecksumRequired operation returned by the service. + * @throws SdkException + * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for + * catch all scenarios. + * @throws SdkClientException + * If any client side error occurs such as an IO related failure, failure to get credentials, etc. + * @throws JsonException + * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. + * @sample JsonClient.OperationWithChecksumRequired + * @see AWS API Documentation + */ + @Override + public OperationWithChecksumRequiredResponse operationWithChecksumRequired( + OperationWithChecksumRequiredRequest operationWithChecksumRequiredRequest) throws AwsServiceException, + SdkClientException, JsonException { + JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) + .isPayloadJson(true).build(); + + HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( + operationMetadata, OperationWithChecksumRequiredResponse::builder); + + HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, + operationMetadata); + List metricPublishers = resolveMetricPublishers(clientConfiguration, + operationWithChecksumRequiredRequest.overrideConfiguration().orElse(null)); + MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector + .create("ApiCall"); + try { + apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); + apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "OperationWithChecksumRequired"); + + return clientHandler + .execute(new ClientExecutionParams() + .withOperationName("OperationWithChecksumRequired") + .withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler) + .withInput(operationWithChecksumRequiredRequest) + .withMetricCollector(apiCallMetricCollector) + .putExecutionAttribute(SdkInternalExecutionAttribute.HTTP_CHECKSUM_REQUIRED, + HttpChecksumRequired.create()) + .withMarshaller(new OperationWithChecksumRequiredRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } @@ -263,30 +319,30 @@ public GetWithoutRequiredMembersResponse getWithoutRequiredMembers( */ @Override public PaginatedOperationWithResultKeyResponse paginatedOperationWithResultKey( - PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) throws AwsServiceException, - SdkClientException, JsonException { + PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) throws AwsServiceException, + SdkClientException, JsonException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) - .isPayloadJson(true).build(); + .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( - operationMetadata, PaginatedOperationWithResultKeyResponse::builder); + operationMetadata, PaginatedOperationWithResultKeyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, - operationMetadata); + operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, - paginatedOperationWithResultKeyRequest.overrideConfiguration().orElse(null)); + paginatedOperationWithResultKeyRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector - .create("ApiCall"); + .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PaginatedOperationWithResultKey"); return clientHandler - .execute(new ClientExecutionParams() - .withOperationName("PaginatedOperationWithResultKey").withResponseHandler(responseHandler) - .withErrorResponseHandler(errorResponseHandler).withInput(paginatedOperationWithResultKeyRequest) - .withMetricCollector(apiCallMetricCollector) - .withMarshaller(new PaginatedOperationWithResultKeyRequestMarshaller(protocolFactory))); + .execute(new ClientExecutionParams() + .withOperationName("PaginatedOperationWithResultKey").withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler).withInput(paginatedOperationWithResultKeyRequest) + .withMetricCollector(apiCallMetricCollector) + .withMarshaller(new PaginatedOperationWithResultKeyRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } @@ -365,8 +421,8 @@ public PaginatedOperationWithResultKeyResponse paginatedOperationWithResultKey( */ @Override public PaginatedOperationWithResultKeyIterable paginatedOperationWithResultKeyPaginator( - PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) throws AwsServiceException, - SdkClientException, JsonException { + PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) throws AwsServiceException, + SdkClientException, JsonException { return new PaginatedOperationWithResultKeyIterable(this, applyPaginatorUserAgent(paginatedOperationWithResultKeyRequest)); } @@ -388,30 +444,30 @@ public PaginatedOperationWithResultKeyIterable paginatedOperationWithResultKeyPa */ @Override public PaginatedOperationWithoutResultKeyResponse paginatedOperationWithoutResultKey( - PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) throws AwsServiceException, - SdkClientException, JsonException { + PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) throws AwsServiceException, + SdkClientException, JsonException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) - .isPayloadJson(true).build(); + .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( - operationMetadata, PaginatedOperationWithoutResultKeyResponse::builder); + operationMetadata, PaginatedOperationWithoutResultKeyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, - operationMetadata); + operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, - paginatedOperationWithoutResultKeyRequest.overrideConfiguration().orElse(null)); + paginatedOperationWithoutResultKeyRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector - .create("ApiCall"); + .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PaginatedOperationWithoutResultKey"); return clientHandler - .execute(new ClientExecutionParams() - .withOperationName("PaginatedOperationWithoutResultKey").withResponseHandler(responseHandler) - .withErrorResponseHandler(errorResponseHandler).withInput(paginatedOperationWithoutResultKeyRequest) - .withMetricCollector(apiCallMetricCollector) - .withMarshaller(new PaginatedOperationWithoutResultKeyRequestMarshaller(protocolFactory))); + .execute(new ClientExecutionParams() + .withOperationName("PaginatedOperationWithoutResultKey").withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler).withInput(paginatedOperationWithoutResultKeyRequest) + .withMetricCollector(apiCallMetricCollector) + .withMarshaller(new PaginatedOperationWithoutResultKeyRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } @@ -490,10 +546,10 @@ public PaginatedOperationWithoutResultKeyResponse paginatedOperationWithoutResul */ @Override public PaginatedOperationWithoutResultKeyIterable paginatedOperationWithoutResultKeyPaginator( - PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) throws AwsServiceException, - SdkClientException, JsonException { + PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) throws AwsServiceException, + SdkClientException, JsonException { return new PaginatedOperationWithoutResultKeyIterable(this, - applyPaginatorUserAgent(paginatedOperationWithoutResultKeyRequest)); + applyPaginatorUserAgent(paginatedOperationWithoutResultKeyRequest)); } /** @@ -525,35 +581,35 @@ public PaginatedOperationWithoutResultKeyIterable paginatedOperationWithoutResul */ @Override public StreamingInputOperationResponse streamingInputOperation(StreamingInputOperationRequest streamingInputOperationRequest, - RequestBody requestBody) throws AwsServiceException, SdkClientException, JsonException { + RequestBody requestBody) throws AwsServiceException, SdkClientException, JsonException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) - .isPayloadJson(true).build(); + .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( - operationMetadata, StreamingInputOperationResponse::builder); + operationMetadata, StreamingInputOperationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, - operationMetadata); + operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, streamingInputOperationRequest - .overrideConfiguration().orElse(null)); + .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector - .create("ApiCall"); + .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StreamingInputOperation"); return clientHandler - .execute(new ClientExecutionParams() - .withOperationName("StreamingInputOperation") - .withResponseHandler(responseHandler) - .withErrorResponseHandler(errorResponseHandler) - .withInput(streamingInputOperationRequest) - .withMetricCollector(apiCallMetricCollector) - .withRequestBody(requestBody) - .withMarshaller( - StreamingRequestMarshaller.builder() - .delegateMarshaller(new StreamingInputOperationRequestMarshaller(protocolFactory)) - .requestBody(requestBody).build())); + .execute(new ClientExecutionParams() + .withOperationName("StreamingInputOperation") + .withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler) + .withInput(streamingInputOperationRequest) + .withMetricCollector(apiCallMetricCollector) + .withRequestBody(requestBody) + .withMarshaller( + StreamingRequestMarshaller.builder() + .delegateMarshaller(new StreamingInputOperationRequestMarshaller(protocolFactory)) + .requestBody(requestBody).build())); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } @@ -595,41 +651,41 @@ public StreamingInputOperationResponse streamingInputOperation(StreamingInputOpe */ @Override public ReturnT streamingInputOutputOperation( - StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, RequestBody requestBody, - ResponseTransformer responseTransformer) throws AwsServiceException, - SdkClientException, JsonException { + StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, RequestBody requestBody, + ResponseTransformer responseTransformer) throws AwsServiceException, + SdkClientException, JsonException { streamingInputOutputOperationRequest = applySignerOverride(streamingInputOutputOperationRequest, - Aws4UnsignedPayloadSigner.create()); + Aws4UnsignedPayloadSigner.create()); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(true) - .isPayloadJson(false).build(); + .isPayloadJson(false).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( - operationMetadata, StreamingInputOutputOperationResponse::builder); + operationMetadata, StreamingInputOutputOperationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, - operationMetadata); + operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, - streamingInputOutputOperationRequest.overrideConfiguration().orElse(null)); + streamingInputOutputOperationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector - .create("ApiCall"); + .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StreamingInputOutputOperation"); return clientHandler.execute( - new ClientExecutionParams() - .withOperationName("StreamingInputOutputOperation") - .withResponseHandler(responseHandler) - .withErrorResponseHandler(errorResponseHandler) - .withInput(streamingInputOutputOperationRequest) - .withMetricCollector(apiCallMetricCollector) - .withRequestBody(requestBody) - .withMarshaller( - StreamingRequestMarshaller - .builder() - .delegateMarshaller( - new StreamingInputOutputOperationRequestMarshaller(protocolFactory)) - .requestBody(requestBody).transferEncoding(true).build()), responseTransformer); + new ClientExecutionParams() + .withOperationName("StreamingInputOutputOperation") + .withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler) + .withInput(streamingInputOutputOperationRequest) + .withMetricCollector(apiCallMetricCollector) + .withRequestBody(requestBody) + .withMarshaller( + StreamingRequestMarshaller + .builder() + .delegateMarshaller( + new StreamingInputOutputOperationRequestMarshaller(protocolFactory)) + .requestBody(requestBody).transferEncoding(true).build()), responseTransformer); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } @@ -660,37 +716,37 @@ public ReturnT streamingInputOutputOperation( */ @Override public ReturnT streamingOutputOperation(StreamingOutputOperationRequest streamingOutputOperationRequest, - ResponseTransformer responseTransformer) throws AwsServiceException, - SdkClientException, JsonException { + ResponseTransformer responseTransformer) throws AwsServiceException, + SdkClientException, JsonException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(true) - .isPayloadJson(false).build(); + .isPayloadJson(false).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( - operationMetadata, StreamingOutputOperationResponse::builder); + operationMetadata, StreamingOutputOperationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, - operationMetadata); + operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, streamingOutputOperationRequest - .overrideConfiguration().orElse(null)); + .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector - .create("ApiCall"); + .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StreamingOutputOperation"); return clientHandler.execute( - new ClientExecutionParams() - .withOperationName("StreamingOutputOperation").withResponseHandler(responseHandler) - .withErrorResponseHandler(errorResponseHandler).withInput(streamingOutputOperationRequest) - .withMetricCollector(apiCallMetricCollector) - .withMarshaller(new StreamingOutputOperationRequestMarshaller(protocolFactory)), responseTransformer); + new ClientExecutionParams() + .withOperationName("StreamingOutputOperation").withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler).withInput(streamingOutputOperationRequest) + .withMetricCollector(apiCallMetricCollector) + .withMarshaller(new StreamingOutputOperationRequestMarshaller(protocolFactory)), responseTransformer); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration, - RequestOverrideConfiguration requestOverrideConfiguration) { + RequestOverrideConfiguration requestOverrideConfiguration) { List publishers = null; if (requestOverrideConfiguration != null) { publishers = requestOverrideConfiguration.metricPublishers(); @@ -705,19 +761,19 @@ private static List resolveMetricPublishers(SdkClientConfigurat } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, - JsonOperationMetadata operationMetadata) { + JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } private > T init(T builder) { return builder - .clientConfiguration(clientConfiguration) - .defaultServiceExceptionSupplier(JsonException::builder) - .protocol(AwsJsonProtocol.REST_JSON) - .protocolVersion("1.1") - .registerModeledException( - ExceptionMetadata.builder().errorCode("InvalidInput") - .exceptionBuilderSupplier(InvalidInputException::builder).httpStatusCode(400).build()); + .clientConfiguration(clientConfiguration) + .defaultServiceExceptionSupplier(JsonException::builder) + .protocol(AwsJsonProtocol.REST_JSON) + .protocolVersion("1.1") + .registerModeledException( + ExceptionMetadata.builder().errorCode("InvalidInput") + .exceptionBuilderSupplier(InvalidInputException::builder).httpStatusCode(400).build()); } @Override @@ -727,10 +783,10 @@ public void close() { private T applyPaginatorUserAgent(T request) { Consumer userAgentApplier = b -> b.addApiName(ApiName.builder() - .version(VersionInfo.SDK_VERSION).name("PAGINATED").build()); + .version(VersionInfo.SDK_VERSION).name("PAGINATED").build()); AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration() - .map(c -> c.toBuilder().applyMutation(userAgentApplier).build()) - .orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build())); + .map(c -> c.toBuilder().applyMutation(userAgentApplier).build()) + .orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build())); return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build(); } @@ -740,8 +796,8 @@ private T applySignerOverride(T request, Signer signer) } Consumer signerOverride = b -> b.signer(signer).build(); AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration() - .map(c -> c.toBuilder().applyMutation(signerOverride).build()) - .orElse((AwsRequestOverrideConfiguration.builder().applyMutation(signerOverride).build())); + .map(c -> c.toBuilder().applyMutation(signerOverride).build()) + .orElse((AwsRequestOverrideConfiguration.builder().applyMutation(signerOverride).build())); return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build(); } diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-interface.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-interface.java index 2685e7061b1f..77c4aa00dc3d 100644 --- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-interface.java +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-interface.java @@ -19,6 +19,8 @@ import software.amazon.awssdk.services.json.model.GetWithoutRequiredMembersResponse; import software.amazon.awssdk.services.json.model.InvalidInputException; import software.amazon.awssdk.services.json.model.JsonException; +import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredRequest; +import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredResponse; import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyRequest; import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyResponse; import software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyRequest; @@ -109,7 +111,7 @@ default APostOperationResponse aPostOperation(APostOperationRequest aPostOperati * API Documentation */ default APostOperationResponse aPostOperation(Consumer aPostOperationRequest) - throws InvalidInputException, AwsServiceException, SdkClientException, JsonException { + throws InvalidInputException, AwsServiceException, SdkClientException, JsonException { return aPostOperation(APostOperationRequest.builder().applyMutation(aPostOperationRequest).build()); } @@ -134,8 +136,8 @@ default APostOperationResponse aPostOperation(ConsumerAWS API Documentation */ default APostOperationWithOutputResponse aPostOperationWithOutput( - APostOperationWithOutputRequest aPostOperationWithOutputRequest) throws InvalidInputException, AwsServiceException, - SdkClientException, JsonException { + APostOperationWithOutputRequest aPostOperationWithOutputRequest) throws InvalidInputException, AwsServiceException, + SdkClientException, JsonException { throw new UnsupportedOperationException(); } @@ -167,8 +169,8 @@ default APostOperationWithOutputResponse aPostOperationWithOutput( * target="_top">AWS API Documentation */ default APostOperationWithOutputResponse aPostOperationWithOutput( - Consumer aPostOperationWithOutputRequest) throws InvalidInputException, - AwsServiceException, SdkClientException, JsonException { + Consumer aPostOperationWithOutputRequest) throws InvalidInputException, + AwsServiceException, SdkClientException, JsonException { return aPostOperationWithOutput(APostOperationWithOutputRequest.builder().applyMutation(aPostOperationWithOutputRequest) .build()); } @@ -194,8 +196,8 @@ default APostOperationWithOutputResponse aPostOperationWithOutput( * target="_top">AWS API Documentation */ default GetWithoutRequiredMembersResponse getWithoutRequiredMembers( - GetWithoutRequiredMembersRequest getWithoutRequiredMembersRequest) throws InvalidInputException, AwsServiceException, - SdkClientException, JsonException { + GetWithoutRequiredMembersRequest getWithoutRequiredMembersRequest) throws InvalidInputException, AwsServiceException, + SdkClientException, JsonException { throw new UnsupportedOperationException(); } @@ -227,12 +229,63 @@ default GetWithoutRequiredMembersResponse getWithoutRequiredMembers( * target="_top">AWS API Documentation */ default GetWithoutRequiredMembersResponse getWithoutRequiredMembers( - Consumer getWithoutRequiredMembersRequest) throws InvalidInputException, - AwsServiceException, SdkClientException, JsonException { + Consumer getWithoutRequiredMembersRequest) throws InvalidInputException, + AwsServiceException, SdkClientException, JsonException { return getWithoutRequiredMembers(GetWithoutRequiredMembersRequest.builder() .applyMutation(getWithoutRequiredMembersRequest).build()); } + /** + * Invokes the OperationWithChecksumRequired operation. + * + * @param operationWithChecksumRequiredRequest + * @return Result of the OperationWithChecksumRequired operation returned by the service. + * @throws SdkException + * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for + * catch all scenarios. + * @throws SdkClientException + * If any client side error occurs such as an IO related failure, failure to get credentials, etc. + * @throws JsonException + * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. + * @sample JsonClient.OperationWithChecksumRequired + * @see AWS API Documentation + */ + default OperationWithChecksumRequiredResponse operationWithChecksumRequired( + OperationWithChecksumRequiredRequest operationWithChecksumRequiredRequest) throws AwsServiceException, + SdkClientException, JsonException { + throw new UnsupportedOperationException(); + } + + /** + * Invokes the OperationWithChecksumRequired operation. + * + * This is a convenience which creates an instance of the {@link OperationWithChecksumRequiredRequest.Builder} + * avoiding the need to create one manually via {@link OperationWithChecksumRequiredRequest#builder()} + * + * + * @param operationWithChecksumRequiredRequest + * A {@link Consumer} that will call methods on {@link OperationWithChecksumRequiredRequest.Builder} to + * create a request. + * @return Result of the OperationWithChecksumRequired operation returned by the service. + * @throws SdkException + * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for + * catch all scenarios. + * @throws SdkClientException + * If any client side error occurs such as an IO related failure, failure to get credentials, etc. + * @throws JsonException + * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. + * @sample JsonClient.OperationWithChecksumRequired + * @see AWS API Documentation + */ + default OperationWithChecksumRequiredResponse operationWithChecksumRequired( + Consumer operationWithChecksumRequiredRequest) + throws AwsServiceException, SdkClientException, JsonException { + return operationWithChecksumRequired(OperationWithChecksumRequiredRequest.builder() + .applyMutation(operationWithChecksumRequiredRequest).build()); + } + /** * Some paginated operation with result_key in paginators.json file * @@ -271,8 +324,8 @@ default PaginatedOperationWithResultKeyResponse paginatedOperationWithResultKey( * target="_top">AWS API Documentation */ default PaginatedOperationWithResultKeyResponse paginatedOperationWithResultKey( - PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) throws AwsServiceException, - SdkClientException, JsonException { + PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) throws AwsServiceException, + SdkClientException, JsonException { throw new UnsupportedOperationException(); } @@ -299,8 +352,8 @@ default PaginatedOperationWithResultKeyResponse paginatedOperationWithResultKey( * target="_top">AWS API Documentation */ default PaginatedOperationWithResultKeyResponse paginatedOperationWithResultKey( - Consumer paginatedOperationWithResultKeyRequest) - throws AwsServiceException, SdkClientException, JsonException { + Consumer paginatedOperationWithResultKeyRequest) + throws AwsServiceException, SdkClientException, JsonException { return paginatedOperationWithResultKey(PaginatedOperationWithResultKeyRequest.builder() .applyMutation(paginatedOperationWithResultKeyRequest).build()); } @@ -453,8 +506,8 @@ default PaginatedOperationWithResultKeyIterable paginatedOperationWithResultKeyP * target="_top">AWS API Documentation */ default PaginatedOperationWithResultKeyIterable paginatedOperationWithResultKeyPaginator( - PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) throws AwsServiceException, - SdkClientException, JsonException { + PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) throws AwsServiceException, + SdkClientException, JsonException { throw new UnsupportedOperationException(); } @@ -536,8 +589,8 @@ default PaginatedOperationWithResultKeyIterable paginatedOperationWithResultKeyP * target="_top">AWS API Documentation */ default PaginatedOperationWithResultKeyIterable paginatedOperationWithResultKeyPaginator( - Consumer paginatedOperationWithResultKeyRequest) - throws AwsServiceException, SdkClientException, JsonException { + Consumer paginatedOperationWithResultKeyRequest) + throws AwsServiceException, SdkClientException, JsonException { return paginatedOperationWithResultKeyPaginator(PaginatedOperationWithResultKeyRequest.builder() .applyMutation(paginatedOperationWithResultKeyRequest).build()); } @@ -559,8 +612,8 @@ default PaginatedOperationWithResultKeyIterable paginatedOperationWithResultKeyP * target="_top">AWS API Documentation */ default PaginatedOperationWithoutResultKeyResponse paginatedOperationWithoutResultKey( - PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) throws AwsServiceException, - SdkClientException, JsonException { + PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) throws AwsServiceException, + SdkClientException, JsonException { throw new UnsupportedOperationException(); } @@ -587,8 +640,8 @@ default PaginatedOperationWithoutResultKeyResponse paginatedOperationWithoutResu * target="_top">AWS API Documentation */ default PaginatedOperationWithoutResultKeyResponse paginatedOperationWithoutResultKey( - Consumer paginatedOperationWithoutResultKeyRequest) - throws AwsServiceException, SdkClientException, JsonException { + Consumer paginatedOperationWithoutResultKeyRequest) + throws AwsServiceException, SdkClientException, JsonException { return paginatedOperationWithoutResultKey(PaginatedOperationWithoutResultKeyRequest.builder() .applyMutation(paginatedOperationWithoutResultKeyRequest).build()); } @@ -665,8 +718,8 @@ default PaginatedOperationWithoutResultKeyResponse paginatedOperationWithoutResu * target="_top">AWS API Documentation */ default PaginatedOperationWithoutResultKeyIterable paginatedOperationWithoutResultKeyPaginator( - PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) throws AwsServiceException, - SdkClientException, JsonException { + PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) throws AwsServiceException, + SdkClientException, JsonException { throw new UnsupportedOperationException(); } @@ -748,8 +801,8 @@ default PaginatedOperationWithoutResultKeyIterable paginatedOperationWithoutResu * target="_top">AWS API Documentation */ default PaginatedOperationWithoutResultKeyIterable paginatedOperationWithoutResultKeyPaginator( - Consumer paginatedOperationWithoutResultKeyRequest) - throws AwsServiceException, SdkClientException, JsonException { + Consumer paginatedOperationWithoutResultKeyRequest) + throws AwsServiceException, SdkClientException, JsonException { return paginatedOperationWithoutResultKeyPaginator(PaginatedOperationWithoutResultKeyRequest.builder() .applyMutation(paginatedOperationWithoutResultKeyRequest).build()); } @@ -782,8 +835,8 @@ default PaginatedOperationWithoutResultKeyIterable paginatedOperationWithoutResu * target="_top">AWS API Documentation */ default StreamingInputOperationResponse streamingInputOperation( - StreamingInputOperationRequest streamingInputOperationRequest, RequestBody requestBody) throws AwsServiceException, - SdkClientException, JsonException { + StreamingInputOperationRequest streamingInputOperationRequest, RequestBody requestBody) throws AwsServiceException, + SdkClientException, JsonException { throw new UnsupportedOperationException(); } @@ -821,8 +874,8 @@ default StreamingInputOperationResponse streamingInputOperation( * target="_top">AWS API Documentation */ default StreamingInputOperationResponse streamingInputOperation( - Consumer streamingInputOperationRequest, RequestBody requestBody) - throws AwsServiceException, SdkClientException, JsonException { + Consumer streamingInputOperationRequest, RequestBody requestBody) + throws AwsServiceException, SdkClientException, JsonException { return streamingInputOperation(StreamingInputOperationRequest.builder().applyMutation(streamingInputOperationRequest) .build(), requestBody); } @@ -850,8 +903,8 @@ default StreamingInputOperationResponse streamingInputOperation( * target="_top">AWS API Documentation */ default StreamingInputOperationResponse streamingInputOperation( - StreamingInputOperationRequest streamingInputOperationRequest, Path sourcePath) throws AwsServiceException, - SdkClientException, JsonException { + StreamingInputOperationRequest streamingInputOperationRequest, Path sourcePath) throws AwsServiceException, + SdkClientException, JsonException { return streamingInputOperation(streamingInputOperationRequest, RequestBody.fromFile(sourcePath)); } @@ -884,8 +937,8 @@ default StreamingInputOperationResponse streamingInputOperation( * target="_top">AWS API Documentation */ default StreamingInputOperationResponse streamingInputOperation( - Consumer streamingInputOperationRequest, Path sourcePath) - throws AwsServiceException, SdkClientException, JsonException { + Consumer streamingInputOperationRequest, Path sourcePath) + throws AwsServiceException, SdkClientException, JsonException { return streamingInputOperation(StreamingInputOperationRequest.builder().applyMutation(streamingInputOperationRequest) .build(), sourcePath); } @@ -907,11 +960,11 @@ default StreamingInputOperationResponse streamingInputOperation( * The service documentation for the request content is as follows 'This be a stream' * @param responseTransformer * Functional interface for processing the streamed response content. The unmarshalled - * StreamingInputOutputOperationResponse and an InputStream to the response content are provided as parameters - * to the callback. The callback may return a transformed type which will be the return value of this method. - * See {@link software.amazon.awssdk.core.sync.ResponseTransformer} for details on implementing this - * interface and for links to pre-canned implementations for common scenarios like downloading to a file. The - * service documentation for the response content is as follows 'This be a stream'. + * StreamingInputOutputOperationResponse and an InputStream to the response content are provided as + * parameters to the callback. The callback may return a transformed type which will be the return value of + * this method. See {@link software.amazon.awssdk.core.sync.ResponseTransformer} for details on implementing + * this interface and for links to pre-canned implementations for common scenarios like downloading to a + * file. The service documentation for the response content is as follows 'This be a stream'. * @return The transformed result of the ResponseTransformer. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for @@ -925,9 +978,9 @@ default StreamingInputOperationResponse streamingInputOperation( * target="_top">AWS API Documentation */ default ReturnT streamingInputOutputOperation( - StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, RequestBody requestBody, - ResponseTransformer responseTransformer) throws AwsServiceException, - SdkClientException, JsonException { + StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, RequestBody requestBody, + ResponseTransformer responseTransformer) throws AwsServiceException, + SdkClientException, JsonException { throw new UnsupportedOperationException(); } @@ -954,11 +1007,11 @@ default ReturnT streamingInputOutputOperation( * The service documentation for the request content is as follows 'This be a stream' * @param responseTransformer * Functional interface for processing the streamed response content. The unmarshalled - * StreamingInputOutputOperationResponse and an InputStream to the response content are provided as parameters - * to the callback. The callback may return a transformed type which will be the return value of this method. - * See {@link software.amazon.awssdk.core.sync.ResponseTransformer} for details on implementing this - * interface and for links to pre-canned implementations for common scenarios like downloading to a file. The - * service documentation for the response content is as follows 'This be a stream'. + * StreamingInputOutputOperationResponse and an InputStream to the response content are provided as + * parameters to the callback. The callback may return a transformed type which will be the return value of + * this method. See {@link software.amazon.awssdk.core.sync.ResponseTransformer} for details on implementing + * this interface and for links to pre-canned implementations for common scenarios like downloading to a + * file. The service documentation for the response content is as follows 'This be a stream'. * @return The transformed result of the ResponseTransformer. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for @@ -972,12 +1025,12 @@ default ReturnT streamingInputOutputOperation( * target="_top">AWS API Documentation */ default ReturnT streamingInputOutputOperation( - Consumer streamingInputOutputOperationRequest, RequestBody requestBody, - ResponseTransformer responseTransformer) throws AwsServiceException, - SdkClientException, JsonException { + Consumer streamingInputOutputOperationRequest, RequestBody requestBody, + ResponseTransformer responseTransformer) throws AwsServiceException, + SdkClientException, JsonException { return streamingInputOutputOperation( - StreamingInputOutputOperationRequest.builder().applyMutation(streamingInputOutputOperationRequest).build(), - requestBody, responseTransformer); + StreamingInputOutputOperationRequest.builder().applyMutation(streamingInputOutputOperationRequest).build(), + requestBody, responseTransformer); } /** @@ -1008,8 +1061,8 @@ default ReturnT streamingInputOutputOperation( * target="_top">AWS API Documentation */ default StreamingInputOutputOperationResponse streamingInputOutputOperation( - StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, Path sourcePath, Path destinationPath) - throws AwsServiceException, SdkClientException, JsonException { + StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, Path sourcePath, Path destinationPath) + throws AwsServiceException, SdkClientException, JsonException { return streamingInputOutputOperation(streamingInputOutputOperationRequest, RequestBody.fromFile(sourcePath), ResponseTransformer.toFile(destinationPath)); } @@ -1048,11 +1101,11 @@ default StreamingInputOutputOperationResponse streamingInputOutputOperation( * target="_top">AWS API Documentation */ default StreamingInputOutputOperationResponse streamingInputOutputOperation( - Consumer streamingInputOutputOperationRequest, Path sourcePath, - Path destinationPath) throws AwsServiceException, SdkClientException, JsonException { + Consumer streamingInputOutputOperationRequest, Path sourcePath, + Path destinationPath) throws AwsServiceException, SdkClientException, JsonException { return streamingInputOutputOperation( - StreamingInputOutputOperationRequest.builder().applyMutation(streamingInputOutputOperationRequest).build(), - sourcePath, destinationPath); + StreamingInputOutputOperationRequest.builder().applyMutation(streamingInputOutputOperationRequest).build(), + sourcePath, destinationPath); } /** @@ -1061,8 +1114,8 @@ default StreamingInputOutputOperationResponse streamingInputOutputOperation( * @param streamingOutputOperationRequest * @param responseTransformer * Functional interface for processing the streamed response content. The unmarshalled - * StreamingOutputOperationResponse and an InputStream to the response content are provided as parameters - * to the callback. The callback may return a transformed type which will be the return value of this method. + * StreamingOutputOperationResponse and an InputStream to the response content are provided as parameters to + * the callback. The callback may return a transformed type which will be the return value of this method. * See {@link software.amazon.awssdk.core.sync.ResponseTransformer} for details on implementing this * interface and for links to pre-canned implementations for common scenarios like downloading to a file. The * service documentation for the response content is as follows 'This be a stream'. @@ -1096,8 +1149,8 @@ default ReturnT streamingOutputOperation(StreamingOutputOperationReque * request. * @param responseTransformer * Functional interface for processing the streamed response content. The unmarshalled - * StreamingOutputOperationResponse and an InputStream to the response content are provided as parameters - * to the callback. The callback may return a transformed type which will be the return value of this method. + * StreamingOutputOperationResponse and an InputStream to the response content are provided as parameters to + * the callback. The callback may return a transformed type which will be the return value of this method. * See {@link software.amazon.awssdk.core.sync.ResponseTransformer} for details on implementing this * interface and for links to pre-canned implementations for common scenarios like downloading to a file. The * service documentation for the response content is as follows 'This be a stream'. @@ -1114,9 +1167,9 @@ default ReturnT streamingOutputOperation(StreamingOutputOperationReque * target="_top">AWS API Documentation */ default ReturnT streamingOutputOperation( - Consumer streamingOutputOperationRequest, - ResponseTransformer responseTransformer) throws AwsServiceException, - SdkClientException, JsonException { + Consumer streamingOutputOperationRequest, + ResponseTransformer responseTransformer) throws AwsServiceException, + SdkClientException, JsonException { return streamingOutputOperation(StreamingOutputOperationRequest.builder().applyMutation(streamingOutputOperationRequest) .build(), responseTransformer); } @@ -1143,8 +1196,8 @@ default ReturnT streamingOutputOperation( * target="_top">AWS API Documentation */ default StreamingOutputOperationResponse streamingOutputOperation( - StreamingOutputOperationRequest streamingOutputOperationRequest, Path destinationPath) throws AwsServiceException, - SdkClientException, JsonException { + StreamingOutputOperationRequest streamingOutputOperationRequest, Path destinationPath) throws AwsServiceException, + SdkClientException, JsonException { return streamingOutputOperation(streamingOutputOperationRequest, ResponseTransformer.toFile(destinationPath)); } @@ -1176,8 +1229,8 @@ default StreamingOutputOperationResponse streamingOutputOperation( * target="_top">AWS API Documentation */ default StreamingOutputOperationResponse streamingOutputOperation( - Consumer streamingOutputOperationRequest, Path destinationPath) - throws AwsServiceException, SdkClientException, JsonException { + Consumer streamingOutputOperationRequest, Path destinationPath) + throws AwsServiceException, SdkClientException, JsonException { return streamingOutputOperation(StreamingOutputOperationRequest.builder().applyMutation(streamingOutputOperationRequest) .build(), destinationPath); } @@ -1205,8 +1258,8 @@ default StreamingOutputOperationResponse streamingOutputOperation( * target="_top">AWS API Documentation */ default ResponseInputStream streamingOutputOperation( - StreamingOutputOperationRequest streamingOutputOperationRequest) throws AwsServiceException, SdkClientException, - JsonException { + StreamingOutputOperationRequest streamingOutputOperationRequest) throws AwsServiceException, SdkClientException, + JsonException { return streamingOutputOperation(streamingOutputOperationRequest, ResponseTransformer.toInputStream()); } @@ -1239,8 +1292,8 @@ default ResponseInputStream
Performs a post operation to the xml service and has no output
Performs a post operation to the xml service and has modelled output
a member that has nested members
An optional member
A structure containing nested members
Contains the response to a successful APostOperationWithOutput request.
The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
A sub-member
The date and time, in ISO 8601 date-time format, when the member was created.
A shape with nested sub-members" + }, + "subMember": { + "type": "string", + "max": 63, + "min": 3, + "pattern": "^[a-z0-9](([a-z0-9]|-(?!-))*[a-z0-9])?$" + }, + "dateType": { + "type": "timestamp" + }, + "invalidInputMessage": { + "type": "string" + }, + "StreamType": { + "type": "blob", + "streaming": true + }, + "StructureWithStreamingMember": { + "type": "structure", + "members": { + "StreamingMember": { + "shape": "StreamType", + "documentation": "This be a stream" + } + }, + "payload": "StreamingMember" + } + }, + "documentation": "A service that is implemented using the xml protocol" +} diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-async-client-class.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-async-client-class.java index f8b0a8eac9c0..721b3fa897e4 100644 --- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-async-client-class.java +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-async-client-class.java @@ -38,6 +38,8 @@ import software.amazon.awssdk.core.client.handler.AttachHttpMetadataResponseHandler; import software.amazon.awssdk.core.client.handler.ClientExecutionParams; import software.amazon.awssdk.core.http.HttpResponseHandler; +import software.amazon.awssdk.core.interceptor.SdkInternalExecutionAttribute; +import software.amazon.awssdk.core.interceptor.trait.HttpChecksumRequired; import software.amazon.awssdk.core.metrics.CoreMetric; import software.amazon.awssdk.core.protocol.VoidSdkResponse; import software.amazon.awssdk.core.runtime.transform.AsyncStreamingRequestMarshaller; @@ -75,6 +77,8 @@ import software.amazon.awssdk.services.json.model.InvalidInputException; import software.amazon.awssdk.services.json.model.JsonException; import software.amazon.awssdk.services.json.model.JsonRequest; +import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredRequest; +import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredResponse; import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyRequest; import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyResponse; import software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyRequest; @@ -95,6 +99,7 @@ import software.amazon.awssdk.services.json.transform.GetWithoutRequiredMembersRequestMarshaller; import software.amazon.awssdk.services.json.transform.InputEventMarshaller; import software.amazon.awssdk.services.json.transform.InputEventTwoMarshaller; +import software.amazon.awssdk.services.json.transform.OperationWithChecksumRequiredRequestMarshaller; import software.amazon.awssdk.services.json.transform.PaginatedOperationWithResultKeyRequestMarshaller; import software.amazon.awssdk.services.json.transform.PaginatedOperationWithoutResultKeyRequestMarshaller; import software.amazon.awssdk.services.json.transform.StreamingInputOperationRequestMarshaller; @@ -300,9 +305,8 @@ public CompletableFuture eventStreamOperation(EventStreamOperationRequest HttpResponseHandler extends EventStream> eventResponseHandler = protocolFactory.createResponseHandler( JsonOperationMetadata.builder().isPayloadJson(true).hasStreamingSuccessResponse(false).build(), EventStreamTaggedUnionPojoSupplier.builder().putSdkPojoSupplier("EventOne", EventOne::builder) - .putSdkPojoSupplier("event-two", EventTwo::builder) + .putSdkPojoSupplier("EventTheSecond", EventTwo::builder) .putSdkPojoSupplier("secondEventOne", EventOne::builder) - .putSdkPojoSupplier("second-event-two", EventTwo::builder) .defaultSdkPojoSupplier(() -> new SdkPojoBuilder(EventStream.UNKNOWN)).build()); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, @@ -327,10 +331,10 @@ public CompletableFuture eventStreamOperation(EventStreamOperationRequest new ClientExecutionParams() .withOperationName("EventStreamOperation") .withMarshaller(new EventStreamOperationRequestMarshaller(protocolFactory)) - .withAsyncRequestBody(software.amazon.awssdk.core.async.AsyncRequestBody.fromPublisher(adapted)) - .withFullDuplex(true).withResponseHandler(responseHandler) - .withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector) - .withInput(eventStreamOperationRequest), restAsyncResponseTransformer); + .withAsyncRequestBody(AsyncRequestBody.fromPublisher(adapted)).withFullDuplex(true) + .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) + .withMetricCollector(apiCallMetricCollector).withInput(eventStreamOperationRequest), + restAsyncResponseTransformer); AwsRequestOverrideConfiguration requestOverrideConfig = eventStreamOperationRequest.overrideConfiguration().orElse( null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { @@ -405,9 +409,9 @@ public CompletableFuture eventStreamO .execute(new ClientExecutionParams() .withOperationName("EventStreamOperationWithOnlyInput") .withMarshaller(new EventStreamOperationWithOnlyInputRequestMarshaller(protocolFactory)) - .withAsyncRequestBody(software.amazon.awssdk.core.async.AsyncRequestBody.fromPublisher(adapted)) - .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) - .withMetricCollector(apiCallMetricCollector).withInput(eventStreamOperationWithOnlyInputRequest)); + .withAsyncRequestBody(AsyncRequestBody.fromPublisher(adapted)).withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector) + .withInput(eventStreamOperationWithOnlyInputRequest)); AwsRequestOverrideConfiguration requestOverrideConfig = eventStreamOperationWithOnlyInputRequest .overrideConfiguration().orElse(null); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { @@ -464,9 +468,8 @@ public CompletableFuture eventStreamOperationWithOnlyOutput( HttpResponseHandler extends EventStream> eventResponseHandler = protocolFactory.createResponseHandler( JsonOperationMetadata.builder().isPayloadJson(true).hasStreamingSuccessResponse(false).build(), EventStreamTaggedUnionPojoSupplier.builder().putSdkPojoSupplier("EventOne", EventOne::builder) - .putSdkPojoSupplier("event-two", EventTwo::builder) + .putSdkPojoSupplier("EventTheSecond", EventTwo::builder) .putSdkPojoSupplier("secondEventOne", EventOne::builder) - .putSdkPojoSupplier("second-event-two", EventTwo::builder) .defaultSdkPojoSupplier(() -> new SdkPojoBuilder(EventStream.UNKNOWN)).build()); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, @@ -573,6 +576,67 @@ public CompletableFuture getWithoutRequiredMe } } + /** + * Invokes the OperationWithChecksumRequired operation asynchronously. + * + * @param operationWithChecksumRequiredRequest + * @return A Java Future containing the result of the OperationWithChecksumRequired operation returned by the + * service. + * The CompletableFuture returned by this method can be completed exceptionally with the following + * exceptions. + * + * SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). + * Can be used for catch all scenarios. + * SdkClientException If any client side error occurs such as an IO related failure, failure to get + * credentials, etc. + * JsonException Base class for all service exceptions. Unknown exceptions will be thrown as an instance + * of this type. + * + * @sample JsonAsyncClient.OperationWithChecksumRequired + * @see AWS API Documentation + */ + @Override + public CompletableFuture operationWithChecksumRequired( + OperationWithChecksumRequiredRequest operationWithChecksumRequiredRequest) { + List metricPublishers = resolveMetricPublishers(clientConfiguration, + operationWithChecksumRequiredRequest.overrideConfiguration().orElse(null)); + MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector + .create("ApiCall"); + try { + apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); + apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "OperationWithChecksumRequired"); + JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) + .isPayloadJson(true).build(); + + HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( + operationMetadata, OperationWithChecksumRequiredResponse::builder); + + HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, + operationMetadata); + + CompletableFuture executeFuture = clientHandler + .execute(new ClientExecutionParams() + .withOperationName("OperationWithChecksumRequired") + .withMarshaller(new OperationWithChecksumRequiredRequestMarshaller(protocolFactory)) + .withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler) + .withMetricCollector(apiCallMetricCollector) + .putExecutionAttribute(SdkInternalExecutionAttribute.HTTP_CHECKSUM_REQUIRED, + HttpChecksumRequired.create()).withInput(operationWithChecksumRequiredRequest)); + AwsRequestOverrideConfiguration requestOverrideConfig = operationWithChecksumRequiredRequest.overrideConfiguration() + .orElse(null); + CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { + metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); + }); + executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); + return executeFuture; + } catch (Throwable t) { + metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); + return CompletableFutureUtils.failedFuture(t); + } + } + /** * Some paginated operation with result_key in paginators.json file * @@ -653,7 +717,7 @@ public CompletableFuture paginatedOpera * The following are few ways to use the response class: *
* {@code * software.amazon.awssdk.services.json.paginators.PaginatedOperationWithResultKeyPublisher publisher = client.paginatedOperationWithResultKeyPaginator(request); @@ -663,19 +727,19 @@ public CompletableFuture paginatedOpera *
* {@code * software.amazon.awssdk.services.json.paginators.PaginatedOperationWithResultKeyPublisher publisher = client.paginatedOperationWithResultKeyPaginator(request); * publisher.subscribe(new Subscriber() { - * + * * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; - * - * + * + * * public void onNext(software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyResponse response) { //... }; * });} *
* Please notice that the configuration of MaxResults won't limit the number of results you get with the @@ -788,7 +852,7 @@ public CompletableFuture paginatedOp * The following are few ways to use the response class: *
* {@code * software.amazon.awssdk.services.json.paginators.PaginatedOperationWithoutResultKeyPublisher publisher = client.paginatedOperationWithoutResultKeyPaginator(request); @@ -798,19 +862,19 @@ public CompletableFuture paginatedOp *
* {@code * software.amazon.awssdk.services.json.paginators.PaginatedOperationWithoutResultKeyPublisher publisher = client.paginatedOperationWithoutResultKeyPaginator(request); * publisher.subscribe(new Subscriber() { - * + * * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... }; - * - * + * + * * public void onNext(software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyResponse response) { //... }; * });} *
* Please notice that the configuration of MaxResults won't limit the number of results you get with the @@ -1129,3 +1193,4 @@ private HttpResponseHandler createErrorResponseHandler(Base return protocolFactory.createErrorResponseHandler(operationMetadata); } } + diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-async-client-interface.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-async-client-interface.java index e97f69cd5896..43455c17f37e 100644 --- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-async-client-interface.java +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-async-client-interface.java @@ -22,6 +22,8 @@ import software.amazon.awssdk.services.json.model.GetWithoutRequiredMembersResponse; import software.amazon.awssdk.services.json.model.InputEventStream; import software.amazon.awssdk.services.json.model.InputEventStreamTwo; +import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredRequest; +import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredResponse; import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyRequest; import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyResponse; import software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyRequest; @@ -145,7 +147,7 @@ default CompletableFuture aPostOperation(ConsumerAWS API Documentation */ default CompletableFuture aPostOperationWithOutput( - APostOperationWithOutputRequest aPostOperationWithOutputRequest) { + APostOperationWithOutputRequest aPostOperationWithOutputRequest) { throw new UnsupportedOperationException(); } @@ -180,9 +182,9 @@ default CompletableFuture aPostOperationWithOu * target="_top">AWS API Documentation */ default CompletableFuture aPostOperationWithOutput( - Consumer aPostOperationWithOutputRequest) { + Consumer aPostOperationWithOutputRequest) { return aPostOperationWithOutput(APostOperationWithOutputRequest.builder().applyMutation(aPostOperationWithOutputRequest) - .build()); + .build()); } /** @@ -205,7 +207,7 @@ default CompletableFuture aPostOperationWithOu * target="_top">AWS API Documentation */ default CompletableFuture eventStreamOperation(EventStreamOperationRequest eventStreamOperationRequest, - Publisher requestStream, EventStreamOperationResponseHandler asyncResponseHandler) { + Publisher requestStream, EventStreamOperationResponseHandler asyncResponseHandler) { throw new UnsupportedOperationException(); } @@ -235,10 +237,10 @@ default CompletableFuture eventStreamOperation(EventStreamOperationRequest * target="_top">AWS API Documentation */ default CompletableFuture eventStreamOperation( - Consumer eventStreamOperationRequest, Publisher requestStream, - EventStreamOperationResponseHandler asyncResponseHandler) { + Consumer eventStreamOperationRequest, Publisher requestStream, + EventStreamOperationResponseHandler asyncResponseHandler) { return eventStreamOperation(EventStreamOperationRequest.builder().applyMutation(eventStreamOperationRequest).build(), - requestStream, asyncResponseHandler); + requestStream, asyncResponseHandler); } /** @@ -262,8 +264,8 @@ default CompletableFuture eventStreamOperation( * target="_top">AWS API Documentation */ default CompletableFuture eventStreamOperationWithOnlyInput( - EventStreamOperationWithOnlyInputRequest eventStreamOperationWithOnlyInputRequest, - Publisher requestStream) { + EventStreamOperationWithOnlyInputRequest eventStreamOperationWithOnlyInputRequest, + Publisher requestStream) { throw new UnsupportedOperationException(); } @@ -294,11 +296,11 @@ default CompletableFuture eventStream * target="_top">AWS API Documentation */ default CompletableFuture eventStreamOperationWithOnlyInput( - Consumer eventStreamOperationWithOnlyInputRequest, - Publisher requestStream) { + Consumer eventStreamOperationWithOnlyInputRequest, + Publisher requestStream) { return eventStreamOperationWithOnlyInput( - EventStreamOperationWithOnlyInputRequest.builder().applyMutation(eventStreamOperationWithOnlyInputRequest) - .build(), requestStream); + EventStreamOperationWithOnlyInputRequest.builder().applyMutation(eventStreamOperationWithOnlyInputRequest) + .build(), requestStream); } /** @@ -322,8 +324,8 @@ default CompletableFuture eventStream * target="_top">AWS API Documentation */ default CompletableFuture eventStreamOperationWithOnlyOutput( - EventStreamOperationWithOnlyOutputRequest eventStreamOperationWithOnlyOutputRequest, - EventStreamOperationWithOnlyOutputResponseHandler asyncResponseHandler) { + EventStreamOperationWithOnlyOutputRequest eventStreamOperationWithOnlyOutputRequest, + EventStreamOperationWithOnlyOutputResponseHandler asyncResponseHandler) { throw new UnsupportedOperationException(); } @@ -354,11 +356,11 @@ default CompletableFuture eventStreamOperationWithOnlyOutput( * target="_top">AWS API Documentation */ default CompletableFuture eventStreamOperationWithOnlyOutput( - Consumer eventStreamOperationWithOnlyOutputRequest, - EventStreamOperationWithOnlyOutputResponseHandler asyncResponseHandler) { + Consumer eventStreamOperationWithOnlyOutputRequest, + EventStreamOperationWithOnlyOutputResponseHandler asyncResponseHandler) { return eventStreamOperationWithOnlyOutput( - EventStreamOperationWithOnlyOutputRequest.builder().applyMutation(eventStreamOperationWithOnlyOutputRequest) - .build(), asyncResponseHandler); + EventStreamOperationWithOnlyOutputRequest.builder().applyMutation(eventStreamOperationWithOnlyOutputRequest) + .build(), asyncResponseHandler); } /** @@ -385,7 +387,7 @@ default CompletableFuture eventStreamOperationWithOnlyOutput( * target="_top">AWS API Documentation */ default CompletableFuture getWithoutRequiredMembers( - GetWithoutRequiredMembersRequest getWithoutRequiredMembersRequest) { + GetWithoutRequiredMembersRequest getWithoutRequiredMembersRequest) { throw new UnsupportedOperationException(); } @@ -420,9 +422,66 @@ default CompletableFuture getWithoutRequiredM * target="_top">AWS API Documentation */ default CompletableFuture getWithoutRequiredMembers( - Consumer getWithoutRequiredMembersRequest) { + Consumer getWithoutRequiredMembersRequest) { return getWithoutRequiredMembers(GetWithoutRequiredMembersRequest.builder() - .applyMutation(getWithoutRequiredMembersRequest).build()); + .applyMutation(getWithoutRequiredMembersRequest).build()); + } + + /** + * Invokes the OperationWithChecksumRequired operation asynchronously. + * + * @param operationWithChecksumRequiredRequest + * @return A Java Future containing the result of the OperationWithChecksumRequired operation returned by the + * service. + * The CompletableFuture returned by this method can be completed exceptionally with the following + * exceptions. + * + * SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). + * Can be used for catch all scenarios. + * SdkClientException If any client side error occurs such as an IO related failure, failure to get + * credentials, etc. + * JsonException Base class for all service exceptions. Unknown exceptions will be thrown as an instance + * of this type. + * + * @sample JsonAsyncClient.OperationWithChecksumRequired + * @see AWS API Documentation + */ + default CompletableFuture operationWithChecksumRequired( + OperationWithChecksumRequiredRequest operationWithChecksumRequiredRequest) { + throw new UnsupportedOperationException(); + } + + /** + * Invokes the OperationWithChecksumRequired operation asynchronously. + * + * This is a convenience which creates an instance of the {@link OperationWithChecksumRequiredRequest.Builder} + * avoiding the need to create one manually via {@link OperationWithChecksumRequiredRequest#builder()} + * + * + * @param operationWithChecksumRequiredRequest + * A {@link Consumer} that will call methods on {@link OperationWithChecksumRequiredRequest.Builder} to + * create a request. + * @return A Java Future containing the result of the OperationWithChecksumRequired operation returned by the + * service. + * The CompletableFuture returned by this method can be completed exceptionally with the following + * exceptions. + * + * SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). + * Can be used for catch all scenarios. + * SdkClientException If any client side error occurs such as an IO related failure, failure to get + * credentials, etc. + * JsonException Base class for all service exceptions. Unknown exceptions will be thrown as an instance + * of this type. + * + * @sample JsonAsyncClient.OperationWithChecksumRequired + * @see AWS API Documentation + */ + default CompletableFuture operationWithChecksumRequired( + Consumer operationWithChecksumRequiredRequest) { + return operationWithChecksumRequired(OperationWithChecksumRequiredRequest.builder() + .applyMutation(operationWithChecksumRequiredRequest).build()); } /** @@ -446,7 +505,7 @@ default CompletableFuture getWithoutRequiredM * target="_top">AWS API Documentation */ default CompletableFuture paginatedOperationWithResultKey( - PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) { + PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) { throw new UnsupportedOperationException(); } @@ -477,9 +536,9 @@ default CompletableFuture paginatedOper * target="_top">AWS API Documentation */ default CompletableFuture paginatedOperationWithResultKey( - Consumer paginatedOperationWithResultKeyRequest) { + Consumer paginatedOperationWithResultKeyRequest) { return paginatedOperationWithResultKey(PaginatedOperationWithResultKeyRequest.builder() - .applyMutation(paginatedOperationWithResultKeyRequest).build()); + .applyMutation(paginatedOperationWithResultKeyRequest).build()); } /** @@ -653,7 +712,7 @@ default PaginatedOperationWithResultKeyPublisher paginatedOperationWithResultKey * target="_top">AWS API Documentation */ default PaginatedOperationWithResultKeyPublisher paginatedOperationWithResultKeyPaginator( - PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) { + PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) { throw new UnsupportedOperationException(); } @@ -736,9 +795,9 @@ default PaginatedOperationWithResultKeyPublisher paginatedOperationWithResultKey * target="_top">AWS API Documentation */ default PaginatedOperationWithResultKeyPublisher paginatedOperationWithResultKeyPaginator( - Consumer paginatedOperationWithResultKeyRequest) { + Consumer paginatedOperationWithResultKeyRequest) { return paginatedOperationWithResultKeyPaginator(PaginatedOperationWithResultKeyRequest.builder() - .applyMutation(paginatedOperationWithResultKeyRequest).build()); + .applyMutation(paginatedOperationWithResultKeyRequest).build()); } /** @@ -762,7 +821,7 @@ default PaginatedOperationWithResultKeyPublisher paginatedOperationWithResultKey * target="_top">AWS API Documentation */ default CompletableFuture paginatedOperationWithoutResultKey( - PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) { + PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) { throw new UnsupportedOperationException(); } @@ -793,9 +852,9 @@ default CompletableFuture paginatedO * target="_top">AWS API Documentation */ default CompletableFuture paginatedOperationWithoutResultKey( - Consumer paginatedOperationWithoutResultKeyRequest) { + Consumer paginatedOperationWithoutResultKeyRequest) { return paginatedOperationWithoutResultKey(PaginatedOperationWithoutResultKeyRequest.builder() - .applyMutation(paginatedOperationWithoutResultKeyRequest).build()); + .applyMutation(paginatedOperationWithoutResultKeyRequest).build()); } /** @@ -871,7 +930,7 @@ default CompletableFuture paginatedO * target="_top">AWS API Documentation */ default PaginatedOperationWithoutResultKeyPublisher paginatedOperationWithoutResultKeyPaginator( - PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) { + PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) { throw new UnsupportedOperationException(); } @@ -954,9 +1013,9 @@ default PaginatedOperationWithoutResultKeyPublisher paginatedOperationWithoutRes * target="_top">AWS API Documentation */ default PaginatedOperationWithoutResultKeyPublisher paginatedOperationWithoutResultKeyPaginator( - Consumer paginatedOperationWithoutResultKeyRequest) { + Consumer paginatedOperationWithoutResultKeyRequest) { return paginatedOperationWithoutResultKeyPaginator(PaginatedOperationWithoutResultKeyRequest.builder() - .applyMutation(paginatedOperationWithoutResultKeyRequest).build()); + .applyMutation(paginatedOperationWithoutResultKeyRequest).build()); } /** @@ -984,7 +1043,7 @@ default PaginatedOperationWithoutResultKeyPublisher paginatedOperationWithoutRes * target="_top">AWS API Documentation */ default CompletableFuture streamingInputOperation( - StreamingInputOperationRequest streamingInputOperationRequest, AsyncRequestBody requestBody) { + StreamingInputOperationRequest streamingInputOperationRequest, AsyncRequestBody requestBody) { throw new UnsupportedOperationException(); } @@ -1019,9 +1078,9 @@ default CompletableFuture streamingInputOperati * target="_top">AWS API Documentation */ default CompletableFuture streamingInputOperation( - Consumer streamingInputOperationRequest, AsyncRequestBody requestBody) { + Consumer streamingInputOperationRequest, AsyncRequestBody requestBody) { return streamingInputOperation(StreamingInputOperationRequest.builder().applyMutation(streamingInputOperationRequest) - .build(), requestBody); + .build(), requestBody); } /** @@ -1049,7 +1108,7 @@ default CompletableFuture streamingInputOperati * target="_top">AWS API Documentation */ default CompletableFuture streamingInputOperation( - StreamingInputOperationRequest streamingInputOperationRequest, Path sourcePath) { + StreamingInputOperationRequest streamingInputOperationRequest, Path sourcePath) { return streamingInputOperation(streamingInputOperationRequest, AsyncRequestBody.fromFile(sourcePath)); } @@ -1084,9 +1143,9 @@ default CompletableFuture streamingInputOperati * target="_top">AWS API Documentation */ default CompletableFuture streamingInputOperation( - Consumer streamingInputOperationRequest, Path sourcePath) { + Consumer streamingInputOperationRequest, Path sourcePath) { return streamingInputOperation(StreamingInputOperationRequest.builder().applyMutation(streamingInputOperationRequest) - .build(), sourcePath); + .build(), sourcePath); } /** @@ -1119,8 +1178,8 @@ default CompletableFuture streamingInputOperati * target="_top">AWS API Documentation */ default CompletableFuture streamingInputOutputOperation( - StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, AsyncRequestBody requestBody, - AsyncResponseTransformer asyncResponseTransformer) { + StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, AsyncRequestBody requestBody, + AsyncResponseTransformer asyncResponseTransformer) { throw new UnsupportedOperationException(); } @@ -1160,12 +1219,12 @@ default CompletableFuture streamingInputOutputOperation( * target="_top">AWS API Documentation */ default CompletableFuture streamingInputOutputOperation( - Consumer streamingInputOutputOperationRequest, - AsyncRequestBody requestBody, - AsyncResponseTransformer asyncResponseTransformer) { + Consumer streamingInputOutputOperationRequest, + AsyncRequestBody requestBody, + AsyncResponseTransformer asyncResponseTransformer) { return streamingInputOutputOperation( - StreamingInputOutputOperationRequest.builder().applyMutation(streamingInputOutputOperationRequest).build(), - requestBody, asyncResponseTransformer); + StreamingInputOutputOperationRequest.builder().applyMutation(streamingInputOutputOperationRequest).build(), + requestBody, asyncResponseTransformer); } /** @@ -1197,9 +1256,9 @@ default CompletableFuture streamingInputOutputOperation( * target="_top">AWS API Documentation */ default CompletableFuture streamingInputOutputOperation( - StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, Path sourcePath, Path destinationPath) { + StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, Path sourcePath, Path destinationPath) { return streamingInputOutputOperation(streamingInputOutputOperationRequest, AsyncRequestBody.fromFile(sourcePath), - AsyncResponseTransformer.toFile(destinationPath)); + AsyncResponseTransformer.toFile(destinationPath)); } /** @@ -1237,11 +1296,11 @@ default CompletableFuture streamingInputO * target="_top">AWS API Documentation */ default CompletableFuture streamingInputOutputOperation( - Consumer streamingInputOutputOperationRequest, Path sourcePath, - Path destinationPath) { + Consumer streamingInputOutputOperationRequest, Path sourcePath, + Path destinationPath) { return streamingInputOutputOperation( - StreamingInputOutputOperationRequest.builder().applyMutation(streamingInputOutputOperationRequest).build(), - sourcePath, destinationPath); + StreamingInputOutputOperationRequest.builder().applyMutation(streamingInputOutputOperationRequest).build(), + sourcePath, destinationPath); } /** @@ -1269,8 +1328,8 @@ default CompletableFuture streamingInputO * target="_top">AWS API Documentation */ default CompletableFuture streamingOutputOperation( - StreamingOutputOperationRequest streamingOutputOperationRequest, - AsyncResponseTransformer asyncResponseTransformer) { + StreamingOutputOperationRequest streamingOutputOperationRequest, + AsyncResponseTransformer asyncResponseTransformer) { throw new UnsupportedOperationException(); } @@ -1305,10 +1364,10 @@ default CompletableFuture streamingOutputOperation( * target="_top">AWS API Documentation */ default CompletableFuture streamingOutputOperation( - Consumer streamingOutputOperationRequest, - AsyncResponseTransformer asyncResponseTransformer) { + Consumer streamingOutputOperationRequest, + AsyncResponseTransformer asyncResponseTransformer) { return streamingOutputOperation(StreamingOutputOperationRequest.builder().applyMutation(streamingOutputOperationRequest) - .build(), asyncResponseTransformer); + .build(), asyncResponseTransformer); } /** @@ -1335,7 +1394,7 @@ default CompletableFuture streamingOutputOperation( * target="_top">AWS API Documentation */ default CompletableFuture streamingOutputOperation( - StreamingOutputOperationRequest streamingOutputOperationRequest, Path destinationPath) { + StreamingOutputOperationRequest streamingOutputOperationRequest, Path destinationPath) { return streamingOutputOperation(streamingOutputOperationRequest, AsyncResponseTransformer.toFile(destinationPath)); } @@ -1369,9 +1428,9 @@ default CompletableFuture streamingOutputOpera * target="_top">AWS API Documentation */ default CompletableFuture streamingOutputOperation( - Consumer streamingOutputOperationRequest, Path destinationPath) { + Consumer streamingOutputOperationRequest, Path destinationPath) { return streamingOutputOperation(StreamingOutputOperationRequest.builder().applyMutation(streamingOutputOperationRequest) - .build(), destinationPath); + .build(), destinationPath); } /** diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-class.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-class.java index 14c934f5b859..b1c99a29788f 100644 --- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-class.java +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-class.java @@ -17,6 +17,8 @@ import software.amazon.awssdk.core.client.handler.SyncClientHandler; import software.amazon.awssdk.core.exception.SdkClientException; import software.amazon.awssdk.core.http.HttpResponseHandler; +import software.amazon.awssdk.core.interceptor.SdkInternalExecutionAttribute; +import software.amazon.awssdk.core.interceptor.trait.HttpChecksumRequired; import software.amazon.awssdk.core.metrics.CoreMetric; import software.amazon.awssdk.core.runtime.transform.StreamingRequestMarshaller; import software.amazon.awssdk.core.signer.Signer; @@ -40,6 +42,8 @@ import software.amazon.awssdk.services.json.model.InvalidInputException; import software.amazon.awssdk.services.json.model.JsonException; import software.amazon.awssdk.services.json.model.JsonRequest; +import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredRequest; +import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredResponse; import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyRequest; import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyResponse; import software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyRequest; @@ -55,6 +59,7 @@ import software.amazon.awssdk.services.json.transform.APostOperationRequestMarshaller; import software.amazon.awssdk.services.json.transform.APostOperationWithOutputRequestMarshaller; import software.amazon.awssdk.services.json.transform.GetWithoutRequiredMembersRequestMarshaller; +import software.amazon.awssdk.services.json.transform.OperationWithChecksumRequiredRequestMarshaller; import software.amazon.awssdk.services.json.transform.PaginatedOperationWithResultKeyRequestMarshaller; import software.amazon.awssdk.services.json.transform.PaginatedOperationWithoutResultKeyRequestMarshaller; import software.amazon.awssdk.services.json.transform.StreamingInputOperationRequestMarshaller; @@ -112,32 +117,32 @@ public final String serviceName() { */ @Override public APostOperationResponse aPostOperation(APostOperationRequest aPostOperationRequest) throws InvalidInputException, - AwsServiceException, SdkClientException, JsonException { + AwsServiceException, SdkClientException, JsonException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) - .isPayloadJson(true).build(); + .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, - APostOperationResponse::builder); + APostOperationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, - operationMetadata); + operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, aPostOperationRequest - .overrideConfiguration().orElse(null)); + .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector - .create("ApiCall"); + .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "APostOperation"); String hostPrefix = "{StringMember}-foo."; HostnameValidator.validateHostnameCompliant(aPostOperationRequest.stringMember(), "StringMember", - "aPostOperationRequest"); + "aPostOperationRequest"); String resolvedHostExpression = String.format("%s-foo.", aPostOperationRequest.stringMember()); return clientHandler.execute(new ClientExecutionParams() - .withOperationName("APostOperation").withResponseHandler(responseHandler) - .withErrorResponseHandler(errorResponseHandler).hostPrefixExpression(resolvedHostExpression) - .withInput(aPostOperationRequest).withMetricCollector(apiCallMetricCollector) - .withMarshaller(new APostOperationRequestMarshaller(protocolFactory))); + .withOperationName("APostOperation").withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler).hostPrefixExpression(resolvedHostExpression) + .withInput(aPostOperationRequest).withMetricCollector(apiCallMetricCollector) + .withMarshaller(new APostOperationRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } @@ -165,30 +170,30 @@ public APostOperationResponse aPostOperation(APostOperationRequest aPostOperatio */ @Override public APostOperationWithOutputResponse aPostOperationWithOutput( - APostOperationWithOutputRequest aPostOperationWithOutputRequest) throws InvalidInputException, AwsServiceException, - SdkClientException, JsonException { + APostOperationWithOutputRequest aPostOperationWithOutputRequest) throws InvalidInputException, AwsServiceException, + SdkClientException, JsonException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) - .isPayloadJson(true).build(); + .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( - operationMetadata, APostOperationWithOutputResponse::builder); + operationMetadata, APostOperationWithOutputResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, - operationMetadata); + operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, aPostOperationWithOutputRequest - .overrideConfiguration().orElse(null)); + .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector - .create("ApiCall"); + .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "APostOperationWithOutput"); return clientHandler - .execute(new ClientExecutionParams() - .withOperationName("APostOperationWithOutput").withResponseHandler(responseHandler) - .withErrorResponseHandler(errorResponseHandler).withInput(aPostOperationWithOutputRequest) - .withMetricCollector(apiCallMetricCollector) - .withMarshaller(new APostOperationWithOutputRequestMarshaller(protocolFactory))); + .execute(new ClientExecutionParams() + .withOperationName("APostOperationWithOutput").withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler).withInput(aPostOperationWithOutputRequest) + .withMetricCollector(apiCallMetricCollector) + .withMarshaller(new APostOperationWithOutputRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } @@ -216,30 +221,81 @@ public APostOperationWithOutputResponse aPostOperationWithOutput( */ @Override public GetWithoutRequiredMembersResponse getWithoutRequiredMembers( - GetWithoutRequiredMembersRequest getWithoutRequiredMembersRequest) throws InvalidInputException, AwsServiceException, - SdkClientException, JsonException { + GetWithoutRequiredMembersRequest getWithoutRequiredMembersRequest) throws InvalidInputException, AwsServiceException, + SdkClientException, JsonException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) - .isPayloadJson(true).build(); + .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( - operationMetadata, GetWithoutRequiredMembersResponse::builder); + operationMetadata, GetWithoutRequiredMembersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, - operationMetadata); + operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, getWithoutRequiredMembersRequest - .overrideConfiguration().orElse(null)); + .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector - .create("ApiCall"); + .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetWithoutRequiredMembers"); return clientHandler - .execute(new ClientExecutionParams() - .withOperationName("GetWithoutRequiredMembers").withResponseHandler(responseHandler) - .withErrorResponseHandler(errorResponseHandler).withInput(getWithoutRequiredMembersRequest) - .withMetricCollector(apiCallMetricCollector) - .withMarshaller(new GetWithoutRequiredMembersRequestMarshaller(protocolFactory))); + .execute(new ClientExecutionParams() + .withOperationName("GetWithoutRequiredMembers").withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler).withInput(getWithoutRequiredMembersRequest) + .withMetricCollector(apiCallMetricCollector) + .withMarshaller(new GetWithoutRequiredMembersRequestMarshaller(protocolFactory))); + } finally { + metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); + } + } + + /** + * Invokes the OperationWithChecksumRequired operation. + * + * @param operationWithChecksumRequiredRequest + * @return Result of the OperationWithChecksumRequired operation returned by the service. + * @throws SdkException + * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for + * catch all scenarios. + * @throws SdkClientException + * If any client side error occurs such as an IO related failure, failure to get credentials, etc. + * @throws JsonException + * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. + * @sample JsonClient.OperationWithChecksumRequired + * @see AWS API Documentation + */ + @Override + public OperationWithChecksumRequiredResponse operationWithChecksumRequired( + OperationWithChecksumRequiredRequest operationWithChecksumRequiredRequest) throws AwsServiceException, + SdkClientException, JsonException { + JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) + .isPayloadJson(true).build(); + + HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( + operationMetadata, OperationWithChecksumRequiredResponse::builder); + + HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, + operationMetadata); + List metricPublishers = resolveMetricPublishers(clientConfiguration, + operationWithChecksumRequiredRequest.overrideConfiguration().orElse(null)); + MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector + .create("ApiCall"); + try { + apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); + apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "OperationWithChecksumRequired"); + + return clientHandler + .execute(new ClientExecutionParams() + .withOperationName("OperationWithChecksumRequired") + .withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler) + .withInput(operationWithChecksumRequiredRequest) + .withMetricCollector(apiCallMetricCollector) + .putExecutionAttribute(SdkInternalExecutionAttribute.HTTP_CHECKSUM_REQUIRED, + HttpChecksumRequired.create()) + .withMarshaller(new OperationWithChecksumRequiredRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } @@ -263,30 +319,30 @@ public GetWithoutRequiredMembersResponse getWithoutRequiredMembers( */ @Override public PaginatedOperationWithResultKeyResponse paginatedOperationWithResultKey( - PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) throws AwsServiceException, - SdkClientException, JsonException { + PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) throws AwsServiceException, + SdkClientException, JsonException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) - .isPayloadJson(true).build(); + .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( - operationMetadata, PaginatedOperationWithResultKeyResponse::builder); + operationMetadata, PaginatedOperationWithResultKeyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, - operationMetadata); + operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, - paginatedOperationWithResultKeyRequest.overrideConfiguration().orElse(null)); + paginatedOperationWithResultKeyRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector - .create("ApiCall"); + .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PaginatedOperationWithResultKey"); return clientHandler - .execute(new ClientExecutionParams() - .withOperationName("PaginatedOperationWithResultKey").withResponseHandler(responseHandler) - .withErrorResponseHandler(errorResponseHandler).withInput(paginatedOperationWithResultKeyRequest) - .withMetricCollector(apiCallMetricCollector) - .withMarshaller(new PaginatedOperationWithResultKeyRequestMarshaller(protocolFactory))); + .execute(new ClientExecutionParams() + .withOperationName("PaginatedOperationWithResultKey").withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler).withInput(paginatedOperationWithResultKeyRequest) + .withMetricCollector(apiCallMetricCollector) + .withMarshaller(new PaginatedOperationWithResultKeyRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } @@ -365,8 +421,8 @@ public PaginatedOperationWithResultKeyResponse paginatedOperationWithResultKey( */ @Override public PaginatedOperationWithResultKeyIterable paginatedOperationWithResultKeyPaginator( - PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) throws AwsServiceException, - SdkClientException, JsonException { + PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) throws AwsServiceException, + SdkClientException, JsonException { return new PaginatedOperationWithResultKeyIterable(this, applyPaginatorUserAgent(paginatedOperationWithResultKeyRequest)); } @@ -388,30 +444,30 @@ public PaginatedOperationWithResultKeyIterable paginatedOperationWithResultKeyPa */ @Override public PaginatedOperationWithoutResultKeyResponse paginatedOperationWithoutResultKey( - PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) throws AwsServiceException, - SdkClientException, JsonException { + PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) throws AwsServiceException, + SdkClientException, JsonException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) - .isPayloadJson(true).build(); + .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( - operationMetadata, PaginatedOperationWithoutResultKeyResponse::builder); + operationMetadata, PaginatedOperationWithoutResultKeyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, - operationMetadata); + operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, - paginatedOperationWithoutResultKeyRequest.overrideConfiguration().orElse(null)); + paginatedOperationWithoutResultKeyRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector - .create("ApiCall"); + .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PaginatedOperationWithoutResultKey"); return clientHandler - .execute(new ClientExecutionParams() - .withOperationName("PaginatedOperationWithoutResultKey").withResponseHandler(responseHandler) - .withErrorResponseHandler(errorResponseHandler).withInput(paginatedOperationWithoutResultKeyRequest) - .withMetricCollector(apiCallMetricCollector) - .withMarshaller(new PaginatedOperationWithoutResultKeyRequestMarshaller(protocolFactory))); + .execute(new ClientExecutionParams() + .withOperationName("PaginatedOperationWithoutResultKey").withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler).withInput(paginatedOperationWithoutResultKeyRequest) + .withMetricCollector(apiCallMetricCollector) + .withMarshaller(new PaginatedOperationWithoutResultKeyRequestMarshaller(protocolFactory))); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } @@ -490,10 +546,10 @@ public PaginatedOperationWithoutResultKeyResponse paginatedOperationWithoutResul */ @Override public PaginatedOperationWithoutResultKeyIterable paginatedOperationWithoutResultKeyPaginator( - PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) throws AwsServiceException, - SdkClientException, JsonException { + PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) throws AwsServiceException, + SdkClientException, JsonException { return new PaginatedOperationWithoutResultKeyIterable(this, - applyPaginatorUserAgent(paginatedOperationWithoutResultKeyRequest)); + applyPaginatorUserAgent(paginatedOperationWithoutResultKeyRequest)); } /** @@ -525,35 +581,35 @@ public PaginatedOperationWithoutResultKeyIterable paginatedOperationWithoutResul */ @Override public StreamingInputOperationResponse streamingInputOperation(StreamingInputOperationRequest streamingInputOperationRequest, - RequestBody requestBody) throws AwsServiceException, SdkClientException, JsonException { + RequestBody requestBody) throws AwsServiceException, SdkClientException, JsonException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) - .isPayloadJson(true).build(); + .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( - operationMetadata, StreamingInputOperationResponse::builder); + operationMetadata, StreamingInputOperationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, - operationMetadata); + operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, streamingInputOperationRequest - .overrideConfiguration().orElse(null)); + .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector - .create("ApiCall"); + .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StreamingInputOperation"); return clientHandler - .execute(new ClientExecutionParams() - .withOperationName("StreamingInputOperation") - .withResponseHandler(responseHandler) - .withErrorResponseHandler(errorResponseHandler) - .withInput(streamingInputOperationRequest) - .withMetricCollector(apiCallMetricCollector) - .withRequestBody(requestBody) - .withMarshaller( - StreamingRequestMarshaller.builder() - .delegateMarshaller(new StreamingInputOperationRequestMarshaller(protocolFactory)) - .requestBody(requestBody).build())); + .execute(new ClientExecutionParams() + .withOperationName("StreamingInputOperation") + .withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler) + .withInput(streamingInputOperationRequest) + .withMetricCollector(apiCallMetricCollector) + .withRequestBody(requestBody) + .withMarshaller( + StreamingRequestMarshaller.builder() + .delegateMarshaller(new StreamingInputOperationRequestMarshaller(protocolFactory)) + .requestBody(requestBody).build())); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } @@ -595,41 +651,41 @@ public StreamingInputOperationResponse streamingInputOperation(StreamingInputOpe */ @Override public ReturnT streamingInputOutputOperation( - StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, RequestBody requestBody, - ResponseTransformer responseTransformer) throws AwsServiceException, - SdkClientException, JsonException { + StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, RequestBody requestBody, + ResponseTransformer responseTransformer) throws AwsServiceException, + SdkClientException, JsonException { streamingInputOutputOperationRequest = applySignerOverride(streamingInputOutputOperationRequest, - Aws4UnsignedPayloadSigner.create()); + Aws4UnsignedPayloadSigner.create()); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(true) - .isPayloadJson(false).build(); + .isPayloadJson(false).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( - operationMetadata, StreamingInputOutputOperationResponse::builder); + operationMetadata, StreamingInputOutputOperationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, - operationMetadata); + operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, - streamingInputOutputOperationRequest.overrideConfiguration().orElse(null)); + streamingInputOutputOperationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector - .create("ApiCall"); + .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StreamingInputOutputOperation"); return clientHandler.execute( - new ClientExecutionParams() - .withOperationName("StreamingInputOutputOperation") - .withResponseHandler(responseHandler) - .withErrorResponseHandler(errorResponseHandler) - .withInput(streamingInputOutputOperationRequest) - .withMetricCollector(apiCallMetricCollector) - .withRequestBody(requestBody) - .withMarshaller( - StreamingRequestMarshaller - .builder() - .delegateMarshaller( - new StreamingInputOutputOperationRequestMarshaller(protocolFactory)) - .requestBody(requestBody).transferEncoding(true).build()), responseTransformer); + new ClientExecutionParams() + .withOperationName("StreamingInputOutputOperation") + .withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler) + .withInput(streamingInputOutputOperationRequest) + .withMetricCollector(apiCallMetricCollector) + .withRequestBody(requestBody) + .withMarshaller( + StreamingRequestMarshaller + .builder() + .delegateMarshaller( + new StreamingInputOutputOperationRequestMarshaller(protocolFactory)) + .requestBody(requestBody).transferEncoding(true).build()), responseTransformer); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } @@ -660,37 +716,37 @@ public ReturnT streamingInputOutputOperation( */ @Override public ReturnT streamingOutputOperation(StreamingOutputOperationRequest streamingOutputOperationRequest, - ResponseTransformer responseTransformer) throws AwsServiceException, - SdkClientException, JsonException { + ResponseTransformer responseTransformer) throws AwsServiceException, + SdkClientException, JsonException { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(true) - .isPayloadJson(false).build(); + .isPayloadJson(false).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( - operationMetadata, StreamingOutputOperationResponse::builder); + operationMetadata, StreamingOutputOperationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, - operationMetadata); + operationMetadata); List metricPublishers = resolveMetricPublishers(clientConfiguration, streamingOutputOperationRequest - .overrideConfiguration().orElse(null)); + .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector - .create("ApiCall"); + .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Json Service"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StreamingOutputOperation"); return clientHandler.execute( - new ClientExecutionParams() - .withOperationName("StreamingOutputOperation").withResponseHandler(responseHandler) - .withErrorResponseHandler(errorResponseHandler).withInput(streamingOutputOperationRequest) - .withMetricCollector(apiCallMetricCollector) - .withMarshaller(new StreamingOutputOperationRequestMarshaller(protocolFactory)), responseTransformer); + new ClientExecutionParams() + .withOperationName("StreamingOutputOperation").withResponseHandler(responseHandler) + .withErrorResponseHandler(errorResponseHandler).withInput(streamingOutputOperationRequest) + .withMetricCollector(apiCallMetricCollector) + .withMarshaller(new StreamingOutputOperationRequestMarshaller(protocolFactory)), responseTransformer); } finally { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); } } private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration, - RequestOverrideConfiguration requestOverrideConfiguration) { + RequestOverrideConfiguration requestOverrideConfiguration) { List publishers = null; if (requestOverrideConfiguration != null) { publishers = requestOverrideConfiguration.metricPublishers(); @@ -705,19 +761,19 @@ private static List resolveMetricPublishers(SdkClientConfigurat } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, - JsonOperationMetadata operationMetadata) { + JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } private > T init(T builder) { return builder - .clientConfiguration(clientConfiguration) - .defaultServiceExceptionSupplier(JsonException::builder) - .protocol(AwsJsonProtocol.REST_JSON) - .protocolVersion("1.1") - .registerModeledException( - ExceptionMetadata.builder().errorCode("InvalidInput") - .exceptionBuilderSupplier(InvalidInputException::builder).httpStatusCode(400).build()); + .clientConfiguration(clientConfiguration) + .defaultServiceExceptionSupplier(JsonException::builder) + .protocol(AwsJsonProtocol.REST_JSON) + .protocolVersion("1.1") + .registerModeledException( + ExceptionMetadata.builder().errorCode("InvalidInput") + .exceptionBuilderSupplier(InvalidInputException::builder).httpStatusCode(400).build()); } @Override @@ -727,10 +783,10 @@ public void close() { private T applyPaginatorUserAgent(T request) { Consumer userAgentApplier = b -> b.addApiName(ApiName.builder() - .version(VersionInfo.SDK_VERSION).name("PAGINATED").build()); + .version(VersionInfo.SDK_VERSION).name("PAGINATED").build()); AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration() - .map(c -> c.toBuilder().applyMutation(userAgentApplier).build()) - .orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build())); + .map(c -> c.toBuilder().applyMutation(userAgentApplier).build()) + .orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build())); return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build(); } @@ -740,8 +796,8 @@ private T applySignerOverride(T request, Signer signer) } Consumer signerOverride = b -> b.signer(signer).build(); AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration() - .map(c -> c.toBuilder().applyMutation(signerOverride).build()) - .orElse((AwsRequestOverrideConfiguration.builder().applyMutation(signerOverride).build())); + .map(c -> c.toBuilder().applyMutation(signerOverride).build()) + .orElse((AwsRequestOverrideConfiguration.builder().applyMutation(signerOverride).build())); return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build(); } diff --git a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-interface.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-interface.java index 2685e7061b1f..77c4aa00dc3d 100644 --- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-interface.java +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-json-client-interface.java @@ -19,6 +19,8 @@ import software.amazon.awssdk.services.json.model.GetWithoutRequiredMembersResponse; import software.amazon.awssdk.services.json.model.InvalidInputException; import software.amazon.awssdk.services.json.model.JsonException; +import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredRequest; +import software.amazon.awssdk.services.json.model.OperationWithChecksumRequiredResponse; import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyRequest; import software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyResponse; import software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyRequest; @@ -109,7 +111,7 @@ default APostOperationResponse aPostOperation(APostOperationRequest aPostOperati * API Documentation */ default APostOperationResponse aPostOperation(Consumer aPostOperationRequest) - throws InvalidInputException, AwsServiceException, SdkClientException, JsonException { + throws InvalidInputException, AwsServiceException, SdkClientException, JsonException { return aPostOperation(APostOperationRequest.builder().applyMutation(aPostOperationRequest).build()); } @@ -134,8 +136,8 @@ default APostOperationResponse aPostOperation(ConsumerAWS API Documentation */ default APostOperationWithOutputResponse aPostOperationWithOutput( - APostOperationWithOutputRequest aPostOperationWithOutputRequest) throws InvalidInputException, AwsServiceException, - SdkClientException, JsonException { + APostOperationWithOutputRequest aPostOperationWithOutputRequest) throws InvalidInputException, AwsServiceException, + SdkClientException, JsonException { throw new UnsupportedOperationException(); } @@ -167,8 +169,8 @@ default APostOperationWithOutputResponse aPostOperationWithOutput( * target="_top">AWS API Documentation */ default APostOperationWithOutputResponse aPostOperationWithOutput( - Consumer aPostOperationWithOutputRequest) throws InvalidInputException, - AwsServiceException, SdkClientException, JsonException { + Consumer aPostOperationWithOutputRequest) throws InvalidInputException, + AwsServiceException, SdkClientException, JsonException { return aPostOperationWithOutput(APostOperationWithOutputRequest.builder().applyMutation(aPostOperationWithOutputRequest) .build()); } @@ -194,8 +196,8 @@ default APostOperationWithOutputResponse aPostOperationWithOutput( * target="_top">AWS API Documentation */ default GetWithoutRequiredMembersResponse getWithoutRequiredMembers( - GetWithoutRequiredMembersRequest getWithoutRequiredMembersRequest) throws InvalidInputException, AwsServiceException, - SdkClientException, JsonException { + GetWithoutRequiredMembersRequest getWithoutRequiredMembersRequest) throws InvalidInputException, AwsServiceException, + SdkClientException, JsonException { throw new UnsupportedOperationException(); } @@ -227,12 +229,63 @@ default GetWithoutRequiredMembersResponse getWithoutRequiredMembers( * target="_top">AWS API Documentation */ default GetWithoutRequiredMembersResponse getWithoutRequiredMembers( - Consumer getWithoutRequiredMembersRequest) throws InvalidInputException, - AwsServiceException, SdkClientException, JsonException { + Consumer getWithoutRequiredMembersRequest) throws InvalidInputException, + AwsServiceException, SdkClientException, JsonException { return getWithoutRequiredMembers(GetWithoutRequiredMembersRequest.builder() .applyMutation(getWithoutRequiredMembersRequest).build()); } + /** + * Invokes the OperationWithChecksumRequired operation. + * + * @param operationWithChecksumRequiredRequest + * @return Result of the OperationWithChecksumRequired operation returned by the service. + * @throws SdkException + * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for + * catch all scenarios. + * @throws SdkClientException + * If any client side error occurs such as an IO related failure, failure to get credentials, etc. + * @throws JsonException + * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. + * @sample JsonClient.OperationWithChecksumRequired + * @see AWS API Documentation + */ + default OperationWithChecksumRequiredResponse operationWithChecksumRequired( + OperationWithChecksumRequiredRequest operationWithChecksumRequiredRequest) throws AwsServiceException, + SdkClientException, JsonException { + throw new UnsupportedOperationException(); + } + + /** + * Invokes the OperationWithChecksumRequired operation. + * + * This is a convenience which creates an instance of the {@link OperationWithChecksumRequiredRequest.Builder} + * avoiding the need to create one manually via {@link OperationWithChecksumRequiredRequest#builder()} + * + * + * @param operationWithChecksumRequiredRequest + * A {@link Consumer} that will call methods on {@link OperationWithChecksumRequiredRequest.Builder} to + * create a request. + * @return Result of the OperationWithChecksumRequired operation returned by the service. + * @throws SdkException + * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for + * catch all scenarios. + * @throws SdkClientException + * If any client side error occurs such as an IO related failure, failure to get credentials, etc. + * @throws JsonException + * Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type. + * @sample JsonClient.OperationWithChecksumRequired + * @see AWS API Documentation + */ + default OperationWithChecksumRequiredResponse operationWithChecksumRequired( + Consumer operationWithChecksumRequiredRequest) + throws AwsServiceException, SdkClientException, JsonException { + return operationWithChecksumRequired(OperationWithChecksumRequiredRequest.builder() + .applyMutation(operationWithChecksumRequiredRequest).build()); + } + /** * Some paginated operation with result_key in paginators.json file * @@ -271,8 +324,8 @@ default PaginatedOperationWithResultKeyResponse paginatedOperationWithResultKey( * target="_top">AWS API Documentation */ default PaginatedOperationWithResultKeyResponse paginatedOperationWithResultKey( - PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) throws AwsServiceException, - SdkClientException, JsonException { + PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) throws AwsServiceException, + SdkClientException, JsonException { throw new UnsupportedOperationException(); } @@ -299,8 +352,8 @@ default PaginatedOperationWithResultKeyResponse paginatedOperationWithResultKey( * target="_top">AWS API Documentation */ default PaginatedOperationWithResultKeyResponse paginatedOperationWithResultKey( - Consumer paginatedOperationWithResultKeyRequest) - throws AwsServiceException, SdkClientException, JsonException { + Consumer paginatedOperationWithResultKeyRequest) + throws AwsServiceException, SdkClientException, JsonException { return paginatedOperationWithResultKey(PaginatedOperationWithResultKeyRequest.builder() .applyMutation(paginatedOperationWithResultKeyRequest).build()); } @@ -453,8 +506,8 @@ default PaginatedOperationWithResultKeyIterable paginatedOperationWithResultKeyP * target="_top">AWS API Documentation */ default PaginatedOperationWithResultKeyIterable paginatedOperationWithResultKeyPaginator( - PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) throws AwsServiceException, - SdkClientException, JsonException { + PaginatedOperationWithResultKeyRequest paginatedOperationWithResultKeyRequest) throws AwsServiceException, + SdkClientException, JsonException { throw new UnsupportedOperationException(); } @@ -536,8 +589,8 @@ default PaginatedOperationWithResultKeyIterable paginatedOperationWithResultKeyP * target="_top">AWS API Documentation */ default PaginatedOperationWithResultKeyIterable paginatedOperationWithResultKeyPaginator( - Consumer paginatedOperationWithResultKeyRequest) - throws AwsServiceException, SdkClientException, JsonException { + Consumer paginatedOperationWithResultKeyRequest) + throws AwsServiceException, SdkClientException, JsonException { return paginatedOperationWithResultKeyPaginator(PaginatedOperationWithResultKeyRequest.builder() .applyMutation(paginatedOperationWithResultKeyRequest).build()); } @@ -559,8 +612,8 @@ default PaginatedOperationWithResultKeyIterable paginatedOperationWithResultKeyP * target="_top">AWS API Documentation */ default PaginatedOperationWithoutResultKeyResponse paginatedOperationWithoutResultKey( - PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) throws AwsServiceException, - SdkClientException, JsonException { + PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) throws AwsServiceException, + SdkClientException, JsonException { throw new UnsupportedOperationException(); } @@ -587,8 +640,8 @@ default PaginatedOperationWithoutResultKeyResponse paginatedOperationWithoutResu * target="_top">AWS API Documentation */ default PaginatedOperationWithoutResultKeyResponse paginatedOperationWithoutResultKey( - Consumer paginatedOperationWithoutResultKeyRequest) - throws AwsServiceException, SdkClientException, JsonException { + Consumer paginatedOperationWithoutResultKeyRequest) + throws AwsServiceException, SdkClientException, JsonException { return paginatedOperationWithoutResultKey(PaginatedOperationWithoutResultKeyRequest.builder() .applyMutation(paginatedOperationWithoutResultKeyRequest).build()); } @@ -665,8 +718,8 @@ default PaginatedOperationWithoutResultKeyResponse paginatedOperationWithoutResu * target="_top">AWS API Documentation */ default PaginatedOperationWithoutResultKeyIterable paginatedOperationWithoutResultKeyPaginator( - PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) throws AwsServiceException, - SdkClientException, JsonException { + PaginatedOperationWithoutResultKeyRequest paginatedOperationWithoutResultKeyRequest) throws AwsServiceException, + SdkClientException, JsonException { throw new UnsupportedOperationException(); } @@ -748,8 +801,8 @@ default PaginatedOperationWithoutResultKeyIterable paginatedOperationWithoutResu * target="_top">AWS API Documentation */ default PaginatedOperationWithoutResultKeyIterable paginatedOperationWithoutResultKeyPaginator( - Consumer paginatedOperationWithoutResultKeyRequest) - throws AwsServiceException, SdkClientException, JsonException { + Consumer paginatedOperationWithoutResultKeyRequest) + throws AwsServiceException, SdkClientException, JsonException { return paginatedOperationWithoutResultKeyPaginator(PaginatedOperationWithoutResultKeyRequest.builder() .applyMutation(paginatedOperationWithoutResultKeyRequest).build()); } @@ -782,8 +835,8 @@ default PaginatedOperationWithoutResultKeyIterable paginatedOperationWithoutResu * target="_top">AWS API Documentation */ default StreamingInputOperationResponse streamingInputOperation( - StreamingInputOperationRequest streamingInputOperationRequest, RequestBody requestBody) throws AwsServiceException, - SdkClientException, JsonException { + StreamingInputOperationRequest streamingInputOperationRequest, RequestBody requestBody) throws AwsServiceException, + SdkClientException, JsonException { throw new UnsupportedOperationException(); } @@ -821,8 +874,8 @@ default StreamingInputOperationResponse streamingInputOperation( * target="_top">AWS API Documentation */ default StreamingInputOperationResponse streamingInputOperation( - Consumer streamingInputOperationRequest, RequestBody requestBody) - throws AwsServiceException, SdkClientException, JsonException { + Consumer streamingInputOperationRequest, RequestBody requestBody) + throws AwsServiceException, SdkClientException, JsonException { return streamingInputOperation(StreamingInputOperationRequest.builder().applyMutation(streamingInputOperationRequest) .build(), requestBody); } @@ -850,8 +903,8 @@ default StreamingInputOperationResponse streamingInputOperation( * target="_top">AWS API Documentation */ default StreamingInputOperationResponse streamingInputOperation( - StreamingInputOperationRequest streamingInputOperationRequest, Path sourcePath) throws AwsServiceException, - SdkClientException, JsonException { + StreamingInputOperationRequest streamingInputOperationRequest, Path sourcePath) throws AwsServiceException, + SdkClientException, JsonException { return streamingInputOperation(streamingInputOperationRequest, RequestBody.fromFile(sourcePath)); } @@ -884,8 +937,8 @@ default StreamingInputOperationResponse streamingInputOperation( * target="_top">AWS API Documentation */ default StreamingInputOperationResponse streamingInputOperation( - Consumer streamingInputOperationRequest, Path sourcePath) - throws AwsServiceException, SdkClientException, JsonException { + Consumer streamingInputOperationRequest, Path sourcePath) + throws AwsServiceException, SdkClientException, JsonException { return streamingInputOperation(StreamingInputOperationRequest.builder().applyMutation(streamingInputOperationRequest) .build(), sourcePath); } @@ -907,11 +960,11 @@ default StreamingInputOperationResponse streamingInputOperation( * The service documentation for the request content is as follows 'This be a stream' * @param responseTransformer * Functional interface for processing the streamed response content. The unmarshalled - * StreamingInputOutputOperationResponse and an InputStream to the response content are provided as parameters - * to the callback. The callback may return a transformed type which will be the return value of this method. - * See {@link software.amazon.awssdk.core.sync.ResponseTransformer} for details on implementing this - * interface and for links to pre-canned implementations for common scenarios like downloading to a file. The - * service documentation for the response content is as follows 'This be a stream'. + * StreamingInputOutputOperationResponse and an InputStream to the response content are provided as + * parameters to the callback. The callback may return a transformed type which will be the return value of + * this method. See {@link software.amazon.awssdk.core.sync.ResponseTransformer} for details on implementing + * this interface and for links to pre-canned implementations for common scenarios like downloading to a + * file. The service documentation for the response content is as follows 'This be a stream'. * @return The transformed result of the ResponseTransformer. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for @@ -925,9 +978,9 @@ default StreamingInputOperationResponse streamingInputOperation( * target="_top">AWS API Documentation */ default ReturnT streamingInputOutputOperation( - StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, RequestBody requestBody, - ResponseTransformer responseTransformer) throws AwsServiceException, - SdkClientException, JsonException { + StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, RequestBody requestBody, + ResponseTransformer responseTransformer) throws AwsServiceException, + SdkClientException, JsonException { throw new UnsupportedOperationException(); } @@ -954,11 +1007,11 @@ default ReturnT streamingInputOutputOperation( * The service documentation for the request content is as follows 'This be a stream' * @param responseTransformer * Functional interface for processing the streamed response content. The unmarshalled - * StreamingInputOutputOperationResponse and an InputStream to the response content are provided as parameters - * to the callback. The callback may return a transformed type which will be the return value of this method. - * See {@link software.amazon.awssdk.core.sync.ResponseTransformer} for details on implementing this - * interface and for links to pre-canned implementations for common scenarios like downloading to a file. The - * service documentation for the response content is as follows 'This be a stream'. + * StreamingInputOutputOperationResponse and an InputStream to the response content are provided as + * parameters to the callback. The callback may return a transformed type which will be the return value of + * this method. See {@link software.amazon.awssdk.core.sync.ResponseTransformer} for details on implementing + * this interface and for links to pre-canned implementations for common scenarios like downloading to a + * file. The service documentation for the response content is as follows 'This be a stream'. * @return The transformed result of the ResponseTransformer. * @throws SdkException * Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for @@ -972,12 +1025,12 @@ default ReturnT streamingInputOutputOperation( * target="_top">AWS API Documentation */ default ReturnT streamingInputOutputOperation( - Consumer streamingInputOutputOperationRequest, RequestBody requestBody, - ResponseTransformer responseTransformer) throws AwsServiceException, - SdkClientException, JsonException { + Consumer streamingInputOutputOperationRequest, RequestBody requestBody, + ResponseTransformer responseTransformer) throws AwsServiceException, + SdkClientException, JsonException { return streamingInputOutputOperation( - StreamingInputOutputOperationRequest.builder().applyMutation(streamingInputOutputOperationRequest).build(), - requestBody, responseTransformer); + StreamingInputOutputOperationRequest.builder().applyMutation(streamingInputOutputOperationRequest).build(), + requestBody, responseTransformer); } /** @@ -1008,8 +1061,8 @@ default ReturnT streamingInputOutputOperation( * target="_top">AWS API Documentation */ default StreamingInputOutputOperationResponse streamingInputOutputOperation( - StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, Path sourcePath, Path destinationPath) - throws AwsServiceException, SdkClientException, JsonException { + StreamingInputOutputOperationRequest streamingInputOutputOperationRequest, Path sourcePath, Path destinationPath) + throws AwsServiceException, SdkClientException, JsonException { return streamingInputOutputOperation(streamingInputOutputOperationRequest, RequestBody.fromFile(sourcePath), ResponseTransformer.toFile(destinationPath)); } @@ -1048,11 +1101,11 @@ default StreamingInputOutputOperationResponse streamingInputOutputOperation( * target="_top">AWS API Documentation */ default StreamingInputOutputOperationResponse streamingInputOutputOperation( - Consumer streamingInputOutputOperationRequest, Path sourcePath, - Path destinationPath) throws AwsServiceException, SdkClientException, JsonException { + Consumer streamingInputOutputOperationRequest, Path sourcePath, + Path destinationPath) throws AwsServiceException, SdkClientException, JsonException { return streamingInputOutputOperation( - StreamingInputOutputOperationRequest.builder().applyMutation(streamingInputOutputOperationRequest).build(), - sourcePath, destinationPath); + StreamingInputOutputOperationRequest.builder().applyMutation(streamingInputOutputOperationRequest).build(), + sourcePath, destinationPath); } /** @@ -1061,8 +1114,8 @@ default StreamingInputOutputOperationResponse streamingInputOutputOperation( * @param streamingOutputOperationRequest * @param responseTransformer * Functional interface for processing the streamed response content. The unmarshalled - * StreamingOutputOperationResponse and an InputStream to the response content are provided as parameters - * to the callback. The callback may return a transformed type which will be the return value of this method. + * StreamingOutputOperationResponse and an InputStream to the response content are provided as parameters to + * the callback. The callback may return a transformed type which will be the return value of this method. * See {@link software.amazon.awssdk.core.sync.ResponseTransformer} for details on implementing this * interface and for links to pre-canned implementations for common scenarios like downloading to a file. The * service documentation for the response content is as follows 'This be a stream'. @@ -1096,8 +1149,8 @@ default ReturnT streamingOutputOperation(StreamingOutputOperationReque * request. * @param responseTransformer * Functional interface for processing the streamed response content. The unmarshalled - * StreamingOutputOperationResponse and an InputStream to the response content are provided as parameters - * to the callback. The callback may return a transformed type which will be the return value of this method. + * StreamingOutputOperationResponse and an InputStream to the response content are provided as parameters to + * the callback. The callback may return a transformed type which will be the return value of this method. * See {@link software.amazon.awssdk.core.sync.ResponseTransformer} for details on implementing this * interface and for links to pre-canned implementations for common scenarios like downloading to a file. The * service documentation for the response content is as follows 'This be a stream'. @@ -1114,9 +1167,9 @@ default ReturnT streamingOutputOperation(StreamingOutputOperationReque * target="_top">AWS API Documentation */ default ReturnT streamingOutputOperation( - Consumer streamingOutputOperationRequest, - ResponseTransformer responseTransformer) throws AwsServiceException, - SdkClientException, JsonException { + Consumer streamingOutputOperationRequest, + ResponseTransformer responseTransformer) throws AwsServiceException, + SdkClientException, JsonException { return streamingOutputOperation(StreamingOutputOperationRequest.builder().applyMutation(streamingOutputOperationRequest) .build(), responseTransformer); } @@ -1143,8 +1196,8 @@ default ReturnT streamingOutputOperation( * target="_top">AWS API Documentation */ default StreamingOutputOperationResponse streamingOutputOperation( - StreamingOutputOperationRequest streamingOutputOperationRequest, Path destinationPath) throws AwsServiceException, - SdkClientException, JsonException { + StreamingOutputOperationRequest streamingOutputOperationRequest, Path destinationPath) throws AwsServiceException, + SdkClientException, JsonException { return streamingOutputOperation(streamingOutputOperationRequest, ResponseTransformer.toFile(destinationPath)); } @@ -1176,8 +1229,8 @@ default StreamingOutputOperationResponse streamingOutputOperation( * target="_top">AWS API Documentation */ default StreamingOutputOperationResponse streamingOutputOperation( - Consumer streamingOutputOperationRequest, Path destinationPath) - throws AwsServiceException, SdkClientException, JsonException { + Consumer streamingOutputOperationRequest, Path destinationPath) + throws AwsServiceException, SdkClientException, JsonException { return streamingOutputOperation(StreamingOutputOperationRequest.builder().applyMutation(streamingOutputOperationRequest) .build(), destinationPath); } @@ -1205,8 +1258,8 @@ default StreamingOutputOperationResponse streamingOutputOperation( * target="_top">AWS API Documentation */ default ResponseInputStream streamingOutputOperation( - StreamingOutputOperationRequest streamingOutputOperationRequest) throws AwsServiceException, SdkClientException, - JsonException { + StreamingOutputOperationRequest streamingOutputOperationRequest) throws AwsServiceException, SdkClientException, + JsonException { return streamingOutputOperation(streamingOutputOperationRequest, ResponseTransformer.toInputStream()); } @@ -1239,8 +1292,8 @@ default ResponseInputStream
+ * This is a convenience which creates an instance of the {@link OperationWithChecksumRequiredRequest.Builder} + * avoiding the need to create one manually via {@link OperationWithChecksumRequiredRequest#builder()} + *