@aws-sdk/client-appsync 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.
@@ -4,6 +4,8 @@ exports.deserializeAws_restJson1AssociateApiCommand = exports.serializeAws_restJ
4
4
  exports.deserializeAws_restJson1UpdateTypeCommand = exports.deserializeAws_restJson1UpdateResolverCommand = exports.deserializeAws_restJson1UpdateGraphqlApiCommand = exports.deserializeAws_restJson1UpdateFunctionCommand = exports.deserializeAws_restJson1UpdateDomainNameCommand = exports.deserializeAws_restJson1UpdateDataSourceCommand = exports.deserializeAws_restJson1UpdateApiKeyCommand = exports.deserializeAws_restJson1UpdateApiCacheCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1StartSchemaCreationCommand = exports.deserializeAws_restJson1ListTypesCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListResolversByFunctionCommand = exports.deserializeAws_restJson1ListResolversCommand = exports.deserializeAws_restJson1ListGraphqlApisCommand = exports.deserializeAws_restJson1ListFunctionsCommand = exports.deserializeAws_restJson1ListDomainNamesCommand = exports.deserializeAws_restJson1ListDataSourcesCommand = exports.deserializeAws_restJson1ListApiKeysCommand = exports.deserializeAws_restJson1GetTypeCommand = exports.deserializeAws_restJson1GetSchemaCreationStatusCommand = exports.deserializeAws_restJson1GetResolverCommand = exports.deserializeAws_restJson1GetIntrospectionSchemaCommand = exports.deserializeAws_restJson1GetGraphqlApiCommand = exports.deserializeAws_restJson1GetFunctionCommand = exports.deserializeAws_restJson1GetDomainNameCommand = exports.deserializeAws_restJson1GetDataSourceCommand = exports.deserializeAws_restJson1GetApiCacheCommand = exports.deserializeAws_restJson1GetApiAssociationCommand = exports.deserializeAws_restJson1FlushApiCacheCommand = exports.deserializeAws_restJson1DisassociateApiCommand = exports.deserializeAws_restJson1DeleteTypeCommand = exports.deserializeAws_restJson1DeleteResolverCommand = exports.deserializeAws_restJson1DeleteGraphqlApiCommand = exports.deserializeAws_restJson1DeleteFunctionCommand = exports.deserializeAws_restJson1DeleteDomainNameCommand = exports.deserializeAws_restJson1DeleteDataSourceCommand = exports.deserializeAws_restJson1DeleteApiKeyCommand = exports.deserializeAws_restJson1DeleteApiCacheCommand = exports.deserializeAws_restJson1CreateTypeCommand = exports.deserializeAws_restJson1CreateResolverCommand = exports.deserializeAws_restJson1CreateGraphqlApiCommand = exports.deserializeAws_restJson1CreateFunctionCommand = exports.deserializeAws_restJson1CreateDomainNameCommand = exports.deserializeAws_restJson1CreateDataSourceCommand = exports.deserializeAws_restJson1CreateApiKeyCommand = exports.deserializeAws_restJson1CreateApiCacheCommand = void 0;
5
5
  const protocol_http_1 = require("@aws-sdk/protocol-http");
6
6
  const smithy_client_1 = require("@aws-sdk/smithy-client");
7
+ const AppSyncServiceException_1 = require("../models/AppSyncServiceException");
8
+ const models_0_1 = require("../models/models_0");
7
9
  const serializeAws_restJson1AssociateApiCommand = async (input, context) => {
8
10
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
9
11
  const headers = {
@@ -1794,51 +1796,25 @@ const deserializeAws_restJson1AssociateApiCommandError = async (output, context)
1794
1796
  switch (errorCode) {
1795
1797
  case "AccessDeniedException":
1796
1798
  case "com.amazonaws.appsync#AccessDeniedException":
1797
- response = {
1798
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
1799
- name: errorCode,
1800
- $metadata: deserializeMetadata(output),
1801
- };
1802
- break;
1799
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
1803
1800
  case "BadRequestException":
1804
1801
  case "com.amazonaws.appsync#BadRequestException":
1805
- response = {
1806
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1807
- name: errorCode,
1808
- $metadata: deserializeMetadata(output),
1809
- };
1810
- break;
1802
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1811
1803
  case "InternalFailureException":
1812
1804
  case "com.amazonaws.appsync#InternalFailureException":
1813
- response = {
1814
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
1815
- name: errorCode,
1816
- $metadata: deserializeMetadata(output),
1817
- };
1818
- break;
1805
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
1819
1806
  case "NotFoundException":
1820
1807
  case "com.amazonaws.appsync#NotFoundException":
1821
- response = {
1822
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1823
- name: errorCode,
1824
- $metadata: deserializeMetadata(output),
1825
- };
1826
- break;
1808
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1827
1809
  default:
1828
1810
  const parsedBody = parsedOutput.body;
1829
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1830
- response = {
1831
- ...parsedBody,
1832
- name: `${errorCode}`,
1833
- message: parsedBody.message || parsedBody.Message || errorCode,
1811
+ response = new AppSyncServiceException_1.AppSyncServiceException({
1812
+ name: parsedBody.code || parsedBody.Code || errorCode,
1834
1813
  $fault: "client",
1835
1814
  $metadata: deserializeMetadata(output),
1836
- };
1815
+ });
1816
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1837
1817
  }
1838
- const message = response.message || response.Message || errorCode;
1839
- response.message = message;
1840
- delete response.Message;
1841
- return Promise.reject(Object.assign(new Error(message), response));
1842
1818
  };
1843
1819
  const deserializeAws_restJson1CreateApiCacheCommand = async (output, context) => {
1844
1820
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1866,59 +1842,28 @@ const deserializeAws_restJson1CreateApiCacheCommandError = async (output, contex
1866
1842
  switch (errorCode) {
1867
1843
  case "BadRequestException":
1868
1844
  case "com.amazonaws.appsync#BadRequestException":
1869
- response = {
1870
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1871
- name: errorCode,
1872
- $metadata: deserializeMetadata(output),
1873
- };
1874
- break;
1845
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1875
1846
  case "ConcurrentModificationException":
1876
1847
  case "com.amazonaws.appsync#ConcurrentModificationException":
1877
- response = {
1878
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
1879
- name: errorCode,
1880
- $metadata: deserializeMetadata(output),
1881
- };
1882
- break;
1848
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
1883
1849
  case "InternalFailureException":
1884
1850
  case "com.amazonaws.appsync#InternalFailureException":
1885
- response = {
1886
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
1887
- name: errorCode,
1888
- $metadata: deserializeMetadata(output),
1889
- };
1890
- break;
1851
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
1891
1852
  case "NotFoundException":
1892
1853
  case "com.amazonaws.appsync#NotFoundException":
1893
- response = {
1894
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1895
- name: errorCode,
1896
- $metadata: deserializeMetadata(output),
1897
- };
1898
- break;
1854
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1899
1855
  case "UnauthorizedException":
1900
1856
  case "com.amazonaws.appsync#UnauthorizedException":
1901
- response = {
1902
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
1903
- name: errorCode,
1904
- $metadata: deserializeMetadata(output),
1905
- };
1906
- break;
1857
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1907
1858
  default:
1908
1859
  const parsedBody = parsedOutput.body;
1909
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1910
- response = {
1911
- ...parsedBody,
1912
- name: `${errorCode}`,
1913
- message: parsedBody.message || parsedBody.Message || errorCode,
1860
+ response = new AppSyncServiceException_1.AppSyncServiceException({
1861
+ name: parsedBody.code || parsedBody.Code || errorCode,
1914
1862
  $fault: "client",
1915
1863
  $metadata: deserializeMetadata(output),
1916
- };
1864
+ });
1865
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1917
1866
  }
1918
- const message = response.message || response.Message || errorCode;
1919
- response.message = message;
1920
- delete response.Message;
1921
- return Promise.reject(Object.assign(new Error(message), response));
1922
1867
  };
1923
1868
  const deserializeAws_restJson1CreateApiKeyCommand = async (output, context) => {
1924
1869
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1946,75 +1891,34 @@ const deserializeAws_restJson1CreateApiKeyCommandError = async (output, context)
1946
1891
  switch (errorCode) {
1947
1892
  case "ApiKeyLimitExceededException":
1948
1893
  case "com.amazonaws.appsync#ApiKeyLimitExceededException":
1949
- response = {
1950
- ...(await deserializeAws_restJson1ApiKeyLimitExceededExceptionResponse(parsedOutput, context)),
1951
- name: errorCode,
1952
- $metadata: deserializeMetadata(output),
1953
- };
1954
- break;
1894
+ throw await deserializeAws_restJson1ApiKeyLimitExceededExceptionResponse(parsedOutput, context);
1955
1895
  case "ApiKeyValidityOutOfBoundsException":
1956
1896
  case "com.amazonaws.appsync#ApiKeyValidityOutOfBoundsException":
1957
- response = {
1958
- ...(await deserializeAws_restJson1ApiKeyValidityOutOfBoundsExceptionResponse(parsedOutput, context)),
1959
- name: errorCode,
1960
- $metadata: deserializeMetadata(output),
1961
- };
1962
- break;
1897
+ throw await deserializeAws_restJson1ApiKeyValidityOutOfBoundsExceptionResponse(parsedOutput, context);
1963
1898
  case "BadRequestException":
1964
1899
  case "com.amazonaws.appsync#BadRequestException":
1965
- response = {
1966
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
1967
- name: errorCode,
1968
- $metadata: deserializeMetadata(output),
1969
- };
1970
- break;
1900
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
1971
1901
  case "InternalFailureException":
1972
1902
  case "com.amazonaws.appsync#InternalFailureException":
1973
- response = {
1974
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
1975
- name: errorCode,
1976
- $metadata: deserializeMetadata(output),
1977
- };
1978
- break;
1903
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
1979
1904
  case "LimitExceededException":
1980
1905
  case "com.amazonaws.appsync#LimitExceededException":
1981
- response = {
1982
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
1983
- name: errorCode,
1984
- $metadata: deserializeMetadata(output),
1985
- };
1986
- break;
1906
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
1987
1907
  case "NotFoundException":
1988
1908
  case "com.amazonaws.appsync#NotFoundException":
1989
- response = {
1990
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
1991
- name: errorCode,
1992
- $metadata: deserializeMetadata(output),
1993
- };
1994
- break;
1909
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
1995
1910
  case "UnauthorizedException":
1996
1911
  case "com.amazonaws.appsync#UnauthorizedException":
1997
- response = {
1998
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
1999
- name: errorCode,
2000
- $metadata: deserializeMetadata(output),
2001
- };
2002
- break;
1912
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2003
1913
  default:
2004
1914
  const parsedBody = parsedOutput.body;
2005
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2006
- response = {
2007
- ...parsedBody,
2008
- name: `${errorCode}`,
2009
- message: parsedBody.message || parsedBody.Message || errorCode,
1915
+ response = new AppSyncServiceException_1.AppSyncServiceException({
1916
+ name: parsedBody.code || parsedBody.Code || errorCode,
2010
1917
  $fault: "client",
2011
1918
  $metadata: deserializeMetadata(output),
2012
- };
1919
+ });
1920
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2013
1921
  }
2014
- const message = response.message || response.Message || errorCode;
2015
- response.message = message;
2016
- delete response.Message;
2017
- return Promise.reject(Object.assign(new Error(message), response));
2018
1922
  };
2019
1923
  const deserializeAws_restJson1CreateDataSourceCommand = async (output, context) => {
2020
1924
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2042,59 +1946,28 @@ const deserializeAws_restJson1CreateDataSourceCommandError = async (output, cont
2042
1946
  switch (errorCode) {
2043
1947
  case "BadRequestException":
2044
1948
  case "com.amazonaws.appsync#BadRequestException":
2045
- response = {
2046
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2047
- name: errorCode,
2048
- $metadata: deserializeMetadata(output),
2049
- };
2050
- break;
1949
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2051
1950
  case "ConcurrentModificationException":
2052
1951
  case "com.amazonaws.appsync#ConcurrentModificationException":
2053
- response = {
2054
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
2055
- name: errorCode,
2056
- $metadata: deserializeMetadata(output),
2057
- };
2058
- break;
1952
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
2059
1953
  case "InternalFailureException":
2060
1954
  case "com.amazonaws.appsync#InternalFailureException":
2061
- response = {
2062
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
2063
- name: errorCode,
2064
- $metadata: deserializeMetadata(output),
2065
- };
2066
- break;
1955
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
2067
1956
  case "NotFoundException":
2068
1957
  case "com.amazonaws.appsync#NotFoundException":
2069
- response = {
2070
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2071
- name: errorCode,
2072
- $metadata: deserializeMetadata(output),
2073
- };
2074
- break;
1958
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2075
1959
  case "UnauthorizedException":
2076
1960
  case "com.amazonaws.appsync#UnauthorizedException":
2077
- response = {
2078
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2079
- name: errorCode,
2080
- $metadata: deserializeMetadata(output),
2081
- };
2082
- break;
1961
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2083
1962
  default:
2084
1963
  const parsedBody = parsedOutput.body;
2085
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2086
- response = {
2087
- ...parsedBody,
2088
- name: `${errorCode}`,
2089
- message: parsedBody.message || parsedBody.Message || errorCode,
1964
+ response = new AppSyncServiceException_1.AppSyncServiceException({
1965
+ name: parsedBody.code || parsedBody.Code || errorCode,
2090
1966
  $fault: "client",
2091
1967
  $metadata: deserializeMetadata(output),
2092
- };
1968
+ });
1969
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2093
1970
  }
2094
- const message = response.message || response.Message || errorCode;
2095
- response.message = message;
2096
- delete response.Message;
2097
- return Promise.reject(Object.assign(new Error(message), response));
2098
1971
  };
2099
1972
  const deserializeAws_restJson1CreateDomainNameCommand = async (output, context) => {
2100
1973
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2122,43 +1995,22 @@ const deserializeAws_restJson1CreateDomainNameCommandError = async (output, cont
2122
1995
  switch (errorCode) {
2123
1996
  case "AccessDeniedException":
2124
1997
  case "com.amazonaws.appsync#AccessDeniedException":
2125
- response = {
2126
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2127
- name: errorCode,
2128
- $metadata: deserializeMetadata(output),
2129
- };
2130
- break;
1998
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2131
1999
  case "BadRequestException":
2132
2000
  case "com.amazonaws.appsync#BadRequestException":
2133
- response = {
2134
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2135
- name: errorCode,
2136
- $metadata: deserializeMetadata(output),
2137
- };
2138
- break;
2001
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2139
2002
  case "InternalFailureException":
2140
2003
  case "com.amazonaws.appsync#InternalFailureException":
2141
- response = {
2142
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
2143
- name: errorCode,
2144
- $metadata: deserializeMetadata(output),
2145
- };
2146
- break;
2004
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
2147
2005
  default:
2148
2006
  const parsedBody = parsedOutput.body;
2149
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2150
- response = {
2151
- ...parsedBody,
2152
- name: `${errorCode}`,
2153
- message: parsedBody.message || parsedBody.Message || errorCode,
2007
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2008
+ name: parsedBody.code || parsedBody.Code || errorCode,
2154
2009
  $fault: "client",
2155
2010
  $metadata: deserializeMetadata(output),
2156
- };
2011
+ });
2012
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2157
2013
  }
2158
- const message = response.message || response.Message || errorCode;
2159
- response.message = message;
2160
- delete response.Message;
2161
- return Promise.reject(Object.assign(new Error(message), response));
2162
2014
  };
2163
2015
  const deserializeAws_restJson1CreateFunctionCommand = async (output, context) => {
2164
2016
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2186,51 +2038,25 @@ const deserializeAws_restJson1CreateFunctionCommandError = async (output, contex
2186
2038
  switch (errorCode) {
2187
2039
  case "ConcurrentModificationException":
2188
2040
  case "com.amazonaws.appsync#ConcurrentModificationException":
2189
- response = {
2190
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
2191
- name: errorCode,
2192
- $metadata: deserializeMetadata(output),
2193
- };
2194
- break;
2041
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
2195
2042
  case "InternalFailureException":
2196
2043
  case "com.amazonaws.appsync#InternalFailureException":
2197
- response = {
2198
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
2199
- name: errorCode,
2200
- $metadata: deserializeMetadata(output),
2201
- };
2202
- break;
2044
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
2203
2045
  case "NotFoundException":
2204
2046
  case "com.amazonaws.appsync#NotFoundException":
2205
- response = {
2206
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2207
- name: errorCode,
2208
- $metadata: deserializeMetadata(output),
2209
- };
2210
- break;
2047
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2211
2048
  case "UnauthorizedException":
2212
2049
  case "com.amazonaws.appsync#UnauthorizedException":
2213
- response = {
2214
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2215
- name: errorCode,
2216
- $metadata: deserializeMetadata(output),
2217
- };
2218
- break;
2050
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2219
2051
  default:
2220
2052
  const parsedBody = parsedOutput.body;
2221
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2222
- response = {
2223
- ...parsedBody,
2224
- name: `${errorCode}`,
2225
- message: parsedBody.message || parsedBody.Message || errorCode,
2053
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2054
+ name: parsedBody.code || parsedBody.Code || errorCode,
2226
2055
  $fault: "client",
2227
2056
  $metadata: deserializeMetadata(output),
2228
- };
2057
+ });
2058
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2229
2059
  }
2230
- const message = response.message || response.Message || errorCode;
2231
- response.message = message;
2232
- delete response.Message;
2233
- return Promise.reject(Object.assign(new Error(message), response));
2234
2060
  };
2235
2061
  const deserializeAws_restJson1CreateGraphqlApiCommand = async (output, context) => {
2236
2062
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2258,67 +2084,31 @@ const deserializeAws_restJson1CreateGraphqlApiCommandError = async (output, cont
2258
2084
  switch (errorCode) {
2259
2085
  case "ApiLimitExceededException":
2260
2086
  case "com.amazonaws.appsync#ApiLimitExceededException":
2261
- response = {
2262
- ...(await deserializeAws_restJson1ApiLimitExceededExceptionResponse(parsedOutput, context)),
2263
- name: errorCode,
2264
- $metadata: deserializeMetadata(output),
2265
- };
2266
- break;
2087
+ throw await deserializeAws_restJson1ApiLimitExceededExceptionResponse(parsedOutput, context);
2267
2088
  case "BadRequestException":
2268
2089
  case "com.amazonaws.appsync#BadRequestException":
2269
- response = {
2270
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2271
- name: errorCode,
2272
- $metadata: deserializeMetadata(output),
2273
- };
2274
- break;
2090
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2275
2091
  case "ConcurrentModificationException":
2276
2092
  case "com.amazonaws.appsync#ConcurrentModificationException":
2277
- response = {
2278
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
2279
- name: errorCode,
2280
- $metadata: deserializeMetadata(output),
2281
- };
2282
- break;
2093
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
2283
2094
  case "InternalFailureException":
2284
2095
  case "com.amazonaws.appsync#InternalFailureException":
2285
- response = {
2286
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
2287
- name: errorCode,
2288
- $metadata: deserializeMetadata(output),
2289
- };
2290
- break;
2096
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
2291
2097
  case "LimitExceededException":
2292
2098
  case "com.amazonaws.appsync#LimitExceededException":
2293
- response = {
2294
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
2295
- name: errorCode,
2296
- $metadata: deserializeMetadata(output),
2297
- };
2298
- break;
2099
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
2299
2100
  case "UnauthorizedException":
2300
2101
  case "com.amazonaws.appsync#UnauthorizedException":
2301
- response = {
2302
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2303
- name: errorCode,
2304
- $metadata: deserializeMetadata(output),
2305
- };
2306
- break;
2102
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2307
2103
  default:
2308
2104
  const parsedBody = parsedOutput.body;
2309
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2310
- response = {
2311
- ...parsedBody,
2312
- name: `${errorCode}`,
2313
- message: parsedBody.message || parsedBody.Message || errorCode,
2105
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2106
+ name: parsedBody.code || parsedBody.Code || errorCode,
2314
2107
  $fault: "client",
2315
2108
  $metadata: deserializeMetadata(output),
2316
- };
2109
+ });
2110
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2317
2111
  }
2318
- const message = response.message || response.Message || errorCode;
2319
- response.message = message;
2320
- delete response.Message;
2321
- return Promise.reject(Object.assign(new Error(message), response));
2322
2112
  };
