Skip to content

Commit 5156e60

Browse files
committed
1 parent 853d833 commit 5156e60

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

packages/middleware-flexible-checksums/src/constants.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,48 @@
11
/**
22
* Determines when a checksum will be calculated for request payloads.
33
*/
4-
export enum RequestChecksumCalculation {
4+
export const RequestChecksumCalculation = {
55
/**
66
* When set, a checksum will be calculated for all request payloads of operations
77
* modeled with the {@link httpChecksum} trait where `requestChecksumRequired` is `true`
88
* AND/OR a `requestAlgorithmMember` is modeled.
99
* {@link https://smithy.io/2.0/aws/aws-core.html#aws-protocols-httpchecksum-trait httpChecksum}
1010
*/
11-
WHEN_SUPPORTED = "WHEN_SUPPORTED",
11+
WHEN_SUPPORTED: "WHEN_SUPPORTED",
1212

1313
/**
1414
* When set, a checksum will only be calculated for request payloads of operations
1515
* modeled with the {@link httpChecksum} trait where `requestChecksumRequired` is `true`
1616
* OR where a `requestAlgorithmMember` is modeled and the user sets it.
1717
* {@link https://smithy.io/2.0/aws/aws-core.html#aws-protocols-httpchecksum-trait httpChecksum}
1818
*/
19-
WHEN_REQUIRED = "WHEN_REQUIRED",
20-
}
19+
WHEN_REQUIRED: "WHEN_REQUIRED",
20+
} as const;
21+
22+
export type RequestChecksumCalculation = (typeof RequestChecksumCalculation)[keyof typeof RequestChecksumCalculation];
2123

2224
/**
2325
* Determines when checksum validation will be performed on response payloads.
2426
*/
25-
export enum ResponseChecksumValidation {
27+
export const ResponseChecksumValidation = {
2628
/**
2729
* When set, checksum validation MUST be performed on all response payloads of operations
2830
* modeled with the {@link httpChecksum} trait where `responseAlgorithms` is modeled,
2931
* except when no modeled checksum algorithms are supported by an SDK.
3032
* {@link https://smithy.io/2.0/aws/aws-core.html#aws-protocols-httpchecksum-trait httpChecksum}
3133
*/
32-
WHEN_SUPPORTED = "WHEN_SUPPORTED",
34+
WHEN_SUPPORTED: "WHEN_SUPPORTED",
3335

3436
/**
3537
* When set, checksum validation MUST NOT be performed on response payloads of operations UNLESS
3638
* the SDK supports the modeled checksum algorithms AND the user has set the `requestValidationModeMember` to `ENABLED`.
3739
* It is currently impossible to model an operation as requiring a response checksum,
3840
* but this setting leaves the door open for future updates.
3941
*/
40-
WHEN_REQUIRED = "WHEN_REQUIRED",
41-
}
42+
WHEN_REQUIRED: "WHEN_REQUIRED",
43+
} as const;
44+
45+
export type ResponseChecksumValidation = (typeof ResponseChecksumValidation)[keyof typeof ResponseChecksumValidation];
4246

4347
/**
4448
* Checksum Algorithms supported by the SDK.

0 commit comments

Comments
 (0)