Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: codegen for command class builder #5604

Merged
merged 12 commits into from
Dec 22, 2023
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
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"
}
10 changes: 5 additions & 5 deletions clients/client-accessanalyzer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,26 @@
"@aws-sdk/util-user-agent-browser": "*",
"@aws-sdk/util-user-agent-node": "*",
"@smithy/config-resolver": "^2.0.21",
"@smithy/core": "^1.2.0",
"@smithy/core": "^1.2.1",
"@smithy/fetch-http-handler": "^2.3.1",
"@smithy/hash-node": "^2.0.17",
"@smithy/invalid-dependency": "^2.0.15",
"@smithy/middleware-content-length": "^2.0.17",
"@smithy/middleware-endpoint": "^2.2.3",
"@smithy/middleware-retry": "^2.0.24",
"@smithy/middleware-retry": "^2.0.25",
"@smithy/middleware-serde": "^2.0.15",
"@smithy/middleware-stack": "^2.0.9",
"@smithy/node-config-provider": "^2.1.8",
"@smithy/node-http-handler": "^2.2.1",
"@smithy/protocol-http": "^3.0.11",
"@smithy/smithy-client": "^2.1.18",
"@smithy/smithy-client": "^2.2.0",
"@smithy/types": "^2.7.0",
"@smithy/url-parser": "^2.0.15",
"@smithy/util-base64": "^2.0.1",
"@smithy/util-body-length-browser": "^2.0.1",
"@smithy/util-body-length-node": "^2.1.0",
"@smithy/util-defaults-mode-browser": "^2.0.22",
"@smithy/util-defaults-mode-node": "^2.0.29",
"@smithy/util-defaults-mode-browser": "^2.0.23",
"@smithy/util-defaults-mode-node": "^2.0.30",
"@smithy/util-endpoints": "^1.0.7",
"@smithy/util-retry": "^2.0.8",
"@smithy/util-utf8": "^2.0.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
// 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 { AccessAnalyzerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../AccessAnalyzerClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { ApplyArchiveRuleRequest } from "../models/models_0";
import { de_ApplyArchiveRuleCommand, se_ApplyArchiveRuleCommand } from "../protocols/Aws_restJson1";

Expand Down Expand Up @@ -81,75 +72,26 @@ export interface ApplyArchiveRuleCommandOutput extends __MetadataBearer {}
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
*
*/
export class ApplyArchiveRuleCommand extends $Command<
ApplyArchiveRuleCommandInput,
ApplyArchiveRuleCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

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

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ApplyArchiveRuleCommandInput, ApplyArchiveRuleCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, ApplyArchiveRuleCommand.getEndpointParameterInstructions())
);

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

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

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

/**
* @internal
*/
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<ApplyArchiveRuleCommandOutput> {
return de_ApplyArchiveRuleCommand(output, context);
}
}
export class ApplyArchiveRuleCommand extends $Command
.classBuilder<
ApplyArchiveRuleCommandInput,
ApplyArchiveRuleCommandOutput,
AccessAnalyzerClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep({
...commonParams,
})
.m(function (this: any, Command: any, cs: any, config: AccessAnalyzerClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("AccessAnalyzer", "ApplyArchiveRule", {})
.n("AccessAnalyzerClient", "ApplyArchiveRuleCommand")
.f(void 0, void 0)
.ser(se_ApplyArchiveRuleCommand)
.de(de_ApplyArchiveRuleCommand)
.build() {}
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
// 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 { AccessAnalyzerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../AccessAnalyzerClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { CancelPolicyGenerationRequest, CancelPolicyGenerationResponse } from "../models/models_0";
import { de_CancelPolicyGenerationCommand, se_CancelPolicyGenerationCommand } from "../protocols/Aws_restJson1";

Expand Down Expand Up @@ -75,75 +66,26 @@ export interface CancelPolicyGenerationCommandOutput extends CancelPolicyGenerat
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
*
*/
export class CancelPolicyGenerationCommand extends $Command<
CancelPolicyGenerationCommandInput,
CancelPolicyGenerationCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

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

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<CancelPolicyGenerationCommandInput, CancelPolicyGenerationCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, CancelPolicyGenerationCommand.getEndpointParameterInstructions())
);

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

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

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

/**
* @internal
*/
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<CancelPolicyGenerationCommandOutput> {
return de_CancelPolicyGenerationCommand(output, context);
}
}
export class CancelPolicyGenerationCommand extends $Command
.classBuilder<
CancelPolicyGenerationCommandInput,
CancelPolicyGenerationCommandOutput,
AccessAnalyzerClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep({
...commonParams,
})
.m(function (this: any, Command: any, cs: any, config: AccessAnalyzerClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("AccessAnalyzer", "CancelPolicyGeneration", {})
.n("AccessAnalyzerClient", "CancelPolicyGenerationCommand")
.f(void 0, void 0)
.ser(se_CancelPolicyGenerationCommand)
.de(de_CancelPolicyGenerationCommand)
.build() {}
Loading
Loading