Skip to content

Commit

Permalink
feat(client-codecommit): CreateRepository API now throws OperationNot…
Browse files Browse the repository at this point in the history
…AllowedException when the account has been restricted from creating a repository.
  • Loading branch information
awstools committed Jul 25, 2024
1 parent 88cbe69 commit 9195ee7
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ export interface CreateRepositoryCommandOutput extends CreateRepositoryOutput, _
* @throws {@link InvalidTagsMapException} (client fault)
* <p>The map of tags is not valid.</p>
*
* @throws {@link OperationNotAllowedException} (client fault)
* <p>The requested action is not allowed.</p>
*
* @throws {@link RepositoryLimitExceededException} (client fault)
* <p>A repository resource limit was exceeded.</p>
*
Expand Down
53 changes: 21 additions & 32 deletions clients/client-codecommit/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4034,7 +4034,7 @@ export interface CreateRepositoryInput {
/**
* <p>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
* <a href="https://docs.aws.amazon.com/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId">KeyId</a> in the Decrypt API description in
* <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId">KeyId</a> in the Decrypt API description in
* the <i>Key Management Service API Reference</i>.</p>
* <p>If no key is specified, the default <code>aws/codecommit</code> Amazon Web Services managed key is used.</p>
* @public
Expand Down Expand Up @@ -4155,6 +4155,26 @@ export class InvalidTagsMapException extends __BaseException {
}
}

/**
* <p>The requested action is not allowed.</p>
* @public
*/
export class OperationNotAllowedException extends __BaseException {
readonly name: "OperationNotAllowedException" = "OperationNotAllowedException";
readonly $fault: "client" = "client";
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<OperationNotAllowedException, __BaseException>) {
super({
name: "OperationNotAllowedException",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, OperationNotAllowedException.prototype);
}
}

/**
* <p>A repository resource limit was exceeded.</p>
* @public
Expand Down Expand Up @@ -7182,34 +7202,3 @@ export interface ListFileCommitHistoryRequest {
*/
nextToken?: string;
}

/**
* <p>Information about a version of a file.</p>
* @public
*/
export interface FileVersion {
/**
* <p>Returns information about a specific commit.</p>
* @public
*/
commit?: Commit;

/**
* <p>The blob ID of the object that represents the content of the file in this version.</p>
* @public
*/
blobId?: string;

/**
* <p>The name and path of the file at which this blob is indexed which contains the data for this version of the file. This value will
* vary between file versions if a file is renamed or if its path changes.</p>
* @public
*/
path?: string;

/**
* <p>An array of commit IDs that contain more recent versions of this file. If there are no additional versions of the file, this array will be empty.</p>
* @public
*/
revisionChildren?: string[];
}
35 changes: 33 additions & 2 deletions clients/client-codecommit/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,49 @@ import {
ApprovalRuleTemplate,
ApprovalState,
Comment,
Commit,
ConflictDetailLevelTypeEnum,
ConflictResolution,
ConflictResolutionStrategyTypeEnum,
FileModeTypeEnum,
FileVersion,
Location,
OverrideStatus,
PullRequest,
PullRequestStatusEnum,
RepositoryTrigger,
} from "./models_0";

/**
* <p>Information about a version of a file.</p>
* @public
*/
export interface FileVersion {
/**
* <p>Returns information about a specific commit.</p>
* @public
*/
commit?: Commit;

/**
* <p>The blob ID of the object that represents the content of the file in this version.</p>
* @public
*/
blobId?: string;

/**
* <p>The name and path of the file at which this blob is indexed which contains the data for this version of the file. This value will
* vary between file versions if a file is renamed or if its path changes.</p>
* @public
*/
path?: string;

/**
* <p>An array of commit IDs that contain more recent versions of this file. If there are no additional versions of the file, this array will be empty.</p>
* @public
*/
revisionChildren?: string[];
}