2323
2113
  const deserializeAws_restJson1CreateResolverCommand = async (output, context) => {
2324
2114
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2346,51 +2136,25 @@ const deserializeAws_restJson1CreateResolverCommandError = async (output, contex
2346
2136
  switch (errorCode) {
2347
2137
  case "ConcurrentModificationException":
2348
2138
  case "com.amazonaws.appsync#ConcurrentModificationException":
2349
- response = {
2350
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
2351
- name: errorCode,
2352
- $metadata: deserializeMetadata(output),
2353
- };
2354
- break;
2139
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
2355
2140
  case "InternalFailureException":
2356
2141
  case "com.amazonaws.appsync#InternalFailureException":
2357
- response = {
2358
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
2359
- name: errorCode,
2360
- $metadata: deserializeMetadata(output),
2361
- };
2362
- break;
2142
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
2363
2143
  case "NotFoundException":
2364
2144
  case "com.amazonaws.appsync#NotFoundException":
2365
- response = {
2366
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2367
- name: errorCode,
2368
- $metadata: deserializeMetadata(output),
2369
- };
2370
- break;
2145
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2371
2146
  case "UnauthorizedException":
2372
2147
  case "com.amazonaws.appsync#UnauthorizedException":
2373
- response = {
2374
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2375
- name: errorCode,
2376
- $metadata: deserializeMetadata(output),
2377
- };
2378
- break;
2148
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2379
2149
  default:
2380
2150
  const parsedBody = parsedOutput.body;
2381
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2382
- response = {
2383
- ...parsedBody,
2384
- name: `${errorCode}`,
2385
- message: parsedBody.message || parsedBody.Message || errorCode,
2151
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2152
+ name: parsedBody.code || parsedBody.Code || errorCode,
2386
2153
  $fault: "client",
2387
2154
  $metadata: deserializeMetadata(output),
2388
- };
2155
+ });
2156
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2389
2157
  }
2390
- const message = response.message || response.Message || errorCode;
2391
- response.message = message;
2392
- delete response.Message;
2393
- return Promise.reject(Object.assign(new Error(message), response));
2394
2158
  };
2395
2159
  const deserializeAws_restJson1CreateTypeCommand = async (output, context) => {
2396
2160
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2418,59 +2182,28 @@ const deserializeAws_restJson1CreateTypeCommandError = async (output, context) =
2418
2182
  switch (errorCode) {
2419
2183
  case "BadRequestException":
2420
2184
  case "com.amazonaws.appsync#BadRequestException":
2421
- response = {
2422
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2423
- name: errorCode,
2424
- $metadata: deserializeMetadata(output),
2425
- };
2426
- break;
2185
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2427
2186
  case "ConcurrentModificationException":
2428
2187
  case "com.amazonaws.appsync#ConcurrentModificationException":
2429
- response = {
2430
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
2431
- name: errorCode,
2432
- $metadata: deserializeMetadata(output),
2433
- };
2434
- break;
2188
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
2435
2189
  case "InternalFailureException":
2436
2190
  case "com.amazonaws.appsync#InternalFailureException":
2437
- response = {
2438
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
2439
- name: errorCode,
2440
- $metadata: deserializeMetadata(output),
2441
- };
2442
- break;
2191
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
2443
2192
  case "NotFoundException":
2444
2193
  case "com.amazonaws.appsync#NotFoundException":
2445
- response = {
2446
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2447
- name: errorCode,
2448
- $metadata: deserializeMetadata(output),
2449
- };
2450
- break;
2194
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2451
2195
  case "UnauthorizedException":
2452
2196
  case "com.amazonaws.appsync#UnauthorizedException":
2453
- response = {
2454
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2455
- name: errorCode,
2456
- $metadata: deserializeMetadata(output),
2457
- };
2458
- break;
2197
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2459
2198
  default:
2460
2199
  const parsedBody = parsedOutput.body;
2461
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2462
- response = {
2463
- ...parsedBody,
2464
- name: `${errorCode}`,
2465
- message: parsedBody.message || parsedBody.Message || errorCode,
2200
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2201
+ name: parsedBody.code || parsedBody.Code || errorCode,
2466
2202
  $fault: "client",
2467
2203
  $metadata: deserializeMetadata(output),
2468
- };
2204
+ });
2205
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2469
2206
  }
2470
- const message = response.message || response.Message || errorCode;
2471
- response.message = message;
2472
- delete response.Message;
2473
- return Promise.reject(Object.assign(new Error(message), response));
2474
2207
  };
2475
2208
  const deserializeAws_restJson1DeleteApiCacheCommand = async (output, context) => {
2476
2209
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2494,59 +2227,28 @@ const deserializeAws_restJson1DeleteApiCacheCommandError = async (output, contex
2494
2227
  switch (errorCode) {
2495
2228
  case "BadRequestException":
2496
2229
  case "com.amazonaws.appsync#BadRequestException":
2497
- response = {
2498
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2499
- name: errorCode,
2500
- $metadata: deserializeMetadata(output),
2501
- };
2502
- break;
2230
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2503
2231
  case "ConcurrentModificationException":
2504
2232
  case "com.amazonaws.appsync#ConcurrentModificationException":
2505
- response = {
2506
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
2507
- name: errorCode,
2508
- $metadata: deserializeMetadata(output),
2509
- };
2510
- break;
2233
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
2511
2234
  case "InternalFailureException":
2512
2235
  case "com.amazonaws.appsync#InternalFailureException":
2513
- response = {
2514
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
2515
- name: errorCode,
2516
- $metadata: deserializeMetadata(output),
2517
- };
2518
- break;
2236
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
2519
2237
  case "NotFoundException":
2520
2238
  case "com.amazonaws.appsync#NotFoundException":
2521
- response = {
2522
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2523
- name: errorCode,
2524
- $metadata: deserializeMetadata(output),
2525
- };
2526
- break;
2239
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2527
2240
  case "UnauthorizedException":
2528
2241
  case "com.amazonaws.appsync#UnauthorizedException":
2529
- response = {
2530
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2531
- name: errorCode,
2532
- $metadata: deserializeMetadata(output),
2533
- };
2534
- break;
2242
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2535
2243
  default:
2536
2244
  const parsedBody = parsedOutput.body;
2537
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2538
- response = {
2539
- ...parsedBody,
2540
- name: `${errorCode}`,
2541
- message: parsedBody.message || parsedBody.Message || errorCode,
2245
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2246
+ name: parsedBody.code || parsedBody.Code || errorCode,
2542
2247
  $fault: "client",
2543
2248
  $metadata: deserializeMetadata(output),
2544
- };
2249
+ });
2250
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2545
2251
  }
2546
- const message = response.message || response.Message || errorCode;
2547
- response.message = message;
2548
- delete response.Message;
2549
- return Promise.reject(Object.assign(new Error(message), response));
2550
2252
  };
2551
2253
  const deserializeAws_restJson1DeleteApiKeyCommand = async (output, context) => {
2552
2254
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2570,51 +2272,25 @@ const deserializeAws_restJson1DeleteApiKeyCommandError = async (output, context)
2570
2272
  switch (errorCode) {
2571
2273
  case "BadRequestException":
2572
2274
  case "com.amazonaws.appsync#BadRequestException":
2573
- response = {
2574
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2575
- name: errorCode,
2576
- $metadata: deserializeMetadata(output),
2577
- };
2578
- break;
2275
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2579
2276
  case "InternalFailureException":
2580
2277
  case "com.amazonaws.appsync#InternalFailureException":
2581
- response = {
2582
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
2583
- name: errorCode,
2584
- $metadata: deserializeMetadata(output),
2585
- };
2586
- break;
2278
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
2587
2279
  case "NotFoundException":
2588
2280
  case "com.amazonaws.appsync#NotFoundException":
2589
- response = {
2590
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2591
- name: errorCode,
2592
- $metadata: deserializeMetadata(output),
2593
- };
2594
- break;
2281
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2595
2282
  case "UnauthorizedException":
2596
2283
  case "com.amazonaws.appsync#UnauthorizedException":
2597
- response = {
2598
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2599
- name: errorCode,
2600
- $metadata: deserializeMetadata(output),
2601
- };
2602
- break;
2284
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2603
2285
  default:
2604
2286
  const parsedBody = parsedOutput.body;
2605
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2606
- response = {
2607
- ...parsedBody,
2608
- name: `${errorCode}`,
2609
- message: parsedBody.message || parsedBody.Message || errorCode,
2287
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2288
+ name: parsedBody.code || parsedBody.Code || errorCode,
2610
2289
  $fault: "client",
2611
2290
  $metadata: deserializeMetadata(output),
2612
- };
2291
+ });
2292
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2613
2293
  }
2614
- const message = response.message || response.Message || errorCode;
2615
- response.message = message;
2616
- delete response.Message;
2617
- return Promise.reject(Object.assign(new Error(message), response));
2618
2294
  };
2619
2295
  const deserializeAws_restJson1DeleteDataSourceCommand = async (output, context) => {
2620
2296
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2638,59 +2314,28 @@ const deserializeAws_restJson1DeleteDataSourceCommandError = async (output, cont
2638
2314
  switch (errorCode) {
2639
2315
  case "BadRequestException":
2640
2316
  case "com.amazonaws.appsync#BadRequestException":
2641
- response = {
2642
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2643
- name: errorCode,
2644
- $metadata: deserializeMetadata(output),
2645
- };
2646
- break;
2317
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2647
2318
  case "ConcurrentModificationException":
2648
2319
  case "com.amazonaws.appsync#ConcurrentModificationException":
2649
- response = {
2650
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
2651
- name: errorCode,
2652
- $metadata: deserializeMetadata(output),
2653
- };
2654
- break;
2320
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
2655
2321
  case "InternalFailureException":
2656
2322
  case "com.amazonaws.appsync#InternalFailureException":
2657
- response = {
2658
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
2659
- name: errorCode,
2660
- $metadata: deserializeMetadata(output),
2661
- };
2662
- break;
2323
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
2663
2324
  case "NotFoundException":
2664
2325
  case "com.amazonaws.appsync#NotFoundException":
2665
- response = {
2666
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2667
- name: errorCode,
2668
- $metadata: deserializeMetadata(output),
2669
- };
2670
- break;
2326
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2671
2327
  case "UnauthorizedException":
2672
2328
  case "com.amazonaws.appsync#UnauthorizedException":
2673
- response = {
2674
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2675
- name: errorCode,
2676
- $metadata: deserializeMetadata(output),
2677
- };
2678
- break;
2329
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2679
2330
  default:
2680
2331
  const parsedBody = parsedOutput.body;
2681
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2682
- response = {
2683
- ...parsedBody,
2684
- name: `${errorCode}`,
2685
- message: parsedBody.message || parsedBody.Message || errorCode,
2332
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2333
+ name: parsedBody.code || parsedBody.Code || errorCode,
2686
2334
  $fault: "client",
2687
2335
  $metadata: deserializeMetadata(output),
2688
- };
2336
+ });
2337
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2689
2338
  }
2690
- const message = response.message || response.Message || errorCode;
2691
- response.message = message;
2692
- delete response.Message;
2693
- return Promise.reject(Object.assign(new Error(message), response));
2694
2339
  };
2695
2340
  const deserializeAws_restJson1DeleteDomainNameCommand = async (output, context) => {
2696
2341
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2714,59 +2359,28 @@ const deserializeAws_restJson1DeleteDomainNameCommandError = async (output, cont
2714
2359
  switch (errorCode) {
2715
2360
  case "AccessDeniedException":
2716
2361
  case "com.amazonaws.appsync#AccessDeniedException":
2717
- response = {
2718
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2719
- name: errorCode,
2720
- $metadata: deserializeMetadata(output),
2721
- };
2722
- break;
2362
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2723
2363
  case "BadRequestException":
2724
2364
  case "com.amazonaws.appsync#BadRequestException":
2725
- response = {
2726
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2727
- name: errorCode,
2728
- $metadata: deserializeMetadata(output),
2729
- };
2730
- break;
2365
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2731
2366
  case "ConcurrentModificationException":
2732
2367
  case "com.amazonaws.appsync#ConcurrentModificationException":
2733
- response = {
2734
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
2735
- name: errorCode,
2736
- $metadata: deserializeMetadata(output),
2737
- };
2738
- break;
2368
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
2739
2369
  case "InternalFailureException":
2740
2370
  case "com.amazonaws.appsync#InternalFailureException":
2741
- response = {
2742
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
2743
- name: errorCode,
2744
- $metadata: deserializeMetadata(output),
2745
- };
2746
- break;
2371
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
2747
2372
  case "NotFoundException":
2748
2373
  case "com.amazonaws.appsync#NotFoundException":
2749
- response = {
2750
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2751
- name: errorCode,
2752
- $metadata: deserializeMetadata(output),
2753
- };
2754
- break;
2374
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2755
2375
  default:
2756
2376
  const parsedBody = parsedOutput.body;
2757
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2758
- response = {
2759
- ...parsedBody,
2760
- name: `${errorCode}`,
2761
- message: parsedBody.message || parsedBody.Message || errorCode,
2377
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2378
+ name: parsedBody.code || parsedBody.Code || errorCode,
2762
2379
  $fault: "client",
2763
2380
  $metadata: deserializeMetadata(output),
2764
- };
2381
+ });
2382
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2765
2383
  }
