Skip to content

Commit

Permalink
feat: sample diff for command codegen helper
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Dec 21, 2023
1 parent 64c731e commit 40804fb
Show file tree
Hide file tree
Showing 99 changed files with 2,721 additions and 8,961 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.rulers": [80, 120],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"typescript.tsdk": "node_modules/typescript/lib"
}
120 changes: 28 additions & 92 deletions clients/client-s3/src/commands/AbortMultipartUploadCommand.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { Command as $Command } from "@smithy/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
SMITHY_CONTEXT_KEY,
} from "@smithy/types";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { AbortMultipartUploadOutput, AbortMultipartUploadRequest } from "../models/models_0";
import { de_AbortMultipartUploadCommand, se_AbortMultipartUploadCommand } from "../protocols/Aws_restXml";
import { S3ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../S3Client";
Expand Down Expand Up @@ -155,83 +146,28 @@ export interface AbortMultipartUploadCommandOutput extends AbortMultipartUploadO
* ```
*
*/
export class AbortMultipartUploadCommand extends $Command<
AbortMultipartUploadCommandInput,
AbortMultipartUploadCommandOutput,
S3ClientResolvedConfig
> {
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
Bucket: { type: "contextParams", name: "Bucket" },
Key: { type: "contextParams", name: "Key" },
ForcePathStyle: { type: "clientContextParams", name: "forcePathStyle" },
UseArnRegion: { type: "clientContextParams", name: "useArnRegion" },
DisableMultiRegionAccessPoints: { type: "clientContextParams", name: "disableMultiregionAccessPoints" },
Accelerate: { type: "clientContextParams", name: "useAccelerateEndpoint" },
DisableS3ExpressSessionAuth: { type: "clientContextParams", name: "disableS3ExpressSessionAuth" },
UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" },
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

/**
* @public
*/
constructor(readonly input: AbortMultipartUploadCommandInput) {
super();
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: S3ClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<AbortMultipartUploadCommandInput, AbortMultipartUploadCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, AbortMultipartUploadCommand.getEndpointParameterInstructions())
);

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "S3Client";
const commandName = "AbortMultipartUploadCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "AbortMultipartUpload",
},
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

/**
* @internal
*/
private serialize(input: AbortMultipartUploadCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return se_AbortMultipartUploadCommand(input, context);
}

/**
* @internal
*/
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<AbortMultipartUploadCommandOutput> {
return de_AbortMultipartUploadCommand(output, context);
}
}
export class AbortMultipartUploadCommand extends $Command
.classBuilder<
AbortMultipartUploadCommandInput,
AbortMultipartUploadCommandOutput,
S3ClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep({
...commonParams,
Bucket: { type: "contextParams", name: "Bucket" },
Key: { type: "contextParams", name: "Key" },
})
.m(function (this: any /*Command*/, Command: any /*static*/, config: S3ClientResolvedConfig) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("AmazonS3", "AbortMultipartUpload", {})
.n("S3Client", "AbortMultipartUploadCommand")
.f(void 0, void 0)
.ser(se_AbortMultipartUploadCommand)
.de(de_AbortMultipartUploadCommand)
.build() {}
124 changes: 30 additions & 94 deletions clients/client-s3/src/commands/CompleteMultipartUploadCommand.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
// smithy-typescript generated code
import { getThrow200ExceptionsPlugin } from "@aws-sdk/middleware-sdk-s3";
import { getSsecPlugin } from "@aws-sdk/middleware-ssec";
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { Command as $Command } from "@smithy/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
SMITHY_CONTEXT_KEY,
} from "@smithy/types";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import {
CompleteMultipartUploadOutput,
CompleteMultipartUploadOutputFilterSensitiveLog,
Expand Down Expand Up @@ -295,85 +286,30 @@ export interface CompleteMultipartUploadCommandOutput extends CompleteMultipartU
* ```
*
*/
export class CompleteMultipartUploadCommand extends $Command<
CompleteMultipartUploadCommandInput,
CompleteMultipartUploadCommandOutput,
S3ClientResolvedConfig
> {
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
Bucket: { type: "contextParams", name: "Bucket" },
Key: { type: "contextParams", name: "Key" },
ForcePathStyle: { type: "clientContextParams", name: "forcePathStyle" },
UseArnRegion: { type: "clientContextParams", name: "useArnRegion" },
DisableMultiRegionAccessPoints: { type: "clientContextParams", name: "disableMultiregionAccessPoints" },
Accelerate: { type: "clientContextParams", name: "useAccelerateEndpoint" },
DisableS3ExpressSessionAuth: { type: "clientContextParams", name: "disableS3ExpressSessionAuth" },
UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" },
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

/**
* @public
*/
constructor(readonly input: CompleteMultipartUploadCommandInput) {
super();
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: S3ClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<CompleteMultipartUploadCommandInput, CompleteMultipartUploadCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, CompleteMultipartUploadCommand.getEndpointParameterInstructions())
);
this.middlewareStack.use(getThrow200ExceptionsPlugin(configuration));
this.middlewareStack.use(getSsecPlugin(configuration));

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "S3Client";
const commandName = "CompleteMultipartUploadCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: CompleteMultipartUploadRequestFilterSensitiveLog,
outputFilterSensitiveLog: CompleteMultipartUploadOutputFilterSensitiveLog,
[SMITHY_CONTEXT_KEY]: {
service: "AmazonS3",
operation: "CompleteMultipartUpload",
},
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

/**
* @internal
*/
private serialize(input: CompleteMultipartUploadCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return se_CompleteMultipartUploadCommand(input, context);
}

/**
* @internal
*/
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<CompleteMultipartUploadCommandOutput> {
return de_CompleteMultipartUploadCommand(output, context);
}
}
export class CompleteMultipartUploadCommand extends $Command
.classBuilder<
CompleteMultipartUploadCommandInput,
CompleteMultipartUploadCommandOutput,
S3ClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep({
...commonParams,
Bucket: { type: "contextParams", name: "Bucket" },
Key: { type: "contextParams", name: "Key" },
})
.m(function (this: any /*Command*/, Command: any /*static*/, config: S3ClientResolvedConfig) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
getThrow200ExceptionsPlugin(config),
getSsecPlugin(config),
];
})
.s("AmazonS3", "CompleteMultipartUpload", {})
.n("S3Client", "CompleteMultipartUploadCommand")
.f(CompleteMultipartUploadRequestFilterSensitiveLog, CompleteMultipartUploadOutputFilterSensitiveLog)
.ser(se_CompleteMultipartUploadCommand)
.de(de_CompleteMultipartUploadCommand)
.build() {}
Loading

0 comments on commit 40804fb

Please sign in to comment.