@aws-sdk/client-auditmanager 3.52.0 → 3.54.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,8 @@ exports.deserializeAws_restJson1ListAssessmentReportsCommand = exports.deseriali
5
5
  exports.deserializeAws_restJson1ValidateAssessmentReportIntegrityCommand = exports.deserializeAws_restJson1UpdateSettingsCommand = exports.deserializeAws_restJson1UpdateControlCommand = exports.deserializeAws_restJson1UpdateAssessmentStatusCommand = exports.deserializeAws_restJson1UpdateAssessmentFrameworkShareCommand = exports.deserializeAws_restJson1UpdateAssessmentFrameworkCommand = exports.deserializeAws_restJson1UpdateAssessmentControlSetStatusCommand = exports.deserializeAws_restJson1UpdateAssessmentControlCommand = exports.deserializeAws_restJson1UpdateAssessmentCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1StartAssessmentFrameworkShareCommand = exports.deserializeAws_restJson1RegisterOrganizationAdminAccountCommand = exports.deserializeAws_restJson1RegisterAccountCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListNotificationsCommand = exports.deserializeAws_restJson1ListKeywordsForDataSourceCommand = exports.deserializeAws_restJson1ListControlsCommand = exports.deserializeAws_restJson1ListControlInsightsByControlDomainCommand = exports.deserializeAws_restJson1ListControlDomainInsightsByAssessmentCommand = exports.deserializeAws_restJson1ListControlDomainInsightsCommand = exports.deserializeAws_restJson1ListAssessmentsCommand = void 0;
6
6
  const protocol_http_1 = require("@aws-sdk/protocol-http");
7
7
  const smithy_client_1 = require("@aws-sdk/smithy-client");
8
+ const AuditManagerServiceException_1 = require("../models/AuditManagerServiceException");
9
+ const models_0_1 = require("../models/models_0");
8
10
  const serializeAws_restJson1AssociateAssessmentReportEvidenceFolderCommand = async (input, context) => {
9
11
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
12
  const headers = {
@@ -1879,51 +1881,25 @@ const deserializeAws_restJson1AssociateAssessmentReportEvidenceFolderCommandErro
1879
1881
  switch (errorCode) {
1880
1882
  case "AccessDeniedException":
1881
1883
  case "com.amazonaws.auditmanager#AccessDeniedException":
1882
- response = {
1883
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1884
- name: errorCode,
1885
- $metadata: deserializeMetadata(output),
1886
- };
1887
- break;
1884
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1888
1885
  case "InternalServerException":
1889
1886
  case "com.amazonaws.auditmanager#InternalServerException":
1890
- response = {
1891
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1892
- name: errorCode,
1893
- $metadata: deserializeMetadata(output),
1894
- };
1895
- break;
1887
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1896
1888
  case "ResourceNotFoundException":
1897
1889
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
1898
- response = {
1899
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1900
- name: errorCode,
1901
- $metadata: deserializeMetadata(output),
1902
- };
1903
- break;
1890
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1904
1891
  case "ValidationException":
1905
1892
  case "com.amazonaws.auditmanager#ValidationException":
1906
- response = {
1907
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1908
- name: errorCode,
1909
- $metadata: deserializeMetadata(output),
1910
- };
1911
- break;
1893
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1912
1894
  default:
1913
1895
  const parsedBody = parsedOutput.body;
1914
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1915
- response = {
1916
- ...parsedBody,
1917
- name: `${errorCode}`,
1918
- message: parsedBody.message || parsedBody.Message || errorCode,
1896
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
1897
+ name: parsedBody.code || parsedBody.Code || errorCode,
1919
1898
  $fault: "client",
1920
1899
  $metadata: deserializeMetadata(output),
1921
- };
1900
+ });
1901
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1922
1902
  }
1923
- const message = response.message || response.Message || errorCode;
1924
- response.message = message;
1925
- delete response.Message;
1926
- return Promise.reject(Object.assign(new Error(message), response));
1927
1903
  };
1928
1904
  const deserializeAws_restJson1BatchAssociateAssessmentReportEvidenceCommand = async (output, context) => {
1929
1905
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1955,51 +1931,25 @@ const deserializeAws_restJson1BatchAssociateAssessmentReportEvidenceCommandError
1955
1931
  switch (errorCode) {
1956
1932
  case "AccessDeniedException":
1957
1933
  case "com.amazonaws.auditmanager#AccessDeniedException":
1958
- response = {
1959
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1960
- name: errorCode,
1961
- $metadata: deserializeMetadata(output),
1962
- };
1963
- break;
1934
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1964
1935
  case "InternalServerException":
1965
1936
  case "com.amazonaws.auditmanager#InternalServerException":
1966
- response = {
1967
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1968
- name: errorCode,
1969
- $metadata: deserializeMetadata(output),
1970
- };
1971
- break;
1937
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1972
1938
  case "ResourceNotFoundException":
1973
1939
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
1974
- response = {
1975
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1976
- name: errorCode,
1977
- $metadata: deserializeMetadata(output),
1978
- };
1979
- break;
1940
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1980
1941
  case "ValidationException":
1981
1942
  case "com.amazonaws.auditmanager#ValidationException":
1982
- response = {
1983
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1984
- name: errorCode,
1985
- $metadata: deserializeMetadata(output),
1986
- };
1987
- break;
1943
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1988
1944
  default:
1989
1945
  const parsedBody = parsedOutput.body;
1990
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1991
- response = {
1992
- ...parsedBody,
1993
- name: `${errorCode}`,
1994
- message: parsedBody.message || parsedBody.Message || errorCode,
1946
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
1947
+ name: parsedBody.code || parsedBody.Code || errorCode,
1995
1948
  $fault: "client",
1996
1949
  $metadata: deserializeMetadata(output),
1997
- };
1950
+ });
1951
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1998
1952
  }
1999
- const message = response.message || response.Message || errorCode;
2000
- response.message = message;
2001
- delete response.Message;
2002
- return Promise.reject(Object.assign(new Error(message), response));
2003
1953
  };
2004
1954
  const deserializeAws_restJson1BatchCreateDelegationByAssessmentCommand = async (output, context) => {
2005
1955
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2031,51 +1981,25 @@ const deserializeAws_restJson1BatchCreateDelegationByAssessmentCommandError = as
2031
1981
  switch (errorCode) {
2032
1982
  case "AccessDeniedException":
2033
1983
  case "com.amazonaws.auditmanager#AccessDeniedException":
2034
- response = {
2035
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2036
- name: errorCode,
2037
- $metadata: deserializeMetadata(output),
2038
- };
2039
- break;
1984
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2040
1985
  case "InternalServerException":
2041
1986
  case "com.amazonaws.auditmanager#InternalServerException":
2042
- response = {
2043
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2044
- name: errorCode,
2045
- $metadata: deserializeMetadata(output),
2046
- };
2047
- break;
1987
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2048
1988
  case "ResourceNotFoundException":
2049
1989
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
2050
- response = {
2051
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2052
- name: errorCode,
2053
- $metadata: deserializeMetadata(output),
2054
- };
2055
- break;
1990
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2056
1991
  case "ValidationException":
2057
1992
  case "com.amazonaws.auditmanager#ValidationException":
2058
- response = {
2059
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2060
- name: errorCode,
2061
- $metadata: deserializeMetadata(output),
2062
- };
2063
- break;
1993
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2064
1994
  default:
2065
1995
  const parsedBody = parsedOutput.body;
2066
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2067
- response = {
2068
- ...parsedBody,
2069
- name: `${errorCode}`,
2070
- message: parsedBody.message || parsedBody.Message || errorCode,
1996
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
1997
+ name: parsedBody.code || parsedBody.Code || errorCode,
2071
1998
  $fault: "client",
2072
1999
  $metadata: deserializeMetadata(output),
2073
- };
2000
+ });
2001
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2074
2002
  }
2075
- const message = response.message || response.Message || errorCode;
2076
- response.message = message;
2077
- delete response.Message;
2078
- return Promise.reject(Object.assign(new Error(message), response));
2079
2003
  };
2080
2004
  const deserializeAws_restJson1BatchDeleteDelegationByAssessmentCommand = async (output, context) => {
2081
2005
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2103,51 +2027,25 @@ const deserializeAws_restJson1BatchDeleteDelegationByAssessmentCommandError = as
2103
2027
  switch (errorCode) {
2104
2028
  case "AccessDeniedException":
2105
2029
  case "com.amazonaws.auditmanager#AccessDeniedException":
2106
- response = {
2107
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2108
- name: errorCode,
2109
- $metadata: deserializeMetadata(output),
2110
- };
2111
- break;
2030
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2112
2031
  case "InternalServerException":
2113
2032
  case "com.amazonaws.auditmanager#InternalServerException":
2114
- response = {
2115
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2116
- name: errorCode,
2117
- $metadata: deserializeMetadata(output),
2118
- };
2119
- break;
2033
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2120
2034
  case "ResourceNotFoundException":
2121
2035
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
2122
- response = {
2123
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2124
- name: errorCode,
2125
- $metadata: deserializeMetadata(output),
2126
- };
2127
- break;
2036
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2128
2037
  case "ValidationException":
2129
2038
  case "com.amazonaws.auditmanager#ValidationException":
2130
- response = {
2131
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2132
- name: errorCode,
2133
- $metadata: deserializeMetadata(output),
2134
- };
2135
- break;
2039
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2136
2040
  default:
2137
2041
  const parsedBody = parsedOutput.body;
2138
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2139
- response = {
2140
- ...parsedBody,
2141
- name: `${errorCode}`,
2142
- message: parsedBody.message || parsedBody.Message || errorCode,
2042
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2043
+ name: parsedBody.code || parsedBody.Code || errorCode,
2143
2044
  $fault: "client",
2144
2045
  $metadata: deserializeMetadata(output),
2145
- };
2046
+ });
2047
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2146
2048
  }
2147
- const message = response.message || response.Message || errorCode;
2148
- response.message = message;
2149
- delete response.Message;
2150
- return Promise.reject(Object.assign(new Error(message), response));
2151
2049
  };
2152
2050
  const deserializeAws_restJson1BatchDisassociateAssessmentReportEvidenceCommand = async (output, context) => {
2153
2051
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2179,51 +2077,25 @@ const deserializeAws_restJson1BatchDisassociateAssessmentReportEvidenceCommandEr
2179
2077
  switch (errorCode) {
2180
2078
  case "AccessDeniedException":
2181
2079
  case "com.amazonaws.auditmanager#AccessDeniedException":
2182
- response = {
2183
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2184
- name: errorCode,
2185
- $metadata: deserializeMetadata(output),
2186
- };
2187
- break;
2080
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2188
2081
  case "InternalServerException":
2189
2082
  case "com.amazonaws.auditmanager#InternalServerException":
2190
- response = {
2191
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2192
- name: errorCode,
2193
- $metadata: deserializeMetadata(output),
2194
- };
2195
- break;
2083
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2196
2084
  case "ResourceNotFoundException":
2197
2085
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
2198
- response = {
2199
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2200
- name: errorCode,
2201
- $metadata: deserializeMetadata(output),
2202
- };
2203
- break;
2086
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2204
2087
  case "ValidationException":
2205
2088
  case "com.amazonaws.auditmanager#ValidationException":
2206
- response = {
2207
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2208
- name: errorCode,
2209
- $metadata: deserializeMetadata(output),
2210
- };
2211
- break;
2089
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2212
2090
  default:
2213
2091
  const parsedBody = parsedOutput.body;
2214
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2215
- response = {
2216
- ...parsedBody,
2217
- name: `${errorCode}`,
2218
- message: parsedBody.message || parsedBody.Message || errorCode,
2092
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2093
+ name: parsedBody.code || parsedBody.Code || errorCode,
2219
2094
  $fault: "client",
2220
2095
  $metadata: deserializeMetadata(output),
2221
- };
2096
+ });
2097
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2222
2098
  }
2223
- const message = response.message || response.Message || errorCode;
2224
- response.message = message;
2225
- delete response.Message;
2226
- return Promise.reject(Object.assign(new Error(message), response));
2227
2099
  };
2228
2100
  const deserializeAws_restJson1BatchImportEvidenceToAssessmentControlCommand = async (output, context) => {
2229
2101
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2251,51 +2123,25 @@ const deserializeAws_restJson1BatchImportEvidenceToAssessmentControlCommandError
2251
2123
  switch (errorCode) {
2252
2124
  case "AccessDeniedException":
2253
2125
  case "com.amazonaws.auditmanager#AccessDeniedException":
2254
- response = {
2255
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2256
- name: errorCode,
2257
- $metadata: deserializeMetadata(output),
2258
- };
2259
- break;
2126
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2260
2127
  case "InternalServerException":
2261
2128
  case "com.amazonaws.auditmanager#InternalServerException":
2262
- response = {
2263
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2264
- name: errorCode,
2265
- $metadata: deserializeMetadata(output),
2266
- };
2267
- break;
2129
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2268
2130
  case "ResourceNotFoundException":
2269
2131
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
2270
- response = {
2271
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2272
- name: errorCode,
2273
- $metadata: deserializeMetadata(output),
2274
- };
2275
- break;
2132
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2276
2133
  case "ValidationException":
2277
2134
  case "com.amazonaws.auditmanager#ValidationException":
2278
- response = {
2279
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2280
- name: errorCode,
2281
- $metadata: deserializeMetadata(output),
2282
- };
2283
- break;
2135
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2284
2136
  default:
2285
2137
  const parsedBody = parsedOutput.body;
2286
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2287
- response = {
2288
- ...parsedBody,
2289
- name: `${errorCode}`,
2290
- message: parsedBody.message || parsedBody.Message || errorCode,
2138
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2139
+ name: parsedBody.code || parsedBody.Code || errorCode,
2291
2140
  $fault: "client",
2292
2141
  $metadata: deserializeMetadata(output),
2293
- };
2142
+ });
2143
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2294
2144
  }
2295
- const message = response.message || response.Message || errorCode;
2296
- response.message = message;
2297
- delete response.Message;
2298
- return Promise.reject(Object.assign(new Error(message), response));
2299
2145
  };
2300
2146
  const deserializeAws_restJson1CreateAssessmentCommand = async (output, context) => {
2301
2147
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2323,51 +2169,25 @@ const deserializeAws_restJson1CreateAssessmentCommandError = async (output, cont
2323
2169
  switch (errorCode) {
2324
2170
  case "AccessDeniedException":
2325
2171
  case "com.amazonaws.auditmanager#AccessDeniedException":
2326
- response = {
2327
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2328
- name: errorCode,
2329
- $metadata: deserializeMetadata(output),
2330
- };
2331
- break;
2172
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2332
2173
  case "InternalServerException":
2333
2174
  case "com.amazonaws.auditmanager#InternalServerException":
2334
- response = {
2335
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2336
- name: errorCode,
2337
- $metadata: deserializeMetadata(output),
2338
- };
2339
- break;
2175
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2340
2176
  case "ResourceNotFoundException":
2341
2177
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
2342
- response = {
2343
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2344
- name: errorCode,
2345
- $metadata: deserializeMetadata(output),
2346
- };
2347
- break;
2178
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2348
2179
  case "ValidationException":
2349
2180
  case "com.amazonaws.auditmanager#ValidationException":
2350
- response = {
2351
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2352
- name: errorCode,
2353
- $metadata: deserializeMetadata(output),
2354
- };
2355
- break;
2181
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2356
2182
  default:
2357
2183
  const parsedBody = parsedOutput.body;
2358
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2359
- response = {
2360
- ...parsedBody,
2361
- name: `${errorCode}`,
2362
- message: parsedBody.message || parsedBody.Message || errorCode,
2184
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2185
+ name: parsedBody.code || parsedBody.Code || errorCode,
2363
2186
  $fault: "client",
2364
2187
  $metadata: deserializeMetadata(output),
2365
- };
2188
+ });
2189
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2366
2190
  }
2367
- const message = response.message || response.Message || errorCode;
2368
- response.message = message;
2369
- delete response.Message;
2370
- return Promise.reject(Object.assign(new Error(message), response));
2371
2191
  };
2372
2192
  const deserializeAws_restJson1CreateAssessmentFrameworkCommand = async (output, context) => {
2373
2193
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2395,51 +2215,25 @@ const deserializeAws_restJson1CreateAssessmentFrameworkCommandError = async (out
2395
2215
  switch (errorCode) {
2396
2216
  case "AccessDeniedException":
2397
2217
  case "com.amazonaws.auditmanager#AccessDeniedException":
2398
- response = {
2399
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2400
- name: errorCode,
2401
- $metadata: deserializeMetadata(output),
2402
- };
2403
- break;
2218
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2404
2219
  case "InternalServerException":
2405
2220
  case "com.amazonaws.auditmanager#InternalServerException":
2406
- response = {
2407
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2408
- name: errorCode,
2409
- $metadata: deserializeMetadata(output),
2410
- };
2411
- break;
2221
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2412
2222
  case "ResourceNotFoundException":
2413
2223
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
2414
- response = {
2415
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2416
- name: errorCode,
2417
- $metadata: deserializeMetadata(output),
2418
- };
2419
- break;
2224
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2420
2225
  case "ValidationException":
2421
2226
  case "com.amazonaws.auditmanager#ValidationException":
2422
- response = {
2423
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2424
- name: errorCode,
2425
- $metadata: deserializeMetadata(output),
2426
- };
2427
- break;
2227
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2428
2228
  default:
2429
2229
  const parsedBody = parsedOutput.body;
2430
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2431
- response = {
2432
- ...parsedBody,
2433
- name: `${errorCode}`,
2434
- message: parsedBody.message || parsedBody.Message || errorCode,
2230
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2231
+ name: parsedBody.code || parsedBody.Code || errorCode,
2435
2232
  $fault: "client",
2436
2233
  $metadata: deserializeMetadata(output),
2437
- };
2234
+ });
2235
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2438
2236
  }
2439
- const message = response.message || response.Message || errorCode;
2440
- response.message = message;
2441
- delete response.Message;
2442
- return Promise.reject(Object.assign(new Error(message), response));
2443
2237
  };
