@aws-sdk/client-signer 3.35.0 → 3.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist-cjs/Signer.js +0 -20
  3. package/dist-cjs/SignerClient.js +0 -25
  4. package/dist-cjs/commands/AddProfilePermissionCommand.js +0 -25
  5. package/dist-cjs/commands/CancelSigningProfileCommand.js +0 -28
  6. package/dist-cjs/commands/DescribeSigningJobCommand.js +0 -27
  7. package/dist-cjs/commands/GetSigningPlatformCommand.js +0 -25
  8. package/dist-cjs/commands/GetSigningProfileCommand.js +0 -25
  9. package/dist-cjs/commands/ListProfilePermissionsCommand.js +0 -25
  10. package/dist-cjs/commands/ListSigningJobsCommand.js +0 -31
  11. package/dist-cjs/commands/ListSigningPlatformsCommand.js +0 -31
  12. package/dist-cjs/commands/ListSigningProfilesCommand.js +0 -32
  13. package/dist-cjs/commands/ListTagsForResourceCommand.js +0 -25
  14. package/dist-cjs/commands/PutSigningProfileCommand.js +0 -27
  15. package/dist-cjs/commands/RemoveProfilePermissionCommand.js +0 -25
  16. package/dist-cjs/commands/RevokeSignatureCommand.js +0 -26
  17. package/dist-cjs/commands/RevokeSigningProfileCommand.js +0 -27
  18. package/dist-cjs/commands/StartSigningJobCommand.js +0 -52
  19. package/dist-cjs/commands/TagResourceCommand.js +0 -28
  20. package/dist-cjs/commands/UntagResourceCommand.js +0 -26
  21. package/dist-cjs/commands/index.js +20 -0
  22. package/dist-cjs/endpoints.js +1 -2
  23. package/dist-cjs/index.js +5 -25
  24. package/dist-cjs/models/index.js +0 -1
  25. package/dist-cjs/models/models_0.js +0 -184
  26. package/dist-cjs/pagination/Interfaces.js +0 -1
  27. package/dist-cjs/pagination/ListSigningJobsPaginator.js +0 -11
  28. package/dist-cjs/pagination/ListSigningPlatformsPaginator.js +0 -11
  29. package/dist-cjs/pagination/ListSigningProfilesPaginator.js +0 -11
  30. package/dist-cjs/pagination/index.js +7 -0
  31. package/dist-cjs/protocols/Aws_restJson1.js +0 -6
  32. package/dist-cjs/runtimeConfig.browser.js +1 -6
  33. package/dist-cjs/runtimeConfig.js +2 -7
  34. package/dist-cjs/runtimeConfig.native.js +0 -4
  35. package/dist-cjs/runtimeConfig.shared.js +0 -4
  36. package/dist-cjs/waiters/index.js +4 -0
  37. package/dist-cjs/waiters/waitForSuccessfulSigningJob.js +0 -10
  38. package/dist-es/Signer.js +0 -1
  39. package/dist-es/SignerClient.js +0 -1
  40. package/dist-es/commands/AddProfilePermissionCommand.js +0 -1
  41. package/dist-es/commands/CancelSigningProfileCommand.js +0 -1
  42. package/dist-es/commands/DescribeSigningJobCommand.js +0 -1
  43. package/dist-es/commands/GetSigningPlatformCommand.js +0 -1
  44. package/dist-es/commands/GetSigningProfileCommand.js +0 -1
  45. package/dist-es/commands/ListProfilePermissionsCommand.js +0 -1
  46. package/dist-es/commands/ListSigningJobsCommand.js +0 -1
  47. package/dist-es/commands/ListSigningPlatformsCommand.js +0 -1
  48. package/dist-es/commands/ListSigningProfilesCommand.js +0 -1
  49. package/dist-es/commands/ListTagsForResourceCommand.js +0 -1
  50. package/dist-es/commands/PutSigningProfileCommand.js +0 -1
  51. package/dist-es/commands/RemoveProfilePermissionCommand.js +0 -1
  52. package/dist-es/commands/RevokeSignatureCommand.js +0 -1
  53. package/dist-es/commands/RevokeSigningProfileCommand.js +0 -1
  54. package/dist-es/commands/StartSigningJobCommand.js +0 -1
  55. package/dist-es/commands/TagResourceCommand.js +0 -1
  56. package/dist-es/commands/UntagResourceCommand.js +0 -1
  57. package/dist-es/commands/index.js +17 -0
  58. package/dist-es/endpoints.js +1 -2
  59. package/dist-es/index.js +5 -25
  60. package/dist-es/models/index.js +0 -1
  61. package/dist-es/models/models_0.js +0 -1
  62. package/dist-es/pagination/Interfaces.js +0 -1
  63. package/dist-es/pagination/ListSigningJobsPaginator.js +0 -1
  64. package/dist-es/pagination/ListSigningPlatformsPaginator.js +0 -1
  65. package/dist-es/pagination/ListSigningProfilesPaginator.js +0 -1
  66. package/dist-es/pagination/index.js +4 -0
  67. package/dist-es/protocols/Aws_restJson1.js +0 -1
  68. package/dist-es/runtimeConfig.browser.js +1 -2
  69. package/dist-es/runtimeConfig.js +2 -3
  70. package/dist-es/runtimeConfig.native.js +0 -1
  71. package/dist-es/runtimeConfig.shared.js +0 -1
  72. package/dist-es/waiters/index.js +1 -0
  73. package/dist-es/waiters/waitForSuccessfulSigningJob.js +0 -1
  74. package/dist-types/commands/index.d.ts +17 -0
  75. package/dist-types/index.d.ts +5 -24
  76. package/dist-types/pagination/index.d.ts +4 -0
  77. package/dist-types/ts3.4/Signer.d.ts +18 -130
  78. package/dist-types/ts3.4/SignerClient.d.ts +24 -105
  79. package/dist-types/ts3.4/commands/AddProfilePermissionCommand.d.ts +2 -20
  80. package/dist-types/ts3.4/commands/CancelSigningProfileCommand.d.ts +2 -23
  81. package/dist-types/ts3.4/commands/DescribeSigningJobCommand.d.ts +2 -22
  82. package/dist-types/ts3.4/commands/GetSigningPlatformCommand.d.ts +2 -20
  83. package/dist-types/ts3.4/commands/GetSigningProfileCommand.d.ts +2 -20
  84. package/dist-types/ts3.4/commands/ListProfilePermissionsCommand.d.ts +2 -20
  85. package/dist-types/ts3.4/commands/ListSigningJobsCommand.d.ts +2 -26
  86. package/dist-types/ts3.4/commands/ListSigningPlatformsCommand.d.ts +2 -26
  87. package/dist-types/ts3.4/commands/ListSigningProfilesCommand.d.ts +2 -27
  88. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +2 -20
  89. package/dist-types/ts3.4/commands/PutSigningProfileCommand.d.ts +2 -22
  90. package/dist-types/ts3.4/commands/RemoveProfilePermissionCommand.d.ts +2 -20
  91. package/dist-types/ts3.4/commands/RevokeSignatureCommand.d.ts +2 -21
  92. package/dist-types/ts3.4/commands/RevokeSigningProfileCommand.d.ts +2 -22
  93. package/dist-types/ts3.4/commands/StartSigningJobCommand.d.ts +2 -47
  94. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +2 -23
  95. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +2 -21
  96. package/dist-types/ts3.4/commands/index.d.ts +17 -0
  97. package/dist-types/ts3.4/index.d.ts +5 -24
  98. package/dist-types/ts3.4/models/models_0.d.ts +279 -902
  99. package/dist-types/ts3.4/pagination/index.d.ts +4 -0
  100. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -3
  101. package/dist-types/ts3.4/runtimeConfig.d.ts +1 -3
  102. package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -3
  103. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +1 -3
  104. package/dist-types/ts3.4/waiters/index.d.ts +1 -0
  105. package/dist-types/ts3.4/waiters/waitForSuccessfulSigningJob.d.ts +2 -9
  106. package/dist-types/waiters/index.d.ts +1 -0
  107. package/package.json +34 -31
  108. package/dist-cjs/Signer.js.map +0 -1
  109. package/dist-cjs/SignerClient.js.map +0 -1
  110. package/dist-cjs/commands/AddProfilePermissionCommand.js.map +0 -1
  111. package/dist-cjs/commands/CancelSigningProfileCommand.js.map +0 -1
  112. package/dist-cjs/commands/DescribeSigningJobCommand.js.map +0 -1
  113. package/dist-cjs/commands/GetSigningPlatformCommand.js.map +0 -1
  114. package/dist-cjs/commands/GetSigningProfileCommand.js.map +0 -1
  115. package/dist-cjs/commands/ListProfilePermissionsCommand.js.map +0 -1
  116. package/dist-cjs/commands/ListSigningJobsCommand.js.map +0 -1
  117. package/dist-cjs/commands/ListSigningPlatformsCommand.js.map +0 -1
  118. package/dist-cjs/commands/ListSigningProfilesCommand.js.map +0 -1
  119. package/dist-cjs/commands/ListTagsForResourceCommand.js.map +0 -1
  120. package/dist-cjs/commands/PutSigningProfileCommand.js.map +0 -1
  121. package/dist-cjs/commands/RemoveProfilePermissionCommand.js.map +0 -1
  122. package/dist-cjs/commands/RevokeSignatureCommand.js.map +0 -1
  123. package/dist-cjs/commands/RevokeSigningProfileCommand.js.map +0 -1
  124. package/dist-cjs/commands/StartSigningJobCommand.js.map +0 -1
  125. package/dist-cjs/commands/TagResourceCommand.js.map +0 -1
  126. package/dist-cjs/commands/UntagResourceCommand.js.map +0 -1
  127. package/dist-cjs/endpoints.js.map +0 -1
  128. package/dist-cjs/index.js.map +0 -1
  129. package/dist-cjs/models/index.js.map +0 -1
  130. package/dist-cjs/models/models_0.js.map +0 -1
  131. package/dist-cjs/pagination/Interfaces.js.map +0 -1
  132. package/dist-cjs/pagination/ListSigningJobsPaginator.js.map +0 -1
  133. package/dist-cjs/pagination/ListSigningPlatformsPaginator.js.map +0 -1
  134. package/dist-cjs/pagination/ListSigningProfilesPaginator.js.map +0 -1
  135. package/dist-cjs/protocols/Aws_restJson1.js.map +0 -1
  136. package/dist-cjs/runtimeConfig.browser.js.map +0 -1
  137. package/dist-cjs/runtimeConfig.js.map +0 -1
  138. package/dist-cjs/runtimeConfig.native.js.map +0 -1
  139. package/dist-cjs/runtimeConfig.shared.js.map +0 -1
  140. package/dist-cjs/waiters/waitForSuccessfulSigningJob.js.map +0 -1
  141. package/dist-es/Signer.js.map +0 -1
  142. package/dist-es/SignerClient.js.map +0 -1
  143. package/dist-es/commands/AddProfilePermissionCommand.js.map +0 -1
  144. package/dist-es/commands/CancelSigningProfileCommand.js.map +0 -1
  145. package/dist-es/commands/DescribeSigningJobCommand.js.map +0 -1
  146. package/dist-es/commands/GetSigningPlatformCommand.js.map +0 -1
  147. package/dist-es/commands/GetSigningProfileCommand.js.map +0 -1
  148. package/dist-es/commands/ListProfilePermissionsCommand.js.map +0 -1
  149. package/dist-es/commands/ListSigningJobsCommand.js.map +0 -1
  150. package/dist-es/commands/ListSigningPlatformsCommand.js.map +0 -1
  151. package/dist-es/commands/ListSigningProfilesCommand.js.map +0 -1
  152. package/dist-es/commands/ListTagsForResourceCommand.js.map +0 -1
  153. package/dist-es/commands/PutSigningProfileCommand.js.map +0 -1
  154. package/dist-es/commands/RemoveProfilePermissionCommand.js.map +0 -1
  155. package/dist-es/commands/RevokeSignatureCommand.js.map +0 -1
  156. package/dist-es/commands/RevokeSigningProfileCommand.js.map +0 -1
  157. package/dist-es/commands/StartSigningJobCommand.js.map +0 -1
  158. package/dist-es/commands/TagResourceCommand.js.map +0 -1
  159. package/dist-es/commands/UntagResourceCommand.js.map +0 -1
  160. package/dist-es/endpoints.js.map +0 -1
  161. package/dist-es/index.js.map +0 -1
  162. package/dist-es/models/index.js.map +0 -1
  163. package/dist-es/models/models_0.js.map +0 -1
  164. package/dist-es/pagination/Interfaces.js.map +0 -1
  165. package/dist-es/pagination/ListSigningJobsPaginator.js.map +0 -1
  166. package/dist-es/pagination/ListSigningPlatformsPaginator.js.map +0 -1
  167. package/dist-es/pagination/ListSigningProfilesPaginator.js.map +0 -1
  168. package/dist-es/protocols/Aws_restJson1.js.map +0 -1
  169. package/dist-es/runtimeConfig.browser.js.map +0 -1
  170. package/dist-es/runtimeConfig.js.map +0 -1
  171. package/dist-es/runtimeConfig.native.js.map +0 -1
  172. package/dist-es/runtimeConfig.shared.js.map +0 -1
  173. package/dist-es/waiters/waitForSuccessfulSigningJob.js.map +0 -1
  174. package/jest.config.js +0 -4
  175. package/src/Signer.ts +0 -703
  176. package/src/SignerClient.ts +0 -327
  177. package/src/commands/AddProfilePermissionCommand.ts +0 -95
  178. package/src/commands/CancelSigningProfileCommand.ts +0 -98
  179. package/src/commands/DescribeSigningJobCommand.ts +0 -97
  180. package/src/commands/GetSigningPlatformCommand.ts +0 -95
  181. package/src/commands/GetSigningProfileCommand.ts +0 -95
  182. package/src/commands/ListProfilePermissionsCommand.ts +0 -95
  183. package/src/commands/ListSigningJobsCommand.ts +0 -101
  184. package/src/commands/ListSigningPlatformsCommand.ts +0 -101
  185. package/src/commands/ListSigningProfilesCommand.ts +0 -102
  186. package/src/commands/ListTagsForResourceCommand.ts +0 -95
  187. package/src/commands/PutSigningProfileCommand.ts +0 -97
  188. package/src/commands/RemoveProfilePermissionCommand.ts +0 -95
  189. package/src/commands/RevokeSignatureCommand.ts +0 -96
  190. package/src/commands/RevokeSigningProfileCommand.ts +0 -97
  191. package/src/commands/StartSigningJobCommand.ts +0 -122
  192. package/src/commands/TagResourceCommand.ts +0 -98
  193. package/src/commands/UntagResourceCommand.ts +0 -96
  194. package/src/endpoints.ts +0 -57
  195. package/src/index.ts +0 -25
  196. package/src/models/index.ts +0 -1
  197. package/src/models/models_0.ts +0 -1831
  198. package/src/pagination/Interfaces.ts +0 -8
  199. package/src/pagination/ListSigningJobsPaginator.ts +0 -59
  200. package/src/pagination/ListSigningPlatformsPaginator.ts +0 -59
  201. package/src/pagination/ListSigningProfilesPaginator.ts +0 -59
  202. package/src/protocols/Aws_restJson1.ts +0 -2978
  203. package/src/runtimeConfig.browser.ts +0 -41
  204. package/src/runtimeConfig.native.ts +0 -17
  205. package/src/runtimeConfig.shared.ts +0 -17
  206. package/src/runtimeConfig.ts +0 -46
  207. package/src/waiters/waitForSuccessfulSigningJob.ts +0 -58
  208. package/tsconfig.es.json +0 -10
  209. package/tsconfig.json +0 -33
  210. package/tsconfig.types.json +0 -9
