Java Code Examples for org.wso2.carbon.apimgt.impl.APIConstants#API_RESTRICTED_VISIBILITY

The following examples show how to use org.wso2.carbon.apimgt.impl.APIConstants#API_RESTRICTED_VISIBILITY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: APIMappingUtil.java    From carbon-apimgt with Apache License 2.0 5 votes vote down vote up
/**
 * Method to map Visibility APIDTO To API Model
 *
 * @param visibility visibility of the API in APIDTO model
 * @return API visibility
 */
private static String mapVisibilityFromDTOtoAPI(APIDTO.VisibilityEnum visibility) {
    switch (visibility) {
        case PUBLIC:
            return APIConstants.API_GLOBAL_VISIBILITY;
        case PRIVATE:
            return APIConstants.API_PRIVATE_VISIBILITY;
        case RESTRICTED:
            return APIConstants.API_RESTRICTED_VISIBILITY;
        case CONTROLLED:
            return APIConstants.API_CONTROLLED_VISIBILITY;
        default:
            return null;
    }
}
 
Example 2
Source File: APIMappingUtil.java    From carbon-apimgt with Apache License 2.0 5 votes vote down vote up
private static String mapVisibilityFromDTOtoAPI(APIDTO.VisibilityEnum visibility) {

        switch (visibility) {
            case PUBLIC:
                return APIConstants.API_GLOBAL_VISIBILITY;
            case PRIVATE:
                return APIConstants.API_PRIVATE_VISIBILITY;
            case RESTRICTED:
                return APIConstants.API_RESTRICTED_VISIBILITY;
//            case CONTROLLED: todo add to swagger
//                return APIConstants.API_CONTROLLED_VISIBILITY;
            default:
                return null; // how to handle this?
        }
    }
 
Example 3
Source File: APIMappingUtil.java    From carbon-apimgt with Apache License 2.0 5 votes vote down vote up
private static APIDTO.VisibilityEnum mapVisibilityFromAPItoDTO(String visibility) {

        switch (visibility) { //public, private,controlled, restricted
            case APIConstants.API_GLOBAL_VISIBILITY:
                return APIDTO.VisibilityEnum.PUBLIC;
            case APIConstants.API_PRIVATE_VISIBILITY:
                return APIDTO.VisibilityEnum.PRIVATE;
            case APIConstants.API_RESTRICTED_VISIBILITY:
                return APIDTO.VisibilityEnum.RESTRICTED;
//            case APIConstants.API_CONTROLLED_VISIBILITY : todo add this to swagger
//                return APIDTO.VisibilityEnum.CONTROLLED;
            default:
                return null; // how to handle this?
        }
    }
 
Example 4
Source File: APIMappingUtil.java    From carbon-apimgt with Apache License 2.0 5 votes vote down vote up
private static APIProductDTO.VisibilityEnum mapVisibilityFromAPIProducttoDTO(String visibility) {
    switch (visibility) { //public, private,controlled, restricted
        case APIConstants.API_GLOBAL_VISIBILITY :
            return APIProductDTO.VisibilityEnum.PUBLIC;
        case APIConstants.API_PRIVATE_VISIBILITY :
            return APIProductDTO.VisibilityEnum.PRIVATE;
        case APIConstants.API_RESTRICTED_VISIBILITY :
            return APIProductDTO.VisibilityEnum.RESTRICTED;
        default:
            return null; // how to handle this?
    }
}
 
Example 5
Source File: APIMappingUtil.java    From carbon-apimgt with Apache License 2.0 5 votes vote down vote up
private static String mapVisibilityFromDTOtoAPIProduct(APIProductDTO.VisibilityEnum visibility) {
    switch (visibility) {
        case PUBLIC:
            return APIConstants.API_GLOBAL_VISIBILITY;
        case PRIVATE:
            return APIConstants.API_PRIVATE_VISIBILITY;
        case RESTRICTED:
            return APIConstants.API_RESTRICTED_VISIBILITY;
        default:
            return null; // how to handle this?
    }
}