2444
2238
  const deserializeAws_restJson1CreateAssessmentReportCommand = async (output, context) => {
2445
2239
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2467,51 +2261,25 @@ const deserializeAws_restJson1CreateAssessmentReportCommandError = async (output
2467
2261
  switch (errorCode) {
2468
2262
  case "AccessDeniedException":
2469
2263
  case "com.amazonaws.auditmanager#AccessDeniedException":
2470
- response = {
2471
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2472
- name: errorCode,
2473
- $metadata: deserializeMetadata(output),
2474
- };
2475
- break;
2264
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2476
2265
  case "InternalServerException":
2477
2266
  case "com.amazonaws.auditmanager#InternalServerException":
2478
- response = {
2479
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2480
- name: errorCode,
2481
- $metadata: deserializeMetadata(output),
2482
- };
2483
- break;
2267
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2484
2268
  case "ResourceNotFoundException":
2485
2269
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
2486
- response = {
2487
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2488
- name: errorCode,
2489
- $metadata: deserializeMetadata(output),
2490
- };
2491
- break;
2270
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2492
2271
  case "ValidationException":
2493
2272
  case "com.amazonaws.auditmanager#ValidationException":
2494
- response = {
2495
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2496
- name: errorCode,
2497
- $metadata: deserializeMetadata(output),
2498
- };
2499
- break;
2273
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2500
2274
  default:
2501
2275
  const parsedBody = parsedOutput.body;
2502
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2503
- response = {
2504
- ...parsedBody,
2505
- name: `${errorCode}`,
2506
- message: parsedBody.message || parsedBody.Message || errorCode,
2276
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2277
+ name: parsedBody.code || parsedBody.Code || errorCode,
2507
2278
  $fault: "client",
2508
2279
  $metadata: deserializeMetadata(output),
2509
- };
2280
+ });
2281
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2510
2282
  }
2511
- const message = response.message || response.Message || errorCode;
2512
- response.message = message;
2513
- delete response.Message;
2514
- return Promise.reject(Object.assign(new Error(message), response));
2515
2283
  };
2516
2284
  const deserializeAws_restJson1CreateControlCommand = async (output, context) => {
2517
2285
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2539,51 +2307,25 @@ const deserializeAws_restJson1CreateControlCommandError = async (output, context
2539
2307
  switch (errorCode) {
2540
2308
  case "AccessDeniedException":
2541
2309
  case "com.amazonaws.auditmanager#AccessDeniedException":
2542
- response = {
2543
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2544
- name: errorCode,
2545
- $metadata: deserializeMetadata(output),
2546
- };
2547
- break;
2310
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2548
2311
  case "InternalServerException":
2549
2312
  case "com.amazonaws.auditmanager#InternalServerException":
2550
- response = {
2551
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2552
- name: errorCode,
2553
- $metadata: deserializeMetadata(output),
2554
- };
2555
- break;
2313
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2556
2314
  case "ResourceNotFoundException":
2557
2315
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
2558
- response = {
2559
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2560
- name: errorCode,
2561
- $metadata: deserializeMetadata(output),
2562
- };
2563
- break;
2316
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2564
2317
  case "ValidationException":
2565
2318
  case "com.amazonaws.auditmanager#ValidationException":
2566
- response = {
2567
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2568
- name: errorCode,
2569
- $metadata: deserializeMetadata(output),
2570
- };
2571
- break;
2319
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2572
2320
  default:
2573
2321
  const parsedBody = parsedOutput.body;
2574
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2575
- response = {
2576
- ...parsedBody,
2577
- name: `${errorCode}`,
2578
- message: parsedBody.message || parsedBody.Message || errorCode,
2322
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2323
+ name: parsedBody.code || parsedBody.Code || errorCode,
2579
2324
  $fault: "client",
2580
2325
  $metadata: deserializeMetadata(output),
2581
- };
2326
+ });
2327
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2582
2328
  }
2583
- const message = response.message || response.Message || errorCode;
2584
- response.message = message;
2585
- delete response.Message;
2586
- return Promise.reject(Object.assign(new Error(message), response));
2587
2329
  };
2588
2330
  const deserializeAws_restJson1DeleteAssessmentCommand = async (output, context) => {
2589
2331
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2607,51 +2349,25 @@ const deserializeAws_restJson1DeleteAssessmentCommandError = async (output, cont
2607
2349
  switch (errorCode) {
2608
2350
  case "AccessDeniedException":
2609
2351
  case "com.amazonaws.auditmanager#AccessDeniedException":
2610
- response = {
2611
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2612
- name: errorCode,
2613
- $metadata: deserializeMetadata(output),
2614
- };
2615
- break;
2352
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2616
2353
  case "InternalServerException":
2617
2354
  case "com.amazonaws.auditmanager#InternalServerException":
2618
- response = {
2619
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2620
- name: errorCode,
2621
- $metadata: deserializeMetadata(output),
2622
- };
2623
- break;
2355
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2624
2356
  case "ResourceNotFoundException":
2625
2357
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
2626
- response = {
2627
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2628
- name: errorCode,
2629
- $metadata: deserializeMetadata(output),
2630
- };
2631
- break;
2358
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2632
2359
  case "ValidationException":
2633
2360
  case "com.amazonaws.auditmanager#ValidationException":
2634
- response = {
2635
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2636
- name: errorCode,
2637
- $metadata: deserializeMetadata(output),
2638
- };
2639
- break;
2361
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2640
2362
  default:
2641
2363
  const parsedBody = parsedOutput.body;
2642
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2643
- response = {
2644
- ...parsedBody,
2645
- name: `${errorCode}`,
2646
- message: parsedBody.message || parsedBody.Message || errorCode,
2364
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2365
+ name: parsedBody.code || parsedBody.Code || errorCode,
2647
2366
  $fault: "client",
2648
2367
  $metadata: deserializeMetadata(output),
2649
- };
2368
+ });
2369
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2650
2370
  }
2651
- const message = response.message || response.Message || errorCode;
2652
- response.message = message;
2653
- delete response.Message;
2654
- return Promise.reject(Object.assign(new Error(message), response));
2655
2371
  };
2656
2372
  const deserializeAws_restJson1DeleteAssessmentFrameworkCommand = async (output, context) => {
2657
2373
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2675,51 +2391,25 @@ const deserializeAws_restJson1DeleteAssessmentFrameworkCommandError = async (out
2675
2391
  switch (errorCode) {
2676
2392
  case "AccessDeniedException":
2677
2393
  case "com.amazonaws.auditmanager#AccessDeniedException":
2678
- response = {
2679
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2680
- name: errorCode,
2681
- $metadata: deserializeMetadata(output),
2682
- };
2683
- break;
2394
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2684
2395
  case "InternalServerException":
2685
2396
  case "com.amazonaws.auditmanager#InternalServerException":
2686
- response = {
2687
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2688
- name: errorCode,
2689
- $metadata: deserializeMetadata(output),
2690
- };
2691
- break;
2397
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2692
2398
  case "ResourceNotFoundException":
2693
2399
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
2694
- response = {
2695
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2696
- name: errorCode,
2697
- $metadata: deserializeMetadata(output),
2698
- };
2699
- break;
2400
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2700
2401
  case "ValidationException":
2701
2402
  case "com.amazonaws.auditmanager#ValidationException":
2702
- response = {
2703
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2704
- name: errorCode,
2705
- $metadata: deserializeMetadata(output),
2706
- };
2707
- break;
2403
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2708
2404
  default:
2709
2405
  const parsedBody = parsedOutput.body;
2710
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2711
- response = {
2712
- ...parsedBody,
2713
- name: `${errorCode}`,
2714
- message: parsedBody.message || parsedBody.Message || errorCode,
2406
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2407
+ name: parsedBody.code || parsedBody.Code || errorCode,
2715
2408
  $fault: "client",
2716
2409
  $metadata: deserializeMetadata(output),
2717
- };
2410
+ });
2411
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2718
2412
  }
2719
- const message = response.message || response.Message || errorCode;
2720
- response.message = message;
2721
- delete response.Message;
2722
- return Promise.reject(Object.assign(new Error(message), response));
2723
2413
  };
2724
2414
  const deserializeAws_restJson1DeleteAssessmentFrameworkShareCommand = async (output, context) => {
2725
2415
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2743,51 +2433,25 @@ const deserializeAws_restJson1DeleteAssessmentFrameworkShareCommandError = async
2743
2433
  switch (errorCode) {
2744
2434
  case "AccessDeniedException":
2745
2435
  case "com.amazonaws.auditmanager#AccessDeniedException":
2746
- response = {
2747
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2748
- name: errorCode,
2749
- $metadata: deserializeMetadata(output),
2750
- };
2751
- break;
2436
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2752
2437
  case "InternalServerException":
2753
2438
  case "com.amazonaws.auditmanager#InternalServerException":
2754
- response = {
2755
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2756
- name: errorCode,
2757
- $metadata: deserializeMetadata(output),
2758
- };
2759
- break;
2439
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2760
2440
  case "ResourceNotFoundException":
2761
2441
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
2762
- response = {
2763
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2764
- name: errorCode,
2765
- $metadata: deserializeMetadata(output),
2766
- };
2767
- break;
2442
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2768
2443
  case "ValidationException":
2769
2444
  case "com.amazonaws.auditmanager#ValidationException":
2770
- response = {
2771
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2772
- name: errorCode,
2773
- $metadata: deserializeMetadata(output),
2774
- };
2775
- break;
2445
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2776
2446
  default:
2777
2447
  const parsedBody = parsedOutput.body;
2778
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2779
- response = {
2780
- ...parsedBody,
2781
- name: `${errorCode}`,
2782
- message: parsedBody.message || parsedBody.Message || errorCode,
2448
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2449
+ name: parsedBody.code || parsedBody.Code || errorCode,
2783
2450
  $fault: "client",
2784
2451
  $metadata: deserializeMetadata(output),
2785
- };
2452
+ });
2453
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2786
2454
  }
2787
- const message = response.message || response.Message || errorCode;
2788
- response.message = message;
2789
- delete response.Message;
2790
- return Promise.reject(Object.assign(new Error(message), response));
2791
2455
  };
2792
2456
  const deserializeAws_restJson1DeleteAssessmentReportCommand = async (output, context) => {
2793
2457
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2811,51 +2475,25 @@ const deserializeAws_restJson1DeleteAssessmentReportCommandError = async (output
2811
2475
  switch (errorCode) {
2812
2476
  case "AccessDeniedException":
2813
2477
  case "com.amazonaws.auditmanager#AccessDeniedException":
2814
- response = {
2815
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2816
- name: errorCode,
2817
- $metadata: deserializeMetadata(output),
2818
- };
2819
- break;
2478
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2820
2479
  case "InternalServerException":
2821
2480
  case "com.amazonaws.auditmanager#InternalServerException":
2822
- response = {
2823
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2824
- name: errorCode,
2825
- $metadata: deserializeMetadata(output),
2826
- };
2827
- break;
2481
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2828
2482
  case "ResourceNotFoundException":
2829
2483
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
2830
- response = {
2831
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2832
- name: errorCode,
2833
- $metadata: deserializeMetadata(output),
2834
- };
2835
- break;
2484
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2836
2485
  case "ValidationException":
2837
2486
  case "com.amazonaws.auditmanager#ValidationException":
2838
- response = {
2839
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2840
- name: errorCode,
2841
- $metadata: deserializeMetadata(output),
2842
- };
2843
- break;
2487
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2844
2488
  default:
2845
2489
  const parsedBody = parsedOutput.body;
2846
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2847
- response = {
2848
- ...parsedBody,
2849
- name: `${errorCode}`,
2850
- message: parsedBody.message || parsedBody.Message || errorCode,
2490
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2491
+ name: parsedBody.code || parsedBody.Code || errorCode,
2851
2492
  $fault: "client",
2852
2493
  $metadata: deserializeMetadata(output),
2853
- };
2494
+ });
2495
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2854
2496
  }
2855
- const message = response.message || response.Message || errorCode;
2856
- response.message = message;
2857
- delete response.Message;
2858
- return Promise.reject(Object.assign(new Error(message), response));
2859
2497
  };
2860
2498
  const deserializeAws_restJson1DeleteControlCommand = async (output, context) => {
2861
2499
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2879,51 +2517,25 @@ const deserializeAws_restJson1DeleteControlCommandError = async (output, context
2879
2517
  switch (errorCode) {
2880
2518
  case "AccessDeniedException":
2881
2519
  case "com.amazonaws.auditmanager#AccessDeniedException":
2882
- response = {
2883
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2884
- name: errorCode,
2885
- $metadata: deserializeMetadata(output),
2886
- };
2887
- break;
2520
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2888
2521
  case "InternalServerException":
2889
2522
  case "com.amazonaws.auditmanager#InternalServerException":
2890
- response = {
2891
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2892
- name: errorCode,
2893
- $metadata: deserializeMetadata(output),
2894
- };
2895
- break;
2523
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2896
2524
  case "ResourceNotFoundException":
2897
2525
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
2898
- response = {
2899
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2900
- name: errorCode,
2901
- $metadata: deserializeMetadata(output),
2902
- };
2903
- break;
2526
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2904
2527
  case "ValidationException":
2905
2528
  case "com.amazonaws.auditmanager#ValidationException":
2906
- response = {
2907
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2908
- name: errorCode,
2909
- $metadata: deserializeMetadata(output),
2910
- };
2911
- break;
2529
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2912
2530
  default:
2913
2531
  const parsedBody = parsedOutput.body;
2914
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2915
- response = {
2916
- ...parsedBody,
2917
- name: `${errorCode}`,
2918
- message: parsedBody.message || parsedBody.Message || errorCode,
2532
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2533
+ name: parsedBody.code || parsedBody.Code || errorCode,
2919
2534
  $fault: "client",
2920
2535
  $metadata: deserializeMetadata(output),
2921
- };
2536
+ });
2537
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2922
2538
  }
2923
- const message = response.message || response.Message || errorCode;
2924
- response.message = message;
2925
- delete response.Message;
2926
- return Promise.reject(Object.assign(new Error(message), response));
2927
2539
  };
2928
2540
  const deserializeAws_restJson1DeregisterAccountCommand = async (output, context) => {
2929
2541
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2951,51 +2563,25 @@ const deserializeAws_restJson1DeregisterAccountCommandError = async (output, con
2951
2563
  switch (errorCode) {
2952
2564
  case "AccessDeniedException":
2953
2565
  case "com.amazonaws.auditmanager#AccessDeniedException":
2954
- response = {
2955
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2956
- name: errorCode,
2957
- $metadata: deserializeMetadata(output),
2958
- };
2959
- break;
2566
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2960
2567
  case "InternalServerException":
2961
2568
  case "com.amazonaws.auditmanager#InternalServerException":
2962
- response = {
2963
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2964
- name: errorCode,
2965
- $metadata: deserializeMetadata(output),
2966
- };
2967
- break;
2569
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
2968
2570
  case "ResourceNotFoundException":
2969
2571
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
2970
- response = {
2971
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2972
- name: errorCode,
2973
- $metadata: deserializeMetadata(output),
2974
- };
2975
- break;
2572
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
2976
2573
  case "ValidationException":
2977
2574
  case "com.amazonaws.auditmanager#ValidationException":
2978
- response = {
2979
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
2980
- name: errorCode,
2981
- $metadata: deserializeMetadata(output),
2982
- };
2983
- break;
2575
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2984
2576
  default:
2985
2577
  const parsedBody = parsedOutput.body;
2986
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2987
- response = {
2988
- ...parsedBody,
2989
- name: `${errorCode}`,
2990
- message: parsedBody.message || parsedBody.Message || errorCode,
2578
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2579
+ name: parsedBody.code || parsedBody.Code || errorCode,
2991
2580
  $fault: "client",
2992
2581
  $metadata: deserializeMetadata(output),
2993
- };
2582
+ });
2583
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2994
2584
  }
2995
- const message = response.message || response.Message || errorCode;
2996
- response.message = message;
2997
- delete response.Message;
2998
- return Promise.reject(Object.assign(new Error(message), response));
2999
2585
  };
3000
2586
  const deserializeAws_restJson1DeregisterOrganizationAdminAccountCommand = async (output, context) => {
3001
2587
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3019,51 +2605,25 @@ const deserializeAws_restJson1DeregisterOrganizationAdminAccountCommandError = a
3019
2605
  switch (errorCode) {
3020
2606
  case "AccessDeniedException":
3021
2607
  case "com.amazonaws.auditmanager#AccessDeniedException":
3022
- response = {
3023
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3024
- name: errorCode,
3025
- $metadata: deserializeMetadata(output),
3026
- };
3027
- break;
2608
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3028
2609
  case "InternalServerException":
3029
2610
  case "com.amazonaws.auditmanager#InternalServerException":
3030
- response = {
3031
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3032
- name: errorCode,
3033
- $metadata: deserializeMetadata(output),
3034
- };
3035
- break;
2611
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3036
2612
  case "ResourceNotFoundException":
3037
2613
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
3038
- response = {
3039
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3040
- name: errorCode,
3041
- $metadata: deserializeMetadata(output),
3042
- };
3043
- break;
2614
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3044
2615
  case "ValidationException":
3045
2616
  case "com.amazonaws.auditmanager#ValidationException":
3046
- response = {
3047
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3048
- name: errorCode,
3049
- $metadata: deserializeMetadata(output),
3050
- };
3051
- break;
2617
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3052
2618
  default:
3053
2619
  const parsedBody = parsedOutput.body;
3054
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3055
- response = {
3056
- ...parsedBody,
3057
- name: `${errorCode}`,
3058
- message: parsedBody.message || parsedBody.Message || errorCode,
2620
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2621
+ name: parsedBody.code || parsedBody.Code || errorCode,
3059
2622
  $fault: "client",
3060
2623
  $metadata: deserializeMetadata(output),
3061
- };
2624
+ });
2625
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3062
2626
  }
3063
- const message = response.message || response.Message || errorCode;
3064
- response.message = message;
3065
- delete response.Message;
3066
- return Promise.reject(Object.assign(new Error(message), response));
3067
2627
  };
3068
2628
  const deserializeAws_restJson1DisassociateAssessmentReportEvidenceFolderCommand = async (output, context) => {
3069
2629
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3087,51 +2647,25 @@ const deserializeAws_restJson1DisassociateAssessmentReportEvidenceFolderCommandE
3087
2647
  switch (errorCode) {
3088
2648
  case "AccessDeniedException":
3089
2649
  case "com.amazonaws.auditmanager#AccessDeniedException":
3090
- response = {
3091
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3092
- name: errorCode,
3093
- $metadata: deserializeMetadata(output),
3094
- };
3095
- break;
2650
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3096
2651
  case "InternalServerException":
3097
2652
  case "com.amazonaws.auditmanager#InternalServerException":
3098
- response = {
3099
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3100
- name: errorCode,
3101
- $metadata: deserializeMetadata(output),
3102
- };
3103
- break;
2653
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3104
2654
  case "ResourceNotFoundException":
3105
2655
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
3106
- response = {
3107
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3108
- name: errorCode,
3109
- $metadata: deserializeMetadata(output),
3110
- };
3111
- break;
2656
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3112
2657
  case "ValidationException":
3113
2658
  case "com.amazonaws.auditmanager#ValidationException":
3114
- response = {
3115
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3116
- name: errorCode,
3117
- $metadata: deserializeMetadata(output),
3118
- };
3119
- break;
2659
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3120
2660
  default:
3121
2661
  const parsedBody = parsedOutput.body;
3122
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3123
- response = {
3124
- ...parsedBody,
3125
- name: `${errorCode}`,
3126
- message: parsedBody.message || parsedBody.Message || errorCode,
2662
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2663
+ name: parsedBody.code || parsedBody.Code || errorCode,
3127
2664
  $fault: "client",
3128
2665
  $metadata: deserializeMetadata(output),
3129
- };
2666
+ });
2667
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3130
2668
  }
