protected function getClientId($client)
    {
        if ($client instanceof Client) {
            if (!empty($client->id)) {
                $id = $client->id;
            } elseif (!empty($client->email)) {
                $id = $this->api->searchClientId($client->email);
            } else {
                throw new YouHostingException("You need to provide either a client ID (recommended) or client e-mail to search for");
            }
        } elseif (is_numeric($client)) {
            $id = $client;
        } else {
            $id = $this->api->searchClientId($client);
        }

        return (int)$id;
    }