Search in sources :

Example 1 with SettingsDocView

use of com.google.api.codegen.viewmodel.SettingsDocView in project toolkit by googleapis.

the class JavaSurfaceTransformer method generateSettingsDoc.

private SettingsDocView generateSettingsDoc(InterfaceContext context, StaticLangApiMethodView exampleApiMethod, GapicProductConfig productConfig, String settingsClassName, String apiClassName) {
    SurfaceNamer namer = context.getNamer();
    SettingsDocView.Builder settingsDoc = SettingsDocView.newBuilder();
    ApiModel model = context.getApiModel();
    settingsDoc.serviceAddress(model.getServiceAddress());
    settingsDoc.servicePort(model.getServicePort());
    settingsDoc.transportProtocol(productConfig.getTransportProtocol());
    settingsDoc.exampleApiMethodName(exampleApiMethod.name());
    settingsDoc.exampleApiMethodSettingsGetter(exampleApiMethod.settingsGetterName());
    settingsDoc.apiClassName(apiClassName);
    settingsDoc.settingsVarName(namer.getApiSettingsVariableName(context.getInterfaceConfig()));
    settingsDoc.settingsClassName(settingsClassName);
    settingsDoc.settingsBuilderVarName(namer.getApiSettingsBuilderVarName(context.getInterfaceConfig()));
    settingsDoc.hasDefaultInstance(context.getInterfaceConfig().hasDefaultInstance());
    return settingsDoc.build();
}
Also used : SettingsDocView(com.google.api.codegen.viewmodel.SettingsDocView) ApiModel(com.google.api.codegen.config.ApiModel) SurfaceNamer(com.google.api.codegen.transformer.SurfaceNamer)

Example 2 with SettingsDocView

use of com.google.api.codegen.viewmodel.SettingsDocView in project toolkit by googleapis.

the class CSharpGapicClientTransformer method generateSettingsDoc.

public SettingsDocView generateSettingsDoc(GapicInterfaceContext context) {
    SurfaceNamer namer = context.getNamer();
    SettingsDocView.Builder settingsDoc = SettingsDocView.newBuilder();
    ApiModel model = context.getApiModel();
    settingsDoc.serviceAddress(model.getServiceAddress());
    settingsDoc.servicePort(model.getServicePort());
    // Unused in C#
    settingsDoc.exampleApiMethodName("");
    // Unused in C#
    settingsDoc.exampleApiMethodSettingsGetter("");
    settingsDoc.apiClassName(namer.getApiWrapperClassName(context.getInterfaceConfig()));
    settingsDoc.settingsVarName(namer.getApiSettingsVariableName(context.getInterfaceConfig()));
    settingsDoc.settingsClassName(namer.getApiSettingsClassName(context.getInterfaceConfig()));
    settingsDoc.settingsBuilderVarName(namer.getApiSettingsBuilderVarName(context.getInterfaceConfig()));
    settingsDoc.hasDefaultInstance(context.getInterfaceConfig().hasDefaultInstance());
    return settingsDoc.build();
}
Also used : SettingsDocView(com.google.api.codegen.viewmodel.SettingsDocView) ApiModel(com.google.api.codegen.config.ApiModel) SurfaceNamer(com.google.api.codegen.transformer.SurfaceNamer)

Aggregations

ApiModel (com.google.api.codegen.config.ApiModel)2 SurfaceNamer (com.google.api.codegen.transformer.SurfaceNamer)2 SettingsDocView (com.google.api.codegen.viewmodel.SettingsDocView)2