2766
- const message = response.message || response.Message || errorCode;
2767
- response.message = message;
2768
- delete response.Message;
2769
- return Promise.reject(Object.assign(new Error(message), response));
2770
2384
  };
2771
2385
  const deserializeAws_restJson1DeleteFunctionCommand = async (output, context) => {
2772
2386
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2790,51 +2404,25 @@ const deserializeAws_restJson1DeleteFunctionCommandError = async (output, contex
2790
2404
  switch (errorCode) {
2791
2405
  case "ConcurrentModificationException":
2792
2406
  case "com.amazonaws.appsync#ConcurrentModificationException":
2793
- response = {
2794
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
2795
- name: errorCode,
2796
- $metadata: deserializeMetadata(output),
2797
- };
2798
- break;
2407
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
2799
2408
  case "InternalFailureException":
2800
2409
  case "com.amazonaws.appsync#InternalFailureException":
2801
- response = {
2802
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
2803
- name: errorCode,
2804
- $metadata: deserializeMetadata(output),
2805
- };
2806
- break;
2410
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
2807
2411
  case "NotFoundException":
2808
2412
  case "com.amazonaws.appsync#NotFoundException":
2809
- response = {
2810
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2811
- name: errorCode,
2812
- $metadata: deserializeMetadata(output),
2813
- };
2814
- break;
2413
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2815
2414
  case "UnauthorizedException":
2816
2415
  case "com.amazonaws.appsync#UnauthorizedException":
2817
- response = {
2818
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2819
- name: errorCode,
2820
- $metadata: deserializeMetadata(output),
2821
- };
2822
- break;
2416
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2823
2417
  default:
2824
2418
  const parsedBody = parsedOutput.body;
2825
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2826
- response = {
2827
- ...parsedBody,
2828
- name: `${errorCode}`,
2829
- message: parsedBody.message || parsedBody.Message || errorCode,
2419
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2420
+ name: parsedBody.code || parsedBody.Code || errorCode,
2830
2421
  $fault: "client",
2831
2422
  $metadata: deserializeMetadata(output),
2832
- };
2423
+ });
2424
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2833
2425
  }
2834
- const message = response.message || response.Message || errorCode;
2835
- response.message = message;
2836
- delete response.Message;
2837
- return Promise.reject(Object.assign(new Error(message), response));
2838
2426
  };
2839
2427
  const deserializeAws_restJson1DeleteGraphqlApiCommand = async (output, context) => {
2840
2428
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2858,67 +2446,31 @@ const deserializeAws_restJson1DeleteGraphqlApiCommandError = async (output, cont
2858
2446
  switch (errorCode) {
2859
2447
  case "AccessDeniedException":
2860
2448
  case "com.amazonaws.appsync#AccessDeniedException":
2861
- response = {
2862
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
2863
- name: errorCode,
2864
- $metadata: deserializeMetadata(output),
2865
- };
2866
- break;
2449
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
2867
2450
  case "BadRequestException":
2868
2451
  case "com.amazonaws.appsync#BadRequestException":
2869
- response = {
2870
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
2871
- name: errorCode,
2872
- $metadata: deserializeMetadata(output),
2873
- };
2874
- break;
2452
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
2875
2453
  case "ConcurrentModificationException":
2876
2454
  case "com.amazonaws.appsync#ConcurrentModificationException":
2877
- response = {
2878
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
2879
- name: errorCode,
2880
- $metadata: deserializeMetadata(output),
2881
- };
2882
- break;
2455
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
2883
2456
  case "InternalFailureException":
2884
2457
  case "com.amazonaws.appsync#InternalFailureException":
2885
- response = {
2886
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
2887
- name: errorCode,
2888
- $metadata: deserializeMetadata(output),
2889
- };
2890
- break;
2458
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
2891
2459
  case "NotFoundException":
2892
2460
  case "com.amazonaws.appsync#NotFoundException":
2893
- response = {
2894
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2895
- name: errorCode,
2896
- $metadata: deserializeMetadata(output),
2897
- };
2898
- break;
2461
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2899
2462
  case "UnauthorizedException":
2900
2463
  case "com.amazonaws.appsync#UnauthorizedException":
2901
- response = {
2902
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2903
- name: errorCode,
2904
- $metadata: deserializeMetadata(output),
2905
- };
2906
- break;
2464
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2907
2465
  default:
2908
2466
  const parsedBody = parsedOutput.body;
2909
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2910
- response = {
2911
- ...parsedBody,
2912
- name: `${errorCode}`,
2913
- message: parsedBody.message || parsedBody.Message || errorCode,
2467
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2468
+ name: parsedBody.code || parsedBody.Code || errorCode,
2914
2469
  $fault: "client",
2915
2470
  $metadata: deserializeMetadata(output),
2916
- };
2471
+ });
2472
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2917
2473
  }
2918
- const message = response.message || response.Message || errorCode;
2919
- response.message = message;
2920
- delete response.Message;
2921
- return Promise.reject(Object.assign(new Error(message), response));
2922
2474
  };
2923
2475
  const deserializeAws_restJson1DeleteResolverCommand = async (output, context) => {
2924
2476
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -2942,51 +2494,25 @@ const deserializeAws_restJson1DeleteResolverCommandError = async (output, contex
2942
2494
  switch (errorCode) {
2943
2495
  case "ConcurrentModificationException":
2944
2496
  case "com.amazonaws.appsync#ConcurrentModificationException":
2945
- response = {
2946
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
2947
- name: errorCode,
2948
- $metadata: deserializeMetadata(output),
2949
- };
2950
- break;
2497
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
2951
2498
  case "InternalFailureException":
2952
2499
  case "com.amazonaws.appsync#InternalFailureException":
2953
- response = {
2954
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
2955
- name: errorCode,
2956
- $metadata: deserializeMetadata(output),
2957
- };
2958
- break;
2500
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
2959
2501
  case "NotFoundException":
2960
2502
  case "com.amazonaws.appsync#NotFoundException":
2961
- response = {
2962
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
2963
- name: errorCode,
2964
- $metadata: deserializeMetadata(output),
2965
- };
2966
- break;
2503
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
2967
2504
  case "UnauthorizedException":
2968
2505
  case "com.amazonaws.appsync#UnauthorizedException":
2969
- response = {
2970
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
2971
- name: errorCode,
2972
- $metadata: deserializeMetadata(output),
2973
- };
2974
- break;
2506
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
2975
2507
  default:
2976
2508
  const parsedBody = parsedOutput.body;
2977
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2978
- response = {
2979
- ...parsedBody,
2980
- name: `${errorCode}`,
2981
- message: parsedBody.message || parsedBody.Message || errorCode,
2509
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2510
+ name: parsedBody.code || parsedBody.Code || errorCode,
2982
2511
  $fault: "client",
2983
2512
  $metadata: deserializeMetadata(output),
2984
- };
2513
+ });
2514
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
2985
2515
  }
2986
- const message = response.message || response.Message || errorCode;
2987
- response.message = message;
2988
- delete response.Message;
2989
- return Promise.reject(Object.assign(new Error(message), response));
2990
2516
  };
2991
2517
  const deserializeAws_restJson1DeleteTypeCommand = async (output, context) => {
2992
2518
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3010,59 +2536,28 @@ const deserializeAws_restJson1DeleteTypeCommandError = async (output, context) =
3010
2536
  switch (errorCode) {
3011
2537
  case "BadRequestException":
3012
2538
  case "com.amazonaws.appsync#BadRequestException":
3013
- response = {
3014
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3015
- name: errorCode,
3016
- $metadata: deserializeMetadata(output),
3017
- };
3018
- break;
2539
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3019
2540
  case "ConcurrentModificationException":
3020
2541
  case "com.amazonaws.appsync#ConcurrentModificationException":
3021
- response = {
3022
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
3023
- name: errorCode,
3024
- $metadata: deserializeMetadata(output),
3025
- };
3026
- break;
2542
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
3027
2543
  case "InternalFailureException":
3028
2544
  case "com.amazonaws.appsync#InternalFailureException":
3029
- response = {
3030
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
3031
- name: errorCode,
3032
- $metadata: deserializeMetadata(output),
3033
- };
3034
- break;
2545
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
3035
2546
  case "NotFoundException":
3036
2547
  case "com.amazonaws.appsync#NotFoundException":
3037
- response = {
3038
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3039
- name: errorCode,
3040
- $metadata: deserializeMetadata(output),
3041
- };
3042
- break;
2548
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3043
2549
  case "UnauthorizedException":
3044
2550
  case "com.amazonaws.appsync#UnauthorizedException":
3045
- response = {
3046
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
3047
- name: errorCode,
3048
- $metadata: deserializeMetadata(output),
3049
- };
3050
- break;
2551
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3051
2552
  default:
3052
2553
  const parsedBody = parsedOutput.body;
3053
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3054
- response = {
3055
- ...parsedBody,
3056
- name: `${errorCode}`,
3057
- message: parsedBody.message || parsedBody.Message || errorCode,
2554
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2555
+ name: parsedBody.code || parsedBody.Code || errorCode,
3058
2556
  $fault: "client",
3059
2557
  $metadata: deserializeMetadata(output),
3060
- };
2558
+ });
2559
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3061
2560
  }
3062
- const message = response.message || response.Message || errorCode;
3063
- response.message = message;
3064
- delete response.Message;
3065
- return Promise.reject(Object.assign(new Error(message), response));
3066
2561
  };
3067
2562
  const deserializeAws_restJson1DisassociateApiCommand = async (output, context) => {
3068
2563
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3086,59 +2581,28 @@ const deserializeAws_restJson1DisassociateApiCommandError = async (output, conte
3086
2581
  switch (errorCode) {
3087
2582
  case "AccessDeniedException":
3088
2583
  case "com.amazonaws.appsync#AccessDeniedException":
3089
- response = {
3090
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3091
- name: errorCode,
3092
- $metadata: deserializeMetadata(output),
3093
- };
3094
- break;
2584
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3095
2585
  case "BadRequestException":
3096
2586
  case "com.amazonaws.appsync#BadRequestException":
3097
- response = {
3098
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3099
- name: errorCode,
3100
- $metadata: deserializeMetadata(output),
3101
- };
3102
- break;
2587
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3103
2588
  case "ConcurrentModificationException":
3104
2589
  case "com.amazonaws.appsync#ConcurrentModificationException":
3105
- response = {
3106
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
3107
- name: errorCode,
3108
- $metadata: deserializeMetadata(output),
3109
- };
3110
- break;
2590
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
3111
2591
  case "InternalFailureException":
3112
2592
  case "com.amazonaws.appsync#InternalFailureException":
3113
- response = {
3114
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
3115
- name: errorCode,
3116
- $metadata: deserializeMetadata(output),
3117
- };
3118
- break;
2593
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
3119
2594
  case "NotFoundException":
3120
2595
  case "com.amazonaws.appsync#NotFoundException":
3121
- response = {
3122
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3123
- name: errorCode,
3124
- $metadata: deserializeMetadata(output),
3125
- };
3126
- break;
2596
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3127
2597
  default:
3128
2598
  const parsedBody = parsedOutput.body;
3129
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3130
- response = {
3131
- ...parsedBody,
3132
- name: `${errorCode}`,
3133
- message: parsedBody.message || parsedBody.Message || errorCode,
2599
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2600
+ name: parsedBody.code || parsedBody.Code || errorCode,
3134
2601
  $fault: "client",
3135
2602
  $metadata: deserializeMetadata(output),
3136
- };
2603
+ });
2604
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3137
2605
  }
3138
- const message = response.message || response.Message || errorCode;
3139
- response.message = message;
3140
- delete response.Message;
3141
- return Promise.reject(Object.assign(new Error(message), response));
3142
2606
  };
3143
2607
  const deserializeAws_restJson1FlushApiCacheCommand = async (output, context) => {
3144
2608
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3162,59 +2626,28 @@ const deserializeAws_restJson1FlushApiCacheCommandError = async (output, context
3162
2626
  switch (errorCode) {
3163
2627
  case "BadRequestException":
3164
2628
  case "com.amazonaws.appsync#BadRequestException":
3165
- response = {
3166
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3167
- name: errorCode,
3168
- $metadata: deserializeMetadata(output),
3169
- };
3170
- break;
2629
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3171
2630
  case "ConcurrentModificationException":
3172
2631
  case "com.amazonaws.appsync#ConcurrentModificationException":
3173
- response = {
3174
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
3175
- name: errorCode,
3176
- $metadata: deserializeMetadata(output),
3177
- };
3178
- break;
2632
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
3179
2633
  case "InternalFailureException":
3180
2634
  case "com.amazonaws.appsync#InternalFailureException":
3181
- response = {
3182
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
3183
- name: errorCode,
3184
- $metadata: deserializeMetadata(output),
3185
- };
3186
- break;
2635
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
3187
2636
  case "NotFoundException":
3188
2637
  case "com.amazonaws.appsync#NotFoundException":
3189
- response = {
3190
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3191
- name: errorCode,
3192
- $metadata: deserializeMetadata(output),
3193
- };
3194
- break;
2638
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3195
2639
  case "UnauthorizedException":
3196
2640
  case "com.amazonaws.appsync#UnauthorizedException":
3197
- response = {
3198
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
3199
- name: errorCode,
3200
- $metadata: deserializeMetadata(output),
3201
- };
3202
- break;
2641
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3203
2642
  default:
3204
2643
  const parsedBody = parsedOutput.body;
3205
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3206
- response = {
3207
- ...parsedBody,
3208
- name: `${errorCode}`,
3209
- message: parsedBody.message || parsedBody.Message || errorCode,
2644
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2645
+ name: parsedBody.code || parsedBody.Code || errorCode,
3210
2646
  $fault: "client",
3211
2647
  $metadata: deserializeMetadata(output),
3212
- };
2648
+ });
2649
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3213
2650
  }
3214
- const message = response.message || response.Message || errorCode;
3215
- response.message = message;
3216
- delete response.Message;
3217
- return Promise.reject(Object.assign(new Error(message), response));
3218
2651
  };
3219
2652
  const deserializeAws_restJson1GetApiAssociationCommand = async (output, context) => {
3220
2653
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3242,51 +2675,25 @@ const deserializeAws_restJson1GetApiAssociationCommandError = async (output, con
3242
2675
  switch (errorCode) {
3243
2676
  case "AccessDeniedException":
3244
2677
  case "com.amazonaws.appsync#AccessDeniedException":
3245
- response = {
3246
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3247
- name: errorCode,
3248
- $metadata: deserializeMetadata(output),
3249
- };
3250
- break;
2678
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3251
2679
  case "BadRequestException":
3252
2680
  case "com.amazonaws.appsync#BadRequestException":
3253
- response = {
3254
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3255
- name: errorCode,
3256
- $metadata: deserializeMetadata(output),
3257
- };
3258
- break;
2681
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3259
2682
  case "InternalFailureException":
3260
2683
  case "com.amazonaws.appsync#InternalFailureException":
3261
- response = {
3262
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
3263
- name: errorCode,
3264
- $metadata: deserializeMetadata(output),
3265
- };
3266
- break;
2684
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
3267
2685
  case "NotFoundException":
3268
2686
  case "com.amazonaws.appsync#NotFoundException":
3269
- response = {
3270
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3271
- name: errorCode,
3272
- $metadata: deserializeMetadata(output),
3273
- };
3274
- break;
2687
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3275
2688
  default:
3276
2689
  const parsedBody = parsedOutput.body;
3277
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3278
- response = {
3279
- ...parsedBody,
3280
- name: `${errorCode}`,
3281
- message: parsedBody.message || parsedBody.Message || errorCode,
2690
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2691
+ name: parsedBody.code || parsedBody.Code || errorCode,
3282
2692
  $fault: "client",
3283
2693
  $metadata: deserializeMetadata(output),
3284
- };
2694
+ });
2695
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3285
2696
  }
