@aws-sdk/client-connect 3.223.0 → 3.225.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.
Files changed (86) hide show
  1. package/dist-cjs/Connect.js +75 -0
  2. package/dist-cjs/commands/CreateRuleCommand.js +46 -0
  3. package/dist-cjs/commands/DeleteRuleCommand.js +46 -0
  4. package/dist-cjs/commands/DescribeRuleCommand.js +46 -0
  5. package/dist-cjs/commands/ListContactReferencesCommand.js +2 -1
  6. package/dist-cjs/commands/ListDefaultVocabulariesCommand.js +3 -3
  7. package/dist-cjs/commands/ListHoursOfOperationsCommand.js +3 -3
  8. package/dist-cjs/commands/ListInstanceAttributesCommand.js +3 -3
  9. package/dist-cjs/commands/ListInstanceStorageConfigsCommand.js +3 -3
  10. package/dist-cjs/commands/ListInstancesCommand.js +3 -3
  11. package/dist-cjs/commands/ListIntegrationAssociationsCommand.js +3 -3
  12. package/dist-cjs/commands/ListRulesCommand.js +46 -0
  13. package/dist-cjs/commands/UpdateRuleCommand.js +46 -0
  14. package/dist-cjs/commands/index.js +5 -0
  15. package/dist-cjs/endpoint/ruleset.js +1 -10
  16. package/dist-cjs/models/models_0.js +104 -134
  17. package/dist-cjs/models/models_1.js +139 -8
  18. package/dist-cjs/pagination/ListRulesPaginator.js +36 -0
  19. package/dist-cjs/pagination/index.js +1 -0
  20. package/dist-cjs/protocols/Aws_restJson1.js +606 -7
  21. package/dist-es/Connect.js +75 -0
  22. package/dist-es/commands/CreateRuleCommand.js +42 -0
  23. package/dist-es/commands/DeleteRuleCommand.js +42 -0
  24. package/dist-es/commands/DescribeRuleCommand.js +42 -0
  25. package/dist-es/commands/ListContactReferencesCommand.js +2 -1
  26. package/dist-es/commands/ListDefaultVocabulariesCommand.js +1 -1
  27. package/dist-es/commands/ListHoursOfOperationsCommand.js +1 -1
  28. package/dist-es/commands/ListInstanceAttributesCommand.js +1 -1
  29. package/dist-es/commands/ListInstanceStorageConfigsCommand.js +1 -1
  30. package/dist-es/commands/ListInstancesCommand.js +1 -1
  31. package/dist-es/commands/ListIntegrationAssociationsCommand.js +1 -1
  32. package/dist-es/commands/ListRulesCommand.js +42 -0
  33. package/dist-es/commands/UpdateRuleCommand.js +42 -0
  34. package/dist-es/commands/index.js +5 -0
  35. package/dist-es/endpoint/ruleset.js +1 -10
  36. package/dist-es/models/models_0.js +83 -107
  37. package/dist-es/models/models_1.js +111 -3
  38. package/dist-es/pagination/ListRulesPaginator.js +32 -0
  39. package/dist-es/pagination/index.js +1 -0
  40. package/dist-es/protocols/Aws_restJson1.js +589 -0
  41. package/dist-types/Connect.d.ts +44 -4
  42. package/dist-types/ConnectClient.d.ts +7 -2
  43. package/dist-types/commands/ClaimPhoneNumberCommand.d.ts +5 -1
  44. package/dist-types/commands/CreateRuleCommand.d.ts +37 -0
  45. package/dist-types/commands/DeleteRuleCommand.d.ts +37 -0
  46. package/dist-types/commands/DescribeRuleCommand.d.ts +37 -0
  47. package/dist-types/commands/DismissUserContactCommand.d.ts +1 -1
  48. package/dist-types/commands/ListContactReferencesCommand.d.ts +2 -1
  49. package/dist-types/commands/ListDefaultVocabulariesCommand.d.ts +1 -1
  50. package/dist-types/commands/ListHoursOfOperationsCommand.d.ts +1 -1
  51. package/dist-types/commands/ListInstanceAttributesCommand.d.ts +1 -1
  52. package/dist-types/commands/ListInstanceStorageConfigsCommand.d.ts +1 -1
  53. package/dist-types/commands/ListInstancesCommand.d.ts +1 -1
  54. package/dist-types/commands/ListIntegrationAssociationsCommand.d.ts +1 -1
  55. package/dist-types/commands/ListRulesCommand.d.ts +37 -0
  56. package/dist-types/commands/MonitorContactCommand.d.ts +3 -2
  57. package/dist-types/commands/UpdateRuleCommand.d.ts +37 -0
  58. package/dist-types/commands/index.d.ts +5 -0
  59. package/dist-types/endpoint/EndpointParameters.d.ts +1 -1
  60. package/dist-types/models/models_0.d.ts +373 -516
  61. package/dist-types/models/models_1.d.ts +628 -29
  62. package/dist-types/pagination/ListRulesPaginator.d.ts +4 -0
  63. package/dist-types/pagination/index.d.ts +1 -0
  64. package/dist-types/protocols/Aws_restJson1.d.ts +15 -0
  65. package/dist-types/ts3.4/Connect.d.ts +85 -0
  66. package/dist-types/ts3.4/ConnectClient.d.ts +30 -0
  67. package/dist-types/ts3.4/commands/CreateRuleCommand.d.ts +34 -0
  68. package/dist-types/ts3.4/commands/DeleteRuleCommand.d.ts +32 -0
  69. package/dist-types/ts3.4/commands/DescribeRuleCommand.d.ts +34 -0
  70. package/dist-types/ts3.4/commands/ListContactReferencesCommand.d.ts +2 -4
  71. package/dist-types/ts3.4/commands/ListDefaultVocabulariesCommand.d.ts +1 -1
  72. package/dist-types/ts3.4/commands/ListHoursOfOperationsCommand.d.ts +1 -1
  73. package/dist-types/ts3.4/commands/ListInstanceAttributesCommand.d.ts +1 -1
  74. package/dist-types/ts3.4/commands/ListInstanceStorageConfigsCommand.d.ts +1 -1
  75. package/dist-types/ts3.4/commands/ListInstancesCommand.d.ts +1 -1
  76. package/dist-types/ts3.4/commands/ListIntegrationAssociationsCommand.d.ts +1 -1
  77. package/dist-types/ts3.4/commands/ListRulesCommand.d.ts +34 -0
  78. package/dist-types/ts3.4/commands/UpdateRuleCommand.d.ts +32 -0
  79. package/dist-types/ts3.4/commands/index.d.ts +5 -0
  80. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +1 -1
  81. package/dist-types/ts3.4/models/models_0.d.ts +147 -249
  82. package/dist-types/ts3.4/models/models_1.d.ts +294 -6
  83. package/dist-types/ts3.4/pagination/ListRulesPaginator.d.ts +11 -0
  84. package/dist-types/ts3.4/pagination/index.d.ts +1 -0
  85. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +60 -0
  86. package/package.json +28 -28
