diff --git a/packages/middleware-flexible-checksums/src/resolveFlexibleChecksumsConfig.spec.ts b/packages/middleware-flexible-checksums/src/resolveFlexibleChecksumsConfig.spec.ts index 7bb1cd64f0d68..59d909a607f39 100644 --- a/packages/middleware-flexible-checksums/src/resolveFlexibleChecksumsConfig.spec.ts +++ b/packages/middleware-flexible-checksums/src/resolveFlexibleChecksumsConfig.spec.ts @@ -1,6 +1,11 @@ import { normalizeProvider } from "@smithy/util-middleware"; -import { DEFAULT_REQUEST_CHECKSUM_CALCULATION, DEFAULT_RESPONSE_CHECKSUM_VALIDATION } from "./constants"; +import { + DEFAULT_REQUEST_CHECKSUM_CALCULATION, + DEFAULT_RESPONSE_CHECKSUM_VALIDATION, + RequestChecksumCalculation, + ResponseChecksumValidation, +} from "./constants"; import { resolveFlexibleChecksumsConfig } from "./resolveFlexibleChecksumsConfig"; jest.mock("@smithy/util-middleware"); @@ -25,8 +30,8 @@ describe(resolveFlexibleChecksumsConfig.name, () => { it("normalizes client checksums configuration", () => { const mockInput = { - requestChecksumCalculation: "WHEN_REQUIRED", - responseChecksumValidation: "WHEN_REQUIRED", + requestChecksumCalculation: RequestChecksumCalculation.WHEN_REQUIRED, + responseChecksumValidation: ResponseChecksumValidation.WHEN_REQUIRED, }; const resolvedConfig = resolveFlexibleChecksumsConfig(mockInput); expect(resolvedConfig).toEqual(mockInput); diff --git a/packages/middleware-flexible-checksums/src/resolveFlexibleChecksumsConfig.ts b/packages/middleware-flexible-checksums/src/resolveFlexibleChecksumsConfig.ts index b57f894b23fbd..57cfd22e7ed91 100644 --- a/packages/middleware-flexible-checksums/src/resolveFlexibleChecksumsConfig.ts +++ b/packages/middleware-flexible-checksums/src/resolveFlexibleChecksumsConfig.ts @@ -1,23 +1,28 @@ import { Provider } from "@smithy/types"; import { normalizeProvider } from "@smithy/util-middleware"; -import { DEFAULT_REQUEST_CHECKSUM_CALCULATION, DEFAULT_RESPONSE_CHECKSUM_VALIDATION } from "./constants"; +import { + DEFAULT_REQUEST_CHECKSUM_CALCULATION, + DEFAULT_RESPONSE_CHECKSUM_VALIDATION, + RequestChecksumCalculation, + ResponseChecksumValidation, +} from "./constants"; export interface FlexibleChecksumsInputConfig { /** * Determines when a checksum will be calculated for request payloads. */ - requestChecksumCalculation?: string | Provider; + requestChecksumCalculation?: RequestChecksumCalculation | Provider; /** * Determines when checksum validation will be performed on response payloads. */ - responseChecksumValidation?: string | Provider; + responseChecksumValidation?: ResponseChecksumValidation | Provider; } export interface FlexibleChecksumsResolvedConfig { - requestChecksumCalculation: Provider; - responseChecksumValidation: Provider; + requestChecksumCalculation: Provider; + responseChecksumValidation: Provider; } export const resolveFlexibleChecksumsConfig = (