@aws-sdk/client-verifiedpermissions 3.451.0 → 3.458.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UpdatePolicyTemplateCommand = exports.de_UpdatePolicyStoreCommand = exports.de_UpdatePolicyCommand = exports.de_UpdateIdentitySourceCommand = exports.de_PutSchemaCommand = exports.de_ListPolicyTemplatesCommand = exports.de_ListPolicyStoresCommand = exports.de_ListPoliciesCommand = exports.de_ListIdentitySourcesCommand = exports.de_IsAuthorizedWithTokenCommand = exports.de_IsAuthorizedCommand = exports.de_GetSchemaCommand = exports.de_GetPolicyTemplateCommand = exports.de_GetPolicyStoreCommand = exports.de_GetPolicyCommand = exports.de_GetIdentitySourceCommand = exports.de_DeletePolicyTemplateCommand = exports.de_DeletePolicyStoreCommand = exports.de_DeletePolicyCommand = exports.de_DeleteIdentitySourceCommand = exports.de_CreatePolicyTemplateCommand = exports.de_CreatePolicyStoreCommand = exports.de_CreatePolicyCommand = exports.de_CreateIdentitySourceCommand = exports.se_UpdatePolicyTemplateCommand = exports.se_UpdatePolicyStoreCommand = exports.se_UpdatePolicyCommand = exports.se_UpdateIdentitySourceCommand = exports.se_PutSchemaCommand = exports.se_ListPolicyTemplatesCommand = exports.se_ListPolicyStoresCommand = exports.se_ListPoliciesCommand = exports.se_ListIdentitySourcesCommand = exports.se_IsAuthorizedWithTokenCommand = exports.se_IsAuthorizedCommand = exports.se_GetSchemaCommand = exports.se_GetPolicyTemplateCommand = exports.se_GetPolicyStoreCommand = exports.se_GetPolicyCommand = exports.se_GetIdentitySourceCommand = exports.se_DeletePolicyTemplateCommand = exports.se_DeletePolicyStoreCommand = exports.se_DeletePolicyCommand = exports.se_DeleteIdentitySourceCommand = exports.se_CreatePolicyTemplateCommand = exports.se_CreatePolicyStoreCommand = exports.se_CreatePolicyCommand = exports.se_CreateIdentitySourceCommand = void 0;
3
+ exports.de_UpdatePolicyTemplateCommand = exports.de_UpdatePolicyStoreCommand = exports.de_UpdatePolicyCommand = exports.de_UpdateIdentitySourceCommand = exports.de_PutSchemaCommand = exports.de_ListPolicyTemplatesCommand = exports.de_ListPolicyStoresCommand = exports.de_ListPoliciesCommand = exports.de_ListIdentitySourcesCommand = exports.de_IsAuthorizedWithTokenCommand = exports.de_IsAuthorizedCommand = exports.de_GetSchemaCommand = exports.de_GetPolicyTemplateCommand = exports.de_GetPolicyStoreCommand = exports.de_GetPolicyCommand = exports.de_GetIdentitySourceCommand = exports.de_DeletePolicyTemplateCommand = exports.de_DeletePolicyStoreCommand = exports.de_DeletePolicyCommand = exports.de_DeleteIdentitySourceCommand = exports.de_CreatePolicyTemplateCommand = exports.de_CreatePolicyStoreCommand = exports.de_CreatePolicyCommand = exports.de_CreateIdentitySourceCommand = exports.de_BatchIsAuthorizedCommand = exports.se_UpdatePolicyTemplateCommand = exports.se_UpdatePolicyStoreCommand = exports.se_UpdatePolicyCommand = exports.se_UpdateIdentitySourceCommand = exports.se_PutSchemaCommand = exports.se_ListPolicyTemplatesCommand = exports.se_ListPolicyStoresCommand = exports.se_ListPoliciesCommand = exports.se_ListIdentitySourcesCommand = exports.se_IsAuthorizedWithTokenCommand = exports.se_IsAuthorizedCommand = exports.se_GetSchemaCommand = exports.se_GetPolicyTemplateCommand = exports.se_GetPolicyStoreCommand = exports.se_GetPolicyCommand = exports.se_GetIdentitySourceCommand = exports.se_DeletePolicyTemplateCommand = exports.se_DeletePolicyStoreCommand = exports.se_DeletePolicyCommand = exports.se_DeleteIdentitySourceCommand = exports.se_CreatePolicyTemplateCommand = exports.se_CreatePolicyStoreCommand = exports.se_CreatePolicyCommand = exports.se_CreateIdentitySourceCommand = exports.se_BatchIsAuthorizedCommand = void 0;
4
4
  const core_1 = require("@aws-sdk/core");
5
5
  const protocol_http_1 = require("@smithy/protocol-http");