@@ -493,6 +493,34 @@ export const serializeAws_restJson1CreateRoutingProfileCommand = async (input, c
493
493
  body,
494
494
  });
495
495
  };
496
+ export const serializeAws_restJson1CreateRuleCommand = async (input, context) => {
497
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
498
+ const headers = {
499
+ "content-type": "application/json",
500
+ };
501
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/rules/{InstanceId}";
502
+ resolvedPath = __resolvedPath(resolvedPath, input, "InstanceId", () => input.InstanceId, "{InstanceId}", false);
503
+ let body;
504
+ body = JSON.stringify({
505
+ ...(input.Actions != null && { Actions: serializeAws_restJson1RuleActions(input.Actions, context) }),
506
+ ClientToken: input.ClientToken ?? generateIdempotencyToken(),
507
+ ...(input.Function != null && { Function: input.Function }),
508
+ ...(input.Name != null && { Name: input.Name }),
509
+ ...(input.PublishStatus != null && { PublishStatus: input.PublishStatus }),
510
+ ...(input.TriggerEventSource != null && {
511
+ TriggerEventSource: serializeAws_restJson1RuleTriggerEventSource(input.TriggerEventSource, context),
512
+ }),
513
+ });
514
+ return new __HttpRequest({
515
+ protocol,
516
+ hostname,
517
+ port,
518
+ method: "POST",
519
+ headers,
520
+ path: resolvedPath,
521
+ body,
522
+ });
523
+ };
496
524
  export const serializeAws_restJson1CreateSecurityProfileCommand = async (input, context) => {
497
525
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
498
526
  const headers = {
@@ -792,6 +820,23 @@ export const serializeAws_restJson1DeleteQuickConnectCommand = async (input, con
792
820
  body,
793
821
  });
794
822
  };
823
+ export const serializeAws_restJson1DeleteRuleCommand = async (input, context) => {
824
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
825
+ const headers = {};
826
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/rules/{InstanceId}/{RuleId}";
827
+ resolvedPath = __resolvedPath(resolvedPath, input, "InstanceId", () => input.InstanceId, "{InstanceId}", false);
828
+ resolvedPath = __resolvedPath(resolvedPath, input, "RuleId", () => input.RuleId, "{RuleId}", false);
829
+ let body;
830
+ return new __HttpRequest({
831
+ protocol,
832
+ hostname,
833
+ port,
834
+ method: "DELETE",
835
+ headers,
836
+ path: resolvedPath,
837
+ body,
838
+ });
839
+ };
795
840
  export const serializeAws_restJson1DeleteSecurityProfileCommand = async (input, context) => {
796
841
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
797
842
  const headers = {};
@@ -1131,6 +1176,23 @@ export const serializeAws_restJson1DescribeRoutingProfileCommand = async (input,
1131
1176
  body,
1132
1177
  });
1133
1178
  };
1179
+ export const serializeAws_restJson1DescribeRuleCommand = async (input, context) => {
1180
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1181
+ const headers = {};
1182
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/rules/{InstanceId}/{RuleId}";
1183
+ resolvedPath = __resolvedPath(resolvedPath, input, "InstanceId", () => input.InstanceId, "{InstanceId}", false);
1184
+ resolvedPath = __resolvedPath(resolvedPath, input, "RuleId", () => input.RuleId, "{RuleId}", false);
1185
+ let body;
1186
+ return new __HttpRequest({
1187
+ protocol,
1188
+ hostname,
1189
+ port,
1190
+ method: "GET",
1191
+ headers,
1192
+ path: resolvedPath,
1193
+ body,
1194
+ });
1195
+ };
1134
1196
  export const serializeAws_restJson1DescribeSecurityProfileCommand = async (input, context) => {
1135
1197
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1136
1198
  const headers = {};
@@ -2108,6 +2170,29 @@ export const serializeAws_restJson1ListRoutingProfilesCommand = async (input, co
2108
2170
  body,
2109
2171
  });
2110
2172
  };