@@ -1,2978 +0,0 @@
1
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
2
- import {
3
- expectBoolean as __expectBoolean,
4
- expectInt32 as __expectInt32,
5
- expectNonNull as __expectNonNull,
6
- expectNumber as __expectNumber,
7
- expectObject as __expectObject,
8
- expectString as __expectString,
9
- extendedEncodeURIComponent as __extendedEncodeURIComponent,
10
- parseEpochTimestamp as __parseEpochTimestamp,
11
- } from "@aws-sdk/smithy-client";
12
- import {
13
- Endpoint as __Endpoint,
14
- MetadataBearer as __MetadataBearer,
15
- ResponseMetadata as __ResponseMetadata,
16
- SerdeContext as __SerdeContext,
17
- SmithyException as __SmithyException,
18
- } from "@aws-sdk/types";
19
- import { v4 as generateIdempotencyToken } from "uuid";
20
-
21
- import {
22
- AddProfilePermissionCommandInput,
23
- AddProfilePermissionCommandOutput,
24
- } from "../commands/AddProfilePermissionCommand";
25
- import {
26
- CancelSigningProfileCommandInput,
27
- CancelSigningProfileCommandOutput,
28
- } from "../commands/CancelSigningProfileCommand";
29
- import { DescribeSigningJobCommandInput, DescribeSigningJobCommandOutput } from "../commands/DescribeSigningJobCommand";
30
- import { GetSigningPlatformCommandInput, GetSigningPlatformCommandOutput } from "../commands/GetSigningPlatformCommand";
31
- import { GetSigningProfileCommandInput, GetSigningProfileCommandOutput } from "../commands/GetSigningProfileCommand";
32
- import {
33
- ListProfilePermissionsCommandInput,
34
- ListProfilePermissionsCommandOutput,
35
- } from "../commands/ListProfilePermissionsCommand";
36
- import { ListSigningJobsCommandInput, ListSigningJobsCommandOutput } from "../commands/ListSigningJobsCommand";
37
- import {
38
- ListSigningPlatformsCommandInput,
39
- ListSigningPlatformsCommandOutput,
40
- } from "../commands/ListSigningPlatformsCommand";
41
- import {
42
- ListSigningProfilesCommandInput,
43
- ListSigningProfilesCommandOutput,
44
- } from "../commands/ListSigningProfilesCommand";
45
- import {
46
- ListTagsForResourceCommandInput,
47
- ListTagsForResourceCommandOutput,
48
- } from "../commands/ListTagsForResourceCommand";
49
- import { PutSigningProfileCommandInput, PutSigningProfileCommandOutput } from "../commands/PutSigningProfileCommand";
50
- import {
51
- RemoveProfilePermissionCommandInput,
52
- RemoveProfilePermissionCommandOutput,
53
- } from "../commands/RemoveProfilePermissionCommand";
54
- import { RevokeSignatureCommandInput, RevokeSignatureCommandOutput } from "../commands/RevokeSignatureCommand";
55
- import {
56
- RevokeSigningProfileCommandInput,
57
- RevokeSigningProfileCommandOutput,
58
- } from "../commands/RevokeSigningProfileCommand";
59
- import { StartSigningJobCommandInput, StartSigningJobCommandOutput } from "../commands/StartSigningJobCommand";
60
- import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand";
61
- import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand";
62
- import {
63
- AccessDeniedException,
64
- BadRequestException,
65
- ConflictException,
66
- Destination,
67
- EncryptionAlgorithm,
68
- EncryptionAlgorithmOptions,
69
- HashAlgorithm,
70
- HashAlgorithmOptions,
71
- ImageFormat,
72
- InternalServiceErrorException,
73
- NotFoundException,
74
- Permission,
75
- ResourceNotFoundException,
76
- S3Destination,
77
- S3SignedObject,
78
- S3Source,
79
- ServiceLimitExceededException,
80
- SignatureValidityPeriod,
81
- SignedObject,
82
- SigningConfiguration,
83
- SigningConfigurationOverrides,
84
- SigningImageFormat,
85
- SigningJob,
86
- SigningJobRevocationRecord,
87
- SigningMaterial,
88
- SigningPlatform,
89
- SigningPlatformOverrides,
90
- SigningProfile,
91
- SigningProfileRevocationRecord,
92
- Source,
93
- ThrottlingException,
94
- TooManyRequestsException,
95
- ValidationException,
96
- } from "../models/models_0";
97
-
98
- export const serializeAws_restJson1AddProfilePermissionCommand = async (
99
- input: AddProfilePermissionCommandInput,
100
- context: __SerdeContext
101
- ): Promise<__HttpRequest> => {
102
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
103
- const headers: any = {
104
- "content-type": "application/json",
105
- };
106
- let resolvedPath =
107
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
108
- "/signing-profiles/{profileName}/permissions";
109
- if (input.profileName !== undefined) {
110
- const labelValue: string = input.profileName;
111
- if (labelValue.length <= 0) {
112
- throw new Error("Empty value provided for input HTTP label: profileName.");
113
- }
114
- resolvedPath = resolvedPath.replace("{profileName}", __extendedEncodeURIComponent(labelValue));
115
- } else {
116
- throw new Error("No value provided for input HTTP label: profileName.");
117
- }
118
- let body: any;
119
- body = JSON.stringify({
120
- ...(input.action !== undefined && input.action !== null && { action: input.action }),
121
- ...(input.principal !== undefined && input.principal !== null && { principal: input.principal }),
122
- ...(input.profileVersion !== undefined &&
123
- input.profileVersion !== null && { profileVersion: input.profileVersion }),
124
- ...(input.revisionId !== undefined && input.revisionId !== null && { revisionId: input.revisionId }),
125
- ...(input.statementId !== undefined && input.statementId !== null && { statementId: input.statementId }),
126
- });
127
- return new __HttpRequest({
128
- protocol,
129
- hostname,
130
- port,
131
- method: "POST",
132
- headers,
133
- path: resolvedPath,
134
- body,
135
- });
136
- };
137
-
138
- export const serializeAws_restJson1CancelSigningProfileCommand = async (
139
- input: CancelSigningProfileCommandInput,
140
- context: __SerdeContext
141
- ): Promise<__HttpRequest> => {
142
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
143
- const headers: any = {};
144
- let resolvedPath =
145
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-profiles/{profileName}";
146
- if (input.profileName !== undefined) {
147
- const labelValue: string = input.profileName;
148
- if (labelValue.length <= 0) {
149
- throw new Error("Empty value provided for input HTTP label: profileName.");
150
- }
151
- resolvedPath = resolvedPath.replace("{profileName}", __extendedEncodeURIComponent(labelValue));
152
- } else {
153
- throw new Error("No value provided for input HTTP label: profileName.");
154
- }
155
- let body: any;
156
- return new __HttpRequest({
157
- protocol,
158
- hostname,
159
- port,
160
- method: "DELETE",
161
- headers,
162
- path: resolvedPath,
163
- body,
164
- });
165
- };
166
-
167
- export const serializeAws_restJson1DescribeSigningJobCommand = async (
168
- input: DescribeSigningJobCommandInput,
169
- context: __SerdeContext
170
- ): Promise<__HttpRequest> => {
171
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
172
- const headers: any = {};
173
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-jobs/{jobId}";
174
- if (input.jobId !== undefined) {
175
- const labelValue: string = input.jobId;
176
- if (labelValue.length <= 0) {
177
- throw new Error("Empty value provided for input HTTP label: jobId.");
178
- }
179
- resolvedPath = resolvedPath.replace("{jobId}", __extendedEncodeURIComponent(labelValue));
180
- } else {
181
- throw new Error("No value provided for input HTTP label: jobId.");
182
- }
183
- let body: any;
184
- return new __HttpRequest({
185
- protocol,
186
- hostname,
187
- port,
188
- method: "GET",
189
- headers,
190
- path: resolvedPath,
191
- body,
192
- });
193
- };
194
-
195
- export const serializeAws_restJson1GetSigningPlatformCommand = async (
196
- input: GetSigningPlatformCommandInput,
197
- context: __SerdeContext
198
- ): Promise<__HttpRequest> => {
199
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
200
- const headers: any = {};
201
- let resolvedPath =
202
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-platforms/{platformId}";
203
- if (input.platformId !== undefined) {
204
- const labelValue: string = input.platformId;
205
- if (labelValue.length <= 0) {
206
- throw new Error("Empty value provided for input HTTP label: platformId.");
207
- }
208
- resolvedPath = resolvedPath.replace("{platformId}", __extendedEncodeURIComponent(labelValue));
209
- } else {
210
- throw new Error("No value provided for input HTTP label: platformId.");
211
- }
212
- let body: any;
213
- return new __HttpRequest({
214
- protocol,
215
- hostname,
216
- port,
217
- method: "GET",
218
- headers,
219
- path: resolvedPath,
220
- body,
221
- });
222
- };
223
-
224
- export const serializeAws_restJson1GetSigningProfileCommand = async (
225
- input: GetSigningProfileCommandInput,
226
- context: __SerdeContext
227
- ): Promise<__HttpRequest> => {
228
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
229
- const headers: any = {};
230
- let resolvedPath =
231
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-profiles/{profileName}";
232
- if (input.profileName !== undefined) {
233
- const labelValue: string = input.profileName;
234
- if (labelValue.length <= 0) {
235
- throw new Error("Empty value provided for input HTTP label: profileName.");
236
- }
237
- resolvedPath = resolvedPath.replace("{profileName}", __extendedEncodeURIComponent(labelValue));
238
- } else {
239
- throw new Error("No value provided for input HTTP label: profileName.");
240
- }
241
- const query: any = {
242
- ...(input.profileOwner !== undefined && { profileOwner: input.profileOwner }),
243
- };
244
- let body: any;
245
- return new __HttpRequest({
246
- protocol,
247
- hostname,
248
- port,
249
- method: "GET",
250
- headers,
251
- path: resolvedPath,
252
- query,
253
- body,
254
- });
255
- };
256
-
257
- export const serializeAws_restJson1ListProfilePermissionsCommand = async (
258
- input: ListProfilePermissionsCommandInput,
259
- context: __SerdeContext
260
- ): Promise<__HttpRequest> => {
261
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
262
- const headers: any = {};
263
- let resolvedPath =
264
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
265
- "/signing-profiles/{profileName}/permissions";
266
- if (input.profileName !== undefined) {
267
- const labelValue: string = input.profileName;
268
- if (labelValue.length <= 0) {
269
- throw new Error("Empty value provided for input HTTP label: profileName.");
270
- }
271
- resolvedPath = resolvedPath.replace("{profileName}", __extendedEncodeURIComponent(labelValue));
272
- } else {
273
- throw new Error("No value provided for input HTTP label: profileName.");
274
- }
275
- const query: any = {
276
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
277
- };
278
- let body: any;
279
- return new __HttpRequest({
280
- protocol,
281
- hostname,
282
- port,
283
- method: "GET",
284
- headers,
285
- path: resolvedPath,
286
- query,
287
- body,
288
- });
289
- };
290
-
291
- export const serializeAws_restJson1ListSigningJobsCommand = async (
292
- input: ListSigningJobsCommandInput,
293
- context: __SerdeContext
294
- ): Promise<__HttpRequest> => {
295
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
296
- const headers: any = {};
297
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-jobs";
298
- const query: any = {
299
- ...(input.status !== undefined && { status: input.status }),
300
- ...(input.platformId !== undefined && { platformId: input.platformId }),
301
- ...(input.requestedBy !== undefined && { requestedBy: input.requestedBy }),
302
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
303
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
304
- ...(input.isRevoked !== undefined && { isRevoked: input.isRevoked.toString() }),
305
- ...(input.signatureExpiresBefore !== undefined && {
306
- signatureExpiresBefore: (input.signatureExpiresBefore.toISOString().split(".")[0] + "Z").toString(),
307
- }),
308
- ...(input.signatureExpiresAfter !== undefined && {
309
- signatureExpiresAfter: (input.signatureExpiresAfter.toISOString().split(".")[0] + "Z").toString(),
310
- }),
311
- ...(input.jobInvoker !== undefined && { jobInvoker: input.jobInvoker }),
312
- };
313
- let body: any;
314
- return new __HttpRequest({
315
- protocol,
316
- hostname,
317
- port,
318
- method: "GET",
319
- headers,
320
- path: resolvedPath,
321
- query,
322
- body,
323
- });
324
- };
325
-
326
- export const serializeAws_restJson1ListSigningPlatformsCommand = async (
327
- input: ListSigningPlatformsCommandInput,
328
- context: __SerdeContext
329
- ): Promise<__HttpRequest> => {
330
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
331
- const headers: any = {};
332
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-platforms";
333
- const query: any = {
334
- ...(input.category !== undefined && { category: input.category }),
335
- ...(input.partner !== undefined && { partner: input.partner }),
336
- ...(input.target !== undefined && { target: input.target }),
337
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
338
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
339
- };
340
- let body: any;
341
- return new __HttpRequest({
342
- protocol,
343
- hostname,
344
- port,
345
- method: "GET",
346
- headers,
347
- path: resolvedPath,
348
- query,
349
- body,
350
- });
351
- };
352
-
353
- export const serializeAws_restJson1ListSigningProfilesCommand = async (
354
- input: ListSigningProfilesCommandInput,
355
- context: __SerdeContext
356
- ): Promise<__HttpRequest> => {
357
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
358
- const headers: any = {};
359
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-profiles";
360
- const query: any = {
361
- ...(input.includeCanceled !== undefined && { includeCanceled: input.includeCanceled.toString() }),
362
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
363
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
364
- ...(input.platformId !== undefined && { platformId: input.platformId }),
365
- ...(input.statuses !== undefined && { statuses: (input.statuses || []).map((_entry) => _entry as any) }),
366
- };
367
- let body: any;
368
- return new __HttpRequest({
369
- protocol,
370
- hostname,
371
- port,
372
- method: "GET",
373
- headers,
374
- path: resolvedPath,
375
- query,
376
- body,
377
- });
378
- };
379
-
380
- export const serializeAws_restJson1ListTagsForResourceCommand = async (
381
- input: ListTagsForResourceCommandInput,
382
- context: __SerdeContext
383
- ): Promise<__HttpRequest> => {
384
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
385
- const headers: any = {};
386
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
387
- if (input.resourceArn !== undefined) {
388
- const labelValue: string = input.resourceArn;
389
- if (labelValue.length <= 0) {
390
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
391
- }
392
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
393
- } else {
394
- throw new Error("No value provided for input HTTP label: resourceArn.");
395
- }
396
- let body: any;
397
- return new __HttpRequest({
398
- protocol,
399
- hostname,
400
- port,
401
- method: "GET",
402
- headers,
403
- path: resolvedPath,
404
- body,
405
- });
406
- };
407
-
408
- export const serializeAws_restJson1PutSigningProfileCommand = async (
409
- input: PutSigningProfileCommandInput,
410
- context: __SerdeContext
411
- ): Promise<__HttpRequest> => {
412
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
413
- const headers: any = {
414
- "content-type": "application/json",
415
- };
416
- let resolvedPath =
417
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-profiles/{profileName}";
418
- if (input.profileName !== undefined) {
419
- const labelValue: string = input.profileName;
420
- if (labelValue.length <= 0) {
421
- throw new Error("Empty value provided for input HTTP label: profileName.");
422
- }
423
- resolvedPath = resolvedPath.replace("{profileName}", __extendedEncodeURIComponent(labelValue));
424
- } else {
425
- throw new Error("No value provided for input HTTP label: profileName.");
426
- }
427
- let body: any;
428
- body = JSON.stringify({
429
- ...(input.overrides !== undefined &&
430
- input.overrides !== null && {
431
- overrides: serializeAws_restJson1SigningPlatformOverrides(input.overrides, context),
432
- }),
433
- ...(input.platformId !== undefined && input.platformId !== null && { platformId: input.platformId }),
434
- ...(input.signatureValidityPeriod !== undefined &&
435
- input.signatureValidityPeriod !== null && {
436
- signatureValidityPeriod: serializeAws_restJson1SignatureValidityPeriod(input.signatureValidityPeriod, context),
437
- }),
438
- ...(input.signingMaterial !== undefined &&
439
- input.signingMaterial !== null && {
440
- signingMaterial: serializeAws_restJson1SigningMaterial(input.signingMaterial, context),
441
- }),
442
- ...(input.signingParameters !== undefined &&
443
- input.signingParameters !== null && {
444
- signingParameters: serializeAws_restJson1SigningParameters(input.signingParameters, context),
445
- }),
446
- ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
447
- });
448
- return new __HttpRequest({
449
- protocol,
450
- hostname,
451
- port,
452
- method: "PUT",
453
- headers,
454
- path: resolvedPath,
455
- body,
456
- });
457
- };
458
-
459
- export const serializeAws_restJson1RemoveProfilePermissionCommand = async (
460
- input: RemoveProfilePermissionCommandInput,
461
- context: __SerdeContext
462
- ): Promise<__HttpRequest> => {
463
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
464
- const headers: any = {};
465
- let resolvedPath =
466
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
467
- "/signing-profiles/{profileName}/permissions/{statementId}";
468
- if (input.profileName !== undefined) {
469
- const labelValue: string = input.profileName;
470
- if (labelValue.length <= 0) {
471
- throw new Error("Empty value provided for input HTTP label: profileName.");
472
- }
473
- resolvedPath = resolvedPath.replace("{profileName}", __extendedEncodeURIComponent(labelValue));
474
- } else {
475
- throw new Error("No value provided for input HTTP label: profileName.");
476
- }
477
- if (input.statementId !== undefined) {
478
- const labelValue: string = input.statementId;
479
- if (labelValue.length <= 0) {
480
- throw new Error("Empty value provided for input HTTP label: statementId.");
481
- }
482
- resolvedPath = resolvedPath.replace("{statementId}", __extendedEncodeURIComponent(labelValue));
483
- } else {
484
- throw new Error("No value provided for input HTTP label: statementId.");
485
- }
486
- const query: any = {
487
- ...(input.revisionId !== undefined && { revisionId: input.revisionId }),
488
- };
489
- let body: any;
490
- return new __HttpRequest({
491
- protocol,
492
- hostname,
493
- port,
494
- method: "DELETE",
495
- headers,
496
- path: resolvedPath,
497
- query,
498
- body,
499
- });
500
- };
501
-
502
- export const serializeAws_restJson1RevokeSignatureCommand = async (
503
- input: RevokeSignatureCommandInput,
504
- context: __SerdeContext
505
- ): Promise<__HttpRequest> => {
506
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
507
- const headers: any = {
508
- "content-type": "application/json",
509
- };
510
- let resolvedPath =
511
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-jobs/{jobId}/revoke";
512
- if (input.jobId !== undefined) {
513
- const labelValue: string = input.jobId;
514
- if (labelValue.length <= 0) {
515
- throw new Error("Empty value provided for input HTTP label: jobId.");
516
- }
517
- resolvedPath = resolvedPath.replace("{jobId}", __extendedEncodeURIComponent(labelValue));
518
- } else {
519
- throw new Error("No value provided for input HTTP label: jobId.");
520
- }
521
- let body: any;
522
- body = JSON.stringify({
523
- ...(input.jobOwner !== undefined && input.jobOwner !== null && { jobOwner: input.jobOwner }),
524
- ...(input.reason !== undefined && input.reason !== null && { reason: input.reason }),
525
- });
526
- return new __HttpRequest({
527
- protocol,
528
- hostname,
529
- port,
530
- method: "PUT",
531
- headers,
532
- path: resolvedPath,
533
- body,
534
- });
535
- };
536
-
537
- export const serializeAws_restJson1RevokeSigningProfileCommand = async (
538
- input: RevokeSigningProfileCommandInput,
539
- context: __SerdeContext
540
- ): Promise<__HttpRequest> => {
541
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
542
- const headers: any = {
543
- "content-type": "application/json",
544
- };
545
- let resolvedPath =
546
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-profiles/{profileName}/revoke";
547
- if (input.profileName !== undefined) {
548
- const labelValue: string = input.profileName;
549
- if (labelValue.length <= 0) {
550
- throw new Error("Empty value provided for input HTTP label: profileName.");
551
- }
552
- resolvedPath = resolvedPath.replace("{profileName}", __extendedEncodeURIComponent(labelValue));
553
- } else {
554
- throw new Error("No value provided for input HTTP label: profileName.");
555
- }
556
- let body: any;
557
- body = JSON.stringify({
558
- ...(input.effectiveTime !== undefined &&
559
- input.effectiveTime !== null && { effectiveTime: Math.round(input.effectiveTime.getTime() / 1000) }),
560
- ...(input.profileVersion !== undefined &&
561
- input.profileVersion !== null && { profileVersion: input.profileVersion }),
562
- ...(input.reason !== undefined && input.reason !== null && { reason: input.reason }),
563
- });
564
- return new __HttpRequest({
565
- protocol,
566
- hostname,
567
- port,
568
- method: "PUT",
569
- headers,
570
- path: resolvedPath,
571
- body,
572
- });
573
- };
574
-
575
- export const serializeAws_restJson1StartSigningJobCommand = async (
576
- input: StartSigningJobCommandInput,
577
- context: __SerdeContext
578
- ): Promise<__HttpRequest> => {
579
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
580
- const headers: any = {
581
- "content-type": "application/json",
582
- };
583
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/signing-jobs";
584
- let body: any;
585
- body = JSON.stringify({
586
- clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(),
587
- ...(input.destination !== undefined &&
588
- input.destination !== null && { destination: serializeAws_restJson1Destination(input.destination, context) }),
589
- ...(input.profileName !== undefined && input.profileName !== null && { profileName: input.profileName }),
590
- ...(input.profileOwner !== undefined && input.profileOwner !== null && { profileOwner: input.profileOwner }),
591
- ...(input.source !== undefined &&
592
- input.source !== null && { source: serializeAws_restJson1Source(input.source, context) }),
593
- });
594
- return new __HttpRequest({
595
- protocol,
596
- hostname,
597
- port,
598
- method: "POST",
599
- headers,
600
- path: resolvedPath,
601
- body,
602
- });
603
- };
604
-
605
- export const serializeAws_restJson1TagResourceCommand = async (
606
- input: TagResourceCommandInput,
607
- context: __SerdeContext
608
- ): Promise<__HttpRequest> => {
609
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
610
- const headers: any = {
611
- "content-type": "application/json",
612
- };
613
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
614
- if (input.resourceArn !== undefined) {
615
- const labelValue: string = input.resourceArn;
616
- if (labelValue.length <= 0) {
617
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
618
- }
619
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
620
- } else {
621
- throw new Error("No value provided for input HTTP label: resourceArn.");
622
- }
623
- let body: any;
624
- body = JSON.stringify({
625
- ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
626
- });
627
- return new __HttpRequest({
628
- protocol,
629
- hostname,
630
- port,
631
- method: "POST",
632
- headers,
633
- path: resolvedPath,
634
- body,
635
- });
636
- };
637
-
638
- export const serializeAws_restJson1UntagResourceCommand = async (
639
- input: UntagResourceCommandInput,
640
- context: __SerdeContext
641
- ): Promise<__HttpRequest> => {
642
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
643
- const headers: any = {};
644
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
645
- if (input.resourceArn !== undefined) {
646
- const labelValue: string = input.resourceArn;
647
- if (labelValue.length <= 0) {
648
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
649
- }
650
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
651
- } else {
652
- throw new Error("No value provided for input HTTP label: resourceArn.");
653
- }
654
- const query: any = {
655
- ...(input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map((_entry) => _entry as any) }),
656
- };
657
- let body: any;
658
- return new __HttpRequest({
659
- protocol,
660
- hostname,
661
- port,
662
- method: "DELETE",
663
- headers,
664
- path: resolvedPath,
665
- query,
666
- body,
667
- });
668
- };
669
-
670
- export const deserializeAws_restJson1AddProfilePermissionCommand = async (
671
- output: __HttpResponse,
672
- context: __SerdeContext
673
- ): Promise<AddProfilePermissionCommandOutput> => {
674
- if (output.statusCode !== 200 && output.statusCode >= 300) {
675
- return deserializeAws_restJson1AddProfilePermissionCommandError(output, context);
676
- }
677
- const contents: AddProfilePermissionCommandOutput = {
678
- $metadata: deserializeMetadata(output),
679
- revisionId: undefined,
680
- };
681
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
682
- if (data.revisionId !== undefined && data.revisionId !== null) {
683
- contents.revisionId = __expectString(data.revisionId);
684
- }
685
- return Promise.resolve(contents);
686
- };
687
-
688
- const deserializeAws_restJson1AddProfilePermissionCommandError = async (
689
- output: __HttpResponse,
690
- context: __SerdeContext
691
- ): Promise<AddProfilePermissionCommandOutput> => {
692
- const parsedOutput: any = {
693
- ...output,
694
- body: await parseBody(output.body, context),
695
- };
696
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
697
- let errorCode = "UnknownError";
698
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
699
- switch (errorCode) {
700
- case "AccessDeniedException":
701
- case "com.amazonaws.signer#AccessDeniedException":
702
- response = {
703
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
704
- name: errorCode,
705
- $metadata: deserializeMetadata(output),
706
- };
707
- break;
708
- case "ConflictException":
709
- case "com.amazonaws.signer#ConflictException":
710
- response = {
711
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
712
- name: errorCode,
713
- $metadata: deserializeMetadata(output),
714
- };
715
- break;
716
- case "InternalServiceErrorException":
717
- case "com.amazonaws.signer#InternalServiceErrorException":
718
- response = {
719
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
720
- name: errorCode,
721
- $metadata: deserializeMetadata(output),
722
- };
723
- break;
724
- case "ResourceNotFoundException":
725
- case "com.amazonaws.signer#ResourceNotFoundException":
726
- response = {
727
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
728
- name: errorCode,
729
- $metadata: deserializeMetadata(output),
730
- };
731
- break;
732
- case "ServiceLimitExceededException":
733
- case "com.amazonaws.signer#ServiceLimitExceededException":
734
- response = {
735
- ...(await deserializeAws_restJson1ServiceLimitExceededExceptionResponse(parsedOutput, context)),
736
- name: errorCode,
737
- $metadata: deserializeMetadata(output),
738
- };
739
- break;
740
- case "TooManyRequestsException":
741
- case "com.amazonaws.signer#TooManyRequestsException":
742
- response = {
743
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
744
- name: errorCode,
745
- $metadata: deserializeMetadata(output),
746
- };
747
- break;
748
- case "ValidationException":
749
- case "com.amazonaws.signer#ValidationException":
750
- response = {
751
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
752
- name: errorCode,
753
- $metadata: deserializeMetadata(output),
754
- };
755
- break;
756
- default:
757
- const parsedBody = parsedOutput.body;
758
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
759
- response = {
760
- ...parsedBody,
761
- name: `${errorCode}`,
762
- message: parsedBody.message || parsedBody.Message || errorCode,
763
- $fault: "client",
764
- $metadata: deserializeMetadata(output),
765
- } as any;
766
- }
767
- const message = response.message || response.Message || errorCode;
768
- response.message = message;
769
- delete response.Message;
770
- return Promise.reject(Object.assign(new Error(message), response));
771
- };
772
-
773
- export const deserializeAws_restJson1CancelSigningProfileCommand = async (
774
- output: __HttpResponse,
775
- context: __SerdeContext
776
- ): Promise<CancelSigningProfileCommandOutput> => {
777
- if (output.statusCode !== 200 && output.statusCode >= 300) {
778
- return deserializeAws_restJson1CancelSigningProfileCommandError(output, context);
779
- }
780
- const contents: CancelSigningProfileCommandOutput = {
781
- $metadata: deserializeMetadata(output),
782
- };
783
- await collectBody(output.body, context);
784
- return Promise.resolve(contents);
785
- };
786
-
787
- const deserializeAws_restJson1CancelSigningProfileCommandError = async (
788
- output: __HttpResponse,
789
- context: __SerdeContext
790
- ): Promise<CancelSigningProfileCommandOutput> => {
791
- const parsedOutput: any = {
792
- ...output,
793
- body: await parseBody(output.body, context),
794
- };
795
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
796
- let errorCode = "UnknownError";
797
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
798
- switch (errorCode) {
799
- case "AccessDeniedException":
800
- case "com.amazonaws.signer#AccessDeniedException":
801
- response = {
802
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
803
- name: errorCode,
804
- $metadata: deserializeMetadata(output),
805
- };
806
- break;
807
- case "InternalServiceErrorException":
808
- case "com.amazonaws.signer#InternalServiceErrorException":
809
- response = {
810
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
811
- name: errorCode,
812
- $metadata: deserializeMetadata(output),
813
- };
814
- break;
815
- case "ResourceNotFoundException":
816
- case "com.amazonaws.signer#ResourceNotFoundException":
817
- response = {
818
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
819
- name: errorCode,
820
- $metadata: deserializeMetadata(output),
821
- };
822
- break;
823
- case "TooManyRequestsException":
824
- case "com.amazonaws.signer#TooManyRequestsException":
825
- response = {
826
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
827
- name: errorCode,
828
- $metadata: deserializeMetadata(output),
829
- };
830
- break;
831
- default:
832
- const parsedBody = parsedOutput.body;
833
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
834
- response = {
835
- ...parsedBody,
836
- name: `${errorCode}`,
837
- message: parsedBody.message || parsedBody.Message || errorCode,
838
- $fault: "client",
839
- $metadata: deserializeMetadata(output),
840
- } as any;
841
- }
842
- const message = response.message || response.Message || errorCode;
843
- response.message = message;
844
- delete response.Message;
845
- return Promise.reject(Object.assign(new Error(message), response));
846
- };
847
-
848
- export const deserializeAws_restJson1DescribeSigningJobCommand = async (
849
- output: __HttpResponse,
850
- context: __SerdeContext
851
- ): Promise<DescribeSigningJobCommandOutput> => {
852
- if (output.statusCode !== 200 && output.statusCode >= 300) {
853
- return deserializeAws_restJson1DescribeSigningJobCommandError(output, context);
854
- }
855
- const contents: DescribeSigningJobCommandOutput = {
856
- $metadata: deserializeMetadata(output),
857
- completedAt: undefined,
858
- createdAt: undefined,
859
- jobId: undefined,
860
- jobInvoker: undefined,
861
- jobOwner: undefined,
862
- overrides: undefined,
863
- platformDisplayName: undefined,
864
- platformId: undefined,
865
- profileName: undefined,
866
- profileVersion: undefined,
867
- requestedBy: undefined,
868
- revocationRecord: undefined,
869
- signatureExpiresAt: undefined,
870
- signedObject: undefined,
871
- signingMaterial: undefined,
872
- signingParameters: undefined,
873
- source: undefined,
874
- status: undefined,
875
- statusReason: undefined,
876
- };
877
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
878
- if (data.completedAt !== undefined && data.completedAt !== null) {
879
- contents.completedAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.completedAt)));
880
- }
881
- if (data.createdAt !== undefined && data.createdAt !== null) {
882
- contents.createdAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.createdAt)));
883
- }
884
- if (data.jobId !== undefined && data.jobId !== null) {
885
- contents.jobId = __expectString(data.jobId);
886
- }
887
- if (data.jobInvoker !== undefined && data.jobInvoker !== null) {
888
- contents.jobInvoker = __expectString(data.jobInvoker);
889
- }
890
- if (data.jobOwner !== undefined && data.jobOwner !== null) {
891
- contents.jobOwner = __expectString(data.jobOwner);
892
- }
893
- if (data.overrides !== undefined && data.overrides !== null) {
894
- contents.overrides = deserializeAws_restJson1SigningPlatformOverrides(data.overrides, context);
895
- }
896
- if (data.platformDisplayName !== undefined && data.platformDisplayName !== null) {
897
- contents.platformDisplayName = __expectString(data.platformDisplayName);
898
- }
899
- if (data.platformId !== undefined && data.platformId !== null) {
900
- contents.platformId = __expectString(data.platformId);
901
- }
902
- if (data.profileName !== undefined && data.profileName !== null) {
903
- contents.profileName = __expectString(data.profileName);
904
- }
905
- if (data.profileVersion !== undefined && data.profileVersion !== null) {
906
- contents.profileVersion = __expectString(data.profileVersion);
907
- }
908
- if (data.requestedBy !== undefined && data.requestedBy !== null) {
909
- contents.requestedBy = __expectString(data.requestedBy);
910
- }
911
- if (data.revocationRecord !== undefined && data.revocationRecord !== null) {
912
- contents.revocationRecord = deserializeAws_restJson1SigningJobRevocationRecord(data.revocationRecord, context);
913
- }
914
- if (data.signatureExpiresAt !== undefined && data.signatureExpiresAt !== null) {
915
- contents.signatureExpiresAt = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.signatureExpiresAt)));
916
- }
917
- if (data.signedObject !== undefined && data.signedObject !== null) {
918
- contents.signedObject = deserializeAws_restJson1SignedObject(data.signedObject, context);
919
- }
920
- if (data.signingMaterial !== undefined && data.signingMaterial !== null) {
921
- contents.signingMaterial = deserializeAws_restJson1SigningMaterial(data.signingMaterial, context);
922
- }
923
- if (data.signingParameters !== undefined && data.signingParameters !== null) {
924
- contents.signingParameters = deserializeAws_restJson1SigningParameters(data.signingParameters, context);
925
- }
926
- if (data.source !== undefined && data.source !== null) {
927
- contents.source = deserializeAws_restJson1Source(data.source, context);
928
- }
929
- if (data.status !== undefined && data.status !== null) {
930
- contents.status = __expectString(data.status);
931
- }
932
- if (data.statusReason !== undefined && data.statusReason !== null) {
933
- contents.statusReason = __expectString(data.statusReason);
934
- }
935
- return Promise.resolve(contents);
936
- };
937
-
938
- const deserializeAws_restJson1DescribeSigningJobCommandError = async (
939
- output: __HttpResponse,
940
- context: __SerdeContext
941
- ): Promise<DescribeSigningJobCommandOutput> => {
942
- const parsedOutput: any = {
943
- ...output,
944
- body: await parseBody(output.body, context),
945
- };
946
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
947
- let errorCode = "UnknownError";
948
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
949
- switch (errorCode) {
950
- case "AccessDeniedException":
951
- case "com.amazonaws.signer#AccessDeniedException":
952
- response = {
953
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
954
- name: errorCode,
955
- $metadata: deserializeMetadata(output),
956
- };
957
- break;
958
- case "InternalServiceErrorException":
959
- case "com.amazonaws.signer#InternalServiceErrorException":
960
- response = {
961
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
962
- name: errorCode,
963
- $metadata: deserializeMetadata(output),
964
- };
965
- break;
966
- case "ResourceNotFoundException":
967
- case "com.amazonaws.signer#ResourceNotFoundException":
968
- response = {
969
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
970
- name: errorCode,
971
- $metadata: deserializeMetadata(output),
972
- };
973
- break;
974
- case "TooManyRequestsException":
975
- case "com.amazonaws.signer#TooManyRequestsException":
976
- response = {
977
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
978
- name: errorCode,
979
- $metadata: deserializeMetadata(output),
980
- };
981
- break;
982
- default:
983
- const parsedBody = parsedOutput.body;
984
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
985
- response = {
986
- ...parsedBody,
987
- name: `${errorCode}`,
988
- message: parsedBody.message || parsedBody.Message || errorCode,
989
- $fault: "client",
990
- $metadata: deserializeMetadata(output),
991
- } as any;
992
- }
993
- const message = response.message || response.Message || errorCode;
994
- response.message = message;
995
- delete response.Message;
996
- return Promise.reject(Object.assign(new Error(message), response));
997
- };
998
-
999
- export const deserializeAws_restJson1GetSigningPlatformCommand = async (
1000
- output: __HttpResponse,
1001
- context: __SerdeContext
1002
- ): Promise<GetSigningPlatformCommandOutput> => {
1003
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1004
- return deserializeAws_restJson1GetSigningPlatformCommandError(output, context);
1005
- }
1006
- const contents: GetSigningPlatformCommandOutput = {
1007
- $metadata: deserializeMetadata(output),
1008
- category: undefined,
1009
- displayName: undefined,
1010
- maxSizeInMB: undefined,
1011
- partner: undefined,
1012
- platformId: undefined,
1013
- revocationSupported: undefined,
1014
- signingConfiguration: undefined,
1015
- signingImageFormat: undefined,
1016
- target: undefined,
1017
- };
1018
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1019
- if (data.category !== undefined && data.category !== null) {
1020
- contents.category = __expectString(data.category);
1021
- }
1022
- if (data.displayName !== undefined && data.displayName !== null) {
1023
- contents.displayName = __expectString(data.displayName);
1024
- }
1025
- if (data.maxSizeInMB !== undefined && data.maxSizeInMB !== null) {
1026
- contents.maxSizeInMB = __expectInt32(data.maxSizeInMB);
1027
- }
1028
- if (data.partner !== undefined && data.partner !== null) {
1029
- contents.partner = __expectString(data.partner);
1030
- }
1031
- if (data.platformId !== undefined && data.platformId !== null) {
1032
- contents.platformId = __expectString(data.platformId);
1033
- }
1034
- if (data.revocationSupported !== undefined && data.revocationSupported !== null) {
1035
- contents.revocationSupported = __expectBoolean(data.revocationSupported);
1036
- }
1037
- if (data.signingConfiguration !== undefined && data.signingConfiguration !== null) {
1038
- contents.signingConfiguration = deserializeAws_restJson1SigningConfiguration(data.signingConfiguration, context);
1039
- }
1040
- if (data.signingImageFormat !== undefined && data.signingImageFormat !== null) {
1041
- contents.signingImageFormat = deserializeAws_restJson1SigningImageFormat(data.signingImageFormat, context);
1042
- }
1043
- if (data.target !== undefined && data.target !== null) {
1044
- contents.target = __expectString(data.target);
1045
- }
1046
- return Promise.resolve(contents);
1047
- };
1048
-
1049
- const deserializeAws_restJson1GetSigningPlatformCommandError = async (
1050
- output: __HttpResponse,
1051
- context: __SerdeContext
1052
- ): Promise<GetSigningPlatformCommandOutput> => {
1053
- const parsedOutput: any = {
1054
- ...output,
1055
- body: await parseBody(output.body, context),
1056
- };
1057
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1058
- let errorCode = "UnknownError";
1059
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1060
- switch (errorCode) {
1061
- case "AccessDeniedException":
1062
- case "com.amazonaws.signer#AccessDeniedException":
1063
- response = {
1064
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1065
- name: errorCode,
1066
- $metadata: deserializeMetadata(output),
1067
- };
1068
- break;
1069
- case "InternalServiceErrorException":
1070
- case "com.amazonaws.signer#InternalServiceErrorException":
1071
- response = {
1072
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1073
- name: errorCode,
1074
- $metadata: deserializeMetadata(output),
1075
- };
1076
- break;
1077
- case "ResourceNotFoundException":
1078
- case "com.amazonaws.signer#ResourceNotFoundException":
1079
- response = {
1080
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1081
- name: errorCode,
1082
- $metadata: deserializeMetadata(output),
1083
- };
1084
- break;
1085
- case "TooManyRequestsException":
1086
- case "com.amazonaws.signer#TooManyRequestsException":
1087
- response = {
1088
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1089
- name: errorCode,
1090
- $metadata: deserializeMetadata(output),
1091
- };
1092
- break;
1093
- default:
1094
- const parsedBody = parsedOutput.body;
1095
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1096
- response = {
1097
- ...parsedBody,
1098
- name: `${errorCode}`,
1099
- message: parsedBody.message || parsedBody.Message || errorCode,
1100
- $fault: "client",
1101
- $metadata: deserializeMetadata(output),
1102
- } as any;
1103
- }
1104
- const message = response.message || response.Message || errorCode;
1105
- response.message = message;
1106
- delete response.Message;
1107
- return Promise.reject(Object.assign(new Error(message), response));
1108
- };
1109
-
1110
- export const deserializeAws_restJson1GetSigningProfileCommand = async (
1111
- output: __HttpResponse,
1112
- context: __SerdeContext
1113
- ): Promise<GetSigningProfileCommandOutput> => {
1114
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1115
- return deserializeAws_restJson1GetSigningProfileCommandError(output, context);
1116
- }
1117
- const contents: GetSigningProfileCommandOutput = {
1118
- $metadata: deserializeMetadata(output),
1119
- arn: undefined,
1120
- overrides: undefined,
1121
- platformDisplayName: undefined,
1122
- platformId: undefined,
1123
- profileName: undefined,
1124
- profileVersion: undefined,
1125
- profileVersionArn: undefined,
1126
- revocationRecord: undefined,
1127
- signatureValidityPeriod: undefined,
1128
- signingMaterial: undefined,
1129
- signingParameters: undefined,
1130
- status: undefined,
1131
- statusReason: undefined,
1132
- tags: undefined,
1133
- };
1134
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1135
- if (data.arn !== undefined && data.arn !== null) {
1136
- contents.arn = __expectString(data.arn);
1137
- }
1138
- if (data.overrides !== undefined && data.overrides !== null) {
1139
- contents.overrides = deserializeAws_restJson1SigningPlatformOverrides(data.overrides, context);
1140
- }
1141
- if (data.platformDisplayName !== undefined && data.platformDisplayName !== null) {
1142
- contents.platformDisplayName = __expectString(data.platformDisplayName);
1143
- }
1144
- if (data.platformId !== undefined && data.platformId !== null) {
1145
- contents.platformId = __expectString(data.platformId);
1146
- }
1147
- if (data.profileName !== undefined && data.profileName !== null) {
1148
- contents.profileName = __expectString(data.profileName);
1149
- }
1150
- if (data.profileVersion !== undefined && data.profileVersion !== null) {
1151
- contents.profileVersion = __expectString(data.profileVersion);
1152
- }
1153
- if (data.profileVersionArn !== undefined && data.profileVersionArn !== null) {
1154
- contents.profileVersionArn = __expectString(data.profileVersionArn);
1155
- }
1156
- if (data.revocationRecord !== undefined && data.revocationRecord !== null) {
1157
- contents.revocationRecord = deserializeAws_restJson1SigningProfileRevocationRecord(data.revocationRecord, context);
1158
- }
1159
- if (data.signatureValidityPeriod !== undefined && data.signatureValidityPeriod !== null) {
1160
- contents.signatureValidityPeriod = deserializeAws_restJson1SignatureValidityPeriod(
1161
- data.signatureValidityPeriod,
1162
- context
1163
- );
1164
- }
1165
- if (data.signingMaterial !== undefined && data.signingMaterial !== null) {
1166
- contents.signingMaterial = deserializeAws_restJson1SigningMaterial(data.signingMaterial, context);
1167
- }
1168
- if (data.signingParameters !== undefined && data.signingParameters !== null) {
1169
- contents.signingParameters = deserializeAws_restJson1SigningParameters(data.signingParameters, context);
1170
- }
1171
- if (data.status !== undefined && data.status !== null) {
1172
- contents.status = __expectString(data.status);
1173
- }
1174
- if (data.statusReason !== undefined && data.statusReason !== null) {
1175
- contents.statusReason = __expectString(data.statusReason);
1176
- }
1177
- if (data.tags !== undefined && data.tags !== null) {
1178
- contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
1179
- }
1180
- return Promise.resolve(contents);
1181
- };
1182
-
1183
- const deserializeAws_restJson1GetSigningProfileCommandError = async (
1184
- output: __HttpResponse,
1185
- context: __SerdeContext
1186
- ): Promise<GetSigningProfileCommandOutput> => {
1187
- const parsedOutput: any = {
1188
- ...output,
1189
- body: await parseBody(output.body, context),
1190
- };
1191
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1192
- let errorCode = "UnknownError";
1193
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1194
- switch (errorCode) {
1195
- case "AccessDeniedException":
1196
- case "com.amazonaws.signer#AccessDeniedException":
1197
- response = {
1198
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1199
- name: errorCode,
1200
- $metadata: deserializeMetadata(output),
1201
- };
1202
- break;
1203
- case "InternalServiceErrorException":
1204
- case "com.amazonaws.signer#InternalServiceErrorException":
1205
- response = {
1206
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1207
- name: errorCode,
1208
- $metadata: deserializeMetadata(output),
1209
- };
1210
- break;
1211
- case "ResourceNotFoundException":
1212
- case "com.amazonaws.signer#ResourceNotFoundException":
1213
- response = {
1214
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1215
- name: errorCode,
1216
- $metadata: deserializeMetadata(output),
1217
- };
1218
- break;
1219
- case "TooManyRequestsException":
1220
- case "com.amazonaws.signer#TooManyRequestsException":
1221
- response = {
1222
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1223
- name: errorCode,
1224
- $metadata: deserializeMetadata(output),
1225
- };
1226
- break;
1227
- default:
1228
- const parsedBody = parsedOutput.body;
1229
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1230
- response = {
1231
- ...parsedBody,
1232
- name: `${errorCode}`,
1233
- message: parsedBody.message || parsedBody.Message || errorCode,
1234
- $fault: "client",
1235
- $metadata: deserializeMetadata(output),
1236
- } as any;
1237
- }
1238
- const message = response.message || response.Message || errorCode;
1239
- response.message = message;
1240
- delete response.Message;
1241
- return Promise.reject(Object.assign(new Error(message), response));
1242
- };
1243
-
1244
- export const deserializeAws_restJson1ListProfilePermissionsCommand = async (
1245
- output: __HttpResponse,
1246
- context: __SerdeContext
1247
- ): Promise<ListProfilePermissionsCommandOutput> => {
1248
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1249
- return deserializeAws_restJson1ListProfilePermissionsCommandError(output, context);
1250
- }
1251
- const contents: ListProfilePermissionsCommandOutput = {
1252
- $metadata: deserializeMetadata(output),
1253
- nextToken: undefined,
1254
- permissions: undefined,
1255
- policySizeBytes: undefined,
1256
- revisionId: undefined,
1257
- };
1258
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1259
- if (data.nextToken !== undefined && data.nextToken !== null) {
1260
- contents.nextToken = __expectString(data.nextToken);
1261
- }
1262
- if (data.permissions !== undefined && data.permissions !== null) {
1263
- contents.permissions = deserializeAws_restJson1Permissions(data.permissions, context);
1264
- }
1265
- if (data.policySizeBytes !== undefined && data.policySizeBytes !== null) {
1266
- contents.policySizeBytes = __expectInt32(data.policySizeBytes);
1267
- }
1268
- if (data.revisionId !== undefined && data.revisionId !== null) {
1269
- contents.revisionId = __expectString(data.revisionId);
1270
- }
1271
- return Promise.resolve(contents);
1272
- };
1273
-
1274
- const deserializeAws_restJson1ListProfilePermissionsCommandError = async (
1275
- output: __HttpResponse,
1276
- context: __SerdeContext
1277
- ): Promise<ListProfilePermissionsCommandOutput> => {
1278
- const parsedOutput: any = {
1279
- ...output,
1280
- body: await parseBody(output.body, context),
1281
- };
1282
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1283
- let errorCode = "UnknownError";
1284
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1285
- switch (errorCode) {
1286
- case "AccessDeniedException":
1287
- case "com.amazonaws.signer#AccessDeniedException":
1288
- response = {
1289
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1290
- name: errorCode,
1291
- $metadata: deserializeMetadata(output),
1292
- };
1293
- break;
1294
- case "InternalServiceErrorException":
1295
- case "com.amazonaws.signer#InternalServiceErrorException":
1296
- response = {
1297
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1298
- name: errorCode,
1299
- $metadata: deserializeMetadata(output),
1300
- };
1301
- break;
1302
- case "ResourceNotFoundException":
1303
- case "com.amazonaws.signer#ResourceNotFoundException":
1304
- response = {
1305
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1306
- name: errorCode,
1307
- $metadata: deserializeMetadata(output),
1308
- };
1309
- break;
1310
- case "TooManyRequestsException":
1311
- case "com.amazonaws.signer#TooManyRequestsException":
1312
- response = {
1313
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1314
- name: errorCode,
1315
- $metadata: deserializeMetadata(output),
1316
- };
1317
- break;
1318
- case "ValidationException":
1319
- case "com.amazonaws.signer#ValidationException":
1320
- response = {
1321
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1322
- name: errorCode,
1323
- $metadata: deserializeMetadata(output),
1324
- };
1325
- break;
1326
- default:
1327
- const parsedBody = parsedOutput.body;
1328
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1329
- response = {
1330
- ...parsedBody,
1331
- name: `${errorCode}`,
1332
- message: parsedBody.message || parsedBody.Message || errorCode,
1333
- $fault: "client",
1334
- $metadata: deserializeMetadata(output),
1335
- } as any;
1336
- }
1337
- const message = response.message || response.Message || errorCode;
1338
- response.message = message;
1339
- delete response.Message;
1340
- return Promise.reject(Object.assign(new Error(message), response));
1341
- };
1342
-
1343
- export const deserializeAws_restJson1ListSigningJobsCommand = async (
1344
- output: __HttpResponse,
1345
- context: __SerdeContext
1346
- ): Promise<ListSigningJobsCommandOutput> => {
1347
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1348
- return deserializeAws_restJson1ListSigningJobsCommandError(output, context);
1349
- }
1350
- const contents: ListSigningJobsCommandOutput = {
1351
- $metadata: deserializeMetadata(output),
1352
- jobs: undefined,
1353
- nextToken: undefined,
1354
- };
1355
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1356
- if (data.jobs !== undefined && data.jobs !== null) {
1357
- contents.jobs = deserializeAws_restJson1SigningJobs(data.jobs, context);
1358
- }
1359
- if (data.nextToken !== undefined && data.nextToken !== null) {
1360
- contents.nextToken = __expectString(data.nextToken);
1361
- }
1362
- return Promise.resolve(contents);
1363
- };
1364
-
1365
- const deserializeAws_restJson1ListSigningJobsCommandError = async (
1366
- output: __HttpResponse,
1367
- context: __SerdeContext
1368
- ): Promise<ListSigningJobsCommandOutput> => {
1369
- const parsedOutput: any = {
1370
- ...output,
1371
- body: await parseBody(output.body, context),
1372
- };
1373
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1374
- let errorCode = "UnknownError";
1375
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1376
- switch (errorCode) {
1377
- case "AccessDeniedException":
1378
- case "com.amazonaws.signer#AccessDeniedException":
1379
- response = {
1380
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1381
- name: errorCode,
1382
- $metadata: deserializeMetadata(output),
1383
- };
1384
- break;
1385
- case "InternalServiceErrorException":
1386
- case "com.amazonaws.signer#InternalServiceErrorException":
1387
- response = {
1388
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1389
- name: errorCode,
1390
- $metadata: deserializeMetadata(output),
1391
- };
1392
- break;
1393
- case "TooManyRequestsException":
1394
- case "com.amazonaws.signer#TooManyRequestsException":
1395
- response = {
1396
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1397
- name: errorCode,
1398
- $metadata: deserializeMetadata(output),
1399
- };
1400
- break;
1401
- case "ValidationException":
1402
- case "com.amazonaws.signer#ValidationException":
1403
- response = {
1404
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1405
- name: errorCode,
1406
- $metadata: deserializeMetadata(output),
1407
- };
1408
- break;
1409
- default:
1410
- const parsedBody = parsedOutput.body;
1411
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1412
- response = {
1413
- ...parsedBody,
1414
- name: `${errorCode}`,
1415
- message: parsedBody.message || parsedBody.Message || errorCode,
1416
- $fault: "client",
1417
- $metadata: deserializeMetadata(output),
1418
- } as any;
1419
- }
1420
- const message = response.message || response.Message || errorCode;
1421
- response.message = message;
1422
- delete response.Message;
1423
- return Promise.reject(Object.assign(new Error(message), response));
1424
- };
1425
-
1426
- export const deserializeAws_restJson1ListSigningPlatformsCommand = async (
1427
- output: __HttpResponse,
1428
- context: __SerdeContext
1429
- ): Promise<ListSigningPlatformsCommandOutput> => {
1430
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1431
- return deserializeAws_restJson1ListSigningPlatformsCommandError(output, context);
1432
- }
1433
- const contents: ListSigningPlatformsCommandOutput = {
1434
- $metadata: deserializeMetadata(output),
1435
- nextToken: undefined,
1436
- platforms: undefined,
1437
- };
1438
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1439
- if (data.nextToken !== undefined && data.nextToken !== null) {
1440
- contents.nextToken = __expectString(data.nextToken);
1441
- }
1442
- if (data.platforms !== undefined && data.platforms !== null) {
1443
- contents.platforms = deserializeAws_restJson1SigningPlatforms(data.platforms, context);
1444
- }
1445
- return Promise.resolve(contents);
1446
- };
1447
-
1448
- const deserializeAws_restJson1ListSigningPlatformsCommandError = async (
1449
- output: __HttpResponse,
1450
- context: __SerdeContext
1451
- ): Promise<ListSigningPlatformsCommandOutput> => {
1452
- const parsedOutput: any = {
1453
- ...output,
1454
- body: await parseBody(output.body, context),
1455
- };
1456
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1457
- let errorCode = "UnknownError";
1458
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1459
- switch (errorCode) {
1460
- case "AccessDeniedException":
1461
- case "com.amazonaws.signer#AccessDeniedException":
1462
- response = {
1463
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1464
- name: errorCode,
1465
- $metadata: deserializeMetadata(output),
1466
- };
1467
- break;
1468
- case "InternalServiceErrorException":
1469
- case "com.amazonaws.signer#InternalServiceErrorException":
1470
- response = {
1471
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1472
- name: errorCode,
1473
- $metadata: deserializeMetadata(output),
1474
- };
1475
- break;
1476
- case "TooManyRequestsException":
1477
- case "com.amazonaws.signer#TooManyRequestsException":
1478
- response = {
1479
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1480
- name: errorCode,
1481
- $metadata: deserializeMetadata(output),
1482
- };
1483
- break;
1484
- case "ValidationException":
1485
- case "com.amazonaws.signer#ValidationException":
1486
- response = {
1487
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1488
- name: errorCode,
1489
- $metadata: deserializeMetadata(output),
1490
- };
1491
- break;
1492
- default:
1493
- const parsedBody = parsedOutput.body;
1494
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1495
- response = {
1496
- ...parsedBody,
1497
- name: `${errorCode}`,
1498
- message: parsedBody.message || parsedBody.Message || errorCode,
1499
- $fault: "client",
1500
- $metadata: deserializeMetadata(output),
1501
- } as any;
1502
- }
1503
- const message = response.message || response.Message || errorCode;
1504
- response.message = message;
1505
- delete response.Message;
1506
- return Promise.reject(Object.assign(new Error(message), response));
1507
- };
1508
-
1509
- export const deserializeAws_restJson1ListSigningProfilesCommand = async (
1510
- output: __HttpResponse,
1511
- context: __SerdeContext
1512
- ): Promise<ListSigningProfilesCommandOutput> => {
1513
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1514
- return deserializeAws_restJson1ListSigningProfilesCommandError(output, context);
1515
- }
1516
- const contents: ListSigningProfilesCommandOutput = {
1517
- $metadata: deserializeMetadata(output),
1518
- nextToken: undefined,
1519
- profiles: undefined,
1520
- };
1521
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1522
- if (data.nextToken !== undefined && data.nextToken !== null) {
1523
- contents.nextToken = __expectString(data.nextToken);
1524
- }
1525
- if (data.profiles !== undefined && data.profiles !== null) {
1526
- contents.profiles = deserializeAws_restJson1SigningProfiles(data.profiles, context);
1527
- }
1528
- return Promise.resolve(contents);
1529
- };
1530
-
1531
- const deserializeAws_restJson1ListSigningProfilesCommandError = async (
1532
- output: __HttpResponse,
1533
- context: __SerdeContext
1534
- ): Promise<ListSigningProfilesCommandOutput> => {
1535
- const parsedOutput: any = {
1536
- ...output,
1537
- body: await parseBody(output.body, context),
1538
- };
1539
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1540
- let errorCode = "UnknownError";
1541
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1542
- switch (errorCode) {
1543
- case "AccessDeniedException":
1544
- case "com.amazonaws.signer#AccessDeniedException":
1545
- response = {
1546
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1547
- name: errorCode,
1548
- $metadata: deserializeMetadata(output),
1549
- };
1550
- break;
1551
- case "InternalServiceErrorException":
1552
- case "com.amazonaws.signer#InternalServiceErrorException":
1553
- response = {
1554
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1555
- name: errorCode,
1556
- $metadata: deserializeMetadata(output),
1557
- };
1558
- break;
1559
- case "TooManyRequestsException":
1560
- case "com.amazonaws.signer#TooManyRequestsException":
1561
- response = {
1562
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1563
- name: errorCode,
1564
- $metadata: deserializeMetadata(output),
1565
- };
1566
- break;
1567
- default:
1568
- const parsedBody = parsedOutput.body;
1569
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1570
- response = {
1571
- ...parsedBody,
1572
- name: `${errorCode}`,
1573
- message: parsedBody.message || parsedBody.Message || errorCode,
1574
- $fault: "client",
1575
- $metadata: deserializeMetadata(output),
1576
- } as any;
1577
- }
1578
- const message = response.message || response.Message || errorCode;
1579
- response.message = message;
1580
- delete response.Message;
1581
- return Promise.reject(Object.assign(new Error(message), response));
1582
- };
1583
-
1584
- export const deserializeAws_restJson1ListTagsForResourceCommand = async (
1585
- output: __HttpResponse,
1586
- context: __SerdeContext
1587
- ): Promise<ListTagsForResourceCommandOutput> => {
1588
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1589
- return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
1590
- }
1591
- const contents: ListTagsForResourceCommandOutput = {
1592
- $metadata: deserializeMetadata(output),
1593
- tags: undefined,
1594
- };
1595
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1596
- if (data.tags !== undefined && data.tags !== null) {
1597
- contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
1598
- }
1599
- return Promise.resolve(contents);
1600
- };
1601
-
1602
- const deserializeAws_restJson1ListTagsForResourceCommandError = async (
1603
- output: __HttpResponse,
1604
- context: __SerdeContext
1605
- ): Promise<ListTagsForResourceCommandOutput> => {
1606
- const parsedOutput: any = {
1607
- ...output,
1608
- body: await parseBody(output.body, context),
1609
- };
1610
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1611
- let errorCode = "UnknownError";
1612
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1613
- switch (errorCode) {
1614
- case "BadRequestException":
1615
- case "com.amazonaws.signer#BadRequestException":
1616
- response = {
1617
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1618
- name: errorCode,
1619
- $metadata: deserializeMetadata(output),
1620
- };
1621
- break;
1622
- case "InternalServiceErrorException":
1623
- case "com.amazonaws.signer#InternalServiceErrorException":
1624
- response = {
1625
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1626
- name: errorCode,
1627
- $metadata: deserializeMetadata(output),
1628
- };
1629
- break;
1630
- case "NotFoundException":
1631
- case "com.amazonaws.signer#NotFoundException":
1632
- response = {
1633
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1634
- name: errorCode,
1635
- $metadata: deserializeMetadata(output),
1636
- };
1637
- break;
1638
- case "TooManyRequestsException":
1639
- case "com.amazonaws.signer#TooManyRequestsException":
1640
- response = {
1641
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1642
- name: errorCode,
1643
- $metadata: deserializeMetadata(output),
1644
- };
1645
- break;
1646
- default:
1647
- const parsedBody = parsedOutput.body;
1648
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1649
- response = {
1650
- ...parsedBody,
1651
- name: `${errorCode}`,
1652
- message: parsedBody.message || parsedBody.Message || errorCode,
1653
- $fault: "client",
1654
- $metadata: deserializeMetadata(output),
1655
- } as any;
1656
- }
1657
- const message = response.message || response.Message || errorCode;
1658
- response.message = message;
1659
- delete response.Message;
1660
- return Promise.reject(Object.assign(new Error(message), response));
1661
- };
1662
-
1663
- export const deserializeAws_restJson1PutSigningProfileCommand = async (
1664
- output: __HttpResponse,
1665
- context: __SerdeContext
1666
- ): Promise<PutSigningProfileCommandOutput> => {
1667
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1668
- return deserializeAws_restJson1PutSigningProfileCommandError(output, context);
1669
- }
1670
- const contents: PutSigningProfileCommandOutput = {
1671
- $metadata: deserializeMetadata(output),
1672
- arn: undefined,
1673
- profileVersion: undefined,
1674
- profileVersionArn: undefined,
1675
- };
1676
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1677
- if (data.arn !== undefined && data.arn !== null) {
1678
- contents.arn = __expectString(data.arn);
1679
- }
1680
- if (data.profileVersion !== undefined && data.profileVersion !== null) {
1681
- contents.profileVersion = __expectString(data.profileVersion);
1682
- }
1683
- if (data.profileVersionArn !== undefined && data.profileVersionArn !== null) {
1684
- contents.profileVersionArn = __expectString(data.profileVersionArn);
1685
- }
1686
- return Promise.resolve(contents);
1687
- };
1688
-
1689
- const deserializeAws_restJson1PutSigningProfileCommandError = async (
1690
- output: __HttpResponse,
1691
- context: __SerdeContext
1692
- ): Promise<PutSigningProfileCommandOutput> => {
1693
- const parsedOutput: any = {
1694
- ...output,
1695
- body: await parseBody(output.body, context),
1696
- };
1697
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1698
- let errorCode = "UnknownError";
1699
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1700
- switch (errorCode) {
1701
- case "AccessDeniedException":
1702
- case "com.amazonaws.signer#AccessDeniedException":
1703
- response = {
1704
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1705
- name: errorCode,
1706
- $metadata: deserializeMetadata(output),
1707
- };
1708
- break;
1709
- case "InternalServiceErrorException":
1710
- case "com.amazonaws.signer#InternalServiceErrorException":
1711
- response = {
1712
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1713
- name: errorCode,
1714
- $metadata: deserializeMetadata(output),
1715
- };
1716
- break;
1717
- case "ResourceNotFoundException":
1718
- case "com.amazonaws.signer#ResourceNotFoundException":
1719
- response = {
1720
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1721
- name: errorCode,
1722
- $metadata: deserializeMetadata(output),
1723
- };
1724
- break;
1725
- case "TooManyRequestsException":
1726
- case "com.amazonaws.signer#TooManyRequestsException":
1727
- response = {
1728
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1729
- name: errorCode,
1730
- $metadata: deserializeMetadata(output),
1731
- };
1732
- break;
1733
- case "ValidationException":
1734
- case "com.amazonaws.signer#ValidationException":
1735
- response = {
1736
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1737
- name: errorCode,
1738
- $metadata: deserializeMetadata(output),
1739
- };
1740
- break;
1741
- default:
1742
- const parsedBody = parsedOutput.body;
1743
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1744
- response = {
1745
- ...parsedBody,
1746
- name: `${errorCode}`,
1747
- message: parsedBody.message || parsedBody.Message || errorCode,
1748
- $fault: "client",
1749
- $metadata: deserializeMetadata(output),
1750
- } as any;
1751
- }
1752
- const message = response.message || response.Message || errorCode;
1753
- response.message = message;
1754
- delete response.Message;
1755
- return Promise.reject(Object.assign(new Error(message), response));
1756
- };
1757
-
1758
- export const deserializeAws_restJson1RemoveProfilePermissionCommand = async (
1759
- output: __HttpResponse,
1760
- context: __SerdeContext
1761
- ): Promise<RemoveProfilePermissionCommandOutput> => {
1762
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1763
- return deserializeAws_restJson1RemoveProfilePermissionCommandError(output, context);
1764
- }
1765
- const contents: RemoveProfilePermissionCommandOutput = {
1766
- $metadata: deserializeMetadata(output),
1767
- revisionId: undefined,
1768
- };
1769
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1770
- if (data.revisionId !== undefined && data.revisionId !== null) {
1771
- contents.revisionId = __expectString(data.revisionId);
1772
- }
1773
- return Promise.resolve(contents);
1774
- };
1775
-
1776
- const deserializeAws_restJson1RemoveProfilePermissionCommandError = async (
1777
- output: __HttpResponse,
1778
- context: __SerdeContext
1779
- ): Promise<RemoveProfilePermissionCommandOutput> => {
1780
- const parsedOutput: any = {
1781
- ...output,
1782
- body: await parseBody(output.body, context),
1783
- };
1784
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1785
- let errorCode = "UnknownError";
1786
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1787
- switch (errorCode) {
1788
- case "AccessDeniedException":
1789
- case "com.amazonaws.signer#AccessDeniedException":
1790
- response = {
1791
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1792
- name: errorCode,
1793
- $metadata: deserializeMetadata(output),
1794
- };
1795
- break;
1796
- case "ConflictException":
1797
- case "com.amazonaws.signer#ConflictException":
1798
- response = {
1799
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1800
- name: errorCode,
1801
- $metadata: deserializeMetadata(output),
1802
- };
1803
- break;
1804
- case "InternalServiceErrorException":
1805
- case "com.amazonaws.signer#InternalServiceErrorException":
1806
- response = {
1807
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1808
- name: errorCode,
1809
- $metadata: deserializeMetadata(output),
1810
- };
1811
- break;
1812
- case "ResourceNotFoundException":
1813
- case "com.amazonaws.signer#ResourceNotFoundException":
1814
- response = {
1815
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1816
- name: errorCode,
1817
- $metadata: deserializeMetadata(output),
1818
- };
1819
- break;
1820
- case "TooManyRequestsException":
1821
- case "com.amazonaws.signer#TooManyRequestsException":
1822
- response = {
1823
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1824
- name: errorCode,
1825
- $metadata: deserializeMetadata(output),
1826
- };
1827
- break;
1828
- case "ValidationException":
1829
- case "com.amazonaws.signer#ValidationException":
1830
- response = {
1831
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1832
- name: errorCode,
1833
- $metadata: deserializeMetadata(output),
1834
- };
1835
- break;
1836
- default:
1837
- const parsedBody = parsedOutput.body;
1838
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1839
- response = {
1840
- ...parsedBody,
1841
- name: `${errorCode}`,
1842
- message: parsedBody.message || parsedBody.Message || errorCode,
1843
- $fault: "client",
1844
- $metadata: deserializeMetadata(output),
1845
- } as any;
1846
- }
1847
- const message = response.message || response.Message || errorCode;
1848
- response.message = message;
1849
- delete response.Message;
1850
- return Promise.reject(Object.assign(new Error(message), response));
1851
- };
1852
-
1853
- export const deserializeAws_restJson1RevokeSignatureCommand = async (
1854
- output: __HttpResponse,
1855
- context: __SerdeContext
1856
- ): Promise<RevokeSignatureCommandOutput> => {
1857
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1858
- return deserializeAws_restJson1RevokeSignatureCommandError(output, context);
1859
- }
1860
- const contents: RevokeSignatureCommandOutput = {
1861
- $metadata: deserializeMetadata(output),
1862
- };
1863
- await collectBody(output.body, context);
1864
- return Promise.resolve(contents);
1865
- };
1866
-
1867
- const deserializeAws_restJson1RevokeSignatureCommandError = async (
1868
- output: __HttpResponse,
1869
- context: __SerdeContext
1870
- ): Promise<RevokeSignatureCommandOutput> => {
1871
- const parsedOutput: any = {
1872
- ...output,
1873
- body: await parseBody(output.body, context),
1874
- };
1875
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1876
- let errorCode = "UnknownError";
1877
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1878
- switch (errorCode) {
1879
- case "AccessDeniedException":
1880
- case "com.amazonaws.signer#AccessDeniedException":
1881
- response = {
1882
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1883
- name: errorCode,
1884
- $metadata: deserializeMetadata(output),
1885
- };
1886
- break;
1887
- case "InternalServiceErrorException":
1888
- case "com.amazonaws.signer#InternalServiceErrorException":
1889
- response = {
1890
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1891
- name: errorCode,
1892
- $metadata: deserializeMetadata(output),
1893
- };
1894
- break;
1895
- case "ResourceNotFoundException":
1896
- case "com.amazonaws.signer#ResourceNotFoundException":
1897
- response = {
1898
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1899
- name: errorCode,
1900
- $metadata: deserializeMetadata(output),
1901
- };
1902
- break;
1903
- case "TooManyRequestsException":
1904
- case "com.amazonaws.signer#TooManyRequestsException":
1905
- response = {
1906
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1907
- name: errorCode,
1908
- $metadata: deserializeMetadata(output),
1909
- };
1910
- break;
1911
- case "ValidationException":
1912
- case "com.amazonaws.signer#ValidationException":
1913
- response = {
1914
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1915
- name: errorCode,
1916
- $metadata: deserializeMetadata(output),
1917
- };
1918
- break;
1919
- default:
1920
- const parsedBody = parsedOutput.body;
1921
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1922
- response = {
1923
- ...parsedBody,
1924
- name: `${errorCode}`,
1925
- message: parsedBody.message || parsedBody.Message || errorCode,
1926
- $fault: "client",
1927
- $metadata: deserializeMetadata(output),
1928
- } as any;
1929
- }
1930
- const message = response.message || response.Message || errorCode;
1931
- response.message = message;
1932
- delete response.Message;
1933
- return Promise.reject(Object.assign(new Error(message), response));
1934
- };
1935
-
1936
- export const deserializeAws_restJson1RevokeSigningProfileCommand = async (
1937
- output: __HttpResponse,
1938
- context: __SerdeContext
1939
- ): Promise<RevokeSigningProfileCommandOutput> => {
1940
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1941
- return deserializeAws_restJson1RevokeSigningProfileCommandError(output, context);
1942
- }
1943
- const contents: RevokeSigningProfileCommandOutput = {
1944
- $metadata: deserializeMetadata(output),
1945
- };
1946
- await collectBody(output.body, context);
1947
- return Promise.resolve(contents);
1948
- };
1949
-
1950
- const deserializeAws_restJson1RevokeSigningProfileCommandError = async (
1951
- output: __HttpResponse,
1952
- context: __SerdeContext
1953
- ): Promise<RevokeSigningProfileCommandOutput> => {
1954
- const parsedOutput: any = {
1955
- ...output,
1956
- body: await parseBody(output.body, context),
1957
- };
1958
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1959
- let errorCode = "UnknownError";
1960
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1961
- switch (errorCode) {
1962
- case "AccessDeniedException":
1963
- case "com.amazonaws.signer#AccessDeniedException":
1964
- response = {
1965
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1966
- name: errorCode,
1967
- $metadata: deserializeMetadata(output),
1968
- };
1969
- break;
1970
- case "InternalServiceErrorException":
1971
- case "com.amazonaws.signer#InternalServiceErrorException":
1972
- response = {
1973
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
1974
- name: errorCode,
1975
- $metadata: deserializeMetadata(output),
1976
- };
1977
- break;
1978
- case "ResourceNotFoundException":
1979
- case "com.amazonaws.signer#ResourceNotFoundException":
1980
- response = {
1981
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1982
- name: errorCode,
1983
- $metadata: deserializeMetadata(output),
1984
- };
1985
- break;
1986
- case "TooManyRequestsException":
1987
- case "com.amazonaws.signer#TooManyRequestsException":
1988
- response = {
1989
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1990
- name: errorCode,
1991
- $metadata: deserializeMetadata(output),
1992
- };
1993
- break;
1994
- case "ValidationException":
1995
- case "com.amazonaws.signer#ValidationException":
1996
- response = {
1997
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1998
- name: errorCode,
1999
- $metadata: deserializeMetadata(output),
2000
- };
2001
- break;
2002
- default:
2003
- const parsedBody = parsedOutput.body;
2004
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2005
- response = {
2006
- ...parsedBody,
2007
- name: `${errorCode}`,
2008
- message: parsedBody.message || parsedBody.Message || errorCode,
2009
- $fault: "client",
2010
- $metadata: deserializeMetadata(output),
2011
- } as any;
2012
- }
2013
- const message = response.message || response.Message || errorCode;
2014
- response.message = message;
2015
- delete response.Message;
2016
- return Promise.reject(Object.assign(new Error(message), response));
2017
- };
2018
-
2019
- export const deserializeAws_restJson1StartSigningJobCommand = async (
2020
- output: __HttpResponse,
2021
- context: __SerdeContext
2022
- ): Promise<StartSigningJobCommandOutput> => {
2023
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2024
- return deserializeAws_restJson1StartSigningJobCommandError(output, context);
2025
- }
2026
- const contents: StartSigningJobCommandOutput = {
2027
- $metadata: deserializeMetadata(output),
2028
- jobId: undefined,
2029
- jobOwner: undefined,
2030
- };
2031
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2032
- if (data.jobId !== undefined && data.jobId !== null) {
2033
- contents.jobId = __expectString(data.jobId);
2034
- }
2035
- if (data.jobOwner !== undefined && data.jobOwner !== null) {
2036
- contents.jobOwner = __expectString(data.jobOwner);
2037
- }
2038
- return Promise.resolve(contents);
2039
- };
2040
-
2041
- const deserializeAws_restJson1StartSigningJobCommandError = async (
2042
- output: __HttpResponse,
2043
- context: __SerdeContext
2044
- ): Promise<StartSigningJobCommandOutput> => {
2045
- const parsedOutput: any = {
2046
- ...output,
2047
- body: await parseBody(output.body, context),
2048
- };
2049
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2050
- let errorCode = "UnknownError";
2051
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2052
- switch (errorCode) {
2053
- case "AccessDeniedException":
2054
- case "com.amazonaws.signer#AccessDeniedException":
2055
- response = {
2056
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2057
- name: errorCode,
2058
- $metadata: deserializeMetadata(output),
2059
- };
2060
- break;
2061
- case "InternalServiceErrorException":
2062
- case "com.amazonaws.signer#InternalServiceErrorException":
2063
- response = {
2064
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
2065
- name: errorCode,
2066
- $metadata: deserializeMetadata(output),
2067
- };
2068
- break;
2069
- case "ResourceNotFoundException":
2070
- case "com.amazonaws.signer#ResourceNotFoundException":
2071
- response = {
2072
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2073
- name: errorCode,
2074
- $metadata: deserializeMetadata(output),
2075
- };
2076
- break;
2077
- case "ThrottlingException":
2078
- case "com.amazonaws.signer#ThrottlingException":
2079
- response = {
2080
- ...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
2081
- name: errorCode,
2082
- $metadata: deserializeMetadata(output),
2083
- };
2084
- break;
2085
- case "TooManyRequestsException":
2086
- case "com.amazonaws.signer#TooManyRequestsException":
2087
- response = {
2088
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2089
- name: errorCode,
2090
- $metadata: deserializeMetadata(output),
2091
- };
2092
- break;
2093
- case "ValidationException":
2094
- case "com.amazonaws.signer#ValidationException":
2095
- response = {
2096
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2097
- name: errorCode,
2098
- $metadata: deserializeMetadata(output),
2099
- };
2100
- break;
2101
- default:
2102
- const parsedBody = parsedOutput.body;
2103
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2104
- response = {
2105
- ...parsedBody,
2106
- name: `${errorCode}`,
2107
- message: parsedBody.message || parsedBody.Message || errorCode,
2108
- $fault: "client",
2109
- $metadata: deserializeMetadata(output),
2110
- } as any;
2111
- }
2112
- const message = response.message || response.Message || errorCode;
2113
- response.message = message;
2114
- delete response.Message;
2115
- return Promise.reject(Object.assign(new Error(message), response));
2116
- };
2117
-
2118
- export const deserializeAws_restJson1TagResourceCommand = async (
2119
- output: __HttpResponse,
2120
- context: __SerdeContext
2121
- ): Promise<TagResourceCommandOutput> => {
2122
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2123
- return deserializeAws_restJson1TagResourceCommandError(output, context);
2124
- }
2125
- const contents: TagResourceCommandOutput = {
2126
- $metadata: deserializeMetadata(output),
2127
- };
2128
- await collectBody(output.body, context);
2129
- return Promise.resolve(contents);
2130
- };
2131
-
2132
- const deserializeAws_restJson1TagResourceCommandError = async (
2133
- output: __HttpResponse,
2134
- context: __SerdeContext
2135
- ): Promise<TagResourceCommandOutput> => {
2136
- const parsedOutput: any = {
2137
- ...output,
2138
- body: await parseBody(output.body, context),
2139
- };
2140
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2141
- let errorCode = "UnknownError";
2142
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2143
- switch (errorCode) {
2144
- case "BadRequestException":
2145
- case "com.amazonaws.signer#BadRequestException":
2146
- response = {
2147
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2148
- name: errorCode,
2149
- $metadata: deserializeMetadata(output),
2150
- };
2151
- break;
2152
- case "InternalServiceErrorException":
2153
- case "com.amazonaws.signer#InternalServiceErrorException":
2154
- response = {
2155
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
2156
- name: errorCode,
2157
- $metadata: deserializeMetadata(output),
2158
- };
2159
- break;
2160
- case "NotFoundException":
2161
- case "com.amazonaws.signer#NotFoundException":
2162
- response = {
2163
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2164
- name: errorCode,
2165
- $metadata: deserializeMetadata(output),
2166
- };
2167
- break;
2168
- case "TooManyRequestsException":
2169
- case "com.amazonaws.signer#TooManyRequestsException":
2170
- response = {
2171
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2172
- name: errorCode,
2173
- $metadata: deserializeMetadata(output),
2174
- };
2175
- break;
2176
- default:
2177
- const parsedBody = parsedOutput.body;
2178
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2179
- response = {
2180
- ...parsedBody,
2181
- name: `${errorCode}`,
2182
- message: parsedBody.message || parsedBody.Message || errorCode,
2183
- $fault: "client",
2184
- $metadata: deserializeMetadata(output),
2185
- } as any;
2186
- }
2187
- const message = response.message || response.Message || errorCode;
2188
- response.message = message;
2189
- delete response.Message;
2190
- return Promise.reject(Object.assign(new Error(message), response));
2191
- };
2192
-
2193
- export const deserializeAws_restJson1UntagResourceCommand = async (
2194
- output: __HttpResponse,
2195
- context: __SerdeContext
2196
- ): Promise<UntagResourceCommandOutput> => {
2197
- if (output.statusCode !== 200 && output.statusCode >= 300) {
2198
- return deserializeAws_restJson1UntagResourceCommandError(output, context);
2199
- }
2200
- const contents: UntagResourceCommandOutput = {
2201
- $metadata: deserializeMetadata(output),
2202
- };
2203
- await collectBody(output.body, context);
2204
- return Promise.resolve(contents);
2205
- };
2206
-
2207
- const deserializeAws_restJson1UntagResourceCommandError = async (
2208
- output: __HttpResponse,
2209
- context: __SerdeContext
2210
- ): Promise<UntagResourceCommandOutput> => {
2211
- const parsedOutput: any = {
2212
- ...output,
2213
- body: await parseBody(output.body, context),
2214
- };
2215
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2216
- let errorCode = "UnknownError";
2217
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2218
- switch (errorCode) {
2219
- case "BadRequestException":
2220
- case "com.amazonaws.signer#BadRequestException":
2221
- response = {
2222
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2223
- name: errorCode,
2224
- $metadata: deserializeMetadata(output),
2225
- };
2226
- break;
2227
- case "InternalServiceErrorException":
2228
- case "com.amazonaws.signer#InternalServiceErrorException":
2229
- response = {
2230
- ...(await deserializeAws_restJson1InternalServiceErrorExceptionResponse(parsedOutput, context)),
2231
- name: errorCode,
2232
- $metadata: deserializeMetadata(output),
2233
- };
2234
- break;
2235
- case "NotFoundException":
2236
- case "com.amazonaws.signer#NotFoundException":
2237
- response = {
2238
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2239
- name: errorCode,
2240
- $metadata: deserializeMetadata(output),
2241
- };
2242
- break;
2243
- case "TooManyRequestsException":
2244
- case "com.amazonaws.signer#TooManyRequestsException":
2245
- response = {
2246
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2247
- name: errorCode,
2248
- $metadata: deserializeMetadata(output),
2249
- };
2250
- break;
2251
- default:
2252
- const parsedBody = parsedOutput.body;
2253
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2254
- response = {
2255
- ...parsedBody,
2256
- name: `${errorCode}`,
2257
- message: parsedBody.message || parsedBody.Message || errorCode,
2258
- $fault: "client",
2259
- $metadata: deserializeMetadata(output),
2260
- } as any;
2261
- }
2262
- const message = response.message || response.Message || errorCode;
2263
- response.message = message;
2264
- delete response.Message;
2265
- return Promise.reject(Object.assign(new Error(message), response));
2266
- };
2267
-
2268
- const deserializeAws_restJson1AccessDeniedExceptionResponse = async (
2269
- parsedOutput: any,
2270
- context: __SerdeContext
2271
- ): Promise<AccessDeniedException> => {
2272
- const contents: AccessDeniedException = {
2273
- name: "AccessDeniedException",
2274
- $fault: "client",
2275
- $metadata: deserializeMetadata(parsedOutput),
2276
- code: undefined,
2277
- message: undefined,
2278
- };
2279
- const data: any = parsedOutput.body;
2280
- if (data.code !== undefined && data.code !== null) {
2281
- contents.code = __expectString(data.code);
2282
- }
2283
- if (data.message !== undefined && data.message !== null) {
2284
- contents.message = __expectString(data.message);
2285
- }
2286
- return contents;
2287
- };
2288
-
2289
- const deserializeAws_restJson1BadRequestExceptionResponse = async (
2290
- parsedOutput: any,
2291
- context: __SerdeContext
2292
- ): Promise<BadRequestException> => {
2293
- const contents: BadRequestException = {
2294
- name: "BadRequestException",
2295
- $fault: "client",
2296
- $metadata: deserializeMetadata(parsedOutput),
2297
- code: undefined,
2298
- message: undefined,
2299
- };
2300
- const data: any = parsedOutput.body;
2301
- if (data.code !== undefined && data.code !== null) {
2302
- contents.code = __expectString(data.code);
2303
- }
2304
- if (data.message !== undefined && data.message !== null) {
2305
- contents.message = __expectString(data.message);
2306
- }
2307
- return contents;
2308
- };
2309
-
2310
- const deserializeAws_restJson1ConflictExceptionResponse = async (
2311
- parsedOutput: any,
2312
- context: __SerdeContext
2313
- ): Promise<ConflictException> => {
2314
- const contents: ConflictException = {
2315
- name: "ConflictException",
2316
- $fault: "client",
2317
- $metadata: deserializeMetadata(parsedOutput),
2318
- code: undefined,
2319
- message: undefined,
2320
- };
2321
- const data: any = parsedOutput.body;
2322
- if (data.code !== undefined && data.code !== null) {
2323
- contents.code = __expectString(data.code);
2324
- }
2325
- if (data.message !== undefined && data.message !== null) {
2326
- contents.message = __expectString(data.message);
2327
- }
2328
- return contents;
2329
- };
2330
-
2331
- const deserializeAws_restJson1InternalServiceErrorExceptionResponse = async (
2332
- parsedOutput: any,
2333
- context: __SerdeContext
2334
- ): Promise<InternalServiceErrorException> => {
2335
- const contents: InternalServiceErrorException = {
2336
- name: "InternalServiceErrorException",
2337
- $fault: "server",
2338
- $metadata: deserializeMetadata(parsedOutput),
2339
- code: undefined,
2340
- message: undefined,
2341
- };
2342
- const data: any = parsedOutput.body;
2343
- if (data.code !== undefined && data.code !== null) {
2344
- contents.code = __expectString(data.code);
2345
- }
2346
- if (data.message !== undefined && data.message !== null) {
2347
- contents.message = __expectString(data.message);
2348
- }
2349
- return contents;
2350
- };
2351
-
2352
- const deserializeAws_restJson1NotFoundExceptionResponse = async (
2353
- parsedOutput: any,
2354
- context: __SerdeContext
2355
- ): Promise<NotFoundException> => {
2356
- const contents: NotFoundException = {
2357
- name: "NotFoundException",
2358
- $fault: "client",
2359
- $metadata: deserializeMetadata(parsedOutput),
2360
- code: undefined,
2361
- message: undefined,
2362
- };
2363
- const data: any = parsedOutput.body;
2364
- if (data.code !== undefined && data.code !== null) {
2365
- contents.code = __expectString(data.code);
2366
- }
2367
- if (data.message !== undefined && data.message !== null) {
2368
- contents.message = __expectString(data.message);
2369
- }
2370
- return contents;
2371
- };
2372
-
2373
- const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (
2374
- parsedOutput: any,
2375
- context: __SerdeContext
2376
- ): Promise<ResourceNotFoundException> => {
2377
- const contents: ResourceNotFoundException = {
2378
- name: "ResourceNotFoundException",
2379
- $fault: "client",
2380
- $metadata: deserializeMetadata(parsedOutput),
2381
- code: undefined,
2382
- message: undefined,
2383
- };
2384
- const data: any = parsedOutput.body;
2385
- if (data.code !== undefined && data.code !== null) {
2386
- contents.code = __expectString(data.code);
2387
- }
2388
- if (data.message !== undefined && data.message !== null) {
2389
- contents.message = __expectString(data.message);
2390
- }
2391
- return contents;
2392
- };
2393
-
2394
- const deserializeAws_restJson1ServiceLimitExceededExceptionResponse = async (
2395
- parsedOutput: any,
2396
- context: __SerdeContext
2397
- ): Promise<ServiceLimitExceededException> => {
2398
- const contents: ServiceLimitExceededException = {
2399
- name: "ServiceLimitExceededException",
2400
- $fault: "client",
2401
- $metadata: deserializeMetadata(parsedOutput),
2402
- code: undefined,
2403
- message: undefined,
2404
- };
2405
- const data: any = parsedOutput.body;
2406
- if (data.code !== undefined && data.code !== null) {
2407
- contents.code = __expectString(data.code);
2408
- }
2409
- if (data.message !== undefined && data.message !== null) {
2410
- contents.message = __expectString(data.message);
2411
- }
2412
- return contents;
2413
- };
2414
-
2415
- const deserializeAws_restJson1ThrottlingExceptionResponse = async (
2416
- parsedOutput: any,
2417
- context: __SerdeContext
2418
- ): Promise<ThrottlingException> => {
2419
- const contents: ThrottlingException = {
2420
- name: "ThrottlingException",
2421
- $fault: "client",
2422
- $metadata: deserializeMetadata(parsedOutput),
2423
- code: undefined,
2424
- message: undefined,
2425
- };
2426
- const data: any = parsedOutput.body;
2427
- if (data.code !== undefined && data.code !== null) {
2428
- contents.code = __expectString(data.code);
2429
- }
2430
- if (data.message !== undefined && data.message !== null) {
2431
- contents.message = __expectString(data.message);
2432
- }
2433
- return contents;
2434
- };
2435
-
2436
- const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (
2437
- parsedOutput: any,
2438
- context: __SerdeContext
2439
- ): Promise<TooManyRequestsException> => {
2440
- const contents: TooManyRequestsException = {
2441
- name: "TooManyRequestsException",
2442
- $fault: "client",
2443
- $metadata: deserializeMetadata(parsedOutput),
2444
- code: undefined,
2445
- message: undefined,
2446
- };
2447
- const data: any = parsedOutput.body;
2448
- if (data.code !== undefined && data.code !== null) {
2449
- contents.code = __expectString(data.code);
2450
- }
2451
- if (data.message !== undefined && data.message !== null) {
2452
- contents.message = __expectString(data.message);
2453
- }
2454
- return contents;
2455
- };
2456
-
2457
- const deserializeAws_restJson1ValidationExceptionResponse = async (
2458
- parsedOutput: any,
2459
- context: __SerdeContext
2460
- ): Promise<ValidationException> => {
2461
- const contents: ValidationException = {
2462
- name: "ValidationException",
2463
- $fault: "client",
2464
- $metadata: deserializeMetadata(parsedOutput),
2465
- code: undefined,
2466
- message: undefined,
2467
- };
2468
- const data: any = parsedOutput.body;
2469
- if (data.code !== undefined && data.code !== null) {
2470
- contents.code = __expectString(data.code);
2471
- }
2472
- if (data.message !== undefined && data.message !== null) {
2473
- contents.message = __expectString(data.message);
2474
- }
2475
- return contents;
2476
- };
2477
-
2478
- const serializeAws_restJson1Destination = (input: Destination, context: __SerdeContext): any => {
2479
- return {
2480
- ...(input.s3 !== undefined && input.s3 !== null && { s3: serializeAws_restJson1S3Destination(input.s3, context) }),
2481
- };
2482
- };
2483
-
2484
- const serializeAws_restJson1S3Destination = (input: S3Destination, context: __SerdeContext): any => {
2485
- return {
2486
- ...(input.bucketName !== undefined && input.bucketName !== null && { bucketName: input.bucketName }),
2487
- ...(input.prefix !== undefined && input.prefix !== null && { prefix: input.prefix }),
2488
- };
2489
- };
2490
-
2491
- const serializeAws_restJson1S3Source = (input: S3Source, context: __SerdeContext): any => {
2492
- return {
2493
- ...(input.bucketName !== undefined && input.bucketName !== null && { bucketName: input.bucketName }),
2494
- ...(input.key !== undefined && input.key !== null && { key: input.key }),
2495
- ...(input.version !== undefined && input.version !== null && { version: input.version }),
2496
- };
2497
- };
2498
-
2499
- const serializeAws_restJson1SignatureValidityPeriod = (
2500
- input: SignatureValidityPeriod,
2501
- context: __SerdeContext
2502
- ): any => {
2503
- return {
2504
- ...(input.type !== undefined && input.type !== null && { type: input.type }),
2505
- ...(input.value !== undefined && input.value !== null && { value: input.value }),
2506
- };
2507
- };
2508
-
2509
- const serializeAws_restJson1SigningConfigurationOverrides = (
2510
- input: SigningConfigurationOverrides,
2511
- context: __SerdeContext
2512
- ): any => {
2513
- return {
2514
- ...(input.encryptionAlgorithm !== undefined &&
2515
- input.encryptionAlgorithm !== null && { encryptionAlgorithm: input.encryptionAlgorithm }),
2516
- ...(input.hashAlgorithm !== undefined && input.hashAlgorithm !== null && { hashAlgorithm: input.hashAlgorithm }),
2517
- };
2518
- };
2519
-
2520
- const serializeAws_restJson1SigningMaterial = (input: SigningMaterial, context: __SerdeContext): any => {
2521
- return {
2522
- ...(input.certificateArn !== undefined &&
2523
- input.certificateArn !== null && { certificateArn: input.certificateArn }),
2524
- };
2525
- };
2526
-
2527
- const serializeAws_restJson1SigningParameters = (input: { [key: string]: string }, context: __SerdeContext): any => {
2528
- return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
2529
- if (value === null) {
2530
- return acc;
2531
- }
2532
- return {
2533
- ...acc,
2534
- [key]: value,
2535
- };
2536
- }, {});
2537
- };
2538
-
2539
- const serializeAws_restJson1SigningPlatformOverrides = (
2540
- input: SigningPlatformOverrides,
2541
- context: __SerdeContext
2542
- ): any => {
2543
- return {
2544
- ...(input.signingConfiguration !== undefined &&
2545
- input.signingConfiguration !== null && {
2546
- signingConfiguration: serializeAws_restJson1SigningConfigurationOverrides(input.signingConfiguration, context),
2547
- }),
2548
- ...(input.signingImageFormat !== undefined &&
2549
- input.signingImageFormat !== null && { signingImageFormat: input.signingImageFormat }),
2550
- };
2551
- };
2552
-
2553
- const serializeAws_restJson1Source = (input: Source, context: __SerdeContext): any => {
2554
- return {
2555
- ...(input.s3 !== undefined && input.s3 !== null && { s3: serializeAws_restJson1S3Source(input.s3, context) }),
2556
- };
2557
- };
2558
-
2559
- const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => {
2560
- return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
2561
- if (value === null) {
2562
- return acc;
2563
- }
2564
- return {
2565
- ...acc,
2566
- [key]: value,
2567
- };
2568
- }, {});
2569
- };
2570
-
2571
- const deserializeAws_restJson1EncryptionAlgorithmOptions = (
2572
- output: any,
2573
- context: __SerdeContext
2574
- ): EncryptionAlgorithmOptions => {
2575
- return {
2576
- allowedValues:
2577
- output.allowedValues !== undefined && output.allowedValues !== null
2578
- ? deserializeAws_restJson1EncryptionAlgorithms(output.allowedValues, context)
2579
- : undefined,
2580
- defaultValue: __expectString(output.defaultValue),
2581
- } as any;
2582
- };
2583
-
2584
- const deserializeAws_restJson1EncryptionAlgorithms = (
2585
- output: any,
2586
- context: __SerdeContext
2587
- ): (EncryptionAlgorithm | string)[] => {
2588
- return (output || [])
2589
- .filter((e: any) => e != null)
2590
- .map((entry: any) => {
2591
- if (entry === null) {
2592
- return null as any;
2593
- }
2594
- return __expectString(entry) as any;
2595
- });
2596
- };
2597
-
2598
- const deserializeAws_restJson1HashAlgorithmOptions = (output: any, context: __SerdeContext): HashAlgorithmOptions => {
2599
- return {
2600
- allowedValues:
2601
- output.allowedValues !== undefined && output.allowedValues !== null
2602
- ? deserializeAws_restJson1HashAlgorithms(output.allowedValues, context)
2603
- : undefined,
2604
- defaultValue: __expectString(output.defaultValue),
2605
- } as any;
2606
- };
2607
-
2608
- const deserializeAws_restJson1HashAlgorithms = (output: any, context: __SerdeContext): (HashAlgorithm | string)[] => {
2609
- return (output || [])
2610
- .filter((e: any) => e != null)
2611
- .map((entry: any) => {
2612
- if (entry === null) {
2613
- return null as any;
2614
- }
2615
- return __expectString(entry) as any;
2616
- });
2617
- };
2618
-
2619
- const deserializeAws_restJson1ImageFormats = (output: any, context: __SerdeContext): (ImageFormat | string)[] => {
2620
- return (output || [])
2621
- .filter((e: any) => e != null)
2622
- .map((entry: any) => {
2623
- if (entry === null) {
2624
- return null as any;
2625
- }
2626
- return __expectString(entry) as any;
2627
- });
2628
- };
2629
-
2630
- const deserializeAws_restJson1Permission = (output: any, context: __SerdeContext): Permission => {
2631
- return {
2632
- action: __expectString(output.action),
2633
- principal: __expectString(output.principal),
2634
- profileVersion: __expectString(output.profileVersion),
2635
- statementId: __expectString(output.statementId),
2636
- } as any;
2637
- };
2638
-
2639
- const deserializeAws_restJson1Permissions = (output: any, context: __SerdeContext): Permission[] => {
2640
- return (output || [])
2641
- .filter((e: any) => e != null)
2642
- .map((entry: any) => {
2643
- if (entry === null) {
2644
- return null as any;
2645
- }
2646
- return deserializeAws_restJson1Permission(entry, context);
2647
- });
2648
- };
2649
-
2650
- const deserializeAws_restJson1S3SignedObject = (output: any, context: __SerdeContext): S3SignedObject => {
2651
- return {
2652
- bucketName: __expectString(output.bucketName),
2653
- key: __expectString(output.key),
2654
- } as any;
2655
- };
2656
-
2657
- const deserializeAws_restJson1S3Source = (output: any, context: __SerdeContext): S3Source => {
2658
- return {
2659
- bucketName: __expectString(output.bucketName),
2660
- key: __expectString(output.key),
2661
- version: __expectString(output.version),
2662
- } as any;
2663
- };
2664
-
2665
- const deserializeAws_restJson1SignatureValidityPeriod = (
2666
- output: any,
2667
- context: __SerdeContext
2668
- ): SignatureValidityPeriod => {
2669
- return {
2670
- type: __expectString(output.type),
2671
- value: __expectInt32(output.value),
2672
- } as any;
2673
- };
2674
-
2675
- const deserializeAws_restJson1SignedObject = (output: any, context: __SerdeContext): SignedObject => {
2676
- return {
2677
- s3:
2678
- output.s3 !== undefined && output.s3 !== null
2679
- ? deserializeAws_restJson1S3SignedObject(output.s3, context)
2680
- : undefined,
2681
- } as any;
2682
- };
2683
-
2684
- const deserializeAws_restJson1SigningConfiguration = (output: any, context: __SerdeContext): SigningConfiguration => {
2685
- return {
2686
- encryptionAlgorithmOptions:
2687
- output.encryptionAlgorithmOptions !== undefined && output.encryptionAlgorithmOptions !== null
2688
- ? deserializeAws_restJson1EncryptionAlgorithmOptions(output.encryptionAlgorithmOptions, context)
2689
- : undefined,
2690
- hashAlgorithmOptions:
2691
- output.hashAlgorithmOptions !== undefined && output.hashAlgorithmOptions !== null
2692
- ? deserializeAws_restJson1HashAlgorithmOptions(output.hashAlgorithmOptions, context)
2693
- : undefined,
2694
- } as any;
2695
- };
2696
-
2697
- const deserializeAws_restJson1SigningConfigurationOverrides = (
2698
- output: any,
2699
- context: __SerdeContext
2700
- ): SigningConfigurationOverrides => {
2701
- return {
2702
- encryptionAlgorithm: __expectString(output.encryptionAlgorithm),
2703
- hashAlgorithm: __expectString(output.hashAlgorithm),
2704
- } as any;
2705
- };
2706
-
2707
- const deserializeAws_restJson1SigningImageFormat = (output: any, context: __SerdeContext): SigningImageFormat => {
2708
- return {
2709
- defaultFormat: __expectString(output.defaultFormat),
2710
- supportedFormats:
2711
- output.supportedFormats !== undefined && output.supportedFormats !== null
2712
- ? deserializeAws_restJson1ImageFormats(output.supportedFormats, context)
2713
- : undefined,
2714
- } as any;
2715
- };
2716
-
2717
- const deserializeAws_restJson1SigningJob = (output: any, context: __SerdeContext): SigningJob => {
2718
- return {
2719
- createdAt:
2720
- output.createdAt !== undefined && output.createdAt !== null
2721
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.createdAt)))
2722
- : undefined,
2723
- isRevoked: __expectBoolean(output.isRevoked),
2724
- jobId: __expectString(output.jobId),
2725
- jobInvoker: __expectString(output.jobInvoker),
2726
- jobOwner: __expectString(output.jobOwner),
2727
- platformDisplayName: __expectString(output.platformDisplayName),
2728
- platformId: __expectString(output.platformId),
2729
- profileName: __expectString(output.profileName),
2730
- profileVersion: __expectString(output.profileVersion),
2731
- signatureExpiresAt:
2732
- output.signatureExpiresAt !== undefined && output.signatureExpiresAt !== null
2733
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.signatureExpiresAt)))
2734
- : undefined,
2735
- signedObject:
2736
- output.signedObject !== undefined && output.signedObject !== null
2737
- ? deserializeAws_restJson1SignedObject(output.signedObject, context)
2738
- : undefined,
2739
- signingMaterial:
2740
- output.signingMaterial !== undefined && output.signingMaterial !== null
2741
- ? deserializeAws_restJson1SigningMaterial(output.signingMaterial, context)
2742
- : undefined,
2743
- source:
2744
- output.source !== undefined && output.source !== null
2745
- ? deserializeAws_restJson1Source(output.source, context)
2746
- : undefined,
2747
- status: __expectString(output.status),
2748
- } as any;
2749
- };
2750
-
2751
- const deserializeAws_restJson1SigningJobRevocationRecord = (
2752
- output: any,
2753
- context: __SerdeContext
2754
- ): SigningJobRevocationRecord => {
2755
- return {
2756
- reason: __expectString(output.reason),
2757
- revokedAt:
2758
- output.revokedAt !== undefined && output.revokedAt !== null
2759
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.revokedAt)))
2760
- : undefined,
2761
- revokedBy: __expectString(output.revokedBy),
2762
- } as any;
2763
- };
2764
-
2765
- const deserializeAws_restJson1SigningJobs = (output: any, context: __SerdeContext): SigningJob[] => {
2766
- return (output || [])
2767
- .filter((e: any) => e != null)
2768
- .map((entry: any) => {
2769
- if (entry === null) {
2770
- return null as any;
2771
- }
2772
- return deserializeAws_restJson1SigningJob(entry, context);
2773
- });
2774
- };
2775
-
2776
- const deserializeAws_restJson1SigningMaterial = (output: any, context: __SerdeContext): SigningMaterial => {
2777
- return {
2778
- certificateArn: __expectString(output.certificateArn),
2779
- } as any;
2780
- };
2781
-
2782
- const deserializeAws_restJson1SigningParameters = (output: any, context: __SerdeContext): { [key: string]: string } => {
2783
- return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
2784
- if (value === null) {
2785
- return acc;
2786
- }
2787
- return {
2788
- ...acc,
2789
- [key]: __expectString(value) as any,
2790
- };
2791
- }, {});
2792
- };
2793
-
2794
- const deserializeAws_restJson1SigningPlatform = (output: any, context: __SerdeContext): SigningPlatform => {
2795
- return {
2796
- category: __expectString(output.category),
2797
- displayName: __expectString(output.displayName),
2798
- maxSizeInMB: __expectInt32(output.maxSizeInMB),
2799
- partner: __expectString(output.partner),
2800
- platformId: __expectString(output.platformId),
2801
- revocationSupported: __expectBoolean(output.revocationSupported),
2802
- signingConfiguration:
2803
- output.signingConfiguration !== undefined && output.signingConfiguration !== null
2804
- ? deserializeAws_restJson1SigningConfiguration(output.signingConfiguration, context)
2805
- : undefined,
2806
- signingImageFormat:
2807
- output.signingImageFormat !== undefined && output.signingImageFormat !== null
2808
- ? deserializeAws_restJson1SigningImageFormat(output.signingImageFormat, context)
2809
- : undefined,
2810
- target: __expectString(output.target),
2811
- } as any;
2812
- };
2813
-
2814
- const deserializeAws_restJson1SigningPlatformOverrides = (
2815
- output: any,
2816
- context: __SerdeContext
2817
- ): SigningPlatformOverrides => {
2818
- return {
2819
- signingConfiguration:
2820
- output.signingConfiguration !== undefined && output.signingConfiguration !== null
2821
- ? deserializeAws_restJson1SigningConfigurationOverrides(output.signingConfiguration, context)
2822
- : undefined,
2823
- signingImageFormat: __expectString(output.signingImageFormat),
2824
- } as any;
2825
- };
2826
-
2827
- const deserializeAws_restJson1SigningPlatforms = (output: any, context: __SerdeContext): SigningPlatform[] => {
2828
- return (output || [])
2829
- .filter((e: any) => e != null)
2830
- .map((entry: any) => {
2831
- if (entry === null) {
2832
- return null as any;
2833
- }
2834
- return deserializeAws_restJson1SigningPlatform(entry, context);
2835
- });
2836
- };
2837
-
2838
- const deserializeAws_restJson1SigningProfile = (output: any, context: __SerdeContext): SigningProfile => {
2839
- return {
2840
- arn: __expectString(output.arn),
2841
- platformDisplayName: __expectString(output.platformDisplayName),
2842
- platformId: __expectString(output.platformId),
2843
- profileName: __expectString(output.profileName),
2844
- profileVersion: __expectString(output.profileVersion),
2845
- profileVersionArn: __expectString(output.profileVersionArn),
2846
- signatureValidityPeriod:
2847
- output.signatureValidityPeriod !== undefined && output.signatureValidityPeriod !== null
2848
- ? deserializeAws_restJson1SignatureValidityPeriod(output.signatureValidityPeriod, context)
2849
- : undefined,
2850
- signingMaterial:
2851
- output.signingMaterial !== undefined && output.signingMaterial !== null
2852
- ? deserializeAws_restJson1SigningMaterial(output.signingMaterial, context)
2853
- : undefined,
2854
- signingParameters:
2855
- output.signingParameters !== undefined && output.signingParameters !== null
2856
- ? deserializeAws_restJson1SigningParameters(output.signingParameters, context)
2857
- : undefined,
2858
- status: __expectString(output.status),
2859
- tags:
2860
- output.tags !== undefined && output.tags !== null
2861
- ? deserializeAws_restJson1TagMap(output.tags, context)
2862
- : undefined,
2863
- } as any;
2864
- };
2865
-
2866
- const deserializeAws_restJson1SigningProfileRevocationRecord = (
2867
- output: any,
2868
- context: __SerdeContext
2869
- ): SigningProfileRevocationRecord => {
2870
- return {
2871
- revocationEffectiveFrom:
2872
- output.revocationEffectiveFrom !== undefined && output.revocationEffectiveFrom !== null
2873
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.revocationEffectiveFrom)))
2874
- : undefined,
2875
- revokedAt:
2876
- output.revokedAt !== undefined && output.revokedAt !== null
2877
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.revokedAt)))
2878
- : undefined,
2879
- revokedBy: __expectString(output.revokedBy),
2880
- } as any;
2881
- };
2882
-
2883
- const deserializeAws_restJson1SigningProfiles = (output: any, context: __SerdeContext): SigningProfile[] => {
2884
- return (output || [])
2885
- .filter((e: any) => e != null)
2886
- .map((entry: any) => {
2887
- if (entry === null) {
2888
- return null as any;
2889
- }
2890
- return deserializeAws_restJson1SigningProfile(entry, context);
2891
- });
2892
- };
2893
-
2894
- const deserializeAws_restJson1Source = (output: any, context: __SerdeContext): Source => {
2895
- return {
2896
- s3:
2897
- output.s3 !== undefined && output.s3 !== null ? deserializeAws_restJson1S3Source(output.s3, context) : undefined,
2898
- } as any;
2899
- };
2900
-
2901
- const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => {
2902
- return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
2903
- if (value === null) {
2904
- return acc;
2905
- }
2906
- return {
2907
- ...acc,
2908
- [key]: __expectString(value) as any,
2909
- };
2910
- }, {});
2911
- };
2912
-
2913
- const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
2914
- httpStatusCode: output.statusCode,
2915
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
2916
- extendedRequestId: output.headers["x-amz-id-2"],
2917
- cfId: output.headers["x-amz-cf-id"],
2918
- });
2919
-
2920
- // Collect low-level response body stream to Uint8Array.
2921
- const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
2922
- if (streamBody instanceof Uint8Array) {
2923
- return Promise.resolve(streamBody);
2924
- }
2925
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2926
- };
2927
-
2928
- // Encode Uint8Array data into string with utf-8.
2929
- const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
2930
- collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
2931
-
2932
- const isSerializableHeaderValue = (value: any): boolean =>
2933
- value !== undefined &&
2934
- value !== null &&
2935
- value !== "" &&
2936
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2937
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
2938
-
2939
- const parseBody = (streamBody: any, context: __SerdeContext): any =>
2940
- collectBodyString(streamBody, context).then((encoded) => {
2941
- if (encoded.length) {
2942
- return JSON.parse(encoded);
2943
- }
2944
- return {};
2945
- });
2946
-
2947
- /**
2948
- * Load an error code for the aws.rest-json-1.1 protocol.
2949
- */
2950
- const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
2951
- const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
2952
-
2953
- const sanitizeErrorCode = (rawValue: string): string => {
2954
- let cleanValue = rawValue;
2955
- if (cleanValue.indexOf(":") >= 0) {
2956
- cleanValue = cleanValue.split(":")[0];
2957
- }
2958
- if (cleanValue.indexOf("#") >= 0) {
2959
- cleanValue = cleanValue.split("#")[1];
2960
- }
2961
- return cleanValue;
2962
- };
2963
-
2964
- const headerKey = findKey(output.headers, "x-amzn-errortype");
2965
- if (headerKey !== undefined) {
2966
- return sanitizeErrorCode(output.headers[headerKey]);
2967
- }
2968
-
2969
- if (data.code !== undefined) {
2970
- return sanitizeErrorCode(data.code);
2971
- }
2972
-
2973
- if (data["__type"] !== undefined) {
2974
- return sanitizeErrorCode(data["__type"]);
2975
- }
2976
-
2977
- return "";
2978
- };