# Number of lines of code in new: 30
sub new {
my ($class, %args) = @_;
$class = ref($class) || $class;
my $validatorList = [];
$validatorList = [
new Com::Vmware::Vapi::Data::UnionValidator(
'discriminant_name' => 'type',
'case_map' => {
'FILE' => ['file_name'],
'REMOTE' => ['remote_addr', 'msg_protocol'],
}),
];
my $self = $class->SUPER::new('validator_list' => $validatorList, %args);
$self->{type} = $args{'type'};
$self->{file_name} = $args{'file_name'};
$self->{remote_addr} = $args{'remote_addr'};
$self->{msg_protocol} = $args{'msg_protocol'};
$self->set_binding_class('binding_class' => 'Com::Vmware::Vapi::Metadata::SourceInfo');
$self->set_binding_name('name' => 'com.vmware.vapi.metadata.source_info');
$self->set_binding_field('key' => 'type', 'value' => new Com::Vmware::Vapi::Bindings::Type::ReferenceType('module_ctx' => 'Com::Vmware::Vapi::Metadata', 'type_name' => 'SourceType'));
$self->set_binding_field('key' => 'file_name', 'value' => new Com::Vmware::Vapi::Bindings::Type::OptionalType('element_type' => new Com::Vmware::Vapi::Bindings::Type::StringType()));
$self->set_binding_field('key' => 'remote_addr', 'value' => new Com::Vmware::Vapi::Bindings::Type::OptionalType('element_type' => new Com::Vmware::Vapi::Bindings::Type::StringType()));
$self->set_binding_field('key' => 'msg_protocol', 'value' => new Com::Vmware::Vapi::Bindings::Type::OptionalType('element_type' => new Com::Vmware::Vapi::Bindings::Type::StringType()));
bless $self, $class;
return $self;
}