public static void validateAdd(OpenstackVolumeAuthenticationKey key) { if (key == null) { throw new ValidationException("Parameter 'key' is mandatory but was not provided."); } if (key.getUsageType()==null) { throw new ValidationException("Parameter 'key.usage_type' is mandatory but was not provided."); } if (key.getUuid()==null) { throw new ValidationException("Parameter 'key.uuid' is mandatory but was not provided."); } if (key.getValue()==null) { throw new ValidationException("Parameter 'key.value' is mandatory but was not provided."); } }
@Mapping(from = OpenstackVolumeAuthenticationKey.class, to = LibvirtSecret.class) public static LibvirtSecret map(OpenstackVolumeAuthenticationKey model, LibvirtSecret template) { LibvirtSecret entity = template != null ? template : new LibvirtSecret(); if (model.isSetId()) { entity.setId(GuidUtils.asGuid(model.getId())); } if (model.isSetUuid()) { entity.setId(GuidUtils.asGuid(model.getUuid())); } if (model.isSetDescription()) { entity.setDescription(model.getDescription()); } if (model.isSetValue()) { entity.setValue(model.getValue()); } if (model.isSetUsageType()) { entity.setUsageType(map(model.getUsageType(), null)); } if (model.isSetOpenstackVolumeProvider() && model.getOpenstackVolumeProvider().isSetId()) { entity.setProviderId(GuidUtils.asGuid(model.getOpenstackVolumeProvider().getId())); } return entity; }
to.setValue(from.getValue());