/** * 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(); }
/** * 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); }
/** * 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()); }
/** * {@inheritDoc} */ public function create($params = array()) { $this->id = null; $this->status = null; return parent::create($params); }