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

fix: stop adding command mw repeatedly in resolveMiddleware() #1883

Merged
merged 1 commit into from
Jan 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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,6 +28,7 @@ export class CreateAnalyzerCommand extends $Command<
CreateAnalyzerCommandOutput,
AccessAnalyzerClientResolvedConfig
> {
private resolved = false;
// Start section: command_properties
// End section: command_properties

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Expand Down
Loading