public function allocateAddress($domain = null)
{
$result = null;
$options = array();
if ($domain !== null) {
$options['Domain'] = (string) $domain;
}
$response = $this->client->call(ucfirst(__FUNCTION__), $options);
if ($response->getError() === false) {
$sxml = simplexml_load_string($response->getRawContent());
$result = new AddressData();
$result->setEc2($this->ec2);
$result->domain = (string) $sxml->domain;
$result->publicIp = $this->exist($sxml->publicIp) ? (string) $sxml->publicIp : null;
$result->allocationId = $this->exist($sxml->allocationId) ? (string) $sxml->allocationId : null;
}
return $result;
}