@aws-sdk/client-grafana 3.58.0 → 3.61.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 (32) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist-cjs/Grafana.js +45 -0
  3. package/dist-cjs/commands/ListTagsForResourceCommand.js +36 -0
  4. package/dist-cjs/commands/TagResourceCommand.js +36 -0
  5. package/dist-cjs/commands/UntagResourceCommand.js +36 -0
  6. package/dist-cjs/commands/index.js +3 -0
  7. package/dist-cjs/models/models_0.js +40 -2
  8. package/dist-cjs/protocols/Aws_restJson1.js +256 -1
  9. package/dist-es/Grafana.js +45 -0
  10. package/dist-es/commands/ListTagsForResourceCommand.js +39 -0
  11. package/dist-es/commands/TagResourceCommand.js +39 -0
  12. package/dist-es/commands/UntagResourceCommand.js +39 -0
  13. package/dist-es/commands/index.js +3 -0
  14. package/dist-es/models/models_0.js +26 -0
  15. package/dist-es/protocols/Aws_restJson1.js +331 -3
  16. package/dist-types/Grafana.d.ts +28 -0
  17. package/dist-types/GrafanaClient.d.ts +5 -2
  18. package/dist-types/commands/ListTagsForResourceCommand.d.ts +37 -0
  19. package/dist-types/commands/TagResourceCommand.d.ts +39 -0
  20. package/dist-types/commands/UntagResourceCommand.d.ts +36 -0
  21. package/dist-types/commands/index.d.ts +3 -0
  22. package/dist-types/models/models_0.d.ts +112 -8
  23. package/dist-types/protocols/Aws_restJson1.d.ts +9 -0
  24. package/dist-types/ts3.4/Grafana.d.ts +15 -0
  25. package/dist-types/ts3.4/GrafanaClient.d.ts +5 -2
  26. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +17 -0
  27. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +17 -0
  28. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +17 -0
  29. package/dist-types/ts3.4/commands/index.d.ts +3 -0
  30. package/dist-types/ts3.4/models/models_0.d.ts +68 -0
  31. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +9 -0
  32. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.61.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.60.0...v3.61.0) (2022-03-31)
