@aws-sdk/client-rolesanywhere 3.123.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +201 -0
  3. package/README.md +208 -0
  4. package/dist-cjs/RolesAnywhere.js +397 -0
  5. package/dist-cjs/RolesAnywhereClient.js +37 -0
  6. package/dist-cjs/commands/CreateProfileCommand.js +36 -0
  7. package/dist-cjs/commands/CreateTrustAnchorCommand.js +36 -0
  8. package/dist-cjs/commands/DeleteCrlCommand.js +36 -0
  9. package/dist-cjs/commands/DeleteProfileCommand.js +36 -0
  10. package/dist-cjs/commands/DeleteTrustAnchorCommand.js +36 -0
  11. package/dist-cjs/commands/DisableCrlCommand.js +36 -0
  12. package/dist-cjs/commands/DisableProfileCommand.js +36 -0
  13. package/dist-cjs/commands/DisableTrustAnchorCommand.js +36 -0
  14. package/dist-cjs/commands/EnableCrlCommand.js +36 -0
  15. package/dist-cjs/commands/EnableProfileCommand.js +36 -0
  16. package/dist-cjs/commands/EnableTrustAnchorCommand.js +36 -0
  17. package/dist-cjs/commands/GetCrlCommand.js +36 -0
  18. package/dist-cjs/commands/GetProfileCommand.js +36 -0
  19. package/dist-cjs/commands/GetSubjectCommand.js +36 -0
  20. package/dist-cjs/commands/GetTrustAnchorCommand.js +36 -0
  21. package/dist-cjs/commands/ImportCrlCommand.js +36 -0
  22. package/dist-cjs/commands/ListCrlsCommand.js +36 -0
  23. package/dist-cjs/commands/ListProfilesCommand.js +36 -0
  24. package/dist-cjs/commands/ListSubjectsCommand.js +36 -0
  25. package/dist-cjs/commands/ListTagsForResourceCommand.js +36 -0
  26. package/dist-cjs/commands/ListTrustAnchorsCommand.js +36 -0
  27. package/dist-cjs/commands/TagResourceCommand.js +36 -0
  28. package/dist-cjs/commands/UntagResourceCommand.js +36 -0
  29. package/dist-cjs/commands/UpdateCrlCommand.js +36 -0
  30. package/dist-cjs/commands/UpdateProfileCommand.js +36 -0
  31. package/dist-cjs/commands/UpdateTrustAnchorCommand.js +36 -0
  32. package/dist-cjs/commands/index.js +29 -0
  33. package/dist-cjs/endpoints.js +131 -0
  34. package/dist-cjs/index.js +11 -0
  35. package/dist-cjs/models/RolesAnywhereServiceException.js +11 -0
  36. package/dist-cjs/models/index.js +4 -0
  37. package/dist-cjs/models/models_0.js +301 -0
  38. package/dist-cjs/pagination/Interfaces.js +2 -0
  39. package/dist-cjs/pagination/ListCrlsPaginator.js +35 -0
  40. package/dist-cjs/pagination/ListProfilesPaginator.js +35 -0
  41. package/dist-cjs/pagination/ListSubjectsPaginator.js +35 -0
  42. package/dist-cjs/pagination/ListTrustAnchorsPaginator.js +35 -0
  43. package/dist-cjs/pagination/index.js +8 -0
  44. package/dist-cjs/protocols/Aws_restJson1.js +2195 -0
  45. package/dist-cjs/runtimeConfig.browser.js +45 -0
  46. package/dist-cjs/runtimeConfig.js +52 -0
  47. package/dist-cjs/runtimeConfig.native.js +16 -0
  48. package/dist-cjs/runtimeConfig.shared.js +17 -0
  49. package/dist-es/RolesAnywhere.js +400 -0
  50. package/dist-es/RolesAnywhereClient.js +39 -0
  51. package/dist-es/commands/CreateProfileCommand.js +39 -0
  52. package/dist-es/commands/CreateTrustAnchorCommand.js +39 -0
  53. package/dist-es/commands/DeleteCrlCommand.js +39 -0
  54. package/dist-es/commands/DeleteProfileCommand.js +39 -0
  55. package/dist-es/commands/DeleteTrustAnchorCommand.js +39 -0
  56. package/dist-es/commands/DisableCrlCommand.js +39 -0
  57. package/dist-es/commands/DisableProfileCommand.js +39 -0
  58. package/dist-es/commands/DisableTrustAnchorCommand.js +39 -0
  59. package/dist-es/commands/EnableCrlCommand.js +39 -0
  60. package/dist-es/commands/EnableProfileCommand.js +39 -0
  61. package/dist-es/commands/EnableTrustAnchorCommand.js +39 -0
  62. package/dist-es/commands/GetCrlCommand.js +39 -0
  63. package/dist-es/commands/GetProfileCommand.js +39 -0
  64. package/dist-es/commands/GetSubjectCommand.js +39 -0
  65. package/dist-es/commands/GetTrustAnchorCommand.js +39 -0
  66. package/dist-es/commands/ImportCrlCommand.js +39 -0
  67. package/dist-es/commands/ListCrlsCommand.js +39 -0
  68. package/dist-es/commands/ListProfilesCommand.js +39 -0
  69. package/dist-es/commands/ListSubjectsCommand.js +39 -0
  70. package/dist-es/commands/ListTagsForResourceCommand.js +39 -0
  71. package/dist-es/commands/ListTrustAnchorsCommand.js +39 -0
  72. package/dist-es/commands/TagResourceCommand.js +39 -0
  73. package/dist-es/commands/UntagResourceCommand.js +39 -0
  74. package/dist-es/commands/UpdateCrlCommand.js +39 -0
  75. package/dist-es/commands/UpdateProfileCommand.js +39 -0
  76. package/dist-es/commands/UpdateTrustAnchorCommand.js +39 -0
  77. package/dist-es/commands/index.js +26 -0
  78. package/dist-es/endpoints.js +127 -0
  79. package/dist-es/index.js +6 -0
  80. package/dist-es/models/RolesAnywhereServiceException.js +12 -0
  81. package/dist-es/models/index.js +1 -0
  82. package/dist-es/models/models_0.js +214 -0
  83. package/dist-es/pagination/Interfaces.js +1 -0
  84. package/dist-es/pagination/ListCrlsPaginator.js +74 -0
  85. package/dist-es/pagination/ListProfilesPaginator.js +74 -0
  86. package/dist-es/pagination/ListSubjectsPaginator.js +74 -0
  87. package/dist-es/pagination/ListTrustAnchorsPaginator.js +74 -0
  88. package/dist-es/pagination/index.js +5 -0
  89. package/dist-es/protocols/Aws_restJson1.js +2793 -0
  90. package/dist-es/runtimeConfig.browser.js +26 -0
  91. package/dist-es/runtimeConfig.js +30 -0
  92. package/dist-es/runtimeConfig.native.js +8 -0
  93. package/dist-es/runtimeConfig.shared.js +13 -0
  94. package/dist-types/RolesAnywhere.d.ts +296 -0
  95. package/dist-types/RolesAnywhereClient.d.ts +173 -0
  96. package/dist-types/commands/CreateProfileCommand.d.ts +39 -0
  97. package/dist-types/commands/CreateTrustAnchorCommand.d.ts +39 -0
  98. package/dist-types/commands/DeleteCrlCommand.d.ts +39 -0
  99. package/dist-types/commands/DeleteProfileCommand.d.ts +39 -0
  100. package/dist-types/commands/DeleteTrustAnchorCommand.d.ts +39 -0
  101. package/dist-types/commands/DisableCrlCommand.d.ts +39 -0
  102. package/dist-types/commands/DisableProfileCommand.d.ts +39 -0
  103. package/dist-types/commands/DisableTrustAnchorCommand.d.ts +39 -0
  104. package/dist-types/commands/EnableCrlCommand.d.ts +39 -0
  105. package/dist-types/commands/EnableProfileCommand.d.ts +39 -0
  106. package/dist-types/commands/EnableTrustAnchorCommand.d.ts +39 -0
  107. package/dist-types/commands/GetCrlCommand.d.ts +39 -0
  108. package/dist-types/commands/GetProfileCommand.d.ts +39 -0
  109. package/dist-types/commands/GetSubjectCommand.d.ts +39 -0
  110. package/dist-types/commands/GetTrustAnchorCommand.d.ts +39 -0
  111. package/dist-types/commands/ImportCrlCommand.d.ts +39 -0
  112. package/dist-types/commands/ListCrlsCommand.d.ts +39 -0
  113. package/dist-types/commands/ListProfilesCommand.d.ts +39 -0
  114. package/dist-types/commands/ListSubjectsCommand.d.ts +39 -0
  115. package/dist-types/commands/ListTagsForResourceCommand.d.ts +39 -0
  116. package/dist-types/commands/ListTrustAnchorsCommand.d.ts +39 -0
  117. package/dist-types/commands/TagResourceCommand.d.ts +39 -0
  118. package/dist-types/commands/UntagResourceCommand.d.ts +39 -0
  119. package/dist-types/commands/UpdateCrlCommand.d.ts +39 -0
  120. package/dist-types/commands/UpdateProfileCommand.d.ts +39 -0
  121. package/dist-types/commands/UpdateTrustAnchorCommand.d.ts +39 -0
  122. package/dist-types/commands/index.d.ts +26 -0
  123. package/dist-types/endpoints.d.ts +2 -0
  124. package/dist-types/index.d.ts +6 -0
  125. package/dist-types/models/RolesAnywhereServiceException.d.ts +10 -0
  126. package/dist-types/models/index.d.ts +1 -0
  127. package/dist-types/models/models_0.d.ts +823 -0
  128. package/dist-types/pagination/Interfaces.d.ts +6 -0
  129. package/dist-types/pagination/ListCrlsPaginator.d.ts +4 -0
  130. package/dist-types/pagination/ListProfilesPaginator.d.ts +4 -0
  131. package/dist-types/pagination/ListSubjectsPaginator.d.ts +4 -0
  132. package/dist-types/pagination/ListTrustAnchorsPaginator.d.ts +4 -0
  133. package/dist-types/pagination/index.d.ts +5 -0
  134. package/dist-types/protocols/Aws_restJson1.d.ts +80 -0
  135. package/dist-types/runtimeConfig.browser.d.ts +40 -0
  136. package/dist-types/runtimeConfig.d.ts +40 -0
  137. package/dist-types/runtimeConfig.native.d.ts +39 -0
  138. package/dist-types/runtimeConfig.shared.d.ts +13 -0
  139. package/dist-types/ts3.4/RolesAnywhere.d.ts +135 -0
  140. package/dist-types/ts3.4/RolesAnywhereClient.d.ts +99 -0
  141. package/dist-types/ts3.4/commands/CreateProfileCommand.d.ts +17 -0
  142. package/dist-types/ts3.4/commands/CreateTrustAnchorCommand.d.ts +17 -0
  143. package/dist-types/ts3.4/commands/DeleteCrlCommand.d.ts +17 -0
  144. package/dist-types/ts3.4/commands/DeleteProfileCommand.d.ts +17 -0
  145. package/dist-types/ts3.4/commands/DeleteTrustAnchorCommand.d.ts +17 -0
  146. package/dist-types/ts3.4/commands/DisableCrlCommand.d.ts +17 -0
  147. package/dist-types/ts3.4/commands/DisableProfileCommand.d.ts +17 -0
  148. package/dist-types/ts3.4/commands/DisableTrustAnchorCommand.d.ts +17 -0
  149. package/dist-types/ts3.4/commands/EnableCrlCommand.d.ts +17 -0
  150. package/dist-types/ts3.4/commands/EnableProfileCommand.d.ts +17 -0
  151. package/dist-types/ts3.4/commands/EnableTrustAnchorCommand.d.ts +17 -0
  152. package/dist-types/ts3.4/commands/GetCrlCommand.d.ts +17 -0
  153. package/dist-types/ts3.4/commands/GetProfileCommand.d.ts +17 -0
  154. package/dist-types/ts3.4/commands/GetSubjectCommand.d.ts +17 -0
  155. package/dist-types/ts3.4/commands/GetTrustAnchorCommand.d.ts +17 -0
  156. package/dist-types/ts3.4/commands/ImportCrlCommand.d.ts +17 -0
  157. package/dist-types/ts3.4/commands/ListCrlsCommand.d.ts +17 -0
  158. package/dist-types/ts3.4/commands/ListProfilesCommand.d.ts +17 -0
  159. package/dist-types/ts3.4/commands/ListSubjectsCommand.d.ts +17 -0
  160. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +17 -0
  161. package/dist-types/ts3.4/commands/ListTrustAnchorsCommand.d.ts +17 -0
  162. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +17 -0
  163. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +17 -0
  164. package/dist-types/ts3.4/commands/UpdateCrlCommand.d.ts +17 -0
  165. package/dist-types/ts3.4/commands/UpdateProfileCommand.d.ts +17 -0
  166. package/dist-types/ts3.4/commands/UpdateTrustAnchorCommand.d.ts +17 -0
  167. package/dist-types/ts3.4/commands/index.d.ts +26 -0
  168. package/dist-types/ts3.4/endpoints.d.ts +2 -0
  169. package/dist-types/ts3.4/index.d.ts +6 -0
  170. package/dist-types/ts3.4/models/RolesAnywhereServiceException.d.ts +6 -0
  171. package/dist-types/ts3.4/models/index.d.ts +1 -0
  172. package/dist-types/ts3.4/models/models_0.d.ts +498 -0
  173. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  174. package/dist-types/ts3.4/pagination/ListCrlsPaginator.d.ts +4 -0
  175. package/dist-types/ts3.4/pagination/ListProfilesPaginator.d.ts +4 -0
  176. package/dist-types/ts3.4/pagination/ListSubjectsPaginator.d.ts +4 -0
  177. package/dist-types/ts3.4/pagination/ListTrustAnchorsPaginator.d.ts +4 -0
  178. package/dist-types/ts3.4/pagination/index.d.ts +5 -0
  179. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +80 -0
  180. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +38 -0
  181. package/dist-types/ts3.4/runtimeConfig.d.ts +38 -0
  182. package/dist-types/ts3.4/runtimeConfig.native.d.ts +37 -0
  183. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +11 -0
  184. package/package.json +94 -0
