Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* 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.dialogflow.cx.v3beta1;
import static io.grpc.MethodDescriptor.generateFullMethodName;
/**
*
*
*
* Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
*
* Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
*
*/
public interface AsyncService {
/**
*
*
*
* Creates a flow in the specified agent.
* Note: You should always train a flow prior to sending it queries. See the
* [training
* documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
*
* Updates the specified flow.
* Note: You should always train a flow prior to sending it queries. See the
* [training
* documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
*
* Trains the specified flow. Note that only the flow in 'draft' environment
* is trained.
* This method is a [long-running
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
* The returned `Operation` type has the following method-specific fields:
* - `metadata`: An empty [Struct
* message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
* - `response`: An [Empty
* message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
* Note: You should always train a flow prior to sending it queries. See the
* [training
* documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
*
* Validates the specified flow and creates or updates validation results.
* Please call this API after the training is completed to get the complete
* validation results.
*
* Imports the specified flow to the specified agent from a binary file.
* This method is a [long-running
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
* The returned `Operation` type has the following method-specific fields:
* - `metadata`: An empty [Struct
* message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
* - `response`:
* [ImportFlowResponse][google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse]
* Note: You should always train a flow prior to sending it queries. See the
* [training
* documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
*
* Exports the specified flow to a binary file.
* This method is a [long-running
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
* The returned `Operation` type has the following method-specific fields:
* - `metadata`: An empty [Struct
* message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
* - `response`:
* [ExportFlowResponse][google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse]
* Note that resources (e.g. intents, entities, webhooks) that the flow
* references will also be exported.
*
*/
default void exportFlow(
com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getExportFlowMethod(), responseObserver);
}
}
/**
* Base class for the server implementation of the service Flows.
*
*
* Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
*
*/
public abstract static class FlowsImplBase implements io.grpc.BindableService, AsyncService {
@java.lang.Override
public final io.grpc.ServerServiceDefinition bindService() {
return FlowsGrpc.bindService(this);
}
}
/**
* A stub to allow clients to do asynchronous rpc calls to service Flows.
*
*
* Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
*
*/
public static final class FlowsStub extends io.grpc.stub.AbstractAsyncStub {
private FlowsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected FlowsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new FlowsStub(channel, callOptions);
}
/**
*
*
*
* Creates a flow in the specified agent.
* Note: You should always train a flow prior to sending it queries. See the
* [training
* documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
*
* Updates the specified flow.
* Note: You should always train a flow prior to sending it queries. See the
* [training
* documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
*
* Trains the specified flow. Note that only the flow in 'draft' environment
* is trained.
* This method is a [long-running
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
* The returned `Operation` type has the following method-specific fields:
* - `metadata`: An empty [Struct
* message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
* - `response`: An [Empty
* message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
* Note: You should always train a flow prior to sending it queries. See the
* [training
* documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
*
* Validates the specified flow and creates or updates validation results.
* Please call this API after the training is completed to get the complete
* validation results.
*
* Imports the specified flow to the specified agent from a binary file.
* This method is a [long-running
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
* The returned `Operation` type has the following method-specific fields:
* - `metadata`: An empty [Struct
* message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
* - `response`:
* [ImportFlowResponse][google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse]
* Note: You should always train a flow prior to sending it queries. See the
* [training
* documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
*
* Exports the specified flow to a binary file.
* This method is a [long-running
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
* The returned `Operation` type has the following method-specific fields:
* - `metadata`: An empty [Struct
* message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
* - `response`:
* [ExportFlowResponse][google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse]
* Note that resources (e.g. intents, entities, webhooks) that the flow
* references will also be exported.
*
*/
public void exportFlow(
com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getExportFlowMethod(), getCallOptions()), request, responseObserver);
}
}
/**
* A stub to allow clients to do synchronous rpc calls to service Flows.
*
*
* Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
*
*/
public static final class FlowsBlockingStub
extends io.grpc.stub.AbstractBlockingStub {
private FlowsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected FlowsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new FlowsBlockingStub(channel, callOptions);
}
/**
*
*
*
* Creates a flow in the specified agent.
* Note: You should always train a flow prior to sending it queries. See the
* [training
* documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
*
* Updates the specified flow.
* Note: You should always train a flow prior to sending it queries. See the
* [training
* documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
*
* Trains the specified flow. Note that only the flow in 'draft' environment
* is trained.
* This method is a [long-running
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
* The returned `Operation` type has the following method-specific fields:
* - `metadata`: An empty [Struct
* message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
* - `response`: An [Empty
* message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
* Note: You should always train a flow prior to sending it queries. See the
* [training
* documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
*
* Validates the specified flow and creates or updates validation results.
* Please call this API after the training is completed to get the complete
* validation results.
*
* Imports the specified flow to the specified agent from a binary file.
* This method is a [long-running
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
* The returned `Operation` type has the following method-specific fields:
* - `metadata`: An empty [Struct
* message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
* - `response`:
* [ImportFlowResponse][google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse]
* Note: You should always train a flow prior to sending it queries. See the
* [training
* documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
*
* Exports the specified flow to a binary file.
* This method is a [long-running
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
* The returned `Operation` type has the following method-specific fields:
* - `metadata`: An empty [Struct
* message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
* - `response`:
* [ExportFlowResponse][google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse]
* Note that resources (e.g. intents, entities, webhooks) that the flow
* references will also be exported.
*
*/
public com.google.longrunning.Operation exportFlow(
com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getExportFlowMethod(), getCallOptions(), request);
}
}
/**
* A stub to allow clients to do ListenableFuture-style rpc calls to service Flows.
*
*
* Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
*
*/
public static final class FlowsFutureStub
extends io.grpc.stub.AbstractFutureStub {
private FlowsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected FlowsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new FlowsFutureStub(channel, callOptions);
}
/**
*
*
*
* Creates a flow in the specified agent.
* Note: You should always train a flow prior to sending it queries. See the
* [training
* documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
*
* Updates the specified flow.
* Note: You should always train a flow prior to sending it queries. See the
* [training
* documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
*
* Trains the specified flow. Note that only the flow in 'draft' environment
* is trained.
* This method is a [long-running
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
* The returned `Operation` type has the following method-specific fields:
* - `metadata`: An empty [Struct
* message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
* - `response`: An [Empty
* message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
* Note: You should always train a flow prior to sending it queries. See the
* [training
* documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
*
* Validates the specified flow and creates or updates validation results.
* Please call this API after the training is completed to get the complete
* validation results.
*
* Imports the specified flow to the specified agent from a binary file.
* This method is a [long-running
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
* The returned `Operation` type has the following method-specific fields:
* - `metadata`: An empty [Struct
* message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
* - `response`:
* [ImportFlowResponse][google.cloud.dialogflow.cx.v3beta1.ImportFlowResponse]
* Note: You should always train a flow prior to sending it queries. See the
* [training
* documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
*
* Exports the specified flow to a binary file.
* This method is a [long-running
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
* The returned `Operation` type has the following method-specific fields:
* - `metadata`: An empty [Struct
* message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
* - `response`:
* [ExportFlowResponse][google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse]
* Note that resources (e.g. intents, entities, webhooks) that the flow
* references will also be exported.
*
*/
public com.google.common.util.concurrent.ListenableFuture
exportFlow(com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getExportFlowMethod(), getCallOptions()), request);
}
}
private static final int METHODID_CREATE_FLOW = 0;
private static final int METHODID_DELETE_FLOW = 1;
private static final int METHODID_LIST_FLOWS = 2;
private static final int METHODID_GET_FLOW = 3;
private static final int METHODID_UPDATE_FLOW = 4;
private static final int METHODID_TRAIN_FLOW = 5;
private static final int METHODID_VALIDATE_FLOW = 6;
private static final int METHODID_GET_FLOW_VALIDATION_RESULT = 7;
private static final int METHODID_IMPORT_FLOW = 8;
private static final int METHODID_EXPORT_FLOW = 9;
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_FLOW:
serviceImpl.createFlow(
(com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest) request,
(io.grpc.stub.StreamObserver)
responseObserver);
break;
case METHODID_DELETE_FLOW:
serviceImpl.deleteFlow(
(com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_LIST_FLOWS:
serviceImpl.listFlows(
(com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest) request,
(io.grpc.stub.StreamObserver<
com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse>)
responseObserver);
break;
case METHODID_GET_FLOW:
serviceImpl.getFlow(
(com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest) request,
(io.grpc.stub.StreamObserver)
responseObserver);
break;
case METHODID_UPDATE_FLOW:
serviceImpl.updateFlow(
(com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest) request,
(io.grpc.stub.StreamObserver)
responseObserver);
break;
case METHODID_TRAIN_FLOW:
serviceImpl.trainFlow(
(com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_VALIDATE_FLOW:
serviceImpl.validateFlow(
(com.google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest) request,
(io.grpc.stub.StreamObserver<
com.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult>)
responseObserver);
break;
case METHODID_GET_FLOW_VALIDATION_RESULT:
serviceImpl.getFlowValidationResult(
(com.google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest) request,
(io.grpc.stub.StreamObserver<
com.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult>)
responseObserver);
break;
case METHODID_IMPORT_FLOW:
serviceImpl.importFlow(
(com.google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_EXPORT_FLOW:
serviceImpl.exportFlow(
(com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest) 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(
getCreateFlowMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest,
com.google.cloud.dialogflow.cx.v3beta1.Flow>(service, METHODID_CREATE_FLOW)))
.addMethod(
getDeleteFlowMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest,
com.google.protobuf.Empty>(service, METHODID_DELETE_FLOW)))
.addMethod(
getListFlowsMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest,
com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse>(
service, METHODID_LIST_FLOWS)))
.addMethod(
getGetFlowMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest,
com.google.cloud.dialogflow.cx.v3beta1.Flow>(service, METHODID_GET_FLOW)))
.addMethod(
getUpdateFlowMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest,
com.google.cloud.dialogflow.cx.v3beta1.Flow>(service, METHODID_UPDATE_FLOW)))
.addMethod(
getTrainFlowMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest,
com.google.longrunning.Operation>(service, METHODID_TRAIN_FLOW)))
.addMethod(
getValidateFlowMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.dialogflow.cx.v3beta1.ValidateFlowRequest,
com.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult>(
service, METHODID_VALIDATE_FLOW)))
.addMethod(
getGetFlowValidationResultMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.dialogflow.cx.v3beta1.GetFlowValidationResultRequest,
com.google.cloud.dialogflow.cx.v3beta1.FlowValidationResult>(
service, METHODID_GET_FLOW_VALIDATION_RESULT)))
.addMethod(
getImportFlowMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest,
com.google.longrunning.Operation>(service, METHODID_IMPORT_FLOW)))
.addMethod(
getExportFlowMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest,
com.google.longrunning.Operation>(service, METHODID_EXPORT_FLOW)))
.build();
}
private abstract static class FlowsBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier,
io.grpc.protobuf.ProtoServiceDescriptorSupplier {
FlowsBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return com.google.cloud.dialogflow.cx.v3beta1.FlowProto.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("Flows");
}
}
private static final class FlowsFileDescriptorSupplier extends FlowsBaseDescriptorSupplier {
FlowsFileDescriptorSupplier() {}
}
private static final class FlowsMethodDescriptorSupplier extends FlowsBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final java.lang.String methodName;
FlowsMethodDescriptorSupplier(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 (FlowsGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor =
result =
io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new FlowsFileDescriptorSupplier())
.addMethod(getCreateFlowMethod())
.addMethod(getDeleteFlowMethod())
.addMethod(getListFlowsMethod())
.addMethod(getGetFlowMethod())
.addMethod(getUpdateFlowMethod())
.addMethod(getTrainFlowMethod())
.addMethod(getValidateFlowMethod())
.addMethod(getGetFlowValidationResultMethod())
.addMethod(getImportFlowMethod())
.addMethod(getExportFlowMethod())
.build();
}
}
}
return result;
}
}