@aws-sdk/client-rbin 3.216.0 → 3.218.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.
- package/dist-cjs/Rbin.js +30 -0
- package/dist-cjs/commands/LockRuleCommand.js +46 -0
- package/dist-cjs/commands/UnlockRuleCommand.js +46 -0
- package/dist-cjs/commands/index.js +2 -0
- package/dist-cjs/endpoint/ruleset.js +1 -1
- package/dist-cjs/models/models_0.js +54 -1
- package/dist-cjs/protocols/Aws_restJson1.js +246 -2
- package/dist-es/Rbin.js +30 -0
- package/dist-es/commands/LockRuleCommand.js +42 -0
- package/dist-es/commands/UnlockRuleCommand.js +42 -0
- package/dist-es/commands/index.js +2 -0
- package/dist-es/endpoint/ruleset.js +1 -1
- package/dist-es/models/models_0.js +46 -0
- package/dist-es/protocols/Aws_restJson1.js +243 -3
- package/dist-types/Rbin.d.ts +18 -1
- package/dist-types/RbinClient.d.ts +4 -2
- package/dist-types/commands/LockRuleCommand.d.ts +37 -0
- package/dist-types/commands/UnlockRuleCommand.d.ts +38 -0
- package/dist-types/commands/UpdateRuleCommand.d.ts +3 -1
- package/dist-types/commands/index.d.ts +2 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +1 -1
- package/dist-types/models/models_0.d.ts +358 -3
- package/dist-types/protocols/Aws_restJson1.d.ts +6 -0
- package/dist-types/ts3.4/Rbin.d.ts +34 -0
- package/dist-types/ts3.4/RbinClient.d.ts +12 -0
- package/dist-types/ts3.4/commands/LockRuleCommand.d.ts +34 -0
- package/dist-types/ts3.4/commands/UnlockRuleCommand.d.ts +34 -0
- package/dist-types/ts3.4/commands/index.d.ts +2 -0
- package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +1 -1
- package/dist-types/ts3.4/models/models_0.d.ts +79 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +24 -0
- package/package.json +3 -3
package/dist-es/Rbin.js
CHANGED
|
@@ -3,7 +3,9 @@ import { DeleteRuleCommand } from "./commands/DeleteRuleCommand";
|
|
|
3
3
|
import { GetRuleCommand } from "./commands/GetRuleCommand";
|
|
4
4
|
import { ListRulesCommand } from "./commands/ListRulesCommand";
|
|
5
5
|
import { ListTagsForResourceCommand, } from "./commands/ListTagsForResourceCommand";
|
|
6
|
+
import { LockRuleCommand } from "./commands/LockRuleCommand";
|
|
6
7
|
import { TagResourceCommand } from "./commands/TagResourceCommand";
|
|
8
|
+
import { UnlockRuleCommand } from "./commands/UnlockRuleCommand";
|
|
7
9
|
import { UntagResourceCommand, } from "./commands/UntagResourceCommand";
|
|
8
10
|
import { UpdateRuleCommand } from "./commands/UpdateRuleCommand";
|
|
9
11
|
import { RbinClient } from "./RbinClient";
|
|
@@ -78,6 +80,20 @@ export class Rbin extends RbinClient {
|
|
|
78
80
|
return this.send(command, optionsOrCb);
|
|
79
81
|
}
|
|
80
82
|
}
|
|
83
|
+
lockRule(args, optionsOrCb, cb) {
|
|
84
|
+
const command = new LockRuleCommand(args);
|
|
85
|
+
if (typeof optionsOrCb === "function") {
|
|
86
|
+
this.send(command, optionsOrCb);
|
|
87
|
+
}
|
|
88
|
+
else if (typeof cb === "function") {
|
|
89
|
+
if (typeof optionsOrCb !== "object")
|
|
90
|
+
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
91
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
return this.send(command, optionsOrCb);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
81
97
|
tagResource(args, optionsOrCb, cb) {
|
|
82
98
|
const command = new TagResourceCommand(args);
|
|
83
99
|
if (typeof optionsOrCb === "function") {
|
|
@@ -92,6 +108,20 @@ export class Rbin extends RbinClient {
|
|
|
92
108
|
return this.send(command, optionsOrCb);
|
|
93
109
|
}
|
|
94
110
|
}
|
|
111
|
+
unlockRule(args, optionsOrCb, cb) {
|
|
112
|
+
const command = new UnlockRuleCommand(args);
|
|
113
|
+
if (typeof optionsOrCb === "function") {
|
|
114
|
+
this.send(command, optionsOrCb);
|
|
115
|
+
}
|
|
116
|
+
else if (typeof cb === "function") {
|
|
117
|
+
if (typeof optionsOrCb !== "object")
|
|
118
|
+
throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
|
|
119
|
+
this.send(command, optionsOrCb || {}, cb);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
return this.send(command, optionsOrCb);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
95
125
|
untagResource(args, optionsOrCb, cb) {
|
|
96
126
|
const command = new UntagResourceCommand(args);
|
|
97
127
|
if (typeof optionsOrCb === "function") {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
|
|
2
|
+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@aws-sdk/smithy-client";
|
|
4
|
+
import { LockRuleRequestFilterSensitiveLog, LockRuleResponseFilterSensitiveLog, } from "../models/models_0";
|
|
5
|
+
import { deserializeAws_restJson1LockRuleCommand, serializeAws_restJson1LockRuleCommand, } from "../protocols/Aws_restJson1";
|
|
6
|
+
export class LockRuleCommand extends $Command {
|
|
7
|
+
constructor(input) {
|
|
8
|
+
super();
|
|
9
|
+
this.input = input;
|
|
10
|
+
}
|
|
11
|
+
static getEndpointParameterInstructions() {
|
|
12
|
+
return {
|
|
13
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
14
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
15
|
+
Region: { type: "builtInParams", name: "region" },
|
|
16
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
20
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
21
|
+
this.middlewareStack.use(getEndpointPlugin(configuration, LockRuleCommand.getEndpointParameterInstructions()));
|
|
22
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
23
|
+
const { logger } = configuration;
|
|
24
|
+
const clientName = "RbinClient";
|
|
25
|
+
const commandName = "LockRuleCommand";
|
|
26
|
+
const handlerExecutionContext = {
|
|
27
|
+
logger,
|
|
28
|
+
clientName,
|
|
29
|
+
commandName,
|
|
30
|
+
inputFilterSensitiveLog: LockRuleRequestFilterSensitiveLog,
|
|
31
|
+
outputFilterSensitiveLog: LockRuleResponseFilterSensitiveLog,
|
|
32
|
+
};
|
|
33
|
+
const { requestHandler } = configuration;
|
|
34
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
35
|
+
}
|
|
36
|
+
serialize(input, context) {
|
|
37
|
+
return serializeAws_restJson1LockRuleCommand(input, context);
|
|
38
|
+
}
|
|
39
|
+
deserialize(output, context) {
|
|
40
|
+
return deserializeAws_restJson1LockRuleCommand(output, context);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
|
|
2
|
+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@aws-sdk/smithy-client";
|
|
4
|
+
import { UnlockRuleRequestFilterSensitiveLog, UnlockRuleResponseFilterSensitiveLog, } from "../models/models_0";
|
|
5
|
+
import { deserializeAws_restJson1UnlockRuleCommand, serializeAws_restJson1UnlockRuleCommand, } from "../protocols/Aws_restJson1";
|
|
6
|
+
export class UnlockRuleCommand extends $Command {
|
|
7
|
+
constructor(input) {
|
|
8
|
+
super();
|
|
9
|
+
this.input = input;
|
|
10
|
+
}
|
|
11
|
+
static getEndpointParameterInstructions() {
|
|
12
|
+
return {
|
|
13
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
14
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
15
|
+
Region: { type: "builtInParams", name: "region" },
|
|
16
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
20
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
21
|
+
this.middlewareStack.use(getEndpointPlugin(configuration, UnlockRuleCommand.getEndpointParameterInstructions()));
|
|
22
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
23
|
+
const { logger } = configuration;
|
|
24
|
+
const clientName = "RbinClient";
|
|
25
|
+
const commandName = "UnlockRuleCommand";
|
|
26
|
+
const handlerExecutionContext = {
|
|
27
|
+
logger,
|
|
28
|
+
clientName,
|
|
29
|
+
commandName,
|
|
30
|
+
inputFilterSensitiveLog: UnlockRuleRequestFilterSensitiveLog,
|
|
31
|
+
outputFilterSensitiveLog: UnlockRuleResponseFilterSensitiveLog,
|
|
32
|
+
};
|
|
33
|
+
const { requestHandler } = configuration;
|
|
34
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
35
|
+
}
|
|
36
|
+
serialize(input, context) {
|
|
37
|
+
return serializeAws_restJson1UnlockRuleCommand(input, context);
|
|
38
|
+
}
|
|
39
|
+
deserialize(output, context) {
|
|
40
|
+
return deserializeAws_restJson1UnlockRuleCommand(output, context);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -3,6 +3,8 @@ export * from "./DeleteRuleCommand";
|
|
|
3
3
|
export * from "./GetRuleCommand";
|
|
4
4
|
export * from "./ListRulesCommand";
|
|
5
5
|
export * from "./ListTagsForResourceCommand";
|
|
6
|
+
export * from "./LockRuleCommand";
|
|
6
7
|
export * from "./TagResourceCommand";
|
|
8
|
+
export * from "./UnlockRuleCommand";
|
|
7
9
|
export * from "./UntagResourceCommand";
|
|
8
10
|
export * from "./UpdateRuleCommand";
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { RbinServiceException as __BaseException } from "./RbinServiceException";
|
|
2
|
+
export var UnlockDelayUnit;
|
|
3
|
+
(function (UnlockDelayUnit) {
|
|
4
|
+
UnlockDelayUnit["DAYS"] = "DAYS";
|
|
5
|
+
})(UnlockDelayUnit || (UnlockDelayUnit = {}));
|
|
2
6
|
export var ResourceType;
|
|
3
7
|
(function (ResourceType) {
|
|
4
8
|
ResourceType["EBS_SNAPSHOT"] = "EBS_SNAPSHOT";
|
|
@@ -8,6 +12,12 @@ export var RetentionPeriodUnit;
|
|
|
8
12
|
(function (RetentionPeriodUnit) {
|
|
9
13
|
RetentionPeriodUnit["DAYS"] = "DAYS";
|
|
10
14
|
})(RetentionPeriodUnit || (RetentionPeriodUnit = {}));
|
|
15
|
+
export var LockState;
|
|
16
|
+
(function (LockState) {
|
|
17
|
+
LockState["LOCKED"] = "locked";
|
|
18
|
+
LockState["PENDING_UNLOCK"] = "pending_unlock";
|
|
19
|
+
LockState["UNLOCKED"] = "unlocked";
|
|
20
|
+
})(LockState || (LockState = {}));
|
|
11
21
|
export var RuleStatus;
|
|
12
22
|
(function (RuleStatus) {
|
|
13
23
|
RuleStatus["AVAILABLE"] = "available";
|
|
@@ -63,6 +73,24 @@ export class ValidationException extends __BaseException {
|
|
|
63
73
|
this.Reason = opts.Reason;
|
|
64
74
|
}
|
|
65
75
|
}
|
|
76
|
+
export var ConflictExceptionReason;
|
|
77
|
+
(function (ConflictExceptionReason) {
|
|
78
|
+
ConflictExceptionReason["INVALID_RULE_STATE"] = "INVALID_RULE_STATE";
|
|
79
|
+
})(ConflictExceptionReason || (ConflictExceptionReason = {}));
|
|
80
|
+
export class ConflictException extends __BaseException {
|
|
81
|
+
constructor(opts) {
|
|
82
|
+
super({
|
|
83
|
+
name: "ConflictException",
|
|
84
|
+
$fault: "client",
|
|
85
|
+
...opts,
|
|
86
|
+
});
|
|
87
|
+
this.name = "ConflictException";
|
|
88
|
+
this.$fault = "client";
|
|
89
|
+
Object.setPrototypeOf(this, ConflictException.prototype);
|
|
90
|
+
this.Message = opts.Message;
|
|
91
|
+
this.Reason = opts.Reason;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
66
94
|
export var ResourceNotFoundExceptionReason;
|
|
67
95
|
(function (ResourceNotFoundExceptionReason) {
|
|
68
96
|
ResourceNotFoundExceptionReason["RULE_NOT_FOUND"] = "RULE_NOT_FOUND";
|
|
@@ -81,6 +109,12 @@ export class ResourceNotFoundException extends __BaseException {
|
|
|
81
109
|
this.Reason = opts.Reason;
|
|
82
110
|
}
|
|
83
111
|
}
|
|
112
|
+
export const UnlockDelayFilterSensitiveLog = (obj) => ({
|
|
113
|
+
...obj,
|
|
114
|
+
});
|
|
115
|
+
export const LockConfigurationFilterSensitiveLog = (obj) => ({
|
|
116
|
+
...obj,
|
|
117
|
+
});
|
|
84
118
|
export const ResourceTagFilterSensitiveLog = (obj) => ({
|
|
85
119
|
...obj,
|
|
86
120
|
});
|
|
@@ -123,12 +157,24 @@ export const ListTagsForResourceRequestFilterSensitiveLog = (obj) => ({
|
|
|
123
157
|
export const ListTagsForResourceResponseFilterSensitiveLog = (obj) => ({
|
|
124
158
|
...obj,
|
|
125
159
|
});
|
|
160
|
+
export const LockRuleRequestFilterSensitiveLog = (obj) => ({
|
|
161
|
+
...obj,
|
|
162
|
+
});
|
|
163
|
+
export const LockRuleResponseFilterSensitiveLog = (obj) => ({
|
|
164
|
+
...obj,
|
|
165
|
+
});
|
|
126
166
|
export const TagResourceRequestFilterSensitiveLog = (obj) => ({
|
|
127
167
|
...obj,
|
|
128
168
|
});
|
|
129
169
|
export const TagResourceResponseFilterSensitiveLog = (obj) => ({
|
|
130
170
|
...obj,
|
|
131
171
|
});
|
|
172
|
+
export const UnlockRuleRequestFilterSensitiveLog = (obj) => ({
|
|
173
|
+
...obj,
|
|
174
|
+
});
|
|
175
|
+
export const UnlockRuleResponseFilterSensitiveLog = (obj) => ({
|
|
176
|
+
...obj,
|
|
177
|
+
});
|
|
132
178
|
export const UntagResourceRequestFilterSensitiveLog = (obj) => ({
|
|
133
179
|
...obj,
|
|
134
180
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
|
-
import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
3
|
-
import { InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ValidationException, } from "../models/models_0";
|
|
2
|
+
import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map as __map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
3
|
+
import { ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ValidationException, } from "../models/models_0";
|
|
4
4
|
import { RbinServiceException as __BaseException } from "../models/RbinServiceException";
|
|
5
5
|
export const serializeAws_restJson1CreateRuleCommand = async (input, context) => {
|
|
6
6
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
@@ -11,6 +11,9 @@ export const serializeAws_restJson1CreateRuleCommand = async (input, context) =>
|
|
|
11
11
|
let body;
|
|
12
12
|
body = JSON.stringify({
|
|
13
13
|
...(input.Description != null && { Description: input.Description }),
|
|
14
|
+
...(input.LockConfiguration != null && {
|
|
15
|
+
LockConfiguration: serializeAws_restJson1LockConfiguration(input.LockConfiguration, context),
|
|
16
|
+
}),
|
|
14
17
|
...(input.ResourceTags != null && {
|
|
15
18
|
ResourceTags: serializeAws_restJson1ResourceTags(input.ResourceTags, context),
|
|
16
19
|
}),
|
|
@@ -70,6 +73,7 @@ export const serializeAws_restJson1ListRulesCommand = async (input, context) =>
|
|
|
70
73
|
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/list-rules";
|
|
71
74
|
let body;
|
|
72
75
|
body = JSON.stringify({
|
|
76
|
+
...(input.LockState != null && { LockState: input.LockState }),
|
|
73
77
|
...(input.MaxResults != null && { MaxResults: input.MaxResults }),
|
|
74
78
|
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
75
79
|
...(input.ResourceTags != null && {
|
|
@@ -103,6 +107,29 @@ export const serializeAws_restJson1ListTagsForResourceCommand = async (input, co
|
|
|
103
107
|
body,
|
|
104
108
|
});
|
|
105
109
|
};
|
|
110
|
+
export const serializeAws_restJson1LockRuleCommand = async (input, context) => {
|
|
111
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
112
|
+
const headers = {
|
|
113
|
+
"content-type": "application/json",
|
|
114
|
+
};
|
|
115
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/rules/{Identifier}/lock";
|
|
116
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "Identifier", () => input.Identifier, "{Identifier}", false);
|
|
117
|
+
let body;
|
|
118
|
+
body = JSON.stringify({
|
|
119
|
+
...(input.LockConfiguration != null && {
|
|
120
|
+
LockConfiguration: serializeAws_restJson1LockConfiguration(input.LockConfiguration, context),
|
|
121
|
+
}),
|
|
122
|
+
});
|
|
123
|
+
return new __HttpRequest({
|
|
124
|
+
protocol,
|
|
125
|
+
hostname,
|
|
126
|
+
port,
|
|
127
|
+
method: "PATCH",
|
|
128
|
+
headers,
|
|
129
|
+
path: resolvedPath,
|
|
130
|
+
body,
|
|
131
|
+
});
|
|
132
|
+
};
|
|
106
133
|
export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
|
|
107
134
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
108
135
|
const headers = {
|
|
@@ -124,13 +151,32 @@ export const serializeAws_restJson1TagResourceCommand = async (input, context) =
|
|
|
124
151
|
body,
|
|
125
152
|
});
|
|
126
153
|
};
|
|
154
|
+
export const serializeAws_restJson1UnlockRuleCommand = async (input, context) => {
|
|
155
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
156
|
+
const headers = {};
|
|
157
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/rules/{Identifier}/unlock";
|
|
158
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "Identifier", () => input.Identifier, "{Identifier}", false);
|
|
159
|
+
let body;
|
|
160
|
+
return new __HttpRequest({
|
|
161
|
+
protocol,
|
|
162
|
+
hostname,
|
|
163
|
+
port,
|
|
164
|
+
method: "PATCH",
|
|
165
|
+
headers,
|
|
166
|
+
path: resolvedPath,
|
|
167
|
+
body,
|
|
168
|
+
});
|
|
169
|
+
};
|
|
127
170
|
export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
|
|
128
171
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
129
172
|
const headers = {};
|
|
130
173
|
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
|
|
131
174
|
resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
|
|
132
175
|
const query = map({
|
|
133
|
-
tagKeys: [
|
|
176
|
+
tagKeys: [
|
|
177
|
+
__expectNonNull(input.TagKeys, `TagKeys`) != null,
|
|
178
|
+
() => (input.TagKeys || []).map((_entry) => _entry),
|
|
179
|
+
],
|
|
134
180
|
});
|
|
135
181
|
let body;
|
|
136
182
|
return new __HttpRequest({
|
|
@@ -186,6 +232,12 @@ export const deserializeAws_restJson1CreateRuleCommand = async (output, context)
|
|
|
186
232
|
if (data.Identifier != null) {
|
|
187
233
|
contents.Identifier = __expectString(data.Identifier);
|
|
188
234
|
}
|
|
235
|
+
if (data.LockConfiguration != null) {
|
|
236
|
+
contents.LockConfiguration = deserializeAws_restJson1LockConfiguration(data.LockConfiguration, context);
|
|
237
|
+
}
|
|
238
|
+
if (data.LockState != null) {
|
|
239
|
+
contents.LockState = __expectString(data.LockState);
|
|
240
|
+
}
|
|
189
241
|
if (data.ResourceTags != null) {
|
|
190
242
|
contents.ResourceTags = deserializeAws_restJson1ResourceTags(data.ResourceTags, context);
|
|
191
243
|
}
|
|
@@ -246,6 +298,9 @@ const deserializeAws_restJson1DeleteRuleCommandError = async (output, context) =
|
|
|
246
298
|
};
|
|
247
299
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
248
300
|
switch (errorCode) {
|
|
301
|
+
case "ConflictException":
|
|
302
|
+
case "com.amazonaws.rbin#ConflictException":
|
|
303
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
249
304
|
case "InternalServerException":
|
|
250
305
|
case "com.amazonaws.rbin#InternalServerException":
|
|
251
306
|
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
@@ -279,6 +334,15 @@ export const deserializeAws_restJson1GetRuleCommand = async (output, context) =>
|
|
|
279
334
|
if (data.Identifier != null) {
|
|
280
335
|
contents.Identifier = __expectString(data.Identifier);
|
|
281
336
|
}
|
|
337
|
+
if (data.LockConfiguration != null) {
|
|
338
|
+
contents.LockConfiguration = deserializeAws_restJson1LockConfiguration(data.LockConfiguration, context);
|
|
339
|
+
}
|
|
340
|
+
if (data.LockEndTime != null) {
|
|
341
|
+
contents.LockEndTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LockEndTime)));
|
|
342
|
+
}
|
|
343
|
+
if (data.LockState != null) {
|
|
344
|
+
contents.LockState = __expectString(data.LockState);
|
|
345
|
+
}
|
|
282
346
|
if (data.ResourceTags != null) {
|
|
283
347
|
contents.ResourceTags = deserializeAws_restJson1ResourceTags(data.ResourceTags, context);
|
|
284
348
|
}
|
|
@@ -397,6 +461,69 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
|
|
|
397
461
|
});
|
|
398
462
|
}
|
|
399
463
|
};
|
|
464
|
+
export const deserializeAws_restJson1LockRuleCommand = async (output, context) => {
|
|
465
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
466
|
+
return deserializeAws_restJson1LockRuleCommandError(output, context);
|
|
467
|
+
}
|
|
468
|
+
const contents = map({
|
|
469
|
+
$metadata: deserializeMetadata(output),
|
|
470
|
+
});
|
|
471
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
472
|
+
if (data.Description != null) {
|
|
473
|
+
contents.Description = __expectString(data.Description);
|
|
474
|
+
}
|
|
475
|
+
if (data.Identifier != null) {
|
|
476
|
+
contents.Identifier = __expectString(data.Identifier);
|
|
477
|
+
}
|
|
478
|
+
if (data.LockConfiguration != null) {
|
|
479
|
+
contents.LockConfiguration = deserializeAws_restJson1LockConfiguration(data.LockConfiguration, context);
|
|
480
|
+
}
|
|
481
|
+
if (data.LockState != null) {
|
|
482
|
+
contents.LockState = __expectString(data.LockState);
|
|
483
|
+
}
|
|
484
|
+
if (data.ResourceTags != null) {
|
|
485
|
+
contents.ResourceTags = deserializeAws_restJson1ResourceTags(data.ResourceTags, context);
|
|
486
|
+
}
|
|
487
|
+
if (data.ResourceType != null) {
|
|
488
|
+
contents.ResourceType = __expectString(data.ResourceType);
|
|
489
|
+
}
|
|
490
|
+
if (data.RetentionPeriod != null) {
|
|
491
|
+
contents.RetentionPeriod = deserializeAws_restJson1RetentionPeriod(data.RetentionPeriod, context);
|
|
492
|
+
}
|
|
493
|
+
if (data.Status != null) {
|
|
494
|
+
contents.Status = __expectString(data.Status);
|
|
495
|
+
}
|
|
496
|
+
return contents;
|
|
497
|
+
};
|
|
498
|
+
const deserializeAws_restJson1LockRuleCommandError = async (output, context) => {
|
|
499
|
+
const parsedOutput = {
|
|
500
|
+
...output,
|
|
501
|
+
body: await parseErrorBody(output.body, context),
|
|
502
|
+
};
|
|
503
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
504
|
+
switch (errorCode) {
|
|
505
|
+
case "ConflictException":
|
|
506
|
+
case "com.amazonaws.rbin#ConflictException":
|
|
507
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
508
|
+
case "InternalServerException":
|
|
509
|
+
case "com.amazonaws.rbin#InternalServerException":
|
|
510
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
511
|
+
case "ResourceNotFoundException":
|
|
512
|
+
case "com.amazonaws.rbin#ResourceNotFoundException":
|
|
513
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
514
|
+
case "ValidationException":
|
|
515
|
+
case "com.amazonaws.rbin#ValidationException":
|
|
516
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
517
|
+
default:
|
|
518
|
+
const parsedBody = parsedOutput.body;
|
|
519
|
+
throwDefaultError({
|
|
520
|
+
output,
|
|
521
|
+
parsedBody,
|
|
522
|
+
exceptionCtor: __BaseException,
|
|
523
|
+
errorCode,
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
};
|
|
400
527
|
export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
|
|
401
528
|
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
402
529
|
return deserializeAws_restJson1TagResourceCommandError(output, context);
|
|
@@ -436,6 +563,72 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
|
|
|
436
563
|
});
|
|
437
564
|
}
|
|
438
565
|
};
|
|
566
|
+
export const deserializeAws_restJson1UnlockRuleCommand = async (output, context) => {
|
|
567
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
568
|
+
return deserializeAws_restJson1UnlockRuleCommandError(output, context);
|
|
569
|
+
}
|
|
570
|
+
const contents = map({
|
|
571
|
+
$metadata: deserializeMetadata(output),
|
|
572
|
+
});
|
|
573
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
574
|
+
if (data.Description != null) {
|
|
575
|
+
contents.Description = __expectString(data.Description);
|
|
576
|
+
}
|
|
577
|
+
if (data.Identifier != null) {
|
|
578
|
+
contents.Identifier = __expectString(data.Identifier);
|
|
579
|
+
}
|
|
580
|
+
if (data.LockConfiguration != null) {
|
|
581
|
+
contents.LockConfiguration = deserializeAws_restJson1LockConfiguration(data.LockConfiguration, context);
|
|
582
|
+
}
|
|
583
|
+
if (data.LockEndTime != null) {
|
|
584
|
+
contents.LockEndTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LockEndTime)));
|
|
585
|
+
}
|
|
586
|
+
if (data.LockState != null) {
|
|
587
|
+
contents.LockState = __expectString(data.LockState);
|
|
588
|
+
}
|
|
589
|
+
if (data.ResourceTags != null) {
|
|
590
|
+
contents.ResourceTags = deserializeAws_restJson1ResourceTags(data.ResourceTags, context);
|
|
591
|
+
}
|
|
592
|
+
if (data.ResourceType != null) {
|
|
593
|
+
contents.ResourceType = __expectString(data.ResourceType);
|
|
594
|
+
}
|
|
595
|
+
if (data.RetentionPeriod != null) {
|
|
596
|
+
contents.RetentionPeriod = deserializeAws_restJson1RetentionPeriod(data.RetentionPeriod, context);
|
|
597
|
+
}
|
|
598
|
+
if (data.Status != null) {
|
|
599
|
+
contents.Status = __expectString(data.Status);
|
|
600
|
+
}
|
|
601
|
+
return contents;
|
|
602
|
+
};
|
|
603
|
+
const deserializeAws_restJson1UnlockRuleCommandError = async (output, context) => {
|
|
604
|
+
const parsedOutput = {
|
|
605
|
+
...output,
|
|
606
|
+
body: await parseErrorBody(output.body, context),
|
|
607
|
+
};
|
|
608
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
609
|
+
switch (errorCode) {
|
|
610
|
+
case "ConflictException":
|
|
611
|
+
case "com.amazonaws.rbin#ConflictException":
|
|
612
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
613
|
+
case "InternalServerException":
|
|
614
|
+
case "com.amazonaws.rbin#InternalServerException":
|
|
615
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
616
|
+
case "ResourceNotFoundException":
|
|
617
|
+
case "com.amazonaws.rbin#ResourceNotFoundException":
|
|
618
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
619
|
+
case "ValidationException":
|
|
620
|
+
case "com.amazonaws.rbin#ValidationException":
|
|
621
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
622
|
+
default:
|
|
623
|
+
const parsedBody = parsedOutput.body;
|
|
624
|
+
throwDefaultError({
|
|
625
|
+
output,
|
|
626
|
+
parsedBody,
|
|
627
|
+
exceptionCtor: __BaseException,
|
|
628
|
+
errorCode,
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
};
|
|
439
632
|
export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
|
|
440
633
|
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
441
634
|
return deserializeAws_restJson1UntagResourceCommandError(output, context);
|
|
@@ -486,6 +679,12 @@ export const deserializeAws_restJson1UpdateRuleCommand = async (output, context)
|
|
|
486
679
|
if (data.Identifier != null) {
|
|
487
680
|
contents.Identifier = __expectString(data.Identifier);
|
|
488
681
|
}
|
|
682
|
+
if (data.LockEndTime != null) {
|
|
683
|
+
contents.LockEndTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.LockEndTime)));
|
|
684
|
+
}
|
|
685
|
+
if (data.LockState != null) {
|
|
686
|
+
contents.LockState = __expectString(data.LockState);
|
|
687
|
+
}
|
|
489
688
|
if (data.ResourceTags != null) {
|
|
490
689
|
contents.ResourceTags = deserializeAws_restJson1ResourceTags(data.ResourceTags, context);
|
|
491
690
|
}
|
|
@@ -507,6 +706,9 @@ const deserializeAws_restJson1UpdateRuleCommandError = async (output, context) =
|
|
|
507
706
|
};
|
|
508
707
|
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
509
708
|
switch (errorCode) {
|
|
709
|
+
case "ConflictException":
|
|
710
|
+
case "com.amazonaws.rbin#ConflictException":
|
|
711
|
+
throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
|
|
510
712
|
case "InternalServerException":
|
|
511
713
|
case "com.amazonaws.rbin#InternalServerException":
|
|
512
714
|
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
@@ -527,6 +729,21 @@ const deserializeAws_restJson1UpdateRuleCommandError = async (output, context) =
|
|
|
527
729
|
}
|
|
528
730
|
};
|
|
529
731
|
const map = __map;
|
|
732
|
+
const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
|
|
733
|
+
const contents = map({});
|
|
734
|
+
const data = parsedOutput.body;
|
|
735
|
+
if (data.Message != null) {
|
|
736
|
+
contents.Message = __expectString(data.Message);
|
|
737
|
+
}
|
|
738
|
+
if (data.Reason != null) {
|
|
739
|
+
contents.Reason = __expectString(data.Reason);
|
|
740
|
+
}
|
|
741
|
+
const exception = new ConflictException({
|
|
742
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
743
|
+
...contents,
|
|
744
|
+
});
|
|
745
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
746
|
+
};
|
|
530
747
|
const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
531
748
|
const contents = map({});
|
|
532
749
|
const data = parsedOutput.body;
|
|
@@ -584,6 +801,11 @@ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput,
|
|
|
584
801
|
});
|
|
585
802
|
return __decorateServiceException(exception, parsedOutput.body);
|
|
586
803
|
};
|
|
804
|
+
const serializeAws_restJson1LockConfiguration = (input, context) => {
|
|
805
|
+
return {
|
|
806
|
+
...(input.UnlockDelay != null && { UnlockDelay: serializeAws_restJson1UnlockDelay(input.UnlockDelay, context) }),
|
|
807
|
+
};
|
|
808
|
+
};
|
|
587
809
|
const serializeAws_restJson1ResourceTag = (input, context) => {
|
|
588
810
|
return {
|
|
589
811
|
...(input.ResourceTagKey != null && { ResourceTagKey: input.ResourceTagKey }),
|
|
@@ -616,6 +838,17 @@ const serializeAws_restJson1TagList = (input, context) => {
|
|
|
616
838
|
return serializeAws_restJson1Tag(entry, context);
|
|
617
839
|
});
|
|
618
840
|
};
|
|
841
|
+
const serializeAws_restJson1UnlockDelay = (input, context) => {
|
|
842
|
+
return {
|
|
843
|
+
...(input.UnlockDelayUnit != null && { UnlockDelayUnit: input.UnlockDelayUnit }),
|
|
844
|
+
...(input.UnlockDelayValue != null && { UnlockDelayValue: input.UnlockDelayValue }),
|
|
845
|
+
};
|
|
846
|
+
};
|
|
847
|
+
const deserializeAws_restJson1LockConfiguration = (output, context) => {
|
|
848
|
+
return {
|
|
849
|
+
UnlockDelay: output.UnlockDelay != null ? deserializeAws_restJson1UnlockDelay(output.UnlockDelay, context) : undefined,
|
|
850
|
+
};
|
|
851
|
+
};
|
|
619
852
|
const deserializeAws_restJson1ResourceTag = (output, context) => {
|
|
620
853
|
return {
|
|
621
854
|
ResourceTagKey: __expectString(output.ResourceTagKey),
|
|
@@ -643,6 +876,7 @@ const deserializeAws_restJson1RuleSummary = (output, context) => {
|
|
|
643
876
|
return {
|
|
644
877
|
Description: __expectString(output.Description),
|
|
645
878
|
Identifier: __expectString(output.Identifier),
|
|
879
|
+
LockState: __expectString(output.LockState),
|
|
646
880
|
RetentionPeriod: output.RetentionPeriod != null
|
|
647
881
|
? deserializeAws_restJson1RetentionPeriod(output.RetentionPeriod, context)
|
|
648
882
|
: undefined,
|
|
@@ -676,6 +910,12 @@ const deserializeAws_restJson1TagList = (output, context) => {
|
|
|
676
910
|
});
|
|
677
911
|
return retVal;
|
|
678
912
|
};
|
|
913
|
+
const deserializeAws_restJson1UnlockDelay = (output, context) => {
|
|
914
|
+
return {
|
|
915
|
+
UnlockDelayUnit: __expectString(output.UnlockDelayUnit),
|
|
916
|
+
UnlockDelayValue: __expectInt32(output.UnlockDelayValue),
|
|
917
|
+
};
|
|
918
|
+
};
|
|
679
919
|
const deserializeMetadata = (output) => ({
|
|
680
920
|
httpStatusCode: output.statusCode,
|
|
681
921
|
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
package/dist-types/Rbin.d.ts
CHANGED
|
@@ -4,7 +4,9 @@ import { DeleteRuleCommandInput, DeleteRuleCommandOutput } from "./commands/Dele
|
|
|
4
4
|
import { GetRuleCommandInput, GetRuleCommandOutput } from "./commands/GetRuleCommand";
|
|
5
5
|
import { ListRulesCommandInput, ListRulesCommandOutput } from "./commands/ListRulesCommand";
|
|
6
6
|
import { ListTagsForResourceCommandInput, ListTagsForResourceCommandOutput } from "./commands/ListTagsForResourceCommand";
|
|
7
|
+
import { LockRuleCommandInput, LockRuleCommandOutput } from "./commands/LockRuleCommand";
|
|
7
8
|
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
|
|
9
|
+
import { UnlockRuleCommandInput, UnlockRuleCommandOutput } from "./commands/UnlockRuleCommand";
|
|
8
10
|
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
|
|
9
11
|
import { UpdateRuleCommandInput, UpdateRuleCommandOutput } from "./commands/UpdateRuleCommand";
|
|
10
12
|
import { RbinClient } from "./RbinClient";
|
|
@@ -57,12 +59,25 @@ export declare class Rbin extends RbinClient {
|
|
|
57
59
|
listTagsForResource(args: ListTagsForResourceCommandInput, options?: __HttpHandlerOptions): Promise<ListTagsForResourceCommandOutput>;
|
|
58
60
|
listTagsForResource(args: ListTagsForResourceCommandInput, cb: (err: any, data?: ListTagsForResourceCommandOutput) => void): void;
|
|
59
61
|
listTagsForResource(args: ListTagsForResourceCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListTagsForResourceCommandOutput) => void): void;
|
|
62
|
+
/**
|
|
63
|
+
* <p>Locks a retention rule. A locked retention rule can't be modified or deleted.</p>
|
|
64
|
+
*/
|
|
65
|
+
lockRule(args: LockRuleCommandInput, options?: __HttpHandlerOptions): Promise<LockRuleCommandOutput>;
|
|
66
|
+
lockRule(args: LockRuleCommandInput, cb: (err: any, data?: LockRuleCommandOutput) => void): void;
|
|
67
|
+
lockRule(args: LockRuleCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: LockRuleCommandOutput) => void): void;
|
|
60
68
|
/**
|
|
61
69
|
* <p>Assigns tags to the specified retention rule.</p>
|
|
62
70
|
*/
|
|
63
71
|
tagResource(args: TagResourceCommandInput, options?: __HttpHandlerOptions): Promise<TagResourceCommandOutput>;
|
|
64
72
|
tagResource(args: TagResourceCommandInput, cb: (err: any, data?: TagResourceCommandOutput) => void): void;
|
|
65
73
|
tagResource(args: TagResourceCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: TagResourceCommandOutput) => void): void;
|
|
74
|
+
/**
|
|
75
|
+
* <p>Unlocks a retention rule. After a retention rule is unlocked, it can be modified or deleted
|
|
76
|
+
* only after the unlock delay period expires.</p>
|
|
77
|
+
*/
|
|
78
|
+
unlockRule(args: UnlockRuleCommandInput, options?: __HttpHandlerOptions): Promise<UnlockRuleCommandOutput>;
|
|
79
|
+
unlockRule(args: UnlockRuleCommandInput, cb: (err: any, data?: UnlockRuleCommandOutput) => void): void;
|
|
80
|
+
unlockRule(args: UnlockRuleCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: UnlockRuleCommandOutput) => void): void;
|
|
66
81
|
/**
|
|
67
82
|
* <p>Unassigns a tag from a retention rule.</p>
|
|
68
83
|
*/
|
|
@@ -70,7 +85,9 @@ export declare class Rbin extends RbinClient {
|
|
|
70
85
|
untagResource(args: UntagResourceCommandInput, cb: (err: any, data?: UntagResourceCommandOutput) => void): void;
|
|
71
86
|
untagResource(args: UntagResourceCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: UntagResourceCommandOutput) => void): void;
|
|
72
87
|
/**
|
|
73
|
-
* <p>Updates an existing Recycle Bin retention rule.
|
|
88
|
+
* <p>Updates an existing Recycle Bin retention rule. You can update a retention rule's description,
|
|
89
|
+
* resource tags, and retention period at any time after creation. You can't update a retention rule's
|
|
90
|
+
* resource type after creation. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recycle-bin-working-with-rules.html#recycle-bin-update-rule">
|
|
74
91
|
* Update Recycle Bin retention rules</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
|
|
75
92
|
*/
|
|
76
93
|
updateRule(args: UpdateRuleCommandInput, options?: __HttpHandlerOptions): Promise<UpdateRuleCommandOutput>;
|