use of org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.MockResponsePayloadInfoDTO in project carbon-apimgt by wso2.
the class APIMappingUtil method fromMockPayloadToDTO.
/**
* This method creates object of MockPayloadDTO.
*
* @param model APIResourceMediationPolicy object
* @return mockResponsePayloadInfoDTO object
*/
public static MockResponsePayloadInfoDTO fromMockPayloadToDTO(APIResourceMediationPolicy model) {
MockResponsePayloadInfoDTO mockResponsePayloadInfoDTO = new MockResponsePayloadInfoDTO();
mockResponsePayloadInfoDTO.setPath(model.getPath());
mockResponsePayloadInfoDTO.setVerb(model.getVerb());
mockResponsePayloadInfoDTO.setContent(model.getContent());
return mockResponsePayloadInfoDTO;
}
use of org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.MockResponsePayloadInfoDTO in project carbon-apimgt by wso2.
the class APIMappingUtil method fromMockPayloadsToListDTO.
/**
* This method creates the list of MockPayloadDTO objects for resetting inline prototyping scripts.
*
* @param mockPayloads APIResourceMediationPolicy List
* @return mockResponsePayloadListDTO (list of MockPayloadDTO)
* @throws APIManagementException
*/
public static MockResponsePayloadListDTO fromMockPayloadsToListDTO(List<APIResourceMediationPolicy> mockPayloads) throws APIManagementException {
MockResponsePayloadListDTO mockResponsePayloadListDTO = new MockResponsePayloadListDTO();
List<MockResponsePayloadInfoDTO> mockResponsePayloadInfoDTOS = mockResponsePayloadListDTO.getList();
for (APIResourceMediationPolicy apiResourceMediationPolicy : mockPayloads) {
mockResponsePayloadInfoDTOS.add(fromMockPayloadToDTO(apiResourceMediationPolicy));
}
return mockResponsePayloadListDTO;
}
Aggregations