# Number of lines of code in new: 31
sub new {
my ($class, %args) = @_;
$class = ref($class) || $class;
my $validatorList = [];
$validatorList = [
new Com::Vmware::Vapi::Data::UnionValidator(
'discriminant_name' => 'type',
'case_map' => {
'ISO_FILE' => ['iso_file'],
'HOST_DEVICE' => ['host_device', 'device_access_type'],
'CLIENT_DEVICE' => ['device_access_type'],
}),
];
my $self = $class->SUPER::new('validator_list' => $validatorList, %args);
$self->{type} = $args{'type'};
$self->{iso_file} = $args{'iso_file'};
$self->{host_device} = $args{'host_device'};
$self->{device_access_type} = $args{'device_access_type'};
$self->set_binding_class('binding_class' => 'Com::Vmware::Vcenter::Vm::Hardware::Cdrom::BackingSpec');
$self->set_binding_name('name' => 'com.vmware.vcenter.vm.hardware.cdrom.backing_spec');
$self->set_binding_field('key' => 'type', 'value' => new Com::Vmware::Vapi::Bindings::Type::ReferenceType('module_ctx' => 'Com::Vmware::Vcenter::Vm::Hardware', 'type_name' => 'Cdrom::BackingType'));
$self->set_binding_field('key' => 'iso_file', 'value' => new Com::Vmware::Vapi::Bindings::Type::OptionalType('element_type' => new Com::Vmware::Vapi::Bindings::Type::StringType()));
$self->set_binding_field('key' => 'host_device', 'value' => new Com::Vmware::Vapi::Bindings::Type::OptionalType('element_type' => new Com::Vmware::Vapi::Bindings::Type::StringType()));
$self->set_binding_field('key' => 'device_access_type', 'value' => new Com::Vmware::Vapi::Bindings::Type::OptionalType('element_type' => new Com::Vmware::Vapi::Bindings::Type::ReferenceType('module_ctx' => 'Com::Vmware::Vcenter::Vm::Hardware', 'type_name' => 'Cdrom::DeviceAccessType')));
bless $self, $class;
return $self;
}