Search in sources :

Example 1 with SampleInitAttribute

use of com.google.api.codegen.SampleInitAttribute in project toolkit by googleapis.

the class SampleTransformer method sampleParamConfigMapFromValueSet.

private ImmutableMap<String, SampleParameterConfig> sampleParamConfigMapFromValueSet(SampleValueSet valueSet) {
    ImmutableMap.Builder<String, SampleParameterConfig> builder = ImmutableMap.builder();
    for (SampleInitAttribute attr : valueSet.getParameters().getAttributesList()) {
        String field = attr.getParameter();
        SampleParameterConfig config = SampleParameterConfig.newBuilder().field(field).isFile(attr.getReadFile()).inputParameter(attr.getSampleArgumentName()).comment(attr.getDescription()).build();
        builder.put(field, config);
    }
    return builder.build();
}
Also used : SampleInitAttribute(com.google.api.codegen.SampleInitAttribute) ImmutableMap(com.google.common.collect.ImmutableMap) SampleParameterConfig(com.google.api.codegen.config.SampleParameterConfig)

Aggregations

SampleInitAttribute (com.google.api.codegen.SampleInitAttribute)1 SampleParameterConfig (com.google.api.codegen.config.SampleParameterConfig)1 ImmutableMap (com.google.common.collect.ImmutableMap)1