/**
* @public
*/
Expand Down Expand Up @@ -2509,7 +2540,7 @@ export interface UpdateRepositoryEncryptionKeyInput {
/**
* <p>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
* <a href="https://docs.aws.amazon.com/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId">KeyId</a> in the Decrypt API description in
* <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId">KeyId</a> in the Decrypt API description in
* the <i>Key Management Service API Reference</i>.</p>
* @public
*/
Expand Down
22 changes: 22 additions & 0 deletions clients/client-codecommit/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ import {
NoChangeException,
NumberOfRulesExceededException,
NumberOfRuleTemplatesExceededException,
OperationNotAllowedException,
ParentCommitDoesNotExistException,
ParentCommitIdOutdatedException,
ParentCommitIdRequiredException,
Expand Down Expand Up @@ -3452,6 +3453,9 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext):
case "InvalidTagsMapException":
case "com.amazonaws.codecommit#InvalidTagsMapException":
throw await de_InvalidTagsMapExceptionRes(parsedOutput, context);
case "OperationNotAllowedException":
case "com.amazonaws.codecommit#OperationNotAllowedException":
throw await de_OperationNotAllowedExceptionRes(parsedOutput, context);
case "RepositoryLimitExceededException":
case "com.amazonaws.codecommit#RepositoryLimitExceededException":
throw await de_RepositoryLimitExceededExceptionRes(parsedOutput, context);
Expand Down Expand Up @@ -5950,6 +5954,22 @@ const de_NumberOfRuleTemplatesExceededExceptionRes = async (
return __decorateServiceException(exception, body);
};

/**
* deserializeAws_json1_1OperationNotAllowedExceptionRes
*/
const de_OperationNotAllowedExceptionRes = async (
parsedOutput: any,
context: __SerdeContext
): Promise<OperationNotAllowedException> => {
const body = parsedOutput.body;
const deserialized: any = _json(body);
const exception = new OperationNotAllowedException({
$metadata: deserializeMetadata(parsedOutput),
...deserialized,
});
return __decorateServiceException(exception, body);
};

/**
* deserializeAws_json1_1OverrideAlreadySetExceptionRes
*/
Expand Down Expand Up @@ -7906,6 +7926,8 @@ const de_MergePullRequestByThreeWayOutput = (

// de_ObjectTypes omitted.

// de_OperationNotAllowedException omitted.

// de_OriginApprovalRuleTemplate omitted.

// de_OverrideAlreadySetException omitted.
Expand Down
22 changes: 20 additions & 2 deletions codegen/sdk-codegen/aws-models/codecommit.json
Original file line number Diff line number Diff line change
Expand Up @@ -4174,6 +4174,9 @@
{
"target": "com.amazonaws.codecommit#InvalidTagsMapException"
},
{
"target": "com.amazonaws.codecommit#OperationNotAllowedException"
},
{
"target": "com.amazonaws.codecommit#RepositoryLimitExceededException"
},
Expand Down Expand Up @@ -4219,7 +4222,7 @@
"kmsKeyId": {
"target": "com.amazonaws.codecommit#KmsKeyId",
"traits": {
"smithy.api#documentation": "<p>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 <a href=\"https://docs.aws.amazon.com/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId\">KeyId</a> in the Decrypt API description in \n the <i>Key Management Service API Reference</i>.</p>\n <p>If no key is specified, the default <code>aws/codecommit</code> Amazon Web Services managed key is used.</p>"
"smithy.api#documentation": "<p>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 <a href=\"https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId\">KeyId</a> in the Decrypt API description in \n the <i>Key Management Service API Reference</i>.</p>\n <p>If no key is specified, the default <code>aws/codecommit</code> Amazon Web Services managed key is used.</p>"
}
}
},
Expand Down Expand Up @@ -11528,6 +11531,21 @@
"smithy.api#documentation": "<p>Information about the type of an object in a merge operation.</p>"
}
},
"com.amazonaws.codecommit#OperationNotAllowedException": {
"type": "structure",
"members": {
"message": {
"target": "com.amazonaws.codecommit#Message",
"traits": {
"smithy.api#documentation": "<p>Any message associated with the exception.</p>"
}
}
},
"traits": {
"smithy.api#documentation": "<p>The requested action is not allowed.</p>",
"smithy.api#error": "client"
}
},
"com.amazonaws.codecommit#OrderEnum": {
"type": "enum",
"members": {
Expand Down Expand Up @@ -15511,7 +15529,7 @@
"kmsKeyId": {
"target": "com.amazonaws.codecommit#KmsKeyId",
"traits": {
"smithy.api#documentation": "<p>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 <a href=\"https://docs.aws.amazon.com/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId\">KeyId</a> in the Decrypt API description in \n the <i>Key Management Service API Reference</i>.</p>",
"smithy.api#documentation": "<p>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 <a href=\"https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId\">KeyId</a> in the Decrypt API description in \n the <i>Key Management Service API Reference</i>.</p>",
"smithy.api#required": {}
}
}
Expand Down

0 comments on commit 9195ee7

Please sign in to comment.