3286
- const message = response.message || response.Message || errorCode;
3287
- response.message = message;
3288
- delete response.Message;
3289
- return Promise.reject(Object.assign(new Error(message), response));
3290
2697
  };
3291
2698
  const deserializeAws_restJson1GetApiCacheCommand = async (output, context) => {
3292
2699
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3314,59 +2721,28 @@ const deserializeAws_restJson1GetApiCacheCommandError = async (output, context)
3314
2721
  switch (errorCode) {
3315
2722
  case "BadRequestException":
3316
2723
  case "com.amazonaws.appsync#BadRequestException":
3317
- response = {
3318
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3319
- name: errorCode,
3320
- $metadata: deserializeMetadata(output),
3321
- };
3322
- break;
2724
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3323
2725
  case "ConcurrentModificationException":
3324
2726
  case "com.amazonaws.appsync#ConcurrentModificationException":
3325
- response = {
3326
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
3327
- name: errorCode,
3328
- $metadata: deserializeMetadata(output),
3329
- };
3330
- break;
2727
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
3331
2728
  case "InternalFailureException":
3332
2729
  case "com.amazonaws.appsync#InternalFailureException":
3333
- response = {
3334
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
3335
- name: errorCode,
3336
- $metadata: deserializeMetadata(output),
3337
- };
3338
- break;
2730
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
3339
2731
  case "NotFoundException":
3340
2732
  case "com.amazonaws.appsync#NotFoundException":
3341
- response = {
3342
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3343
- name: errorCode,
3344
- $metadata: deserializeMetadata(output),
3345
- };
3346
- break;
2733
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3347
2734
  case "UnauthorizedException":
3348
2735
  case "com.amazonaws.appsync#UnauthorizedException":
3349
- response = {
3350
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
3351
- name: errorCode,
3352
- $metadata: deserializeMetadata(output),
3353
- };
3354
- break;
2736
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3355
2737
  default:
3356
2738
  const parsedBody = parsedOutput.body;
3357
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3358
- response = {
3359
- ...parsedBody,
3360
- name: `${errorCode}`,
3361
- message: parsedBody.message || parsedBody.Message || errorCode,
2739
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2740
+ name: parsedBody.code || parsedBody.Code || errorCode,
3362
2741
  $fault: "client",
3363
2742
  $metadata: deserializeMetadata(output),
3364
- };
2743
+ });
2744
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3365
2745
  }
3366
- const message = response.message || response.Message || errorCode;
3367
- response.message = message;
3368
- delete response.Message;
3369
- return Promise.reject(Object.assign(new Error(message), response));
3370
2746
  };
3371
2747
  const deserializeAws_restJson1GetDataSourceCommand = async (output, context) => {
3372
2748
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3394,59 +2770,28 @@ const deserializeAws_restJson1GetDataSourceCommandError = async (output, context
3394
2770
  switch (errorCode) {
3395
2771
  case "BadRequestException":
3396
2772
  case "com.amazonaws.appsync#BadRequestException":
3397
- response = {
3398
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3399
- name: errorCode,
3400
- $metadata: deserializeMetadata(output),
3401
- };
3402
- break;
2773
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3403
2774
  case "ConcurrentModificationException":
3404
2775
  case "com.amazonaws.appsync#ConcurrentModificationException":
3405
- response = {
3406
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
3407
- name: errorCode,
3408
- $metadata: deserializeMetadata(output),
3409
- };
3410
- break;
2776
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
3411
2777
  case "InternalFailureException":
3412
2778
  case "com.amazonaws.appsync#InternalFailureException":
3413
- response = {
3414
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
3415
- name: errorCode,
3416
- $metadata: deserializeMetadata(output),
3417
- };
3418
- break;
2779
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
3419
2780
  case "NotFoundException":
3420
2781
  case "com.amazonaws.appsync#NotFoundException":
3421
- response = {
3422
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3423
- name: errorCode,
3424
- $metadata: deserializeMetadata(output),
3425
- };
3426
- break;
2782
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3427
2783
  case "UnauthorizedException":
3428
2784
  case "com.amazonaws.appsync#UnauthorizedException":
3429
- response = {
3430
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
3431
- name: errorCode,
3432
- $metadata: deserializeMetadata(output),
3433
- };
3434
- break;
2785
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3435
2786
  default:
3436
2787
  const parsedBody = parsedOutput.body;
3437
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3438
- response = {
3439
- ...parsedBody,
3440
- name: `${errorCode}`,
3441
- message: parsedBody.message || parsedBody.Message || errorCode,
2788
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2789
+ name: parsedBody.code || parsedBody.Code || errorCode,
3442
2790
  $fault: "client",
3443
2791
  $metadata: deserializeMetadata(output),
3444
- };
2792
+ });
2793
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3445
2794
  }
3446
- const message = response.message || response.Message || errorCode;
3447
- response.message = message;
3448
- delete response.Message;
3449
- return Promise.reject(Object.assign(new Error(message), response));
3450
2795
  };
3451
2796
  const deserializeAws_restJson1GetDomainNameCommand = async (output, context) => {
3452
2797
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3474,51 +2819,25 @@ const deserializeAws_restJson1GetDomainNameCommandError = async (output, context
3474
2819
  switch (errorCode) {
3475
2820
  case "AccessDeniedException":
3476
2821
  case "com.amazonaws.appsync#AccessDeniedException":
3477
- response = {
3478
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3479
- name: errorCode,
3480
- $metadata: deserializeMetadata(output),
3481
- };
3482
- break;
2822
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3483
2823
  case "BadRequestException":
3484
2824
  case "com.amazonaws.appsync#BadRequestException":
3485
- response = {
3486
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3487
- name: errorCode,
3488
- $metadata: deserializeMetadata(output),
3489
- };
3490
- break;
2825
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3491
2826
  case "InternalFailureException":
3492
2827
  case "com.amazonaws.appsync#InternalFailureException":
3493
- response = {
3494
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
3495
- name: errorCode,
3496
- $metadata: deserializeMetadata(output),
3497
- };
3498
- break;
2828
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
3499
2829
  case "NotFoundException":
3500
2830
  case "com.amazonaws.appsync#NotFoundException":
3501
- response = {
3502
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3503
- name: errorCode,
3504
- $metadata: deserializeMetadata(output),
3505
- };
3506
- break;
2831
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3507
2832
  default:
3508
2833
  const parsedBody = parsedOutput.body;
3509
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3510
- response = {
3511
- ...parsedBody,
3512
- name: `${errorCode}`,
3513
- message: parsedBody.message || parsedBody.Message || errorCode,
2834
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2835
+ name: parsedBody.code || parsedBody.Code || errorCode,
3514
2836
  $fault: "client",
3515
2837
  $metadata: deserializeMetadata(output),
3516
- };
2838
+ });
2839
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3517
2840
  }
3518
- const message = response.message || response.Message || errorCode;
3519
- response.message = message;
3520
- delete response.Message;
3521
- return Promise.reject(Object.assign(new Error(message), response));
3522
2841
  };
3523
2842
  const deserializeAws_restJson1GetFunctionCommand = async (output, context) => {
3524
2843
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3546,43 +2865,22 @@ const deserializeAws_restJson1GetFunctionCommandError = async (output, context)
3546
2865
  switch (errorCode) {
3547
2866
  case "ConcurrentModificationException":
3548
2867
  case "com.amazonaws.appsync#ConcurrentModificationException":
3549
- response = {
3550
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
3551
- name: errorCode,
3552
- $metadata: deserializeMetadata(output),
3553
- };
3554
- break;
2868
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
3555
2869
  case "NotFoundException":
3556
2870
  case "com.amazonaws.appsync#NotFoundException":
3557
- response = {
3558
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3559
- name: errorCode,
3560
- $metadata: deserializeMetadata(output),
3561
- };
3562
- break;
2871
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3563
2872
  case "UnauthorizedException":
3564
2873
  case "com.amazonaws.appsync#UnauthorizedException":
3565
- response = {
3566
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
3567
- name: errorCode,
3568
- $metadata: deserializeMetadata(output),
3569
- };
3570
- break;
2874
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3571
2875
  default:
3572
2876
  const parsedBody = parsedOutput.body;
3573
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3574
- response = {
3575
- ...parsedBody,
3576
- name: `${errorCode}`,
3577
- message: parsedBody.message || parsedBody.Message || errorCode,
2877
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2878
+ name: parsedBody.code || parsedBody.Code || errorCode,
3578
2879
  $fault: "client",
3579
2880
  $metadata: deserializeMetadata(output),
3580
- };
2881
+ });
2882
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3581
2883
  }
3582
- const message = response.message || response.Message || errorCode;
3583
- response.message = message;
3584
- delete response.Message;
3585
- return Promise.reject(Object.assign(new Error(message), response));
3586
2884
  };
3587
2885
  const deserializeAws_restJson1GetGraphqlApiCommand = async (output, context) => {
3588
2886
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3610,59 +2908,28 @@ const deserializeAws_restJson1GetGraphqlApiCommandError = async (output, context
3610
2908
  switch (errorCode) {
3611
2909
  case "AccessDeniedException":
3612
2910
  case "com.amazonaws.appsync#AccessDeniedException":
3613
- response = {
3614
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
3615
- name: errorCode,
3616
- $metadata: deserializeMetadata(output),
3617
- };
3618
- break;
2911
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
3619
2912
  case "BadRequestException":
3620
2913
  case "com.amazonaws.appsync#BadRequestException":
3621
- response = {
3622
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3623
- name: errorCode,
3624
- $metadata: deserializeMetadata(output),
3625
- };
3626
- break;
2914
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3627
2915
  case "InternalFailureException":
3628
2916
  case "com.amazonaws.appsync#InternalFailureException":
3629
- response = {
3630
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
3631
- name: errorCode,
3632
- $metadata: deserializeMetadata(output),
3633
- };
3634
- break;
2917
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
3635
2918
  case "NotFoundException":
3636
2919
  case "com.amazonaws.appsync#NotFoundException":
3637
- response = {
3638
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3639
- name: errorCode,
3640
- $metadata: deserializeMetadata(output),
3641
- };
3642
- break;
2920
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3643
2921
  case "UnauthorizedException":
3644
2922
  case "com.amazonaws.appsync#UnauthorizedException":
3645
- response = {
3646
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
3647
- name: errorCode,
3648
- $metadata: deserializeMetadata(output),
3649
- };
3650
- break;
2923
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3651
2924
  default:
3652
2925
  const parsedBody = parsedOutput.body;
3653
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3654
- response = {
3655
- ...parsedBody,
3656
- name: `${errorCode}`,
3657
- message: parsedBody.message || parsedBody.Message || errorCode,
2926
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2927
+ name: parsedBody.code || parsedBody.Code || errorCode,
3658
2928
  $fault: "client",
3659
2929
  $metadata: deserializeMetadata(output),
3660
- };
2930
+ });
2931
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3661
2932
  }
3662
- const message = response.message || response.Message || errorCode;
3663
- response.message = message;
3664
- delete response.Message;
3665
- return Promise.reject(Object.assign(new Error(message), response));
3666
2933
  };
3667
2934
  const deserializeAws_restJson1GetIntrospectionSchemaCommand = async (output, context) => {
3668
2935
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3688,51 +2955,25 @@ const deserializeAws_restJson1GetIntrospectionSchemaCommandError = async (output
3688
2955
  switch (errorCode) {
3689
2956
  case "GraphQLSchemaException":
3690
2957
  case "com.amazonaws.appsync#GraphQLSchemaException":
3691
- response = {
3692
- ...(await deserializeAws_restJson1GraphQLSchemaExceptionResponse(parsedOutput, context)),
3693
- name: errorCode,
3694
- $metadata: deserializeMetadata(output),
3695
- };
3696
- break;
2958
+ throw await deserializeAws_restJson1GraphQLSchemaExceptionResponse(parsedOutput, context);
3697
2959
  case "InternalFailureException":
3698
2960
  case "com.amazonaws.appsync#InternalFailureException":
3699
- response = {
3700
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
3701
- name: errorCode,
3702
- $metadata: deserializeMetadata(output),
3703
- };
3704
- break;
2961
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
3705
2962
  case "NotFoundException":
3706
2963
  case "com.amazonaws.appsync#NotFoundException":
3707
- response = {
3708
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3709
- name: errorCode,
3710
- $metadata: deserializeMetadata(output),
3711
- };
3712
- break;
2964
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3713
2965
  case "UnauthorizedException":
3714
2966
  case "com.amazonaws.appsync#UnauthorizedException":
3715
- response = {
3716
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
3717
- name: errorCode,
3718
- $metadata: deserializeMetadata(output),
3719
- };
3720
- break;
2967
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3721
2968
  default:
3722
2969
  const parsedBody = parsedOutput.body;
3723
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3724
- response = {
3725
- ...parsedBody,
3726
- name: `${errorCode}`,
3727
- message: parsedBody.message || parsedBody.Message || errorCode,
2970
+ response = new AppSyncServiceException_1.AppSyncServiceException({
2971
+ name: parsedBody.code || parsedBody.Code || errorCode,
3728
2972
  $fault: "client",
3729
2973
  $metadata: deserializeMetadata(output),
3730
- };
2974
+ });
2975
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3731
2976
  }
3732
- const message = response.message || response.Message || errorCode;
3733
- response.message = message;
3734
- delete response.Message;
3735
- return Promise.reject(Object.assign(new Error(message), response));
3736
2977
  };
3737
2978
  const deserializeAws_restJson1GetResolverCommand = async (output, context) => {
3738
2979
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3760,43 +3001,22 @@ const deserializeAws_restJson1GetResolverCommandError = async (output, context)
3760
3001
  switch (errorCode) {
3761
3002
  case "ConcurrentModificationException":
3762
3003
  case "com.amazonaws.appsync#ConcurrentModificationException":
3763
- response = {
3764
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
3765
- name: errorCode,
3766
- $metadata: deserializeMetadata(output),
3767
- };
3768
- break;
3004
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
3769
3005
  case "NotFoundException":
3770
3006
  case "com.amazonaws.appsync#NotFoundException":
3771
- response = {
3772
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3773
- name: errorCode,
3774
- $metadata: deserializeMetadata(output),
3775
- };
3776
- break;
3007
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3777
3008
  case "UnauthorizedException":
3778
3009
  case "com.amazonaws.appsync#UnauthorizedException":
3779
- response = {
3780
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
3781
- name: errorCode,
3782
- $metadata: deserializeMetadata(output),
3783
- };
3784
- break;
3010
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3785
3011
  default:
3786
3012
  const parsedBody = parsedOutput.body;
3787
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3788
- response = {
3789
- ...parsedBody,
3790
- name: `${errorCode}`,
3791
- message: parsedBody.message || parsedBody.Message || errorCode,
3013
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3014
+ name: parsedBody.code || parsedBody.Code || errorCode,
3792
3015
  $fault: "client",
3793
3016
  $metadata: deserializeMetadata(output),
3794
- };
3017
+ });
3018
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3795
3019
  }
3796
- const message = response.message || response.Message || errorCode;
3797
- response.message = message;
3798
- delete response.Message;
3799
- return Promise.reject(Object.assign(new Error(message), response));
3800
3020
  };
3801
3021
  const deserializeAws_restJson1GetSchemaCreationStatusCommand = async (output, context) => {
3802
3022
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3828,51 +3048,25 @@ const deserializeAws_restJson1GetSchemaCreationStatusCommandError = async (outpu
3828
3048
  switch (errorCode) {
3829
3049
  case "BadRequestException":
3830
3050
  case "com.amazonaws.appsync#BadRequestException":
3831
- response = {
3832
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3833
- name: errorCode,
3834
- $metadata: deserializeMetadata(output),
3835
- };
3836
- break;
3051
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3837
3052
  case "InternalFailureException":
3838
3053
  case "com.amazonaws.appsync#InternalFailureException":
3839
- response = {
3840
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
3841
- name: errorCode,
3842
- $metadata: deserializeMetadata(output),
3843
- };
3844
- break;
3054
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
3845
3055
  case "NotFoundException":
3846
3056
  case "com.amazonaws.appsync#NotFoundException":
3847
- response = {
3848
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3849
- name: errorCode,
3850
- $metadata: deserializeMetadata(output),
3851
- };
3852
- break;
3057
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3853
3058
  case "UnauthorizedException":
3854
3059
  case "com.amazonaws.appsync#UnauthorizedException":
3855
- response = {
3856
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
3857
- name: errorCode,
3858
- $metadata: deserializeMetadata(output),
3859
- };
3860
- break;
3060
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3861
3061
  default:
3862
3062
  const parsedBody = parsedOutput.body;
3863
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3864
- response = {
3865
- ...parsedBody,
3866
- name: `${errorCode}`,
3867
- message: parsedBody.message || parsedBody.Message || errorCode,
3063
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3064
+ name: parsedBody.code || parsedBody.Code || errorCode,
3868
3065
  $fault: "client",
3869
3066
  $metadata: deserializeMetadata(output),
3870
- };
3067
+ });
3068
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3871
3069
  }
