Skip to content

Commit 4835de4

Browse files
authored
feat: codegen for command class builder (#5604)
* feat: sample diff for command codegen helper * feat: preliminary codegen for command classbuilder * fix: endpoint discovery codegen * chore: codegen update * chore: update yarn lock * chore: fix sso bundle files * chore: nocheck for bundled sso oidc * feat: update smithy hash * chore: codegen rebase * fix: error ENAMETOOLONG * fix(token-providers): script writeFile * test: fix unit test in pkg
1 parent d0b44b8 commit 4835de4

File tree

16,075 files changed

+400902
-1294800
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

16,075 files changed

+400902
-1294800
lines changed

Diff for: .vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"editor.defaultFormatter": "esbenp.prettier-vscode",
99
"editor.rulers": [80, 120],
1010
"editor.codeActionsOnSave": {
11-
"source.fixAll.eslint": true
11+
"source.fixAll.eslint": "explicit"
1212
},
1313
"typescript.tsdk": "node_modules/typescript/lib"
1414
}

Diff for: clients/client-accessanalyzer/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,26 @@
3434
"@aws-sdk/util-user-agent-browser": "*",
3535
"@aws-sdk/util-user-agent-node": "*",
3636
"@smithy/config-resolver": "^2.0.21",
37-
"@smithy/core": "^1.2.0",
37+
"@smithy/core": "^1.2.1",
3838
"@smithy/fetch-http-handler": "^2.3.1",
3939
"@smithy/hash-node": "^2.0.17",
4040
"@smithy/invalid-dependency": "^2.0.15",
4141
"@smithy/middleware-content-length": "^2.0.17",
4242
"@smithy/middleware-endpoint": "^2.2.3",
43-
"@smithy/middleware-retry": "^2.0.24",
43+
"@smithy/middleware-retry": "^2.0.25",
4444
"@smithy/middleware-serde": "^2.0.15",
4545
"@smithy/middleware-stack": "^2.0.9",
4646
"@smithy/node-config-provider": "^2.1.8",
4747
"@smithy/node-http-handler": "^2.2.1",
4848
"@smithy/protocol-http": "^3.0.11",
49-
"@smithy/smithy-client": "^2.1.18",
49+
"@smithy/smithy-client": "^2.2.0",
5050
"@smithy/types": "^2.7.0",
5151
"@smithy/url-parser": "^2.0.15",
5252
"@smithy/util-base64": "^2.0.1",
5353
"@smithy/util-body-length-browser": "^2.0.1",
5454
"@smithy/util-body-length-node": "^2.1.0",
55-
"@smithy/util-defaults-mode-browser": "^2.0.22",
56-
"@smithy/util-defaults-mode-node": "^2.0.29",
55+
"@smithy/util-defaults-mode-browser": "^2.0.23",
56+
"@smithy/util-defaults-mode-node": "^2.0.30",
5757
"@smithy/util-endpoints": "^1.0.7",
5858
"@smithy/util-retry": "^2.0.8",
5959
"@smithy/util-utf8": "^2.0.2",
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
// smithy-typescript generated code
2-
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
33
import { getSerdePlugin } from "@smithy/middleware-serde";
4-
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
54
import { Command as $Command } from "@smithy/smithy-client";
6-
import {
7-
FinalizeHandlerArguments,
8-
Handler,
9-
HandlerExecutionContext,
10-
HttpHandlerOptions as __HttpHandlerOptions,
11-
MetadataBearer as __MetadataBearer,
12-
MiddlewareStack,
13-
SerdeContext as __SerdeContext,
14-
SMITHY_CONTEXT_KEY,
15-
} from "@smithy/types";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
166

