Ejemplo n.º 1
0
 /**
  * Upload an existing public key to a new keypair.
  * 
  * @param  array $options
  * @return type
  * @throws KeyPairException
  */
 public function upload(array $options = array())
 {
     if (isset($options['path'])) {
         if (!file_exists($options['path'])) {
             throw new KeyPairException('%s does not exist.');
         }
         $contents = file_get_contents($options['path']);
         $this->setPublicKey($contents);
     } elseif (isset($options['data'])) {
         $this->setPublicKey($options['data']);
     } elseif (!$this->getPublicKey()) {
         throw new KeyPairException('In order to upload a keypair, the public key must be set.');
     }
     return parent::create();
 }
Ejemplo n.º 2
0
 /**
  * Create() returns an asynchronous response
  *
  * @param array $params array of key/value pairs
  * @return AsyncResponse
  */
 public function create($params = array())
 {
     $body = Formatter::decode(parent::create($params));
     return new AsyncResponse($this->getService(), $body);
 }
Ejemplo n.º 3
0
 /**
  * Create() returns an asynchronous response
  *
  * @param array $params array of key/value pairs
  * @return AsyncResponse
  */
 public function create($params = array())
 {
     return new AsyncResponse($this->Service(), parent::create($params)->httpBody());
 }
Ejemplo n.º 4
0
 /**
  * {@inheritDoc}
  */
 public function create($params = array())
 {
     $this->id = null;
     $this->status = null;
     return parent::create($params);
 }