|
6 | 6 | use ApiClients\Client\Github\CommandBus\Command\Repository\AddLabelCommand; |
7 | 7 | use ApiClients\Client\Github\CommandBus\Command\Repository\AddWebHookCommand; |
8 | 8 | use ApiClients\Client\Github\CommandBus\Command\Repository\AppVeyorCommand; |
| 9 | +use ApiClients\Client\Github\CommandBus\Command\Repository\BlobCommand; |
9 | 10 | use ApiClients\Client\Github\CommandBus\Command\Repository\BranchesCommand; |
| 11 | +use ApiClients\Client\Github\CommandBus\Command\Repository\CommitCommand; |
10 | 12 | use ApiClients\Client\Github\CommandBus\Command\Repository\CommitsCommand; |
11 | 13 | use ApiClients\Client\Github\CommandBus\Command\Repository\CommunityHealthCommand; |
12 | 14 | use ApiClients\Client\Github\CommandBus\Command\Repository\Contents\FileUploadCommand; |
13 | 15 | use ApiClients\Client\Github\CommandBus\Command\Repository\ContentsCommand; |
14 | 16 | use ApiClients\Client\Github\CommandBus\Command\Repository\LabelsCommand; |
15 | 17 | use ApiClients\Client\Github\CommandBus\Command\Repository\LanguagesCommand; |
| 18 | +use ApiClients\Client\Github\CommandBus\Command\Repository\RefsCommand; |
16 | 19 | use ApiClients\Client\Github\CommandBus\Command\Repository\ReleasesCommand; |
17 | 20 | use ApiClients\Client\Github\CommandBus\Command\Repository\ReplaceTopicsCommand; |
18 | 21 | use ApiClients\Client\Github\CommandBus\Command\Repository\ScrutinizerCommand; |
19 | 22 | use ApiClients\Client\Github\CommandBus\Command\Repository\SubscribeCommand; |
20 | 23 | use ApiClients\Client\Github\CommandBus\Command\Repository\TagsCommand; |
21 | 24 | use ApiClients\Client\Github\CommandBus\Command\Repository\TravisCommand; |
| 25 | +use ApiClients\Client\Github\CommandBus\Command\Repository\TreeCommand; |
22 | 26 | use ApiClients\Client\Github\CommandBus\Command\Repository\UnSubscribeCommand; |
23 | 27 | use ApiClients\Client\Github\CommandBus\Command\Repository\UpdateSettingsCommand; |
24 | 28 | use ApiClients\Client\Github\CommandBus\Command\WebHooksCommand; |
| 29 | +use ApiClients\Client\Github\Resource\Git\TreeInterface; |
25 | 30 | use ApiClients\Client\Github\Resource\Repository as BaseRepository; |
| 31 | +use ApiClients\Client\Github\VO\NamedBlob; |
26 | 32 | use function ApiClients\Tools\Rx\unwrapObservableFromPromise; |
27 | 33 | use React\Promise\PromiseInterface; |
28 | 34 | use React\Stream\ReadableStreamInterface; |
@@ -191,4 +197,26 @@ public function updateSettings(array $settings): PromiseInterface |
191 | 197 |
|
192 | 198 | return $this->handleCommand(new UpdateSettingsCommand($this->fullName(), $settings)); |
193 | 199 | } |
| 200 | + |
| 201 | + public function blob(ReadableStreamInterface $contents): PromiseInterface |
| 202 | + { |
| 203 | + return $this->handleCommand(new BlobCommand($this->fullName(), $contents)); |
| 204 | + } |
| 205 | + |
| 206 | + public function tree(?string $baseTree, NamedBlob ...$blobs): PromiseInterface |
| 207 | + { |
| 208 | + return $this->handleCommand(new TreeCommand($this->fullName(), $baseTree, ...$blobs)); |
| 209 | + } |
| 210 | + |
| 211 | + public function commit(string $message, TreeInterface $tree, ?string ...$baseCommits): PromiseInterface |
| 212 | + { |
| 213 | + return $this->handleCommand(new CommitCommand($this->fullName(), $message, $tree->sha(), ...$baseCommits)); |
| 214 | + } |
| 215 | + |
| 216 | + public function refs(?string $namespace = null): ObservableInterface |
| 217 | + { |
| 218 | + return unwrapObservableFromPromise($this->handleCommand( |
| 219 | + new RefsCommand($this->fullName(), $namespace) |
| 220 | + )); |
| 221 | + } |
194 | 222 | } |
0 commit comments