All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.language.v1.LanguageServiceGrpc Maven / Gradle / Ivy

There is a newer version: 2.50.0
Show newest version
package com.google.cloud.language.v1;

import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;

/**
 * 
 * Provides text analysis operations such as sentiment analysis and entity
 * recognition.
 * 
*/ @javax.annotation.Generated( value = "by gRPC proto compiler (version 1.2.0)", comments = "Source: google/cloud/language/v1/language_service.proto") public final class LanguageServiceGrpc { private LanguageServiceGrpc() {} public static final String SERVICE_NAME = "google.cloud.language.v1.LanguageService"; // Static method descriptors that strictly reflect the proto. @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_ANALYZE_SENTIMENT = io.grpc.MethodDescriptor.create( io.grpc.MethodDescriptor.MethodType.UNARY, generateFullMethodName( "google.cloud.language.v1.LanguageService", "AnalyzeSentiment"), io.grpc.protobuf.ProtoUtils.marshaller(com.google.cloud.language.v1.AnalyzeSentimentRequest.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(com.google.cloud.language.v1.AnalyzeSentimentResponse.getDefaultInstance())); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_ANALYZE_ENTITIES = io.grpc.MethodDescriptor.create( io.grpc.MethodDescriptor.MethodType.UNARY, generateFullMethodName( "google.cloud.language.v1.LanguageService", "AnalyzeEntities"), io.grpc.protobuf.ProtoUtils.marshaller(com.google.cloud.language.v1.AnalyzeEntitiesRequest.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(com.google.cloud.language.v1.AnalyzeEntitiesResponse.getDefaultInstance())); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_ANALYZE_SYNTAX = io.grpc.MethodDescriptor.create( io.grpc.MethodDescriptor.MethodType.UNARY, generateFullMethodName( "google.cloud.language.v1.LanguageService", "AnalyzeSyntax"), io.grpc.protobuf.ProtoUtils.marshaller(com.google.cloud.language.v1.AnalyzeSyntaxRequest.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(com.google.cloud.language.v1.AnalyzeSyntaxResponse.getDefaultInstance())); @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_ANNOTATE_TEXT = io.grpc.MethodDescriptor.create( io.grpc.MethodDescriptor.MethodType.UNARY, generateFullMethodName( "google.cloud.language.v1.LanguageService", "AnnotateText"), io.grpc.protobuf.ProtoUtils.marshaller(com.google.cloud.language.v1.AnnotateTextRequest.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(com.google.cloud.language.v1.AnnotateTextResponse.getDefaultInstance())); /** * Creates a new async stub that supports all call types for the service */ public static LanguageServiceStub newStub(io.grpc.Channel channel) { return new LanguageServiceStub(channel); } /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ public static LanguageServiceBlockingStub newBlockingStub( io.grpc.Channel channel) { return new LanguageServiceBlockingStub(channel); } /** * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service */ public static LanguageServiceFutureStub newFutureStub( io.grpc.Channel channel) { return new LanguageServiceFutureStub(channel); } /** *
   * Provides text analysis operations such as sentiment analysis and entity
   * recognition.
   * 
*/ public static abstract class LanguageServiceImplBase implements io.grpc.BindableService { /** *
     * Analyzes the sentiment of the provided text.
     * 
*/ public void analyzeSentiment(com.google.cloud.language.v1.AnalyzeSentimentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(METHOD_ANALYZE_SENTIMENT, responseObserver); } /** *
     * Finds named entities (currently proper names and common nouns) in the text
     * along with entity types, salience, mentions for each entity, and
     * other properties.
     * 
*/ public void analyzeEntities(com.google.cloud.language.v1.AnalyzeEntitiesRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(METHOD_ANALYZE_ENTITIES, responseObserver); } /** *
     * Analyzes the syntax of the text and provides sentence boundaries and
     * tokenization along with part of speech tags, dependency trees, and other
     * properties.
     * 
*/ public void analyzeSyntax(com.google.cloud.language.v1.AnalyzeSyntaxRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(METHOD_ANALYZE_SYNTAX, responseObserver); } /** *
     * A convenience method that provides all the features that analyzeSentiment,
     * analyzeEntities, and analyzeSyntax provide in one call.
     * 
*/ public void annotateText(com.google.cloud.language.v1.AnnotateTextRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(METHOD_ANNOTATE_TEXT, responseObserver); } @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( METHOD_ANALYZE_SENTIMENT, asyncUnaryCall( new MethodHandlers< com.google.cloud.language.v1.AnalyzeSentimentRequest, com.google.cloud.language.v1.AnalyzeSentimentResponse>( this, METHODID_ANALYZE_SENTIMENT))) .addMethod( METHOD_ANALYZE_ENTITIES, asyncUnaryCall( new MethodHandlers< com.google.cloud.language.v1.AnalyzeEntitiesRequest, com.google.cloud.language.v1.AnalyzeEntitiesResponse>( this, METHODID_ANALYZE_ENTITIES))) .addMethod( METHOD_ANALYZE_SYNTAX, asyncUnaryCall( new MethodHandlers< com.google.cloud.language.v1.AnalyzeSyntaxRequest, com.google.cloud.language.v1.AnalyzeSyntaxResponse>( this, METHODID_ANALYZE_SYNTAX))) .addMethod( METHOD_ANNOTATE_TEXT, asyncUnaryCall( new MethodHandlers< com.google.cloud.language.v1.AnnotateTextRequest, com.google.cloud.language.v1.AnnotateTextResponse>( this, METHODID_ANNOTATE_TEXT))) .build(); } } /** *
   * Provides text analysis operations such as sentiment analysis and entity
   * recognition.
   * 
*/ public static final class LanguageServiceStub extends io.grpc.stub.AbstractStub { private LanguageServiceStub(io.grpc.Channel channel) { super(channel); } private LanguageServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected LanguageServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new LanguageServiceStub(channel, callOptions); } /** *
     * Analyzes the sentiment of the provided text.
     * 
*/ public void analyzeSentiment(com.google.cloud.language.v1.AnalyzeSentimentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(METHOD_ANALYZE_SENTIMENT, getCallOptions()), request, responseObserver); } /** *
     * Finds named entities (currently proper names and common nouns) in the text
     * along with entity types, salience, mentions for each entity, and
     * other properties.
     * 
*/ public void analyzeEntities(com.google.cloud.language.v1.AnalyzeEntitiesRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(METHOD_ANALYZE_ENTITIES, getCallOptions()), request, responseObserver); } /** *
     * Analyzes the syntax of the text and provides sentence boundaries and
     * tokenization along with part of speech tags, dependency trees, and other
     * properties.
     * 
*/ public void analyzeSyntax(com.google.cloud.language.v1.AnalyzeSyntaxRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(METHOD_ANALYZE_SYNTAX, getCallOptions()), request, responseObserver); } /** *
     * A convenience method that provides all the features that analyzeSentiment,
     * analyzeEntities, and analyzeSyntax provide in one call.
     * 
*/ public void annotateText(com.google.cloud.language.v1.AnnotateTextRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(METHOD_ANNOTATE_TEXT, getCallOptions()), request, responseObserver); } } /** *
   * Provides text analysis operations such as sentiment analysis and entity
   * recognition.
   * 
*/ public static final class LanguageServiceBlockingStub extends io.grpc.stub.AbstractStub { private LanguageServiceBlockingStub(io.grpc.Channel channel) { super(channel); } private LanguageServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected LanguageServiceBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new LanguageServiceBlockingStub(channel, callOptions); } /** *
     * Analyzes the sentiment of the provided text.
     * 
*/ public com.google.cloud.language.v1.AnalyzeSentimentResponse analyzeSentiment(com.google.cloud.language.v1.AnalyzeSentimentRequest request) { return blockingUnaryCall( getChannel(), METHOD_ANALYZE_SENTIMENT, getCallOptions(), request); } /** *
     * Finds named entities (currently proper names and common nouns) in the text
     * along with entity types, salience, mentions for each entity, and
     * other properties.
     * 
*/ public com.google.cloud.language.v1.AnalyzeEntitiesResponse analyzeEntities(com.google.cloud.language.v1.AnalyzeEntitiesRequest request) { return blockingUnaryCall( getChannel(), METHOD_ANALYZE_ENTITIES, getCallOptions(), request); } /** *
     * Analyzes the syntax of the text and provides sentence boundaries and
     * tokenization along with part of speech tags, dependency trees, and other
     * properties.
     * 
*/ public com.google.cloud.language.v1.AnalyzeSyntaxResponse analyzeSyntax(com.google.cloud.language.v1.AnalyzeSyntaxRequest request) { return blockingUnaryCall( getChannel(), METHOD_ANALYZE_SYNTAX, getCallOptions(), request); } /** *
     * A convenience method that provides all the features that analyzeSentiment,
     * analyzeEntities, and analyzeSyntax provide in one call.
     * 
*/ public com.google.cloud.language.v1.AnnotateTextResponse annotateText(com.google.cloud.language.v1.AnnotateTextRequest request) { return blockingUnaryCall( getChannel(), METHOD_ANNOTATE_TEXT, getCallOptions(), request); } } /** *
   * Provides text analysis operations such as sentiment analysis and entity
   * recognition.
   * 
*/ public static final class LanguageServiceFutureStub extends io.grpc.stub.AbstractStub { private LanguageServiceFutureStub(io.grpc.Channel channel) { super(channel); } private LanguageServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected LanguageServiceFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new LanguageServiceFutureStub(channel, callOptions); } /** *
     * Analyzes the sentiment of the provided text.
     * 
*/ public com.google.common.util.concurrent.ListenableFuture analyzeSentiment( com.google.cloud.language.v1.AnalyzeSentimentRequest request) { return futureUnaryCall( getChannel().newCall(METHOD_ANALYZE_SENTIMENT, getCallOptions()), request); } /** *
     * Finds named entities (currently proper names and common nouns) in the text
     * along with entity types, salience, mentions for each entity, and
     * other properties.
     * 
*/ public com.google.common.util.concurrent.ListenableFuture analyzeEntities( com.google.cloud.language.v1.AnalyzeEntitiesRequest request) { return futureUnaryCall( getChannel().newCall(METHOD_ANALYZE_ENTITIES, getCallOptions()), request); } /** *
     * Analyzes the syntax of the text and provides sentence boundaries and
     * tokenization along with part of speech tags, dependency trees, and other
     * properties.
     * 
*/ public com.google.common.util.concurrent.ListenableFuture analyzeSyntax( com.google.cloud.language.v1.AnalyzeSyntaxRequest request) { return futureUnaryCall( getChannel().newCall(METHOD_ANALYZE_SYNTAX, getCallOptions()), request); } /** *
     * A convenience method that provides all the features that analyzeSentiment,
     * analyzeEntities, and analyzeSyntax provide in one call.
     * 
*/ public com.google.common.util.concurrent.ListenableFuture annotateText( com.google.cloud.language.v1.AnnotateTextRequest request) { return futureUnaryCall( getChannel().newCall(METHOD_ANNOTATE_TEXT, getCallOptions()), request); } } private static final int METHODID_ANALYZE_SENTIMENT = 0; private static final int METHODID_ANALYZE_ENTITIES = 1; private static final int METHODID_ANALYZE_SYNTAX = 2; private static final int METHODID_ANNOTATE_TEXT = 3; 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 LanguageServiceImplBase serviceImpl; private final int methodId; MethodHandlers(LanguageServiceImplBase 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_ANALYZE_SENTIMENT: serviceImpl.analyzeSentiment((com.google.cloud.language.v1.AnalyzeSentimentRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_ANALYZE_ENTITIES: serviceImpl.analyzeEntities((com.google.cloud.language.v1.AnalyzeEntitiesRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_ANALYZE_SYNTAX: serviceImpl.analyzeSyntax((com.google.cloud.language.v1.AnalyzeSyntaxRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_ANNOTATE_TEXT: serviceImpl.annotateText((com.google.cloud.language.v1.AnnotateTextRequest) 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(); } } } private static final class LanguageServiceDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier { @java.lang.Override public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { return com.google.cloud.language.v1.LanguageServiceProto.getDescriptor(); } } private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { io.grpc.ServiceDescriptor result = serviceDescriptor; if (result == null) { synchronized (LanguageServiceGrpc.class) { result = serviceDescriptor; if (result == null) { serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) .setSchemaDescriptor(new LanguageServiceDescriptorSupplier()) .addMethod(METHOD_ANALYZE_SENTIMENT) .addMethod(METHOD_ANALYZE_ENTITIES) .addMethod(METHOD_ANALYZE_SYNTAX) .addMethod(METHOD_ANNOTATE_TEXT) .build(); } } } return result; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy