use of com.google.api.codegen.config.FixedResourceNameConfig in project toolkit by googleapis.
the class PathTemplateTransformer method generateResourceNames.
List<ResourceNameView> generateResourceNames(InterfaceContext context, Iterable<ResourceNameConfig> configs) {
List<ResourceNameView> resourceNames = new ArrayList<>();
int index = 1;
for (ResourceNameConfig config : configs) {
switch(config.getResourceNameType()) {
case SINGLE:
resourceNames.add(generateResourceNameSingle(context, index, (SingleResourceNameConfig) config));
break;
case ONEOF:
resourceNames.add(generateResourceNameOneof(context, index, (ResourceNameOneofConfig) config));
break;
case FIXED:
resourceNames.add(generateResourceNameFixed(context, index, (FixedResourceNameConfig) config));
break;
default:
throw new IllegalStateException("Unexpected resource-name type.");
}
index += 1;
}
return resourceNames;
}
Aggregations