2173
+ export const serializeAws_restJson1ListRulesCommand = async (input, context) => {
2174
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
2175
+ const headers = {};
2176
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/rules/{InstanceId}";
2177
+ resolvedPath = __resolvedPath(resolvedPath, input, "InstanceId", () => input.InstanceId, "{InstanceId}", false);
2178
+ const query = map({
2179
+ publishStatus: [, input.PublishStatus],
2180
+ eventSourceName: [, input.EventSourceName],
2181
+ maxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
2182
+ nextToken: [, input.NextToken],
2183
+ });
2184
+ let body;
2185
+ return new __HttpRequest({
2186
+ protocol,
2187
+ hostname,
2188
+ port,
2189
+ method: "GET",
2190
+ headers,
2191
+ path: resolvedPath,
2192
+ query,
2193
+ body,
2194
+ });
2195
+ };
2111
2196
  export const serializeAws_restJson1ListSecurityKeysCommand = async (input, context) => {
2112
2197
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
2113
2198
  const headers = {};
@@ -3451,6 +3536,31 @@ export const serializeAws_restJson1UpdateRoutingProfileQueuesCommand = async (in
3451
3536
  body,
3452
3537
  });
3453
3538
  };
3539
+ export const serializeAws_restJson1UpdateRuleCommand = async (input, context) => {
3540
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
3541
+ const headers = {
3542
+ "content-type": "application/json",
3543
+ };
3544
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/rules/{InstanceId}/{RuleId}";
3545
+ resolvedPath = __resolvedPath(resolvedPath, input, "RuleId", () => input.RuleId, "{RuleId}", false);
3546
+ resolvedPath = __resolvedPath(resolvedPath, input, "InstanceId", () => input.InstanceId, "{InstanceId}", false);
3547
+ let body;
3548
+ body = JSON.stringify({
3549
+ ...(input.Actions != null && { Actions: serializeAws_restJson1RuleActions(input.Actions, context) }),
3550
+ ...(input.Function != null && { Function: input.Function }),
3551
+ ...(input.Name != null && { Name: input.Name }),
3552
+ ...(input.PublishStatus != null && { PublishStatus: input.PublishStatus }),
3553
+ });
3554
+ return new __HttpRequest({
3555
+ protocol,
3556
+ hostname,
3557
+ port,
3558
+ method: "PUT",
3559
+ headers,
3560
+ path: resolvedPath,
3561
+ body,
3562
+ });
3563
+ };
3454
3564
  export const serializeAws_restJson1UpdateSecurityProfileCommand = async (input, context) => {
3455
3565
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
3456
3566
  const headers = {
@@ -4701,6 +4811,60 @@ const deserializeAws_restJson1CreateRoutingProfileCommandError = async (output,
4701
4811
  });
4702
4812
  }
4703
4813
  };
4814
+ export const deserializeAws_restJson1CreateRuleCommand = async (output, context) => {
4815
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
4816
+ return deserializeAws_restJson1CreateRuleCommandError(output, context);
4817
+ }
4818
+ const contents = map({
4819
+ $metadata: deserializeMetadata(output),
4820
+ });
4821
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
4822
+ if (data.RuleArn != null) {
4823
+ contents.RuleArn = __expectString(data.RuleArn);
4824
+ }
4825
+ if (data.RuleId != null) {
4826
+ contents.RuleId = __expectString(data.RuleId);
4827
+ }
4828
+ return contents;
4829
+ };
4830
+ const deserializeAws_restJson1CreateRuleCommandError = async (output, context) => {
4831
+ const parsedOutput = {
4832
+ ...output,
4833
+ body: await parseErrorBody(output.body, context),
4834
+ };
4835
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
4836
+ switch (errorCode) {
4837
+ case "AccessDeniedException":
4838
+ case "com.amazonaws.connect#AccessDeniedException":
4839
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
4840
+ case "InternalServiceException":
4841
+ case "com.amazonaws.connect#InternalServiceException":
4842
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
4843
+ case "InvalidRequestException":
4844
+ case "com.amazonaws.connect#InvalidRequestException":
4845
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
4846
+ case "ResourceConflictException":
4847
+ case "com.amazonaws.connect#ResourceConflictException":
4848
+ throw await deserializeAws_restJson1ResourceConflictExceptionResponse(parsedOutput, context);
4849
+ case "ResourceNotFoundException":
4850
+ case "com.amazonaws.connect#ResourceNotFoundException":
4851
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
4852
+ case "ServiceQuotaExceededException":
4853
+ case "com.amazonaws.connect#ServiceQuotaExceededException":
4854
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
4855
+ case "ThrottlingException":
4856
+ case "com.amazonaws.connect#ThrottlingException":
4857
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
4858
+ default:
4859
+ const parsedBody = parsedOutput.body;
4860
+ throwDefaultError({
4861
+ output,
4862
+ parsedBody,
4863
+ exceptionCtor: __BaseException,
4864
+ errorCode,
4865
+ });
4866
+ }
4867
+ };
4704
4868
  export const deserializeAws_restJson1CreateSecurityProfileCommand = async (output, context) => {
4705
4869
  if (output.statusCode !== 200 && output.statusCode >= 300) {
4706
4870
  return deserializeAws_restJson1CreateSecurityProfileCommandError(output, context);
@@ -5325,6 +5489,48 @@ const deserializeAws_restJson1DeleteQuickConnectCommandError = async (output, co
5325
5489
  });
5326
5490
  }
5327
5491
  };
