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(codegen): generate idempotencyToken default for queryParams #4272

Merged
merged 3 commits into from
Dec 12, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export const serializeAws_restJson1DeleteAnalyzerCommand = async (
false
);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
return new __HttpRequest({
Expand Down Expand Up @@ -333,7 +333,7 @@ export const serializeAws_restJson1DeleteArchiveRuleCommand = async (
);
resolvedPath = __resolvedPath(resolvedPath, input, "ruleName", () => input.ruleName!, "{ruleName}", false);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
return new __HttpRequest({
Expand Down
8 changes: 4 additions & 4 deletions clients/client-amp/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export const serializeAws_restJson1DeleteAlertManagerDefinitionCommand = async (
"/workspaces/{workspaceId}/alertmanager/definition";
resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", () => input.workspaceId!, "{workspaceId}", false);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
return new __HttpRequest({
Expand All @@ -255,7 +255,7 @@ export const serializeAws_restJson1DeleteLoggingConfigurationCommand = async (
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}/logging";
resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", () => input.workspaceId!, "{workspaceId}", false);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
return new __HttpRequest({
Expand All @@ -282,7 +282,7 @@ export const serializeAws_restJson1DeleteRuleGroupsNamespaceCommand = async (
resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", () => input.workspaceId!, "{workspaceId}", false);
resolvedPath = __resolvedPath(resolvedPath, input, "name", () => input.name!, "{name}", false);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
return new __HttpRequest({
Expand All @@ -307,7 +307,7 @@ export const serializeAws_restJson1DeleteWorkspaceCommand = async (
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/workspaces/{workspaceId}";
resolvedPath = __resolvedPath(resolvedPath, input, "workspaceId", () => input.workspaceId!, "{workspaceId}", false);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
return new __HttpRequest({
Expand Down
12 changes: 6 additions & 6 deletions clients/client-amplifyuibuilder/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const serializeAws_restJson1CreateComponentCommand = async (
false
);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
if (input.componentToCreate !== undefined) {
Expand Down Expand Up @@ -166,7 +166,7 @@ export const serializeAws_restJson1CreateFormCommand = async (
false
);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
if (input.formToCreate !== undefined) {
Expand Down Expand Up @@ -209,7 +209,7 @@ export const serializeAws_restJson1CreateThemeCommand = async (
false
);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
if (input.themeToCreate !== undefined) {
Expand Down Expand Up @@ -775,7 +775,7 @@ export const serializeAws_restJson1UpdateComponentCommand = async (
);
resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id!, "{id}", false);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
if (input.updatedComponent !== undefined) {
Expand Down Expand Up @@ -819,7 +819,7 @@ export const serializeAws_restJson1UpdateFormCommand = async (
);
resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id!, "{id}", false);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
if (input.updatedForm !== undefined) {
Expand Down Expand Up @@ -863,7 +863,7 @@ export const serializeAws_restJson1UpdateThemeCommand = async (
);
resolvedPath = __resolvedPath(resolvedPath, input, "id", () => input.id!, "{id}", false);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
if (input.updatedTheme !== undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ export const serializeAws_restJson1PostAgentProfileCommand = async (
false
);
const query: any = map({
profileToken: [, input.profileToken!],
profileToken: [, input.profileToken ?? generateIdempotencyToken()],
});
let body: any;
if (input.agentProfile !== undefined) {
Expand Down
2 changes: 1 addition & 1 deletion clients/client-connect/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3916,7 +3916,7 @@ export const serializeAws_restJson1ReleasePhoneNumberCommand = async (
false
);
const query: any = map({
clientToken: [, input.ClientToken!],
clientToken: [, input.ClientToken ?? generateIdempotencyToken()],
});
let body: any;
return new __HttpRequest({
Expand Down
6 changes: 3 additions & 3 deletions clients/client-finspace-data/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export const serializeAws_restJson1DeleteDatasetCommand = async (
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/datasetsv2/{datasetId}";
resolvedPath = __resolvedPath(resolvedPath, input, "datasetId", () => input.datasetId!, "{datasetId}", false);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
return new __HttpRequest({
Expand Down Expand Up @@ -349,7 +349,7 @@ export const serializeAws_restJson1DeletePermissionGroupCommand = async (
false
);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
return new __HttpRequest({
Expand Down Expand Up @@ -408,7 +408,7 @@ export const serializeAws_restJson1DisassociateUserFromPermissionGroupCommand =
);
resolvedPath = __resolvedPath(resolvedPath, input, "userId", () => input.userId!, "{userId}", false);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
return new __HttpRequest({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const serializeAws_restJson1DeleteApplicationCommand = async (
false
);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
return new __HttpRequest({
Expand Down
12 changes: 6 additions & 6 deletions clients/client-iotsitewise/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ export const serializeAws_restJson1DeleteAccessPolicyCommand = async (
false
);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
let { hostname: resolvedHostname } = await context.endpoint();
Expand Down Expand Up @@ -937,7 +937,7 @@ export const serializeAws_restJson1DeleteAssetCommand = async (
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assets/{assetId}";
resolvedPath = __resolvedPath(resolvedPath, input, "assetId", () => input.assetId!, "{assetId}", false);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
let { hostname: resolvedHostname } = await context.endpoint();
Expand Down Expand Up @@ -976,7 +976,7 @@ export const serializeAws_restJson1DeleteAssetModelCommand = async (
false
);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
let { hostname: resolvedHostname } = await context.endpoint();
Expand Down Expand Up @@ -1008,7 +1008,7 @@ export const serializeAws_restJson1DeleteDashboardCommand = async (
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/dashboards/{dashboardId}";
resolvedPath = __resolvedPath(resolvedPath, input, "dashboardId", () => input.dashboardId!, "{dashboardId}", false);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
let { hostname: resolvedHostname } = await context.endpoint();
Expand Down Expand Up @@ -1067,7 +1067,7 @@ export const serializeAws_restJson1DeletePortalCommand = async (
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/portals/{portalId}";
resolvedPath = __resolvedPath(resolvedPath, input, "portalId", () => input.portalId!, "{portalId}", false);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
let { hostname: resolvedHostname } = await context.endpoint();
Expand Down Expand Up @@ -1098,7 +1098,7 @@ export const serializeAws_restJson1DeleteProjectCommand = async (
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/projects/{projectId}";
resolvedPath = __resolvedPath(resolvedPath, input, "projectId", () => input.projectId!, "{projectId}", false);
const query: any = map({
clientToken: [, input.clientToken!],
clientToken: [, input.clientToken ?? generateIdempotencyToken()],
});
let body: any;
let { hostname: resolvedHostname } = await context.endpoint();
Expand Down
4 changes: 2 additions & 2 deletions clients/client-scheduler/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const serializeAws_restJson1DeleteScheduleCommand = async (
resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name!, "{Name}", false);
const query: any = map({
groupName: [, input.GroupName!],
clientToken: [, input.ClientToken!],
clientToken: [, input.ClientToken ?? generateIdempotencyToken()],
});
let body: any;
return new __HttpRequest({
Expand All @@ -168,7 +168,7 @@ export const serializeAws_restJson1DeleteScheduleGroupCommand = async (
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/schedule-groups/{Name}";
resolvedPath = __resolvedPath(resolvedPath, input, "Name", () => input.Name!, "{Name}", false);
const query: any = map({
clientToken: [, input.ClientToken!],
clientToken: [, input.ClientToken ?? generateIdempotencyToken()],
});
let body: any;
return new __HttpRequest({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2426,7 +2426,7 @@ export const serializeAws_restJson1QueryIdempotencyTokenAutoFillCommand = async
const resolvedPath =
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/QueryIdempotencyTokenAutoFill";
const query: any = map({
token: [, input.token!],
token: [, input.token ?? generateIdempotencyToken()],
});
let body: any;
return new __HttpRequest({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ export const serializeAws_restXmlQueryIdempotencyTokenAutoFillCommand = async (
const resolvedPath =
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/QueryIdempotencyTokenAutoFill";
const query: any = map({
token: [, input.token!],
token: [, input.token ?? generateIdempotencyToken()],
});
let body: any;
return new __HttpRequest({
Expand Down