Search in sources :

Example 1 with MockResponsePayloadInfoDTO

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;
}
Also used : MockResponsePayloadInfoDTO(org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.MockResponsePayloadInfoDTO)

Example 2 with 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;
}
Also used : APIResourceMediationPolicy(org.wso2.carbon.apimgt.api.model.APIResourceMediationPolicy) MockResponsePayloadListDTO(org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.MockResponsePayloadListDTO) MockResponsePayloadInfoDTO(org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.MockResponsePayloadInfoDTO)

Aggregations

MockResponsePayloadInfoDTO (org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.MockResponsePayloadInfoDTO)2 APIResourceMediationPolicy (org.wso2.carbon.apimgt.api.model.APIResourceMediationPolicy)1 MockResponsePayloadListDTO (org.wso2.carbon.apimgt.rest.api.publisher.v1.dto.MockResponsePayloadListDTO)1