5492
+ export const deserializeAws_restJson1DeleteRuleCommand = async (output, context) => {
5493
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
5494
+ return deserializeAws_restJson1DeleteRuleCommandError(output, context);
5495
+ }
5496
+ const contents = map({
5497
+ $metadata: deserializeMetadata(output),
5498
+ });
5499
+ await collectBody(output.body, context);
5500
+ return contents;
5501
+ };
5502
+ const deserializeAws_restJson1DeleteRuleCommandError = async (output, context) => {
5503
+ const parsedOutput = {
5504
+ ...output,
5505
+ body: await parseErrorBody(output.body, context),
5506
+ };
5507
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
5508
+ switch (errorCode) {
5509
+ case "AccessDeniedException":
5510
+ case "com.amazonaws.connect#AccessDeniedException":
5511
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
5512
+ case "InternalServiceException":
5513
+ case "com.amazonaws.connect#InternalServiceException":
5514
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
5515
+ case "InvalidRequestException":
5516
+ case "com.amazonaws.connect#InvalidRequestException":
5517
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
5518
+ case "ResourceNotFoundException":
5519
+ case "com.amazonaws.connect#ResourceNotFoundException":
5520
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
5521
+ case "ThrottlingException":
5522
+ case "com.amazonaws.connect#ThrottlingException":
5523
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
5524
+ default:
5525
+ const parsedBody = parsedOutput.body;
5526
+ throwDefaultError({
5527
+ output,
5528
+ parsedBody,
5529
+ exceptionCtor: __BaseException,
5530
+ errorCode,
5531
+ });
5532
+ }
5533
+ };
5328
5534
  export const deserializeAws_restJson1DeleteSecurityProfileCommand = async (output, context) => {
5329
5535
  if (output.statusCode !== 200 && output.statusCode >= 300) {
5330
5536
  return deserializeAws_restJson1DeleteSecurityProfileCommandError(output, context);
@@ -6177,6 +6383,51 @@ const deserializeAws_restJson1DescribeRoutingProfileCommandError = async (output
6177
6383
  });
6178
6384
  }
6179
6385
  };
6386
+ export const deserializeAws_restJson1DescribeRuleCommand = async (output, context) => {
6387
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
6388
+ return deserializeAws_restJson1DescribeRuleCommandError(output, context);
6389
+ }
6390
+ const contents = map({
6391
+ $metadata: deserializeMetadata(output),
6392
+ });
6393
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
6394
+ if (data.Rule != null) {
6395
+ contents.Rule = deserializeAws_restJson1Rule(data.Rule, context);
6396
+ }
6397
+ return contents;
6398
+ };
6399
+ const deserializeAws_restJson1DescribeRuleCommandError = async (output, context) => {
6400
+ const parsedOutput = {
6401
+ ...output,
6402
+ body: await parseErrorBody(output.body, context),
6403
+ };
6404
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
6405
+ switch (errorCode) {
6406
+ case "AccessDeniedException":
6407
+ case "com.amazonaws.connect#AccessDeniedException":
6408
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
6409
+ case "InternalServiceException":
6410
+ case "com.amazonaws.connect#InternalServiceException":
6411
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
6412
+ case "InvalidRequestException":
6413
+ case "com.amazonaws.connect#InvalidRequestException":
6414
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
6415
+ case "ResourceNotFoundException":
6416
+ case "com.amazonaws.connect#ResourceNotFoundException":
6417
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
6418
+ case "ThrottlingException":
6419
+ case "com.amazonaws.connect#ThrottlingException":
6420
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
6421
+ default:
6422
+ const parsedBody = parsedOutput.body;
6423
+ throwDefaultError({
6424
+ output,
6425
+ parsedBody,
6426
+ exceptionCtor: __BaseException,
6427
+ errorCode,
6428
+ });
6429
+ }
6430
+ };
6180
6431
  export const deserializeAws_restJson1DescribeSecurityProfileCommand = async (output, context) => {
6181
6432
  if (output.statusCode !== 200 && output.statusCode >= 300) {
6182
6433
  return deserializeAws_restJson1DescribeSecurityProfileCommandError(output, context);
@@ -8283,6 +8534,54 @@ const deserializeAws_restJson1ListRoutingProfilesCommandError = async (output, c
8283
8534
  });
8284
8535
  }
8285
8536
  };
8537
+ export const deserializeAws_restJson1ListRulesCommand = async (output, context) => {
8538
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
8539
+ return deserializeAws_restJson1ListRulesCommandError(output, context);
8540
+ }
8541
+ const contents = map({
8542
+ $metadata: deserializeMetadata(output),
8543
+ });
8544
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
8545
+ if (data.NextToken != null) {
8546
+ contents.NextToken = __expectString(data.NextToken);
8547
+ }
8548
+ if (data.RuleSummaryList != null) {
8549
+ contents.RuleSummaryList = deserializeAws_restJson1RuleSummaryList(data.RuleSummaryList, context);
8550
+ }
8551
+ return contents;
8552
+ };
8553
+ const deserializeAws_restJson1ListRulesCommandError = async (output, context) => {
8554
+ const parsedOutput = {
8555
+ ...output,
8556
+ body: await parseErrorBody(output.body, context),
8557
+ };
8558
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
8559
+ switch (errorCode) {
8560
+ case "AccessDeniedException":
8561
+ case "com.amazonaws.connect#AccessDeniedException":
8562
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
8563
+ case "InternalServiceException":
8564
+ case "com.amazonaws.connect#InternalServiceException":
8565
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
8566
+ case "InvalidRequestException":
8567
+ case "com.amazonaws.connect#InvalidRequestException":
8568
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
8569
+ case "ResourceNotFoundException":
8570
+ case "com.amazonaws.connect#ResourceNotFoundException":
8571
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
8572
+ case "ThrottlingException":
8573
+ case "com.amazonaws.connect#ThrottlingException":
8574
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
8575
+ default:
8576
+ const parsedBody = parsedOutput.body;
8577
+ throwDefaultError({
8578
+ output,
8579
+ parsedBody,
8580
+ exceptionCtor: __BaseException,
8581
+ errorCode,
8582
+ });
8583
+ }
8584
+ };
8286
8585
  export const deserializeAws_restJson1ListSecurityKeysCommand = async (output, context) => {
8287
8586
  if (output.statusCode !== 200 && output.statusCode >= 300) {
8288
8587
  return deserializeAws_restJson1ListSecurityKeysCommandError(output, context);
@@ -10818,6 +11117,51 @@ const deserializeAws_restJson1UpdateRoutingProfileQueuesCommandError = async (ou
10818
11117
  });
10819
11118
  }
