| @@ 97-115 (lines=19) @@ | ||
| 94 | * |
|
| 95 | * @return object |
|
| 96 | */ |
|
| 97 | public function create($owner, $repo, $tree, $base_tree = '') |
|
| 98 | { |
|
| 99 | // Build the request path. |
|
| 100 | $path = '/repos/' . $owner . '/' . $repo . '/git/trees'; |
|
| 101 | ||
| 102 | $data = array(); |
|
| 103 | ||
| 104 | $data['tree'] = $tree; |
|
| 105 | ||
| 106 | if ($base_tree) |
|
| 107 | { |
|
| 108 | $data['base_tree'] = $base_tree; |
|
| 109 | } |
|
| 110 | ||
| 111 | return $this->processResponse( |
|
| 112 | $this->client->post($this->fetchUrl($path), json_encode($data)), |
|
| 113 | 201 |
|
| 114 | ); |
|
| 115 | } |
|
| 116 | } |
|
| 117 | ||
| @@ 299-315 (lines=17) @@ | ||
| 296 | * |
|
| 297 | * @since 1.4.0 |
|
| 298 | */ |
|
| 299 | public function editAsset($user, $repo, $assetId, $name, $label = '') |
|
| 300 | { |
|
| 301 | // Build the request path. |
|
| 302 | $path = '/repos/' . $user . '/' . $repo . '/releases/assets/' . (int) $assetId; |
|
| 303 | ||
| 304 | $data = array( |
|
| 305 | 'name' => $name, |
|
| 306 | ); |
|
| 307 | ||
| 308 | if ($label) |
|
| 309 | { |
|
| 310 | $data['label'] = $label; |
|
| 311 | } |
|
| 312 | ||
| 313 | // Send the request. |
|
| 314 | return $this->processResponse($this->client->patch($this->fetchUrl($path), json_encode($data))); |
|
| 315 | } |
|
| 316 | ||
| 317 | /** |
|
| 318 | * Delete a release asset. |
|