7
+
8
+
9
+ ### Features
10
+
11
+ * **client-grafana:** This release adds tagging support to the Managed Grafana service. New APIs: TagResource, UntagResource and ListTagsForResource. Updates: add optional field tags to support tagging while calling CreateWorkspace. ([38838fa](https://github.com/aws/aws-sdk-js-v3/commit/38838fa822f863c6f6e6380c31596247fac2f40e))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.58.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.57.0...v3.58.0) (2022-03-28)
7
18
 
8
19
  **Note:** Version bump only for package @aws-sdk/client-grafana
@@ -8,7 +8,10 @@ const DescribeWorkspaceAuthenticationCommand_1 = require("./commands/DescribeWor
8
8
  const DescribeWorkspaceCommand_1 = require("./commands/DescribeWorkspaceCommand");
9
9
  const DisassociateLicenseCommand_1 = require("./commands/DisassociateLicenseCommand");
10
10
  const ListPermissionsCommand_1 = require("./commands/ListPermissionsCommand");
11
+ const ListTagsForResourceCommand_1 = require("./commands/ListTagsForResourceCommand");
11
12
  const ListWorkspacesCommand_1 = require("./commands/ListWorkspacesCommand");
13
+ const TagResourceCommand_1 = require("./commands/TagResourceCommand");
14
+ const UntagResourceCommand_1 = require("./commands/UntagResourceCommand");
12
15
  const UpdatePermissionsCommand_1 = require("./commands/UpdatePermissionsCommand");
13
16
  const UpdateWorkspaceAuthenticationCommand_1 = require("./commands/UpdateWorkspaceAuthenticationCommand");
14
17
  const UpdateWorkspaceCommand_1 = require("./commands/UpdateWorkspaceCommand");
@@ -112,6 +115,20 @@ class Grafana extends GrafanaClient_1.GrafanaClient {
112
115
  return this.send(command, optionsOrCb);
113
116
  }
114
117
  }
118
+ listTagsForResource(args, optionsOrCb, cb) {
119
+ const command = new ListTagsForResourceCommand_1.ListTagsForResourceCommand(args);
120
+ if (typeof optionsOrCb === "function") {
121
+ this.send(command, optionsOrCb);
122
+ }
123
+ else if (typeof cb === "function") {
124
+ if (typeof optionsOrCb !== "object")
125
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
126
+ this.send(command, optionsOrCb || {}, cb);
127
+ }
128
+ else {
129
+ return this.send(command, optionsOrCb);
130
+ }
131
+ }
115
132
  listWorkspaces(args, optionsOrCb, cb) {
116
133
  const command = new ListWorkspacesCommand_1.ListWorkspacesCommand(args);
117
134
  if (typeof optionsOrCb === "function") {
@@ -126,6 +143,34 @@ class Grafana extends GrafanaClient_1.GrafanaClient {
126
143
  return this.send(command, optionsOrCb);
127
144
  }
128
145
  }
146
+ tagResource(args, optionsOrCb, cb) {
147
+ const command = new TagResourceCommand_1.TagResourceCommand(args);
148
+ if (typeof optionsOrCb === "function") {
149
+ this.send(command, optionsOrCb);
150
+ }
151
+ else if (typeof cb === "function") {
152
+ if (typeof optionsOrCb !== "object")
153
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
154
+ this.send(command, optionsOrCb || {}, cb);
155
+ }
156
+ else {
157
+ return this.send(command, optionsOrCb);
158
+ }
159
+ }
160
+ untagResource(args, optionsOrCb, cb) {
161
+ const command = new UntagResourceCommand_1.UntagResourceCommand(args);
162
+ if (typeof optionsOrCb === "function") {
163
+ this.send(command, optionsOrCb);
164
+ }
165
+ else if (typeof cb === "function") {
166
+ if (typeof optionsOrCb !== "object")
167
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
168
+ this.send(command, optionsOrCb || {}, cb);
169
+ }
170
+ else {
171
+ return this.send(command, optionsOrCb);
172
+ }
173
+ }
129
174
  updatePermissions(args, optionsOrCb, cb) {
130
175
  const command = new UpdatePermissionsCommand_1.UpdatePermissionsCommand(args);
131
176
  if (typeof optionsOrCb === "function") {
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListTagsForResourceCommand = void 0;
4
+ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
5
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const models_0_1 = require("../models/models_0");
7
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
8
+ class ListTagsForResourceCommand extends smithy_client_1.Command {
9
+ constructor(input) {
10
+ super();
11
+ this.input = input;
12
+ }
13
+ resolveMiddleware(clientStack, configuration, options) {
14
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
15
+ const stack = clientStack.concat(this.middlewareStack);
16
+ const { logger } = configuration;
17
+ const clientName = "GrafanaClient";
18
+ const commandName = "ListTagsForResourceCommand";
19
+ const handlerExecutionContext = {
20
+ logger,
21
+ clientName,
22
+ commandName,
23
+ inputFilterSensitiveLog: models_0_1.ListTagsForResourceRequest.filterSensitiveLog,
24
+ outputFilterSensitiveLog: models_0_1.ListTagsForResourceResponse.filterSensitiveLog,
25
+ };
26
+ const { requestHandler } = configuration;
27
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
28
+ }
29
+ serialize(input, context) {
30
+ return (0, Aws_restJson1_1.serializeAws_restJson1ListTagsForResourceCommand)(input, context);
31
+ }
32
+ deserialize(output, context) {
33
+ return (0, Aws_restJson1_1.deserializeAws_restJson1ListTagsForResourceCommand)(output, context);
34
+ }
35
+ }
36
+ exports.ListTagsForResourceCommand = ListTagsForResourceCommand;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TagResourceCommand = void 0;
4
+ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
5
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const models_0_1 = require("../models/models_0");
7
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
8
+ class TagResourceCommand extends smithy_client_1.Command {
9
+ constructor(input) {
10
+ super();
11
+ this.input = input;
12
+ }
13
+ resolveMiddleware(clientStack, configuration, options) {
14
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
15
+ const stack = clientStack.concat(this.middlewareStack);
16
+ const { logger } = configuration;
17
+ const clientName = "GrafanaClient";
18
+ const commandName = "TagResourceCommand";
19
+ const handlerExecutionContext = {
20
+ logger,
21
+ clientName,
22
+ commandName,
23
+ inputFilterSensitiveLog: models_0_1.TagResourceRequest.filterSensitiveLog,
24
+ outputFilterSensitiveLog: models_0_1.TagResourceResponse.filterSensitiveLog,
25
+ };
26
+ const { requestHandler } = configuration;
27
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
28
+ }
29
+ serialize(input, context) {
30
+ return (0, Aws_restJson1_1.serializeAws_restJson1TagResourceCommand)(input, context);
31
+ }
32
+ deserialize(output, context) {
33
+ return (0, Aws_restJson1_1.deserializeAws_restJson1TagResourceCommand)(output, context);
34
+ }
35
+ }
36
+ exports.TagResourceCommand = TagResourceCommand;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UntagResourceCommand = void 0;
4
+ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
5
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const models_0_1 = require("../models/models_0");
7
+ const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
8
+ class UntagResourceCommand extends smithy_client_1.Command {
9
+ constructor(input) {
10
+ super();
11
+ this.input = input;
12
+ }
13
+ resolveMiddleware(clientStack, configuration, options) {
14
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
15
+ const stack = clientStack.concat(this.middlewareStack);
16
+ const { logger } = configuration;
17
+ const clientName = "GrafanaClient";
18
+ const commandName = "UntagResourceCommand";
19
+ const handlerExecutionContext = {
20
+ logger,
21
+ clientName,
22
+ commandName,
23
+ inputFilterSensitiveLog: models_0_1.UntagResourceRequest.filterSensitiveLog,
24
+ outputFilterSensitiveLog: models_0_1.UntagResourceResponse.filterSensitiveLog,
25
+ };
26
+ const { requestHandler } = configuration;
27
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
28
+ }
29
+ serialize(input, context) {
30
+ return (0, Aws_restJson1_1.serializeAws_restJson1UntagResourceCommand)(input, context);
31
+ }
32
+ deserialize(output, context) {
33
+ return (0, Aws_restJson1_1.deserializeAws_restJson1UntagResourceCommand)(output, context);
34
+ }
35
+ }
36
+ exports.UntagResourceCommand = UntagResourceCommand;
@@ -8,7 +8,10 @@ tslib_1.__exportStar(require("./DescribeWorkspaceAuthenticationCommand"), export
8
8
  tslib_1.__exportStar(require("./DescribeWorkspaceCommand"), exports);
9
9
  tslib_1.__exportStar(require("./DisassociateLicenseCommand"), exports);
10
10
  tslib_1.__exportStar(require("./ListPermissionsCommand"), exports);
11
+ tslib_1.__exportStar(require("./ListTagsForResourceCommand"), exports);
11
12
  tslib_1.__exportStar(require("./ListWorkspacesCommand"), exports);
13
+ tslib_1.__exportStar(require("./TagResourceCommand"), exports);
14
+ tslib_1.__exportStar(require("./UntagResourceCommand"), exports);
12
15
  tslib_1.__exportStar(require("./UpdatePermissionsCommand"), exports);
13
16
  tslib_1.__exportStar(require("./UpdateWorkspaceAuthenticationCommand"), exports);
14
17
  tslib_1.__exportStar(require("./UpdateWorkspaceCommand"), exports);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DescribeWorkspaceRequest = exports.DeleteWorkspaceResponse = exports.DeleteWorkspaceRequest = exports.ServiceQuotaExceededException = exports.CreateWorkspaceResponse = exports.CreateWorkspaceRequest = exports.UpdatePermissionsResponse = exports.UpdateError = exports.UpdatePermissionsRequest = exports.UpdateInstruction = exports.UpdateAction = exports.ListPermissionsResponse = exports.PermissionEntry = exports.User = exports.Role = exports.ListPermissionsRequest = exports.UserType = exports.DisassociateLicenseResponse = exports.DisassociateLicenseRequest = exports.UpdateWorkspaceAuthenticationResponse = exports.UpdateWorkspaceAuthenticationRequest = exports.ConflictException = exports.DescribeWorkspaceAuthenticationResponse = exports.AuthenticationDescription = exports.SamlAuthentication = exports.SamlConfiguration = exports.RoleValues = exports.IdpMetadata = exports.AwsSsoAuthentication = exports.DescribeWorkspaceAuthenticationRequest = exports.ValidationException = exports.ValidationExceptionReason = exports.ValidationExceptionField = exports.ThrottlingException = exports.ResourceNotFoundException = exports.InternalServerException = exports.AssociateLicenseResponse = exports.WorkspaceDescription = exports.WorkspaceStatus = exports.PermissionType = exports.NotificationDestinationType = exports.DataSourceType = exports.AuthenticationSummary = exports.SamlConfigurationStatus = exports.AuthenticationProviderTypes = exports.AssociateLicenseRequest = exports.LicenseType = exports.AssertionAttributes = exports.AccountAccessType = exports.AccessDeniedException = void 0;
4
- exports.UpdateWorkspaceResponse = exports.UpdateWorkspaceRequest = exports.ListWorkspacesResponse = exports.WorkspaceSummary = exports.ListWorkspacesRequest = exports.DescribeWorkspaceResponse = void 0;
3
+ exports.UntagResourceResponse = exports.UntagResourceRequest = exports.TagResourceResponse = exports.TagResourceRequest = exports.UpdatePermissionsResponse = exports.UpdateError = exports.UpdatePermissionsRequest = exports.UpdateInstruction = exports.UpdateAction = exports.ListPermissionsResponse = exports.PermissionEntry = exports.User = exports.Role = exports.ListPermissionsRequest = exports.UserType = exports.ListTagsForResourceResponse = exports.ListTagsForResourceRequest = exports.DisassociateLicenseResponse = exports.DisassociateLicenseRequest = exports.UpdateWorkspaceAuthenticationResponse = exports.UpdateWorkspaceAuthenticationRequest = exports.ConflictException = exports.DescribeWorkspaceAuthenticationResponse = exports.AuthenticationDescription = exports.SamlAuthentication = exports.SamlConfiguration = exports.RoleValues = exports.IdpMetadata = exports.AwsSsoAuthentication = exports.DescribeWorkspaceAuthenticationRequest = exports.ValidationException = exports.ValidationExceptionReason = exports.ValidationExceptionField = exports.ThrottlingException = exports.ResourceNotFoundException = exports.InternalServerException = exports.AssociateLicenseResponse = exports.WorkspaceDescription = exports.WorkspaceStatus = exports.PermissionType = exports.NotificationDestinationType = exports.DataSourceType = exports.AuthenticationSummary = exports.SamlConfigurationStatus = exports.AuthenticationProviderTypes = exports.AssociateLicenseRequest = exports.LicenseType = exports.AssertionAttributes = exports.AccountAccessType = exports.AccessDeniedException = void 0;
4
+ exports.UpdateWorkspaceResponse = exports.UpdateWorkspaceRequest = exports.ListWorkspacesResponse = exports.WorkspaceSummary = exports.ListWorkspacesRequest = exports.DescribeWorkspaceResponse = exports.DescribeWorkspaceRequest = exports.DeleteWorkspaceResponse = exports.DeleteWorkspaceRequest = exports.ServiceQuotaExceededException = exports.CreateWorkspaceResponse = exports.CreateWorkspaceRequest = void 0;
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const GrafanaServiceException_1 = require("./GrafanaServiceException");
7
7
  class AccessDeniedException extends GrafanaServiceException_1.GrafanaServiceException {
@@ -58,8 +58,10 @@ var AuthenticationSummary;
58
58
  var DataSourceType;
59
59
  (function (DataSourceType) {
60
60
  DataSourceType["AMAZON_OPENSEARCH_SERVICE"] = "AMAZON_OPENSEARCH_SERVICE";
61
+ DataSourceType["ATHENA"] = "ATHENA";
61
62
  DataSourceType["CLOUDWATCH"] = "CLOUDWATCH";
62
63
  DataSourceType["PROMETHEUS"] = "PROMETHEUS";
64
+ DataSourceType["REDSHIFT"] = "REDSHIFT";
63
65
  DataSourceType["SITEWISE"] = "SITEWISE";
64
66
  DataSourceType["TIMESTREAM"] = "TIMESTREAM";
65
67
  DataSourceType["XRAY"] = "XRAY";
@@ -286,6 +288,18 @@ var DisassociateLicenseResponse;
286
288
  ...(obj.workspace && { workspace: WorkspaceDescription.filterSensitiveLog(obj.workspace) }),
287
289
  });
288
290
  })(DisassociateLicenseResponse = exports.DisassociateLicenseResponse || (exports.DisassociateLicenseResponse = {}));
291
+ var ListTagsForResourceRequest;
292
+ (function (ListTagsForResourceRequest) {
293
+ ListTagsForResourceRequest.filterSensitiveLog = (obj) => ({
294
+ ...obj,
295
+ });
296
+ })(ListTagsForResourceRequest = exports.ListTagsForResourceRequest || (exports.ListTagsForResourceRequest = {}));
297
+ var ListTagsForResourceResponse;
298
+ (function (ListTagsForResourceResponse) {
299
+ ListTagsForResourceResponse.filterSensitiveLog = (obj) => ({
300
+ ...obj,
301
+ });
302
+ })(ListTagsForResourceResponse = exports.ListTagsForResourceResponse || (exports.ListTagsForResourceResponse = {}));
289
303
  var UserType;
290
304
  (function (UserType) {
291
305
  UserType["SSO_GROUP"] = "SSO_GROUP";
@@ -349,6 +363,30 @@ var UpdatePermissionsResponse;
349
363
  ...obj,
350
364
  });
351
365
  })(UpdatePermissionsResponse = exports.UpdatePermissionsResponse || (exports.UpdatePermissionsResponse = {}));
366
+ var TagResourceRequest;
367
+ (function (TagResourceRequest) {
368
+ TagResourceRequest.filterSensitiveLog = (obj) => ({
369
+ ...obj,
370
+ });
371
+ })(TagResourceRequest = exports.TagResourceRequest || (exports.TagResourceRequest = {}));
372
+ var TagResourceResponse;
373
+ (function (TagResourceResponse) {
374
+ TagResourceResponse.filterSensitiveLog = (obj) => ({
375
+ ...obj,
376
+ });
377
+ })(TagResourceResponse = exports.TagResourceResponse || (exports.TagResourceResponse = {}));
378
+ var UntagResourceRequest;
379
+ (function (UntagResourceRequest) {
380
+ UntagResourceRequest.filterSensitiveLog = (obj) => ({
381
+ ...obj,
382
+ });
383
+ })(UntagResourceRequest = exports.UntagResourceRequest || (exports.UntagResourceRequest = {}));
384
+ var UntagResourceResponse;
385
+ (function (UntagResourceResponse) {
386
+ UntagResourceResponse.filterSensitiveLog = (obj) => ({
387
+ ...obj,
388
+ });
389
+ })(UntagResourceResponse = exports.UntagResourceResponse || (exports.UntagResourceResponse = {}));
352
390
  var CreateWorkspaceRequest;
353
391
  (function (CreateWorkspaceRequest) {
354
392
  CreateWorkspaceRequest.filterSensitiveLog = (obj) => ({
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deserializeAws_restJson1UpdateWorkspaceAuthenticationCommand = exports.deserializeAws_restJson1UpdateWorkspaceCommand = exports.deserializeAws_restJson1UpdatePermissionsCommand = exports.deserializeAws_restJson1ListWorkspacesCommand = exports.deserializeAws_restJson1ListPermissionsCommand = exports.deserializeAws_restJson1DisassociateLicenseCommand = exports.deserializeAws_restJson1DescribeWorkspaceAuthenticationCommand = exports.deserializeAws_restJson1DescribeWorkspaceCommand = exports.deserializeAws_restJson1DeleteWorkspaceCommand = exports.deserializeAws_restJson1CreateWorkspaceCommand = exports.deserializeAws_restJson1AssociateLicenseCommand = exports.serializeAws_restJson1UpdateWorkspaceAuthenticationCommand = exports.serializeAws_restJson1UpdateWorkspaceCommand = exports.serializeAws_restJson1UpdatePermissionsCommand = exports.serializeAws_restJson1ListWorkspacesCommand = exports.serializeAws_restJson1ListPermissionsCommand = exports.serializeAws_restJson1DisassociateLicenseCommand = exports.serializeAws_restJson1DescribeWorkspaceAuthenticationCommand = exports.serializeAws_restJson1DescribeWorkspaceCommand = exports.serializeAws_restJson1DeleteWorkspaceCommand = exports.serializeAws_restJson1CreateWorkspaceCommand = exports.serializeAws_restJson1AssociateLicenseCommand = void 0;
3
+ exports.deserializeAws_restJson1UpdateWorkspaceAuthenticationCommand = exports.deserializeAws_restJson1UpdateWorkspaceCommand = exports.deserializeAws_restJson1UpdatePermissionsCommand = exports.deserializeAws_restJson1UntagResourceCommand = exports.deserializeAws_restJson1TagResourceCommand = exports.deserializeAws_restJson1ListWorkspacesCommand = exports.deserializeAws_restJson1ListTagsForResourceCommand = exports.deserializeAws_restJson1ListPermissionsCommand = exports.deserializeAws_restJson1DisassociateLicenseCommand = exports.deserializeAws_restJson1DescribeWorkspaceAuthenticationCommand = exports.deserializeAws_restJson1DescribeWorkspaceCommand = exports.deserializeAws_restJson1DeleteWorkspaceCommand = exports.deserializeAws_restJson1CreateWorkspaceCommand = exports.deserializeAws_restJson1AssociateLicenseCommand = exports.serializeAws_restJson1UpdateWorkspaceAuthenticationCommand = exports.serializeAws_restJson1UpdateWorkspaceCommand = exports.serializeAws_restJson1UpdatePermissionsCommand = exports.serializeAws_restJson1UntagResourceCommand = exports.serializeAws_restJson1TagResourceCommand = exports.serializeAws_restJson1ListWorkspacesCommand = exports.serializeAws_restJson1ListTagsForResourceCommand = exports.serializeAws_restJson1ListPermissionsCommand = exports.serializeAws_restJson1DisassociateLicenseCommand = exports.serializeAws_restJson1DescribeWorkspaceAuthenticationCommand = exports.serializeAws_restJson1DescribeWorkspaceCommand = exports.serializeAws_restJson1DeleteWorkspaceCommand = exports.serializeAws_restJson1CreateWorkspaceCommand = exports.serializeAws_restJson1AssociateLicenseCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const uuid_1 = require("uuid");
@@ -64,6 +64,7 @@ const serializeAws_restJson1CreateWorkspaceCommand = async (input, context) => {
64
64
  ...(input.permissionType !== undefined &&
65
65
  input.permissionType !== null && { permissionType: input.permissionType }),
66
66
  ...(input.stackSetName !== undefined && input.stackSetName !== null && { stackSetName: input.stackSetName }),
67
+ ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
67
68
  ...(input.workspaceDataSources !== undefined &&
68
69
  input.workspaceDataSources !== null && {
69
70
  workspaceDataSources: serializeAws_restJson1DataSourceTypesList(input.workspaceDataSources, context),
@@ -242,6 +243,32 @@ const serializeAws_restJson1ListPermissionsCommand = async (input, context) => {
242
243
  });
243
244
  };
244
245
  exports.serializeAws_restJson1ListPermissionsCommand = serializeAws_restJson1ListPermissionsCommand;
246
+ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
247
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
248
+ const headers = {};
249
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
250
+ if (input.resourceArn !== undefined) {
251
+ const labelValue = input.resourceArn;
252
+ if (labelValue.length <= 0) {
253
+ throw new Error("Empty value provided for input HTTP label: resourceArn.");
254
+ }
255
+ resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
256
+ }
257
+ else {
258
+ throw new Error("No value provided for input HTTP label: resourceArn.");
259
+ }
260
+ let body;
261
+ return new protocol_http_1.HttpRequest({
262
+ protocol,
263
+ hostname,
264
+ port,
265
+ method: "GET",
266
+ headers,
267
+ path: resolvedPath,
268
+ body,
269
+ });
270
+ };
271
+ exports.serializeAws_restJson1ListTagsForResourceCommand = serializeAws_restJson1ListTagsForResourceCommand;
245
272
  const serializeAws_restJson1ListWorkspacesCommand = async (input, context) => {
246
273
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
247
274
  const headers = {};
@@ -263,6 +290,67 @@ const serializeAws_restJson1ListWorkspacesCommand = async (input, context) => {
263
290
  });
264
291
  };
265
292
  exports.serializeAws_restJson1ListWorkspacesCommand = serializeAws_restJson1ListWorkspacesCommand;
293
+ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
294
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
295
+ const headers = {
296
+ "content-type": "application/json",
297
+ };
298
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
299
+ if (input.resourceArn !== undefined) {
300
+ const labelValue = input.resourceArn;
301
+ if (labelValue.length <= 0) {
302
+ throw new Error("Empty value provided for input HTTP label: resourceArn.");
303
+ }
304
+ resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
305
+ }
306
+ else {
307
+ throw new Error("No value provided for input HTTP label: resourceArn.");
308
+ }
309
+ let body;
310
+ body = JSON.stringify({
311
+ ...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
312
+ });
313
+ return new protocol_http_1.HttpRequest({
314
+ protocol,
315
+ hostname,
316
+ port,
317
+ method: "POST",
318
+ headers,
319
+ path: resolvedPath,
320
+ body,
321
+ });
322
+ };
323
+ exports.serializeAws_restJson1TagResourceCommand = serializeAws_restJson1TagResourceCommand;
324
+ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
325
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
326
+ const headers = {};
327
+ let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
328
+ if (input.resourceArn !== undefined) {
329
+ const labelValue = input.resourceArn;
330
+ if (labelValue.length <= 0) {
331
+ throw new Error("Empty value provided for input HTTP label: resourceArn.");
332
+ }
333
+ resolvedPath = resolvedPath.replace("{resourceArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
334
+ }
335
+ else {
336
+ throw new Error("No value provided for input HTTP label: resourceArn.");
337
+ }
338
+ const query = {
339
+ ...(input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map((_entry) => _entry) }),
340
+ };
341
+ let body;
342
+ return new protocol_http_1.HttpRequest({
343
+ protocol,
344
+ hostname,
345
+ port,
346
+ method: "DELETE",
347
+ headers,
348
+ path: resolvedPath,
349
+ query,
350
+ body,
351
+ });
352
+ };
353
+ exports.serializeAws_restJson1UntagResourceCommand = serializeAws_restJson1UntagResourceCommand;
266
354
  const serializeAws_restJson1UpdatePermissionsCommand = async (input, context) => {
267
355
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
268
356
  const headers = {
@@ -742,6 +830,55 @@ const deserializeAws_restJson1ListPermissionsCommandError = async (output, conte
742
830
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
743
831
  }
744
832
  };
833
+ const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
834
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
835
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
836
+ }
837
+ const contents = {
838
+ $metadata: deserializeMetadata(output),
839
+ tags: undefined,
840
+ };
841
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
842
+ if (data.tags !== undefined && data.tags !== null) {
843
+ contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
844
+ }
845
+ return Promise.resolve(contents);
846
+ };
847
+ exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
848
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
849
+ const parsedOutput = {
850
+ ...output,
851
+ body: await parseBody(output.body, context),
852
+ };
853
+ let response;
854
+ let errorCode = "UnknownError";
855
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
856
+ switch (errorCode) {
857
+ case "AccessDeniedException":
858
+ case "com.amazonaws.grafana#AccessDeniedException":
859
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
860
+ case "InternalServerException":
861
+ case "com.amazonaws.grafana#InternalServerException":
862
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
863
+ case "ResourceNotFoundException":
864
+ case "com.amazonaws.grafana#ResourceNotFoundException":
865
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
866
+ case "ThrottlingException":
867
+ case "com.amazonaws.grafana#ThrottlingException":
868
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
869
+ case "ValidationException":
870
+ case "com.amazonaws.grafana#ValidationException":
871
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
872
+ default:
873
+ const parsedBody = parsedOutput.body;
874
+ response = new GrafanaServiceException_1.GrafanaServiceException({
875
+ name: parsedBody.code || parsedBody.Code || errorCode,
876
+ $fault: "client",
877
+ $metadata: deserializeMetadata(output),
878
+ });
879
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
880
+ }
881
+ };
745
882
  const deserializeAws_restJson1ListWorkspacesCommand = async (output, context) => {
746
883
  if (output.statusCode !== 200 && output.statusCode >= 300) {
747
884
  return deserializeAws_restJson1ListWorkspacesCommandError(output, context);
@@ -789,6 +926,96 @@ const deserializeAws_restJson1ListWorkspacesCommandError = async (output, contex
789
926
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
790
927
  }
791
928
  };
929
+ const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
930
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
931
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
932
+ }
933
+ const contents = {
934
+ $metadata: deserializeMetadata(output),
935
+ };
936
+ await collectBody(output.body, context);
937
+ return Promise.resolve(contents);
938
+ };
939
+ exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
940
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
941
+ const parsedOutput = {
942
+ ...output,
943
+ body: await parseBody(output.body, context),
944
+ };
945
+ let response;
946
+ let errorCode = "UnknownError";
947
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
948
+ switch (errorCode) {
949
+ case "AccessDeniedException":
950
+ case "com.amazonaws.grafana#AccessDeniedException":
951
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
952
+ case "InternalServerException":
953
+ case "com.amazonaws.grafana#InternalServerException":
954
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
955
+ case "ResourceNotFoundException":
956
+ case "com.amazonaws.grafana#ResourceNotFoundException":
957
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
958
+ case "ThrottlingException":
959
+ case "com.amazonaws.grafana#ThrottlingException":
960
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
961
+ case "ValidationException":
962
+ case "com.amazonaws.grafana#ValidationException":
963
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
964
+ default:
965
+ const parsedBody = parsedOutput.body;
966
+ response = new GrafanaServiceException_1.GrafanaServiceException({
967
+ name: parsedBody.code || parsedBody.Code || errorCode,
968
+ $fault: "client",
969
+ $metadata: deserializeMetadata(output),
970
+ });
971
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
972
+ }
973
+ };
974
+ const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
975
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
976
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
977
+ }
978
+ const contents = {
979
+ $metadata: deserializeMetadata(output),
980
+ };
981
+ await collectBody(output.body, context);
982
+ return Promise.resolve(contents);
983
+ };
984
+ exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
985
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
986
+ const parsedOutput = {
987
+ ...output,
988
+ body: await parseBody(output.body, context),
989
+ };
990
+ let response;
991
+ let errorCode = "UnknownError";
992
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
993
+ switch (errorCode) {
994
+ case "AccessDeniedException":
995
+ case "com.amazonaws.grafana#AccessDeniedException":
996
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
997
+ case "InternalServerException":
998
+ case "com.amazonaws.grafana#InternalServerException":
999
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
1000
+ case "ResourceNotFoundException":
1001
+ case "com.amazonaws.grafana#ResourceNotFoundException":
1002
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
1003
+ case "ThrottlingException":
1004
+ case "com.amazonaws.grafana#ThrottlingException":
1005
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
1006
+ case "ValidationException":
1007
+ case "com.amazonaws.grafana#ValidationException":
1008
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1009
+ default:
1010
+ const parsedBody = parsedOutput.body;
1011
+ response = new GrafanaServiceException_1.GrafanaServiceException({
1012
+ name: parsedBody.code || parsedBody.Code || errorCode,
1013
+ $fault: "client",
1014
+ $metadata: deserializeMetadata(output),
1015
+ });
1016
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1017
+ }
1018
+ };
792
1019
  const deserializeAws_restJson1UpdatePermissionsCommand = async (output, context) => {
793
1020
  if (output.statusCode !== 200 && output.statusCode >= 300) {
794
1021
  return deserializeAws_restJson1UpdatePermissionsCommandError(output, context);
@@ -1171,6 +1398,17 @@ const serializeAws_restJson1SamlConfiguration = (input, context) => {
1171
1398
  input.roleValues !== null && { roleValues: serializeAws_restJson1RoleValues(input.roleValues, context) }),
1172
1399
  };
1173
1400
  };
