Search in sources :

Example 1 with FlatteningGroupProto

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

the class MethodConfig method createFlattening.

@Nullable
static ImmutableList<FlatteningConfig> createFlattening(DiagCollector diagCollector, ResourceNameMessageConfigs messageConfigs, ImmutableMap<String, ResourceNameConfig> resourceNameConfigs, MethodConfigProto methodConfigProto, MethodModel method) {
    boolean missing = false;
    ImmutableList.Builder<FlatteningConfig> flatteningGroupsBuilder = ImmutableList.builder();
    for (FlatteningGroupProto flatteningGroup : methodConfigProto.getFlattening().getGroupsList()) {
        FlatteningConfig groupConfig = FlatteningConfig.createFlattening(diagCollector, messageConfigs, resourceNameConfigs, methodConfigProto, flatteningGroup, method);
        if (groupConfig == null) {
            missing = true;
        } else {
            flatteningGroupsBuilder.add(groupConfig);
        }
    }
    if (missing) {
        return null;
    }
    return flatteningGroupsBuilder.build();
}
Also used : ImmutableList(com.google.common.collect.ImmutableList) FlatteningGroupProto(com.google.api.codegen.FlatteningGroupProto) Nullable(javax.annotation.Nullable)

Aggregations

FlatteningGroupProto (com.google.api.codegen.FlatteningGroupProto)1 ImmutableList (com.google.common.collect.ImmutableList)1 Nullable (javax.annotation.Nullable)1