Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

feat: Expose supported languages of the agent #205

Merged
merged 3 commits into from
May 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,9 @@ public final UnaryCallable<DeleteAgentRequest, Empty> deleteAgentCallable() {
* ExportAgentRequest.newBuilder()
* .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
* .setAgentUri("agentUri1469149223")
* .setEnvironment(
* EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]")
* .toString())
* .build();
* ExportAgentResponse response = agentsClient.exportAgentAsync(request).get();
* }
Expand All @@ -686,6 +689,9 @@ public final OperationFuture<ExportAgentResponse, Struct> exportAgentAsync(
* ExportAgentRequest.newBuilder()
* .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
* .setAgentUri("agentUri1469149223")
* .setEnvironment(
* EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]")
* .toString())
* .build();
* OperationFuture<ExportAgentResponse, Struct> future =
* agentsClient.exportAgentOperationCallable().futureCall(request);
Expand All @@ -711,6 +717,9 @@ public final OperationFuture<ExportAgentResponse, Struct> exportAgentAsync(
* ExportAgentRequest.newBuilder()
* .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
* .setAgentUri("agentUri1469149223")
* .setEnvironment(
* EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]")
* .toString())
* .build();
* ApiFuture<Operation> future = agentsClient.exportAgentCallable().futureCall(request);
* // Do something.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,161 @@ public final FlowValidationResult getFlowValidationResult(
return stub.getFlowValidationResultCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Imports the specified flow to the specified agent from a binary file.
*
* <p>Sample code:
*
* <pre>{@code
* try (FlowsClient flowsClient = FlowsClient.create()) {
* ImportFlowRequest request =
* ImportFlowRequest.newBuilder()
* .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString())
* .build();
* ImportFlowResponse response = flowsClient.importFlowAsync(request).get();
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<ImportFlowResponse, Struct> importFlowAsync(
ImportFlowRequest request) {
return importFlowOperationCallable().futureCall(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Imports the specified flow to the specified agent from a binary file.
*
* <p>Sample code:
*
* <pre>{@code
* try (FlowsClient flowsClient = FlowsClient.create()) {
* ImportFlowRequest request =
* ImportFlowRequest.newBuilder()
* .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString())
* .build();
* OperationFuture<ImportFlowResponse, Struct> future =
* flowsClient.importFlowOperationCallable().futureCall(request);
* // Do something.
* ImportFlowResponse response = future.get();
* }
* }</pre>
*/
public final OperationCallable<ImportFlowRequest, ImportFlowResponse, Struct>
importFlowOperationCallable() {
return stub.importFlowOperationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Imports the specified flow to the specified agent from a binary file.
*
* <p>Sample code:
*
* <pre>{@code
* try (FlowsClient flowsClient = FlowsClient.create()) {
* ImportFlowRequest request =
* ImportFlowRequest.newBuilder()
* .setParent(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString())
* .build();
* ApiFuture<Operation> future = flowsClient.importFlowCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<ImportFlowRequest, Operation> importFlowCallable() {
return stub.importFlowCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Exports the specified flow to a binary file.
*
* <p>Note that resources (e.g. intents, entities, webhooks) that the flow references will also be
* exported.
*
* <p>Sample code:
*
* <pre>{@code
* try (FlowsClient flowsClient = FlowsClient.create()) {
* ExportFlowRequest request =
* ExportFlowRequest.newBuilder()
* .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString())
* .setFlowUri("flowUri-765815458")
* .setIncludeReferencedFlows(true)
* .build();
* ExportFlowResponse response = flowsClient.exportFlowAsync(request).get();
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<ExportFlowResponse, Struct> exportFlowAsync(
ExportFlowRequest request) {
return exportFlowOperationCallable().futureCall(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Exports the specified flow to a binary file.
*
* <p>Note that resources (e.g. intents, entities, webhooks) that the flow references will also be
* exported.
*
* <p>Sample code:
*
* <pre>{@code
* try (FlowsClient flowsClient = FlowsClient.create()) {
* ExportFlowRequest request =
* ExportFlowRequest.newBuilder()
* .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString())
* .setFlowUri("flowUri-765815458")
* .setIncludeReferencedFlows(true)
* .build();
* OperationFuture<ExportFlowResponse, Struct> future =
* flowsClient.exportFlowOperationCallable().futureCall(request);
* // Do something.
* ExportFlowResponse response = future.get();
* }
* }</pre>
*/
public final OperationCallable<ExportFlowRequest, ExportFlowResponse, Struct>
exportFlowOperationCallable() {
return stub.exportFlowOperationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Exports the specified flow to a binary file.
*
* <p>Note that resources (e.g. intents, entities, webhooks) that the flow references will also be
* exported.
*
* <p>Sample code:
*
* <pre>{@code
* try (FlowsClient flowsClient = FlowsClient.create()) {
* ExportFlowRequest request =
* ExportFlowRequest.newBuilder()
* .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString())
* .setFlowUri("flowUri-765815458")
* .setIncludeReferencedFlows(true)
* .build();
* ApiFuture<Operation> future = flowsClient.exportFlowCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<ExportFlowRequest, Operation> exportFlowCallable() {
return stub.exportFlowCallable();
}

@Override
public final void close() {
stub.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,28 @@ public UnaryCallSettings<ValidateFlowRequest, FlowValidationResult> validateFlow
return ((FlowsStubSettings) getStubSettings()).getFlowValidationResultSettings();
}

/** Returns the object with the settings used for calls to importFlow. */
public UnaryCallSettings<ImportFlowRequest, Operation> importFlowSettings() {
return ((FlowsStubSettings) getStubSettings()).importFlowSettings();
}

/** Returns the object with the settings used for calls to importFlow. */
public OperationCallSettings<ImportFlowRequest, ImportFlowResponse, Struct>
importFlowOperationSettings() {
return ((FlowsStubSettings) getStubSettings()).importFlowOperationSettings();
}

/** Returns the object with the settings used for calls to exportFlow. */
public UnaryCallSettings<ExportFlowRequest, Operation> exportFlowSettings() {
return ((FlowsStubSettings) getStubSettings()).exportFlowSettings();
}

/** Returns the object with the settings used for calls to exportFlow. */
public OperationCallSettings<ExportFlowRequest, ExportFlowResponse, Struct>
exportFlowOperationSettings() {
return ((FlowsStubSettings) getStubSettings()).exportFlowOperationSettings();
}

public static final FlowsSettings create(FlowsStubSettings stub) throws IOException {
return new FlowsSettings.Builder(stub.toBuilder()).build();
}
Expand Down Expand Up @@ -265,6 +287,28 @@ public UnaryCallSettings.Builder<TrainFlowRequest, Operation> trainFlowSettings(
return getStubSettingsBuilder().getFlowValidationResultSettings();
}

/** Returns the builder for the settings used for calls to importFlow. */
public UnaryCallSettings.Builder<ImportFlowRequest, Operation> importFlowSettings() {
return getStubSettingsBuilder().importFlowSettings();
}

/** Returns the builder for the settings used for calls to importFlow. */
public OperationCallSettings.Builder<ImportFlowRequest, ImportFlowResponse, Struct>
importFlowOperationSettings() {
return getStubSettingsBuilder().importFlowOperationSettings();
}

/** Returns the builder for the settings used for calls to exportFlow. */
public UnaryCallSettings.Builder<ExportFlowRequest, Operation> exportFlowSettings() {
return getStubSettingsBuilder().exportFlowSettings();
}

/** Returns the builder for the settings used for calls to exportFlow. */
public OperationCallSettings.Builder<ExportFlowRequest, ExportFlowResponse, Struct>
exportFlowOperationSettings() {
return getStubSettingsBuilder().exportFlowOperationSettings();
}

@Override
public FlowsSettings build() throws IOException {
return new FlowsSettings(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ public final UnaryCallable<DeleteVersionRequest, Empty> deleteVersionCallable()

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Loads a specified version to draft version.
* Loads resources in the specified version to the draft flow.
*
* <p>Sample code:
*
Expand All @@ -736,7 +736,7 @@ public final UnaryCallable<DeleteVersionRequest, Empty> deleteVersionCallable()
* }</pre>
*
* @param name Required. The [Version][google.cloud.dialogflow.cx.v3.Version] to be loaded to
* draft version. Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
* draft flow. Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
* ID&gt;/agents/&lt;Agent ID&gt;/flows/&lt;Flow ID&gt;/versions/&lt;Version ID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand All @@ -748,7 +748,7 @@ public final OperationFuture<Empty, Struct> loadVersionAsync(VersionName name) {

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Loads a specified version to draft version.
* Loads resources in the specified version to the draft flow.
*
* <p>Sample code:
*
Expand All @@ -761,7 +761,7 @@ public final OperationFuture<Empty, Struct> loadVersionAsync(VersionName name) {
* }</pre>
*
* @param name Required. The [Version][google.cloud.dialogflow.cx.v3.Version] to be loaded to
* draft version. Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
* draft flow. Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
* ID&gt;/agents/&lt;Agent ID&gt;/flows/&lt;Flow ID&gt;/versions/&lt;Version ID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand All @@ -772,7 +772,7 @@ public final OperationFuture<Empty, Struct> loadVersionAsync(String name) {

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Loads a specified version to draft version.
* Loads resources in the specified version to the draft flow.
*
* <p>Sample code:
*
Expand All @@ -798,7 +798,7 @@ public final OperationFuture<Empty, Struct> loadVersionAsync(LoadVersionRequest

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Loads a specified version to draft version.
* Loads resources in the specified version to the draft flow.
*
* <p>Sample code:
*
Expand All @@ -824,7 +824,7 @@ public final OperationCallable<LoadVersionRequest, Empty, Struct> loadVersionOpe

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Loads a specified version to draft version.
* Loads resources in the specified version to the draft flow.
*
* <p>Sample code:
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,18 @@
"DeleteFlow": {
"methods": ["deleteFlow", "deleteFlow", "deleteFlow", "deleteFlowCallable"]
},
"ExportFlow": {
"methods": ["exportFlowAsync", "exportFlowOperationCallable", "exportFlowCallable"]
},
"GetFlow": {
"methods": ["getFlow", "getFlow", "getFlow", "getFlowCallable"]
},
"GetFlowValidationResult": {
"methods": ["getFlowValidationResult", "getFlowValidationResult", "getFlowValidationResult", "getFlowValidationResultCallable"]
},
"ImportFlow": {
"methods": ["importFlowAsync", "importFlowOperationCallable", "importFlowCallable"]
},
"ListFlows": {
"methods": ["listFlows", "listFlows", "listFlows", "listFlowsPagedCallable", "listFlowsCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.dialogflow.cx.v3.CreateFlowRequest;
import com.google.cloud.dialogflow.cx.v3.DeleteFlowRequest;
import com.google.cloud.dialogflow.cx.v3.ExportFlowRequest;
import com.google.cloud.dialogflow.cx.v3.ExportFlowResponse;
import com.google.cloud.dialogflow.cx.v3.Flow;
import com.google.cloud.dialogflow.cx.v3.FlowValidationResult;
import com.google.cloud.dialogflow.cx.v3.GetFlowRequest;
import com.google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest;
import com.google.cloud.dialogflow.cx.v3.ImportFlowRequest;
import com.google.cloud.dialogflow.cx.v3.ImportFlowResponse;
import com.google.cloud.dialogflow.cx.v3.ListFlowsRequest;
import com.google.cloud.dialogflow.cx.v3.ListFlowsResponse;
import com.google.cloud.dialogflow.cx.v3.TrainFlowRequest;
Expand Down Expand Up @@ -92,6 +96,24 @@ public UnaryCallable<ValidateFlowRequest, FlowValidationResult> validateFlowCall
throw new UnsupportedOperationException("Not implemented: getFlowValidationResultCallable()");
}

public OperationCallable<ImportFlowRequest, ImportFlowResponse, Struct>
importFlowOperationCallable() {
throw new UnsupportedOperationException("Not implemented: importFlowOperationCallable()");
}

public UnaryCallable<ImportFlowRequest, Operation> importFlowCallable() {
throw new UnsupportedOperationException("Not implemented: importFlowCallable()");
}

public OperationCallable<ExportFlowRequest, ExportFlowResponse, Struct>
exportFlowOperationCallable() {
throw new UnsupportedOperationException("Not implemented: exportFlowOperationCallable()");
}

public UnaryCallable<ExportFlowRequest, Operation> exportFlowCallable() {
throw new UnsupportedOperationException("Not implemented: exportFlowCallable()");
}

@Override
public abstract void close();
}
Loading