Search in sources :

Example 1 with MetaRes

use of org.wso2.carbon.identity.api.server.identity.governance.v1.model.MetaRes in project identity-api-server by wso2.

the class ServerIdentityGovernanceService method buildConnectorResDTO.

private ConnectorRes buildConnectorResDTO(ConnectorConfig connectorConfig) {
    ConnectorRes connectorsResDTO = new ConnectorRes();
    connectorsResDTO.setId(Base64.getUrlEncoder().withoutPadding().encodeToString(connectorConfig.getName().getBytes(StandardCharsets.UTF_8)));
    connectorsResDTO.setName(connectorConfig.getName());
    connectorsResDTO.setFriendlyName(connectorConfig.getFriendlyName());
    connectorsResDTO.setCategory(connectorConfig.getCategory());
    connectorsResDTO.setSubCategory(connectorConfig.getSubCategory());
    connectorsResDTO.setOrder(connectorConfig.getOrder());
    List<PropertyRes> properties = new ArrayList<>();
    for (Property property : connectorConfig.getProperties()) {
        PropertyRes propertyRes = new PropertyRes();
        propertyRes.setName(property.getName());
        propertyRes.setValue(property.getValue());
        propertyRes.setDisplayName(property.getDisplayName());
        propertyRes.setDescription(property.getDescription() != null ? property.getDescription() : "");
        MetaRes metaRes = new MetaRes();
        metaRes.setType(property.getType());
        metaRes.setRegex(property.getRegex());
        metaRes.setGroupID(property.getGroupId());
        propertyRes.setMeta(metaRes);
        properties.add(propertyRes);
    }
    connectorsResDTO.setProperties(properties);
    return connectorsResDTO;
}
Also used : ConnectorRes(org.wso2.carbon.identity.api.server.identity.governance.v1.model.ConnectorRes) MetaRes(org.wso2.carbon.identity.api.server.identity.governance.v1.model.MetaRes) ArrayList(java.util.ArrayList) Property(org.wso2.carbon.identity.application.common.model.Property) PropertyRes(org.wso2.carbon.identity.api.server.identity.governance.v1.model.PropertyRes)

Aggregations

ArrayList (java.util.ArrayList)1 ConnectorRes (org.wso2.carbon.identity.api.server.identity.governance.v1.model.ConnectorRes)1 MetaRes (org.wso2.carbon.identity.api.server.identity.governance.v1.model.MetaRes)1 PropertyRes (org.wso2.carbon.identity.api.server.identity.governance.v1.model.PropertyRes)1 Property (org.wso2.carbon.identity.application.common.model.Property)1