177
import { AccessAnalyzerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../AccessAnalyzerClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
189
import { ApplyArchiveRuleRequest } from "../models/models_0";
1910
import { de_ApplyArchiveRuleCommand, se_ApplyArchiveRuleCommand } from "../protocols/Aws_restJson1";
2011

@@ -81,75 +72,26 @@ export interface ApplyArchiveRuleCommandOutput extends __MetadataBearer {}
8172
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
8273
*
8374
*/
84-
export class ApplyArchiveRuleCommand extends $Command<
85-
ApplyArchiveRuleCommandInput,
86-
ApplyArchiveRuleCommandOutput,
87-
AccessAnalyzerClientResolvedConfig
88-
> {
89-
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
90-
return {
91-
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
92-
Endpoint: { type: "builtInParams", name: "endpoint" },
93-
Region: { type: "builtInParams", name: "region" },
94-
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
95-
};
96-
}
97-
98-
/**
99-
* @public
100-
*/
101-
constructor(readonly input: ApplyArchiveRuleCommandInput) {
102-
super();
103-
}
104-
105-
/**
106-
* @internal
107-
*/
108-
resolveMiddleware(
109-
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
110-
configuration: AccessAnalyzerClientResolvedConfig,
111-
options?: __HttpHandlerOptions
112-
): Handler<ApplyArchiveRuleCommandInput, ApplyArchiveRuleCommandOutput> {
113-
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
114-
this.middlewareStack.use(
115-
getEndpointPlugin(configuration, ApplyArchiveRuleCommand.getEndpointParameterInstructions())
116-
);
117-
118-
const stack = clientStack.concat(this.middlewareStack);
119-
120-
const { logger } = configuration;
121-
const clientName = "AccessAnalyzerClient";
122-
const commandName = "ApplyArchiveRuleCommand";
123-
const handlerExecutionContext: HandlerExecutionContext = {
124-
logger,
125-
clientName,
126-
commandName,
127-
inputFilterSensitiveLog: (_: any) => _,
128-
outputFilterSensitiveLog: (_: any) => _,
129-
[SMITHY_CONTEXT_KEY]: {
130-
service: "AccessAnalyzer",
131-
operation: "ApplyArchiveRule",
132-
},
133-
};
134-
const { requestHandler } = configuration;
135-
return stack.resolve(
136-
(request: FinalizeHandlerArguments<any>) =>
137-
requestHandler.handle(request.request as __HttpRequest, options || {}),
138-
handlerExecutionContext
139-
);
140-
}
141-
142-
/**
143-
* @internal
144-
*/
145-
private serialize(input: ApplyArchiveRuleCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
146-
return se_ApplyArchiveRuleCommand(input, context);
147-
}
148-
149-
/**
150-
* @internal
151-
*/
152-
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<ApplyArchiveRuleCommandOutput> {
153-
return de_ApplyArchiveRuleCommand(output, context);
154-
}
155-
}
75+
export class ApplyArchiveRuleCommand extends $Command
76+
.classBuilder<
77+
ApplyArchiveRuleCommandInput,
78+
ApplyArchiveRuleCommandOutput,
79+
AccessAnalyzerClientResolvedConfig,
80+
ServiceInputTypes,
81+
ServiceOutputTypes
82+
>()
83+
.ep({
84+
...commonParams,
85+
})
86+
.m(function (this: any, Command: any, cs: any, config: AccessAnalyzerClientResolvedConfig, o: any) {
87+
return [
88+
getSerdePlugin(config, this.serialize, this.deserialize),
89+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
90+
];
91+
})
92+
.s("AccessAnalyzer", "ApplyArchiveRule", {})
93+
.n("AccessAnalyzerClient", "ApplyArchiveRuleCommand")
94+
.f(void 0, void 0)
95+
.ser(se_ApplyArchiveRuleCommand)
96+
.de(de_ApplyArchiveRuleCommand)
97+
.build() {}
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
// smithy-typescript generated code
2-
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
33
import { getSerdePlugin } from "@smithy/middleware-serde";
4-
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
54
import { Command as $Command } from "@smithy/smithy-client";
6-
import {
7-
FinalizeHandlerArguments,
8-
Handler,
9-
HandlerExecutionContext,
10-
HttpHandlerOptions as __HttpHandlerOptions,
11-
MetadataBearer as __MetadataBearer,
12-
MiddlewareStack,
13-
SerdeContext as __SerdeContext,
14-
SMITHY_CONTEXT_KEY,
15-
} from "@smithy/types";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
166