3131
- const message = response.message || response.Message || errorCode;
3132
- response.message = message;
3133
- delete response.Message;
3134
- return Promise.reject(Object.assign(new Error(message), response));
3135
2669
  };
3136
2670
  const deserializeAws_restJson1GetAccountStatusCommand = async (output, context) => {
3137
2671
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3159,27 +2693,16 @@ const deserializeAws_restJson1GetAccountStatusCommandError = async (output, cont
3159
2693
  switch (errorCode) {
3160
2694
  case "InternalServerException":
3161
2695
  case "com.amazonaws.auditmanager#InternalServerException":
3162
- response = {
3163
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3164
- name: errorCode,
3165
- $metadata: deserializeMetadata(output),
3166
- };
3167
- break;
2696
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3168
2697
  default:
3169
2698
  const parsedBody = parsedOutput.body;
3170
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3171
- response = {
3172
- ...parsedBody,
3173
- name: `${errorCode}`,
3174
- message: parsedBody.message || parsedBody.Message || errorCode,
2699
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2700
+ name: parsedBody.code || parsedBody.Code || errorCode,
3175
2701
  $fault: "client",
3176
2702
  $metadata: deserializeMetadata(output),
3177
- };
2703
+ });
2704
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3178
2705
  }
3179
- const message = response.message || response.Message || errorCode;
3180
- response.message = message;
3181
- delete response.Message;
3182
- return Promise.reject(Object.assign(new Error(message), response));
3183
2706
  };
3184
2707
  const deserializeAws_restJson1GetAssessmentCommand = async (output, context) => {
3185
2708
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3211,51 +2734,25 @@ const deserializeAws_restJson1GetAssessmentCommandError = async (output, context
3211
2734
  switch (errorCode) {
3212
2735
  case "AccessDeniedException":
3213
2736
  case "com.amazonaws.auditmanager#AccessDeniedException":
3214
- response = {
3215
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3216
- name: errorCode,
3217
- $metadata: deserializeMetadata(output),
3218
- };
3219
- break;
2737
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3220
2738
  case "InternalServerException":
3221
2739
  case "com.amazonaws.auditmanager#InternalServerException":
3222
- response = {
3223
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3224
- name: errorCode,
3225
- $metadata: deserializeMetadata(output),
3226
- };
3227
- break;
2740
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3228
2741
  case "ResourceNotFoundException":
3229
2742
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
3230
- response = {
3231
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3232
- name: errorCode,
3233
- $metadata: deserializeMetadata(output),
3234
- };
3235
- break;
2743
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3236
2744
  case "ValidationException":
3237
2745
  case "com.amazonaws.auditmanager#ValidationException":
3238
- response = {
3239
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3240
- name: errorCode,
3241
- $metadata: deserializeMetadata(output),
3242
- };
3243
- break;
2746
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3244
2747
  default:
3245
2748
  const parsedBody = parsedOutput.body;
3246
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3247
- response = {
3248
- ...parsedBody,
3249
- name: `${errorCode}`,
3250
- message: parsedBody.message || parsedBody.Message || errorCode,
2749
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2750
+ name: parsedBody.code || parsedBody.Code || errorCode,
3251
2751
  $fault: "client",
3252
2752
  $metadata: deserializeMetadata(output),
3253
- };
2753
+ });
2754
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3254
2755
  }
3255
- const message = response.message || response.Message || errorCode;
3256
- response.message = message;
3257
- delete response.Message;
3258
- return Promise.reject(Object.assign(new Error(message), response));
3259
2756
  };
3260
2757
  const deserializeAws_restJson1GetAssessmentFrameworkCommand = async (output, context) => {
3261
2758
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3283,51 +2780,25 @@ const deserializeAws_restJson1GetAssessmentFrameworkCommandError = async (output
3283
2780
  switch (errorCode) {
3284
2781
  case "AccessDeniedException":
3285
2782
  case "com.amazonaws.auditmanager#AccessDeniedException":
3286
- response = {
3287
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3288
- name: errorCode,
3289
- $metadata: deserializeMetadata(output),
3290
- };
3291
- break;
2783
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3292
2784
  case "InternalServerException":
3293
2785
  case "com.amazonaws.auditmanager#InternalServerException":
3294
- response = {
3295
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3296
- name: errorCode,
3297
- $metadata: deserializeMetadata(output),
3298
- };
3299
- break;
2786
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3300
2787
  case "ResourceNotFoundException":
3301
2788
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
3302
- response = {
3303
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3304
- name: errorCode,
3305
- $metadata: deserializeMetadata(output),
3306
- };
3307
- break;
2789
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3308
2790
  case "ValidationException":
3309
2791
  case "com.amazonaws.auditmanager#ValidationException":
3310
- response = {
3311
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3312
- name: errorCode,
3313
- $metadata: deserializeMetadata(output),
3314
- };
3315
- break;
2792
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3316
2793
  default:
3317
2794
  const parsedBody = parsedOutput.body;
3318
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3319
- response = {
3320
- ...parsedBody,
3321
- name: `${errorCode}`,
3322
- message: parsedBody.message || parsedBody.Message || errorCode,
2795
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2796
+ name: parsedBody.code || parsedBody.Code || errorCode,
3323
2797
  $fault: "client",
3324
2798
  $metadata: deserializeMetadata(output),
3325
- };
2799
+ });
2800
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3326
2801
  }
3327
- const message = response.message || response.Message || errorCode;
3328
- response.message = message;
3329
- delete response.Message;
3330
- return Promise.reject(Object.assign(new Error(message), response));
3331
2802
  };
3332
2803
  const deserializeAws_restJson1GetAssessmentReportUrlCommand = async (output, context) => {
3333
2804
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3355,51 +2826,25 @@ const deserializeAws_restJson1GetAssessmentReportUrlCommandError = async (output
3355
2826
  switch (errorCode) {
3356
2827
  case "AccessDeniedException":
3357
2828
  case "com.amazonaws.auditmanager#AccessDeniedException":
3358
- response = {
3359
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3360
- name: errorCode,
3361
- $metadata: deserializeMetadata(output),
3362
- };
3363
- break;
2829
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3364
2830
  case "InternalServerException":
3365
2831
  case "com.amazonaws.auditmanager#InternalServerException":
3366
- response = {
3367
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3368
- name: errorCode,
3369
- $metadata: deserializeMetadata(output),
3370
- };
3371
- break;
2832
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3372
2833
  case "ResourceNotFoundException":
3373
2834
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
3374
- response = {
3375
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3376
- name: errorCode,
3377
- $metadata: deserializeMetadata(output),
3378
- };
3379
- break;
2835
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3380
2836
  case "ValidationException":
3381
2837
  case "com.amazonaws.auditmanager#ValidationException":
3382
- response = {
3383
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3384
- name: errorCode,
3385
- $metadata: deserializeMetadata(output),
3386
- };
3387
- break;
2838
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3388
2839
  default:
3389
2840
  const parsedBody = parsedOutput.body;
3390
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3391
- response = {
3392
- ...parsedBody,
3393
- name: `${errorCode}`,
3394
- message: parsedBody.message || parsedBody.Message || errorCode,
2841
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2842
+ name: parsedBody.code || parsedBody.Code || errorCode,
3395
2843
  $fault: "client",
3396
2844
  $metadata: deserializeMetadata(output),
3397
- };
2845
+ });
2846
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3398
2847
  }
3399
- const message = response.message || response.Message || errorCode;
3400
- response.message = message;
3401
- delete response.Message;
3402
- return Promise.reject(Object.assign(new Error(message), response));
3403
2848
  };
3404
2849
  const deserializeAws_restJson1GetChangeLogsCommand = async (output, context) => {
3405
2850
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3431,51 +2876,25 @@ const deserializeAws_restJson1GetChangeLogsCommandError = async (output, context
3431
2876
  switch (errorCode) {
3432
2877
  case "AccessDeniedException":
3433
2878
  case "com.amazonaws.auditmanager#AccessDeniedException":
3434
- response = {
3435
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3436
- name: errorCode,
3437
- $metadata: deserializeMetadata(output),
3438
- };
3439
- break;
2879
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3440
2880
  case "InternalServerException":
3441
2881
  case "com.amazonaws.auditmanager#InternalServerException":
3442
- response = {
3443
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3444
- name: errorCode,
3445
- $metadata: deserializeMetadata(output),
3446
- };
3447
- break;
2882
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3448
2883
  case "ResourceNotFoundException":
3449
2884
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
3450
- response = {
3451
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3452
- name: errorCode,
3453
- $metadata: deserializeMetadata(output),
3454
- };
3455
- break;
2885
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3456
2886
  case "ValidationException":
3457
2887
  case "com.amazonaws.auditmanager#ValidationException":
3458
- response = {
3459
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3460
- name: errorCode,
3461
- $metadata: deserializeMetadata(output),
3462
- };
3463
- break;
2888
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3464
2889
  default:
3465
2890
  const parsedBody = parsedOutput.body;
3466
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3467
- response = {
3468
- ...parsedBody,
3469
- name: `${errorCode}`,
3470
- message: parsedBody.message || parsedBody.Message || errorCode,
2891
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2892
+ name: parsedBody.code || parsedBody.Code || errorCode,
3471
2893
  $fault: "client",
3472
2894
  $metadata: deserializeMetadata(output),
3473
- };
2895
+ });
2896
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3474
2897
  }
3475
- const message = response.message || response.Message || errorCode;
3476
- response.message = message;
3477
- delete response.Message;
3478
- return Promise.reject(Object.assign(new Error(message), response));
3479
2898
  };
3480
2899
  const deserializeAws_restJson1GetControlCommand = async (output, context) => {
3481
2900
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3503,51 +2922,25 @@ const deserializeAws_restJson1GetControlCommandError = async (output, context) =
3503
2922
  switch (errorCode) {
3504
2923
  case "AccessDeniedException":
3505
2924
  case "com.amazonaws.auditmanager#AccessDeniedException":
3506
- response = {
3507
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3508
- name: errorCode,
3509
- $metadata: deserializeMetadata(output),
3510
- };
3511
- break;
2925
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3512
2926
  case "InternalServerException":
3513
2927
  case "com.amazonaws.auditmanager#InternalServerException":
3514
- response = {
3515
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3516
- name: errorCode,
3517
- $metadata: deserializeMetadata(output),
3518
- };
3519
- break;
2928
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3520
2929
  case "ResourceNotFoundException":
3521
2930
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
3522
- response = {
3523
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3524
- name: errorCode,
3525
- $metadata: deserializeMetadata(output),
3526
- };
3527
- break;
2931
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3528
2932
  case "ValidationException":
3529
2933
  case "com.amazonaws.auditmanager#ValidationException":
3530
- response = {
3531
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3532
- name: errorCode,
3533
- $metadata: deserializeMetadata(output),
3534
- };
3535
- break;
2934
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3536
2935
  default:
3537
2936
  const parsedBody = parsedOutput.body;
3538
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3539
- response = {
3540
- ...parsedBody,
3541
- name: `${errorCode}`,
3542
- message: parsedBody.message || parsedBody.Message || errorCode,
2937
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2938
+ name: parsedBody.code || parsedBody.Code || errorCode,
3543
2939
  $fault: "client",
3544
2940
  $metadata: deserializeMetadata(output),
3545
- };
2941
+ });
2942
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3546
2943
  }
3547
- const message = response.message || response.Message || errorCode;
3548
- response.message = message;
3549
- delete response.Message;
3550
- return Promise.reject(Object.assign(new Error(message), response));
3551
2944
  };
3552
2945
  const deserializeAws_restJson1GetDelegationsCommand = async (output, context) => {
3553
2946
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3579,43 +2972,22 @@ const deserializeAws_restJson1GetDelegationsCommandError = async (output, contex
3579
2972
  switch (errorCode) {
3580
2973
  case "AccessDeniedException":
3581
2974
  case "com.amazonaws.auditmanager#AccessDeniedException":
3582
- response = {
3583
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3584
- name: errorCode,
3585
- $metadata: deserializeMetadata(output),
3586
- };
3587
- break;
2975
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3588
2976
  case "InternalServerException":
3589
2977
  case "com.amazonaws.auditmanager#InternalServerException":
3590
- response = {
3591
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3592
- name: errorCode,
3593
- $metadata: deserializeMetadata(output),
3594
- };
3595
- break;
2978
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3596
2979
  case "ValidationException":
3597
2980
  case "com.amazonaws.auditmanager#ValidationException":
3598
- response = {
3599
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3600
- name: errorCode,
3601
- $metadata: deserializeMetadata(output),
3602
- };
3603
- break;
2981
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3604
2982
  default:
3605
2983
  const parsedBody = parsedOutput.body;
3606
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3607
- response = {
3608
- ...parsedBody,
3609
- name: `${errorCode}`,
3610
- message: parsedBody.message || parsedBody.Message || errorCode,
2984
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
2985
+ name: parsedBody.code || parsedBody.Code || errorCode,
3611
2986
  $fault: "client",
3612
2987
  $metadata: deserializeMetadata(output),
3613
- };
2988
+ });
2989
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3614
2990
  }
3615
- const message = response.message || response.Message || errorCode;
3616
- response.message = message;
3617
- delete response.Message;
3618
- return Promise.reject(Object.assign(new Error(message), response));
3619
2991
  };
3620
2992
  const deserializeAws_restJson1GetEvidenceCommand = async (output, context) => {
3621
2993
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3643,51 +3015,25 @@ const deserializeAws_restJson1GetEvidenceCommandError = async (output, context)
3643
3015
  switch (errorCode) {
3644
3016
  case "AccessDeniedException":
3645
3017
  case "com.amazonaws.auditmanager#AccessDeniedException":
3646
- response = {
3647
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3648
- name: errorCode,
3649
- $metadata: deserializeMetadata(output),
3650
- };
3651
- break;
3018
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3652
3019
  case "InternalServerException":
3653
3020
  case "com.amazonaws.auditmanager#InternalServerException":
3654
- response = {
3655
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3656
- name: errorCode,
3657
- $metadata: deserializeMetadata(output),
3658
- };
3659
- break;
3021
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3660
3022
  case "ResourceNotFoundException":
3661
3023
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
3662
- response = {
3663
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3664
- name: errorCode,
3665
- $metadata: deserializeMetadata(output),
3666
- };
3667
- break;
3024
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3668
3025
  case "ValidationException":
3669
3026
  case "com.amazonaws.auditmanager#ValidationException":
3670
- response = {
3671
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3672
- name: errorCode,
3673
- $metadata: deserializeMetadata(output),
3674
- };
3675
- break;
3027
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3676
3028
  default:
3677
3029
  const parsedBody = parsedOutput.body;
3678
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3679
- response = {
3680
- ...parsedBody,
3681
- name: `${errorCode}`,
3682
- message: parsedBody.message || parsedBody.Message || errorCode,
3030
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3031
+ name: parsedBody.code || parsedBody.Code || errorCode,
3683
3032
  $fault: "client",
3684
3033
  $metadata: deserializeMetadata(output),
3685
- };
3034
+ });
3035
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3686
3036
  }
3687
- const message = response.message || response.Message || errorCode;
3688
- response.message = message;
3689
- delete response.Message;
3690
- return Promise.reject(Object.assign(new Error(message), response));
3691
3037
  };
3692
3038
  const deserializeAws_restJson1GetEvidenceByEvidenceFolderCommand = async (output, context) => {
3693
3039
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3719,51 +3065,25 @@ const deserializeAws_restJson1GetEvidenceByEvidenceFolderCommandError = async (o
3719
3065
  switch (errorCode) {
3720
3066
  case "AccessDeniedException":
3721
3067
  case "com.amazonaws.auditmanager#AccessDeniedException":
3722
- response = {
3723
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3724
- name: errorCode,
3725
- $metadata: deserializeMetadata(output),
3726
- };
3727
- break;
3068
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3728
3069
  case "InternalServerException":
3729
3070
  case "com.amazonaws.auditmanager#InternalServerException":
3730
- response = {
3731
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3732
- name: errorCode,
3733
- $metadata: deserializeMetadata(output),
3734
- };
3735
- break;
3071
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3736
3072
  case "ResourceNotFoundException":
3737
3073
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
3738
- response = {
3739
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3740
- name: errorCode,
3741
- $metadata: deserializeMetadata(output),
3742
- };
3743
- break;
3074
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3744
3075
  case "ValidationException":
3745
3076
  case "com.amazonaws.auditmanager#ValidationException":
3746
- response = {
3747
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3748
- name: errorCode,
3749
- $metadata: deserializeMetadata(output),
3750
- };
3751
- break;
3077
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3752
3078
  default:
3753
3079
  const parsedBody = parsedOutput.body;
3754
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3755
- response = {
3756
- ...parsedBody,
3757
- name: `${errorCode}`,
3758
- message: parsedBody.message || parsedBody.Message || errorCode,
3080
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3081
+ name: parsedBody.code || parsedBody.Code || errorCode,
3759
3082
  $fault: "client",
3760
3083
  $metadata: deserializeMetadata(output),
3761
- };
3084
+ });
3085
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3762
3086
  }
3763
- const message = response.message || response.Message || errorCode;
3764
- response.message = message;
3765
- delete response.Message;
3766
- return Promise.reject(Object.assign(new Error(message), response));
3767
3087
  };
3768
3088
  const deserializeAws_restJson1GetEvidenceFolderCommand = async (output, context) => {
3769
3089
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3791,51 +3111,25 @@ const deserializeAws_restJson1GetEvidenceFolderCommandError = async (output, con
3791
3111
  switch (errorCode) {
3792
3112
  case "AccessDeniedException":
3793
3113
  case "com.amazonaws.auditmanager#AccessDeniedException":
3794
- response = {
3795
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3796
- name: errorCode,
3797
- $metadata: deserializeMetadata(output),
3798
- };
3799
- break;
3114
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3800
3115
  case "InternalServerException":
3801
3116
  case "com.amazonaws.auditmanager#InternalServerException":
3802
- response = {
3803
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3804
- name: errorCode,
3805
- $metadata: deserializeMetadata(output),
3806
- };
3807
- break;
3117
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3808
3118
  case "ResourceNotFoundException":
3809
3119
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
3810
- response = {
3811
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3812
- name: errorCode,
3813
- $metadata: deserializeMetadata(output),
3814
- };
3815
- break;
3120
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3816
3121
  case "ValidationException":
3817
3122
  case "com.amazonaws.auditmanager#ValidationException":
3818
- response = {
3819
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3820
- name: errorCode,
3821
- $metadata: deserializeMetadata(output),
3822
- };
3823
- break;
3123
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3824
3124
  default:
3825
3125
  const parsedBody = parsedOutput.body;
3826
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3827
- response = {
3828
- ...parsedBody,
3829
- name: `${errorCode}`,
3830
- message: parsedBody.message || parsedBody.Message || errorCode,
3126
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3127
+ name: parsedBody.code || parsedBody.Code || errorCode,
3831
3128
  $fault: "client",
3832
3129
  $metadata: deserializeMetadata(output),
3833
- };
3130
+ });
3131
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3834
3132
  }
