com.google.cloud.retail.v2.ModelServiceGrpc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grpc-google-cloud-retail-v2 Show documentation
Show all versions of grpc-google-cloud-retail-v2 Show documentation
GRPC library for google-cloud-retail
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.retail.v2;
import static io.grpc.MethodDescriptor.generateFullMethodName;
/**
*
*
*
* Service for performing CRUD operations on models.
* Recommendation models contain all the metadata necessary to generate a set of
* models for the `Predict()` API. A model is queried
* indirectly via a ServingConfig, which associates a model with a
* given Placement (e.g. Frequently Bought Together on Home Page).
* This service allows you to do the following:
* * Initiate training of a model.
* * Pause training of an existing model.
* * List all the available models along with their metadata.
* * Control their tuning schedule.
*
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: google/cloud/retail/v2/model_service.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class ModelServiceGrpc {
private ModelServiceGrpc() {}
public static final java.lang.String SERVICE_NAME = "google.cloud.retail.v2.ModelService";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.CreateModelRequest, com.google.longrunning.Operation>
getCreateModelMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "CreateModel",
requestType = com.google.cloud.retail.v2.CreateModelRequest.class,
responseType = com.google.longrunning.Operation.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.CreateModelRequest, com.google.longrunning.Operation>
getCreateModelMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.CreateModelRequest, com.google.longrunning.Operation>
getCreateModelMethod;
if ((getCreateModelMethod = ModelServiceGrpc.getCreateModelMethod) == null) {
synchronized (ModelServiceGrpc.class) {
if ((getCreateModelMethod = ModelServiceGrpc.getCreateModelMethod) == null) {
ModelServiceGrpc.getCreateModelMethod =
getCreateModelMethod =
io.grpc.MethodDescriptor
.
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateModel"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.retail.v2.CreateModelRequest.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.longrunning.Operation.getDefaultInstance()))
.setSchemaDescriptor(new ModelServiceMethodDescriptorSupplier("CreateModel"))
.build();
}
}
}
return getCreateModelMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.GetModelRequest, com.google.cloud.retail.v2.Model>
getGetModelMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "GetModel",
requestType = com.google.cloud.retail.v2.GetModelRequest.class,
responseType = com.google.cloud.retail.v2.Model.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.GetModelRequest, com.google.cloud.retail.v2.Model>
getGetModelMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.GetModelRequest, com.google.cloud.retail.v2.Model>
getGetModelMethod;
if ((getGetModelMethod = ModelServiceGrpc.getGetModelMethod) == null) {
synchronized (ModelServiceGrpc.class) {
if ((getGetModelMethod = ModelServiceGrpc.getGetModelMethod) == null) {
ModelServiceGrpc.getGetModelMethod =
getGetModelMethod =
io.grpc.MethodDescriptor
.
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetModel"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.retail.v2.GetModelRequest.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.retail.v2.Model.getDefaultInstance()))
.setSchemaDescriptor(new ModelServiceMethodDescriptorSupplier("GetModel"))
.build();
}
}
}
return getGetModelMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.PauseModelRequest, com.google.cloud.retail.v2.Model>
getPauseModelMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "PauseModel",
requestType = com.google.cloud.retail.v2.PauseModelRequest.class,
responseType = com.google.cloud.retail.v2.Model.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.PauseModelRequest, com.google.cloud.retail.v2.Model>
getPauseModelMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.PauseModelRequest, com.google.cloud.retail.v2.Model>
getPauseModelMethod;
if ((getPauseModelMethod = ModelServiceGrpc.getPauseModelMethod) == null) {
synchronized (ModelServiceGrpc.class) {
if ((getPauseModelMethod = ModelServiceGrpc.getPauseModelMethod) == null) {
ModelServiceGrpc.getPauseModelMethod =
getPauseModelMethod =
io.grpc.MethodDescriptor
.
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "PauseModel"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.retail.v2.PauseModelRequest.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.retail.v2.Model.getDefaultInstance()))
.setSchemaDescriptor(new ModelServiceMethodDescriptorSupplier("PauseModel"))
.build();
}
}
}
return getPauseModelMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.ResumeModelRequest, com.google.cloud.retail.v2.Model>
getResumeModelMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "ResumeModel",
requestType = com.google.cloud.retail.v2.ResumeModelRequest.class,
responseType = com.google.cloud.retail.v2.Model.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.ResumeModelRequest, com.google.cloud.retail.v2.Model>
getResumeModelMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.ResumeModelRequest, com.google.cloud.retail.v2.Model>
getResumeModelMethod;
if ((getResumeModelMethod = ModelServiceGrpc.getResumeModelMethod) == null) {
synchronized (ModelServiceGrpc.class) {
if ((getResumeModelMethod = ModelServiceGrpc.getResumeModelMethod) == null) {
ModelServiceGrpc.getResumeModelMethod =
getResumeModelMethod =
io.grpc.MethodDescriptor
.
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "ResumeModel"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.retail.v2.ResumeModelRequest.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.retail.v2.Model.getDefaultInstance()))
.setSchemaDescriptor(new ModelServiceMethodDescriptorSupplier("ResumeModel"))
.build();
}
}
}
return getResumeModelMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.DeleteModelRequest, com.google.protobuf.Empty>
getDeleteModelMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "DeleteModel",
requestType = com.google.cloud.retail.v2.DeleteModelRequest.class,
responseType = com.google.protobuf.Empty.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.DeleteModelRequest, com.google.protobuf.Empty>
getDeleteModelMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.DeleteModelRequest, com.google.protobuf.Empty>
getDeleteModelMethod;
if ((getDeleteModelMethod = ModelServiceGrpc.getDeleteModelMethod) == null) {
synchronized (ModelServiceGrpc.class) {
if ((getDeleteModelMethod = ModelServiceGrpc.getDeleteModelMethod) == null) {
ModelServiceGrpc.getDeleteModelMethod =
getDeleteModelMethod =
io.grpc.MethodDescriptor
.
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteModel"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.retail.v2.DeleteModelRequest.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.protobuf.Empty.getDefaultInstance()))
.setSchemaDescriptor(new ModelServiceMethodDescriptorSupplier("DeleteModel"))
.build();
}
}
}
return getDeleteModelMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.ListModelsRequest,
com.google.cloud.retail.v2.ListModelsResponse>
getListModelsMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "ListModels",
requestType = com.google.cloud.retail.v2.ListModelsRequest.class,
responseType = com.google.cloud.retail.v2.ListModelsResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.ListModelsRequest,
com.google.cloud.retail.v2.ListModelsResponse>
getListModelsMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.ListModelsRequest,
com.google.cloud.retail.v2.ListModelsResponse>
getListModelsMethod;
if ((getListModelsMethod = ModelServiceGrpc.getListModelsMethod) == null) {
synchronized (ModelServiceGrpc.class) {
if ((getListModelsMethod = ModelServiceGrpc.getListModelsMethod) == null) {
ModelServiceGrpc.getListModelsMethod =
getListModelsMethod =
io.grpc.MethodDescriptor
.
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListModels"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.retail.v2.ListModelsRequest.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.retail.v2.ListModelsResponse.getDefaultInstance()))
.setSchemaDescriptor(new ModelServiceMethodDescriptorSupplier("ListModels"))
.build();
}
}
}
return getListModelsMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.UpdateModelRequest, com.google.cloud.retail.v2.Model>
getUpdateModelMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "UpdateModel",
requestType = com.google.cloud.retail.v2.UpdateModelRequest.class,
responseType = com.google.cloud.retail.v2.Model.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.UpdateModelRequest, com.google.cloud.retail.v2.Model>
getUpdateModelMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.UpdateModelRequest, com.google.cloud.retail.v2.Model>
getUpdateModelMethod;
if ((getUpdateModelMethod = ModelServiceGrpc.getUpdateModelMethod) == null) {
synchronized (ModelServiceGrpc.class) {
if ((getUpdateModelMethod = ModelServiceGrpc.getUpdateModelMethod) == null) {
ModelServiceGrpc.getUpdateModelMethod =
getUpdateModelMethod =
io.grpc.MethodDescriptor
.
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateModel"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.retail.v2.UpdateModelRequest.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.retail.v2.Model.getDefaultInstance()))
.setSchemaDescriptor(new ModelServiceMethodDescriptorSupplier("UpdateModel"))
.build();
}
}
}
return getUpdateModelMethod;
}
private static volatile io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.TuneModelRequest, com.google.longrunning.Operation>
getTuneModelMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "TuneModel",
requestType = com.google.cloud.retail.v2.TuneModelRequest.class,
responseType = com.google.longrunning.Operation.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.TuneModelRequest, com.google.longrunning.Operation>
getTuneModelMethod() {
io.grpc.MethodDescriptor<
com.google.cloud.retail.v2.TuneModelRequest, com.google.longrunning.Operation>
getTuneModelMethod;
if ((getTuneModelMethod = ModelServiceGrpc.getTuneModelMethod) == null) {
synchronized (ModelServiceGrpc.class) {
if ((getTuneModelMethod = ModelServiceGrpc.getTuneModelMethod) == null) {
ModelServiceGrpc.getTuneModelMethod =
getTuneModelMethod =
io.grpc.MethodDescriptor
.
newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "TuneModel"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.retail.v2.TuneModelRequest.getDefaultInstance()))
.setResponseMarshaller(
io.grpc.protobuf.ProtoUtils.marshaller(
com.google.longrunning.Operation.getDefaultInstance()))
.setSchemaDescriptor(new ModelServiceMethodDescriptorSupplier("TuneModel"))
.build();
}
}
}
return getTuneModelMethod;
}
/** Creates a new async stub that supports all call types for the service */
public static ModelServiceStub newStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public ModelServiceStub newStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ModelServiceStub(channel, callOptions);
}
};
return ModelServiceStub.newStub(factory, channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static ModelServiceBlockingStub newBlockingStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public ModelServiceBlockingStub newStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ModelServiceBlockingStub(channel, callOptions);
}
};
return ModelServiceBlockingStub.newStub(factory, channel);
}
/** Creates a new ListenableFuture-style stub that supports unary calls on the service */
public static ModelServiceFutureStub newFutureStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public ModelServiceFutureStub newStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ModelServiceFutureStub(channel, callOptions);
}
};
return ModelServiceFutureStub.newStub(factory, channel);
}
/**
*
*
*
* Service for performing CRUD operations on models.
* Recommendation models contain all the metadata necessary to generate a set of
* models for the `Predict()` API. A model is queried
* indirectly via a ServingConfig, which associates a model with a
* given Placement (e.g. Frequently Bought Together on Home Page).
* This service allows you to do the following:
* * Initiate training of a model.
* * Pause training of an existing model.
* * List all the available models along with their metadata.
* * Control their tuning schedule.
*
*/
public interface AsyncService {
/**
*
*
*
* Creates a new model.
*
*/
default void createModel(
com.google.cloud.retail.v2.CreateModelRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getCreateModelMethod(), responseObserver);
}
/**
*
*
*
* Gets a model.
*
*/
default void getModel(
com.google.cloud.retail.v2.GetModelRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetModelMethod(), responseObserver);
}
/**
*
*
*
* Pauses the training of an existing model.
*
*/
default void pauseModel(
com.google.cloud.retail.v2.PauseModelRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPauseModelMethod(), responseObserver);
}
/**
*
*
*
* Resumes the training of an existing model.
*
*/
default void resumeModel(
com.google.cloud.retail.v2.ResumeModelRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getResumeModelMethod(), responseObserver);
}
/**
*
*
*
* Deletes an existing model.
*
*/
default void deleteModel(
com.google.cloud.retail.v2.DeleteModelRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getDeleteModelMethod(), responseObserver);
}
/**
*
*
*
* Lists all the models linked to this event store.
*
*/
default void listModels(
com.google.cloud.retail.v2.ListModelsRequest request,
io.grpc.stub.StreamObserver
responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListModelsMethod(), responseObserver);
}
/**
*
*
*
* Update of model metadata. Only fields that
* currently can be updated are: `filtering_option` and
* `periodic_tuning_state`.
* If other values are provided, this API method ignores them.
*
*/
default void updateModel(
com.google.cloud.retail.v2.UpdateModelRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
getUpdateModelMethod(), responseObserver);
}
/**
*
*
*
* Tunes an existing model.
*
*/
default void tuneModel(
com.google.cloud.retail.v2.TuneModelRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getTuneModelMethod(), responseObserver);
}
}
/**
* Base class for the server implementation of the service ModelService.
*
*
* Service for performing CRUD operations on models.
* Recommendation models contain all the metadata necessary to generate a set of
* models for the `Predict()` API. A model is queried
* indirectly via a ServingConfig, which associates a model with a
* given Placement (e.g. Frequently Bought Together on Home Page).
* This service allows you to do the following:
* * Initiate training of a model.
* * Pause training of an existing model.
* * List all the available models along with their metadata.
* * Control their tuning schedule.
*
*/
public abstract static class ModelServiceImplBase
implements io.grpc.BindableService, AsyncService {
@java.lang.Override
public final io.grpc.ServerServiceDefinition bindService() {
return ModelServiceGrpc.bindService(this);
}
}
/**
* A stub to allow clients to do asynchronous rpc calls to service ModelService.
*
*
* Service for performing CRUD operations on models.
* Recommendation models contain all the metadata necessary to generate a set of
* models for the `Predict()` API. A model is queried
* indirectly via a ServingConfig, which associates a model with a
* given Placement (e.g. Frequently Bought Together on Home Page).
* This service allows you to do the following:
* * Initiate training of a model.
* * Pause training of an existing model.
* * List all the available models along with their metadata.
* * Control their tuning schedule.
*
*/
public static final class ModelServiceStub
extends io.grpc.stub.AbstractAsyncStub {
private ModelServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected ModelServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ModelServiceStub(channel, callOptions);
}
/**
*
*
*
* Creates a new model.
*
*/
public void createModel(
com.google.cloud.retail.v2.CreateModelRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getCreateModelMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
*
* Gets a model.
*
*/
public void getModel(
com.google.cloud.retail.v2.GetModelRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getGetModelMethod(), getCallOptions()), request, responseObserver);
}
/**
*
*
*
* Pauses the training of an existing model.
*
*/
public void pauseModel(
com.google.cloud.retail.v2.PauseModelRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getPauseModelMethod(), getCallOptions()), request, responseObserver);
}
/**
*
*
*
* Resumes the training of an existing model.
*
*/
public void resumeModel(
com.google.cloud.retail.v2.ResumeModelRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getResumeModelMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
*
* Deletes an existing model.
*
*/
public void deleteModel(
com.google.cloud.retail.v2.DeleteModelRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getDeleteModelMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
*
* Lists all the models linked to this event store.
*
*/
public void listModels(
com.google.cloud.retail.v2.ListModelsRequest request,
io.grpc.stub.StreamObserver
responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getListModelsMethod(), getCallOptions()), request, responseObserver);
}
/**
*
*
*
* Update of model metadata. Only fields that
* currently can be updated are: `filtering_option` and
* `periodic_tuning_state`.
* If other values are provided, this API method ignores them.
*
*/
public void updateModel(
com.google.cloud.retail.v2.UpdateModelRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getUpdateModelMethod(), getCallOptions()),
request,
responseObserver);
}
/**
*
*
*
* Tunes an existing model.
*
*/
public void tuneModel(
com.google.cloud.retail.v2.TuneModelRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getTuneModelMethod(), getCallOptions()), request, responseObserver);
}
}
/**
* A stub to allow clients to do synchronous rpc calls to service ModelService.
*
*
* Service for performing CRUD operations on models.
* Recommendation models contain all the metadata necessary to generate a set of
* models for the `Predict()` API. A model is queried
* indirectly via a ServingConfig, which associates a model with a
* given Placement (e.g. Frequently Bought Together on Home Page).
* This service allows you to do the following:
* * Initiate training of a model.
* * Pause training of an existing model.
* * List all the available models along with their metadata.
* * Control their tuning schedule.
*
*/
public static final class ModelServiceBlockingStub
extends io.grpc.stub.AbstractBlockingStub {
private ModelServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected ModelServiceBlockingStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ModelServiceBlockingStub(channel, callOptions);
}
/**
*
*
*
* Creates a new model.
*
*/
public com.google.longrunning.Operation createModel(
com.google.cloud.retail.v2.CreateModelRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getCreateModelMethod(), getCallOptions(), request);
}
/**
*
*
*
* Gets a model.
*
*/
public com.google.cloud.retail.v2.Model getModel(
com.google.cloud.retail.v2.GetModelRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getGetModelMethod(), getCallOptions(), request);
}
/**
*
*
*
* Pauses the training of an existing model.
*
*/
public com.google.cloud.retail.v2.Model pauseModel(
com.google.cloud.retail.v2.PauseModelRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getPauseModelMethod(), getCallOptions(), request);
}
/**
*
*
*
* Resumes the training of an existing model.
*
*/
public com.google.cloud.retail.v2.Model resumeModel(
com.google.cloud.retail.v2.ResumeModelRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getResumeModelMethod(), getCallOptions(), request);
}
/**
*
*
*
* Deletes an existing model.
*
*/
public com.google.protobuf.Empty deleteModel(
com.google.cloud.retail.v2.DeleteModelRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getDeleteModelMethod(), getCallOptions(), request);
}
/**
*
*
*
* Lists all the models linked to this event store.
*
*/
public com.google.cloud.retail.v2.ListModelsResponse listModels(
com.google.cloud.retail.v2.ListModelsRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getListModelsMethod(), getCallOptions(), request);
}
/**
*
*
*
* Update of model metadata. Only fields that
* currently can be updated are: `filtering_option` and
* `periodic_tuning_state`.
* If other values are provided, this API method ignores them.
*
*/
public com.google.cloud.retail.v2.Model updateModel(
com.google.cloud.retail.v2.UpdateModelRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getUpdateModelMethod(), getCallOptions(), request);
}
/**
*
*
*
* Tunes an existing model.
*
*/
public com.google.longrunning.Operation tuneModel(
com.google.cloud.retail.v2.TuneModelRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getTuneModelMethod(), getCallOptions(), request);
}
}
/**
* A stub to allow clients to do ListenableFuture-style rpc calls to service ModelService.
*
*
* Service for performing CRUD operations on models.
* Recommendation models contain all the metadata necessary to generate a set of
* models for the `Predict()` API. A model is queried
* indirectly via a ServingConfig, which associates a model with a
* given Placement (e.g. Frequently Bought Together on Home Page).
* This service allows you to do the following:
* * Initiate training of a model.
* * Pause training of an existing model.
* * List all the available models along with their metadata.
* * Control their tuning schedule.
*
*/
public static final class ModelServiceFutureStub
extends io.grpc.stub.AbstractFutureStub {
private ModelServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected ModelServiceFutureStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ModelServiceFutureStub(channel, callOptions);
}
/**
*
*
*
* Creates a new model.
*
*/
public com.google.common.util.concurrent.ListenableFuture
createModel(com.google.cloud.retail.v2.CreateModelRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getCreateModelMethod(), getCallOptions()), request);
}
/**
*
*
*
* Gets a model.
*
*/
public com.google.common.util.concurrent.ListenableFuture
getModel(com.google.cloud.retail.v2.GetModelRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getGetModelMethod(), getCallOptions()), request);
}
/**
*
*
*
* Pauses the training of an existing model.
*
*/
public com.google.common.util.concurrent.ListenableFuture
pauseModel(com.google.cloud.retail.v2.PauseModelRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getPauseModelMethod(), getCallOptions()), request);
}
/**
*
*
*
* Resumes the training of an existing model.
*
*/
public com.google.common.util.concurrent.ListenableFuture
resumeModel(com.google.cloud.retail.v2.ResumeModelRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getResumeModelMethod(), getCallOptions()), request);
}
/**
*
*
*
* Deletes an existing model.
*
*/
public com.google.common.util.concurrent.ListenableFuture
deleteModel(com.google.cloud.retail.v2.DeleteModelRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getDeleteModelMethod(), getCallOptions()), request);
}
/**
*
*
*
* Lists all the models linked to this event store.
*
*/
public com.google.common.util.concurrent.ListenableFuture<
com.google.cloud.retail.v2.ListModelsResponse>
listModels(com.google.cloud.retail.v2.ListModelsRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getListModelsMethod(), getCallOptions()), request);
}
/**
*
*
*
* Update of model metadata. Only fields that
* currently can be updated are: `filtering_option` and
* `periodic_tuning_state`.
* If other values are provided, this API method ignores them.
*
*/
public com.google.common.util.concurrent.ListenableFuture
updateModel(com.google.cloud.retail.v2.UpdateModelRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getUpdateModelMethod(), getCallOptions()), request);
}
/**
*
*
*
* Tunes an existing model.
*
*/
public com.google.common.util.concurrent.ListenableFuture
tuneModel(com.google.cloud.retail.v2.TuneModelRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getTuneModelMethod(), getCallOptions()), request);
}
}
private static final int METHODID_CREATE_MODEL = 0;
private static final int METHODID_GET_MODEL = 1;
private static final int METHODID_PAUSE_MODEL = 2;
private static final int METHODID_RESUME_MODEL = 3;
private static final int METHODID_DELETE_MODEL = 4;
private static final int METHODID_LIST_MODELS = 5;
private static final int METHODID_UPDATE_MODEL = 6;
private static final int METHODID_TUNE_MODEL = 7;
private static final class MethodHandlers
implements io.grpc.stub.ServerCalls.UnaryMethod,
io.grpc.stub.ServerCalls.ServerStreamingMethod,
io.grpc.stub.ServerCalls.ClientStreamingMethod,
io.grpc.stub.ServerCalls.BidiStreamingMethod {
private final AsyncService serviceImpl;
private final int methodId;
MethodHandlers(AsyncService serviceImpl, int methodId) {
this.serviceImpl = serviceImpl;
this.methodId = methodId;
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) {
switch (methodId) {
case METHODID_CREATE_MODEL:
serviceImpl.createModel(
(com.google.cloud.retail.v2.CreateModelRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_GET_MODEL:
serviceImpl.getModel(
(com.google.cloud.retail.v2.GetModelRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_PAUSE_MODEL:
serviceImpl.pauseModel(
(com.google.cloud.retail.v2.PauseModelRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_RESUME_MODEL:
serviceImpl.resumeModel(
(com.google.cloud.retail.v2.ResumeModelRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_DELETE_MODEL:
serviceImpl.deleteModel(
(com.google.cloud.retail.v2.DeleteModelRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_LIST_MODELS:
serviceImpl.listModels(
(com.google.cloud.retail.v2.ListModelsRequest) request,
(io.grpc.stub.StreamObserver)
responseObserver);
break;
case METHODID_UPDATE_MODEL:
serviceImpl.updateModel(
(com.google.cloud.retail.v2.UpdateModelRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_TUNE_MODEL:
serviceImpl.tuneModel(
(com.google.cloud.retail.v2.TuneModelRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
default:
throw new AssertionError();
}
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public io.grpc.stub.StreamObserver invoke(
io.grpc.stub.StreamObserver responseObserver) {
switch (methodId) {
default:
throw new AssertionError();
}
}
}
public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getCreateModelMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.retail.v2.CreateModelRequest,
com.google.longrunning.Operation>(service, METHODID_CREATE_MODEL)))
.addMethod(
getGetModelMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.retail.v2.GetModelRequest, com.google.cloud.retail.v2.Model>(
service, METHODID_GET_MODEL)))
.addMethod(
getPauseModelMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.retail.v2.PauseModelRequest, com.google.cloud.retail.v2.Model>(
service, METHODID_PAUSE_MODEL)))
.addMethod(
getResumeModelMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.retail.v2.ResumeModelRequest,
com.google.cloud.retail.v2.Model>(service, METHODID_RESUME_MODEL)))
.addMethod(
getDeleteModelMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.retail.v2.DeleteModelRequest, com.google.protobuf.Empty>(
service, METHODID_DELETE_MODEL)))
.addMethod(
getListModelsMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.retail.v2.ListModelsRequest,
com.google.cloud.retail.v2.ListModelsResponse>(service, METHODID_LIST_MODELS)))
.addMethod(
getUpdateModelMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.retail.v2.UpdateModelRequest,
com.google.cloud.retail.v2.Model>(service, METHODID_UPDATE_MODEL)))
.addMethod(
getTuneModelMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.retail.v2.TuneModelRequest, com.google.longrunning.Operation>(
service, METHODID_TUNE_MODEL)))
.build();
}
private abstract static class ModelServiceBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier,
io.grpc.protobuf.ProtoServiceDescriptorSupplier {
ModelServiceBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return com.google.cloud.retail.v2.ModelServiceProto.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("ModelService");
}
}
private static final class ModelServiceFileDescriptorSupplier
extends ModelServiceBaseDescriptorSupplier {
ModelServiceFileDescriptorSupplier() {}
}
private static final class ModelServiceMethodDescriptorSupplier
extends ModelServiceBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final java.lang.String methodName;
ModelServiceMethodDescriptorSupplier(java.lang.String methodName) {
this.methodName = methodName;
}
@java.lang.Override
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
return getServiceDescriptor().findMethodByName(methodName);
}
}
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
io.grpc.ServiceDescriptor result = serviceDescriptor;
if (result == null) {
synchronized (ModelServiceGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor =
result =
io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new ModelServiceFileDescriptorSupplier())
.addMethod(getCreateModelMethod())
.addMethod(getGetModelMethod())
.addMethod(getPauseModelMethod())
.addMethod(getResumeModelMethod())
.addMethod(getDeleteModelMethod())
.addMethod(getListModelsMethod())
.addMethod(getUpdateModelMethod())
.addMethod(getTuneModelMethod())
.build();
}
}
}
return result;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy