Skip to content

Commit

Permalink
feat(client-repostspace): Adds the BatchAddRole and BatchRemoveRole A…
Browse files Browse the repository at this point in the history
…PIs.
  • Loading branch information
awstools committed Oct 22, 2024
1 parent eae7a3e commit fa3d3d0
Show file tree
Hide file tree
Showing 10 changed files with 944 additions and 126 deletions.
18 changes: 17 additions & 1 deletion clients/client-repostspace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ AWS SDK for JavaScript Repostspace Client for Node.js, Browser and React Native.

## Installing

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

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

## Client Commands (Operations List)

<details>
<summary>
BatchAddRole
</summary>

[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/)

</details>
<details>
<summary>
BatchRemoveRole
</summary>

[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/)

</details>
<details>
<summary>
CreateSpace
Expand Down
37 changes: 37 additions & 0 deletions clients/client-repostspace/src/Repostspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
import { createAggregatedClient } from "@smithy/smithy-client";
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";

import {
BatchAddRoleCommand,
BatchAddRoleCommandInput,
BatchAddRoleCommandOutput,
} from "./commands/BatchAddRoleCommand";
import {
BatchRemoveRoleCommand,
BatchRemoveRoleCommandInput,
BatchRemoveRoleCommandOutput,
} from "./commands/BatchRemoveRoleCommand";
import { CreateSpaceCommand, CreateSpaceCommandInput, CreateSpaceCommandOutput } from "./commands/CreateSpaceCommand";
import { DeleteSpaceCommand, DeleteSpaceCommandInput, DeleteSpaceCommandOutput } from "./commands/DeleteSpaceCommand";
import {
Expand Down Expand Up @@ -32,6 +42,8 @@ import { UpdateSpaceCommand, UpdateSpaceCommandInput, UpdateSpaceCommandOutput }
import { RepostspaceClient, RepostspaceClientConfig } from "./RepostspaceClient";

const commands = {
BatchAddRoleCommand,
BatchRemoveRoleCommand,
CreateSpaceCommand,
DeleteSpaceCommand,
DeregisterAdminCommand,
Expand All @@ -46,6 +58,31 @@ const commands = {
};

export interface Repostspace {
/**
* @see {@link BatchAddRoleCommand}
*/
batchAddRole(args: BatchAddRoleCommandInput, options?: __HttpHandlerOptions): Promise<BatchAddRoleCommandOutput>;
batchAddRole(args: BatchAddRoleCommandInput, cb: (err: any, data?: BatchAddRoleCommandOutput) => void): void;
batchAddRole(
args: BatchAddRoleCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: BatchAddRoleCommandOutput) => void
): void;

/**
* @see {@link BatchRemoveRoleCommand}
*/
batchRemoveRole(
args: BatchRemoveRoleCommandInput,
options?: __HttpHandlerOptions
): Promise<BatchRemoveRoleCommandOutput>;
batchRemoveRole(args: BatchRemoveRoleCommandInput, cb: (err: any, data?: BatchRemoveRoleCommandOutput) => void): void;
batchRemoveRole(
args: BatchRemoveRoleCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: BatchRemoveRoleCommandOutput) => void
): void;

/**
* @see {@link CreateSpaceCommand}
*/
Expand Down
6 changes: 6 additions & 0 deletions clients/client-repostspace/src/RepostspaceClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ import {
HttpAuthSchemeResolvedConfig,
resolveHttpAuthSchemeConfig,
} from "./auth/httpAuthSchemeProvider";
import { BatchAddRoleCommandInput, BatchAddRoleCommandOutput } from "./commands/BatchAddRoleCommand";
import { BatchRemoveRoleCommandInput, BatchRemoveRoleCommandOutput } from "./commands/BatchRemoveRoleCommand";
import { CreateSpaceCommandInput, CreateSpaceCommandOutput } from "./commands/CreateSpaceCommand";
import { DeleteSpaceCommandInput, DeleteSpaceCommandOutput } from "./commands/DeleteSpaceCommand";
import { DeregisterAdminCommandInput, DeregisterAdminCommandOutput } from "./commands/DeregisterAdminCommand";
Expand Down Expand Up @@ -82,6 +84,8 @@ export { __Client };
* @public
*/
export type ServiceInputTypes =
| BatchAddRoleCommandInput
| BatchRemoveRoleCommandInput
| CreateSpaceCommandInput
| DeleteSpaceCommandInput
| DeregisterAdminCommandInput
Expand All @@ -98,6 +102,8 @@ export type ServiceInputTypes =
* @public
*/
export type ServiceOutputTypes =
| BatchAddRoleCommandOutput
| BatchRemoveRoleCommandOutput
| CreateSpaceCommandOutput
| DeleteSpaceCommandOutput
| DeregisterAdminCommandOutput
Expand Down
120 changes: 120 additions & 0 deletions clients/client-repostspace/src/commands/BatchAddRoleCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { BatchAddRoleInput, BatchAddRoleOutput } from "../models/models_0";
import { de_BatchAddRoleCommand, se_BatchAddRoleCommand } from "../protocols/Aws_restJson1";
import { RepostspaceClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RepostspaceClient";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link BatchAddRoleCommand}.
*/
export interface BatchAddRoleCommandInput extends BatchAddRoleInput {}
/**
* @public
*
* The output of {@link BatchAddRoleCommand}.
*/
export interface BatchAddRoleCommandOutput extends BatchAddRoleOutput, __MetadataBearer {}

/**
* <p>Add role to multiple users or groups in a private re:Post.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { RepostspaceClient, BatchAddRoleCommand } from "@aws-sdk/client-repostspace"; // ES Modules import
* // const { RepostspaceClient, BatchAddRoleCommand } = require("@aws-sdk/client-repostspace"); // CommonJS import
* const client = new RepostspaceClient(config);
* const input = { // BatchAddRoleInput
* spaceId: "STRING_VALUE", // required
* accessorIds: [ // AccessorIdList // required
* "STRING_VALUE",
* ],
* role: "EXPERT" || "MODERATOR" || "ADMINISTRATOR" || "SUPPORTREQUESTOR", // required
* };
* const command = new BatchAddRoleCommand(input);
* const response = await client.send(command);
* // { // BatchAddRoleOutput
* // addedAccessorIds: [ // AccessorIdList // required
* // "STRING_VALUE",
* // ],
* // errors: [ // BatchErrorList // required
* // { // BatchError
* // accessorId: "STRING_VALUE", // required
* // error: Number("int"), // required
* // message: "STRING_VALUE", // required
* // },
* // ],
* // };
*
* ```
*
* @param BatchAddRoleCommandInput - {@link BatchAddRoleCommandInput}
* @returns {@link BatchAddRoleCommandOutput}
* @see {@link BatchAddRoleCommandInput} for command's `input` shape.
* @see {@link BatchAddRoleCommandOutput} for command's `response` shape.
* @see {@link RepostspaceClientResolvedConfig | config} for RepostspaceClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>User does not have sufficient access to perform this action.</p>
*
* @throws {@link InternalServerException} (server fault)
* <p>Unexpected error during processing of request.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>Request references a resource which does not exist.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>Request was denied due to request throttling.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by an AWS service.</p>
*
* @throws {@link RepostspaceServiceException}
* <p>Base exception class for all service exceptions from Repostspace service.</p>
*
* @public
*/
export class BatchAddRoleCommand extends $Command
.classBuilder<
BatchAddRoleCommandInput,
BatchAddRoleCommandOutput,
RepostspaceClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep(commonParams)
.m(function (this: any, Command: any, cs: any, config: RepostspaceClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("RepostSpace", "BatchAddRole", {})
.n("RepostspaceClient", "BatchAddRoleCommand")
.f(void 0, void 0)
.ser(se_BatchAddRoleCommand)
.de(de_BatchAddRoleCommand)
.build() {
/** @internal type navigation helper, not in runtime. */
protected declare static __types: {
api: {
input: BatchAddRoleInput;
output: BatchAddRoleOutput;
};
sdk: {
input: BatchAddRoleCommandInput;
output: BatchAddRoleCommandOutput;
};
};
}
120 changes: 120 additions & 0 deletions clients/client-repostspace/src/commands/BatchRemoveRoleCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { BatchRemoveRoleInput, BatchRemoveRoleOutput } from "../models/models_0";
import { de_BatchRemoveRoleCommand, se_BatchRemoveRoleCommand } from "../protocols/Aws_restJson1";
import { RepostspaceClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../RepostspaceClient";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link BatchRemoveRoleCommand}.
*/
export interface BatchRemoveRoleCommandInput extends BatchRemoveRoleInput {}
/**
* @public
*
* The output of {@link BatchRemoveRoleCommand}.
*/
export interface BatchRemoveRoleCommandOutput extends BatchRemoveRoleOutput, __MetadataBearer {}

/**
* <p>Remove role from multiple users or groups in a private re:Post.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { RepostspaceClient, BatchRemoveRoleCommand } from "@aws-sdk/client-repostspace"; // ES Modules import
* // const { RepostspaceClient, BatchRemoveRoleCommand } = require("@aws-sdk/client-repostspace"); // CommonJS import
* const client = new RepostspaceClient(config);
* const input = { // BatchRemoveRoleInput
* spaceId: "STRING_VALUE", // required
* accessorIds: [ // AccessorIdList // required
* "STRING_VALUE",
* ],
* role: "EXPERT" || "MODERATOR" || "ADMINISTRATOR" || "SUPPORTREQUESTOR", // required
* };
* const command = new BatchRemoveRoleCommand(input);
* const response = await client.send(command);
* // { // BatchRemoveRoleOutput
* // removedAccessorIds: [ // AccessorIdList // required
* // "STRING_VALUE",
* // ],
* // errors: [ // BatchErrorList // required
* // { // BatchError
* // accessorId: "STRING_VALUE", // required
* // error: Number("int"), // required
* // message: "STRING_VALUE", // required
* // },
* // ],
* // };
*
* ```
*
* @param BatchRemoveRoleCommandInput - {@link BatchRemoveRoleCommandInput}
* @returns {@link BatchRemoveRoleCommandOutput}
* @see {@link BatchRemoveRoleCommandInput} for command's `input` shape.
* @see {@link BatchRemoveRoleCommandOutput} for command's `response` shape.
* @see {@link RepostspaceClientResolvedConfig | config} for RepostspaceClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>User does not have sufficient access to perform this action.</p>
*
* @throws {@link InternalServerException} (server fault)
* <p>Unexpected error during processing of request.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>Request references a resource which does not exist.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>Request was denied due to request throttling.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by an AWS service.</p>
*
* @throws {@link RepostspaceServiceException}
* <p>Base exception class for all service exceptions from Repostspace service.</p>
*
* @public
*/
export class BatchRemoveRoleCommand extends $Command
.classBuilder<
BatchRemoveRoleCommandInput,
BatchRemoveRoleCommandOutput,
RepostspaceClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep(commonParams)
.m(function (this: any, Command: any, cs: any, config: RepostspaceClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("RepostSpace", "BatchRemoveRole", {})
.n("RepostspaceClient", "BatchRemoveRoleCommand")
.f(void 0, void 0)
.ser(se_BatchRemoveRoleCommand)
.de(de_BatchRemoveRoleCommand)
.build() {
/** @internal type navigation helper, not in runtime. */
protected declare static __types: {
api: {
input: BatchRemoveRoleInput;
output: BatchRemoveRoleOutput;
};
sdk: {
input: BatchRemoveRoleCommandInput;
output: BatchRemoveRoleCommandOutput;
};
};
}
5 changes: 5 additions & 0 deletions clients/client-repostspace/src/commands/GetSpaceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ export interface GetSpaceCommandOutput extends GetSpaceOutput, __MetadataBearer
* // groupAdmins: [ // GroupAdmins
* // "STRING_VALUE",
* // ],
* // roles: { // Roles
* // "<keys>": [ // RoleList
* // "EXPERT" || "MODERATOR" || "ADMINISTRATOR" || "SUPPORTREQUESTOR",
* // ],
* // },
* // userKMSKey: "STRING_VALUE",
* // userCount: Number("int"),
* // contentSize: Number("long"),
Expand Down
2 changes: 2 additions & 0 deletions clients/client-repostspace/src/commands/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// smithy-typescript generated code
export * from "./BatchAddRoleCommand";
export * from "./BatchRemoveRoleCommand";
export * from "./CreateSpaceCommand";
export * from "./DeleteSpaceCommand";
export * from "./DeregisterAdminCommand";
Expand Down
Loading

0 comments on commit fa3d3d0

Please sign in to comment.