Skip to content

Commit

Permalink
feat(serde): use type mapping to describe stream mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Oct 12, 2022
1 parent afcdb61 commit 3a6afdf
Show file tree
Hide file tree
Showing 22 changed files with 82 additions and 231 deletions.
13 changes: 2 additions & 11 deletions clients/client-backupstorage/src/commands/GetChunkCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
SdkStream as __SdkStream,
SdkStreamSerdeContext as __SdkStreamSerdeContext,
SerdeContext as __SerdeContext,
WithSdkStreamMixin as __WithSdkStreamMixin,
} from "@aws-sdk/types";

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

export interface GetChunkCommandInput extends GetChunkInput {}
type GetChunkCommandOutputType = __MetadataBearer &
Omit<GetChunkOutput, "Data"> & {
/**
* For *`GetChunkOutput["Data"]`*, see {@link GetChunkOutput.Data}.
*/
Data: __SdkStream<Required<GetChunkOutput>["Data"]>;
};
/**
* This interface extends from `GetChunkOutput` interface. There are more parameters than `Data` defined in {@link GetChunkOutput}
*/
export interface GetChunkCommandOutput extends GetChunkCommandOutputType {}
export interface GetChunkCommandOutput extends __WithSdkStreamMixin<GetChunkOutput, "Data">, __MetadataBearer {}

/**
* Gets the specified object's chunk.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
SdkStream as __SdkStream,
SdkStreamSerdeContext as __SdkStreamSerdeContext,
SerdeContext as __SerdeContext,
WithSdkStreamMixin as __WithSdkStreamMixin,
} from "@aws-sdk/types";

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

export interface GetObjectMetadataCommandInput extends GetObjectMetadataInput {}
type GetObjectMetadataCommandOutputType = __MetadataBearer &
Omit<GetObjectMetadataOutput, "MetadataBlob"> & {
/**
* For *`GetObjectMetadataOutput["MetadataBlob"]`*, see {@link GetObjectMetadataOutput.MetadataBlob}.
*/
MetadataBlob?: __SdkStream<Required<GetObjectMetadataOutput>["MetadataBlob"]>;
};
/**
* This interface extends from `GetObjectMetadataOutput` interface. There are more parameters than `MetadataBlob` defined in {@link GetObjectMetadataOutput}
*/
export interface GetObjectMetadataCommandOutput extends GetObjectMetadataCommandOutputType {}
export interface GetObjectMetadataCommandOutput
extends __WithSdkStreamMixin<GetObjectMetadataOutput, "MetadataBlob">,
__MetadataBearer {}

/**
* Get metadata associated with an Object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
SdkStream as __SdkStream,
SdkStreamSerdeContext as __SdkStreamSerdeContext,
SerdeContext as __SerdeContext,
WithSdkStreamMixin as __WithSdkStreamMixin,
} from "@aws-sdk/types";

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

export interface GetPackageVersionAssetCommandInput extends GetPackageVersionAssetRequest {}
type GetPackageVersionAssetCommandOutputType = __MetadataBearer &
Omit<GetPackageVersionAssetResult, "asset"> & {
/**
* For *`GetPackageVersionAssetResult["asset"]`*, see {@link GetPackageVersionAssetResult.asset}.
*/
asset?: __SdkStream<Required<GetPackageVersionAssetResult>["asset"]>;
};
/**
* This interface extends from `GetPackageVersionAssetResult` interface. There are more parameters than `asset` defined in {@link GetPackageVersionAssetResult}
*/
export interface GetPackageVersionAssetCommandOutput extends GetPackageVersionAssetCommandOutputType {}
export interface GetPackageVersionAssetCommandOutput
extends __WithSdkStreamMixin<GetPackageVersionAssetResult, "asset">,
__MetadataBearer {}

/**
* <p>
Expand Down
15 changes: 4 additions & 11 deletions clients/client-ebs/src/commands/GetSnapshotBlockCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
SdkStream as __SdkStream,
SdkStreamSerdeContext as __SdkStreamSerdeContext,
SerdeContext as __SerdeContext,
WithSdkStreamMixin as __WithSdkStreamMixin,
} from "@aws-sdk/types";

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

export interface GetSnapshotBlockCommandInput extends GetSnapshotBlockRequest {}
type GetSnapshotBlockCommandOutputType = __MetadataBearer &
Omit<GetSnapshotBlockResponse, "BlockData"> & {
/**
* For *`GetSnapshotBlockResponse["BlockData"]`*, see {@link GetSnapshotBlockResponse.BlockData}.
*/
BlockData?: __SdkStream<Required<GetSnapshotBlockResponse>["BlockData"]>;
};
/**
* This interface extends from `GetSnapshotBlockResponse` interface. There are more parameters than `BlockData` defined in {@link GetSnapshotBlockResponse}
*/
export interface GetSnapshotBlockCommandOutput extends GetSnapshotBlockCommandOutputType {}
export interface GetSnapshotBlockCommandOutput
extends __WithSdkStreamMixin<GetSnapshotBlockResponse, "BlockData">,
__MetadataBearer {}

