/**
  * @param string $id Optional (do not set for new objects)
  * @param string $parent_id Parent ID for AdAccountGroup is always "me"
  * @param Api $api The Api instance this object should use to make calls
  */
 public function __construct($id = null, $parent_id = null, Api $api = null)
 {
     parent::__construct($id, 'me', $api);
 }
 /**
  * Delete this object from the graph
  *
  * @param array $params
  * @return void
  * @throws \Exception
  */
 public function delete(array $params = array())
 {
     if (!$this->data[AdImageFields::HASH]) {
         throw new \Exception("AdImage hash is required to delete");
     }
     $params = array_merge($params, array('hash' => $this->data[AdImageFields::HASH]));
     parent::delete($params);
 }
 /**
  * @param AbstractCrudObject $subject
  */
 public function assertCannotDelete(AbstractCrudObject $subject)
 {
     $has_throw_exception = false;
     try {
         $subject->delete();
     } catch (\Exception $e) {
         $has_throw_exception = true;
     }
     $this->assertTrue($has_throw_exception);
 }