public function describeAddresses(ListDataType $publicIpList = null, ListDataType $allocationIdList = null, AddressFilterList $filter = null)
{
$result = null;
$options = array();
if ($publicIpList !== null) {
$options = array_merge($options, $publicIpList->getQueryArrayBare('PublicIp'));
}
if ($allocationIdList !== null) {
$options = array_merge($options, $allocationIdList->getQueryArrayBare('AllocationId'));
}
if (!empty($filter)) {
$options = array_merge($options, $filter->getQueryArrayBare('Filter'));
}
$response = $this->client->call(ucfirst(__FUNCTION__), $options);
if ($response->getError() === false) {
$sxml = simplexml_load_string($response->getRawContent());
$response = null;
$result = new AddressList();
$result->setEc2($this->ec2);
$result->setRequestId($sxml->requestId);
if (isset($sxml->addressesSet->item)) {
foreach ($sxml->addressesSet->item as $v) {
$item = new AddressData();
$item->setEc2($this->ec2);
$item->allocationId = $this->exist($v->allocationId) ? (string) $v->allocationId : null;
$item->associationId = $this->exist($v->associationId) ? (string) $v->associationId : null;
$item->domain = $this->exist($v->domain) ? (string) $v->domain : null;
$item->instanceId = $this->exist($v->instanceId) ? (string) $v->instanceId : null;
$item->publicIp = $this->exist($v->publicIp) ? (string) $v->publicIp : null;
$item->privateIpAddress = $this->exist($v->privateIpAddress) ? (string) $v->privateIpAddress : null;
$item->networkInterfaceId = $this->exist($v->networkInterfaceId) ? (string) $v->networkInterfaceId : null;
$item->networkInterfaceOwnerId = $this->exist($v->networkInterfaceOwnerId) ? (string) $v->networkInterfaceOwnerId : null;
$result->append($item);
unset($item);
}
}
}
return $result;
}