Skip to content

Commit 9195ee7

Browse files
author
awstools
committed
feat(client-codecommit): CreateRepository API now throws OperationNotAllowedException when the account has been restricted from creating a repository.
1 parent 88cbe69 commit 9195ee7

File tree

5 files changed

+99
-36
lines changed

5 files changed

+99
-36
lines changed

clients/client-codecommit/src/commands/CreateRepositoryCommand.ts

+3
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ export interface CreateRepositoryCommandOutput extends CreateRepositoryOutput, _
108108
* @throws {@link InvalidTagsMapException} (client fault)
109109
* <p>The map of tags is not valid.</p>
110110
*
111+
* @throws {@link OperationNotAllowedException} (client fault)
112+
* <p>The requested action is not allowed.</p>
113+
*
111114
* @throws {@link RepositoryLimitExceededException} (client fault)
112115
* <p>A repository resource limit was exceeded.</p>
113116
*

clients/client-codecommit/src/models/models_0.ts

+21-32
Original file line numberDiff line numberDiff line change
@@ -4034,7 +4034,7 @@ export interface CreateRepositoryInput {
40344034
/**
40354035
* <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
40364036
* programmatically retrieve a key ID. For more information about acceptable values for kmsKeyID, see
4037-
* <a href="https://docs.aws.amazon.com/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId">KeyId</a> in the Decrypt API description in
4037+
* <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
40384038
* the <i>Key Management Service API Reference</i>.</p>
40394039
* <p>If no key is specified, the default <code>aws/codecommit</code> Amazon Web Services managed key is used.</p>
40404040
* @public
@@ -4155,6 +4155,26 @@ export class InvalidTagsMapException extends __BaseException {
41554155
}
41564156
}
41574157

4158+
/**
4159+
* <p>The requested action is not allowed.</p>
4160+
* @public
4161+
*/
4162+
export class OperationNotAllowedException extends __BaseException {
4163+
readonly name: "OperationNotAllowedException" = "OperationNotAllowedException";
4164+
readonly $fault: "client" = "client";
4165+
/**
4166+
* @internal
4167+
*/
4168+
constructor(opts: __ExceptionOptionType<OperationNotAllowedException, __BaseException>) {
4169+
super({
4170+
name: "OperationNotAllowedException",
4171+
$fault: "client",
4172+
...opts,
4173+
});
4174+
Object.setPrototypeOf(this, OperationNotAllowedException.prototype);
4175+
}
4176+
}
4177+
41584178
/**
41594179
* <p>A repository resource limit was exceeded.</p>
41604180
* @public
@@ -7182,34 +7202,3 @@ export interface ListFileCommitHistoryRequest {
71827202
*/
71837203
nextToken?: string;
71847204
}
7185-
7186-
/**
7187-
* <p>Information about a version of a file.</p>
7188-
* @public
7189-
*/
7190-
export interface FileVersion {
7191-
/**
7192-
* <p>Returns information about a specific commit.</p>
7193-
* @public
7194-
*/
7195-
commit?: Commit;
7196-
7197-
/**
7198-
* <p>The blob ID of the object that represents the content of the file in this version.</p>
7199-
* @public
7200-
*/
7201-
blobId?: string;
7202-
7203-
/**
7204-
* <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
7205-
* vary between file versions if a file is renamed or if its path changes.</p>
7206-
* @public
7207-
*/
7208-
path?: string;
7209-
7210-
/**
7211-
* <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>
7212-
* @public
7213-
*/
7214-
revisionChildren?: string[];
7215-
}

clients/client-codecommit/src/models/models_1.ts

+33-2
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,49 @@ import {
88
ApprovalRuleTemplate,
99
ApprovalState,
1010
Comment,
11+
Commit,
1112
ConflictDetailLevelTypeEnum,
1213
ConflictResolution,
1314
ConflictResolutionStrategyTypeEnum,
1415
FileModeTypeEnum,
15-
FileVersion,
1616
Location,
1717
OverrideStatus,
1818
PullRequest,
1919
PullRequestStatusEnum,
2020
RepositoryTrigger,
2121
} from "./models_0";
2222

