@aws-sdk/client-greengrassv2 3.41.0 → 3.46.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 (47) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +7 -7
  3. package/dist-cjs/GreengrassV2.js +75 -0
  4. package/dist-cjs/commands/AssociateServiceRoleToAccountCommand.js +36 -0
  5. package/dist-cjs/commands/DisassociateServiceRoleFromAccountCommand.js +36 -0
  6. package/dist-cjs/commands/GetConnectivityInfoCommand.js +36 -0
  7. package/dist-cjs/commands/GetServiceRoleForAccountCommand.js +36 -0
  8. package/dist-cjs/commands/UpdateConnectivityInfoCommand.js +36 -0
  9. package/dist-cjs/commands/index.js +5 -0
  10. package/dist-cjs/endpoints.js +1 -0
  11. package/dist-cjs/models/models_0.js +89 -23
  12. package/dist-cjs/protocols/Aws_restJson1.js +435 -1
  13. package/dist-cjs/runtimeConfig.js +0 -2
  14. package/dist-es/GreengrassV2.js +75 -0
  15. package/dist-es/commands/AssociateServiceRoleToAccountCommand.js +39 -0
  16. package/dist-es/commands/DisassociateServiceRoleFromAccountCommand.js +39 -0
  17. package/dist-es/commands/GetConnectivityInfoCommand.js +39 -0
  18. package/dist-es/commands/GetServiceRoleForAccountCommand.js +39 -0
  19. package/dist-es/commands/UpdateConnectivityInfoCommand.js +39 -0
  20. package/dist-es/commands/index.js +5 -0
  21. package/dist-es/endpoints.js +1 -0
  22. package/dist-es/models/models_0.js +60 -16
  23. package/dist-es/protocols/Aws_restJson1.js +519 -0
  24. package/dist-es/runtimeConfig.js +0 -2
  25. package/dist-types/GreengrassV2.d.ts +59 -2
  26. package/dist-types/GreengrassV2Client.d.ts +7 -2
  27. package/dist-types/commands/AssociateServiceRoleToAccountCommand.d.ts +39 -0
  28. package/dist-types/commands/BatchAssociateClientDeviceWithCoreDeviceCommand.d.ts +1 -1
  29. package/dist-types/commands/BatchDisassociateClientDeviceFromCoreDeviceCommand.d.ts +1 -1
  30. package/dist-types/commands/DisassociateServiceRoleFromAccountCommand.d.ts +38 -0
  31. package/dist-types/commands/GetConnectivityInfoCommand.d.ts +41 -0
  32. package/dist-types/commands/GetServiceRoleForAccountCommand.d.ts +38 -0
  33. package/dist-types/commands/UpdateConnectivityInfoCommand.d.ts +41 -0
  34. package/dist-types/commands/index.d.ts +5 -0
  35. package/dist-types/models/models_0.d.ts +229 -65
  36. package/dist-types/protocols/Aws_restJson1.d.ts +15 -0
  37. package/dist-types/ts3.4/GreengrassV2.d.ts +25 -0
  38. package/dist-types/ts3.4/GreengrassV2Client.d.ts +7 -2
  39. package/dist-types/ts3.4/commands/AssociateServiceRoleToAccountCommand.d.ts +17 -0
  40. package/dist-types/ts3.4/commands/DisassociateServiceRoleFromAccountCommand.d.ts +17 -0
  41. package/dist-types/ts3.4/commands/GetConnectivityInfoCommand.d.ts +17 -0
  42. package/dist-types/ts3.4/commands/GetServiceRoleForAccountCommand.d.ts +17 -0
  43. package/dist-types/ts3.4/commands/UpdateConnectivityInfoCommand.d.ts +17 -0
  44. package/dist-types/ts3.4/commands/index.d.ts +5 -0
  45. package/dist-types/ts3.4/models/models_0.d.ts +139 -40
  46. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +15 -0
  47. package/package.json +36 -43
