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

Commit

Permalink
docs(samples): add protobuf.util dependency to enable FieldMaskUtil (#…
Browse files Browse the repository at this point in the history
…349)

* docs(samples): add protobuf.util dependency to enable FieldMaskUtil

* revert back samples module
  • Loading branch information
stephaniewang526 committed Sep 18, 2020
1 parent 486f677 commit ad32b5f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions samples/install-without-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
</dependency>
<!-- [END bigquerydatatransfer_install_without_bom] -->

<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java-util</artifactId>
<version>3.13.0</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
6 changes: 6 additions & 0 deletions samples/snapshot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
</dependency>
<!-- {x-version-update-end} -->

<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java-util</artifactId>
<version>3.13.0</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions samples/snippets/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
</dependency>
<!-- [END bigquerydatatransfer_install_with_bom] -->

<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java-util</artifactId>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.google.cloud.bigquery.datatransfer.v1.TransferConfig;
import com.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest;
import com.google.protobuf.FieldMask;
import com.google.protobuf.util.FieldMaskUtil;
import java.io.IOException;

// Sample to update transfer config.
Expand All @@ -40,7 +41,7 @@ public static void updateTransferConfig(String configId) throws IOException {
.setName(configId)
.setDisplayName("UPDATED_DISPLAY_NAME")
.build();
FieldMask updateMask = FieldMask.newBuilder().addPaths("display_name").build();
FieldMask updateMask = FieldMaskUtil.fromString("display_name");
UpdateTransferConfigRequest request =
UpdateTransferConfigRequest.newBuilder()
.setTransferConfig(transferConfig)
Expand Down

0 comments on commit ad32b5f

Please sign in to comment.