Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [dialogflow-cx] add agent answer feedback capability #10066

Merged
merged 8 commits into from Nov 27, 2023
4 changes: 2 additions & 2 deletions java-dialogflow-cx/README.md
Expand Up @@ -23,7 +23,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.23.0</version>
<version>26.27.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -201,7 +201,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
[stability-image]: https://img.shields.io/badge/stability-preview-yellow
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-dialogflow-cx.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-dialogflow-cx/0.35.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-dialogflow-cx/0.41.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Expand Up @@ -177,175 +177,6 @@ public EntityTypesStub getStub() {
return stub;
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all entity types in the specified agent.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
* AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
* for (EntityType element : entityTypesClient.listEntityTypes(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</pre>
*
* @param parent Required. The agent to list all entity types for. Format: `projects/&lt;Project
* ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent ID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListEntityTypesPagedResponse listEntityTypes(AgentName parent) {
ListEntityTypesRequest request =
ListEntityTypesRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.build();
return listEntityTypes(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all entity types in the specified agent.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
* String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString();
* for (EntityType element : entityTypesClient.listEntityTypes(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</pre>
*
* @param parent Required. The agent to list all entity types for. Format: `projects/&lt;Project
* ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent ID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListEntityTypesPagedResponse listEntityTypes(String parent) {
ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder().setParent(parent).build();
return listEntityTypes(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all entity types in the specified agent.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
* ListEntityTypesRequest request =
* ListEntityTypesRequest.newBuilder()
* .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
* .setLanguageCode("languageCode-2092349083")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* for (EntityType element : entityTypesClient.listEntityTypes(request).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</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 ListEntityTypesPagedResponse listEntityTypes(ListEntityTypesRequest request) {
return listEntityTypesPagedCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all entity types in the specified agent.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
* ListEntityTypesRequest request =
* ListEntityTypesRequest.newBuilder()
* .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
* .setLanguageCode("languageCode-2092349083")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* ApiFuture<EntityType> future =
* entityTypesClient.listEntityTypesPagedCallable().futureCall(request);
* // Do something.
* for (EntityType element : future.get().iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</pre>
*/
public final UnaryCallable<ListEntityTypesRequest, ListEntityTypesPagedResponse>
listEntityTypesPagedCallable() {
return stub.listEntityTypesPagedCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all entity types in the specified agent.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
* ListEntityTypesRequest request =
* ListEntityTypesRequest.newBuilder()
* .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
* .setLanguageCode("languageCode-2092349083")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* while (true) {
* ListEntityTypesResponse response =
* entityTypesClient.listEntityTypesCallable().call(request);
* for (EntityType element : response.getEntityTypesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
* if (!Strings.isNullOrEmpty(nextPageToken)) {
* request = request.toBuilder().setPageToken(nextPageToken).build();
* } else {
* break;
* }
* }
* }
* }</pre>
*/
public final UnaryCallable<ListEntityTypesRequest, ListEntityTypesResponse>
listEntityTypesCallable() {
return stub.listEntityTypesCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Retrieves the specified entity type.
Expand Down Expand Up @@ -834,6 +665,175 @@ public final UnaryCallable<DeleteEntityTypeRequest, Empty> deleteEntityTypeCalla
return stub.deleteEntityTypeCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all entity types in the specified agent.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
* AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
* for (EntityType element : entityTypesClient.listEntityTypes(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</pre>
*
* @param parent Required. The agent to list all entity types for. Format: `projects/&lt;Project
* ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent ID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListEntityTypesPagedResponse listEntityTypes(AgentName parent) {
ListEntityTypesRequest request =
ListEntityTypesRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.build();
return listEntityTypes(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all entity types in the specified agent.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
* String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString();
* for (EntityType element : entityTypesClient.listEntityTypes(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</pre>
*
* @param parent Required. The agent to list all entity types for. Format: `projects/&lt;Project
* ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent ID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListEntityTypesPagedResponse listEntityTypes(String parent) {
ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder().setParent(parent).build();
return listEntityTypes(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all entity types in the specified agent.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
* ListEntityTypesRequest request =
* ListEntityTypesRequest.newBuilder()
* .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
* .setLanguageCode("languageCode-2092349083")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* for (EntityType element : entityTypesClient.listEntityTypes(request).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</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 ListEntityTypesPagedResponse listEntityTypes(ListEntityTypesRequest request) {
return listEntityTypesPagedCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all entity types in the specified agent.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
* ListEntityTypesRequest request =
* ListEntityTypesRequest.newBuilder()
* .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
* .setLanguageCode("languageCode-2092349083")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* ApiFuture<EntityType> future =
* entityTypesClient.listEntityTypesPagedCallable().futureCall(request);
* // Do something.
* for (EntityType element : future.get().iterateAll()) {
* // doThingsWith(element);
* }
* }
* }</pre>
*/
public final UnaryCallable<ListEntityTypesRequest, ListEntityTypesPagedResponse>
listEntityTypesPagedCallable() {
return stub.listEntityTypesPagedCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns the list of all entity types in the specified agent.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
* ListEntityTypesRequest request =
* ListEntityTypesRequest.newBuilder()
* .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
* .setLanguageCode("languageCode-2092349083")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* while (true) {
* ListEntityTypesResponse response =
* entityTypesClient.listEntityTypesCallable().call(request);
* for (EntityType element : response.getEntityTypesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
* if (!Strings.isNullOrEmpty(nextPageToken)) {
* request = request.toBuilder().setPageToken(nextPageToken).build();
* } else {
* break;
* }
* }
* }
* }</pre>
*/
public final UnaryCallable<ListEntityTypesRequest, ListEntityTypesResponse>
listEntityTypesCallable() {
return stub.listEntityTypesCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists information about the supported locations for this service.
Expand Down