use of com.google.api.codegen.viewmodel.IamResourceView in project toolkit by googleapis.
the class IamResourceTransformer method generateIamResources.
public List<IamResourceView> generateIamResources(InterfaceContext context) {
List<IamResourceView> resources = new ArrayList<>();
for (FieldModel field : context.getProductConfig().getInterfaceConfig(context.getInterfaceModel()).getIamResources()) {
String resourceTypeName = context.getImportTypeTable().getAndSaveNicknameFor(field.getParentTypeName(context.getImportTypeTable()).getFullName());
resources.add(IamResourceView.builder().resourceGetterFunctionName(context.getNamer().getIamResourceGetterFunctionName(field)).paramName(context.getNamer().getIamResourceParamName(field)).exampleName(context.getNamer().getIamResourceGetterFunctionExampleName(context.getInterfaceConfig(), field)).fieldName(context.getNamer().publicFieldName(Name.from(field.getSimpleName()))).resourceTypeName(resourceTypeName).resourceConstructorName(context.getNamer().getTypeConstructor(resourceTypeName)).build());
}
return resources;
}
Aggregations