@aws-sdk/client-serverlessapplicationrepository 3.33.0 → 3.36.1

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 (221) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/{dist/cjs → dist-cjs}/ServerlessApplicationRepository.js +2 -25
  3. package/dist-cjs/ServerlessApplicationRepositoryClient.js +35 -0
  4. package/{dist/cjs → dist-cjs}/commands/CreateApplicationCommand.js +2 -27
  5. package/{dist/cjs → dist-cjs}/commands/CreateApplicationVersionCommand.js +2 -27
  6. package/{dist/cjs → dist-cjs}/commands/CreateCloudFormationChangeSetCommand.js +2 -27
  7. package/{dist/cjs → dist-cjs}/commands/CreateCloudFormationTemplateCommand.js +2 -27
  8. package/{dist/cjs → dist-cjs}/commands/DeleteApplicationCommand.js +2 -27
  9. package/{dist/cjs → dist-cjs}/commands/GetApplicationCommand.js +2 -27
  10. package/{dist/cjs → dist-cjs}/commands/GetApplicationPolicyCommand.js +2 -27
  11. package/{dist/cjs → dist-cjs}/commands/GetCloudFormationTemplateCommand.js +2 -27
  12. package/{dist/cjs → dist-cjs}/commands/ListApplicationDependenciesCommand.js +2 -27
  13. package/{dist/cjs → dist-cjs}/commands/ListApplicationVersionsCommand.js +2 -27
  14. package/{dist/cjs → dist-cjs}/commands/ListApplicationsCommand.js +2 -27
  15. package/{dist/cjs → dist-cjs}/commands/PutApplicationPolicyCommand.js +2 -30
  16. package/{dist/cjs → dist-cjs}/commands/UnshareApplicationCommand.js +2 -27
  17. package/{dist/cjs → dist-cjs}/commands/UpdateApplicationCommand.js +2 -27
  18. package/{dist/cjs → dist-cjs}/endpoints.js +0 -1
  19. package/{dist/cjs → dist-cjs}/index.js +0 -1
  20. package/{dist/cjs → dist-cjs}/models/index.js +0 -1
  21. package/{dist/cjs → dist-cjs}/models/models_0.js +0 -127
  22. package/{dist/cjs → dist-cjs}/pagination/Interfaces.js +0 -1
  23. package/{dist/cjs → dist-cjs}/pagination/ListApplicationDependenciesPaginator.js +1 -12
  24. package/{dist/cjs → dist-cjs}/pagination/ListApplicationVersionsPaginator.js +1 -12
  25. package/{dist/cjs → dist-cjs}/pagination/ListApplicationsPaginator.js +1 -12
  26. package/{dist/cjs → dist-cjs}/protocols/Aws_restJson1.js +2 -8
  27. package/{dist/cjs → dist-cjs}/runtimeConfig.browser.js +1 -5
  28. package/{dist/cjs → dist-cjs}/runtimeConfig.js +1 -5
  29. package/{dist/cjs → dist-cjs}/runtimeConfig.native.js +0 -4
  30. package/{dist/cjs → dist-cjs}/runtimeConfig.shared.js +1 -5
  31. package/{dist/es → dist-es}/ServerlessApplicationRepository.js +3 -26
  32. package/dist-es/ServerlessApplicationRepositoryClient.js +37 -0
  33. package/{dist/es → dist-es}/commands/CreateApplicationCommand.js +4 -30
  34. package/{dist/es → dist-es}/commands/CreateApplicationVersionCommand.js +4 -30
  35. package/{dist/es → dist-es}/commands/CreateCloudFormationChangeSetCommand.js +4 -30
  36. package/{dist/es → dist-es}/commands/CreateCloudFormationTemplateCommand.js +4 -30
  37. package/{dist/es → dist-es}/commands/DeleteApplicationCommand.js +4 -30
  38. package/{dist/es → dist-es}/commands/GetApplicationCommand.js +4 -30
  39. package/{dist/es → dist-es}/commands/GetApplicationPolicyCommand.js +4 -30
  40. package/{dist/es → dist-es}/commands/GetCloudFormationTemplateCommand.js +4 -30
  41. package/{dist/es → dist-es}/commands/ListApplicationDependenciesCommand.js +4 -30
  42. package/{dist/es → dist-es}/commands/ListApplicationVersionsCommand.js +4 -30
  43. package/{dist/es → dist-es}/commands/ListApplicationsCommand.js +4 -30
  44. package/{dist/es → dist-es}/commands/PutApplicationPolicyCommand.js +4 -33
  45. package/{dist/es → dist-es}/commands/UnshareApplicationCommand.js +4 -30
  46. package/{dist/es → dist-es}/commands/UpdateApplicationCommand.js +4 -30
  47. package/{dist/es → dist-es}/endpoints.js +1 -2
  48. package/{dist/types/index.d.ts → dist-es/index.js} +0 -0
  49. package/{dist/types/models/index.d.ts → dist-es/models/index.js} +0 -0
  50. package/{dist/es → dist-es}/models/models_0.js +0 -127
  51. package/dist-es/pagination/Interfaces.js +1 -0
  52. package/{dist/es → dist-es}/pagination/ListApplicationDependenciesPaginator.js +17 -30
  53. package/{dist/es → dist-es}/pagination/ListApplicationVersionsPaginator.js +17 -30
  54. package/{dist/es → dist-es}/pagination/ListApplicationsPaginator.js +17 -30
  55. package/{dist/es → dist-es}/protocols/Aws_restJson1.js +412 -418
  56. package/{dist/es → dist-es}/runtimeConfig.browser.js +1 -5
  57. package/{dist/es → dist-es}/runtimeConfig.js +1 -5
  58. package/{dist/es → dist-es}/runtimeConfig.native.js +0 -4
  59. package/{dist/es → dist-es}/runtimeConfig.shared.js +1 -5
  60. package/{dist/types → dist-types}/ServerlessApplicationRepository.d.ts +3 -3
  61. package/{dist/types → dist-types}/ServerlessApplicationRepositoryClient.d.ts +9 -9
  62. package/{dist/types → dist-types}/commands/CreateApplicationCommand.d.ts +3 -3
  63. package/{dist/types → dist-types}/commands/CreateApplicationVersionCommand.d.ts +3 -3
  64. package/{dist/types → dist-types}/commands/CreateCloudFormationChangeSetCommand.d.ts +3 -3
  65. package/{dist/types → dist-types}/commands/CreateCloudFormationTemplateCommand.d.ts +3 -3
  66. package/{dist/types → dist-types}/commands/DeleteApplicationCommand.d.ts +3 -3
  67. package/{dist/types → dist-types}/commands/GetApplicationCommand.d.ts +3 -3
  68. package/{dist/types → dist-types}/commands/GetApplicationPolicyCommand.d.ts +3 -3
  69. package/{dist/types → dist-types}/commands/GetCloudFormationTemplateCommand.d.ts +3 -3
  70. package/{dist/types → dist-types}/commands/ListApplicationDependenciesCommand.d.ts +3 -3
  71. package/{dist/types → dist-types}/commands/ListApplicationVersionsCommand.d.ts +3 -3
  72. package/{dist/types → dist-types}/commands/ListApplicationsCommand.d.ts +3 -3
  73. package/{dist/types → dist-types}/commands/PutApplicationPolicyCommand.d.ts +3 -3
  74. package/{dist/types → dist-types}/commands/UnshareApplicationCommand.d.ts +3 -3
  75. package/{dist/types → dist-types}/commands/UpdateApplicationCommand.d.ts +3 -3
  76. package/{dist/types → dist-types}/endpoints.d.ts +0 -0
  77. package/{index.ts → dist-types/index.d.ts} +0 -0
  78. package/{models/index.ts → dist-types/models/index.d.ts} +0 -0
  79. package/{dist/types → dist-types}/models/models_0.d.ts +0 -0
  80. package/{dist/types → dist-types}/pagination/Interfaces.d.ts +1 -1
  81. package/{dist/types → dist-types}/pagination/ListApplicationDependenciesPaginator.d.ts +1 -1
  82. package/{dist/types → dist-types}/pagination/ListApplicationVersionsPaginator.d.ts +1 -1
  83. package/{dist/types → dist-types}/pagination/ListApplicationsPaginator.d.ts +1 -1
  84. package/{dist/types → dist-types}/protocols/Aws_restJson1.d.ts +3 -3
  85. package/{dist/types → dist-types}/runtimeConfig.browser.d.ts +0 -0
  86. package/{dist/types → dist-types}/runtimeConfig.d.ts +1 -1
  87. package/{dist/types → dist-types}/runtimeConfig.native.d.ts +0 -0
  88. package/{dist/types → dist-types}/runtimeConfig.shared.d.ts +0 -0
  89. package/{dist/types → dist-types}/ts3.4/ServerlessApplicationRepository.d.ts +18 -70
  90. package/{dist/types → dist-types}/ts3.4/ServerlessApplicationRepositoryClient.d.ts +33 -117
  91. package/dist-types/ts3.4/commands/CreateApplicationCommand.d.ts +17 -0
  92. package/{dist/types → dist-types}/ts3.4/commands/CreateApplicationVersionCommand.d.ts +5 -23
  93. package/{dist/types → dist-types}/ts3.4/commands/CreateCloudFormationChangeSetCommand.d.ts +5 -23
  94. package/{dist/types → dist-types}/ts3.4/commands/CreateCloudFormationTemplateCommand.d.ts +5 -23
  95. package/dist-types/ts3.4/commands/DeleteApplicationCommand.d.ts +17 -0
  96. package/dist-types/ts3.4/commands/GetApplicationCommand.d.ts +17 -0
  97. package/{dist/types → dist-types}/ts3.4/commands/GetApplicationPolicyCommand.d.ts +5 -23
  98. package/{dist/types → dist-types}/ts3.4/commands/GetCloudFormationTemplateCommand.d.ts +5 -23
  99. package/{dist/types → dist-types}/ts3.4/commands/ListApplicationDependenciesCommand.d.ts +5 -23
  100. package/{dist/types → dist-types}/ts3.4/commands/ListApplicationVersionsCommand.d.ts +5 -23
  101. package/dist-types/ts3.4/commands/ListApplicationsCommand.d.ts +17 -0
  102. package/dist-types/ts3.4/commands/PutApplicationPolicyCommand.d.ts +17 -0
  103. package/dist-types/ts3.4/commands/UnshareApplicationCommand.d.ts +17 -0
  104. package/dist-types/ts3.4/commands/UpdateApplicationCommand.d.ts +17 -0
  105. package/{dist/types → dist-types}/ts3.4/endpoints.d.ts +0 -0
  106. package/{dist/types → dist-types}/ts3.4/index.d.ts +0 -0
  107. package/{dist/types → dist-types}/ts3.4/models/index.d.ts +0 -0
  108. package/dist-types/ts3.4/models/models_0.d.ts +684 -0
  109. package/{dist/types → dist-types}/ts3.4/pagination/Interfaces.d.ts +1 -1
  110. package/{dist/types → dist-types}/ts3.4/pagination/ListApplicationDependenciesPaginator.d.ts +1 -1
  111. package/{dist/types → dist-types}/ts3.4/pagination/ListApplicationVersionsPaginator.d.ts +1 -1
  112. package/{dist/types → dist-types}/ts3.4/pagination/ListApplicationsPaginator.d.ts +1 -1
  113. package/{dist/types → dist-types}/ts3.4/protocols/Aws_restJson1.d.ts +3 -3
  114. package/{dist/types → dist-types}/ts3.4/runtimeConfig.browser.d.ts +1 -3
  115. package/{dist/types → dist-types}/ts3.4/runtimeConfig.d.ts +2 -4
  116. package/{dist/types → dist-types}/ts3.4/runtimeConfig.native.d.ts +1 -3
  117. package/{dist/types → dist-types}/ts3.4/runtimeConfig.shared.d.ts +1 -3
  118. package/package.json +52 -49
  119. package/ServerlessApplicationRepository.ts +0 -547
  120. package/ServerlessApplicationRepositoryClient.ts +0 -321
  121. package/commands/CreateApplicationCommand.ts +0 -98
  122. package/commands/CreateApplicationVersionCommand.ts +0 -98
  123. package/commands/CreateCloudFormationChangeSetCommand.ts +0 -103
  124. package/commands/CreateCloudFormationTemplateCommand.ts +0 -103
  125. package/commands/DeleteApplicationCommand.ts +0 -98
  126. package/commands/GetApplicationCommand.ts +0 -98
  127. package/commands/GetApplicationPolicyCommand.ts +0 -98
  128. package/commands/GetCloudFormationTemplateCommand.ts +0 -101
  129. package/commands/ListApplicationDependenciesCommand.ts +0 -103
  130. package/commands/ListApplicationVersionsCommand.ts +0 -98
  131. package/commands/ListApplicationsCommand.ts +0 -98
  132. package/commands/PutApplicationPolicyCommand.ts +0 -101
  133. package/commands/UnshareApplicationCommand.ts +0 -98
  134. package/commands/UpdateApplicationCommand.ts +0 -98
  135. package/dist/cjs/ServerlessApplicationRepository.js.map +0 -1
  136. package/dist/cjs/ServerlessApplicationRepositoryClient.js +0 -63
  137. package/dist/cjs/ServerlessApplicationRepositoryClient.js.map +0 -1
  138. package/dist/cjs/commands/CreateApplicationCommand.js.map +0 -1
  139. package/dist/cjs/commands/CreateApplicationVersionCommand.js.map +0 -1
  140. package/dist/cjs/commands/CreateCloudFormationChangeSetCommand.js.map +0 -1
  141. package/dist/cjs/commands/CreateCloudFormationTemplateCommand.js.map +0 -1
  142. package/dist/cjs/commands/DeleteApplicationCommand.js.map +0 -1
  143. package/dist/cjs/commands/GetApplicationCommand.js.map +0 -1
  144. package/dist/cjs/commands/GetApplicationPolicyCommand.js.map +0 -1
  145. package/dist/cjs/commands/GetCloudFormationTemplateCommand.js.map +0 -1
  146. package/dist/cjs/commands/ListApplicationDependenciesCommand.js.map +0 -1
  147. package/dist/cjs/commands/ListApplicationVersionsCommand.js.map +0 -1
  148. package/dist/cjs/commands/ListApplicationsCommand.js.map +0 -1
  149. package/dist/cjs/commands/PutApplicationPolicyCommand.js.map +0 -1
  150. package/dist/cjs/commands/UnshareApplicationCommand.js.map +0 -1
  151. package/dist/cjs/commands/UpdateApplicationCommand.js.map +0 -1
  152. package/dist/cjs/endpoints.js.map +0 -1
  153. package/dist/cjs/index.js.map +0 -1
  154. package/dist/cjs/models/index.js.map +0 -1
  155. package/dist/cjs/models/models_0.js.map +0 -1
  156. package/dist/cjs/package.json +0 -91
  157. package/dist/cjs/pagination/Interfaces.js.map +0 -1
  158. package/dist/cjs/pagination/ListApplicationDependenciesPaginator.js.map +0 -1
  159. package/dist/cjs/pagination/ListApplicationVersionsPaginator.js.map +0 -1
  160. package/dist/cjs/pagination/ListApplicationsPaginator.js.map +0 -1
  161. package/dist/cjs/protocols/Aws_restJson1.js.map +0 -1
  162. package/dist/cjs/runtimeConfig.browser.js.map +0 -1
  163. package/dist/cjs/runtimeConfig.js.map +0 -1
  164. package/dist/cjs/runtimeConfig.native.js.map +0 -1
  165. package/dist/cjs/runtimeConfig.shared.js.map +0 -1
  166. package/dist/es/ServerlessApplicationRepository.js.map +0 -1
  167. package/dist/es/ServerlessApplicationRepositoryClient.js +0 -65
  168. package/dist/es/ServerlessApplicationRepositoryClient.js.map +0 -1
  169. package/dist/es/commands/CreateApplicationCommand.js.map +0 -1
  170. package/dist/es/commands/CreateApplicationVersionCommand.js.map +0 -1
  171. package/dist/es/commands/CreateCloudFormationChangeSetCommand.js.map +0 -1
  172. package/dist/es/commands/CreateCloudFormationTemplateCommand.js.map +0 -1
  173. package/dist/es/commands/DeleteApplicationCommand.js.map +0 -1
  174. package/dist/es/commands/GetApplicationCommand.js.map +0 -1
  175. package/dist/es/commands/GetApplicationPolicyCommand.js.map +0 -1
  176. package/dist/es/commands/GetCloudFormationTemplateCommand.js.map +0 -1
  177. package/dist/es/commands/ListApplicationDependenciesCommand.js.map +0 -1
  178. package/dist/es/commands/ListApplicationVersionsCommand.js.map +0 -1
  179. package/dist/es/commands/ListApplicationsCommand.js.map +0 -1
  180. package/dist/es/commands/PutApplicationPolicyCommand.js.map +0 -1
  181. package/dist/es/commands/UnshareApplicationCommand.js.map +0 -1
  182. package/dist/es/commands/UpdateApplicationCommand.js.map +0 -1
  183. package/dist/es/endpoints.js.map +0 -1
  184. package/dist/es/index.js +0 -22
  185. package/dist/es/index.js.map +0 -1
  186. package/dist/es/models/index.js +0 -2
  187. package/dist/es/models/index.js.map +0 -1
  188. package/dist/es/models/models_0.js.map +0 -1
  189. package/dist/es/package.json +0 -91
  190. package/dist/es/pagination/Interfaces.js +0 -2
  191. package/dist/es/pagination/Interfaces.js.map +0 -1
  192. package/dist/es/pagination/ListApplicationDependenciesPaginator.js.map +0 -1
  193. package/dist/es/pagination/ListApplicationVersionsPaginator.js.map +0 -1
  194. package/dist/es/pagination/ListApplicationsPaginator.js.map +0 -1
  195. package/dist/es/protocols/Aws_restJson1.js.map +0 -1
  196. package/dist/es/runtimeConfig.browser.js.map +0 -1
  197. package/dist/es/runtimeConfig.js.map +0 -1
  198. package/dist/es/runtimeConfig.native.js.map +0 -1
  199. package/dist/es/runtimeConfig.shared.js.map +0 -1
  200. package/dist/types/ts3.4/commands/CreateApplicationCommand.d.ts +0 -35
  201. package/dist/types/ts3.4/commands/DeleteApplicationCommand.d.ts +0 -35
  202. package/dist/types/ts3.4/commands/GetApplicationCommand.d.ts +0 -35
  203. package/dist/types/ts3.4/commands/ListApplicationsCommand.d.ts +0 -35
  204. package/dist/types/ts3.4/commands/PutApplicationPolicyCommand.d.ts +0 -38
  205. package/dist/types/ts3.4/commands/UnshareApplicationCommand.d.ts +0 -35
  206. package/dist/types/ts3.4/commands/UpdateApplicationCommand.d.ts +0 -35
  207. package/dist/types/ts3.4/models/models_0.d.ts +0 -1325
  208. package/endpoints.ts +0 -66
  209. package/jest.config.js +0 -4
  210. package/models/models_0.ts +0 -1649
  211. package/pagination/Interfaces.ts +0 -7
  212. package/pagination/ListApplicationDependenciesPaginator.ts +0 -60
  213. package/pagination/ListApplicationVersionsPaginator.ts +0 -60
  214. package/pagination/ListApplicationsPaginator.ts +0 -60
  215. package/protocols/Aws_restJson1.ts +0 -2545
  216. package/runtimeConfig.browser.ts +0 -40
  217. package/runtimeConfig.native.ts +0 -16
  218. package/runtimeConfig.shared.ts +0 -16
  219. package/runtimeConfig.ts +0 -45
  220. package/tsconfig.es.json +0 -12
  221. package/tsconfig.json +0 -32
