use of com.google.api.codegen.viewmodel.StaticLangFileView in project toolkit by googleapis.
the class StaticLangGapicSamplesTransformer method newSampleFileView.
private StaticLangFileView newSampleFileView(GapicProductConfig productConfig, InterfaceContext context, String sampleClassName, String sampleFileName, StaticLangApiMethodView method, MethodSampleView sample) {
StaticLangSampleClassView sampleClassView = StaticLangSampleClassView.newBuilder().name(sampleClassName).libraryMethod(method).sample(sample).build();
String outputPath = Paths.get(pathMapper.getOutputPath(context.getInterfaceModel().getFullName(), productConfig), sampleFileName).toString();
StaticLangFileView.Builder<StaticLangSampleClassView> builder = StaticLangFileView.newBuilder();
builder.templateFileName(templateFileName);
builder.fileHeader(fileHeaderTransformer.generateFileHeader(context));
builder.outputPath(outputPath);
builder.classView(sampleClassView);
return builder.build();
}
Aggregations