Search in sources :

Example 1 with APIMetaDataDTO

use of org.wso2.carbon.apimgt.rest.api.gateway.dto.APIMetaDataDTO in project carbon-apimgt by wso2.

the class GatewayUtils method generateAPIListDTO.

public static APIListDTO generateAPIListDTO(List<API> apiList) {
    APIListDTO apiListDTO = new APIListDTO();
    List<APIMetaDataDTO> apiMetaDataDTOList = new ArrayList<>();
    for (API api : apiList) {
        APIMetaDataDTO apiMetaDataDTO = new APIMetaDataDTO().apiId(api.getApiId()).name(api.getApiName()).version(api.getApiVersion()).apiUUID(api.getUuid()).apiType(api.getApiType()).provider(api.getApiProvider()).context(api.getContext()).isDefaultVersion(api.isDefaultVersion()).name(api.getApiName()).policy(api.getApiTier()).apiType(api.getApiType());
        apiMetaDataDTOList.add(apiMetaDataDTO);
    }
    apiListDTO.setList(apiMetaDataDTOList);
    apiListDTO.count(apiMetaDataDTOList.size());
    return apiListDTO;
}
Also used : ArrayList(java.util.ArrayList) APIListDTO(org.wso2.carbon.apimgt.rest.api.gateway.dto.APIListDTO) APIMetaDataDTO(org.wso2.carbon.apimgt.rest.api.gateway.dto.APIMetaDataDTO) API(org.wso2.carbon.apimgt.keymgt.model.entity.API)

Aggregations

ArrayList (java.util.ArrayList)1 API (org.wso2.carbon.apimgt.keymgt.model.entity.API)1 APIListDTO (org.wso2.carbon.apimgt.rest.api.gateway.dto.APIListDTO)1 APIMetaDataDTO (org.wso2.carbon.apimgt.rest.api.gateway.dto.APIMetaDataDTO)1