6
6
  const smithy_client_1 = require("@smithy/smithy-client");
7
7
  const uuid_1 = require("uuid");
8
8
  const models_0_1 = require("../models/models_0");
9
9
  const VerifiedPermissionsServiceException_1 = require("../models/VerifiedPermissionsServiceException");
10
+ const se_BatchIsAuthorizedCommand = async (input, context) => {
11
+ const headers = sharedHeaders("BatchIsAuthorized");
12
+ let body;
13
+ body = JSON.stringify(se_BatchIsAuthorizedInput(input, context));
14
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
15
+ };
16
+ exports.se_BatchIsAuthorizedCommand = se_BatchIsAuthorizedCommand;
10
17
  const se_CreateIdentitySourceCommand = async (input, context) => {
11
18
  const headers = sharedHeaders("CreateIdentitySource");
12
19
  let body;
@@ -175,6 +182,51 @@ const se_UpdatePolicyTemplateCommand = async (input, context) => {
175
182
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
176
183
  };
177
184
  exports.se_UpdatePolicyTemplateCommand = se_UpdatePolicyTemplateCommand;
185
+ const de_BatchIsAuthorizedCommand = async (output, context) => {
186
+ if (output.statusCode >= 300) {
187
+ return de_BatchIsAuthorizedCommandError(output, context);
188
+ }
189
+ const data = await parseBody(output.body, context);
190
+ let contents = {};
191
+ contents = de_BatchIsAuthorizedOutput(data, context);
192
+ const response = {
193
+ $metadata: deserializeMetadata(output),
194
+ ...contents,
195
+ };
196
+ return response;
197
+ };
198
+ exports.de_BatchIsAuthorizedCommand = de_BatchIsAuthorizedCommand;
199
+ const de_BatchIsAuthorizedCommandError = async (output, context) => {
200
+ const parsedOutput = {
201
+ ...output,
202
+ body: await parseErrorBody(output.body, context),
203
+ };
204
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
205
+ switch (errorCode) {
206
+ case "AccessDeniedException":
207
+ case "com.amazonaws.verifiedpermissions#AccessDeniedException":
208
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
209
+ case "InternalServerException":
210
+ case "com.amazonaws.verifiedpermissions#InternalServerException":
211
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
212
+ case "ResourceNotFoundException":
213
+ case "com.amazonaws.verifiedpermissions#ResourceNotFoundException":
214
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
215
+ case "ThrottlingException":
216
+ case "com.amazonaws.verifiedpermissions#ThrottlingException":
217
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
218
+ case "ValidationException":
219
+ case "com.amazonaws.verifiedpermissions#ValidationException":
220
+ throw await de_ValidationExceptionRes(parsedOutput, context);
221
+ default:
222
+ const parsedBody = parsedOutput.body;
223
+ return throwDefaultError({
224
+ output,
225
+ parsedBody,
226
+ errorCode,
227
+ });
228
+ }
229
+ };
178
230
  const de_CreateIdentitySourceCommand = async (output, context) => {
179
231
  if (output.statusCode >= 300) {
180
232
  return de_CreateIdentitySourceCommandError(output, context);
@@ -1374,6 +1426,28 @@ const se_AttributeValue = (input, context) => {
1374
1426
  _: (name, value) => ({ name: value }),
1375
1427
  });
1376
1428
  };
1429
+ const se_BatchIsAuthorizedInput = (input, context) => {
1430
+ return (0, smithy_client_1.take)(input, {
1431
+ entities: (_) => se_EntitiesDefinition(_, context),
1432
+ policyStoreId: [],
1433
+ requests: (_) => se_BatchIsAuthorizedInputList(_, context),
1434
+ });
1435
+ };
1436
+ const se_BatchIsAuthorizedInputItem = (input, context) => {
1437
+ return (0, smithy_client_1.take)(input, {
1438
+ action: smithy_client_1._json,
1439
+ context: (_) => se_ContextDefinition(_, context),
1440
+ principal: smithy_client_1._json,
1441
+ resource: smithy_client_1._json,
1442
+ });
1443
+ };
1444
+ const se_BatchIsAuthorizedInputList = (input, context) => {
1445
+ return input
1446
+ .filter((e) => e != null)
1447
+ .map((entry) => {
1448
+ return se_BatchIsAuthorizedInputItem(entry, context);
1449
+ });
1450
+ };
1377
1451
  const se_ContextDefinition = (input, context) => {
1378
1452
  return models_0_1.ContextDefinition.visit(input, {
1379
1453
  contextMap: (value) => ({ contextMap: se_ContextMap(value, context) }),
@@ -1484,6 +1558,79 @@ const se_SetAttribute = (input, context) => {
1484
1558
  return se_AttributeValue(entry, context);
1485
1559
  });
1486
1560
  };
1561
+ const de_AttributeValue = (output, context) => {
1562
+ if ((0, smithy_client_1.expectBoolean)(output.boolean) !== undefined) {
1563
+ return { boolean: (0, smithy_client_1.expectBoolean)(output.boolean) };
1564
+ }
1565
+ if (output.entityIdentifier != null) {
1566
+ return {
1567
+ entityIdentifier: (0, smithy_client_1._json)(output.entityIdentifier),
1568
+ };
1569
+ }
1570
+ if ((0, smithy_client_1.expectLong)(output.long) !== undefined) {
1571
+ return { long: (0, smithy_client_1.expectLong)(output.long) };
1572
+ }
1573
+ if (output.record != null) {
1574
+ return {
1575
+ record: de_RecordAttribute(output.record, context),
1576
+ };
1577
+ }
1578
+ if (output.set != null) {
1579
+ return {
1580
+ set: de_SetAttribute(output.set, context),
1581
+ };
1582
+ }
1583
+ if ((0, smithy_client_1.expectString)(output.string) !== undefined) {
1584
+ return { string: (0, smithy_client_1.expectString)(output.string) };
1585
+ }
1586
+ return { $unknown: Object.entries(output)[0] };
1587
+ };
1588
+ const de_BatchIsAuthorizedInputItem = (output, context) => {
1589
+ return (0, smithy_client_1.take)(output, {
1590
+ action: smithy_client_1._json,
1591
+ context: (_) => de_ContextDefinition((0, core_1.awsExpectUnion)(_), context),
1592
+ principal: smithy_client_1._json,
1593
+ resource: smithy_client_1._json,
1594
+ });
1595
+ };
1596
+ const de_BatchIsAuthorizedOutput = (output, context) => {
1597
+ return (0, smithy_client_1.take)(output, {
1598
+ results: (_) => de_BatchIsAuthorizedOutputList(_, context),
1599
+ });
1600
+ };
1601
+ const de_BatchIsAuthorizedOutputItem = (output, context) => {
1602
+ return (0, smithy_client_1.take)(output, {
1603
+ decision: smithy_client_1.expectString,
1604
+ determiningPolicies: smithy_client_1._json,
1605
+ errors: smithy_client_1._json,
1606
+ request: (_) => de_BatchIsAuthorizedInputItem(_, context),
1607
+ });
1608
+ };
1609
+ const de_BatchIsAuthorizedOutputList = (output, context) => {
1610
+ const retVal = (output || [])
1611
+ .filter((e) => e != null)
1612
+ .map((entry) => {
1613
+ return de_BatchIsAuthorizedOutputItem(entry, context);
1614
+ });
1615
+ return retVal;
1616
+ };
1617
+ const de_ContextDefinition = (output, context) => {
1618
+ if (output.contextMap != null) {
1619
+ return {
1620
+ contextMap: de_ContextMap(output.contextMap, context),
1621
+ };
1622
+ }
1623
+ return { $unknown: Object.entries(output)[0] };
1624
+ };
1625
+ const de_ContextMap = (output, context) => {
1626
+ return Object.entries(output).reduce((acc, [key, value]) => {
1627
+ if (value === null) {
1628
+ return acc;
1629
+ }
1630
+ acc[key] = de_AttributeValue((0, core_1.awsExpectUnion)(value), context);
1631
+ return acc;
1632
+ }, {});
1633
+ };
1487
1634
  const de_CreateIdentitySourceOutput = (output, context) => {
1488
1635
  return (0, smithy_client_1.take)(output, {
1489
1636
  createdDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
@@ -1670,6 +1817,23 @@ const de_PutSchemaOutput = (output, context) => {
1670
1817
  policyStoreId: smithy_client_1.expectString,
1671
1818
  });
1672
1819
  };
1820
+ const de_RecordAttribute = (output, context) => {
1821
+ return Object.entries(output).reduce((acc, [key, value]) => {
1822
+ if (value === null) {
1823
+ return acc;
1824
+ }
1825
+ acc[key] = de_AttributeValue((0, core_1.awsExpectUnion)(value), context);
1826
+ return acc;
1827
+ }, {});
1828
+ };
1829
+ const de_SetAttribute = (output, context) => {
1830
+ const retVal = (output || [])
1831
+ .filter((e) => e != null)
1832
+ .map((entry) => {
1833
+ return de_AttributeValue((0, core_1.awsExpectUnion)(entry), context);
1834
+ });
1835
+ return retVal;
1836
+ };
1673
1837
  const de_UpdateIdentitySourceOutput = (output, context) => {
1674
1838
  return (0, smithy_client_1.take)(output, {
1675
1839
  createdDate: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
@@ -1,4 +1,5 @@
1
1
  import { createAggregatedClient } from "@smithy/smithy-client";
2
+ import { BatchIsAuthorizedCommand, } from "./commands/BatchIsAuthorizedCommand";
2
3
  import { CreateIdentitySourceCommand, } from "./commands/CreateIdentitySourceCommand";
3
4
  import { CreatePolicyCommand, } from "./commands/CreatePolicyCommand";
4
5
  import { CreatePolicyStoreCommand, } from "./commands/CreatePolicyStoreCommand";
@@ -25,6 +26,7 @@ import { UpdatePolicyStoreCommand, } from "./commands/UpdatePolicyStoreCommand";
25
26
  import { UpdatePolicyTemplateCommand, } from "./commands/UpdatePolicyTemplateCommand";
26
27
  import { VerifiedPermissionsClient } from "./VerifiedPermissionsClient";
27
28
  const commands = {
29
+ BatchIsAuthorizedCommand,
28
30
  CreateIdentitySourceCommand,
29
31
  CreatePolicyCommand,
30
32
  CreatePolicyStoreCommand,
@@ -0,0 +1,48 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ import { BatchIsAuthorizedInputFilterSensitiveLog, BatchIsAuthorizedOutputFilterSensitiveLog, } from "../models/models_0";
6
+ import { de_BatchIsAuthorizedCommand, se_BatchIsAuthorizedCommand } from "../protocols/Aws_json1_0";
7
+ export { $Command };
8
+ export class BatchIsAuthorizedCommand extends $Command {
9
+ static getEndpointParameterInstructions() {
10
+ return {
11
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
12
+ Endpoint: { type: "builtInParams", name: "endpoint" },
13
+ Region: { type: "builtInParams", name: "region" },
14
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
15
+ };
16
+ }
17
+ constructor(input) {
18
+ super();
19
+ this.input = input;
20
+ }
21
+ resolveMiddleware(clientStack, configuration, options) {
22
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
23
+ this.middlewareStack.use(getEndpointPlugin(configuration, BatchIsAuthorizedCommand.getEndpointParameterInstructions()));
24
+ const stack = clientStack.concat(this.middlewareStack);
25
+ const { logger } = configuration;
26
+ const clientName = "VerifiedPermissionsClient";
27
+ const commandName = "BatchIsAuthorizedCommand";
28
+ const handlerExecutionContext = {
29
+ logger,
30
+ clientName,
31
+ commandName,
32
+ inputFilterSensitiveLog: BatchIsAuthorizedInputFilterSensitiveLog,
33
+ outputFilterSensitiveLog: BatchIsAuthorizedOutputFilterSensitiveLog,
34
+ [SMITHY_CONTEXT_KEY]: {
35
+ service: "VerifiedPermissions",
36
+ operation: "BatchIsAuthorized",
37
+ },
38
+ };
39
+ const { requestHandler } = configuration;
40
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
41
+ }
42
+ serialize(input, context) {
43
+ return se_BatchIsAuthorizedCommand(input, context);
44
+ }
45
+ deserialize(output, context) {
46
+ return de_BatchIsAuthorizedCommand(output, context);
47
+ }
48
+ }
@@ -1,3 +1,4 @@
1
+ export * from "./BatchIsAuthorizedCommand";
1
2
  export * from "./CreateIdentitySourceCommand";
2
3
  export * from "./CreatePolicyCommand";
3
4
  export * from "./CreatePolicyStoreCommand";
@@ -12,34 +12,10 @@ export class AccessDeniedException extends __BaseException {
12
12
  Object.setPrototypeOf(this, AccessDeniedException.prototype);
13
13
  }
14
14
  }
15
- export var Configuration;
16
- (function (Configuration) {
17
- Configuration.visit = (value, visitor) => {
18
- if (value.cognitoUserPoolConfiguration !== undefined)
19
- return visitor.cognitoUserPoolConfiguration(value.cognitoUserPoolConfiguration);
20
- return visitor._(value.$unknown[0], value.$unknown[1]);
21
- };
22
- })(Configuration || (Configuration = {}));
23
- export const ResourceType = {
24
- IDENTITY_SOURCE: "IDENTITY_SOURCE",
25
- POLICY: "POLICY",
26
- POLICY_STORE: "POLICY_STORE",
27
- POLICY_TEMPLATE: "POLICY_TEMPLATE",
28
- SCHEMA: "SCHEMA",
15
+ export const Decision = {
16
+ ALLOW: "ALLOW",
17
+ DENY: "DENY",
29
18
  };
30
- export class ConflictException extends __BaseException {
31
- constructor(opts) {
32
- super({
33
- name: "ConflictException",
34
- $fault: "client",
35
- ...opts,
36
- });
37
- this.name = "ConflictException";
38
- this.$fault = "client";
39
- Object.setPrototypeOf(this, ConflictException.prototype);
40
- this.resources = opts.resources;
41
- }
42
- }
43
19
  export class InternalServerException extends __BaseException {
44
20
  constructor(opts) {
45
21
  super({
@@ -53,6 +29,13 @@ export class InternalServerException extends __BaseException {
53
29
  Object.setPrototypeOf(this, InternalServerException.prototype);
54
30
  }
55
31
  }
32
+ export const ResourceType = {
33
+ IDENTITY_SOURCE: "IDENTITY_SOURCE",
34
+ POLICY: "POLICY",
35
+ POLICY_STORE: "POLICY_STORE",
36
+ POLICY_TEMPLATE: "POLICY_TEMPLATE",
37
+ SCHEMA: "SCHEMA",
38
+ };
56
39
  export class ResourceNotFoundException extends __BaseException {
57
40
  constructor(opts) {
58
41
  super({
@@ -67,22 +50,6 @@ export class ResourceNotFoundException extends __BaseException {
67
50
  this.resourceType = opts.resourceType;
68
51
  }
69
52
  }
70
- export class ServiceQuotaExceededException extends __BaseException {
71
- constructor(opts) {
72
- super({
73
- name: "ServiceQuotaExceededException",
74
- $fault: "client",
75
- ...opts,
76
- });
77
- this.name = "ServiceQuotaExceededException";
78
- this.$fault = "client";
79
- Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype);
80
- this.resourceId = opts.resourceId;
81
- this.resourceType = opts.resourceType;
82
- this.serviceCode = opts.serviceCode;
83
- this.quotaCode = opts.quotaCode;
84
- }
85
- }
86
53
  export class ThrottlingException extends __BaseException {
87
54
  constructor(opts) {
88
55
  super({
@@ -113,6 +80,43 @@ export class ValidationException extends __BaseException {
113
80
  this.fieldList = opts.fieldList;
114
81
  }
115
82
  }
83
+ export var Configuration;
84
+ (function (Configuration) {
85
+ Configuration.visit = (value, visitor) => {
86
+ if (value.cognitoUserPoolConfiguration !== undefined)
87
+ return visitor.cognitoUserPoolConfiguration(value.cognitoUserPoolConfiguration);
88
+ return visitor._(value.$unknown[0], value.$unknown[1]);
89
+ };
90
+ })(Configuration || (Configuration = {}));
91
+ export class ConflictException extends __BaseException {
92
+ constructor(opts) {
93
+ super({
94
+ name: "ConflictException",
95
+ $fault: "client",
96
+ ...opts,
97
+ });
98
+ this.name = "ConflictException";
99
+ this.$fault = "client";
100
+ Object.setPrototypeOf(this, ConflictException.prototype);
101
+ this.resources = opts.resources;
102
+ }
103
+ }
104
+ export class ServiceQuotaExceededException extends __BaseException {
105
+ constructor(opts) {
106
+ super({
107
+ name: "ServiceQuotaExceededException",
108
+ $fault: "client",
109
+ ...opts,
110
+ });
111
+ this.name = "ServiceQuotaExceededException";
112
+ this.$fault = "client";
113
+ Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype);
114
+ this.resourceId = opts.resourceId;
115
+ this.resourceType = opts.resourceType;
116
+ this.serviceCode = opts.serviceCode;
117
+ this.quotaCode = opts.quotaCode;
118
+ }
119
+ }
116
120
  export var PolicyDefinition;
117
121
  (function (PolicyDefinition) {
118
122
  PolicyDefinition.visit = (value, visitor) => {
@@ -131,10 +135,6 @@ export const ValidationMode = {
131
135
  OFF: "OFF",
132
136
  STRICT: "STRICT",
133
137
  };
134
- export const Decision = {
135
- ALLOW: "ALLOW",
136
- DENY: "DENY",
137
- };
138
138
  export var EntityReference;
139
139
  (function (EntityReference) {
140
140
  EntityReference.visit = (value, visitor) => {
@@ -236,6 +236,9 @@ export const EntityIdentifierFilterSensitiveLog = (obj) => ({
236
236
  ...(obj.entityType && { entityType: SENSITIVE_STRING }),
237
237
  ...(obj.entityId && { entityId: SENSITIVE_STRING }),
238
238
  });
239
+ export const EvaluationErrorItemFilterSensitiveLog = (obj) => ({
240
+ ...obj,
241
+ });
239
242
  export const CognitoUserPoolConfigurationFilterSensitiveLog = (obj) => ({
240
243
  ...obj,
241
244
  ...(obj.clientIds && { clientIds: SENSITIVE_STRING }),
@@ -293,9 +296,6 @@ export const EntityReferenceFilterSensitiveLog = (obj) => {
293
296
  if (obj.$unknown !== undefined)
294
297
  return { [obj.$unknown[0]]: "UNKNOWN" };
295
298
  };
296
- export const EvaluationErrorItemFilterSensitiveLog = (obj) => ({
297
- ...obj,
298
- });
299
299
  export const IdentitySourceDetailsFilterSensitiveLog = (obj) => ({
300
300
  ...obj,
301
301
  ...(obj.clientIds && { clientIds: SENSITIVE_STRING }),
@@ -507,12 +507,28 @@ export const EntityItemFilterSensitiveLog = (obj) => ({
507
507
  }),
508
508
  ...(obj.parents && { parents: obj.parents.map((item) => EntityIdentifierFilterSensitiveLog(item)) }),
509
509
  });
510
+ export const BatchIsAuthorizedInputItemFilterSensitiveLog = (obj) => ({
511
+ ...obj,
512
+ ...(obj.principal && { principal: EntityIdentifierFilterSensitiveLog(obj.principal) }),
513
+ ...(obj.action && { action: ActionIdentifierFilterSensitiveLog(obj.action) }),
514
+ ...(obj.resource && { resource: EntityIdentifierFilterSensitiveLog(obj.resource) }),
515
+ ...(obj.context && { context: ContextDefinitionFilterSensitiveLog(obj.context) }),
516
+ });
517
+ export const BatchIsAuthorizedOutputItemFilterSensitiveLog = (obj) => ({
518
+ ...obj,
519
+ ...(obj.request && { request: BatchIsAuthorizedInputItemFilterSensitiveLog(obj.request) }),
520
+ ...(obj.errors && { errors: SENSITIVE_STRING }),
521
+ });
510
522
  export const EntitiesDefinitionFilterSensitiveLog = (obj) => {
511
523
  if (obj.entityList !== undefined)
512
524
  return { entityList: obj.entityList.map((item) => EntityItemFilterSensitiveLog(item)) };
513
525
  if (obj.$unknown !== undefined)
514
526
  return { [obj.$unknown[0]]: "UNKNOWN" };
515
527
  };
528
+ export const BatchIsAuthorizedOutputFilterSensitiveLog = (obj) => ({
529
+ ...obj,
530
+ ...(obj.results && { results: obj.results.map((item) => BatchIsAuthorizedOutputItemFilterSensitiveLog(item)) }),
531
+ });
516
532
  export const IsAuthorizedInputFilterSensitiveLog = (obj) => ({
517
533
  ...obj,
518
534
  ...(obj.principal && { principal: EntityIdentifierFilterSensitiveLog(obj.principal) }),
@@ -530,3 +546,8 @@ export const IsAuthorizedWithTokenInputFilterSensitiveLog = (obj) => ({
530
546
  ...(obj.context && { context: ContextDefinitionFilterSensitiveLog(obj.context) }),
531
547
  ...(obj.entities && { entities: EntitiesDefinitionFilterSensitiveLog(obj.entities) }),
532
548
  });
549
+ export const BatchIsAuthorizedInputFilterSensitiveLog = (obj) => ({
550
+ ...obj,
551
+ ...(obj.entities && { entities: EntitiesDefinitionFilterSensitiveLog(obj.entities) }),
552
+ ...(obj.requests && { requests: obj.requests.map((item) => BatchIsAuthorizedInputItemFilterSensitiveLog(item)) }),
553
+ });
@@ -1,9 +1,15 @@
1
1
  import { awsExpectUnion as __expectUnion } from "@aws-sdk/core";
2
2
  import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
3
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, take, withBaseException, } from "@smithy/smithy-client";
3
+ import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, expectNonNull as __expectNonNull, expectString as __expectString, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, take, withBaseException, } from "@smithy/smithy-client";
4
4
  import { v4 as generateIdempotencyToken } from "uuid";
5
5
  import { AccessDeniedException, AttributeValue, ConflictException, ContextDefinition, EntitiesDefinition, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
6
6
  import { VerifiedPermissionsServiceException as __BaseException } from "../models/VerifiedPermissionsServiceException";
7
+ export const se_BatchIsAuthorizedCommand = async (input, context) => {
8
+ const headers = sharedHeaders("BatchIsAuthorized");
9
+ let body;
10
+ body = JSON.stringify(se_BatchIsAuthorizedInput(input, context));
11
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
12
+ };
7
13
  export const se_CreateIdentitySourceCommand = async (input, context) => {
8
14
  const headers = sharedHeaders("CreateIdentitySource");
9
15
  let body;
@@ -148,6 +154,50 @@ export const se_UpdatePolicyTemplateCommand = async (input, context) => {
148
154
  body = JSON.stringify(_json(input));
149
155
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
150
156
  };
157
+ export const de_BatchIsAuthorizedCommand = async (output, context) => {
158
+ if (output.statusCode >= 300) {
159
+ return de_BatchIsAuthorizedCommandError(output, context);
160
+ }
161
+ const data = await parseBody(output.body, context);
162
+ let contents = {};
163
+ contents = de_BatchIsAuthorizedOutput(data, context);
164
+ const response = {
165
+ $metadata: deserializeMetadata(output),
166
+ ...contents,
167
+ };
168
+ return response;
169
+ };
170
+ const de_BatchIsAuthorizedCommandError = async (output, context) => {
171
+ const parsedOutput = {
172
+ ...output,
173
+ body: await parseErrorBody(output.body, context),
174
+ };
175
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
176
+ switch (errorCode) {
177
+ case "AccessDeniedException":
178
+ case "com.amazonaws.verifiedpermissions#AccessDeniedException":
179
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
180
+ case "InternalServerException":
181
+ case "com.amazonaws.verifiedpermissions#InternalServerException":
182
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
183
+ case "ResourceNotFoundException":
184
+ case "com.amazonaws.verifiedpermissions#ResourceNotFoundException":
185
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
186
+ case "ThrottlingException":
187
+ case "com.amazonaws.verifiedpermissions#ThrottlingException":
188
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
189
+ case "ValidationException":
190
+ case "com.amazonaws.verifiedpermissions#ValidationException":
191
+ throw await de_ValidationExceptionRes(parsedOutput, context);
192
+ default:
193
+ const parsedBody = parsedOutput.body;
194
+ return throwDefaultError({
195
+ output,
196
+ parsedBody,
197
+ errorCode,
198
+ });
199
+ }
200
+ };
151
201
  export const de_CreateIdentitySourceCommand = async (output, context) => {
152
202
  if (output.statusCode >= 300) {
153
203
  return de_CreateIdentitySourceCommandError(output, context);
@@ -1323,6 +1373,28 @@ const se_AttributeValue = (input, context) => {
1323
1373
  _: (name, value) => ({ name: value }),
1324
1374
  });
1325
1375
  };
1376
+ const se_BatchIsAuthorizedInput = (input, context) => {
1377
+ return take(input, {
1378
+ entities: (_) => se_EntitiesDefinition(_, context),
1379
+ policyStoreId: [],
1380
+ requests: (_) => se_BatchIsAuthorizedInputList(_, context),
1381
+ });
1382
+ };
1383
+ const se_BatchIsAuthorizedInputItem = (input, context) => {
1384
+ return take(input, {
1385
+ action: _json,
1386
+ context: (_) => se_ContextDefinition(_, context),
1387
+ principal: _json,
1388
+ resource: _json,
1389
+ });
1390
+ };
1391
+ const se_BatchIsAuthorizedInputList = (input, context) => {
1392
+ return input
1393
+ .filter((e) => e != null)
1394
+ .map((entry) => {
1395
+ return se_BatchIsAuthorizedInputItem(entry, context);
1396
+ });
1397
+ };
1326
1398
  const se_ContextDefinition = (input, context) => {
1327
1399
  return ContextDefinition.visit(input, {
1328
1400
  contextMap: (value) => ({ contextMap: se_ContextMap(value, context) }),
@@ -1433,6 +1505,79 @@ const se_SetAttribute = (input, context) => {
1433
1505
  return se_AttributeValue(entry, context);
1434
1506
  });
1435
1507
  };
1508
+ const de_AttributeValue = (output, context) => {
1509
+ if (__expectBoolean(output.boolean) !== undefined) {
1510
+ return { boolean: __expectBoolean(output.boolean) };
1511
+ }
1512
+ if (output.entityIdentifier != null) {
1513
+ return {
1514
+ entityIdentifier: _json(output.entityIdentifier),
1515
+ };
1516
+ }
1517
+ if (__expectLong(output.long) !== undefined) {
1518
+ return { long: __expectLong(output.long) };
1519
+ }
1520
+ if (output.record != null) {
1521
+ return {
1522
+ record: de_RecordAttribute(output.record, context),
1523
+ };
1524
+ }
1525
+ if (output.set != null) {
1526
+ return {
1527
+ set: de_SetAttribute(output.set, context),
1528
+ };
1529
+ }
1530
+ if (__expectString(output.string) !== undefined) {
1531
+ return { string: __expectString(output.string) };
1532
+ }
1533
+ return { $unknown: Object.entries(output)[0] };
1534
+ };
1535
+ const de_BatchIsAuthorizedInputItem = (output, context) => {
1536
+ return take(output, {
1537
+ action: _json,
1538
+ context: (_) => de_ContextDefinition(__expectUnion(_), context),
1539
+ principal: _json,
1540
+ resource: _json,
1541
+ });
1542
+ };
1543
+ const de_BatchIsAuthorizedOutput = (output, context) => {
1544
+ return take(output, {
1545
+ results: (_) => de_BatchIsAuthorizedOutputList(_, context),
1546
+ });
1547
+ };
1548
+ const de_BatchIsAuthorizedOutputItem = (output, context) => {
1549
+ return take(output, {
1550
+ decision: __expectString,
1551
+ determiningPolicies: _json,
1552
+ errors: _json,
1553
+ request: (_) => de_BatchIsAuthorizedInputItem(_, context),
1554
+ });
1555
+ };
1556
+ const de_BatchIsAuthorizedOutputList = (output, context) => {
1557
+ const retVal = (output || [])
1558
+ .filter((e) => e != null)
1559
+ .map((entry) => {
1560
+ return de_BatchIsAuthorizedOutputItem(entry, context);
1561
+ });
1562
+ return retVal;
1563
+ };
1564
+ const de_ContextDefinition = (output, context) => {
1565
+ if (output.contextMap != null) {
1566
+ return {
1567
+ contextMap: de_ContextMap(output.contextMap, context),
1568
+ };
1569
+ }
1570
+ return { $unknown: Object.entries(output)[0] };
1571
+ };
1572
+ const de_ContextMap = (output, context) => {
1573
+ return Object.entries(output).reduce((acc, [key, value]) => {
1574
+ if (value === null) {
1575
+ return acc;
1576
+ }
1577
+ acc[key] = de_AttributeValue(__expectUnion(value), context);
1578
+ return acc;
1579
+ }, {});
1580
+ };
1436
1581
  const de_CreateIdentitySourceOutput = (output, context) => {
1437
1582
  return take(output, {
1438
1583
  createdDate: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
@@ -1619,6 +1764,23 @@ const de_PutSchemaOutput = (output, context) => {
1619
1764
  policyStoreId: __expectString,
1620
1765
  });
1621
1766
  };
1767
+ const de_RecordAttribute = (output, context) => {
1768
+ return Object.entries(output).reduce((acc, [key, value]) => {
1769
+ if (value === null) {
1770
+ return acc;
1771
+ }
1772
+ acc[key] = de_AttributeValue(__expectUnion(value), context);
1773
+ return acc;
1774
+ }, {});
1775
+ };
1776
+ const de_SetAttribute = (output, context) => {
1777
+ const retVal = (output || [])
1778
+ .filter((e) => e != null)
1779
+ .map((entry) => {
1780
+ return de_AttributeValue(__expectUnion(entry), context);
1781
+ });
1782
+ return retVal;
1783
+ };
1622
1784
  const de_UpdateIdentitySourceOutput = (output, context) => {
1623
1785
  return take(output, {
1624
1786
  createdDate: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
@@ -1,4 +1,5 @@
1
1
  import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
2
+ import { BatchIsAuthorizedCommandInput, BatchIsAuthorizedCommandOutput } from "./commands/BatchIsAuthorizedCommand";
2
3
  import { CreateIdentitySourceCommandInput, CreateIdentitySourceCommandOutput } from "./commands/CreateIdentitySourceCommand";
3
4
  import { CreatePolicyCommandInput, CreatePolicyCommandOutput } from "./commands/CreatePolicyCommand";
4
5
  import { CreatePolicyStoreCommandInput, CreatePolicyStoreCommandOutput } from "./commands/CreatePolicyStoreCommand";
@@ -25,6 +26,12 @@ import { UpdatePolicyStoreCommandInput, UpdatePolicyStoreCommandOutput } from ".
25
26
  import { UpdatePolicyTemplateCommandInput, UpdatePolicyTemplateCommandOutput } from "./commands/UpdatePolicyTemplateCommand";
26
27
  import { VerifiedPermissionsClient } from "./VerifiedPermissionsClient";
27
28
  export interface VerifiedPermissions {
29
+ /**
30
+ * @see {@link BatchIsAuthorizedCommand}
31
+ */
32
+ batchIsAuthorized(args: BatchIsAuthorizedCommandInput, options?: __HttpHandlerOptions): Promise<BatchIsAuthorizedCommandOutput>;
33
+ batchIsAuthorized(args: BatchIsAuthorizedCommandInput, cb: (err: any, data?: BatchIsAuthorizedCommandOutput) => void): void;
34
+ batchIsAuthorized(args: BatchIsAuthorizedCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: BatchIsAuthorizedCommandOutput) => void): void;
28
35
  /**
29
36
  * @see {@link CreateIdentitySourceCommand}
30
37
  */