Skip to content

Commit fa3d3d0

Browse files
author
awstools
committed
feat(client-repostspace): Adds the BatchAddRole and BatchRemoveRole APIs.
1 parent eae7a3e commit fa3d3d0

File tree

10 files changed

+944
-126
lines changed

10 files changed

+944
-126
lines changed

clients/client-repostspace/README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ AWS SDK for JavaScript Repostspace Client for Node.js, Browser and React Native.
1010

1111
## Installing
1212

13-
To install the this package, simply type add or install @aws-sdk/client-repostspace
13+
To install this package, simply type add or install @aws-sdk/client-repostspace
1414
using your favorite package manager:
1515

1616
- `npm install @aws-sdk/client-repostspace`
@@ -203,6 +203,22 @@ see LICENSE for more information.
203203

204204
## Client Commands (Operations List)
205205

206+
<details>
207+
<summary>
208+
BatchAddRole
209+
</summary>
210+
211+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/repostspace/command/BatchAddRoleCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-repostspace/Interface/BatchAddRoleCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-repostspace/Interface/BatchAddRoleCommandOutput/)
212+
213+
</details>
214+
<details>
215+
<summary>
216+
BatchRemoveRole
217+
</summary>
218+
219+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/repostspace/command/BatchRemoveRoleCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-repostspace/Interface/BatchRemoveRoleCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-repostspace/Interface/BatchRemoveRoleCommandOutput/)
220+
221+
</details>
206222
<details>
207223
<summary>
208224
CreateSpace

clients/client-repostspace/src/Repostspace.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
import { createAggregatedClient } from "@smithy/smithy-client";
33
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
44

