/**
  * Get the activity from the previous operation.
  *
  * @return Activity|false
  */
 public function getLastActivity()
 {
     if (!isset($this->data['_embedded']['activities'][0])) {
         return false;
     }
     return Activity::wrap($this->data['_embedded']['activities'][0], $this->baseUrl, $this->client);
 }
 /**
  * Run a long-running operation.
  *
  * @param string $op
  * @param string $method
  * @param array  $body
  *
  * @throws \Exception
  *
  * @return Activity
  */
 protected function runLongOperation($op, $method = 'post', array $body = [])
 {
     $data = $this->runOperation($op, $method, $body);
     if (!isset($data['_embedded']['activities'][0])) {
         throw new \Exception('Expected activity not found');
     }
     return Activity::wrap($data['_embedded']['activities'][0], $this->baseUrl, $this->client);
 }