| @@ 219-233 (lines=15) @@ | ||
| 216 | * |
|
| 217 | * @since 1.0 |
|
| 218 | */ |
|
| 219 | public function markReadThread($id, $unread = true, $read = true) |
|
| 220 | { |
|
| 221 | // Build the request path. |
|
| 222 | $path = '/notifications/threads/' . $id; |
|
| 223 | ||
| 224 | $data = array( |
|
| 225 | 'unread' => $unread, |
|
| 226 | 'read' => $read |
|
| 227 | ); |
|
| 228 | ||
| 229 | return $this->processResponse( |
|
| 230 | $this->client->patch($this->fetchUrl($path), json_encode($data)), |
|
| 231 | 205 |
|
| 232 | ); |
|
| 233 | } |
|
| 234 | ||
| 235 | /** |
|
| 236 | * Get a Thread Subscription. |
|
| @@ 37-53 (lines=17) @@ | ||
| 34 | * @since 1.0 |
|
| 35 | * @throws \DomainException |
|
| 36 | */ |
|
| 37 | public function create($files, $public = false, $description = null) |
|
| 38 | { |
|
| 39 | // Build the request path. |
|
| 40 | $path = '/gists'; |
|
| 41 | ||
| 42 | // Build the request data. |
|
| 43 | $data = json_encode( |
|
| 44 | array( |
|
| 45 | 'files' => $this->buildFileData((array) $files), |
|
| 46 | 'public' => (bool) $public, |
|
| 47 | 'description' => $description |
|
| 48 | ) |
|
| 49 | ); |
|
| 50 | ||
| 51 | // Send the request. |
|
| 52 | return $this->processResponse($this->client->post($this->fetchUrl($path), $data), 201); |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * Delete a gist. |
|