3872
- const message = response.message || response.Message || errorCode;
3873
- response.message = message;
3874
- delete response.Message;
3875
- return Promise.reject(Object.assign(new Error(message), response));
3876
3070
  };
3877
3071
  const deserializeAws_restJson1GetTypeCommand = async (output, context) => {
3878
3072
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3900,59 +3094,28 @@ const deserializeAws_restJson1GetTypeCommandError = async (output, context) => {
3900
3094
  switch (errorCode) {
3901
3095
  case "BadRequestException":
3902
3096
  case "com.amazonaws.appsync#BadRequestException":
3903
- response = {
3904
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3905
- name: errorCode,
3906
- $metadata: deserializeMetadata(output),
3907
- };
3908
- break;
3097
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3909
3098
  case "ConcurrentModificationException":
3910
3099
  case "com.amazonaws.appsync#ConcurrentModificationException":
3911
- response = {
3912
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
3913
- name: errorCode,
3914
- $metadata: deserializeMetadata(output),
3915
- };
3916
- break;
3100
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
3917
3101
  case "InternalFailureException":
3918
3102
  case "com.amazonaws.appsync#InternalFailureException":
3919
- response = {
3920
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
3921
- name: errorCode,
3922
- $metadata: deserializeMetadata(output),
3923
- };
3924
- break;
3103
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
3925
3104
  case "NotFoundException":
3926
3105
  case "com.amazonaws.appsync#NotFoundException":
3927
- response = {
3928
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
3929
- name: errorCode,
3930
- $metadata: deserializeMetadata(output),
3931
- };
3932
- break;
3106
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
3933
3107
  case "UnauthorizedException":
3934
3108
  case "com.amazonaws.appsync#UnauthorizedException":
3935
- response = {
3936
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
3937
- name: errorCode,
3938
- $metadata: deserializeMetadata(output),
3939
- };
3940
- break;
3109
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
3941
3110
  default:
3942
3111
  const parsedBody = parsedOutput.body;
3943
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
3944
- response = {
3945
- ...parsedBody,
3946
- name: `${errorCode}`,
3947
- message: parsedBody.message || parsedBody.Message || errorCode,
3112
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3113
+ name: parsedBody.code || parsedBody.Code || errorCode,
3948
3114
  $fault: "client",
3949
3115
  $metadata: deserializeMetadata(output),
3950
- };
3116
+ });
3117
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
3951
3118
  }
3952
- const message = response.message || response.Message || errorCode;
3953
- response.message = message;
3954
- delete response.Message;
3955
- return Promise.reject(Object.assign(new Error(message), response));
3956
3119
  };
3957
3120
  const deserializeAws_restJson1ListApiKeysCommand = async (output, context) => {
3958
3121
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -3984,51 +3147,25 @@ const deserializeAws_restJson1ListApiKeysCommandError = async (output, context)
3984
3147
  switch (errorCode) {
3985
3148
  case "BadRequestException":
3986
3149
  case "com.amazonaws.appsync#BadRequestException":
3987
- response = {
3988
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
3989
- name: errorCode,
3990
- $metadata: deserializeMetadata(output),
3991
- };
3992
- break;
3150
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
3993
3151
  case "InternalFailureException":
3994
3152
  case "com.amazonaws.appsync#InternalFailureException":
3995
- response = {
3996
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
3997
- name: errorCode,
3998
- $metadata: deserializeMetadata(output),
3999
- };
4000
- break;
3153
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
4001
3154
  case "NotFoundException":
4002
3155
  case "com.amazonaws.appsync#NotFoundException":
4003
- response = {
4004
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
4005
- name: errorCode,
4006
- $metadata: deserializeMetadata(output),
4007
- };
4008
- break;
3156
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
4009
3157
  case "UnauthorizedException":
4010
3158
  case "com.amazonaws.appsync#UnauthorizedException":
4011
- response = {
4012
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
4013
- name: errorCode,
4014
- $metadata: deserializeMetadata(output),
4015
- };
4016
- break;
3159
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
4017
3160
  default:
4018
3161
  const parsedBody = parsedOutput.body;
4019
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4020
- response = {
4021
- ...parsedBody,
4022
- name: `${errorCode}`,
4023
- message: parsedBody.message || parsedBody.Message || errorCode,
3162
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3163
+ name: parsedBody.code || parsedBody.Code || errorCode,
4024
3164
  $fault: "client",
4025
3165
  $metadata: deserializeMetadata(output),
4026
- };
3166
+ });
3167
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4027
3168
  }
4028
- const message = response.message || response.Message || errorCode;
4029
- response.message = message;
4030
- delete response.Message;
4031
- return Promise.reject(Object.assign(new Error(message), response));
4032
3169
  };
4033
3170
  const deserializeAws_restJson1ListDataSourcesCommand = async (output, context) => {
4034
3171
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4060,51 +3197,25 @@ const deserializeAws_restJson1ListDataSourcesCommandError = async (output, conte
4060
3197
  switch (errorCode) {
4061
3198
  case "BadRequestException":
4062
3199
  case "com.amazonaws.appsync#BadRequestException":
4063
- response = {
4064
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
4065
- name: errorCode,
4066
- $metadata: deserializeMetadata(output),
4067
- };
4068
- break;
3200
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
4069
3201
  case "InternalFailureException":
4070
3202
  case "com.amazonaws.appsync#InternalFailureException":
4071
- response = {
4072
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
4073
- name: errorCode,
4074
- $metadata: deserializeMetadata(output),
4075
- };
4076
- break;
3203
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
4077
3204
  case "NotFoundException":
4078
3205
  case "com.amazonaws.appsync#NotFoundException":
4079
- response = {
4080
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
4081
- name: errorCode,
4082
- $metadata: deserializeMetadata(output),
4083
- };
4084
- break;
3206
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
4085
3207
  case "UnauthorizedException":
4086
3208
  case "com.amazonaws.appsync#UnauthorizedException":
4087
- response = {
4088
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
4089
- name: errorCode,
4090
- $metadata: deserializeMetadata(output),
4091
- };
4092
- break;
3209
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
4093
3210
  default:
4094
3211
  const parsedBody = parsedOutput.body;
4095
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4096
- response = {
4097
- ...parsedBody,
4098
- name: `${errorCode}`,
4099
- message: parsedBody.message || parsedBody.Message || errorCode,
3212
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3213
+ name: parsedBody.code || parsedBody.Code || errorCode,
4100
3214
  $fault: "client",
4101
3215
  $metadata: deserializeMetadata(output),
4102
- };
3216
+ });
3217
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4103
3218
  }
4104
- const message = response.message || response.Message || errorCode;
4105
- response.message = message;
4106
- delete response.Message;
4107
- return Promise.reject(Object.assign(new Error(message), response));
4108
3219
  };
4109
3220
  const deserializeAws_restJson1ListDomainNamesCommand = async (output, context) => {
4110
3221
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4136,43 +3247,22 @@ const deserializeAws_restJson1ListDomainNamesCommandError = async (output, conte
4136
3247
  switch (errorCode) {
4137
3248
  case "AccessDeniedException":
4138
3249
  case "com.amazonaws.appsync#AccessDeniedException":
4139
- response = {
4140
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4141
- name: errorCode,
4142
- $metadata: deserializeMetadata(output),
4143
- };
4144
- break;
3250
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4145
3251
  case "BadRequestException":
4146
3252
  case "com.amazonaws.appsync#BadRequestException":
4147
- response = {
4148
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
4149
- name: errorCode,
4150
- $metadata: deserializeMetadata(output),
4151
- };
4152
- break;
3253
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
4153
3254
  case "InternalFailureException":
4154
3255
  case "com.amazonaws.appsync#InternalFailureException":
4155
- response = {
4156
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
4157
- name: errorCode,
4158
- $metadata: deserializeMetadata(output),
4159
- };
4160
- break;
3256
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
4161
3257
  default:
4162
3258
  const parsedBody = parsedOutput.body;
4163
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4164
- response = {
4165
- ...parsedBody,
4166
- name: `${errorCode}`,
4167
- message: parsedBody.message || parsedBody.Message || errorCode,
3259
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3260
+ name: parsedBody.code || parsedBody.Code || errorCode,
4168
3261
  $fault: "client",
4169
3262
  $metadata: deserializeMetadata(output),
4170
- };
3263
+ });
3264
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4171
3265
  }
4172
- const message = response.message || response.Message || errorCode;
4173
- response.message = message;
4174
- delete response.Message;
4175
- return Promise.reject(Object.assign(new Error(message), response));
4176
3266
  };
4177
3267
  const deserializeAws_restJson1ListFunctionsCommand = async (output, context) => {
4178
3268
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4204,51 +3294,25 @@ const deserializeAws_restJson1ListFunctionsCommandError = async (output, context
4204
3294
  switch (errorCode) {
4205
3295
  case "BadRequestException":
4206
3296
  case "com.amazonaws.appsync#BadRequestException":
4207
- response = {
4208
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
4209
- name: errorCode,
4210
- $metadata: deserializeMetadata(output),
4211
- };
4212
- break;
3297
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
4213
3298
  case "InternalFailureException":
4214
3299
  case "com.amazonaws.appsync#InternalFailureException":
4215
- response = {
4216
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
4217
- name: errorCode,
4218
- $metadata: deserializeMetadata(output),
4219
- };
4220
- break;
3300
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
4221
3301
  case "NotFoundException":
4222
3302
  case "com.amazonaws.appsync#NotFoundException":
4223
- response = {
4224
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
4225
- name: errorCode,
4226
- $metadata: deserializeMetadata(output),
4227
- };
4228
- break;
3303
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
4229
3304
  case "UnauthorizedException":
4230
3305
  case "com.amazonaws.appsync#UnauthorizedException":
4231
- response = {
4232
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
4233
- name: errorCode,
4234
- $metadata: deserializeMetadata(output),
4235
- };
4236
- break;
3306
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
4237
3307
  default:
4238
3308
  const parsedBody = parsedOutput.body;
4239
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4240
- response = {
4241
- ...parsedBody,
4242
- name: `${errorCode}`,
4243
- message: parsedBody.message || parsedBody.Message || errorCode,
3309
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3310
+ name: parsedBody.code || parsedBody.Code || errorCode,
4244
3311
  $fault: "client",
4245
3312
  $metadata: deserializeMetadata(output),
4246
- };
3313
+ });
3314
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4247
3315
  }
4248
- const message = response.message || response.Message || errorCode;
4249
- response.message = message;
4250
- delete response.Message;
4251
- return Promise.reject(Object.assign(new Error(message), response));
4252
3316
  };
4253
3317
  const deserializeAws_restJson1ListGraphqlApisCommand = async (output, context) => {
4254
3318
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4280,43 +3344,22 @@ const deserializeAws_restJson1ListGraphqlApisCommandError = async (output, conte
4280
3344
  switch (errorCode) {
4281
3345
  case "BadRequestException":
4282
3346
  case "com.amazonaws.appsync#BadRequestException":
4283
- response = {
4284
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
4285
- name: errorCode,
4286
- $metadata: deserializeMetadata(output),
4287
- };
4288
- break;
3347
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
4289
3348
  case "InternalFailureException":
4290
3349
  case "com.amazonaws.appsync#InternalFailureException":
4291
- response = {
4292
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
4293
- name: errorCode,
4294
- $metadata: deserializeMetadata(output),
4295
- };
4296
- break;
3350
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
4297
3351
  case "UnauthorizedException":
4298
3352
  case "com.amazonaws.appsync#UnauthorizedException":
4299
- response = {
4300
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
4301
- name: errorCode,
4302
- $metadata: deserializeMetadata(output),
4303
- };
4304
- break;
3353
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
4305
3354
  default:
4306
3355
  const parsedBody = parsedOutput.body;
4307
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4308
- response = {
4309
- ...parsedBody,
4310
- name: `${errorCode}`,
4311
- message: parsedBody.message || parsedBody.Message || errorCode,
3356
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3357
+ name: parsedBody.code || parsedBody.Code || errorCode,
4312
3358
  $fault: "client",
4313
3359
  $metadata: deserializeMetadata(output),
4314
- };
3360
+ });
3361
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4315
3362
  }
4316
- const message = response.message || response.Message || errorCode;
4317
- response.message = message;
4318
- delete response.Message;
4319
- return Promise.reject(Object.assign(new Error(message), response));
4320
3363
  };
4321
3364
  const deserializeAws_restJson1ListResolversCommand = async (output, context) => {
4322
3365
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4348,51 +3391,25 @@ const deserializeAws_restJson1ListResolversCommandError = async (output, context
4348
3391
  switch (errorCode) {
4349
3392
  case "BadRequestException":
4350
3393
  case "com.amazonaws.appsync#BadRequestException":
4351
- response = {
4352
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
4353
- name: errorCode,
4354
- $metadata: deserializeMetadata(output),
4355
- };
4356
- break;
3394
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
4357
3395
  case "InternalFailureException":
4358
3396
  case "com.amazonaws.appsync#InternalFailureException":
4359
- response = {
4360
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
4361
- name: errorCode,
4362
- $metadata: deserializeMetadata(output),
4363
- };
4364
- break;
3397
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
4365
3398
  case "NotFoundException":
4366
3399
  case "com.amazonaws.appsync#NotFoundException":
4367
- response = {
4368
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
4369
- name: errorCode,
4370
- $metadata: deserializeMetadata(output),
4371
- };
4372
- break;
3400
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
4373
3401
  case "UnauthorizedException":
4374
3402
  case "com.amazonaws.appsync#UnauthorizedException":
4375
- response = {
4376
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
4377
- name: errorCode,
4378
- $metadata: deserializeMetadata(output),
4379
- };
4380
- break;
3403
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
4381
3404
  default:
4382
3405
  const parsedBody = parsedOutput.body;
4383
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4384
- response = {
4385
- ...parsedBody,
4386
- name: `${errorCode}`,
4387
- message: parsedBody.message || parsedBody.Message || errorCode,
3406
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3407
+ name: parsedBody.code || parsedBody.Code || errorCode,
4388
3408
  $fault: "client",
4389
3409
  $metadata: deserializeMetadata(output),
4390
- };
3410
+ });
3411
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4391
3412
  }
4392
- const message = response.message || response.Message || errorCode;
4393
- response.message = message;
4394
- delete response.Message;
4395
- return Promise.reject(Object.assign(new Error(message), response));
4396
3413
  };
4397
3414
  const deserializeAws_restJson1ListResolversByFunctionCommand = async (output, context) => {
4398
3415
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4424,51 +3441,25 @@ const deserializeAws_restJson1ListResolversByFunctionCommandError = async (outpu
4424
3441
  switch (errorCode) {
4425
3442
  case "BadRequestException":
4426
3443
  case "com.amazonaws.appsync#BadRequestException":
4427
- response = {
4428
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
4429
- name: errorCode,
4430
- $metadata: deserializeMetadata(output),
4431
- };
4432
- break;
3444
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
4433
3445
  case "InternalFailureException":
4434
3446
  case "com.amazonaws.appsync#InternalFailureException":
4435
- response = {
4436
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
4437
- name: errorCode,
4438
- $metadata: deserializeMetadata(output),
4439
- };
4440
- break;
3447
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
4441
3448
  case "NotFoundException":
4442
3449
  case "com.amazonaws.appsync#NotFoundException":
4443
- response = {
4444
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
4445
- name: errorCode,
4446
- $metadata: deserializeMetadata(output),
4447
- };
4448
- break;
3450
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
4449
3451
  case "UnauthorizedException":
4450
3452
  case "com.amazonaws.appsync#UnauthorizedException":
4451
- response = {
4452
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
4453
- name: errorCode,
4454
- $metadata: deserializeMetadata(output),
4455
- };
4456
- break;
3453
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
4457
3454
  default:
4458
3455
  const parsedBody = parsedOutput.body;
4459
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4460
- response = {
4461
- ...parsedBody,
4462
- name: `${errorCode}`,
4463
- message: parsedBody.message || parsedBody.Message || errorCode,
3456
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3457
+ name: parsedBody.code || parsedBody.Code || errorCode,
4464
3458
  $fault: "client",
4465
3459
  $metadata: deserializeMetadata(output),
4466
- };
3460
+ });
3461
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4467
3462
  }