@@ -1,9 +1,31 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1ResolveComponentCandidatesCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListInstalledComponentsCommand = exports.deserializeAws_restJson1ListEffectiveDeploymentsCommand = exports.deserializeAws_restJson1ListDeploymentsCommand = exports.deserializeAws_restJson1ListCoreDevicesCommand = exports.deserializeAws_restJson1ListComponentVersionsCommand = exports.deserializeAws_restJson1ListComponentsCommand = exports.deserializeAws_restJson1ListClientDevicesAssociatedWithCoreDeviceCommand = exports.deserializeAws_restJson1GetDeploymentCommand = exports.deserializeAws_restJson1GetCoreDeviceCommand = exports.deserializeAws_restJson1GetComponentVersionArtifactCommand = exports.deserializeAws_restJson1GetComponentCommand = exports.deserializeAws_restJson1DescribeComponentCommand = exports.deserializeAws_restJson1DeleteCoreDeviceCommand = exports.deserializeAws_restJson1DeleteComponentCommand = exports.deserializeAws_restJson1CreateDeploymentCommand = exports.deserializeAws_restJson1CreateComponentVersionCommand = exports.deserializeAws_restJson1CancelDeploymentCommand = exports.deserializeAws_restJson1BatchDisassociateClientDeviceFromCoreDeviceCommand = exports.deserializeAws_restJson1BatchAssociateClientDeviceWithCoreDeviceCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1ResolveComponentCandidatesCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListInstalledComponentsCommand = exports.serializeAws_restJson1ListEffectiveDeploymentsCommand = exports.serializeAws_restJson1ListDeploymentsCommand = exports.serializeAws_restJson1ListCoreDevicesCommand = exports.serializeAws_restJson1ListComponentVersionsCommand = exports.serializeAws_restJson1ListComponentsCommand = exports.serializeAws_restJson1ListClientDevicesAssociatedWithCoreDeviceCommand = exports.serializeAws_restJson1GetDeploymentCommand = exports.serializeAws_restJson1GetCoreDeviceCommand = exports.serializeAws_restJson1GetComponentVersionArtifactCommand = exports.serializeAws_restJson1GetComponentCommand = exports.serializeAws_restJson1DescribeComponentCommand = exports.serializeAws_restJson1DeleteCoreDeviceCommand = exports.serializeAws_restJson1DeleteComponentCommand = exports.serializeAws_restJson1CreateDeploymentCommand = exports.serializeAws_restJson1CreateComponentVersionCommand = exports.serializeAws_restJson1CancelDeploymentCommand = exports.serializeAws_restJson1BatchDisassociateClientDeviceFromCoreDeviceCommand = exports.serializeAws_restJson1BatchAssociateClientDeviceWithCoreDeviceCommand = void 0;
3
+ exports.deserializeAws_restJson1ListEffectiveDeploymentsCommand = exports.deserializeAws_restJson1ListDeploymentsCommand = exports.deserializeAws_restJson1ListCoreDevicesCommand = exports.deserializeAws_restJson1ListComponentVersionsCommand = exports.deserializeAws_restJson1ListComponentsCommand = exports.deserializeAws_restJson1ListClientDevicesAssociatedWithCoreDeviceCommand = exports.deserializeAws_restJson1GetServiceRoleForAccountCommand = exports.deserializeAws_restJson1GetDeploymentCommand = exports.deserializeAws_restJson1GetCoreDeviceCommand = exports.deserializeAws_restJson1GetConnectivityInfoCommand = exports.deserializeAws_restJson1GetComponentVersionArtifactCommand = exports.deserializeAws_restJson1GetComponentCommand = exports.deserializeAws_restJson1DisassociateServiceRoleFromAccountCommand = exports.deserializeAws_restJson1DescribeComponentCommand = exports.deserializeAws_restJson1DeleteCoreDeviceCommand = exports.deserializeAws_restJson1DeleteComponentCommand = exports.deserializeAws_restJson1CreateDeploymentCommand = exports.deserializeAws_restJson1CreateComponentVersionCommand = exports.deserializeAws_restJson1CancelDeploymentCommand = exports.deserializeAws_restJson1BatchDisassociateClientDeviceFromCoreDeviceCommand = exports.deserializeAws_restJson1BatchAssociateClientDeviceWithCoreDeviceCommand = exports.deserializeAws_restJson1AssociateServiceRoleToAccountCommand = exports.serializeAws_restJson1UpdateConnectivityInfoCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1ResolveComponentCandidatesCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListInstalledComponentsCommand = exports.serializeAws_restJson1ListEffectiveDeploymentsCommand = exports.serializeAws_restJson1ListDeploymentsCommand = exports.serializeAws_restJson1ListCoreDevicesCommand = exports.serializeAws_restJson1ListComponentVersionsCommand = exports.serializeAws_restJson1ListComponentsCommand = exports.serializeAws_restJson1ListClientDevicesAssociatedWithCoreDeviceCommand = exports.serializeAws_restJson1GetServiceRoleForAccountCommand = exports.serializeAws_restJson1GetDeploymentCommand = exports.serializeAws_restJson1GetCoreDeviceCommand = exports.serializeAws_restJson1GetConnectivityInfoCommand = exports.serializeAws_restJson1GetComponentVersionArtifactCommand = exports.serializeAws_restJson1GetComponentCommand = exports.serializeAws_restJson1DisassociateServiceRoleFromAccountCommand = exports.serializeAws_restJson1DescribeComponentCommand = exports.serializeAws_restJson1DeleteCoreDeviceCommand = exports.serializeAws_restJson1DeleteComponentCommand = exports.serializeAws_restJson1CreateDeploymentCommand = exports.serializeAws_restJson1CreateComponentVersionCommand = exports.serializeAws_restJson1CancelDeploymentCommand = exports.serializeAws_restJson1BatchDisassociateClientDeviceFromCoreDeviceCommand = exports.serializeAws_restJson1BatchAssociateClientDeviceWithCoreDeviceCommand = exports.serializeAws_restJson1AssociateServiceRoleToAccountCommand = void 0;
4
+ exports.deserializeAws_restJson1UpdateConnectivityInfoCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1ResolveComponentCandidatesCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListInstalledComponentsCommand = void 0;
4
5
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
6
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
7
  const uuid_1 = require("uuid");