3835
- const message = response.message || response.Message || errorCode;
3836
- response.message = message;
3837
- delete response.Message;
3838
- return Promise.reject(Object.assign(new Error(message), response));
3839
3133
  };
3840
3134
  const deserializeAws_restJson1GetEvidenceFoldersByAssessmentCommand = async (output, context) => {
3841
3135
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3867,51 +3161,25 @@ const deserializeAws_restJson1GetEvidenceFoldersByAssessmentCommandError = async
3867
3161
  switch (errorCode) {
3868
3162
  case "AccessDeniedException":
3869
3163
  case "com.amazonaws.auditmanager#AccessDeniedException":
3870
- response = {
3871
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3872
- name: errorCode,
3873
- $metadata: deserializeMetadata(output),
3874
- };
3875
- break;
3164
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3876
3165
  case "InternalServerException":
3877
3166
  case "com.amazonaws.auditmanager#InternalServerException":
3878
- response = {
3879
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3880
- name: errorCode,
3881
- $metadata: deserializeMetadata(output),
3882
- };
3883
- break;
3167
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3884
3168
  case "ResourceNotFoundException":
3885
3169
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
3886
- response = {
3887
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3888
- name: errorCode,
3889
- $metadata: deserializeMetadata(output),
3890
- };
3891
- break;
3170
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3892
3171
  case "ValidationException":
3893
3172
  case "com.amazonaws.auditmanager#ValidationException":
3894
- response = {
3895
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3896
- name: errorCode,
3897
- $metadata: deserializeMetadata(output),
3898
- };
3899
- break;
3173
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3900
3174
  default:
3901
3175
  const parsedBody = parsedOutput.body;
3902
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3903
- response = {
3904
- ...parsedBody,
3905
- name: `${errorCode}`,
3906
- message: parsedBody.message || parsedBody.Message || errorCode,
3176
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3177
+ name: parsedBody.code || parsedBody.Code || errorCode,
3907
3178
  $fault: "client",
3908
3179
  $metadata: deserializeMetadata(output),
3909
- };
3180
+ });
3181
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3910
3182
  }
3911
- const message = response.message || response.Message || errorCode;
3912
- response.message = message;
3913
- delete response.Message;
3914
- return Promise.reject(Object.assign(new Error(message), response));
3915
3183
  };
3916
3184
  const deserializeAws_restJson1GetEvidenceFoldersByAssessmentControlCommand = async (output, context) => {
3917
3185
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3943,51 +3211,25 @@ const deserializeAws_restJson1GetEvidenceFoldersByAssessmentControlCommandError
3943
3211
  switch (errorCode) {
3944
3212
  case "AccessDeniedException":
3945
3213
  case "com.amazonaws.auditmanager#AccessDeniedException":
3946
- response = {
3947
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3948
- name: errorCode,
3949
- $metadata: deserializeMetadata(output),
3950
- };
3951
- break;
3214
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3952
3215
  case "InternalServerException":
3953
3216
  case "com.amazonaws.auditmanager#InternalServerException":
3954
- response = {
3955
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3956
- name: errorCode,
3957
- $metadata: deserializeMetadata(output),
3958
- };
3959
- break;
3217
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
3960
3218
  case "ResourceNotFoundException":
3961
3219
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
3962
- response = {
3963
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
3964
- name: errorCode,
3965
- $metadata: deserializeMetadata(output),
3966
- };
3967
- break;
3220
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
3968
3221
  case "ValidationException":
3969
3222
  case "com.amazonaws.auditmanager#ValidationException":
3970
- response = {
3971
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3972
- name: errorCode,
3973
- $metadata: deserializeMetadata(output),
3974
- };
3975
- break;
3223
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
3976
3224
  default:
3977
3225
  const parsedBody = parsedOutput.body;
3978
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3979
- response = {
3980
- ...parsedBody,
3981
- name: `${errorCode}`,
3982
- message: parsedBody.message || parsedBody.Message || errorCode,
3226
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3227
+ name: parsedBody.code || parsedBody.Code || errorCode,
3983
3228
  $fault: "client",
3984
3229
  $metadata: deserializeMetadata(output),
3985
- };
3230
+ });
3231
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3986
3232
  }
3987
- const message = response.message || response.Message || errorCode;
3988
- response.message = message;
3989
- delete response.Message;
3990
- return Promise.reject(Object.assign(new Error(message), response));
3991
3233
  };
3992
3234
  const deserializeAws_restJson1GetInsightsCommand = async (output, context) => {
3993
3235
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4015,35 +3257,19 @@ const deserializeAws_restJson1GetInsightsCommandError = async (output, context)
4015
3257
  switch (errorCode) {
4016
3258
  case "AccessDeniedException":
4017
3259
  case "com.amazonaws.auditmanager#AccessDeniedException":
4018
- response = {
4019
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4020
- name: errorCode,
4021
- $metadata: deserializeMetadata(output),
4022
- };
4023
- break;
3260
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4024
3261
  case "InternalServerException":
4025
3262
  case "com.amazonaws.auditmanager#InternalServerException":
4026
- response = {
4027
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
4028
- name: errorCode,
4029
- $metadata: deserializeMetadata(output),
4030
- };
4031
- break;
3263
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
4032
3264
  default:
4033
3265
  const parsedBody = parsedOutput.body;
4034
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4035
- response = {
4036
- ...parsedBody,
4037
- name: `${errorCode}`,
4038
- message: parsedBody.message || parsedBody.Message || errorCode,
3266
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3267
+ name: parsedBody.code || parsedBody.Code || errorCode,
4039
3268
  $fault: "client",
4040
3269
  $metadata: deserializeMetadata(output),
4041
- };
3270
+ });
3271
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4042
3272
  }
4043
- const message = response.message || response.Message || errorCode;
4044
- response.message = message;
4045
- delete response.Message;
4046
- return Promise.reject(Object.assign(new Error(message), response));
4047
3273
  };
4048
3274
  const deserializeAws_restJson1GetInsightsByAssessmentCommand = async (output, context) => {
4049
3275
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4071,51 +3297,25 @@ const deserializeAws_restJson1GetInsightsByAssessmentCommandError = async (outpu
4071
3297
  switch (errorCode) {
4072
3298
  case "AccessDeniedException":
4073
3299
  case "com.amazonaws.auditmanager#AccessDeniedException":
4074
- response = {
4075
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4076
- name: errorCode,
4077
- $metadata: deserializeMetadata(output),
4078
- };
4079
- break;
3300
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4080
3301
  case "InternalServerException":
4081
3302
  case "com.amazonaws.auditmanager#InternalServerException":
4082
- response = {
4083
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
4084
- name: errorCode,
4085
- $metadata: deserializeMetadata(output),
4086
- };
4087
- break;
3303
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
4088
3304
  case "ResourceNotFoundException":
4089
3305
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
4090
- response = {
4091
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4092
- name: errorCode,
4093
- $metadata: deserializeMetadata(output),
4094
- };
4095
- break;
3306
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
4096
3307
  case "ValidationException":
4097
3308
  case "com.amazonaws.auditmanager#ValidationException":
4098
- response = {
4099
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
4100
- name: errorCode,
4101
- $metadata: deserializeMetadata(output),
4102
- };
4103
- break;
3309
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4104
3310
  default:
4105
3311
  const parsedBody = parsedOutput.body;
4106
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4107
- response = {
4108
- ...parsedBody,
4109
- name: `${errorCode}`,
4110
- message: parsedBody.message || parsedBody.Message || errorCode,
3312
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3313
+ name: parsedBody.code || parsedBody.Code || errorCode,
4111
3314
  $fault: "client",
4112
3315
  $metadata: deserializeMetadata(output),
4113
- };
3316
+ });
3317
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4114
3318
  }
4115
- const message = response.message || response.Message || errorCode;
4116
- response.message = message;
4117
- delete response.Message;
4118
- return Promise.reject(Object.assign(new Error(message), response));
4119
3319
  };
4120
3320
  const deserializeAws_restJson1GetOrganizationAdminAccountCommand = async (output, context) => {
4121
3321
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4147,51 +3347,25 @@ const deserializeAws_restJson1GetOrganizationAdminAccountCommandError = async (o
4147
3347
  switch (errorCode) {
4148
3348
  case "AccessDeniedException":
4149
3349
  case "com.amazonaws.auditmanager#AccessDeniedException":
4150
- response = {
4151
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4152
- name: errorCode,
4153
- $metadata: deserializeMetadata(output),
4154
- };
4155
- break;
3350
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4156
3351
  case "InternalServerException":
4157
3352
  case "com.amazonaws.auditmanager#InternalServerException":
4158
- response = {
4159
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
4160
- name: errorCode,
4161
- $metadata: deserializeMetadata(output),
4162
- };
4163
- break;
3353
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
4164
3354
  case "ResourceNotFoundException":
4165
3355
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
4166
- response = {
4167
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4168
- name: errorCode,
4169
- $metadata: deserializeMetadata(output),
4170
- };
4171
- break;
3356
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
4172
3357
  case "ValidationException":
4173
3358
  case "com.amazonaws.auditmanager#ValidationException":
4174
- response = {
4175
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
4176
- name: errorCode,
4177
- $metadata: deserializeMetadata(output),
4178
- };
4179
- break;
3359
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4180
3360
  default:
4181
3361
  const parsedBody = parsedOutput.body;
4182
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4183
- response = {
4184
- ...parsedBody,
4185
- name: `${errorCode}`,
4186
- message: parsedBody.message || parsedBody.Message || errorCode,
3362
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3363
+ name: parsedBody.code || parsedBody.Code || errorCode,
4187
3364
  $fault: "client",
4188
3365
  $metadata: deserializeMetadata(output),
4189
- };
3366
+ });
3367
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4190
3368
  }
4191
- const message = response.message || response.Message || errorCode;
4192
- response.message = message;
4193
- delete response.Message;
4194
- return Promise.reject(Object.assign(new Error(message), response));
4195
3369
  };
4196
3370
  const deserializeAws_restJson1GetServicesInScopeCommand = async (output, context) => {
4197
3371
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4219,43 +3393,22 @@ const deserializeAws_restJson1GetServicesInScopeCommandError = async (output, co
4219
3393
  switch (errorCode) {
4220
3394
  case "AccessDeniedException":
4221
3395
  case "com.amazonaws.auditmanager#AccessDeniedException":
4222
- response = {
4223
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4224
- name: errorCode,
4225
- $metadata: deserializeMetadata(output),
4226
- };
4227
- break;
3396
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4228
3397
  case "InternalServerException":
4229
3398
  case "com.amazonaws.auditmanager#InternalServerException":
4230
- response = {
4231
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
4232
- name: errorCode,
4233
- $metadata: deserializeMetadata(output),
4234
- };
4235
- break;
3399
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
4236
3400
  case "ValidationException":
4237
3401
  case "com.amazonaws.auditmanager#ValidationException":
4238
- response = {
4239
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
4240
- name: errorCode,
4241
- $metadata: deserializeMetadata(output),
4242
- };
4243
- break;
3402
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4244
3403
  default:
4245
3404
  const parsedBody = parsedOutput.body;
4246
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4247
- response = {
4248
- ...parsedBody,
4249
- name: `${errorCode}`,
4250
- message: parsedBody.message || parsedBody.Message || errorCode,
3405
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3406
+ name: parsedBody.code || parsedBody.Code || errorCode,
4251
3407
  $fault: "client",
4252
3408
  $metadata: deserializeMetadata(output),
4253
- };
3409
+ });
3410
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4254
3411
  }
4255
- const message = response.message || response.Message || errorCode;
4256
- response.message = message;
4257
- delete response.Message;
4258
- return Promise.reject(Object.assign(new Error(message), response));
4259
3412
  };
4260
3413
  const deserializeAws_restJson1GetSettingsCommand = async (output, context) => {
4261
3414
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4283,35 +3436,19 @@ const deserializeAws_restJson1GetSettingsCommandError = async (output, context)
4283
3436
  switch (errorCode) {
4284
3437
  case "AccessDeniedException":
4285
3438
  case "com.amazonaws.auditmanager#AccessDeniedException":
4286
- response = {
4287
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4288
- name: errorCode,
4289
- $metadata: deserializeMetadata(output),
4290
- };
4291
- break;
3439
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4292
3440
  case "InternalServerException":
4293
3441
  case "com.amazonaws.auditmanager#InternalServerException":
4294
- response = {
4295
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
4296
- name: errorCode,
4297
- $metadata: deserializeMetadata(output),
4298
- };
4299
- break;
3442
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
4300
3443
  default:
4301
3444
  const parsedBody = parsedOutput.body;
4302
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4303
- response = {
4304
- ...parsedBody,
4305
- name: `${errorCode}`,
4306
- message: parsedBody.message || parsedBody.Message || errorCode,
3445
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3446
+ name: parsedBody.code || parsedBody.Code || errorCode,
4307
3447
  $fault: "client",
4308
3448
  $metadata: deserializeMetadata(output),
4309
- };
3449
+ });
3450
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4310
3451
  }
4311
- const message = response.message || response.Message || errorCode;
4312
- response.message = message;
4313
- delete response.Message;
4314
- return Promise.reject(Object.assign(new Error(message), response));
4315
3452
  };
4316
3453
  const deserializeAws_restJson1ListAssessmentControlInsightsByControlDomainCommand = async (output, context) => {
4317
3454
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4343,51 +3480,25 @@ const deserializeAws_restJson1ListAssessmentControlInsightsByControlDomainComman
4343
3480
  switch (errorCode) {
4344
3481
  case "AccessDeniedException":
4345
3482
  case "com.amazonaws.auditmanager#AccessDeniedException":
4346
- response = {
4347
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4348
- name: errorCode,
4349
- $metadata: deserializeMetadata(output),
4350
- };
4351
- break;
3483
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4352
3484
  case "InternalServerException":
4353
3485
  case "com.amazonaws.auditmanager#InternalServerException":
4354
- response = {
4355
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
4356
- name: errorCode,
4357
- $metadata: deserializeMetadata(output),
4358
- };
4359
- break;
3486
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
4360
3487
  case "ResourceNotFoundException":
4361
3488
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
4362
- response = {
4363
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4364
- name: errorCode,
4365
- $metadata: deserializeMetadata(output),
4366
- };
4367
- break;
3489
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
4368
3490
  case "ValidationException":
4369
3491
  case "com.amazonaws.auditmanager#ValidationException":
4370
- response = {
4371
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
4372
- name: errorCode,
4373
- $metadata: deserializeMetadata(output),
4374
- };
4375
- break;
3492
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4376
3493
  default:
4377
3494
  const parsedBody = parsedOutput.body;
4378
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4379
- response = {
4380
- ...parsedBody,
4381
- name: `${errorCode}`,
4382
- message: parsedBody.message || parsedBody.Message || errorCode,
3495
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3496
+ name: parsedBody.code || parsedBody.Code || errorCode,
4383
3497
  $fault: "client",
4384
3498
  $metadata: deserializeMetadata(output),
4385
- };
3499
+ });
3500
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4386
3501
  }
4387
- const message = response.message || response.Message || errorCode;
4388
- response.message = message;
4389
- delete response.Message;
4390
- return Promise.reject(Object.assign(new Error(message), response));
4391
3502
  };
4392
3503
  const deserializeAws_restJson1ListAssessmentFrameworksCommand = async (output, context) => {
4393
3504
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4419,43 +3530,22 @@ const deserializeAws_restJson1ListAssessmentFrameworksCommandError = async (outp
4419
3530
  switch (errorCode) {
4420
3531
  case "AccessDeniedException":
4421
3532
  case "com.amazonaws.auditmanager#AccessDeniedException":
4422
- response = {
4423
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4424
- name: errorCode,
4425
- $metadata: deserializeMetadata(output),
4426
- };
4427
- break;
3533
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4428
3534
  case "InternalServerException":
4429
3535
  case "com.amazonaws.auditmanager#InternalServerException":
4430
- response = {
4431
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
4432
- name: errorCode,
4433
- $metadata: deserializeMetadata(output),
4434
- };
4435
- break;
3536
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
4436
3537
  case "ValidationException":
4437
3538
  case "com.amazonaws.auditmanager#ValidationException":
4438
- response = {
4439
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
4440
- name: errorCode,
4441
- $metadata: deserializeMetadata(output),
4442
- };
4443
- break;
3539
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4444
3540
  default:
4445
3541
  const parsedBody = parsedOutput.body;
4446
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4447
- response = {
4448
- ...parsedBody,
4449
- name: `${errorCode}`,
4450
- message: parsedBody.message || parsedBody.Message || errorCode,
3542
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3543
+ name: parsedBody.code || parsedBody.Code || errorCode,
4451
3544
  $fault: "client",
4452
3545
  $metadata: deserializeMetadata(output),
4453
- };
3546
+ });
3547
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4454
3548
  }
4455
- const message = response.message || response.Message || errorCode;
4456
- response.message = message;
4457
- delete response.Message;
4458
- return Promise.reject(Object.assign(new Error(message), response));
4459
3549
  };
4460
3550
  const deserializeAws_restJson1ListAssessmentFrameworkShareRequestsCommand = async (output, context) => {
4461
3551
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4487,43 +3577,22 @@ const deserializeAws_restJson1ListAssessmentFrameworkShareRequestsCommandError =
4487
3577
  switch (errorCode) {
4488
3578
  case "AccessDeniedException":
4489
3579
  case "com.amazonaws.auditmanager#AccessDeniedException":
4490
- response = {
4491
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4492
- name: errorCode,
4493
- $metadata: deserializeMetadata(output),
4494
- };
4495
- break;
3580
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4496
3581
  case "InternalServerException":
4497
3582
  case "com.amazonaws.auditmanager#InternalServerException":
4498
- response = {
4499
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
4500
- name: errorCode,
4501
- $metadata: deserializeMetadata(output),
4502
- };
4503
- break;
3583
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
4504
3584
  case "ValidationException":
4505
3585
  case "com.amazonaws.auditmanager#ValidationException":
4506
- response = {
4507
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
4508
- name: errorCode,
4509
- $metadata: deserializeMetadata(output),
4510
- };
4511
- break;
3586
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4512
3587
  default:
4513
3588
  const parsedBody = parsedOutput.body;
4514
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4515
- response = {
4516
- ...parsedBody,
4517
- name: `${errorCode}`,
4518
- message: parsedBody.message || parsedBody.Message || errorCode,
3589
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3590
+ name: parsedBody.code || parsedBody.Code || errorCode,
4519
3591
  $fault: "client",
4520
3592
  $metadata: deserializeMetadata(output),
4521
- };
3593
+ });
3594
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4522
3595
  }