4468
- const message = response.message || response.Message || errorCode;
4469
- response.message = message;
4470
- delete response.Message;
4471
- return Promise.reject(Object.assign(new Error(message), response));
4472
3463
  };
4473
3464
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
4474
3465
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4496,67 +3487,31 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
4496
3487
  switch (errorCode) {
4497
3488
  case "AccessDeniedException":
4498
3489
  case "com.amazonaws.appsync#AccessDeniedException":
4499
- response = {
4500
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4501
- name: errorCode,
4502
- $metadata: deserializeMetadata(output),
4503
- };
4504
- break;
3490
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4505
3491
  case "BadRequestException":
4506
3492
  case "com.amazonaws.appsync#BadRequestException":
4507
- response = {
4508
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
4509
- name: errorCode,
4510
- $metadata: deserializeMetadata(output),
4511
- };
4512
- break;
3493
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
4513
3494
  case "InternalFailureException":
4514
3495
  case "com.amazonaws.appsync#InternalFailureException":
4515
- response = {
4516
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
4517
- name: errorCode,
4518
- $metadata: deserializeMetadata(output),
4519
- };
4520
- break;
3496
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
4521
3497
  case "LimitExceededException":
4522
3498
  case "com.amazonaws.appsync#LimitExceededException":
4523
- response = {
4524
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
4525
- name: errorCode,
4526
- $metadata: deserializeMetadata(output),
4527
- };
4528
- break;
3499
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
4529
3500
  case "NotFoundException":
4530
3501
  case "com.amazonaws.appsync#NotFoundException":
4531
- response = {
4532
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
4533
- name: errorCode,
4534
- $metadata: deserializeMetadata(output),
4535
- };
4536
- break;
3502
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
4537
3503
  case "UnauthorizedException":
4538
3504
  case "com.amazonaws.appsync#UnauthorizedException":
4539
- response = {
4540
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
4541
- name: errorCode,
4542
- $metadata: deserializeMetadata(output),
4543
- };
4544
- break;
3505
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
4545
3506
  default:
4546
3507
  const parsedBody = parsedOutput.body;
4547
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4548
- response = {
4549
- ...parsedBody,
4550
- name: `${errorCode}`,
4551
- message: parsedBody.message || parsedBody.Message || errorCode,
3508
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3509
+ name: parsedBody.code || parsedBody.Code || errorCode,
4552
3510
  $fault: "client",
4553
3511
  $metadata: deserializeMetadata(output),
4554
- };
3512
+ });
3513
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4555
3514
  }
4556
- const message = response.message || response.Message || errorCode;
4557
- response.message = message;
4558
- delete response.Message;
4559
- return Promise.reject(Object.assign(new Error(message), response));
4560
3515
  };
4561
3516
  const deserializeAws_restJson1ListTypesCommand = async (output, context) => {
4562
3517
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4588,59 +3543,28 @@ const deserializeAws_restJson1ListTypesCommandError = async (output, context) =>
4588
3543
  switch (errorCode) {
4589
3544
  case "BadRequestException":
4590
3545
  case "com.amazonaws.appsync#BadRequestException":
4591
- response = {
4592
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
4593
- name: errorCode,
4594
- $metadata: deserializeMetadata(output),
4595
- };
4596
- break;
3546
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
4597
3547
  case "ConcurrentModificationException":
4598
3548
  case "com.amazonaws.appsync#ConcurrentModificationException":
4599
- response = {
4600
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
4601
- name: errorCode,
4602
- $metadata: deserializeMetadata(output),
4603
- };
4604
- break;
3549
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
4605
3550
  case "InternalFailureException":
4606
3551
  case "com.amazonaws.appsync#InternalFailureException":
4607
- response = {
4608
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
4609
- name: errorCode,
4610
- $metadata: deserializeMetadata(output),
4611
- };
4612
- break;
3552
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
4613
3553
  case "NotFoundException":
4614
3554
  case "com.amazonaws.appsync#NotFoundException":
4615
- response = {
4616
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
4617
- name: errorCode,
4618
- $metadata: deserializeMetadata(output),
4619
- };
4620
- break;
3555
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
4621
3556
  case "UnauthorizedException":
4622
3557
  case "com.amazonaws.appsync#UnauthorizedException":
4623
- response = {
4624
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
4625
- name: errorCode,
4626
- $metadata: deserializeMetadata(output),
4627
- };
4628
- break;
3558
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
4629
3559
  default:
4630
3560
  const parsedBody = parsedOutput.body;
4631
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4632
- response = {
4633
- ...parsedBody,
4634
- name: `${errorCode}`,
4635
- message: parsedBody.message || parsedBody.Message || errorCode,
3561
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3562
+ name: parsedBody.code || parsedBody.Code || errorCode,
4636
3563
  $fault: "client",
4637
3564
  $metadata: deserializeMetadata(output),
4638
- };
3565
+ });
3566
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4639
3567
  }
4640
- const message = response.message || response.Message || errorCode;
4641
- response.message = message;
4642
- delete response.Message;
4643
- return Promise.reject(Object.assign(new Error(message), response));
4644
3568
  };
4645
3569
  const deserializeAws_restJson1StartSchemaCreationCommand = async (output, context) => {
4646
3570
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4668,59 +3592,28 @@ const deserializeAws_restJson1StartSchemaCreationCommandError = async (output, c
4668
3592
  switch (errorCode) {
4669
3593
  case "BadRequestException":
4670
3594
  case "com.amazonaws.appsync#BadRequestException":
4671
- response = {
4672
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
4673
- name: errorCode,
4674
- $metadata: deserializeMetadata(output),
4675
- };
4676
- break;
3595
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
4677
3596
  case "ConcurrentModificationException":
4678
3597
  case "com.amazonaws.appsync#ConcurrentModificationException":
4679
- response = {
4680
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
4681
- name: errorCode,
4682
- $metadata: deserializeMetadata(output),
4683
- };
4684
- break;
3598
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
4685
3599
  case "InternalFailureException":
4686
3600
  case "com.amazonaws.appsync#InternalFailureException":
4687
- response = {
4688
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
4689
- name: errorCode,
4690
- $metadata: deserializeMetadata(output),
4691
- };
4692
- break;
3601
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
4693
3602
  case "NotFoundException":
4694
3603
  case "com.amazonaws.appsync#NotFoundException":
4695
- response = {
4696
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
4697
- name: errorCode,
4698
- $metadata: deserializeMetadata(output),
4699
- };
4700
- break;
3604
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
4701
3605
  case "UnauthorizedException":
4702
3606
  case "com.amazonaws.appsync#UnauthorizedException":
4703
- response = {
4704
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
4705
- name: errorCode,
4706
- $metadata: deserializeMetadata(output),
4707
- };
4708
- break;
3607
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
4709
3608
  default:
4710
3609
  const parsedBody = parsedOutput.body;
4711
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4712
- response = {
4713
- ...parsedBody,
4714
- name: `${errorCode}`,
4715
- message: parsedBody.message || parsedBody.Message || errorCode,
3610
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3611
+ name: parsedBody.code || parsedBody.Code || errorCode,
4716
3612
  $fault: "client",
4717
3613
  $metadata: deserializeMetadata(output),
4718
- };
3614
+ });
3615
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4719
3616
  }
4720
- const message = response.message || response.Message || errorCode;
4721
- response.message = message;
4722
- delete response.Message;
4723
- return Promise.reject(Object.assign(new Error(message), response));
4724
3617
  };
4725
3618
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
4726
3619
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4744,67 +3637,31 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
4744
3637
  switch (errorCode) {
4745
3638
  case "AccessDeniedException":
4746
3639
  case "com.amazonaws.appsync#AccessDeniedException":
4747
- response = {
4748
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4749
- name: errorCode,
4750
- $metadata: deserializeMetadata(output),
4751
- };
4752
- break;
3640
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4753
3641
  case "BadRequestException":
4754
3642
  case "com.amazonaws.appsync#BadRequestException":
4755
- response = {
4756
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
4757
- name: errorCode,
4758
- $metadata: deserializeMetadata(output),
4759
- };
4760
- break;
3643
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
4761
3644
  case "InternalFailureException":
4762
3645
  case "com.amazonaws.appsync#InternalFailureException":
4763
- response = {
4764
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
4765
- name: errorCode,
4766
- $metadata: deserializeMetadata(output),
4767
- };
4768
- break;
3646
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
4769
3647
  case "LimitExceededException":
4770
3648
  case "com.amazonaws.appsync#LimitExceededException":
4771
- response = {
4772
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
4773
- name: errorCode,
4774
- $metadata: deserializeMetadata(output),
4775
- };
4776
- break;
3649
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
4777
3650
  case "NotFoundException":
4778
3651
  case "com.amazonaws.appsync#NotFoundException":
4779
- response = {
4780
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
4781
- name: errorCode,
4782
- $metadata: deserializeMetadata(output),
4783
- };
4784
- break;
3652
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
4785
3653
  case "UnauthorizedException":
4786
3654
  case "com.amazonaws.appsync#UnauthorizedException":
4787
- response = {
4788
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
4789
- name: errorCode,
4790
- $metadata: deserializeMetadata(output),
4791
- };
4792
- break;
3655
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
4793
3656
  default:
4794
3657
  const parsedBody = parsedOutput.body;
4795
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4796
- response = {
4797
- ...parsedBody,
4798
- name: `${errorCode}`,
4799
- message: parsedBody.message || parsedBody.Message || errorCode,
3658
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3659
+ name: parsedBody.code || parsedBody.Code || errorCode,
4800
3660
  $fault: "client",
4801
3661
  $metadata: deserializeMetadata(output),
4802
- };
3662
+ });
3663
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4803
3664
  }
4804
- const message = response.message || response.Message || errorCode;
4805
- response.message = message;
4806
- delete response.Message;
4807
- return Promise.reject(Object.assign(new Error(message), response));
4808
3665
  };
4809
3666
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
4810
3667
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4828,67 +3685,31 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
4828
3685
  switch (errorCode) {
4829
3686
  case "AccessDeniedException":
4830
3687
  case "com.amazonaws.appsync#AccessDeniedException":
4831
- response = {
4832
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
4833
- name: errorCode,
4834
- $metadata: deserializeMetadata(output),
4835
- };
4836
- break;
3688
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4837
3689
  case "BadRequestException":
4838
3690
  case "com.amazonaws.appsync#BadRequestException":
4839
- response = {
4840
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
4841
- name: errorCode,
4842
- $metadata: deserializeMetadata(output),
4843
- };
4844
- break;
3691
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
4845
3692
  case "InternalFailureException":
4846
3693
  case "com.amazonaws.appsync#InternalFailureException":
4847
- response = {
4848
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
4849
- name: errorCode,
4850
- $metadata: deserializeMetadata(output),
4851
- };
4852
- break;
3694
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
4853
3695
  case "LimitExceededException":
4854
3696
  case "com.amazonaws.appsync#LimitExceededException":
4855
- response = {
4856
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
4857
- name: errorCode,
4858
- $metadata: deserializeMetadata(output),
4859
- };
4860
- break;
3697
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
4861
3698
  case "NotFoundException":
4862
3699
  case "com.amazonaws.appsync#NotFoundException":
4863
- response = {
4864
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
4865
- name: errorCode,
4866
- $metadata: deserializeMetadata(output),
4867
- };
4868
- break;
3700
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
4869
3701
  case "UnauthorizedException":
4870
3702
  case "com.amazonaws.appsync#UnauthorizedException":
4871
- response = {
4872
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
4873
- name: errorCode,
4874
- $metadata: deserializeMetadata(output),
4875
- };
4876
- break;
3703
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
4877
3704
  default:
4878
3705
  const parsedBody = parsedOutput.body;
4879
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4880
- response = {
4881
- ...parsedBody,
4882
- name: `${errorCode}`,
4883
- message: parsedBody.message || parsedBody.Message || errorCode,
3706
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3707
+ name: parsedBody.code || parsedBody.Code || errorCode,
4884
3708
  $fault: "client",
4885
3709
  $metadata: deserializeMetadata(output),
4886
- };
3710
+ });
3711
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4887
3712
  }
4888
- const message = response.message || response.Message || errorCode;
4889
- response.message = message;
4890
- delete response.Message;
4891
- return Promise.reject(Object.assign(new Error(message), response));
4892
3713
  };
4893
3714
  const deserializeAws_restJson1UpdateApiCacheCommand = async (output, context) => {
4894
3715
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4916,59 +3737,28 @@ const deserializeAws_restJson1UpdateApiCacheCommandError = async (output, contex
4916
3737
  switch (errorCode) {
4917
3738
  case "BadRequestException":
4918
3739
  case "com.amazonaws.appsync#BadRequestException":
4919
- response = {
4920
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
4921
- name: errorCode,
4922
- $metadata: deserializeMetadata(output),
4923
- };
4924
- break;
3740
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
4925
3741
  case "ConcurrentModificationException":
4926
3742
  case "com.amazonaws.appsync#ConcurrentModificationException":
4927
- response = {
4928
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
4929
- name: errorCode,
4930
- $metadata: deserializeMetadata(output),
4931
- };
4932
- break;
3743
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
4933
3744
  case "InternalFailureException":
4934
3745
  case "com.amazonaws.appsync#InternalFailureException":
4935
- response = {
4936
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
4937
- name: errorCode,
4938
- $metadata: deserializeMetadata(output),
4939
- };
4940
- break;
3746
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
4941
3747
  case "NotFoundException":
4942
3748
  case "com.amazonaws.appsync#NotFoundException":
4943
- response = {
4944
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
4945
- name: errorCode,
4946
- $metadata: deserializeMetadata(output),
4947
- };
4948
- break;
3749
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
4949
3750
  case "UnauthorizedException":
4950
3751
  case "com.amazonaws.appsync#UnauthorizedException":
4951
- response = {
4952
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
4953
- name: errorCode,
4954
- $metadata: deserializeMetadata(output),
4955
- };
4956
- break;
3752
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
4957
3753
  default:
4958
3754
  const parsedBody = parsedOutput.body;
4959
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
4960
- response = {
4961
- ...parsedBody,
4962
- name: `${errorCode}`,
4963
- message: parsedBody.message || parsedBody.Message || errorCode,
3755
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3756
+ name: parsedBody.code || parsedBody.Code || errorCode,
4964
3757
  $fault: "client",
4965
3758
  $metadata: deserializeMetadata(output),
4966
- };
3759
+ });
3760
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
4967
3761
  }
4968
- const message = response.message || response.Message || errorCode;
4969
- response.message = message;
4970
- delete response.Message;
4971
- return Promise.reject(Object.assign(new Error(message), response));
4972
3762
  };