23+
/**
24+
* <p>Information about a version of a file.</p>
25+
* @public
26+
*/
27+
export interface FileVersion {
28+
/**
29+
* <p>Returns information about a specific commit.</p>
30+
* @public
31+
*/
32+
commit?: Commit;
33+
34+
/**
35+
* <p>The blob ID of the object that represents the content of the file in this version.</p>
36+
* @public
37+
*/
38+
blobId?: string;
39+
40+
/**
41+
* <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
42+
* vary between file versions if a file is renamed or if its path changes.</p>
43+
* @public
44+
*/
45+
path?: string;
46+
47+
/**
48+
* <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>
49+
* @public
50+
*/
51+
revisionChildren?: string[];
52+
}
53+
2354
/**
2455
* @public
2556
*/
@@ -2509,7 +2540,7 @@ export interface UpdateRepositoryEncryptionKeyInput {
25092540
/**
25102541
* <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
25112542
* programmatically retrieve a key ID. For more information about acceptable values for keyID, see
2512-
* <a href="https://docs.aws.amazon.com/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId">KeyId</a> in the Decrypt API description in
2543+
* <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
25132544
* the <i>Key Management Service API Reference</i>.</p>
25142545
* @public
25152546
*/

clients/client-codecommit/src/protocols/Aws_json1_1.ts

+22
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ import {
432432
NoChangeException,
433433
NumberOfRulesExceededException,
434434
NumberOfRuleTemplatesExceededException,
435+
OperationNotAllowedException,
435436
ParentCommitDoesNotExistException,
436437
ParentCommitIdOutdatedException,
437438
ParentCommitIdRequiredException,
@@ -3452,6 +3453,9 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext):
34523453
case "InvalidTagsMapException":
34533454
case "com.amazonaws.codecommit#InvalidTagsMapException":
34543455
throw await de_InvalidTagsMapExceptionRes(parsedOutput, context);
3456+
case "OperationNotAllowedException":
3457+
case "com.amazonaws.codecommit#OperationNotAllowedException":
3458+
throw await de_OperationNotAllowedExceptionRes(parsedOutput, context);
34553459
case "RepositoryLimitExceededException":
34563460
case "com.amazonaws.codecommit#RepositoryLimitExceededException":
34573461
throw await de_RepositoryLimitExceededExceptionRes(parsedOutput, context);
@@ -5950,6 +5954,22 @@ const de_NumberOfRuleTemplatesExceededExceptionRes = async (
59505954
return __decorateServiceException(exception, body);
59515955
};
59525956

5957+
/**
5958+
* deserializeAws_json1_1OperationNotAllowedExceptionRes
5959+
*/
5960+
const de_OperationNotAllowedExceptionRes = async (
5961+
parsedOutput: any,
5962+
context: __SerdeContext
5963+
): Promise<OperationNotAllowedException> => {
5964+
const body = parsedOutput.body;
5965+
const deserialized: any = _json(body);
5966+
const exception = new OperationNotAllowedException({
5967+
$metadata: deserializeMetadata(parsedOutput),
5968+
...deserialized,
5969+
});
5970+
return __decorateServiceException(exception, body);
5971+
};
5972+
59535973
/**
59545974
* deserializeAws_json1_1OverrideAlreadySetExceptionRes
59555975
*/
@@ -7906,6 +7926,8 @@ const de_MergePullRequestByThreeWayOutput = (
79067926

79077927
// de_ObjectTypes omitted.
79087928

7929+
// de_OperationNotAllowedException omitted.
7930+
79097931
// de_OriginApprovalRuleTemplate omitted.
79107932

79117933
// de_OverrideAlreadySetException omitted.

codegen/sdk-codegen/aws-models/codecommit.json

+20-2
Original file line numberDiff line numberDiff line change
@@ -4174,6 +4174,9 @@
41744174
{
41754175
"target": "com.amazonaws.codecommit#InvalidTagsMapException"
41764176
},
4177+
{
4178+
"target": "com.amazonaws.codecommit#OperationNotAllowedException"
4179+
},
41774180
{
41784181
"target": "com.amazonaws.codecommit#RepositoryLimitExceededException"
41794182
},
@@ -4219,7 +4222,7 @@
42194222
"kmsKeyId": {
42204223
"target": "com.amazonaws.codecommit#KmsKeyId",
42214224
"traits": {
4222-
"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>"
4225+
"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>"
42234226
}
42244227
}
42254228
},
@@ -11528,6 +11531,21 @@
1152811531
"smithy.api#documentation": "<p>Information about the type of an object in a merge operation.</p>"
1152911532
}
1153011533
},
11534+
"com.amazonaws.codecommit#OperationNotAllowedException": {
11535+
"type": "structure",
11536+
"members": {
11537+
"message": {
11538+
"target": "com.amazonaws.codecommit#Message",
11539+
"traits": {
11540+
"smithy.api#documentation": "<p>Any message associated with the exception.</p>"
11541+
}
11542+
}
11543+
},
11544+
"traits": {
11545+
"smithy.api#documentation": "<p>The requested action is not allowed.</p>",
11546+
"smithy.api#error": "client"
11547+
}
11548+
},
1153111549
"com.amazonaws.codecommit#OrderEnum": {
1153211550
"type": "enum",
1153311551
"members": {
@@ -15511,7 +15529,7 @@
1551115529
"kmsKeyId": {
1551215530
"target": "com.amazonaws.codecommit#KmsKeyId",
1551315531
"traits": {
15514-
"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>",
15532+
"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>",
1551515533
"smithy.api#required": {}
1551615534
}
1551715535
}

0 commit comments

Comments
 (0)