4523
- const message = response.message || response.Message || errorCode;
4524
- response.message = message;
4525
- delete response.Message;
4526
- return Promise.reject(Object.assign(new Error(message), response));
4527
3596
  };
4528
3597
  const deserializeAws_restJson1ListAssessmentReportsCommand = async (output, context) => {
4529
3598
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4555,43 +3624,22 @@ const deserializeAws_restJson1ListAssessmentReportsCommandError = async (output,
4555
3624
  switch (errorCode) {
4556
3625
  case "AccessDeniedException":
4557
3626
  case "com.amazonaws.auditmanager#AccessDeniedException":
4558
- response = {
4559
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4560
- name: errorCode,
4561
- $metadata: deserializeMetadata(output),
4562
- };
4563
- break;
3627
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4564
3628
  case "InternalServerException":
4565
3629
  case "com.amazonaws.auditmanager#InternalServerException":
4566
- response = {
4567
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
4568
- name: errorCode,
4569
- $metadata: deserializeMetadata(output),
4570
- };
4571
- break;
3630
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
4572
3631
  case "ValidationException":
4573
3632
  case "com.amazonaws.auditmanager#ValidationException":
4574
- response = {
4575
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
4576
- name: errorCode,
4577
- $metadata: deserializeMetadata(output),
4578
- };
4579
- break;
3633
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4580
3634
  default:
4581
3635
  const parsedBody = parsedOutput.body;
4582
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4583
- response = {
4584
- ...parsedBody,
4585
- name: `${errorCode}`,
4586
- message: parsedBody.message || parsedBody.Message || errorCode,
3636
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3637
+ name: parsedBody.code || parsedBody.Code || errorCode,
4587
3638
  $fault: "client",
4588
3639
  $metadata: deserializeMetadata(output),
4589
- };
3640
+ });
3641
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4590
3642
  }
4591
- const message = response.message || response.Message || errorCode;
4592
- response.message = message;
4593
- delete response.Message;
4594
- return Promise.reject(Object.assign(new Error(message), response));
4595
3643
  };
4596
3644
  const deserializeAws_restJson1ListAssessmentsCommand = async (output, context) => {
4597
3645
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4623,43 +3671,22 @@ const deserializeAws_restJson1ListAssessmentsCommandError = async (output, conte
4623
3671
  switch (errorCode) {
4624
3672
  case "AccessDeniedException":
4625
3673
  case "com.amazonaws.auditmanager#AccessDeniedException":
4626
- response = {
4627
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4628
- name: errorCode,
4629
- $metadata: deserializeMetadata(output),
4630
- };
4631
- break;
3674
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4632
3675
  case "InternalServerException":
4633
3676
  case "com.amazonaws.auditmanager#InternalServerException":
4634
- response = {
4635
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
4636
- name: errorCode,
4637
- $metadata: deserializeMetadata(output),
4638
- };
4639
- break;
3677
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
4640
3678
  case "ValidationException":
4641
3679
  case "com.amazonaws.auditmanager#ValidationException":
4642
- response = {
4643
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
4644
- name: errorCode,
4645
- $metadata: deserializeMetadata(output),
4646
- };
4647
- break;
3680
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4648
3681
  default:
4649
3682
  const parsedBody = parsedOutput.body;
4650
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4651
- response = {
4652
- ...parsedBody,
4653
- name: `${errorCode}`,
4654
- message: parsedBody.message || parsedBody.Message || errorCode,
3683
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3684
+ name: parsedBody.code || parsedBody.Code || errorCode,
4655
3685
  $fault: "client",
4656
3686
  $metadata: deserializeMetadata(output),
4657
- };
3687
+ });
3688
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4658
3689
  }
4659
- const message = response.message || response.Message || errorCode;
4660
- response.message = message;
4661
- delete response.Message;
4662
- return Promise.reject(Object.assign(new Error(message), response));
4663
3690
  };
4664
3691
  const deserializeAws_restJson1ListControlDomainInsightsCommand = async (output, context) => {
4665
3692
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4691,51 +3718,25 @@ const deserializeAws_restJson1ListControlDomainInsightsCommandError = async (out
4691
3718
  switch (errorCode) {
4692
3719
  case "AccessDeniedException":
4693
3720
  case "com.amazonaws.auditmanager#AccessDeniedException":
4694
- response = {
4695
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4696
- name: errorCode,
4697
- $metadata: deserializeMetadata(output),
4698
- };
4699
- break;
3721
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4700
3722
  case "InternalServerException":
4701
3723
  case "com.amazonaws.auditmanager#InternalServerException":
4702
- response = {
4703
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
4704
- name: errorCode,
4705
- $metadata: deserializeMetadata(output),
4706
- };
4707
- break;
3724
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
4708
3725
  case "ResourceNotFoundException":
4709
3726
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
4710
- response = {
4711
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4712
- name: errorCode,
4713
- $metadata: deserializeMetadata(output),
4714
- };
4715
- break;
3727
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
4716
3728
  case "ValidationException":
4717
3729
  case "com.amazonaws.auditmanager#ValidationException":
4718
- response = {
4719
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
4720
- name: errorCode,
4721
- $metadata: deserializeMetadata(output),
4722
- };
4723
- break;
3730
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4724
3731
  default:
4725
3732
  const parsedBody = parsedOutput.body;
4726
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4727
- response = {
4728
- ...parsedBody,
4729
- name: `${errorCode}`,
4730
- message: parsedBody.message || parsedBody.Message || errorCode,
3733
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3734
+ name: parsedBody.code || parsedBody.Code || errorCode,
4731
3735
  $fault: "client",
4732
3736
  $metadata: deserializeMetadata(output),
4733
- };
3737
+ });
3738
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4734
3739
  }
4735
- const message = response.message || response.Message || errorCode;
4736
- response.message = message;
4737
- delete response.Message;
4738
- return Promise.reject(Object.assign(new Error(message), response));
4739
3740
  };
4740
3741
  const deserializeAws_restJson1ListControlDomainInsightsByAssessmentCommand = async (output, context) => {
4741
3742
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4767,51 +3768,25 @@ const deserializeAws_restJson1ListControlDomainInsightsByAssessmentCommandError
4767
3768
  switch (errorCode) {
4768
3769
  case "AccessDeniedException":
4769
3770
  case "com.amazonaws.auditmanager#AccessDeniedException":
4770
- response = {
4771
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4772
- name: errorCode,
4773
- $metadata: deserializeMetadata(output),
4774
- };
4775
- break;
3771
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4776
3772
  case "InternalServerException":
4777
3773
  case "com.amazonaws.auditmanager#InternalServerException":
4778
- response = {
4779
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
4780
- name: errorCode,
4781
- $metadata: deserializeMetadata(output),
4782
- };
4783
- break;
3774
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
4784
3775
  case "ResourceNotFoundException":
4785
3776
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
4786
- response = {
4787
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4788
- name: errorCode,
4789
- $metadata: deserializeMetadata(output),
4790
- };
4791
- break;
3777
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
4792
3778
  case "ValidationException":
4793
3779
  case "com.amazonaws.auditmanager#ValidationException":
4794
- response = {
4795
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
4796
- name: errorCode,
4797
- $metadata: deserializeMetadata(output),
4798
- };
4799
- break;
3780
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4800
3781
  default:
4801
3782
  const parsedBody = parsedOutput.body;
4802
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4803
- response = {
4804
- ...parsedBody,
4805
- name: `${errorCode}`,
4806
- message: parsedBody.message || parsedBody.Message || errorCode,
3783
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3784
+ name: parsedBody.code || parsedBody.Code || errorCode,
4807
3785
  $fault: "client",
4808
3786
  $metadata: deserializeMetadata(output),
4809
- };
3787
+ });
3788
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4810
3789
  }
4811
- const message = response.message || response.Message || errorCode;
4812
- response.message = message;
4813
- delete response.Message;
4814
- return Promise.reject(Object.assign(new Error(message), response));
4815
3790
  };
4816
3791
  const deserializeAws_restJson1ListControlInsightsByControlDomainCommand = async (output, context) => {
4817
3792
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4843,51 +3818,25 @@ const deserializeAws_restJson1ListControlInsightsByControlDomainCommandError = a
4843
3818
  switch (errorCode) {
4844
3819
  case "AccessDeniedException":
4845
3820
  case "com.amazonaws.auditmanager#AccessDeniedException":
4846
- response = {
4847
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4848
- name: errorCode,
4849
- $metadata: deserializeMetadata(output),
4850
- };
4851
- break;
3821
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4852
3822
  case "InternalServerException":
4853
3823
  case "com.amazonaws.auditmanager#InternalServerException":
4854
- response = {
4855
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
4856
- name: errorCode,
4857
- $metadata: deserializeMetadata(output),
4858
- };
4859
- break;
3824
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
4860
3825
  case "ResourceNotFoundException":
4861
3826
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
4862
- response = {
4863
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
4864
- name: errorCode,
4865
- $metadata: deserializeMetadata(output),
4866
- };
4867
- break;
3827
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
4868
3828
  case "ValidationException":
4869
3829
  case "com.amazonaws.auditmanager#ValidationException":
4870
- response = {
4871
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
4872
- name: errorCode,
4873
- $metadata: deserializeMetadata(output),
4874
- };
4875
- break;
3830
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4876
3831
  default:
4877
3832
  const parsedBody = parsedOutput.body;
4878
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4879
- response = {
4880
- ...parsedBody,
4881
- name: `${errorCode}`,
4882
- message: parsedBody.message || parsedBody.Message || errorCode,
3833
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3834
+ name: parsedBody.code || parsedBody.Code || errorCode,
4883
3835
  $fault: "client",
4884
3836
  $metadata: deserializeMetadata(output),
4885
- };
3837
+ });
3838
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4886
3839
  }
4887
- const message = response.message || response.Message || errorCode;
4888
- response.message = message;
4889
- delete response.Message;
4890
- return Promise.reject(Object.assign(new Error(message), response));
4891
3840
  };
4892
3841
  const deserializeAws_restJson1ListControlsCommand = async (output, context) => {
4893
3842
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4919,43 +3868,22 @@ const deserializeAws_restJson1ListControlsCommandError = async (output, context)
4919
3868
  switch (errorCode) {
4920
3869
  case "AccessDeniedException":
4921
3870
  case "com.amazonaws.auditmanager#AccessDeniedException":
4922
- response = {
4923
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4924
- name: errorCode,
4925
- $metadata: deserializeMetadata(output),
4926
- };
4927
- break;
3871
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4928
3872
  case "InternalServerException":
4929
3873
  case "com.amazonaws.auditmanager#InternalServerException":
4930
- response = {
4931
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
4932
- name: errorCode,
4933
- $metadata: deserializeMetadata(output),
4934
- };
4935
- break;
3874
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
4936
3875
  case "ValidationException":
4937
3876
  case "com.amazonaws.auditmanager#ValidationException":
4938
- response = {
4939
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
4940
- name: errorCode,
4941
- $metadata: deserializeMetadata(output),
4942
- };
4943
- break;
3877
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
4944
3878
  default:
4945
3879
  const parsedBody = parsedOutput.body;
4946
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4947
- response = {
4948
- ...parsedBody,
4949
- name: `${errorCode}`,
4950
- message: parsedBody.message || parsedBody.Message || errorCode,
3880
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3881
+ name: parsedBody.code || parsedBody.Code || errorCode,
4951
3882
  $fault: "client",
4952
3883
  $metadata: deserializeMetadata(output),
4953
- };
3884
+ });
3885
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4954
3886
  }
4955
- const message = response.message || response.Message || errorCode;
4956
- response.message = message;
4957
- delete response.Message;
4958
- return Promise.reject(Object.assign(new Error(message), response));
4959
3887
  };
4960
3888
  const deserializeAws_restJson1ListKeywordsForDataSourceCommand = async (output, context) => {
4961
3889
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4987,43 +3915,22 @@ const deserializeAws_restJson1ListKeywordsForDataSourceCommandError = async (out
4987
3915
  switch (errorCode) {
4988
3916
  case "AccessDeniedException":
4989
3917
  case "com.amazonaws.auditmanager#AccessDeniedException":
4990
- response = {
4991
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4992
- name: errorCode,
4993
- $metadata: deserializeMetadata(output),
4994
- };
4995
- break;
3918
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4996
3919
  case "InternalServerException":
4997
3920
  case "com.amazonaws.auditmanager#InternalServerException":
4998
- response = {
4999
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
5000
- name: errorCode,
5001
- $metadata: deserializeMetadata(output),
5002
- };
5003
- break;
3921
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
5004
3922
  case "ValidationException":
5005
3923
  case "com.amazonaws.auditmanager#ValidationException":
5006
- response = {
5007
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
5008
- name: errorCode,
5009
- $metadata: deserializeMetadata(output),
5010
- };
5011
- break;
3924
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
5012
3925
  default:
5013
3926
  const parsedBody = parsedOutput.body;
5014
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5015
- response = {
5016
- ...parsedBody,
5017
- name: `${errorCode}`,
5018
- message: parsedBody.message || parsedBody.Message || errorCode,
3927
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3928
+ name: parsedBody.code || parsedBody.Code || errorCode,
5019
3929
  $fault: "client",
5020
3930
  $metadata: deserializeMetadata(output),
5021
- };
3931
+ });
3932
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5022
3933
  }
5023
- const message = response.message || response.Message || errorCode;
5024
- response.message = message;
5025
- delete response.Message;
5026
- return Promise.reject(Object.assign(new Error(message), response));
5027
3934
  };
5028
3935
  const deserializeAws_restJson1ListNotificationsCommand = async (output, context) => {
5029
3936
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5055,43 +3962,22 @@ const deserializeAws_restJson1ListNotificationsCommandError = async (output, con
5055
3962
  switch (errorCode) {
5056
3963
  case "AccessDeniedException":
5057
3964
  case "com.amazonaws.auditmanager#AccessDeniedException":
5058
- response = {
5059
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
5060
- name: errorCode,
5061
- $metadata: deserializeMetadata(output),
5062
- };
5063
- break;
3965
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
5064
3966
  case "InternalServerException":
5065
3967
  case "com.amazonaws.auditmanager#InternalServerException":
5066
- response = {
5067
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
5068
- name: errorCode,
5069
- $metadata: deserializeMetadata(output),
5070
- };
5071
- break;
3968
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
5072
3969
  case "ValidationException":
5073
3970
  case "com.amazonaws.auditmanager#ValidationException":
5074
- response = {
5075
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
5076
- name: errorCode,
5077
- $metadata: deserializeMetadata(output),
5078
- };
5079
- break;
3971
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
5080
3972
  default:
5081
3973
  const parsedBody = parsedOutput.body;
5082
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5083
- response = {
5084
- ...parsedBody,
5085
- name: `${errorCode}`,
5086
- message: parsedBody.message || parsedBody.Message || errorCode,
3974
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
3975
+ name: parsedBody.code || parsedBody.Code || errorCode,
5087
3976
  $fault: "client",
5088
3977
  $metadata: deserializeMetadata(output),
5089
- };
3978
+ });
3979
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5090
3980
  }
5091
- const message = response.message || response.Message || errorCode;
5092
- response.message = message;
5093
- delete response.Message;
5094
- return Promise.reject(Object.assign(new Error(message), response));
5095
3981
  };
5096
3982
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
5097
3983
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5119,43 +4005,22 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
5119
4005
  switch (errorCode) {
5120
4006
  case "InternalServerException":
5121
4007
  case "com.amazonaws.auditmanager#InternalServerException":
5122
- response = {
5123
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
5124
- name: errorCode,
5125
- $metadata: deserializeMetadata(output),
5126
- };
5127
- break;
4008
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
5128
4009
  case "ResourceNotFoundException":
5129
4010
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
5130
- response = {
5131
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
5132
- name: errorCode,
5133
- $metadata: deserializeMetadata(output),
5134
- };
5135
- break;
4011
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
5136
4012
  case "ValidationException":
5137
4013
  case "com.amazonaws.auditmanager#ValidationException":
5138
- response = {
5139
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
5140
- name: errorCode,
5141
- $metadata: deserializeMetadata(output),
5142
- };
5143
- break;
4014
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
5144
4015
  default:
5145
4016
  const parsedBody = parsedOutput.body;
5146
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5147
- response = {
5148
- ...parsedBody,
5149
- name: `${errorCode}`,
5150
- message: parsedBody.message || parsedBody.Message || errorCode,
4017
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
4018
+ name: parsedBody.code || parsedBody.Code || errorCode,
5151
4019
  $fault: "client",
5152
4020
  $metadata: deserializeMetadata(output),
5153
- };
4021
+ });
4022
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5154
4023
  }
5155
- const message = response.message || response.Message || errorCode;
5156
- response.message = message;
5157
- delete response.Message;
5158
- return Promise.reject(Object.assign(new Error(message), response));
5159
4024
  };
5160
4025
  const deserializeAws_restJson1RegisterAccountCommand = async (output, context) => {
5161
4026
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5183,51 +4048,25 @@ const deserializeAws_restJson1RegisterAccountCommandError = async (output, conte
5183
4048
  switch (errorCode) {
5184
4049
  case "AccessDeniedException":
5185
4050
  case "com.amazonaws.auditmanager#AccessDeniedException":
5186
- response = {
5187
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
5188
- name: errorCode,
5189
- $metadata: deserializeMetadata(output),
5190
- };
5191
- break;
4051
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
5192
4052
  case "InternalServerException":
5193
4053
  case "com.amazonaws.auditmanager#InternalServerException":
5194
- response = {
5195
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
5196
- name: errorCode,
5197
- $metadata: deserializeMetadata(output),
5198
- };
5199
- break;
4054
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
5200
4055
  case "ResourceNotFoundException":
5201
4056
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
5202
- response = {
5203
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
5204
- name: errorCode,
5205
- $metadata: deserializeMetadata(output),
5206
- };
5207
- break;
4057
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
5208
4058
  case "ValidationException":
5209
4059
  case "com.amazonaws.auditmanager#ValidationException":
5210
- response = {
5211
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
5212
- name: errorCode,
5213
- $metadata: deserializeMetadata(output),
5214
- };
5215
- break;
4060
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
5216
4061
  default:
5217
4062
  const parsedBody = parsedOutput.body;
5218
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5219
- response = {
5220
- ...parsedBody,
5221
- name: `${errorCode}`,
5222
- message: parsedBody.message || parsedBody.Message || errorCode,
4063
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
4064
+ name: parsedBody.code || parsedBody.Code || errorCode,
5223
4065
  $fault: "client",
5224
4066
  $metadata: deserializeMetadata(output),
5225
- };
4067
+ });
4068
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5226
4069
  }
