Skip to content

Commit 3a6afdf

Browse files
committed
feat(serde): use type mapping to describe stream mixin
1 parent afcdb61 commit 3a6afdf

File tree

22 files changed

+82
-231
lines changed

22 files changed

+82
-231
lines changed

clients/client-backupstorage/src/commands/GetChunkCommand.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
SdkStream as __SdkStream,
1313
SdkStreamSerdeContext as __SdkStreamSerdeContext,
1414
SerdeContext as __SerdeContext,
15+
WithSdkStreamMixin as __WithSdkStreamMixin,
1516
} from "@aws-sdk/types";
1617

1718
import { BackupStorageClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BackupStorageClient";
@@ -27,17 +28,7 @@ import {
2728
} from "../protocols/Aws_restJson1";
2829

2930
export interface GetChunkCommandInput extends GetChunkInput {}
30-
type GetChunkCommandOutputType = __MetadataBearer &
31-
Omit<GetChunkOutput, "Data"> & {
32-
/**
33-
* For *`GetChunkOutput["Data"]`*, see {@link GetChunkOutput.Data}.
34-
*/
35-
Data: __SdkStream<Required<GetChunkOutput>["Data"]>;
36-
};
37-
/**
38-
* This interface extends from `GetChunkOutput` interface. There are more parameters than `Data` defined in {@link GetChunkOutput}
39-
*/
40-
export interface GetChunkCommandOutput extends GetChunkCommandOutputType {}
31+
export interface GetChunkCommandOutput extends __WithSdkStreamMixin<GetChunkOutput, "Data">, __MetadataBearer {}
4132

4233
/**
4334
* Gets the specified object's chunk.

clients/client-backupstorage/src/commands/GetObjectMetadataCommand.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
SdkStream as __SdkStream,
1313
SdkStreamSerdeContext as __SdkStreamSerdeContext,
1414
SerdeContext as __SerdeContext,
15+
WithSdkStreamMixin as __WithSdkStreamMixin,
1516
} from "@aws-sdk/types";
1617

1718
import { BackupStorageClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BackupStorageClient";
@@ -27,17 +28,9 @@ import {
2728
} from "../protocols/Aws_restJson1";
2829

2930
export interface GetObjectMetadataCommandInput extends GetObjectMetadataInput {}
30-
type GetObjectMetadataCommandOutputType = __MetadataBearer &
31-
Omit<GetObjectMetadataOutput, "MetadataBlob"> & {
32-
/**
33-
* For *`GetObjectMetadataOutput["MetadataBlob"]`*, see {@link GetObjectMetadataOutput.MetadataBlob}.
34-
*/
35-
MetadataBlob?: __SdkStream<Required<GetObjectMetadataOutput>["MetadataBlob"]>;
36-
};
37-
/**
38-
* This interface extends from `GetObjectMetadataOutput` interface. There are more parameters than `MetadataBlob` defined in {@link GetObjectMetadataOutput}
39-
*/
40-
export interface GetObjectMetadataCommandOutput extends GetObjectMetadataCommandOutputType {}
31+
export interface GetObjectMetadataCommandOutput
32+
extends __WithSdkStreamMixin<GetObjectMetadataOutput, "MetadataBlob">,
33+
__MetadataBearer {}
4134

4235
/**
4336
* Get metadata associated with an Object.

clients/client-codeartifact/src/commands/GetPackageVersionAssetCommand.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
SdkStream as __SdkStream,
1313
SdkStreamSerdeContext as __SdkStreamSerdeContext,
1414
SerdeContext as __SerdeContext,
15+
WithSdkStreamMixin as __WithSdkStreamMixin,
1516
} from "@aws-sdk/types";
1617

1718
import { CodeartifactClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CodeartifactClient";
@@ -27,17 +28,9 @@ import {
2728
} from "../protocols/Aws_restJson1";
2829

2930
export interface GetPackageVersionAssetCommandInput extends GetPackageVersionAssetRequest {}
30-
type GetPackageVersionAssetCommandOutputType = __MetadataBearer &
31-
Omit<GetPackageVersionAssetResult, "asset"> & {
32-
/**
33-
* For *`GetPackageVersionAssetResult["asset"]`*, see {@link GetPackageVersionAssetResult.asset}.
34-
*/
35-
asset?: __SdkStream<Required<GetPackageVersionAssetResult>["asset"]>;
36-
};
37-
/**
38-
* This interface extends from `GetPackageVersionAssetResult` interface. There are more parameters than `asset` defined in {@link GetPackageVersionAssetResult}
39-
*/
40-
export interface GetPackageVersionAssetCommandOutput extends GetPackageVersionAssetCommandOutputType {}
31+
export interface GetPackageVersionAssetCommandOutput
32+
extends __WithSdkStreamMixin<GetPackageVersionAssetResult, "asset">,
33+
__MetadataBearer {}
4134

