|
2 | 2 |
|
3 | 3 | namespace AsyncAws\CodeCommit;
|
4 | 4 |
|
| 5 | +use AsyncAws\CodeCommit\Enum\OrderEnum; |
| 6 | +use AsyncAws\CodeCommit\Enum\SortByEnum; |
5 | 7 | use AsyncAws\CodeCommit\Exception\BlobIdDoesNotExistException;
|
6 | 8 | use AsyncAws\CodeCommit\Exception\BlobIdRequiredException;
|
7 | 9 | use AsyncAws\CodeCommit\Exception\BranchDoesNotExistException;
|
|
22 | 24 | use AsyncAws\CodeCommit\Exception\InvalidCommitIdException;
|
23 | 25 | use AsyncAws\CodeCommit\Exception\InvalidContinuationTokenException;
|
24 | 26 | use AsyncAws\CodeCommit\Exception\InvalidMaxResultsException;
|
| 27 | +use AsyncAws\CodeCommit\Exception\InvalidOrderException; |
25 | 28 | use AsyncAws\CodeCommit\Exception\InvalidPathException;
|
| 29 | +use AsyncAws\CodeCommit\Exception\InvalidRepositoryDescriptionException; |
26 | 30 | use AsyncAws\CodeCommit\Exception\InvalidRepositoryNameException;
|
27 | 31 | use AsyncAws\CodeCommit\Exception\InvalidRepositoryTriggerBranchNameException;
|
28 | 32 | use AsyncAws\CodeCommit\Exception\InvalidRepositoryTriggerCustomDataException;
|
29 | 33 | use AsyncAws\CodeCommit\Exception\InvalidRepositoryTriggerDestinationArnException;
|
30 | 34 | use AsyncAws\CodeCommit\Exception\InvalidRepositoryTriggerEventsException;
|
31 | 35 | use AsyncAws\CodeCommit\Exception\InvalidRepositoryTriggerNameException;
|
32 | 36 | use AsyncAws\CodeCommit\Exception\InvalidRepositoryTriggerRegionException;
|
| 37 | +use AsyncAws\CodeCommit\Exception\InvalidSortByException; |
| 38 | +use AsyncAws\CodeCommit\Exception\InvalidSystemTagUsageException; |
| 39 | +use AsyncAws\CodeCommit\Exception\InvalidTagsMapException; |
33 | 40 | use AsyncAws\CodeCommit\Exception\MaximumBranchesExceededException;
|
34 | 41 | use AsyncAws\CodeCommit\Exception\MaximumRepositoryTriggersExceededException;
|
35 | 42 | use AsyncAws\CodeCommit\Exception\PathDoesNotExistException;
|
36 | 43 | use AsyncAws\CodeCommit\Exception\RepositoryDoesNotExistException;
|
| 44 | +use AsyncAws\CodeCommit\Exception\RepositoryLimitExceededException; |
| 45 | +use AsyncAws\CodeCommit\Exception\RepositoryNameExistsException; |
37 | 46 | use AsyncAws\CodeCommit\Exception\RepositoryNameRequiredException;
|
38 | 47 | use AsyncAws\CodeCommit\Exception\RepositoryTriggerBranchNameListRequiredException;
|
39 | 48 | use AsyncAws\CodeCommit\Exception\RepositoryTriggerDestinationArnRequiredException;
|
40 | 49 | use AsyncAws\CodeCommit\Exception\RepositoryTriggerEventsListRequiredException;
|
41 | 50 | use AsyncAws\CodeCommit\Exception\RepositoryTriggerNameRequiredException;
|
42 | 51 | use AsyncAws\CodeCommit\Exception\RepositoryTriggersListRequiredException;
|
| 52 | +use AsyncAws\CodeCommit\Exception\TagPolicyException; |
| 53 | +use AsyncAws\CodeCommit\Exception\TooManyTagsException; |
| 54 | +use AsyncAws\CodeCommit\Input\CreateRepositoryInput; |
| 55 | +use AsyncAws\CodeCommit\Input\DeleteRepositoryInput; |
43 | 56 | use AsyncAws\CodeCommit\Input\GetBlobInput;
|
44 | 57 | use AsyncAws\CodeCommit\Input\GetBranchInput;
|
45 | 58 | use AsyncAws\CodeCommit\Input\GetCommitInput;
|
46 | 59 | use AsyncAws\CodeCommit\Input\GetDifferencesInput;
|
| 60 | +use AsyncAws\CodeCommit\Input\ListRepositoriesInput; |
47 | 61 | use AsyncAws\CodeCommit\Input\PutRepositoryTriggersInput;
|
| 62 | +use AsyncAws\CodeCommit\Result\CreateRepositoryOutput; |
| 63 | +use AsyncAws\CodeCommit\Result\DeleteRepositoryOutput; |
48 | 64 | use AsyncAws\CodeCommit\Result\GetBlobOutput;
|
49 | 65 | use AsyncAws\CodeCommit\Result\GetBranchOutput;
|
50 | 66 | use AsyncAws\CodeCommit\Result\GetCommitOutput;
|
51 | 67 | use AsyncAws\CodeCommit\Result\GetDifferencesOutput;
|
| 68 | +use AsyncAws\CodeCommit\Result\ListRepositoriesOutput; |
52 | 69 | use AsyncAws\CodeCommit\Result\PutRepositoryTriggersOutput;
|
53 | 70 | use AsyncAws\CodeCommit\ValueObject\RepositoryTrigger;
|
54 | 71 | use AsyncAws\Core\AbstractApi;
|
|
59 | 76 |
|
60 | 77 | class CodeCommitClient extends AbstractApi
|
61 | 78 | {
|
| 79 | + /** |
| 80 | + * Creates a new, empty repository. |
| 81 | + * |
| 82 | + * @see https://docs.aws.amazon.com/codecommit/latest/APIReference/API_CreateRepository.html |
| 83 | + * @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-codecommit-2015-04-13.html#createrepository |
| 84 | + * |
| 85 | + * @param array{ |
| 86 | + * repositoryName: string, |
| 87 | + * repositoryDescription?: string, |
| 88 | + * tags?: array<string, string>, |
| 89 | + * @region?: string, |
| 90 | + * }|CreateRepositoryInput $input |
| 91 | + * |
| 92 | + * @throws RepositoryNameExistsException |
| 93 | + * @throws RepositoryNameRequiredException |
| 94 | + * @throws InvalidRepositoryNameException |
| 95 | + * @throws InvalidRepositoryDescriptionException |
| 96 | + * @throws RepositoryLimitExceededException |
| 97 | + * @throws EncryptionIntegrityChecksFailedException |
| 98 | + * @throws EncryptionKeyAccessDeniedException |
| 99 | + * @throws EncryptionKeyDisabledException |
| 100 | + * @throws EncryptionKeyNotFoundException |
| 101 | + * @throws EncryptionKeyUnavailableException |
| 102 | + * @throws InvalidTagsMapException |
| 103 | + * @throws TooManyTagsException |
| 104 | + * @throws InvalidSystemTagUsageException |
| 105 | + * @throws TagPolicyException |
| 106 | + */ |
| 107 | + public function createRepository($input): CreateRepositoryOutput |
| 108 | + { |
| 109 | + $input = CreateRepositoryInput::create($input); |
| 110 | + $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'CreateRepository', 'region' => $input->getRegion(), 'exceptionMapping' => [ |
| 111 | + 'RepositoryNameExistsException' => RepositoryNameExistsException::class, |
| 112 | + 'RepositoryNameRequiredException' => RepositoryNameRequiredException::class, |
| 113 | + 'InvalidRepositoryNameException' => InvalidRepositoryNameException::class, |
| 114 | + 'InvalidRepositoryDescriptionException' => InvalidRepositoryDescriptionException::class, |
| 115 | + 'RepositoryLimitExceededException' => RepositoryLimitExceededException::class, |
| 116 | + 'EncryptionIntegrityChecksFailedException' => EncryptionIntegrityChecksFailedException::class, |
| 117 | + 'EncryptionKeyAccessDeniedException' => EncryptionKeyAccessDeniedException::class, |
| 118 | + 'EncryptionKeyDisabledException' => EncryptionKeyDisabledException::class, |
| 119 | + 'EncryptionKeyNotFoundException' => EncryptionKeyNotFoundException::class, |
| 120 | + 'EncryptionKeyUnavailableException' => EncryptionKeyUnavailableException::class, |
| 121 | + 'InvalidTagsMapException' => InvalidTagsMapException::class, |
| 122 | + 'TooManyTagsException' => TooManyTagsException::class, |
| 123 | + 'InvalidSystemTagUsageException' => InvalidSystemTagUsageException::class, |
| 124 | + 'TagPolicyException' => TagPolicyException::class, |
| 125 | + ]])); |
| 126 | + |
| 127 | + return new CreateRepositoryOutput($response); |
| 128 | + } |
| 129 | + |
| 130 | + /** |
| 131 | + * Deletes a repository. If a specified repository was already deleted, a null repository ID is returned. |
| 132 | + * |
| 133 | + * @see https://docs.aws.amazon.com/codecommit/latest/APIReference/API_DeleteRepository.html |
| 134 | + * @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-codecommit-2015-04-13.html#deleterepository |
| 135 | + * |
| 136 | + * @param array{ |
| 137 | + * repositoryName: string, |
| 138 | + * @region?: string, |
| 139 | + * }|DeleteRepositoryInput $input |
| 140 | + * |
| 141 | + * @throws RepositoryNameRequiredException |
| 142 | + * @throws InvalidRepositoryNameException |
| 143 | + * @throws EncryptionIntegrityChecksFailedException |
| 144 | + * @throws EncryptionKeyAccessDeniedException |
| 145 | + * @throws EncryptionKeyDisabledException |
| 146 | + * @throws EncryptionKeyNotFoundException |
| 147 | + * @throws EncryptionKeyUnavailableException |
| 148 | + */ |
| 149 | + public function deleteRepository($input): DeleteRepositoryOutput |
| 150 | + { |
| 151 | + $input = DeleteRepositoryInput::create($input); |
| 152 | + $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'DeleteRepository', 'region' => $input->getRegion(), 'exceptionMapping' => [ |
| 153 | + 'RepositoryNameRequiredException' => RepositoryNameRequiredException::class, |
| 154 | + 'InvalidRepositoryNameException' => InvalidRepositoryNameException::class, |
| 155 | + 'EncryptionIntegrityChecksFailedException' => EncryptionIntegrityChecksFailedException::class, |
| 156 | + 'EncryptionKeyAccessDeniedException' => EncryptionKeyAccessDeniedException::class, |
| 157 | + 'EncryptionKeyDisabledException' => EncryptionKeyDisabledException::class, |
| 158 | + 'EncryptionKeyNotFoundException' => EncryptionKeyNotFoundException::class, |
| 159 | + 'EncryptionKeyUnavailableException' => EncryptionKeyUnavailableException::class, |
| 160 | + ]])); |
| 161 | + |
| 162 | + return new DeleteRepositoryOutput($response); |
| 163 | + } |
| 164 | + |
62 | 165 | /**
|
63 | 166 | * Returns the base-64 encoded content of an individual blob in a repository.
|
64 | 167 | *
|
@@ -253,6 +356,35 @@ public function getDifferences($input): GetDifferencesOutput
|
253 | 356 | return new GetDifferencesOutput($response, $this, $input);
|
254 | 357 | }
|
255 | 358 |
|
| 359 | + /** |
| 360 | + * Gets information about one or more repositories. |
| 361 | + * |
| 362 | + * @see https://docs.aws.amazon.com/codecommit/latest/APIReference/API_ListRepositories.html |
| 363 | + * @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-codecommit-2015-04-13.html#listrepositories |
| 364 | + * |
| 365 | + * @param array{ |
| 366 | + * nextToken?: string, |
| 367 | + * sortBy?: SortByEnum::*, |
| 368 | + * order?: OrderEnum::*, |
| 369 | + * @region?: string, |
| 370 | + * }|ListRepositoriesInput $input |
| 371 | + * |
| 372 | + * @throws InvalidSortByException |
| 373 | + * @throws InvalidOrderException |
| 374 | + * @throws InvalidContinuationTokenException |
| 375 | + */ |
| 376 | + public function listRepositories($input = []): ListRepositoriesOutput |
| 377 | + { |
| 378 | + $input = ListRepositoriesInput::create($input); |
| 379 | + $response = $this->getResponse($input->request(), new RequestContext(['operation' => 'ListRepositories', 'region' => $input->getRegion(), 'exceptionMapping' => [ |
| 380 | + 'InvalidSortByException' => InvalidSortByException::class, |
| 381 | + 'InvalidOrderException' => InvalidOrderException::class, |
| 382 | + 'InvalidContinuationTokenException' => InvalidContinuationTokenException::class, |
| 383 | + ]])); |
| 384 | + |
| 385 | + return new ListRepositoriesOutput($response, $this, $input); |
| 386 | + } |
| 387 | + |
256 | 388 | /**
|
257 | 389 | * Replaces all triggers for a repository. Used to create or delete triggers.
|
258 | 390 | *
|
|
0 commit comments