5227
- const message = response.message || response.Message || errorCode;
5228
- response.message = message;
5229
- delete response.Message;
5230
- return Promise.reject(Object.assign(new Error(message), response));
5231
4070
  };
5232
4071
  const deserializeAws_restJson1RegisterOrganizationAdminAccountCommand = async (output, context) => {
5233
4072
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5259,51 +4098,25 @@ const deserializeAws_restJson1RegisterOrganizationAdminAccountCommandError = asy
5259
4098
  switch (errorCode) {
5260
4099
  case "AccessDeniedException":
5261
4100
  case "com.amazonaws.auditmanager#AccessDeniedException":
5262
- response = {
5263
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
5264
- name: errorCode,
5265
- $metadata: deserializeMetadata(output),
5266
- };
5267
- break;
4101
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
5268
4102
  case "InternalServerException":
5269
4103
  case "com.amazonaws.auditmanager#InternalServerException":
5270
- response = {
5271
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
5272
- name: errorCode,
5273
- $metadata: deserializeMetadata(output),
5274
- };
5275
- break;
4104
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
5276
4105
  case "ResourceNotFoundException":
5277
4106
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
5278
- response = {
5279
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
5280
- name: errorCode,
5281
- $metadata: deserializeMetadata(output),
5282
- };
5283
- break;
4107
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
5284
4108
  case "ValidationException":
5285
4109
  case "com.amazonaws.auditmanager#ValidationException":
5286
- response = {
5287
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
5288
- name: errorCode,
5289
- $metadata: deserializeMetadata(output),
5290
- };
5291
- break;
4110
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
5292
4111
  default:
5293
4112
  const parsedBody = parsedOutput.body;
5294
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5295
- response = {
5296
- ...parsedBody,
5297
- name: `${errorCode}`,
5298
- message: parsedBody.message || parsedBody.Message || errorCode,
4113
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
4114
+ name: parsedBody.code || parsedBody.Code || errorCode,
5299
4115
  $fault: "client",
5300
4116
  $metadata: deserializeMetadata(output),
5301
- };
4117
+ });
4118
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5302
4119
  }
5303
- const message = response.message || response.Message || errorCode;
5304
- response.message = message;
5305
- delete response.Message;
5306
- return Promise.reject(Object.assign(new Error(message), response));
5307
4120
  };
5308
4121
  const deserializeAws_restJson1StartAssessmentFrameworkShareCommand = async (output, context) => {
5309
4122
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5331,51 +4144,25 @@ const deserializeAws_restJson1StartAssessmentFrameworkShareCommandError = async
5331
4144
  switch (errorCode) {
5332
4145
  case "AccessDeniedException":
5333
4146
  case "com.amazonaws.auditmanager#AccessDeniedException":
5334
- response = {
5335
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
5336
- name: errorCode,
5337
- $metadata: deserializeMetadata(output),
5338
- };
5339
- break;
4147
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
5340
4148
  case "InternalServerException":
5341
4149
  case "com.amazonaws.auditmanager#InternalServerException":
5342
- response = {
5343
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
5344
- name: errorCode,
5345
- $metadata: deserializeMetadata(output),
5346
- };
5347
- break;
4150
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
5348
4151
  case "ResourceNotFoundException":
5349
4152
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
5350
- response = {
5351
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
5352
- name: errorCode,
5353
- $metadata: deserializeMetadata(output),
5354
- };
5355
- break;
4153
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
5356
4154
  case "ValidationException":
5357
4155
  case "com.amazonaws.auditmanager#ValidationException":
5358
- response = {
5359
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
5360
- name: errorCode,
5361
- $metadata: deserializeMetadata(output),
5362
- };
5363
- break;
4156
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
5364
4157
  default:
5365
4158
  const parsedBody = parsedOutput.body;
5366
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5367
- response = {
5368
- ...parsedBody,
5369
- name: `${errorCode}`,
5370
- message: parsedBody.message || parsedBody.Message || errorCode,
4159
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
4160
+ name: parsedBody.code || parsedBody.Code || errorCode,
5371
4161
  $fault: "client",
5372
4162
  $metadata: deserializeMetadata(output),
5373
- };
4163
+ });
4164
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5374
4165
  }
5375
- const message = response.message || response.Message || errorCode;
5376
- response.message = message;
5377
- delete response.Message;
5378
- return Promise.reject(Object.assign(new Error(message), response));
5379
4166
  };
5380
4167
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
5381
4168
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5399,43 +4186,22 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
5399
4186
  switch (errorCode) {
5400
4187
  case "InternalServerException":
5401
4188
  case "com.amazonaws.auditmanager#InternalServerException":
5402
- response = {
5403
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
5404
- name: errorCode,
5405
- $metadata: deserializeMetadata(output),
5406
- };
5407
- break;
4189
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
5408
4190
  case "ResourceNotFoundException":
5409
4191
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
5410
- response = {
5411
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
5412
- name: errorCode,
5413
- $metadata: deserializeMetadata(output),
5414
- };
5415
- break;
4192
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
5416
4193
  case "ValidationException":
5417
4194
  case "com.amazonaws.auditmanager#ValidationException":
5418
- response = {
5419
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
5420
- name: errorCode,
5421
- $metadata: deserializeMetadata(output),
5422
- };
5423
- break;
4195
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
5424
4196
  default:
5425
4197
  const parsedBody = parsedOutput.body;
5426
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5427
- response = {
5428
- ...parsedBody,
5429
- name: `${errorCode}`,
5430
- message: parsedBody.message || parsedBody.Message || errorCode,
4198
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
4199
+ name: parsedBody.code || parsedBody.Code || errorCode,
5431
4200
  $fault: "client",
5432
4201
  $metadata: deserializeMetadata(output),
5433
- };
4202
+ });
4203
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5434
4204
  }
5435
- const message = response.message || response.Message || errorCode;
5436
- response.message = message;
5437
- delete response.Message;
5438
- return Promise.reject(Object.assign(new Error(message), response));
5439
4205
  };
5440
4206
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
5441
4207
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5459,43 +4225,22 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
5459
4225
  switch (errorCode) {
5460
4226
  case "InternalServerException":
5461
4227
  case "com.amazonaws.auditmanager#InternalServerException":
5462
- response = {
5463
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
5464
- name: errorCode,
5465
- $metadata: deserializeMetadata(output),
5466
- };
5467
- break;
4228
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
5468
4229
  case "ResourceNotFoundException":
5469
4230
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
5470
- response = {
5471
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
5472
- name: errorCode,
5473
- $metadata: deserializeMetadata(output),
5474
- };
5475
- break;
4231
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
5476
4232
  case "ValidationException":
5477
4233
  case "com.amazonaws.auditmanager#ValidationException":
5478
- response = {
5479
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
5480
- name: errorCode,
5481
- $metadata: deserializeMetadata(output),
5482
- };
5483
- break;
4234
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
5484
4235
  default:
5485
4236
  const parsedBody = parsedOutput.body;
5486
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5487
- response = {
5488
- ...parsedBody,
5489
- name: `${errorCode}`,
5490
- message: parsedBody.message || parsedBody.Message || errorCode,
4237
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
4238
+ name: parsedBody.code || parsedBody.Code || errorCode,
5491
4239
  $fault: "client",
5492
4240
  $metadata: deserializeMetadata(output),
5493
- };
4241
+ });
4242
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5494
4243
  }
5495
- const message = response.message || response.Message || errorCode;
5496
- response.message = message;
5497
- delete response.Message;
5498
- return Promise.reject(Object.assign(new Error(message), response));
5499
4244
  };
5500
4245
  const deserializeAws_restJson1UpdateAssessmentCommand = async (output, context) => {
5501
4246
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5523,51 +4268,25 @@ const deserializeAws_restJson1UpdateAssessmentCommandError = async (output, cont
5523
4268
  switch (errorCode) {
5524
4269
  case "AccessDeniedException":
5525
4270
  case "com.amazonaws.auditmanager#AccessDeniedException":
5526
- response = {
5527
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
5528
- name: errorCode,
5529
- $metadata: deserializeMetadata(output),
5530
- };
5531
- break;
4271
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
5532
4272
  case "InternalServerException":
5533
4273
  case "com.amazonaws.auditmanager#InternalServerException":
5534
- response = {
5535
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
5536
- name: errorCode,
5537
- $metadata: deserializeMetadata(output),
5538
- };
5539
- break;
4274
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
5540
4275
  case "ResourceNotFoundException":
5541
4276
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
5542
- response = {
5543
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
5544
- name: errorCode,
5545
- $metadata: deserializeMetadata(output),
5546
- };
5547
- break;
4277
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
5548
4278
  case "ValidationException":
5549
4279
  case "com.amazonaws.auditmanager#ValidationException":
5550
- response = {
5551
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
5552
- name: errorCode,
5553
- $metadata: deserializeMetadata(output),
5554
- };
5555
- break;
4280
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
5556
4281
  default:
5557
4282
  const parsedBody = parsedOutput.body;
5558
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5559
- response = {
5560
- ...parsedBody,
5561
- name: `${errorCode}`,
5562
- message: parsedBody.message || parsedBody.Message || errorCode,
4283
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
4284
+ name: parsedBody.code || parsedBody.Code || errorCode,
5563
4285
  $fault: "client",
5564
4286
  $metadata: deserializeMetadata(output),
5565
- };
4287
+ });
4288
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5566
4289
  }
5567
- const message = response.message || response.Message || errorCode;
5568
- response.message = message;
5569
- delete response.Message;
5570
- return Promise.reject(Object.assign(new Error(message), response));
5571
4290
  };
5572
4291
  const deserializeAws_restJson1UpdateAssessmentControlCommand = async (output, context) => {
5573
4292
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5595,51 +4314,25 @@ const deserializeAws_restJson1UpdateAssessmentControlCommandError = async (outpu
5595
4314
  switch (errorCode) {
5596
4315
  case "AccessDeniedException":
5597
4316
  case "com.amazonaws.auditmanager#AccessDeniedException":
5598
- response = {
5599
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
5600
- name: errorCode,
5601
- $metadata: deserializeMetadata(output),
5602
- };
5603
- break;
4317
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
5604
4318
  case "InternalServerException":
5605
4319
  case "com.amazonaws.auditmanager#InternalServerException":
5606
- response = {
5607
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
5608
- name: errorCode,
5609
- $metadata: deserializeMetadata(output),
5610
- };
5611
- break;
4320
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
5612
4321
  case "ResourceNotFoundException":
5613
4322
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
5614
- response = {
5615
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
5616
- name: errorCode,
5617
- $metadata: deserializeMetadata(output),
5618
- };
5619
- break;
4323
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
5620
4324
  case "ValidationException":
5621
4325
  case "com.amazonaws.auditmanager#ValidationException":
5622
- response = {
5623
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
5624
- name: errorCode,
5625
- $metadata: deserializeMetadata(output),
5626
- };
5627
- break;
4326
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
5628
4327
  default:
5629
4328
  const parsedBody = parsedOutput.body;
5630
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5631
- response = {
5632
- ...parsedBody,
5633
- name: `${errorCode}`,
5634
- message: parsedBody.message || parsedBody.Message || errorCode,
4329
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
4330
+ name: parsedBody.code || parsedBody.Code || errorCode,
5635
4331
  $fault: "client",
5636
4332
  $metadata: deserializeMetadata(output),
5637
- };
4333
+ });
4334
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5638
4335
  }
5639
- const message = response.message || response.Message || errorCode;
5640
- response.message = message;
5641
- delete response.Message;
5642
- return Promise.reject(Object.assign(new Error(message), response));
5643
4336
  };
5644
4337
  const deserializeAws_restJson1UpdateAssessmentControlSetStatusCommand = async (output, context) => {
5645
4338
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5667,51 +4360,25 @@ const deserializeAws_restJson1UpdateAssessmentControlSetStatusCommandError = asy
5667
4360
  switch (errorCode) {
5668
4361
  case "AccessDeniedException":
5669
4362
  case "com.amazonaws.auditmanager#AccessDeniedException":
5670
- response = {
5671
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
5672
- name: errorCode,
5673
- $metadata: deserializeMetadata(output),
5674
- };
5675
- break;
4363
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
5676
4364
  case "InternalServerException":
5677
4365
  case "com.amazonaws.auditmanager#InternalServerException":
5678
- response = {
5679
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
5680
- name: errorCode,
5681
- $metadata: deserializeMetadata(output),
5682
- };
5683
- break;
4366
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
5684
4367
  case "ResourceNotFoundException":
5685
4368
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
5686
- response = {
5687
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
5688
- name: errorCode,
5689
- $metadata: deserializeMetadata(output),
5690
- };
5691
- break;
4369
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
5692
4370
  case "ValidationException":
5693
4371
  case "com.amazonaws.auditmanager#ValidationException":
5694
- response = {
5695
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
5696
- name: errorCode,
5697
- $metadata: deserializeMetadata(output),
5698
- };
5699
- break;
4372
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
5700
4373
  default:
5701
4374
  const parsedBody = parsedOutput.body;
5702
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5703
- response = {
5704
- ...parsedBody,
5705
- name: `${errorCode}`,
5706
- message: parsedBody.message || parsedBody.Message || errorCode,
4375
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
4376
+ name: parsedBody.code || parsedBody.Code || errorCode,
5707
4377
  $fault: "client",
5708
4378
  $metadata: deserializeMetadata(output),
5709
- };
4379
+ });
4380
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5710
4381
  }
5711
- const message = response.message || response.Message || errorCode;
5712
- response.message = message;
5713
- delete response.Message;
5714
- return Promise.reject(Object.assign(new Error(message), response));
5715
4382
  };
5716
4383
  const deserializeAws_restJson1UpdateAssessmentFrameworkCommand = async (output, context) => {
5717
4384
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5739,51 +4406,25 @@ const deserializeAws_restJson1UpdateAssessmentFrameworkCommandError = async (out
5739
4406
  switch (errorCode) {
5740
4407
  case "AccessDeniedException":
5741
4408
  case "com.amazonaws.auditmanager#AccessDeniedException":
5742
- response = {
5743
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
5744
- name: errorCode,
5745
- $metadata: deserializeMetadata(output),
5746
- };
5747
- break;
4409
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
5748
4410
  case "InternalServerException":
5749
4411
  case "com.amazonaws.auditmanager#InternalServerException":
5750
- response = {
5751
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
5752
- name: errorCode,
5753
- $metadata: deserializeMetadata(output),
5754
- };
5755
- break;
4412
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
5756
4413
  case "ResourceNotFoundException":
5757
4414
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
5758
- response = {
5759
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
5760
- name: errorCode,
5761
- $metadata: deserializeMetadata(output),
5762
- };
5763
- break;
4415
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
5764
4416
  case "ValidationException":
5765
4417
  case "com.amazonaws.auditmanager#ValidationException":
5766
- response = {
5767
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
5768
- name: errorCode,
5769
- $metadata: deserializeMetadata(output),
5770
- };
5771
- break;
4418
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
5772
4419
  default:
5773
4420
  const parsedBody = parsedOutput.body;
5774
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5775
- response = {
5776
- ...parsedBody,
5777
- name: `${errorCode}`,
5778
- message: parsedBody.message || parsedBody.Message || errorCode,
4421
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
4422
+ name: parsedBody.code || parsedBody.Code || errorCode,
5779
4423
  $fault: "client",
5780
4424
  $metadata: deserializeMetadata(output),
5781
- };
4425
+ });
4426
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5782
4427
  }
5783
- const message = response.message || response.Message || errorCode;
5784
- response.message = message;
5785
- delete response.Message;
5786
- return Promise.reject(Object.assign(new Error(message), response));
5787
4428
  };
5788
4429
  const deserializeAws_restJson1UpdateAssessmentFrameworkShareCommand = async (output, context) => {
5789
4430
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5811,51 +4452,25 @@ const deserializeAws_restJson1UpdateAssessmentFrameworkShareCommandError = async
5811
4452
  switch (errorCode) {
5812
4453
  case "AccessDeniedException":
5813
4454
  case "com.amazonaws.auditmanager#AccessDeniedException":
5814
- response = {
5815
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
5816
- name: errorCode,
5817
- $metadata: deserializeMetadata(output),
5818
- };
5819
- break;
4455
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
5820
4456
  case "InternalServerException":
5821
4457
  case "com.amazonaws.auditmanager#InternalServerException":
5822
- response = {
5823
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
5824
- name: errorCode,
5825
- $metadata: deserializeMetadata(output),
5826
- };
5827
- break;
4458
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
5828
4459
  case "ResourceNotFoundException":
5829
4460
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
5830
- response = {
5831
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
5832
- name: errorCode,
5833
- $metadata: deserializeMetadata(output),
5834
- };
5835
- break;
4461
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
5836
4462
  case "ValidationException":
5837
4463
  case "com.amazonaws.auditmanager#ValidationException":
5838
- response = {
5839
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
5840
- name: errorCode,
5841
- $metadata: deserializeMetadata(output),
5842
- };
5843
- break;
4464
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
5844
4465
  default:
5845
4466
  const parsedBody = parsedOutput.body;
5846
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5847
- response = {
5848
- ...parsedBody,
5849
- name: `${errorCode}`,
5850
- message: parsedBody.message || parsedBody.Message || errorCode,
4467
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
4468
+ name: parsedBody.code || parsedBody.Code || errorCode,
5851
4469
  $fault: "client",
5852
4470
  $metadata: deserializeMetadata(output),
5853
- };
4471
+ });
4472
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5854
4473
  }
5855
- const message = response.message || response.Message || errorCode;
5856
- response.message = message;
5857
- delete response.Message;
5858
- return Promise.reject(Object.assign(new Error(message), response));
5859
4474
  };
5860
4475
  const deserializeAws_restJson1UpdateAssessmentStatusCommand = async (output, context) => {
5861
4476
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5883,51 +4498,25 @@ const deserializeAws_restJson1UpdateAssessmentStatusCommandError = async (output
5883
4498
  switch (errorCode) {
5884
4499
  case "AccessDeniedException":
5885
4500
  case "com.amazonaws.auditmanager#AccessDeniedException":
5886
- response = {
5887
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
5888
- name: errorCode,
5889
- $metadata: deserializeMetadata(output),
5890
- };
5891
- break;
4501
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
5892
4502
  case "InternalServerException":
5893
4503
  case "com.amazonaws.auditmanager#InternalServerException":
5894
- response = {
5895
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
5896
- name: errorCode,
5897
- $metadata: deserializeMetadata(output),
5898
- };
5899
- break;
4504
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
5900
4505
  case "ResourceNotFoundException":
5901
4506
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
5902
- response = {
5903
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
5904
- name: errorCode,
5905
- $metadata: deserializeMetadata(output),
5906
- };
5907
- break;
4507
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
5908
4508
  case "ValidationException":
5909
4509
  case "com.amazonaws.auditmanager#ValidationException":
5910
- response = {
5911
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
5912
- name: errorCode,
5913
- $metadata: deserializeMetadata(output),
5914
- };
5915
- break;
4510
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
5916
4511
  default:
5917
4512
  const parsedBody = parsedOutput.body;
5918
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5919
- response = {
5920
- ...parsedBody,
5921
- name: `${errorCode}`,
5922
- message: parsedBody.message || parsedBody.Message || errorCode,
4513
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
4514
+ name: parsedBody.code || parsedBody.Code || errorCode,
5923
4515
  $fault: "client",
5924
4516
  $metadata: deserializeMetadata(output),
5925
- };
4517
+ });
4518
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5926
4519
  }