@@ -0,0 +1,2195 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deserializeAws_restJson1UpdateCrlCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1ListTrustAnchorsCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListSubjectsCommand = exports.deserializeAws_restJson1ListProfilesCommand = exports.deserializeAws_restJson1ListCrlsCommand = exports.deserializeAws_restJson1ImportCrlCommand = exports.deserializeAws_restJson1GetTrustAnchorCommand = exports.deserializeAws_restJson1GetSubjectCommand = exports.deserializeAws_restJson1GetProfileCommand = exports.deserializeAws_restJson1GetCrlCommand = exports.deserializeAws_restJson1EnableTrustAnchorCommand = exports.deserializeAws_restJson1EnableProfileCommand = exports.deserializeAws_restJson1EnableCrlCommand = exports.deserializeAws_restJson1DisableTrustAnchorCommand = exports.deserializeAws_restJson1DisableProfileCommand = exports.deserializeAws_restJson1DisableCrlCommand = exports.deserializeAws_restJson1DeleteTrustAnchorCommand = exports.deserializeAws_restJson1DeleteProfileCommand = exports.deserializeAws_restJson1DeleteCrlCommand = exports.deserializeAws_restJson1CreateTrustAnchorCommand = exports.deserializeAws_restJson1CreateProfileCommand = exports.serializeAws_restJson1UpdateTrustAnchorCommand = exports.serializeAws_restJson1UpdateProfileCommand = exports.serializeAws_restJson1UpdateCrlCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1ListTrustAnchorsCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListSubjectsCommand = exports.serializeAws_restJson1ListProfilesCommand = exports.serializeAws_restJson1ListCrlsCommand = exports.serializeAws_restJson1ImportCrlCommand = exports.serializeAws_restJson1GetTrustAnchorCommand = exports.serializeAws_restJson1GetSubjectCommand = exports.serializeAws_restJson1GetProfileCommand = exports.serializeAws_restJson1GetCrlCommand = exports.serializeAws_restJson1EnableTrustAnchorCommand = exports.serializeAws_restJson1EnableProfileCommand = exports.serializeAws_restJson1EnableCrlCommand = exports.serializeAws_restJson1DisableTrustAnchorCommand = exports.serializeAws_restJson1DisableProfileCommand = exports.serializeAws_restJson1DisableCrlCommand = exports.serializeAws_restJson1DeleteTrustAnchorCommand = exports.serializeAws_restJson1DeleteProfileCommand = exports.serializeAws_restJson1DeleteCrlCommand = exports.serializeAws_restJson1CreateTrustAnchorCommand = exports.serializeAws_restJson1CreateProfileCommand = void 0;
4
+ exports.deserializeAws_restJson1UpdateTrustAnchorCommand = exports.deserializeAws_restJson1UpdateProfileCommand = void 0;
5
+ const protocol_http_1 = require("@aws-sdk/protocol-http");
6
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
7
+ const models_0_1 = require("../models/models_0");
8
+ const RolesAnywhereServiceException_1 = require("../models/RolesAnywhereServiceException");
9
+ const serializeAws_restJson1CreateProfileCommand = async (input, context) => {
10
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
11
+ const headers = {
12
+ "content-type": "application/json",
13
+ };
14
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/profiles";
15
+ let body;
16
+ body = JSON.stringify({
17
+ ...(input.durationSeconds !== undefined &&
18
+ input.durationSeconds !== null && { durationSeconds: input.durationSeconds }),
19
+ ...(input.enabled !== undefined && input.enabled !== null && { enabled: input.enabled }),
20
+ ...(input.managedPolicyArns !== undefined &&
21
+ input.managedPolicyArns !== null && {
22
+ managedPolicyArns: serializeAws_restJson1ManagedPolicyList(input.managedPolicyArns, context),
23
+ }),
24
+ ...(input.name !== undefined && input.name !== null && { name: input.name }),
25
+ ...(input.requireInstanceProperties !== undefined &&
26
+ input.requireInstanceProperties !== null && { requireInstanceProperties: input.requireInstanceProperties }),
27
+ ...(input.roleArns !== undefined &&
28
+ input.roleArns !== null && { roleArns: serializeAws_restJson1RoleArnList(input.roleArns, context) }),
29
+ ...(input.sessionPolicy !== undefined && input.sessionPolicy !== null && { sessionPolicy: input.sessionPolicy }),
30
+ ...(input.tags !== undefined &&
31
+ input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }),
32
+ });
33
+ return new protocol_http_1.HttpRequest({
34
+ protocol,
35
+ hostname,
36
+ port,
37
+ method: "POST",
38
+ headers,
39
+ path: resolvedPath,
40
+ body,
41
+ });
42
+ };
43
+ exports.serializeAws_restJson1CreateProfileCommand = serializeAws_restJson1CreateProfileCommand;
44
+ const serializeAws_restJson1CreateTrustAnchorCommand = async (input, context) => {
45
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
46
+ const headers = {
47
+ "content-type": "application/json",
48
+ };
49
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/trustanchors";
50
+ let body;
51
+ body = JSON.stringify({
52
+ ...(input.enabled !== undefined && input.enabled !== null && { enabled: input.enabled }),
53
+ ...(input.name !== undefined && input.name !== null && { name: input.name }),
54
+ ...(input.source !== undefined &&
55
+ input.source !== null && { source: serializeAws_restJson1Source(input.source, context) }),
56
+ ...(input.tags !== undefined &&
57
+ input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }),
58
+ });
59
+ return new protocol_http_1.HttpRequest({
60
+ protocol,
61
+ hostname,
62
+ port,
63
+ method: "POST",
64
+ headers,
65
+ path: resolvedPath,
66
+ body,
67
+ });
68
+ };
69
+ exports.serializeAws_restJson1CreateTrustAnchorCommand = serializeAws_restJson1CreateTrustAnchorCommand;
70
+ const serializeAws_restJson1DeleteCrlCommand = async (input, context) => {
71
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
72
+ const headers = {};
73
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/crl/{crlId}";
74
+ if (input.crlId !== undefined) {
75
+ const labelValue = input.crlId;
76
+ if (labelValue.length <= 0) {
77
+ throw new Error("Empty value provided for input HTTP label: crlId.");
78
+ }
79
+ resolvedPath = resolvedPath.replace("{crlId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
80
+ }
81
+ else {
82
+ throw new Error("No value provided for input HTTP label: crlId.");
83
+ }
84
+ let body;
85
+ return new protocol_http_1.HttpRequest({
86
+ protocol,
87
+ hostname,
88
+ port,
89
+ method: "DELETE",
90
+ headers,
91
+ path: resolvedPath,
92
+ body,
93
+ });
94
+ };
95
+ exports.serializeAws_restJson1DeleteCrlCommand = serializeAws_restJson1DeleteCrlCommand;
96
+ const serializeAws_restJson1DeleteProfileCommand = async (input, context) => {
97
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
98
+ const headers = {};
99
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/profile/{profileId}";
100
+ if (input.profileId !== undefined) {
101
+ const labelValue = input.profileId;
102
+ if (labelValue.length <= 0) {
103
+ throw new Error("Empty value provided for input HTTP label: profileId.");
104
+ }
105
+ resolvedPath = resolvedPath.replace("{profileId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
106
+ }
107
+ else {
108
+ throw new Error("No value provided for input HTTP label: profileId.");
109
+ }
110
+ let body;
111
+ return new protocol_http_1.HttpRequest({
112
+ protocol,
113
+ hostname,
114
+ port,
115
+ method: "DELETE",
116
+ headers,
117
+ path: resolvedPath,
118
+ body,
119
+ });
120
+ };
121
+ exports.serializeAws_restJson1DeleteProfileCommand = serializeAws_restJson1DeleteProfileCommand;
122
+ const serializeAws_restJson1DeleteTrustAnchorCommand = async (input, context) => {
123
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
124
+ const headers = {};
125
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/trustanchor/{trustAnchorId}";
126
+ if (input.trustAnchorId !== undefined) {
127
+ const labelValue = input.trustAnchorId;
128
+ if (labelValue.length <= 0) {
129
+ throw new Error("Empty value provided for input HTTP label: trustAnchorId.");
130
+ }
131
+ resolvedPath = resolvedPath.replace("{trustAnchorId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
132
+ }
133
+ else {
134
+ throw new Error("No value provided for input HTTP label: trustAnchorId.");
135
+ }
136
+ let body;
137
+ return new protocol_http_1.HttpRequest({
138
+ protocol,
139
+ hostname,
140
+ port,
141
+ method: "DELETE",
142
+ headers,
143
+ path: resolvedPath,
144
+ body,
145
+ });
146
+ };
147
+ exports.serializeAws_restJson1DeleteTrustAnchorCommand = serializeAws_restJson1DeleteTrustAnchorCommand;
148
+ const serializeAws_restJson1DisableCrlCommand = async (input, context) => {
149
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
150
+ const headers = {};
151
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/crl/{crlId}/disable";
152
+ if (input.crlId !== undefined) {
153
+ const labelValue = input.crlId;
154
+ if (labelValue.length <= 0) {
155
+ throw new Error("Empty value provided for input HTTP label: crlId.");
156
+ }
157
+ resolvedPath = resolvedPath.replace("{crlId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
158
+ }
159
+ else {
160
+ throw new Error("No value provided for input HTTP label: crlId.");
161
+ }
162
+ let body;
163
+ return new protocol_http_1.HttpRequest({
164
+ protocol,
165
+ hostname,
166
+ port,
167
+ method: "POST",
168
+ headers,
169
+ path: resolvedPath,
170
+ body,
171
+ });
172
+ };
173
+ exports.serializeAws_restJson1DisableCrlCommand = serializeAws_restJson1DisableCrlCommand;
174
+ const serializeAws_restJson1DisableProfileCommand = async (input, context) => {
175
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
176
+ const headers = {};
177
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/profile/{profileId}/disable";
178
+ if (input.profileId !== undefined) {
179
+ const labelValue = input.profileId;
180
+ if (labelValue.length <= 0) {
181
+ throw new Error("Empty value provided for input HTTP label: profileId.");
182
+ }
183
+ resolvedPath = resolvedPath.replace("{profileId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
184
+ }
185
+ else {
186
+ throw new Error("No value provided for input HTTP label: profileId.");
187
+ }
188
+ let body;
189
+ return new protocol_http_1.HttpRequest({
190
+ protocol,
191
+ hostname,
192
+ port,
193
+ method: "POST",
194
+ headers,
195
+ path: resolvedPath,
196
+ body,
197
+ });
198
+ };
199
+ exports.serializeAws_restJson1DisableProfileCommand = serializeAws_restJson1DisableProfileCommand;
200
+ const serializeAws_restJson1DisableTrustAnchorCommand = async (input, context) => {
201
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
202
+ const headers = {};
203
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/trustanchor/{trustAnchorId}/disable";
204
+ if (input.trustAnchorId !== undefined) {
205
+ const labelValue = input.trustAnchorId;
206
+ if (labelValue.length <= 0) {
207
+ throw new Error("Empty value provided for input HTTP label: trustAnchorId.");
208
+ }
209
+ resolvedPath = resolvedPath.replace("{trustAnchorId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
210
+ }
211
+ else {
212
+ throw new Error("No value provided for input HTTP label: trustAnchorId.");
213
+ }
214
+ let body;
215
+ return new protocol_http_1.HttpRequest({
216
+ protocol,
217
+ hostname,
218
+ port,
219
+ method: "POST",
220
+ headers,
221
+ path: resolvedPath,
222
+ body,
223
+ });
224
+ };
225
+ exports.serializeAws_restJson1DisableTrustAnchorCommand = serializeAws_restJson1DisableTrustAnchorCommand;
226
+ const serializeAws_restJson1EnableCrlCommand = async (input, context) => {
227
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
228
+ const headers = {};
229
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/crl/{crlId}/enable";
230
+ if (input.crlId !== undefined) {
231
+ const labelValue = input.crlId;
232
+ if (labelValue.length <= 0) {
233
+ throw new Error("Empty value provided for input HTTP label: crlId.");
234
+ }
235
+ resolvedPath = resolvedPath.replace("{crlId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
236
+ }
237
+ else {
238
+ throw new Error("No value provided for input HTTP label: crlId.");
239
+ }
240
+ let body;
241
+ return new protocol_http_1.HttpRequest({
242
+ protocol,
243
+ hostname,
244
+ port,
245
+ method: "POST",
246
+ headers,
247
+ path: resolvedPath,
248
+ body,
249
+ });
250
+ };
251
+ exports.serializeAws_restJson1EnableCrlCommand = serializeAws_restJson1EnableCrlCommand;
252
+ const serializeAws_restJson1EnableProfileCommand = async (input, context) => {
253
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
254
+ const headers = {};
255
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/profile/{profileId}/enable";
256
+ if (input.profileId !== undefined) {
257
+ const labelValue = input.profileId;
258
+ if (labelValue.length <= 0) {
259
+ throw new Error("Empty value provided for input HTTP label: profileId.");
260
+ }
261
+ resolvedPath = resolvedPath.replace("{profileId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
262
+ }
263
+ else {
264
+ throw new Error("No value provided for input HTTP label: profileId.");
265
+ }
266
+ let body;
267
+ return new protocol_http_1.HttpRequest({
268
+ protocol,
269
+ hostname,
270
+ port,
271
+ method: "POST",
272
+ headers,
273
+ path: resolvedPath,
274
+ body,
275
+ });
276
+ };
277
+ exports.serializeAws_restJson1EnableProfileCommand = serializeAws_restJson1EnableProfileCommand;
278
+ const serializeAws_restJson1EnableTrustAnchorCommand = async (input, context) => {
279
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
280
+ const headers = {};
281
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/trustanchor/{trustAnchorId}/enable";
282
+ if (input.trustAnchorId !== undefined) {
283
+ const labelValue = input.trustAnchorId;
284
+ if (labelValue.length <= 0) {
285
+ throw new Error("Empty value provided for input HTTP label: trustAnchorId.");
286
+ }
287
+ resolvedPath = resolvedPath.replace("{trustAnchorId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
288
+ }
289
+ else {
290
+ throw new Error("No value provided for input HTTP label: trustAnchorId.");
291
+ }
292
+ let body;
293
+ return new protocol_http_1.HttpRequest({
294
+ protocol,
295
+ hostname,
296
+ port,
297
+ method: "POST",
298
+ headers,
299
+ path: resolvedPath,
300
+ body,
301
+ });
302
+ };
303
+ exports.serializeAws_restJson1EnableTrustAnchorCommand = serializeAws_restJson1EnableTrustAnchorCommand;
304
+ const serializeAws_restJson1GetCrlCommand = async (input, context) => {
305
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
306
+ const headers = {};
307
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/crl/{crlId}";
308
+ if (input.crlId !== undefined) {
309
+ const labelValue = input.crlId;
310
+ if (labelValue.length <= 0) {
311
+ throw new Error("Empty value provided for input HTTP label: crlId.");
312
+ }
313
+ resolvedPath = resolvedPath.replace("{crlId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
314
+ }
315
+ else {
316
+ throw new Error("No value provided for input HTTP label: crlId.");
317
+ }
318
+ let body;
319
+ return new protocol_http_1.HttpRequest({
320
+ protocol,
321
+ hostname,
322
+ port,
323
+ method: "GET",
324
+ headers,
325
+ path: resolvedPath,
326
+ body,
327
+ });
328
+ };
329
+ exports.serializeAws_restJson1GetCrlCommand = serializeAws_restJson1GetCrlCommand;
330
+ const serializeAws_restJson1GetProfileCommand = async (input, context) => {
331
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
332
+ const headers = {};
333
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/profile/{profileId}";
334
+ if (input.profileId !== undefined) {
335
+ const labelValue = input.profileId;
336
+ if (labelValue.length <= 0) {
337
+ throw new Error("Empty value provided for input HTTP label: profileId.");
338
+ }
339
+ resolvedPath = resolvedPath.replace("{profileId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
340
+ }
341
+ else {
342
+ throw new Error("No value provided for input HTTP label: profileId.");
343
+ }
344
+ let body;
345
+ return new protocol_http_1.HttpRequest({
346
+ protocol,
347
+ hostname,
348
+ port,
349
+ method: "GET",
350
+ headers,
351
+ path: resolvedPath,
352
+ body,
353
+ });
354
+ };
355
+ exports.serializeAws_restJson1GetProfileCommand = serializeAws_restJson1GetProfileCommand;
356
+ const serializeAws_restJson1GetSubjectCommand = async (input, context) => {
357
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
358
+ const headers = {};
359
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/subject/{subjectId}";
360
+ if (input.subjectId !== undefined) {
361
+ const labelValue = input.subjectId;
362
+ if (labelValue.length <= 0) {
363
+ throw new Error("Empty value provided for input HTTP label: subjectId.");
364
+ }
365
+ resolvedPath = resolvedPath.replace("{subjectId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
366
+ }
367
+ else {
368
+ throw new Error("No value provided for input HTTP label: subjectId.");
369
+ }
370
+ let body;
371
+ return new protocol_http_1.HttpRequest({
372
+ protocol,
373
+ hostname,
374
+ port,
375
+ method: "GET",
376
+ headers,
377
+ path: resolvedPath,
378
+ body,
379
+ });
380
+ };
381
+ exports.serializeAws_restJson1GetSubjectCommand = serializeAws_restJson1GetSubjectCommand;
382
+ const serializeAws_restJson1GetTrustAnchorCommand = async (input, context) => {
383
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
384
+ const headers = {};
385
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/trustanchor/{trustAnchorId}";
386
+ if (input.trustAnchorId !== undefined) {
387
+ const labelValue = input.trustAnchorId;
388
+ if (labelValue.length <= 0) {
389
+ throw new Error("Empty value provided for input HTTP label: trustAnchorId.");
390
+ }
391
+ resolvedPath = resolvedPath.replace("{trustAnchorId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
392
+ }
393
+ else {
394
+ throw new Error("No value provided for input HTTP label: trustAnchorId.");
395
+ }
396
+ let body;
397
+ return new protocol_http_1.HttpRequest({
398
+ protocol,
399
+ hostname,
400
+ port,
401
+ method: "GET",
402
+ headers,
403
+ path: resolvedPath,
404
+ body,
405
+ });
406
+ };
407
+ exports.serializeAws_restJson1GetTrustAnchorCommand = serializeAws_restJson1GetTrustAnchorCommand;
408
+ const serializeAws_restJson1ImportCrlCommand = async (input, context) => {
409
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
410
+ const headers = {
411
+ "content-type": "application/json",
412
+ };
413
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/crls";
414
+ let body;
415
+ body = JSON.stringify({
416
+ ...(input.crlData !== undefined && input.crlData !== null && { crlData: context.base64Encoder(input.crlData) }),
417
+ ...(input.enabled !== undefined && input.enabled !== null && { enabled: input.enabled }),
418
+ ...(input.name !== undefined && input.name !== null && { name: input.name }),
419
+ ...(input.tags !== undefined &&
420
+ input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }),
421
+ ...(input.trustAnchorArn !== undefined &&
422
+ input.trustAnchorArn !== null && { trustAnchorArn: input.trustAnchorArn }),
423
+ });
424
+ return new protocol_http_1.HttpRequest({
425
+ protocol,
426
+ hostname,
427
+ port,
428
+ method: "POST",
429
+ headers,
430
+ path: resolvedPath,
431
+ body,
432
+ });
433
+ };
434
+ exports.serializeAws_restJson1ImportCrlCommand = serializeAws_restJson1ImportCrlCommand;
435
+ const serializeAws_restJson1ListCrlsCommand = async (input, context) => {
436
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
437
+ const headers = {};
438
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/crls";
439
+ const query = {
440
+ ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
441
+ ...(input.pageSize !== undefined && { pageSize: input.pageSize.toString() }),
442
+ };
443
+ let body;
444
+ return new protocol_http_1.HttpRequest({
445
+ protocol,
446
+ hostname,
447
+ port,
448
+ method: "GET",
449
+ headers,
450
+ path: resolvedPath,
451
+ query,
452
+ body,
453
+ });
454
+ };
455
+ exports.serializeAws_restJson1ListCrlsCommand = serializeAws_restJson1ListCrlsCommand;
456
+ const serializeAws_restJson1ListProfilesCommand = async (input, context) => {
457
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
458
+ const headers = {};
459
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/profiles";
460
+ const query = {
461
+ ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
462
+ ...(input.pageSize !== undefined && { pageSize: input.pageSize.toString() }),
463
+ };
464
+ let body;
465
+ return new protocol_http_1.HttpRequest({
466
+ protocol,
467
+ hostname,
468
+ port,
469
+ method: "GET",
470
+ headers,
471
+ path: resolvedPath,
472
+ query,
473
+ body,
474
+ });
475
+ };
476
+ exports.serializeAws_restJson1ListProfilesCommand = serializeAws_restJson1ListProfilesCommand;
477
+ const serializeAws_restJson1ListSubjectsCommand = async (input, context) => {
478
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
479
+ const headers = {};
480
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/subjects";
481
+ const query = {
482
+ ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
483
+ ...(input.pageSize !== undefined && { pageSize: input.pageSize.toString() }),
484
+ };
485
+ let body;
486
+ return new protocol_http_1.HttpRequest({
487
+ protocol,
488
+ hostname,
489
+ port,
490
+ method: "GET",
491
+ headers,
492
+ path: resolvedPath,
493
+ query,
494
+ body,
495
+ });
496
+ };
497
+ exports.serializeAws_restJson1ListSubjectsCommand = serializeAws_restJson1ListSubjectsCommand;
498
+ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
499
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
500
+ const headers = {};
501
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/ListTagsForResource";
502
+ const query = {
503
+ ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }),
504
+ };
505
+ let body;
506
+ return new protocol_http_1.HttpRequest({
507
+ protocol,
508
+ hostname,
509
+ port,
510
+ method: "GET",
511
+ headers,
512
+ path: resolvedPath,
513
+ query,
514
+ body,
515
+ });
516
+ };
517
+ exports.serializeAws_restJson1ListTagsForResourceCommand = serializeAws_restJson1ListTagsForResourceCommand;
518
+ const serializeAws_restJson1ListTrustAnchorsCommand = async (input, context) => {
519
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
520
+ const headers = {};
521
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/trustanchors";
522
+ const query = {
523
+ ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
524
+ ...(input.pageSize !== undefined && { pageSize: input.pageSize.toString() }),
525
+ };
526
+ let body;
527
+ return new protocol_http_1.HttpRequest({
528
+ protocol,
529
+ hostname,
530
+ port,
531
+ method: "GET",
532
+ headers,
533
+ path: resolvedPath,
534
+ query,
535
+ body,
536
+ });
537
+ };
538
+ exports.serializeAws_restJson1ListTrustAnchorsCommand = serializeAws_restJson1ListTrustAnchorsCommand;
539
+ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
540
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
541
+ const headers = {
542
+ "content-type": "application/json",
543
+ };
544
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/TagResource";
545
+ let body;
546
+ body = JSON.stringify({
547
+ ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }),
548
+ ...(input.tags !== undefined &&
549
+ input.tags !== null && { tags: serializeAws_restJson1TagList(input.tags, context) }),
550
+ });
551
+ return new protocol_http_1.HttpRequest({
552
+ protocol,
553
+ hostname,
554
+ port,
555
+ method: "POST",
556
+ headers,
557
+ path: resolvedPath,
558
+ body,
559
+ });
560
+ };
561
+ exports.serializeAws_restJson1TagResourceCommand = serializeAws_restJson1TagResourceCommand;
562
+ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
563
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
564
+ const headers = {
565
+ "content-type": "application/json",
566
+ };
567
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/UntagResource";
568
+ let body;
569
+ body = JSON.stringify({
570
+ ...(input.resourceArn !== undefined && input.resourceArn !== null && { resourceArn: input.resourceArn }),
571
+ ...(input.tagKeys !== undefined &&
572
+ input.tagKeys !== null && { tagKeys: serializeAws_restJson1TagKeyList(input.tagKeys, context) }),
573
+ });
574
+ return new protocol_http_1.HttpRequest({
575
+ protocol,
576
+ hostname,
577
+ port,
578
+ method: "POST",
579
+ headers,
580
+ path: resolvedPath,
581
+ body,
582
+ });
583
+ };
584
+ exports.serializeAws_restJson1UntagResourceCommand = serializeAws_restJson1UntagResourceCommand;
585
+ const serializeAws_restJson1UpdateCrlCommand = async (input, context) => {
586
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
587
+ const headers = {
588
+ "content-type": "application/json",
589
+ };
590
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/crl/{crlId}";
591
+ if (input.crlId !== undefined) {
592
+ const labelValue = input.crlId;
593
+ if (labelValue.length <= 0) {
594
+ throw new Error("Empty value provided for input HTTP label: crlId.");
595
+ }
596
+ resolvedPath = resolvedPath.replace("{crlId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
597
+ }
598
+ else {
599
+ throw new Error("No value provided for input HTTP label: crlId.");
600
+ }
601
+ let body;
602
+ body = JSON.stringify({
603
+ ...(input.crlData !== undefined && input.crlData !== null && { crlData: context.base64Encoder(input.crlData) }),
604
+ ...(input.name !== undefined && input.name !== null && { name: input.name }),
605
+ });
606
+ return new protocol_http_1.HttpRequest({
607
+ protocol,
608
+ hostname,
609
+ port,
610
+ method: "PATCH",
611
+ headers,
612
+ path: resolvedPath,
613
+ body,
614
+ });
615
+ };
616
+ exports.serializeAws_restJson1UpdateCrlCommand = serializeAws_restJson1UpdateCrlCommand;
617
+ const serializeAws_restJson1UpdateProfileCommand = async (input, context) => {
618
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
619
+ const headers = {
620
+ "content-type": "application/json",
621
+ };
622
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/profile/{profileId}";
623
+ if (input.profileId !== undefined) {
624
+ const labelValue = input.profileId;
625
+ if (labelValue.length <= 0) {
626
+ throw new Error("Empty value provided for input HTTP label: profileId.");
627
+ }
628
+ resolvedPath = resolvedPath.replace("{profileId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
629
+ }
630
+ else {
631
+ throw new Error("No value provided for input HTTP label: profileId.");
632
+ }
633
+ let body;
634
+ body = JSON.stringify({
635
+ ...(input.durationSeconds !== undefined &&
636
+ input.durationSeconds !== null && { durationSeconds: input.durationSeconds }),
637
+ ...(input.managedPolicyArns !== undefined &&
638
+ input.managedPolicyArns !== null && {
639
+ managedPolicyArns: serializeAws_restJson1ManagedPolicyList(input.managedPolicyArns, context),
640
+ }),
641
+ ...(input.name !== undefined && input.name !== null && { name: input.name }),
642
+ ...(input.roleArns !== undefined &&
643
+ input.roleArns !== null && { roleArns: serializeAws_restJson1RoleArnList(input.roleArns, context) }),
644
+ ...(input.sessionPolicy !== undefined && input.sessionPolicy !== null && { sessionPolicy: input.sessionPolicy }),
645
+ });
646
+ return new protocol_http_1.HttpRequest({
647
+ protocol,
648
+ hostname,
649
+ port,
650
+ method: "PATCH",
651
+ headers,
652
+ path: resolvedPath,
653
+ body,
654
+ });
655
+ };
656
+ exports.serializeAws_restJson1UpdateProfileCommand = serializeAws_restJson1UpdateProfileCommand;
657
+ const serializeAws_restJson1UpdateTrustAnchorCommand = async (input, context) => {
658
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
659
+ const headers = {
660
+ "content-type": "application/json",
661
+ };
662
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/trustanchor/{trustAnchorId}";
663
+ if (input.trustAnchorId !== undefined) {
664
+ const labelValue = input.trustAnchorId;
665
+ if (labelValue.length <= 0) {
666
+ throw new Error("Empty value provided for input HTTP label: trustAnchorId.");
667
+ }
668
+ resolvedPath = resolvedPath.replace("{trustAnchorId}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
669
+ }
670
+ else {
671
+ throw new Error("No value provided for input HTTP label: trustAnchorId.");
672
+ }
673
+ let body;
674
+ body = JSON.stringify({
675
+ ...(input.name !== undefined && input.name !== null && { name: input.name }),
676
+ ...(input.source !== undefined &&
677
+ input.source !== null && { source: serializeAws_restJson1Source(input.source, context) }),
678
+ });
679
+ return new protocol_http_1.HttpRequest({
680
+ protocol,
681
+ hostname,
682
+ port,
683
+ method: "PATCH",
684
+ headers,
685
+ path: resolvedPath,
686
+ body,
687
+ });
688
+ };
689
+ exports.serializeAws_restJson1UpdateTrustAnchorCommand = serializeAws_restJson1UpdateTrustAnchorCommand;
690
+ const deserializeAws_restJson1CreateProfileCommand = async (output, context) => {
691
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
692
+ return deserializeAws_restJson1CreateProfileCommandError(output, context);
693
+ }
694
+ const contents = {
695
+ $metadata: deserializeMetadata(output),
696
+ profile: undefined,
697
+ };
698
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
699
+ if (data.profile !== undefined && data.profile !== null) {
700
+ contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
701
+ }
702
+ return Promise.resolve(contents);
703
+ };
704
+ exports.deserializeAws_restJson1CreateProfileCommand = deserializeAws_restJson1CreateProfileCommand;
705
+ const deserializeAws_restJson1CreateProfileCommandError = async (output, context) => {
706
+ const parsedOutput = {
707
+ ...output,
708
+ body: await parseBody(output.body, context),
709
+ };
710
+ let response;
711
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
712
+ switch (errorCode) {
713
+ case "AccessDeniedException":
714
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
715
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
716
+ case "ValidationException":
717
+ case "com.amazonaws.rolesanywhere#ValidationException":
718
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
719
+ default:
720
+ const parsedBody = parsedOutput.body;
721
+ const $metadata = deserializeMetadata(output);
722
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
723
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
724
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
725
+ $fault: "client",
726
+ $metadata,
727
+ });
728
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
729
+ }
730
+ };
731
+ const deserializeAws_restJson1CreateTrustAnchorCommand = async (output, context) => {
732
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
733
+ return deserializeAws_restJson1CreateTrustAnchorCommandError(output, context);
734
+ }
735
+ const contents = {
736
+ $metadata: deserializeMetadata(output),
737
+ trustAnchor: undefined,
738
+ };
739
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
740
+ if (data.trustAnchor !== undefined && data.trustAnchor !== null) {
741
+ contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
742
+ }
743
+ return Promise.resolve(contents);
744
+ };
745
+ exports.deserializeAws_restJson1CreateTrustAnchorCommand = deserializeAws_restJson1CreateTrustAnchorCommand;
746
+ const deserializeAws_restJson1CreateTrustAnchorCommandError = async (output, context) => {
747
+ const parsedOutput = {
748
+ ...output,
749
+ body: await parseBody(output.body, context),
750
+ };
751
+ let response;
752
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
753
+ switch (errorCode) {
754
+ case "AccessDeniedException":
755
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
756
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
757
+ case "ValidationException":
758
+ case "com.amazonaws.rolesanywhere#ValidationException":
759
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
760
+ default:
761
+ const parsedBody = parsedOutput.body;
762
+ const $metadata = deserializeMetadata(output);
763
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
764
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
765
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
766
+ $fault: "client",
767
+ $metadata,
768
+ });
769
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
770
+ }
771
+ };
772
+ const deserializeAws_restJson1DeleteCrlCommand = async (output, context) => {
773
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
774
+ return deserializeAws_restJson1DeleteCrlCommandError(output, context);
775
+ }
776
+ const contents = {
777
+ $metadata: deserializeMetadata(output),
778
+ crl: undefined,
779
+ };
780
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
781
+ if (data.crl !== undefined && data.crl !== null) {
782
+ contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
783
+ }
784
+ return Promise.resolve(contents);
785
+ };
786
+ exports.deserializeAws_restJson1DeleteCrlCommand = deserializeAws_restJson1DeleteCrlCommand;
787
+ const deserializeAws_restJson1DeleteCrlCommandError = async (output, context) => {
788
+ const parsedOutput = {
789
+ ...output,
790
+ body: await parseBody(output.body, context),
791
+ };
792
+ let response;
793
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
794
+ switch (errorCode) {
795
+ case "AccessDeniedException":
796
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
797
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
798
+ case "ResourceNotFoundException":
799
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
800
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
801
+ default:
802
+ const parsedBody = parsedOutput.body;
803
+ const $metadata = deserializeMetadata(output);
804
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
805
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
806
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
807
+ $fault: "client",
808
+ $metadata,
809
+ });
810
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
811
+ }
812
+ };
813
+ const deserializeAws_restJson1DeleteProfileCommand = async (output, context) => {
814
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
815
+ return deserializeAws_restJson1DeleteProfileCommandError(output, context);
816
+ }
817
+ const contents = {
818
+ $metadata: deserializeMetadata(output),
819
+ profile: undefined,
820
+ };
821
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
822
+ if (data.profile !== undefined && data.profile !== null) {
823
+ contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
824
+ }
825
+ return Promise.resolve(contents);
826
+ };
827
+ exports.deserializeAws_restJson1DeleteProfileCommand = deserializeAws_restJson1DeleteProfileCommand;
828
+ const deserializeAws_restJson1DeleteProfileCommandError = async (output, context) => {
829
+ const parsedOutput = {
830
+ ...output,
831
+ body: await parseBody(output.body, context),
832
+ };
833
+ let response;
834
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
835
+ switch (errorCode) {
836
+ case "AccessDeniedException":
837
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
838
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
839
+ case "ResourceNotFoundException":
840
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
841
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
842
+ default:
843
+ const parsedBody = parsedOutput.body;
844
+ const $metadata = deserializeMetadata(output);
845
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
846
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
847
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
848
+ $fault: "client",
849
+ $metadata,
850
+ });
851
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
852
+ }
853
+ };
854
+ const deserializeAws_restJson1DeleteTrustAnchorCommand = async (output, context) => {
855
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
856
+ return deserializeAws_restJson1DeleteTrustAnchorCommandError(output, context);
857
+ }
858
+ const contents = {
859
+ $metadata: deserializeMetadata(output),
860
+ trustAnchor: undefined,
861
+ };
862
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
863
+ if (data.trustAnchor !== undefined && data.trustAnchor !== null) {
864
+ contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
865
+ }
866
+ return Promise.resolve(contents);
867
+ };
868
+ exports.deserializeAws_restJson1DeleteTrustAnchorCommand = deserializeAws_restJson1DeleteTrustAnchorCommand;
869
+ const deserializeAws_restJson1DeleteTrustAnchorCommandError = async (output, context) => {
870
+ const parsedOutput = {
871
+ ...output,
872
+ body: await parseBody(output.body, context),
873
+ };
874
+ let response;
875
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
876
+ switch (errorCode) {
877
+ case "AccessDeniedException":
878
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
879
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
880
+ case "ResourceNotFoundException":
881
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
882
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
883
+ default:
884
+ const parsedBody = parsedOutput.body;
885
+ const $metadata = deserializeMetadata(output);
886
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
887
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
888
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
889
+ $fault: "client",
890
+ $metadata,
891
+ });
892
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
893
+ }
894
+ };
895
+ const deserializeAws_restJson1DisableCrlCommand = async (output, context) => {
896
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
897
+ return deserializeAws_restJson1DisableCrlCommandError(output, context);
898
+ }
899
+ const contents = {
900
+ $metadata: deserializeMetadata(output),
901
+ crl: undefined,
902
+ };
903
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
904
+ if (data.crl !== undefined && data.crl !== null) {
905
+ contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
906
+ }
907
+ return Promise.resolve(contents);
908
+ };
909
+ exports.deserializeAws_restJson1DisableCrlCommand = deserializeAws_restJson1DisableCrlCommand;
910
+ const deserializeAws_restJson1DisableCrlCommandError = async (output, context) => {
911
+ const parsedOutput = {
912
+ ...output,
913
+ body: await parseBody(output.body, context),
914
+ };
915
+ let response;
916
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
917
+ switch (errorCode) {
918
+ case "AccessDeniedException":
919
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
920
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
921
+ case "ResourceNotFoundException":
922
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
923
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
924
+ default:
925
+ const parsedBody = parsedOutput.body;
926
+ const $metadata = deserializeMetadata(output);
927
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
928
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
929
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
930
+ $fault: "client",
931
+ $metadata,
932
+ });
933
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
934
+ }
935
+ };
936
+ const deserializeAws_restJson1DisableProfileCommand = async (output, context) => {
937
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
938
+ return deserializeAws_restJson1DisableProfileCommandError(output, context);
939
+ }
940
+ const contents = {
941
+ $metadata: deserializeMetadata(output),
942
+ profile: undefined,
943
+ };
944
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
945
+ if (data.profile !== undefined && data.profile !== null) {
946
+ contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
947
+ }
948
+ return Promise.resolve(contents);
949
+ };
950
+ exports.deserializeAws_restJson1DisableProfileCommand = deserializeAws_restJson1DisableProfileCommand;
951
+ const deserializeAws_restJson1DisableProfileCommandError = async (output, context) => {
952
+ const parsedOutput = {
953
+ ...output,
954
+ body: await parseBody(output.body, context),
955
+ };
956
+ let response;
957
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
958
+ switch (errorCode) {
959
+ case "AccessDeniedException":
960
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
961
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
962
+ case "ResourceNotFoundException":
963
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
964
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
965
+ default:
966
+ const parsedBody = parsedOutput.body;
967
+ const $metadata = deserializeMetadata(output);
968
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
969
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
970
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
971
+ $fault: "client",
972
+ $metadata,
973
+ });
974
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
975
+ }
976
+ };
977
+ const deserializeAws_restJson1DisableTrustAnchorCommand = async (output, context) => {
978
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
979
+ return deserializeAws_restJson1DisableTrustAnchorCommandError(output, context);
980
+ }
981
+ const contents = {
982
+ $metadata: deserializeMetadata(output),
983
+ trustAnchor: undefined,
984
+ };
985
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
986
+ if (data.trustAnchor !== undefined && data.trustAnchor !== null) {
987
+ contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
988
+ }
989
+ return Promise.resolve(contents);
990
+ };
991
+ exports.deserializeAws_restJson1DisableTrustAnchorCommand = deserializeAws_restJson1DisableTrustAnchorCommand;
992
+ const deserializeAws_restJson1DisableTrustAnchorCommandError = async (output, context) => {
993
+ const parsedOutput = {
994
+ ...output,
995
+ body: await parseBody(output.body, context),
996
+ };
997
+ let response;
998
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
999
+ switch (errorCode) {
1000
+ case "AccessDeniedException":
1001
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1002
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1003
+ case "ResourceNotFoundException":
1004
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1005
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1006
+ default:
1007
+ const parsedBody = parsedOutput.body;
1008
+ const $metadata = deserializeMetadata(output);
1009
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1010
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
1011
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1012
+ $fault: "client",
1013
+ $metadata,
1014
+ });
1015
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1016
+ }
1017
+ };
1018
+ const deserializeAws_restJson1EnableCrlCommand = async (output, context) => {
1019
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1020
+ return deserializeAws_restJson1EnableCrlCommandError(output, context);
1021
+ }
1022
+ const contents = {
1023
+ $metadata: deserializeMetadata(output),
1024
+ crl: undefined,
1025
+ };
1026
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1027
+ if (data.crl !== undefined && data.crl !== null) {
1028
+ contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
1029
+ }
1030
+ return Promise.resolve(contents);
1031
+ };
1032
+ exports.deserializeAws_restJson1EnableCrlCommand = deserializeAws_restJson1EnableCrlCommand;
1033
+ const deserializeAws_restJson1EnableCrlCommandError = async (output, context) => {
1034
+ const parsedOutput = {
1035
+ ...output,
1036
+ body: await parseBody(output.body, context),
1037
+ };
1038
+ let response;
1039
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1040
+ switch (errorCode) {
1041
+ case "AccessDeniedException":
1042
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1043
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1044
+ case "ResourceNotFoundException":
1045
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1046
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1047
+ default:
1048
+ const parsedBody = parsedOutput.body;
1049
+ const $metadata = deserializeMetadata(output);
1050
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1051
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
1052
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1053
+ $fault: "client",
1054
+ $metadata,
1055
+ });
1056
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1057
+ }
1058
+ };
1059
+ const deserializeAws_restJson1EnableProfileCommand = async (output, context) => {
1060
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1061
+ return deserializeAws_restJson1EnableProfileCommandError(output, context);
1062
+ }
1063
+ const contents = {
1064
+ $metadata: deserializeMetadata(output),
1065
+ profile: undefined,
1066
+ };
1067
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1068
+ if (data.profile !== undefined && data.profile !== null) {
1069
+ contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
1070
+ }
1071
+ return Promise.resolve(contents);
1072
+ };
1073
+ exports.deserializeAws_restJson1EnableProfileCommand = deserializeAws_restJson1EnableProfileCommand;
1074
+ const deserializeAws_restJson1EnableProfileCommandError = async (output, context) => {
1075
+ const parsedOutput = {
1076
+ ...output,
1077
+ body: await parseBody(output.body, context),
1078
+ };
1079
+ let response;
1080
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1081
+ switch (errorCode) {
1082
+ case "AccessDeniedException":
1083
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1084
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1085
+ case "ResourceNotFoundException":
1086
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1087
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1088
+ default:
1089
+ const parsedBody = parsedOutput.body;
1090
+ const $metadata = deserializeMetadata(output);
1091
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1092
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
1093
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1094
+ $fault: "client",
1095
+ $metadata,
1096
+ });
1097
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1098
+ }
1099
+ };
1100
+ const deserializeAws_restJson1EnableTrustAnchorCommand = async (output, context) => {
1101
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1102
+ return deserializeAws_restJson1EnableTrustAnchorCommandError(output, context);
1103
+ }
1104
+ const contents = {
1105
+ $metadata: deserializeMetadata(output),
1106
+ trustAnchor: undefined,
1107
+ };
1108
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1109
+ if (data.trustAnchor !== undefined && data.trustAnchor !== null) {
1110
+ contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
1111
+ }
1112
+ return Promise.resolve(contents);
1113
+ };
1114
+ exports.deserializeAws_restJson1EnableTrustAnchorCommand = deserializeAws_restJson1EnableTrustAnchorCommand;
1115
+ const deserializeAws_restJson1EnableTrustAnchorCommandError = async (output, context) => {
1116
+ const parsedOutput = {
1117
+ ...output,
1118
+ body: await parseBody(output.body, context),
1119
+ };
1120
+ let response;
1121
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1122
+ switch (errorCode) {
1123
+ case "AccessDeniedException":
1124
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1125
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1126
+ case "ResourceNotFoundException":
1127
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1128
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1129
+ default:
1130
+ const parsedBody = parsedOutput.body;
1131
+ const $metadata = deserializeMetadata(output);
1132
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1133
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
1134
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1135
+ $fault: "client",
1136
+ $metadata,
1137
+ });
1138
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1139
+ }
1140
+ };
1141
+ const deserializeAws_restJson1GetCrlCommand = async (output, context) => {
1142
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1143
+ return deserializeAws_restJson1GetCrlCommandError(output, context);
1144
+ }
1145
+ const contents = {
1146
+ $metadata: deserializeMetadata(output),
1147
+ crl: undefined,
1148
+ };
1149
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1150
+ if (data.crl !== undefined && data.crl !== null) {
1151
+ contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
1152
+ }
1153
+ return Promise.resolve(contents);
1154
+ };
1155
+ exports.deserializeAws_restJson1GetCrlCommand = deserializeAws_restJson1GetCrlCommand;
1156
+ const deserializeAws_restJson1GetCrlCommandError = async (output, context) => {
1157
+ const parsedOutput = {
1158
+ ...output,
1159
+ body: await parseBody(output.body, context),
1160
+ };
1161
+ let response;
1162
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1163
+ switch (errorCode) {
1164
+ case "ResourceNotFoundException":
1165
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1166
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1167
+ default:
1168
+ const parsedBody = parsedOutput.body;
1169
+ const $metadata = deserializeMetadata(output);
1170
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1171
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
1172
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1173
+ $fault: "client",
1174
+ $metadata,
1175
+ });
1176
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1177
+ }
1178
+ };
1179
+ const deserializeAws_restJson1GetProfileCommand = async (output, context) => {
1180
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1181
+ return deserializeAws_restJson1GetProfileCommandError(output, context);
1182
+ }
1183
+ const contents = {
1184
+ $metadata: deserializeMetadata(output),
1185
+ profile: undefined,
1186
+ };
1187
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1188
+ if (data.profile !== undefined && data.profile !== null) {
1189
+ contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
1190
+ }
1191
+ return Promise.resolve(contents);
1192
+ };
1193
+ exports.deserializeAws_restJson1GetProfileCommand = deserializeAws_restJson1GetProfileCommand;
1194
+ const deserializeAws_restJson1GetProfileCommandError = async (output, context) => {
1195
+ const parsedOutput = {
1196
+ ...output,
1197
+ body: await parseBody(output.body, context),
1198
+ };
1199
+ let response;
1200
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1201
+ switch (errorCode) {
1202
+ case "AccessDeniedException":
1203
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1204
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1205
+ case "ResourceNotFoundException":
1206
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1207
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1208
+ default:
1209
+ const parsedBody = parsedOutput.body;
1210
+ const $metadata = deserializeMetadata(output);
1211
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1212
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
1213
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1214
+ $fault: "client",
1215
+ $metadata,
1216
+ });
1217
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1218
+ }
1219
+ };
1220
+ const deserializeAws_restJson1GetSubjectCommand = async (output, context) => {
1221
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1222
+ return deserializeAws_restJson1GetSubjectCommandError(output, context);
1223
+ }
1224
+ const contents = {
1225
+ $metadata: deserializeMetadata(output),
1226
+ subject: undefined,
1227
+ };
1228
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1229
+ if (data.subject !== undefined && data.subject !== null) {
1230
+ contents.subject = deserializeAws_restJson1SubjectDetail(data.subject, context);
1231
+ }
1232
+ return Promise.resolve(contents);
1233
+ };
1234
+ exports.deserializeAws_restJson1GetSubjectCommand = deserializeAws_restJson1GetSubjectCommand;
1235
+ const deserializeAws_restJson1GetSubjectCommandError = async (output, context) => {
1236
+ const parsedOutput = {
1237
+ ...output,
1238
+ body: await parseBody(output.body, context),
1239
+ };
1240
+ let response;
1241
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1242
+ switch (errorCode) {
1243
+ case "AccessDeniedException":
1244
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1245
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1246
+ case "ResourceNotFoundException":
1247
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1248
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1249
+ default:
1250
+ const parsedBody = parsedOutput.body;
1251
+ const $metadata = deserializeMetadata(output);
1252
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1253
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
1254
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1255
+ $fault: "client",
1256
+ $metadata,
1257
+ });
1258
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1259
+ }
1260
+ };
1261
+ const deserializeAws_restJson1GetTrustAnchorCommand = async (output, context) => {
1262
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1263
+ return deserializeAws_restJson1GetTrustAnchorCommandError(output, context);
1264
+ }
1265
+ const contents = {
1266
+ $metadata: deserializeMetadata(output),
1267
+ trustAnchor: undefined,
1268
+ };
1269
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1270
+ if (data.trustAnchor !== undefined && data.trustAnchor !== null) {
1271
+ contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
1272
+ }
1273
+ return Promise.resolve(contents);
1274
+ };
1275
+ exports.deserializeAws_restJson1GetTrustAnchorCommand = deserializeAws_restJson1GetTrustAnchorCommand;
1276
+ const deserializeAws_restJson1GetTrustAnchorCommandError = async (output, context) => {
1277
+ const parsedOutput = {
1278
+ ...output,
1279
+ body: await parseBody(output.body, context),
1280
+ };
1281
+ let response;
1282
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1283
+ switch (errorCode) {
1284
+ case "AccessDeniedException":
1285
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1286
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1287
+ case "ResourceNotFoundException":
1288
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1289
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1290
+ case "ValidationException":
1291
+ case "com.amazonaws.rolesanywhere#ValidationException":
1292
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1293
+ default:
1294
+ const parsedBody = parsedOutput.body;
1295
+ const $metadata = deserializeMetadata(output);
1296
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1297
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
1298
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1299
+ $fault: "client",
1300
+ $metadata,
1301
+ });
1302
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1303
+ }
1304
+ };
1305
+ const deserializeAws_restJson1ImportCrlCommand = async (output, context) => {
1306
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
1307
+ return deserializeAws_restJson1ImportCrlCommandError(output, context);
1308
+ }
1309
+ const contents = {
1310
+ $metadata: deserializeMetadata(output),
1311
+ crl: undefined,
1312
+ };
1313
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1314
+ if (data.crl !== undefined && data.crl !== null) {
1315
+ contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
1316
+ }
1317
+ return Promise.resolve(contents);
1318
+ };
1319
+ exports.deserializeAws_restJson1ImportCrlCommand = deserializeAws_restJson1ImportCrlCommand;
1320
+ const deserializeAws_restJson1ImportCrlCommandError = async (output, context) => {
1321
+ const parsedOutput = {
1322
+ ...output,
1323
+ body: await parseBody(output.body, context),
1324
+ };
1325
+ let response;
1326
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1327
+ switch (errorCode) {
1328
+ case "AccessDeniedException":
1329
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1330
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1331
+ case "ValidationException":
1332
+ case "com.amazonaws.rolesanywhere#ValidationException":
1333
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1334
+ default:
1335
+ const parsedBody = parsedOutput.body;
1336
+ const $metadata = deserializeMetadata(output);
1337
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1338
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
1339
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1340
+ $fault: "client",
1341
+ $metadata,
1342
+ });
1343
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1344
+ }
1345
+ };
1346
+ const deserializeAws_restJson1ListCrlsCommand = async (output, context) => {
1347
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1348
+ return deserializeAws_restJson1ListCrlsCommandError(output, context);
1349
+ }
1350
+ const contents = {
1351
+ $metadata: deserializeMetadata(output),
1352
+ crls: undefined,
1353
+ nextToken: undefined,
1354
+ };
1355
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1356
+ if (data.crls !== undefined && data.crls !== null) {
1357
+ contents.crls = deserializeAws_restJson1CrlDetails(data.crls, context);
1358
+ }
1359
+ if (data.nextToken !== undefined && data.nextToken !== null) {
1360
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1361
+ }
1362
+ return Promise.resolve(contents);
1363
+ };
1364
+ exports.deserializeAws_restJson1ListCrlsCommand = deserializeAws_restJson1ListCrlsCommand;
1365
+ const deserializeAws_restJson1ListCrlsCommandError = async (output, context) => {
1366
+ const parsedOutput = {
1367
+ ...output,
1368
+ body: await parseBody(output.body, context),
1369
+ };
1370
+ let response;
1371
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1372
+ switch (errorCode) {
1373
+ case "AccessDeniedException":
1374
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1375
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1376
+ case "ValidationException":
1377
+ case "com.amazonaws.rolesanywhere#ValidationException":
1378
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1379
+ default:
1380
+ const parsedBody = parsedOutput.body;
1381
+ const $metadata = deserializeMetadata(output);
1382
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1383
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
1384
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1385
+ $fault: "client",
1386
+ $metadata,
1387
+ });
1388
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1389
+ }
1390
+ };
1391
+ const deserializeAws_restJson1ListProfilesCommand = async (output, context) => {
1392
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1393
+ return deserializeAws_restJson1ListProfilesCommandError(output, context);
1394
+ }
1395
+ const contents = {
1396
+ $metadata: deserializeMetadata(output),
1397
+ nextToken: undefined,
1398
+ profiles: undefined,
1399
+ };
1400
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1401
+ if (data.nextToken !== undefined && data.nextToken !== null) {
1402
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1403
+ }
1404
+ if (data.profiles !== undefined && data.profiles !== null) {
1405
+ contents.profiles = deserializeAws_restJson1ProfileDetails(data.profiles, context);
1406
+ }
1407
+ return Promise.resolve(contents);
1408
+ };
1409
+ exports.deserializeAws_restJson1ListProfilesCommand = deserializeAws_restJson1ListProfilesCommand;
1410
+ const deserializeAws_restJson1ListProfilesCommandError = async (output, context) => {
1411
+ const parsedOutput = {
1412
+ ...output,
1413
+ body: await parseBody(output.body, context),
1414
+ };
1415
+ let response;
1416
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1417
+ switch (errorCode) {
1418
+ case "AccessDeniedException":
1419
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1420
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1421
+ case "ValidationException":
1422
+ case "com.amazonaws.rolesanywhere#ValidationException":
1423
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1424
+ default:
1425
+ const parsedBody = parsedOutput.body;
1426
+ const $metadata = deserializeMetadata(output);
1427
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1428
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
1429
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1430
+ $fault: "client",
1431
+ $metadata,
1432
+ });
1433
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1434
+ }
1435
+ };
1436
+ const deserializeAws_restJson1ListSubjectsCommand = async (output, context) => {
1437
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1438
+ return deserializeAws_restJson1ListSubjectsCommandError(output, context);
1439
+ }
1440
+ const contents = {
1441
+ $metadata: deserializeMetadata(output),
1442
+ nextToken: undefined,
1443
+ subjects: undefined,
1444
+ };
1445
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1446
+ if (data.nextToken !== undefined && data.nextToken !== null) {
1447
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1448
+ }
1449
+ if (data.subjects !== undefined && data.subjects !== null) {
1450
+ contents.subjects = deserializeAws_restJson1SubjectSummaries(data.subjects, context);
1451
+ }
1452
+ return Promise.resolve(contents);
1453
+ };
1454
+ exports.deserializeAws_restJson1ListSubjectsCommand = deserializeAws_restJson1ListSubjectsCommand;
1455
+ const deserializeAws_restJson1ListSubjectsCommandError = async (output, context) => {
1456
+ const parsedOutput = {
1457
+ ...output,
1458
+ body: await parseBody(output.body, context),
1459
+ };
1460
+ let response;
1461
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1462
+ switch (errorCode) {
1463
+ case "AccessDeniedException":
1464
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1465
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1466
+ case "ValidationException":
1467
+ case "com.amazonaws.rolesanywhere#ValidationException":
1468
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1469
+ default:
1470
+ const parsedBody = parsedOutput.body;
1471
+ const $metadata = deserializeMetadata(output);
1472
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1473
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
1474
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1475
+ $fault: "client",
1476
+ $metadata,
1477
+ });
1478
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1479
+ }
1480
+ };
1481
+ const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
1482
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1483
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
1484
+ }
1485
+ const contents = {
1486
+ $metadata: deserializeMetadata(output),
1487
+ tags: undefined,
1488
+ };
1489
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1490
+ if (data.tags !== undefined && data.tags !== null) {
1491
+ contents.tags = deserializeAws_restJson1TagList(data.tags, context);
1492
+ }
1493
+ return Promise.resolve(contents);
1494
+ };
1495
+ exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
1496
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
1497
+ const parsedOutput = {
1498
+ ...output,
1499
+ body: await parseBody(output.body, context),
1500
+ };
1501
+ let response;
1502
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1503
+ switch (errorCode) {
1504
+ case "AccessDeniedException":
1505
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1506
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1507
+ case "ResourceNotFoundException":
1508
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1509
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1510
+ case "ValidationException":
1511
+ case "com.amazonaws.rolesanywhere#ValidationException":
1512
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1513
+ default:
1514
+ const parsedBody = parsedOutput.body;
1515
+ const $metadata = deserializeMetadata(output);
1516
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1517
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
1518
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1519
+ $fault: "client",
1520
+ $metadata,
1521
+ });
1522
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1523
+ }
1524
+ };
1525
+ const deserializeAws_restJson1ListTrustAnchorsCommand = async (output, context) => {
1526
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1527
+ return deserializeAws_restJson1ListTrustAnchorsCommandError(output, context);
1528
+ }
1529
+ const contents = {
1530
+ $metadata: deserializeMetadata(output),
1531
+ nextToken: undefined,
1532
+ trustAnchors: undefined,
1533
+ };
1534
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1535
+ if (data.nextToken !== undefined && data.nextToken !== null) {
1536
+ contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1537
+ }
1538
+ if (data.trustAnchors !== undefined && data.trustAnchors !== null) {
1539
+ contents.trustAnchors = deserializeAws_restJson1TrustAnchorDetails(data.trustAnchors, context);
1540
+ }
1541
+ return Promise.resolve(contents);
1542
+ };
1543
+ exports.deserializeAws_restJson1ListTrustAnchorsCommand = deserializeAws_restJson1ListTrustAnchorsCommand;
1544
+ const deserializeAws_restJson1ListTrustAnchorsCommandError = async (output, context) => {
1545
+ const parsedOutput = {
1546
+ ...output,
1547
+ body: await parseBody(output.body, context),
1548
+ };
1549
+ let response;
1550
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1551
+ switch (errorCode) {
1552
+ case "AccessDeniedException":
1553
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1554
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1555
+ case "ValidationException":
1556
+ case "com.amazonaws.rolesanywhere#ValidationException":
1557
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1558
+ default:
1559
+ const parsedBody = parsedOutput.body;
1560
+ const $metadata = deserializeMetadata(output);
1561
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1562
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
1563
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1564
+ $fault: "client",
1565
+ $metadata,
1566
+ });
1567
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1568
+ }
1569
+ };
1570
+ const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
1571
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
1572
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
1573
+ }
1574
+ const contents = {
1575
+ $metadata: deserializeMetadata(output),
1576
+ };
1577
+ await collectBody(output.body, context);
1578
+ return Promise.resolve(contents);
1579
+ };
1580
+ exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
1581
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
1582
+ const parsedOutput = {
1583
+ ...output,
1584
+ body: await parseBody(output.body, context),
1585
+ };
1586
+ let response;
1587
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1588
+ switch (errorCode) {
1589
+ case "AccessDeniedException":
1590
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1591
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1592
+ case "ResourceNotFoundException":
1593
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1594
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1595
+ case "TooManyTagsException":
1596
+ case "com.amazonaws.rolesanywhere#TooManyTagsException":
1597
+ throw await deserializeAws_restJson1TooManyTagsExceptionResponse(parsedOutput, context);
1598
+ case "ValidationException":
1599
+ case "com.amazonaws.rolesanywhere#ValidationException":
1600
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1601
+ default:
1602
+ const parsedBody = parsedOutput.body;
1603
+ const $metadata = deserializeMetadata(output);
1604
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1605
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
1606
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1607
+ $fault: "client",
1608
+ $metadata,
1609
+ });
1610
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1611
+ }
1612
+ };
1613
+ const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
1614
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1615
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
1616
+ }
1617
+ const contents = {
1618
+ $metadata: deserializeMetadata(output),
1619
+ };
1620
+ await collectBody(output.body, context);
1621
+ return Promise.resolve(contents);
1622
+ };
1623
+ exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
1624
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
1625
+ const parsedOutput = {
1626
+ ...output,
1627
+ body: await parseBody(output.body, context),
1628
+ };
1629
+ let response;
1630
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1631
+ switch (errorCode) {
1632
+ case "AccessDeniedException":
1633
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1634
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1635
+ case "ResourceNotFoundException":
1636
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1637
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1638
+ case "ValidationException":
1639
+ case "com.amazonaws.rolesanywhere#ValidationException":
1640
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1641
+ default:
1642
+ const parsedBody = parsedOutput.body;
1643
+ const $metadata = deserializeMetadata(output);
1644
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1645
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
1646
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1647
+ $fault: "client",
1648
+ $metadata,
1649
+ });
1650
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1651
+ }
1652
+ };
1653
+ const deserializeAws_restJson1UpdateCrlCommand = async (output, context) => {
1654
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1655
+ return deserializeAws_restJson1UpdateCrlCommandError(output, context);
1656
+ }
1657
+ const contents = {
1658
+ $metadata: deserializeMetadata(output),
1659
+ crl: undefined,
1660
+ };
1661
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1662
+ if (data.crl !== undefined && data.crl !== null) {
1663
+ contents.crl = deserializeAws_restJson1CrlDetail(data.crl, context);
1664
+ }
1665
+ return Promise.resolve(contents);
1666
+ };
1667
+ exports.deserializeAws_restJson1UpdateCrlCommand = deserializeAws_restJson1UpdateCrlCommand;
1668
+ const deserializeAws_restJson1UpdateCrlCommandError = async (output, context) => {
1669
+ const parsedOutput = {
1670
+ ...output,
1671
+ body: await parseBody(output.body, context),
1672
+ };
1673
+ let response;
1674
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1675
+ switch (errorCode) {
1676
+ case "AccessDeniedException":
1677
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1678
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1679
+ case "ResourceNotFoundException":
1680
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1681
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1682
+ case "ValidationException":
1683
+ case "com.amazonaws.rolesanywhere#ValidationException":
1684
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1685
+ default:
1686
+ const parsedBody = parsedOutput.body;
1687
+ const $metadata = deserializeMetadata(output);
1688
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1689
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
1690
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1691
+ $fault: "client",
1692
+ $metadata,
1693
+ });
1694
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1695
+ }
1696
+ };
1697
+ const deserializeAws_restJson1UpdateProfileCommand = async (output, context) => {
1698
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1699
+ return deserializeAws_restJson1UpdateProfileCommandError(output, context);
1700
+ }
1701
+ const contents = {
1702
+ $metadata: deserializeMetadata(output),
1703
+ profile: undefined,
1704
+ };
1705
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1706
+ if (data.profile !== undefined && data.profile !== null) {
1707
+ contents.profile = deserializeAws_restJson1ProfileDetail(data.profile, context);
1708
+ }
1709
+ return Promise.resolve(contents);
1710
+ };
1711
+ exports.deserializeAws_restJson1UpdateProfileCommand = deserializeAws_restJson1UpdateProfileCommand;
1712
+ const deserializeAws_restJson1UpdateProfileCommandError = async (output, context) => {
1713
+ const parsedOutput = {
1714
+ ...output,
1715
+ body: await parseBody(output.body, context),
1716
+ };
1717
+ let response;
1718
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1719
+ switch (errorCode) {
1720
+ case "AccessDeniedException":
1721
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1722
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1723
+ case "ResourceNotFoundException":
1724
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1725
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1726
+ case "ValidationException":
1727
+ case "com.amazonaws.rolesanywhere#ValidationException":
1728
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1729
+ default:
1730
+ const parsedBody = parsedOutput.body;
1731
+ const $metadata = deserializeMetadata(output);
1732
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1733
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
1734
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1735
+ $fault: "client",
1736
+ $metadata,
1737
+ });
1738
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1739
+ }
1740
+ };
1741
+ const deserializeAws_restJson1UpdateTrustAnchorCommand = async (output, context) => {
1742
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1743
+ return deserializeAws_restJson1UpdateTrustAnchorCommandError(output, context);
1744
+ }
1745
+ const contents = {
1746
+ $metadata: deserializeMetadata(output),
1747
+ trustAnchor: undefined,
1748
+ };
1749
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1750
+ if (data.trustAnchor !== undefined && data.trustAnchor !== null) {
1751
+ contents.trustAnchor = deserializeAws_restJson1TrustAnchorDetail(data.trustAnchor, context);
1752
+ }
1753
+ return Promise.resolve(contents);
1754
+ };
1755
+ exports.deserializeAws_restJson1UpdateTrustAnchorCommand = deserializeAws_restJson1UpdateTrustAnchorCommand;
1756
+ const deserializeAws_restJson1UpdateTrustAnchorCommandError = async (output, context) => {
1757
+ const parsedOutput = {
1758
+ ...output,
1759
+ body: await parseBody(output.body, context),
1760
+ };
1761
+ let response;
1762
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1763
+ switch (errorCode) {
1764
+ case "AccessDeniedException":
1765
+ case "com.amazonaws.rolesanywhere#AccessDeniedException":
1766
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1767
+ case "ResourceNotFoundException":
1768
+ case "com.amazonaws.rolesanywhere#ResourceNotFoundException":
1769
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1770
+ case "ValidationException":
1771
+ case "com.amazonaws.rolesanywhere#ValidationException":
1772
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1773
+ default:
1774
+ const parsedBody = parsedOutput.body;
1775
+ const $metadata = deserializeMetadata(output);
1776
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1777
+ response = new RolesAnywhereServiceException_1.RolesAnywhereServiceException({
1778
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1779
+ $fault: "client",
1780
+ $metadata,
1781
+ });
1782
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1783
+ }
1784
+ };
1785
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
1786
+ const contents = {};
1787
+ const data = parsedOutput.body;
1788
+ if (data.message !== undefined && data.message !== null) {
1789
+ contents.message = (0, smithy_client_1.expectString)(data.message);
1790
+ }
1791
+ const exception = new models_0_1.AccessDeniedException({
1792
+ $metadata: deserializeMetadata(parsedOutput),
1793
+ ...contents,
1794
+ });
1795
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1796
+ };
1797
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1798
+ const contents = {};
1799
+ const data = parsedOutput.body;
1800
+ if (data.message !== undefined && data.message !== null) {
1801
+ contents.message = (0, smithy_client_1.expectString)(data.message);
1802
+ }
1803
+ const exception = new models_0_1.ResourceNotFoundException({
1804
+ $metadata: deserializeMetadata(parsedOutput),
1805
+ ...contents,
1806
+ });
1807
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1808
+ };
1809
+ const deserializeAws_restJson1TooManyTagsExceptionResponse = async (parsedOutput, context) => {
1810
+ const contents = {};
1811
+ const data = parsedOutput.body;
1812
+ if (data.message !== undefined && data.message !== null) {
1813
+ contents.message = (0, smithy_client_1.expectString)(data.message);
1814
+ }
1815
+ const exception = new models_0_1.TooManyTagsException({
1816
+ $metadata: deserializeMetadata(parsedOutput),
1817
+ ...contents,
1818
+ });
1819
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1820
+ };
1821
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1822
+ const contents = {};
1823
+ const data = parsedOutput.body;
1824
+ if (data.message !== undefined && data.message !== null) {
1825
+ contents.message = (0, smithy_client_1.expectString)(data.message);
1826
+ }
1827
+ const exception = new models_0_1.ValidationException({
1828
+ $metadata: deserializeMetadata(parsedOutput),
1829
+ ...contents,
1830
+ });
1831
+ return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1832
+ };
1833
+ const serializeAws_restJson1ManagedPolicyList = (input, context) => {
1834
+ return input
1835
+ .filter((e) => e != null)
1836
+ .map((entry) => {
1837
+ if (entry === null) {
1838
+ return null;
1839
+ }
1840
+ return entry;
1841
+ });
1842
+ };
1843
+ const serializeAws_restJson1RoleArnList = (input, context) => {
1844
+ return input
1845
+ .filter((e) => e != null)
1846
+ .map((entry) => {
1847
+ if (entry === null) {
1848
+ return null;
1849
+ }
1850
+ return entry;
1851
+ });
1852
+ };
1853
+ const serializeAws_restJson1Source = (input, context) => {
1854
+ return {
1855
+ ...(input.sourceData !== undefined &&
1856
+ input.sourceData !== null && { sourceData: serializeAws_restJson1SourceData(input.sourceData, context) }),
1857
+ ...(input.sourceType !== undefined && input.sourceType !== null && { sourceType: input.sourceType }),
1858
+ };
1859
+ };
1860
+ const serializeAws_restJson1SourceData = (input, context) => {
1861
+ return models_0_1.SourceData.visit(input, {
1862
+ acmPcaArn: (value) => ({ acmPcaArn: value }),
1863
+ x509CertificateData: (value) => ({ x509CertificateData: value }),
1864
+ _: (name, value) => ({ name: value }),
1865
+ });
1866
+ };
1867
+ const serializeAws_restJson1Tag = (input, context) => {
1868
+ return {
1869
+ ...(input.key !== undefined && input.key !== null && { key: input.key }),
1870
+ ...(input.value !== undefined && input.value !== null && { value: input.value }),
1871
+ };
1872
+ };
1873
+ const serializeAws_restJson1TagKeyList = (input, context) => {
1874
+ return input
1875
+ .filter((e) => e != null)
1876
+ .map((entry) => {
1877
+ if (entry === null) {
1878
+ return null;
1879
+ }
1880
+ return entry;
1881
+ });
1882
+ };
1883
+ const serializeAws_restJson1TagList = (input, context) => {
1884
+ return input
1885
+ .filter((e) => e != null)
1886
+ .map((entry) => {
1887
+ if (entry === null) {
1888
+ return null;
1889
+ }
1890
+ return serializeAws_restJson1Tag(entry, context);
1891
+ });
1892
+ };
1893
+ const deserializeAws_restJson1CredentialSummaries = (output, context) => {
1894
+ const retVal = (output || [])
1895
+ .filter((e) => e != null)
1896
+ .map((entry) => {
1897
+ if (entry === null) {
1898
+ return null;
1899
+ }
1900
+ return deserializeAws_restJson1CredentialSummary(entry, context);
1901
+ });
1902
+ return retVal;
1903
+ };
1904
+ const deserializeAws_restJson1CredentialSummary = (output, context) => {
1905
+ return {
1906
+ enabled: (0, smithy_client_1.expectBoolean)(output.enabled),
1907
+ failed: (0, smithy_client_1.expectBoolean)(output.failed),
1908
+ issuer: (0, smithy_client_1.expectString)(output.issuer),
1909
+ seenAt: output.seenAt !== undefined && output.seenAt !== null
1910
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.seenAt))
1911
+ : undefined,
1912
+ serialNumber: (0, smithy_client_1.expectString)(output.serialNumber),
1913
+ x509CertificateData: (0, smithy_client_1.expectString)(output.x509CertificateData),
1914
+ };
1915
+ };
1916
+ const deserializeAws_restJson1CrlDetail = (output, context) => {
1917
+ return {
1918
+ createdAt: output.createdAt !== undefined && output.createdAt !== null
1919
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.createdAt))
1920
+ : undefined,
1921
+ crlArn: (0, smithy_client_1.expectString)(output.crlArn),
1922
+ crlData: output.crlData !== undefined && output.crlData !== null ? context.base64Decoder(output.crlData) : undefined,
1923
+ crlId: (0, smithy_client_1.expectString)(output.crlId),
1924
+ enabled: (0, smithy_client_1.expectBoolean)(output.enabled),
1925
+ name: (0, smithy_client_1.expectString)(output.name),
1926
+ trustAnchorArn: (0, smithy_client_1.expectString)(output.trustAnchorArn),
1927
+ updatedAt: output.updatedAt !== undefined && output.updatedAt !== null
1928
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.updatedAt))
1929
+ : undefined,
1930
+ };
1931
+ };
1932
+ const deserializeAws_restJson1CrlDetails = (output, context) => {
1933
+ const retVal = (output || [])
1934
+ .filter((e) => e != null)
1935
+ .map((entry) => {
1936
+ if (entry === null) {
1937
+ return null;
1938
+ }
1939
+ return deserializeAws_restJson1CrlDetail(entry, context);
1940
+ });
1941
+ return retVal;
1942
+ };
1943
+ const deserializeAws_restJson1InstanceProperties = (output, context) => {
1944
+ const retVal = (output || [])
1945
+ .filter((e) => e != null)
1946
+ .map((entry) => {
1947
+ if (entry === null) {
1948
+ return null;
1949
+ }
1950
+ return deserializeAws_restJson1InstanceProperty(entry, context);
1951
+ });
1952
+ return retVal;
1953
+ };
1954
+ const deserializeAws_restJson1InstanceProperty = (output, context) => {
1955
+ return {
1956
+ failed: (0, smithy_client_1.expectBoolean)(output.failed),
1957
+ properties: output.properties !== undefined && output.properties !== null
1958
+ ? deserializeAws_restJson1InstancePropertyMap(output.properties, context)
1959
+ : undefined,
1960
+ seenAt: output.seenAt !== undefined && output.seenAt !== null
1961
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.seenAt))
1962
+ : undefined,
1963
+ };
1964
+ };
1965
+ const deserializeAws_restJson1InstancePropertyMap = (output, context) => {
1966
+ return Object.entries(output).reduce((acc, [key, value]) => {
1967
+ if (value === null) {
1968
+ return acc;
1969
+ }
1970
+ return {
1971
+ ...acc,
1972
+ [key]: (0, smithy_client_1.expectString)(value),
1973
+ };
1974
+ }, {});
1975
+ };
1976
+ const deserializeAws_restJson1ManagedPolicyList = (output, context) => {
1977
+ const retVal = (output || [])
1978
+ .filter((e) => e != null)
1979
+ .map((entry) => {
1980
+ if (entry === null) {
1981
+ return null;
1982
+ }
1983
+ return (0, smithy_client_1.expectString)(entry);
1984
+ });
1985
+ return retVal;
1986
+ };
1987
+ const deserializeAws_restJson1ProfileDetail = (output, context) => {
1988
+ return {
1989
+ createdAt: output.createdAt !== undefined && output.createdAt !== null
1990
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.createdAt))
1991
+ : undefined,
1992
+ createdBy: (0, smithy_client_1.expectString)(output.createdBy),
1993
+ durationSeconds: (0, smithy_client_1.expectInt32)(output.durationSeconds),
1994
+ enabled: (0, smithy_client_1.expectBoolean)(output.enabled),
1995
+ managedPolicyArns: output.managedPolicyArns !== undefined && output.managedPolicyArns !== null
1996
+ ? deserializeAws_restJson1ManagedPolicyList(output.managedPolicyArns, context)
1997
+ : undefined,
1998
+ name: (0, smithy_client_1.expectString)(output.name),
1999
+ profileArn: (0, smithy_client_1.expectString)(output.profileArn),
2000
+ profileId: (0, smithy_client_1.expectString)(output.profileId),
2001
+ requireInstanceProperties: (0, smithy_client_1.expectBoolean)(output.requireInstanceProperties),
2002
+ roleArns: output.roleArns !== undefined && output.roleArns !== null
2003
+ ? deserializeAws_restJson1RoleArnList(output.roleArns, context)
2004
+ : undefined,
2005
+ sessionPolicy: (0, smithy_client_1.expectString)(output.sessionPolicy),
2006
+ updatedAt: output.updatedAt !== undefined && output.updatedAt !== null
2007
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.updatedAt))
2008
+ : undefined,
2009
+ };
2010
+ };
2011
+ const deserializeAws_restJson1ProfileDetails = (output, context) => {
2012
+ const retVal = (output || [])
2013
+ .filter((e) => e != null)
2014
+ .map((entry) => {
2015
+ if (entry === null) {
2016
+ return null;
2017
+ }
2018
+ return deserializeAws_restJson1ProfileDetail(entry, context);
2019
+ });
2020
+ return retVal;
2021
+ };
2022
+ const deserializeAws_restJson1RoleArnList = (output, context) => {
2023
+ const retVal = (output || [])
2024
+ .filter((e) => e != null)
2025
+ .map((entry) => {
2026
+ if (entry === null) {
2027
+ return null;
2028
+ }
2029
+ return (0, smithy_client_1.expectString)(entry);
2030
+ });
2031
+ return retVal;
2032
+ };
2033
+ const deserializeAws_restJson1Source = (output, context) => {
2034
+ return {
2035
+ sourceData: output.sourceData !== undefined && output.sourceData !== null
2036
+ ? deserializeAws_restJson1SourceData((0, smithy_client_1.expectUnion)(output.sourceData), context)
2037
+ : undefined,
2038
+ sourceType: (0, smithy_client_1.expectString)(output.sourceType),
2039
+ };
2040
+ };
2041
+ const deserializeAws_restJson1SourceData = (output, context) => {
2042
+ if ((0, smithy_client_1.expectString)(output.acmPcaArn) !== undefined) {
2043
+ return { acmPcaArn: (0, smithy_client_1.expectString)(output.acmPcaArn) };
2044
+ }
2045
+ if ((0, smithy_client_1.expectString)(output.x509CertificateData) !== undefined) {
2046
+ return { x509CertificateData: (0, smithy_client_1.expectString)(output.x509CertificateData) };
2047
+ }
2048
+ return { $unknown: Object.entries(output)[0] };
2049
+ };
2050
+ const deserializeAws_restJson1SubjectDetail = (output, context) => {
2051
+ return {
2052
+ createdAt: output.createdAt !== undefined && output.createdAt !== null
2053
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.createdAt))
2054
+ : undefined,
2055
+ credentials: output.credentials !== undefined && output.credentials !== null
2056
+ ? deserializeAws_restJson1CredentialSummaries(output.credentials, context)
2057
+ : undefined,
2058
+ enabled: (0, smithy_client_1.expectBoolean)(output.enabled),
2059
+ instanceProperties: output.instanceProperties !== undefined && output.instanceProperties !== null
2060
+ ? deserializeAws_restJson1InstanceProperties(output.instanceProperties, context)
2061
+ : undefined,
2062
+ lastSeenAt: output.lastSeenAt !== undefined && output.lastSeenAt !== null
2063
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.lastSeenAt))
2064
+ : undefined,
2065
+ subjectArn: (0, smithy_client_1.expectString)(output.subjectArn),
2066
+ subjectId: (0, smithy_client_1.expectString)(output.subjectId),
2067
+ updatedAt: output.updatedAt !== undefined && output.updatedAt !== null
2068
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.updatedAt))
2069
+ : undefined,
2070
+ x509Subject: (0, smithy_client_1.expectString)(output.x509Subject),
2071
+ };
2072
+ };
2073
+ const deserializeAws_restJson1SubjectSummaries = (output, context) => {
2074
+ const retVal = (output || [])
2075
+ .filter((e) => e != null)
2076
+ .map((entry) => {
2077
+ if (entry === null) {
2078
+ return null;
2079
+ }
2080
+ return deserializeAws_restJson1SubjectSummary(entry, context);
2081
+ });
2082
+ return retVal;
2083
+ };
2084
+ const deserializeAws_restJson1SubjectSummary = (output, context) => {
2085
+ return {
2086
+ createdAt: output.createdAt !== undefined && output.createdAt !== null
2087
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.createdAt))
2088
+ : undefined,
2089
+ enabled: (0, smithy_client_1.expectBoolean)(output.enabled),
2090
+ lastSeenAt: output.lastSeenAt !== undefined && output.lastSeenAt !== null
2091
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.lastSeenAt))
2092
+ : undefined,
2093
+ subjectArn: (0, smithy_client_1.expectString)(output.subjectArn),
2094
+ subjectId: (0, smithy_client_1.expectString)(output.subjectId),
2095
+ updatedAt: output.updatedAt !== undefined && output.updatedAt !== null
2096
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.updatedAt))
2097
+ : undefined,
2098
+ x509Subject: (0, smithy_client_1.expectString)(output.x509Subject),
2099
+ };
2100
+ };
2101
+ const deserializeAws_restJson1Tag = (output, context) => {
2102
+ return {
2103
+ key: (0, smithy_client_1.expectString)(output.key),
2104
+ value: (0, smithy_client_1.expectString)(output.value),
2105
+ };
2106
+ };
2107
+ const deserializeAws_restJson1TagList = (output, context) => {
2108
+ const retVal = (output || [])
2109
+ .filter((e) => e != null)
2110
+ .map((entry) => {
2111
+ if (entry === null) {
2112
+ return null;
2113
+ }
2114
+ return deserializeAws_restJson1Tag(entry, context);
2115
+ });
2116
+ return retVal;
2117
+ };
2118
+ const deserializeAws_restJson1TrustAnchorDetail = (output, context) => {
2119
+ return {
2120
+ createdAt: output.createdAt !== undefined && output.createdAt !== null
2121
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.createdAt))
2122
+ : undefined,
2123
+ enabled: (0, smithy_client_1.expectBoolean)(output.enabled),
2124
+ name: (0, smithy_client_1.expectString)(output.name),
2125
+ source: output.source !== undefined && output.source !== null
2126
+ ? deserializeAws_restJson1Source(output.source, context)
2127
+ : undefined,
2128
+ trustAnchorArn: (0, smithy_client_1.expectString)(output.trustAnchorArn),
2129
+ trustAnchorId: (0, smithy_client_1.expectString)(output.trustAnchorId),
2130
+ updatedAt: output.updatedAt !== undefined && output.updatedAt !== null
2131
+ ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(output.updatedAt))
2132
+ : undefined,
2133
+ };
2134
+ };
2135
+ const deserializeAws_restJson1TrustAnchorDetails = (output, context) => {
2136
+ const retVal = (output || [])
2137
+ .filter((e) => e != null)
2138
+ .map((entry) => {
2139
+ if (entry === null) {
2140
+ return null;
2141
+ }
2142
+ return deserializeAws_restJson1TrustAnchorDetail(entry, context);
2143
+ });
2144
+ return retVal;
2145
+ };
2146
+ const deserializeMetadata = (output) => {
2147
+ var _a;
2148
+ return ({
2149
+ httpStatusCode: output.statusCode,
2150
+ requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
2151
+ extendedRequestId: output.headers["x-amz-id-2"],
2152
+ cfId: output.headers["x-amz-cf-id"],
2153
+ });
2154
+ };
2155
+ const collectBody = (streamBody = new Uint8Array(), context) => {
2156
+ if (streamBody instanceof Uint8Array) {
2157
+ return Promise.resolve(streamBody);
2158
+ }
2159
+ return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
2160
+ };
2161
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
2162
+ const isSerializableHeaderValue = (value) => value !== undefined &&
2163
+ value !== null &&
2164
+ value !== "" &&
2165
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
2166
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
2167
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
2168
+ if (encoded.length) {
2169
+ return JSON.parse(encoded);
2170
+ }
2171
+ return {};
2172
+ });
2173
+ const loadRestJsonErrorCode = (output, data) => {
2174
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
2175
+ const sanitizeErrorCode = (rawValue) => {
2176
+ let cleanValue = rawValue;
2177
+ if (cleanValue.indexOf(":") >= 0) {
2178
+ cleanValue = cleanValue.split(":")[0];
2179
+ }
2180
+ if (cleanValue.indexOf("#") >= 0) {
2181
+ cleanValue = cleanValue.split("#")[1];
2182
+ }
2183
+ return cleanValue;
2184
+ };
2185
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
2186
+ if (headerKey !== undefined) {
2187
+ return sanitizeErrorCode(output.headers[headerKey]);
2188
+ }
2189
+ if (data.code !== undefined) {
2190
+ return sanitizeErrorCode(data.code);
2191
+ }
2192
+ if (data["__type"] !== undefined) {
2193
+ return sanitizeErrorCode(data["__type"]);
2194
+ }
2195
+ };