public function add(array $parameters)
    {
        if (!array_key_exists('name', $parameters) || !is_string($parameters['name'])) {
            throw new \InvalidArgumentException('You need to provide the name of the SSH Key.');
        }

        if (!array_key_exists('ssh_pub_key', $parameters) || !is_string($parameters['ssh_pub_key'])) {
            throw new \InvalidArgumentException('You need to provide the SSH key.');
        }

        return $this->processQuery($this->buildQuery(null, SSHKeysActions::ACTION_ADD, $parameters));
    }
public function add(array $parameters)
    {
        if (!array_key_exists('name', $parameters) || !is_string($parameters['name'])) {
            throw new \InvalidArgumentException('You need to provide the name of the SSH Key.');
        }

        if (!array_key_exists('ssh_pub_key', $parameters) || !is_string($parameters['ssh_pub_key'])) {
            throw new \InvalidArgumentException('You need to provide the SSH key.');
        }

        return $this->processQuery($this->buildQuery(null, SSHKeysActions::ACTION_ADD, $parameters));
    }
public function add ( array $ parameters ) { if ( ! array_key_exists ( 'name' , $ parameters ) || ! is_string ( $ parameters [ 'name' ] ) ) { throw new \ InvalidArgumentException ( 'You need to provide the name of the SSH Key.' ) ; } if ( ! array_key_exists ( 'ssh_pub_key' , $ parameters ) || ! is_string ( $ parameters [ 'ssh_pub_key' ] ) ) { throw new \ InvalidArgumentException ( 'You need to provide the SSH key.' ) ; } return $ this -> processQuery ( $ this -> buildQuery ( null , SSHKeysActions :: ACTION_ADD , $ parameters ) ) ; }
Adds a new public SSH key to your account.
The array requires name and ssh_pub_key keys.

@param array $parameters An array of parameters.

@return StdClass

@throws \InvalidArgumentException
Adds a new public SSH key to your account . The array requires name and ssh_pub_key keys .