Java 类com.amazonaws.services.apigateway.model.MethodResponse 实例源码

项目:aws-apigateway-swagger-exporter    文件:APIGExporter.java   
private static Map<String, Property> getResponseHeaders(MethodResponse methodResponse) {
    Map<String, Property> result = null;
    Map<String, Boolean> responseParameters = methodResponse.getResponseParameters();
    if (responseParameters != null) {
        for (Map.Entry<String, Boolean> responseParameterEntry : responseParameters.entrySet()) {
            String parameterName = responseParameterEntry.getKey();
            if (parameterName.startsWith(METHOD_RESPONSE_HEADER)) {
                StringProperty headerProperty = new StringProperty();
                headerProperty.setRequired(responseParameterEntry.getValue());
                if (result == null) {
                    result = new LinkedHashMap<String, Property>();
                }
                result.put(parameterName.substring(METHOD_RESPONSE_HEADER.length()), headerProperty);
            } else {
                throw new UnsupportedOperationException("Unsupported response parameter type " + parameterName);
            }
        }
    }
    return result;
}