10820
11119
  };
11120
+ export const deserializeAws_restJson1UpdateRuleCommand = async (output, context) => {
11121
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
11122
+ return deserializeAws_restJson1UpdateRuleCommandError(output, context);
11123
+ }
11124
+ const contents = map({
11125
+ $metadata: deserializeMetadata(output),
11126
+ });
11127
+ await collectBody(output.body, context);
11128
+ return contents;
11129
+ };
11130
+ const deserializeAws_restJson1UpdateRuleCommandError = async (output, context) => {
11131
+ const parsedOutput = {
11132
+ ...output,
11133
+ body: await parseErrorBody(output.body, context),
11134
+ };
11135
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
11136
+ switch (errorCode) {
11137
+ case "AccessDeniedException":
11138
+ case "com.amazonaws.connect#AccessDeniedException":
11139
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
11140
+ case "InternalServiceException":
11141
+ case "com.amazonaws.connect#InternalServiceException":
11142
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
11143
+ case "InvalidRequestException":
11144
+ case "com.amazonaws.connect#InvalidRequestException":
11145
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
11146
+ case "ResourceConflictException":
11147
+ case "com.amazonaws.connect#ResourceConflictException":
11148
+ throw await deserializeAws_restJson1ResourceConflictExceptionResponse(parsedOutput, context);
11149
+ case "ResourceNotFoundException":
11150
+ case "com.amazonaws.connect#ResourceNotFoundException":
11151
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
11152
+ case "ThrottlingException":
11153
+ case "com.amazonaws.connect#ThrottlingException":
11154
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
11155
+ default:
11156
+ const parsedBody = parsedOutput.body;
11157
+ throwDefaultError({
11158
+ output,
11159
+ parsedBody,
11160
+ exceptionCtor: __BaseException,
11161
+ errorCode,
11162
+ });
11163
+ }
11164
+ };
10821
11165
  export const deserializeAws_restJson1UpdateSecurityProfileCommand = async (output, context) => {
10822
11166
  if (output.statusCode !== 200 && output.statusCode >= 300) {
10823
11167
  return deserializeAws_restJson1UpdateSecurityProfileCommandError(output, context);
@@ -11572,6 +11916,9 @@ const serializeAws_restJson1AnswerMachineDetectionConfig = (input, context) => {
11572
11916
  }),
11573
11917
  };
11574
11918
  };