1401
+ const serializeAws_restJson1TagMap = (input, context) => {
1402
+ return Object.entries(input).reduce((acc, [key, value]) => {
1403
+ if (value === null) {
1404
+ return acc;
1405
+ }
1406
+ return {
1407
+ ...acc,
1408
+ [key]: value,
1409
+ };
1410
+ }, {});
1411
+ };
1174
1412
  const serializeAws_restJson1UpdateInstruction = (input, context) => {
1175
1413
  return {
1176
1414
  ...(input.action !== undefined && input.action !== null && { action: input.action }),
@@ -1370,6 +1608,17 @@ const deserializeAws_restJson1SamlConfiguration = (output, context) => {
1370
1608
  : undefined,
1371
1609
  };
1372
1610
  };
1611
+ const deserializeAws_restJson1TagMap = (output, context) => {
1612
+ return Object.entries(output).reduce((acc, [key, value]) => {
1613
+ if (value === null) {
1614
+ return acc;
1615
+ }
1616
+ return {
1617
+ ...acc,
1618
+ [key]: (0, smithy_client_1.expectString)(value),
1619
+ };
1620
+ }, {});
1621
+ };
1373
1622
  const deserializeAws_restJson1UpdateError = (output, context) => {
1374
1623
  return {
1375
1624
  causedBy: output.causedBy !== undefined && output.causedBy !== null
@@ -1471,6 +1720,9 @@ const deserializeAws_restJson1WorkspaceDescription = (output, context) => {
1471
1720
  permissionType: (0, smithy_client_1.expectString)(output.permissionType),
1472
1721
  stackSetName: (0, smithy_client_1.expectString)(output.stackSetName),
1473
1722
  status: (0, smithy_client_1.expectString)(output.status),
1723
+ tags: output.tags !== undefined && output.tags !== null
1724
+ ? deserializeAws_restJson1TagMap(output.tags, context)
1725
+ : undefined,
1474
1726
  workspaceRoleArn: (0, smithy_client_1.expectString)(output.workspaceRoleArn),
1475
1727
  };
1476
1728
  };
@@ -1505,6 +1757,9 @@ const deserializeAws_restJson1WorkspaceSummary = (output, context) => {
1505
1757
  ? deserializeAws_restJson1NotificationDestinationsList(output.notificationDestinations, context)
1506
1758
  : undefined,
1507
1759
  status: (0, smithy_client_1.expectString)(output.status),
1760
+ tags: output.tags !== undefined && output.tags !== null
1761
+ ? deserializeAws_restJson1TagMap(output.tags, context)
1762
+ : undefined,
1508
1763
  };
1509
1764
  };
1510
1765
  const deserializeMetadata = (output) => {