5+
import {
6+
BatchAddRoleCommand,
7+
BatchAddRoleCommandInput,
8+
BatchAddRoleCommandOutput,
9+
} from "./commands/BatchAddRoleCommand";
10+
import {
11+
BatchRemoveRoleCommand,
12+
BatchRemoveRoleCommandInput,
13+
BatchRemoveRoleCommandOutput,
14+
} from "./commands/BatchRemoveRoleCommand";
515
import { CreateSpaceCommand, CreateSpaceCommandInput, CreateSpaceCommandOutput } from "./commands/CreateSpaceCommand";
616
import { DeleteSpaceCommand, DeleteSpaceCommandInput, DeleteSpaceCommandOutput } from "./commands/DeleteSpaceCommand";
717
import {
@@ -32,6 +42,8 @@ import { UpdateSpaceCommand, UpdateSpaceCommandInput, UpdateSpaceCommandOutput }
3242
import { RepostspaceClient, RepostspaceClientConfig } from "./RepostspaceClient";
3343

3444
const commands = {
45+
BatchAddRoleCommand,
46+
BatchRemoveRoleCommand,
3547
CreateSpaceCommand,
3648
DeleteSpaceCommand,
3749
DeregisterAdminCommand,
@@ -46,6 +58,31 @@ const commands = {
4658
};
4759

4860
export interface Repostspace {
61+
/**
62+
* @see {@link BatchAddRoleCommand}
63+
*/
64+
batchAddRole(args: BatchAddRoleCommandInput, options?: __HttpHandlerOptions): Promise<BatchAddRoleCommandOutput>;
65+
batchAddRole(args: BatchAddRoleCommandInput, cb: (err: any, data?: BatchAddRoleCommandOutput) => void): void;
66+
batchAddRole(
67+
args: BatchAddRoleCommandInput,
68+
options: __HttpHandlerOptions,
69+
cb: (err: any, data?: BatchAddRoleCommandOutput) => void
70+
): void;
71+
72+
/**
73+
* @see {@link BatchRemoveRoleCommand}
74+
*/
75+
batchRemoveRole(
76+
args: BatchRemoveRoleCommandInput,
77+
options?: __HttpHandlerOptions
78+
): Promise<BatchRemoveRoleCommandOutput>;
79+
batchRemoveRole(args: BatchRemoveRoleCommandInput, cb: (err: any, data?: BatchRemoveRoleCommandOutput) => void): void;
80+
batchRemoveRole(
81+
args: BatchRemoveRoleCommandInput,
82+
options: __HttpHandlerOptions,
83+
cb: (err: any, data?: BatchRemoveRoleCommandOutput) => void
84+
): void;
85+
4986
/**
5087
* @see {@link CreateSpaceCommand}
5188
*/

clients/client-repostspace/src/RepostspaceClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ import {
5353
HttpAuthSchemeResolvedConfig,
5454
resolveHttpAuthSchemeConfig,
5555
} from "./auth/httpAuthSchemeProvider";
56+
import { BatchAddRoleCommandInput, BatchAddRoleCommandOutput } from "./commands/BatchAddRoleCommand";
57+
import { BatchRemoveRoleCommandInput, BatchRemoveRoleCommandOutput } from "./commands/BatchRemoveRoleCommand";
5658
import { CreateSpaceCommandInput, CreateSpaceCommandOutput } from "./commands/CreateSpaceCommand";
5759
import { DeleteSpaceCommandInput, DeleteSpaceCommandOutput } from "./commands/DeleteSpaceCommand";
5860
import { DeregisterAdminCommandInput, DeregisterAdminCommandOutput } from "./commands/DeregisterAdminCommand";
@@ -82,6 +84,8 @@ export { __Client };
8284
* @public
8385
*/
8486
export type ServiceInputTypes =
87+
| BatchAddRoleCommandInput
88+
| BatchRemoveRoleCommandInput
8589
| CreateSpaceCommandInput
8690
| DeleteSpaceCommandInput
8791
| DeregisterAdminCommandInput
@@ -98,6 +102,8 @@ export type ServiceInputTypes =
98102
* @public
99103
*/
100104
export type ServiceOutputTypes =
105+
| BatchAddRoleCommandOutput
106+
| BatchRemoveRoleCommandOutput
101107
| CreateSpaceCommandOutput
102108
| DeleteSpaceCommandOutput
103109
| DeregisterAdminCommandOutput
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { BatchAddRoleInput, BatchAddRoleOutput } from "../models/models_0";
9+
import { de_BatchAddRoleCommand, se_BatchAddRoleCommand } from "../protocols/Aws_restJson1";
10+
import { RepostspaceClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RepostspaceClient";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link BatchAddRoleCommand}.
21+
*/
22+
export interface BatchAddRoleCommandInput extends BatchAddRoleInput {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link BatchAddRoleCommand}.
27+
*/
28+
export interface BatchAddRoleCommandOutput extends BatchAddRoleOutput, __MetadataBearer {}
29+
30+
/**
31+
* <p>Add role to multiple users or groups in a private re:Post.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { RepostspaceClient, BatchAddRoleCommand } from "@aws-sdk/client-repostspace"; // ES Modules import
36+
* // const { RepostspaceClient, BatchAddRoleCommand } = require("@aws-sdk/client-repostspace"); // CommonJS import
37+
* const client = new RepostspaceClient(config);
38+
* const input = { // BatchAddRoleInput
39+
* spaceId: "STRING_VALUE", // required
40+
* accessorIds: [ // AccessorIdList // required
41+
* "STRING_VALUE",
42+
* ],
43+
* role: "EXPERT" || "MODERATOR" || "ADMINISTRATOR" || "SUPPORTREQUESTOR", // required
44+
* };
45+
* const command = new BatchAddRoleCommand(input);
46+
* const response = await client.send(command);
47+
* // { // BatchAddRoleOutput
48+
* // addedAccessorIds: [ // AccessorIdList // required
49+
* // "STRING_VALUE",
50+
* // ],
51+
* // errors: [ // BatchErrorList // required
52+
* // { // BatchError
53+
* // accessorId: "STRING_VALUE", // required
54+
* // error: Number("int"), // required
55+
* // message: "STRING_VALUE", // required
56+
* // },
57+
* // ],
58+
* // };
59+
*
60+
* ```
61+
*
62+
* @param BatchAddRoleCommandInput - {@link BatchAddRoleCommandInput}
63+
* @returns {@link BatchAddRoleCommandOutput}
64+
* @see {@link BatchAddRoleCommandInput} for command's `input` shape.
65+
* @see {@link BatchAddRoleCommandOutput} for command's `response` shape.
66+
* @see {@link RepostspaceClientResolvedConfig | config} for RepostspaceClient's `config` shape.
67+
*
68+
* @throws {@link AccessDeniedException} (client fault)
69+
* <p>User does not have sufficient access to perform this action.</p>
70+
*
71+
* @throws {@link InternalServerException} (server fault)
72+
* <p>Unexpected error during processing of request.</p>
73+
*
74+
* @throws {@link ResourceNotFoundException} (client fault)
75+
* <p>Request references a resource which does not exist.</p>
76+
*
77+
* @throws {@link ThrottlingException} (client fault)
78+
* <p>Request was denied due to request throttling.</p>
79+
*
80+
* @throws {@link ValidationException} (client fault)
81+
* <p>The input fails to satisfy the constraints specified by an AWS service.</p>
82+
*
83+
* @throws {@link RepostspaceServiceException}
84+
* <p>Base exception class for all service exceptions from Repostspace service.</p>
85+
*
86+
* @public
87+
*/
88+
export class BatchAddRoleCommand extends $Command
89+
.classBuilder<
90+
BatchAddRoleCommandInput,
91+
BatchAddRoleCommandOutput,
92+
RepostspaceClientResolvedConfig,
93+
ServiceInputTypes,
94+
ServiceOutputTypes
95+
>()
96+
.ep(commonParams)
97+
.m(function (this: any, Command: any, cs: any, config: RepostspaceClientResolvedConfig, o: any) {
98+
return [
99+
getSerdePlugin(config, this.serialize, this.deserialize),
100+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
101+
];
102+
})
103+
.s("RepostSpace", "BatchAddRole", {})
104+
.n("RepostspaceClient", "BatchAddRoleCommand")
105+
.f(void 0, void 0)
106+
.ser(se_BatchAddRoleCommand)
107+
.de(de_BatchAddRoleCommand)
108+
.build() {
109+
/** @internal type navigation helper, not in runtime. */
110+
protected declare static __types: {
111+
api: {
112+
input: BatchAddRoleInput;
113+
output: BatchAddRoleOutput;
114+
};
115+
sdk: {
116+
input: BatchAddRoleCommandInput;
117+
output: BatchAddRoleCommandOutput;
118+
};
119+
};
120+
}
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { BatchRemoveRoleInput, BatchRemoveRoleOutput } from "../models/models_0";
9+
import { de_BatchRemoveRoleCommand, se_BatchRemoveRoleCommand } from "../protocols/Aws_restJson1";
10+
import { RepostspaceClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RepostspaceClient";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link BatchRemoveRoleCommand}.
21+
*/
22+
export interface BatchRemoveRoleCommandInput extends BatchRemoveRoleInput {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link BatchRemoveRoleCommand}.
27+
*/
28+
export interface BatchRemoveRoleCommandOutput extends BatchRemoveRoleOutput, __MetadataBearer {}
29+
30+
/**
31+
* <p>Remove role from multiple users or groups in a private re:Post.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { RepostspaceClient, BatchRemoveRoleCommand } from "@aws-sdk/client-repostspace"; // ES Modules import
36+
* // const { RepostspaceClient, BatchRemoveRoleCommand } = require("@aws-sdk/client-repostspace"); // CommonJS import
37+
* const client = new RepostspaceClient(config);
38+
* const input = { // BatchRemoveRoleInput
39+
* spaceId: "STRING_VALUE", // required
40+
* accessorIds: [ // AccessorIdList // required
41+
* "STRING_VALUE",
42+
* ],
43+
* role: "EXPERT" || "MODERATOR" || "ADMINISTRATOR" || "SUPPORTREQUESTOR", // required
44+
* };
45+
* const command = new BatchRemoveRoleCommand(input);
46+
* const response = await client.send(command);
47+
* // { // BatchRemoveRoleOutput
48+
* // removedAccessorIds: [ // AccessorIdList // required
49+
* // "STRING_VALUE",
50+
* // ],
51+
* // errors: [ // BatchErrorList // required
52+
* // { // BatchError
53+
* // accessorId: "STRING_VALUE", // required
54+
* // error: Number("int"), // required
55+
* // message: "STRING_VALUE", // required
56+
* // },
57+
* // ],
58+
* // };
59+
*
60+
* ```
61+
*
62+
* @param BatchRemoveRoleCommandInput - {@link BatchRemoveRoleCommandInput}
63+
* @returns {@link BatchRemoveRoleCommandOutput}
64+
* @see {@link BatchRemoveRoleCommandInput} for command's `input` shape.
65+
* @see {@link BatchRemoveRoleCommandOutput} for command's `response` shape.
66+
* @see {@link RepostspaceClientResolvedConfig | config} for RepostspaceClient's `config` shape.
67+
*
68+
* @throws {@link AccessDeniedException} (client fault)
69+
* <p>User does not have sufficient access to perform this action.</p>
70+
*
71+
* @throws {@link InternalServerException} (server fault)
72+
* <p>Unexpected error during processing of request.</p>
73+
*
74+
* @throws {@link ResourceNotFoundException} (client fault)
75+
* <p>Request references a resource which does not exist.</p>
76+
*
77+
* @throws {@link ThrottlingException} (client fault)
78+
* <p>Request was denied due to request throttling.</p>
79+
*
80+
* @throws {@link ValidationException} (client fault)
81+
* <p>The input fails to satisfy the constraints specified by an AWS service.</p>
82+
*
83+
* @throws {@link RepostspaceServiceException}
84+
* <p>Base exception class for all service exceptions from Repostspace service.</p>
85+
*
86+
* @public
87+
*/
88+
export class BatchRemoveRoleCommand extends $Command
89+
.classBuilder<
90+
BatchRemoveRoleCommandInput,
91+
BatchRemoveRoleCommandOutput,
92+
RepostspaceClientResolvedConfig,
93+
ServiceInputTypes,
94+
ServiceOutputTypes
95+
>()
96+
.ep(commonParams)
97+
.m(function (this: any, Command: any, cs: any, config: RepostspaceClientResolvedConfig, o: any) {
98+
return [
99+
getSerdePlugin(config, this.serialize, this.deserialize),
100+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
101+
];
102+
})
103+
.s("RepostSpace", "BatchRemoveRole", {})
104+
.n("RepostspaceClient", "BatchRemoveRoleCommand")
105+
.f(void 0, void 0)
106+
.ser(se_BatchRemoveRoleCommand)
107+
.de(de_BatchRemoveRoleCommand)
108+
.build() {
109+
/** @internal type navigation helper, not in runtime. */
110+
protected declare static __types: {
111+
api: {
112+
input: BatchRemoveRoleInput;
113+
output: BatchRemoveRoleOutput;
114+
};
115+
sdk: {
116+
input: BatchRemoveRoleCommandInput;
117+
output: BatchRemoveRoleCommandOutput;
118+
};
119+
};
120+
}

clients/client-repostspace/src/commands/GetSpaceCommand.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ export interface GetSpaceCommandOutput extends GetSpaceOutput, __MetadataBearer
6262
* // groupAdmins: [ // GroupAdmins
6363
* // "STRING_VALUE",
6464
* // ],
65+
* // roles: { // Roles
66+
* // "<keys>": [ // RoleList
67+
* // "EXPERT" || "MODERATOR" || "ADMINISTRATOR" || "SUPPORTREQUESTOR",
68+
* // ],
69+
* // },
6570
* // userKMSKey: "STRING_VALUE",
6671
* // userCount: Number("int"),
6772
* // contentSize: Number("long"),

clients/client-repostspace/src/commands/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// smithy-typescript generated code
2+
export * from "./BatchAddRoleCommand";
3+
export * from "./BatchRemoveRoleCommand";
24
export * from "./CreateSpaceCommand";
35
export * from "./DeleteSpaceCommand";
46
export * from "./DeregisterAdminCommand";

0 commit comments

Comments
 (0)