11919
+ const serializeAws_restJson1AssignContactCategoryActionDefinition = (input, context) => {
11920
+ return {};
11921
+ };
11575
11922
  const serializeAws_restJson1Attributes = (input, context) => {
11576
11923
  return Object.entries(input).reduce((acc, [key, value]) => {
11577
11924
  if (value === null) {
@@ -11667,6 +12014,11 @@ const serializeAws_restJson1EncryptionConfig = (input, context) => {
11667
12014
  ...(input.KeyId != null && { KeyId: input.KeyId }),
11668
12015
  };
11669
12016
  };
12017
+ const serializeAws_restJson1EventBridgeActionDefinition = (input, context) => {
12018
+ return {
12019
+ ...(input.Name != null && { Name: input.Name }),
12020
+ };
12021
+ };
11670
12022
  const serializeAws_restJson1Filters = (input, context) => {
11671
12023
  return {
11672
12024
  ...(input.Channels != null && { Channels: serializeAws_restJson1Channels(input.Channels, context) }),
@@ -11810,6 +12162,12 @@ const serializeAws_restJson1MediaConcurrency = (input, context) => {
11810
12162
  ...(input.Concurrency != null && { Concurrency: input.Concurrency }),
11811
12163
  };
11812
12164
  };
12165
+ const serializeAws_restJson1NotificationRecipientType = (input, context) => {
12166
+ return {
12167
+ ...(input.UserIds != null && { UserIds: serializeAws_restJson1UserIdList(input.UserIds, context) }),
12168
+ ...(input.UserTags != null && { UserTags: serializeAws_restJson1UserTagMap(input.UserTags, context) }),
12169
+ };
12170
+ };
11813
12171
  const serializeAws_restJson1OutboundCallerConfig = (input, context) => {
11814
12172
  return {
11815
12173
  ...(input.OutboundCallerIdName != null && { OutboundCallerIdName: input.OutboundCallerIdName }),
@@ -11996,6 +12354,36 @@ const serializeAws_restJson1RoutingProfileSearchFilter = (input, context) => {
11996
12354
  }),
11997
12355
  };
11998
12356
  };
12357
+ const serializeAws_restJson1RuleAction = (input, context) => {
12358
+ return {
12359
+ ...(input.ActionType != null && { ActionType: input.ActionType }),
12360
+ ...(input.AssignContactCategoryAction != null && {
12361
+ AssignContactCategoryAction: serializeAws_restJson1AssignContactCategoryActionDefinition(input.AssignContactCategoryAction, context),
12362
+ }),
12363
+ ...(input.EventBridgeAction != null && {
12364
+ EventBridgeAction: serializeAws_restJson1EventBridgeActionDefinition(input.EventBridgeAction, context),
12365
+ }),
12366
+ ...(input.SendNotificationAction != null && {
12367
+ SendNotificationAction: serializeAws_restJson1SendNotificationActionDefinition(input.SendNotificationAction, context),
12368
+ }),
12369
+ ...(input.TaskAction != null && {
12370
+ TaskAction: serializeAws_restJson1TaskActionDefinition(input.TaskAction, context),
12371
+ }),
12372
+ };
12373
+ };
12374
+ const serializeAws_restJson1RuleActions = (input, context) => {
12375
+ return input
12376
+ .filter((e) => e != null)
12377
+ .map((entry) => {
12378
+ return serializeAws_restJson1RuleAction(entry, context);
12379
+ });
12380
+ };
12381
+ const serializeAws_restJson1RuleTriggerEventSource = (input, context) => {
12382
+ return {
12383
+ ...(input.EventSourceName != null && { EventSourceName: input.EventSourceName }),
12384
+ ...(input.IntegrationAssociationId != null && { IntegrationAssociationId: input.IntegrationAssociationId }),
12385
+ };
12386
+ };
11999
12387
  const serializeAws_restJson1S3Config = (input, context) => {
12000
12388
  return {
12001
12389
  ...(input.BucketName != null && { BucketName: input.BucketName }),
@@ -12039,6 +12427,17 @@ const serializeAws_restJson1SecurityProfilesSearchFilter = (input, context) => {
12039
12427
  }),
12040
12428
  };
12041
12429
  };
12430
+ const serializeAws_restJson1SendNotificationActionDefinition = (input, context) => {
12431
+ return {
12432
+ ...(input.Content != null && { Content: input.Content }),
12433
+ ...(input.ContentType != null && { ContentType: input.ContentType }),
12434
+ ...(input.DeliveryMethod != null && { DeliveryMethod: input.DeliveryMethod }),
12435
+ ...(input.Recipient != null && {
12436
+ Recipient: serializeAws_restJson1NotificationRecipientType(input.Recipient, context),
12437
+ }),
12438
+ ...(input.Subject != null && { Subject: input.Subject }),
12439
+ };
12440
+ };
12042
12441
  const serializeAws_restJson1SingleSelectOptions = (input, context) => {
12043
12442
  return input
12044
12443
  .filter((e) => e != null)
@@ -12096,6 +12495,14 @@ const serializeAws_restJson1TagRestrictedResourceList = (input, context) => {
12096
12495
  return entry;
12097
12496
  });
12098
12497
  };
12498
+ const serializeAws_restJson1TaskActionDefinition = (input, context) => {
12499
+ return {
12500
+ ...(input.ContactFlowId != null && { ContactFlowId: input.ContactFlowId }),
12501
+ ...(input.Description != null && { Description: input.Description }),
12502
+ ...(input.Name != null && { Name: input.Name }),
12503
+ ...(input.References != null && { References: serializeAws_restJson1ContactReferences(input.References, context) }),
12504
+ };
12505
+ };
12099
12506
  const serializeAws_restJson1TaskTemplateConstraints = (input, context) => {
12100
12507
  return {
12101
12508
  ...(input.InvisibleFields != null && {
@@ -12181,6 +12588,13 @@ const serializeAws_restJson1UserIdentityInfo = (input, context) => {
12181
12588
  ...(input.SecondaryEmail != null && { SecondaryEmail: input.SecondaryEmail }),
12182
12589
  };
12183
12590
  };
12591
+ const serializeAws_restJson1UserIdList = (input, context) => {
12592
+ return input
12593
+ .filter((e) => e != null)
12594
+ .map((entry) => {
12595
+ return entry;
12596
+ });
12597
+ };
12184
12598
  const serializeAws_restJson1UserPhoneConfig = (input, context) => {
12185
12599
  return {
12186
12600
  ...(input.AfterContactWorkTimeLimit != null && { AfterContactWorkTimeLimit: input.AfterContactWorkTimeLimit }),
@@ -12225,11 +12639,36 @@ const serializeAws_restJson1UserSearchFilter = (input, context) => {
12225
12639
  }),
12226
12640
  };
12227
12641
  };
12642
+ const serializeAws_restJson1UserTagMap = (input, context) => {
12643
+ return Object.entries(input).reduce((acc, [key, value]) => {
12644
+ if (value === null) {
12645
+ return acc;
12646
+ }
12647
+ acc[key] = value;
12648
+ return acc;
12649
+ }, {});
12650
+ };
12228
12651
  const serializeAws_restJson1VoiceRecordingConfiguration = (input, context) => {
12229
12652
  return {
12230
12653
  ...(input.VoiceRecordingTrack != null && { VoiceRecordingTrack: input.VoiceRecordingTrack }),
12231
12654
  };
12232
12655
  };
12656
+ const deserializeAws_restJson1ActionSummaries = (output, context) => {
12657
+ const retVal = (output || [])
12658
+ .filter((e) => e != null)
12659
+ .map((entry) => {
12660
+ if (entry === null) {
12661
+ return null;
12662
+ }
12663
+ return deserializeAws_restJson1ActionSummary(entry, context);
12664
+ });
12665
+ return retVal;
12666
+ };
12667
+ const deserializeAws_restJson1ActionSummary = (output, context) => {
12668
+ return {
12669
+ ActionType: __expectString(output.ActionType),
12670
+ };
12671
+ };
12233
12672
  const deserializeAws_restJson1AgentContactReference = (output, context) => {
12234
12673
  return {
12235
12674
  AgentContactState: __expectString(output.AgentContactState),
@@ -12312,6 +12751,9 @@ const deserializeAws_restJson1AllowedAccessControlTags = (output, context) => {
12312
12751
  return acc;
12313
12752
  }, {});
12314
12753
  };
12754
+ const deserializeAws_restJson1AssignContactCategoryActionDefinition = (output, context) => {
12755
+ return {};
12756
+ };
12315
12757
  const deserializeAws_restJson1AttachmentReference = (output, context) => {
12316
12758
  return {
12317
12759
  Name: __expectString(output.Name),
@@ -12476,6 +12918,15 @@ const deserializeAws_restJson1ContactFlowSummaryList = (output, context) => {
12476
12918
  });
12477
12919
  return retVal;
12478
12920
  };
12921
+ const deserializeAws_restJson1ContactReferences = (output, context) => {
12922
+ return Object.entries(output).reduce((acc, [key, value]) => {
12923
+ if (value === null) {
12924
+ return acc;
12925
+ }
12926
+ acc[key] = deserializeAws_restJson1Reference(value, context);
12927
+ return acc;
12928
+ }, {});
12929
+ };
12479
12930
  const deserializeAws_restJson1Credentials = (output, context) => {
12480
12931
  return {
12481
12932
  AccessToken: __expectString(output.AccessToken),
@@ -12590,6 +13041,11 @@ const deserializeAws_restJson1EncryptionConfig = (output, context) => {
12590
13041
  KeyId: __expectString(output.KeyId),
12591
13042
  };
12592
13043
  };
13044
+ const deserializeAws_restJson1EventBridgeActionDefinition = (output, context) => {
13045
+ return {
13046
+ Name: __expectString(output.Name),
13047
+ };
13048
+ };
12593
13049
  const deserializeAws_restJson1FunctionArnsList = (output, context) => {
12594
13050
  const retVal = (output || [])
12595
13051
  .filter((e) => e != null)
@@ -12989,6 +13445,12 @@ const deserializeAws_restJson1MediaConcurrency = (output, context) => {
12989
13445
  Concurrency: __expectInt32(output.Concurrency),
12990
13446
  };
12991
13447
  };
13448
+ const deserializeAws_restJson1NotificationRecipientType = (output, context) => {
13449
+ return {
13450
+ UserIds: output.UserIds != null ? deserializeAws_restJson1UserIdList(output.UserIds, context) : undefined,
13451
+ UserTags: output.UserTags != null ? deserializeAws_restJson1UserTagMap(output.UserTags, context) : undefined,
13452
+ };
13453
+ };
12992
13454
  const deserializeAws_restJson1NumberReference = (output, context) => {
12993
13455
  return {
12994
13456
  Name: __expectString(output.Name),
@@ -13233,6 +13695,12 @@ const deserializeAws_restJson1ReadOnlyTaskTemplateFields = (output, context) =>
13233
13695
  });
13234
13696
  return retVal;
13235
13697
  };
13698
+ const deserializeAws_restJson1Reference = (output, context) => {
13699
+ return {
13700
+ Type: __expectString(output.Type),
13701
+ Value: __expectString(output.Value),
13702
+ };
13703
+ };
13236
13704
  const deserializeAws_restJson1ReferenceSummary = (output, context) => {
13237
13705
  if (output.Attachment != null) {
13238
13706
  return {
@@ -13365,6 +13833,88 @@ const deserializeAws_restJson1RoutingProfileSummaryList = (output, context) => {
13365
13833
  });
13366
13834
  return retVal;
13367
13835
  };
13836
+ const deserializeAws_restJson1Rule = (output, context) => {
13837
+ return {
13838
+ Actions: output.Actions != null ? deserializeAws_restJson1RuleActions(output.Actions, context) : undefined,
13839
+ CreatedTime: output.CreatedTime != null
13840
+ ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedTime)))
13841
+ : undefined,
13842
+ Function: __expectString(output.Function),
13843
+ LastUpdatedBy: __expectString(output.LastUpdatedBy),
13844
+ LastUpdatedTime: output.LastUpdatedTime != null
13845
+ ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedTime)))
13846
+ : undefined,
13847
+ Name: __expectString(output.Name),
13848
+ PublishStatus: __expectString(output.PublishStatus),
13849
+ RuleArn: __expectString(output.RuleArn),
13850
+ RuleId: __expectString(output.RuleId),
13851
+ Tags: output.Tags != null ? deserializeAws_restJson1TagMap(output.Tags, context) : undefined,
13852
+ TriggerEventSource: output.TriggerEventSource != null
13853
+ ? deserializeAws_restJson1RuleTriggerEventSource(output.TriggerEventSource, context)
13854
+ : undefined,
13855
+ };
13856
+ };
13857
+ const deserializeAws_restJson1RuleAction = (output, context) => {
13858
+ return {
13859
+ ActionType: __expectString(output.ActionType),
13860
+ AssignContactCategoryAction: output.AssignContactCategoryAction != null
13861
+ ? deserializeAws_restJson1AssignContactCategoryActionDefinition(output.AssignContactCategoryAction, context)
13862
+ : undefined,
13863
+ EventBridgeAction: output.EventBridgeAction != null
13864
+ ? deserializeAws_restJson1EventBridgeActionDefinition(output.EventBridgeAction, context)
13865
+ : undefined,
13866
+ SendNotificationAction: output.SendNotificationAction != null
13867
+ ? deserializeAws_restJson1SendNotificationActionDefinition(output.SendNotificationAction, context)
13868
+ : undefined,
13869
+ TaskAction: output.TaskAction != null ? deserializeAws_restJson1TaskActionDefinition(output.TaskAction, context) : undefined,
13870
+ };
13871
+ };
13872
+ const deserializeAws_restJson1RuleActions = (output, context) => {
13873
+ const retVal = (output || [])
13874
+ .filter((e) => e != null)
13875
+ .map((entry) => {
13876
+ if (entry === null) {
13877
+ return null;
13878
+ }
13879
+ return deserializeAws_restJson1RuleAction(entry, context);
13880
+ });
13881
+ return retVal;
13882
+ };
13883
+ const deserializeAws_restJson1RuleSummary = (output, context) => {
13884
+ return {
13885
+ ActionSummaries: output.ActionSummaries != null
13886
+ ? deserializeAws_restJson1ActionSummaries(output.ActionSummaries, context)
13887
+ : undefined,
13888
+ CreatedTime: output.CreatedTime != null
13889
+ ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedTime)))
13890
+ : undefined,
13891
+ EventSourceName: __expectString(output.EventSourceName),
13892
+ LastUpdatedTime: output.LastUpdatedTime != null
13893
+ ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedTime)))
13894
+ : undefined,
13895
+ Name: __expectString(output.Name),
13896
+ PublishStatus: __expectString(output.PublishStatus),
13897
+ RuleArn: __expectString(output.RuleArn),
13898
+ RuleId: __expectString(output.RuleId),
13899
+ };
13900
+ };
13901
+ const deserializeAws_restJson1RuleSummaryList = (output, context) => {
13902
+ const retVal = (output || [])
13903
+ .filter((e) => e != null)
13904
+ .map((entry) => {
13905
+ if (entry === null) {
13906
+ return null;
13907
+ }
13908
+ return deserializeAws_restJson1RuleSummary(entry, context);
13909
+ });
13910
+ return retVal;
13911
+ };
13912
+ const deserializeAws_restJson1RuleTriggerEventSource = (output, context) => {
13913
+ return {
13914
+ EventSourceName: __expectString(output.EventSourceName),
13915
+ IntegrationAssociationId: __expectString(output.IntegrationAssociationId),
13916
+ };
13917
+ };
13368
13918
  const deserializeAws_restJson1S3Config = (output, context) => {
13369
13919
  return {
13370
13920
  BucketName: __expectString(output.BucketName),
@@ -13460,6 +14010,17 @@ const deserializeAws_restJson1SecurityProfileSummaryList = (output, context) =>
13460
14010
  });
