From dc7a599064934d8aec277241bd5375e1cda996b1 Mon Sep 17 00:00:00 2001 From: awstools Date: Thu, 21 Dec 2023 19:17:56 +0000 Subject: [PATCH] feat(client-codecommit): AWS CodeCommit now supports customer managed keys from AWS Key Management Service. UpdateRepositoryEncryptionKey is added for updating the key configuration. CreateRepository, GetRepository, BatchGetRepositories are updated with new input or output parameters. --- clients/client-codecommit/README.md | 13 + clients/client-codecommit/src/CodeCommit.ts | 28 ++ .../client-codecommit/src/CodeCommitClient.ts | 11 + .../commands/BatchGetRepositoriesCommand.ts | 9 + .../src/commands/CreateRepositoryCommand.ts | 9 + .../src/commands/GetRepositoryCommand.ts | 1 + .../commands/ListFileCommitHistoryCommand.ts | 3 +- .../src/commands/ListPullRequestsCommand.ts | 3 +- .../UpdateRepositoryEncryptionKeyCommand.ts | 189 +++++++++++++ .../client-codecommit/src/commands/index.ts | 1 + clients/client-codecommit/src/index.ts | 5 + .../client-codecommit/src/models/models_0.ts | 206 +++++++------- .../client-codecommit/src/models/models_1.ts | 158 +++++++++++ .../src/protocols/Aws_json1_1.ts | 173 +++++++++++- .../sdk-codegen/aws-models/codecommit.json | 254 +++++++++++++++++- 15 files changed, 962 insertions(+), 101 deletions(-) create mode 100644 clients/client-codecommit/src/commands/UpdateRepositoryEncryptionKeyCommand.ts diff --git a/clients/client-codecommit/README.md b/clients/client-codecommit/README.md index a8463683bce5e..21bd42d141684 100644 --- a/clients/client-codecommit/README.md +++ b/clients/client-codecommit/README.md @@ -39,6 +39,11 @@ CodeCommit API along with usage examples.

  • +UpdateRepositoryEncryptionKey, which updates the Key Management Service encryption key used +to encrypt and decrypt a repository.

    +
  • +
  • +

    UpdateRepositoryName, which changes the name of the repository. If you change the name of a repository, no other users of that repository can access it until you send them the new HTTPS or SSH URL to @@ -1199,6 +1204,14 @@ UpdateRepositoryDescription [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/codecommit/command/UpdateRepositoryDescriptionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codecommit/Interface/UpdateRepositoryDescriptionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codecommit/Interface/UpdateRepositoryDescriptionCommandOutput/) + +

    + +UpdateRepositoryEncryptionKey + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/codecommit/command/UpdateRepositoryEncryptionKeyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codecommit/Interface/UpdateRepositoryEncryptionKeyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-codecommit/Interface/UpdateRepositoryEncryptionKeyCommandOutput/) +
    diff --git a/clients/client-codecommit/src/CodeCommit.ts b/clients/client-codecommit/src/CodeCommit.ts index 3c1d913a055bc..c8f7f9ab85587 100644 --- a/clients/client-codecommit/src/CodeCommit.ts +++ b/clients/client-codecommit/src/CodeCommit.ts @@ -352,6 +352,11 @@ import { UpdateRepositoryDescriptionCommandInput, UpdateRepositoryDescriptionCommandOutput, } from "./commands/UpdateRepositoryDescriptionCommand"; +import { + UpdateRepositoryEncryptionKeyCommand, + UpdateRepositoryEncryptionKeyCommandInput, + UpdateRepositoryEncryptionKeyCommandOutput, +} from "./commands/UpdateRepositoryEncryptionKeyCommand"; import { UpdateRepositoryNameCommand, UpdateRepositoryNameCommandInput, @@ -436,6 +441,7 @@ const commands = { UpdatePullRequestStatusCommand, UpdatePullRequestTitleCommand, UpdateRepositoryDescriptionCommand, + UpdateRepositoryEncryptionKeyCommand, UpdateRepositoryNameCommand, }; @@ -1638,6 +1644,23 @@ export interface CodeCommit { cb: (err: any, data?: UpdateRepositoryDescriptionCommandOutput) => void ): void; + /** + * @see {@link UpdateRepositoryEncryptionKeyCommand} + */ + updateRepositoryEncryptionKey( + args: UpdateRepositoryEncryptionKeyCommandInput, + options?: __HttpHandlerOptions + ): Promise; + updateRepositoryEncryptionKey( + args: UpdateRepositoryEncryptionKeyCommandInput, + cb: (err: any, data?: UpdateRepositoryEncryptionKeyCommandOutput) => void + ): void; + updateRepositoryEncryptionKey( + args: UpdateRepositoryEncryptionKeyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateRepositoryEncryptionKeyCommandOutput) => void + ): void; + /** * @see {@link UpdateRepositoryNameCommand} */ @@ -1690,6 +1713,11 @@ export interface CodeCommit { *
  • *
  • *

    + * UpdateRepositoryEncryptionKey, which updates the Key Management Service encryption key used + * to encrypt and decrypt a repository.

    + *
  • + *
  • + *

    * UpdateRepositoryName, which changes the name of the * repository. If you change the name of a repository, no other users of that * repository can access it until you send them the new HTTPS or SSH URL to diff --git a/clients/client-codecommit/src/CodeCommitClient.ts b/clients/client-codecommit/src/CodeCommitClient.ts index 59a933df13bb3..a342283596d57 100644 --- a/clients/client-codecommit/src/CodeCommitClient.ts +++ b/clients/client-codecommit/src/CodeCommitClient.ts @@ -269,6 +269,10 @@ import { UpdateRepositoryDescriptionCommandInput, UpdateRepositoryDescriptionCommandOutput, } from "./commands/UpdateRepositoryDescriptionCommand"; +import { + UpdateRepositoryEncryptionKeyCommandInput, + UpdateRepositoryEncryptionKeyCommandOutput, +} from "./commands/UpdateRepositoryEncryptionKeyCommand"; import { UpdateRepositoryNameCommandInput, UpdateRepositoryNameCommandOutput, @@ -365,6 +369,7 @@ export type ServiceInputTypes = | UpdatePullRequestStatusCommandInput | UpdatePullRequestTitleCommandInput | UpdateRepositoryDescriptionCommandInput + | UpdateRepositoryEncryptionKeyCommandInput | UpdateRepositoryNameCommandInput; /** @@ -448,6 +453,7 @@ export type ServiceOutputTypes = | UpdatePullRequestStatusCommandOutput | UpdatePullRequestTitleCommandOutput | UpdateRepositoryDescriptionCommandOutput + | UpdateRepositoryEncryptionKeyCommandOutput | UpdateRepositoryNameCommandOutput; /** @@ -654,6 +660,11 @@ export interface CodeCommitClientResolvedConfig extends CodeCommitClientResolved *

  • *
  • *

    + * UpdateRepositoryEncryptionKey, which updates the Key Management Service encryption key used + * to encrypt and decrypt a repository.

    + *
  • + *
  • + *

    * UpdateRepositoryName, which changes the name of the * repository. If you change the name of a repository, no other users of that * repository can access it until you send them the new HTTPS or SSH URL to diff --git a/clients/client-codecommit/src/commands/BatchGetRepositoriesCommand.ts b/clients/client-codecommit/src/commands/BatchGetRepositoriesCommand.ts index 02e8131ffb889..01e47d3faa904 100644 --- a/clients/client-codecommit/src/commands/BatchGetRepositoriesCommand.ts +++ b/clients/client-codecommit/src/commands/BatchGetRepositoriesCommand.ts @@ -71,11 +71,20 @@ export interface BatchGetRepositoriesCommandOutput extends BatchGetRepositoriesO * // cloneUrlHttp: "STRING_VALUE", * // cloneUrlSsh: "STRING_VALUE", * // Arn: "STRING_VALUE", + * // kmsKeyId: "STRING_VALUE", * // }, * // ], * // repositoriesNotFound: [ // RepositoryNotFoundList * // "STRING_VALUE", * // ], + * // errors: [ // BatchGetRepositoriesErrorsList + * // { // BatchGetRepositoriesError + * // repositoryId: "STRING_VALUE", + * // repositoryName: "STRING_VALUE", + * // errorCode: "EncryptionIntegrityChecksFailedException" || "EncryptionKeyAccessDeniedException" || "EncryptionKeyDisabledException" || "EncryptionKeyNotFoundException" || "EncryptionKeyUnavailableException" || "RepositoryDoesNotExistException", + * // errorMessage: "STRING_VALUE", + * // }, + * // ], * // }; * * ``` diff --git a/clients/client-codecommit/src/commands/CreateRepositoryCommand.ts b/clients/client-codecommit/src/commands/CreateRepositoryCommand.ts index 3394f24282b62..86eff18c32e0c 100644 --- a/clients/client-codecommit/src/commands/CreateRepositoryCommand.ts +++ b/clients/client-codecommit/src/commands/CreateRepositoryCommand.ts @@ -50,6 +50,7 @@ export interface CreateRepositoryCommandOutput extends CreateRepositoryOutput, _ * tags: { // TagsMap * "": "STRING_VALUE", * }, + * kmsKeyId: "STRING_VALUE", * }; * const command = new CreateRepositoryCommand(input); * const response = await client.send(command); @@ -65,6 +66,7 @@ export interface CreateRepositoryCommandOutput extends CreateRepositoryOutput, _ * // cloneUrlHttp: "STRING_VALUE", * // cloneUrlSsh: "STRING_VALUE", * // Arn: "STRING_VALUE", + * // kmsKeyId: "STRING_VALUE", * // }, * // }; * @@ -85,6 +87,13 @@ export interface CreateRepositoryCommandOutput extends CreateRepositoryOutput, _ * @throws {@link EncryptionKeyDisabledException} (client fault) *

    The encryption key is disabled.

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

    The Key Management Service encryption key is not valid.

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

    A KMS encryption key was used to try and encrypt or decrypt a repository, but either the repository or the key was not + * in a valid state to support the operation.

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

    No encryption key was found.

    * diff --git a/clients/client-codecommit/src/commands/GetRepositoryCommand.ts b/clients/client-codecommit/src/commands/GetRepositoryCommand.ts index d9bb00b9fac82..a54a106c92f15 100644 --- a/clients/client-codecommit/src/commands/GetRepositoryCommand.ts +++ b/clients/client-codecommit/src/commands/GetRepositoryCommand.ts @@ -68,6 +68,7 @@ export interface GetRepositoryCommandOutput extends GetRepositoryOutput, __Metad * // cloneUrlHttp: "STRING_VALUE", * // cloneUrlSsh: "STRING_VALUE", * // Arn: "STRING_VALUE", + * // kmsKeyId: "STRING_VALUE", * // }, * // }; * diff --git a/clients/client-codecommit/src/commands/ListFileCommitHistoryCommand.ts b/clients/client-codecommit/src/commands/ListFileCommitHistoryCommand.ts index dbd6f3aa4d4f8..ff77bf2deffde 100644 --- a/clients/client-codecommit/src/commands/ListFileCommitHistoryCommand.ts +++ b/clients/client-codecommit/src/commands/ListFileCommitHistoryCommand.ts @@ -15,7 +15,8 @@ import { } from "@smithy/types"; import { CodeCommitClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CodeCommitClient"; -import { ListFileCommitHistoryRequest, ListFileCommitHistoryResponse } from "../models/models_0"; +import { ListFileCommitHistoryRequest } from "../models/models_0"; +import { ListFileCommitHistoryResponse } from "../models/models_1"; import { de_ListFileCommitHistoryCommand, se_ListFileCommitHistoryCommand } from "../protocols/Aws_json1_1"; /** diff --git a/clients/client-codecommit/src/commands/ListPullRequestsCommand.ts b/clients/client-codecommit/src/commands/ListPullRequestsCommand.ts index 69458c4454b63..f4f12c52e230b 100644 --- a/clients/client-codecommit/src/commands/ListPullRequestsCommand.ts +++ b/clients/client-codecommit/src/commands/ListPullRequestsCommand.ts @@ -15,8 +15,7 @@ import { } from "@smithy/types"; import { CodeCommitClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CodeCommitClient"; -import { ListPullRequestsInput } from "../models/models_0"; -import { ListPullRequestsOutput } from "../models/models_1"; +import { ListPullRequestsInput, ListPullRequestsOutput } from "../models/models_1"; import { de_ListPullRequestsCommand, se_ListPullRequestsCommand } from "../protocols/Aws_json1_1"; /** diff --git a/clients/client-codecommit/src/commands/UpdateRepositoryEncryptionKeyCommand.ts b/clients/client-codecommit/src/commands/UpdateRepositoryEncryptionKeyCommand.ts new file mode 100644 index 0000000000000..84db3738a79c4 --- /dev/null +++ b/clients/client-codecommit/src/commands/UpdateRepositoryEncryptionKeyCommand.ts @@ -0,0 +1,189 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { CodeCommitClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CodeCommitClient"; +import { UpdateRepositoryEncryptionKeyInput, UpdateRepositoryEncryptionKeyOutput } from "../models/models_1"; +import { + de_UpdateRepositoryEncryptionKeyCommand, + se_UpdateRepositoryEncryptionKeyCommand, +} from "../protocols/Aws_json1_1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link UpdateRepositoryEncryptionKeyCommand}. + */ +export interface UpdateRepositoryEncryptionKeyCommandInput extends UpdateRepositoryEncryptionKeyInput {} +/** + * @public + * + * The output of {@link UpdateRepositoryEncryptionKeyCommand}. + */ +export interface UpdateRepositoryEncryptionKeyCommandOutput + extends UpdateRepositoryEncryptionKeyOutput, + __MetadataBearer {} + +/** + * @public + *

    Updates the Key Management Service encryption key used to encrypt and decrypt a CodeCommit repository.

    + * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { CodeCommitClient, UpdateRepositoryEncryptionKeyCommand } from "@aws-sdk/client-codecommit"; // ES Modules import + * // const { CodeCommitClient, UpdateRepositoryEncryptionKeyCommand } = require("@aws-sdk/client-codecommit"); // CommonJS import + * const client = new CodeCommitClient(config); + * const input = { // UpdateRepositoryEncryptionKeyInput + * repositoryName: "STRING_VALUE", // required + * kmsKeyId: "STRING_VALUE", // required + * }; + * const command = new UpdateRepositoryEncryptionKeyCommand(input); + * const response = await client.send(command); + * // { // UpdateRepositoryEncryptionKeyOutput + * // repositoryId: "STRING_VALUE", + * // kmsKeyId: "STRING_VALUE", + * // originalKmsKeyId: "STRING_VALUE", + * // }; + * + * ``` + * + * @param UpdateRepositoryEncryptionKeyCommandInput - {@link UpdateRepositoryEncryptionKeyCommandInput} + * @returns {@link UpdateRepositoryEncryptionKeyCommandOutput} + * @see {@link UpdateRepositoryEncryptionKeyCommandInput} for command's `input` shape. + * @see {@link UpdateRepositoryEncryptionKeyCommandOutput} for command's `response` shape. + * @see {@link CodeCommitClientResolvedConfig | config} for CodeCommitClient's `config` shape. + * + * @throws {@link EncryptionIntegrityChecksFailedException} (server fault) + *

    An encryption integrity check failed.

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

    An encryption key could not be accessed.

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

    The encryption key is disabled.

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

    The Key Management Service encryption key is not valid.

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

    A KMS encryption key was used to try and encrypt or decrypt a repository, but either the repository or the key was not + * in a valid state to support the operation.

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

    No encryption key was found.

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

    A KMS encryption key ID is required but was not specified.

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

    The encryption key is not available.

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

    A specified repository name is not valid.

    + * + *

    This exception occurs only when a specified repository name is not valid. Other + * exceptions occur when a required repository parameter is missing, or when a + * specified repository does not exist.

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

    The specified repository does not exist.

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

    A repository name is required, but was not specified.

    + * + * @throws {@link CodeCommitServiceException} + *

    Base exception class for all service exceptions from CodeCommit service.

    + * + */ +export class UpdateRepositoryEncryptionKeyCommand extends $Command< + UpdateRepositoryEncryptionKeyCommandInput, + UpdateRepositoryEncryptionKeyCommandOutput, + CodeCommitClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: UpdateRepositoryEncryptionKeyCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: CodeCommitClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, UpdateRepositoryEncryptionKeyCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "CodeCommitClient"; + const commandName = "UpdateRepositoryEncryptionKeyCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "CodeCommit_20150413", + operation: "UpdateRepositoryEncryptionKey", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: UpdateRepositoryEncryptionKeyCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_UpdateRepositoryEncryptionKeyCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_UpdateRepositoryEncryptionKeyCommand(output, context); + } +} diff --git a/clients/client-codecommit/src/commands/index.ts b/clients/client-codecommit/src/commands/index.ts index 0f7fc78c715dd..5974e25cffe3b 100644 --- a/clients/client-codecommit/src/commands/index.ts +++ b/clients/client-codecommit/src/commands/index.ts @@ -76,4 +76,5 @@ export * from "./UpdatePullRequestDescriptionCommand"; export * from "./UpdatePullRequestStatusCommand"; export * from "./UpdatePullRequestTitleCommand"; export * from "./UpdateRepositoryDescriptionCommand"; +export * from "./UpdateRepositoryEncryptionKeyCommand"; export * from "./UpdateRepositoryNameCommand"; diff --git a/clients/client-codecommit/src/index.ts b/clients/client-codecommit/src/index.ts index 9b37729fcf729..1eab68cdaf503 100644 --- a/clients/client-codecommit/src/index.ts +++ b/clients/client-codecommit/src/index.ts @@ -33,6 +33,11 @@ *
  • *
  • *

    + * UpdateRepositoryEncryptionKey, which updates the Key Management Service encryption key used + * to encrypt and decrypt a repository.

    + *
  • + *
  • + *

    * UpdateRepositoryName, which changes the name of the * repository. If you change the name of a repository, no other users of that * repository can access it until you send them the new HTTPS or SSH URL to diff --git a/clients/client-codecommit/src/models/models_0.ts b/clients/client-codecommit/src/models/models_0.ts index 31c004e8e609e..f1a2b952e0ce3 100644 --- a/clients/client-codecommit/src/models/models_0.ts +++ b/clients/client-codecommit/src/models/models_0.ts @@ -1819,6 +1819,55 @@ export interface BatchGetRepositoriesInput { repositoryNames: string[] | undefined; } +/** + * @public + * @enum + */ +export const BatchGetRepositoriesErrorCodeEnum = { + ENCRYPTION_INTEGRITY_CHECKS_FAILED_EXCEPTION: "EncryptionIntegrityChecksFailedException", + ENCRYPTION_KEY_ACCESS_DENIED_EXCEPTION: "EncryptionKeyAccessDeniedException", + ENCRYPTION_KEY_DISABLED_EXCEPTION: "EncryptionKeyDisabledException", + ENCRYPTION_KEY_NOT_FOUND_EXCEPTION: "EncryptionKeyNotFoundException", + ENCRYPTION_KEY_UNAVAILABLE_EXCEPTION: "EncryptionKeyUnavailableException", + REPOSITORY_DOES_NOT_EXIST_EXCEPTION: "RepositoryDoesNotExistException", +} as const; + +/** + * @public + */ +export type BatchGetRepositoriesErrorCodeEnum = + (typeof BatchGetRepositoriesErrorCodeEnum)[keyof typeof BatchGetRepositoriesErrorCodeEnum]; + +/** + * @public + *

    Returns information about errors in a BatchGetRepositories operation.

    + */ +export interface BatchGetRepositoriesError { + /** + * @public + *

    The ID of a repository that either could not be found or was not in a valid state.

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

    The name of a repository that either could not be found or was not in a valid state.

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

    An error code that specifies the type of failure.

    + */ + errorCode?: BatchGetRepositoriesErrorCodeEnum; + + /** + * @public + *

    An error message that provides detail about why the repository either was not found or was not in a valid state.

    + */ + errorMessage?: string; +} + /** * @public *

    Information about a repository.

    @@ -1883,6 +1932,12 @@ export interface RepositoryMetadata { *

    The Amazon Resource Name (ARN) of the repository.

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

    The ID of the Key Management Service encryption key used to encrypt and decrypt the repository.

    + */ + kmsKeyId?: string; } /** @@ -1901,6 +1956,12 @@ export interface BatchGetRepositoriesOutput { *

    Returns a list of repository names for which information could not be found.

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

    Returns information about any errors returned when attempting to retrieve information about the repositories.

    + */ + errors?: BatchGetRepositoriesError[]; } /** @@ -3969,6 +4030,16 @@ export interface CreateRepositoryInput { *

    One or more tag key-value pairs to use when tagging this repository.

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

    The ID of the encryption key. You can view the ID of an encryption key in the KMS console, or use the KMS APIs to + * programmatically retrieve a key ID. For more information about acceptable values for kmsKeyID, see + * KeyId in the Decrypt API description in + * the Key Management Service API Reference.

    + *

    If no key is specified, the default aws/codecommit Amazon Web Services managed key is used.

    + */ + kmsKeyId?: string; } /** @@ -3983,6 +4054,47 @@ export interface CreateRepositoryOutput { repositoryMetadata?: RepositoryMetadata; } +/** + * @public + *

    The Key Management Service encryption key is not valid.

    + */ +export class EncryptionKeyInvalidIdException extends __BaseException { + readonly name: "EncryptionKeyInvalidIdException" = "EncryptionKeyInvalidIdException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "EncryptionKeyInvalidIdException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, EncryptionKeyInvalidIdException.prototype); + } +} + +/** + * @public + *

    A KMS encryption key was used to try and encrypt or decrypt a repository, but either the repository or the key was not + * in a valid state to support the operation.

    + */ +export class EncryptionKeyInvalidUsageException extends __BaseException { + readonly name: "EncryptionKeyInvalidUsageException" = "EncryptionKeyInvalidUsageException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "EncryptionKeyInvalidUsageException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, EncryptionKeyInvalidUsageException.prototype); + } +} + /** * @public *

    The specified repository description is not valid.

    @@ -7101,97 +7213,3 @@ export interface FileVersion { */ revisionChildren?: string[]; } - -/** - * @public - */ -export interface ListFileCommitHistoryResponse { - /** - * @public - *

    An array of FileVersion objects that form a directed acyclic graph (DAG) of the changes to the file made by the commits that changed the file.

    - */ - revisionDag: FileVersion[] | undefined; - - /** - * @public - *

    An enumeration token that can be used to return the next batch of results.

    - */ - nextToken?: string; -} - -/** - * @public - *

    The Amazon Resource Name (ARN) is not valid. Make sure that you have provided the full ARN for the author of the pull request, and then try again.

    - */ -export class InvalidAuthorArnException extends __BaseException { - readonly name: "InvalidAuthorArnException" = "InvalidAuthorArnException"; - readonly $fault: "client" = "client"; - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "InvalidAuthorArnException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, InvalidAuthorArnException.prototype); - } -} - -/** - * @public - *

    The pull request status is not valid. The only valid values are OPEN and CLOSED.

    - */ -export class InvalidPullRequestStatusException extends __BaseException { - readonly name: "InvalidPullRequestStatusException" = "InvalidPullRequestStatusException"; - readonly $fault: "client" = "client"; - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "InvalidPullRequestStatusException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, InvalidPullRequestStatusException.prototype); - } -} - -/** - * @public - */ -export interface ListPullRequestsInput { - /** - * @public - *

    The name of the repository for which you want to list pull requests.

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

    Optional. The Amazon Resource Name (ARN) of the user who created the pull request. If used, this filters the results - * to pull requests created by that user.

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

    Optional. The status of the pull request. If used, this refines the results to the pull requests that match the specified status.

    - */ - pullRequestStatus?: PullRequestStatusEnum; - - /** - * @public - *

    An enumeration token that, when provided in a request, returns the next batch of the - * results.

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

    A non-zero, non-negative integer used to limit the number of returned results.

    - */ - maxResults?: number; -} diff --git a/clients/client-codecommit/src/models/models_1.ts b/clients/client-codecommit/src/models/models_1.ts index 20a70c460dd6f..16f4528f8a8ca 100644 --- a/clients/client-codecommit/src/models/models_1.ts +++ b/clients/client-codecommit/src/models/models_1.ts @@ -12,6 +12,7 @@ import { ConflictResolution, ConflictResolutionStrategyTypeEnum, FileModeTypeEnum, + FileVersion, Location, OverrideStatus, PullRequest, @@ -19,6 +20,100 @@ import { RepositoryTrigger, } from "./models_0"; +/** + * @public + */ +export interface ListFileCommitHistoryResponse { + /** + * @public + *

    An array of FileVersion objects that form a directed acyclic graph (DAG) of the changes to the file made by the commits that changed the file.

    + */ + revisionDag: FileVersion[] | undefined; + + /** + * @public + *

    An enumeration token that can be used to return the next batch of results.

    + */ + nextToken?: string; +} + +/** + * @public + *

    The Amazon Resource Name (ARN) is not valid. Make sure that you have provided the full ARN for the author of the pull request, and then try again.

    + */ +export class InvalidAuthorArnException extends __BaseException { + readonly name: "InvalidAuthorArnException" = "InvalidAuthorArnException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InvalidAuthorArnException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, InvalidAuthorArnException.prototype); + } +} + +/** + * @public + *

    The pull request status is not valid. The only valid values are OPEN and CLOSED.

    + */ +export class InvalidPullRequestStatusException extends __BaseException { + readonly name: "InvalidPullRequestStatusException" = "InvalidPullRequestStatusException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InvalidPullRequestStatusException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, InvalidPullRequestStatusException.prototype); + } +} + +/** + * @public + */ +export interface ListPullRequestsInput { + /** + * @public + *

    The name of the repository for which you want to list pull requests.

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

    Optional. The Amazon Resource Name (ARN) of the user who created the pull request. If used, this filters the results + * to pull requests created by that user.

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

    Optional. The status of the pull request. If used, this refines the results to the pull requests that match the specified status.

    + */ + pullRequestStatus?: PullRequestStatusEnum; + + /** + * @public + *

    An enumeration token that, when provided in a request, returns the next batch of the + * results.

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

    A non-zero, non-negative integer used to limit the number of returned results.

    + */ + maxResults?: number; +} + /** * @public */ @@ -2381,6 +2476,69 @@ export interface UpdateRepositoryDescriptionInput { repositoryDescription?: string; } +/** + * @public + *

    A KMS encryption key ID is required but was not specified.

    + */ +export class EncryptionKeyRequiredException extends __BaseException { + readonly name: "EncryptionKeyRequiredException" = "EncryptionKeyRequiredException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "EncryptionKeyRequiredException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, EncryptionKeyRequiredException.prototype); + } +} + +/** + * @public + */ +export interface UpdateRepositoryEncryptionKeyInput { + /** + * @public + *

    The name of the repository for which you want to update the KMS encryption key used to encrypt and decrypt the repository.

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

    The ID of the encryption key. You can view the ID of an encryption key in the KMS console, or use the KMS APIs to + * programmatically retrieve a key ID. For more information about acceptable values for keyID, see + * KeyId in the Decrypt API description in + * the Key Management Service API Reference.

    + */ + kmsKeyId: string | undefined; +} + +/** + * @public + */ +export interface UpdateRepositoryEncryptionKeyOutput { + /** + * @public + *

    The ID of the repository.

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

    The ID of the encryption key.

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

    The ID of the encryption key formerly used to encrypt and decrypt the repository.

    + */ + originalKmsKeyId?: string; +} + /** * @public *

    Represents the input of an update repository description operation.

    diff --git a/clients/client-codecommit/src/protocols/Aws_json1_1.ts b/clients/client-codecommit/src/protocols/Aws_json1_1.ts index cfecd42f805ea..303ad811ac684 100644 --- a/clients/client-codecommit/src/protocols/Aws_json1_1.ts +++ b/clients/client-codecommit/src/protocols/Aws_json1_1.ts @@ -242,6 +242,10 @@ import { UpdateRepositoryDescriptionCommandInput, UpdateRepositoryDescriptionCommandOutput, } from "../commands/UpdateRepositoryDescriptionCommand"; +import { + UpdateRepositoryEncryptionKeyCommandInput, + UpdateRepositoryEncryptionKeyCommandOutput, +} from "../commands/UpdateRepositoryEncryptionKeyCommand"; import { UpdateRepositoryNameCommandInput, UpdateRepositoryNameCommandOutput, @@ -322,6 +326,8 @@ import { EncryptionIntegrityChecksFailedException, EncryptionKeyAccessDeniedException, EncryptionKeyDisabledException, + EncryptionKeyInvalidIdException, + EncryptionKeyInvalidUsageException, EncryptionKeyNotFoundException, EncryptionKeyUnavailableException, EvaluatePullRequestApprovalRulesInput, @@ -369,7 +375,6 @@ import { InvalidApprovalRuleTemplateContentException, InvalidApprovalRuleTemplateDescriptionException, InvalidApprovalRuleTemplateNameException, - InvalidAuthorArnException, InvalidBlobIdException, InvalidBranchNameException, InvalidClientRequestTokenException, @@ -393,7 +398,6 @@ import { InvalidPathException, InvalidPullRequestEventTypeException, InvalidPullRequestIdException, - InvalidPullRequestStatusException, InvalidReactionUserArnException, InvalidReferenceNameException, InvalidReplacementContentException, @@ -411,7 +415,6 @@ import { ListAssociatedApprovalRuleTemplatesForRepositoryInput, ListBranchesInput, ListFileCommitHistoryRequest, - ListPullRequestsInput, Location, ManualMergeRequiredException, MaximumConflictResolutionEntriesExceededException, @@ -475,12 +478,15 @@ import { CommentContentRequiredException, CommentContentSizeLimitExceededException, CommentNotCreatedByCallerException, + EncryptionKeyRequiredException, FileContentRequiredException, InvalidApprovalStateException, + InvalidAuthorArnException, InvalidFileLocationException, InvalidFilePositionException, InvalidOrderException, InvalidOverrideStatusException, + InvalidPullRequestStatusException, InvalidPullRequestStatusUpdateException, InvalidReactionValueException, InvalidRelativeFileVersionEnumException, @@ -495,6 +501,7 @@ import { InvalidSortByException, InvalidTagKeysListException, InvalidTargetBranchException, + ListPullRequestsInput, ListRepositoriesForApprovalRuleTemplateInput, ListRepositoriesInput, ListTagsForResourceInput, @@ -559,6 +566,7 @@ import { UpdatePullRequestTitleInput, UpdatePullRequestTitleOutput, UpdateRepositoryDescriptionInput, + UpdateRepositoryEncryptionKeyInput, UpdateRepositoryNameInput, } from "../models/models_1"; @@ -1563,6 +1571,19 @@ export const se_UpdateRepositoryDescriptionCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_json1_1UpdateRepositoryEncryptionKeyCommand + */ +export const se_UpdateRepositoryEncryptionKeyCommand = async ( + input: UpdateRepositoryEncryptionKeyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("UpdateRepositoryEncryptionKey"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_json1_1UpdateRepositoryNameCommand */ @@ -2595,6 +2616,12 @@ const de_CreateRepositoryCommandError = async ( case "EncryptionKeyDisabledException": case "com.amazonaws.codecommit#EncryptionKeyDisabledException": throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); + case "EncryptionKeyInvalidIdException": + case "com.amazonaws.codecommit#EncryptionKeyInvalidIdException": + throw await de_EncryptionKeyInvalidIdExceptionRes(parsedOutput, context); + case "EncryptionKeyInvalidUsageException": + case "com.amazonaws.codecommit#EncryptionKeyInvalidUsageException": + throw await de_EncryptionKeyInvalidUsageExceptionRes(parsedOutput, context); case "EncryptionKeyNotFoundException": case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); @@ -8097,6 +8124,82 @@ const de_UpdateRepositoryDescriptionCommandError = async ( } }; +/** + * deserializeAws_json1_1UpdateRepositoryEncryptionKeyCommand + */ +export const de_UpdateRepositoryEncryptionKeyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_UpdateRepositoryEncryptionKeyCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UpdateRepositoryEncryptionKeyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_1UpdateRepositoryEncryptionKeyCommandError + */ +const de_UpdateRepositoryEncryptionKeyCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "EncryptionIntegrityChecksFailedException": + case "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException": + throw await de_EncryptionIntegrityChecksFailedExceptionRes(parsedOutput, context); + case "EncryptionKeyAccessDeniedException": + case "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException": + throw await de_EncryptionKeyAccessDeniedExceptionRes(parsedOutput, context); + case "EncryptionKeyDisabledException": + case "com.amazonaws.codecommit#EncryptionKeyDisabledException": + throw await de_EncryptionKeyDisabledExceptionRes(parsedOutput, context); + case "EncryptionKeyInvalidIdException": + case "com.amazonaws.codecommit#EncryptionKeyInvalidIdException": + throw await de_EncryptionKeyInvalidIdExceptionRes(parsedOutput, context); + case "EncryptionKeyInvalidUsageException": + case "com.amazonaws.codecommit#EncryptionKeyInvalidUsageException": + throw await de_EncryptionKeyInvalidUsageExceptionRes(parsedOutput, context); + case "EncryptionKeyNotFoundException": + case "com.amazonaws.codecommit#EncryptionKeyNotFoundException": + throw await de_EncryptionKeyNotFoundExceptionRes(parsedOutput, context); + case "EncryptionKeyRequiredException": + case "com.amazonaws.codecommit#EncryptionKeyRequiredException": + throw await de_EncryptionKeyRequiredExceptionRes(parsedOutput, context); + case "EncryptionKeyUnavailableException": + case "com.amazonaws.codecommit#EncryptionKeyUnavailableException": + throw await de_EncryptionKeyUnavailableExceptionRes(parsedOutput, context); + case "InvalidRepositoryNameException": + case "com.amazonaws.codecommit#InvalidRepositoryNameException": + throw await de_InvalidRepositoryNameExceptionRes(parsedOutput, context); + case "RepositoryDoesNotExistException": + case "com.amazonaws.codecommit#RepositoryDoesNotExistException": + throw await de_RepositoryDoesNotExistExceptionRes(parsedOutput, context); + case "RepositoryNameRequiredException": + case "com.amazonaws.codecommit#RepositoryNameRequiredException": + throw await de_RepositoryNameRequiredExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_json1_1UpdateRepositoryNameCommand */ @@ -8805,6 +8908,38 @@ const de_EncryptionKeyDisabledExceptionRes = async ( return __decorateServiceException(exception, body); }; +/** + * deserializeAws_json1_1EncryptionKeyInvalidIdExceptionRes + */ +const de_EncryptionKeyInvalidIdExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new EncryptionKeyInvalidIdException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_1EncryptionKeyInvalidUsageExceptionRes + */ +const de_EncryptionKeyInvalidUsageExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new EncryptionKeyInvalidUsageException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + /** * deserializeAws_json1_1EncryptionKeyNotFoundExceptionRes */ @@ -8821,6 +8956,22 @@ const de_EncryptionKeyNotFoundExceptionRes = async ( return __decorateServiceException(exception, body); }; +/** + * deserializeAws_json1_1EncryptionKeyRequiredExceptionRes + */ +const de_EncryptionKeyRequiredExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new EncryptionKeyRequiredException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + /** * deserializeAws_json1_1EncryptionKeyUnavailableExceptionRes */ @@ -11512,6 +11663,8 @@ const se_ReplaceContentEntry = (input: ReplaceContentEntry, context: __SerdeCont // se_UpdateRepositoryDescriptionInput omitted. +// se_UpdateRepositoryEncryptionKeyInput omitted. + // se_UpdateRepositoryNameInput omitted. // de_ActorDoesNotExistException omitted. @@ -11622,11 +11775,16 @@ const de_ApprovalRuleTemplate = (output: any, context: __SerdeContext): Approval // de_BatchGetCommitsOutput omitted. +// de_BatchGetRepositoriesError omitted. + +// de_BatchGetRepositoriesErrorsList omitted. + /** * deserializeAws_json1_1BatchGetRepositoriesOutput */ const de_BatchGetRepositoriesOutput = (output: any, context: __SerdeContext): BatchGetRepositoriesOutput => { return take(output, { + errors: _json, repositories: (_: any) => de_RepositoryMetadataList(_, context), repositoriesNotFound: _json, }) as any; @@ -11876,8 +12034,14 @@ const de_DescribePullRequestEventsOutput = (output: any, context: __SerdeContext // de_EncryptionKeyDisabledException omitted. +// de_EncryptionKeyInvalidIdException omitted. + +// de_EncryptionKeyInvalidUsageException omitted. + // de_EncryptionKeyNotFoundException omitted. +// de_EncryptionKeyRequiredException omitted. + // de_EncryptionKeyUnavailableException omitted. // de_EvaluatePullRequestApprovalRulesOutput omitted. @@ -12447,6 +12611,7 @@ const de_RepositoryMetadata = (output: any, context: __SerdeContext): Repository cloneUrlSsh: __expectString, creationDate: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), defaultBranch: __expectString, + kmsKeyId: __expectString, lastModifiedDate: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), repositoryDescription: __expectString, repositoryId: __expectString, @@ -12641,6 +12806,8 @@ const de_UpdatePullRequestTitleOutput = (output: any, context: __SerdeContext): }) as any; }; +// de_UpdateRepositoryEncryptionKeyOutput omitted. + // de_UserInfo omitted. const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ diff --git a/codegen/sdk-codegen/aws-models/codecommit.json b/codegen/sdk-codegen/aws-models/codecommit.json index a7b9313c63d69..409dc82586c24 100644 --- a/codegen/sdk-codegen/aws-models/codecommit.json +++ b/codegen/sdk-codegen/aws-models/codecommit.json @@ -1219,6 +1219,85 @@ "smithy.api#documentation": "

    Returns information about one or more repositories.

    \n \n

    The description field for a repository accepts all HTML characters and all valid\n Unicode characters. Applications that do not HTML-encode the description and display\n it in a webpage can expose users to potentially malicious code. Make sure that you\n HTML-encode the description field in any application that uses this API to display\n the repository description on a webpage.

    \n
    " } }, + "com.amazonaws.codecommit#BatchGetRepositoriesError": { + "type": "structure", + "members": { + "repositoryId": { + "target": "com.amazonaws.codecommit#RepositoryId", + "traits": { + "smithy.api#documentation": "

    The ID of a repository that either could not be found or was not in a valid state.

    " + } + }, + "repositoryName": { + "target": "com.amazonaws.codecommit#RepositoryName", + "traits": { + "smithy.api#documentation": "

    The name of a repository that either could not be found or was not in a valid state.

    " + } + }, + "errorCode": { + "target": "com.amazonaws.codecommit#BatchGetRepositoriesErrorCodeEnum", + "traits": { + "smithy.api#documentation": "

    An error code that specifies the type of failure.

    " + } + }, + "errorMessage": { + "target": "com.amazonaws.codecommit#ErrorMessage", + "traits": { + "smithy.api#documentation": "

    An error message that provides detail about why the repository either was not found or was not in a valid state.

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

    Returns information about errors in a BatchGetRepositories operation.

    " + } + }, + "com.amazonaws.codecommit#BatchGetRepositoriesErrorCodeEnum": { + "type": "enum", + "members": { + "ENCRYPTION_INTEGRITY_CHECKS_FAILED_EXCEPTION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EncryptionIntegrityChecksFailedException" + } + }, + "ENCRYPTION_KEY_ACCESS_DENIED_EXCEPTION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EncryptionKeyAccessDeniedException" + } + }, + "ENCRYPTION_KEY_DISABLED_EXCEPTION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EncryptionKeyDisabledException" + } + }, + "ENCRYPTION_KEY_NOT_FOUND_EXCEPTION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EncryptionKeyNotFoundException" + } + }, + "ENCRYPTION_KEY_UNAVAILABLE_EXCEPTION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EncryptionKeyUnavailableException" + } + }, + "REPOSITORY_DOES_NOT_EXIST_EXCEPTION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RepositoryDoesNotExistException" + } + } + } + }, + "com.amazonaws.codecommit#BatchGetRepositoriesErrorsList": { + "type": "list", + "member": { + "target": "com.amazonaws.codecommit#BatchGetRepositoriesError" + } + }, "com.amazonaws.codecommit#BatchGetRepositoriesInput": { "type": "structure", "members": { @@ -1249,6 +1328,12 @@ "traits": { "smithy.api#documentation": "

    Returns a list of repository names for which information could not be found.

    " } + }, + "errors": { + "target": "com.amazonaws.codecommit#BatchGetRepositoriesErrorsList", + "traits": { + "smithy.api#documentation": "

    Returns information about any errors returned when attempting to retrieve information about the repositories.

    " + } } }, "traits": { @@ -1743,6 +1828,9 @@ { "target": "com.amazonaws.codecommit#UpdateRepositoryDescription" }, + { + "target": "com.amazonaws.codecommit#UpdateRepositoryEncryptionKey" + }, { "target": "com.amazonaws.codecommit#UpdateRepositoryName" } @@ -1759,7 +1847,7 @@ "name": "codecommit" }, "aws.protocols#awsJson1_1": {}, - "smithy.api#documentation": "CodeCommit\n

    This is the CodeCommit API Reference. This reference provides descriptions of the operations and data types for \n CodeCommit API along with usage examples.

    \n

    You can use the CodeCommit API to work with the following objects:

    \n

    Repositories, by calling the following:

    \n
      \n
    • \n

      \n BatchGetRepositories, which returns information about one or more repositories associated with your Amazon Web Services account.

      \n
    • \n
    • \n

      \n CreateRepository, which creates an CodeCommit repository.

      \n
    • \n
    • \n

      \n DeleteRepository, which deletes an CodeCommit repository.

      \n
    • \n
    • \n

      \n GetRepository, which returns information about a specified repository.

      \n
    • \n
    • \n

      \n ListRepositories, which lists all CodeCommit repositories associated with your Amazon Web Services account.

      \n
    • \n
    • \n

      \n UpdateRepositoryDescription, which sets or updates the description of the repository.

      \n
    • \n
    • \n

      \n UpdateRepositoryName, which changes the name of the\n repository. If you change the name of a repository, no other users of that\n repository can access it until you send them the new HTTPS or SSH URL to\n use.

      \n
    • \n
    \n

    Branches, by calling the following:

    \n
      \n
    • \n

      \n CreateBranch, which creates a branch in a specified\n repository.

      \n
    • \n
    • \n

      \n DeleteBranch, which deletes the specified branch in a repository unless it is the default branch.

      \n
    • \n
    • \n

      \n GetBranch, which returns information about a specified branch.

      \n
    • \n
    • \n

      \n ListBranches, which lists all branches for a specified repository.

      \n
    • \n
    • \n

      \n UpdateDefaultBranch, which changes the default branch for a repository.

      \n
    • \n
    \n

    Files, by calling the following:

    \n
      \n
    • \n

      \n DeleteFile, which deletes the content of a specified file from a specified branch.

      \n
    • \n
    • \n

      \n GetBlob, which returns the base-64 encoded content of an\n individual Git blob object in a repository.

      \n
    • \n
    • \n

      \n GetFile, which returns the base-64 encoded content of a specified file.

      \n
    • \n
    • \n

      \n GetFolder, which returns the contents of a specified folder or directory.

      \n
    • \n
    • \n

      \n ListFileCommitHistory, which retrieves a list of commits and changes to a specified file.

      \n
    • \n
    • \n

      \n PutFile, which adds or modifies a single file in a specified repository and branch.

      \n
    • \n
    \n

    Commits, by calling the following:

    \n
      \n
    • \n

      \n BatchGetCommits, which returns information about one or more commits in a repository.

      \n
    • \n
    • \n

      \n CreateCommit, which creates a commit for changes to a repository.

      \n
    • \n
    • \n

      \n GetCommit, which returns information about a commit, including commit \n messages and author and committer information.

      \n
    • \n
    • \n

      \n GetDifferences, which returns information about the\n differences in a valid commit specifier (such as a branch, tag, HEAD, commit ID,\n or other fully qualified reference).

      \n
    • \n
    \n

    Merges, by calling the following:

    \n
      \n
    • \n

      \n BatchDescribeMergeConflicts, which returns information about conflicts in a merge between commits in a repository.

      \n
    • \n
    • \n

      \n CreateUnreferencedMergeCommit, which creates an unreferenced commit between two branches or commits for the\n purpose of comparing them and identifying any potential conflicts.

      \n
    • \n
    • \n

      \n DescribeMergeConflicts, which returns information about merge conflicts between the base, source, and destination versions\n of a file in a potential merge.

      \n
    • \n
    • \n

      \n GetMergeCommit, which returns information about the merge between a source and destination commit.

      \n
    • \n
    • \n

      \n GetMergeConflicts, which returns information about merge conflicts\n between the source and destination branch in a pull request.

      \n
    • \n
    • \n

      \n GetMergeOptions, which returns information about the available merge options between two branches or commit specifiers.

      \n
    • \n
    • \n

      \n MergeBranchesByFastForward, which merges two branches using the fast-forward merge option.

      \n
    • \n
    • \n

      \n MergeBranchesBySquash, which merges two branches using the squash merge option.

      \n
    • \n
    • \n

      \n MergeBranchesByThreeWay, which merges two branches using the three-way merge option.

      \n
    • \n
    \n

    Pull requests, by calling the following:

    \n \n

    Approval rule templates, by calling the following:

    \n \n

    Comments in a repository, by calling the following:

    \n
      \n
    • \n

      \n DeleteCommentContent, which deletes the content of a comment on a commit in a repository.

      \n
    • \n
    • \n

      \n GetComment, which returns information about a comment on a commit.

      \n
    • \n
    • \n

      \n GetCommentReactions, which returns information about emoji reactions to comments.

      \n
    • \n
    • \n

      \n GetCommentsForComparedCommit, which returns information about comments on the comparison between two commit specifiers \n in a repository.

      \n
    • \n
    • \n

      \n PostCommentForComparedCommit, which creates a comment on the comparison between two commit specifiers in a repository.

      \n
    • \n
    • \n

      \n PostCommentReply, which creates a reply to a comment.

      \n
    • \n
    • \n

      \n PutCommentReaction, which creates or updates an emoji reaction to a comment.

      \n
    • \n
    • \n

      \n UpdateComment, which updates the content of a comment on a commit in a repository.

      \n
    • \n
    \n

    Tags used to tag resources in CodeCommit (not Git tags), by calling the following:

    \n
      \n
    • \n

      \n ListTagsForResource, which gets information about Amazon Web Servicestags for a specified Amazon Resource Name (ARN) in CodeCommit.

      \n
    • \n
    • \n

      \n TagResource, which adds or updates tags for a resource in CodeCommit.

      \n
    • \n
    • \n

      \n UntagResource, which removes tags for a resource in CodeCommit.

      \n
    • \n
    \n

    Triggers, by calling the following:

    \n
      \n
    • \n

      \n GetRepositoryTriggers, which returns information about triggers configured \n for a repository.

      \n
    • \n
    • \n

      \n PutRepositoryTriggers, which replaces all triggers for a repository and can \n be used to create or delete triggers.

      \n
    • \n
    • \n

      \n TestRepositoryTriggers, which tests the functionality of a repository trigger \n by sending data to the trigger target.

      \n
    • \n
    \n

    For information about how to use CodeCommit, see the CodeCommit User Guide.

    ", + "smithy.api#documentation": "CodeCommit\n

    This is the CodeCommit API Reference. This reference provides descriptions of the operations and data types for \n CodeCommit API along with usage examples.

    \n

    You can use the CodeCommit API to work with the following objects:

    \n

    Repositories, by calling the following:

    \n
      \n
    • \n

      \n BatchGetRepositories, which returns information about one or more repositories associated with your Amazon Web Services account.

      \n
    • \n
    • \n

      \n CreateRepository, which creates an CodeCommit repository.

      \n
    • \n
    • \n

      \n DeleteRepository, which deletes an CodeCommit repository.

      \n
    • \n
    • \n

      \n GetRepository, which returns information about a specified repository.

      \n
    • \n
    • \n

      \n ListRepositories, which lists all CodeCommit repositories associated with your Amazon Web Services account.

      \n
    • \n
    • \n

      \n UpdateRepositoryDescription, which sets or updates the description of the repository.

      \n
    • \n
    • \n

      \n UpdateRepositoryEncryptionKey, which updates the Key Management Service encryption key used\n to encrypt and decrypt a repository.

      \n
    • \n
    • \n

      \n UpdateRepositoryName, which changes the name of the\n repository. If you change the name of a repository, no other users of that\n repository can access it until you send them the new HTTPS or SSH URL to\n use.

      \n
    • \n
    \n

    Branches, by calling the following:

    \n
      \n
    • \n

      \n CreateBranch, which creates a branch in a specified\n repository.

      \n
    • \n
    • \n

      \n DeleteBranch, which deletes the specified branch in a repository unless it is the default branch.

      \n
    • \n
    • \n

      \n GetBranch, which returns information about a specified branch.

      \n
    • \n
    • \n

      \n ListBranches, which lists all branches for a specified repository.

      \n
    • \n
    • \n

      \n UpdateDefaultBranch, which changes the default branch for a repository.

      \n
    • \n
    \n

    Files, by calling the following:

    \n
      \n
    • \n

      \n DeleteFile, which deletes the content of a specified file from a specified branch.

      \n
    • \n
    • \n

      \n GetBlob, which returns the base-64 encoded content of an\n individual Git blob object in a repository.

      \n
    • \n
    • \n

      \n GetFile, which returns the base-64 encoded content of a specified file.

      \n
    • \n
    • \n

      \n GetFolder, which returns the contents of a specified folder or directory.

      \n
    • \n
    • \n

      \n ListFileCommitHistory, which retrieves a list of commits and changes to a specified file.

      \n
    • \n
    • \n

      \n PutFile, which adds or modifies a single file in a specified repository and branch.

      \n
    • \n
    \n

    Commits, by calling the following:

    \n
      \n
    • \n

      \n BatchGetCommits, which returns information about one or more commits in a repository.

      \n
    • \n
    • \n

      \n CreateCommit, which creates a commit for changes to a repository.

      \n
    • \n
    • \n

      \n GetCommit, which returns information about a commit, including commit \n messages and author and committer information.

      \n
    • \n
    • \n

      \n GetDifferences, which returns information about the\n differences in a valid commit specifier (such as a branch, tag, HEAD, commit ID,\n or other fully qualified reference).

      \n
    • \n
    \n

    Merges, by calling the following:

    \n
      \n
    • \n

      \n BatchDescribeMergeConflicts, which returns information about conflicts in a merge between commits in a repository.

      \n
    • \n
    • \n

      \n CreateUnreferencedMergeCommit, which creates an unreferenced commit between two branches or commits for the\n purpose of comparing them and identifying any potential conflicts.

      \n
    • \n
    • \n

      \n DescribeMergeConflicts, which returns information about merge conflicts between the base, source, and destination versions\n of a file in a potential merge.

      \n
    • \n
    • \n

      \n GetMergeCommit, which returns information about the merge between a source and destination commit.

      \n
    • \n
    • \n

      \n GetMergeConflicts, which returns information about merge conflicts\n between the source and destination branch in a pull request.

      \n
    • \n
    • \n

      \n GetMergeOptions, which returns information about the available merge options between two branches or commit specifiers.

      \n
    • \n
    • \n

      \n MergeBranchesByFastForward, which merges two branches using the fast-forward merge option.

      \n
    • \n
    • \n

      \n MergeBranchesBySquash, which merges two branches using the squash merge option.

      \n
    • \n
    • \n

      \n MergeBranchesByThreeWay, which merges two branches using the three-way merge option.

      \n
    • \n
    \n

    Pull requests, by calling the following:

    \n \n

    Approval rule templates, by calling the following:

    \n \n

    Comments in a repository, by calling the following:

    \n
      \n
    • \n

      \n DeleteCommentContent, which deletes the content of a comment on a commit in a repository.

      \n
    • \n
    • \n

      \n GetComment, which returns information about a comment on a commit.

      \n
    • \n
    • \n

      \n GetCommentReactions, which returns information about emoji reactions to comments.

      \n
    • \n
    • \n

      \n GetCommentsForComparedCommit, which returns information about comments on the comparison between two commit specifiers \n in a repository.

      \n
    • \n
    • \n

      \n PostCommentForComparedCommit, which creates a comment on the comparison between two commit specifiers in a repository.

      \n
    • \n
    • \n

      \n PostCommentReply, which creates a reply to a comment.

      \n
    • \n
    • \n

      \n PutCommentReaction, which creates or updates an emoji reaction to a comment.

      \n
    • \n
    • \n

      \n UpdateComment, which updates the content of a comment on a commit in a repository.

      \n
    • \n
    \n

    Tags used to tag resources in CodeCommit (not Git tags), by calling the following:

    \n
      \n
    • \n

      \n ListTagsForResource, which gets information about Amazon Web Servicestags for a specified Amazon Resource Name (ARN) in CodeCommit.

      \n
    • \n
    • \n

      \n TagResource, which adds or updates tags for a resource in CodeCommit.

      \n
    • \n
    • \n

      \n UntagResource, which removes tags for a resource in CodeCommit.

      \n
    • \n
    \n

    Triggers, by calling the following:

    \n
      \n
    • \n

      \n GetRepositoryTriggers, which returns information about triggers configured \n for a repository.

      \n
    • \n
    • \n

      \n PutRepositoryTriggers, which replaces all triggers for a repository and can \n be used to create or delete triggers.

      \n
    • \n
    • \n

      \n TestRepositoryTriggers, which tests the functionality of a repository trigger \n by sending data to the trigger target.

      \n
    • \n
    \n

    For information about how to use CodeCommit, see the CodeCommit User Guide.

    ", "smithy.api#title": "AWS CodeCommit", "smithy.api#xmlNamespace": { "uri": "http://codecommit.amazonaws.com/doc/2015-04-13" @@ -4062,6 +4150,12 @@ { "target": "com.amazonaws.codecommit#EncryptionKeyDisabledException" }, + { + "target": "com.amazonaws.codecommit#EncryptionKeyInvalidIdException" + }, + { + "target": "com.amazonaws.codecommit#EncryptionKeyInvalidUsageException" + }, { "target": "com.amazonaws.codecommit#EncryptionKeyNotFoundException" }, @@ -4121,6 +4215,12 @@ "traits": { "smithy.api#documentation": "

    One or more tag key-value pairs to use when tagging this repository.

    " } + }, + "kmsKeyId": { + "target": "com.amazonaws.codecommit#KmsKeyId", + "traits": { + "smithy.api#documentation": "

    The ID of the encryption key. You can view the ID of an encryption key in the KMS console, or use the KMS APIs to\n programmatically retrieve a key ID. For more information about acceptable values for kmsKeyID, see \n KeyId in the Decrypt API description in \n the Key Management Service API Reference.

    \n

    If no key is specified, the default aws/codecommit Amazon Web Services managed key is used.

    " + } } }, "traits": { @@ -5423,6 +5523,36 @@ "smithy.api#error": "client" } }, + "com.amazonaws.codecommit#EncryptionKeyInvalidIdException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.codecommit#Message", + "traits": { + "smithy.api#documentation": "

    Any message associated with the exception.

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

    The Key Management Service encryption key is not valid.

    ", + "smithy.api#error": "client" + } + }, + "com.amazonaws.codecommit#EncryptionKeyInvalidUsageException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.codecommit#Message", + "traits": { + "smithy.api#documentation": "

    Any message associated with the exception.

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

    A KMS encryption key was used to try and encrypt or decrypt a repository, but either the repository or the key was not\n in a valid state to support the operation.

    ", + "smithy.api#error": "client" + } + }, "com.amazonaws.codecommit#EncryptionKeyNotFoundException": { "type": "structure", "members": { @@ -5438,6 +5568,21 @@ "smithy.api#error": "client" } }, + "com.amazonaws.codecommit#EncryptionKeyRequiredException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.codecommit#Message", + "traits": { + "smithy.api#documentation": "

    Any message associated with the exception.

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

    A KMS encryption key ID is required but was not specified.

    ", + "smithy.api#error": "client" + } + }, "com.amazonaws.codecommit#EncryptionKeyUnavailableException": { "type": "structure", "members": { @@ -8994,6 +9139,12 @@ "smithy.api#default": false } }, + "com.amazonaws.codecommit#KmsKeyId": { + "type": "string", + "traits": { + "smithy.api#pattern": "^[a-zA-Z0-9:/_-]+$" + } + }, "com.amazonaws.codecommit#LastModifiedDate": { "type": "timestamp" }, @@ -13411,6 +13562,12 @@ "traits": { "smithy.api#documentation": "

    The Amazon Resource Name (ARN) of the repository.

    " } + }, + "kmsKeyId": { + "target": "com.amazonaws.codecommit#KmsKeyId", + "traits": { + "smithy.api#documentation": "

    The ID of the Key Management Service encryption key used to encrypt and decrypt the repository.

    " + } } }, "traits": { @@ -15294,6 +15451,101 @@ "smithy.api#input": {} } }, + "com.amazonaws.codecommit#UpdateRepositoryEncryptionKey": { + "type": "operation", + "input": { + "target": "com.amazonaws.codecommit#UpdateRepositoryEncryptionKeyInput" + }, + "output": { + "target": "com.amazonaws.codecommit#UpdateRepositoryEncryptionKeyOutput" + }, + "errors": [ + { + "target": "com.amazonaws.codecommit#EncryptionIntegrityChecksFailedException" + }, + { + "target": "com.amazonaws.codecommit#EncryptionKeyAccessDeniedException" + }, + { + "target": "com.amazonaws.codecommit#EncryptionKeyDisabledException" + }, + { + "target": "com.amazonaws.codecommit#EncryptionKeyInvalidIdException" + }, + { + "target": "com.amazonaws.codecommit#EncryptionKeyInvalidUsageException" + }, + { + "target": "com.amazonaws.codecommit#EncryptionKeyNotFoundException" + }, + { + "target": "com.amazonaws.codecommit#EncryptionKeyRequiredException" + }, + { + "target": "com.amazonaws.codecommit#EncryptionKeyUnavailableException" + }, + { + "target": "com.amazonaws.codecommit#InvalidRepositoryNameException" + }, + { + "target": "com.amazonaws.codecommit#RepositoryDoesNotExistException" + }, + { + "target": "com.amazonaws.codecommit#RepositoryNameRequiredException" + } + ], + "traits": { + "smithy.api#documentation": "

    Updates the Key Management Service encryption key used to encrypt and decrypt a CodeCommit repository.

    " + } + }, + "com.amazonaws.codecommit#UpdateRepositoryEncryptionKeyInput": { + "type": "structure", + "members": { + "repositoryName": { + "target": "com.amazonaws.codecommit#RepositoryName", + "traits": { + "smithy.api#documentation": "

    The name of the repository for which you want to update the KMS encryption key used to encrypt and decrypt the repository.

    ", + "smithy.api#required": {} + } + }, + "kmsKeyId": { + "target": "com.amazonaws.codecommit#KmsKeyId", + "traits": { + "smithy.api#documentation": "

    The ID of the encryption key. You can view the ID of an encryption key in the KMS console, or use the KMS APIs to\n programmatically retrieve a key ID. For more information about acceptable values for keyID, see \n KeyId in the Decrypt API description in \n the Key Management Service API Reference.

    ", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.codecommit#UpdateRepositoryEncryptionKeyOutput": { + "type": "structure", + "members": { + "repositoryId": { + "target": "com.amazonaws.codecommit#RepositoryId", + "traits": { + "smithy.api#documentation": "

    The ID of the repository.

    " + } + }, + "kmsKeyId": { + "target": "com.amazonaws.codecommit#KmsKeyId", + "traits": { + "smithy.api#documentation": "

    The ID of the encryption key.

    " + } + }, + "originalKmsKeyId": { + "target": "com.amazonaws.codecommit#KmsKeyId", + "traits": { + "smithy.api#documentation": "

    The ID of the encryption key formerly used to encrypt and decrypt the repository.

    " + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.codecommit#UpdateRepositoryName": { "type": "operation", "input": {