4973
3763
  const deserializeAws_restJson1UpdateApiKeyCommand = async (output, context) => {
4974
3764
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -4996,67 +3786,31 @@ const deserializeAws_restJson1UpdateApiKeyCommandError = async (output, context)
4996
3786
  switch (errorCode) {
4997
3787
  case "ApiKeyValidityOutOfBoundsException":
4998
3788
  case "com.amazonaws.appsync#ApiKeyValidityOutOfBoundsException":
4999
- response = {
5000
- ...(await deserializeAws_restJson1ApiKeyValidityOutOfBoundsExceptionResponse(parsedOutput, context)),
5001
- name: errorCode,
5002
- $metadata: deserializeMetadata(output),
5003
- };
5004
- break;
3789
+ throw await deserializeAws_restJson1ApiKeyValidityOutOfBoundsExceptionResponse(parsedOutput, context);
5005
3790
  case "BadRequestException":
5006
3791
  case "com.amazonaws.appsync#BadRequestException":
5007
- response = {
5008
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
5009
- name: errorCode,
5010
- $metadata: deserializeMetadata(output),
5011
- };
5012
- break;
3792
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
5013
3793
  case "InternalFailureException":
5014
3794
  case "com.amazonaws.appsync#InternalFailureException":
5015
- response = {
5016
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
5017
- name: errorCode,
5018
- $metadata: deserializeMetadata(output),
5019
- };
5020
- break;
3795
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
5021
3796
  case "LimitExceededException":
5022
3797
  case "com.amazonaws.appsync#LimitExceededException":
5023
- response = {
5024
- ...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
5025
- name: errorCode,
5026
- $metadata: deserializeMetadata(output),
5027
- };
5028
- break;
3798
+ throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
5029
3799
  case "NotFoundException":
5030
3800
  case "com.amazonaws.appsync#NotFoundException":
5031
- response = {
5032
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
5033
- name: errorCode,
5034
- $metadata: deserializeMetadata(output),
5035
- };
5036
- break;
3801
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
5037
3802
  case "UnauthorizedException":
5038
3803
  case "com.amazonaws.appsync#UnauthorizedException":
5039
- response = {
5040
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
5041
- name: errorCode,
5042
- $metadata: deserializeMetadata(output),
5043
- };
5044
- break;
3804
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
5045
3805
  default:
5046
3806
  const parsedBody = parsedOutput.body;
5047
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5048
- response = {
5049
- ...parsedBody,
5050
- name: `${errorCode}`,
5051
- message: parsedBody.message || parsedBody.Message || errorCode,
3807
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3808
+ name: parsedBody.code || parsedBody.Code || errorCode,
5052
3809
  $fault: "client",
5053
3810
  $metadata: deserializeMetadata(output),
5054
- };
3811
+ });
3812
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5055
3813
  }
5056
- const message = response.message || response.Message || errorCode;
5057
- response.message = message;
5058
- delete response.Message;
5059
- return Promise.reject(Object.assign(new Error(message), response));
5060
3814
  };
5061
3815
  const deserializeAws_restJson1UpdateDataSourceCommand = async (output, context) => {
5062
3816
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5084,59 +3838,28 @@ const deserializeAws_restJson1UpdateDataSourceCommandError = async (output, cont
5084
3838
  switch (errorCode) {
5085
3839
  case "BadRequestException":
5086
3840
  case "com.amazonaws.appsync#BadRequestException":
5087
- response = {
5088
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
5089
- name: errorCode,
5090
- $metadata: deserializeMetadata(output),
5091
- };
5092
- break;
3841
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
5093
3842
  case "ConcurrentModificationException":
5094
3843
  case "com.amazonaws.appsync#ConcurrentModificationException":
5095
- response = {
5096
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
5097
- name: errorCode,
5098
- $metadata: deserializeMetadata(output),
5099
- };
5100
- break;
3844
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
5101
3845
  case "InternalFailureException":
5102
3846
  case "com.amazonaws.appsync#InternalFailureException":
5103
- response = {
5104
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
5105
- name: errorCode,
5106
- $metadata: deserializeMetadata(output),
5107
- };
5108
- break;
3847
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
5109
3848
  case "NotFoundException":
5110
3849
  case "com.amazonaws.appsync#NotFoundException":
5111
- response = {
5112
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
5113
- name: errorCode,
5114
- $metadata: deserializeMetadata(output),
5115
- };
5116
- break;
3850
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
5117
3851
  case "UnauthorizedException":
5118
3852
  case "com.amazonaws.appsync#UnauthorizedException":
5119
- response = {
5120
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
5121
- name: errorCode,
5122
- $metadata: deserializeMetadata(output),
5123
- };
5124
- break;
3853
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
5125
3854
  default:
5126
3855
  const parsedBody = parsedOutput.body;
5127
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5128
- response = {
5129
- ...parsedBody,
5130
- name: `${errorCode}`,
5131
- message: parsedBody.message || parsedBody.Message || errorCode,
3856
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3857
+ name: parsedBody.code || parsedBody.Code || errorCode,
5132
3858
  $fault: "client",
5133
3859
  $metadata: deserializeMetadata(output),
5134
- };
3860
+ });
3861
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5135
3862
  }
5136
- const message = response.message || response.Message || errorCode;
5137
- response.message = message;
5138
- delete response.Message;
5139
- return Promise.reject(Object.assign(new Error(message), response));
5140
3863
  };
5141
3864
  const deserializeAws_restJson1UpdateDomainNameCommand = async (output, context) => {
5142
3865
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5164,59 +3887,28 @@ const deserializeAws_restJson1UpdateDomainNameCommandError = async (output, cont
5164
3887
  switch (errorCode) {
5165
3888
  case "AccessDeniedException":
5166
3889
  case "com.amazonaws.appsync#AccessDeniedException":
5167
- response = {
5168
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
5169
- name: errorCode,
5170
- $metadata: deserializeMetadata(output),
5171
- };
5172
- break;
3890
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
5173
3891
  case "BadRequestException":
5174
3892
  case "com.amazonaws.appsync#BadRequestException":
5175
- response = {
5176
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
5177
- name: errorCode,
5178
- $metadata: deserializeMetadata(output),
5179
- };
5180
- break;
3893
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
5181
3894
  case "ConcurrentModificationException":
5182
3895
  case "com.amazonaws.appsync#ConcurrentModificationException":
5183
- response = {
5184
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
5185
- name: errorCode,
5186
- $metadata: deserializeMetadata(output),
5187
- };
5188
- break;
3896
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
5189
3897
  case "InternalFailureException":
5190
3898
  case "com.amazonaws.appsync#InternalFailureException":
5191
- response = {
5192
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
5193
- name: errorCode,
5194
- $metadata: deserializeMetadata(output),
5195
- };
5196
- break;
3899
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
5197
3900
  case "NotFoundException":
5198
3901
  case "com.amazonaws.appsync#NotFoundException":
5199
- response = {
5200
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
5201
- name: errorCode,
5202
- $metadata: deserializeMetadata(output),
5203
- };
5204
- break;
3902
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
5205
3903
  default:
5206
3904
  const parsedBody = parsedOutput.body;
5207
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5208
- response = {
5209
- ...parsedBody,
5210
- name: `${errorCode}`,
5211
- message: parsedBody.message || parsedBody.Message || errorCode,
3905
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3906
+ name: parsedBody.code || parsedBody.Code || errorCode,
5212
3907
  $fault: "client",
5213
3908
  $metadata: deserializeMetadata(output),
5214
- };
3909
+ });
3910
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5215
3911
  }
5216
- const message = response.message || response.Message || errorCode;
5217
- response.message = message;
5218
- delete response.Message;
5219
- return Promise.reject(Object.assign(new Error(message), response));
5220
3912
  };
5221
3913
  const deserializeAws_restJson1UpdateFunctionCommand = async (output, context) => {
5222
3914
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5244,51 +3936,25 @@ const deserializeAws_restJson1UpdateFunctionCommandError = async (output, contex
5244
3936
  switch (errorCode) {
5245
3937
  case "ConcurrentModificationException":
5246
3938
  case "com.amazonaws.appsync#ConcurrentModificationException":
5247
- response = {
5248
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
5249
- name: errorCode,
5250
- $metadata: deserializeMetadata(output),
5251
- };
5252
- break;
3939
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
5253
3940
  case "InternalFailureException":
5254
3941
  case "com.amazonaws.appsync#InternalFailureException":
5255
- response = {
5256
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
5257
- name: errorCode,
5258
- $metadata: deserializeMetadata(output),
5259
- };
5260
- break;
3942
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
5261
3943
  case "NotFoundException":
5262
3944
  case "com.amazonaws.appsync#NotFoundException":
5263
- response = {
5264
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
5265
- name: errorCode,
5266
- $metadata: deserializeMetadata(output),
5267
- };
5268
- break;
3945
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
5269
3946
  case "UnauthorizedException":
5270
3947
  case "com.amazonaws.appsync#UnauthorizedException":
5271
- response = {
5272
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
5273
- name: errorCode,
5274
- $metadata: deserializeMetadata(output),
5275
- };
5276
- break;
3948
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
5277
3949
  default:
5278
3950
  const parsedBody = parsedOutput.body;
5279
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5280
- response = {
5281
- ...parsedBody,
5282
- name: `${errorCode}`,
5283
- message: parsedBody.message || parsedBody.Message || errorCode,
3951
+ response = new AppSyncServiceException_1.AppSyncServiceException({
3952
+ name: parsedBody.code || parsedBody.Code || errorCode,
5284
3953
  $fault: "client",
5285
3954
  $metadata: deserializeMetadata(output),
5286
- };
3955
+ });
3956
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5287
3957
  }
5288
- const message = response.message || response.Message || errorCode;
5289
- response.message = message;
5290
- delete response.Message;
5291
- return Promise.reject(Object.assign(new Error(message), response));
5292
3958
  };
5293
3959
  const deserializeAws_restJson1UpdateGraphqlApiCommand = async (output, context) => {
5294
3960
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5316,67 +3982,31 @@ const deserializeAws_restJson1UpdateGraphqlApiCommandError = async (output, cont
5316
3982
  switch (errorCode) {
5317
3983
  case "AccessDeniedException":
5318
3984
  case "com.amazonaws.appsync#AccessDeniedException":
5319
- response = {
5320
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
5321
- name: errorCode,
5322
- $metadata: deserializeMetadata(output),
5323
- };
5324
- break;
3985
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
5325
3986
  case "BadRequestException":
5326
3987
  case "com.amazonaws.appsync#BadRequestException":
5327
- response = {
5328
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
5329
- name: errorCode,
5330
- $metadata: deserializeMetadata(output),
5331
- };
5332
- break;
3988
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
5333
3989
  case "ConcurrentModificationException":
5334
3990
  case "com.amazonaws.appsync#ConcurrentModificationException":
5335
- response = {
5336
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
5337
- name: errorCode,
5338
- $metadata: deserializeMetadata(output),
5339
- };
5340
- break;
3991
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
5341
3992
  case "InternalFailureException":
5342
3993
  case "com.amazonaws.appsync#InternalFailureException":
5343
- response = {
5344
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
5345
- name: errorCode,
5346
- $metadata: deserializeMetadata(output),
5347
- };
5348
- break;
3994
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
5349
3995
  case "NotFoundException":
5350
3996
  case "com.amazonaws.appsync#NotFoundException":
5351
- response = {
5352
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
5353
- name: errorCode,
5354
- $metadata: deserializeMetadata(output),
5355
- };
5356
- break;
3997
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
5357
3998
  case "UnauthorizedException":
5358
3999
  case "com.amazonaws.appsync#UnauthorizedException":
5359
- response = {
5360
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
5361
- name: errorCode,
5362
- $metadata: deserializeMetadata(output),
5363
- };
5364
- break;
4000
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
5365
4001
  default:
5366
4002
  const parsedBody = parsedOutput.body;
5367
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5368
- response = {
5369
- ...parsedBody,
5370
- name: `${errorCode}`,
5371
- message: parsedBody.message || parsedBody.Message || errorCode,
4003
+ response = new AppSyncServiceException_1.AppSyncServiceException({
4004
+ name: parsedBody.code || parsedBody.Code || errorCode,
5372
4005
  $fault: "client",
5373
4006
  $metadata: deserializeMetadata(output),
5374
- };
4007
+ });
4008
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5375
4009
  }
5376
- const message = response.message || response.Message || errorCode;
5377
- response.message = message;
5378
- delete response.Message;
5379
- return Promise.reject(Object.assign(new Error(message), response));
5380
4010
  };
5381
4011
  const deserializeAws_restJson1UpdateResolverCommand = async (output, context) => {
5382
4012
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5404,51 +4034,25 @@ const deserializeAws_restJson1UpdateResolverCommandError = async (output, contex
5404
4034
  switch (errorCode) {
5405
4035
  case "ConcurrentModificationException":
5406
4036
  case "com.amazonaws.appsync#ConcurrentModificationException":
5407
- response = {
5408
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
5409
- name: errorCode,
5410
- $metadata: deserializeMetadata(output),
5411
- };
5412
- break;
4037
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
5413
4038
  case "InternalFailureException":
5414
4039
  case "com.amazonaws.appsync#InternalFailureException":
5415
- response = {
5416
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
5417
- name: errorCode,
5418
- $metadata: deserializeMetadata(output),
5419
- };
5420
- break;
4040
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
5421
4041
  case "NotFoundException":
5422
4042
  case "com.amazonaws.appsync#NotFoundException":
5423
- response = {
5424
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
5425
- name: errorCode,
5426
- $metadata: deserializeMetadata(output),
5427
- };
5428
- break;
4043
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
5429
4044
  case "UnauthorizedException":
5430
4045
  case "com.amazonaws.appsync#UnauthorizedException":
5431
- response = {
5432
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
5433
- name: errorCode,
5434
- $metadata: deserializeMetadata(output),
5435
- };
5436
- break;
4046
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
5437
4047
  default:
5438
4048
  const parsedBody = parsedOutput.body;
5439
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5440
- response = {
5441
- ...parsedBody,
5442
- name: `${errorCode}`,
5443
- message: parsedBody.message || parsedBody.Message || errorCode,
4049
+ response = new AppSyncServiceException_1.AppSyncServiceException({
4050
+ name: parsedBody.code || parsedBody.Code || errorCode,
5444
4051
  $fault: "client",
5445
4052
  $metadata: deserializeMetadata(output),
5446
- };
4053
+ });
4054
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5447
4055
  }
5448
- const message = response.message || response.Message || errorCode;
5449
- response.message = message;
5450
- delete response.Message;
5451
- return Promise.reject(Object.assign(new Error(message), response));
5452
4056
  };
5453
4057
  const deserializeAws_restJson1UpdateTypeCommand = async (output, context) => {
5454
4058
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -5476,202 +4080,160 @@ const deserializeAws_restJson1UpdateTypeCommandError = async (output, context) =
5476
4080
  switch (errorCode) {
5477
4081
  case "BadRequestException":
5478
4082
  case "com.amazonaws.appsync#BadRequestException":
5479
- response = {
5480
- ...(await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context)),
5481
- name: errorCode,
5482
- $metadata: deserializeMetadata(output),
5483
- };
5484
- break;
4083
+ throw await deserializeAws_restJson1BadRequestExceptionResponse(parsedOutput, context);
5485
4084
  case "ConcurrentModificationException":
5486
4085
  case "com.amazonaws.appsync#ConcurrentModificationException":
5487
- response = {
5488
- ...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
5489
- name: errorCode,
5490
- $metadata: deserializeMetadata(output),
5491
- };
5492
- break;
4086
+ throw await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context);
5493
4087
  case "InternalFailureException":
5494
4088
  case "com.amazonaws.appsync#InternalFailureException":
5495
- response = {
5496
- ...(await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context)),
5497
- name: errorCode,
5498
- $metadata: deserializeMetadata(output),
5499
- };
5500
- break;
4089
+ throw await deserializeAws_restJson1InternalFailureExceptionResponse(parsedOutput, context);
5501
4090
  case "NotFoundException":
5502
4091
  case "com.amazonaws.appsync#NotFoundException":
5503
- response = {
5504
- ...(await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context)),
5505
- name: errorCode,
5506
- $metadata: deserializeMetadata(output),
5507
- };
5508
- break;
4092
+ throw await deserializeAws_restJson1NotFoundExceptionResponse(parsedOutput, context);
5509
4093
  case "UnauthorizedException":
5510
4094
  case "com.amazonaws.appsync#UnauthorizedException":
5511
- response = {
5512
- ...(await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context)),
5513
- name: errorCode,
5514
- $metadata: deserializeMetadata(output),
5515
- };
5516
- break;
4095
+ throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
5517
4096
  default:
5518
4097
  const parsedBody = parsedOutput.body;
5519
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
5520
- response = {
5521
- ...parsedBody,
5522
- name: `${errorCode}`,
5523
- message: parsedBody.message || parsedBody.Message || errorCode,
4098
+ response = new AppSyncServiceException_1.AppSyncServiceException({
4099
+ name: parsedBody.code || parsedBody.Code || errorCode,
5524
4100
  $fault: "client",
5525
4101
  $metadata: deserializeMetadata(output),
5526
- };
4102
+ });
4103
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
5527
4104
  }
5528
- const message = response.message || response.Message || errorCode;
5529
- response.message = message;
5530
- delete response.Message;
5531
- return Promise.reject(Object.assign(new Error(message), response));
5532
4105
  };
5533
4106
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
5534
- const contents = {
5535
- name: "AccessDeniedException",
5536
- $fault: "client",
5537
- $metadata: deserializeMetadata(parsedOutput),
5538
- message: undefined,
5539
- };
4107
+ const contents = {};
5540
4108
  const data = parsedOutput.body;