4235
/**
4336
* <p>

clients/client-ebs/src/commands/GetSnapshotBlockCommand.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
SdkStream as __SdkStream,
1313
SdkStreamSerdeContext as __SdkStreamSerdeContext,
1414
SerdeContext as __SerdeContext,
15+
WithSdkStreamMixin as __WithSdkStreamMixin,
1516
} from "@aws-sdk/types";
1617

1718
import { EBSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EBSClient";
@@ -27,17 +28,9 @@ import {
2728
} from "../protocols/Aws_restJson1";
2829

2930
export interface GetSnapshotBlockCommandInput extends GetSnapshotBlockRequest {}
30-
type GetSnapshotBlockCommandOutputType = __MetadataBearer &
31-
Omit<GetSnapshotBlockResponse, "BlockData"> & {
32-
/**
33-
* For *`GetSnapshotBlockResponse["BlockData"]`*, see {@link GetSnapshotBlockResponse.BlockData}.
34-
*/
35-
BlockData?: __SdkStream<Required<GetSnapshotBlockResponse>["BlockData"]>;
36-
};
37-
/**
38-
* This interface extends from `GetSnapshotBlockResponse` interface. There are more parameters than `BlockData` defined in {@link GetSnapshotBlockResponse}
39-
*/
40-
export interface GetSnapshotBlockCommandOutput extends GetSnapshotBlockCommandOutputType {}
31+
export interface GetSnapshotBlockCommandOutput
32+
extends __WithSdkStreamMixin<GetSnapshotBlockResponse, "BlockData">,
33+
__MetadataBearer {}
4134

4235
/**
4336
* <p>Returns the data in a block in an Amazon Elastic Block Store snapshot.</p>

clients/client-glacier/src/commands/GetJobOutputCommand.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
SdkStream as __SdkStream,
1313
SdkStreamSerdeContext as __SdkStreamSerdeContext,
1414
SerdeContext as __SerdeContext,
15+
WithSdkStreamMixin as __WithSdkStreamMixin,
1516
} from "@aws-sdk/types";
1617

1718
import { GlacierClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GlacierClient";
@@ -27,17 +28,7 @@ import {
2728
} from "../protocols/Aws_restJson1";
2829

2930
export interface GetJobOutputCommandInput extends GetJobOutputInput {}
30-
type GetJobOutputCommandOutputType = __MetadataBearer &
31-
Omit<GetJobOutputOutput, "body"> & {
32-
/**
33-
* For *`GetJobOutputOutput["body"]`*, see {@link GetJobOutputOutput.body}.
34-
*/
35-
body?: __SdkStream<Required<GetJobOutputOutput>["body"]>;
36-
};
37-
/**
38-
* This interface extends from `GetJobOutputOutput` interface. There are more parameters than `body` defined in {@link GetJobOutputOutput}
39-
*/
40-
export interface GetJobOutputCommandOutput extends GetJobOutputCommandOutputType {}
31+
export interface GetJobOutputCommandOutput extends __WithSdkStreamMixin<GetJobOutputOutput, "body">, __MetadataBearer {}
4132

4233
/**
4334
* <p>This operation downloads the output of the job you initiated using <a>InitiateJob</a>. Depending on the job type you specified when you initiated the

clients/client-kinesis-video-archived-media/src/commands/GetClipCommand.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
SdkStream as __SdkStream,
1313
SdkStreamSerdeContext as __SdkStreamSerdeContext,
1414
SerdeContext as __SerdeContext,
15+
WithSdkStreamMixin as __WithSdkStreamMixin,
1516
} from "@aws-sdk/types";
1617

1718
import {
@@ -31,17 +32,7 @@ import {
3132
} from "../protocols/Aws_restJson1";
3233

3334
export interface GetClipCommandInput extends GetClipInput {}
34-
type GetClipCommandOutputType = __MetadataBearer &
35-
Omit<GetClipOutput, "Payload"> & {
36-
/**
37-
* For *`GetClipOutput["Payload"]`*, see {@link GetClipOutput.Payload}.
38-
*/
39-
Payload?: __SdkStream<Required<GetClipOutput>["Payload"]>;
40-
};
41-
/**
42-
* This interface extends from `GetClipOutput` interface. There are more parameters than `Payload` defined in {@link GetClipOutput}
43-
*/
44-
export interface GetClipCommandOutput extends GetClipCommandOutputType {}
35+
export interface GetClipCommandOutput extends __WithSdkStreamMixin<GetClipOutput, "Payload">, __MetadataBearer {}
4536

