;
+ testPostNoPayload(
+ args: TestPostNoPayloadCommandInput,
+ cb: (err: any, data?: TestPostNoPayloadCommandOutput) => void
+ ): void;
+ testPostNoPayload(
+ args: TestPostNoPayloadCommandInput,
+ options: __HttpHandlerOptions,
+ cb: (err: any, data?: TestPostNoPayloadCommandOutput) => void
+ ): void;
+
/**
* @see {@link TimestampFormatHeadersCommand}
*/
diff --git a/private/aws-protocoltests-restjson/src/RestJsonProtocolClient.ts b/private/aws-protocoltests-restjson/src/RestJsonProtocolClient.ts
index 85ed6fbe66699..15156c4f0f023 100644
--- a/private/aws-protocoltests-restjson/src/RestJsonProtocolClient.ts
+++ b/private/aws-protocoltests-restjson/src/RestJsonProtocolClient.ts
@@ -320,15 +320,20 @@ import {
} from "./commands/StreamingTraitsWithMediaTypeCommand";
import { TestBodyStructureCommandInput, TestBodyStructureCommandOutput } from "./commands/TestBodyStructureCommand";
import {
- TestNoInputNoPayloadCommandInput,
- TestNoInputNoPayloadCommandOutput,
-} from "./commands/TestNoInputNoPayloadCommand";
-import { TestNoPayloadCommandInput, TestNoPayloadCommandOutput } from "./commands/TestNoPayloadCommand";
+ TestGetNoInputNoPayloadCommandInput,
+ TestGetNoInputNoPayloadCommandOutput,
+} from "./commands/TestGetNoInputNoPayloadCommand";
+import { TestGetNoPayloadCommandInput, TestGetNoPayloadCommandOutput } from "./commands/TestGetNoPayloadCommand";
import { TestPayloadBlobCommandInput, TestPayloadBlobCommandOutput } from "./commands/TestPayloadBlobCommand";
import {
TestPayloadStructureCommandInput,
TestPayloadStructureCommandOutput,
} from "./commands/TestPayloadStructureCommand";
+import {
+ TestPostNoInputNoPayloadCommandInput,
+ TestPostNoInputNoPayloadCommandOutput,
+} from "./commands/TestPostNoInputNoPayloadCommand";
+import { TestPostNoPayloadCommandInput, TestPostNoPayloadCommandOutput } from "./commands/TestPostNoPayloadCommand";
import {
TimestampFormatHeadersCommandInput,
TimestampFormatHeadersCommandOutput,
@@ -436,10 +441,12 @@ export type ServiceInputTypes =
| StreamingTraitsRequireLengthCommandInput
| StreamingTraitsWithMediaTypeCommandInput
| TestBodyStructureCommandInput
- | TestNoInputNoPayloadCommandInput
- | TestNoPayloadCommandInput
+ | TestGetNoInputNoPayloadCommandInput
+ | TestGetNoPayloadCommandInput
| TestPayloadBlobCommandInput
| TestPayloadStructureCommandInput
+ | TestPostNoInputNoPayloadCommandInput
+ | TestPostNoPayloadCommandInput
| TimestampFormatHeadersCommandInput
| UnitInputAndOutputCommandInput;
@@ -540,10 +547,12 @@ export type ServiceOutputTypes =
| StreamingTraitsRequireLengthCommandOutput
| StreamingTraitsWithMediaTypeCommandOutput
| TestBodyStructureCommandOutput
- | TestNoInputNoPayloadCommandOutput
- | TestNoPayloadCommandOutput
+ | TestGetNoInputNoPayloadCommandOutput
+ | TestGetNoPayloadCommandOutput
| TestPayloadBlobCommandOutput
| TestPayloadStructureCommandOutput
+ | TestPostNoInputNoPayloadCommandOutput
+ | TestPostNoPayloadCommandOutput
| TimestampFormatHeadersCommandOutput
| UnitInputAndOutputCommandOutput;
diff --git a/private/aws-protocoltests-restjson/src/commands/SparseJsonListsCommand.ts b/private/aws-protocoltests-restjson/src/commands/SparseJsonListsCommand.ts
index efe1d17e8968d..c574909d41d4b 100644
--- a/private/aws-protocoltests-restjson/src/commands/SparseJsonListsCommand.ts
+++ b/private/aws-protocoltests-restjson/src/commands/SparseJsonListsCommand.ts
@@ -38,6 +38,9 @@ export interface SparseJsonListsCommandOutput extends SparseJsonListsInputOutput
* sparseStringList: [ // SparseStringList
* "STRING_VALUE",
* ],
+ * sparseShortList: [ // SparseShortList
+ * Number("short"),
+ * ],
* };
* const command = new SparseJsonListsCommand(input);
* const response = await client.send(command);
@@ -45,6 +48,9 @@ export interface SparseJsonListsCommandOutput extends SparseJsonListsInputOutput
* // sparseStringList: [ // SparseStringList
* // "STRING_VALUE",
* // ],
+ * // sparseShortList: [ // SparseShortList
+ * // Number("short"),
+ * // ],
* // };
*
* ```
diff --git a/private/aws-protocoltests-restjson/src/commands/TestNoInputNoPayloadCommand.ts b/private/aws-protocoltests-restjson/src/commands/TestGetNoInputNoPayloadCommand.ts
similarity index 53%
rename from private/aws-protocoltests-restjson/src/commands/TestNoInputNoPayloadCommand.ts
rename to private/aws-protocoltests-restjson/src/commands/TestGetNoInputNoPayloadCommand.ts
index 875ab08716d05..2035026b6edb2 100644
--- a/private/aws-protocoltests-restjson/src/commands/TestNoInputNoPayloadCommand.ts
+++ b/private/aws-protocoltests-restjson/src/commands/TestGetNoInputNoPayloadCommand.ts
@@ -4,7 +4,7 @@ import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
import { TestNoPayloadInputOutput } from "../models/models_0";
-import { de_TestNoInputNoPayloadCommand, se_TestNoInputNoPayloadCommand } from "../protocols/Aws_restJson1";
+import { de_TestGetNoInputNoPayloadCommand, se_TestGetNoInputNoPayloadCommand } from "../protocols/Aws_restJson1";
import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient";
/**
@@ -15,18 +15,18 @@ export { $Command };
/**
* @public
*
- * The input for {@link TestNoInputNoPayloadCommand}.
+ * The input for {@link TestGetNoInputNoPayloadCommand}.
*/
-export interface TestNoInputNoPayloadCommandInput {}
+export interface TestGetNoInputNoPayloadCommandInput {}
/**
* @public
*
- * The output of {@link TestNoInputNoPayloadCommand}.
+ * The output of {@link TestGetNoInputNoPayloadCommand}.
*/
-export interface TestNoInputNoPayloadCommandOutput extends TestNoPayloadInputOutput, __MetadataBearer {}
+export interface TestGetNoInputNoPayloadCommandOutput extends TestNoPayloadInputOutput, __MetadataBearer {}
/**
- * This example operation has no input and serializes a request without an HTTP body.
+ * This example GET operation has no input and serializes a request without a HTTP body.
*
* These tests are to ensure we do not attach a body or related headers
* (Content-Length, Content-Type) to operations that semantically
@@ -35,11 +35,11 @@ export interface TestNoInputNoPayloadCommandOutput extends TestNoPayloadInputOut
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
- * import { RestJsonProtocolClient, TestNoInputNoPayloadCommand } from "@aws-sdk/aws-protocoltests-restjson"; // ES Modules import
- * // const { RestJsonProtocolClient, TestNoInputNoPayloadCommand } = require("@aws-sdk/aws-protocoltests-restjson"); // CommonJS import
+ * import { RestJsonProtocolClient, TestGetNoInputNoPayloadCommand } from "@aws-sdk/aws-protocoltests-restjson"; // ES Modules import
+ * // const { RestJsonProtocolClient, TestGetNoInputNoPayloadCommand } = require("@aws-sdk/aws-protocoltests-restjson"); // CommonJS import
* const client = new RestJsonProtocolClient(config);
* const input = {};
- * const command = new TestNoInputNoPayloadCommand(input);
+ * const command = new TestGetNoInputNoPayloadCommand(input);
* const response = await client.send(command);
* // { // TestNoPayloadInputOutput
* // testId: "STRING_VALUE",
@@ -47,10 +47,10 @@ export interface TestNoInputNoPayloadCommandOutput extends TestNoPayloadInputOut
*
* ```
*
- * @param TestNoInputNoPayloadCommandInput - {@link TestNoInputNoPayloadCommandInput}
- * @returns {@link TestNoInputNoPayloadCommandOutput}
- * @see {@link TestNoInputNoPayloadCommandInput} for command's `input` shape.
- * @see {@link TestNoInputNoPayloadCommandOutput} for command's `response` shape.
+ * @param TestGetNoInputNoPayloadCommandInput - {@link TestGetNoInputNoPayloadCommandInput}
+ * @returns {@link TestGetNoInputNoPayloadCommandOutput}
+ * @see {@link TestGetNoInputNoPayloadCommandInput} for command's `input` shape.
+ * @see {@link TestGetNoInputNoPayloadCommandOutput} for command's `response` shape.
* @see {@link RestJsonProtocolClientResolvedConfig | config} for RestJsonProtocolClient's `config` shape.
*
* @throws {@link RestJsonProtocolServiceException}
@@ -58,10 +58,10 @@ export interface TestNoInputNoPayloadCommandOutput extends TestNoPayloadInputOut
*
* @public
*/
-export class TestNoInputNoPayloadCommand extends $Command
+export class TestGetNoInputNoPayloadCommand extends $Command
.classBuilder<
- TestNoInputNoPayloadCommandInput,
- TestNoInputNoPayloadCommandOutput,
+ TestGetNoInputNoPayloadCommandInput,
+ TestGetNoInputNoPayloadCommandOutput,
RestJsonProtocolClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
@@ -69,11 +69,11 @@ export class TestNoInputNoPayloadCommand extends $Command
.m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) {
return [getSerdePlugin(config, this.serialize, this.deserialize)];
})
- .s("RestJson", "TestNoInputNoPayload", {})
- .n("RestJsonProtocolClient", "TestNoInputNoPayloadCommand")
+ .s("RestJson", "TestGetNoInputNoPayload", {})
+ .n("RestJsonProtocolClient", "TestGetNoInputNoPayloadCommand")
.f(void 0, void 0)
- .ser(se_TestNoInputNoPayloadCommand)
- .de(de_TestNoInputNoPayloadCommand)
+ .ser(se_TestGetNoInputNoPayloadCommand)
+ .de(de_TestGetNoInputNoPayloadCommand)
.build() {
/** @internal type navigation helper, not in runtime. */
protected declare static __types: {
@@ -82,8 +82,8 @@ export class TestNoInputNoPayloadCommand extends $Command
output: TestNoPayloadInputOutput;
};
sdk: {
- input: TestNoInputNoPayloadCommandInput;
- output: TestNoInputNoPayloadCommandOutput;
+ input: TestGetNoInputNoPayloadCommandInput;
+ output: TestGetNoInputNoPayloadCommandOutput;
};
};
}
diff --git a/private/aws-protocoltests-restjson/src/commands/TestNoPayloadCommand.ts b/private/aws-protocoltests-restjson/src/commands/TestGetNoPayloadCommand.ts
similarity index 56%
rename from private/aws-protocoltests-restjson/src/commands/TestNoPayloadCommand.ts
rename to private/aws-protocoltests-restjson/src/commands/TestGetNoPayloadCommand.ts
index 7990e0449db42..c4be058e41692 100644
--- a/private/aws-protocoltests-restjson/src/commands/TestNoPayloadCommand.ts
+++ b/private/aws-protocoltests-restjson/src/commands/TestGetNoPayloadCommand.ts
@@ -4,7 +4,7 @@ import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
import { TestNoPayloadInputOutput } from "../models/models_0";
-import { de_TestNoPayloadCommand, se_TestNoPayloadCommand } from "../protocols/Aws_restJson1";
+import { de_TestGetNoPayloadCommand, se_TestGetNoPayloadCommand } from "../protocols/Aws_restJson1";
import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient";
/**
@@ -15,18 +15,18 @@ export { $Command };
/**
* @public
*
- * The input for {@link TestNoPayloadCommand}.
+ * The input for {@link TestGetNoPayloadCommand}.
*/
-export interface TestNoPayloadCommandInput extends TestNoPayloadInputOutput {}
+export interface TestGetNoPayloadCommandInput extends TestNoPayloadInputOutput {}
/**
* @public
*
- * The output of {@link TestNoPayloadCommand}.
+ * The output of {@link TestGetNoPayloadCommand}.
*/
-export interface TestNoPayloadCommandOutput extends TestNoPayloadInputOutput, __MetadataBearer {}
+export interface TestGetNoPayloadCommandOutput extends TestNoPayloadInputOutput, __MetadataBearer {}
/**
- * This example operation serializes a request without an HTTP body.
+ * This example GET operation serializes a request without a modeled HTTP body.
*
* These tests are to ensure we do not attach a body or related headers
* (Content-Length, Content-Type) to operations that semantically
@@ -35,13 +35,13 @@ export interface TestNoPayloadCommandOutput extends TestNoPayloadInputOutput, __
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
- * import { RestJsonProtocolClient, TestNoPayloadCommand } from "@aws-sdk/aws-protocoltests-restjson"; // ES Modules import
- * // const { RestJsonProtocolClient, TestNoPayloadCommand } = require("@aws-sdk/aws-protocoltests-restjson"); // CommonJS import
+ * import { RestJsonProtocolClient, TestGetNoPayloadCommand } from "@aws-sdk/aws-protocoltests-restjson"; // ES Modules import
+ * // const { RestJsonProtocolClient, TestGetNoPayloadCommand } = require("@aws-sdk/aws-protocoltests-restjson"); // CommonJS import
* const client = new RestJsonProtocolClient(config);
* const input = { // TestNoPayloadInputOutput
* testId: "STRING_VALUE",
* };
- * const command = new TestNoPayloadCommand(input);
+ * const command = new TestGetNoPayloadCommand(input);
* const response = await client.send(command);
* // { // TestNoPayloadInputOutput
* // testId: "STRING_VALUE",
@@ -49,10 +49,10 @@ export interface TestNoPayloadCommandOutput extends TestNoPayloadInputOutput, __
*
* ```
*
- * @param TestNoPayloadCommandInput - {@link TestNoPayloadCommandInput}
- * @returns {@link TestNoPayloadCommandOutput}
- * @see {@link TestNoPayloadCommandInput} for command's `input` shape.
- * @see {@link TestNoPayloadCommandOutput} for command's `response` shape.
+ * @param TestGetNoPayloadCommandInput - {@link TestGetNoPayloadCommandInput}
+ * @returns {@link TestGetNoPayloadCommandOutput}
+ * @see {@link TestGetNoPayloadCommandInput} for command's `input` shape.
+ * @see {@link TestGetNoPayloadCommandOutput} for command's `response` shape.
* @see {@link RestJsonProtocolClientResolvedConfig | config} for RestJsonProtocolClient's `config` shape.
*
* @throws {@link RestJsonProtocolServiceException}
@@ -60,10 +60,10 @@ export interface TestNoPayloadCommandOutput extends TestNoPayloadInputOutput, __
*
* @public
*/
-export class TestNoPayloadCommand extends $Command
+export class TestGetNoPayloadCommand extends $Command
.classBuilder<
- TestNoPayloadCommandInput,
- TestNoPayloadCommandOutput,
+ TestGetNoPayloadCommandInput,
+ TestGetNoPayloadCommandOutput,
RestJsonProtocolClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
@@ -71,11 +71,11 @@ export class TestNoPayloadCommand extends $Command
.m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) {
return [getSerdePlugin(config, this.serialize, this.deserialize)];
})
- .s("RestJson", "TestNoPayload", {})
- .n("RestJsonProtocolClient", "TestNoPayloadCommand")
+ .s("RestJson", "TestGetNoPayload", {})
+ .n("RestJsonProtocolClient", "TestGetNoPayloadCommand")
.f(void 0, void 0)
- .ser(se_TestNoPayloadCommand)
- .de(de_TestNoPayloadCommand)
+ .ser(se_TestGetNoPayloadCommand)
+ .de(de_TestGetNoPayloadCommand)
.build() {
/** @internal type navigation helper, not in runtime. */
protected declare static __types: {
@@ -84,8 +84,8 @@ export class TestNoPayloadCommand extends $Command
output: TestNoPayloadInputOutput;
};
sdk: {
- input: TestNoPayloadCommandInput;
- output: TestNoPayloadCommandOutput;
+ input: TestGetNoPayloadCommandInput;
+ output: TestGetNoPayloadCommandOutput;
};
};
}
diff --git a/private/aws-protocoltests-restjson/src/commands/TestPostNoInputNoPayloadCommand.ts b/private/aws-protocoltests-restjson/src/commands/TestPostNoInputNoPayloadCommand.ts
new file mode 100644
index 0000000000000..4150675574458
--- /dev/null
+++ b/private/aws-protocoltests-restjson/src/commands/TestPostNoInputNoPayloadCommand.ts
@@ -0,0 +1,88 @@
+// smithy-typescript generated code
+import { getSerdePlugin } from "@smithy/middleware-serde";
+import { Command as $Command } from "@smithy/smithy-client";
+import { MetadataBearer as __MetadataBearer } from "@smithy/types";
+
+import { TestNoPayloadInputOutput } from "../models/models_0";
+import { de_TestPostNoInputNoPayloadCommand, se_TestPostNoInputNoPayloadCommand } from "../protocols/Aws_restJson1";
+import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient";
+
+/**
+ * @public
+ */
+export type { __MetadataBearer };
+export { $Command };
+/**
+ * @public
+ *
+ * The input for {@link TestPostNoInputNoPayloadCommand}.
+ */
+export interface TestPostNoInputNoPayloadCommandInput {}
+/**
+ * @public
+ *
+ * The output of {@link TestPostNoInputNoPayloadCommand}.
+ */
+export interface TestPostNoInputNoPayloadCommandOutput extends TestNoPayloadInputOutput, __MetadataBearer {}
+
+/**
+ * This example POST operation has no input and serializes a request without a HTTP body.
+ *
+ * These tests are to ensure we do not attach a body or related headers
+ * (Content-Type) to a POST operation with no modeled input.
+ *
+ * @example
+ * Use a bare-bones client and the command you need to make an API call.
+ * ```javascript
+ * import { RestJsonProtocolClient, TestPostNoInputNoPayloadCommand } from "@aws-sdk/aws-protocoltests-restjson"; // ES Modules import
+ * // const { RestJsonProtocolClient, TestPostNoInputNoPayloadCommand } = require("@aws-sdk/aws-protocoltests-restjson"); // CommonJS import
+ * const client = new RestJsonProtocolClient(config);
+ * const input = {};
+ * const command = new TestPostNoInputNoPayloadCommand(input);
+ * const response = await client.send(command);
+ * // { // TestNoPayloadInputOutput
+ * // testId: "STRING_VALUE",
+ * // };
+ *
+ * ```
+ *
+ * @param TestPostNoInputNoPayloadCommandInput - {@link TestPostNoInputNoPayloadCommandInput}
+ * @returns {@link TestPostNoInputNoPayloadCommandOutput}
+ * @see {@link TestPostNoInputNoPayloadCommandInput} for command's `input` shape.
+ * @see {@link TestPostNoInputNoPayloadCommandOutput} for command's `response` shape.
+ * @see {@link RestJsonProtocolClientResolvedConfig | config} for RestJsonProtocolClient's `config` shape.
+ *
+ * @throws {@link RestJsonProtocolServiceException}
+ * Base exception class for all service exceptions from RestJsonProtocol service.
+ *
+ * @public
+ */
+export class TestPostNoInputNoPayloadCommand extends $Command
+ .classBuilder<
+ TestPostNoInputNoPayloadCommandInput,
+ TestPostNoInputNoPayloadCommandOutput,
+ RestJsonProtocolClientResolvedConfig,
+ ServiceInputTypes,
+ ServiceOutputTypes
+ >()
+ .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) {
+ return [getSerdePlugin(config, this.serialize, this.deserialize)];
+ })
+ .s("RestJson", "TestPostNoInputNoPayload", {})
+ .n("RestJsonProtocolClient", "TestPostNoInputNoPayloadCommand")
+ .f(void 0, void 0)
+ .ser(se_TestPostNoInputNoPayloadCommand)
+ .de(de_TestPostNoInputNoPayloadCommand)
+ .build() {
+ /** @internal type navigation helper, not in runtime. */
+ protected declare static __types: {
+ api: {
+ input: {};
+ output: TestNoPayloadInputOutput;
+ };
+ sdk: {
+ input: TestPostNoInputNoPayloadCommandInput;
+ output: TestPostNoInputNoPayloadCommandOutput;
+ };
+ };
+}
diff --git a/private/aws-protocoltests-restjson/src/commands/TestPostNoPayloadCommand.ts b/private/aws-protocoltests-restjson/src/commands/TestPostNoPayloadCommand.ts
new file mode 100644
index 0000000000000..d3315690a6199
--- /dev/null
+++ b/private/aws-protocoltests-restjson/src/commands/TestPostNoPayloadCommand.ts
@@ -0,0 +1,90 @@
+// smithy-typescript generated code
+import { getSerdePlugin } from "@smithy/middleware-serde";
+import { Command as $Command } from "@smithy/smithy-client";
+import { MetadataBearer as __MetadataBearer } from "@smithy/types";
+
+import { TestNoPayloadInputOutput } from "../models/models_0";
+import { de_TestPostNoPayloadCommand, se_TestPostNoPayloadCommand } from "../protocols/Aws_restJson1";
+import { RestJsonProtocolClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RestJsonProtocolClient";
+
+/**
+ * @public
+ */
+export type { __MetadataBearer };
+export { $Command };
+/**
+ * @public
+ *
+ * The input for {@link TestPostNoPayloadCommand}.
+ */
+export interface TestPostNoPayloadCommandInput extends TestNoPayloadInputOutput {}
+/**
+ * @public
+ *
+ * The output of {@link TestPostNoPayloadCommand}.
+ */
+export interface TestPostNoPayloadCommandOutput extends TestNoPayloadInputOutput, __MetadataBearer {}
+
+/**
+ * This example POST operation serializes a request without a modeled HTTP body.
+ *
+ * These tests are to ensure we do not attach a body or related headers
+ * (Content-Type) to a POST operation with no modeled payload.
+ *
+ * @example
+ * Use a bare-bones client and the command you need to make an API call.
+ * ```javascript
+ * import { RestJsonProtocolClient, TestPostNoPayloadCommand } from "@aws-sdk/aws-protocoltests-restjson"; // ES Modules import
+ * // const { RestJsonProtocolClient, TestPostNoPayloadCommand } = require("@aws-sdk/aws-protocoltests-restjson"); // CommonJS import
+ * const client = new RestJsonProtocolClient(config);
+ * const input = { // TestNoPayloadInputOutput
+ * testId: "STRING_VALUE",
+ * };
+ * const command = new TestPostNoPayloadCommand(input);
+ * const response = await client.send(command);
+ * // { // TestNoPayloadInputOutput
+ * // testId: "STRING_VALUE",
+ * // };
+ *
+ * ```
+ *
+ * @param TestPostNoPayloadCommandInput - {@link TestPostNoPayloadCommandInput}
+ * @returns {@link TestPostNoPayloadCommandOutput}
+ * @see {@link TestPostNoPayloadCommandInput} for command's `input` shape.
+ * @see {@link TestPostNoPayloadCommandOutput} for command's `response` shape.
+ * @see {@link RestJsonProtocolClientResolvedConfig | config} for RestJsonProtocolClient's `config` shape.
+ *
+ * @throws {@link RestJsonProtocolServiceException}
+ * Base exception class for all service exceptions from RestJsonProtocol service.
+ *
+ * @public
+ */
+export class TestPostNoPayloadCommand extends $Command
+ .classBuilder<
+ TestPostNoPayloadCommandInput,
+ TestPostNoPayloadCommandOutput,
+ RestJsonProtocolClientResolvedConfig,
+ ServiceInputTypes,
+ ServiceOutputTypes
+ >()
+ .m(function (this: any, Command: any, cs: any, config: RestJsonProtocolClientResolvedConfig, o: any) {
+ return [getSerdePlugin(config, this.serialize, this.deserialize)];
+ })
+ .s("RestJson", "TestPostNoPayload", {})
+ .n("RestJsonProtocolClient", "TestPostNoPayloadCommand")
+ .f(void 0, void 0)
+ .ser(se_TestPostNoPayloadCommand)
+ .de(de_TestPostNoPayloadCommand)
+ .build() {
+ /** @internal type navigation helper, not in runtime. */
+ protected declare static __types: {
+ api: {
+ input: TestNoPayloadInputOutput;
+ output: TestNoPayloadInputOutput;
+ };
+ sdk: {
+ input: TestPostNoPayloadCommandInput;
+ output: TestPostNoPayloadCommandOutput;
+ };
+ };
+}
diff --git a/private/aws-protocoltests-restjson/src/commands/index.ts b/private/aws-protocoltests-restjson/src/commands/index.ts
index e75203cd33117..f433279c386ab 100644
--- a/private/aws-protocoltests-restjson/src/commands/index.ts
+++ b/private/aws-protocoltests-restjson/src/commands/index.ts
@@ -92,9 +92,11 @@ export * from "./StreamingTraitsCommand";
export * from "./StreamingTraitsRequireLengthCommand";
export * from "./StreamingTraitsWithMediaTypeCommand";
export * from "./TestBodyStructureCommand";
-export * from "./TestNoInputNoPayloadCommand";
-export * from "./TestNoPayloadCommand";
+export * from "./TestGetNoInputNoPayloadCommand";
+export * from "./TestGetNoPayloadCommand";
export * from "./TestPayloadBlobCommand";
export * from "./TestPayloadStructureCommand";
+export * from "./TestPostNoInputNoPayloadCommand";
+export * from "./TestPostNoPayloadCommand";
export * from "./TimestampFormatHeadersCommand";
export * from "./UnitInputAndOutputCommand";
diff --git a/private/aws-protocoltests-restjson/src/models/models_0.ts b/private/aws-protocoltests-restjson/src/models/models_0.ts
index 83894c0aa7e46..a579ed5a01866 100644
--- a/private/aws-protocoltests-restjson/src/models/models_0.ts
+++ b/private/aws-protocoltests-restjson/src/models/models_0.ts
@@ -1414,6 +1414,7 @@ export interface SimpleScalarPropertiesInputOutput {
*/
export interface SparseJsonListsInputOutput {
sparseStringList?: string[];
+ sparseShortList?: number[];
}
/**
diff --git a/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts b/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts
index 62433667fff72..8f75204fa3f02 100644
--- a/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts
+++ b/private/aws-protocoltests-restjson/src/protocols/Aws_restJson1.ts
@@ -316,15 +316,20 @@ import {
} from "../commands/StreamingTraitsWithMediaTypeCommand";
import { TestBodyStructureCommandInput, TestBodyStructureCommandOutput } from "../commands/TestBodyStructureCommand";
import {
- TestNoInputNoPayloadCommandInput,
- TestNoInputNoPayloadCommandOutput,
-} from "../commands/TestNoInputNoPayloadCommand";
-import { TestNoPayloadCommandInput, TestNoPayloadCommandOutput } from "../commands/TestNoPayloadCommand";
+ TestGetNoInputNoPayloadCommandInput,
+ TestGetNoInputNoPayloadCommandOutput,
+} from "../commands/TestGetNoInputNoPayloadCommand";
+import { TestGetNoPayloadCommandInput, TestGetNoPayloadCommandOutput } from "../commands/TestGetNoPayloadCommand";
import { TestPayloadBlobCommandInput, TestPayloadBlobCommandOutput } from "../commands/TestPayloadBlobCommand";
import {
TestPayloadStructureCommandInput,
TestPayloadStructureCommandOutput,
} from "../commands/TestPayloadStructureCommand";
+import {
+ TestPostNoInputNoPayloadCommandInput,
+ TestPostNoInputNoPayloadCommandOutput,
+} from "../commands/TestPostNoInputNoPayloadCommand";
+import { TestPostNoPayloadCommandInput, TestPostNoPayloadCommandOutput } from "../commands/TestPostNoPayloadCommand";
import {
TimestampFormatHeadersCommandInput,
TimestampFormatHeadersCommandOutput,
@@ -2312,6 +2317,7 @@ export const se_SparseJsonListsCommand = async (
let body: any;
body = JSON.stringify(
take(input, {
+ sparseShortList: (_) => se_SparseShortList(_, context),
sparseStringList: (_) => se_SparseStringList(_, context),
})
);
@@ -2432,10 +2438,10 @@ export const se_TestBodyStructureCommand = async (
};
/**
- * serializeAws_restJson1TestNoInputNoPayloadCommand
+ * serializeAws_restJson1TestGetNoInputNoPayloadCommand
*/
-export const se_TestNoInputNoPayloadCommand = async (
- input: TestNoInputNoPayloadCommandInput,
+export const se_TestGetNoInputNoPayloadCommand = async (
+ input: TestGetNoInputNoPayloadCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> => {
const b = rb(input, context);
@@ -2447,10 +2453,10 @@ export const se_TestNoInputNoPayloadCommand = async (
};
/**
- * serializeAws_restJson1TestNoPayloadCommand
+ * serializeAws_restJson1TestGetNoPayloadCommand
*/
-export const se_TestNoPayloadCommand = async (
- input: TestNoPayloadCommandInput,
+export const se_TestGetNoPayloadCommand = async (
+ input: TestGetNoPayloadCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> => {
const b = rb(input, context);
@@ -2508,6 +2514,38 @@ export const se_TestPayloadStructureCommand = async (
return b.build();
};
+/**
+ * serializeAws_restJson1TestPostNoInputNoPayloadCommand
+ */
+export const se_TestPostNoInputNoPayloadCommand = async (
+ input: TestPostNoInputNoPayloadCommandInput,
+ context: __SerdeContext
+): Promise<__HttpRequest> => {
+ const b = rb(input, context);
+ const headers: any = {};
+ b.bp("/no_input_no_payload");
+ let body: any;
+ b.m("POST").h(headers).b(body);
+ return b.build();
+};
+
+/**
+ * serializeAws_restJson1TestPostNoPayloadCommand
+ */
+export const se_TestPostNoPayloadCommand = async (
+ input: TestPostNoPayloadCommandInput,
+ context: __SerdeContext
+): Promise<__HttpRequest> => {
+ const b = rb(input, context);
+ const headers: any = map({}, isSerializableHeaderValue, {
+ [_xati]: input[_tI]!,
+ });
+ b.bp("/no_payload");
+ let body: any;
+ b.m("POST").h(headers).b(body);
+ return b.build();
+};
+
/**
* serializeAws_restJson1TimestampFormatHeadersCommand
*/
@@ -4282,6 +4320,7 @@ export const de_SparseJsonListsCommand = async (
});
const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
const doc = take(data, {
+ sparseShortList: (_) => de_SparseShortList(_, context),
sparseStringList: (_) => de_SparseStringList(_, context),
});
Object.assign(contents, doc);
@@ -4393,12 +4432,12 @@ export const de_TestBodyStructureCommand = async (
};
/**
- * deserializeAws_restJson1TestNoInputNoPayloadCommand
+ * deserializeAws_restJson1TestGetNoInputNoPayloadCommand
*/
-export const de_TestNoInputNoPayloadCommand = async (
+export const de_TestGetNoInputNoPayloadCommand = async (
output: __HttpResponse,
context: __SerdeContext
-): Promise => {
+): Promise => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
@@ -4411,12 +4450,12 @@ export const de_TestNoInputNoPayloadCommand = async (
};
/**
- * deserializeAws_restJson1TestNoPayloadCommand
+ * deserializeAws_restJson1TestGetNoPayloadCommand
*/
-export const de_TestNoPayloadCommand = async (
+export const de_TestGetNoPayloadCommand = async (
output: __HttpResponse,
context: __SerdeContext
-): Promise => {
+): Promise => {
if (output.statusCode !== 200 && output.statusCode >= 300) {
return de_CommandError(output, context);
}
@@ -4466,6 +4505,42 @@ export const de_TestPayloadStructureCommand = async (
return contents;
};
+/**
+ * deserializeAws_restJson1TestPostNoInputNoPayloadCommand
+ */
+export const de_TestPostNoInputNoPayloadCommand = async (
+ output: __HttpResponse,
+ context: __SerdeContext
+): Promise => {
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
+ return de_CommandError(output, context);
+ }
+ const contents: any = map({
+ $metadata: deserializeMetadata(output),
+ [_tI]: [, output.headers[_xati]],
+ });
+ await collectBody(output.body, context);
+ return contents;
+};
+
+/**
+ * deserializeAws_restJson1TestPostNoPayloadCommand
+ */
+export const de_TestPostNoPayloadCommand = async (
+ output: __HttpResponse,
+ context: __SerdeContext
+): Promise => {
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
+ return de_CommandError(output, context);
+ }
+ const contents: any = map({
+ $metadata: deserializeMetadata(output),
+ [_tI]: [, output.headers[_xati]],
+ });
+ await collectBody(output.body, context);
+ return contents;
+};
+
/**
* deserializeAws_restJson1TimestampFormatHeadersCommand
*/
@@ -4855,6 +4930,13 @@ const se_UnionWithJsonName = (input: UnionWithJsonName, context: __SerdeContext)
// se_NestedStringList omitted.
+/**
+ * serializeAws_restJson1SparseShortList
+ */
+const se_SparseShortList = (input: number[], context: __SerdeContext): any => {
+ return input;
+};
+
/**
* serializeAws_restJson1SparseStringList
*/
@@ -5147,6 +5229,19 @@ const de_UnionWithJsonName = (output: any, context: __SerdeContext): UnionWithJs
// de_NestedStringList omitted.
+/**
+ * deserializeAws_restJson1SparseShortList
+ */
+const de_SparseShortList = (output: any, context: __SerdeContext): number[] => {
+ const retVal = (output || []).map((entry: any) => {
+ if (entry === null) {
+ return null as any;
+ }
+ return __expectShort(entry) as any;
+ });
+ return retVal;
+};
+
/**
* deserializeAws_restJson1SparseStringList
*/
diff --git a/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts b/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts
index c00123f13e9e0..5deab5de6b28d 100644
--- a/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts
+++ b/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts
@@ -64,10 +64,12 @@ import { StreamingTraitsCommand } from "../../src/commands/StreamingTraitsComman
import { StreamingTraitsRequireLengthCommand } from "../../src/commands/StreamingTraitsRequireLengthCommand";
import { StreamingTraitsWithMediaTypeCommand } from "../../src/commands/StreamingTraitsWithMediaTypeCommand";
import { TestBodyStructureCommand } from "../../src/commands/TestBodyStructureCommand";
-import { TestNoInputNoPayloadCommand } from "../../src/commands/TestNoInputNoPayloadCommand";
-import { TestNoPayloadCommand } from "../../src/commands/TestNoPayloadCommand";
+import { TestGetNoInputNoPayloadCommand } from "../../src/commands/TestGetNoInputNoPayloadCommand";
+import { TestGetNoPayloadCommand } from "../../src/commands/TestGetNoPayloadCommand";
import { TestPayloadBlobCommand } from "../../src/commands/TestPayloadBlobCommand";
import { TestPayloadStructureCommand } from "../../src/commands/TestPayloadStructureCommand";
+import { TestPostNoInputNoPayloadCommand } from "../../src/commands/TestPostNoInputNoPayloadCommand";
+import { TestPostNoPayloadCommand } from "../../src/commands/TestPostNoPayloadCommand";
import { TimestampFormatHeadersCommand } from "../../src/commands/TimestampFormatHeadersCommand";
import { UnitInputAndOutputCommand } from "../../src/commands/UnitInputAndOutputCommand";
import { RestJsonProtocolClient } from "../../src/RestJsonProtocolClient";
@@ -6717,7 +6719,7 @@ it("RestJsonNoInputAndOutputNoPayload:Response", async () => {
});
/**
- * Do not send null values, empty strings, or empty lists over the wire in headers
+ * Do not send null values, but do send empty strings and empty lists over the wire in headers
*/
it.skip("RestJsonNullAndEmptyHeaders:Request", async () => {
const client = new RestJsonProtocolClient({
@@ -6744,8 +6746,11 @@ it.skip("RestJsonNullAndEmptyHeaders:Request", async () => {
expect(r.path).toBe("/NullAndEmptyHeadersClient");
expect(r.headers["x-a"]).toBeUndefined();
- expect(r.headers["x-b"]).toBeUndefined();
- expect(r.headers["x-c"]).toBeUndefined();
+
+ expect(r.headers["x-b"]).toBeDefined();
+ expect(r.headers["x-b"]).toBe("");
+ expect(r.headers["x-c"]).toBeDefined();
+ expect(r.headers["x-c"]).toBe("");
expect(!r.body || r.body === `{}`).toBeTruthy();
}
@@ -7258,7 +7263,7 @@ it.skip("RestJsonClientIgnoresDefaultValuesIfMemberValuesArePresentInResponse:Re
defaultDocumentBoolean: false,
defaultDocumentList: ["b"],
defaultNullDocument: "notNull",
- defaultTimestamp: new Date(1 * 1000),
+ defaultTimestamp: new Date(2 * 1000),
defaultBlob: Uint8Array.from("hi", (c) => c.charCodeAt(0)),
defaultByte: 2,
defaultShort: 2,
@@ -8613,6 +8618,7 @@ it("RestJsonSparseListsSerializeNull:Request", async () => {
const command = new SparseJsonListsCommand({
sparseStringList: [null, "hi"],
+ sparseShortList: [null, 2],
} as any);
try {
await client.send(command);
@@ -8636,6 +8642,10 @@ it("RestJsonSparseListsSerializeNull:Request", async () => {
\"sparseStringList\": [
null,
\"hi\"
+ ],
+ \"sparseShortList\": [
+ null,
+ 2
]
}`;
const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString());
@@ -8659,6 +8669,10 @@ it("RestJsonSparseListsSerializeNull:Response", async () => {
"sparseStringList": [
null,
"hi"
+ ],
+ "sparseShortList": [
+ null,
+ 2
]
}`
),
@@ -8678,6 +8692,7 @@ it("RestJsonSparseListsSerializeNull:Response", async () => {
const paramsToValidate: any = [
{
sparseStringList: [null, "hi"],
+ sparseShortList: [null, 2],
},
][0];
Object.keys(paramsToValidate).forEach((param) => {
@@ -9590,13 +9605,13 @@ it("RestJsonHttpWithEmptyBody:Request", async () => {
/**
* Serializes a GET request for an operation with no input, and therefore no modeled body
*/
-it("RestJsonHttpWithNoInput:Request", async () => {
+it("RestJsonHttpGetWithNoInput:Request", async () => {
const client = new RestJsonProtocolClient({
...clientParams,
requestHandler: new RequestSerializationTestHandler(),
});
- const command = new TestNoInputNoPayloadCommand({});
+ const command = new TestGetNoInputNoPayloadCommand({});
try {
await client.send(command);
fail("Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown");
@@ -9610,8 +9625,8 @@ it("RestJsonHttpWithNoInput:Request", async () => {
expect(r.method).toBe("GET");
expect(r.path).toBe("/no_input_no_payload");
- expect(r.headers["content-length"]).toBeUndefined();
expect(r.headers["content-type"]).toBeUndefined();
+ expect(r.headers["content-length"]).toBeUndefined();
expect(!r.body || r.body === `{}`).toBeTruthy();
}
@@ -9620,13 +9635,13 @@ it("RestJsonHttpWithNoInput:Request", async () => {
/**
* Serializes a GET request with no modeled body
*/
-it("RestJsonHttpWithNoModeledBody:Request", async () => {
+it("RestJsonHttpGetWithNoModeledBody:Request", async () => {
const client = new RestJsonProtocolClient({
...clientParams,
requestHandler: new RequestSerializationTestHandler(),
});
- const command = new TestNoPayloadCommand({} as any);
+ const command = new TestGetNoPayloadCommand({} as any);
try {
await client.send(command);
fail("Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown");
@@ -9650,13 +9665,13 @@ it("RestJsonHttpWithNoModeledBody:Request", async () => {
/**
* Serializes a GET request with header member but no modeled body
*/
-it("RestJsonHttpWithHeaderMemberNoModeledBody:Request", async () => {
+it("RestJsonHttpGetWithHeaderMemberNoModeledBody:Request", async () => {
const client = new RestJsonProtocolClient({
...clientParams,
requestHandler: new RequestSerializationTestHandler(),
});
- const command = new TestNoPayloadCommand({
+ const command = new TestGetNoPayloadCommand({
testId: "t-12345",
} as any);
try {
@@ -9705,9 +9720,6 @@ it("RestJsonHttpWithEmptyBlobPayload:Request", async () => {
expect(r.method).toBe("POST");
expect(r.path).toBe("/blob_payload");
- expect(r.headers["content-type"]).toBeDefined();
- expect(r.headers["content-type"]).toBe("application/octet-stream");
-
expect(!r.body || r.body === `{}`).toBeTruthy();
}
});
@@ -9864,6 +9876,98 @@ it("RestJsonHttpWithHeadersButNoPayload:Request", async () => {
}
});
+/**
+ * Serializes a POST request for an operation with no input, and therefore no modeled body
+ */
+it("RestJsonHttpPostWithNoInput:Request", async () => {
+ const client = new RestJsonProtocolClient({
+ ...clientParams,
+ requestHandler: new RequestSerializationTestHandler(),
+ });
+
+ const command = new TestPostNoInputNoPayloadCommand({});
+ try {
+ await client.send(command);
+ fail("Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown");
+ return;
+ } catch (err) {
+ if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {
+ fail(err);
+ return;
+ }
+ const r = err.request;
+ expect(r.method).toBe("POST");
+ expect(r.path).toBe("/no_input_no_payload");
+
+ expect(r.headers["content-type"]).toBeUndefined();
+
+ expect(!r.body || r.body === `{}`).toBeTruthy();
+ }
+});
+
+/**
+ * Serializes a POST request with no modeled body
+ */
+it("RestJsonHttpPostWithNoModeledBody:Request", async () => {
+ const client = new RestJsonProtocolClient({
+ ...clientParams,
+ requestHandler: new RequestSerializationTestHandler(),
+ });
+
+ const command = new TestPostNoPayloadCommand({} as any);
+ try {
+ await client.send(command);
+ fail("Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown");
+ return;
+ } catch (err) {
+ if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {
+ fail(err);
+ return;
+ }
+ const r = err.request;
+ expect(r.method).toBe("POST");
+ expect(r.path).toBe("/no_payload");
+
+ expect(r.headers["content-type"]).toBeUndefined();
+
+ expect(!r.body || r.body === `{}`).toBeTruthy();
+ }
+});
+
+/**
+ * Serializes a POST request with header member but no modeled body
+ */
+it("RestJsonHttpWithPostHeaderMemberNoModeledBody:Request", async () => {
+ const client = new RestJsonProtocolClient({
+ ...clientParams,
+ requestHandler: new RequestSerializationTestHandler(),
+ });
+
+ const command = new TestPostNoPayloadCommand({
+ testId: "t-12345",
+ } as any);
+ try {
+ await client.send(command);
+ fail("Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown");
+ return;
+ } catch (err) {
+ if (!(err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR)) {
+ fail(err);
+ return;
+ }
+ const r = err.request;
+ expect(r.method).toBe("POST");
+ expect(r.path).toBe("/no_payload");
+
+ expect(r.headers["content-type"]).toBeUndefined();
+
+ expect(r.headers["x-amz-test-id"]).toBeDefined();
+ expect(r.headers["x-amz-test-id"]).toBe("t-12345");
+
+ expect(!r.body || r.body === `{}`).toBeTruthy();
+ }
+});
+
/**
* Tests how timestamp request headers are serialized
*/
diff --git a/private/aws-protocoltests-restxml/README.md b/private/aws-protocoltests-restxml/README.md
index c72a51ce7389a..897b4eec89a6e 100644
--- a/private/aws-protocoltests-restxml/README.md
+++ b/private/aws-protocoltests-restxml/README.md
@@ -1709,18 +1709,18 @@ TestBodyStructure