use of com.google.api.codegen.viewmodel.StaticLangApiMethodView in project toolkit by googleapis.
the class StaticLangApiMethodTransformer method generateOperationRequestObjectMethod.
public StaticLangApiMethodView generateOperationRequestObjectMethod(MethodContext context, List<ParamWithSimpleDoc> additionalParams) {
MethodModel method = context.getMethodModel();
SurfaceNamer namer = context.getNamer();
StaticLangApiMethodView.Builder methodViewBuilder = StaticLangApiMethodView.newBuilder();
setCommonFields(context, methodViewBuilder);
methodViewBuilder.name(namer.getApiMethodName(method, context.getMethodConfig().getVisibility()));
methodViewBuilder.exampleName(namer.getApiMethodExampleName(context.getInterfaceConfig(), method));
setRequestObjectMethodFields(context, namer.getCallableMethodName(method), Synchronicity.Sync, additionalParams, methodViewBuilder);
methodViewBuilder.operationMethod(lroTransformer.generateDetailView(context));
TypeModel returnType = context.getMethodConfig().getLongRunningConfig().getReturnType();
methodViewBuilder.responseTypeName(context.getTypeTable().getAndSaveNicknameFor(returnType));
return methodViewBuilder.type(ClientMethodType.OperationRequestObjectMethod).build();
}
use of com.google.api.codegen.viewmodel.StaticLangApiMethodView in project toolkit by googleapis.
the class StaticLangApiMethodTransformer method generateCallableMethod.
public StaticLangApiMethodView generateCallableMethod(MethodContext context) {
MethodModel method = context.getMethodModel();
SurfaceNamer namer = context.getNamer();
StaticLangApiMethodView.Builder methodViewBuilder = StaticLangApiMethodView.newBuilder();
setCommonFields(context, methodViewBuilder);
methodViewBuilder.name(namer.getCallableMethodName(method));
methodViewBuilder.exampleName(context.getNamer().getCallableMethodExampleName(method));
setCallableMethodFields(context, namer.getCallableName(method), methodViewBuilder);
methodViewBuilder.responseTypeName(context.getMethodModel().getAndSaveResponseTypeName(context.getTypeTable(), context.getNamer()));
return methodViewBuilder.type(ClientMethodType.CallableMethod).build();
}
use of com.google.api.codegen.viewmodel.StaticLangApiMethodView in project toolkit by googleapis.
the class StaticLangApiMethodTransformer method generatePagedFlattenedAsyncMethod.
public StaticLangApiMethodView generatePagedFlattenedAsyncMethod(MethodContext context, List<ParamWithSimpleDoc> additionalParams) {
MethodModel methodModel = context.getMethodModel();
SurfaceNamer namer = context.getNamer();
StaticLangApiMethodView.Builder methodViewBuilder = StaticLangApiMethodView.newBuilder();
setCommonFields(context, methodViewBuilder);
methodViewBuilder.name(namer.getAsyncApiMethodName(methodModel, context.getMethodConfig().getVisibility()));
methodViewBuilder.exampleName(namer.getAsyncApiMethodExampleName(methodModel));
setListMethodFields(context, Synchronicity.Async, methodViewBuilder);
setFlattenedMethodFields(context, additionalParams, Synchronicity.Async, methodViewBuilder);
return methodViewBuilder.type(ClientMethodType.PagedFlattenedAsyncMethod).build();
}
use of com.google.api.codegen.viewmodel.StaticLangApiMethodView in project toolkit by googleapis.
the class StaticLangApiMethodTransformer method generateFlattenedAsyncMethod.
public StaticLangApiMethodView generateFlattenedAsyncMethod(MethodContext context, List<ParamWithSimpleDoc> additionalParams, ClientMethodType type) {
MethodModel method = context.getMethodModel();
SurfaceNamer namer = context.getNamer();
StaticLangApiMethodView.Builder methodViewBuilder = StaticLangApiMethodView.newBuilder();
setCommonFields(context, methodViewBuilder);
methodViewBuilder.name(namer.getAsyncApiMethodName(method, context.getMethodConfig().getVisibility()));
methodViewBuilder.exampleName(namer.getCallableMethodExampleName(method));
methodViewBuilder.callableName(namer.getCallableName(method));
setFlattenedMethodFields(context, additionalParams, Synchronicity.Async, methodViewBuilder);
setStaticLangAsyncReturnTypeName(context, methodViewBuilder);
return methodViewBuilder.type(type).build();
}
use of com.google.api.codegen.viewmodel.StaticLangApiMethodView in project toolkit by googleapis.
the class StaticLangApiMethodTransformer method generateOperationFlattenedMethod.
public StaticLangApiMethodView generateOperationFlattenedMethod(MethodContext context, List<ParamWithSimpleDoc> additionalParams) {
MethodModel method = context.getMethodModel();
SurfaceNamer namer = context.getNamer();
StaticLangApiMethodView.Builder methodViewBuilder = StaticLangApiMethodView.newBuilder();
setCommonFields(context, methodViewBuilder);
methodViewBuilder.name(namer.getApiMethodName(method, context.getMethodConfig().getVisibility()));
methodViewBuilder.exampleName(namer.getApiMethodExampleName(context.getInterfaceConfig(), method));
methodViewBuilder.callableName(namer.getCallableName(method));
setFlattenedMethodFields(context, additionalParams, Synchronicity.Sync, methodViewBuilder);
methodViewBuilder.operationMethod(lroTransformer.generateDetailView(context));
TypeModel returnType = context.getMethodConfig().getLongRunningConfig().getReturnType();
methodViewBuilder.responseTypeName(context.getTypeTable().getAndSaveNicknameFor(returnType));
return methodViewBuilder.type(ClientMethodType.OperationFlattenedMethod).build();
}
Aggregations