4637
/**
4738
* <p>Downloads an MP4 file (clip) containing the archived, on-demand media from the

clients/client-kinesis-video-archived-media/src/commands/GetMediaForFragmentListCommand.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
SdkStream as __SdkStream,
1313
SdkStreamSerdeContext as __SdkStreamSerdeContext,
1414
SerdeContext as __SerdeContext,
15+
WithSdkStreamMixin as __WithSdkStreamMixin,
1516
} from "@aws-sdk/types";
1617

1718
import {
@@ -31,17 +32,9 @@ import {
3132
} from "../protocols/Aws_restJson1";
3233

3334
export interface GetMediaForFragmentListCommandInput extends GetMediaForFragmentListInput {}
34-
type GetMediaForFragmentListCommandOutputType = __MetadataBearer &
35-
Omit<GetMediaForFragmentListOutput, "Payload"> & {
36-
/**
37-
* For *`GetMediaForFragmentListOutput["Payload"]`*, see {@link GetMediaForFragmentListOutput.Payload}.
38-
*/
39-
Payload?: __SdkStream<Required<GetMediaForFragmentListOutput>["Payload"]>;
40-
};
41-
/**
42-
* This interface extends from `GetMediaForFragmentListOutput` interface. There are more parameters than `Payload` defined in {@link GetMediaForFragmentListOutput}
43-
*/
44-
export interface GetMediaForFragmentListCommandOutput extends GetMediaForFragmentListCommandOutputType {}
35+
export interface GetMediaForFragmentListCommandOutput
36+
extends __WithSdkStreamMixin<GetMediaForFragmentListOutput, "Payload">,
37+
__MetadataBearer {}
4538

4639
/**
4740
* <p>Gets media for a list of fragments (specified by fragment number) from the archived

clients/client-kinesis-video-media/src/commands/GetMediaCommand.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
SdkStream as __SdkStream,
1313
SdkStreamSerdeContext as __SdkStreamSerdeContext,
1414
SerdeContext as __SerdeContext,
15+
WithSdkStreamMixin as __WithSdkStreamMixin,
1516
} from "@aws-sdk/types";
1617

1718
import {
@@ -31,17 +32,7 @@ import {
3132
} from "../protocols/Aws_restJson1";
3233

3334
export interface GetMediaCommandInput extends GetMediaInput {}
34-
type GetMediaCommandOutputType = __MetadataBearer &
35-
Omit<GetMediaOutput, "Payload"> & {
36-
/**
37-
* For *`GetMediaOutput["Payload"]`*, see {@link GetMediaOutput.Payload}.
38-
*/
39-
Payload?: __SdkStream<Required<GetMediaOutput>["Payload"]>;
40-
};
41-
/**
42-
* This interface extends from `GetMediaOutput` interface. There are more parameters than `Payload` defined in {@link GetMediaOutput}
43-
*/
44-
export interface GetMediaCommandOutput extends GetMediaCommandOutputType {}
35+
export interface GetMediaCommandOutput extends __WithSdkStreamMixin<GetMediaOutput, "Payload">, __MetadataBearer {}
4536

4637
/**
4738
* <p> Use this API to retrieve media content from a Kinesis video stream. In the request,

clients/client-lakeformation/src/commands/GetWorkUnitResultsCommand.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
SdkStream as __SdkStream,
1313
SdkStreamSerdeContext as __SdkStreamSerdeContext,
1414
SerdeContext as __SerdeContext,
15+
WithSdkStreamMixin as __WithSdkStreamMixin,
1516
} from "@aws-sdk/types";
1617

1718
import { LakeFormationClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../LakeFormationClient";
@@ -27,17 +28,9 @@ import {
2728
} from "../protocols/Aws_restJson1";
2829

2930
export interface GetWorkUnitResultsCommandInput extends GetWorkUnitResultsRequest {}
30-
type GetWorkUnitResultsCommandOutputType = __MetadataBearer &
31-
Omit<GetWorkUnitResultsResponse, "ResultStream"> & {
32-
/**
33-
* For *`GetWorkUnitResultsResponse["ResultStream"]`*, see {@link GetWorkUnitResultsResponse.ResultStream}.
34-
*/
35-
ResultStream?: __SdkStream<Required<GetWorkUnitResultsResponse>["ResultStream"]>;
36-
};
37-
/**
38-
* This interface extends from `GetWorkUnitResultsResponse` interface. There are more parameters than `ResultStream` defined in {@link GetWorkUnitResultsResponse}
39-
*/
40-
export interface GetWorkUnitResultsCommandOutput extends GetWorkUnitResultsCommandOutputType {}
31+
export interface GetWorkUnitResultsCommandOutput
32+
extends __WithSdkStreamMixin<GetWorkUnitResultsResponse, "ResultStream">,
33+
__MetadataBearer {}
4134

