Skip to content
Permalink
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
  • Loading branch information
stephaniewang526 committed Sep 18, 2020
1 parent 486f677 commit ad32b5f50bede5c56bdaf6c8c79508ab44130c70
@@ -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>
@@ -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>
@@ -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>
@@ -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.
@@ -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)

0 comments on commit ad32b5f

Please sign in to comment.