177
import { AccessAnalyzerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../AccessAnalyzerClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
189
import { CancelPolicyGenerationRequest, CancelPolicyGenerationResponse } from "../models/models_0";
1910
import { de_CancelPolicyGenerationCommand, se_CancelPolicyGenerationCommand } from "../protocols/Aws_restJson1";
2011

@@ -75,75 +66,26 @@ export interface CancelPolicyGenerationCommandOutput extends CancelPolicyGenerat
7566
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
7667
*
7768
*/
78-
export class CancelPolicyGenerationCommand extends $Command<
79-
CancelPolicyGenerationCommandInput,
80-
CancelPolicyGenerationCommandOutput,
81-
AccessAnalyzerClientResolvedConfig
82-
> {
83-
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
84-
return {
85-
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
86-
Endpoint: { type: "builtInParams", name: "endpoint" },
87-
Region: { type: "builtInParams", name: "region" },
88-
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
89-
};
90-
}
91-
92-
/**
93-
* @public
94-
*/
95-
constructor(readonly input: CancelPolicyGenerationCommandInput) {
96-
super();
97-
}
98-
99-
/**
100-
* @internal
101-
*/
102-
resolveMiddleware(
103-
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
104-
configuration: AccessAnalyzerClientResolvedConfig,
105-
options?: __HttpHandlerOptions
106-
): Handler<CancelPolicyGenerationCommandInput, CancelPolicyGenerationCommandOutput> {
107-
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
108-
this.middlewareStack.use(
109-
getEndpointPlugin(configuration, CancelPolicyGenerationCommand.getEndpointParameterInstructions())
110-
);
111-
112-
const stack = clientStack.concat(this.middlewareStack);
113-
114-
const { logger } = configuration;
115-
const clientName = "AccessAnalyzerClient";
116-
const commandName = "CancelPolicyGenerationCommand";
117-
const handlerExecutionContext: HandlerExecutionContext = {
118-
logger,
119-
clientName,
120-
commandName,
121-
inputFilterSensitiveLog: (_: any) => _,
122-
outputFilterSensitiveLog: (_: any) => _,
123-
[SMITHY_CONTEXT_KEY]: {
124-
service: "AccessAnalyzer",
125-
operation: "CancelPolicyGeneration",
126-
},
127-
};
128-
const { requestHandler } = configuration;
129-
return stack.resolve(
130-
(request: FinalizeHandlerArguments<any>) =>
131-
requestHandler.handle(request.request as __HttpRequest, options || {}),
132-
handlerExecutionContext
133-
);
134-
}
135-
136-
/**
137-
* @internal
138-
*/
139-
private serialize(input: CancelPolicyGenerationCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
140-
return se_CancelPolicyGenerationCommand(input, context);
141-
}
142-
143-
/**
144-
* @internal
145-
*/
146-
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<CancelPolicyGenerationCommandOutput> {
147-
return de_CancelPolicyGenerationCommand(output, context);
148-
}
149-
}
69+
export class CancelPolicyGenerationCommand extends $Command
70+
.classBuilder<
71+
CancelPolicyGenerationCommandInput,
72+
CancelPolicyGenerationCommandOutput,
73+
AccessAnalyzerClientResolvedConfig,
74+
ServiceInputTypes,
75+
ServiceOutputTypes
76+
>()
77+
.ep({
78+
...commonParams,
79+
})
80+
.m(function (this: any, Command: any, cs: any, config: AccessAnalyzerClientResolvedConfig, o: any) {
81+
return [
82+
getSerdePlugin(config, this.serialize, this.deserialize),
83+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
84+
];
85+
})
86+
.s("AccessAnalyzer", "CancelPolicyGeneration", {})
87+
.n("AccessAnalyzerClient", "CancelPolicyGenerationCommand")
88+
.f(void 0, void 0)
89+
.ser(se_CancelPolicyGenerationCommand)
90+
.de(de_CancelPolicyGenerationCommand)
91+
.build() {}

0 commit comments

Comments
 (0)