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

Commit

Permalink
feat: allow setting custom CA for generic webhooks and release Compar…
Browse files Browse the repository at this point in the history
…eVersions API docs: clarify DLP template reader usage (#362)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 410299375

Source-Link: googleapis/googleapis@4a4ec6d

Source-Link: googleapis/googleapis-gen@043e044
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDQzZTA0NGNhOTYzYTE1OTY2ZDUwZjRjMmIyMWJmYmQ3M2FmYWE5NCJ9
  • Loading branch information
gcf-owl-bot[bot] committed Nov 17, 2021
1 parent dd9ce6e commit 1d581ad
Show file tree
Hide file tree
Showing 55 changed files with 5,033 additions and 1,153 deletions.
Expand Up @@ -179,8 +179,8 @@ public final OperationsClient getOperationsClient() {
* }</pre>
*
* @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to list all versions
* for. Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
* ID&gt;/flows/&lt;Flow ID&gt;`.
* for. Format:
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListVersionsPagedResponse listVersions(FlowName parent) {
Expand All @@ -207,8 +207,8 @@ public final ListVersionsPagedResponse listVersions(FlowName parent) {
* }</pre>
*
* @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to list all versions
* for. Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
* ID&gt;/flows/&lt;Flow ID&gt;`.
* for. Format:
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListVersionsPagedResponse listVersions(String parent) {
Expand Down Expand Up @@ -318,8 +318,7 @@ public final UnaryCallable<ListVersionsRequest, ListVersionsResponse> listVersio
* }</pre>
*
* @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version]. 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;`.
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;/versions/&lt;VersionID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Version getVersion(VersionName name) {
Expand All @@ -343,8 +342,7 @@ public final Version getVersion(VersionName name) {
* }</pre>
*
* @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version]. 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;`.
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;/versions/&lt;VersionID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Version getVersion(String name) {
Expand Down Expand Up @@ -425,8 +423,8 @@ public final UnaryCallable<GetVersionRequest, Version> getVersionCallable() {
* }</pre>
*
* @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to create an
* [Version][google.cloud.dialogflow.cx.v3.Version] for. Format: `projects/&lt;Project
* ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent ID&gt;/flows/&lt;Flow ID&gt;`.
* [Version][google.cloud.dialogflow.cx.v3.Version] for. Format:
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;`.
* @param version Required. The version to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand Down Expand Up @@ -464,8 +462,8 @@ public final OperationFuture<Version, CreateVersionOperationMetadata> createVers
* }</pre>
*
* @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to create an
* [Version][google.cloud.dialogflow.cx.v3.Version] for. Format: `projects/&lt;Project
* ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent ID&gt;/flows/&lt;Flow ID&gt;`.
* [Version][google.cloud.dialogflow.cx.v3.Version] for. Format:
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;`.
* @param version Required. The version to create.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand Down Expand Up @@ -663,8 +661,8 @@ public final UnaryCallable<UpdateVersionRequest, Version> updateVersionCallable(
* }</pre>
*
* @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version] to
* delete. 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;`.
* delete. Format:
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;/versions/&lt;VersionID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteVersion(VersionName name) {
Expand All @@ -688,8 +686,8 @@ public final void deleteVersion(VersionName name) {
* }</pre>
*
* @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version] to
* delete. 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;`.
* delete. Format:
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;/versions/&lt;VersionID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteVersion(String name) {
Expand Down Expand Up @@ -770,8 +768,8 @@ public final UnaryCallable<DeleteVersionRequest, Empty> deleteVersionCallable()
* }</pre>
*
* @param name Required. The [Version][google.cloud.dialogflow.cx.v3.Version] to be loaded to
* 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;`.
* draft flow. Format:
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;/versions/&lt;VersionID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<Empty, Struct> loadVersionAsync(VersionName name) {
Expand Down Expand Up @@ -804,8 +802,8 @@ 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 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;`.
* draft flow. Format:
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;/versions/&lt;VersionID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<Empty, Struct> loadVersionAsync(String name) {
Expand Down Expand Up @@ -917,6 +915,119 @@ public final UnaryCallable<LoadVersionRequest, Operation> loadVersionCallable()
return stub.loadVersionCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Compares the specified base version with target version.
*
* <p>Sample code:
*
* <pre>{@code
* try (VersionsClient versionsClient = VersionsClient.create()) {
* VersionName baseVersion =
* VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
* CompareVersionsResponse response = versionsClient.compareVersions(baseVersion);
* }
* }</pre>
*
* @param baseVersion Required. Name of the base flow version to compare with the target version.
* Use version ID `0` to indicate the draft version of the specified flow.
* <p>Format:
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;/versions/&lt;VersionID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final CompareVersionsResponse compareVersions(VersionName baseVersion) {
CompareVersionsRequest request =
CompareVersionsRequest.newBuilder()
.setBaseVersion(baseVersion == null ? null : baseVersion.toString())
.build();
return compareVersions(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Compares the specified base version with target version.
*
* <p>Sample code:
*
* <pre>{@code
* try (VersionsClient versionsClient = VersionsClient.create()) {
* String baseVersion =
* VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]").toString();
* CompareVersionsResponse response = versionsClient.compareVersions(baseVersion);
* }
* }</pre>
*
* @param baseVersion Required. Name of the base flow version to compare with the target version.
* Use version ID `0` to indicate the draft version of the specified flow.
* <p>Format:
* `projects/&lt;ProjectID&gt;/locations/&lt;LocationID&gt;/agents/&lt;AgentID&gt;/flows/&lt;FlowID&gt;/versions/&lt;VersionID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final CompareVersionsResponse compareVersions(String baseVersion) {
CompareVersionsRequest request =
CompareVersionsRequest.newBuilder().setBaseVersion(baseVersion).build();
return compareVersions(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Compares the specified base version with target version.
*
* <p>Sample code:
*
* <pre>{@code
* try (VersionsClient versionsClient = VersionsClient.create()) {
* CompareVersionsRequest request =
* CompareVersionsRequest.newBuilder()
* .setBaseVersion(
* VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]")
* .toString())
* .setTargetVersion(
* VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]")
* .toString())
* .setLanguageCode("languageCode-2092349083")
* .build();
* CompareVersionsResponse response = versionsClient.compareVersions(request);
* }
* }</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 CompareVersionsResponse compareVersions(CompareVersionsRequest request) {
return compareVersionsCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Compares the specified base version with target version.
*
* <p>Sample code:
*
* <pre>{@code
* try (VersionsClient versionsClient = VersionsClient.create()) {
* CompareVersionsRequest request =
* CompareVersionsRequest.newBuilder()
* .setBaseVersion(
* VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]")
* .toString())
* .setTargetVersion(
* VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]")
* .toString())
* .setLanguageCode("languageCode-2092349083")
* .build();
* ApiFuture<CompareVersionsResponse> future =
* versionsClient.compareVersionsCallable().futureCall(request);
* // Do something.
* CompareVersionsResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<CompareVersionsRequest, CompareVersionsResponse>
compareVersionsCallable() {
return stub.compareVersionsCallable();
}

@Override
public final void close() {
stub.close();
Expand Down
Expand Up @@ -114,6 +114,12 @@ public OperationCallSettings<LoadVersionRequest, Empty, Struct> loadVersionOpera
return ((VersionsStubSettings) getStubSettings()).loadVersionOperationSettings();
}

/** Returns the object with the settings used for calls to compareVersions. */
public UnaryCallSettings<CompareVersionsRequest, CompareVersionsResponse>
compareVersionsSettings() {
return ((VersionsStubSettings) getStubSettings()).compareVersionsSettings();
}

public static final VersionsSettings create(VersionsStubSettings stub) throws IOException {
return new VersionsSettings.Builder(stub.toBuilder()).build();
}
Expand Down Expand Up @@ -255,6 +261,12 @@ public UnaryCallSettings.Builder<LoadVersionRequest, Operation> loadVersionSetti
return getStubSettingsBuilder().loadVersionOperationSettings();
}

/** Returns the builder for the settings used for calls to compareVersions. */
public UnaryCallSettings.Builder<CompareVersionsRequest, CompareVersionsResponse>
compareVersionsSettings() {
return getStubSettingsBuilder().compareVersionsSettings();
}

@Override
public VersionsSettings build() throws IOException {
return new VersionsSettings(this);
Expand Down
Expand Up @@ -391,6 +391,9 @@
"grpc": {
"libraryClient": "VersionsClient",
"rpcs": {
"CompareVersions": {
"methods": ["compareVersions", "compareVersions", "compareVersions", "compareVersionsCallable"]
},
"CreateVersion": {
"methods": ["createVersionAsync", "createVersionAsync", "createVersionAsync", "createVersionOperationCallable", "createVersionCallable"]
},
Expand Down
Expand Up @@ -25,6 +25,8 @@
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.dialogflow.cx.v3.CompareVersionsRequest;
import com.google.cloud.dialogflow.cx.v3.CompareVersionsResponse;
import com.google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata;
import com.google.cloud.dialogflow.cx.v3.CreateVersionRequest;
import com.google.cloud.dialogflow.cx.v3.DeleteVersionRequest;
Expand Down Expand Up @@ -107,6 +109,17 @@ public class GrpcVersionsStub extends VersionsStub {
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.build();

private static final MethodDescriptor<CompareVersionsRequest, CompareVersionsResponse>
compareVersionsMethodDescriptor =
MethodDescriptor.<CompareVersionsRequest, CompareVersionsResponse>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.cloud.dialogflow.cx.v3.Versions/CompareVersions")
.setRequestMarshaller(
ProtoUtils.marshaller(CompareVersionsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(CompareVersionsResponse.getDefaultInstance()))
.build();

private final UnaryCallable<ListVersionsRequest, ListVersionsResponse> listVersionsCallable;
private final UnaryCallable<ListVersionsRequest, ListVersionsPagedResponse>
listVersionsPagedCallable;
Expand All @@ -118,6 +131,8 @@ public class GrpcVersionsStub extends VersionsStub {
private final UnaryCallable<DeleteVersionRequest, Empty> deleteVersionCallable;
private final UnaryCallable<LoadVersionRequest, Operation> loadVersionCallable;
private final OperationCallable<LoadVersionRequest, Empty, Struct> loadVersionOperationCallable;
private final UnaryCallable<CompareVersionsRequest, CompareVersionsResponse>
compareVersionsCallable;

private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
Expand Down Expand Up @@ -218,6 +233,17 @@ protected GrpcVersionsStub(
return params.build();
})
.build();
GrpcCallSettings<CompareVersionsRequest, CompareVersionsResponse>
compareVersionsTransportSettings =
GrpcCallSettings.<CompareVersionsRequest, CompareVersionsResponse>newBuilder()
.setMethodDescriptor(compareVersionsMethodDescriptor)
.setParamsExtractor(
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("base_version", String.valueOf(request.getBaseVersion()));
return params.build();
})
.build();

this.listVersionsCallable =
callableFactory.createUnaryCallable(
Expand Down Expand Up @@ -252,6 +278,9 @@ protected GrpcVersionsStub(
settings.loadVersionOperationSettings(),
clientContext,
operationsStub);
this.compareVersionsCallable =
callableFactory.createUnaryCallable(
compareVersionsTransportSettings, settings.compareVersionsSettings(), clientContext);

this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
Expand Down Expand Up @@ -307,6 +336,11 @@ public OperationCallable<LoadVersionRequest, Empty, Struct> loadVersionOperation
return loadVersionOperationCallable;
}

@Override
public UnaryCallable<CompareVersionsRequest, CompareVersionsResponse> compareVersionsCallable() {
return compareVersionsCallable;
}

@Override
public final void close() {
try {
Expand Down
Expand Up @@ -21,6 +21,8 @@
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.dialogflow.cx.v3.CompareVersionsRequest;
import com.google.cloud.dialogflow.cx.v3.CompareVersionsResponse;
import com.google.cloud.dialogflow.cx.v3.CreateVersionOperationMetadata;
import com.google.cloud.dialogflow.cx.v3.CreateVersionRequest;
import com.google.cloud.dialogflow.cx.v3.DeleteVersionRequest;
Expand Down Expand Up @@ -86,6 +88,10 @@ public UnaryCallable<LoadVersionRequest, Operation> loadVersionCallable() {
throw new UnsupportedOperationException("Not implemented: loadVersionCallable()");
}

public UnaryCallable<CompareVersionsRequest, CompareVersionsResponse> compareVersionsCallable() {
throw new UnsupportedOperationException("Not implemented: compareVersionsCallable()");
}

@Override
public abstract void close();
}

0 comments on commit 1d581ad

Please sign in to comment.