Skip to content

Commit

Permalink
feat: [java-discoveryengine] allow recommendation users to set user l…
Browse files Browse the repository at this point in the history
…abels in the request (#8689)

* feat: allow recommendation users to set user labels in the request
feat: add more long running operation path bindings

PiperOrigin-RevId: 483996440

Source-Link: googleapis/googleapis@51fd0bf

Source-Link: https://github.com/googleapis/googleapis-gen/commit/21c7fb9b07a384bb4aaa6163d3245d2d53357595
Copy-Tag: eyJwIjoiamF2YS1kaXNjb3ZlcnllbmdpbmUvLk93bEJvdC55YW1sIiwiaCI6IjIxYzdmYjliMDdhMzg0YmI0YWFhNjE2M2QzMjQ1ZDJkNTMzNTc1OTUifQ==

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Oct 27, 2022
1 parent 54f750d commit 1b54799
Show file tree
Hide file tree
Showing 13 changed files with 690 additions and 40 deletions.
17 changes: 17 additions & 0 deletions java-discoveryengine/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Maven
target/

# Eclipse
.classpath
.project
.settings

# Intellij
*.iml
.idea/

# python utilities
*.pyc
__pycache__

.flattened-pom.xml
6 changes: 3 additions & 3 deletions java-discoveryengine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ If you are using Maven, add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-discoveryengine</artifactId>
<version>0.0.0</version>
<version>0.1.0</version>
</dependency>
```

If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-discoveryengine:0.0.0'
implementation 'com.google.cloud:google-cloud-discoveryengine:0.1.0'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-discoveryengine" % "0.0.0"
libraryDependencies += "com.google.cloud" % "google-cloud-discoveryengine" % "0.1.0"
```

## Authentication
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version='1.0' encoding='UTF-8'?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud</groupId>
Expand Down
4 changes: 2 additions & 2 deletions java-discoveryengine/google-cloud-discoveryengine/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version='1.0' encoding='UTF-8'?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud</groupId>
Expand Down Expand Up @@ -110,4 +110,4 @@
<scope>test</scope>
</dependency>
</dependencies>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
* .setFilter("filter-1274492040")
* .setValidateOnly(true)
* .putAllParams(new HashMap<String, Value>())
* .putAllUserLabels(new HashMap<String, String>())
* .build();
* RecommendResponse response = recommendationServiceClient.recommend(request);
* }
Expand Down Expand Up @@ -209,6 +210,7 @@ public RecommendationServiceStub getStub() {
* .setFilter("filter-1274492040")
* .setValidateOnly(true)
* .putAllParams(new HashMap<String, Value>())
* .putAllUserLabels(new HashMap<String, String>())
* .build();
* RecommendResponse response = recommendationServiceClient.recommend(request);
* }
Expand Down Expand Up @@ -246,6 +248,7 @@ public final RecommendResponse recommend(RecommendRequest request) {
* .setFilter("filter-1274492040")
* .setValidateOnly(true)
* .putAllParams(new HashMap<String, Value>())
* .putAllUserLabels(new HashMap<String, String>())
* .build();
* ApiFuture<RecommendResponse> future =
* recommendationServiceClient.recommendCallable().futureCall(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
* .setFilter("filter-1274492040")
* .setValidateOnly(true)
* .putAllParams(new HashMap<String, Value>())
* .putAllUserLabels(new HashMap<String, String>())
* .build();
* RecommendResponse response = recommendationServiceClient.recommend(request);
* }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public void recommendTest() throws Exception {
.setFilter("filter-1274492040")
.setValidateOnly(true)
.putAllParams(new HashMap<String, Value>())
.putAllUserLabels(new HashMap<String, String>())
.build();

RecommendResponse actualResponse = client.recommend(request);
Expand Down Expand Up @@ -134,6 +135,7 @@ public void recommendExceptionTest() throws Exception {
.setFilter("filter-1274492040")
.setValidateOnly(true)
.putAllParams(new HashMap<String, Value>())
.putAllUserLabels(new HashMap<String, String>())
.build();
client.recommend(request);
Assert.fail("No exception raised");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public void recommendTest() throws Exception {
.setFilter("filter-1274492040")
.setValidateOnly(true)
.putAllParams(new HashMap<String, Value>())
.putAllUserLabels(new HashMap<String, String>())
.build();

RecommendResponse actualResponse = client.recommend(request);
Expand All @@ -115,6 +116,7 @@ public void recommendTest() throws Exception {
Assert.assertEquals(request.getFilter(), actualRequest.getFilter());
Assert.assertEquals(request.getValidateOnly(), actualRequest.getValidateOnly());
Assert.assertEquals(request.getParamsMap(), actualRequest.getParamsMap());
Assert.assertEquals(request.getUserLabelsMap(), actualRequest.getUserLabelsMap());
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
Expand All @@ -138,6 +140,7 @@ public void recommendExceptionTest() throws Exception {
.setFilter("filter-1274492040")
.setValidateOnly(true)
.putAllParams(new HashMap<String, Value>())
.putAllUserLabels(new HashMap<String, String>())
.build();
client.recommend(request);
Assert.fail("No exception raised");
Expand Down
3 changes: 2 additions & 1 deletion java-discoveryengine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@
<module>proto-google-cloud-discoveryengine-v1beta</module>
<module>google-cloud-discoveryengine-bom</module>
</modules>
</project>

</project>
Loading

0 comments on commit 1b54799

Please sign in to comment.