5927
- const message = response.message || response.Message || errorCode;
5928
- response.message = message;
5929
- delete response.Message;
5930
- return Promise.reject(Object.assign(new Error(message), response));
5931
4520
  };
5932
4521
  const deserializeAws_restJson1UpdateControlCommand = async (output, context) => {
5933
4522
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5955,51 +4544,25 @@ const deserializeAws_restJson1UpdateControlCommandError = async (output, context
5955
4544
  switch (errorCode) {
5956
4545
  case "AccessDeniedException":
5957
4546
  case "com.amazonaws.auditmanager#AccessDeniedException":
5958
- response = {
5959
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
5960
- name: errorCode,
5961
- $metadata: deserializeMetadata(output),
5962
- };
5963
- break;
4547
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
5964
4548
  case "InternalServerException":
5965
4549
  case "com.amazonaws.auditmanager#InternalServerException":
5966
- response = {
5967
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
5968
- name: errorCode,
5969
- $metadata: deserializeMetadata(output),
5970
- };
5971
- break;
4550
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
5972
4551
  case "ResourceNotFoundException":
5973
4552
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
5974
- response = {
5975
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
5976
- name: errorCode,
5977
- $metadata: deserializeMetadata(output),
5978
- };
5979
- break;
4553
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
5980
4554
  case "ValidationException":
5981
4555
  case "com.amazonaws.auditmanager#ValidationException":
5982
- response = {
5983
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
5984
- name: errorCode,
5985
- $metadata: deserializeMetadata(output),
5986
- };
5987
- break;
4556
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
5988
4557
  default:
5989
4558
  const parsedBody = parsedOutput.body;
5990
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5991
- response = {
5992
- ...parsedBody,
5993
- name: `${errorCode}`,
5994
- message: parsedBody.message || parsedBody.Message || errorCode,
4559
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
4560
+ name: parsedBody.code || parsedBody.Code || errorCode,
5995
4561
  $fault: "client",
5996
4562
  $metadata: deserializeMetadata(output),
5997
- };
4563
+ });
4564
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5998
4565
  }
5999
- const message = response.message || response.Message || errorCode;
6000
- response.message = message;
6001
- delete response.Message;
6002
- return Promise.reject(Object.assign(new Error(message), response));
6003
4566
  };
6004
4567
  const deserializeAws_restJson1UpdateSettingsCommand = async (output, context) => {
6005
4568
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -6027,43 +4590,22 @@ const deserializeAws_restJson1UpdateSettingsCommandError = async (output, contex
6027
4590
  switch (errorCode) {
6028
4591
  case "AccessDeniedException":
6029
4592
  case "com.amazonaws.auditmanager#AccessDeniedException":
6030
- response = {
6031
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
6032
- name: errorCode,
6033
- $metadata: deserializeMetadata(output),
6034
- };
6035
- break;
4593
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
6036
4594
  case "InternalServerException":
6037
4595
  case "com.amazonaws.auditmanager#InternalServerException":
6038
- response = {
6039
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
6040
- name: errorCode,
6041
- $metadata: deserializeMetadata(output),
6042
- };
6043
- break;
4596
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
6044
4597
  case "ValidationException":
6045
4598
  case "com.amazonaws.auditmanager#ValidationException":
6046
- response = {
6047
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
6048
- name: errorCode,
6049
- $metadata: deserializeMetadata(output),
6050
- };
6051
- break;
4599
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
6052
4600
  default:
6053
4601
  const parsedBody = parsedOutput.body;
6054
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
6055
- response = {
6056
- ...parsedBody,
6057
- name: `${errorCode}`,
6058
- message: parsedBody.message || parsedBody.Message || errorCode,
4602
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
4603
+ name: parsedBody.code || parsedBody.Code || errorCode,
6059
4604
  $fault: "client",
6060
4605
  $metadata: deserializeMetadata(output),
6061
- };
4606
+ });
4607
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
6062
4608
  }
6063
- const message = response.message || response.Message || errorCode;
6064
- response.message = message;
6065
- delete response.Message;
6066
- return Promise.reject(Object.assign(new Error(message), response));
6067
4609
  };
6068
4610
  const deserializeAws_restJson1ValidateAssessmentReportIntegrityCommand = async (output, context) => {
6069
4611
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -6107,87 +4649,52 @@ const deserializeAws_restJson1ValidateAssessmentReportIntegrityCommandError = as
6107
4649
  switch (errorCode) {
6108
4650
  case "AccessDeniedException":
6109
4651
  case "com.amazonaws.auditmanager#AccessDeniedException":
6110
- response = {
6111
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
6112
- name: errorCode,
6113
- $metadata: deserializeMetadata(output),
6114
- };
6115
- break;
4652
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
6116
4653
  case "InternalServerException":
6117
4654
  case "com.amazonaws.auditmanager#InternalServerException":
6118
- response = {
6119
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
6120
- name: errorCode,
6121
- $metadata: deserializeMetadata(output),
6122
- };
6123
- break;
4655
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
6124
4656
  case "ResourceNotFoundException":
6125
4657
  case "com.amazonaws.auditmanager#ResourceNotFoundException":
6126
- response = {
6127
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
6128
- name: errorCode,
6129
- $metadata: deserializeMetadata(output),
6130
- };
6131
- break;
4658
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
6132
4659
  case "ValidationException":
6133
4660
  case "com.amazonaws.auditmanager#ValidationException":
6134
- response = {
6135
- ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
6136
- name: errorCode,
6137
- $metadata: deserializeMetadata(output),
6138
- };
6139
- break;
4661
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
6140
4662
  default:
6141
4663
  const parsedBody = parsedOutput.body;
6142
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
6143
- response = {
6144
- ...parsedBody,
6145
- name: `${errorCode}`,
6146
- message: parsedBody.message || parsedBody.Message || errorCode,
4664
+ response = new AuditManagerServiceException_1.AuditManagerServiceException({
4665
+ name: parsedBody.code || parsedBody.Code || errorCode,
6147
4666
  $fault: "client",
6148
4667
  $metadata: deserializeMetadata(output),
6149
- };
4668
+ });
4669
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
6150
4670
  }
6151
- const message = response.message || response.Message || errorCode;
6152
- response.message = message;
6153
- delete response.Message;
6154
- return Promise.reject(Object.assign(new Error(message), response));
6155
4671
  };
6156
4672
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
6157
- const contents = {
6158
- name: "AccessDeniedException",
6159
- $fault: "client",
6160
- $metadata: deserializeMetadata(parsedOutput),
6161
- message: undefined,
6162
- };
4673
+ const contents = {};
6163
4674
  const data = parsedOutput.body;
6164
4675
  if (data.message !== undefined && data.message !== null) {
6165
4676
  contents.message = smithy_client_1.expectString(data.message);
6166
4677
  }
6167
- return contents;
4678
+ const exception = new models_0_1.AccessDeniedException({
4679
+ $metadata: deserializeMetadata(parsedOutput),
4680
+ ...contents,
4681
+ });
4682
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
6168
4683
  };
6169
4684
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
6170
- const contents = {
6171
- name: "InternalServerException",
6172
- $fault: "server",
6173
- $metadata: deserializeMetadata(parsedOutput),
6174
- message: undefined,
6175
- };
4685
+ const contents = {};
6176
4686
  const data = parsedOutput.body;
6177
4687
  if (data.message !== undefined && data.message !== null) {
6178
4688
  contents.message = smithy_client_1.expectString(data.message);
6179
4689
  }
6180
- return contents;
4690
+ const exception = new models_0_1.InternalServerException({
4691
+ $metadata: deserializeMetadata(parsedOutput),
4692
+ ...contents,
4693
+ });
4694
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
6181
4695
  };
6182
4696
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
6183
- const contents = {
6184
- name: "ResourceNotFoundException",
6185
- $fault: "client",
6186
- $metadata: deserializeMetadata(parsedOutput),
6187
- message: undefined,
6188
- resourceId: undefined,
6189
- resourceType: undefined,
6190
- };
4697
+ const contents = {};
6191
4698
  const data = parsedOutput.body;
6192
4699
  if (data.message !== undefined && data.message !== null) {
6193
4700
  contents.message = smithy_client_1.expectString(data.message);
@@ -6198,17 +4705,14 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
6198
4705
  if (data.resourceType !== undefined && data.resourceType !== null) {
6199
4706
  contents.resourceType = smithy_client_1.expectString(data.resourceType);
6200
4707
  }
6201
- return contents;
4708
+ const exception = new models_0_1.ResourceNotFoundException({
4709
+ $metadata: deserializeMetadata(parsedOutput),
4710
+ ...contents,
4711
+ });
4712
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
6202
4713
  };
6203
4714
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
6204
- const contents = {
6205
- name: "ValidationException",
6206
- $fault: "client",
6207
- $metadata: deserializeMetadata(parsedOutput),
6208
- fields: undefined,
6209
- message: undefined,
6210
- reason: undefined,
6211
- };
4715
+ const contents = {};
6212
4716
  const data = parsedOutput.body;
6213
4717
  if (data.fields !== undefined && data.fields !== null) {
6214
4718
  contents.fields = deserializeAws_restJson1ValidationExceptionFieldList(data.fields, context);
@@ -6219,7 +4723,11 @@ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput,
6219
4723
  if (data.reason !== undefined && data.reason !== null) {
6220
4724
  contents.reason = smithy_client_1.expectString(data.reason);
6221
4725
  }
6222
- return contents;
4726
+ const exception = new models_0_1.ValidationException({
4727
+ $metadata: deserializeMetadata(parsedOutput),
4728
+ ...contents,
4729
+ });
4730
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
6223
4731
  };