4235
/**
4336
* <p>Returns the work units resulting from the query. Work units can be executed in any order and in parallel. </p>

clients/client-lex-runtime-service/src/commands/PostContentCommand.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
SdkStream as __SdkStream,
1313
SdkStreamSerdeContext as __SdkStreamSerdeContext,
1414
SerdeContext as __SerdeContext,
15+
WithSdkStreamMixin as __WithSdkStreamMixin,
1516
} from "@aws-sdk/types";
1617

1718
import {
@@ -40,17 +41,9 @@ type PostContentCommandInputType = Omit<PostContentRequest, "inputStream"> & {
4041
* This interface extends from `PostContentRequest` interface. There are more parameters than `inputStream` defined in {@link PostContentRequest}
4142
*/
4243
export interface PostContentCommandInput extends PostContentCommandInputType {}
43-
type PostContentCommandOutputType = __MetadataBearer &
44-
Omit<PostContentResponse, "audioStream"> & {
45-
/**
46-
* For *`PostContentResponse["audioStream"]`*, see {@link PostContentResponse.audioStream}.
47-
*/
48-
audioStream?: __SdkStream<Required<PostContentResponse>["audioStream"]>;
49-
};
50-
/**
51-
* This interface extends from `PostContentResponse` interface. There are more parameters than `audioStream` defined in {@link PostContentResponse}
52-
*/
53-
export interface PostContentCommandOutput extends PostContentCommandOutputType {}
44+
export interface PostContentCommandOutput
45+
extends __WithSdkStreamMixin<PostContentResponse, "audioStream">,
46+
__MetadataBearer {}
5447

5548
/**
5649
* <p> Sends user input (text or speech) to Amazon Lex. Clients use this API to

clients/client-lex-runtime-service/src/commands/PutSessionCommand.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
SdkStream as __SdkStream,
1313
SdkStreamSerdeContext as __SdkStreamSerdeContext,
1414
SerdeContext as __SerdeContext,
15+
WithSdkStreamMixin as __WithSdkStreamMixin,
1516
} from "@aws-sdk/types";
1617

1718
import {
@@ -31,17 +32,9 @@ import {
3132
} from "../protocols/Aws_restJson1";
3233

3334
export interface PutSessionCommandInput extends PutSessionRequest {}
34-
type PutSessionCommandOutputType = __MetadataBearer &
35-
Omit<PutSessionResponse, "audioStream"> & {
36-
/**
37-
* For *`PutSessionResponse["audioStream"]`*, see {@link PutSessionResponse.audioStream}.
38-
*/
39-
audioStream?: __SdkStream<Required<PutSessionResponse>["audioStream"]>;
40-
};
41-
/**
42-
* This interface extends from `PutSessionResponse` interface. There are more parameters than `audioStream` defined in {@link PutSessionResponse}
43-
*/
44-
export interface PutSessionCommandOutput extends PutSessionCommandOutputType {}
35+
export interface PutSessionCommandOutput
36+
extends __WithSdkStreamMixin<PutSessionResponse, "audioStream">,
37+
__MetadataBearer {}
4538

4639
/**
4740
* <p>Creates a new session or modifies an existing session with an Amazon Lex

clients/client-lex-runtime-v2/src/commands/PutSessionCommand.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
SdkStream as __SdkStream,
1313
SdkStreamSerdeContext as __SdkStreamSerdeContext,
1414
SerdeContext as __SerdeContext,
15+
WithSdkStreamMixin as __WithSdkStreamMixin,
1516
} from "@aws-sdk/types";
1617

1718
import { LexRuntimeV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../LexRuntimeV2Client";
@@ -27,17 +28,9 @@ import {
2728
} from "../protocols/Aws_restJson1";
2829

2930
export interface PutSessionCommandInput extends PutSessionRequest {}
30-
type PutSessionCommandOutputType = __MetadataBearer &
31-
Omit<PutSessionResponse, "audioStream"> & {
32-
/**
33-
* For *`PutSessionResponse["audioStream"]`*, see {@link PutSessionResponse.audioStream}.
34-
*/
35-
audioStream?: __SdkStream<Required<PutSessionResponse>["audioStream"]>;
36-
};
37-
/**
38-
* This interface extends from `PutSessionResponse` interface. There are more parameters than `audioStream` defined in {@link PutSessionResponse}
39-
*/
40-
export interface PutSessionCommandOutput extends PutSessionCommandOutputType {}
31+
export interface PutSessionCommandOutput
32+
extends __WithSdkStreamMixin<PutSessionResponse, "audioStream">,
33+
__MetadataBearer {}
4134

