;\n}\n\n// Replacing to fix typings\n// export interface OAuth {\n// awsCognito?: awsCognitoOAuthOpts,\n// auth0?: any\n// }\n\nexport type OAuthOpts = AwsCognitoOAuthOpts | Auth0OAuthOpts;\n\nexport interface ConfirmSignUpOptions {\n\tforceAliasCreation?: boolean;\n\tclientMetadata?: ClientMetaData;\n}\n\nexport interface SignOutOpts {\n\tglobal?: boolean;\n}\n\nexport interface CurrentUserOpts {\n\tbypassCache: boolean;\n}\n\nexport interface GetPreferredMFAOpts {\n\tbypassCache: boolean;\n}\n\nexport type UsernamePasswordOpts = {\n\tusername: string;\n\tpassword: string;\n\tvalidationData?: { [key: string]: any };\n};\n\nexport enum AuthErrorTypes {\n\tNoConfig = 'noConfig',\n\tMissingAuthConfig = 'missingAuthConfig',\n\tEmptyUsername = 'emptyUsername',\n\tInvalidUsername = 'invalidUsername',\n\tEmptyPassword = 'emptyPassword',\n\tEmptyCode = 'emptyCode',\n\tSignUpError = 'signUpError',\n\tNoMFA = 'noMFA',\n\tInvalidMFA = 'invalidMFA',\n\tEmptyChallengeResponse = 'emptyChallengeResponse',\n\tNoUserSession = 'noUserSession',\n\tDefault = 'default',\n\tDeviceConfig = 'deviceConfig',\n\tNetworkError = 'networkError',\n\tAutoSignInError = 'autoSignInError',\n}\n\nexport type AuthErrorMessages = { [key in AuthErrorTypes]: AuthErrorMessage };\n\nexport interface AuthErrorMessage {\n\tmessage: string;\n\tlog?: string;\n}\n\n// We can extend this in the future if needed\nexport type SignInOpts = UsernamePasswordOpts;\n\nexport type ClientMetaData =\n\t| {\n\t\t\t[key: string]: string;\n\t }\n\t| undefined;\n\nexport function isUsernamePasswordOpts(obj: any): obj is UsernamePasswordOpts {\n\treturn !!(obj as UsernamePasswordOpts).username;\n}\n\nexport interface IAuthDevice {\n\tid: string;\n\tname: string;\n}\n\nexport interface AutoSignInOptions {\n\tenabled: boolean;\n\tclientMetaData?: ClientMetaData;\n\tvalidationData?: { [key: string]: any };\n}\n\nexport enum GRAPHQL_AUTH_MODE {\n\tAPI_KEY = 'API_KEY',\n\tAWS_IAM = 'AWS_IAM',\n\tOPENID_CONNECT = 'OPENID_CONNECT',\n\tAMAZON_COGNITO_USER_POOLS = 'AMAZON_COGNITO_USER_POOLS',\n\tAWS_LAMBDA = 'AWS_LAMBDA',\n}\n","import { ConsoleLogger as LoggerClass } from './Logger';\n\nconst logger = new LoggerClass('Amplify');\n\nexport class AmplifyClass {\n\t// Everything that is `register`ed is tracked here\n\tprivate _components = [];\n\tprivate _config = {};\n\n\t// All modules (with `getModuleName()`) are stored here for dependency injection\n\tprivate _modules = {};\n\n\t// for backward compatibility to avoid breaking change\n\t// if someone is using like Amplify.Auth\n\tAuth = null;\n\tAnalytics = null;\n\tAPI = null;\n\tCredentials = null;\n\tStorage = null;\n\tI18n = null;\n\tCache = null;\n\tPubSub = null;\n\tInteractions = null;\n\tPushnotification = null;\n\tUI = null;\n\tXR = null;\n\tPredictions = null;\n\tDataStore = null;\n\tGeo = null;\n\n\tLogger = LoggerClass;\n\tServiceWorker = null;\n\n\tregister(comp) {\n\t\tlogger.debug('component registered in amplify', comp);\n\t\tthis._components.push(comp);\n\t\tif (typeof comp.getModuleName === 'function') {\n\t\t\tthis._modules[comp.getModuleName()] = comp;\n\t\t\tthis[comp.getModuleName()] = comp;\n\t\t} else {\n\t\t\tlogger.debug('no getModuleName method for component', comp);\n\t\t}\n\n\t\t// Finally configure this new component(category) loaded\n\t\t// With the new modularization changes in Amplify V3, all the Amplify\n\t\t// component are not loaded/registered right away but when they are\n\t\t// imported (and hence instantiated) in the client's app. This ensures\n\t\t// that all new components imported get correctly configured with the\n\t\t// configuration that Amplify.configure() was called with.\n\t\tcomp.configure(this._config);\n\t}\n\n\tconfigure(config?) {\n\t\tif (!config) return this._config;\n\n\t\tthis._config = Object.assign(this._config, config);\n\t\tlogger.debug('amplify config', this._config);\n\n\t\t// Dependency Injection via property-setting.\n\t\t// This avoids introducing a public method/interface/setter that's difficult to remove later.\n\t\t// Plus, it reduces `if` statements within the `constructor` and `configure` of each module\n\t\tObject.entries(this._modules).forEach(([Name, comp]) => {\n\t\t\t// e.g. Auth.*\n\t\t\tObject.keys(comp).forEach(property => {\n\t\t\t\t// e.g. Auth[\"Credentials\"] = this._modules[\"Credentials\"] when set\n\t\t\t\tif (this._modules[property]) {\n\t\t\t\t\tcomp[property] = this._modules[property];\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\tthis._components.map(comp => {\n\t\t\tcomp.configure(this._config);\n\t\t});\n\n\t\treturn this._config;\n\t}\n\n\taddPluggable(pluggable) {\n\t\tif (\n\t\t\tpluggable &&\n\t\t\tpluggable['getCategory'] &&\n\t\t\ttypeof pluggable['getCategory'] === 'function'\n\t\t) {\n\t\t\tthis._components.map(comp => {\n\t\t\t\tif (\n\t\t\t\t\tcomp['addPluggable'] &&\n\t\t\t\t\ttypeof comp['addPluggable'] === 'function'\n\t\t\t\t) {\n\t\t\t\t\tcomp.addPluggable(pluggable);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n}\n\nexport const Amplify = new AmplifyClass();\n\n/**\n * @deprecated use named import\n */\nexport default Amplify;\n","/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\nimport { ConsoleLogger as Logger } from '../Logger';\nimport { browserOrNode } from '../JS';\nimport { NonRetryableError } from '../Util';\n\nconst logger = new Logger('CognitoCredentials');\n\nconst waitForInit = new Promise((res, rej) => {\n\tif (!browserOrNode().isBrowser) {\n\t\tlogger.debug('not in the browser, directly resolved');\n\t\treturn res();\n\t}\n\tconst ga =\n\t\twindow['gapi'] && window['gapi'].auth2 ? window['gapi'].auth2 : null;\n\tif (ga) {\n\t\tlogger.debug('google api already loaded');\n\t\treturn res();\n\t} else {\n\t\tsetTimeout(() => {\n\t\t\treturn res();\n\t\t}, 2000);\n\t}\n});\n\nexport class GoogleOAuth {\n\tpublic initialized = false;\n\n\tconstructor() {\n\t\tthis.refreshGoogleToken = this.refreshGoogleToken.bind(this);\n\t\tthis._refreshGoogleTokenImpl = this._refreshGoogleTokenImpl.bind(this);\n\t}\n\n\tpublic async refreshGoogleToken() {\n\t\tif (!this.initialized) {\n\t\t\tlogger.debug('need to wait for the Google SDK loaded');\n\t\t\tawait waitForInit;\n\t\t\tthis.initialized = true;\n\t\t\tlogger.debug('finish waiting');\n\t\t}\n\n\t\treturn this._refreshGoogleTokenImpl();\n\t}\n\n\tprivate _refreshGoogleTokenImpl() {\n\t\tlet ga = null;\n\t\tif (browserOrNode().isBrowser)\n\t\t\tga = window['gapi'] && window['gapi'].auth2 ? window['gapi'].auth2 : null;\n\t\tif (!ga) {\n\t\t\tlogger.debug('no gapi auth2 available');\n\t\t\treturn Promise.reject('no gapi auth2 available');\n\t\t}\n\n\t\treturn new Promise((res, rej) => {\n\t\t\tga.getAuthInstance()\n\t\t\t\t.then(googleAuth => {\n\t\t\t\t\tif (!googleAuth) {\n\t\t\t\t\t\tlogger.debug('google Auth undefined');\n\t\t\t\t\t\trej(new NonRetryableError('google Auth undefined'));\n\t\t\t\t\t}\n\n\t\t\t\t\tconst googleUser = googleAuth.currentUser.get();\n\t\t\t\t\t// refresh the token\n\t\t\t\t\tif (googleUser.isSignedIn()) {\n\t\t\t\t\t\tlogger.debug('refreshing the google access token');\n\t\t\t\t\t\tgoogleUser\n\t\t\t\t\t\t\t.reloadAuthResponse()\n\t\t\t\t\t\t\t.then(authResponse => {\n\t\t\t\t\t\t\t\tconst { id_token, expires_at } = authResponse;\n\t\t\t\t\t\t\t\tres({ token: id_token, expires_at });\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.catch(err => {\n\t\t\t\t\t\t\t\tif (err && err.error === 'network_error') {\n\t\t\t\t\t\t\t\t\t// Not using NonRetryableError so handler will be retried\n\t\t\t\t\t\t\t\t\trej('Network error reloading google auth response');\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trej(\n\t\t\t\t\t\t\t\t\t\tnew NonRetryableError(\n\t\t\t\t\t\t\t\t\t\t\t'Failed to reload google auth response'\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\trej(new NonRetryableError('User is not signed in with Google'));\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tlogger.debug('Failed to refresh google token', err);\n\t\t\t\t\trej(new NonRetryableError('Failed to refresh google token'));\n\t\t\t\t});\n\t\t});\n\t}\n}\n\n/**\n * @deprecated use named import\n */\nexport default GoogleOAuth;\n","/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\nimport { ConsoleLogger as Logger } from '../Logger';\nimport { browserOrNode } from '../JS';\nimport { NonRetryableError } from '../Util';\n\nconst logger = new Logger('CognitoCredentials');\n\nconst waitForInit = new Promise((res, rej) => {\n\tif (!browserOrNode().isBrowser) {\n\t\tlogger.debug('not in the browser, directly resolved');\n\t\treturn res();\n\t}\n\tconst fb = window['FB'];\n\tif (fb) {\n\t\tlogger.debug('FB SDK already loaded');\n\t\treturn res();\n\t} else {\n\t\tsetTimeout(() => {\n\t\t\treturn res();\n\t\t}, 2000);\n\t}\n});\n\nexport class FacebookOAuth {\n\tpublic initialized = false;\n\n\tconstructor() {\n\t\tthis.refreshFacebookToken = this.refreshFacebookToken.bind(this);\n\t\tthis._refreshFacebookTokenImpl = this._refreshFacebookTokenImpl.bind(this);\n\t}\n\n\tpublic async refreshFacebookToken() {\n\t\tif (!this.initialized) {\n\t\t\tlogger.debug('need to wait for the Facebook SDK loaded');\n\t\t\tawait waitForInit;\n\t\t\tthis.initialized = true;\n\t\t\tlogger.debug('finish waiting');\n\t\t}\n\n\t\treturn this._refreshFacebookTokenImpl();\n\t}\n\n\tprivate _refreshFacebookTokenImpl() {\n\t\tlet fb = null;\n\t\tif (browserOrNode().isBrowser) fb = window['FB'];\n\t\tif (!fb) {\n\t\t\tconst errorMessage = 'no fb sdk available';\n\t\t\tlogger.debug(errorMessage);\n\t\t\treturn Promise.reject(new NonRetryableError(errorMessage));\n\t\t}\n\n\t\treturn new Promise((res, rej) => {\n\t\t\tfb.getLoginStatus(\n\t\t\t\tfbResponse => {\n\t\t\t\t\tif (!fbResponse || !fbResponse.authResponse) {\n\t\t\t\t\t\tconst errorMessage =\n\t\t\t\t\t\t\t'no response from facebook when refreshing the jwt token';\n\t\t\t\t\t\tlogger.debug(errorMessage);\n\t\t\t\t\t\t// There is no definitive indication for a network error in\n\t\t\t\t\t\t// fbResponse, so we are treating it as an invalid token.\n\t\t\t\t\t\trej(new NonRetryableError(errorMessage));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst response = fbResponse.authResponse;\n\t\t\t\t\t\tconst { accessToken, expiresIn } = response;\n\t\t\t\t\t\tconst date = new Date();\n\t\t\t\t\t\tconst expires_at = expiresIn * 1000 + date.getTime();\n\t\t\t\t\t\tif (!accessToken) {\n\t\t\t\t\t\t\tconst errorMessage = 'the jwtToken is undefined';\n\t\t\t\t\t\t\tlogger.debug(errorMessage);\n\t\t\t\t\t\t\trej(new NonRetryableError(errorMessage));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tres({\n\t\t\t\t\t\t\ttoken: accessToken,\n\t\t\t\t\t\t\texpires_at,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ scope: 'public_profile,email' }\n\t\t\t);\n\t\t});\n\t}\n}\n\n/**\n * @deprecated use named import\n */\nexport default FacebookOAuth;\n","/*\n * Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\nimport { GoogleOAuth as GoogleOAuthClass } from './GoogleOAuth';\nimport { FacebookOAuth as FacebookOAuthClass } from './FacebookOAuth';\n\nexport const GoogleOAuth = new GoogleOAuthClass();\nexport const FacebookOAuth = new FacebookOAuthClass();\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { SmithyException as __SmithyException } from \"@aws-sdk/smithy-client\";\nimport { MetadataBearer as $MetadataBearer } from \"@aws-sdk/types\";\n\nexport enum AmbiguousRoleResolutionType {\n AUTHENTICATED_ROLE = \"AuthenticatedRole\",\n DENY = \"Deny\",\n}\n\n/**\n * A provider representing an Amazon Cognito user pool and its client ID.
\n */\nexport interface CognitoIdentityProvider {\n /**\n * The provider name for an Amazon Cognito user pool. For example,\n * cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789
.
\n */\n ProviderName?: string;\n\n /**\n * The client ID for the Amazon Cognito user pool.
\n */\n ClientId?: string;\n\n /**\n * TRUE if server-side token validation is enabled for the identity provider’s\n * token.
\n * Once you set ServerSideTokenCheck
to TRUE for an identity pool, that\n * identity pool will check with the integrated user pools to make sure that the user has not\n * been globally signed out or deleted before the identity pool provides an OIDC token or AWS\n * credentials for the user.
\n * If the user is signed out or deleted, the identity pool will return a 400 Not\n * Authorized error.
\n */\n ServerSideTokenCheck?: boolean;\n}\n\nexport namespace CognitoIdentityProvider {\n export const filterSensitiveLog = (obj: CognitoIdentityProvider): any => ({\n ...obj,\n });\n}\n\n/**\n * Input to the CreateIdentityPool action.
\n */\nexport interface CreateIdentityPoolInput {\n /**\n * A string that you provide.
\n */\n IdentityPoolName: string | undefined;\n\n /**\n * TRUE if the identity pool supports unauthenticated logins.
\n */\n AllowUnauthenticatedIdentities: boolean | undefined;\n\n /**\n * Enables or disables the Basic (Classic) authentication flow. For more information, see\n * Identity Pools (Federated Identities) Authentication Flow in the Amazon Cognito Developer Guide.
\n */\n AllowClassicFlow?: boolean;\n\n /**\n * Optional key:value pairs mapping provider names to provider app IDs.
\n */\n SupportedLoginProviders?: { [key: string]: string };\n\n /**\n * The \"domain\" by which Cognito will refer to your users. This name acts as a\n * placeholder that allows your backend and the Cognito service to communicate about the\n * developer provider. For the DeveloperProviderName
, you can use letters as well\n * as period (.
), underscore (_
), and dash\n * (-
).
\n * Once you have set a developer provider name, you cannot change it. Please take care\n * in setting this parameter.
\n */\n DeveloperProviderName?: string;\n\n /**\n * A list of OpendID Connect provider ARNs.
\n */\n OpenIdConnectProviderARNs?: string[];\n\n /**\n * An array of Amazon Cognito user pools and their client IDs.
\n */\n CognitoIdentityProviders?: CognitoIdentityProvider[];\n\n /**\n * An array of Amazon Resource Names (ARNs) of the SAML provider for your identity\n * pool.
\n */\n SamlProviderARNs?: string[];\n\n /**\n * Tags to assign to the identity pool. A tag is a label that you can apply to identity\n * pools to categorize and manage them in different ways, such as by purpose, owner,\n * environment, or other criteria.
\n */\n IdentityPoolTags?: { [key: string]: string };\n}\n\nexport namespace CreateIdentityPoolInput {\n export const filterSensitiveLog = (obj: CreateIdentityPoolInput): any => ({\n ...obj,\n });\n}\n\n/**\n * An object representing an Amazon Cognito identity pool.
\n */\nexport interface IdentityPool {\n /**\n * An identity pool ID in the format REGION:GUID.
\n */\n IdentityPoolId: string | undefined;\n\n /**\n * A string that you provide.
\n */\n IdentityPoolName: string | undefined;\n\n /**\n * TRUE if the identity pool supports unauthenticated logins.
\n */\n AllowUnauthenticatedIdentities: boolean | undefined;\n\n /**\n * Enables or disables the Basic (Classic) authentication flow. For more information, see\n * Identity Pools (Federated Identities) Authentication Flow in the Amazon Cognito Developer Guide.
\n */\n AllowClassicFlow?: boolean;\n\n /**\n * Optional key:value pairs mapping provider names to provider app IDs.
\n */\n SupportedLoginProviders?: { [key: string]: string };\n\n /**\n * The \"domain\" by which Cognito will refer to your users.
\n */\n DeveloperProviderName?: string;\n\n /**\n * A list of OpendID Connect provider ARNs.
\n */\n OpenIdConnectProviderARNs?: string[];\n\n /**\n * A list representing an Amazon Cognito user pool and its client ID.
\n */\n CognitoIdentityProviders?: CognitoIdentityProvider[];\n\n /**\n * An array of Amazon Resource Names (ARNs) of the SAML provider for your identity\n * pool.
\n */\n SamlProviderARNs?: string[];\n\n /**\n * The tags that are assigned to the identity pool. A tag is a label that you can apply to\n * identity pools to categorize and manage them in different ways, such as by purpose, owner,\n * environment, or other criteria.
\n */\n IdentityPoolTags?: { [key: string]: string };\n}\n\nexport namespace IdentityPool {\n export const filterSensitiveLog = (obj: IdentityPool): any => ({\n ...obj,\n });\n}\n\n/**\n * Thrown when the service encounters an error during processing the request.
\n */\nexport interface InternalErrorException extends __SmithyException, $MetadataBearer {\n name: \"InternalErrorException\";\n $fault: \"server\";\n /**\n * The message returned by an InternalErrorException.
\n */\n message?: string;\n}\n\nexport namespace InternalErrorException {\n export const filterSensitiveLog = (obj: InternalErrorException): any => ({\n ...obj,\n });\n}\n\n/**\n * Thrown for missing or bad input parameter(s).
\n */\nexport interface InvalidParameterException extends __SmithyException, $MetadataBearer {\n name: \"InvalidParameterException\";\n $fault: \"client\";\n /**\n * The message returned by an InvalidParameterException.
\n */\n message?: string;\n}\n\nexport namespace InvalidParameterException {\n export const filterSensitiveLog = (obj: InvalidParameterException): any => ({\n ...obj,\n });\n}\n\n/**\n * Thrown when the total number of user pools has exceeded a preset limit.
\n */\nexport interface LimitExceededException extends __SmithyException, $MetadataBearer {\n name: \"LimitExceededException\";\n $fault: \"client\";\n /**\n * The message returned by a LimitExceededException.
\n */\n message?: string;\n}\n\nexport namespace LimitExceededException {\n export const filterSensitiveLog = (obj: LimitExceededException): any => ({\n ...obj,\n });\n}\n\n/**\n * Thrown when a user is not authorized to access the requested resource.
\n */\nexport interface NotAuthorizedException extends __SmithyException, $MetadataBearer {\n name: \"NotAuthorizedException\";\n $fault: \"client\";\n /**\n * The message returned by a NotAuthorizedException
\n */\n message?: string;\n}\n\nexport namespace NotAuthorizedException {\n export const filterSensitiveLog = (obj: NotAuthorizedException): any => ({\n ...obj,\n });\n}\n\n/**\n * Thrown when a user tries to use a login which is already linked to another\n * account.
\n */\nexport interface ResourceConflictException extends __SmithyException, $MetadataBearer {\n name: \"ResourceConflictException\";\n $fault: \"client\";\n /**\n * The message returned by a ResourceConflictException.
\n */\n message?: string;\n}\n\nexport namespace ResourceConflictException {\n export const filterSensitiveLog = (obj: ResourceConflictException): any => ({\n ...obj,\n });\n}\n\n/**\n * Thrown when a request is throttled.
\n */\nexport interface TooManyRequestsException extends __SmithyException, $MetadataBearer {\n name: \"TooManyRequestsException\";\n $fault: \"client\";\n /**\n * Message returned by a TooManyRequestsException
\n */\n message?: string;\n}\n\nexport namespace TooManyRequestsException {\n export const filterSensitiveLog = (obj: TooManyRequestsException): any => ({\n ...obj,\n });\n}\n\n/**\n * Input to the DeleteIdentities
action.
\n */\nexport interface DeleteIdentitiesInput {\n /**\n * A list of 1-60 identities that you want to delete.
\n */\n IdentityIdsToDelete: string[] | undefined;\n}\n\nexport namespace DeleteIdentitiesInput {\n export const filterSensitiveLog = (obj: DeleteIdentitiesInput): any => ({\n ...obj,\n });\n}\n\nexport enum ErrorCode {\n ACCESS_DENIED = \"AccessDenied\",\n INTERNAL_SERVER_ERROR = \"InternalServerError\",\n}\n\n/**\n * An array of UnprocessedIdentityId objects, each of which contains an ErrorCode and\n * IdentityId.
\n */\nexport interface UnprocessedIdentityId {\n /**\n * A unique identifier in the format REGION:GUID.
\n */\n IdentityId?: string;\n\n /**\n * The error code indicating the type of error that occurred.
\n */\n ErrorCode?: ErrorCode | string;\n}\n\nexport namespace UnprocessedIdentityId {\n export const filterSensitiveLog = (obj: UnprocessedIdentityId): any => ({\n ...obj,\n });\n}\n\n/**\n * Returned in response to a successful DeleteIdentities
\n * operation.
\n */\nexport interface DeleteIdentitiesResponse {\n /**\n * An array of UnprocessedIdentityId objects, each of which contains an ErrorCode and\n * IdentityId.
\n */\n UnprocessedIdentityIds?: UnprocessedIdentityId[];\n}\n\nexport namespace DeleteIdentitiesResponse {\n export const filterSensitiveLog = (obj: DeleteIdentitiesResponse): any => ({\n ...obj,\n });\n}\n\n/**\n * Input to the DeleteIdentityPool action.
\n */\nexport interface DeleteIdentityPoolInput {\n /**\n * An identity pool ID in the format REGION:GUID.
\n */\n IdentityPoolId: string | undefined;\n}\n\nexport namespace DeleteIdentityPoolInput {\n export const filterSensitiveLog = (obj: DeleteIdentityPoolInput): any => ({\n ...obj,\n });\n}\n\n/**\n * Thrown when the requested resource (for example, a dataset or record) does not\n * exist.
\n */\nexport interface ResourceNotFoundException extends __SmithyException, $MetadataBearer {\n name: \"ResourceNotFoundException\";\n $fault: \"client\";\n /**\n * The message returned by a ResourceNotFoundException.
\n */\n message?: string;\n}\n\nexport namespace ResourceNotFoundException {\n export const filterSensitiveLog = (obj: ResourceNotFoundException): any => ({\n ...obj,\n });\n}\n\n/**\n * Input to the DescribeIdentity
action.
\n */\nexport interface DescribeIdentityInput {\n /**\n * A unique identifier in the format REGION:GUID.
\n */\n IdentityId: string | undefined;\n}\n\nexport namespace DescribeIdentityInput {\n export const filterSensitiveLog = (obj: DescribeIdentityInput): any => ({\n ...obj,\n });\n}\n\n/**\n * A description of the identity.
\n */\nexport interface IdentityDescription {\n /**\n * A unique identifier in the format REGION:GUID.
\n */\n IdentityId?: string;\n\n /**\n * The provider names.
\n */\n Logins?: string[];\n\n /**\n * Date on which the identity was created.
\n */\n CreationDate?: Date;\n\n /**\n * Date on which the identity was last modified.
\n */\n LastModifiedDate?: Date;\n}\n\nexport namespace IdentityDescription {\n export const filterSensitiveLog = (obj: IdentityDescription): any => ({\n ...obj,\n });\n}\n\n/**\n * Input to the DescribeIdentityPool action.
\n */\nexport interface DescribeIdentityPoolInput {\n /**\n * An identity pool ID in the format REGION:GUID.
\n */\n IdentityPoolId: string | undefined;\n}\n\nexport namespace DescribeIdentityPoolInput {\n export const filterSensitiveLog = (obj: DescribeIdentityPoolInput): any => ({\n ...obj,\n });\n}\n\n/**\n * An exception thrown when a dependent service such as Facebook or Twitter is not\n * responding
\n */\nexport interface ExternalServiceException extends __SmithyException, $MetadataBearer {\n name: \"ExternalServiceException\";\n $fault: \"client\";\n /**\n * The message returned by an ExternalServiceException
\n */\n message?: string;\n}\n\nexport namespace ExternalServiceException {\n export const filterSensitiveLog = (obj: ExternalServiceException): any => ({\n ...obj,\n });\n}\n\n/**\n * Input to the GetCredentialsForIdentity
action.
\n */\nexport interface GetCredentialsForIdentityInput {\n /**\n * A unique identifier in the format REGION:GUID.
\n */\n IdentityId: string | undefined;\n\n /**\n * A set of optional name-value pairs that map provider names to provider tokens. The\n * name-value pair will follow the syntax \"provider_name\":\n * \"provider_user_identifier\".
\n * Logins should not be specified when trying to get credentials for an unauthenticated\n * identity.
\n * The Logins parameter is required when using identities associated with external\n * identity providers such as FaceBook. For examples of Logins
maps, see the code\n * examples in the External Identity Providers section of the Amazon Cognito Developer\n * Guide.
\n */\n Logins?: { [key: string]: string };\n\n /**\n * The Amazon Resource Name (ARN) of the role to be assumed when multiple roles were\n * received in the token from the identity provider. For example, a SAML-based identity\n * provider. This parameter is optional for identity providers that do not support role\n * customization.
\n */\n CustomRoleArn?: string;\n}\n\nexport namespace GetCredentialsForIdentityInput {\n export const filterSensitiveLog = (obj: GetCredentialsForIdentityInput): any => ({\n ...obj,\n });\n}\n\n/**\n * Credentials for the provided identity ID.
\n */\nexport interface Credentials {\n /**\n * The Access Key portion of the credentials.
\n */\n AccessKeyId?: string;\n\n /**\n * The Secret Access Key portion of the credentials
\n */\n SecretKey?: string;\n\n /**\n * The Session Token portion of the credentials
\n */\n SessionToken?: string;\n\n /**\n * The date at which these credentials will expire.
\n */\n Expiration?: Date;\n}\n\nexport namespace Credentials {\n export const filterSensitiveLog = (obj: Credentials): any => ({\n ...obj,\n });\n}\n\n/**\n * Returned in response to a successful GetCredentialsForIdentity
\n * operation.
\n */\nexport interface GetCredentialsForIdentityResponse {\n /**\n * A unique identifier in the format REGION:GUID.
\n */\n IdentityId?: string;\n\n /**\n * Credentials for the provided identity ID.
\n */\n Credentials?: Credentials;\n}\n\nexport namespace GetCredentialsForIdentityResponse {\n export const filterSensitiveLog = (obj: GetCredentialsForIdentityResponse): any => ({\n ...obj,\n });\n}\n\n/**\n * Thrown if the identity pool has no role associated for the given auth type\n * (auth/unauth) or if the AssumeRole fails.
\n */\nexport interface InvalidIdentityPoolConfigurationException extends __SmithyException, $MetadataBearer {\n name: \"InvalidIdentityPoolConfigurationException\";\n $fault: \"client\";\n /**\n * The message returned for an InvalidIdentityPoolConfigurationException
\n *
\n */\n message?: string;\n}\n\nexport namespace InvalidIdentityPoolConfigurationException {\n export const filterSensitiveLog = (obj: InvalidIdentityPoolConfigurationException): any => ({\n ...obj,\n });\n}\n\n/**\n * Input to the GetId action.
\n */\nexport interface GetIdInput {\n /**\n * A standard AWS account ID (9+ digits).
\n */\n AccountId?: string;\n\n /**\n * An identity pool ID in the format REGION:GUID.
\n */\n IdentityPoolId: string | undefined;\n\n /**\n * A set of optional name-value pairs that map provider names to provider tokens. The\n * available provider names for Logins
are as follows:
\n * \n * - \n *
Facebook: graph.facebook.com
\n *
\n * \n * - \n *
Amazon Cognito user pool:\n * cognito-idp..amazonaws.com/
,\n * for example, cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789
.\n *
\n * \n * - \n *
Google: accounts.google.com
\n *
\n * \n * - \n *
Amazon: www.amazon.com
\n *
\n * \n * - \n *
Twitter: api.twitter.com
\n *
\n * \n * - \n *
Digits: www.digits.com
\n *
\n * \n *
\n */\n Logins?: { [key: string]: string };\n}\n\nexport namespace GetIdInput {\n export const filterSensitiveLog = (obj: GetIdInput): any => ({\n ...obj,\n });\n}\n\n/**\n * Returned in response to a GetId request.
\n */\nexport interface GetIdResponse {\n /**\n * A unique identifier in the format REGION:GUID.
\n */\n IdentityId?: string;\n}\n\nexport namespace GetIdResponse {\n export const filterSensitiveLog = (obj: GetIdResponse): any => ({\n ...obj,\n });\n}\n\n/**\n * Input to the GetIdentityPoolRoles
action.
\n */\nexport interface GetIdentityPoolRolesInput {\n /**\n * An identity pool ID in the format REGION:GUID.
\n */\n IdentityPoolId: string | undefined;\n}\n\nexport namespace GetIdentityPoolRolesInput {\n export const filterSensitiveLog = (obj: GetIdentityPoolRolesInput): any => ({\n ...obj,\n });\n}\n\nexport enum MappingRuleMatchType {\n CONTAINS = \"Contains\",\n EQUALS = \"Equals\",\n NOT_EQUAL = \"NotEqual\",\n STARTS_WITH = \"StartsWith\",\n}\n\n/**\n * A rule that maps a claim name, a claim value, and a match type to a role\n * ARN.
\n */\nexport interface MappingRule {\n /**\n * The claim name that must be present in the token, for example, \"isAdmin\" or\n * \"paid\".
\n */\n Claim: string | undefined;\n\n /**\n * The match condition that specifies how closely the claim value in the IdP token must\n * match Value
.
\n */\n MatchType: MappingRuleMatchType | string | undefined;\n\n /**\n * A brief string that the claim must match, for example, \"paid\" or \"yes\".
\n */\n Value: string | undefined;\n\n /**\n * The role ARN.
\n */\n RoleARN: string | undefined;\n}\n\nexport namespace MappingRule {\n export const filterSensitiveLog = (obj: MappingRule): any => ({\n ...obj,\n });\n}\n\n/**\n * A container for rules.
\n */\nexport interface RulesConfigurationType {\n /**\n * An array of rules. You can specify up to 25 rules per identity provider.
\n * Rules are evaluated in order. The first one to match specifies the role.
\n */\n Rules: MappingRule[] | undefined;\n}\n\nexport namespace RulesConfigurationType {\n export const filterSensitiveLog = (obj: RulesConfigurationType): any => ({\n ...obj,\n });\n}\n\nexport enum RoleMappingType {\n RULES = \"Rules\",\n TOKEN = \"Token\",\n}\n\n/**\n * A role mapping.
\n */\nexport interface RoleMapping {\n /**\n * The role mapping type. Token will use cognito:roles
and\n * cognito:preferred_role
claims from the Cognito identity provider token to\n * map groups to roles. Rules will attempt to match claims from the token to map to a\n * role.
\n */\n Type: RoleMappingType | string | undefined;\n\n /**\n * If you specify Token or Rules as the Type
,\n * AmbiguousRoleResolution
is required.
\n * Specifies the action to be taken if either no rules match the claim value for the\n * Rules
type, or there is no cognito:preferred_role
claim and\n * there are multiple cognito:roles
matches for the Token
\n * type.
\n */\n AmbiguousRoleResolution?: AmbiguousRoleResolutionType | string;\n\n /**\n * The rules to be used for mapping users to roles.
\n * If you specify Rules as the role mapping type, RulesConfiguration
is\n * required.
\n */\n RulesConfiguration?: RulesConfigurationType;\n}\n\nexport namespace RoleMapping {\n export const filterSensitiveLog = (obj: RoleMapping): any => ({\n ...obj,\n });\n}\n\n/**\n * Returned in response to a successful GetIdentityPoolRoles
\n * operation.
\n */\nexport interface GetIdentityPoolRolesResponse {\n /**\n * An identity pool ID in the format REGION:GUID.
\n */\n IdentityPoolId?: string;\n\n /**\n * The map of roles associated with this pool. Currently only authenticated and\n * unauthenticated roles are supported.
\n */\n Roles?: { [key: string]: string };\n\n /**\n * How users for a specific identity provider are to mapped to roles. This is a\n * String-to-RoleMapping object map. The string identifies the identity\n * provider, for example, \"graph.facebook.com\" or\n * \"cognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id\".
\n */\n RoleMappings?: { [key: string]: RoleMapping };\n}\n\nexport namespace GetIdentityPoolRolesResponse {\n export const filterSensitiveLog = (obj: GetIdentityPoolRolesResponse): any => ({\n ...obj,\n });\n}\n\n/**\n * Input to the GetOpenIdToken action.
\n */\nexport interface GetOpenIdTokenInput {\n /**\n * A unique identifier in the format REGION:GUID.
\n */\n IdentityId: string | undefined;\n\n /**\n * A set of optional name-value pairs that map provider names to provider tokens. When\n * using graph.facebook.com and www.amazon.com, supply the access_token returned from the\n * provider's authflow. For accounts.google.com, an Amazon Cognito user pool provider, or any\n * other OpenId Connect provider, always include the id_token
.
\n */\n Logins?: { [key: string]: string };\n}\n\nexport namespace GetOpenIdTokenInput {\n export const filterSensitiveLog = (obj: GetOpenIdTokenInput): any => ({\n ...obj,\n });\n}\n\n/**\n * Returned in response to a successful GetOpenIdToken request.
\n */\nexport interface GetOpenIdTokenResponse {\n /**\n * A unique identifier in the format REGION:GUID. Note that the IdentityId returned may\n * not match the one passed on input.
\n */\n IdentityId?: string;\n\n /**\n * An OpenID token, valid for 10 minutes.
\n */\n Token?: string;\n}\n\nexport namespace GetOpenIdTokenResponse {\n export const filterSensitiveLog = (obj: GetOpenIdTokenResponse): any => ({\n ...obj,\n });\n}\n\n/**\n * The provided developer user identifier is already registered with Cognito under a\n * different identity ID.
\n */\nexport interface DeveloperUserAlreadyRegisteredException extends __SmithyException, $MetadataBearer {\n name: \"DeveloperUserAlreadyRegisteredException\";\n $fault: \"client\";\n /**\n * This developer user identifier is already registered with Cognito.
\n */\n message?: string;\n}\n\nexport namespace DeveloperUserAlreadyRegisteredException {\n export const filterSensitiveLog = (obj: DeveloperUserAlreadyRegisteredException): any => ({\n ...obj,\n });\n}\n\n/**\n * Input to the GetOpenIdTokenForDeveloperIdentity
action.
\n */\nexport interface GetOpenIdTokenForDeveloperIdentityInput {\n /**\n * An identity pool ID in the format REGION:GUID.
\n */\n IdentityPoolId: string | undefined;\n\n /**\n * A unique identifier in the format REGION:GUID.
\n */\n IdentityId?: string;\n\n /**\n * A set of optional name-value pairs that map provider names to provider tokens. Each\n * name-value pair represents a user from a public provider or developer provider. If the user\n * is from a developer provider, the name-value pair will follow the syntax\n * \"developer_provider_name\": \"developer_user_identifier\"
. The developer\n * provider is the \"domain\" by which Cognito will refer to your users; you provided this\n * domain while creating/updating the identity pool. The developer user identifier is an\n * identifier from your backend that uniquely identifies a user. When you create an identity\n * pool, you can specify the supported logins.
\n */\n Logins: { [key: string]: string } | undefined;\n\n /**\n * The expiration time of the token, in seconds. You can specify a custom expiration\n * time for the token so that you can cache it. If you don't provide an expiration time, the\n * token is valid for 15 minutes. You can exchange the token with Amazon STS for temporary AWS\n * credentials, which are valid for a maximum of one hour. The maximum token duration you can\n * set is 24 hours. You should take care in setting the expiration time for a token, as there\n * are significant security implications: an attacker could use a leaked token to access your\n * AWS resources for the token's duration.
\n * \n * Please provide for a small grace period, usually no more than 5 minutes, to account for clock skew.
\n * \n */\n TokenDuration?: number;\n}\n\nexport namespace GetOpenIdTokenForDeveloperIdentityInput {\n export const filterSensitiveLog = (obj: GetOpenIdTokenForDeveloperIdentityInput): any => ({\n ...obj,\n });\n}\n\n/**\n * Returned in response to a successful GetOpenIdTokenForDeveloperIdentity
\n * request.
\n */\nexport interface GetOpenIdTokenForDeveloperIdentityResponse {\n /**\n * A unique identifier in the format REGION:GUID.
\n */\n IdentityId?: string;\n\n /**\n * An OpenID token.
\n */\n Token?: string;\n}\n\nexport namespace GetOpenIdTokenForDeveloperIdentityResponse {\n export const filterSensitiveLog = (obj: GetOpenIdTokenForDeveloperIdentityResponse): any => ({\n ...obj,\n });\n}\n\n/**\n * Input to the ListIdentities action.
\n */\nexport interface ListIdentitiesInput {\n /**\n * An identity pool ID in the format REGION:GUID.
\n */\n IdentityPoolId: string | undefined;\n\n /**\n * The maximum number of identities to return.
\n */\n MaxResults: number | undefined;\n\n /**\n * A pagination token.
\n */\n NextToken?: string;\n\n /**\n * An optional boolean parameter that allows you to hide disabled identities. If\n * omitted, the ListIdentities API will include disabled identities in the response.
\n */\n HideDisabled?: boolean;\n}\n\nexport namespace ListIdentitiesInput {\n export const filterSensitiveLog = (obj: ListIdentitiesInput): any => ({\n ...obj,\n });\n}\n\n/**\n * The response to a ListIdentities request.
\n */\nexport interface ListIdentitiesResponse {\n /**\n * An identity pool ID in the format REGION:GUID.
\n */\n IdentityPoolId?: string;\n\n /**\n * An object containing a set of identities and associated mappings.
\n */\n Identities?: IdentityDescription[];\n\n /**\n * A pagination token.
\n */\n NextToken?: string;\n}\n\nexport namespace ListIdentitiesResponse {\n export const filterSensitiveLog = (obj: ListIdentitiesResponse): any => ({\n ...obj,\n });\n}\n\n/**\n * Input to the ListIdentityPools action.
\n */\nexport interface ListIdentityPoolsInput {\n /**\n * The maximum number of identities to return.
\n */\n MaxResults: number | undefined;\n\n /**\n * A pagination token.
\n */\n NextToken?: string;\n}\n\nexport namespace ListIdentityPoolsInput {\n export const filterSensitiveLog = (obj: ListIdentityPoolsInput): any => ({\n ...obj,\n });\n}\n\n/**\n * A description of the identity pool.
\n */\nexport interface IdentityPoolShortDescription {\n /**\n * An identity pool ID in the format REGION:GUID.
\n */\n IdentityPoolId?: string;\n\n /**\n * A string that you provide.
\n */\n IdentityPoolName?: string;\n}\n\nexport namespace IdentityPoolShortDescription {\n export const filterSensitiveLog = (obj: IdentityPoolShortDescription): any => ({\n ...obj,\n });\n}\n\n/**\n * The result of a successful ListIdentityPools action.
\n */\nexport interface ListIdentityPoolsResponse {\n /**\n * The identity pools returned by the ListIdentityPools action.
\n */\n IdentityPools?: IdentityPoolShortDescription[];\n\n /**\n * A pagination token.
\n */\n NextToken?: string;\n}\n\nexport namespace ListIdentityPoolsResponse {\n export const filterSensitiveLog = (obj: ListIdentityPoolsResponse): any => ({\n ...obj,\n });\n}\n\nexport interface ListTagsForResourceInput {\n /**\n * The Amazon Resource Name (ARN) of the identity pool that the tags are assigned\n * to.
\n */\n ResourceArn: string | undefined;\n}\n\nexport namespace ListTagsForResourceInput {\n export const filterSensitiveLog = (obj: ListTagsForResourceInput): any => ({\n ...obj,\n });\n}\n\nexport interface ListTagsForResourceResponse {\n /**\n * The tags that are assigned to the identity pool.
\n */\n Tags?: { [key: string]: string };\n}\n\nexport namespace ListTagsForResourceResponse {\n export const filterSensitiveLog = (obj: ListTagsForResourceResponse): any => ({\n ...obj,\n });\n}\n\n/**\n * Input to the LookupDeveloperIdentityInput
action.
\n */\nexport interface LookupDeveloperIdentityInput {\n /**\n * An identity pool ID in the format REGION:GUID.
\n */\n IdentityPoolId: string | undefined;\n\n /**\n * A unique identifier in the format REGION:GUID.
\n */\n IdentityId?: string;\n\n /**\n * A unique ID used by your backend authentication process to identify a user.\n * Typically, a developer identity provider would issue many developer user identifiers, in\n * keeping with the number of users.
\n */\n DeveloperUserIdentifier?: string;\n\n /**\n * The maximum number of identities to return.
\n */\n MaxResults?: number;\n\n /**\n * A pagination token. The first call you make will have NextToken
set to\n * null. After that the service will return NextToken
values as needed. For\n * example, let's say you make a request with MaxResults
set to 10, and there are\n * 20 matches in the database. The service will return a pagination token as a part of the\n * response. This token can be used to call the API again and get results starting from the\n * 11th match.
\n */\n NextToken?: string;\n}\n\nexport namespace LookupDeveloperIdentityInput {\n export const filterSensitiveLog = (obj: LookupDeveloperIdentityInput): any => ({\n ...obj,\n });\n}\n\n/**\n * Returned in response to a successful LookupDeveloperIdentity
\n * action.
\n */\nexport interface LookupDeveloperIdentityResponse {\n /**\n * A unique identifier in the format REGION:GUID.
\n */\n IdentityId?: string;\n\n /**\n * This is the list of developer user identifiers associated with an identity ID.\n * Cognito supports the association of multiple developer user identifiers with an identity\n * ID.
\n */\n DeveloperUserIdentifierList?: string[];\n\n /**\n * A pagination token. The first call you make will have NextToken
set to\n * null. After that the service will return NextToken
values as needed. For\n * example, let's say you make a request with MaxResults
set to 10, and there are\n * 20 matches in the database. The service will return a pagination token as a part of the\n * response. This token can be used to call the API again and get results starting from the\n * 11th match.
\n */\n NextToken?: string;\n}\n\nexport namespace LookupDeveloperIdentityResponse {\n export const filterSensitiveLog = (obj: LookupDeveloperIdentityResponse): any => ({\n ...obj,\n });\n}\n\n/**\n * Input to the MergeDeveloperIdentities
action.
\n */\nexport interface MergeDeveloperIdentitiesInput {\n /**\n * User identifier for the source user. The value should be a\n * DeveloperUserIdentifier
.
\n */\n SourceUserIdentifier: string | undefined;\n\n /**\n * User identifier for the destination user. The value should be a\n * DeveloperUserIdentifier
.
\n */\n DestinationUserIdentifier: string | undefined;\n\n /**\n * The \"domain\" by which Cognito will refer to your users. This is a (pseudo) domain\n * name that you provide while creating an identity pool. This name acts as a placeholder that\n * allows your backend and the Cognito service to communicate about the developer provider.\n * For the DeveloperProviderName
, you can use letters as well as period (.),\n * underscore (_), and dash (-).
\n */\n DeveloperProviderName: string | undefined;\n\n /**\n * An identity pool ID in the format REGION:GUID.
\n */\n IdentityPoolId: string | undefined;\n}\n\nexport namespace MergeDeveloperIdentitiesInput {\n export const filterSensitiveLog = (obj: MergeDeveloperIdentitiesInput): any => ({\n ...obj,\n });\n}\n\n/**\n * Returned in response to a successful MergeDeveloperIdentities
\n * action.
\n */\nexport interface MergeDeveloperIdentitiesResponse {\n /**\n * A unique identifier in the format REGION:GUID.
\n */\n IdentityId?: string;\n}\n\nexport namespace MergeDeveloperIdentitiesResponse {\n export const filterSensitiveLog = (obj: MergeDeveloperIdentitiesResponse): any => ({\n ...obj,\n });\n}\n\n/**\n * Thrown if there are parallel requests to modify a resource.
\n */\nexport interface ConcurrentModificationException extends __SmithyException, $MetadataBearer {\n name: \"ConcurrentModificationException\";\n $fault: \"client\";\n /**\n * The message returned by a ConcurrentModificationException.
\n */\n message?: string;\n}\n\nexport namespace ConcurrentModificationException {\n export const filterSensitiveLog = (obj: ConcurrentModificationException): any => ({\n ...obj,\n });\n}\n\n/**\n * Input to the SetIdentityPoolRoles
action.
\n */\nexport interface SetIdentityPoolRolesInput {\n /**\n * An identity pool ID in the format REGION:GUID.
\n */\n IdentityPoolId: string | undefined;\n\n /**\n * The map of roles associated with this pool. For a given role, the key will be either\n * \"authenticated\" or \"unauthenticated\" and the value will be the Role ARN.
\n */\n Roles: { [key: string]: string } | undefined;\n\n /**\n * How users for a specific identity provider are to mapped to roles. This is a string\n * to RoleMapping object map. The string identifies the identity provider,\n * for example, \"graph.facebook.com\" or\n * \"cognito-idp-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id\".
\n * Up to 25 rules can be specified per identity provider.
\n */\n RoleMappings?: { [key: string]: RoleMapping };\n}\n\nexport namespace SetIdentityPoolRolesInput {\n export const filterSensitiveLog = (obj: SetIdentityPoolRolesInput): any => ({\n ...obj,\n });\n}\n\nexport interface TagResourceInput {\n /**\n * The Amazon Resource Name (ARN) of the identity pool to assign the tags to.
\n */\n ResourceArn: string | undefined;\n\n /**\n * The tags to assign to the identity pool.
\n */\n Tags: { [key: string]: string } | undefined;\n}\n\nexport namespace TagResourceInput {\n export const filterSensitiveLog = (obj: TagResourceInput): any => ({\n ...obj,\n });\n}\n\nexport interface TagResourceResponse {}\n\nexport namespace TagResourceResponse {\n export const filterSensitiveLog = (obj: TagResourceResponse): any => ({\n ...obj,\n });\n}\n\n/**\n * Input to the UnlinkDeveloperIdentity
action.
\n */\nexport interface UnlinkDeveloperIdentityInput {\n /**\n * A unique identifier in the format REGION:GUID.
\n */\n IdentityId: string | undefined;\n\n /**\n * An identity pool ID in the format REGION:GUID.
\n */\n IdentityPoolId: string | undefined;\n\n /**\n * The \"domain\" by which Cognito will refer to your users.
\n */\n DeveloperProviderName: string | undefined;\n\n /**\n * A unique ID used by your backend authentication process to identify a user.
\n */\n DeveloperUserIdentifier: string | undefined;\n}\n\nexport namespace UnlinkDeveloperIdentityInput {\n export const filterSensitiveLog = (obj: UnlinkDeveloperIdentityInput): any => ({\n ...obj,\n });\n}\n\n/**\n * Input to the UnlinkIdentity action.
\n */\nexport interface UnlinkIdentityInput {\n /**\n * A unique identifier in the format REGION:GUID.
\n */\n IdentityId: string | undefined;\n\n /**\n * A set of optional name-value pairs that map provider names to provider\n * tokens.
\n */\n Logins: { [key: string]: string } | undefined;\n\n /**\n * Provider names to unlink from this identity.
\n */\n LoginsToRemove: string[] | undefined;\n}\n\nexport namespace UnlinkIdentityInput {\n export const filterSensitiveLog = (obj: UnlinkIdentityInput): any => ({\n ...obj,\n });\n}\n\nexport interface UntagResourceInput {\n /**\n * The Amazon Resource Name (ARN) of the identity pool that the tags are assigned\n * to.
\n */\n ResourceArn: string | undefined;\n\n /**\n * The keys of the tags to remove from the user pool.
\n */\n TagKeys: string[] | undefined;\n}\n\nexport namespace UntagResourceInput {\n export const filterSensitiveLog = (obj: UntagResourceInput): any => ({\n ...obj,\n });\n}\n\nexport interface UntagResourceResponse {}\n\nexport namespace UntagResourceResponse {\n export const filterSensitiveLog = (obj: UntagResourceResponse): any => ({\n ...obj,\n });\n}\n","import { CreateIdentityPoolCommandInput, CreateIdentityPoolCommandOutput } from \"../commands/CreateIdentityPoolCommand\";\nimport { DeleteIdentitiesCommandInput, DeleteIdentitiesCommandOutput } from \"../commands/DeleteIdentitiesCommand\";\nimport { DeleteIdentityPoolCommandInput, DeleteIdentityPoolCommandOutput } from \"../commands/DeleteIdentityPoolCommand\";\nimport { DescribeIdentityCommandInput, DescribeIdentityCommandOutput } from \"../commands/DescribeIdentityCommand\";\nimport {\n DescribeIdentityPoolCommandInput,\n DescribeIdentityPoolCommandOutput,\n} from \"../commands/DescribeIdentityPoolCommand\";\nimport {\n GetCredentialsForIdentityCommandInput,\n GetCredentialsForIdentityCommandOutput,\n} from \"../commands/GetCredentialsForIdentityCommand\";\nimport { GetIdCommandInput, GetIdCommandOutput } from \"../commands/GetIdCommand\";\nimport {\n GetIdentityPoolRolesCommandInput,\n GetIdentityPoolRolesCommandOutput,\n} from \"../commands/GetIdentityPoolRolesCommand\";\nimport { GetOpenIdTokenCommandInput, GetOpenIdTokenCommandOutput } from \"../commands/GetOpenIdTokenCommand\";\nimport {\n GetOpenIdTokenForDeveloperIdentityCommandInput,\n GetOpenIdTokenForDeveloperIdentityCommandOutput,\n} from \"../commands/GetOpenIdTokenForDeveloperIdentityCommand\";\nimport { ListIdentitiesCommandInput, ListIdentitiesCommandOutput } from \"../commands/ListIdentitiesCommand\";\nimport { ListIdentityPoolsCommandInput, ListIdentityPoolsCommandOutput } from \"../commands/ListIdentityPoolsCommand\";\nimport {\n ListTagsForResourceCommandInput,\n ListTagsForResourceCommandOutput,\n} from \"../commands/ListTagsForResourceCommand\";\nimport {\n LookupDeveloperIdentityCommandInput,\n LookupDeveloperIdentityCommandOutput,\n} from \"../commands/LookupDeveloperIdentityCommand\";\nimport {\n MergeDeveloperIdentitiesCommandInput,\n MergeDeveloperIdentitiesCommandOutput,\n} from \"../commands/MergeDeveloperIdentitiesCommand\";\nimport {\n SetIdentityPoolRolesCommandInput,\n SetIdentityPoolRolesCommandOutput,\n} from \"../commands/SetIdentityPoolRolesCommand\";\nimport { TagResourceCommandInput, TagResourceCommandOutput } from \"../commands/TagResourceCommand\";\nimport {\n UnlinkDeveloperIdentityCommandInput,\n UnlinkDeveloperIdentityCommandOutput,\n} from \"../commands/UnlinkDeveloperIdentityCommand\";\nimport { UnlinkIdentityCommandInput, UnlinkIdentityCommandOutput } from \"../commands/UnlinkIdentityCommand\";\nimport { UntagResourceCommandInput, UntagResourceCommandOutput } from \"../commands/UntagResourceCommand\";\nimport { UpdateIdentityPoolCommandInput, UpdateIdentityPoolCommandOutput } from \"../commands/UpdateIdentityPoolCommand\";\nimport {\n CognitoIdentityProvider,\n ConcurrentModificationException,\n CreateIdentityPoolInput,\n Credentials,\n DeleteIdentitiesInput,\n DeleteIdentitiesResponse,\n DeleteIdentityPoolInput,\n DescribeIdentityInput,\n DescribeIdentityPoolInput,\n DeveloperUserAlreadyRegisteredException,\n ExternalServiceException,\n GetCredentialsForIdentityInput,\n GetCredentialsForIdentityResponse,\n GetIdInput,\n GetIdResponse,\n GetIdentityPoolRolesInput,\n GetIdentityPoolRolesResponse,\n GetOpenIdTokenForDeveloperIdentityInput,\n GetOpenIdTokenForDeveloperIdentityResponse,\n GetOpenIdTokenInput,\n GetOpenIdTokenResponse,\n IdentityDescription,\n IdentityPool,\n IdentityPoolShortDescription,\n InternalErrorException,\n InvalidIdentityPoolConfigurationException,\n InvalidParameterException,\n LimitExceededException,\n ListIdentitiesInput,\n ListIdentitiesResponse,\n ListIdentityPoolsInput,\n ListIdentityPoolsResponse,\n ListTagsForResourceInput,\n ListTagsForResourceResponse,\n LookupDeveloperIdentityInput,\n LookupDeveloperIdentityResponse,\n MappingRule,\n MergeDeveloperIdentitiesInput,\n MergeDeveloperIdentitiesResponse,\n NotAuthorizedException,\n ResourceConflictException,\n ResourceNotFoundException,\n RoleMapping,\n RulesConfigurationType,\n SetIdentityPoolRolesInput,\n TagResourceInput,\n TagResourceResponse,\n TooManyRequestsException,\n UnlinkDeveloperIdentityInput,\n UnlinkIdentityInput,\n UnprocessedIdentityId,\n UntagResourceInput,\n UntagResourceResponse,\n} from \"../models/models_0\";\nimport { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from \"@aws-sdk/protocol-http\";\nimport { SmithyException as __SmithyException } from \"@aws-sdk/smithy-client\";\nimport {\n Endpoint as __Endpoint,\n HeaderBag as __HeaderBag,\n MetadataBearer as __MetadataBearer,\n ResponseMetadata as __ResponseMetadata,\n SerdeContext as __SerdeContext,\n} from \"@aws-sdk/types\";\n\nexport const serializeAws_json1_1CreateIdentityPoolCommand = async (\n input: CreateIdentityPoolCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.CreateIdentityPool\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1CreateIdentityPoolInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1DeleteIdentitiesCommand = async (\n input: DeleteIdentitiesCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.DeleteIdentities\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1DeleteIdentitiesInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1DeleteIdentityPoolCommand = async (\n input: DeleteIdentityPoolCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.DeleteIdentityPool\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1DeleteIdentityPoolInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1DescribeIdentityCommand = async (\n input: DescribeIdentityCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.DescribeIdentity\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1DescribeIdentityInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1DescribeIdentityPoolCommand = async (\n input: DescribeIdentityPoolCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.DescribeIdentityPool\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1DescribeIdentityPoolInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1GetCredentialsForIdentityCommand = async (\n input: GetCredentialsForIdentityCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.GetCredentialsForIdentity\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1GetCredentialsForIdentityInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1GetIdCommand = async (\n input: GetIdCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.GetId\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1GetIdInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1GetIdentityPoolRolesCommand = async (\n input: GetIdentityPoolRolesCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.GetIdentityPoolRoles\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1GetIdentityPoolRolesInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1GetOpenIdTokenCommand = async (\n input: GetOpenIdTokenCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.GetOpenIdToken\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1GetOpenIdTokenInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand = async (\n input: GetOpenIdTokenForDeveloperIdentityCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.GetOpenIdTokenForDeveloperIdentity\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1ListIdentitiesCommand = async (\n input: ListIdentitiesCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.ListIdentities\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1ListIdentitiesInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1ListIdentityPoolsCommand = async (\n input: ListIdentityPoolsCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.ListIdentityPools\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1ListIdentityPoolsInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1ListTagsForResourceCommand = async (\n input: ListTagsForResourceCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.ListTagsForResource\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1ListTagsForResourceInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1LookupDeveloperIdentityCommand = async (\n input: LookupDeveloperIdentityCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.LookupDeveloperIdentity\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1LookupDeveloperIdentityInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1MergeDeveloperIdentitiesCommand = async (\n input: MergeDeveloperIdentitiesCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.MergeDeveloperIdentities\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1MergeDeveloperIdentitiesInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1SetIdentityPoolRolesCommand = async (\n input: SetIdentityPoolRolesCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.SetIdentityPoolRoles\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1SetIdentityPoolRolesInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1TagResourceCommand = async (\n input: TagResourceCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.TagResource\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1TagResourceInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1UnlinkDeveloperIdentityCommand = async (\n input: UnlinkDeveloperIdentityCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.UnlinkDeveloperIdentity\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1UnlinkDeveloperIdentityInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1UnlinkIdentityCommand = async (\n input: UnlinkIdentityCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.UnlinkIdentity\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1UnlinkIdentityInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1UntagResourceCommand = async (\n input: UntagResourceCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.UntagResource\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1UntagResourceInput(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const serializeAws_json1_1UpdateIdentityPoolCommand = async (\n input: UpdateIdentityPoolCommandInput,\n context: __SerdeContext\n): Promise<__HttpRequest> => {\n const headers: __HeaderBag = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.UpdateIdentityPool\",\n };\n let body: any;\n body = JSON.stringify(serializeAws_json1_1IdentityPool(input, context));\n return buildHttpRpcRequest(context, headers, \"/\", undefined, body);\n};\n\nexport const deserializeAws_json1_1CreateIdentityPoolCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1CreateIdentityPoolCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1IdentityPool(data, context);\n const response: CreateIdentityPoolCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1CreateIdentityPoolCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"LimitExceededException\":\n case \"com.amazonaws.cognitoidentity#LimitExceededException\":\n response = {\n ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceConflictException\":\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\":\n response = {\n ...(await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1DeleteIdentitiesCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1DeleteIdentitiesCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1DeleteIdentitiesResponse(data, context);\n const response: DeleteIdentitiesCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1DeleteIdentitiesCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1DeleteIdentityPoolCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1DeleteIdentityPoolCommandError(output, context);\n }\n await collectBody(output.body, context);\n const response: DeleteIdentityPoolCommandOutput = {\n $metadata: deserializeMetadata(output),\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1DeleteIdentityPoolCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1DescribeIdentityCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1DescribeIdentityCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1IdentityDescription(data, context);\n const response: DescribeIdentityCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1DescribeIdentityCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1DescribeIdentityPoolCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1DescribeIdentityPoolCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1IdentityPool(data, context);\n const response: DescribeIdentityPoolCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1DescribeIdentityPoolCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1GetCredentialsForIdentityCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1GetCredentialsForIdentityCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1GetCredentialsForIdentityResponse(data, context);\n const response: GetCredentialsForIdentityCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1GetCredentialsForIdentityCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"ExternalServiceException\":\n case \"com.amazonaws.cognitoidentity#ExternalServiceException\":\n response = {\n ...(await deserializeAws_json1_1ExternalServiceExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidIdentityPoolConfigurationException\":\n case \"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException\":\n response = {\n ...(await deserializeAws_json1_1InvalidIdentityPoolConfigurationExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceConflictException\":\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\":\n response = {\n ...(await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1GetIdCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1GetIdCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1GetIdResponse(data, context);\n const response: GetIdCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1GetIdCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"ExternalServiceException\":\n case \"com.amazonaws.cognitoidentity#ExternalServiceException\":\n response = {\n ...(await deserializeAws_json1_1ExternalServiceExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"LimitExceededException\":\n case \"com.amazonaws.cognitoidentity#LimitExceededException\":\n response = {\n ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceConflictException\":\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\":\n response = {\n ...(await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1GetIdentityPoolRolesCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1GetIdentityPoolRolesCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1GetIdentityPoolRolesResponse(data, context);\n const response: GetIdentityPoolRolesCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1GetIdentityPoolRolesCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceConflictException\":\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\":\n response = {\n ...(await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1GetOpenIdTokenCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1GetOpenIdTokenCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1GetOpenIdTokenResponse(data, context);\n const response: GetOpenIdTokenCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1GetOpenIdTokenCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"ExternalServiceException\":\n case \"com.amazonaws.cognitoidentity#ExternalServiceException\":\n response = {\n ...(await deserializeAws_json1_1ExternalServiceExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceConflictException\":\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\":\n response = {\n ...(await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityResponse(data, context);\n const response: GetOpenIdTokenForDeveloperIdentityCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"DeveloperUserAlreadyRegisteredException\":\n case \"com.amazonaws.cognitoidentity#DeveloperUserAlreadyRegisteredException\":\n response = {\n ...(await deserializeAws_json1_1DeveloperUserAlreadyRegisteredExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceConflictException\":\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\":\n response = {\n ...(await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1ListIdentitiesCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1ListIdentitiesCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1ListIdentitiesResponse(data, context);\n const response: ListIdentitiesCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1ListIdentitiesCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1ListIdentityPoolsCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1ListIdentityPoolsCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1ListIdentityPoolsResponse(data, context);\n const response: ListIdentityPoolsCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1ListIdentityPoolsCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1ListTagsForResourceCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1ListTagsForResourceCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1ListTagsForResourceResponse(data, context);\n const response: ListTagsForResourceCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1ListTagsForResourceCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1LookupDeveloperIdentityCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1LookupDeveloperIdentityCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1LookupDeveloperIdentityResponse(data, context);\n const response: LookupDeveloperIdentityCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1LookupDeveloperIdentityCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n const parsedOutput: any = {\n ...output,\n body: await parseBody(output.body, context),\n };\n let response: __SmithyException & __MetadataBearer & { [key: string]: any };\n let errorCode: string = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n switch (errorCode) {\n case \"InternalErrorException\":\n case \"com.amazonaws.cognitoidentity#InternalErrorException\":\n response = {\n ...(await deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"InvalidParameterException\":\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\":\n response = {\n ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"NotAuthorizedException\":\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\":\n response = {\n ...(await deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceConflictException\":\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\":\n response = {\n ...(await deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"ResourceNotFoundException\":\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\":\n response = {\n ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n case \"TooManyRequestsException\":\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\":\n response = {\n ...(await deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)),\n name: errorCode,\n $metadata: deserializeMetadata(output),\n };\n break;\n default:\n const parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = {\n ...parsedBody,\n name: `${errorCode}`,\n message: parsedBody.message || parsedBody.Message || errorCode,\n $fault: \"client\",\n $metadata: deserializeMetadata(output),\n } as any;\n }\n const message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return Promise.reject(Object.assign(new Error(message), response));\n};\n\nexport const deserializeAws_json1_1MergeDeveloperIdentitiesCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1MergeDeveloperIdentitiesCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1MergeDeveloperIdentitiesResponse(data, context);\n const response: MergeDeveloperIdentitiesCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1MergeDeveloperIdentitiesCommandError = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise