| @@ 22-30 (lines=9) @@ | ||
| 19 | * @return Mail|string |
|
| 20 | * @throws \Exception |
|
| 21 | */ |
|
| 22 | public function addLabels( array $labels ) |
|
| 23 | { |
|
| 24 | $this->messageRequest->setAddLabelIds( $labels ); |
|
| 25 | try { |
|
| 26 | return $this->modify(); |
|
| 27 | } catch ( \Exception $e ) { |
|
| 28 | throw new \Exception( "Couldn't mark email as unread: {$e->getMessage()}" ); |
|
| 29 | } |
|
| 30 | } |
|
| 31 | ||
| 32 | /** |
|
| 33 | * @param array $labels |
|
| @@ 38-46 (lines=9) @@ | ||
| 35 | * @return Mail|string |
|
| 36 | * @throws \Exception |
|
| 37 | */ |
|
| 38 | public function removeLabels( array $labels ) |
|
| 39 | { |
|
| 40 | $this->messageRequest->setRemoveLabelIds( $labels ); |
|
| 41 | try { |
|
| 42 | return $this->modify(); |
|
| 43 | } catch ( \Exception $e ) { |
|
| 44 | throw new \Exception( "Couldn't remove mark email as important.: {$e->getMessage()}" ); |
|
| 45 | } |
|
| 46 | } |
|
| 47 | ||
| 48 | /** |
|
| 49 | * Adds a single label to the request |
|