Skip to content

Commit

Permalink
chore(clients): add automatic id tokens for header values (#6260)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr authored Jul 9, 2024
1 parent 9199fba commit 2697d89
Show file tree
Hide file tree
Showing 18 changed files with 80 additions and 80 deletions.
2 changes: 1 addition & 1 deletion clients/client-appconfig/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export const se_CreateHostedConfigurationVersionCommand = async (
): Promise<__HttpRequest> => {
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
[_ct]: input[_CT]! || "application/octet-stream",
[_ct]: input[_CT] || "application/octet-stream",
[_d]: input[_D]!,
[_lvn]: [() => isSerializableHeaderValue(input[_LVN]), () => input[_LVN]!.toString()],
[_v]: input[_VL]!,
Expand Down
4 changes: 2 additions & 2 deletions clients/client-bedrock-runtime/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export const se_InvokeModelCommand = async (
): Promise<__HttpRequest> => {
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
[_ct]: input[_cT]! || "application/octet-stream",
[_ct]: input[_cT] || "application/octet-stream",
[_a]: input[_a]!,
[_xabt]: input[_t]!,
[_xabg]: input[_gI]!,
Expand All @@ -175,7 +175,7 @@ export const se_InvokeModelWithResponseStreamCommand = async (
): Promise<__HttpRequest> => {
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
[_ct]: input[_cT]! || "application/octet-stream",
[_ct]: input[_cT] || "application/octet-stream",
[_xaba]: input[_a]!,
[_xabt]: input[_t]!,
[_xabg]: input[_gI]!,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export const se_CreateBillingGroupCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_CT]!,
[_xact]: input[_CT] ?? generateIdempotencyToken(),
});
b.bp("/create-billing-group");
let body: any;
Expand Down Expand Up @@ -286,7 +286,7 @@ export const se_CreateCustomLineItemCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_CT]!,
[_xact]: input[_CT] ?? generateIdempotencyToken(),
});
b.bp("/create-custom-line-item");
let body: any;
Expand Down Expand Up @@ -315,7 +315,7 @@ export const se_CreatePricingPlanCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_CT]!,
[_xact]: input[_CT] ?? generateIdempotencyToken(),
});
b.bp("/create-pricing-plan");
let body: any;
Expand All @@ -341,7 +341,7 @@ export const se_CreatePricingRuleCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_CT]!,
[_xact]: input[_CT] ?? generateIdempotencyToken(),
});
b.bp("/create-pricing-rule");
let body: any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const se_UploadDocumentsCommand = async (
): Promise<__HttpRequest> => {
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
[_ct]: input[_cT]! || "application/octet-stream",
[_ct]: input[_cT] || "application/octet-stream",
});
b.bp("/2013-01-01/documents/batch");
const query: any = map({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ export const se_PostAgentProfileCommand = async (
): Promise<__HttpRequest> => {
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
[_ct]: input[_cTo]! || "application/octet-stream",
[_ct]: input[_cTo] || "application/octet-stream",
});
b.bp("/profilingGroups/{profilingGroupName}/agentProfile");
b.p("profilingGroupName", () => input.profilingGroupName!, "{profilingGroupName}", false);
Expand Down
40 changes: 20 additions & 20 deletions clients/client-deadline/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ export const se_CreateBudgetCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/farms/{farmId}/budgets");
b.p("farmId", () => input.farmId!, "{farmId}", false);
Expand Down Expand Up @@ -740,7 +740,7 @@ export const se_CreateFarmCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/farms");
let body: any;
Expand Down Expand Up @@ -774,7 +774,7 @@ export const se_CreateFleetCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/farms/{farmId}/fleets");
b.p("farmId", () => input.farmId!, "{farmId}", false);
Expand Down Expand Up @@ -812,7 +812,7 @@ export const se_CreateJobCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/farms/{farmId}/queues/{queueId}/jobs");
b.p("farmId", () => input.farmId!, "{farmId}", false);
Expand Down Expand Up @@ -853,7 +853,7 @@ export const se_CreateLicenseEndpointCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/license-endpoints");
let body: any;
Expand Down Expand Up @@ -887,7 +887,7 @@ export const se_CreateMonitorCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/monitors");
let body: any;
Expand Down Expand Up @@ -921,7 +921,7 @@ export const se_CreateQueueCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/farms/{farmId}/queues");
b.p("farmId", () => input.farmId!, "{farmId}", false);
Expand Down Expand Up @@ -961,7 +961,7 @@ export const se_CreateQueueEnvironmentCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/farms/{farmId}/queues/{queueId}/environments");
b.p("farmId", () => input.farmId!, "{farmId}", false);
Expand Down Expand Up @@ -1028,7 +1028,7 @@ export const se_CreateStorageProfileCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/farms/{farmId}/storage-profiles");
b.p("farmId", () => input.farmId!, "{farmId}", false);
Expand Down Expand Up @@ -1062,7 +1062,7 @@ export const se_CreateWorkerCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/farms/{farmId}/fleets/{fleetId}/workers");
b.p("farmId", () => input.farmId!, "{farmId}", false);
Expand Down Expand Up @@ -1143,7 +1143,7 @@ export const se_DeleteFleetCommand = async (
): Promise<__HttpRequest> => {
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/farms/{farmId}/fleets/{fleetId}");
b.p("farmId", () => input.farmId!, "{farmId}", false);
Expand Down Expand Up @@ -2935,7 +2935,7 @@ export const se_UpdateBudgetCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/farms/{farmId}/budgets/{budgetId}");
b.p("farmId", () => input.farmId!, "{farmId}", false);
Expand Down Expand Up @@ -3006,7 +3006,7 @@ export const se_UpdateFleetCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/farms/{farmId}/fleets/{fleetId}");
b.p("farmId", () => input.farmId!, "{farmId}", false);
Expand Down Expand Up @@ -3044,7 +3044,7 @@ export const se_UpdateJobCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/farms/{farmId}/queues/{queueId}/jobs/{jobId}");
b.p("farmId", () => input.farmId!, "{farmId}", false);
Expand Down Expand Up @@ -3115,7 +3115,7 @@ export const se_UpdateQueueCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/farms/{farmId}/queues/{queueId}");
b.p("farmId", () => input.farmId!, "{farmId}", false);
Expand Down Expand Up @@ -3157,7 +3157,7 @@ export const se_UpdateQueueEnvironmentCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/farms/{farmId}/queues/{queueId}/environments/{queueEnvironmentId}");
b.p("farmId", () => input.farmId!, "{farmId}", false);
Expand Down Expand Up @@ -3226,7 +3226,7 @@ export const se_UpdateSessionCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/farms/{farmId}/queues/{queueId}/jobs/{jobId}/sessions/{sessionId}");
b.p("farmId", () => input.farmId!, "{farmId}", false);
Expand Down Expand Up @@ -3261,7 +3261,7 @@ export const se_UpdateStepCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/farms/{farmId}/queues/{queueId}/jobs/{jobId}/steps/{stepId}");
b.p("farmId", () => input.farmId!, "{farmId}", false);
Expand Down Expand Up @@ -3296,7 +3296,7 @@ export const se_UpdateStorageProfileCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/farms/{farmId}/storage-profiles/{storageProfileId}");
b.p("farmId", () => input.farmId!, "{farmId}", false);
Expand Down Expand Up @@ -3332,7 +3332,7 @@ export const se_UpdateTaskCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_cT]!,
[_xact]: input[_cT] ?? generateIdempotencyToken(),
});
b.bp("/2023-10-12/farms/{farmId}/queues/{queueId}/jobs/{jobId}/steps/{stepId}/tasks/{taskId}");
b.p("farmId", () => input.farmId!, "{farmId}", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const se_PostContentCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"x-amz-content-sha256": "UNSIGNED-PAYLOAD",
[_ct]: input[_cT]! || "application/octet-stream",
[_ct]: input[_cT] || "application/octet-stream",
[_xalsa]: [
() => isSerializableHeaderValue(input[_sA]),
() => context.base64Encoder(Buffer.from(__LazyJsonString.fromObject(input[_sA]!))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export const se_RecognizeUtteranceCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"x-amz-content-sha256": "UNSIGNED-PAYLOAD",
[_ct]: input[_rCTe]! || "application/octet-stream",
[_ct]: input[_rCTe] || "application/octet-stream",
[_xalss]: input[_sS]!,
[_xalra]: input[_rA]!,
[_rct]: input[_rCT]!,
Expand Down
22 changes: 11 additions & 11 deletions clients/client-lookoutvision/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const se_CreateDatasetCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_CT]!,
[_xact]: input[_CT] ?? generateIdempotencyToken(),
});
b.bp("/2020-11-20/projects/{ProjectName}/datasets");
b.p("ProjectName", () => input.ProjectName!, "{ProjectName}", false);
Expand All @@ -133,7 +133,7 @@ export const se_CreateModelCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_CT]!,
[_xact]: input[_CT] ?? generateIdempotencyToken(),
});
b.bp("/2020-11-20/projects/{ProjectName}/models");
b.p("ProjectName", () => input.ProjectName!, "{ProjectName}", false);
Expand All @@ -160,7 +160,7 @@ export const se_CreateProjectCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_CT]!,
[_xact]: input[_CT] ?? generateIdempotencyToken(),
});
b.bp("/2020-11-20/projects");
let body: any;
Expand All @@ -182,7 +182,7 @@ export const se_DeleteDatasetCommand = async (
): Promise<__HttpRequest> => {
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
[_xact]: input[_CT]!,
[_xact]: input[_CT] ?? generateIdempotencyToken(),
});
b.bp("/2020-11-20/projects/{ProjectName}/datasets/{DatasetType}");
b.p("ProjectName", () => input.ProjectName!, "{ProjectName}", false);
Expand All @@ -201,7 +201,7 @@ export const se_DeleteModelCommand = async (
): Promise<__HttpRequest> => {
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
[_xact]: input[_CT]!,
[_xact]: input[_CT] ?? generateIdempotencyToken(),
});
b.bp("/2020-11-20/projects/{ProjectName}/models/{ModelVersion}");
b.p("ProjectName", () => input.ProjectName!, "{ProjectName}", false);
Expand All @@ -220,7 +220,7 @@ export const se_DeleteProjectCommand = async (
): Promise<__HttpRequest> => {
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
[_xact]: input[_CT]!,
[_xact]: input[_CT] ?? generateIdempotencyToken(),
});
b.bp("/2020-11-20/projects/{ProjectName}");
b.p("ProjectName", () => input.ProjectName!, "{ProjectName}", false);
Expand Down Expand Up @@ -305,7 +305,7 @@ export const se_DetectAnomaliesCommand = async (
): Promise<__HttpRequest> => {
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
[_ct]: input[_CTo]! || "application/octet-stream",
[_ct]: input[_CTo] || "application/octet-stream",
});
b.bp("/2020-11-20/projects/{ProjectName}/models/{ModelVersion}/detect");
b.p("ProjectName", () => input.ProjectName!, "{ProjectName}", false);
Expand Down Expand Up @@ -429,7 +429,7 @@ export const se_StartModelCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_CT]!,
[_xact]: input[_CT] ?? generateIdempotencyToken(),
});
b.bp("/2020-11-20/projects/{ProjectName}/models/{ModelVersion}/start");
b.p("ProjectName", () => input.ProjectName!, "{ProjectName}", false);
Expand All @@ -455,7 +455,7 @@ export const se_StartModelPackagingJobCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_CT]!,
[_xact]: input[_CT] ?? generateIdempotencyToken(),
});
b.bp("/2020-11-20/projects/{ProjectName}/modelpackagingjobs");
b.p("ProjectName", () => input.ProjectName!, "{ProjectName}", false);
Expand All @@ -481,7 +481,7 @@ export const se_StopModelCommand = async (
): Promise<__HttpRequest> => {
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
[_xact]: input[_CT]!,
[_xact]: input[_CT] ?? generateIdempotencyToken(),
});
b.bp("/2020-11-20/projects/{ProjectName}/models/{ModelVersion}/stop");
b.p("ProjectName", () => input.ProjectName!, "{ProjectName}", false);
Expand Down Expand Up @@ -546,7 +546,7 @@ export const se_UpdateDatasetEntriesCommand = async (
const b = rb(input, context);
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
[_xact]: input[_CT]!,
[_xact]: input[_CT] ?? generateIdempotencyToken(),
});
b.bp("/2020-11-20/projects/{ProjectName}/datasets/{DatasetType}/entries");
b.p("ProjectName", () => input.ProjectName!, "{ProjectName}", false);
Expand Down
Loading

0 comments on commit 2697d89

Please sign in to comment.