Skip to content

Commit

Permalink
feat(middleware-stack): allow adding middleware to override an existi…
Browse files Browse the repository at this point in the history
…ng one (#1964)

* feat(middleware-stack): allow adding middleware to override an existing one

* fix: add override config to all native middleware

* fix: remove resolved flag in commands(revert #1883)

This reverts commit d4c302b.
  • Loading branch information
AllanZhengYP authored Jan 28, 2021
1 parent ea93d22 commit 9c21f14
Show file tree
Hide file tree
Showing 8,982 changed files with 9,382 additions and 45,041 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class CreateAnalyzerCommand extends $Command<
CreateAnalyzerCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -46,10 +45,7 @@ export class CreateAnalyzerCommand extends $Command<
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<CreateAnalyzerCommandInput, CreateAnalyzerCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class CreateArchiveRuleCommand extends $Command<
CreateArchiveRuleCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -47,10 +46,7 @@ export class CreateArchiveRuleCommand extends $Command<
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<CreateArchiveRuleCommandInput, CreateArchiveRuleCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export class DeleteAnalyzerCommand extends $Command<
DeleteAnalyzerCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -48,10 +47,7 @@ export class DeleteAnalyzerCommand extends $Command<
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<DeleteAnalyzerCommandInput, DeleteAnalyzerCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class DeleteArchiveRuleCommand extends $Command<
DeleteArchiveRuleCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -46,10 +45,7 @@ export class DeleteArchiveRuleCommand extends $Command<
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<DeleteArchiveRuleCommandInput, DeleteArchiveRuleCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class GetAnalyzedResourceCommand extends $Command<
GetAnalyzedResourceCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -46,10 +45,7 @@ export class GetAnalyzedResourceCommand extends $Command<
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<GetAnalyzedResourceCommandInput, GetAnalyzedResourceCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
6 changes: 1 addition & 5 deletions clients/client-accessanalyzer/commands/GetAnalyzerCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class GetAnalyzerCommand extends $Command<
GetAnalyzerCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -46,10 +45,7 @@ export class GetAnalyzerCommand extends $Command<
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<GetAnalyzerCommandInput, GetAnalyzerCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class GetArchiveRuleCommand extends $Command<
GetArchiveRuleCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -46,10 +45,7 @@ export class GetArchiveRuleCommand extends $Command<
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<GetArchiveRuleCommandInput, GetArchiveRuleCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
6 changes: 1 addition & 5 deletions clients/client-accessanalyzer/commands/GetFindingCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class GetFindingCommand extends $Command<
GetFindingCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -46,10 +45,7 @@ export class GetFindingCommand extends $Command<
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<GetFindingCommandInput, GetFindingCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class ListAnalyzedResourcesCommand extends $Command<
ListAnalyzedResourcesCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -47,10 +46,7 @@ export class ListAnalyzedResourcesCommand extends $Command<
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ListAnalyzedResourcesCommandInput, ListAnalyzedResourcesCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class ListAnalyzersCommand extends $Command<
ListAnalyzersCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -46,10 +45,7 @@ export class ListAnalyzersCommand extends $Command<
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ListAnalyzersCommandInput, ListAnalyzersCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class ListArchiveRulesCommand extends $Command<
ListArchiveRulesCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -46,10 +45,7 @@ export class ListArchiveRulesCommand extends $Command<
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ListArchiveRulesCommandInput, ListArchiveRulesCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class ListFindingsCommand extends $Command<
ListFindingsCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -46,10 +45,7 @@ export class ListFindingsCommand extends $Command<
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ListFindingsCommandInput, ListFindingsCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class ListTagsForResourceCommand extends $Command<
ListTagsForResourceCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -46,10 +45,7 @@ export class ListTagsForResourceCommand extends $Command<
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ListTagsForResourceCommandInput, ListTagsForResourceCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class StartResourceScanCommand extends $Command<
StartResourceScanCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -46,10 +45,7 @@ export class StartResourceScanCommand extends $Command<
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<StartResourceScanCommandInput, StartResourceScanCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
6 changes: 1 addition & 5 deletions clients/client-accessanalyzer/commands/TagResourceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class TagResourceCommand extends $Command<
TagResourceCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -46,10 +45,7 @@ export class TagResourceCommand extends $Command<
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<TagResourceCommandInput, TagResourceCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class UntagResourceCommand extends $Command<
UntagResourceCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -46,10 +45,7 @@ export class UntagResourceCommand extends $Command<
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<UntagResourceCommandInput, UntagResourceCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class UpdateArchiveRuleCommand extends $Command<
UpdateArchiveRuleCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -46,10 +45,7 @@ export class UpdateArchiveRuleCommand extends $Command<
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<UpdateArchiveRuleCommandInput, UpdateArchiveRuleCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class UpdateFindingsCommand extends $Command<
UpdateFindingsCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -46,10 +45,7 @@ export class UpdateFindingsCommand extends $Command<
configuration: AccessAnalyzerClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<UpdateFindingsCommandInput, UpdateFindingsCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export class CreateCertificateAuthorityAuditReportCommand extends $Command<
CreateCertificateAuthorityAuditReportCommandOutput,
ACMPCAClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -65,10 +64,7 @@ export class CreateCertificateAuthorityAuditReportCommand extends $Command<
configuration: ACMPCAClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<CreateCertificateAuthorityAuditReportCommandInput, CreateCertificateAuthorityAuditReportCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export class CreateCertificateAuthorityCommand extends $Command<
CreateCertificateAuthorityCommandOutput,
ACMPCAClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

Expand All @@ -64,10 +63,7 @@ export class CreateCertificateAuthorityCommand extends $Command<
configuration: ACMPCAClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<CreateCertificateAuthorityCommandInput, CreateCertificateAuthorityCommandOutput> {
if (!this.resolved) {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.resolved = true;
}
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

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

Expand Down
Loading

0 comments on commit 9c21f14

Please sign in to comment.