@@ -1,2545 +0,0 @@
1
- import { CreateApplicationCommandInput, CreateApplicationCommandOutput } from "../commands/CreateApplicationCommand";
2
- import {
3
- CreateApplicationVersionCommandInput,
4
- CreateApplicationVersionCommandOutput,
5
- } from "../commands/CreateApplicationVersionCommand";
6
- import {
7
- CreateCloudFormationChangeSetCommandInput,
8
- CreateCloudFormationChangeSetCommandOutput,
9
- } from "../commands/CreateCloudFormationChangeSetCommand";
10
- import {
11
- CreateCloudFormationTemplateCommandInput,
12
- CreateCloudFormationTemplateCommandOutput,
13
- } from "../commands/CreateCloudFormationTemplateCommand";
14
- import { DeleteApplicationCommandInput, DeleteApplicationCommandOutput } from "../commands/DeleteApplicationCommand";
15
- import { GetApplicationCommandInput, GetApplicationCommandOutput } from "../commands/GetApplicationCommand";
16
- import {
17
- GetApplicationPolicyCommandInput,
18
- GetApplicationPolicyCommandOutput,
19
- } from "../commands/GetApplicationPolicyCommand";
20
- import {
21
- GetCloudFormationTemplateCommandInput,
22
- GetCloudFormationTemplateCommandOutput,
23
- } from "../commands/GetCloudFormationTemplateCommand";
24
- import {
25
- ListApplicationDependenciesCommandInput,
26
- ListApplicationDependenciesCommandOutput,
27
- } from "../commands/ListApplicationDependenciesCommand";
28
- import {
29
- ListApplicationVersionsCommandInput,
30
- ListApplicationVersionsCommandOutput,
31
- } from "../commands/ListApplicationVersionsCommand";
32
- import { ListApplicationsCommandInput, ListApplicationsCommandOutput } from "../commands/ListApplicationsCommand";
33
- import {
34
- PutApplicationPolicyCommandInput,
35
- PutApplicationPolicyCommandOutput,
36
- } from "../commands/PutApplicationPolicyCommand";
37
- import { UnshareApplicationCommandInput, UnshareApplicationCommandOutput } from "../commands/UnshareApplicationCommand";
38
- import { UpdateApplicationCommandInput, UpdateApplicationCommandOutput } from "../commands/UpdateApplicationCommand";
39
- import {
40
- ApplicationDependencySummary,
41
- ApplicationPolicyStatement,
42
- ApplicationSummary,
43
- BadRequestException,
44
- Capability,
45
- ConflictException,
46
- ForbiddenException,
47
- InternalServerErrorException,
48
- NotFoundException,
49
- ParameterDefinition,
50
- ParameterValue,
51
- RollbackConfiguration,
52
- RollbackTrigger,
53
- Tag,
54
- TooManyRequestsException,
55
- Version,
56
- VersionSummary,
57
- } from "../models/models_0";
58
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
59
- import {
60
- expectBoolean as __expectBoolean,
61
- expectInt32 as __expectInt32,
62
- expectNonNull as __expectNonNull,
63
- expectObject as __expectObject,
64
- expectString as __expectString,
65
- extendedEncodeURIComponent as __extendedEncodeURIComponent,
66
- } from "@aws-sdk/smithy-client";
67
- import {
68
- Endpoint as __Endpoint,
69
- MetadataBearer as __MetadataBearer,
70
- ResponseMetadata as __ResponseMetadata,
71
- SerdeContext as __SerdeContext,
72
- SmithyException as __SmithyException,
73
- } from "@aws-sdk/types";
74
-
75
- export const serializeAws_restJson1CreateApplicationCommand = async (
76
- input: CreateApplicationCommandInput,
77
- context: __SerdeContext
78
- ): Promise<__HttpRequest> => {
79
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
80
- const headers: any = {
81
- "content-type": "application/json",
82
- };
83
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications";
84
- let body: any;
85
- body = JSON.stringify({
86
- ...(input.Author !== undefined && input.Author !== null && { author: input.Author }),
87
- ...(input.Description !== undefined && input.Description !== null && { description: input.Description }),
88
- ...(input.HomePageUrl !== undefined && input.HomePageUrl !== null && { homePageUrl: input.HomePageUrl }),
89
- ...(input.Labels !== undefined &&
90
- input.Labels !== null && { labels: serializeAws_restJson1__listOf__string(input.Labels, context) }),
91
- ...(input.LicenseBody !== undefined && input.LicenseBody !== null && { licenseBody: input.LicenseBody }),
92
- ...(input.LicenseUrl !== undefined && input.LicenseUrl !== null && { licenseUrl: input.LicenseUrl }),
93
- ...(input.Name !== undefined && input.Name !== null && { name: input.Name }),
94
- ...(input.ReadmeBody !== undefined && input.ReadmeBody !== null && { readmeBody: input.ReadmeBody }),
95
- ...(input.ReadmeUrl !== undefined && input.ReadmeUrl !== null && { readmeUrl: input.ReadmeUrl }),
96
- ...(input.SemanticVersion !== undefined &&
97
- input.SemanticVersion !== null && { semanticVersion: input.SemanticVersion }),
98
- ...(input.SourceCodeArchiveUrl !== undefined &&
99
- input.SourceCodeArchiveUrl !== null && { sourceCodeArchiveUrl: input.SourceCodeArchiveUrl }),
100
- ...(input.SourceCodeUrl !== undefined && input.SourceCodeUrl !== null && { sourceCodeUrl: input.SourceCodeUrl }),
101
- ...(input.SpdxLicenseId !== undefined && input.SpdxLicenseId !== null && { spdxLicenseId: input.SpdxLicenseId }),
102
- ...(input.TemplateBody !== undefined && input.TemplateBody !== null && { templateBody: input.TemplateBody }),
103
- ...(input.TemplateUrl !== undefined && input.TemplateUrl !== null && { templateUrl: input.TemplateUrl }),
104
- });
105
- return new __HttpRequest({
106
- protocol,
107
- hostname,
108
- port,
109
- method: "POST",
110
- headers,
111
- path: resolvedPath,
112
- body,
113
- });
114
- };
115
-
116
- export const serializeAws_restJson1CreateApplicationVersionCommand = async (
117
- input: CreateApplicationVersionCommandInput,
118
- context: __SerdeContext
119
- ): Promise<__HttpRequest> => {
120
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
121
- const headers: any = {
122
- "content-type": "application/json",
123
- };
124
- let resolvedPath =
125
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
126
- "/applications/{ApplicationId}/versions/{SemanticVersion}";
127
- if (input.ApplicationId !== undefined) {
128
- const labelValue: string = input.ApplicationId;
129
- if (labelValue.length <= 0) {
130
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
131
- }
132
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
133
- } else {
134
- throw new Error("No value provided for input HTTP label: ApplicationId.");
135
- }
136
- if (input.SemanticVersion !== undefined) {
137
- const labelValue: string = input.SemanticVersion;
138
- if (labelValue.length <= 0) {
139
- throw new Error("Empty value provided for input HTTP label: SemanticVersion.");
140
- }
141
- resolvedPath = resolvedPath.replace("{SemanticVersion}", __extendedEncodeURIComponent(labelValue));
142
- } else {
143
- throw new Error("No value provided for input HTTP label: SemanticVersion.");
144
- }
145
- let body: any;
146
- body = JSON.stringify({
147
- ...(input.SourceCodeArchiveUrl !== undefined &&
148
- input.SourceCodeArchiveUrl !== null && { sourceCodeArchiveUrl: input.SourceCodeArchiveUrl }),
149
- ...(input.SourceCodeUrl !== undefined && input.SourceCodeUrl !== null && { sourceCodeUrl: input.SourceCodeUrl }),
150
- ...(input.TemplateBody !== undefined && input.TemplateBody !== null && { templateBody: input.TemplateBody }),
151
- ...(input.TemplateUrl !== undefined && input.TemplateUrl !== null && { templateUrl: input.TemplateUrl }),
152
- });
153
- return new __HttpRequest({
154
- protocol,
155
- hostname,
156
- port,
157
- method: "PUT",
158
- headers,
159
- path: resolvedPath,
160
- body,
161
- });
162
- };
163
-
164
- export const serializeAws_restJson1CreateCloudFormationChangeSetCommand = async (
165
- input: CreateCloudFormationChangeSetCommandInput,
166
- context: __SerdeContext
167
- ): Promise<__HttpRequest> => {
168
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
169
- const headers: any = {
170
- "content-type": "application/json",
171
- };
172
- let resolvedPath =
173
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}/changesets";
174
- if (input.ApplicationId !== undefined) {
175
- const labelValue: string = input.ApplicationId;
176
- if (labelValue.length <= 0) {
177
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
178
- }
179
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
180
- } else {
181
- throw new Error("No value provided for input HTTP label: ApplicationId.");
182
- }
183
- let body: any;
184
- body = JSON.stringify({
185
- ...(input.Capabilities !== undefined &&
186
- input.Capabilities !== null && {
187
- capabilities: serializeAws_restJson1__listOf__string(input.Capabilities, context),
188
- }),
189
- ...(input.ChangeSetName !== undefined && input.ChangeSetName !== null && { changeSetName: input.ChangeSetName }),
190
- ...(input.ClientToken !== undefined && input.ClientToken !== null && { clientToken: input.ClientToken }),
191
- ...(input.Description !== undefined && input.Description !== null && { description: input.Description }),
192
- ...(input.NotificationArns !== undefined &&
193
- input.NotificationArns !== null && {
194
- notificationArns: serializeAws_restJson1__listOf__string(input.NotificationArns, context),
195
- }),
196
- ...(input.ParameterOverrides !== undefined &&
197
- input.ParameterOverrides !== null && {
198
- parameterOverrides: serializeAws_restJson1__listOfParameterValue(input.ParameterOverrides, context),
199
- }),
200
- ...(input.ResourceTypes !== undefined &&
201
- input.ResourceTypes !== null && {
202
- resourceTypes: serializeAws_restJson1__listOf__string(input.ResourceTypes, context),
203
- }),
204
- ...(input.RollbackConfiguration !== undefined &&
205
- input.RollbackConfiguration !== null && {
206
- rollbackConfiguration: serializeAws_restJson1RollbackConfiguration(input.RollbackConfiguration, context),
207
- }),
208
- ...(input.SemanticVersion !== undefined &&
209
- input.SemanticVersion !== null && { semanticVersion: input.SemanticVersion }),
210
- ...(input.StackName !== undefined && input.StackName !== null && { stackName: input.StackName }),
211
- ...(input.Tags !== undefined &&
212
- input.Tags !== null && { tags: serializeAws_restJson1__listOfTag(input.Tags, context) }),
213
- ...(input.TemplateId !== undefined && input.TemplateId !== null && { templateId: input.TemplateId }),
214
- });
215
- return new __HttpRequest({
216
- protocol,
217
- hostname,
218
- port,
219
- method: "POST",
220
- headers,
221
- path: resolvedPath,
222
- body,
223
- });
224
- };
225
-
226
- export const serializeAws_restJson1CreateCloudFormationTemplateCommand = async (
227
- input: CreateCloudFormationTemplateCommandInput,
228
- context: __SerdeContext
229
- ): Promise<__HttpRequest> => {
230
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
231
- const headers: any = {
232
- "content-type": "application/json",
233
- };
234
- let resolvedPath =
235
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}/templates";
236
- if (input.ApplicationId !== undefined) {
237
- const labelValue: string = input.ApplicationId;
238
- if (labelValue.length <= 0) {
239
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
240
- }
241
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
242
- } else {
243
- throw new Error("No value provided for input HTTP label: ApplicationId.");
244
- }
245
- let body: any;
246
- body = JSON.stringify({
247
- ...(input.SemanticVersion !== undefined &&
248
- input.SemanticVersion !== null && { semanticVersion: input.SemanticVersion }),
249
- });
250
- return new __HttpRequest({
251
- protocol,
252
- hostname,
253
- port,
254
- method: "POST",
255
- headers,
256
- path: resolvedPath,
257
- body,
258
- });
259
- };
260
-
261
- export const serializeAws_restJson1DeleteApplicationCommand = async (
262
- input: DeleteApplicationCommandInput,
263
- context: __SerdeContext
264
- ): Promise<__HttpRequest> => {
265
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
266
- const headers: any = {};
267
- let resolvedPath =
268
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}";
269
- if (input.ApplicationId !== undefined) {
270
- const labelValue: string = input.ApplicationId;
271
- if (labelValue.length <= 0) {
272
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
273
- }
274
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
275
- } else {
276
- throw new Error("No value provided for input HTTP label: ApplicationId.");
277
- }
278
- let body: any;
279
- return new __HttpRequest({
280
- protocol,
281
- hostname,
282
- port,
283
- method: "DELETE",
284
- headers,
285
- path: resolvedPath,
286
- body,
287
- });
288
- };
289
-
290
- export const serializeAws_restJson1GetApplicationCommand = async (
291
- input: GetApplicationCommandInput,
292
- context: __SerdeContext
293
- ): Promise<__HttpRequest> => {
294
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
295
- const headers: any = {};
296
- let resolvedPath =
297
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}";
298
- if (input.ApplicationId !== undefined) {
299
- const labelValue: string = input.ApplicationId;
300
- if (labelValue.length <= 0) {
301
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
302
- }
303
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
304
- } else {
305
- throw new Error("No value provided for input HTTP label: ApplicationId.");
306
- }
307
- const query: any = {
308
- ...(input.SemanticVersion !== undefined && { semanticVersion: input.SemanticVersion }),
309
- };
310
- let body: any;
311
- return new __HttpRequest({
312
- protocol,
313
- hostname,
314
- port,
315
- method: "GET",
316
- headers,
317
- path: resolvedPath,
318
- query,
319
- body,
320
- });
321
- };
322
-
323
- export const serializeAws_restJson1GetApplicationPolicyCommand = async (
324
- input: GetApplicationPolicyCommandInput,
325
- context: __SerdeContext
326
- ): Promise<__HttpRequest> => {
327
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
328
- const headers: any = {};
329
- let resolvedPath =
330
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}/policy";
331
- if (input.ApplicationId !== undefined) {
332
- const labelValue: string = input.ApplicationId;
333
- if (labelValue.length <= 0) {
334
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
335
- }
336
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
337
- } else {
338
- throw new Error("No value provided for input HTTP label: ApplicationId.");
339
- }
340
- let body: any;
341
- return new __HttpRequest({
342
- protocol,
343
- hostname,
344
- port,
345
- method: "GET",
346
- headers,
347
- path: resolvedPath,
348
- body,
349
- });
350
- };
351
-
352
- export const serializeAws_restJson1GetCloudFormationTemplateCommand = async (
353
- input: GetCloudFormationTemplateCommandInput,
354
- context: __SerdeContext
355
- ): Promise<__HttpRequest> => {
356
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
357
- const headers: any = {};
358
- let resolvedPath =
359
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
360
- "/applications/{ApplicationId}/templates/{TemplateId}";
361
- if (input.ApplicationId !== undefined) {
362
- const labelValue: string = input.ApplicationId;
363
- if (labelValue.length <= 0) {
364
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
365
- }
366
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
367
- } else {
368
- throw new Error("No value provided for input HTTP label: ApplicationId.");
369
- }
370
- if (input.TemplateId !== undefined) {
371
- const labelValue: string = input.TemplateId;
372
- if (labelValue.length <= 0) {
373
- throw new Error("Empty value provided for input HTTP label: TemplateId.");
374
- }
375
- resolvedPath = resolvedPath.replace("{TemplateId}", __extendedEncodeURIComponent(labelValue));
376
- } else {
377
- throw new Error("No value provided for input HTTP label: TemplateId.");
378
- }
379
- let body: any;
380
- return new __HttpRequest({
381
- protocol,
382
- hostname,
383
- port,
384
- method: "GET",
385
- headers,
386
- path: resolvedPath,
387
- body,
388
- });
389
- };
390
-
391
- export const serializeAws_restJson1ListApplicationDependenciesCommand = async (
392
- input: ListApplicationDependenciesCommandInput,
393
- context: __SerdeContext
394
- ): Promise<__HttpRequest> => {
395
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
396
- const headers: any = {};
397
- let resolvedPath =
398
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
399
- "/applications/{ApplicationId}/dependencies";
400
- if (input.ApplicationId !== undefined) {
401
- const labelValue: string = input.ApplicationId;
402
- if (labelValue.length <= 0) {
403
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
404
- }
405
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
406
- } else {
407
- throw new Error("No value provided for input HTTP label: ApplicationId.");
408
- }
409
- const query: any = {
410
- ...(input.MaxItems !== undefined && { maxItems: input.MaxItems.toString() }),
411
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
412
- ...(input.SemanticVersion !== undefined && { semanticVersion: input.SemanticVersion }),
413
- };
414
- let body: any;
415
- return new __HttpRequest({
416
- protocol,
417
- hostname,
418
- port,
419
- method: "GET",
420
- headers,
421
- path: resolvedPath,
422
- query,
423
- body,
424
- });
425
- };
426
-
427
- export const serializeAws_restJson1ListApplicationsCommand = async (
428
- input: ListApplicationsCommandInput,
429
- context: __SerdeContext
430
- ): Promise<__HttpRequest> => {
431
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
432
- const headers: any = {};
433
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications";
434
- const query: any = {
435
- ...(input.MaxItems !== undefined && { maxItems: input.MaxItems.toString() }),
436
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
437
- };
438
- let body: any;
439
- return new __HttpRequest({
440
- protocol,
441
- hostname,
442
- port,
443
- method: "GET",
444
- headers,
445
- path: resolvedPath,
446
- query,
447
- body,
448
- });
449
- };
450
-
451
- export const serializeAws_restJson1ListApplicationVersionsCommand = async (
452
- input: ListApplicationVersionsCommandInput,
453
- context: __SerdeContext
454
- ): Promise<__HttpRequest> => {
455
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
456
- const headers: any = {};
457
- let resolvedPath =
458
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}/versions";
459
- if (input.ApplicationId !== undefined) {
460
- const labelValue: string = input.ApplicationId;
461
- if (labelValue.length <= 0) {
462
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
463
- }
464
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
465
- } else {
466
- throw new Error("No value provided for input HTTP label: ApplicationId.");
467
- }
468
- const query: any = {
469
- ...(input.MaxItems !== undefined && { maxItems: input.MaxItems.toString() }),
470
- ...(input.NextToken !== undefined && { nextToken: input.NextToken }),
471
- };
472
- let body: any;
473
- return new __HttpRequest({
474
- protocol,
475
- hostname,
476
- port,
477
- method: "GET",
478
- headers,
479
- path: resolvedPath,
480
- query,
481
- body,
482
- });
483
- };
484
-
485
- export const serializeAws_restJson1PutApplicationPolicyCommand = async (
486
- input: PutApplicationPolicyCommandInput,
487
- context: __SerdeContext
488
- ): Promise<__HttpRequest> => {
489
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
490
- const headers: any = {
491
- "content-type": "application/json",
492
- };
493
- let resolvedPath =
494
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}/policy";
495
- if (input.ApplicationId !== undefined) {
496
- const labelValue: string = input.ApplicationId;
497
- if (labelValue.length <= 0) {
498
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
499
- }
500
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
501
- } else {
502
- throw new Error("No value provided for input HTTP label: ApplicationId.");
503
- }
504
- let body: any;
505
- body = JSON.stringify({
506
- ...(input.Statements !== undefined &&
507
- input.Statements !== null && {
508
- statements: serializeAws_restJson1__listOfApplicationPolicyStatement(input.Statements, context),
509
- }),
510
- });
511
- return new __HttpRequest({
512
- protocol,
513
- hostname,
514
- port,
515
- method: "PUT",
516
- headers,
517
- path: resolvedPath,
518
- body,
519
- });
520
- };
521
-
522
- export const serializeAws_restJson1UnshareApplicationCommand = async (
523
- input: UnshareApplicationCommandInput,
524
- context: __SerdeContext
525
- ): Promise<__HttpRequest> => {
526
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
527
- const headers: any = {
528
- "content-type": "application/json",
529
- };
530
- let resolvedPath =
531
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}/unshare";
532
- if (input.ApplicationId !== undefined) {
533
- const labelValue: string = input.ApplicationId;
534
- if (labelValue.length <= 0) {
535
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
536
- }
537
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
538
- } else {
539
- throw new Error("No value provided for input HTTP label: ApplicationId.");
540
- }
541
- let body: any;
542
- body = JSON.stringify({
543
- ...(input.OrganizationId !== undefined &&
544
- input.OrganizationId !== null && { organizationId: input.OrganizationId }),
545
- });
546
- return new __HttpRequest({
547
- protocol,
548
- hostname,
549
- port,
550
- method: "POST",
551
- headers,
552
- path: resolvedPath,
553
- body,
554
- });
555
- };
556
-
557
- export const serializeAws_restJson1UpdateApplicationCommand = async (
558
- input: UpdateApplicationCommandInput,
559
- context: __SerdeContext
560
- ): Promise<__HttpRequest> => {
561
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
562
- const headers: any = {
563
- "content-type": "application/json",
564
- };
565
- let resolvedPath =
566
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/applications/{ApplicationId}";
567
- if (input.ApplicationId !== undefined) {
568
- const labelValue: string = input.ApplicationId;
569
- if (labelValue.length <= 0) {
570
- throw new Error("Empty value provided for input HTTP label: ApplicationId.");
571
- }
572
- resolvedPath = resolvedPath.replace("{ApplicationId}", __extendedEncodeURIComponent(labelValue));
573
- } else {
574
- throw new Error("No value provided for input HTTP label: ApplicationId.");
575
- }
576
- let body: any;
577
- body = JSON.stringify({
578
- ...(input.Author !== undefined && input.Author !== null && { author: input.Author }),
579
- ...(input.Description !== undefined && input.Description !== null && { description: input.Description }),
580
- ...(input.HomePageUrl !== undefined && input.HomePageUrl !== null && { homePageUrl: input.HomePageUrl }),
581
- ...(input.Labels !== undefined &&
582
- input.Labels !== null && { labels: serializeAws_restJson1__listOf__string(input.Labels, context) }),
583
- ...(input.ReadmeBody !== undefined && input.ReadmeBody !== null && { readmeBody: input.ReadmeBody }),
584
- ...(input.ReadmeUrl !== undefined && input.ReadmeUrl !== null && { readmeUrl: input.ReadmeUrl }),
585
- });
586
- return new __HttpRequest({
587
- protocol,
588
- hostname,
589
- port,
590
- method: "PATCH",
591
- headers,
592
- path: resolvedPath,
593
- body,
594
- });
595
- };
596
-
597
- export const deserializeAws_restJson1CreateApplicationCommand = async (
598
- output: __HttpResponse,
599
- context: __SerdeContext
600
- ): Promise<CreateApplicationCommandOutput> => {
601
- if (output.statusCode !== 201 && output.statusCode >= 300) {
602
- return deserializeAws_restJson1CreateApplicationCommandError(output, context);
603
- }
604
- const contents: CreateApplicationCommandOutput = {
605
- $metadata: deserializeMetadata(output),
606
- ApplicationId: undefined,
607
- Author: undefined,
608
- CreationTime: undefined,
609
- Description: undefined,
610
- HomePageUrl: undefined,
611
- IsVerifiedAuthor: undefined,
612
- Labels: undefined,
613
- LicenseUrl: undefined,
614
- Name: undefined,
615
- ReadmeUrl: undefined,
616
- SpdxLicenseId: undefined,
617
- VerifiedAuthorUrl: undefined,
618
- Version: undefined,
619
- };
620
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
621
- if (data.applicationId !== undefined && data.applicationId !== null) {
622
- contents.ApplicationId = __expectString(data.applicationId);
623
- }
624
- if (data.author !== undefined && data.author !== null) {
625
- contents.Author = __expectString(data.author);
626
- }
627
- if (data.creationTime !== undefined && data.creationTime !== null) {
628
- contents.CreationTime = __expectString(data.creationTime);
629
- }
630
- if (data.description !== undefined && data.description !== null) {
631
- contents.Description = __expectString(data.description);
632
- }
633
- if (data.homePageUrl !== undefined && data.homePageUrl !== null) {
634
- contents.HomePageUrl = __expectString(data.homePageUrl);
635
- }
636
- if (data.isVerifiedAuthor !== undefined && data.isVerifiedAuthor !== null) {
637
- contents.IsVerifiedAuthor = __expectBoolean(data.isVerifiedAuthor);
638
- }
639
- if (data.labels !== undefined && data.labels !== null) {
640
- contents.Labels = deserializeAws_restJson1__listOf__string(data.labels, context);
641
- }
642
- if (data.licenseUrl !== undefined && data.licenseUrl !== null) {
643
- contents.LicenseUrl = __expectString(data.licenseUrl);
644
- }
645
- if (data.name !== undefined && data.name !== null) {
646
- contents.Name = __expectString(data.name);
647
- }
648
- if (data.readmeUrl !== undefined && data.readmeUrl !== null) {
649
- contents.ReadmeUrl = __expectString(data.readmeUrl);
650
- }
651
- if (data.spdxLicenseId !== undefined && data.spdxLicenseId !== null) {
652
- contents.SpdxLicenseId = __expectString(data.spdxLicenseId);
653
- }
654
- if (data.verifiedAuthorUrl !== undefined && data.verifiedAuthorUrl !== null) {
655
- contents.VerifiedAuthorUrl = __expectString(data.verifiedAuthorUrl);
656
- }
657
- if (data.version !== undefined && data.version !== null) {
658
- contents.Version = deserializeAws_restJson1Version(data.version, context);
659
- }
660
- return Promise.resolve(contents);
661
- };
662
-
663
- const deserializeAws_restJson1CreateApplicationCommandError = async (
664
- output: __HttpResponse,
665
- context: __SerdeContext
666
- ): Promise<CreateApplicationCommandOutput> => {
667
- const parsedOutput: any = {
668
- ...output,
669
- body: await parseBody(output.body, context),
670
- };
671
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
672
- let errorCode: string = "UnknownError";
673
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
674
- switch (errorCode) {
675
- case "BadRequestException":
676
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
677
- response = {
678
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
679
- name: errorCode,
680
- $metadata: deserializeMetadata(output),
681
- };
682
- break;
683
- case "ConflictException":
684
- case "com.amazonaws.serverlessapplicationrepository#ConflictException":
685
- response = {
686
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
687
- name: errorCode,
688
- $metadata: deserializeMetadata(output),
689
- };
690
- break;
691
- case "ForbiddenException":
692
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
693
- response = {
694
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
695
- name: errorCode,
696
- $metadata: deserializeMetadata(output),
697
- };
698
- break;
699
- case "InternalServerErrorException":
700
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
701
- response = {
702
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
703
- name: errorCode,
704
- $metadata: deserializeMetadata(output),
705
- };
706
- break;
707
- case "TooManyRequestsException":
708
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
709
- response = {
710
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
711
- name: errorCode,
712
- $metadata: deserializeMetadata(output),
713
- };
714
- break;
715
- default:
716
- const parsedBody = parsedOutput.body;
717
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
718
- response = {
719
- ...parsedBody,
720
- name: `${errorCode}`,
721
- message: parsedBody.message || parsedBody.Message || errorCode,
722
- $fault: "client",
723
- $metadata: deserializeMetadata(output),
724
- } as any;
725
- }
726
- const message = response.message || response.Message || errorCode;
727
- response.message = message;
728
- delete response.Message;
729
- return Promise.reject(Object.assign(new Error(message), response));
730
- };
731
-
732
- export const deserializeAws_restJson1CreateApplicationVersionCommand = async (
733
- output: __HttpResponse,
734
- context: __SerdeContext
735
- ): Promise<CreateApplicationVersionCommandOutput> => {
736
- if (output.statusCode !== 201 && output.statusCode >= 300) {
737
- return deserializeAws_restJson1CreateApplicationVersionCommandError(output, context);
738
- }
739
- const contents: CreateApplicationVersionCommandOutput = {
740
- $metadata: deserializeMetadata(output),
741
- ApplicationId: undefined,
742
- CreationTime: undefined,
743
- ParameterDefinitions: undefined,
744
- RequiredCapabilities: undefined,
745
- ResourcesSupported: undefined,
746
- SemanticVersion: undefined,
747
- SourceCodeArchiveUrl: undefined,
748
- SourceCodeUrl: undefined,
749
- TemplateUrl: undefined,
750
- };
751
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
752
- if (data.applicationId !== undefined && data.applicationId !== null) {
753
- contents.ApplicationId = __expectString(data.applicationId);
754
- }
755
- if (data.creationTime !== undefined && data.creationTime !== null) {
756
- contents.CreationTime = __expectString(data.creationTime);
757
- }
758
- if (data.parameterDefinitions !== undefined && data.parameterDefinitions !== null) {
759
- contents.ParameterDefinitions = deserializeAws_restJson1__listOfParameterDefinition(
760
- data.parameterDefinitions,
761
- context
762
- );
763
- }
764
- if (data.requiredCapabilities !== undefined && data.requiredCapabilities !== null) {
765
- contents.RequiredCapabilities = deserializeAws_restJson1__listOfCapability(data.requiredCapabilities, context);
766
- }
767
- if (data.resourcesSupported !== undefined && data.resourcesSupported !== null) {
768
- contents.ResourcesSupported = __expectBoolean(data.resourcesSupported);
769
- }
770
- if (data.semanticVersion !== undefined && data.semanticVersion !== null) {
771
- contents.SemanticVersion = __expectString(data.semanticVersion);
772
- }
773
- if (data.sourceCodeArchiveUrl !== undefined && data.sourceCodeArchiveUrl !== null) {
774
- contents.SourceCodeArchiveUrl = __expectString(data.sourceCodeArchiveUrl);
775
- }
776
- if (data.sourceCodeUrl !== undefined && data.sourceCodeUrl !== null) {
777
- contents.SourceCodeUrl = __expectString(data.sourceCodeUrl);
778
- }
779
- if (data.templateUrl !== undefined && data.templateUrl !== null) {
780
- contents.TemplateUrl = __expectString(data.templateUrl);
781
- }
782
- return Promise.resolve(contents);
783
- };
784
-
785
- const deserializeAws_restJson1CreateApplicationVersionCommandError = async (
786
- output: __HttpResponse,
787
- context: __SerdeContext
788
- ): Promise<CreateApplicationVersionCommandOutput> => {
789
- const parsedOutput: any = {
790
- ...output,
791
- body: await parseBody(output.body, context),
792
- };
793
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
794
- let errorCode: string = "UnknownError";
795
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
796
- switch (errorCode) {
797
- case "BadRequestException":
798
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
799
- response = {
800
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
801
- name: errorCode,
802
- $metadata: deserializeMetadata(output),
803
- };
804
- break;
805
- case "ConflictException":
806
- case "com.amazonaws.serverlessapplicationrepository#ConflictException":
807
- response = {
808
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
809
- name: errorCode,
810
- $metadata: deserializeMetadata(output),
811
- };
812
- break;
813
- case "ForbiddenException":
814
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
815
- response = {
816
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
817
- name: errorCode,
818
- $metadata: deserializeMetadata(output),
819
- };
820
- break;
821
- case "InternalServerErrorException":
822
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
823
- response = {
824
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
825
- name: errorCode,
826
- $metadata: deserializeMetadata(output),
827
- };
828
- break;
829
- case "TooManyRequestsException":
830
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
831
- response = {
832
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
833
- name: errorCode,
834
- $metadata: deserializeMetadata(output),
835
- };
836
- break;
837
- default:
838
- const parsedBody = parsedOutput.body;
839
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
840
- response = {
841
- ...parsedBody,
842
- name: `${errorCode}`,
843
- message: parsedBody.message || parsedBody.Message || errorCode,
844
- $fault: "client",
845
- $metadata: deserializeMetadata(output),
846
- } as any;
847
- }
848
- const message = response.message || response.Message || errorCode;
849
- response.message = message;
850
- delete response.Message;
851
- return Promise.reject(Object.assign(new Error(message), response));
852
- };
853
-
854
- export const deserializeAws_restJson1CreateCloudFormationChangeSetCommand = async (
855
- output: __HttpResponse,
856
- context: __SerdeContext
857
- ): Promise<CreateCloudFormationChangeSetCommandOutput> => {
858
- if (output.statusCode !== 201 && output.statusCode >= 300) {
859
- return deserializeAws_restJson1CreateCloudFormationChangeSetCommandError(output, context);
860
- }
861
- const contents: CreateCloudFormationChangeSetCommandOutput = {
862
- $metadata: deserializeMetadata(output),
863
- ApplicationId: undefined,
864
- ChangeSetId: undefined,
865
- SemanticVersion: undefined,
866
- StackId: undefined,
867
- };
868
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
869
- if (data.applicationId !== undefined && data.applicationId !== null) {
870
- contents.ApplicationId = __expectString(data.applicationId);
871
- }
872
- if (data.changeSetId !== undefined && data.changeSetId !== null) {
873
- contents.ChangeSetId = __expectString(data.changeSetId);
874
- }
875
- if (data.semanticVersion !== undefined && data.semanticVersion !== null) {
876
- contents.SemanticVersion = __expectString(data.semanticVersion);
877
- }
878
- if (data.stackId !== undefined && data.stackId !== null) {
879
- contents.StackId = __expectString(data.stackId);
880
- }
881
- return Promise.resolve(contents);
882
- };
883
-
884
- const deserializeAws_restJson1CreateCloudFormationChangeSetCommandError = async (
885
- output: __HttpResponse,
886
- context: __SerdeContext
887
- ): Promise<CreateCloudFormationChangeSetCommandOutput> => {
888
- const parsedOutput: any = {
889
- ...output,
890
- body: await parseBody(output.body, context),
891
- };
892
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
893
- let errorCode: string = "UnknownError";
894
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
895
- switch (errorCode) {
896
- case "BadRequestException":
897
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
898
- response = {
899
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
900
- name: errorCode,
901
- $metadata: deserializeMetadata(output),
902
- };
903
- break;
904
- case "ForbiddenException":
905
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
906
- response = {
907
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
908
- name: errorCode,
909
- $metadata: deserializeMetadata(output),
910
- };
911
- break;
912
- case "InternalServerErrorException":
913
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
914
- response = {
915
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
916
- name: errorCode,
917
- $metadata: deserializeMetadata(output),
918
- };
919
- break;
920
- case "TooManyRequestsException":
921
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
922
- response = {
923
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
924
- name: errorCode,
925
- $metadata: deserializeMetadata(output),
926
- };
927
- break;
928
- default:
929
- const parsedBody = parsedOutput.body;
930
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
931
- response = {
932
- ...parsedBody,
933
- name: `${errorCode}`,
934
- message: parsedBody.message || parsedBody.Message || errorCode,
935
- $fault: "client",
936
- $metadata: deserializeMetadata(output),
937
- } as any;
938
- }
939
- const message = response.message || response.Message || errorCode;
940
- response.message = message;
941
- delete response.Message;
942
- return Promise.reject(Object.assign(new Error(message), response));
943
- };
944
-
945
- export const deserializeAws_restJson1CreateCloudFormationTemplateCommand = async (
946
- output: __HttpResponse,
947
- context: __SerdeContext
948
- ): Promise<CreateCloudFormationTemplateCommandOutput> => {
949
- if (output.statusCode !== 201 && output.statusCode >= 300) {
950
- return deserializeAws_restJson1CreateCloudFormationTemplateCommandError(output, context);
951
- }
952
- const contents: CreateCloudFormationTemplateCommandOutput = {
953
- $metadata: deserializeMetadata(output),
954
- ApplicationId: undefined,
955
- CreationTime: undefined,
956
- ExpirationTime: undefined,
957
- SemanticVersion: undefined,
958
- Status: undefined,
959
- TemplateId: undefined,
960
- TemplateUrl: undefined,
961
- };
962
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
963
- if (data.applicationId !== undefined && data.applicationId !== null) {
964
- contents.ApplicationId = __expectString(data.applicationId);
965
- }
966
- if (data.creationTime !== undefined && data.creationTime !== null) {
967
- contents.CreationTime = __expectString(data.creationTime);
968
- }
969
- if (data.expirationTime !== undefined && data.expirationTime !== null) {
970
- contents.ExpirationTime = __expectString(data.expirationTime);
971
- }
972
- if (data.semanticVersion !== undefined && data.semanticVersion !== null) {
973
- contents.SemanticVersion = __expectString(data.semanticVersion);
974
- }
975
- if (data.status !== undefined && data.status !== null) {
976
- contents.Status = __expectString(data.status);
977
- }
978
- if (data.templateId !== undefined && data.templateId !== null) {
979
- contents.TemplateId = __expectString(data.templateId);
980
- }
981
- if (data.templateUrl !== undefined && data.templateUrl !== null) {
982
- contents.TemplateUrl = __expectString(data.templateUrl);
983
- }
984
- return Promise.resolve(contents);
985
- };
986
-
987
- const deserializeAws_restJson1CreateCloudFormationTemplateCommandError = async (
988
- output: __HttpResponse,
989
- context: __SerdeContext
990
- ): Promise<CreateCloudFormationTemplateCommandOutput> => {
991
- const parsedOutput: any = {
992
- ...output,
993
- body: await parseBody(output.body, context),
994
- };
995
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
996
- let errorCode: string = "UnknownError";
997
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
998
- switch (errorCode) {
999
- case "BadRequestException":
1000
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
1001
- response = {
1002
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1003
- name: errorCode,
1004
- $metadata: deserializeMetadata(output),
1005
- };
1006
- break;
1007
- case "ForbiddenException":
1008
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
1009
- response = {
1010
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1011
- name: errorCode,
1012
- $metadata: deserializeMetadata(output),
1013
- };
1014
- break;
1015
- case "InternalServerErrorException":
1016
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
1017
- response = {
1018
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1019
- name: errorCode,
1020
- $metadata: deserializeMetadata(output),
1021
- };
1022
- break;
1023
- case "NotFoundException":
1024
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
1025
- response = {
1026
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1027
- name: errorCode,
1028
- $metadata: deserializeMetadata(output),
1029
- };
1030
- break;
1031
- case "TooManyRequestsException":
1032
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
1033
- response = {
1034
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1035
- name: errorCode,
1036
- $metadata: deserializeMetadata(output),
1037
- };
1038
- break;
1039
- default:
1040
- const parsedBody = parsedOutput.body;
1041
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1042
- response = {
1043
- ...parsedBody,
1044
- name: `${errorCode}`,
1045
- message: parsedBody.message || parsedBody.Message || errorCode,
1046
- $fault: "client",
1047
- $metadata: deserializeMetadata(output),
1048
- } as any;
1049
- }
1050
- const message = response.message || response.Message || errorCode;
1051
- response.message = message;
1052
- delete response.Message;
1053
- return Promise.reject(Object.assign(new Error(message), response));
1054
- };
1055
-
1056
- export const deserializeAws_restJson1DeleteApplicationCommand = async (
1057
- output: __HttpResponse,
1058
- context: __SerdeContext
1059
- ): Promise<DeleteApplicationCommandOutput> => {
1060
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1061
- return deserializeAws_restJson1DeleteApplicationCommandError(output, context);
1062
- }
1063
- const contents: DeleteApplicationCommandOutput = {
1064
- $metadata: deserializeMetadata(output),
1065
- };
1066
- await collectBody(output.body, context);
1067
- return Promise.resolve(contents);
1068
- };
1069
-
1070
- const deserializeAws_restJson1DeleteApplicationCommandError = async (
1071
- output: __HttpResponse,
1072
- context: __SerdeContext
1073
- ): Promise<DeleteApplicationCommandOutput> => {
1074
- const parsedOutput: any = {
1075
- ...output,
1076
- body: await parseBody(output.body, context),
1077
- };
1078
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1079
- let errorCode: string = "UnknownError";
1080
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1081
- switch (errorCode) {
1082
- case "BadRequestException":
1083
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
1084
- response = {
1085
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1086
- name: errorCode,
1087
- $metadata: deserializeMetadata(output),
1088
- };
1089
- break;
1090
- case "ConflictException":
1091
- case "com.amazonaws.serverlessapplicationrepository#ConflictException":
1092
- response = {
1093
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
1094
- name: errorCode,
1095
- $metadata: deserializeMetadata(output),
1096
- };
1097
- break;
1098
- case "ForbiddenException":
1099
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
1100
- response = {
1101
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1102
- name: errorCode,
1103
- $metadata: deserializeMetadata(output),
1104
- };
1105
- break;
1106
- case "InternalServerErrorException":
1107
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
1108
- response = {
1109
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1110
- name: errorCode,
1111
- $metadata: deserializeMetadata(output),
1112
- };
1113
- break;
1114
- case "NotFoundException":
1115
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
1116
- response = {
1117
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1118
- name: errorCode,
1119
- $metadata: deserializeMetadata(output),
1120
- };
1121
- break;
1122
- case "TooManyRequestsException":
1123
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
1124
- response = {
1125
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1126
- name: errorCode,
1127
- $metadata: deserializeMetadata(output),
1128
- };
1129
- break;
1130
- default:
1131
- const parsedBody = parsedOutput.body;
1132
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1133
- response = {
1134
- ...parsedBody,
1135
- name: `${errorCode}`,
1136
- message: parsedBody.message || parsedBody.Message || errorCode,
1137
- $fault: "client",
1138
- $metadata: deserializeMetadata(output),
1139
- } as any;
1140
- }
1141
- const message = response.message || response.Message || errorCode;
1142
- response.message = message;
1143
- delete response.Message;
1144
- return Promise.reject(Object.assign(new Error(message), response));
1145
- };
1146
-
1147
- export const deserializeAws_restJson1GetApplicationCommand = async (
1148
- output: __HttpResponse,
1149
- context: __SerdeContext
1150
- ): Promise<GetApplicationCommandOutput> => {
1151
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1152
- return deserializeAws_restJson1GetApplicationCommandError(output, context);
1153
- }
1154
- const contents: GetApplicationCommandOutput = {
1155
- $metadata: deserializeMetadata(output),
1156
- ApplicationId: undefined,
1157
- Author: undefined,
1158
- CreationTime: undefined,
1159
- Description: undefined,
1160
- HomePageUrl: undefined,
1161
- IsVerifiedAuthor: undefined,
1162
- Labels: undefined,
1163
- LicenseUrl: undefined,
1164
- Name: undefined,
1165
- ReadmeUrl: undefined,
1166
- SpdxLicenseId: undefined,
1167
- VerifiedAuthorUrl: undefined,
1168
- Version: undefined,
1169
- };
1170
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1171
- if (data.applicationId !== undefined && data.applicationId !== null) {
1172
- contents.ApplicationId = __expectString(data.applicationId);
1173
- }
1174
- if (data.author !== undefined && data.author !== null) {
1175
- contents.Author = __expectString(data.author);
1176
- }
1177
- if (data.creationTime !== undefined && data.creationTime !== null) {
1178
- contents.CreationTime = __expectString(data.creationTime);
1179
- }
1180
- if (data.description !== undefined && data.description !== null) {
1181
- contents.Description = __expectString(data.description);
1182
- }
1183
- if (data.homePageUrl !== undefined && data.homePageUrl !== null) {
1184
- contents.HomePageUrl = __expectString(data.homePageUrl);
1185
- }
1186
- if (data.isVerifiedAuthor !== undefined && data.isVerifiedAuthor !== null) {
1187
- contents.IsVerifiedAuthor = __expectBoolean(data.isVerifiedAuthor);
1188
- }
1189
- if (data.labels !== undefined && data.labels !== null) {
1190
- contents.Labels = deserializeAws_restJson1__listOf__string(data.labels, context);
1191
- }
1192
- if (data.licenseUrl !== undefined && data.licenseUrl !== null) {
1193
- contents.LicenseUrl = __expectString(data.licenseUrl);
1194
- }
1195
- if (data.name !== undefined && data.name !== null) {
1196
- contents.Name = __expectString(data.name);
1197
- }
1198
- if (data.readmeUrl !== undefined && data.readmeUrl !== null) {
1199
- contents.ReadmeUrl = __expectString(data.readmeUrl);
1200
- }
1201
- if (data.spdxLicenseId !== undefined && data.spdxLicenseId !== null) {
1202
- contents.SpdxLicenseId = __expectString(data.spdxLicenseId);
1203
- }
1204
- if (data.verifiedAuthorUrl !== undefined && data.verifiedAuthorUrl !== null) {
1205
- contents.VerifiedAuthorUrl = __expectString(data.verifiedAuthorUrl);
1206
- }
1207
- if (data.version !== undefined && data.version !== null) {
1208
- contents.Version = deserializeAws_restJson1Version(data.version, context);
1209
- }
1210
- return Promise.resolve(contents);
1211
- };
1212
-
1213
- const deserializeAws_restJson1GetApplicationCommandError = async (
1214
- output: __HttpResponse,
1215
- context: __SerdeContext
1216
- ): Promise<GetApplicationCommandOutput> => {
1217
- const parsedOutput: any = {
1218
- ...output,
1219
- body: await parseBody(output.body, context),
1220
- };
1221
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1222
- let errorCode: string = "UnknownError";
1223
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1224
- switch (errorCode) {
1225
- case "BadRequestException":
1226
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
1227
- response = {
1228
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1229
- name: errorCode,
1230
- $metadata: deserializeMetadata(output),
1231
- };
1232
- break;
1233
- case "ForbiddenException":
1234
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
1235
- response = {
1236
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1237
- name: errorCode,
1238
- $metadata: deserializeMetadata(output),
1239
- };
1240
- break;
1241
- case "InternalServerErrorException":
1242
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
1243
- response = {
1244
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1245
- name: errorCode,
1246
- $metadata: deserializeMetadata(output),
1247
- };
1248
- break;
1249
- case "NotFoundException":
1250
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
1251
- response = {
1252
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1253
- name: errorCode,
1254
- $metadata: deserializeMetadata(output),
1255
- };
1256
- break;
1257
- case "TooManyRequestsException":
1258
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
1259
- response = {
1260
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1261
- name: errorCode,
1262
- $metadata: deserializeMetadata(output),
1263
- };
1264
- break;
1265
- default:
1266
- const parsedBody = parsedOutput.body;
1267
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1268
- response = {
1269
- ...parsedBody,
1270
- name: `${errorCode}`,
1271
- message: parsedBody.message || parsedBody.Message || errorCode,
1272
- $fault: "client",
1273
- $metadata: deserializeMetadata(output),
1274
- } as any;
1275
- }
1276
- const message = response.message || response.Message || errorCode;
1277
- response.message = message;
1278
- delete response.Message;
1279
- return Promise.reject(Object.assign(new Error(message), response));
1280
- };
1281
-
1282
- export const deserializeAws_restJson1GetApplicationPolicyCommand = async (
1283
- output: __HttpResponse,
1284
- context: __SerdeContext
1285
- ): Promise<GetApplicationPolicyCommandOutput> => {
1286
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1287
- return deserializeAws_restJson1GetApplicationPolicyCommandError(output, context);
1288
- }
1289
- const contents: GetApplicationPolicyCommandOutput = {
1290
- $metadata: deserializeMetadata(output),
1291
- Statements: undefined,
1292
- };
1293
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1294
- if (data.statements !== undefined && data.statements !== null) {
1295
- contents.Statements = deserializeAws_restJson1__listOfApplicationPolicyStatement(data.statements, context);
1296
- }
1297
- return Promise.resolve(contents);
1298
- };
1299
-
1300
- const deserializeAws_restJson1GetApplicationPolicyCommandError = async (
1301
- output: __HttpResponse,
1302
- context: __SerdeContext
1303
- ): Promise<GetApplicationPolicyCommandOutput> => {
1304
- const parsedOutput: any = {
1305
- ...output,
1306
- body: await parseBody(output.body, context),
1307
- };
1308
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1309
- let errorCode: string = "UnknownError";
1310
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1311
- switch (errorCode) {
1312
- case "BadRequestException":
1313
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
1314
- response = {
1315
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1316
- name: errorCode,
1317
- $metadata: deserializeMetadata(output),
1318
- };
1319
- break;
1320
- case "ForbiddenException":
1321
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
1322
- response = {
1323
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1324
- name: errorCode,
1325
- $metadata: deserializeMetadata(output),
1326
- };
1327
- break;
1328
- case "InternalServerErrorException":
1329
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
1330
- response = {
1331
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1332
- name: errorCode,
1333
- $metadata: deserializeMetadata(output),
1334
- };
1335
- break;
1336
- case "NotFoundException":
1337
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
1338
- response = {
1339
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1340
- name: errorCode,
1341
- $metadata: deserializeMetadata(output),
1342
- };
1343
- break;
1344
- case "TooManyRequestsException":
1345
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
1346
- response = {
1347
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1348
- name: errorCode,
1349
- $metadata: deserializeMetadata(output),
1350
- };
1351
- break;
1352
- default:
1353
- const parsedBody = parsedOutput.body;
1354
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1355
- response = {
1356
- ...parsedBody,
1357
- name: `${errorCode}`,
1358
- message: parsedBody.message || parsedBody.Message || errorCode,
1359
- $fault: "client",
1360
- $metadata: deserializeMetadata(output),
1361
- } as any;
1362
- }
1363
- const message = response.message || response.Message || errorCode;
1364
- response.message = message;
1365
- delete response.Message;
1366
- return Promise.reject(Object.assign(new Error(message), response));
1367
- };
1368
-
1369
- export const deserializeAws_restJson1GetCloudFormationTemplateCommand = async (
1370
- output: __HttpResponse,
1371
- context: __SerdeContext
1372
- ): Promise<GetCloudFormationTemplateCommandOutput> => {
1373
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1374
- return deserializeAws_restJson1GetCloudFormationTemplateCommandError(output, context);
1375
- }
1376
- const contents: GetCloudFormationTemplateCommandOutput = {
1377
- $metadata: deserializeMetadata(output),
1378
- ApplicationId: undefined,
1379
- CreationTime: undefined,
1380
- ExpirationTime: undefined,
1381
- SemanticVersion: undefined,
1382
- Status: undefined,
1383
- TemplateId: undefined,
1384
- TemplateUrl: undefined,
1385
- };
1386
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1387
- if (data.applicationId !== undefined && data.applicationId !== null) {
1388
- contents.ApplicationId = __expectString(data.applicationId);
1389
- }
1390
- if (data.creationTime !== undefined && data.creationTime !== null) {
1391
- contents.CreationTime = __expectString(data.creationTime);
1392
- }
1393
- if (data.expirationTime !== undefined && data.expirationTime !== null) {
1394
- contents.ExpirationTime = __expectString(data.expirationTime);
1395
- }
1396
- if (data.semanticVersion !== undefined && data.semanticVersion !== null) {
1397
- contents.SemanticVersion = __expectString(data.semanticVersion);
1398
- }
1399
- if (data.status !== undefined && data.status !== null) {
1400
- contents.Status = __expectString(data.status);
1401
- }
1402
- if (data.templateId !== undefined && data.templateId !== null) {
1403
- contents.TemplateId = __expectString(data.templateId);
1404
- }
1405
- if (data.templateUrl !== undefined && data.templateUrl !== null) {
1406
- contents.TemplateUrl = __expectString(data.templateUrl);
1407
- }
1408
- return Promise.resolve(contents);
1409
- };
1410
-
1411
- const deserializeAws_restJson1GetCloudFormationTemplateCommandError = async (
1412
- output: __HttpResponse,
1413
- context: __SerdeContext
1414
- ): Promise<GetCloudFormationTemplateCommandOutput> => {
1415
- const parsedOutput: any = {
1416
- ...output,
1417
- body: await parseBody(output.body, context),
1418
- };
1419
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1420
- let errorCode: string = "UnknownError";
1421
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1422
- switch (errorCode) {
1423
- case "BadRequestException":
1424
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
1425
- response = {
1426
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1427
- name: errorCode,
1428
- $metadata: deserializeMetadata(output),
1429
- };
1430
- break;
1431
- case "ForbiddenException":
1432
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
1433
- response = {
1434
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1435
- name: errorCode,
1436
- $metadata: deserializeMetadata(output),
1437
- };
1438
- break;
1439
- case "InternalServerErrorException":
1440
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
1441
- response = {
1442
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1443
- name: errorCode,
1444
- $metadata: deserializeMetadata(output),
1445
- };
1446
- break;
1447
- case "NotFoundException":
1448
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
1449
- response = {
1450
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1451
- name: errorCode,
1452
- $metadata: deserializeMetadata(output),
1453
- };
1454
- break;
1455
- case "TooManyRequestsException":
1456
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
1457
- response = {
1458
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1459
- name: errorCode,
1460
- $metadata: deserializeMetadata(output),
1461
- };
1462
- break;
1463
- default:
1464
- const parsedBody = parsedOutput.body;
1465
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1466
- response = {
1467
- ...parsedBody,
1468
- name: `${errorCode}`,
1469
- message: parsedBody.message || parsedBody.Message || errorCode,
1470
- $fault: "client",
1471
- $metadata: deserializeMetadata(output),
1472
- } as any;
1473
- }
1474
- const message = response.message || response.Message || errorCode;
1475
- response.message = message;
1476
- delete response.Message;
1477
- return Promise.reject(Object.assign(new Error(message), response));
1478
- };
1479
-
1480
- export const deserializeAws_restJson1ListApplicationDependenciesCommand = async (
1481
- output: __HttpResponse,
1482
- context: __SerdeContext
1483
- ): Promise<ListApplicationDependenciesCommandOutput> => {
1484
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1485
- return deserializeAws_restJson1ListApplicationDependenciesCommandError(output, context);
1486
- }
1487
- const contents: ListApplicationDependenciesCommandOutput = {
1488
- $metadata: deserializeMetadata(output),
1489
- Dependencies: undefined,
1490
- NextToken: undefined,
1491
- };
1492
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1493
- if (data.dependencies !== undefined && data.dependencies !== null) {
1494
- contents.Dependencies = deserializeAws_restJson1__listOfApplicationDependencySummary(data.dependencies, context);
1495
- }
1496
- if (data.nextToken !== undefined && data.nextToken !== null) {
1497
- contents.NextToken = __expectString(data.nextToken);
1498
- }
1499
- return Promise.resolve(contents);
1500
- };
1501
-
1502
- const deserializeAws_restJson1ListApplicationDependenciesCommandError = async (
1503
- output: __HttpResponse,
1504
- context: __SerdeContext
1505
- ): Promise<ListApplicationDependenciesCommandOutput> => {
1506
- const parsedOutput: any = {
1507
- ...output,
1508
- body: await parseBody(output.body, context),
1509
- };
1510
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1511
- let errorCode: string = "UnknownError";
1512
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1513
- switch (errorCode) {
1514
- case "BadRequestException":
1515
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
1516
- response = {
1517
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1518
- name: errorCode,
1519
- $metadata: deserializeMetadata(output),
1520
- };
1521
- break;
1522
- case "ForbiddenException":
1523
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
1524
- response = {
1525
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1526
- name: errorCode,
1527
- $metadata: deserializeMetadata(output),
1528
- };
1529
- break;
1530
- case "InternalServerErrorException":
1531
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
1532
- response = {
1533
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1534
- name: errorCode,
1535
- $metadata: deserializeMetadata(output),
1536
- };
1537
- break;
1538
- case "NotFoundException":
1539
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
1540
- response = {
1541
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1542
- name: errorCode,
1543
- $metadata: deserializeMetadata(output),
1544
- };
1545
- break;
1546
- case "TooManyRequestsException":
1547
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
1548
- response = {
1549
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1550
- name: errorCode,
1551
- $metadata: deserializeMetadata(output),
1552
- };
1553
- break;
1554
- default:
1555
- const parsedBody = parsedOutput.body;
1556
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1557
- response = {
1558
- ...parsedBody,
1559
- name: `${errorCode}`,
1560
- message: parsedBody.message || parsedBody.Message || errorCode,
1561
- $fault: "client",
1562
- $metadata: deserializeMetadata(output),
1563
- } as any;
1564
- }
1565
- const message = response.message || response.Message || errorCode;
1566
- response.message = message;
1567
- delete response.Message;
1568
- return Promise.reject(Object.assign(new Error(message), response));
1569
- };
1570
-
1571
- export const deserializeAws_restJson1ListApplicationsCommand = async (
1572
- output: __HttpResponse,
1573
- context: __SerdeContext
1574
- ): Promise<ListApplicationsCommandOutput> => {
1575
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1576
- return deserializeAws_restJson1ListApplicationsCommandError(output, context);
1577
- }
1578
- const contents: ListApplicationsCommandOutput = {
1579
- $metadata: deserializeMetadata(output),
1580
- Applications: undefined,
1581
- NextToken: undefined,
1582
- };
1583
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1584
- if (data.applications !== undefined && data.applications !== null) {
1585
- contents.Applications = deserializeAws_restJson1__listOfApplicationSummary(data.applications, context);
1586
- }
1587
- if (data.nextToken !== undefined && data.nextToken !== null) {
1588
- contents.NextToken = __expectString(data.nextToken);
1589
- }
1590
- return Promise.resolve(contents);
1591
- };
1592
-
1593
- const deserializeAws_restJson1ListApplicationsCommandError = async (
1594
- output: __HttpResponse,
1595
- context: __SerdeContext
1596
- ): Promise<ListApplicationsCommandOutput> => {
1597
- const parsedOutput: any = {
1598
- ...output,
1599
- body: await parseBody(output.body, context),
1600
- };
1601
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1602
- let errorCode: string = "UnknownError";
1603
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1604
- switch (errorCode) {
1605
- case "BadRequestException":
1606
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
1607
- response = {
1608
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1609
- name: errorCode,
1610
- $metadata: deserializeMetadata(output),
1611
- };
1612
- break;
1613
- case "ForbiddenException":
1614
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
1615
- response = {
1616
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1617
- name: errorCode,
1618
- $metadata: deserializeMetadata(output),
1619
- };
1620
- break;
1621
- case "InternalServerErrorException":
1622
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
1623
- response = {
1624
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1625
- name: errorCode,
1626
- $metadata: deserializeMetadata(output),
1627
- };
1628
- break;
1629
- case "NotFoundException":
1630
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
1631
- response = {
1632
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1633
- name: errorCode,
1634
- $metadata: deserializeMetadata(output),
1635
- };
1636
- break;
1637
- default:
1638
- const parsedBody = parsedOutput.body;
1639
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1640
- response = {
1641
- ...parsedBody,
1642
- name: `${errorCode}`,
1643
- message: parsedBody.message || parsedBody.Message || errorCode,
1644
- $fault: "client",
1645
- $metadata: deserializeMetadata(output),
1646
- } as any;
1647
- }
1648
- const message = response.message || response.Message || errorCode;
1649
- response.message = message;
1650
- delete response.Message;
1651
- return Promise.reject(Object.assign(new Error(message), response));
1652
- };
1653
-
1654
- export const deserializeAws_restJson1ListApplicationVersionsCommand = async (
1655
- output: __HttpResponse,
1656
- context: __SerdeContext
1657
- ): Promise<ListApplicationVersionsCommandOutput> => {
1658
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1659
- return deserializeAws_restJson1ListApplicationVersionsCommandError(output, context);
1660
- }
1661
- const contents: ListApplicationVersionsCommandOutput = {
1662
- $metadata: deserializeMetadata(output),
1663
- NextToken: undefined,
1664
- Versions: undefined,
1665
- };
1666
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1667
- if (data.nextToken !== undefined && data.nextToken !== null) {
1668
- contents.NextToken = __expectString(data.nextToken);
1669
- }
1670
- if (data.versions !== undefined && data.versions !== null) {
1671
- contents.Versions = deserializeAws_restJson1__listOfVersionSummary(data.versions, context);
1672
- }
1673
- return Promise.resolve(contents);
1674
- };
1675
-
1676
- const deserializeAws_restJson1ListApplicationVersionsCommandError = async (
1677
- output: __HttpResponse,
1678
- context: __SerdeContext
1679
- ): Promise<ListApplicationVersionsCommandOutput> => {
1680
- const parsedOutput: any = {
1681
- ...output,
1682
- body: await parseBody(output.body, context),
1683
- };
1684
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1685
- let errorCode: string = "UnknownError";
1686
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1687
- switch (errorCode) {
1688
- case "BadRequestException":
1689
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
1690
- response = {
1691
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1692
- name: errorCode,
1693
- $metadata: deserializeMetadata(output),
1694
- };
1695
- break;
1696
- case "ForbiddenException":
1697
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
1698
- response = {
1699
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1700
- name: errorCode,
1701
- $metadata: deserializeMetadata(output),
1702
- };
1703
- break;
1704
- case "InternalServerErrorException":
1705
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
1706
- response = {
1707
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1708
- name: errorCode,
1709
- $metadata: deserializeMetadata(output),
1710
- };
1711
- break;
1712
- case "NotFoundException":
1713
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
1714
- response = {
1715
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1716
- name: errorCode,
1717
- $metadata: deserializeMetadata(output),
1718
- };
1719
- break;
1720
- case "TooManyRequestsException":
1721
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
1722
- response = {
1723
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1724
- name: errorCode,
1725
- $metadata: deserializeMetadata(output),
1726
- };
1727
- break;
1728
- default:
1729
- const parsedBody = parsedOutput.body;
1730
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1731
- response = {
1732
- ...parsedBody,
1733
- name: `${errorCode}`,
1734
- message: parsedBody.message || parsedBody.Message || errorCode,
1735
- $fault: "client",
1736
- $metadata: deserializeMetadata(output),
1737
- } as any;
1738
- }
1739
- const message = response.message || response.Message || errorCode;
1740
- response.message = message;
1741
- delete response.Message;
1742
- return Promise.reject(Object.assign(new Error(message), response));
1743
- };
1744
-
1745
- export const deserializeAws_restJson1PutApplicationPolicyCommand = async (
1746
- output: __HttpResponse,
1747
- context: __SerdeContext
1748
- ): Promise<PutApplicationPolicyCommandOutput> => {
1749
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1750
- return deserializeAws_restJson1PutApplicationPolicyCommandError(output, context);
1751
- }
1752
- const contents: PutApplicationPolicyCommandOutput = {
1753
- $metadata: deserializeMetadata(output),
1754
- Statements: undefined,
1755
- };
1756
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1757
- if (data.statements !== undefined && data.statements !== null) {
1758
- contents.Statements = deserializeAws_restJson1__listOfApplicationPolicyStatement(data.statements, context);
1759
- }
1760
- return Promise.resolve(contents);
1761
- };
1762
-
1763
- const deserializeAws_restJson1PutApplicationPolicyCommandError = async (
1764
- output: __HttpResponse,
1765
- context: __SerdeContext
1766
- ): Promise<PutApplicationPolicyCommandOutput> => {
1767
- const parsedOutput: any = {
1768
- ...output,
1769
- body: await parseBody(output.body, context),
1770
- };
1771
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1772
- let errorCode: string = "UnknownError";
1773
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1774
- switch (errorCode) {
1775
- case "BadRequestException":
1776
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
1777
- response = {
1778
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1779
- name: errorCode,
1780
- $metadata: deserializeMetadata(output),
1781
- };
1782
- break;
1783
- case "ForbiddenException":
1784
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
1785
- response = {
1786
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1787
- name: errorCode,
1788
- $metadata: deserializeMetadata(output),
1789
- };
1790
- break;
1791
- case "InternalServerErrorException":
1792
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
1793
- response = {
1794
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1795
- name: errorCode,
1796
- $metadata: deserializeMetadata(output),
1797
- };
1798
- break;
1799
- case "NotFoundException":
1800
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
1801
- response = {
1802
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1803
- name: errorCode,
1804
- $metadata: deserializeMetadata(output),
1805
- };
1806
- break;
1807
- case "TooManyRequestsException":
1808
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
1809
- response = {
1810
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1811
- name: errorCode,
1812
- $metadata: deserializeMetadata(output),
1813
- };
1814
- break;
1815
- default:
1816
- const parsedBody = parsedOutput.body;
1817
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1818
- response = {
1819
- ...parsedBody,
1820
- name: `${errorCode}`,
1821
- message: parsedBody.message || parsedBody.Message || errorCode,
1822
- $fault: "client",
1823
- $metadata: deserializeMetadata(output),
1824
- } as any;
1825
- }
1826
- const message = response.message || response.Message || errorCode;
1827
- response.message = message;
1828
- delete response.Message;
1829
- return Promise.reject(Object.assign(new Error(message), response));
1830
- };
1831
-
1832
- export const deserializeAws_restJson1UnshareApplicationCommand = async (
1833
- output: __HttpResponse,
1834
- context: __SerdeContext
1835
- ): Promise<UnshareApplicationCommandOutput> => {
1836
- if (output.statusCode !== 204 && output.statusCode >= 300) {
1837
- return deserializeAws_restJson1UnshareApplicationCommandError(output, context);
1838
- }
1839
- const contents: UnshareApplicationCommandOutput = {
1840
- $metadata: deserializeMetadata(output),
1841
- };
1842
- await collectBody(output.body, context);
1843
- return Promise.resolve(contents);
1844
- };
1845
-
1846
- const deserializeAws_restJson1UnshareApplicationCommandError = async (
1847
- output: __HttpResponse,
1848
- context: __SerdeContext
1849
- ): Promise<UnshareApplicationCommandOutput> => {
1850
- const parsedOutput: any = {
1851
- ...output,
1852
- body: await parseBody(output.body, context),
1853
- };
1854
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1855
- let errorCode: string = "UnknownError";
1856
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1857
- switch (errorCode) {
1858
- case "BadRequestException":
1859
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
1860
- response = {
1861
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1862
- name: errorCode,
1863
- $metadata: deserializeMetadata(output),
1864
- };
1865
- break;
1866
- case "ForbiddenException":
1867
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
1868
- response = {
1869
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
1870
- name: errorCode,
1871
- $metadata: deserializeMetadata(output),
1872
- };
1873
- break;
1874
- case "InternalServerErrorException":
1875
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
1876
- response = {
1877
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
1878
- name: errorCode,
1879
- $metadata: deserializeMetadata(output),
1880
- };
1881
- break;
1882
- case "NotFoundException":
1883
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
1884
- response = {
1885
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1886
- name: errorCode,
1887
- $metadata: deserializeMetadata(output),
1888
- };
1889
- break;
1890
- case "TooManyRequestsException":
1891
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
1892
- response = {
1893
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
1894
- name: errorCode,
1895
- $metadata: deserializeMetadata(output),
1896
- };
1897
- break;
1898
- default:
1899
- const parsedBody = parsedOutput.body;
1900
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1901
- response = {
1902
- ...parsedBody,
1903
- name: `${errorCode}`,
1904
- message: parsedBody.message || parsedBody.Message || errorCode,
1905
- $fault: "client",
1906
- $metadata: deserializeMetadata(output),
1907
- } as any;
1908
- }
1909
- const message = response.message || response.Message || errorCode;
1910
- response.message = message;
1911
- delete response.Message;
1912
- return Promise.reject(Object.assign(new Error(message), response));
1913
- };
1914
-
1915
- export const deserializeAws_restJson1UpdateApplicationCommand = async (
1916
- output: __HttpResponse,
1917
- context: __SerdeContext
1918
- ): Promise<UpdateApplicationCommandOutput> => {
1919
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1920
- return deserializeAws_restJson1UpdateApplicationCommandError(output, context);
1921
- }
1922
- const contents: UpdateApplicationCommandOutput = {
1923
- $metadata: deserializeMetadata(output),
1924
- ApplicationId: undefined,
1925
- Author: undefined,
1926
- CreationTime: undefined,
1927
- Description: undefined,
1928
- HomePageUrl: undefined,
1929
- IsVerifiedAuthor: undefined,
1930
- Labels: undefined,
1931
- LicenseUrl: undefined,
1932
- Name: undefined,
1933
- ReadmeUrl: undefined,
1934
- SpdxLicenseId: undefined,
1935
- VerifiedAuthorUrl: undefined,
1936
- Version: undefined,
1937
- };
1938
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1939
- if (data.applicationId !== undefined && data.applicationId !== null) {
1940
- contents.ApplicationId = __expectString(data.applicationId);
1941
- }
1942
- if (data.author !== undefined && data.author !== null) {
1943
- contents.Author = __expectString(data.author);
1944
- }
1945
- if (data.creationTime !== undefined && data.creationTime !== null) {
1946
- contents.CreationTime = __expectString(data.creationTime);
1947
- }
1948
- if (data.description !== undefined && data.description !== null) {
1949
- contents.Description = __expectString(data.description);
1950
- }
1951
- if (data.homePageUrl !== undefined && data.homePageUrl !== null) {
1952
- contents.HomePageUrl = __expectString(data.homePageUrl);
1953
- }
1954
- if (data.isVerifiedAuthor !== undefined && data.isVerifiedAuthor !== null) {
1955
- contents.IsVerifiedAuthor = __expectBoolean(data.isVerifiedAuthor);
1956
- }
1957
- if (data.labels !== undefined && data.labels !== null) {
1958
- contents.Labels = deserializeAws_restJson1__listOf__string(data.labels, context);
1959
- }
1960
- if (data.licenseUrl !== undefined && data.licenseUrl !== null) {
1961
- contents.LicenseUrl = __expectString(data.licenseUrl);
1962
- }
1963
- if (data.name !== undefined && data.name !== null) {
1964
- contents.Name = __expectString(data.name);
1965
- }
1966
- if (data.readmeUrl !== undefined && data.readmeUrl !== null) {
1967
- contents.ReadmeUrl = __expectString(data.readmeUrl);
1968
- }
1969
- if (data.spdxLicenseId !== undefined && data.spdxLicenseId !== null) {
1970
- contents.SpdxLicenseId = __expectString(data.spdxLicenseId);
1971
- }
1972
- if (data.verifiedAuthorUrl !== undefined && data.verifiedAuthorUrl !== null) {
1973
- contents.VerifiedAuthorUrl = __expectString(data.verifiedAuthorUrl);
1974
- }
1975
- if (data.version !== undefined && data.version !== null) {
1976
- contents.Version = deserializeAws_restJson1Version(data.version, context);
1977
- }
1978
- return Promise.resolve(contents);
1979
- };
1980
-
1981
- const deserializeAws_restJson1UpdateApplicationCommandError = async (
1982
- output: __HttpResponse,
1983
- context: __SerdeContext
1984
- ): Promise<UpdateApplicationCommandOutput> => {
1985
- const parsedOutput: any = {
1986
- ...output,
1987
- body: await parseBody(output.body, context),
1988
- };
1989
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1990
- let errorCode: string = "UnknownError";
1991
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1992
- switch (errorCode) {
1993
- case "BadRequestException":
1994
- case "com.amazonaws.serverlessapplicationrepository#BadRequestException":
1995
- response = {
1996
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1997
- name: errorCode,
1998
- $metadata: deserializeMetadata(output),
1999
- };
2000
- break;
2001
- case "ConflictException":
2002
- case "com.amazonaws.serverlessapplicationrepository#ConflictException":
2003
- response = {
2004
- ...(await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)),
2005
- name: errorCode,
2006
- $metadata: deserializeMetadata(output),
2007
- };
2008
- break;
2009
- case "ForbiddenException":
2010
- case "com.amazonaws.serverlessapplicationrepository#ForbiddenException":
2011
- response = {
2012
- ...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
2013
- name: errorCode,
2014
- $metadata: deserializeMetadata(output),
2015
- };
2016
- break;
2017
- case "InternalServerErrorException":
2018
- case "com.amazonaws.serverlessapplicationrepository#InternalServerErrorException":
2019
- response = {
2020
- ...(await deserializeAws_restJson1InternalServerErrorExceptionResponse(parsedOutput, context)),
2021
- name: errorCode,
2022
- $metadata: deserializeMetadata(output),
2023
- };
2024
- break;
2025
- case "NotFoundException":
2026
- case "com.amazonaws.serverlessapplicationrepository#NotFoundException":
2027
- response = {
2028
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2029
- name: errorCode,
2030
- $metadata: deserializeMetadata(output),
2031
- };
2032
- break;
2033
- case "TooManyRequestsException":
2034
- case "com.amazonaws.serverlessapplicationrepository#TooManyRequestsException":
2035
- response = {
2036
- ...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
2037
- name: errorCode,
2038
- $metadata: deserializeMetadata(output),
2039
- };
2040
- break;
2041
- default:
2042
- const parsedBody = parsedOutput.body;
2043
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2044
- response = {
2045
- ...parsedBody,
2046
- name: `${errorCode}`,
2047
- message: parsedBody.message || parsedBody.Message || errorCode,
2048
- $fault: "client",
2049
- $metadata: deserializeMetadata(output),
2050
- } as any;
2051
- }
2052
- const message = response.message || response.Message || errorCode;
2053
- response.message = message;
2054
- delete response.Message;
2055
- return Promise.reject(Object.assign(new Error(message), response));
2056
- };
2057
-
2058
- const deserializeAws_restJson1BadRequestExceptionResponse = async (
2059
- parsedOutput: any,
2060
- context: __SerdeContext
2061
- ): Promise<BadRequestException> => {
2062
- const contents: BadRequestException = {
2063
- name: "BadRequestException",
2064
- $fault: "client",
2065
- $metadata: deserializeMetadata(parsedOutput),
2066
- ErrorCode: undefined,
2067
- Message: undefined,
2068
- };
2069
- const data: any = parsedOutput.body;
2070
- if (data.errorCode !== undefined && data.errorCode !== null) {
2071
- contents.ErrorCode = __expectString(data.errorCode);
2072
- }
2073
- if (data.message !== undefined && data.message !== null) {
2074
- contents.Message = __expectString(data.message);
2075
- }
2076
- return contents;
2077
- };
2078
-
2079
- const deserializeAws_restJson1ConflictExceptionResponse = async (
2080
- parsedOutput: any,
2081
- context: __SerdeContext
2082
- ): Promise<ConflictException> => {
2083
- const contents: ConflictException = {
2084
- name: "ConflictException",
2085
- $fault: "client",
2086
- $metadata: deserializeMetadata(parsedOutput),
2087
- ErrorCode: undefined,
2088
- Message: undefined,
2089
- };
2090
- const data: any = parsedOutput.body;
2091
- if (data.errorCode !== undefined && data.errorCode !== null) {
2092
- contents.ErrorCode = __expectString(data.errorCode);
2093
- }
2094
- if (data.message !== undefined && data.message !== null) {
2095
- contents.Message = __expectString(data.message);
2096
- }
2097
- return contents;
2098
- };
2099
-
2100
- const deserializeAws_restJson1ForbiddenExceptionResponse = async (
2101
- parsedOutput: any,
2102
- context: __SerdeContext
2103
- ): Promise<ForbiddenException> => {
2104
- const contents: ForbiddenException = {
2105
- name: "ForbiddenException",
2106
- $fault: "client",
2107
- $metadata: deserializeMetadata(parsedOutput),
2108
- ErrorCode: undefined,
2109
- Message: undefined,
2110
- };
2111
- const data: any = parsedOutput.body;
2112
- if (data.errorCode !== undefined && data.errorCode !== null) {
2113
- contents.ErrorCode = __expectString(data.errorCode);
2114
- }
2115
- if (data.message !== undefined && data.message !== null) {
2116
- contents.Message = __expectString(data.message);
2117
- }
2118
- return contents;
2119
- };
2120
-
2121
- const deserializeAws_restJson1InternalServerErrorExceptionResponse = async (
2122
- parsedOutput: any,
2123
- context: __SerdeContext
2124
- ): Promise<InternalServerErrorException> => {
2125
- const contents: InternalServerErrorException = {
2126
- name: "InternalServerErrorException",
2127
- $fault: "server",
2128
- $metadata: deserializeMetadata(parsedOutput),
2129
- ErrorCode: undefined,
2130
- Message: undefined,
2131
- };
2132
- const data: any = parsedOutput.body;
2133
- if (data.errorCode !== undefined && data.errorCode !== null) {
2134
- contents.ErrorCode = __expectString(data.errorCode);
2135
- }
2136
- if (data.message !== undefined && data.message !== null) {
2137
- contents.Message = __expectString(data.message);
2138
- }
2139
- return contents;
2140
- };
2141
-
2142
- const deserializeAws_restJson1NotFoundExceptionResponse = async (
2143
- parsedOutput: any,
2144
- context: __SerdeContext
2145
- ): Promise<NotFoundException> => {
2146
- const contents: NotFoundException = {
2147
- name: "NotFoundException",
2148
- $fault: "client",
2149
- $metadata: deserializeMetadata(parsedOutput),
2150
- ErrorCode: undefined,
2151
- Message: undefined,
2152
- };
2153
- const data: any = parsedOutput.body;
2154
- if (data.errorCode !== undefined && data.errorCode !== null) {
2155
- contents.ErrorCode = __expectString(data.errorCode);
2156
- }
2157
- if (data.message !== undefined && data.message !== null) {
2158
- contents.Message = __expectString(data.message);
2159
- }
2160
- return contents;
2161
- };
2162
-
2163
- const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (
2164
- parsedOutput: any,
2165
- context: __SerdeContext
2166
- ): Promise<TooManyRequestsException> => {
2167
- const contents: TooManyRequestsException = {
2168
- name: "TooManyRequestsException",
2169
- $fault: "client",
2170
- $metadata: deserializeMetadata(parsedOutput),
2171
- ErrorCode: undefined,
2172
- Message: undefined,
2173
- };
2174
- const data: any = parsedOutput.body;
2175
- if (data.errorCode !== undefined && data.errorCode !== null) {
2176
- contents.ErrorCode = __expectString(data.errorCode);
2177
- }
2178
- if (data.message !== undefined && data.message !== null) {
2179
- contents.Message = __expectString(data.message);
2180
- }
2181
- return contents;
2182
- };
2183
-
2184
- const serializeAws_restJson1__listOf__string = (input: string[], context: __SerdeContext): any => {
2185
- return input
2186
- .filter((e: any) => e != null)
2187
- .map((entry) => {
2188
- if (entry === null) {
2189
- return null as any;
2190
- }
2191
- return entry;
2192
- });
2193
- };
2194
-
2195
- const serializeAws_restJson1__listOfApplicationPolicyStatement = (
2196
- input: ApplicationPolicyStatement[],
2197
- context: __SerdeContext
2198
- ): any => {
2199
- return input
2200
- .filter((e: any) => e != null)
2201
- .map((entry) => {
2202
- if (entry === null) {
2203
- return null as any;
2204
- }
2205
- return serializeAws_restJson1ApplicationPolicyStatement(entry, context);
2206
- });
2207
- };
2208
-
2209
- const serializeAws_restJson1__listOfParameterValue = (input: ParameterValue[], context: __SerdeContext): any => {
2210
- return input
2211
- .filter((e: any) => e != null)
2212
- .map((entry) => {
2213
- if (entry === null) {
2214
- return null as any;
2215
- }
2216
- return serializeAws_restJson1ParameterValue(entry, context);
2217
- });
2218
- };
2219
-
2220
- const serializeAws_restJson1__listOfRollbackTrigger = (input: RollbackTrigger[], context: __SerdeContext): any => {
2221
- return input
2222
- .filter((e: any) => e != null)
2223
- .map((entry) => {
2224
- if (entry === null) {
2225
- return null as any;
2226
- }
2227
- return serializeAws_restJson1RollbackTrigger(entry, context);
2228
- });
2229
- };
2230
-
2231
- const serializeAws_restJson1__listOfTag = (input: Tag[], context: __SerdeContext): any => {
2232
- return input
2233
- .filter((e: any) => e != null)
2234
- .map((entry) => {
2235
- if (entry === null) {
2236
- return null as any;
2237
- }
2238
- return serializeAws_restJson1Tag(entry, context);
2239
- });
2240
- };
2241
-
2242
- const serializeAws_restJson1ApplicationPolicyStatement = (
2243
- input: ApplicationPolicyStatement,
2244
- context: __SerdeContext
2245
- ): any => {
2246
- return {
2247
- ...(input.Actions !== undefined &&
2248
- input.Actions !== null && { actions: serializeAws_restJson1__listOf__string(input.Actions, context) }),
2249
- ...(input.PrincipalOrgIDs !== undefined &&
2250
- input.PrincipalOrgIDs !== null && {
2251
- principalOrgIDs: serializeAws_restJson1__listOf__string(input.PrincipalOrgIDs, context),
2252
- }),
2253
- ...(input.Principals !== undefined &&
2254
- input.Principals !== null && { principals: serializeAws_restJson1__listOf__string(input.Principals, context) }),
2255
- ...(input.StatementId !== undefined && input.StatementId !== null && { statementId: input.StatementId }),
2256
- };
2257
- };
2258
-
2259
- const serializeAws_restJson1ParameterValue = (input: ParameterValue, context: __SerdeContext): any => {
2260
- return {
2261
- ...(input.Name !== undefined && input.Name !== null && { name: input.Name }),
2262
- ...(input.Value !== undefined && input.Value !== null && { value: input.Value }),
2263
- };
2264
- };
2265
-
2266
- const serializeAws_restJson1RollbackConfiguration = (input: RollbackConfiguration, context: __SerdeContext): any => {
2267
- return {
2268
- ...(input.MonitoringTimeInMinutes !== undefined &&
2269
- input.MonitoringTimeInMinutes !== null && { monitoringTimeInMinutes: input.MonitoringTimeInMinutes }),
2270
- ...(input.RollbackTriggers !== undefined &&
2271
- input.RollbackTriggers !== null && {
2272
- rollbackTriggers: serializeAws_restJson1__listOfRollbackTrigger(input.RollbackTriggers, context),
2273
- }),
2274
- };
2275
- };
2276
-
2277
- const serializeAws_restJson1RollbackTrigger = (input: RollbackTrigger, context: __SerdeContext): any => {
2278
- return {
2279
- ...(input.Arn !== undefined && input.Arn !== null && { arn: input.Arn }),
2280
- ...(input.Type !== undefined && input.Type !== null && { type: input.Type }),
2281
- };
2282
- };
2283
-
2284
- const serializeAws_restJson1Tag = (input: Tag, context: __SerdeContext): any => {
2285
- return {
2286
- ...(input.Key !== undefined && input.Key !== null && { key: input.Key }),
2287
- ...(input.Value !== undefined && input.Value !== null && { value: input.Value }),
2288
- };
2289
- };
2290
-
2291
- const deserializeAws_restJson1__listOf__string = (output: any, context: __SerdeContext): string[] => {
2292
- return (output || [])
2293
- .filter((e: any) => e != null)
2294
- .map((entry: any) => {
2295
- if (entry === null) {
2296
- return null as any;
2297
- }
2298
- return __expectString(entry) as any;
2299
- });
2300
- };
2301
-
2302
- const deserializeAws_restJson1__listOfApplicationDependencySummary = (
2303
- output: any,
2304
- context: __SerdeContext
2305
- ): ApplicationDependencySummary[] => {
2306
- return (output || [])
2307
- .filter((e: any) => e != null)
2308
- .map((entry: any) => {
2309
- if (entry === null) {
2310
- return null as any;
2311
- }
2312
- return deserializeAws_restJson1ApplicationDependencySummary(entry, context);
2313
- });
2314
- };
2315
-
2316
- const deserializeAws_restJson1__listOfApplicationPolicyStatement = (
2317
- output: any,
2318
- context: __SerdeContext
2319
- ): ApplicationPolicyStatement[] => {
2320
- return (output || [])
2321
- .filter((e: any) => e != null)
2322
- .map((entry: any) => {
2323
- if (entry === null) {
2324
- return null as any;
2325
- }
2326
- return deserializeAws_restJson1ApplicationPolicyStatement(entry, context);
2327
- });
2328
- };
2329
-
2330
- const deserializeAws_restJson1__listOfApplicationSummary = (
2331
- output: any,
2332
- context: __SerdeContext
2333
- ): ApplicationSummary[] => {
2334
- return (output || [])
2335
- .filter((e: any) => e != null)
2336
- .map((entry: any) => {
2337
- if (entry === null) {
2338
- return null as any;
2339
- }
2340
- return deserializeAws_restJson1ApplicationSummary(entry, context);
2341
- });
2342
- };
2343
-
2344
- const deserializeAws_restJson1__listOfCapability = (output: any, context: __SerdeContext): (Capability | string)[] => {
2345
- return (output || [])
2346
- .filter((e: any) => e != null)
2347
- .map((entry: any) => {
2348
- if (entry === null) {
2349
- return null as any;
2350
- }
2351
- return __expectString(entry) as any;
2352
- });
2353
- };
2354
-
2355
- const deserializeAws_restJson1__listOfParameterDefinition = (
2356
- output: any,
2357
- context: __SerdeContext
2358
- ): ParameterDefinition[] => {
2359
- return (output || [])
2360
- .filter((e: any) => e != null)
2361
- .map((entry: any) => {
2362
- if (entry === null) {
2363
- return null as any;
2364
- }
2365
- return deserializeAws_restJson1ParameterDefinition(entry, context);
2366
- });
2367
- };
2368
-
2369
- const deserializeAws_restJson1__listOfVersionSummary = (output: any, context: __SerdeContext): VersionSummary[] => {
2370
- return (output || [])
2371
- .filter((e: any) => e != null)
2372
- .map((entry: any) => {
2373
- if (entry === null) {
2374
- return null as any;
2375
- }
2376
- return deserializeAws_restJson1VersionSummary(entry, context);
2377
- });
2378
- };
2379
-
2380
- const deserializeAws_restJson1ApplicationDependencySummary = (
2381
- output: any,
2382
- context: __SerdeContext
2383
- ): ApplicationDependencySummary => {
2384
- return {
2385
- ApplicationId: __expectString(output.applicationId),
2386
- SemanticVersion: __expectString(output.semanticVersion),
2387
- } as any;
2388
- };
2389
-
2390
- const deserializeAws_restJson1ApplicationPolicyStatement = (
2391
- output: any,
2392
- context: __SerdeContext
2393
- ): ApplicationPolicyStatement => {
2394
- return {
2395
- Actions:
2396
- output.actions !== undefined && output.actions !== null
2397
- ? deserializeAws_restJson1__listOf__string(output.actions, context)
2398
- : undefined,
2399
- PrincipalOrgIDs:
2400
- output.principalOrgIDs !== undefined && output.principalOrgIDs !== null
2401
- ? deserializeAws_restJson1__listOf__string(output.principalOrgIDs, context)
2402
- : undefined,
2403
- Principals:
2404
- output.principals !== undefined && output.principals !== null
2405
- ? deserializeAws_restJson1__listOf__string(output.principals, context)
2406
- : undefined,
2407
- StatementId: __expectString(output.statementId),
2408
- } as any;
2409
- };
2410
-
2411
- const deserializeAws_restJson1ApplicationSummary = (output: any, context: __SerdeContext): ApplicationSummary => {
2412
- return {
2413
- ApplicationId: __expectString(output.applicationId),
2414
- Author: __expectString(output.author),
2415
- CreationTime: __expectString(output.creationTime),
2416
- Description: __expectString(output.description),
2417
- HomePageUrl: __expectString(output.homePageUrl),
2418
- Labels:
2419
- output.labels !== undefined && output.labels !== null
2420
- ? deserializeAws_restJson1__listOf__string(output.labels, context)
2421
- : undefined,
2422
- Name: __expectString(output.name),
2423
- SpdxLicenseId: __expectString(output.spdxLicenseId),
2424
- } as any;
2425
- };
2426
-
2427
- const deserializeAws_restJson1ParameterDefinition = (output: any, context: __SerdeContext): ParameterDefinition => {
2428
- return {
2429
- AllowedPattern: __expectString(output.allowedPattern),
2430
- AllowedValues:
2431
- output.allowedValues !== undefined && output.allowedValues !== null
2432
- ? deserializeAws_restJson1__listOf__string(output.allowedValues, context)
2433
- : undefined,
2434
- ConstraintDescription: __expectString(output.constraintDescription),
2435
- DefaultValue: __expectString(output.defaultValue),
2436
- Description: __expectString(output.description),
2437
- MaxLength: __expectInt32(output.maxLength),
2438
- MaxValue: __expectInt32(output.maxValue),
2439
- MinLength: __expectInt32(output.minLength),
2440
- MinValue: __expectInt32(output.minValue),
2441
- Name: __expectString(output.name),
2442
- NoEcho: __expectBoolean(output.noEcho),
2443
- ReferencedByResources:
2444
- output.referencedByResources !== undefined && output.referencedByResources !== null
2445
- ? deserializeAws_restJson1__listOf__string(output.referencedByResources, context)
2446
- : undefined,
2447
- Type: __expectString(output.type),
2448
- } as any;
2449
- };
2450
-
2451
- const deserializeAws_restJson1Version = (output: any, context: __SerdeContext): Version => {
2452
- return {
2453
- ApplicationId: __expectString(output.applicationId),
2454
- CreationTime: __expectString(output.creationTime),
2455
- ParameterDefinitions:
2456
- output.parameterDefinitions !== undefined && output.parameterDefinitions !== null
2457
- ? deserializeAws_restJson1__listOfParameterDefinition(output.parameterDefinitions, context)
2458
- : undefined,
2459
- RequiredCapabilities:
2460
- output.requiredCapabilities !== undefined && output.requiredCapabilities !== null
2461
- ? deserializeAws_restJson1__listOfCapability(output.requiredCapabilities, context)
2462
- : undefined,
2463
- ResourcesSupported: __expectBoolean(output.resourcesSupported),
2464
- SemanticVersion: __expectString(output.semanticVersion),
2465
- SourceCodeArchiveUrl: __expectString(output.sourceCodeArchiveUrl),
2466
- SourceCodeUrl: __expectString(output.sourceCodeUrl),
2467
- TemplateUrl: __expectString(output.templateUrl),
2468
- } as any;
2469
- };
2470
-
2471
- const deserializeAws_restJson1VersionSummary = (output: any, context: __SerdeContext): VersionSummary => {
2472
- return {
2473
- ApplicationId: __expectString(output.applicationId),
2474
- CreationTime: __expectString(output.creationTime),
2475
- SemanticVersion: __expectString(output.semanticVersion),
2476
- SourceCodeUrl: __expectString(output.sourceCodeUrl),
2477
- } as any;
2478
- };
2479
-
2480
- const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
2481
- httpStatusCode: output.statusCode,
2482
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
2483
- extendedRequestId: output.headers["x-amz-id-2"],
2484
- cfId: output.headers["x-amz-cf-id"],
2485
- });
2486
-
2487
- // Collect low-level response body stream to Uint8Array.
2488
- const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
2489
- if (streamBody instanceof Uint8Array) {
2490
- return Promise.resolve(streamBody);
2491
- }
2492
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2493
- };
2494
-
2495
- // Encode Uint8Array data into string with utf-8.
2496
- const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
2497
- collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
2498
-
2499
- const isSerializableHeaderValue = (value: any): boolean =>
2500
- value !== undefined &&
2501
- value !== null &&
2502
- value !== "" &&
2503
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2504
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
2505
-
2506
- const parseBody = (streamBody: any, context: __SerdeContext): any =>
2507
- collectBodyString(streamBody, context).then((encoded) => {
2508
- if (encoded.length) {
2509
- return JSON.parse(encoded);
2510
- }
2511
- return {};
2512
- });
2513
-
2514
- /**
2515
- * Load an error code for the aws.rest-json-1.1 protocol.
2516
- */
2517
- const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
2518
- const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
2519
-
2520
- const sanitizeErrorCode = (rawValue: string): string => {
2521
- let cleanValue = rawValue;
2522
- if (cleanValue.indexOf(":") >= 0) {
2523
- cleanValue = cleanValue.split(":")[0];
2524
- }
2525
- if (cleanValue.indexOf("#") >= 0) {
2526
- cleanValue = cleanValue.split("#")[1];
2527
- }
2528
- return cleanValue;
2529
- };
2530
-
2531
- const headerKey = findKey(output.headers, "x-amzn-errortype");
2532
- if (headerKey !== undefined) {
2533
- return sanitizeErrorCode(output.headers[headerKey]);
2534
- }
2535
-
2536
- if (data.code !== undefined) {
2537
- return sanitizeErrorCode(data.code);
2538
- }
2539
-
2540
- if (data["__type"] !== undefined) {
2541
- return sanitizeErrorCode(data["__type"]);
2542
- }
2543
-
2544
- return "";
2545
- };