diff --git a/clients/client-repostspace/README.md b/clients/client-repostspace/README.md index 0183391f052d..fe6b87f4d770 100644 --- a/clients/client-repostspace/README.md +++ b/clients/client-repostspace/README.md @@ -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` @@ -203,6 +203,22 @@ see LICENSE for more information. ## Client Commands (Operations List) +
+ +BatchAddRole + + +[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/) + +
+
+ +BatchRemoveRole + + +[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/) + +
CreateSpace diff --git a/clients/client-repostspace/src/Repostspace.ts b/clients/client-repostspace/src/Repostspace.ts index 07f249abaa1d..c734b4b33de7 100644 --- a/clients/client-repostspace/src/Repostspace.ts +++ b/clients/client-repostspace/src/Repostspace.ts @@ -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 { @@ -32,6 +42,8 @@ import { UpdateSpaceCommand, UpdateSpaceCommandInput, UpdateSpaceCommandOutput } import { RepostspaceClient, RepostspaceClientConfig } from "./RepostspaceClient"; const commands = { + BatchAddRoleCommand, + BatchRemoveRoleCommand, CreateSpaceCommand, DeleteSpaceCommand, DeregisterAdminCommand, @@ -46,6 +58,31 @@ const commands = { }; export interface Repostspace { + /** + * @see {@link BatchAddRoleCommand} + */ + batchAddRole(args: BatchAddRoleCommandInput, options?: __HttpHandlerOptions): Promise; + 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; + 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} */ diff --git a/clients/client-repostspace/src/RepostspaceClient.ts b/clients/client-repostspace/src/RepostspaceClient.ts index b47fe54575cf..88b444026357 100644 --- a/clients/client-repostspace/src/RepostspaceClient.ts +++ b/clients/client-repostspace/src/RepostspaceClient.ts @@ -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"; @@ -82,6 +84,8 @@ export { __Client }; * @public */ export type ServiceInputTypes = + | BatchAddRoleCommandInput + | BatchRemoveRoleCommandInput | CreateSpaceCommandInput | DeleteSpaceCommandInput | DeregisterAdminCommandInput @@ -98,6 +102,8 @@ export type ServiceInputTypes = * @public */ export type ServiceOutputTypes = + | BatchAddRoleCommandOutput + | BatchRemoveRoleCommandOutput | CreateSpaceCommandOutput | DeleteSpaceCommandOutput | DeregisterAdminCommandOutput diff --git a/clients/client-repostspace/src/commands/BatchAddRoleCommand.ts b/clients/client-repostspace/src/commands/BatchAddRoleCommand.ts new file mode 100644 index 000000000000..af1bde1bc712 --- /dev/null +++ b/clients/client-repostspace/src/commands/BatchAddRoleCommand.ts @@ -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 {} + +/** + *

Add role to multiple users or groups in a private re:Post.

+ * @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) + *

User does not have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

Unexpected error during processing of request.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

Request references a resource which does not exist.

+ * + * @throws {@link ThrottlingException} (client fault) + *

Request was denied due to request throttling.

+ * + * @throws {@link ValidationException} (client fault) + *

The input fails to satisfy the constraints specified by an AWS service.

+ * + * @throws {@link RepostspaceServiceException} + *

Base exception class for all service exceptions from Repostspace service.

+ * + * @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; + }; + }; +} diff --git a/clients/client-repostspace/src/commands/BatchRemoveRoleCommand.ts b/clients/client-repostspace/src/commands/BatchRemoveRoleCommand.ts new file mode 100644 index 000000000000..a14395b1cd24 --- /dev/null +++ b/clients/client-repostspace/src/commands/BatchRemoveRoleCommand.ts @@ -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 {} + +/** + *

Remove role from multiple users or groups in a private re:Post.

+ * @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) + *

User does not have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

Unexpected error during processing of request.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

Request references a resource which does not exist.

+ * + * @throws {@link ThrottlingException} (client fault) + *

Request was denied due to request throttling.

+ * + * @throws {@link ValidationException} (client fault) + *

The input fails to satisfy the constraints specified by an AWS service.

+ * + * @throws {@link RepostspaceServiceException} + *

Base exception class for all service exceptions from Repostspace service.

+ * + * @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; + }; + }; +} diff --git a/clients/client-repostspace/src/commands/GetSpaceCommand.ts b/clients/client-repostspace/src/commands/GetSpaceCommand.ts index 23d4bfec9d83..e5fa8364ba25 100644 --- a/clients/client-repostspace/src/commands/GetSpaceCommand.ts +++ b/clients/client-repostspace/src/commands/GetSpaceCommand.ts @@ -62,6 +62,11 @@ export interface GetSpaceCommandOutput extends GetSpaceOutput, __MetadataBearer * // groupAdmins: [ // GroupAdmins * // "STRING_VALUE", * // ], + * // roles: { // Roles + * // "": [ // RoleList + * // "EXPERT" || "MODERATOR" || "ADMINISTRATOR" || "SUPPORTREQUESTOR", + * // ], + * // }, * // userKMSKey: "STRING_VALUE", * // userCount: Number("int"), * // contentSize: Number("long"), diff --git a/clients/client-repostspace/src/commands/index.ts b/clients/client-repostspace/src/commands/index.ts index cf62ffdbba94..e34b598a9cff 100644 --- a/clients/client-repostspace/src/commands/index.ts +++ b/clients/client-repostspace/src/commands/index.ts @@ -1,4 +1,6 @@ // smithy-typescript generated code +export * from "./BatchAddRoleCommand"; +export * from "./BatchRemoveRoleCommand"; export * from "./CreateSpaceCommand"; export * from "./DeleteSpaceCommand"; export * from "./DeregisterAdminCommand"; diff --git a/clients/client-repostspace/src/models/models_0.ts b/clients/client-repostspace/src/models/models_0.ts index 1fc0f56e10ae..ce189eec66a0 100644 --- a/clients/client-repostspace/src/models/models_0.ts +++ b/clients/client-repostspace/src/models/models_0.ts @@ -27,120 +27,80 @@ export class AccessDeniedException extends __BaseException { * @public * @enum */ -export const ConfigurationStatus = { - CONFIGURED: "CONFIGURED", - UNCONFIGURED: "UNCONFIGURED", +export const Role = { + ADMINISTRATOR: "ADMINISTRATOR", + EXPERT: "EXPERT", + MODERATOR: "MODERATOR", + SUPPORTREQUESTOR: "SUPPORTREQUESTOR", } as const; /** * @public */ -export type ConfigurationStatus = (typeof ConfigurationStatus)[keyof typeof ConfigurationStatus]; +export type Role = (typeof Role)[keyof typeof Role]; /** - *

Updating or deleting a resource can cause an inconsistent state.

* @public */ -export class ConflictException extends __BaseException { - readonly name: "ConflictException" = "ConflictException"; - readonly $fault: "client" = "client"; +export interface BatchAddRoleInput { /** - *

The ID of the resource.

+ *

The unique ID of the private re:Post.

* @public */ - resourceId: string | undefined; + spaceId: string | undefined; /** - *

The type of the resource.

+ *

The user or group accessor identifiers to add the role to.

* @public */ - resourceType: string | undefined; + accessorIds: string[] | undefined; /** - * @internal + *

The role to add to the users or groups.

+ * @public */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "ConflictException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ConflictException.prototype); - this.resourceId = opts.resourceId; - this.resourceType = opts.resourceType; - } + role: Role | undefined; } /** + *

An error that occurred during a batch operation.

* @public - * @enum */ -export const TierLevel = { - BASIC: "BASIC", - STANDARD: "STANDARD", -} as const; - -/** - * @public - */ -export type TierLevel = (typeof TierLevel)[keyof typeof TierLevel]; - -/** - * @public - */ -export interface CreateSpaceInput { +export interface BatchError { /** - *

The name for the private re:Post. This must be unique in your account.

+ *

The accessor identifier that's related to the error.

* @public */ - name: string | undefined; + accessorId: string | undefined; /** - *

The subdomain that you use to access your AWS re:Post Private private re:Post. All custom subdomains must be approved by AWS before use. In addition to your custom subdomain, all private re:Posts are issued an AWS generated subdomain for immediate use.

+ *

The error code.

* @public */ - subdomain: string | undefined; + error: number | undefined; /** - *

The pricing tier for the private re:Post.

- * @public - */ - tier: TierLevel | undefined; - - /** - *

A description for the private re:Post. This is used only to help you identify this private re:Post.

+ *

Description of the error.

* @public */ - description?: string; - - /** - *

The AWS KMS key ARN that’s used for the AWS KMS encryption. If you don't provide a key, your data is encrypted by default with a key that AWS owns and manages for you.

- * @public - */ - userKMSKey?: string; - - /** - *

The list of tags associated with the private re:Post.

- * @public - */ - tags?: Record; - - /** - *

The IAM role that grants permissions to the private re:Post to convert unanswered questions into AWS support tickets.

- * @public - */ - roleArn?: string; + message: string | undefined; } /** * @public */ -export interface CreateSpaceOutput { +export interface BatchAddRoleOutput { /** - *

The unique ID of the private re:Post.

+ *

An array of successfully updated accessor identifiers.

* @public */ - spaceId: string | undefined; + addedAccessorIds: string[] | undefined; + + /** + *

An array of errors that occurred when roles were added.

+ * @public + */ + errors: BatchError[] | undefined; } /** @@ -205,54 +165,6 @@ export class ResourceNotFoundException extends __BaseException { } } -/** - *

Request would cause a service quota to be exceeded.

- * @public - */ -export class ServiceQuotaExceededException extends __BaseException { - readonly name: "ServiceQuotaExceededException" = "ServiceQuotaExceededException"; - readonly $fault: "client" = "client"; - /** - *

The id of the resource.

- * @public - */ - resourceId: string | undefined; - - /** - *

The type of the resource.

- * @public - */ - resourceType: string | undefined; - - /** - *

The code to identify the service.

- * @public - */ - serviceCode: string | undefined; - - /** - *

The code to identify the quota.

- * @public - */ - quotaCode: string | undefined; - - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "ServiceQuotaExceededException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype); - this.resourceId = opts.resourceId; - this.resourceType = opts.resourceType; - this.serviceCode = opts.serviceCode; - this.quotaCode = opts.quotaCode; - } -} - /** *

Request was denied due to request throttling.

* @public @@ -365,6 +277,214 @@ export class ValidationException extends __BaseException { } } +/** + * @public + */ +export interface BatchRemoveRoleInput { + /** + *

The unique ID of the private re:Post.

+ * @public + */ + spaceId: string | undefined; + + /** + *

The user or group accessor identifiers to remove the role from.

+ * @public + */ + accessorIds: string[] | undefined; + + /** + *

The role to remove from the users or groups.

+ * @public + */ + role: Role | undefined; +} + +/** + * @public + */ +export interface BatchRemoveRoleOutput { + /** + *

An array of successfully updated accessor identifiers.

+ * @public + */ + removedAccessorIds: string[] | undefined; + + /** + *

An array of errors that occurred when roles were removed.

+ * @public + */ + errors: BatchError[] | undefined; +} + +/** + * @public + * @enum + */ +export const ConfigurationStatus = { + CONFIGURED: "CONFIGURED", + UNCONFIGURED: "UNCONFIGURED", +} as const; + +/** + * @public + */ +export type ConfigurationStatus = (typeof ConfigurationStatus)[keyof typeof ConfigurationStatus]; + +/** + *

Updating or deleting a resource can cause an inconsistent state.

+ * @public + */ +export class ConflictException extends __BaseException { + readonly name: "ConflictException" = "ConflictException"; + readonly $fault: "client" = "client"; + /** + *

The ID of the resource.

+ * @public + */ + resourceId: string | undefined; + + /** + *

The type of the resource.

+ * @public + */ + resourceType: string | undefined; + + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ConflictException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ConflictException.prototype); + this.resourceId = opts.resourceId; + this.resourceType = opts.resourceType; + } +} + +/** + * @public + * @enum + */ +export const TierLevel = { + BASIC: "BASIC", + STANDARD: "STANDARD", +} as const; + +/** + * @public + */ +export type TierLevel = (typeof TierLevel)[keyof typeof TierLevel]; + +/** + * @public + */ +export interface CreateSpaceInput { + /** + *

The name for the private re:Post. This must be unique in your account.

+ * @public + */ + name: string | undefined; + + /** + *

The subdomain that you use to access your AWS re:Post Private private re:Post. All custom subdomains must be approved by AWS before use. In addition to your custom subdomain, all private re:Posts are issued an AWS generated subdomain for immediate use.

+ * @public + */ + subdomain: string | undefined; + + /** + *

The pricing tier for the private re:Post.

+ * @public + */ + tier: TierLevel | undefined; + + /** + *

A description for the private re:Post. This is used only to help you identify this private re:Post.

+ * @public + */ + description?: string; + + /** + *

The AWS KMS key ARN that’s used for the AWS KMS encryption. If you don't provide a key, your data is encrypted by default with a key that AWS owns and manages for you.

+ * @public + */ + userKMSKey?: string; + + /** + *

The list of tags associated with the private re:Post.

+ * @public + */ + tags?: Record; + + /** + *

The IAM role that grants permissions to the private re:Post to convert unanswered questions into AWS support tickets.

+ * @public + */ + roleArn?: string; +} + +/** + * @public + */ +export interface CreateSpaceOutput { + /** + *

The unique ID of the private re:Post.

+ * @public + */ + spaceId: string | undefined; +} + +/** + *

Request would cause a service quota to be exceeded.

+ * @public + */ +export class ServiceQuotaExceededException extends __BaseException { + readonly name: "ServiceQuotaExceededException" = "ServiceQuotaExceededException"; + readonly $fault: "client" = "client"; + /** + *

The id of the resource.

+ * @public + */ + resourceId: string | undefined; + + /** + *

The type of the resource.

+ * @public + */ + resourceType: string | undefined; + + /** + *

The code to identify the service.

+ * @public + */ + serviceCode: string | undefined; + + /** + *

The code to identify the quota.

+ * @public + */ + quotaCode: string | undefined; + + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ServiceQuotaExceededException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype); + this.resourceId = opts.resourceId; + this.resourceType = opts.resourceType; + this.serviceCode = opts.serviceCode; + this.quotaCode = opts.quotaCode; + } +} + /** * @public */ @@ -514,17 +634,27 @@ export interface GetSpaceOutput { storageLimit: number | undefined; /** + * @deprecated + * *

The list of users that are administrators of the private re:Post.

* @public */ userAdmins?: string[]; /** + * @deprecated + * *

The list of groups that are administrators of the private re:Post.

* @public */ groupAdmins?: string[]; + /** + *

A map of accessor identifiers and their roles.

+ * @public + */ + roles?: Record; + /** *

The custom AWS KMS key ARN that’s used for the AWS KMS encryption.

* @public diff --git a/clients/client-repostspace/src/protocols/Aws_restJson1.ts b/clients/client-repostspace/src/protocols/Aws_restJson1.ts index 68090f01a579..35aee8e261cf 100644 --- a/clients/client-repostspace/src/protocols/Aws_restJson1.ts +++ b/clients/client-repostspace/src/protocols/Aws_restJson1.ts @@ -25,6 +25,8 @@ import { SerdeContext as __SerdeContext, } from "@smithy/types"; +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"; @@ -51,6 +53,54 @@ import { } from "../models/models_0"; import { RepostspaceServiceException as __BaseException } from "../models/RepostspaceServiceException"; +/** + * serializeAws_restJson1BatchAddRoleCommand + */ +export const se_BatchAddRoleCommand = async ( + input: BatchAddRoleCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/spaces/{spaceId}/roles"); + b.p("spaceId", () => input.spaceId!, "{spaceId}", false); + let body: any; + body = JSON.stringify( + take(input, { + accessorIds: (_) => _json(_), + role: [], + }) + ); + b.m("POST").h(headers).b(body); + return b.build(); +}; + +/** + * serializeAws_restJson1BatchRemoveRoleCommand + */ +export const se_BatchRemoveRoleCommand = async ( + input: BatchRemoveRoleCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/spaces/{spaceId}/roles"); + b.p("spaceId", () => input.spaceId!, "{spaceId}", false); + let body: any; + body = JSON.stringify( + take(input, { + accessorIds: (_) => _json(_), + role: [], + }) + ); + b.m("PATCH").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1CreateSpaceCommand */ @@ -272,6 +322,50 @@ export const se_UpdateSpaceCommand = async ( return b.build(); }; +/** + * deserializeAws_restJson1BatchAddRoleCommand + */ +export const de_BatchAddRoleCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + addedAccessorIds: _json, + errors: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1BatchRemoveRoleCommand + */ +export const de_BatchRemoveRoleCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + errors: _json, + removedAccessorIds: _json, + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1CreateSpaceCommand */ @@ -353,6 +447,7 @@ export const de_GetSpaceCommand = async ( groupAdmins: _json, name: __expectString, randomDomain: __expectString, + roles: _json, spaceId: __expectString, status: __expectString, storageLimit: __expectLong, @@ -508,24 +603,24 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): case "AccessDeniedException": case "com.amazonaws.repostspace#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); - case "ConflictException": - case "com.amazonaws.repostspace#ConflictException": - throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.repostspace#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); case "ResourceNotFoundException": case "com.amazonaws.repostspace#ResourceNotFoundException": throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); - case "ServiceQuotaExceededException": - case "com.amazonaws.repostspace#ServiceQuotaExceededException": - throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.repostspace#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.repostspace#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.repostspace#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.repostspace#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ @@ -688,8 +783,18 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_Tags omitted. +// de_AccessorIdList omitted. + +// de_BatchError omitted. + +// de_BatchErrorList omitted. + // de_GroupAdmins omitted. +// de_RoleList omitted. + +// de_Roles omitted. + /** * deserializeAws_restJson1SpaceData */ diff --git a/codegen/sdk-codegen/aws-models/repostspace.json b/codegen/sdk-codegen/aws-models/repostspace.json index 49e966af82bd..3460b6d86fa9 100644 --- a/codegen/sdk-codegen/aws-models/repostspace.json +++ b/codegen/sdk-codegen/aws-models/repostspace.json @@ -43,6 +43,215 @@ } } }, + "com.amazonaws.repostspace#BatchAddRole": { + "type": "operation", + "input": { + "target": "com.amazonaws.repostspace#BatchAddRoleInput" + }, + "output": { + "target": "com.amazonaws.repostspace#BatchAddRoleOutput" + }, + "errors": [ + { + "target": "com.amazonaws.repostspace#AccessDeniedException" + }, + { + "target": "com.amazonaws.repostspace#InternalServerException" + }, + { + "target": "com.amazonaws.repostspace#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.repostspace#ThrottlingException" + }, + { + "target": "com.amazonaws.repostspace#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Add role to multiple users or groups in a private re:Post.

", + "smithy.api#http": { + "method": "POST", + "uri": "/spaces/{spaceId}/roles", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.repostspace#BatchAddRoleInput": { + "type": "structure", + "members": { + "spaceId": { + "target": "com.amazonaws.repostspace#SpaceId", + "traits": { + "smithy.api#documentation": "

The unique ID of the private re:Post.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "accessorIds": { + "target": "com.amazonaws.repostspace#AccessorIdList", + "traits": { + "smithy.api#documentation": "

The user or group accessor identifiers to add the role to.

", + "smithy.api#required": {} + } + }, + "role": { + "target": "com.amazonaws.repostspace#Role", + "traits": { + "smithy.api#documentation": "

The role to add to the users or groups.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.repostspace#BatchAddRoleOutput": { + "type": "structure", + "members": { + "addedAccessorIds": { + "target": "com.amazonaws.repostspace#AccessorIdList", + "traits": { + "smithy.api#documentation": "

An array of successfully updated accessor identifiers.

", + "smithy.api#required": {} + } + }, + "errors": { + "target": "com.amazonaws.repostspace#BatchErrorList", + "traits": { + "smithy.api#documentation": "

An array of errors that occurred when roles were added.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.repostspace#BatchError": { + "type": "structure", + "members": { + "accessorId": { + "target": "com.amazonaws.repostspace#AccessorId", + "traits": { + "smithy.api#documentation": "

The accessor identifier that's related to the error.

", + "smithy.api#required": {} + } + }, + "error": { + "target": "com.amazonaws.repostspace#ErrorCode", + "traits": { + "smithy.api#documentation": "

The error code.

", + "smithy.api#required": {} + } + }, + "message": { + "target": "com.amazonaws.repostspace#ErrorMessage", + "traits": { + "smithy.api#documentation": "

Description of the error.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

An error that occurred during a batch operation.

" + } + }, + "com.amazonaws.repostspace#BatchErrorList": { + "type": "list", + "member": { + "target": "com.amazonaws.repostspace#BatchError" + } + }, + "com.amazonaws.repostspace#BatchRemoveRole": { + "type": "operation", + "input": { + "target": "com.amazonaws.repostspace#BatchRemoveRoleInput" + }, + "output": { + "target": "com.amazonaws.repostspace#BatchRemoveRoleOutput" + }, + "errors": [ + { + "target": "com.amazonaws.repostspace#AccessDeniedException" + }, + { + "target": "com.amazonaws.repostspace#InternalServerException" + }, + { + "target": "com.amazonaws.repostspace#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.repostspace#ThrottlingException" + }, + { + "target": "com.amazonaws.repostspace#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Remove role from multiple users or groups in a private re:Post.

", + "smithy.api#http": { + "method": "PATCH", + "uri": "/spaces/{spaceId}/roles", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.repostspace#BatchRemoveRoleInput": { + "type": "structure", + "members": { + "spaceId": { + "target": "com.amazonaws.repostspace#SpaceId", + "traits": { + "smithy.api#documentation": "

The unique ID of the private re:Post.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "accessorIds": { + "target": "com.amazonaws.repostspace#AccessorIdList", + "traits": { + "smithy.api#documentation": "

The user or group accessor identifiers to remove the role from.

", + "smithy.api#required": {} + } + }, + "role": { + "target": "com.amazonaws.repostspace#Role", + "traits": { + "smithy.api#documentation": "

The role to remove from the users or groups.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.repostspace#BatchRemoveRoleOutput": { + "type": "structure", + "members": { + "removedAccessorIds": { + "target": "com.amazonaws.repostspace#AccessorIdList", + "traits": { + "smithy.api#documentation": "

An array of successfully updated accessor identifiers.

", + "smithy.api#required": {} + } + }, + "errors": { + "target": "com.amazonaws.repostspace#BatchErrorList", + "traits": { + "smithy.api#documentation": "

An array of errors that occurred when roles were removed.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.repostspace#ClientId": { "type": "string" }, @@ -315,6 +524,12 @@ "smithy.api#input": {} } }, + "com.amazonaws.repostspace#ErrorCode": { + "type": "integer" + }, + "com.amazonaws.repostspace#ErrorMessage": { + "type": "string" + }, "com.amazonaws.repostspace#GetSpace": { "type": "operation", "input": { @@ -476,15 +691,27 @@ "userAdmins": { "target": "com.amazonaws.repostspace#UserAdmins", "traits": { + "smithy.api#deprecated": { + "message": "This property has been depracted and will be replaced by the roles property." + }, "smithy.api#documentation": "

The list of users that are administrators of the private re:Post.

" } }, "groupAdmins": { "target": "com.amazonaws.repostspace#GroupAdmins", "traits": { + "smithy.api#deprecated": { + "message": "This property has been depracted and will be replaced by the roles property." + }, "smithy.api#documentation": "

The list of groups that are administrators of the private re:Post.

" } }, + "roles": { + "target": "com.amazonaws.repostspace#Roles", + "traits": { + "smithy.api#documentation": "

A map of accessor identifiers and their roles.

" + } + }, "userKMSKey": { "target": "com.amazonaws.repostspace#KMSKey", "traits": { @@ -789,6 +1016,12 @@ "type": "service", "version": "2022-05-13", "operations": [ + { + "target": "com.amazonaws.repostspace#BatchAddRole" + }, + { + "target": "com.amazonaws.repostspace#BatchRemoveRole" + }, { "target": "com.amazonaws.repostspace#CreateSpace" }, @@ -1547,6 +1780,50 @@ "smithy.api#httpError": 404 } }, + "com.amazonaws.repostspace#Role": { + "type": "enum", + "members": { + "EXPERT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EXPERT" + } + }, + "MODERATOR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MODERATOR" + } + }, + "ADMINISTRATOR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ADMINISTRATOR" + } + }, + "SUPPORTREQUESTOR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SUPPORTREQUESTOR" + } + } + } + }, + "com.amazonaws.repostspace#RoleList": { + "type": "list", + "member": { + "target": "com.amazonaws.repostspace#Role" + } + }, + "com.amazonaws.repostspace#Roles": { + "type": "map", + "key": { + "target": "com.amazonaws.repostspace#AccessorId" + }, + "value": { + "target": "com.amazonaws.repostspace#RoleList" + } + }, "com.amazonaws.repostspace#SendInvites": { "type": "operation", "input": {