5541
4109
  if (data.message !== undefined && data.message !== null) {
5542
4110
  contents.message = smithy_client_1.expectString(data.message);
5543
4111
  }
5544
- return contents;
4112
+ const exception = new models_0_1.AccessDeniedException({
4113
+ $metadata: deserializeMetadata(parsedOutput),
4114
+ ...contents,
4115
+ });
4116
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
5545
4117
  };
5546
4118
  const deserializeAws_restJson1ApiKeyLimitExceededExceptionResponse = async (parsedOutput, context) => {
5547
- const contents = {
5548
- name: "ApiKeyLimitExceededException",
5549
- $fault: "client",
5550
- $metadata: deserializeMetadata(parsedOutput),
5551
- message: undefined,
5552
- };
4119
+ const contents = {};
5553
4120
  const data = parsedOutput.body;
5554
4121
  if (data.message !== undefined && data.message !== null) {
5555
4122
  contents.message = smithy_client_1.expectString(data.message);
5556
4123
  }
5557
- return contents;
4124
+ const exception = new models_0_1.ApiKeyLimitExceededException({
4125
+ $metadata: deserializeMetadata(parsedOutput),
4126
+ ...contents,
4127
+ });
4128
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
5558
4129
  };
5559
4130
  const deserializeAws_restJson1ApiKeyValidityOutOfBoundsExceptionResponse = async (parsedOutput, context) => {
5560
- const contents = {
5561
- name: "ApiKeyValidityOutOfBoundsException",
5562
- $fault: "client",
5563
- $metadata: deserializeMetadata(parsedOutput),
5564
- message: undefined,
5565
- };
4131
+ const contents = {};
5566
4132
  const data = parsedOutput.body;
5567
4133
  if (data.message !== undefined && data.message !== null) {
5568
4134
  contents.message = smithy_client_1.expectString(data.message);
5569
4135
  }
5570
- return contents;
4136
+ const exception = new models_0_1.ApiKeyValidityOutOfBoundsException({
4137
+ $metadata: deserializeMetadata(parsedOutput),
4138
+ ...contents,
4139
+ });
4140
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
5571
4141
  };
5572
4142
  const deserializeAws_restJson1ApiLimitExceededExceptionResponse = async (parsedOutput, context) => {
5573
- const contents = {
5574
- name: "ApiLimitExceededException",
5575
- $fault: "client",
5576
- $metadata: deserializeMetadata(parsedOutput),
5577
- message: undefined,
5578
- };
4143
+ const contents = {};
5579
4144
  const data = parsedOutput.body;
5580
4145
  if (data.message !== undefined && data.message !== null) {
5581
4146
  contents.message = smithy_client_1.expectString(data.message);
5582
4147
  }
5583
- return contents;
4148
+ const exception = new models_0_1.ApiLimitExceededException({
4149
+ $metadata: deserializeMetadata(parsedOutput),
4150
+ ...contents,
4151
+ });
4152
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
5584
4153
  };
5585
4154
  const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
5586
- const contents = {
5587
- name: "BadRequestException",
5588
- $fault: "client",
5589
- $metadata: deserializeMetadata(parsedOutput),
5590
- message: undefined,
5591
- };
4155
+ const contents = {};
5592
4156
  const data = parsedOutput.body;
5593
4157
  if (data.message !== undefined && data.message !== null) {
5594
4158
  contents.message = smithy_client_1.expectString(data.message);
5595
4159
  }
5596
- return contents;
4160
+ const exception = new models_0_1.BadRequestException({
4161
+ $metadata: deserializeMetadata(parsedOutput),
4162
+ ...contents,
4163
+ });
4164
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
5597
4165
  };
5598
4166
  const deserializeAws_restJson1ConcurrentModificationExceptionResponse = async (parsedOutput, context) => {
5599
- const contents = {
5600
- name: "ConcurrentModificationException",
5601
- $fault: "client",
5602
- $metadata: deserializeMetadata(parsedOutput),
5603
- message: undefined,
5604
- };
4167
+ const contents = {};
5605
4168
  const data = parsedOutput.body;
5606
4169
  if (data.message !== undefined && data.message !== null) {
5607
4170
  contents.message = smithy_client_1.expectString(data.message);
5608
4171
  }
5609
- return contents;
4172
+ const exception = new models_0_1.ConcurrentModificationException({
4173
+ $metadata: deserializeMetadata(parsedOutput),
4174
+ ...contents,
4175
+ });
4176
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
5610
4177
  };
5611
4178
  const deserializeAws_restJson1GraphQLSchemaExceptionResponse = async (parsedOutput, context) => {
5612
- const contents = {
5613
- name: "GraphQLSchemaException",
5614
- $fault: "client",
5615
- $metadata: deserializeMetadata(parsedOutput),
5616
- message: undefined,
5617
- };
4179
+ const contents = {};
5618
4180
  const data = parsedOutput.body;
5619
4181
  if (data.message !== undefined && data.message !== null) {
5620
4182
  contents.message = smithy_client_1.expectString(data.message);
5621
4183
  }
5622
- return contents;
4184
+ const exception = new models_0_1.GraphQLSchemaException({
4185
+ $metadata: deserializeMetadata(parsedOutput),
4186
+ ...contents,
4187
+ });
4188
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
5623
4189
  };
5624
4190
  const deserializeAws_restJson1InternalFailureExceptionResponse = async (parsedOutput, context) => {
5625
- const contents = {
5626
- name: "InternalFailureException",
5627
- $fault: "server",
5628
- $metadata: deserializeMetadata(parsedOutput),
5629
- message: undefined,
5630
- };
4191
+ const contents = {};
5631
4192
  const data = parsedOutput.body;
5632
4193
  if (data.message !== undefined && data.message !== null) {
5633
4194
  contents.message = smithy_client_1.expectString(data.message);
5634
4195
  }
5635
- return contents;
4196
+ const exception = new models_0_1.InternalFailureException({
4197
+ $metadata: deserializeMetadata(parsedOutput),
4198
+ ...contents,
4199
+ });
4200
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
5636
4201
  };
5637
4202
  const deserializeAws_restJson1LimitExceededExceptionResponse = async (parsedOutput, context) => {
5638
- const contents = {
5639
- name: "LimitExceededException",
5640
- $fault: "client",
5641
- $metadata: deserializeMetadata(parsedOutput),
5642
- message: undefined,
5643
- };
4203
+ const contents = {};
5644
4204
  const data = parsedOutput.body;
5645
4205
  if (data.message !== undefined && data.message !== null) {
5646
4206
  contents.message = smithy_client_1.expectString(data.message);
5647
4207
  }
5648
- return contents;
4208
+ const exception = new models_0_1.LimitExceededException({
4209
+ $metadata: deserializeMetadata(parsedOutput),
4210
+ ...contents,
4211
+ });
4212
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
5649
4213
  };
5650
4214
  const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, context) => {
5651
- const contents = {
5652
- name: "NotFoundException",
5653
- $fault: "client",
5654
- $metadata: deserializeMetadata(parsedOutput),
5655
- message: undefined,
5656
- };
4215
+ const contents = {};
5657
4216
  const data = parsedOutput.body;
5658
4217
  if (data.message !== undefined && data.message !== null) {
5659
4218
  contents.message = smithy_client_1.expectString(data.message);
5660
4219
  }
5661
- return contents;
4220
+ const exception = new models_0_1.NotFoundException({
4221
+ $metadata: deserializeMetadata(parsedOutput),
4222
+ ...contents,
4223
+ });
4224
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
5662
4225
  };
5663
4226
  const deserializeAws_restJson1UnauthorizedExceptionResponse = async (parsedOutput, context) => {
5664
- const contents = {
5665
- name: "UnauthorizedException",
5666
- $fault: "client",
5667
- $metadata: deserializeMetadata(parsedOutput),
5668
- message: undefined,
5669
- };
4227
+ const contents = {};
5670
4228
  const data = parsedOutput.body;
5671
4229
  if (data.message !== undefined && data.message !== null) {
5672
4230
  contents.message = smithy_client_1.expectString(data.message);
5673
4231
  }
5674
- return contents;
4232
+ const exception = new models_0_1.UnauthorizedException({
4233
+ $metadata: deserializeMetadata(parsedOutput),
4234
+ ...contents,
4235
+ });
4236
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
5675
4237
  };
5676
4238
  const serializeAws_restJson1AdditionalAuthenticationProvider = (input, context) => {
5677
4239
  return {
@@ -5912,7 +4474,7 @@ const deserializeAws_restJson1AdditionalAuthenticationProvider = (output, contex
5912
4474
  };
5913
4475
  };
5914
4476
  const deserializeAws_restJson1AdditionalAuthenticationProviders = (output, context) => {
5915
- return (output || [])
4477
+ const retVal = (output || [])
5916
4478
  .filter((e) => e != null)
5917
4479
  .map((entry) => {
5918
4480
  if (entry === null) {
@@ -5920,6 +4482,7 @@ const deserializeAws_restJson1AdditionalAuthenticationProviders = (output, conte
5920
4482
  }
5921
4483
  return deserializeAws_restJson1AdditionalAuthenticationProvider(entry, context);
5922
4484
  });
4485
+ return retVal;
5923
4486
  };
5924
4487
  const deserializeAws_restJson1ApiAssociation = (output, context) => {
5925
4488
  return {
@@ -5948,7 +4511,7 @@ const deserializeAws_restJson1ApiKey = (output, context) => {
5948
4511
  };
5949
4512
  };
5950
4513
  const deserializeAws_restJson1ApiKeys = (output, context) => {
5951
- return (output || [])
4514
+ const retVal = (output || [])
5952
4515
  .filter((e) => e != null)
5953
4516
  .map((entry) => {
5954
4517
  if (entry === null) {
@@ -5956,6 +4519,7 @@ const deserializeAws_restJson1ApiKeys = (output, context) => {
5956
4519
  }
5957
4520
  return deserializeAws_restJson1ApiKey(entry, context);
5958
4521
  });
4522
+ return retVal;
5959
4523
  };
5960
4524
  const deserializeAws_restJson1AuthorizationConfig = (output, context) => {
5961
4525
  return {
@@ -5980,7 +4544,7 @@ const deserializeAws_restJson1CachingConfig = (output, context) => {
5980
4544
  };
5981
4545
  };
5982
4546
  const deserializeAws_restJson1CachingKeys = (output, context) => {
5983
- return (output || [])
4547
+ const retVal = (output || [])
5984
4548
  .filter((e) => e != null)
5985
4549
  .map((entry) => {
5986
4550
  if (entry === null) {
@@ -5988,6 +4552,7 @@ const deserializeAws_restJson1CachingKeys = (output, context) => {
5988
4552
  }
5989
4553
  return smithy_client_1.expectString(entry);
5990
4554
  });
4555
+ return retVal;
5991
4556
  };
5992
4557
  const deserializeAws_restJson1CognitoUserPoolConfig = (output, context) => {
5993
4558
  return {
@@ -6024,7 +4589,7 @@ const deserializeAws_restJson1DataSource = (output, context) => {
6024
4589
  };
6025
4590
  };
6026
4591
  const deserializeAws_restJson1DataSources = (output, context) => {
6027
- return (output || [])
4592
+ const retVal = (output || [])
6028
4593
  .filter((e) => e != null)
6029
4594
  .map((entry) => {
6030
4595
  if (entry === null) {
@@ -6032,6 +4597,7 @@ const deserializeAws_restJson1DataSources = (output, context) => {
6032
4597
  }
6033
4598
  return deserializeAws_restJson1DataSource(entry, context);
6034
4599
  });
4600
+ return retVal;
6035
4601
  };
6036
4602
  const deserializeAws_restJson1DeltaSyncConfig = (output, context) => {
6037
4603
  return {
@@ -6050,7 +4616,7 @@ const deserializeAws_restJson1DomainNameConfig = (output, context) => {
6050
4616
  };
6051
4617
  };
6052
4618
  const deserializeAws_restJson1DomainNameConfigs = (output, context) => {
6053
- return (output || [])
4619
+ const retVal = (output || [])
6054
4620
  .filter((e) => e != null)
6055
4621
  .map((entry) => {
6056
4622
  if (entry === null) {
@@ -6058,6 +4624,7 @@ const deserializeAws_restJson1DomainNameConfigs = (output, context) => {
6058
4624
  }
6059
4625
  return deserializeAws_restJson1DomainNameConfig(entry, context);
6060
4626
  });
4627
+ return retVal;
6061
4628
  };
6062
4629
  const deserializeAws_restJson1DynamodbDataSourceConfig = (output, context) => {
6063
4630
  return {
@@ -6093,7 +4660,7 @@ const deserializeAws_restJson1FunctionConfiguration = (output, context) => {
6093
4660
  };
6094
4661
  };
6095
4662
  const deserializeAws_restJson1Functions = (output, context) => {
6096
- return (output || [])
4663
+ const retVal = (output || [])
6097
4664
  .filter((e) => e != null)
6098
4665
  .map((entry) => {
6099
4666
  if (entry === null) {
@@ -6101,9 +4668,10 @@ const deserializeAws_restJson1Functions = (output, context) => {
6101
4668
  }
6102
4669
  return deserializeAws_restJson1FunctionConfiguration(entry, context);
6103
4670
  });
4671
+ return retVal;
6104
4672
  };
6105
4673
  const deserializeAws_restJson1FunctionsIds = (output, context) => {
6106
- return (output || [])
4674
+ const retVal = (output || [])
6107
4675
  .filter((e) => e != null)
6108
4676
  .map((entry) => {
6109
4677
  if (entry === null) {
@@ -6111,6 +4679,7 @@ const deserializeAws_restJson1FunctionsIds = (output, context) => {
6111
4679
  }
6112
4680
  return smithy_client_1.expectString(entry);
6113
4681
  });
4682
+ return retVal;
6114
4683
  };
6115
4684
  const deserializeAws_restJson1GraphqlApi = (output, context) => {
6116
4685
  return {
@@ -6144,7 +4713,7 @@ const deserializeAws_restJson1GraphqlApi = (output, context) => {
6144
4713
  };
6145
4714
  };
6146
4715
  const deserializeAws_restJson1GraphqlApis = (output, context) => {
6147
- return (output || [])
4716
+ const retVal = (output || [])
6148
4717
  .filter((e) => e != null)
6149
4718
  .map((entry) => {
6150
4719
  if (entry === null) {
@@ -6152,6 +4721,7 @@ const deserializeAws_restJson1GraphqlApis = (output, context) => {
6152
4721
  }
6153
4722
  return deserializeAws_restJson1GraphqlApi(entry, context);
6154
4723
  });
4724
+ return retVal;
6155
4725
  };
6156
4726
  const deserializeAws_restJson1HttpDataSourceConfig = (output, context) => {
6157
4727
  return {
@@ -6256,7 +4826,7 @@ const deserializeAws_restJson1Resolver = (output, context) => {
6256
4826
  };
6257
4827
  };
6258
4828
  const deserializeAws_restJson1Resolvers = (output, context) => {
6259
- return (output || [])
4829
+ const retVal = (output || [])
6260
4830
  .filter((e) => e != null)
6261
4831
  .map((entry) => {
6262
4832
  if (entry === null) {
@@ -6264,6 +4834,7 @@ const deserializeAws_restJson1Resolvers = (output, context) => {
6264
4834
  }
6265
4835
  return deserializeAws_restJson1Resolver(entry, context);
6266
4836
  });
4837
+ return retVal;
6267
4838
  };
6268
4839
  const deserializeAws_restJson1SyncConfig = (output, context) => {
6269
4840
  return {
@@ -6295,7 +4866,7 @@ const deserializeAws_restJson1Type = (output, context) => {
6295
4866
  };
6296
4867
  };
6297
4868
  const deserializeAws_restJson1TypeList = (output, context) => {
6298
- return (output || [])
4869
+ const retVal = (output || [])
6299
4870
  .filter((e) => e != null)
6300
4871
  .map((entry) => {
6301
4872
  if (entry === null) {
@@ -6303,6 +4874,7 @@ const deserializeAws_restJson1TypeList = (output, context) => {
6303
4874
  }
6304
4875
  return deserializeAws_restJson1Type(entry, context);
6305
4876
  });
4877
+ return retVal;
6306
4878
  };
6307
4879
  const deserializeAws_restJson1UserPoolConfig = (output, context) => {
6308
4880
  return {