/**
* <p>Returns the data in a block in an Amazon Elastic Block Store snapshot.</p>
Expand Down
13 changes: 2 additions & 11 deletions clients/client-glacier/src/commands/GetJobOutputCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
SdkStream as __SdkStream,
SdkStreamSerdeContext as __SdkStreamSerdeContext,
SerdeContext as __SerdeContext,
WithSdkStreamMixin as __WithSdkStreamMixin,
} from "@aws-sdk/types";

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

export interface GetJobOutputCommandInput extends GetJobOutputInput {}
type GetJobOutputCommandOutputType = __MetadataBearer &
Omit<GetJobOutputOutput, "body"> & {
/**
* For *`GetJobOutputOutput["body"]`*, see {@link GetJobOutputOutput.body}.
*/
body?: __SdkStream<Required<GetJobOutputOutput>["body"]>;
};
/**
* This interface extends from `GetJobOutputOutput` interface. There are more parameters than `body` defined in {@link GetJobOutputOutput}
*/
export interface GetJobOutputCommandOutput extends GetJobOutputCommandOutputType {}
export interface GetJobOutputCommandOutput extends __WithSdkStreamMixin<GetJobOutputOutput, "body">, __MetadataBearer {}

/**
* <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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
SdkStream as __SdkStream,
SdkStreamSerdeContext as __SdkStreamSerdeContext,
SerdeContext as __SerdeContext,
WithSdkStreamMixin as __WithSdkStreamMixin,
} from "@aws-sdk/types";

import {
Expand All @@ -31,17 +32,7 @@ import {
} from "../protocols/Aws_restJson1";

export interface GetClipCommandInput extends GetClipInput {}
type GetClipCommandOutputType = __MetadataBearer &
Omit<GetClipOutput, "Payload"> & {
/**
* For *`GetClipOutput["Payload"]`*, see {@link GetClipOutput.Payload}.
*/
Payload?: __SdkStream<Required<GetClipOutput>["Payload"]>;
};
/**
* This interface extends from `GetClipOutput` interface. There are more parameters than `Payload` defined in {@link GetClipOutput}
*/
export interface GetClipCommandOutput extends GetClipCommandOutputType {}
export interface GetClipCommandOutput extends __WithSdkStreamMixin<GetClipOutput, "Payload">, __MetadataBearer {}

/**
* <p>Downloads an MP4 file (clip) containing the archived, on-demand media from the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
SdkStream as __SdkStream,
SdkStreamSerdeContext as __SdkStreamSerdeContext,
SerdeContext as __SerdeContext,
WithSdkStreamMixin as __WithSdkStreamMixin,
} from "@aws-sdk/types";

import {
Expand All @@ -31,17 +32,9 @@ import {
} from "../protocols/Aws_restJson1";

export interface GetMediaForFragmentListCommandInput extends GetMediaForFragmentListInput {}
type GetMediaForFragmentListCommandOutputType = __MetadataBearer &
Omit<GetMediaForFragmentListOutput, "Payload"> & {
/**
* For *`GetMediaForFragmentListOutput["Payload"]`*, see {@link GetMediaForFragmentListOutput.Payload}.
*/
Payload?: __SdkStream<Required<GetMediaForFragmentListOutput>["Payload"]>;
};
/**
* This interface extends from `GetMediaForFragmentListOutput` interface. There are more parameters than `Payload` defined in {@link GetMediaForFragmentListOutput}
*/
export interface GetMediaForFragmentListCommandOutput extends GetMediaForFragmentListCommandOutputType {}
export interface GetMediaForFragmentListCommandOutput
extends __WithSdkStreamMixin<GetMediaForFragmentListOutput, "Payload">,
__MetadataBearer {}

