# Number of lines of code in new: 28
sub new {
my ($class, %args) = @_;
$class = ref($class) || $class;
my $validatorList = [];
$validatorList = [
new Com::Vmware::Vapi::Data::UnionValidator(
'discriminant_name' => 'category',
'case_map' => {
'PRIMITIVE' => ['primitive_value'],
'LIST' => ['list_value'],
}),
];
my $self = $class->SUPER::new('validator_list' => $validatorList, %args);
$self->{category} = $args{'category'};
$self->{primitive_value} = $args{'primitive_value'};
$self->{list_value} = $args{'list_value'};
$self->set_binding_class('binding_class' => 'Com::Vmware::Vapi::Metadata::Metamodel::ConstantValue');
$self->set_binding_name('name' => 'com.vmware.vapi.metadata.metamodel.constant_value');
$self->set_binding_field('key' => 'category', 'value' => new Com::Vmware::Vapi::Bindings::Type::ReferenceType('module_ctx' => 'Com::Vmware::Vapi::Metadata::Metamodel', 'type_name' => 'ConstantValue::Category'));
$self->set_binding_field('key' => 'primitive_value', 'value' => new Com::Vmware::Vapi::Bindings::Type::OptionalType('element_type' => new Com::Vmware::Vapi::Bindings::Type::ReferenceType('module_ctx' => 'Com::Vmware::Vapi::Metadata::Metamodel', 'type_name' => 'PrimitiveValue')));
$self->set_binding_field('key' => 'list_value', 'value' => new Com::Vmware::Vapi::Bindings::Type::OptionalType('element_type' => new Com::Vmware::Vapi::Bindings::Type::ListType(new Com::Vmware::Vapi::Bindings::Type::ReferenceType('module_ctx' => 'Com::Vmware::Vapi::Metadata::Metamodel', 'type_name' => 'PrimitiveValue'))));
bless $self, $class;
return $self;
}