4235
/**
4336
* <p>Creates a new session or modifies an existing session with an Amazon Lex V2

clients/client-lex-runtime-v2/src/commands/RecognizeUtteranceCommand.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
SdkStream as __SdkStream,
1313
SdkStreamSerdeContext as __SdkStreamSerdeContext,
1414
SerdeContext as __SerdeContext,
15+
WithSdkStreamMixin as __WithSdkStreamMixin,
1516
} from "@aws-sdk/types";
1617

1718
import { LexRuntimeV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../LexRuntimeV2Client";
@@ -36,17 +37,9 @@ type RecognizeUtteranceCommandInputType = Omit<RecognizeUtteranceRequest, "input
3637
* This interface extends from `RecognizeUtteranceRequest` interface. There are more parameters than `inputStream` defined in {@link RecognizeUtteranceRequest}
3738
*/
3839
export interface RecognizeUtteranceCommandInput extends RecognizeUtteranceCommandInputType {}
39-
type RecognizeUtteranceCommandOutputType = __MetadataBearer &
40-
Omit<RecognizeUtteranceResponse, "audioStream"> & {
41-
/**
42-
* For *`RecognizeUtteranceResponse["audioStream"]`*, see {@link RecognizeUtteranceResponse.audioStream}.
43-
*/
44-
audioStream?: __SdkStream<Required<RecognizeUtteranceResponse>["audioStream"]>;
45-
};
46-
/**
47-
* This interface extends from `RecognizeUtteranceResponse` interface. There are more parameters than `audioStream` defined in {@link RecognizeUtteranceResponse}
48-
*/
49-
export interface RecognizeUtteranceCommandOutput extends RecognizeUtteranceCommandOutputType {}
40+
export interface RecognizeUtteranceCommandOutput
41+
extends __WithSdkStreamMixin<RecognizeUtteranceResponse, "audioStream">,
42+
__MetadataBearer {}
5043

5144
/**
5245
* <p>Sends user input to Amazon Lex V2. You can send text or speech. Clients use

clients/client-medialive/src/commands/DescribeInputDeviceThumbnailCommand.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
SdkStream as __SdkStream,
1313
SdkStreamSerdeContext as __SdkStreamSerdeContext,
1414
SerdeContext as __SerdeContext,
15+
WithSdkStreamMixin as __WithSdkStreamMixin,
1516
} from "@aws-sdk/types";
1617

1718
import { MediaLiveClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MediaLiveClient";
@@ -27,17 +28,9 @@ import {
2728
} from "../protocols/Aws_restJson1";
2829

2930
export interface DescribeInputDeviceThumbnailCommandInput extends DescribeInputDeviceThumbnailRequest {}
30-
type DescribeInputDeviceThumbnailCommandOutputType = __MetadataBearer &
31-
Omit<DescribeInputDeviceThumbnailResponse, "Body"> & {
32-
/**
33-
* For *`DescribeInputDeviceThumbnailResponse["Body"]`*, see {@link DescribeInputDeviceThumbnailResponse.Body}.
34-
*/
35-
Body?: __SdkStream<Required<DescribeInputDeviceThumbnailResponse>["Body"]>;
36-
};
37-
/**
38-
* This interface extends from `DescribeInputDeviceThumbnailResponse` interface. There are more parameters than `Body` defined in {@link DescribeInputDeviceThumbnailResponse}
39-
*/
40-
export interface DescribeInputDeviceThumbnailCommandOutput extends DescribeInputDeviceThumbnailCommandOutputType {}
31+
export interface DescribeInputDeviceThumbnailCommandOutput
32+
extends __WithSdkStreamMixin<DescribeInputDeviceThumbnailResponse, "Body">,
33+
__MetadataBearer {}
4134

4235
/**
4336
* Get the latest thumbnail data for the input device.

0 commit comments

Comments
 (0)