8
+ const serializeAws_restJson1AssociateServiceRoleToAccountCommand = async (input, context) => {
9
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
+ const headers = {
11
+ "content-type": "application/json",
12
+ };
13
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/greengrass/servicerole";
14
+ let body;
15
+ body = JSON.stringify({
16
+ ...(input.roleArn !== undefined && input.roleArn !== null && { RoleArn: input.roleArn }),
17
+ });
18
+ return new protocol_http_1.HttpRequest({
19
+ protocol,
20
+ hostname,
21
+ port,
22
+ method: "PUT",
23
+ headers,
24
+ path: resolvedPath,
25
+ body,
26
+ });
27
+ };
28
+ exports.serializeAws_restJson1AssociateServiceRoleToAccountCommand = serializeAws_restJson1AssociateServiceRoleToAccountCommand;
7
29
  const serializeAws_restJson1BatchAssociateClientDeviceWithCoreDeviceCommand = async (input, context) => {
8
30
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
9
31
  const headers = {
@@ -247,6 +269,25 @@ const serializeAws_restJson1DescribeComponentCommand = async (input, context) =>
247
269
  });
248
270
  };
249
271
  exports.serializeAws_restJson1DescribeComponentCommand = serializeAws_restJson1DescribeComponentCommand;
272
+ const serializeAws_restJson1DisassociateServiceRoleFromAccountCommand = async (input, context) => {
273
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
274
+ const headers = {
275
+ "content-type": "application/json",
276
+ };
277
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/greengrass/servicerole";
278
+ let body;
279
+ body = "";
280
+ return new protocol_http_1.HttpRequest({
281
+ protocol,
282
+ hostname,
283
+ port,
284
+ method: "DELETE",
285
+ headers,
286
+ path: resolvedPath,
287
+ body,
288
+ });
289
+ };
290
+ exports.serializeAws_restJson1DisassociateServiceRoleFromAccountCommand = serializeAws_restJson1DisassociateServiceRoleFromAccountCommand;
250
291
  const serializeAws_restJson1GetComponentCommand = async (input, context) => {
251
292
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
252
293
  const headers = {};
@@ -317,6 +358,33 @@ const serializeAws_restJson1GetComponentVersionArtifactCommand = async (input, c
317
358
  });
318
359
  };
319
360
  exports.serializeAws_restJson1GetComponentVersionArtifactCommand = serializeAws_restJson1GetComponentVersionArtifactCommand;
361
+ const serializeAws_restJson1GetConnectivityInfoCommand = async (input, context) => {
362
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
363
+ const headers = {};
364
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
365
+ "/greengrass/things/{thingName}/connectivityInfo";
366
+ if (input.thingName !== undefined) {
367
+ const labelValue = input.thingName;
368
+ if (labelValue.length <= 0) {
369
+ throw new Error("Empty value provided for input HTTP label: thingName.");
370
+ }
371
+ resolvedPath = resolvedPath.replace("{thingName}", smithy_client_1.extendedEncodeURIComponent(labelValue));
372
+ }
373
+ else {
374
+ throw new Error("No value provided for input HTTP label: thingName.");
375
+ }
376
+ let body;
377
+ return new protocol_http_1.HttpRequest({
378
+ protocol,
379
+ hostname,
380
+ port,
381
+ method: "GET",
382
+ headers,
383
+ path: resolvedPath,
384
+ body,
385
+ });
386
+ };
387
+ exports.serializeAws_restJson1GetConnectivityInfoCommand = serializeAws_restJson1GetConnectivityInfoCommand;
320
388
  const serializeAws_restJson1GetCoreDeviceCommand = async (input, context) => {
321
389
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
322
390
  const headers = {};
@@ -370,6 +438,25 @@ const serializeAws_restJson1GetDeploymentCommand = async (input, context) => {
370
438
  });
371
439
  };
372
440
  exports.serializeAws_restJson1GetDeploymentCommand = serializeAws_restJson1GetDeploymentCommand;
441
+ const serializeAws_restJson1GetServiceRoleForAccountCommand = async (input, context) => {
442
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
443
+ const headers = {
444
+ "content-type": "application/json",
445
+ };
446
+ const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/greengrass/servicerole";
447
+ let body;
448
+ body = "";
449
+ return new protocol_http_1.HttpRequest({
450
+ protocol,
451
+ hostname,
452
+ port,
453
+ method: "GET",
454
+ headers,
455
+ path: resolvedPath,
456
+ body,
457
+ });
458
+ };
459
+ exports.serializeAws_restJson1GetServiceRoleForAccountCommand = serializeAws_restJson1GetServiceRoleForAccountCommand;
373
460
  const serializeAws_restJson1ListClientDevicesAssociatedWithCoreDeviceCommand = async (input, context) => {
374
461
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
375
462
  const headers = {};
@@ -678,6 +765,97 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
678
765
  });
679
766
  };
680
767
  exports.serializeAws_restJson1UntagResourceCommand = serializeAws_restJson1UntagResourceCommand;