/**
* <p>Gets media for a list of fragments (specified by fragment number) from the archived
Expand Down
13 changes: 2 additions & 11 deletions clients/client-kinesis-video-media/src/commands/GetMediaCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
SdkStream as __SdkStream,
SdkStreamSerdeContext as __SdkStreamSerdeContext,
SerdeContext as __SerdeContext,
WithSdkStreamMixin as __WithSdkStreamMixin,
} from "@aws-sdk/types";

import {
Expand All @@ -31,17 +32,7 @@ import {
} from "../protocols/Aws_restJson1";

export interface GetMediaCommandInput extends GetMediaInput {}
type GetMediaCommandOutputType = __MetadataBearer &
Omit<GetMediaOutput, "Payload"> & {
/**
* For *`GetMediaOutput["Payload"]`*, see {@link GetMediaOutput.Payload}.
*/
Payload?: __SdkStream<Required<GetMediaOutput>["Payload"]>;
};
/**
* This interface extends from `GetMediaOutput` interface. There are more parameters than `Payload` defined in {@link GetMediaOutput}
*/
export interface GetMediaCommandOutput extends GetMediaCommandOutputType {}
export interface GetMediaCommandOutput extends __WithSdkStreamMixin<GetMediaOutput, "Payload">, __MetadataBearer {}

/**
* <p> Use this API to retrieve media content from a Kinesis video stream. In the request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
SdkStream as __SdkStream,
SdkStreamSerdeContext as __SdkStreamSerdeContext,
SerdeContext as __SerdeContext,
WithSdkStreamMixin as __WithSdkStreamMixin,
} from "@aws-sdk/types";

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

export interface GetWorkUnitResultsCommandInput extends GetWorkUnitResultsRequest {}
type GetWorkUnitResultsCommandOutputType = __MetadataBearer &
Omit<GetWorkUnitResultsResponse, "ResultStream"> & {
/**
* For *`GetWorkUnitResultsResponse["ResultStream"]`*, see {@link GetWorkUnitResultsResponse.ResultStream}.
*/
ResultStream?: __SdkStream<Required<GetWorkUnitResultsResponse>["ResultStream"]>;
};
/**
* This interface extends from `GetWorkUnitResultsResponse` interface. There are more parameters than `ResultStream` defined in {@link GetWorkUnitResultsResponse}
*/
export interface GetWorkUnitResultsCommandOutput extends GetWorkUnitResultsCommandOutputType {}
export interface GetWorkUnitResultsCommandOutput
extends __WithSdkStreamMixin<GetWorkUnitResultsResponse, "ResultStream">,
__MetadataBearer {}

/**
* <p>Returns the work units resulting from the query. Work units can be executed in any order and in parallel. </p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
SdkStream as __SdkStream,
SdkStreamSerdeContext as __SdkStreamSerdeContext,
SerdeContext as __SerdeContext,
WithSdkStreamMixin as __WithSdkStreamMixin,
} from "@aws-sdk/types";

import {
Expand Down Expand Up @@ -40,17 +41,9 @@ type PostContentCommandInputType = Omit<PostContentRequest, "inputStream"> & {
* This interface extends from `PostContentRequest` interface. There are more parameters than `inputStream` defined in {@link PostContentRequest}
*/
export interface PostContentCommandInput extends PostContentCommandInputType {}
type PostContentCommandOutputType = __MetadataBearer &
Omit<PostContentResponse, "audioStream"> & {
/**
* For *`PostContentResponse["audioStream"]`*, see {@link PostContentResponse.audioStream}.
*/
audioStream?: __SdkStream<Required<PostContentResponse>["audioStream"]>;
};
/**
* This interface extends from `PostContentResponse` interface. There are more parameters than `audioStream` defined in {@link PostContentResponse}
*/
export interface PostContentCommandOutput extends PostContentCommandOutputType {}
export interface PostContentCommandOutput
extends __WithSdkStreamMixin<PostContentResponse, "audioStream">,
__MetadataBearer {}

/**
* <p> Sends user input (text or speech) to Amazon Lex. Clients use this API to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
SdkStream as __SdkStream,
SdkStreamSerdeContext as __SdkStreamSerdeContext,
SerdeContext as __SerdeContext,
WithSdkStreamMixin as __WithSdkStreamMixin,
} from "@aws-sdk/types";

import {
Expand All @@ -31,17 +32,9 @@ import {
} from "../protocols/Aws_restJson1";

export interface PutSessionCommandInput extends PutSessionRequest {}
type PutSessionCommandOutputType = __MetadataBearer &
Omit<PutSessionResponse, "audioStream"> & {
/**
* For *`PutSessionResponse["audioStream"]`*, see {@link PutSessionResponse.audioStream}.
*/
audioStream?: __SdkStream<Required<PutSessionResponse>["audioStream"]>;
};
/**
* This interface extends from `PutSessionResponse` interface. There are more parameters than `audioStream` defined in {@link PutSessionResponse}
*/
export interface PutSessionCommandOutput extends PutSessionCommandOutputType {}
export interface PutSessionCommandOutput
extends __WithSdkStreamMixin<PutSessionResponse, "audioStream">,
__MetadataBearer {}