13461
14011
  return retVal;
13462
14012
  };
14013
+ const deserializeAws_restJson1SendNotificationActionDefinition = (output, context) => {
14014
+ return {
14015
+ Content: __expectString(output.Content),
14016
+ ContentType: __expectString(output.ContentType),
14017
+ DeliveryMethod: __expectString(output.DeliveryMethod),
14018
+ Recipient: output.Recipient != null
14019
+ ? deserializeAws_restJson1NotificationRecipientType(output.Recipient, context)
14020
+ : undefined,
14021
+ Subject: __expectString(output.Subject),
14022
+ };
14023
+ };
13463
14024
  const deserializeAws_restJson1SingleSelectOptions = (output, context) => {
13464
14025
  const retVal = (output || [])
13465
14026
  .filter((e) => e != null)
@@ -13497,6 +14058,14 @@ const deserializeAws_restJson1TagRestrictedResourceList = (output, context) => {
13497
14058
  });
13498
14059
  return retVal;
13499
14060
  };
14061
+ const deserializeAws_restJson1TaskActionDefinition = (output, context) => {
14062
+ return {
14063
+ ContactFlowId: __expectString(output.ContactFlowId),
14064
+ Description: __expectString(output.Description),
14065
+ Name: __expectString(output.Name),
14066
+ References: output.References != null ? deserializeAws_restJson1ContactReferences(output.References, context) : undefined,
14067
+ };
14068
+ };
13500
14069
  const deserializeAws_restJson1TaskTemplateConstraints = (output, context) => {
13501
14070
  return {
13502
14071
  InvisibleFields: output.InvisibleFields != null
@@ -13718,6 +14287,17 @@ const deserializeAws_restJson1UserIdentityInfoLite = (output, context) => {
13718
14287
  LastName: __expectString(output.LastName),
13719
14288
  };
13720
14289
  };
14290
+ const deserializeAws_restJson1UserIdList = (output, context) => {
14291
+ const retVal = (output || [])
14292
+ .filter((e) => e != null)
14293
+ .map((entry) => {
14294
+ if (entry === null) {
14295
+ return null;
14296
+ }
14297
+ return __expectString(entry);
14298
+ });
14299
+ return retVal;
14300
+ };
13721
14301
  const deserializeAws_restJson1UserPhoneConfig = (output, context) => {
13722
14302
  return {
13723
14303
  AfterContactWorkTimeLimit: __expectInt32(output.AfterContactWorkTimeLimit),
@@ -13785,6 +14365,15 @@ const deserializeAws_restJson1UserSummaryList = (output, context) => {
13785
14365
  });
13786
14366
  return retVal;
13787
14367
  };
14368
+ const deserializeAws_restJson1UserTagMap = (output, context) => {
14369
+ return Object.entries(output).reduce((acc, [key, value]) => {
14370
+ if (value === null) {
14371
+ return acc;
14372
+ }
14373
+ acc[key] = __expectString(value);
14374
+ return acc;
14375
+ }, {});
14376
+ };
13788
14377
  const deserializeAws_restJson1Vocabulary = (output, context) => {
13789
14378
  return {
13790
14379
  Arn: __expectString(output.Arn),