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.
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.
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.
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.
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.
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.
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.
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.
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\".
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.
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.
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 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.
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.
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.
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.
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.
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 (-).
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.
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.
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 { HeaderBag, HttpMessage, HttpResponse as IHttpResponse } from \"@aws-sdk/types\";\n\ntype HttpResponseOptions = Partial & {\n statusCode: number;\n};\n\nexport interface HttpResponse extends IHttpResponse {}\n\nexport class HttpResponse {\n public statusCode: number;\n public headers: HeaderBag;\n public body?: any;\n\n constructor(options: HttpResponseOptions) {\n this.statusCode = options.statusCode;\n this.headers = options.headers || {};\n this.body = options.body;\n }\n\n static isInstance(response: unknown): response is HttpResponse {\n //determine if response is a valid HttpResponse\n if (!response) return false;\n const resp = response as any;\n return typeof resp.statusCode === \"number\" && typeof resp.headers === \"object\";\n }\n}\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 { Endpoint, HeaderBag, HttpMessage, HttpRequest as IHttpRequest, QueryParameterBag } from \"@aws-sdk/types\";\n\ntype HttpRequestOptions = Partial & Partial & { method?: string };\n\nexport interface HttpRequest extends IHttpRequest {}\n\nexport class HttpRequest implements HttpMessage, Endpoint {\n public method: string;\n public protocol: string;\n public hostname: string;\n public port?: number;\n public path: string;\n public query: QueryParameterBag;\n public headers: HeaderBag;\n public body?: any;\n\n constructor(options: HttpRequestOptions) {\n this.method = options.method || \"GET\";\n this.hostname = options.hostname || \"localhost\";\n this.port = options.port;\n this.query = options.query || {};\n this.headers = options.headers || {};\n this.body = options.body;\n this.protocol = options.protocol\n ? options.protocol.substr(-1) !== \":\"\n ? `${options.protocol}:`\n : options.protocol\n : \"https:\";\n this.path = options.path ? (options.path.charAt(0) !== \"/\" ? `/${options.path}` : options.path) : \"/\";\n }\n\n static isInstance(request: unknown): request is HttpRequest {\n //determine if request is a valid httpRequest\n if (!request) return false;\n const req: any = request;\n return (\n \"method\" in req &&\n \"protocol\" in req &&\n \"hostname\" in req &&\n \"path\" in req &&\n typeof req[\"query\"] === \"object\" &&\n typeof req[\"headers\"] === \"object\"\n );\n }\n\n clone(): HttpRequest {\n const cloned = new HttpRequest({\n ...this,\n headers: { ...this.headers },\n });\n if (cloned.query) cloned.query = cloneQuery(cloned.query);\n return cloned;\n }\n}\n\nfunction cloneQuery(query: QueryParameterBag): QueryParameterBag {\n return Object.keys(query).reduce((carry: QueryParameterBag, paramName: string) => {\n const param = query[paramName];\n return {\n ...carry,\n [paramName]: Array.isArray(param) ? [...param] : param,\n };\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 => {\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_1SetIdentityPoolRolesCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1SetIdentityPoolRolesCommandError(output, context);\n }\n await collectBody(output.body, context);\n const response: SetIdentityPoolRolesCommandOutput = {\n $metadata: deserializeMetadata(output),\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1SetIdentityPoolRolesCommandError = 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 \"ConcurrentModificationException\":\n case \"com.amazonaws.cognitoidentity#ConcurrentModificationException\":\n response = {\n ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(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_1TagResourceCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1TagResourceCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1TagResourceResponse(data, context);\n const response: TagResourceCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1TagResourceCommandError = 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_1UnlinkDeveloperIdentityCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1UnlinkDeveloperIdentityCommandError(output, context);\n }\n await collectBody(output.body, context);\n const response: UnlinkDeveloperIdentityCommandOutput = {\n $metadata: deserializeMetadata(output),\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1UnlinkDeveloperIdentityCommandError = 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_1UnlinkIdentityCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1UnlinkIdentityCommandError(output, context);\n }\n await collectBody(output.body, context);\n const response: UnlinkIdentityCommandOutput = {\n $metadata: deserializeMetadata(output),\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1UnlinkIdentityCommandError = 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_1UntagResourceCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1UntagResourceCommandError(output, context);\n }\n const data: any = await parseBody(output.body, context);\n let contents: any = {};\n contents = deserializeAws_json1_1UntagResourceResponse(data, context);\n const response: UntagResourceCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1UntagResourceCommandError = 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_1UpdateIdentityPoolCommand = async (\n output: __HttpResponse,\n context: __SerdeContext\n): Promise => {\n if (output.statusCode >= 300) {\n return deserializeAws_json1_1UpdateIdentityPoolCommandError(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: UpdateIdentityPoolCommandOutput = {\n $metadata: deserializeMetadata(output),\n ...contents,\n };\n return Promise.resolve(response);\n};\n\nconst deserializeAws_json1_1UpdateIdentityPoolCommandError = 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 \"ConcurrentModificationException\":\n case \"com.amazonaws.cognitoidentity#ConcurrentModificationException\":\n response = {\n ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(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\nconst deserializeAws_json1_1ConcurrentModificationExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1ConcurrentModificationException(body, context);\n const contents: ConcurrentModificationException = {\n name: \"ConcurrentModificationException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1DeveloperUserAlreadyRegisteredExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1DeveloperUserAlreadyRegisteredException(body, context);\n const contents: DeveloperUserAlreadyRegisteredException = {\n name: \"DeveloperUserAlreadyRegisteredException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1ExternalServiceExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1ExternalServiceException(body, context);\n const contents: ExternalServiceException = {\n name: \"ExternalServiceException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1InternalErrorExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1InternalErrorException(body, context);\n const contents: InternalErrorException = {\n name: \"InternalErrorException\",\n $fault: \"server\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1InvalidIdentityPoolConfigurationExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1InvalidIdentityPoolConfigurationException(body, context);\n const contents: InvalidIdentityPoolConfigurationException = {\n name: \"InvalidIdentityPoolConfigurationException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1InvalidParameterExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1InvalidParameterException(body, context);\n const contents: InvalidParameterException = {\n name: \"InvalidParameterException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1LimitExceededExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1LimitExceededException(body, context);\n const contents: LimitExceededException = {\n name: \"LimitExceededException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1NotAuthorizedExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1NotAuthorizedException(body, context);\n const contents: NotAuthorizedException = {\n name: \"NotAuthorizedException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1ResourceConflictExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1ResourceConflictException(body, context);\n const contents: ResourceConflictException = {\n name: \"ResourceConflictException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1ResourceNotFoundExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1ResourceNotFoundException(body, context);\n const contents: ResourceNotFoundException = {\n name: \"ResourceNotFoundException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst deserializeAws_json1_1TooManyRequestsExceptionResponse = async (\n parsedOutput: any,\n context: __SerdeContext\n): Promise => {\n const body = parsedOutput.body;\n const deserialized: any = deserializeAws_json1_1TooManyRequestsException(body, context);\n const contents: TooManyRequestsException = {\n name: \"TooManyRequestsException\",\n $fault: \"client\",\n $metadata: deserializeMetadata(parsedOutput),\n ...deserialized,\n };\n return contents;\n};\n\nconst serializeAws_json1_1CognitoIdentityProvider = (input: CognitoIdentityProvider, context: __SerdeContext): any => {\n return {\n ...(input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId }),\n ...(input.ProviderName !== undefined && input.ProviderName !== null && { ProviderName: input.ProviderName }),\n ...(input.ServerSideTokenCheck !== undefined &&\n input.ServerSideTokenCheck !== null && { ServerSideTokenCheck: input.ServerSideTokenCheck }),\n };\n};\n\nconst serializeAws_json1_1CognitoIdentityProviderList = (\n input: CognitoIdentityProvider[],\n context: __SerdeContext\n): any => {\n return input\n .filter((e: any) => e != null)\n .map((entry) => {\n if (entry === null) {\n return null as any;\n }\n return serializeAws_json1_1CognitoIdentityProvider(entry, context);\n });\n};\n\nconst serializeAws_json1_1CreateIdentityPoolInput = (input: CreateIdentityPoolInput, context: __SerdeContext): any => {\n return {\n ...(input.AllowClassicFlow !== undefined &&\n input.AllowClassicFlow !== null && { AllowClassicFlow: input.AllowClassicFlow }),\n ...(input.AllowUnauthenticatedIdentities !== undefined &&\n input.AllowUnauthenticatedIdentities !== null && {\n AllowUnauthenticatedIdentities: input.AllowUnauthenticatedIdentities,\n }),\n ...(input.CognitoIdentityProviders !== undefined &&\n input.CognitoIdentityProviders !== null && {\n CognitoIdentityProviders: serializeAws_json1_1CognitoIdentityProviderList(\n input.CognitoIdentityProviders,\n context\n ),\n }),\n ...(input.DeveloperProviderName !== undefined &&\n input.DeveloperProviderName !== null && { DeveloperProviderName: input.DeveloperProviderName }),\n ...(input.IdentityPoolName !== undefined &&\n input.IdentityPoolName !== null && { IdentityPoolName: input.IdentityPoolName }),\n ...(input.IdentityPoolTags !== undefined &&\n input.IdentityPoolTags !== null && {\n IdentityPoolTags: serializeAws_json1_1IdentityPoolTagsType(input.IdentityPoolTags, context),\n }),\n ...(input.OpenIdConnectProviderARNs !== undefined &&\n input.OpenIdConnectProviderARNs !== null && {\n OpenIdConnectProviderARNs: serializeAws_json1_1OIDCProviderList(input.OpenIdConnectProviderARNs, context),\n }),\n ...(input.SamlProviderARNs !== undefined &&\n input.SamlProviderARNs !== null && {\n SamlProviderARNs: serializeAws_json1_1SAMLProviderList(input.SamlProviderARNs, context),\n }),\n ...(input.SupportedLoginProviders !== undefined &&\n input.SupportedLoginProviders !== null && {\n SupportedLoginProviders: serializeAws_json1_1IdentityProviders(input.SupportedLoginProviders, context),\n }),\n };\n};\n\nconst serializeAws_json1_1DeleteIdentitiesInput = (input: DeleteIdentitiesInput, context: __SerdeContext): any => {\n return {\n ...(input.IdentityIdsToDelete !== undefined &&\n input.IdentityIdsToDelete !== null && {\n IdentityIdsToDelete: serializeAws_json1_1IdentityIdList(input.IdentityIdsToDelete, context),\n }),\n };\n};\n\nconst serializeAws_json1_1DeleteIdentityPoolInput = (input: DeleteIdentityPoolInput, context: __SerdeContext): any => {\n return {\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n };\n};\n\nconst serializeAws_json1_1DescribeIdentityInput = (input: DescribeIdentityInput, context: __SerdeContext): any => {\n return {\n ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }),\n };\n};\n\nconst serializeAws_json1_1DescribeIdentityPoolInput = (\n input: DescribeIdentityPoolInput,\n context: __SerdeContext\n): any => {\n return {\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n };\n};\n\nconst serializeAws_json1_1GetCredentialsForIdentityInput = (\n input: GetCredentialsForIdentityInput,\n context: __SerdeContext\n): any => {\n return {\n ...(input.CustomRoleArn !== undefined && input.CustomRoleArn !== null && { CustomRoleArn: input.CustomRoleArn }),\n ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }),\n ...(input.Logins !== undefined &&\n input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }),\n };\n};\n\nconst serializeAws_json1_1GetIdentityPoolRolesInput = (\n input: GetIdentityPoolRolesInput,\n context: __SerdeContext\n): any => {\n return {\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n };\n};\n\nconst serializeAws_json1_1GetIdInput = (input: GetIdInput, context: __SerdeContext): any => {\n return {\n ...(input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId }),\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n ...(input.Logins !== undefined &&\n input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }),\n };\n};\n\nconst serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityInput = (\n input: GetOpenIdTokenForDeveloperIdentityInput,\n context: __SerdeContext\n): any => {\n return {\n ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }),\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n ...(input.Logins !== undefined &&\n input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }),\n ...(input.TokenDuration !== undefined && input.TokenDuration !== null && { TokenDuration: input.TokenDuration }),\n };\n};\n\nconst serializeAws_json1_1GetOpenIdTokenInput = (input: GetOpenIdTokenInput, context: __SerdeContext): any => {\n return {\n ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }),\n ...(input.Logins !== undefined &&\n input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }),\n };\n};\n\nconst serializeAws_json1_1IdentityIdList = (input: string[], context: __SerdeContext): any => {\n return input\n .filter((e: any) => e != null)\n .map((entry) => {\n if (entry === null) {\n return null as any;\n }\n return entry;\n });\n};\n\nconst serializeAws_json1_1IdentityPool = (input: IdentityPool, context: __SerdeContext): any => {\n return {\n ...(input.AllowClassicFlow !== undefined &&\n input.AllowClassicFlow !== null && { AllowClassicFlow: input.AllowClassicFlow }),\n ...(input.AllowUnauthenticatedIdentities !== undefined &&\n input.AllowUnauthenticatedIdentities !== null && {\n AllowUnauthenticatedIdentities: input.AllowUnauthenticatedIdentities,\n }),\n ...(input.CognitoIdentityProviders !== undefined &&\n input.CognitoIdentityProviders !== null && {\n CognitoIdentityProviders: serializeAws_json1_1CognitoIdentityProviderList(\n input.CognitoIdentityProviders,\n context\n ),\n }),\n ...(input.DeveloperProviderName !== undefined &&\n input.DeveloperProviderName !== null && { DeveloperProviderName: input.DeveloperProviderName }),\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n ...(input.IdentityPoolName !== undefined &&\n input.IdentityPoolName !== null && { IdentityPoolName: input.IdentityPoolName }),\n ...(input.IdentityPoolTags !== undefined &&\n input.IdentityPoolTags !== null && {\n IdentityPoolTags: serializeAws_json1_1IdentityPoolTagsType(input.IdentityPoolTags, context),\n }),\n ...(input.OpenIdConnectProviderARNs !== undefined &&\n input.OpenIdConnectProviderARNs !== null && {\n OpenIdConnectProviderARNs: serializeAws_json1_1OIDCProviderList(input.OpenIdConnectProviderARNs, context),\n }),\n ...(input.SamlProviderARNs !== undefined &&\n input.SamlProviderARNs !== null && {\n SamlProviderARNs: serializeAws_json1_1SAMLProviderList(input.SamlProviderARNs, context),\n }),\n ...(input.SupportedLoginProviders !== undefined &&\n input.SupportedLoginProviders !== null && {\n SupportedLoginProviders: serializeAws_json1_1IdentityProviders(input.SupportedLoginProviders, context),\n }),\n };\n};\n\nconst serializeAws_json1_1IdentityPoolTagsListType = (input: string[], context: __SerdeContext): any => {\n return input\n .filter((e: any) => e != null)\n .map((entry) => {\n if (entry === null) {\n return null as any;\n }\n return entry;\n });\n};\n\nconst serializeAws_json1_1IdentityPoolTagsType = (input: { [key: string]: string }, context: __SerdeContext): any => {\n return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {\n if (value === null) {\n return acc;\n }\n return {\n ...acc,\n [key]: value,\n };\n }, {});\n};\n\nconst serializeAws_json1_1IdentityProviders = (input: { [key: string]: string }, context: __SerdeContext): any => {\n return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {\n if (value === null) {\n return acc;\n }\n return {\n ...acc,\n [key]: value,\n };\n }, {});\n};\n\nconst serializeAws_json1_1ListIdentitiesInput = (input: ListIdentitiesInput, context: __SerdeContext): any => {\n return {\n ...(input.HideDisabled !== undefined && input.HideDisabled !== null && { HideDisabled: input.HideDisabled }),\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),\n ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),\n };\n};\n\nconst serializeAws_json1_1ListIdentityPoolsInput = (input: ListIdentityPoolsInput, context: __SerdeContext): any => {\n return {\n ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),\n ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),\n };\n};\n\nconst serializeAws_json1_1ListTagsForResourceInput = (\n input: ListTagsForResourceInput,\n context: __SerdeContext\n): any => {\n return {\n ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }),\n };\n};\n\nconst serializeAws_json1_1LoginsList = (input: string[], context: __SerdeContext): any => {\n return input\n .filter((e: any) => e != null)\n .map((entry) => {\n if (entry === null) {\n return null as any;\n }\n return entry;\n });\n};\n\nconst serializeAws_json1_1LoginsMap = (input: { [key: string]: string }, context: __SerdeContext): any => {\n return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {\n if (value === null) {\n return acc;\n }\n return {\n ...acc,\n [key]: value,\n };\n }, {});\n};\n\nconst serializeAws_json1_1LookupDeveloperIdentityInput = (\n input: LookupDeveloperIdentityInput,\n context: __SerdeContext\n): any => {\n return {\n ...(input.DeveloperUserIdentifier !== undefined &&\n input.DeveloperUserIdentifier !== null && { DeveloperUserIdentifier: input.DeveloperUserIdentifier }),\n ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }),\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),\n ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),\n };\n};\n\nconst serializeAws_json1_1MappingRule = (input: MappingRule, context: __SerdeContext): any => {\n return {\n ...(input.Claim !== undefined && input.Claim !== null && { Claim: input.Claim }),\n ...(input.MatchType !== undefined && input.MatchType !== null && { MatchType: input.MatchType }),\n ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }),\n ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }),\n };\n};\n\nconst serializeAws_json1_1MappingRulesList = (input: MappingRule[], context: __SerdeContext): any => {\n return input\n .filter((e: any) => e != null)\n .map((entry) => {\n if (entry === null) {\n return null as any;\n }\n return serializeAws_json1_1MappingRule(entry, context);\n });\n};\n\nconst serializeAws_json1_1MergeDeveloperIdentitiesInput = (\n input: MergeDeveloperIdentitiesInput,\n context: __SerdeContext\n): any => {\n return {\n ...(input.DestinationUserIdentifier !== undefined &&\n input.DestinationUserIdentifier !== null && { DestinationUserIdentifier: input.DestinationUserIdentifier }),\n ...(input.DeveloperProviderName !== undefined &&\n input.DeveloperProviderName !== null && { DeveloperProviderName: input.DeveloperProviderName }),\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n ...(input.SourceUserIdentifier !== undefined &&\n input.SourceUserIdentifier !== null && { SourceUserIdentifier: input.SourceUserIdentifier }),\n };\n};\n\nconst serializeAws_json1_1OIDCProviderList = (input: string[], context: __SerdeContext): any => {\n return input\n .filter((e: any) => e != null)\n .map((entry) => {\n if (entry === null) {\n return null as any;\n }\n return entry;\n });\n};\n\nconst serializeAws_json1_1RoleMapping = (input: RoleMapping, context: __SerdeContext): any => {\n return {\n ...(input.AmbiguousRoleResolution !== undefined &&\n input.AmbiguousRoleResolution !== null && { AmbiguousRoleResolution: input.AmbiguousRoleResolution }),\n ...(input.RulesConfiguration !== undefined &&\n input.RulesConfiguration !== null && {\n RulesConfiguration: serializeAws_json1_1RulesConfigurationType(input.RulesConfiguration, context),\n }),\n ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }),\n };\n};\n\nconst serializeAws_json1_1RoleMappingMap = (input: { [key: string]: RoleMapping }, context: __SerdeContext): any => {\n return Object.entries(input).reduce((acc: { [key: string]: RoleMapping }, [key, value]: [string, any]) => {\n if (value === null) {\n return acc;\n }\n return {\n ...acc,\n [key]: serializeAws_json1_1RoleMapping(value, context),\n };\n }, {});\n};\n\nconst serializeAws_json1_1RolesMap = (input: { [key: string]: string }, context: __SerdeContext): any => {\n return Object.entries(input).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {\n if (value === null) {\n return acc;\n }\n return {\n ...acc,\n [key]: value,\n };\n }, {});\n};\n\nconst serializeAws_json1_1RulesConfigurationType = (input: RulesConfigurationType, context: __SerdeContext): any => {\n return {\n ...(input.Rules !== undefined &&\n input.Rules !== null && { Rules: serializeAws_json1_1MappingRulesList(input.Rules, context) }),\n };\n};\n\nconst serializeAws_json1_1SAMLProviderList = (input: string[], context: __SerdeContext): any => {\n return input\n .filter((e: any) => e != null)\n .map((entry) => {\n if (entry === null) {\n return null as any;\n }\n return entry;\n });\n};\n\nconst serializeAws_json1_1SetIdentityPoolRolesInput = (\n input: SetIdentityPoolRolesInput,\n context: __SerdeContext\n): any => {\n return {\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n ...(input.RoleMappings !== undefined &&\n input.RoleMappings !== null && { RoleMappings: serializeAws_json1_1RoleMappingMap(input.RoleMappings, context) }),\n ...(input.Roles !== undefined &&\n input.Roles !== null && { Roles: serializeAws_json1_1RolesMap(input.Roles, context) }),\n };\n};\n\nconst serializeAws_json1_1TagResourceInput = (input: TagResourceInput, context: __SerdeContext): any => {\n return {\n ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }),\n ...(input.Tags !== undefined &&\n input.Tags !== null && { Tags: serializeAws_json1_1IdentityPoolTagsType(input.Tags, context) }),\n };\n};\n\nconst serializeAws_json1_1UnlinkDeveloperIdentityInput = (\n input: UnlinkDeveloperIdentityInput,\n context: __SerdeContext\n): any => {\n return {\n ...(input.DeveloperProviderName !== undefined &&\n input.DeveloperProviderName !== null && { DeveloperProviderName: input.DeveloperProviderName }),\n ...(input.DeveloperUserIdentifier !== undefined &&\n input.DeveloperUserIdentifier !== null && { DeveloperUserIdentifier: input.DeveloperUserIdentifier }),\n ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }),\n ...(input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }),\n };\n};\n\nconst serializeAws_json1_1UnlinkIdentityInput = (input: UnlinkIdentityInput, context: __SerdeContext): any => {\n return {\n ...(input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }),\n ...(input.Logins !== undefined &&\n input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }),\n ...(input.LoginsToRemove !== undefined &&\n input.LoginsToRemove !== null && {\n LoginsToRemove: serializeAws_json1_1LoginsList(input.LoginsToRemove, context),\n }),\n };\n};\n\nconst serializeAws_json1_1UntagResourceInput = (input: UntagResourceInput, context: __SerdeContext): any => {\n return {\n ...(input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }),\n ...(input.TagKeys !== undefined &&\n input.TagKeys !== null && { TagKeys: serializeAws_json1_1IdentityPoolTagsListType(input.TagKeys, context) }),\n };\n};\n\nconst deserializeAws_json1_1CognitoIdentityProvider = (\n output: any,\n context: __SerdeContext\n): CognitoIdentityProvider => {\n return {\n ClientId: output.ClientId !== undefined && output.ClientId !== null ? output.ClientId : undefined,\n ProviderName: output.ProviderName !== undefined && output.ProviderName !== null ? output.ProviderName : undefined,\n ServerSideTokenCheck:\n output.ServerSideTokenCheck !== undefined && output.ServerSideTokenCheck !== null\n ? output.ServerSideTokenCheck\n : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1CognitoIdentityProviderList = (\n output: any,\n context: __SerdeContext\n): CognitoIdentityProvider[] => {\n return (output || [])\n .filter((e: any) => e != null)\n .map((entry: any) => {\n if (entry === null) {\n return null as any;\n }\n return deserializeAws_json1_1CognitoIdentityProvider(entry, context);\n });\n};\n\nconst deserializeAws_json1_1ConcurrentModificationException = (\n output: any,\n context: __SerdeContext\n): ConcurrentModificationException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1Credentials = (output: any, context: __SerdeContext): Credentials => {\n return {\n AccessKeyId: output.AccessKeyId !== undefined && output.AccessKeyId !== null ? output.AccessKeyId : undefined,\n Expiration:\n output.Expiration !== undefined && output.Expiration !== null\n ? new Date(Math.round(output.Expiration * 1000))\n : undefined,\n SecretKey: output.SecretKey !== undefined && output.SecretKey !== null ? output.SecretKey : undefined,\n SessionToken: output.SessionToken !== undefined && output.SessionToken !== null ? output.SessionToken : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1DeleteIdentitiesResponse = (\n output: any,\n context: __SerdeContext\n): DeleteIdentitiesResponse => {\n return {\n UnprocessedIdentityIds:\n output.UnprocessedIdentityIds !== undefined && output.UnprocessedIdentityIds !== null\n ? deserializeAws_json1_1UnprocessedIdentityIdList(output.UnprocessedIdentityIds, context)\n : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1DeveloperUserAlreadyRegisteredException = (\n output: any,\n context: __SerdeContext\n): DeveloperUserAlreadyRegisteredException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1DeveloperUserIdentifierList = (output: any, context: __SerdeContext): string[] => {\n return (output || [])\n .filter((e: any) => e != null)\n .map((entry: any) => {\n if (entry === null) {\n return null as any;\n }\n return entry;\n });\n};\n\nconst deserializeAws_json1_1ExternalServiceException = (\n output: any,\n context: __SerdeContext\n): ExternalServiceException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1GetCredentialsForIdentityResponse = (\n output: any,\n context: __SerdeContext\n): GetCredentialsForIdentityResponse => {\n return {\n Credentials:\n output.Credentials !== undefined && output.Credentials !== null\n ? deserializeAws_json1_1Credentials(output.Credentials, context)\n : undefined,\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1GetIdentityPoolRolesResponse = (\n output: any,\n context: __SerdeContext\n): GetIdentityPoolRolesResponse => {\n return {\n IdentityPoolId:\n output.IdentityPoolId !== undefined && output.IdentityPoolId !== null ? output.IdentityPoolId : undefined,\n RoleMappings:\n output.RoleMappings !== undefined && output.RoleMappings !== null\n ? deserializeAws_json1_1RoleMappingMap(output.RoleMappings, context)\n : undefined,\n Roles:\n output.Roles !== undefined && output.Roles !== null\n ? deserializeAws_json1_1RolesMap(output.Roles, context)\n : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1GetIdResponse = (output: any, context: __SerdeContext): GetIdResponse => {\n return {\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityResponse = (\n output: any,\n context: __SerdeContext\n): GetOpenIdTokenForDeveloperIdentityResponse => {\n return {\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n Token: output.Token !== undefined && output.Token !== null ? output.Token : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1GetOpenIdTokenResponse = (output: any, context: __SerdeContext): GetOpenIdTokenResponse => {\n return {\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n Token: output.Token !== undefined && output.Token !== null ? output.Token : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1IdentitiesList = (output: any, context: __SerdeContext): IdentityDescription[] => {\n return (output || [])\n .filter((e: any) => e != null)\n .map((entry: any) => {\n if (entry === null) {\n return null as any;\n }\n return deserializeAws_json1_1IdentityDescription(entry, context);\n });\n};\n\nconst deserializeAws_json1_1IdentityDescription = (output: any, context: __SerdeContext): IdentityDescription => {\n return {\n CreationDate:\n output.CreationDate !== undefined && output.CreationDate !== null\n ? new Date(Math.round(output.CreationDate * 1000))\n : undefined,\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n LastModifiedDate:\n output.LastModifiedDate !== undefined && output.LastModifiedDate !== null\n ? new Date(Math.round(output.LastModifiedDate * 1000))\n : undefined,\n Logins:\n output.Logins !== undefined && output.Logins !== null\n ? deserializeAws_json1_1LoginsList(output.Logins, context)\n : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1IdentityPool = (output: any, context: __SerdeContext): IdentityPool => {\n return {\n AllowClassicFlow:\n output.AllowClassicFlow !== undefined && output.AllowClassicFlow !== null ? output.AllowClassicFlow : undefined,\n AllowUnauthenticatedIdentities:\n output.AllowUnauthenticatedIdentities !== undefined && output.AllowUnauthenticatedIdentities !== null\n ? output.AllowUnauthenticatedIdentities\n : undefined,\n CognitoIdentityProviders:\n output.CognitoIdentityProviders !== undefined && output.CognitoIdentityProviders !== null\n ? deserializeAws_json1_1CognitoIdentityProviderList(output.CognitoIdentityProviders, context)\n : undefined,\n DeveloperProviderName:\n output.DeveloperProviderName !== undefined && output.DeveloperProviderName !== null\n ? output.DeveloperProviderName\n : undefined,\n IdentityPoolId:\n output.IdentityPoolId !== undefined && output.IdentityPoolId !== null ? output.IdentityPoolId : undefined,\n IdentityPoolName:\n output.IdentityPoolName !== undefined && output.IdentityPoolName !== null ? output.IdentityPoolName : undefined,\n IdentityPoolTags:\n output.IdentityPoolTags !== undefined && output.IdentityPoolTags !== null\n ? deserializeAws_json1_1IdentityPoolTagsType(output.IdentityPoolTags, context)\n : undefined,\n OpenIdConnectProviderARNs:\n output.OpenIdConnectProviderARNs !== undefined && output.OpenIdConnectProviderARNs !== null\n ? deserializeAws_json1_1OIDCProviderList(output.OpenIdConnectProviderARNs, context)\n : undefined,\n SamlProviderARNs:\n output.SamlProviderARNs !== undefined && output.SamlProviderARNs !== null\n ? deserializeAws_json1_1SAMLProviderList(output.SamlProviderARNs, context)\n : undefined,\n SupportedLoginProviders:\n output.SupportedLoginProviders !== undefined && output.SupportedLoginProviders !== null\n ? deserializeAws_json1_1IdentityProviders(output.SupportedLoginProviders, context)\n : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1IdentityPoolShortDescription = (\n output: any,\n context: __SerdeContext\n): IdentityPoolShortDescription => {\n return {\n IdentityPoolId:\n output.IdentityPoolId !== undefined && output.IdentityPoolId !== null ? output.IdentityPoolId : undefined,\n IdentityPoolName:\n output.IdentityPoolName !== undefined && output.IdentityPoolName !== null ? output.IdentityPoolName : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1IdentityPoolsList = (\n output: any,\n context: __SerdeContext\n): IdentityPoolShortDescription[] => {\n return (output || [])\n .filter((e: any) => e != null)\n .map((entry: any) => {\n if (entry === null) {\n return null as any;\n }\n return deserializeAws_json1_1IdentityPoolShortDescription(entry, context);\n });\n};\n\nconst deserializeAws_json1_1IdentityPoolTagsType = (\n output: any,\n context: __SerdeContext\n): { [key: string]: string } => {\n return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {\n if (value === null) {\n return acc;\n }\n return {\n ...acc,\n [key]: value,\n };\n }, {});\n};\n\nconst deserializeAws_json1_1IdentityProviders = (output: any, context: __SerdeContext): { [key: string]: string } => {\n return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {\n if (value === null) {\n return acc;\n }\n return {\n ...acc,\n [key]: value,\n };\n }, {});\n};\n\nconst deserializeAws_json1_1InternalErrorException = (output: any, context: __SerdeContext): InternalErrorException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1InvalidIdentityPoolConfigurationException = (\n output: any,\n context: __SerdeContext\n): InvalidIdentityPoolConfigurationException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1InvalidParameterException = (\n output: any,\n context: __SerdeContext\n): InvalidParameterException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1LimitExceededException = (output: any, context: __SerdeContext): LimitExceededException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1ListIdentitiesResponse = (output: any, context: __SerdeContext): ListIdentitiesResponse => {\n return {\n Identities:\n output.Identities !== undefined && output.Identities !== null\n ? deserializeAws_json1_1IdentitiesList(output.Identities, context)\n : undefined,\n IdentityPoolId:\n output.IdentityPoolId !== undefined && output.IdentityPoolId !== null ? output.IdentityPoolId : undefined,\n NextToken: output.NextToken !== undefined && output.NextToken !== null ? output.NextToken : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1ListIdentityPoolsResponse = (\n output: any,\n context: __SerdeContext\n): ListIdentityPoolsResponse => {\n return {\n IdentityPools:\n output.IdentityPools !== undefined && output.IdentityPools !== null\n ? deserializeAws_json1_1IdentityPoolsList(output.IdentityPools, context)\n : undefined,\n NextToken: output.NextToken !== undefined && output.NextToken !== null ? output.NextToken : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1ListTagsForResourceResponse = (\n output: any,\n context: __SerdeContext\n): ListTagsForResourceResponse => {\n return {\n Tags:\n output.Tags !== undefined && output.Tags !== null\n ? deserializeAws_json1_1IdentityPoolTagsType(output.Tags, context)\n : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1LoginsList = (output: any, context: __SerdeContext): string[] => {\n return (output || [])\n .filter((e: any) => e != null)\n .map((entry: any) => {\n if (entry === null) {\n return null as any;\n }\n return entry;\n });\n};\n\nconst deserializeAws_json1_1LookupDeveloperIdentityResponse = (\n output: any,\n context: __SerdeContext\n): LookupDeveloperIdentityResponse => {\n return {\n DeveloperUserIdentifierList:\n output.DeveloperUserIdentifierList !== undefined && output.DeveloperUserIdentifierList !== null\n ? deserializeAws_json1_1DeveloperUserIdentifierList(output.DeveloperUserIdentifierList, context)\n : undefined,\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n NextToken: output.NextToken !== undefined && output.NextToken !== null ? output.NextToken : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1MappingRule = (output: any, context: __SerdeContext): MappingRule => {\n return {\n Claim: output.Claim !== undefined && output.Claim !== null ? output.Claim : undefined,\n MatchType: output.MatchType !== undefined && output.MatchType !== null ? output.MatchType : undefined,\n RoleARN: output.RoleARN !== undefined && output.RoleARN !== null ? output.RoleARN : undefined,\n Value: output.Value !== undefined && output.Value !== null ? output.Value : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1MappingRulesList = (output: any, context: __SerdeContext): MappingRule[] => {\n return (output || [])\n .filter((e: any) => e != null)\n .map((entry: any) => {\n if (entry === null) {\n return null as any;\n }\n return deserializeAws_json1_1MappingRule(entry, context);\n });\n};\n\nconst deserializeAws_json1_1MergeDeveloperIdentitiesResponse = (\n output: any,\n context: __SerdeContext\n): MergeDeveloperIdentitiesResponse => {\n return {\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1NotAuthorizedException = (output: any, context: __SerdeContext): NotAuthorizedException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1OIDCProviderList = (output: any, context: __SerdeContext): string[] => {\n return (output || [])\n .filter((e: any) => e != null)\n .map((entry: any) => {\n if (entry === null) {\n return null as any;\n }\n return entry;\n });\n};\n\nconst deserializeAws_json1_1ResourceConflictException = (\n output: any,\n context: __SerdeContext\n): ResourceConflictException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1ResourceNotFoundException = (\n output: any,\n context: __SerdeContext\n): ResourceNotFoundException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1RoleMapping = (output: any, context: __SerdeContext): RoleMapping => {\n return {\n AmbiguousRoleResolution:\n output.AmbiguousRoleResolution !== undefined && output.AmbiguousRoleResolution !== null\n ? output.AmbiguousRoleResolution\n : undefined,\n RulesConfiguration:\n output.RulesConfiguration !== undefined && output.RulesConfiguration !== null\n ? deserializeAws_json1_1RulesConfigurationType(output.RulesConfiguration, context)\n : undefined,\n Type: output.Type !== undefined && output.Type !== null ? output.Type : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1RoleMappingMap = (output: any, context: __SerdeContext): { [key: string]: RoleMapping } => {\n return Object.entries(output).reduce((acc: { [key: string]: RoleMapping }, [key, value]: [string, any]) => {\n if (value === null) {\n return acc;\n }\n return {\n ...acc,\n [key]: deserializeAws_json1_1RoleMapping(value, context),\n };\n }, {});\n};\n\nconst deserializeAws_json1_1RolesMap = (output: any, context: __SerdeContext): { [key: string]: string } => {\n return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {\n if (value === null) {\n return acc;\n }\n return {\n ...acc,\n [key]: value,\n };\n }, {});\n};\n\nconst deserializeAws_json1_1RulesConfigurationType = (output: any, context: __SerdeContext): RulesConfigurationType => {\n return {\n Rules:\n output.Rules !== undefined && output.Rules !== null\n ? deserializeAws_json1_1MappingRulesList(output.Rules, context)\n : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1SAMLProviderList = (output: any, context: __SerdeContext): string[] => {\n return (output || [])\n .filter((e: any) => e != null)\n .map((entry: any) => {\n if (entry === null) {\n return null as any;\n }\n return entry;\n });\n};\n\nconst deserializeAws_json1_1TagResourceResponse = (output: any, context: __SerdeContext): TagResourceResponse => {\n return {} as any;\n};\n\nconst deserializeAws_json1_1TooManyRequestsException = (\n output: any,\n context: __SerdeContext\n): TooManyRequestsException => {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1UnprocessedIdentityId = (output: any, context: __SerdeContext): UnprocessedIdentityId => {\n return {\n ErrorCode: output.ErrorCode !== undefined && output.ErrorCode !== null ? output.ErrorCode : undefined,\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n } as any;\n};\n\nconst deserializeAws_json1_1UnprocessedIdentityIdList = (\n output: any,\n context: __SerdeContext\n): UnprocessedIdentityId[] => {\n return (output || [])\n .filter((e: any) => e != null)\n .map((entry: any) => {\n if (entry === null) {\n return null as any;\n }\n return deserializeAws_json1_1UnprocessedIdentityId(entry, context);\n });\n};\n\nconst deserializeAws_json1_1UntagResourceResponse = (output: any, context: __SerdeContext): UntagResourceResponse => {\n return {} as any;\n};\n\nconst deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({\n httpStatusCode: output.statusCode,\n requestId: output.headers[\"x-amzn-requestid\"] ?? output.headers[\"x-amzn-request-id\"],\n extendedRequestId: output.headers[\"x-amz-id-2\"],\n cfId: output.headers[\"x-amz-cf-id\"],\n});\n\n// Collect low-level response body stream to Uint8Array.\nconst collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise => {\n if (streamBody instanceof Uint8Array) {\n return Promise.resolve(streamBody);\n }\n return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());\n};\n\n// Encode Uint8Array data into string with utf-8.\nconst collectBodyString = (streamBody: any, context: __SerdeContext): Promise =>\n collectBody(streamBody, context).then((body) => context.utf8Encoder(body));\n\nconst buildHttpRpcRequest = async (\n context: __SerdeContext,\n headers: __HeaderBag,\n path: string,\n resolvedHostname: string | undefined,\n body: any\n): Promise<__HttpRequest> => {\n const { hostname, protocol = \"https\", port } = await context.endpoint();\n const contents: any = {\n protocol,\n hostname,\n port,\n method: \"POST\",\n path,\n headers,\n };\n if (resolvedHostname !== undefined) {\n contents.hostname = resolvedHostname;\n }\n if (body !== undefined) {\n contents.body = body;\n }\n return new __HttpRequest(contents);\n};\n\nconst parseBody = (streamBody: any, context: __SerdeContext): any =>\n collectBodyString(streamBody, context).then((encoded) => {\n if (encoded.length) {\n return JSON.parse(encoded);\n }\n return {};\n });\n\n/**\n * Load an error code for the aws.rest-json-1.1 protocol.\n */\nconst loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {\n const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());\n\n const sanitizeErrorCode = (rawValue: string): string => {\n let cleanValue = rawValue;\n if (cleanValue.indexOf(\":\") >= 0) {\n cleanValue = cleanValue.split(\":\")[0];\n }\n if (cleanValue.indexOf(\"#\") >= 0) {\n cleanValue = cleanValue.split(\"#\")[1];\n }\n return cleanValue;\n };\n\n const headerKey = findKey(output.headers, \"x-amzn-errortype\");\n if (headerKey !== undefined) {\n return sanitizeErrorCode(output.headers[headerKey]);\n }\n\n if (data.code !== undefined) {\n return sanitizeErrorCode(data.code);\n }\n\n if (data[\"__type\"] !== undefined) {\n return sanitizeErrorCode(data[\"__type\"]);\n }\n\n return \"\";\n};\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 {\n DeserializeHandler,\n DeserializeHandlerArguments,\n DeserializeHandlerOutput,\n DeserializeMiddleware,\n HandlerExecutionContext,\n ResponseDeserializer,\n} from \"@aws-sdk/types\";\n\nexport const deserializerMiddleware = (\n options: RuntimeUtils,\n deserializer: ResponseDeserializer\n): DeserializeMiddleware => (\n next: DeserializeHandler,\n context: HandlerExecutionContext\n): DeserializeHandler => async (\n args: DeserializeHandlerArguments\n): Promise> => {\n const { response } = await next(args);\n const parsed = await deserializer(response, options);\n return {\n response,\n output: parsed as Output,\n };\n};\n","import {\n DeserializeHandlerOptions,\n EndpointBearer,\n MetadataBearer,\n MiddlewareStack,\n Pluggable,\n RequestSerializer,\n ResponseDeserializer,\n SerializeHandlerOptions,\n} from \"@aws-sdk/types\";\n\nimport { deserializerMiddleware } from \"./deserializerMiddleware\";\nimport { serializerMiddleware } from \"./serializerMiddleware\";\n\nexport const deserializerMiddlewareOption: DeserializeHandlerOptions = {\n name: \"deserializerMiddleware\",\n step: \"deserialize\",\n tags: [\"DESERIALIZER\"],\n override: true,\n};\n\nexport const serializerMiddlewareOption: SerializeHandlerOptions = {\n name: \"serializerMiddleware\",\n step: \"serialize\",\n tags: [\"SERIALIZER\"],\n override: true,\n};\n\nexport function getSerdePlugin<\n InputType extends object,\n SerDeContext extends EndpointBearer,\n OutputType extends MetadataBearer\n>(\n config: SerDeContext,\n serializer: RequestSerializer,\n deserializer: ResponseDeserializer\n): Pluggable {\n return {\n applyToStack: (commandStack: MiddlewareStack) => {\n commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption);\n commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption);\n },\n };\n}\n","import {\n EndpointBearer,\n HandlerExecutionContext,\n RequestSerializer,\n SerializeHandler,\n SerializeHandlerArguments,\n SerializeHandlerOutput,\n SerializeMiddleware,\n} from \"@aws-sdk/types\";\n\nexport const serializerMiddleware = (\n options: RuntimeUtils,\n serializer: RequestSerializer\n): SerializeMiddleware => (\n next: SerializeHandler,\n context: HandlerExecutionContext\n): SerializeHandler => async (\n args: SerializeHandlerArguments\n): Promise> => {\n const request = await serializer(args.input, options);\n return next({\n ...args,\n request,\n });\n};\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 {\n AbsoluteLocation,\n DeserializeHandler,\n Handler,\n HandlerExecutionContext,\n HandlerOptions,\n MiddlewareStack,\n MiddlewareType,\n Pluggable,\n Priority,\n RelativeLocation,\n Step,\n} from \"@aws-sdk/types\";\n\nimport { AbsoluteMiddlewareEntry, MiddlewareEntry, Normalized, RelativeMiddlewareEntry } from \"./types\";\n\nexport const constructStack = (): MiddlewareStack => {\n let absoluteEntries: AbsoluteMiddlewareEntry[] = [];\n let relativeEntries: RelativeMiddlewareEntry[] = [];\n const entriesNameSet: Set = new Set();\n\n const sort = >(entries: T[]): T[] =>\n entries.sort(\n (a, b) =>\n stepWeights[b.step] - stepWeights[a.step] ||\n priorityWeights[b.priority || \"normal\"] - priorityWeights[a.priority || \"normal\"]\n );\n\n const removeByName = (toRemove: string): boolean => {\n let isRemoved = false;\n const filterCb = (entry: MiddlewareEntry): boolean => {\n if (entry.name && entry.name === toRemove) {\n isRemoved = true;\n entriesNameSet.delete(toRemove);\n return false;\n }\n return true;\n };\n absoluteEntries = absoluteEntries.filter(filterCb);\n relativeEntries = relativeEntries.filter(filterCb);\n return isRemoved;\n };\n\n const removeByReference = (toRemove: MiddlewareType): boolean => {\n let isRemoved = false;\n const filterCb = (entry: MiddlewareEntry): boolean => {\n if (entry.middleware === toRemove) {\n isRemoved = true;\n if (entry.name) entriesNameSet.delete(entry.name);\n return false;\n }\n return true;\n };\n absoluteEntries = absoluteEntries.filter(filterCb);\n relativeEntries = relativeEntries.filter(filterCb);\n return isRemoved;\n };\n\n const cloneTo = (\n toStack: MiddlewareStack\n ): MiddlewareStack => {\n absoluteEntries.forEach((entry) => {\n //@ts-ignore\n toStack.add(entry.middleware, { ...entry });\n });\n relativeEntries.forEach((entry) => {\n //@ts-ignore\n toStack.addRelativeTo(entry.middleware, { ...entry });\n });\n return toStack;\n };\n\n const expandRelativeMiddlewareList = (\n from: Normalized, Input, Output>\n ): MiddlewareEntry[] => {\n const expandedMiddlewareList: MiddlewareEntry[] = [];\n from.before.forEach((entry) => {\n if (entry.before.length === 0 && entry.after.length === 0) {\n expandedMiddlewareList.push(entry);\n } else {\n expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));\n }\n });\n expandedMiddlewareList.push(from);\n from.after.reverse().forEach((entry) => {\n if (entry.before.length === 0 && entry.after.length === 0) {\n expandedMiddlewareList.push(entry);\n } else {\n expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));\n }\n });\n return expandedMiddlewareList;\n };\n\n /**\n * Get a final list of middleware in the order of being executed in the resolved handler.\n */\n const getMiddlewareList = (): Array> => {\n const normalizedAbsoluteEntries: Normalized, Input, Output>[] = [];\n const normalizedRelativeEntries: Normalized, Input, Output>[] = [];\n const normalizedEntriesNameMap: {\n [middlewareName: string]: Normalized, Input, Output>;\n } = {};\n\n absoluteEntries.forEach((entry) => {\n const normalizedEntry = {\n ...entry,\n before: [],\n after: [],\n };\n if (normalizedEntry.name) normalizedEntriesNameMap[normalizedEntry.name] = normalizedEntry;\n normalizedAbsoluteEntries.push(normalizedEntry);\n });\n\n relativeEntries.forEach((entry) => {\n const normalizedEntry = {\n ...entry,\n before: [],\n after: [],\n };\n if (normalizedEntry.name) normalizedEntriesNameMap[normalizedEntry.name] = normalizedEntry;\n normalizedRelativeEntries.push(normalizedEntry);\n });\n\n normalizedRelativeEntries.forEach((entry) => {\n if (entry.toMiddleware) {\n const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware];\n if (toMiddleware === undefined) {\n throw new Error(\n `${entry.toMiddleware} is not found when adding ${entry.name || \"anonymous\"} middleware ${entry.relation} ${\n entry.toMiddleware\n }`\n );\n }\n if (entry.relation === \"after\") {\n toMiddleware.after.push(entry);\n }\n if (entry.relation === \"before\") {\n toMiddleware.before.push(entry);\n }\n }\n });\n\n const mainChain = sort(normalizedAbsoluteEntries)\n .map(expandRelativeMiddlewareList)\n .reduce((wholeList, expendedMiddlewareList) => {\n // TODO: Replace it with Array.flat();\n wholeList.push(...expendedMiddlewareList);\n return wholeList;\n }, [] as MiddlewareEntry[]);\n return mainChain.map((entry) => entry.middleware);\n };\n\n const stack = {\n add: (middleware: MiddlewareType, options: HandlerOptions & AbsoluteLocation = {}) => {\n const { name, override } = options;\n const entry: AbsoluteMiddlewareEntry = {\n step: \"initialize\",\n priority: \"normal\",\n middleware,\n ...options,\n };\n if (name) {\n if (entriesNameSet.has(name)) {\n if (!override) throw new Error(`Duplicate middleware name '${name}'`);\n const toOverrideIndex = absoluteEntries.findIndex((entry) => entry.name === name);\n const toOverride = absoluteEntries[toOverrideIndex];\n if (toOverride.step !== entry.step || toOverride.priority !== entry.priority) {\n throw new Error(\n `\"${name}\" middleware with ${toOverride.priority} priority in ${toOverride.step} step cannot be ` +\n `overridden by same-name middleware with ${entry.priority} priority in ${entry.step} step.`\n );\n }\n absoluteEntries.splice(toOverrideIndex, 1);\n }\n entriesNameSet.add(name);\n }\n absoluteEntries.push(entry);\n },\n\n addRelativeTo: (middleware: MiddlewareType, options: HandlerOptions & RelativeLocation) => {\n const { name, override } = options;\n const entry: RelativeMiddlewareEntry = {\n middleware,\n ...options,\n };\n if (name) {\n if (entriesNameSet.has(name)) {\n if (!override) throw new Error(`Duplicate middleware name '${name}'`);\n const toOverrideIndex = relativeEntries.findIndex((entry) => entry.name === name);\n const toOverride = relativeEntries[toOverrideIndex];\n if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) {\n throw new Error(\n `\"${name}\" middleware ${toOverride.relation} \"${toOverride.toMiddleware}\" middleware cannot be overridden ` +\n `by same-name middleware ${entry.relation} \"${entry.toMiddleware}\" middleware.`\n );\n }\n relativeEntries.splice(toOverrideIndex, 1);\n }\n entriesNameSet.add(name);\n }\n relativeEntries.push(entry);\n },\n\n clone: () => cloneTo(constructStack()),\n\n use: (plugin: Pluggable) => {\n plugin.applyToStack(stack);\n },\n\n remove: (toRemove: MiddlewareType | string): boolean => {\n if (typeof toRemove === \"string\") return removeByName(toRemove);\n else return removeByReference(toRemove);\n },\n\n removeByTag: (toRemove: string): boolean => {\n let isRemoved = false;\n const filterCb = (entry: MiddlewareEntry): boolean => {\n const { tags, name } = entry;\n if (tags && tags.includes(toRemove)) {\n if (name) entriesNameSet.delete(name);\n isRemoved = true;\n return false;\n }\n return true;\n };\n absoluteEntries = absoluteEntries.filter(filterCb);\n relativeEntries = relativeEntries.filter(filterCb);\n return isRemoved;\n },\n\n concat: (\n from: MiddlewareStack\n ): MiddlewareStack => {\n const cloned = cloneTo(constructStack());\n cloned.use(from);\n return cloned;\n },\n\n applyToStack: cloneTo,\n\n resolve: (\n handler: DeserializeHandler,\n context: HandlerExecutionContext\n ): Handler => {\n for (const middleware of getMiddlewareList().reverse()) {\n handler = middleware(handler as Handler, context) as any;\n }\n return handler as Handler;\n },\n };\n return stack;\n};\n\nconst stepWeights: { [key in Step]: number } = {\n initialize: 5,\n serialize: 4,\n build: 3,\n finalizeRequest: 2,\n deserialize: 1,\n};\n\nconst priorityWeights: { [key in Priority]: number } = {\n high: 3,\n normal: 2,\n low: 1,\n};\n","import { constructStack } from \"@aws-sdk/middleware-stack\";\nimport { Client as IClient, Command, MetadataBearer, RequestHandler } from \"@aws-sdk/types\";\n\nexport interface SmithyConfiguration {\n requestHandler: RequestHandler;\n /**\n * The API version set internally by the SDK, and is\n * not planned to be used by customer code.\n * @internal\n */\n readonly apiVersion: string;\n}\n\nexport type SmithyResolvedConfiguration = SmithyConfiguration;\n\nexport class Client<\n HandlerOptions,\n ClientInput extends object,\n ClientOutput extends MetadataBearer,\n ResolvedClientConfiguration extends SmithyResolvedConfiguration\n> implements IClient {\n public middlewareStack = constructStack();\n readonly config: ResolvedClientConfiguration;\n constructor(config: ResolvedClientConfiguration) {\n this.config = config;\n }\n send(\n command: Command>,\n options?: HandlerOptions\n ): Promise;\n send(\n command: Command>,\n cb: (err: any, data?: OutputType) => void\n ): void;\n send(\n command: Command>,\n options: HandlerOptions,\n cb: (err: any, data?: OutputType) => void\n ): void;\n send(\n command: Command>,\n optionsOrCb?: HandlerOptions | ((err: any, data?: OutputType) => void),\n cb?: (err: any, data?: OutputType) => void\n ): Promise | void {\n const options = typeof optionsOrCb !== \"function\" ? optionsOrCb : undefined;\n const callback = typeof optionsOrCb === \"function\" ? (optionsOrCb as (err: any, data?: OutputType) => void) : cb;\n const handler = command.resolveMiddleware(this.middlewareStack as any, this.config, options);\n if (callback) {\n handler(command)\n .then(\n (result) => callback(null, result.output),\n (err: any) => callback(err)\n )\n .catch(\n // prevent any errors thrown in the callback from triggering an\n // unhandled promise rejection\n () => {}\n );\n } else {\n return handler(command).then((result) => result.output);\n }\n }\n\n destroy() {\n if (this.config.requestHandler.destroy) this.config.requestHandler.destroy();\n }\n}\n","import { constructStack } from \"@aws-sdk/middleware-stack\";\nimport { Command as ICommand, Handler, MetadataBearer, MiddlewareStack as IMiddlewareStack } from \"@aws-sdk/types\";\n\nexport abstract class Command<\n Input extends ClientInput,\n Output extends ClientOutput,\n ResolvedClientConfiguration,\n ClientInput extends object = any,\n ClientOutput extends MetadataBearer = any\n> implements ICommand {\n abstract input: Input;\n readonly middlewareStack: IMiddlewareStack = constructStack();\n abstract resolveMiddleware(\n stack: IMiddlewareStack,\n configuration: ResolvedClientConfiguration,\n options: any\n ): Handler;\n}\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","/**\n * Lazy String holder for JSON typed contents.\n */\n\ninterface StringWrapper {\n new (arg: any): String;\n}\n\n/**\n * Because of https://github.com/microsoft/tslib/issues/95,\n * TS 'extends' shim doesn't support extending native types like String.\n * So here we create StringWrapper that duplicate everything from String\n * class including its prototype chain. So we can extend from here.\n */\n// @ts-ignore StringWrapper implementation is not a simple constructor\nexport const StringWrapper: StringWrapper = function () {\n //@ts-ignore 'this' cannot be assigned to any, but Object.getPrototypeOf accepts any\n const Class = Object.getPrototypeOf(this).constructor;\n const Constructor = Function.bind.apply(String, [null as any, ...arguments]);\n //@ts-ignore Call wrapped String constructor directly, don't bother typing it.\n const instance = new Constructor();\n Object.setPrototypeOf(instance, Class.prototype);\n return instance as String;\n};\nStringWrapper.prototype = Object.create(String.prototype, {\n constructor: {\n value: StringWrapper,\n enumerable: false,\n writable: true,\n configurable: true,\n },\n});\nObject.setPrototypeOf(StringWrapper, String);\n\nexport class LazyJsonString extends StringWrapper {\n deserializeJSON(): any {\n return JSON.parse(super.toString());\n }\n\n toJSON(): string {\n return super.toString();\n }\n\n static fromObject(object: any): LazyJsonString {\n if (object instanceof LazyJsonString) {\n return object;\n } else if (object instanceof String || typeof object === \"string\") {\n return new LazyJsonString(object);\n }\n return new LazyJsonString(JSON.stringify(object));\n }\n}\n","import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../CognitoIdentityClient\";\nimport { GetCredentialsForIdentityInput, GetCredentialsForIdentityResponse } from \"../models/models_0\";\nimport {\n deserializeAws_json1_1GetCredentialsForIdentityCommand,\n serializeAws_json1_1GetCredentialsForIdentityCommand,\n} from \"../protocols/Aws_json1_1\";\nimport { getSerdePlugin } from \"@aws-sdk/middleware-serde\";\nimport { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from \"@aws-sdk/protocol-http\";\nimport { Command as $Command } from \"@aws-sdk/smithy-client\";\nimport {\n FinalizeHandlerArguments,\n Handler,\n HandlerExecutionContext,\n MiddlewareStack,\n HttpHandlerOptions as __HttpHandlerOptions,\n MetadataBearer as __MetadataBearer,\n SerdeContext as __SerdeContext,\n} from \"@aws-sdk/types\";\n\nexport type GetCredentialsForIdentityCommandInput = GetCredentialsForIdentityInput;\nexport type GetCredentialsForIdentityCommandOutput = GetCredentialsForIdentityResponse & __MetadataBearer;\n\n/**\n *
Returns credentials for the provided identity ID. Any provided logins will be\n * validated against supported login providers. If the token is for\n * cognito-identity.amazonaws.com, it will be passed through to AWS Security Token Service\n * with the appropriate role for the token.
\n *
This is a public API. You do not need any credentials to call this API.
\n */\nexport class GetCredentialsForIdentityCommand extends $Command<\n GetCredentialsForIdentityCommandInput,\n GetCredentialsForIdentityCommandOutput,\n CognitoIdentityClientResolvedConfig\n> {\n // Start section: command_properties\n // End section: command_properties\n\n constructor(readonly input: GetCredentialsForIdentityCommandInput) {\n // Start section: command_constructor\n super();\n // End section: command_constructor\n }\n\n /**\n * @internal\n */\n resolveMiddleware(\n clientStack: MiddlewareStack,\n configuration: CognitoIdentityClientResolvedConfig,\n options?: __HttpHandlerOptions\n ): Handler {\n this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));\n\n const stack = clientStack.concat(this.middlewareStack);\n\n const { logger } = configuration;\n const clientName = \"CognitoIdentityClient\";\n const commandName = \"GetCredentialsForIdentityCommand\";\n const handlerExecutionContext: HandlerExecutionContext = {\n logger,\n clientName,\n commandName,\n inputFilterSensitiveLog: GetCredentialsForIdentityInput.filterSensitiveLog,\n outputFilterSensitiveLog: GetCredentialsForIdentityResponse.filterSensitiveLog,\n };\n const { requestHandler } = configuration;\n return stack.resolve(\n (request: FinalizeHandlerArguments) =>\n requestHandler.handle(request.request as __HttpRequest, options || {}),\n handlerExecutionContext\n );\n }\n\n private serialize(input: GetCredentialsForIdentityCommandInput, context: __SerdeContext): Promise<__HttpRequest> {\n return serializeAws_json1_1GetCredentialsForIdentityCommand(input, context);\n }\n\n private deserialize(\n output: __HttpResponse,\n context: __SerdeContext\n ): Promise {\n return deserializeAws_json1_1GetCredentialsForIdentityCommand(output, context);\n }\n\n // Start section: command_body_extra\n // End section: command_body_extra\n}\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","/**\n * An error representing a failure of an individual credential provider.\n *\n * This error class has special meaning to the {@link chain} method. If a\n * provider in the chain is rejected with an error, the chain will only proceed\n * to the next provider if the value of the `tryNextLink` property on the error\n * is truthy. This allows individual providers to halt the chain and also\n * ensures the chain will stop if an entirely unexpected error is encountered.\n */\nexport class ProviderError extends Error {\n constructor(message: string, public readonly tryNextLink: boolean = true) {\n super(message);\n }\n}\n","import { Logins, ResolvedLogins } from \"./Logins\";\n\n/**\n * @internal\n */\nexport function resolveLogins(logins: Logins): Promise {\n return Promise.all(\n Object.keys(logins).reduce((arr: Array<[string, string] | Promise<[string, string]>>, name: string) => {\n const tokenOrProvider = logins[name];\n if (typeof tokenOrProvider === \"string\") {\n arr.push([name, tokenOrProvider] as [string, string]);\n } else {\n arr.push(tokenOrProvider().then((token) => [name, token] as [string, string]));\n }\n return arr;\n }, [] as Array>)\n ).then((resolvedPairs) =>\n resolvedPairs.reduce((logins: ResolvedLogins, [key, value]) => {\n logins[key] = value;\n return logins;\n }, {} as ResolvedLogins)\n );\n}\n","import { GetCredentialsForIdentityCommand } from \"@aws-sdk/client-cognito-identity\";\nimport { ProviderError } from \"@aws-sdk/property-provider\";\nimport { CredentialProvider, Credentials } from \"@aws-sdk/types\";\n\nimport { CognitoProviderParameters } from \"./CognitoProviderParameters\";\nimport { resolveLogins } from \"./resolveLogins\";\n\nexport interface CognitoIdentityCredentials extends Credentials {\n /**\n * The Cognito ID returned by the last call to AWS.CognitoIdentity.getOpenIdToken().\n */\n identityId: string;\n}\n\n/**\n * Retrieves temporary AWS credentials using Amazon Cognito's\n * `GetCredentialsForIdentity` operation.\n *\n * Results from this function call are not cached internally.\n */\nexport function fromCognitoIdentity(parameters: FromCognitoIdentityParameters): CredentialProvider {\n return async (): Promise => {\n const {\n Credentials: {\n AccessKeyId = throwOnMissingAccessKeyId(),\n Expiration,\n SecretKey = throwOnMissingSecretKey(),\n SessionToken,\n } = throwOnMissingCredentials(),\n } = await parameters.client.send(\n new GetCredentialsForIdentityCommand({\n CustomRoleArn: parameters.customRoleArn,\n IdentityId: parameters.identityId,\n Logins: parameters.logins ? await resolveLogins(parameters.logins) : undefined,\n })\n );\n\n return {\n identityId: parameters.identityId,\n accessKeyId: AccessKeyId,\n secretAccessKey: SecretKey,\n sessionToken: SessionToken,\n expiration: Expiration,\n };\n };\n}\n\nexport interface FromCognitoIdentityParameters extends CognitoProviderParameters {\n /**\n * The unique identifier for the identity against which credentials will be\n * issued.\n */\n identityId: string;\n}\n\nfunction throwOnMissingAccessKeyId(): never {\n throw new ProviderError(\"Response from Amazon Cognito contained no access key ID\");\n}\n\nfunction throwOnMissingCredentials(): never {\n throw new ProviderError(\"Response from Amazon Cognito contained no credentials\");\n}\n\nfunction throwOnMissingSecretKey(): never {\n throw new ProviderError(\"Response from Amazon Cognito contained no secret key\");\n}\n","import { CognitoIdentityClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from \"../CognitoIdentityClient\";\nimport { GetIdInput, GetIdResponse } from \"../models/models_0\";\nimport { deserializeAws_json1_1GetIdCommand, serializeAws_json1_1GetIdCommand } from \"../protocols/Aws_json1_1\";\nimport { getSerdePlugin } from \"@aws-sdk/middleware-serde\";\nimport { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from \"@aws-sdk/protocol-http\";\nimport { Command as $Command } from \"@aws-sdk/smithy-client\";\nimport {\n FinalizeHandlerArguments,\n Handler,\n HandlerExecutionContext,\n MiddlewareStack,\n HttpHandlerOptions as __HttpHandlerOptions,\n MetadataBearer as __MetadataBearer,\n SerdeContext as __SerdeContext,\n} from \"@aws-sdk/types\";\n\nexport type GetIdCommandInput = GetIdInput;\nexport type GetIdCommandOutput = GetIdResponse & __MetadataBearer;\n\n/**\n *
Generates (or retrieves) a Cognito ID. Supplying multiple logins will create an\n * implicit linked account.
\n *
This is a public API. You do not need any credentials to call this API.
\n */\nexport class GetIdCommand extends $Command {\n // Start section: command_properties\n // End section: command_properties\n\n constructor(readonly input: GetIdCommandInput) {\n // Start section: command_constructor\n super();\n // End section: command_constructor\n }\n\n /**\n * @internal\n */\n resolveMiddleware(\n clientStack: MiddlewareStack,\n configuration: CognitoIdentityClientResolvedConfig,\n options?: __HttpHandlerOptions\n ): Handler {\n this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));\n\n const stack = clientStack.concat(this.middlewareStack);\n\n const { logger } = configuration;\n const clientName = \"CognitoIdentityClient\";\n const commandName = \"GetIdCommand\";\n const handlerExecutionContext: HandlerExecutionContext = {\n logger,\n clientName,\n commandName,\n inputFilterSensitiveLog: GetIdInput.filterSensitiveLog,\n outputFilterSensitiveLog: GetIdResponse.filterSensitiveLog,\n };\n const { requestHandler } = configuration;\n return stack.resolve(\n (request: FinalizeHandlerArguments) =>\n requestHandler.handle(request.request as __HttpRequest, options || {}),\n handlerExecutionContext\n );\n }\n\n private serialize(input: GetIdCommandInput, context: __SerdeContext): Promise<__HttpRequest> {\n return serializeAws_json1_1GetIdCommand(input, context);\n }\n\n private deserialize(output: __HttpResponse, context: __SerdeContext): Promise {\n return deserializeAws_json1_1GetIdCommand(output, context);\n }\n\n // Start section: command_body_extra\n // End section: command_body_extra\n}\n","import { Storage } from \"./Storage\";\n\nconst STORE_NAME = \"IdentityIds\";\n\nexport class IndexedDbStorage implements Storage {\n constructor(private readonly dbName: string = \"aws:cognito-identity-ids\") {}\n\n getItem(key: string): Promise {\n return this.withObjectStore(\"readonly\", (store) => {\n const req = store.get(key);\n\n return new Promise((resolve) => {\n req.onerror = () => resolve(null);\n\n req.onsuccess = () => resolve(req.result ? req.result.value : null);\n });\n }).catch(() => null);\n }\n\n removeItem(key: string): Promise {\n return this.withObjectStore(\"readwrite\", (store) => {\n const req = store.delete(key);\n\n return new Promise((resolve, reject) => {\n req.onerror = () => reject(req.error);\n\n req.onsuccess = () => resolve();\n });\n });\n }\n\n setItem(id: string, value: string): Promise {\n return this.withObjectStore(\"readwrite\", (store) => {\n const req = store.put({ id, value });\n\n return new Promise((resolve, reject) => {\n req.onerror = () => reject(req.error);\n\n req.onsuccess = () => resolve();\n });\n });\n }\n\n private getDb(): Promise {\n const openDbRequest = self.indexedDB.open(this.dbName, 1);\n return new Promise((resolve, reject) => {\n openDbRequest.onsuccess = () => {\n resolve(openDbRequest.result);\n };\n\n openDbRequest.onerror = () => {\n reject(openDbRequest.error);\n };\n\n openDbRequest.onblocked = () => {\n reject(new Error(\"Unable to access DB\"));\n };\n\n openDbRequest.onupgradeneeded = () => {\n const db = openDbRequest.result;\n db.onerror = () => {\n reject(new Error(\"Failed to create object store\"));\n };\n\n db.createObjectStore(STORE_NAME, { keyPath: \"id\" });\n };\n });\n }\n\n private withObjectStore(mode: IDBTransactionMode, action: (store: IDBObjectStore) => Promise): Promise {\n return this.getDb().then((db) => {\n const tx = db.transaction(STORE_NAME, mode);\n tx.oncomplete = () => db.close();\n\n return new Promise((resolve, reject) => {\n tx.onerror = () => reject(tx.error);\n\n resolve(action(tx.objectStore(STORE_NAME)));\n }).catch((err) => {\n db.close();\n throw err;\n });\n });\n }\n}\n","import { IndexedDbStorage } from \"./IndexedDbStorage\";\nimport { InMemoryStorage } from \"./InMemoryStorage\";\nimport { Storage } from \"./Storage\";\n\nconst inMemoryStorage = new InMemoryStorage();\n\nexport function localStorage(): Storage {\n if (typeof self === \"object\" && self.indexedDB) {\n return new IndexedDbStorage();\n }\n\n if (typeof window === \"object\" && window.localStorage) {\n return window.localStorage;\n }\n\n return inMemoryStorage;\n}\n","import { Storage } from \"./Storage\";\n\nexport class InMemoryStorage implements Storage {\n constructor(private store: { [key: string]: string } = {}) {}\n\n getItem(key: string): string | null {\n if (key in this.store) {\n return this.store[key];\n }\n\n return null;\n }\n\n removeItem(key: string): void {\n delete this.store[key];\n }\n\n setItem(key: string, value: string): void {\n this.store[key] = value;\n }\n}\n","import { GetIdCommand } from \"@aws-sdk/client-cognito-identity\";\nimport { ProviderError } from \"@aws-sdk/property-provider\";\nimport { CredentialProvider } from \"@aws-sdk/types\";\n\nimport { CognitoProviderParameters } from \"./CognitoProviderParameters\";\nimport { fromCognitoIdentity } from \"./fromCognitoIdentity\";\nimport { localStorage } from \"./localStorage\";\nimport { resolveLogins } from \"./resolveLogins\";\nimport { Storage } from \"./Storage\";\n\n/**\n * Retrieves or generates a unique identifier using Amazon Cognito's `GetId`\n * operation, then generates temporary AWS credentials using Amazon Cognito's\n * `GetCredentialsForIdentity` operation.\n *\n * Results from `GetId` are cached internally, but results from\n * `GetCredentialsForIdentity` are not.\n */\nexport function fromCognitoIdentityPool({\n accountId,\n cache = localStorage(),\n client,\n customRoleArn,\n identityPoolId,\n logins,\n userIdentifier = !logins || Object.keys(logins).length === 0 ? \"ANONYMOUS\" : undefined,\n}: FromCognitoIdentityPoolParameters): CredentialProvider {\n const cacheKey = userIdentifier ? `aws:cognito-identity-credentials:${identityPoolId}:${userIdentifier}` : undefined;\n\n let provider: CredentialProvider = async () => {\n let identityId = cacheKey && (await cache.getItem(cacheKey));\n if (!identityId) {\n const { IdentityId = throwOnMissingId() } = await client.send(\n new GetIdCommand({\n AccountId: accountId,\n IdentityPoolId: identityPoolId,\n Logins: logins ? await resolveLogins(logins) : undefined,\n })\n );\n identityId = IdentityId;\n if (cacheKey) {\n Promise.resolve(cache.setItem(cacheKey, identityId)).catch(() => {});\n }\n }\n\n provider = fromCognitoIdentity({\n client,\n customRoleArn,\n logins,\n identityId,\n });\n\n return provider();\n };\n\n return () =>\n provider().catch(async (err) => {\n if (cacheKey) {\n Promise.resolve(cache.removeItem(cacheKey)).catch(() => {});\n }\n\n throw err;\n });\n}\n\nexport interface FromCognitoIdentityPoolParameters extends CognitoProviderParameters {\n /**\n * A standard AWS account ID (9+ digits).\n */\n accountId?: string;\n\n /**\n * A cache in which to store resolved Cognito IdentityIds. If not supplied,\n * the credential provider will attempt to store IdentityIds in one of the\n * following (in order of preference):\n * 1. IndexedDB\n * 2. LocalStorage\n * 3. An in-memory cache object that will not persist between pages.\n *\n * IndexedDB is preferred to maximize data sharing between top-level\n * browsing contexts and web workers.\n *\n * The provider will not cache IdentityIds of authenticated users unless a\n * separate `userIdentitifer` parameter is supplied.\n */\n cache?: Storage;\n\n /**\n * The unique identifier for the identity pool from which an identity should\n * be retrieved or generated.\n */\n identityPoolId: string;\n\n /**\n * A unique identifier for the user. This is distinct from a Cognito\n * IdentityId and should instead be an identifier meaningful to your\n * application. Used to cache Cognito IdentityIds on a per-user basis.\n */\n userIdentifier?: string;\n}\n\nfunction throwOnMissingId(): never {\n throw new ProviderError(\"Response from Amazon Cognito contained no identity ID\");\n}\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","/*! *****************************************************************************\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","export const escapeUri = (uri: string): string =>\n // AWS percent-encodes some extra non-standard characters in a URI\n encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode);\n\nconst hexEncode = (c: string) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`;\n","const alphabetByEncoding: { [key: string]: number } = {};\nconst alphabetByValue: Array = new Array(64);\n\nfor (let i = 0, start = \"A\".charCodeAt(0), limit = \"Z\".charCodeAt(0); i + start <= limit; i++) {\n const char = String.fromCharCode(i + start);\n alphabetByEncoding[char] = i;\n alphabetByValue[i] = char;\n}\n\nfor (let i = 0, start = \"a\".charCodeAt(0), limit = \"z\".charCodeAt(0); i + start <= limit; i++) {\n const char = String.fromCharCode(i + start);\n const index = i + 26;\n alphabetByEncoding[char] = index;\n alphabetByValue[index] = char;\n}\n\nfor (let i = 0; i < 10; i++) {\n alphabetByEncoding[i.toString(10)] = i + 52;\n const char = i.toString(10);\n const index = i + 52;\n alphabetByEncoding[char] = index;\n alphabetByValue[index] = char;\n}\n\nalphabetByEncoding[\"+\"] = 62;\nalphabetByValue[62] = \"+\";\nalphabetByEncoding[\"/\"] = 63;\nalphabetByValue[63] = \"/\";\n\nconst bitsPerLetter = 6;\nconst bitsPerByte = 8;\nconst maxLetterValue = 0b111111;\n\n/**\n * Converts a base-64 encoded string to a Uint8Array of bytes.\n *\n * @param input The base-64 encoded string\n *\n * @see https://tools.ietf.org/html/rfc4648#section-4\n */\nexport function fromBase64(input: string): Uint8Array {\n let totalByteLength = (input.length / 4) * 3;\n if (input.substr(-2) === \"==\") {\n totalByteLength -= 2;\n } else if (input.substr(-1) === \"=\") {\n totalByteLength--;\n }\n const out = new ArrayBuffer(totalByteLength);\n const dataView = new DataView(out);\n for (let i = 0; i < input.length; i += 4) {\n let bits = 0;\n let bitLength = 0;\n for (let j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n bitLength += bitsPerLetter;\n } else {\n bits >>= bitsPerLetter;\n }\n }\n\n const chunkOffset = (i / 4) * 3;\n bits >>= bitLength % bitsPerByte;\n const byteLength = Math.floor(bitLength / bitsPerByte);\n for (let k = 0; k < byteLength; k++) {\n const offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n }\n }\n\n return new Uint8Array(out);\n}\n\n/**\n * Converts a Uint8Array of binary data to a base-64 encoded string.\n *\n * @param input The binary data to encode\n *\n * @see https://tools.ietf.org/html/rfc4648#section-4\n */\nexport function toBase64(input: Uint8Array): string {\n let str = \"\";\n for (let i = 0; i < input.length; i += 3) {\n let bits = 0;\n let bitLength = 0;\n for (let j = i, limit = Math.min(i + 3, input.length); j < limit; j++) {\n bits |= input[j] << ((limit - j - 1) * bitsPerByte);\n bitLength += bitsPerByte;\n }\n\n const bitClusterCount = Math.ceil(bitLength / bitsPerLetter);\n bits <<= bitClusterCount * bitsPerLetter - bitLength;\n for (let k = 1; k <= bitClusterCount; k++) {\n const offset = (bitClusterCount - k) * bitsPerLetter;\n str += alphabetByValue[(bits & (maxLetterValue << offset)) >> offset];\n }\n\n str += \"==\".slice(0, 4 - bitClusterCount);\n }\n\n return str;\n}\n","import { HttpHandler, HttpRequest, HttpResponse } from \"@aws-sdk/protocol-http\";\nimport { buildQueryString } from \"@aws-sdk/querystring-builder\";\nimport { HeaderBag, HttpHandlerOptions } from \"@aws-sdk/types\";\n\nimport { requestTimeout } from \"./request-timeout\";\n\ndeclare let AbortController: any;\n\n/**\n * Represents the http options that can be passed to a browser http client.\n */\nexport interface FetchHttpHandlerOptions {\n /**\n * The number of milliseconds a request can take before being automatically\n * terminated.\n */\n requestTimeout?: number;\n}\n\nexport class FetchHttpHandler implements HttpHandler {\n private readonly requestTimeout?: number;\n\n constructor({ requestTimeout }: FetchHttpHandlerOptions = {}) {\n this.requestTimeout = requestTimeout;\n }\n\n destroy(): void {\n // Do nothing. TLS and HTTP/2 connection pooling is handled by the browser.\n }\n\n handle(request: HttpRequest, { abortSignal }: HttpHandlerOptions = {}): Promise<{ response: HttpResponse }> {\n const requestTimeoutInMs = this.requestTimeout;\n\n // if the request was already aborted, prevent doing extra work\n if (abortSignal?.aborted) {\n const abortError = new Error(\"Request aborted\");\n abortError.name = \"AbortError\";\n return Promise.reject(abortError);\n }\n\n let path = request.path;\n if (request.query) {\n const queryString = buildQueryString(request.query);\n if (queryString) {\n path += `?${queryString}`;\n }\n }\n\n const { port, method } = request;\n const url = `${request.protocol}//${request.hostname}${port ? `:${port}` : \"\"}${path}`;\n // Request constructor doesn't allow GET/HEAD request with body\n // ref: https://github.com/whatwg/fetch/issues/551\n const body = method === \"GET\" || method === \"HEAD\" ? undefined : request.body;\n const requestOptions: RequestInit = {\n body,\n headers: new Headers(request.headers),\n method: method,\n };\n\n // some browsers support abort signal\n if (typeof AbortController !== \"undefined\") {\n (requestOptions as any)[\"signal\"] = abortSignal;\n }\n\n const fetchRequest = new Request(url, requestOptions);\n const raceOfPromises = [\n fetch(fetchRequest).then((response) => {\n const fetchHeaders: any = response.headers;\n const transformedHeaders: HeaderBag = {};\n\n for (const pair of >fetchHeaders.entries()) {\n transformedHeaders[pair[0]] = pair[1];\n }\n\n const hasReadableStream = response.body !== undefined;\n\n // Return the response with buffered body\n if (!hasReadableStream) {\n return response.blob().then((body) => ({\n response: new HttpResponse({\n headers: transformedHeaders,\n statusCode: response.status,\n body,\n }),\n }));\n }\n // Return the response with streaming body\n return {\n response: new HttpResponse({\n headers: transformedHeaders,\n statusCode: response.status,\n body: response.body,\n }),\n };\n }),\n requestTimeout(requestTimeoutInMs),\n ];\n if (abortSignal) {\n raceOfPromises.push(\n new Promise((resolve, reject) => {\n abortSignal.onabort = () => {\n const abortError = new Error(\"Request aborted\");\n abortError.name = \"AbortError\";\n reject(abortError);\n };\n })\n );\n }\n return Promise.race(raceOfPromises);\n }\n}\n","import { QueryParameterBag } from \"@aws-sdk/types\";\nimport { escapeUri } from \"@aws-sdk/util-uri-escape\";\n\nexport function buildQueryString(query: QueryParameterBag): string {\n const parts: string[] = [];\n for (let key of Object.keys(query).sort()) {\n const value = query[key];\n key = escapeUri(key);\n if (Array.isArray(value)) {\n for (let i = 0, iLen = value.length; i < iLen; i++) {\n parts.push(`${key}=${escapeUri(value[i])}`);\n }\n } else {\n let qsEntry = key;\n if (value || typeof value === \"string\") {\n qsEntry += `=${escapeUri(value)}`;\n }\n parts.push(qsEntry);\n }\n }\n\n return parts.join(\"&\");\n}\n","export function requestTimeout(timeoutInMs = 0): Promise {\n return new Promise((resolve, reject) => {\n if (timeoutInMs) {\n setTimeout(() => {\n const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`);\n timeoutError.name = \"TimeoutError\";\n reject(timeoutError);\n }, timeoutInMs);\n }\n });\n}\n","import { StreamCollector } from \"@aws-sdk/types\";\nimport { fromBase64 } from \"@aws-sdk/util-base64-browser\";\n\n//reference: https://snack.expo.io/r1JCSWRGU\nexport const streamCollector: StreamCollector = (stream: Blob | ReadableStream): Promise => {\n if (typeof Blob === \"function\" && stream instanceof Blob) {\n return collectBlob(stream);\n }\n\n return collectStream(stream as ReadableStream);\n};\n\nasync function collectBlob(blob: Blob): Promise {\n const base64 = await readToBase64(blob);\n const arrayBuffer = fromBase64(base64);\n return new Uint8Array(arrayBuffer);\n}\n\nasync function collectStream(stream: ReadableStream): Promise {\n let res = new Uint8Array(0);\n const reader = stream.getReader();\n let isDone = false;\n while (!isDone) {\n const { done, value } = await reader.read();\n if (value) {\n const prior = res;\n res = new Uint8Array(prior.length + value.length);\n res.set(prior);\n res.set(value, prior.length);\n }\n isDone = done;\n }\n return res;\n}\n\nfunction readToBase64(blob: Blob): Promise {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => {\n // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL\n // response from readAsDataURL is always prepended with \"data:*/*;base64,\"\n if (reader.readyState !== 2) {\n return reject(new Error(\"Reader aborted too early\"));\n }\n const result = (reader.result ?? \"\") as string;\n // Response can include only 'data:' for empty blob, return empty string in this case.\n // Otherwise, return the string after ','\n const commaIndex = result.indexOf(\",\");\n const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;\n resolve(result.substring(dataOffset));\n };\n reader.onabort = () => reject(new Error(\"Read aborted\"));\n reader.onerror = () => reject(reader.error);\n // reader.readAsArrayBuffer is not always available\n reader.readAsDataURL(blob);\n });\n}\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 {\n AbsoluteLocation,\n FinalizeHandler,\n FinalizeHandlerArguments,\n FinalizeHandlerOutput,\n FinalizeRequestHandlerOptions,\n HandlerExecutionContext,\n MetadataBearer,\n Pluggable,\n} from \"@aws-sdk/types\";\n\nimport { RetryResolvedConfig } from \"./configurations\";\n\nexport const retryMiddleware = (options: RetryResolvedConfig) =>