Search in sources :

Example 1 with StaticLangSampleClassView

use of com.google.api.codegen.viewmodel.StaticLangSampleClassView 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();
}
Also used : StaticLangFileView(com.google.api.codegen.viewmodel.StaticLangFileView) StaticLangSampleClassView(com.google.api.codegen.viewmodel.StaticLangSampleClassView)

Aggregations

StaticLangFileView (com.google.api.codegen.viewmodel.StaticLangFileView)1 StaticLangSampleClassView (com.google.api.codegen.viewmodel.StaticLangSampleClassView)1