768
+ const serializeAws_restJson1UpdateConnectivityInfoCommand = async (input, context) => {
769
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
770
+ const headers = {
771
+ "content-type": "application/json",
772
+ };
773
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
774
+ "/greengrass/things/{thingName}/connectivityInfo";
775
+ if (input.thingName !== undefined) {
776
+ const labelValue = input.thingName;
777
+ if (labelValue.length <= 0) {
778
+ throw new Error("Empty value provided for input HTTP label: thingName.");
779
+ }
780
+ resolvedPath = resolvedPath.replace("{thingName}", smithy_client_1.extendedEncodeURIComponent(labelValue));
781
+ }
782
+ else {
783
+ throw new Error("No value provided for input HTTP label: thingName.");
784
+ }
785
+ let body;
786
+ body = JSON.stringify({
787
+ ...(input.connectivityInfo !== undefined &&
788
+ input.connectivityInfo !== null && {
789
+ ConnectivityInfo: serializeAws_restJson1connectivityInfoList(input.connectivityInfo, context),
790
+ }),
791
+ });
792
+ return new protocol_http_1.HttpRequest({
793
+ protocol,
794
+ hostname,
795
+ port,
796
+ method: "PUT",
797
+ headers,
798
+ path: resolvedPath,
799
+ body,
800
+ });
801
+ };
802
+ exports.serializeAws_restJson1UpdateConnectivityInfoCommand = serializeAws_restJson1UpdateConnectivityInfoCommand;
803
+ const deserializeAws_restJson1AssociateServiceRoleToAccountCommand = async (output, context) => {
804
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
805
+ return deserializeAws_restJson1AssociateServiceRoleToAccountCommandError(output, context);
806
+ }
807
+ const contents = {
808
+ $metadata: deserializeMetadata(output),
809
+ associatedAt: undefined,
810
+ };
811
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
812
+ if (data.AssociatedAt !== undefined && data.AssociatedAt !== null) {
813
+ contents.associatedAt = smithy_client_1.expectString(data.AssociatedAt);
814
+ }
815
+ return Promise.resolve(contents);
816
+ };
817
+ exports.deserializeAws_restJson1AssociateServiceRoleToAccountCommand = deserializeAws_restJson1AssociateServiceRoleToAccountCommand;
818
+ const deserializeAws_restJson1AssociateServiceRoleToAccountCommandError = async (output, context) => {
819
+ const parsedOutput = {
820
+ ...output,
821
+ body: await parseBody(output.body, context),
822
+ };
823
+ let response;
824
+ let errorCode = "UnknownError";
825
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
826
+ switch (errorCode) {
827
+ case "InternalServerException":
828
+ case "com.amazonaws.greengrassv2#InternalServerException":
829
+ response = {
830
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
831
+ name: errorCode,
832
+ $metadata: deserializeMetadata(output),
833
+ };
834
+ break;
835
+ case "ValidationException":
836
+ case "com.amazonaws.greengrassv2#ValidationException":
837
+ response = {
838
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
839
+ name: errorCode,
840
+ $metadata: deserializeMetadata(output),
841
+ };
842
+ break;
843
+ default:
844
+ const parsedBody = parsedOutput.body;
845
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
846
+ response = {
847
+ ...parsedBody,
848
+ name: `${errorCode}`,
849
+ message: parsedBody.message || parsedBody.Message || errorCode,
850
+ $fault: "client",
851
+ $metadata: deserializeMetadata(output),
852
+ };
853
+ }
854
+ const message = response.message || response.Message || errorCode;
855
+ response.message = message;
856
+ delete response.Message;
857
+ return Promise.reject(Object.assign(new Error(message), response));
858
+ };
681
859
  const deserializeAws_restJson1BatchAssociateClientDeviceWithCoreDeviceCommand = async (output, context) => {
682
860
  if (output.statusCode !== 200 && output.statusCode >= 300) {
683
861
  return deserializeAws_restJson1BatchAssociateClientDeviceWithCoreDeviceCommandError(output, context);
@@ -1414,6 +1592,54 @@ const deserializeAws_restJson1DescribeComponentCommandError = async (output, con
1414
1592
  delete response.Message;
1415
1593
  return Promise.reject(Object.assign(new Error(message), response));
1416
1594
  };
1595
+ const deserializeAws_restJson1DisassociateServiceRoleFromAccountCommand = async (output, context) => {
1596
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1597
+ return deserializeAws_restJson1DisassociateServiceRoleFromAccountCommandError(output, context);
1598
+ }
1599
+ const contents = {
1600
+ $metadata: deserializeMetadata(output),
1601
+ disassociatedAt: undefined,
1602
+ };
1603
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
1604
+ if (data.DisassociatedAt !== undefined && data.DisassociatedAt !== null) {
1605
+ contents.disassociatedAt = smithy_client_1.expectString(data.DisassociatedAt);
1606
+ }
1607
+ return Promise.resolve(contents);
1608
+ };
1609
+ exports.deserializeAws_restJson1DisassociateServiceRoleFromAccountCommand = deserializeAws_restJson1DisassociateServiceRoleFromAccountCommand;
1610
+ const deserializeAws_restJson1DisassociateServiceRoleFromAccountCommandError = async (output, context) => {
1611
+ const parsedOutput = {
1612
+ ...output,
1613
+ body: await parseBody(output.body, context),
1614
+ };
1615
+ let response;
1616
+ let errorCode = "UnknownError";
1617
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1618
+ switch (errorCode) {
1619
+ case "InternalServerException":
1620
+ case "com.amazonaws.greengrassv2#InternalServerException":
1621
+ response = {
1622
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1623
+ name: errorCode,
1624
+ $metadata: deserializeMetadata(output),
1625
+ };
1626
+ break;
1627
+ default:
1628
+ const parsedBody = parsedOutput.body;
1629
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1630
+ response = {
1631
+ ...parsedBody,
1632
+ name: `${errorCode}`,
1633
+ message: parsedBody.message || parsedBody.Message || errorCode,
1634
+ $fault: "client",
1635
+ $metadata: deserializeMetadata(output),
1636
+ };
1637
+ }
1638
+ const message = response.message || response.Message || errorCode;
1639
+ response.message = message;
1640
+ delete response.Message;
1641
+ return Promise.reject(Object.assign(new Error(message), response));
1642
+ };
1417
1643
  const deserializeAws_restJson1GetComponentCommand = async (output, context) => {
1418
1644
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1419
1645
  return deserializeAws_restJson1GetComponentCommandError(output, context);
@@ -1582,6 +1808,66 @@ const deserializeAws_restJson1GetComponentVersionArtifactCommandError = async (o
1582
1808
  delete response.Message;
1583
1809
  return Promise.reject(Object.assign(new Error(message), response));
1584
1810
  };
1811
+ const deserializeAws_restJson1GetConnectivityInfoCommand = async (output, context) => {
1812
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1813
+ return deserializeAws_restJson1GetConnectivityInfoCommandError(output, context);
1814
+ }
1815
+ const contents = {
1816
+ $metadata: deserializeMetadata(output),
1817
+ connectivityInfo: undefined,
1818
+ message: undefined,
1819
+ };
1820
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
1821
+ if (data.ConnectivityInfo !== undefined && data.ConnectivityInfo !== null) {
1822
+ contents.connectivityInfo = deserializeAws_restJson1connectivityInfoList(data.ConnectivityInfo, context);
1823
+ }
1824
+ if (data.Message !== undefined && data.Message !== null) {
1825
+ contents.message = smithy_client_1.expectString(data.Message);
1826
+ }
1827
+ return Promise.resolve(contents);
1828
+ };
1829
+ exports.deserializeAws_restJson1GetConnectivityInfoCommand = deserializeAws_restJson1GetConnectivityInfoCommand;
1830
+ const deserializeAws_restJson1GetConnectivityInfoCommandError = async (output, context) => {
1831
+ const parsedOutput = {
1832
+ ...output,
1833
+ body: await parseBody(output.body, context),
1834
+ };
1835
+ let response;
1836
+ let errorCode = "UnknownError";
1837
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1838
+ switch (errorCode) {
1839
+ case "InternalServerException":
1840
+ case "com.amazonaws.greengrassv2#InternalServerException":
1841
+ response = {
1842
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
1843
+ name: errorCode,
1844
+ $metadata: deserializeMetadata(output),
1845
+ };
1846
+ break;
1847
+ case "ValidationException":
1848
+ case "com.amazonaws.greengrassv2#ValidationException":
1849
+ response = {
1850
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
1851
+ name: errorCode,
1852
+ $metadata: deserializeMetadata(output),
1853
+ };
1854
+ break;
1855
+ default:
1856
+ const parsedBody = parsedOutput.body;
1857
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
1858
+ response = {
1859
+ ...parsedBody,
1860
+ name: `${errorCode}`,
1861
+ message: parsedBody.message || parsedBody.Message || errorCode,
1862
+ $fault: "client",
1863
+ $metadata: deserializeMetadata(output),
1864
+ };
1865
+ }
1866
+ const message = response.message || response.Message || errorCode;
1867
+ response.message = message;
1868
+ delete response.Message;
1869
+ return Promise.reject(Object.assign(new Error(message), response));
1870
+ };
1585
1871
  const deserializeAws_restJson1GetCoreDeviceCommand = async (output, context) => {
1586
1872
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1587
1873
  return deserializeAws_restJson1GetCoreDeviceCommandError(output, context);
@@ -1814,6 +2100,58 @@ const deserializeAws_restJson1GetDeploymentCommandError = async (output, context
1814
2100
  delete response.Message;
1815
2101
  return Promise.reject(Object.assign(new Error(message), response));
1816
2102
  };
2103
+ const deserializeAws_restJson1GetServiceRoleForAccountCommand = async (output, context) => {
2104
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2105
+ return deserializeAws_restJson1GetServiceRoleForAccountCommandError(output, context);
2106
+ }
2107
+ const contents = {
2108
+ $metadata: deserializeMetadata(output),
2109
+ associatedAt: undefined,
2110
+ roleArn: undefined,
2111
+ };
2112
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
2113
+ if (data.AssociatedAt !== undefined && data.AssociatedAt !== null) {
2114
+ contents.associatedAt = smithy_client_1.expectString(data.AssociatedAt);
2115
+ }
2116
+ if (data.RoleArn !== undefined && data.RoleArn !== null) {
2117
+ contents.roleArn = smithy_client_1.expectString(data.RoleArn);
2118
+ }
2119
+ return Promise.resolve(contents);
2120
+ };
2121
+ exports.deserializeAws_restJson1GetServiceRoleForAccountCommand = deserializeAws_restJson1GetServiceRoleForAccountCommand;
2122
+ const deserializeAws_restJson1GetServiceRoleForAccountCommandError = async (output, context) => {
2123
+ const parsedOutput = {
2124
+ ...output,
2125
+ body: await parseBody(output.body, context),
2126
+ };
2127
+ let response;
2128
+ let errorCode = "UnknownError";
2129
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2130
+ switch (errorCode) {
2131
+ case "InternalServerException":
2132
+ case "com.amazonaws.greengrassv2#InternalServerException":
2133
+ response = {
2134
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
2135
+ name: errorCode,
2136
+ $metadata: deserializeMetadata(output),
2137
+ };
2138
+ break;
2139
+ default:
2140
+ const parsedBody = parsedOutput.body;
2141
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
2142
+ response = {
2143
+ ...parsedBody,
2144
+ name: `${errorCode}`,
2145
+ message: parsedBody.message || parsedBody.Message || errorCode,
2146
+ $fault: "client",
2147
+ $metadata: deserializeMetadata(output),
2148
+ };
2149
+ }
2150
+ const message = response.message || response.Message || errorCode;
2151
+ response.message = message;
2152
+ delete response.Message;
2153
+ return Promise.reject(Object.assign(new Error(message), response));
2154
+ };
1817
2155
  const deserializeAws_restJson1ListClientDevicesAssociatedWithCoreDeviceCommand = async (output, context) => {
1818
2156
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1819
2157
  return deserializeAws_restJson1ListClientDevicesAssociatedWithCoreDeviceCommandError(output, context);
@@ -2650,6 +2988,66 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
2650
2988
  delete response.Message;
2651
2989
  return Promise.reject(Object.assign(new Error(message), response));
2652
2990
  };
2991
+ const deserializeAws_restJson1UpdateConnectivityInfoCommand = async (output, context) => {
2992
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
2993
+ return deserializeAws_restJson1UpdateConnectivityInfoCommandError(output, context);
2994
+ }
2995
+ const contents = {
2996
+ $metadata: deserializeMetadata(output),
2997
+ message: undefined,
2998
+ version: undefined,
2999
+ };
3000
+ const data = smithy_client_1.expectNonNull(smithy_client_1.expectObject(await parseBody(output.body, context)), "body");
3001
+ if (data.Message !== undefined && data.Message !== null) {
3002
+ contents.message = smithy_client_1.expectString(data.Message);
3003
+ }
3004
+ if (data.Version !== undefined && data.Version !== null) {
3005
+ contents.version = smithy_client_1.expectString(data.Version);
3006
+ }
3007
+ return Promise.resolve(contents);
3008
+ };
3009
+ exports.deserializeAws_restJson1UpdateConnectivityInfoCommand = deserializeAws_restJson1UpdateConnectivityInfoCommand;
3010
+ const deserializeAws_restJson1UpdateConnectivityInfoCommandError = async (output, context) => {
3011
+ const parsedOutput = {
3012
+ ...output,
3013
+ body: await parseBody(output.body, context),
3014
+ };
3015
+ let response;
3016
+ let errorCode = "UnknownError";
3017
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3018
+ switch (errorCode) {
3019
+ case "InternalServerException":
3020
+ case "com.amazonaws.greengrassv2#InternalServerException":
3021
+ response = {
3022
+ ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
3023
+ name: errorCode,
3024
+ $metadata: deserializeMetadata(output),
3025
+ };
3026
+ break;
3027
+ case "ValidationException":
3028
+ case "com.amazonaws.greengrassv2#ValidationException":
3029
+ response = {
3030
+ ...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
3031
+ name: errorCode,
3032
+ $metadata: deserializeMetadata(output),
3033
+ };
3034
+ break;
3035
+ default:
3036
+ const parsedBody = parsedOutput.body;
3037
+ errorCode = parsedBody.code || parsedBody.Code || errorCode;
3038
+ response = {
3039
+ ...parsedBody,
3040
+ name: `${errorCode}`,
3041
+ message: parsedBody.message || parsedBody.Message || errorCode,
3042
+ $fault: "client",
3043
+ $metadata: deserializeMetadata(output),
3044
+ };
3045
+ }
3046
+ const message = response.message || response.Message || errorCode;
3047
+ response.message = message;
3048
+ delete response.Message;
3049
+ return Promise.reject(Object.assign(new Error(message), response));
3050
+ };
2653
3051
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
2654
3052
  const contents = {
2655
3053
  name: "AccessDeniedException",
@@ -2945,6 +3343,24 @@ const serializeAws_restJson1ComponentVersionRequirementMap = (input, context) =>
2945
3343
  };