/**
* <p>Creates a new session or modifies an existing session with an Amazon Lex
Expand Down
15 changes: 4 additions & 11 deletions clients/client-lex-runtime-v2/src/commands/PutSessionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
SdkStream as __SdkStream,
SdkStreamSerdeContext as __SdkStreamSerdeContext,
SerdeContext as __SerdeContext,
WithSdkStreamMixin as __WithSdkStreamMixin,
} from "@aws-sdk/types";

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

export interface PutSessionCommandInput extends PutSessionRequest {}
type PutSessionCommandOutputType = __MetadataBearer &
Omit<PutSessionResponse, "audioStream"> & {
/**
* For *`PutSessionResponse["audioStream"]`*, see {@link PutSessionResponse.audioStream}.
*/
audioStream?: __SdkStream<Required<PutSessionResponse>["audioStream"]>;
};
/**
* This interface extends from `PutSessionResponse` interface. There are more parameters than `audioStream` defined in {@link PutSessionResponse}
*/
export interface PutSessionCommandOutput extends PutSessionCommandOutputType {}
export interface PutSessionCommandOutput
extends __WithSdkStreamMixin<PutSessionResponse, "audioStream">,
__MetadataBearer {}

/**
* <p>Creates a new session or modifies an existing session with an Amazon Lex V2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
SdkStream as __SdkStream,
SdkStreamSerdeContext as __SdkStreamSerdeContext,
SerdeContext as __SerdeContext,
WithSdkStreamMixin as __WithSdkStreamMixin,
} from "@aws-sdk/types";

import { LexRuntimeV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../LexRuntimeV2Client";
Expand All @@ -36,17 +37,9 @@ type RecognizeUtteranceCommandInputType = Omit<RecognizeUtteranceRequest, "input
* This interface extends from `RecognizeUtteranceRequest` interface. There are more parameters than `inputStream` defined in {@link RecognizeUtteranceRequest}
*/
export interface RecognizeUtteranceCommandInput extends RecognizeUtteranceCommandInputType {}
type RecognizeUtteranceCommandOutputType = __MetadataBearer &
Omit<RecognizeUtteranceResponse, "audioStream"> & {
/**
* For *`RecognizeUtteranceResponse["audioStream"]`*, see {@link RecognizeUtteranceResponse.audioStream}.
*/
audioStream?: __SdkStream<Required<RecognizeUtteranceResponse>["audioStream"]>;
};
/**
* This interface extends from `RecognizeUtteranceResponse` interface. There are more parameters than `audioStream` defined in {@link RecognizeUtteranceResponse}
*/
export interface RecognizeUtteranceCommandOutput extends RecognizeUtteranceCommandOutputType {}
export interface RecognizeUtteranceCommandOutput
extends __WithSdkStreamMixin<RecognizeUtteranceResponse, "audioStream">,
__MetadataBearer {}

/**
* <p>Sends user input to Amazon Lex V2. You can send text or speech. Clients use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
SdkStream as __SdkStream,
SdkStreamSerdeContext as __SdkStreamSerdeContext,
SerdeContext as __SerdeContext,
WithSdkStreamMixin as __WithSdkStreamMixin,
} from "@aws-sdk/types";

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

export interface DescribeInputDeviceThumbnailCommandInput extends DescribeInputDeviceThumbnailRequest {}
type DescribeInputDeviceThumbnailCommandOutputType = __MetadataBearer &
Omit<DescribeInputDeviceThumbnailResponse, "Body"> & {
/**
* For *`DescribeInputDeviceThumbnailResponse["Body"]`*, see {@link DescribeInputDeviceThumbnailResponse.Body}.
*/
Body?: __SdkStream<Required<DescribeInputDeviceThumbnailResponse>["Body"]>;
};
/**
* This interface extends from `DescribeInputDeviceThumbnailResponse` interface. There are more parameters than `Body` defined in {@link DescribeInputDeviceThumbnailResponse}
*/
export interface DescribeInputDeviceThumbnailCommandOutput extends DescribeInputDeviceThumbnailCommandOutputType {}
export interface DescribeInputDeviceThumbnailCommandOutput
extends __WithSdkStreamMixin<DescribeInputDeviceThumbnailResponse, "Body">,
__MetadataBearer {}

/**
* Get the latest thumbnail data for the input device.
Expand Down
Loading

0 comments on commit 3a6afdf

Please sign in to comment.