}
public static final Auth toDataModel(com.alu.e3.prov.restapi.model.Auth authData) {
if (authData==null) throw new IllegalArgumentException("authData must not be null");
Auth auth = new Auth();
auth.setId (authData.getId());
auth.setStatus (toDataModel(authData.getStatus()));
auth.setTdrGenerationRule (toDataModel(authData.getTdr()));
auth.setApiContext (authData.getApiContext());
auth.setPolicyContext (authData.getPolicyContext());
auth.setHeaderTransformation (BeanConverterUtil.<HeaderTransformation, com.alu.e3.prov.restapi.model.HeaderTransformation>toDataModels(authData.getHeaderTransformations()));
for(Key prop : authData.getProperties()){
auth.getProperties().put(prop.getName(), prop.getValue());
}
AuthDetail authDetail = new AuthDetail();
auth.setAuthDetail (authDetail);
authDetail.setType (toDataModel(authData.getType()));
switch(authData.getType()) {
case AUTHKEY:
authDetail.setAuthKeyValue(authData.getAuthKeyAuth().getKeyValue());
break;
case BASIC:
authDetail.setUsername(authData.getBasicAuth().getUsername());
authDetail.setPassword(authData.getBasicAuth().getPassword());
break;
case IP_WHITE_LIST:
authDetail.getWhiteListedIps().addAll(authData.getIpWhiteListAuth().getIp());
break;
case NO_AUTH:
break;
case OAUTH:
authDetail.setClientId(authData.getOAuth().getClientId());
authDetail.setClientSecret(authData.getOAuth().getClientSecret());
break;
case WSSE:
authDetail.setUsername(authData.getWsseAuth().getUsername());
auth.setWssePassword(authData.getWsseAuth().getPassword());
break;
default:
throw new IllegalArgumentException("Unknown authType specified");
}