Search in sources :

Example 1 with RequestFieldProto

use of com.google.api.codegen.samplegen.v1p2.RequestFieldProto in project toolkit by googleapis.

the class SampleTransformer method sampleParamConfigMapFromRequestConfigs.

private ImmutableMap<String, SampleParameterConfig> sampleParamConfigMapFromRequestConfigs(List<RequestFieldProto> requests) {
    ImmutableMap.Builder<String, SampleParameterConfig> builder = ImmutableMap.builder();
    for (RequestFieldProto request : requests) {
        String field = request.getField();
        SampleParameterConfig config = SampleParameterConfig.newBuilder().field(field).isFile(request.getValueIsFile()).inputParameter(request.getInputParameter()).comment(request.getComment()).build();
        builder.put(field, config);
    }
    return builder.build();
}
Also used : RequestFieldProto(com.google.api.codegen.samplegen.v1p2.RequestFieldProto) ImmutableMap(com.google.common.collect.ImmutableMap) SampleParameterConfig(com.google.api.codegen.config.SampleParameterConfig)

Aggregations

SampleParameterConfig (com.google.api.codegen.config.SampleParameterConfig)1 RequestFieldProto (com.google.api.codegen.samplegen.v1p2.RequestFieldProto)1 ImmutableMap (com.google.common.collect.ImmutableMap)1