2946
3344
  }, {});
2947
3345
  };
3346
+ const serializeAws_restJson1ConnectivityInfo = (input, context) => {
3347
+ return {
3348
+ ...(input.hostAddress !== undefined && input.hostAddress !== null && { HostAddress: input.hostAddress }),
3349
+ ...(input.id !== undefined && input.id !== null && { Id: input.id }),
3350
+ ...(input.metadata !== undefined && input.metadata !== null && { Metadata: input.metadata }),
3351
+ ...(input.portNumber !== undefined && input.portNumber !== null && { PortNumber: input.portNumber }),
3352
+ };
3353
+ };
3354
+ const serializeAws_restJson1connectivityInfoList = (input, context) => {
3355
+ return input
3356
+ .filter((e) => e != null)
3357
+ .map((entry) => {
3358
+ if (entry === null) {
3359
+ return null;
3360
+ }
3361
+ return serializeAws_restJson1ConnectivityInfo(entry, context);
3362
+ });
3363
+ };
2948
3364
  const serializeAws_restJson1DeploymentComponentUpdatePolicy = (input, context) => {
2949
3365
  return {
2950
3366
  ...(input.action !== undefined && input.action !== null && { action: input.action }),
@@ -3399,6 +3815,24 @@ const deserializeAws_restJson1ComponentVersionListItem = (output, context) => {
3399
3815
  componentVersion: smithy_client_1.expectString(output.componentVersion),
3400
3816
  };
3401
3817
  };
3818
+ const deserializeAws_restJson1ConnectivityInfo = (output, context) => {
3819
+ return {
3820
+ hostAddress: smithy_client_1.expectString(output.HostAddress),
3821
+ id: smithy_client_1.expectString(output.Id),
3822
+ metadata: smithy_client_1.expectString(output.Metadata),
3823
+ portNumber: smithy_client_1.expectInt32(output.PortNumber),
3824
+ };
3825
+ };
3826
+ const deserializeAws_restJson1connectivityInfoList = (output, context) => {
3827
+ return (output || [])
3828
+ .filter((e) => e != null)
3829
+ .map((entry) => {
3830
+ if (entry === null) {
3831
+ return null;
3832
+ }
3833
+ return deserializeAws_restJson1ConnectivityInfo(entry, context);
3834
+ });
3835
+ };
3402
3836
  const deserializeAws_restJson1CoreDevice = (output, context) => {
3403
3837
  return {
3404
3838
  coreDeviceThingName: smithy_client_1.expectString(output.coreDeviceThingName),
@@ -15,10 +15,8 @@ const util_body_length_node_1 = require("@aws-sdk/util-body-length-node");
15
15
  const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node");
16
16
  const util_utf8_node_1 = require("@aws-sdk/util-utf8-node");
17
17
  const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
18
- const smithy_client_1 = require("@aws-sdk/smithy-client");
19
18
  const getRuntimeConfig = (config) => {
20
19
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
21
- smithy_client_1.emitWarningIfUnsupportedVersion(process.version);
22
20
  const clientSharedValues = runtimeConfig_shared_1.getRuntimeConfig(config);
23
21
  return {
24
22
  ...clientSharedValues,
@@ -1,4 +1,5 @@
1
1
  import { __extends } from "tslib";
2
+ import { AssociateServiceRoleToAccountCommand, } from "./commands/AssociateServiceRoleToAccountCommand";
2
3
  import { BatchAssociateClientDeviceWithCoreDeviceCommand, } from "./commands/BatchAssociateClientDeviceWithCoreDeviceCommand";
3
4
  import { BatchDisassociateClientDeviceFromCoreDeviceCommand, } from "./commands/BatchDisassociateClientDeviceFromCoreDeviceCommand";
4
5
  import { CancelDeploymentCommand, } from "./commands/CancelDeploymentCommand";
@@ -7,10 +8,13 @@ import { CreateDeploymentCommand, } from "./commands/CreateDeploymentCommand";
7
8
  import { DeleteComponentCommand, } from "./commands/DeleteComponentCommand";
8
9
  import { DeleteCoreDeviceCommand, } from "./commands/DeleteCoreDeviceCommand";
9
10
  import { DescribeComponentCommand, } from "./commands/DescribeComponentCommand";
11
+ import { DisassociateServiceRoleFromAccountCommand, } from "./commands/DisassociateServiceRoleFromAccountCommand";
10
12
  import { GetComponentCommand, } from "./commands/GetComponentCommand";
11
13
  import { GetComponentVersionArtifactCommand, } from "./commands/GetComponentVersionArtifactCommand";
14
+ import { GetConnectivityInfoCommand, } from "./commands/GetConnectivityInfoCommand";
12
15
  import { GetCoreDeviceCommand, } from "./commands/GetCoreDeviceCommand";
13
16
  import { GetDeploymentCommand, } from "./commands/GetDeploymentCommand";
17
+ import { GetServiceRoleForAccountCommand, } from "./commands/GetServiceRoleForAccountCommand";
14
18
  import { ListClientDevicesAssociatedWithCoreDeviceCommand, } from "./commands/ListClientDevicesAssociatedWithCoreDeviceCommand";
15
19
  import { ListComponentsCommand, } from "./commands/ListComponentsCommand";
16
20
  import { ListComponentVersionsCommand, } from "./commands/ListComponentVersionsCommand";
@@ -22,12 +26,27 @@ import { ListTagsForResourceCommand, } from "./commands/ListTagsForResourceComma
22
26
  import { ResolveComponentCandidatesCommand, } from "./commands/ResolveComponentCandidatesCommand";
23
27
  import { TagResourceCommand } from "./commands/TagResourceCommand";
24
28
  import { UntagResourceCommand, } from "./commands/UntagResourceCommand";
29
+ import { UpdateConnectivityInfoCommand, } from "./commands/UpdateConnectivityInfoCommand";
25
30
  import { GreengrassV2Client } from "./GreengrassV2Client";
26
31
  var GreengrassV2 = (function (_super) {
27
32
  __extends(GreengrassV2, _super);
28
33
  function GreengrassV2() {
29
34
  return _super !== null && _super.apply(this, arguments) || this;
30
35
  }
36
+ GreengrassV2.prototype.associateServiceRoleToAccount = function (args, optionsOrCb, cb) {
37
+ var command = new AssociateServiceRoleToAccountCommand(args);
38
+ if (typeof optionsOrCb === "function") {
39
+ this.send(command, optionsOrCb);
40
+ }
41
+ else if (typeof cb === "function") {
42
+ if (typeof optionsOrCb !== "object")
43
+ throw new Error("Expect http options but get " + typeof optionsOrCb);
44
+ this.send(command, optionsOrCb || {}, cb);
45
+ }
46
+ else {
47
+ return this.send(command, optionsOrCb);
48
+ }
49
+ };
31
50
  GreengrassV2.prototype.batchAssociateClientDeviceWithCoreDevice = function (args, optionsOrCb, cb) {
32
51
  var command = new BatchAssociateClientDeviceWithCoreDeviceCommand(args);
33
52
  if (typeof optionsOrCb === "function") {
@@ -140,6 +159,20 @@ var GreengrassV2 = (function (_super) {
140
159
  return this.send(command, optionsOrCb);
141
160
  }
142
161
  };
162
+ GreengrassV2.prototype.disassociateServiceRoleFromAccount = function (args, optionsOrCb, cb) {
163
+ var command = new DisassociateServiceRoleFromAccountCommand(args);
164
+ if (typeof optionsOrCb === "function") {
165
+ this.send(command, optionsOrCb);
166
+ }
167
+ else if (typeof cb === "function") {
168
+ if (typeof optionsOrCb !== "object")
169
+ throw new Error("Expect http options but get " + typeof optionsOrCb);
170
+ this.send(command, optionsOrCb || {}, cb);
171
+ }
172
+ else {
173
+ return this.send(command, optionsOrCb);
174
+ }
175
+ };
143
176
  GreengrassV2.prototype.getComponent = function (args, optionsOrCb, cb) {
144
177
  var command = new GetComponentCommand(args);
145
178
  if (typeof optionsOrCb === "function") {
@@ -168,6 +201,20 @@ var GreengrassV2 = (function (_super) {
168
201
  return this.send(command, optionsOrCb);
169
202
  }
170
203
  };
204
+ GreengrassV2.prototype.getConnectivityInfo = function (args, optionsOrCb, cb) {
205
+ var command = new GetConnectivityInfoCommand(args);
206
+ if (typeof optionsOrCb === "function") {
207
+ this.send(command, optionsOrCb);
208
+ }
209
+ else if (typeof cb === "function") {
210
+ if (typeof optionsOrCb !== "object")
211
+ throw new Error("Expect http options but get " + typeof optionsOrCb);
212
+ this.send(command, optionsOrCb || {}, cb);
213
+ }
214
+ else {
215
+ return this.send(command, optionsOrCb);
216
+ }
217
+ };
171
218
  GreengrassV2.prototype.getCoreDevice = function (args, optionsOrCb, cb) {
172
219
  var command = new GetCoreDeviceCommand(args);
173
220
  if (typeof optionsOrCb === "function") {
@@ -196,6 +243,20 @@ var GreengrassV2 = (function (_super) {
196
243
  return this.send(command, optionsOrCb);
197
244
  }
198
245
  };
246
+ GreengrassV2.prototype.getServiceRoleForAccount = function (args, optionsOrCb, cb) {
247
+ var command = new GetServiceRoleForAccountCommand(args);
248
+ if (typeof optionsOrCb === "function") {
249
+ this.send(command, optionsOrCb);
250
+ }
251
+ else if (typeof cb === "function") {
252
+ if (typeof optionsOrCb !== "object")
253
+ throw new Error("Expect http options but get " + typeof optionsOrCb);
254
+ this.send(command, optionsOrCb || {}, cb);
255
+ }
256
+ else {
257
+ return this.send(command, optionsOrCb);
258
+ }
259
+ };
199
260
  GreengrassV2.prototype.listClientDevicesAssociatedWithCoreDevice = function (args, optionsOrCb, cb) {
200
261
  var command = new ListClientDevicesAssociatedWithCoreDeviceCommand(args);
201
262
  if (typeof optionsOrCb === "function") {
@@ -350,6 +411,20 @@ var GreengrassV2 = (function (_super) {
350
411
  return this.send(command, optionsOrCb);
351
412
  }
352
413
  };
414
+ GreengrassV2.prototype.updateConnectivityInfo = function (args, optionsOrCb, cb) {
415
+ var command = new UpdateConnectivityInfoCommand(args);
416
+ if (typeof optionsOrCb === "function") {
417
+ this.send(command, optionsOrCb);
418
+ }
419
+ else if (typeof cb === "function") {
420
+ if (typeof optionsOrCb !== "object")
421
+ throw new Error("Expect http options but get " + typeof optionsOrCb);
422
+ this.send(command, optionsOrCb || {}, cb);
423
+ }
424
+ else {
425
+ return this.send(command, optionsOrCb);
426
+ }
427
+ };
353
428
  return GreengrassV2;
354
429
  }(GreengrassV2Client));
355
430
  export { GreengrassV2 };