Search in sources :

Example 1 with ApiBeanDto

use of io.apiman.manager.api.beans.apis.dto.ApiBeanDto in project apiman by apiman.

the class RestHelper method hideSensitiveDataFromApiVersionBean.

/**
 * This method will hide sensitive data, such as created by, from the result
 *
 * @param apiVersionBean the apiVersionBean
 * @return the apiVersionBean without sensitive data
 */
public static ApiVersionBeanDto hideSensitiveDataFromApiVersionBean(ApiVersionBeanDto apiVersionBean) {
    ApiBeanDto api = new ApiBeanDto();
    api.setId(apiVersionBean.getApi().getId());
    api.setName(apiVersionBean.getApi().getName());
    api.setDescription(apiVersionBean.getApi().getDescription());
    api.setImage(apiVersionBean.getApi().getImage());
    OrganizationBean org = new OrganizationBean();
    org.setId(apiVersionBean.getApi().getOrganization().getId());
    org.setName(apiVersionBean.getApi().getOrganization().getName());
    org.setDescription(apiVersionBean.getApi().getOrganization().getDescription());
    api.setOrganization(org);
    ApiVersionBeanDto apiVersion = new ApiVersionBeanDto();
    apiVersion.setApi(api);
    apiVersion.setStatus(apiVersionBean.getStatus());
    apiVersion.setEndpointType(apiVersionBean.getEndpointType());
    apiVersion.setEndpointContentType(apiVersionBean.getEndpointContentType());
    apiVersion.setGateways(apiVersionBean.getGateways());
    apiVersion.setPublicAPI(apiVersionBean.isPublicAPI());
    apiVersion.setPlans(apiVersionBean.getPlans());
    apiVersion.setVersion(apiVersionBean.getVersion());
    apiVersion.setDefinitionType(apiVersionBean.getDefinitionType());
    apiVersion.setPublicDiscoverability(apiVersionBean.getPublicDiscoverability());
    apiVersion.setExtendedDescription(apiVersionBean.getExtendedDescription());
    // dates
    apiVersion.setCreatedOn(apiVersionBean.getCreatedOn());
    apiVersion.setModifiedOn(apiVersionBean.getModifiedOn());
    apiVersion.setPublishedOn(apiVersionBean.getPublishedOn());
    apiVersion.setRetiredOn(apiVersionBean.getRetiredOn());
    return apiVersion;
}
Also used : ApiBeanDto(io.apiman.manager.api.beans.apis.dto.ApiBeanDto) ApiVersionBeanDto(io.apiman.manager.api.beans.apis.dto.ApiVersionBeanDto) OrganizationBean(io.apiman.manager.api.beans.orgs.OrganizationBean)

Aggregations

ApiBeanDto (io.apiman.manager.api.beans.apis.dto.ApiBeanDto)1 ApiVersionBeanDto (io.apiman.manager.api.beans.apis.dto.ApiVersionBeanDto)1 OrganizationBean (io.apiman.manager.api.beans.orgs.OrganizationBean)1