6224
4732
  const serializeAws_restJson1AssessmentReportsDestination = (input, context) => {
6225
4733
  return {
@@ -6502,7 +5010,7 @@ const deserializeAws_restJson1AssessmentControl = (output, context) => {
6502
5010
  };
6503
5011
  };
6504
5012
  const deserializeAws_restJson1AssessmentControls = (output, context) => {
6505
- return (output || [])
5013
+ const retVal = (output || [])
6506
5014
  .filter((e) => e != null)
6507
5015
  .map((entry) => {
6508
5016
  if (entry === null) {
@@ -6510,6 +5018,7 @@ const deserializeAws_restJson1AssessmentControls = (output, context) => {
6510
5018
  }
6511
5019
  return deserializeAws_restJson1AssessmentControl(entry, context);
6512
5020
  });
5021
+ return retVal;
6513
5022
  };
6514
5023
  const deserializeAws_restJson1AssessmentControlSet = (output, context) => {
6515
5024
  return {
@@ -6530,7 +5039,7 @@ const deserializeAws_restJson1AssessmentControlSet = (output, context) => {
6530
5039
  };
6531
5040
  };
6532
5041
  const deserializeAws_restJson1AssessmentControlSets = (output, context) => {
6533
- return (output || [])
5042
+ const retVal = (output || [])
6534
5043
  .filter((e) => e != null)
6535
5044
  .map((entry) => {
6536
5045
  if (entry === null) {
@@ -6538,6 +5047,7 @@ const deserializeAws_restJson1AssessmentControlSets = (output, context) => {
6538
5047
  }
6539
5048
  return deserializeAws_restJson1AssessmentControlSet(entry, context);
6540
5049
  });
5050
+ return retVal;
6541
5051
  };
6542
5052
  const deserializeAws_restJson1AssessmentEvidenceFolder = (output, context) => {
6543
5053
  return {
@@ -6564,7 +5074,7 @@ const deserializeAws_restJson1AssessmentEvidenceFolder = (output, context) => {
6564
5074
  };
6565
5075
  };
6566
5076
  const deserializeAws_restJson1AssessmentEvidenceFolders = (output, context) => {
6567
- return (output || [])
5077
+ const retVal = (output || [])
6568
5078
  .filter((e) => e != null)
6569
5079
  .map((entry) => {
6570
5080
  if (entry === null) {
@@ -6572,6 +5082,7 @@ const deserializeAws_restJson1AssessmentEvidenceFolders = (output, context) => {
6572
5082
  }
6573
5083
  return deserializeAws_restJson1AssessmentEvidenceFolder(entry, context);
6574
5084
  });
5085
+ return retVal;
6575
5086
  };
6576
5087
  const deserializeAws_restJson1AssessmentFramework = (output, context) => {
6577
5088
  return {
@@ -6630,7 +5141,7 @@ const deserializeAws_restJson1AssessmentFrameworkShareRequest = (output, context
6630
5141
  };
6631
5142
  };
6632
5143
  const deserializeAws_restJson1AssessmentFrameworkShareRequestList = (output, context) => {
6633
- return (output || [])
5144
+ const retVal = (output || [])
6634
5145
  .filter((e) => e != null)
6635
5146
  .map((entry) => {
6636
5147
  if (entry === null) {
@@ -6638,6 +5149,7 @@ const deserializeAws_restJson1AssessmentFrameworkShareRequestList = (output, con
6638
5149
  }
6639
5150
  return deserializeAws_restJson1AssessmentFrameworkShareRequest(entry, context);
6640
5151
  });
5152
+ return retVal;
6641
5153
  };
6642
5154
  const deserializeAws_restJson1AssessmentMetadata = (output, context) => {
6643
5155
  return {
@@ -6709,7 +5221,7 @@ const deserializeAws_restJson1AssessmentReportEvidenceError = (output, context)
6709
5221
  };
6710
5222
  };
6711
5223
  const deserializeAws_restJson1AssessmentReportEvidenceErrors = (output, context) => {
6712
- return (output || [])
5224
+ const retVal = (output || [])
6713
5225
  .filter((e) => e != null)
6714
5226
  .map((entry) => {
6715
5227
  if (entry === null) {
@@ -6717,6 +5229,7 @@ const deserializeAws_restJson1AssessmentReportEvidenceErrors = (output, context)
6717
5229
  }
6718
5230
  return deserializeAws_restJson1AssessmentReportEvidenceError(entry, context);
6719
5231
  });
5232
+ return retVal;
6720
5233
  };
6721
5234
  const deserializeAws_restJson1AssessmentReportMetadata = (output, context) => {
6722
5235
  return {
@@ -6739,7 +5252,7 @@ const deserializeAws_restJson1AssessmentReportsDestination = (output, context) =
6739
5252
  };
6740
5253
  };
6741
5254
  const deserializeAws_restJson1AssessmentReportsMetadata = (output, context) => {
6742
- return (output || [])
5255
+ const retVal = (output || [])
6743
5256
  .filter((e) => e != null)
6744
5257
  .map((entry) => {
6745
5258
  if (entry === null) {
@@ -6747,6 +5260,7 @@ const deserializeAws_restJson1AssessmentReportsMetadata = (output, context) => {
6747
5260
  }
6748
5261
  return deserializeAws_restJson1AssessmentReportMetadata(entry, context);
6749
5262
  });
5263
+ return retVal;
6750
5264
  };
6751
5265
  const deserializeAws_restJson1AWSAccount = (output, context) => {
6752
5266
  return {
@@ -6756,7 +5270,7 @@ const deserializeAws_restJson1AWSAccount = (output, context) => {
6756
5270
  };
6757
5271
  };
6758
5272
  const deserializeAws_restJson1AWSAccounts = (output, context) => {
6759
- return (output || [])
5273
+ const retVal = (output || [])
6760
5274
  .filter((e) => e != null)
6761
5275
  .map((entry) => {
6762
5276
  if (entry === null) {
@@ -6764,6 +5278,7 @@ const deserializeAws_restJson1AWSAccounts = (output, context) => {
6764
5278
  }
6765
5279
  return deserializeAws_restJson1AWSAccount(entry, context);
6766
5280
  });
5281
+ return retVal;
6767
5282
  };
6768
5283
  const deserializeAws_restJson1AWSService = (output, context) => {
6769
5284
  return {
@@ -6771,7 +5286,7 @@ const deserializeAws_restJson1AWSService = (output, context) => {
6771
5286
  };
6772
5287
  };
6773
5288
  const deserializeAws_restJson1AWSServices = (output, context) => {
6774
- return (output || [])
5289
+ const retVal = (output || [])
6775
5290
  .filter((e) => e != null)
6776
5291
  .map((entry) => {
6777
5292
  if (entry === null) {
@@ -6779,6 +5294,7 @@ const deserializeAws_restJson1AWSServices = (output, context) => {
6779
5294
  }
6780
5295
  return deserializeAws_restJson1AWSService(entry, context);
6781
5296
  });
5297
+ return retVal;
6782
5298
  };
6783
5299
  const deserializeAws_restJson1BatchCreateDelegationByAssessmentError = (output, context) => {
6784
5300
  return {
@@ -6790,7 +5306,7 @@ const deserializeAws_restJson1BatchCreateDelegationByAssessmentError = (output,
6790
5306
  };
6791
5307
  };
6792
5308
  const deserializeAws_restJson1BatchCreateDelegationByAssessmentErrors = (output, context) => {
6793
- return (output || [])
5309
+ const retVal = (output || [])
6794
5310
  .filter((e) => e != null)
6795
5311
  .map((entry) => {
6796
5312
  if (entry === null) {
@@ -6798,6 +5314,7 @@ const deserializeAws_restJson1BatchCreateDelegationByAssessmentErrors = (output,
6798
5314
  }
6799
5315
  return deserializeAws_restJson1BatchCreateDelegationByAssessmentError(entry, context);
6800
5316
  });
5317
+ return retVal;
6801
5318
  };
6802
5319
  const deserializeAws_restJson1BatchDeleteDelegationByAssessmentError = (output, context) => {
6803
5320
  return {
@@ -6807,7 +5324,7 @@ const deserializeAws_restJson1BatchDeleteDelegationByAssessmentError = (output,
6807
5324
  };
6808
5325
  };
6809
5326
  const deserializeAws_restJson1BatchDeleteDelegationByAssessmentErrors = (output, context) => {
6810
- return (output || [])
5327
+ const retVal = (output || [])
6811
5328
  .filter((e) => e != null)
6812
5329
  .map((entry) => {
6813
5330
  if (entry === null) {
@@ -6815,6 +5332,7 @@ const deserializeAws_restJson1BatchDeleteDelegationByAssessmentErrors = (output,
6815
5332
  }
6816
5333
  return deserializeAws_restJson1BatchDeleteDelegationByAssessmentError(entry, context);
6817
5334
  });
5335
+ return retVal;
6818
5336
  };
6819
5337
  const deserializeAws_restJson1BatchImportEvidenceToAssessmentControlError = (output, context) => {
6820
5338
  return {
@@ -6826,7 +5344,7 @@ const deserializeAws_restJson1BatchImportEvidenceToAssessmentControlError = (out
6826
5344
  };
6827
5345
  };
6828
5346
  const deserializeAws_restJson1BatchImportEvidenceToAssessmentControlErrors = (output, context) => {
6829
- return (output || [])
5347
+ const retVal = (output || [])
6830
5348
  .filter((e) => e != null)
6831
5349
  .map((entry) => {
6832
5350
  if (entry === null) {
@@ -6834,6 +5352,7 @@ const deserializeAws_restJson1BatchImportEvidenceToAssessmentControlErrors = (ou
6834
5352
  }
6835
5353
  return deserializeAws_restJson1BatchImportEvidenceToAssessmentControlError(entry, context);
6836
5354
  });
5355
+ return retVal;
6837
5356
  };
6838
5357
  const deserializeAws_restJson1ChangeLog = (output, context) => {
6839
5358
  return {
@@ -6847,7 +5366,7 @@ const deserializeAws_restJson1ChangeLog = (output, context) => {
6847
5366
  };
6848
5367
  };
6849
5368
  const deserializeAws_restJson1ChangeLogs = (output, context) => {
6850
- return (output || [])
5369
+ const retVal = (output || [])
6851
5370
  .filter((e) => e != null)
6852
5371
  .map((entry) => {
6853
5372
  if (entry === null) {
@@ -6855,6 +5374,7 @@ const deserializeAws_restJson1ChangeLogs = (output, context) => {
6855
5374
  }
6856
5375
  return deserializeAws_restJson1ChangeLog(entry, context);
6857
5376
  });
5377
+ return retVal;
6858
5378
  };
6859
5379
  const deserializeAws_restJson1Control = (output, context) => {
6860
5380
  return {
@@ -6893,7 +5413,7 @@ const deserializeAws_restJson1ControlComment = (output, context) => {
6893
5413
  };
6894
5414
  };
6895
5415
  const deserializeAws_restJson1ControlComments = (output, context) => {
6896
- return (output || [])
5416
+ const retVal = (output || [])
6897
5417
  .filter((e) => e != null)
6898
5418
  .map((entry) => {
6899
5419
  if (entry === null) {
@@ -6901,6 +5421,7 @@ const deserializeAws_restJson1ControlComments = (output, context) => {
6901
5421
  }
6902
5422
  return deserializeAws_restJson1ControlComment(entry, context);
6903
5423
  });
5424
+ return retVal;
6904
5425
  };
6905
5426
  const deserializeAws_restJson1ControlDomainInsights = (output, context) => {
6906
5427
  return {
@@ -6917,7 +5438,7 @@ const deserializeAws_restJson1ControlDomainInsights = (output, context) => {
6917
5438
  };
6918
5439
  };
6919
5440
  const deserializeAws_restJson1ControlDomainInsightsList = (output, context) => {
6920
- return (output || [])
5441
+ const retVal = (output || [])
6921
5442
  .filter((e) => e != null)
6922
5443
  .map((entry) => {
6923
5444
  if (entry === null) {
@@ -6925,9 +5446,10 @@ const deserializeAws_restJson1ControlDomainInsightsList = (output, context) => {
6925
5446
  }
6926
5447
  return deserializeAws_restJson1ControlDomainInsights(entry, context);
6927
5448
  });
5449
+ return retVal;
6928
5450
  };
6929
5451
  const deserializeAws_restJson1ControlInsightsMetadata = (output, context) => {
6930
- return (output || [])
5452
+ const retVal = (output || [])
6931
5453
  .filter((e) => e != null)
6932
5454
  .map((entry) => {
6933
5455
  if (entry === null) {
@@ -6935,9 +5457,10 @@ const deserializeAws_restJson1ControlInsightsMetadata = (output, context) => {
6935
5457
  }
6936
5458
  return deserializeAws_restJson1ControlInsightsMetadataItem(entry, context);
6937
5459
  });
5460
+ return retVal;
6938
5461
  };
6939
5462
  const deserializeAws_restJson1ControlInsightsMetadataByAssessment = (output, context) => {
6940
- return (output || [])
5463
+ const retVal = (output || [])
6941
5464
  .filter((e) => e != null)
6942
5465
  .map((entry) => {
6943
5466
  if (entry === null) {
@@ -6945,6 +5468,7 @@ const deserializeAws_restJson1ControlInsightsMetadataByAssessment = (output, con
6945
5468
  }
6946
5469
  return deserializeAws_restJson1ControlInsightsMetadataByAssessmentItem(entry, context);
6947
5470
  });
5471
+ return retVal;
6948
5472
  };
6949
5473
  const deserializeAws_restJson1ControlInsightsMetadataByAssessmentItem = (output, context) => {
6950
5474
  return {
@@ -6986,7 +5510,7 @@ const deserializeAws_restJson1ControlMappingSource = (output, context) => {
6986
5510
  };
6987
5511
  };
6988
5512
  const deserializeAws_restJson1ControlMappingSources = (output, context) => {
6989
- return (output || [])
5513
+ const retVal = (output || [])
6990
5514
  .filter((e) => e != null)
6991
5515
  .map((entry) => {
6992
5516
  if (entry === null) {
@@ -6994,6 +5518,7 @@ const deserializeAws_restJson1ControlMappingSources = (output, context) => {
6994
5518
  }
6995
5519
  return deserializeAws_restJson1ControlMappingSource(entry, context);
6996
5520
  });
5521
+ return retVal;
6997
5522
  };
6998
5523
  const deserializeAws_restJson1ControlMetadata = (output, context) => {
6999
5524
  return {
@@ -7010,7 +5535,7 @@ const deserializeAws_restJson1ControlMetadata = (output, context) => {
7010
5535
  };
7011
5536
  };
7012
5537
  const deserializeAws_restJson1ControlMetadataList = (output, context) => {
7013
- return (output || [])
5538
+ const retVal = (output || [])
7014
5539
  .filter((e) => e != null)
7015
5540
  .map((entry) => {
7016
5541
  if (entry === null) {
@@ -7018,9 +5543,10 @@ const deserializeAws_restJson1ControlMetadataList = (output, context) => {
7018
5543
  }
7019
5544
  return deserializeAws_restJson1ControlMetadata(entry, context);
7020
5545
  });
5546
+ return retVal;
7021
5547
  };
7022
5548
  const deserializeAws_restJson1Controls = (output, context) => {
7023
- return (output || [])
5549
+ const retVal = (output || [])
7024
5550
  .filter((e) => e != null)
7025
5551
  .map((entry) => {
7026
5552
  if (entry === null) {
@@ -7028,6 +5554,7 @@ const deserializeAws_restJson1Controls = (output, context) => {
7028
5554
  }
7029
5555
  return deserializeAws_restJson1Control(entry, context);
7030
5556
  });
5557
+ return retVal;
7031
5558
  };
7032
5559
  const deserializeAws_restJson1ControlSet = (output, context) => {
7033
5560
  return {
@@ -7039,7 +5566,7 @@ const deserializeAws_restJson1ControlSet = (output, context) => {
7039
5566
  };
7040
5567
  };
7041
5568
  const deserializeAws_restJson1ControlSets = (output, context) => {
7042
- return (output || [])
5569
+ const retVal = (output || [])
7043
5570
  .filter((e) => e != null)
7044
5571
  .map((entry) => {
7045
5572
  if (entry === null) {
@@ -7047,6 +5574,7 @@ const deserializeAws_restJson1ControlSets = (output, context) => {
7047
5574
  }
7048
5575
  return deserializeAws_restJson1ControlSet(entry, context);
7049
5576
  });
5577
+ return retVal;
7050
5578
  };
7051
5579
  const deserializeAws_restJson1CreateDelegationRequest = (output, context) => {
7052
5580
  return {
@@ -7089,7 +5617,7 @@ const deserializeAws_restJson1DelegationMetadata = (output, context) => {
7089
5617
  };
7090
5618
  };
7091
5619
  const deserializeAws_restJson1DelegationMetadataList = (output, context) => {
7092
- return (output || [])
5620
+ const retVal = (output || [])
7093
5621
  .filter((e) => e != null)
7094
5622
  .map((entry) => {
7095
5623
  if (entry === null) {
@@ -7097,9 +5625,10 @@ const deserializeAws_restJson1DelegationMetadataList = (output, context) => {
7097
5625
  }
7098
5626
  return deserializeAws_restJson1DelegationMetadata(entry, context);
7099
5627
  });
5628
+ return retVal;
7100
5629
  };
7101
5630
  const deserializeAws_restJson1Delegations = (output, context) => {
7102
- return (output || [])
5631
+ const retVal = (output || [])
7103
5632
  .filter((e) => e != null)
7104
5633
  .map((entry) => {
7105
5634
  if (entry === null) {
@@ -7107,6 +5636,7 @@ const deserializeAws_restJson1Delegations = (output, context) => {
7107
5636
  }
7108
5637
  return deserializeAws_restJson1Delegation(entry, context);
7109
5638
  });
5639
+ return retVal;
7110
5640
  };
7111
5641
  const deserializeAws_restJson1Evidence = (output, context) => {
7112
5642
  return {
@@ -7145,7 +5675,7 @@ const deserializeAws_restJson1EvidenceAttributes = (output, context) => {
7145
5675
  }, {});
7146
5676
  };
7147
5677
  const deserializeAws_restJson1EvidenceIds = (output, context) => {
7148
- return (output || [])
5678
+ const retVal = (output || [])
7149
5679
  .filter((e) => e != null)
7150
5680
  .map((entry) => {
7151
5681
  if (entry === null) {
@@ -7153,6 +5683,7 @@ const deserializeAws_restJson1EvidenceIds = (output, context) => {
7153
5683
  }
7154
5684
  return smithy_client_1.expectString(entry);
7155
5685
  });
5686
+ return retVal;
7156
5687
  };
7157
5688
  const deserializeAws_restJson1EvidenceInsights = (output, context) => {
7158
5689
  return {
@@ -7162,7 +5693,7 @@ const deserializeAws_restJson1EvidenceInsights = (output, context) => {
7162
5693
  };
7163
5694
  };
7164
5695
  const deserializeAws_restJson1EvidenceList = (output, context) => {
7165
- return (output || [])
5696
+ const retVal = (output || [])
7166
5697
  .filter((e) => e != null)
7167
5698
  .map((entry) => {
7168
5699
  if (entry === null) {
@@ -7170,9 +5701,10 @@ const deserializeAws_restJson1EvidenceList = (output, context) => {
7170
5701
  }
7171
5702
  return deserializeAws_restJson1Evidence(entry, context);
7172
5703
  });
5704
+ return retVal;
7173
5705
  };
7174
5706
  const deserializeAws_restJson1EvidenceSources = (output, context) => {
7175
- return (output || [])
5707
+ const retVal = (output || [])
7176
5708
  .filter((e) => e != null)
7177
5709
  .map((entry) => {
7178
5710
  if (entry === null) {
@@ -7180,6 +5712,7 @@ const deserializeAws_restJson1EvidenceSources = (output, context) => {
7180
5712
  }
7181
5713
  return smithy_client_1.expectString(entry);
7182
5714
  });
5715
+ return retVal;
7183
5716
  };
7184
5717
  const deserializeAws_restJson1Framework = (output, context) => {
7185
5718
  return {
@@ -7216,7 +5749,7 @@ const deserializeAws_restJson1FrameworkMetadata = (output, context) => {
7216
5749
  };
7217
5750
  };
7218
5751
  const deserializeAws_restJson1FrameworkMetadataList = (output, context) => {
7219
- return (output || [])
5752
+ const retVal = (output || [])
7220
5753
  .filter((e) => e != null)
7221
5754
  .map((entry) => {
7222
5755
  if (entry === null) {
@@ -7224,6 +5757,7 @@ const deserializeAws_restJson1FrameworkMetadataList = (output, context) => {
7224
5757
  }
7225
5758
  return deserializeAws_restJson1AssessmentFrameworkMetadata(entry, context);
7226
5759
  });
5760
+ return retVal;
7227
5761
  };
7228
5762
  const deserializeAws_restJson1Insights = (output, context) => {
7229
5763
  return {
@@ -7251,7 +5785,7 @@ const deserializeAws_restJson1InsightsByAssessment = (output, context) => {
7251
5785
  };
7252
5786
  };
7253
5787
  const deserializeAws_restJson1Keywords = (output, context) => {
7254
- return (output || [])
5788
+ const retVal = (output || [])
7255
5789
  .filter((e) => e != null)
7256
5790
  .map((entry) => {
7257
5791
  if (entry === null) {
@@ -7259,9 +5793,10 @@ const deserializeAws_restJson1Keywords = (output, context) => {
7259
5793
  }
7260
5794
  return smithy_client_1.expectString(entry);
7261
5795
  });
5796
+ return retVal;
7262
5797
  };
7263
5798
  const deserializeAws_restJson1ListAssessmentMetadata = (output, context) => {
7264
- return (output || [])
5799
+ const retVal = (output || [])
7265
5800
  .filter((e) => e != null)
7266
5801
  .map((entry) => {
7267
5802
  if (entry === null) {
@@ -7269,6 +5804,7 @@ const deserializeAws_restJson1ListAssessmentMetadata = (output, context) => {
7269
5804
  }
7270
5805
  return deserializeAws_restJson1AssessmentMetadataItem(entry, context);
7271
5806
  });
5807
+ return retVal;
7272
5808
  };
7273
5809
  const deserializeAws_restJson1ManualEvidence = (output, context) => {
7274
5810
  return {
@@ -7290,7 +5826,7 @@ const deserializeAws_restJson1Notification = (output, context) => {
7290
5826
  };
7291
5827
  };
7292
5828
  const deserializeAws_restJson1Notifications = (output, context) => {
7293
- return (output || [])
5829
+ const retVal = (output || [])
7294
5830
  .filter((e) => e != null)
7295
5831
  .map((entry) => {
7296
5832
  if (entry === null) {
@@ -7298,6 +5834,7 @@ const deserializeAws_restJson1Notifications = (output, context) => {
7298
5834
  }
7299
5835
  return deserializeAws_restJson1Notification(entry, context);
7300
5836
  });
5837
+ return retVal;
7301
5838
  };
7302
5839
  const deserializeAws_restJson1Resource = (output, context) => {
7303
5840
  return {
@@ -7306,7 +5843,7 @@ const deserializeAws_restJson1Resource = (output, context) => {
7306
5843
  };
7307
5844
  };
7308
5845
  const deserializeAws_restJson1Resources = (output, context) => {
7309
- return (output || [])
5846
+ const retVal = (output || [])
7310
5847
  .filter((e) => e != null)
7311
5848
  .map((entry) => {
7312
5849
  if (entry === null) {
@@ -7314,6 +5851,7 @@ const deserializeAws_restJson1Resources = (output, context) => {
7314
5851
  }
7315
5852
  return deserializeAws_restJson1Resource(entry, context);
7316
5853
  });
5854
+ return retVal;
7317
5855
  };
7318
5856
  const deserializeAws_restJson1Role = (output, context) => {
7319
5857
  return {
@@ -7322,7 +5860,7 @@ const deserializeAws_restJson1Role = (output, context) => {
7322
5860
  };
7323
5861
  };
7324
5862
  const deserializeAws_restJson1Roles = (output, context) => {
7325
- return (output || [])
5863
+ const retVal = (output || [])
7326
5864
  .filter((e) => e != null)
7327
5865
  .map((entry) => {
7328
5866
  if (entry === null) {
@@ -7330,6 +5868,7 @@ const deserializeAws_restJson1Roles = (output, context) => {
7330
5868
  }
7331
5869
  return deserializeAws_restJson1Role(entry, context);
7332
5870
  });
5871
+ return retVal;
7333
5872
  };
7334
5873
  const deserializeAws_restJson1Scope = (output, context) => {
7335
5874
  return {
@@ -7350,7 +5889,7 @@ const deserializeAws_restJson1ServiceMetadata = (output, context) => {
7350
5889
  };
7351
5890
  };
7352
5891
  const deserializeAws_restJson1ServiceMetadataList = (output, context) => {
7353
- return (output || [])
5892
+ const retVal = (output || [])
7354
5893
  .filter((e) => e != null)
7355
5894
  .map((entry) => {
7356
5895
  if (entry === null) {
@@ -7358,6 +5897,7 @@ const deserializeAws_restJson1ServiceMetadataList = (output, context) => {
7358
5897
  }
7359
5898
  return deserializeAws_restJson1ServiceMetadata(entry, context);
7360
5899
  });
5900
+ return retVal;
7361
5901
  };
7362
5902
  const deserializeAws_restJson1Settings = (output, context) => {
7363
5903
  return {
@@ -7396,7 +5936,7 @@ const deserializeAws_restJson1URL = (output, context) => {
7396
5936
  };
7397
5937
  };
7398
5938
  const deserializeAws_restJson1ValidationErrors = (output, context) => {
7399
- return (output || [])
5939
+ const retVal = (output || [])
7400
5940
  .filter((e) => e != null)
7401
5941
  .map((entry) => {
7402
5942
  if (entry === null) {
@@ -7404,6 +5944,7 @@ const deserializeAws_restJson1ValidationErrors = (output, context) => {
7404
5944
  }
7405
5945
  return smithy_client_1.expectString(entry);
7406
5946
  });
5947
+ return retVal;
7407
5948
  };
7408
5949
  const deserializeAws_restJson1ValidationExceptionField = (output, context) => {
7409
5950
  return {
@@ -7412,7 +5953,7 @@ const deserializeAws_restJson1ValidationExceptionField = (output, context) => {
7412
5953
  };
7413
5954
  };
7414
5955
  const deserializeAws_restJson1ValidationExceptionFieldList = (output, context) => {
7415
- return (output || [])
5956
+ const retVal = (output || [])
7416
5957
  .filter((e) => e != null)
7417
5958
  .map((entry) => {
7418
5959
  if (entry === null) {
@@ -7420,6 +5961,7 @@ const deserializeAws_restJson1ValidationExceptionFieldList = (output, context) =
7420
5961
  }
7421
5962
  return deserializeAws_restJson1ValidationExceptionField(entry, context);
7422
5963
  });
5964
+ return retVal;
7423
5965
  };
7424
5966
  const deserializeMetadata = (output) => {
7425
5967
  var _a;