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

Commit ad32b5f

Browse files
docs(samples): add protobuf.util dependency to enable FieldMaskUtil (#349)
* docs(samples): add protobuf.util dependency to enable FieldMaskUtil * revert back samples module
1 parent 486f677 commit ad32b5f

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

samples/install-without-bom/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
</dependency>
3434
<!-- [END bigquerydatatransfer_install_without_bom] -->
3535

36+
<dependency>
37+
<groupId>com.google.protobuf</groupId>
38+
<artifactId>protobuf-java-util</artifactId>
39+
<version>3.13.0</version>
40+
</dependency>
41+
3642
<dependency>
3743
<groupId>junit</groupId>
3844
<artifactId>junit</artifactId>

samples/snapshot/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
</dependency>
3333
<!-- {x-version-update-end} -->
3434

35+
<dependency>
36+
<groupId>com.google.protobuf</groupId>
37+
<artifactId>protobuf-java-util</artifactId>
38+
<version>3.13.0</version>
39+
</dependency>
40+
3541
<dependency>
3642
<groupId>junit</groupId>
3743
<artifactId>junit</artifactId>

samples/snippets/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
</dependency>
4545
<!-- [END bigquerydatatransfer_install_with_bom] -->
4646

47+
<dependency>
48+
<groupId>com.google.protobuf</groupId>
49+
<artifactId>protobuf-java-util</artifactId>
50+
</dependency>
51+
4752
<!-- Test dependencies -->
4853
<dependency>
4954
<groupId>junit</groupId>

samples/snippets/src/main/java/com/example/bigquerydatatransfer/UpdateTransferConfig.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.google.cloud.bigquery.datatransfer.v1.TransferConfig;
2323
import com.google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest;
2424
import com.google.protobuf.FieldMask;
25+
import com.google.protobuf.util.FieldMaskUtil;
2526
import java.io.IOException;
2627

2728
// Sample to update transfer config.
@@ -40,7 +41,7 @@ public static void updateTransferConfig(String configId) throws IOException {
4041
.setName(configId)
4142
.setDisplayName("UPDATED_DISPLAY_NAME")
4243
.build();
43-
FieldMask updateMask = FieldMask.newBuilder().addPaths("display_name").build();
44+
FieldMask updateMask = FieldMaskUtil.fromString("display_name");
4445
UpdateTransferConfigRequest request =
4546
UpdateTransferConfigRequest.newBuilder()
4647
.setTransferConfig(transferConfig)

0 commit comments

Comments
 (0)