public function describeNetworkInterfaceAttribute($networkInterfaceId, NetworkInterfaceAttributeType $attribute)
{
$result = null;
$options = array('NetworkInterfaceId' => (string) $networkInterfaceId, 'Attribute' => (string) $attribute);
$action = ucfirst(__FUNCTION__);
$response = $this->client->call($action, $options);
if ($response->getError() === false) {
$sxml = simplexml_load_string($response->getRawContent());
$response = null;
$ptr = $sxml->{$options['Attribute']};
$entity = $this->ec2->getEntityManagerEnabled() ? $this->ec2->networkInterface->get($options['NetworkInterfaceId']) : null;
switch ($options['Attribute']) {
case NetworkInterfaceAttributeType::ATTR_DESCRIPTION:
$result = (string) $ptr->value;
break;
case NetworkInterfaceAttributeType::ATTR_SOURCE_DEST_CHECK:
$result = (string) $ptr->value == 'true';
break;
case NetworkInterfaceAttributeType::ATTR_ATTACHMENT:
$result = $this->_loadNetworkInterfaceAttachmentData($ptr);
break;
case NetworkInterfaceAttributeType::ATTR_GROUP_SET:
$result = $this->_loadGroupList($ptr);
break;
default:
throw new \InvalidArgumentException(sprintf('Unexpected attribute "%s" in %s call', $options['Attribute'], $action));
}
if ($entity !== null) {
$entity->{$options['Attribute']} = $result;
}
}
return $result;
}