Skip to content

Commit 7f8420a

Browse files
authored
chore(private): set schema serde mode for duplicated protocol tests (#7309)
* chore(private): set schema serde mode for duplicated protocol tests * chore: increase jvm memory
1 parent b0f9107 commit 7f8420a

File tree

28 files changed

+727
-863
lines changed

28 files changed

+727
-863
lines changed

codegen/gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
smithyVersion=1.61.0
22
smithyGradleVersion=1.2.0
3-
smithyPluginVersion=0.6.0
3+
smithyPluginVersion=0.6.0
4+
org.gradle.jvmargs=-Xmx4096M

codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddProtocolConfig.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ public AddProtocolConfig() {
4646
// protocol tests
4747
SchemaGenerationAllowlist.allow("aws.protocoltests.json10#JsonRpc10");
4848
SchemaGenerationAllowlist.allow("aws.protocoltests.json#JsonProtocol");
49+
SchemaGenerationAllowlist.allow("com.amazonaws.machinelearning#AmazonML_20141212");
4950
SchemaGenerationAllowlist.allow("aws.protocoltests.restjson#RestJson");
51+
SchemaGenerationAllowlist.allow("com.amazonaws.glacier#Glacier");
52+
SchemaGenerationAllowlist.allow("com.amazonaws.apigateway#BackplaneControlService");
5053
SchemaGenerationAllowlist.allow("aws.protocoltests.restxml#RestXml");
5154
SchemaGenerationAllowlist.allow("aws.protocoltests.query#AwsQuery");
5255
SchemaGenerationAllowlist.allow("aws.protocoltests.ec2#AwsEc2");

private/aws-protocoltests-json-schema-machinelearning/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@
5656
"@smithy/util-middleware": "^4.0.5",
5757
"@smithy/util-retry": "^4.0.7",
5858
"@smithy/util-utf8": "^4.0.0",
59-
"@types/uuid": "^9.0.1",
60-
"tslib": "^2.6.2",
61-
"uuid": "^9.0.1"
59+
"tslib": "^2.6.2"
6260
},
6361
"devDependencies": {
6462
"@tsconfig/node18": "18.2.4",

private/aws-protocoltests-json-schema-machinelearning/src/MachineLearningClient.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
getHttpAuthSchemeEndpointRuleSetPlugin,
2525
getHttpSigningPlugin,
2626
} from "@smithy/core";
27+
import { getSchemaSerdePlugin } from "@smithy/core/schema";
2728
import { getContentLengthPlugin } from "@smithy/middleware-content-length";
2829
import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@smithy/middleware-endpoint";
2930
import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry";
@@ -39,11 +40,14 @@ import {
3940
BodyLengthCalculator as __BodyLengthCalculator,
4041
CheckOptionalClientConfig as __CheckOptionalClientConfig,
4142
ChecksumConstructor as __ChecksumConstructor,
43+
ClientProtocol,
4244
Decoder as __Decoder,
4345
Encoder as __Encoder,
4446
EndpointV2 as __EndpointV2,
4547
HashConstructor as __HashConstructor,
4648
HttpHandlerOptions as __HttpHandlerOptions,
49+
HttpRequest,
50+
HttpResponse,
4751
Logger as __Logger,
4852
Provider as __Provider,
4953
Provider,
@@ -225,6 +229,16 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
225229
*/
226230
extensions?: RuntimeExtension[];
227231

232+
/**
233+
* The protocol controlling the message type (e.g. HTTP) and format (e.g. JSON)
234+
* may be overridden. A default will always be set by the client.
235+
* Available options depend on the service's supported protocols and will not be validated by
236+
* the client.
237+
* @alpha
238+
*
239+
*/
240+
protocol?: ClientProtocol<HttpRequest, HttpResponse>;
241+
228242
/**
229243
* The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK.
230244
*/
@@ -300,6 +314,7 @@ export class MachineLearningClient extends __Client<
300314
const _config_8 = resolveHttpAuthSchemeConfig(_config_7);
301315
const _config_9 = resolveRuntimeExtensions(_config_8, configuration?.extensions || []);
302316
this.config = _config_9;
317+
this.middlewareStack.use(getSchemaSerdePlugin(this.config));
303318
this.middlewareStack.use(getUserAgentPlugin(this.config));
304319
this.middlewareStack.use(getRetryPlugin(this.config));
305320
this.middlewareStack.use(getContentLengthPlugin(this.config));

private/aws-protocoltests-json-schema-machinelearning/src/commands/PredictCommand.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
// smithy-typescript generated code
22
import { getPredictEndpointPlugin } from "@aws-sdk/middleware-sdk-machinelearning";
33
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
4-
import { getSerdePlugin } from "@smithy/middleware-serde";
54
import { Command as $Command } from "@smithy/smithy-client";
65
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
76

87
import { commonParams } from "../endpoint/EndpointParameters";
98
import { MachineLearningClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MachineLearningClient";
109
import { PredictInput, PredictOutput } from "../models/models_0";
11-
import { de_PredictCommand, se_PredictCommand } from "../protocols/Aws_json1_1";
10+
import { Predict } from "../schemas/schemas_1_Predict";
1211

1312
/**
1413
* @public
@@ -92,17 +91,11 @@ export class PredictCommand extends $Command
9291
>()
9392
.ep(commonParams)
9493
.m(function (this: any, Command: any, cs: any, config: MachineLearningClientResolvedConfig, o: any) {
95-
return [
96-
getSerdePlugin(config, this.serialize, this.deserialize),
97-
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
98-
getPredictEndpointPlugin(config),
99-
];
94+
return [getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getPredictEndpointPlugin(config)];
10095
})
10196
.s("AmazonML_20141212", "Predict", {})
10297
.n("MachineLearningClient", "PredictCommand")
103-
.f(void 0, void 0)
104-
.ser(se_PredictCommand)
105-
.de(de_PredictCommand)
98+
.sc(Predict)
10699
.build() {
107100
/** @internal type navigation helper, not in runtime. */
108101
protected declare static __types: {

private/aws-protocoltests-json-schema-machinelearning/src/protocols/Aws_json1_1.ts

Lines changed: 0 additions & 274 deletions
This file was deleted.

0 commit comments

Comments
 (0)