Search in sources :

Example 11 with SurfaceNamer

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

the class CSharpGapicSnippetsTransformer method generateOperationFlattenedAsyncMethod.

private StaticLangApiMethodSnippetView generateOperationFlattenedAsyncMethod(MethodContext methodContext, String suffix) {
    SurfaceNamer namer = methodContext.getNamer();
    StaticLangApiMethodView method = apiMethodTransformer.generateAsyncOperationFlattenedMethod(methodContext, Collections.<ParamWithSimpleDoc>emptyList(), ClientMethodType.AsyncOperationFlattenedMethod, true);
    String callerResponseTypeName = method.operationMethod().clientReturnTypeName();
    return StaticLangApiMethodSnippetView.newBuilder().method(method).snippetMethodName(method.name() + suffix).callerResponseTypeName(callerResponseTypeName).apiClassName(namer.getApiWrapperClassName(methodContext.getInterfaceConfig())).apiVariableName(method.apiVariableName()).build();
}
Also used : StaticLangApiMethodView(com.google.api.codegen.viewmodel.StaticLangApiMethodView) SurfaceNamer(com.google.api.codegen.transformer.SurfaceNamer)

Example 12 with SurfaceNamer

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

the class CSharpGapicSnippetsTransformer method generatePagedFlattenedMethod.

private StaticLangApiMethodSnippetView generatePagedFlattenedMethod(MethodContext methodContext, String suffix, boolean requiresNamedArguments) {
    StaticLangApiMethodView method = apiMethodTransformer.generatePagedFlattenedMethod(methodContext, csharpCommonTransformer.pagedMethodAdditionalParams());
    SurfaceNamer namer = methodContext.getNamer();
    PageStreamingConfig pageStreaming = methodContext.getMethodConfig().getPageStreaming();
    FieldConfig resourceFieldConfig = pageStreaming.getResourcesFieldConfig();
    String callerResponseTypeName = namer.getAndSaveCallerPagedResponseTypeName(methodContext, resourceFieldConfig);
    return StaticLangApiMethodSnippetView.newBuilder().method(method).snippetMethodName(method.name() + suffix).callerResponseTypeName(callerResponseTypeName).apiClassName(namer.getApiWrapperClassName(methodContext.getInterfaceConfig())).apiVariableName(method.apiVariableName()).requiresNamedArguments(requiresNamedArguments).build();
}
Also used : StaticLangApiMethodView(com.google.api.codegen.viewmodel.StaticLangApiMethodView) FieldConfig(com.google.api.codegen.config.FieldConfig) PageStreamingConfig(com.google.api.codegen.config.PageStreamingConfig) SurfaceNamer(com.google.api.codegen.transformer.SurfaceNamer)

Example 13 with SurfaceNamer

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

the class CSharpGapicSnippetsTransformer method generateFlattenedAsyncMethod.

private StaticLangApiMethodSnippetView generateFlattenedAsyncMethod(MethodContext methodContext, String suffix) {
    StaticLangApiMethodView method = apiMethodTransformer.generateFlattenedAsyncMethod(methodContext, ClientMethodType.FlattenedAsyncCallSettingsMethod);
    SurfaceNamer namer = methodContext.getNamer();
    String callerResponseTypeName = methodContext.getTypeTable().getAndSaveNicknameFor(namer.getStaticLangCallerAsyncReturnTypeName(methodContext));
    return StaticLangApiMethodSnippetView.newBuilder().method(method).snippetMethodName(method.name() + suffix).callerResponseTypeName(callerResponseTypeName).apiClassName(namer.getApiWrapperClassName(methodContext.getInterfaceConfig())).apiVariableName(method.apiVariableName()).build();
}
Also used : StaticLangApiMethodView(com.google.api.codegen.viewmodel.StaticLangApiMethodView) SurfaceNamer(com.google.api.codegen.transformer.SurfaceNamer)

Example 14 with SurfaceNamer

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

the class CSharpGapicSnippetsTransformer method generateOperationFlattenedMethod.

private StaticLangApiMethodSnippetView generateOperationFlattenedMethod(MethodContext methodContext, String suffix) {
    SurfaceNamer namer = methodContext.getNamer();
    StaticLangApiMethodView method = apiMethodTransformer.generateOperationFlattenedMethod(methodContext, Collections.<ParamWithSimpleDoc>emptyList());
    String callerResponseTypeName = method.operationMethod().clientReturnTypeName();
    return StaticLangApiMethodSnippetView.newBuilder().method(method).snippetMethodName(method.name() + suffix).callerResponseTypeName(callerResponseTypeName).apiClassName(namer.getApiWrapperClassName(methodContext.getInterfaceConfig())).apiVariableName(method.apiVariableName()).build();
}
Also used : StaticLangApiMethodView(com.google.api.codegen.viewmodel.StaticLangApiMethodView) SurfaceNamer(com.google.api.codegen.transformer.SurfaceNamer)

Example 15 with SurfaceNamer

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

the class CSharpGapicSnippetsTransformer method generateFlattenedMethod.

private StaticLangApiMethodSnippetView generateFlattenedMethod(MethodContext methodContext, String suffix) {
    StaticLangApiMethodView method = apiMethodTransformer.generateFlattenedMethod(methodContext);
    SurfaceNamer namer = methodContext.getNamer();
    String callerResponseTypeName = methodContext.getTypeTable().getAndSaveNicknameFor(namer.getStaticLangCallerReturnTypeName(methodContext));
    return StaticLangApiMethodSnippetView.newBuilder().method(method).snippetMethodName(method.name() + suffix).callerResponseTypeName(callerResponseTypeName).apiClassName(namer.getApiWrapperClassName(methodContext.getInterfaceConfig())).apiVariableName(method.apiVariableName()).build();
}
Also used : StaticLangApiMethodView(com.google.api.codegen.viewmodel.StaticLangApiMethodView) SurfaceNamer(com.google.api.codegen.transformer.SurfaceNamer)

Aggregations

SurfaceNamer (com.google.api.codegen.transformer.SurfaceNamer)91 StaticLangApiMethodView (com.google.api.codegen.viewmodel.StaticLangApiMethodView)22 InterfaceModel (com.google.api.codegen.config.InterfaceModel)18 ImmutableList (com.google.common.collect.ImmutableList)16 ViewModel (com.google.api.codegen.viewmodel.ViewModel)14 ArrayList (java.util.ArrayList)14 GapicInterfaceContext (com.google.api.codegen.transformer.GapicInterfaceContext)13 MethodModel (com.google.api.codegen.config.MethodModel)12 FileHeaderView (com.google.api.codegen.viewmodel.FileHeaderView)10 ImportSectionView (com.google.api.codegen.viewmodel.ImportSectionView)10 MethodConfig (com.google.api.codegen.config.MethodConfig)9 GapicMethodContext (com.google.api.codegen.transformer.GapicMethodContext)9 ApiModel (com.google.api.codegen.config.ApiModel)8 InterfaceConfig (com.google.api.codegen.config.InterfaceConfig)8 ModelTypeTable (com.google.api.codegen.transformer.ModelTypeTable)8 SmokeTestClassView (com.google.api.codegen.viewmodel.testing.SmokeTestClassView)8 FieldConfig (com.google.api.codegen.config.FieldConfig)6 FlatteningConfig (com.google.api.codegen.config.FlatteningConfig)6 ImportTypeTable (com.google.api.codegen.transformer.ImportTypeTable)5 PackageMetadataNamer (com.google.api.codegen.transformer.PackageMetadataNamer)5