From e9fec0a501148e1848e48ecef7b3ea8f817c1a9a Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Thu, 6 Jun 2024 16:16:53 +0000 Subject: [PATCH 01/17] restore to older version --- .../{.OwlBot.yaml => .OwlBot-hermetic.yaml} | 0 .../hermetic_library_generation.yaml | 39 ++++++ .../update_googleapis_committish.yaml | 42 ++++++ generation/hermetic_library_generation.sh | 124 ++++++++++++++++++ generation/update_googleapis_committish.sh | 92 +++++++++++++ generation_config.yaml | 35 +++++ 6 files changed, 332 insertions(+) rename .github/{.OwlBot.yaml => .OwlBot-hermetic.yaml} (100%) create mode 100644 .github/workflows/hermetic_library_generation.yaml create mode 100644 .github/workflows/update_googleapis_committish.yaml create mode 100644 generation/hermetic_library_generation.sh create mode 100644 generation/update_googleapis_committish.sh create mode 100644 generation_config.yaml diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot-hermetic.yaml similarity index 100% rename from .github/.OwlBot.yaml rename to .github/.OwlBot-hermetic.yaml diff --git a/.github/workflows/hermetic_library_generation.yaml b/.github/workflows/hermetic_library_generation.yaml new file mode 100644 index 000000000..a7e05557b --- /dev/null +++ b/.github/workflows/hermetic_library_generation.yaml @@ -0,0 +1,39 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# GitHub action job to test core java library features on +# downstream client libraries before they are released. +name: Hermetic library generation upon generation config change through pull requests +on: + pull_request: + +jobs: + library_generation: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} + - name: Generate changed libraries + shell: bash + run: | + set -x + [ -z "$(git config user.email)" ] && git config --global user.email "cloud-java-bot@google.com" + [ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot" + bash generation/hermetic_library_generation.sh \ + --target_branch ${{ github.base_ref }} \ + --current_branch ${{ github.head_ref }} \ + --image_tag $(cat generation_config.yaml | yq .gapic_generator_version) + env: + GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} diff --git a/.github/workflows/update_googleapis_committish.yaml b/.github/workflows/update_googleapis_committish.yaml new file mode 100644 index 000000000..aac08d039 --- /dev/null +++ b/.github/workflows/update_googleapis_committish.yaml @@ -0,0 +1,42 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# GitHub action job to test core java library features on +# downstream client libraries before they are released. +name: Update googleapis commit +on: + schedule: + - cron: '0 2 * * *' + workflow_dispatch: + +jobs: + update-googleapis-committish: + runs-on: ubuntu-22.04 + env: + # the branch into which the pull request is merged + base_branch: main + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} + - name: Update googleapis committish to latest + shell: bash + run: | + set -x + [ -z "$(git config user.email)" ] && git config --global user.email "cloud-java-bot@google.com" + [ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot" + bash generation/update_googleapis_committish.sh \ + --base_branch "${base_branch}"\ + --repo ${{ github.repository }} + env: + GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} diff --git a/generation/hermetic_library_generation.sh b/generation/hermetic_library_generation.sh new file mode 100644 index 000000000..d7e55e3c6 --- /dev/null +++ b/generation/hermetic_library_generation.sh @@ -0,0 +1,124 @@ +#!/bin/bash +set -e +# This script should be run at the root of the repository. +# This script is used to, when a pull request changes the generation +# configuration (generation_config.yaml by default): +# 1. Find whether the last commit in this pull request contains changes to +# the generation configuration and exit early if it doesn't have such a change +# since the generation result would be the same. +# 2. Compare generation configurations in the current branch (with which the +# pull request associated) and target branch (into which the pull request is +# merged); +# 3. Generate changed libraries using library_generation image; +# 4. Commit the changes to the pull request, if any. +# 5. Edit the PR body with generated pull request description, if applicable. + +# The following commands need to be installed before running the script: +# 1. git +# 2. gh +# 3. docker + +# The parameters of this script is: +# 1. target_branch, the branch into which the pull request is merged. +# 2. current_branch, the branch with which the pull request is associated. +# 3. image_tag, the tag of gcr.io/cloud-devrel-public-resources/java-library-generation. +# 3. [optional] generation_config, the path to the generation configuration, +# the default value is generation_config.yaml in the repository root. +while [[ $# -gt 0 ]]; do +key="$1" +case "${key}" in + --target_branch) + target_branch="$2" + shift + ;; + --current_branch) + current_branch="$2" + shift + ;; + --image_tag) + image_tag="$2" + shift + ;; + --generation_config) + generation_config="$2" + shift + ;; + *) + echo "Invalid option: [$1]" + exit 1 + ;; +esac +shift +done + +if [ -z "${target_branch}" ]; then + echo "missing required argument --target_branch" + exit 1 +fi + +if [ -z "${current_branch}" ]; then + echo "missing required argument --current_branch" + exit 1 +fi + +if [ -z "${image_tag}" ]; then + echo "missing required argument --image_tag" + exit 1 +fi + +if [ -z "${generation_config}" ]; then + generation_config=generation_config.yaml + echo "Use default generation config: ${generation_config}" +fi + +workspace_name="/workspace" +baseline_generation_config="baseline_generation_config.yaml" +message="chore: generate libraries at $(date)" + +git checkout "${target_branch}" +git checkout "${current_branch}" +# if the last commit doesn't contain changes to generation configuration, +# do not generate again as the result will be the same. +change_of_last_commit="$(git diff-tree --no-commit-id --name-only HEAD~1..HEAD -r)" +if [[ ! ("${change_of_last_commit}" == *"${generation_config}"*) ]]; then + echo "The last commit doesn't contain any changes to the generation_config.yaml, skipping the whole generation process." || true + exit 0 +fi +# copy generation configuration from target branch to current branch. +git show "${target_branch}":"${generation_config}" > "${baseline_generation_config}" +config_diff=$(diff "${generation_config}" "${baseline_generation_config}" || true) + +# run hermetic code generation docker image. +docker run \ + --rm \ + -u "$(id -u):$(id -g)" \ + -v "$(pwd):${workspace_name}" \ + gcr.io/cloud-devrel-public-resources/java-library-generation:"${image_tag}" \ + --baseline-generation-config-path="${workspace_name}/${baseline_generation_config}" \ + --current-generation-config-path="${workspace_name}/${generation_config}" + + +# commit the change to the pull request. +if [[ $(basename $(pwd)) == "google-cloud-java" ]]; then + git add java-* pom.xml gapic-libraries-bom/pom.xml versions.txt +else + # The image leaves intermediate folders and files it works with. Here we remove them + rm -rdf output googleapis "${baseline_generation_config}" + git add --all -- ':!pr_description.txt' +fi +changed_files=$(git diff --cached --name-only) +if [[ "${changed_files}" == "" ]]; then + echo "There is no generated code change with the generation config change ${config_diff}." + echo "Skip committing to the pull request." + exit 0 +fi + +echo "Configuration diff:" +echo "${config_diff}" +git commit -m "${message}" +git push +# set pr body if pr_description.txt is generated. +if [[ -f "pr_description.txt" ]]; then + pr_num=$(gh pr list -s open -H "${current_branch}" -q . --json number | jq ".[] | .number") + gh pr edit "${pr_num}" --body "$(cat pr_description.txt)" +fi diff --git a/generation/update_googleapis_committish.sh b/generation/update_googleapis_committish.sh new file mode 100644 index 000000000..5dfcaba56 --- /dev/null +++ b/generation/update_googleapis_committish.sh @@ -0,0 +1,92 @@ +#!/bin/bash +set -e +# This script should be run at the root of the repository. +# This script is used to update googleapis committish to latest in generation +# configuration at the time of running and create a pull request. + +# The following commands need to be installed before running the script: +# 1. git +# 2. gh + +# The parameters of this script is: +# 1. base_branch, the base branch of the result pull request. +# 2. repo, organization/repo-name, e.g., googleapis/google-cloud-java +# 3. [optional] generation_config, the path to the generation configuration, +# the default value is generation_config.yaml in the repository root. +while [[ $# -gt 0 ]]; do +key="$1" +case "${key}" in + --base_branch) + base_branch="$2" + shift + ;; + --repo) + repo="$2" + shift + ;; + --generation_config) + generation_config="$2" + shift + ;; + *) + echo "Invalid option: [$1]" + exit 1 + ;; +esac +shift +done + +if [ -z "${base_branch}" ]; then + echo "missing required argument --base_branch" + exit 1 +fi + +if [ -z "${repo}" ]; then + echo "missing required argument --repo" + exit 1 +fi + +if [ -z "${generation_config}" ]; then + generation_config="generation_config.yaml" + echo "Use default generation config: ${generation_config}" +fi + +current_branch="generate-libraries-${base_branch}" +title="chore: update googleapis committish at $(date)" + +# try to find a open pull request associated with the branch +pr_num=$(gh pr list -s open -H "${current_branch}" -q . --json number | jq ".[] | .number") +# create a branch if there's no open pull request associated with the +# branch; otherwise checkout the pull request. +if [ -z "${pr_num}" ]; then + git checkout -b "${current_branch}" +else + gh pr checkout "${pr_num}" +fi + +mkdir tmp-googleapis +# use partial clone because only commit history is needed. +git clone --filter=blob:none https://github.com/googleapis/googleapis.git tmp-googleapis +pushd tmp-googleapis +git pull +latest_commit=$(git rev-parse HEAD) +popd +rm -rf tmp-googleapis +sed -i -e "s/^googleapis_commitish.*$/googleapis_commitish: ${latest_commit}/" "${generation_config}" + +git add "${generation_config}" +changed_files=$(git diff --cached --name-only) +if [[ "${changed_files}" == "" ]]; then + echo "The latest googleapis commit is not changed." + echo "Skip committing to the pull request." + exit 0 +fi +git commit -m "${title}" +if [ -z "${pr_num}" ]; then + git remote add remote_repo https://cloud-java-bot:"${GH_TOKEN}@github.com/${repo}.git" + git fetch -q --unshallow remote_repo + git push -f remote_repo "${current_branch}" + gh pr create --title "${title}" --head "${current_branch}" --body "${title}" --base "${base_branch}" +else + git push +fi diff --git a/generation_config.yaml b/generation_config.yaml new file mode 100644 index 000000000..ecf1db129 --- /dev/null +++ b/generation_config.yaml @@ -0,0 +1,35 @@ +gapic_generator_version: 2.41.0 +protoc_version: '25.3' +googleapis_commitish: 6f289d775912966eb0cf04bda91e5e355c998d30 +libraries_bom_version: 26.38.0 +template_excludes: + - .kokoro/presubmit/integration.cfg + - .kokoro/presubmit/graalvm-native.cfg + - .kokoro/presubmit/graalvm-native-17.cfg + - .kokoro/nightly/integration.cfg + - .kokoro/nightly/java11-integration.cfg + - .kokoro/requirements.in + - .kokoro/requirements.txt + - .github/dependabot.yml +libraries: + - api_shortname: "datastore" + name_pretty: "Cloud Datastore" + product_documentation: "https://cloud.google.com/datastore" + client_documentation: "https://cloud.google.com/java/docs/reference/google-cloud-datastore/latest/history" + issue_tracker: "https://issuetracker.google.com/savedsearches/559768" + release_level: "stable" + language: "java" + repo: "googleapis/java-datastore" + repo_short: "java-datastore" + distribution_name: "com.google.cloud:google-cloud-datastore" + codeowner_team: "@googleapis/cloud-native-db-dpes @googleapis/api-datastore-sdk @googleapis/api-firestore-partners" + api_id: "datastore.googleapis.com" + library_type: "GAPIC_COMBO" + api_description: "is a fully managed, schemaless database for\nstoring non-relational data. Cloud Datastore automatically scales with\nyour users and supports ACID transactions, high availability of reads and\nwrites, strong consistency for reads and ancestor queries, and eventual\nconsistency for all other queries." + excluded_dependencies: "grpc-google-cloud-datastore-v1" + extra_versioned_modules: "datastore-v1-proto-client" + excluded_poms: "grpc-google-cloud-datastore-v1" + recommended_package: "com.google.cloud.datastore" + GAPICs: + - proto_path: google/datastore/v1 + - proto_path: google/datastore/admin/v1 From 1b1d682a7505c99cc30d1b5b7290916273cfdd6c Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Thu, 6 Jun 2024 16:18:16 +0000 Subject: [PATCH 02/17] update googleapis_committish --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index ecf1db129..7d8fa9f5e 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,6 +1,6 @@ gapic_generator_version: 2.41.0 protoc_version: '25.3' -googleapis_commitish: 6f289d775912966eb0cf04bda91e5e355c998d30 +googleapis_commitish: dde0ec1f36cb8cbf9036dd0f1e8e5eda7882db4e libraries_bom_version: 26.38.0 template_excludes: - .kokoro/presubmit/integration.cfg From 8a247dce42f6006f969982bef7edcdfc067d5aa0 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Thu, 6 Jun 2024 16:33:27 +0000 Subject: [PATCH 03/17] fix googleapis_committish --- generation_config.yaml | 2 +- .../com/google/datastore/v1/PropertyMask.java | 848 ++++++++++++++++++ .../datastore/v1/PropertyMaskOrBuilder.java | 117 +++ 3 files changed, 966 insertions(+), 1 deletion(-) create mode 100644 proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/PropertyMask.java create mode 100644 proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/PropertyMaskOrBuilder.java diff --git a/generation_config.yaml b/generation_config.yaml index 7d8fa9f5e..b59837cb3 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,6 +1,6 @@ gapic_generator_version: 2.41.0 protoc_version: '25.3' -googleapis_commitish: dde0ec1f36cb8cbf9036dd0f1e8e5eda7882db4e +googleapis_commitish: bcaed39fd1a805a6411a3992ea32dc1ba0ba7ec3 libraries_bom_version: 26.38.0 template_excludes: - .kokoro/presubmit/integration.cfg diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/PropertyMask.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/PropertyMask.java new file mode 100644 index 000000000..2d9c2caf6 --- /dev/null +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/PropertyMask.java @@ -0,0 +1,848 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/datastore/v1/datastore.proto + +// Protobuf Java Version: 3.25.3 +package com.google.datastore.v1; + +/** + * + * + *
+ * The set of arbitrarily nested property paths used to restrict an operation to
+ * only a subset of properties in an entity.
+ * 
+ * + * Protobuf type {@code google.datastore.v1.PropertyMask} + */ +public final class PropertyMask extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.datastore.v1.PropertyMask) + PropertyMaskOrBuilder { + private static final long serialVersionUID = 0L; + // Use PropertyMask.newBuilder() to construct. + private PropertyMask(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PropertyMask() { + paths_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PropertyMask(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.v1.DatastoreProto + .internal_static_google_datastore_v1_PropertyMask_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.DatastoreProto + .internal_static_google_datastore_v1_PropertyMask_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.PropertyMask.class, + com.google.datastore.v1.PropertyMask.Builder.class); + } + + public static final int PATHS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList paths_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * The paths to the properties covered by this mask.
+   *
+   * A path is a list of property names separated by dots (`.`), for example
+   * `foo.bar` means the property `bar` inside the entity property `foo` inside
+   * the entity associated with this path.
+   *
+   * If a property name contains a dot `.` or a backslash `\`, then that
+   * name must be escaped.
+   *
+   * A path must not be empty, and may not reference a value inside an
+   * [array value][google.datastore.v1.Value.array_value].
+   * 
+ * + * repeated string paths = 1; + * + * @return A list containing the paths. + */ + public com.google.protobuf.ProtocolStringList getPathsList() { + return paths_; + } + /** + * + * + *
+   * The paths to the properties covered by this mask.
+   *
+   * A path is a list of property names separated by dots (`.`), for example
+   * `foo.bar` means the property `bar` inside the entity property `foo` inside
+   * the entity associated with this path.
+   *
+   * If a property name contains a dot `.` or a backslash `\`, then that
+   * name must be escaped.
+   *
+   * A path must not be empty, and may not reference a value inside an
+   * [array value][google.datastore.v1.Value.array_value].
+   * 
+ * + * repeated string paths = 1; + * + * @return The count of paths. + */ + public int getPathsCount() { + return paths_.size(); + } + /** + * + * + *
+   * The paths to the properties covered by this mask.
+   *
+   * A path is a list of property names separated by dots (`.`), for example
+   * `foo.bar` means the property `bar` inside the entity property `foo` inside
+   * the entity associated with this path.
+   *
+   * If a property name contains a dot `.` or a backslash `\`, then that
+   * name must be escaped.
+   *
+   * A path must not be empty, and may not reference a value inside an
+   * [array value][google.datastore.v1.Value.array_value].
+   * 
+ * + * repeated string paths = 1; + * + * @param index The index of the element to return. + * @return The paths at the given index. + */ + public java.lang.String getPaths(int index) { + return paths_.get(index); + } + /** + * + * + *
+   * The paths to the properties covered by this mask.
+   *
+   * A path is a list of property names separated by dots (`.`), for example
+   * `foo.bar` means the property `bar` inside the entity property `foo` inside
+   * the entity associated with this path.
+   *
+   * If a property name contains a dot `.` or a backslash `\`, then that
+   * name must be escaped.
+   *
+   * A path must not be empty, and may not reference a value inside an
+   * [array value][google.datastore.v1.Value.array_value].
+   * 
+ * + * repeated string paths = 1; + * + * @param index The index of the value to return. + * @return The bytes of the paths at the given index. + */ + public com.google.protobuf.ByteString getPathsBytes(int index) { + return paths_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < paths_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, paths_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < paths_.size(); i++) { + dataSize += computeStringSizeNoTag(paths_.getRaw(i)); + } + size += dataSize; + size += 1 * getPathsList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.datastore.v1.PropertyMask)) { + return super.equals(obj); + } + com.google.datastore.v1.PropertyMask other = (com.google.datastore.v1.PropertyMask) obj; + + if (!getPathsList().equals(other.getPathsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPathsCount() > 0) { + hash = (37 * hash) + PATHS_FIELD_NUMBER; + hash = (53 * hash) + getPathsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.datastore.v1.PropertyMask parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.PropertyMask parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.v1.PropertyMask parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.PropertyMask parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.v1.PropertyMask parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.datastore.v1.PropertyMask parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.datastore.v1.PropertyMask parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.PropertyMask parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.datastore.v1.PropertyMask parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.PropertyMask parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.datastore.v1.PropertyMask parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.datastore.v1.PropertyMask parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.datastore.v1.PropertyMask prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The set of arbitrarily nested property paths used to restrict an operation to
+   * only a subset of properties in an entity.
+   * 
+ * + * Protobuf type {@code google.datastore.v1.PropertyMask} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.datastore.v1.PropertyMask) + com.google.datastore.v1.PropertyMaskOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.datastore.v1.DatastoreProto + .internal_static_google_datastore_v1_PropertyMask_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.datastore.v1.DatastoreProto + .internal_static_google_datastore_v1_PropertyMask_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.datastore.v1.PropertyMask.class, + com.google.datastore.v1.PropertyMask.Builder.class); + } + + // Construct using com.google.datastore.v1.PropertyMask.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + paths_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.datastore.v1.DatastoreProto + .internal_static_google_datastore_v1_PropertyMask_descriptor; + } + + @java.lang.Override + public com.google.datastore.v1.PropertyMask getDefaultInstanceForType() { + return com.google.datastore.v1.PropertyMask.getDefaultInstance(); + } + + @java.lang.Override + public com.google.datastore.v1.PropertyMask build() { + com.google.datastore.v1.PropertyMask result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.datastore.v1.PropertyMask buildPartial() { + com.google.datastore.v1.PropertyMask result = new com.google.datastore.v1.PropertyMask(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.datastore.v1.PropertyMask result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + paths_.makeImmutable(); + result.paths_ = paths_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.datastore.v1.PropertyMask) { + return mergeFrom((com.google.datastore.v1.PropertyMask) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.datastore.v1.PropertyMask other) { + if (other == com.google.datastore.v1.PropertyMask.getDefaultInstance()) return this; + if (!other.paths_.isEmpty()) { + if (paths_.isEmpty()) { + paths_ = other.paths_; + bitField0_ |= 0x00000001; + } else { + ensurePathsIsMutable(); + paths_.addAll(other.paths_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensurePathsIsMutable(); + paths_.add(s); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList paths_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensurePathsIsMutable() { + if (!paths_.isModifiable()) { + paths_ = new com.google.protobuf.LazyStringArrayList(paths_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+     * The paths to the properties covered by this mask.
+     *
+     * A path is a list of property names separated by dots (`.`), for example
+     * `foo.bar` means the property `bar` inside the entity property `foo` inside
+     * the entity associated with this path.
+     *
+     * If a property name contains a dot `.` or a backslash `\`, then that
+     * name must be escaped.
+     *
+     * A path must not be empty, and may not reference a value inside an
+     * [array value][google.datastore.v1.Value.array_value].
+     * 
+ * + * repeated string paths = 1; + * + * @return A list containing the paths. + */ + public com.google.protobuf.ProtocolStringList getPathsList() { + paths_.makeImmutable(); + return paths_; + } + /** + * + * + *
+     * The paths to the properties covered by this mask.
+     *
+     * A path is a list of property names separated by dots (`.`), for example
+     * `foo.bar` means the property `bar` inside the entity property `foo` inside
+     * the entity associated with this path.
+     *
+     * If a property name contains a dot `.` or a backslash `\`, then that
+     * name must be escaped.
+     *
+     * A path must not be empty, and may not reference a value inside an
+     * [array value][google.datastore.v1.Value.array_value].
+     * 
+ * + * repeated string paths = 1; + * + * @return The count of paths. + */ + public int getPathsCount() { + return paths_.size(); + } + /** + * + * + *
+     * The paths to the properties covered by this mask.
+     *
+     * A path is a list of property names separated by dots (`.`), for example
+     * `foo.bar` means the property `bar` inside the entity property `foo` inside
+     * the entity associated with this path.
+     *
+     * If a property name contains a dot `.` or a backslash `\`, then that
+     * name must be escaped.
+     *
+     * A path must not be empty, and may not reference a value inside an
+     * [array value][google.datastore.v1.Value.array_value].
+     * 
+ * + * repeated string paths = 1; + * + * @param index The index of the element to return. + * @return The paths at the given index. + */ + public java.lang.String getPaths(int index) { + return paths_.get(index); + } + /** + * + * + *
+     * The paths to the properties covered by this mask.
+     *
+     * A path is a list of property names separated by dots (`.`), for example
+     * `foo.bar` means the property `bar` inside the entity property `foo` inside
+     * the entity associated with this path.
+     *
+     * If a property name contains a dot `.` or a backslash `\`, then that
+     * name must be escaped.
+     *
+     * A path must not be empty, and may not reference a value inside an
+     * [array value][google.datastore.v1.Value.array_value].
+     * 
+ * + * repeated string paths = 1; + * + * @param index The index of the value to return. + * @return The bytes of the paths at the given index. + */ + public com.google.protobuf.ByteString getPathsBytes(int index) { + return paths_.getByteString(index); + } + /** + * + * + *
+     * The paths to the properties covered by this mask.
+     *
+     * A path is a list of property names separated by dots (`.`), for example
+     * `foo.bar` means the property `bar` inside the entity property `foo` inside
+     * the entity associated with this path.
+     *
+     * If a property name contains a dot `.` or a backslash `\`, then that
+     * name must be escaped.
+     *
+     * A path must not be empty, and may not reference a value inside an
+     * [array value][google.datastore.v1.Value.array_value].
+     * 
+ * + * repeated string paths = 1; + * + * @param index The index to set the value at. + * @param value The paths to set. + * @return This builder for chaining. + */ + public Builder setPaths(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePathsIsMutable(); + paths_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The paths to the properties covered by this mask.
+     *
+     * A path is a list of property names separated by dots (`.`), for example
+     * `foo.bar` means the property `bar` inside the entity property `foo` inside
+     * the entity associated with this path.
+     *
+     * If a property name contains a dot `.` or a backslash `\`, then that
+     * name must be escaped.
+     *
+     * A path must not be empty, and may not reference a value inside an
+     * [array value][google.datastore.v1.Value.array_value].
+     * 
+ * + * repeated string paths = 1; + * + * @param value The paths to add. + * @return This builder for chaining. + */ + public Builder addPaths(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePathsIsMutable(); + paths_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The paths to the properties covered by this mask.
+     *
+     * A path is a list of property names separated by dots (`.`), for example
+     * `foo.bar` means the property `bar` inside the entity property `foo` inside
+     * the entity associated with this path.
+     *
+     * If a property name contains a dot `.` or a backslash `\`, then that
+     * name must be escaped.
+     *
+     * A path must not be empty, and may not reference a value inside an
+     * [array value][google.datastore.v1.Value.array_value].
+     * 
+ * + * repeated string paths = 1; + * + * @param values The paths to add. + * @return This builder for chaining. + */ + public Builder addAllPaths(java.lang.Iterable values) { + ensurePathsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, paths_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The paths to the properties covered by this mask.
+     *
+     * A path is a list of property names separated by dots (`.`), for example
+     * `foo.bar` means the property `bar` inside the entity property `foo` inside
+     * the entity associated with this path.
+     *
+     * If a property name contains a dot `.` or a backslash `\`, then that
+     * name must be escaped.
+     *
+     * A path must not be empty, and may not reference a value inside an
+     * [array value][google.datastore.v1.Value.array_value].
+     * 
+ * + * repeated string paths = 1; + * + * @return This builder for chaining. + */ + public Builder clearPaths() { + paths_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * The paths to the properties covered by this mask.
+     *
+     * A path is a list of property names separated by dots (`.`), for example
+     * `foo.bar` means the property `bar` inside the entity property `foo` inside
+     * the entity associated with this path.
+     *
+     * If a property name contains a dot `.` or a backslash `\`, then that
+     * name must be escaped.
+     *
+     * A path must not be empty, and may not reference a value inside an
+     * [array value][google.datastore.v1.Value.array_value].
+     * 
+ * + * repeated string paths = 1; + * + * @param value The bytes of the paths to add. + * @return This builder for chaining. + */ + public Builder addPathsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePathsIsMutable(); + paths_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.datastore.v1.PropertyMask) + } + + // @@protoc_insertion_point(class_scope:google.datastore.v1.PropertyMask) + private static final com.google.datastore.v1.PropertyMask DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.datastore.v1.PropertyMask(); + } + + public static com.google.datastore.v1.PropertyMask getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PropertyMask parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.datastore.v1.PropertyMask getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/PropertyMaskOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/PropertyMaskOrBuilder.java new file mode 100644 index 000000000..8711d5d8a --- /dev/null +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/PropertyMaskOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/datastore/v1/datastore.proto + +// Protobuf Java Version: 3.25.3 +package com.google.datastore.v1; + +public interface PropertyMaskOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.datastore.v1.PropertyMask) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The paths to the properties covered by this mask.
+   *
+   * A path is a list of property names separated by dots (`.`), for example
+   * `foo.bar` means the property `bar` inside the entity property `foo` inside
+   * the entity associated with this path.
+   *
+   * If a property name contains a dot `.` or a backslash `\`, then that
+   * name must be escaped.
+   *
+   * A path must not be empty, and may not reference a value inside an
+   * [array value][google.datastore.v1.Value.array_value].
+   * 
+ * + * repeated string paths = 1; + * + * @return A list containing the paths. + */ + java.util.List getPathsList(); + /** + * + * + *
+   * The paths to the properties covered by this mask.
+   *
+   * A path is a list of property names separated by dots (`.`), for example
+   * `foo.bar` means the property `bar` inside the entity property `foo` inside
+   * the entity associated with this path.
+   *
+   * If a property name contains a dot `.` or a backslash `\`, then that
+   * name must be escaped.
+   *
+   * A path must not be empty, and may not reference a value inside an
+   * [array value][google.datastore.v1.Value.array_value].
+   * 
+ * + * repeated string paths = 1; + * + * @return The count of paths. + */ + int getPathsCount(); + /** + * + * + *
+   * The paths to the properties covered by this mask.
+   *
+   * A path is a list of property names separated by dots (`.`), for example
+   * `foo.bar` means the property `bar` inside the entity property `foo` inside
+   * the entity associated with this path.
+   *
+   * If a property name contains a dot `.` or a backslash `\`, then that
+   * name must be escaped.
+   *
+   * A path must not be empty, and may not reference a value inside an
+   * [array value][google.datastore.v1.Value.array_value].
+   * 
+ * + * repeated string paths = 1; + * + * @param index The index of the element to return. + * @return The paths at the given index. + */ + java.lang.String getPaths(int index); + /** + * + * + *
+   * The paths to the properties covered by this mask.
+   *
+   * A path is a list of property names separated by dots (`.`), for example
+   * `foo.bar` means the property `bar` inside the entity property `foo` inside
+   * the entity associated with this path.
+   *
+   * If a property name contains a dot `.` or a backslash `\`, then that
+   * name must be escaped.
+   *
+   * A path must not be empty, and may not reference a value inside an
+   * [array value][google.datastore.v1.Value.array_value].
+   * 
+ * + * repeated string paths = 1; + * + * @param index The index of the value to return. + * @return The bytes of the paths at the given index. + */ + com.google.protobuf.ByteString getPathsBytes(int index); +} From 394ce5baf9fd5a4963f39efe462abacc2db76709 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 12 Jun 2024 17:11:42 +0000 Subject: [PATCH 04/17] infer image tag from config yaml --- .../workflows/hermetic_library_generation.yaml | 3 +-- generation/hermetic_library_generation.sh | 15 ++++----------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/hermetic_library_generation.yaml b/.github/workflows/hermetic_library_generation.yaml index a7e05557b..23385a1be 100644 --- a/.github/workflows/hermetic_library_generation.yaml +++ b/.github/workflows/hermetic_library_generation.yaml @@ -33,7 +33,6 @@ jobs: [ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot" bash generation/hermetic_library_generation.sh \ --target_branch ${{ github.base_ref }} \ - --current_branch ${{ github.head_ref }} \ - --image_tag $(cat generation_config.yaml | yq .gapic_generator_version) + --current_branch ${{ github.head_ref }} env: GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} diff --git a/generation/hermetic_library_generation.sh b/generation/hermetic_library_generation.sh index d7e55e3c6..6c3f22d8f 100644 --- a/generation/hermetic_library_generation.sh +++ b/generation/hermetic_library_generation.sh @@ -21,7 +21,6 @@ set -e # The parameters of this script is: # 1. target_branch, the branch into which the pull request is merged. # 2. current_branch, the branch with which the pull request is associated. -# 3. image_tag, the tag of gcr.io/cloud-devrel-public-resources/java-library-generation. # 3. [optional] generation_config, the path to the generation configuration, # the default value is generation_config.yaml in the repository root. while [[ $# -gt 0 ]]; do @@ -35,10 +34,6 @@ case "${key}" in current_branch="$2" shift ;; - --image_tag) - image_tag="$2" - shift - ;; --generation_config) generation_config="$2" shift @@ -61,14 +56,9 @@ if [ -z "${current_branch}" ]; then exit 1 fi -if [ -z "${image_tag}" ]; then - echo "missing required argument --image_tag" - exit 1 -fi - if [ -z "${generation_config}" ]; then generation_config=generation_config.yaml - echo "Use default generation config: ${generation_config}" + echo "Using default generation config: ${generation_config}" fi workspace_name="/workspace" @@ -88,6 +78,9 @@ fi git show "${target_branch}":"${generation_config}" > "${baseline_generation_config}" config_diff=$(diff "${generation_config}" "${baseline_generation_config}" || true) +# parse image tag from the generation configuration. +image_tag=$(grep "gapic_generator_version" "${generation_config}" | cut -d ':' -f 2 | xargs) + # run hermetic code generation docker image. docker run \ --rm \ From bd1a2da99c369395eea46886468f54af929ca537 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 12 Jun 2024 17:18:25 +0000 Subject: [PATCH 05/17] correct workflow name --- .github/workflows/update_googleapis_committish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_googleapis_committish.yaml b/.github/workflows/update_googleapis_committish.yaml index aac08d039..7cc9356f0 100644 --- a/.github/workflows/update_googleapis_committish.yaml +++ b/.github/workflows/update_googleapis_committish.yaml @@ -13,7 +13,7 @@ # limitations under the License. # GitHub action job to test core java library features on # downstream client libraries before they are released. -name: Update googleapis commit +name: Update googleapis committish on: schedule: - cron: '0 2 * * *' From 768376990ec7e0e7f71c4ec2fec3a49842d36fd6 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 12 Jun 2024 17:45:14 +0000 Subject: [PATCH 06/17] update config scripts and yamls --- .../scripts}/hermetic_library_generation.sh | 0 .../scripts/update_generation_config.sh | 39 ++++++++++++++--- .../workflows/update_generation_config.yaml | 42 +++++++++++++++++++ 3 files changed, 76 insertions(+), 5 deletions(-) rename {generation => .github/scripts}/hermetic_library_generation.sh (100%) rename generation/update_googleapis_committish.sh => .github/scripts/update_generation_config.sh (59%) create mode 100644 .github/workflows/update_generation_config.yaml diff --git a/generation/hermetic_library_generation.sh b/.github/scripts/hermetic_library_generation.sh similarity index 100% rename from generation/hermetic_library_generation.sh rename to .github/scripts/hermetic_library_generation.sh diff --git a/generation/update_googleapis_committish.sh b/.github/scripts/update_generation_config.sh similarity index 59% rename from generation/update_googleapis_committish.sh rename to .github/scripts/update_generation_config.sh index 5dfcaba56..561a31304 100644 --- a/generation/update_googleapis_committish.sh +++ b/.github/scripts/update_generation_config.sh @@ -1,12 +1,32 @@ #!/bin/bash set -e # This script should be run at the root of the repository. -# This script is used to update googleapis committish to latest in generation -# configuration at the time of running and create a pull request. +# This script is used to update googleapis_commitish, gapic_generator_version, +# and libraries_bom_version in generation configuration at the time of running +# and create a pull request. # The following commands need to be installed before running the script: # 1. git # 2. gh +# 3. jq + +# Utility functions +# Get the latest released version of a Maven artifact. +function get_latest_released_version() { + local group_id=$1 + local artifact_id=$2 + latest=$(curl -s "https://search.maven.org/solrsearch/select?q=g:${group_id}+AND+a:${artifact_id}&core=gav&rows=500&wt=json" | jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v' | sort -V | tail -n 1) + echo "${latest}" +} + +# Update a key to a new value in the generation config. +function update_config() { + local key_word=$1 + local new_value=$2 + local file=$3 + echo "Update ${key_word} to ${new_value} in ${file}" + sed -i -e "s/^${key_word}.*$/${key_word}: ${new_value}/" "${file}" +} # The parameters of this script is: # 1. base_branch, the base branch of the result pull request. @@ -52,7 +72,7 @@ if [ -z "${generation_config}" ]; then fi current_branch="generate-libraries-${base_branch}" -title="chore: update googleapis committish at $(date)" +title="chore: Update generation configuration at $(date)" # try to find a open pull request associated with the branch pr_num=$(gh pr list -s open -H "${current_branch}" -q . --json number | jq ".[] | .number") @@ -72,12 +92,20 @@ git pull latest_commit=$(git rev-parse HEAD) popd rm -rf tmp-googleapis -sed -i -e "s/^googleapis_commitish.*$/googleapis_commitish: ${latest_commit}/" "${generation_config}" +update_config "googleapis_commitish" "${latest_commit}" "${generation_config}" + +# update gapic-generator-java version to the latest +latest_version=$(get_latest_released_version "com.google.api" "gapic-generator-java") +update_config "gapic_generator_version" "${latest_version}" "${generation_config}" + +# update libraries-bom version to the latest +latest_version=$(get_latest_released_version "com.google.cloud" "libraries-bom") +update_config "libraries_bom_version" "${latest_version}" "${generation_config}" git add "${generation_config}" changed_files=$(git diff --cached --name-only) if [[ "${changed_files}" == "" ]]; then - echo "The latest googleapis commit is not changed." + echo "The latest generation config is not changed." echo "Skip committing to the pull request." exit 0 fi @@ -89,4 +117,5 @@ if [ -z "${pr_num}" ]; then gh pr create --title "${title}" --head "${current_branch}" --body "${title}" --base "${base_branch}" else git push + gh pr edit "${pr_num}" --title "${title}" --body "${title}" fi diff --git a/.github/workflows/update_generation_config.yaml b/.github/workflows/update_generation_config.yaml new file mode 100644 index 000000000..70b513312 --- /dev/null +++ b/.github/workflows/update_generation_config.yaml @@ -0,0 +1,42 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# GitHub action job to test core java library features on +# downstream client libraries before they are released. +name: Update generation configuration +on: + schedule: + - cron: '0 2 * * *' + workflow_dispatch: + +jobs: + update-generation-config: + runs-on: ubuntu-22.04 + env: + # the branch into which the pull request is merged + base_branch: main + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} + - name: Update params in generation config to latest + shell: bash + run: | + set -x + [ -z "$(git config user.email)" ] && git config --global user.email "cloud-java-bot@google.com" + [ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot" + bash .github/scripts/update_generation_config.sh.sh \ + --base_branch "${base_branch}"\ + --repo ${{ github.repository }} + env: + GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} From 2a35979e963b0d35fd91402256a13ca9c69384b7 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Thu, 20 Jun 2024 20:41:47 +0000 Subject: [PATCH 07/17] remove old update_googleapis_committish workflow --- .../update_googleapis_committish.yaml | 42 ------------------- 1 file changed, 42 deletions(-) delete mode 100644 .github/workflows/update_googleapis_committish.yaml diff --git a/.github/workflows/update_googleapis_committish.yaml b/.github/workflows/update_googleapis_committish.yaml deleted file mode 100644 index 7cc9356f0..000000000 --- a/.github/workflows/update_googleapis_committish.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# GitHub action job to test core java library features on -# downstream client libraries before they are released. -name: Update googleapis committish -on: - schedule: - - cron: '0 2 * * *' - workflow_dispatch: - -jobs: - update-googleapis-committish: - runs-on: ubuntu-22.04 - env: - # the branch into which the pull request is merged - base_branch: main - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} - - name: Update googleapis committish to latest - shell: bash - run: | - set -x - [ -z "$(git config user.email)" ] && git config --global user.email "cloud-java-bot@google.com" - [ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot" - bash generation/update_googleapis_committish.sh \ - --base_branch "${base_branch}"\ - --repo ${{ github.repository }} - env: - GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} From 59046f83269c16fb775d1069b54ee5de0749b8e5 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Thu, 20 Jun 2024 21:17:40 +0000 Subject: [PATCH 08/17] restore proto folder --- proto-google-cloud-datastore-admin-v1/pom.xml | 4 +- proto-google-cloud-datastore-v1/pom.xml | 4 +- .../google/datastore/v1/DatastoreProto.java | 310 ++++++++------- .../google/datastore/v1/LookupRequest.java | 329 ++++++++++++++++ .../datastore/v1/LookupRequestOrBuilder.java | 50 +++ .../com/google/datastore/v1/Mutation.java | 366 +++++++++++++++++- .../datastore/v1/MutationOrBuilder.java | 56 +++ .../google/datastore/v1/RunQueryRequest.java | 337 +++++++++++++++- .../v1/RunQueryRequestOrBuilder.java | 47 +++ .../proto/google/datastore/v1/datastore.proto | 42 ++ 10 files changed, 1385 insertions(+), 160 deletions(-) diff --git a/proto-google-cloud-datastore-admin-v1/pom.xml b/proto-google-cloud-datastore-admin-v1/pom.xml index b7d230c93..94759e4ad 100644 --- a/proto-google-cloud-datastore-admin-v1/pom.xml +++ b/proto-google-cloud-datastore-admin-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-datastore-admin-v1 - 2.19.4-SNAPSHOT + 2.20.1 proto-google-cloud-datastore-admin-v1 Proto library for google-cloud-datastore com.google.cloud google-cloud-datastore-parent - 2.19.4-SNAPSHOT + 2.20.1 diff --git a/proto-google-cloud-datastore-v1/pom.xml b/proto-google-cloud-datastore-v1/pom.xml index 406872937..3d41fdbe2 100644 --- a/proto-google-cloud-datastore-v1/pom.xml +++ b/proto-google-cloud-datastore-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-datastore-v1 - 0.110.4-SNAPSHOT + 0.111.1 proto-google-cloud-datastore-v1 PROTO library for proto-google-cloud-datastore-v1 com.google.cloud google-cloud-datastore-parent - 2.19.4-SNAPSHOT + 2.20.1 diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/DatastoreProto.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/DatastoreProto.java index 1b8753e35..e637dd010 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/DatastoreProto.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/DatastoreProto.java @@ -100,6 +100,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_datastore_v1_MutationResult_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_datastore_v1_MutationResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_v1_PropertyMask_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_v1_PropertyMask_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_datastore_v1_ReadOptions_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -134,151 +138,157 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "entity.proto\032\037google/datastore/v1/query." + "proto\032\'google/datastore/v1/query_profile" + ".proto\032\037google/protobuf/timestamp.proto\"" - + "\242\001\n\rLookupRequest\022\027\n\nproject_id\030\010 \001(\tB\003\340" + + "\334\001\n\rLookupRequest\022\027\n\nproject_id\030\010 \001(\tB\003\340" + "A\002\022\023\n\013database_id\030\t \001(\t\0226\n\014read_options\030" + "\001 \001(\0132 .google.datastore.v1.ReadOptions\022" + "+\n\004keys\030\003 \003(\0132\030.google.datastore.v1.KeyB" - + "\003\340A\002\"\346\001\n\016LookupResponse\0220\n\005found\030\001 \003(\0132!" - + ".google.datastore.v1.EntityResult\0222\n\007mis" - + "sing\030\002 \003(\0132!.google.datastore.v1.EntityR" - + "esult\022*\n\010deferred\030\003 \003(\0132\030.google.datasto" - + "re.v1.Key\022\023\n\013transaction\030\005 \001(\014\022-\n\tread_t" - + "ime\030\007 \001(\0132\032.google.protobuf.Timestamp\"\341\002" - + "\n\017RunQueryRequest\022\027\n\nproject_id\030\010 \001(\tB\003\340" - + "A\002\022\023\n\013database_id\030\t \001(\t\0226\n\014partition_id\030" - + "\002 \001(\0132 .google.datastore.v1.PartitionId\022" - + "6\n\014read_options\030\001 \001(\0132 .google.datastore" - + ".v1.ReadOptions\022+\n\005query\030\003 \001(\0132\032.google." - + "datastore.v1.QueryH\000\0222\n\tgql_query\030\007 \001(\0132" - + "\035.google.datastore.v1.GqlQueryH\000\022A\n\017expl" - + "ain_options\030\014 \001(\0132#.google.datastore.v1." - + "ExplainOptionsB\003\340A\001B\014\n\nquery_type\"\306\001\n\020Ru" - + "nQueryResponse\0224\n\005batch\030\001 \001(\0132%.google.d" - + "atastore.v1.QueryResultBatch\022)\n\005query\030\002 " - + "\001(\0132\032.google.datastore.v1.Query\022\023\n\013trans" - + "action\030\005 \001(\014\022<\n\017explain_metrics\030\t \001(\0132#." - + "google.datastore.v1.ExplainMetrics\"\203\003\n\032R" - + "unAggregationQueryRequest\022\027\n\nproject_id\030" - + "\010 \001(\tB\003\340A\002\022\023\n\013database_id\030\t \001(\t\0226\n\014parti" - + "tion_id\030\002 \001(\0132 .google.datastore.v1.Part" - + "itionId\0226\n\014read_options\030\001 \001(\0132 .google.d" - + "atastore.v1.ReadOptions\022B\n\021aggregation_q" - + "uery\030\003 \001(\0132%.google.datastore.v1.Aggrega" - + "tionQueryH\000\0222\n\tgql_query\030\007 \001(\0132\035.google." - + "datastore.v1.GqlQueryH\000\022A\n\017explain_optio" - + "ns\030\013 \001(\0132#.google.datastore.v1.ExplainOp" - + "tionsB\003\340A\001B\014\n\nquery_type\"\342\001\n\033RunAggregat" - + "ionQueryResponse\022:\n\005batch\030\001 \001(\0132+.google" - + ".datastore.v1.AggregationResultBatch\0224\n\005" - + "query\030\002 \001(\0132%.google.datastore.v1.Aggreg" - + "ationQuery\022\023\n\013transaction\030\005 \001(\014\022<\n\017expla" - + "in_metrics\030\t \001(\0132#.google.datastore.v1.E" - + "xplainMetrics\"\215\001\n\027BeginTransactionReques" - + "t\022\027\n\nproject_id\030\010 \001(\tB\003\340A\002\022\023\n\013database_i" - + "d\030\t \001(\t\022D\n\023transaction_options\030\n \001(\0132\'.g" - + "oogle.datastore.v1.TransactionOptions\"/\n" - + "\030BeginTransactionResponse\022\023\n\013transaction" - + "\030\001 \001(\014\"Y\n\017RollbackRequest\022\027\n\nproject_id\030" - + "\010 \001(\tB\003\340A\002\022\023\n\013database_id\030\t \001(\t\022\030\n\013trans" - + "action\030\001 \001(\014B\003\340A\002\"\022\n\020RollbackResponse\"\350\002" - + "\n\rCommitRequest\022\027\n\nproject_id\030\010 \001(\tB\003\340A\002" - + "\022\023\n\013database_id\030\t \001(\t\0225\n\004mode\030\005 \001(\0162\'.go" - + "ogle.datastore.v1.CommitRequest.Mode\022\025\n\013" - + "transaction\030\001 \001(\014H\000\022I\n\026single_use_transa" - + "ction\030\n \001(\0132\'.google.datastore.v1.Transa" - + "ctionOptionsH\000\0220\n\tmutations\030\006 \003(\0132\035.goog" - + "le.datastore.v1.Mutation\"F\n\004Mode\022\024\n\020MODE" - + "_UNSPECIFIED\020\000\022\021\n\rTRANSACTIONAL\020\001\022\025\n\021NON" - + "_TRANSACTIONAL\020\002B\026\n\024transaction_selector" - + "\"\227\001\n\016CommitResponse\022=\n\020mutation_results\030" - + "\003 \003(\0132#.google.datastore.v1.MutationResu" - + "lt\022\025\n\rindex_updates\030\004 \001(\005\022/\n\013commit_time" - + "\030\010 \001(\0132\032.google.protobuf.Timestamp\"o\n\022Al" - + "locateIdsRequest\022\027\n\nproject_id\030\010 \001(\tB\003\340A" - + "\002\022\023\n\013database_id\030\t \001(\t\022+\n\004keys\030\001 \003(\0132\030.g" - + "oogle.datastore.v1.KeyB\003\340A\002\"=\n\023AllocateI" - + "dsResponse\022&\n\004keys\030\001 \003(\0132\030.google.datast" - + "ore.v1.Key\"n\n\021ReserveIdsRequest\022\027\n\nproje" - + "ct_id\030\010 \001(\tB\003\340A\002\022\023\n\013database_id\030\t \001(\t\022+\n" - + "\004keys\030\001 \003(\0132\030.google.datastore.v1.KeyB\003\340" - + "A\002\"\024\n\022ReserveIdsResponse\"\272\002\n\010Mutation\022-\n" - + "\006insert\030\004 \001(\0132\033.google.datastore.v1.Enti" - + "tyH\000\022-\n\006update\030\005 \001(\0132\033.google.datastore." - + "v1.EntityH\000\022-\n\006upsert\030\006 \001(\0132\033.google.dat" - + "astore.v1.EntityH\000\022*\n\006delete\030\007 \001(\0132\030.goo" - + "gle.datastore.v1.KeyH\000\022\026\n\014base_version\030\010" - + " \001(\003H\001\0221\n\013update_time\030\013 \001(\0132\032.google.pro" - + "tobuf.TimestampH\001B\013\n\toperationB\035\n\033confli" - + "ct_detection_strategy\"\305\001\n\016MutationResult" - + "\022%\n\003key\030\003 \001(\0132\030.google.datastore.v1.Key\022" - + "\017\n\007version\030\004 \001(\003\022/\n\013create_time\030\007 \001(\0132\032." - + "google.protobuf.Timestamp\022/\n\013update_time" - + "\030\006 \001(\0132\032.google.protobuf.Timestamp\022\031\n\021co" - + "nflict_detected\030\005 \001(\010\"\312\002\n\013ReadOptions\022L\n" - + "\020read_consistency\030\001 \001(\01620.google.datasto" - + "re.v1.ReadOptions.ReadConsistencyH\000\022\025\n\013t" - + "ransaction\030\002 \001(\014H\000\022B\n\017new_transaction\030\003 " - + "\001(\0132\'.google.datastore.v1.TransactionOpt" - + "ionsH\000\022/\n\tread_time\030\004 \001(\0132\032.google.proto" - + "buf.TimestampH\000\"M\n\017ReadConsistency\022 \n\034RE" - + "AD_CONSISTENCY_UNSPECIFIED\020\000\022\n\n\006STRONG\020\001" - + "\022\014\n\010EVENTUAL\020\002B\022\n\020consistency_type\"\222\002\n\022T" - + "ransactionOptions\022G\n\nread_write\030\001 \001(\01321." - + "google.datastore.v1.TransactionOptions.R" - + "eadWriteH\000\022E\n\tread_only\030\002 \001(\01320.google.d" - + "atastore.v1.TransactionOptions.ReadOnlyH" - + "\000\032)\n\tReadWrite\022\034\n\024previous_transaction\030\001" - + " \001(\014\0329\n\010ReadOnly\022-\n\tread_time\030\001 \001(\0132\032.go" - + "ogle.protobuf.TimestampB\006\n\004mode2\341\r\n\tData" - + "store\022\300\001\n\006Lookup\022\".google.datastore.v1.L" - + "ookupRequest\032#.google.datastore.v1.Looku" - + "pResponse\"m\332A\034project_id,read_options,ke" - + "ys\202\323\344\223\002%\" /v1/projects/{project_id}:look" - + "up:\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013database_id" - + "\022\251\001\n\010RunQuery\022$.google.datastore.v1.RunQ" - + "ueryRequest\032%.google.datastore.v1.RunQue" - + "ryResponse\"P\202\323\344\223\002\'\"\"/v1/projects/{projec" - + "t_id}:runQuery:\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n" - + "\013database_id\022\325\001\n\023RunAggregationQuery\022/.g" - + "oogle.datastore.v1.RunAggregationQueryRe" - + "quest\0320.google.datastore.v1.RunAggregati" - + "onQueryResponse\"[\202\323\344\223\0022\"-/v1/projects/{p" - + "roject_id}:runAggregationQuery:\001*\212\323\344\223\002\035\022" - + "\014\n\nproject_id\022\r\n\013database_id\022\326\001\n\020BeginTr" - + "ansaction\022,.google.datastore.v1.BeginTra" - + "nsactionRequest\032-.google.datastore.v1.Be" - + "ginTransactionResponse\"e\332A\nproject_id\202\323\344" - + "\223\002/\"*/v1/projects/{project_id}:beginTran" - + "saction:\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013databa" - + "se_id\022\346\001\n\006Commit\022\".google.datastore.v1.C" - + "ommitRequest\032#.google.datastore.v1.Commi" - + "tResponse\"\222\001\332A%project_id,mode,transacti" - + "on,mutations\332A\031project_id,mode,mutations" - + "\202\323\344\223\002%\" /v1/projects/{project_id}:commit" - + ":\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013database_id\022\302" - + "\001\n\010Rollback\022$.google.datastore.v1.Rollba" - + "ckRequest\032%.google.datastore.v1.Rollback" - + "Response\"i\332A\026project_id,transaction\202\323\344\223\002" - + "\'\"\"/v1/projects/{project_id}:rollback:\001*" - + "\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013database_id\022\307\001\n\013" - + "AllocateIds\022\'.google.datastore.v1.Alloca" - + "teIdsRequest\032(.google.datastore.v1.Alloc" - + "ateIdsResponse\"e\332A\017project_id,keys\202\323\344\223\002*" - + "\"%/v1/projects/{project_id}:allocateIds:" - + "\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013database_id\022\303\001" - + "\n\nReserveIds\022&.google.datastore.v1.Reser" - + "veIdsRequest\032\'.google.datastore.v1.Reser" - + "veIdsResponse\"d\332A\017project_id,keys\202\323\344\223\002)\"" - + "$/v1/projects/{project_id}:reserveIds:\001*" - + "\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013database_id\032v\312A\030" - + "datastore.googleapis.com\322AXhttps://www.g" - + "oogleapis.com/auth/cloud-platform,https:" - + "//www.googleapis.com/auth/datastoreB\300\001\n\027" - + "com.google.datastore.v1B\016DatastoreProtoP" - + "\001Z + * The properties to return. Defaults to returning all properties. + * + * If this field is set and an entity has a property not referenced in the + * mask, it will be absent from [LookupResponse.found.entity.properties][]. + * + * The entity's key is always returned. + * + * + * .google.datastore.v1.PropertyMask property_mask = 5; + * + * @return Whether the propertyMask field is set. + */ + @java.lang.Override + public boolean hasPropertyMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The properties to return. Defaults to returning all properties.
+   *
+   * If this field is set and an entity has a property not referenced in the
+   * mask, it will be absent from [LookupResponse.found.entity.properties][].
+   *
+   * The entity's key is always returned.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + * + * @return The propertyMask. + */ + @java.lang.Override + public com.google.datastore.v1.PropertyMask getPropertyMask() { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } + /** + * + * + *
+   * The properties to return. Defaults to returning all properties.
+   *
+   * If this field is set and an entity has a property not referenced in the
+   * mask, it will be absent from [LookupResponse.found.entity.properties][].
+   *
+   * The entity's key is always returned.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + */ + @java.lang.Override + public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -319,6 +384,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < keys_.size(); i++) { output.writeMessage(3, keys_.get(i)); } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getPropertyMask()); + } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 8, projectId_); } @@ -340,6 +408,9 @@ public int getSerializedSize() { for (int i = 0; i < keys_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, keys_.get(i)); } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getPropertyMask()); + } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, projectId_); } @@ -368,6 +439,10 @@ public boolean equals(final java.lang.Object obj) { if (!getReadOptions().equals(other.getReadOptions())) return false; } if (!getKeysList().equals(other.getKeysList())) return false; + if (hasPropertyMask() != other.hasPropertyMask()) return false; + if (hasPropertyMask()) { + if (!getPropertyMask().equals(other.getPropertyMask())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -391,6 +466,10 @@ public int hashCode() { hash = (37 * hash) + KEYS_FIELD_NUMBER; hash = (53 * hash) + getKeysList().hashCode(); } + if (hasPropertyMask()) { + hash = (37 * hash) + PROPERTY_MASK_FIELD_NUMBER; + hash = (53 * hash) + getPropertyMask().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -532,6 +611,7 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getReadOptionsFieldBuilder(); getKeysFieldBuilder(); + getPropertyMaskFieldBuilder(); } } @@ -553,6 +633,11 @@ public Builder clear() { keysBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000008); + propertyMask_ = null; + if (propertyMaskBuilder_ != null) { + propertyMaskBuilder_.dispose(); + propertyMaskBuilder_ = null; + } return this; } @@ -614,6 +699,11 @@ private void buildPartial0(com.google.datastore.v1.LookupRequest result) { readOptionsBuilder_ == null ? readOptions_ : readOptionsBuilder_.build(); to_bitField0_ |= 0x00000001; } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.propertyMask_ = + propertyMaskBuilder_ == null ? propertyMask_ : propertyMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } result.bitField0_ |= to_bitField0_; } @@ -702,6 +792,9 @@ public Builder mergeFrom(com.google.datastore.v1.LookupRequest other) { } } } + if (other.hasPropertyMask()) { + mergePropertyMask(other.getPropertyMask()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -746,6 +839,12 @@ public Builder mergeFrom( } break; } // case 26 + case 42: + { + input.readMessage(getPropertyMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 case 66: { projectId_ = input.readStringRequireUtf8(); @@ -1549,6 +1648,236 @@ public java.util.List getKeysBuilderList() return keysBuilder_; } + private com.google.datastore.v1.PropertyMask propertyMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PropertyMask, + com.google.datastore.v1.PropertyMask.Builder, + com.google.datastore.v1.PropertyMaskOrBuilder> + propertyMaskBuilder_; + /** + * + * + *
+     * The properties to return. Defaults to returning all properties.
+     *
+     * If this field is set and an entity has a property not referenced in the
+     * mask, it will be absent from [LookupResponse.found.entity.properties][].
+     *
+     * The entity's key is always returned.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + * + * @return Whether the propertyMask field is set. + */ + public boolean hasPropertyMask() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * The properties to return. Defaults to returning all properties.
+     *
+     * If this field is set and an entity has a property not referenced in the
+     * mask, it will be absent from [LookupResponse.found.entity.properties][].
+     *
+     * The entity's key is always returned.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + * + * @return The propertyMask. + */ + public com.google.datastore.v1.PropertyMask getPropertyMask() { + if (propertyMaskBuilder_ == null) { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } else { + return propertyMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The properties to return. Defaults to returning all properties.
+     *
+     * If this field is set and an entity has a property not referenced in the
+     * mask, it will be absent from [LookupResponse.found.entity.properties][].
+     *
+     * The entity's key is always returned.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + */ + public Builder setPropertyMask(com.google.datastore.v1.PropertyMask value) { + if (propertyMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + propertyMask_ = value; + } else { + propertyMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The properties to return. Defaults to returning all properties.
+     *
+     * If this field is set and an entity has a property not referenced in the
+     * mask, it will be absent from [LookupResponse.found.entity.properties][].
+     *
+     * The entity's key is always returned.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + */ + public Builder setPropertyMask(com.google.datastore.v1.PropertyMask.Builder builderForValue) { + if (propertyMaskBuilder_ == null) { + propertyMask_ = builderForValue.build(); + } else { + propertyMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The properties to return. Defaults to returning all properties.
+     *
+     * If this field is set and an entity has a property not referenced in the
+     * mask, it will be absent from [LookupResponse.found.entity.properties][].
+     *
+     * The entity's key is always returned.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + */ + public Builder mergePropertyMask(com.google.datastore.v1.PropertyMask value) { + if (propertyMaskBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && propertyMask_ != null + && propertyMask_ != com.google.datastore.v1.PropertyMask.getDefaultInstance()) { + getPropertyMaskBuilder().mergeFrom(value); + } else { + propertyMask_ = value; + } + } else { + propertyMaskBuilder_.mergeFrom(value); + } + if (propertyMask_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The properties to return. Defaults to returning all properties.
+     *
+     * If this field is set and an entity has a property not referenced in the
+     * mask, it will be absent from [LookupResponse.found.entity.properties][].
+     *
+     * The entity's key is always returned.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + */ + public Builder clearPropertyMask() { + bitField0_ = (bitField0_ & ~0x00000010); + propertyMask_ = null; + if (propertyMaskBuilder_ != null) { + propertyMaskBuilder_.dispose(); + propertyMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The properties to return. Defaults to returning all properties.
+     *
+     * If this field is set and an entity has a property not referenced in the
+     * mask, it will be absent from [LookupResponse.found.entity.properties][].
+     *
+     * The entity's key is always returned.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + */ + public com.google.datastore.v1.PropertyMask.Builder getPropertyMaskBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getPropertyMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The properties to return. Defaults to returning all properties.
+     *
+     * If this field is set and an entity has a property not referenced in the
+     * mask, it will be absent from [LookupResponse.found.entity.properties][].
+     *
+     * The entity's key is always returned.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + */ + public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() { + if (propertyMaskBuilder_ != null) { + return propertyMaskBuilder_.getMessageOrBuilder(); + } else { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } + } + /** + * + * + *
+     * The properties to return. Defaults to returning all properties.
+     *
+     * If this field is set and an entity has a property not referenced in the
+     * mask, it will be absent from [LookupResponse.found.entity.properties][].
+     *
+     * The entity's key is always returned.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PropertyMask, + com.google.datastore.v1.PropertyMask.Builder, + com.google.datastore.v1.PropertyMaskOrBuilder> + getPropertyMaskFieldBuilder() { + if (propertyMaskBuilder_ == null) { + propertyMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PropertyMask, + com.google.datastore.v1.PropertyMask.Builder, + com.google.datastore.v1.PropertyMaskOrBuilder>( + getPropertyMask(), getParentForChildren(), isClean()); + propertyMask_ = null; + } + return propertyMaskBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/LookupRequestOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/LookupRequestOrBuilder.java index 82fe24661..d343eeca4 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/LookupRequestOrBuilder.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/LookupRequestOrBuilder.java @@ -170,4 +170,54 @@ public interface LookupRequestOrBuilder * */ com.google.datastore.v1.KeyOrBuilder getKeysOrBuilder(int index); + + /** + * + * + *
+   * The properties to return. Defaults to returning all properties.
+   *
+   * If this field is set and an entity has a property not referenced in the
+   * mask, it will be absent from [LookupResponse.found.entity.properties][].
+   *
+   * The entity's key is always returned.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + * + * @return Whether the propertyMask field is set. + */ + boolean hasPropertyMask(); + /** + * + * + *
+   * The properties to return. Defaults to returning all properties.
+   *
+   * If this field is set and an entity has a property not referenced in the
+   * mask, it will be absent from [LookupResponse.found.entity.properties][].
+   *
+   * The entity's key is always returned.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + * + * @return The propertyMask. + */ + com.google.datastore.v1.PropertyMask getPropertyMask(); + /** + * + * + *
+   * The properties to return. Defaults to returning all properties.
+   *
+   * If this field is set and an entity has a property not referenced in the
+   * mask, it will be absent from [LookupResponse.found.entity.properties][].
+   *
+   * The entity's key is always returned.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + */ + com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder(); } diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Mutation.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Mutation.java index 91895d180..6857d48a6 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Mutation.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Mutation.java @@ -60,6 +60,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.datastore.v1.Mutation.class, com.google.datastore.v1.Mutation.Builder.class); } + private int bitField0_; private int operationCase_ = 0; @SuppressWarnings("serial") @@ -476,6 +477,77 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { return com.google.protobuf.Timestamp.getDefaultInstance(); } + public static final int PROPERTY_MASK_FIELD_NUMBER = 9; + private com.google.datastore.v1.PropertyMask propertyMask_; + /** + * + * + *
+   * The properties to write in this mutation.
+   * None of the properties in the mask may have a reserved name, except for
+   * `__key__`.
+   * This field is ignored for `delete`.
+   *
+   * If the entity already exists, only properties referenced in the mask are
+   * updated, others are left untouched.
+   * Properties referenced in the mask but not in the entity are deleted.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + * + * @return Whether the propertyMask field is set. + */ + @java.lang.Override + public boolean hasPropertyMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The properties to write in this mutation.
+   * None of the properties in the mask may have a reserved name, except for
+   * `__key__`.
+   * This field is ignored for `delete`.
+   *
+   * If the entity already exists, only properties referenced in the mask are
+   * updated, others are left untouched.
+   * Properties referenced in the mask but not in the entity are deleted.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + * + * @return The propertyMask. + */ + @java.lang.Override + public com.google.datastore.v1.PropertyMask getPropertyMask() { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } + /** + * + * + *
+   * The properties to write in this mutation.
+   * None of the properties in the mask may have a reserved name, except for
+   * `__key__`.
+   * This field is ignored for `delete`.
+   *
+   * If the entity already exists, only properties referenced in the mask are
+   * updated, others are left untouched.
+   * Properties referenced in the mask but not in the entity are deleted.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + */ + @java.lang.Override + public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -505,6 +577,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (conflictDetectionStrategyCase_ == 8) { output.writeInt64(8, (long) ((java.lang.Long) conflictDetectionStrategy_)); } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(9, getPropertyMask()); + } if (conflictDetectionStrategyCase_ == 11) { output.writeMessage(11, (com.google.protobuf.Timestamp) conflictDetectionStrategy_); } @@ -542,6 +617,9 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeInt64Size( 8, (long) ((java.lang.Long) conflictDetectionStrategy_)); } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getPropertyMask()); + } if (conflictDetectionStrategyCase_ == 11) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( @@ -562,6 +640,10 @@ public boolean equals(final java.lang.Object obj) { } com.google.datastore.v1.Mutation other = (com.google.datastore.v1.Mutation) obj; + if (hasPropertyMask() != other.hasPropertyMask()) return false; + if (hasPropertyMask()) { + if (!getPropertyMask().equals(other.getPropertyMask())) return false; + } if (!getOperationCase().equals(other.getOperationCase())) return false; switch (operationCase_) { case 4: @@ -602,6 +684,10 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPropertyMask()) { + hash = (37 * hash) + PROPERTY_MASK_FIELD_NUMBER; + hash = (53 * hash) + getPropertyMask().hashCode(); + } switch (operationCase_) { case 4: hash = (37 * hash) + INSERT_FIELD_NUMBER; @@ -762,10 +848,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.datastore.v1.Mutation.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPropertyMaskFieldBuilder(); + } } @java.lang.Override @@ -787,6 +882,11 @@ public Builder clear() { if (updateTimeBuilder_ != null) { updateTimeBuilder_.clear(); } + propertyMask_ = null; + if (propertyMaskBuilder_ != null) { + propertyMaskBuilder_.dispose(); + propertyMaskBuilder_ = null; + } operationCase_ = 0; operation_ = null; conflictDetectionStrategyCase_ = 0; @@ -827,6 +927,13 @@ public com.google.datastore.v1.Mutation buildPartial() { private void buildPartial0(com.google.datastore.v1.Mutation result) { int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000040) != 0)) { + result.propertyMask_ = + propertyMaskBuilder_ == null ? propertyMask_ : propertyMaskBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } private void buildPartialOneofs(com.google.datastore.v1.Mutation result) { @@ -896,6 +1003,9 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.datastore.v1.Mutation other) { if (other == com.google.datastore.v1.Mutation.getDefaultInstance()) return this; + if (other.hasPropertyMask()) { + mergePropertyMask(other.getPropertyMask()); + } switch (other.getOperationCase()) { case INSERT: { @@ -994,6 +1104,12 @@ public Builder mergeFrom( conflictDetectionStrategyCase_ = 8; break; } // case 64 + case 74: + { + input.readMessage(getPropertyMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 74 case 90: { input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); @@ -2206,6 +2322,254 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { return updateTimeBuilder_; } + private com.google.datastore.v1.PropertyMask propertyMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PropertyMask, + com.google.datastore.v1.PropertyMask.Builder, + com.google.datastore.v1.PropertyMaskOrBuilder> + propertyMaskBuilder_; + /** + * + * + *
+     * The properties to write in this mutation.
+     * None of the properties in the mask may have a reserved name, except for
+     * `__key__`.
+     * This field is ignored for `delete`.
+     *
+     * If the entity already exists, only properties referenced in the mask are
+     * updated, others are left untouched.
+     * Properties referenced in the mask but not in the entity are deleted.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + * + * @return Whether the propertyMask field is set. + */ + public boolean hasPropertyMask() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * The properties to write in this mutation.
+     * None of the properties in the mask may have a reserved name, except for
+     * `__key__`.
+     * This field is ignored for `delete`.
+     *
+     * If the entity already exists, only properties referenced in the mask are
+     * updated, others are left untouched.
+     * Properties referenced in the mask but not in the entity are deleted.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + * + * @return The propertyMask. + */ + public com.google.datastore.v1.PropertyMask getPropertyMask() { + if (propertyMaskBuilder_ == null) { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } else { + return propertyMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The properties to write in this mutation.
+     * None of the properties in the mask may have a reserved name, except for
+     * `__key__`.
+     * This field is ignored for `delete`.
+     *
+     * If the entity already exists, only properties referenced in the mask are
+     * updated, others are left untouched.
+     * Properties referenced in the mask but not in the entity are deleted.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + */ + public Builder setPropertyMask(com.google.datastore.v1.PropertyMask value) { + if (propertyMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + propertyMask_ = value; + } else { + propertyMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The properties to write in this mutation.
+     * None of the properties in the mask may have a reserved name, except for
+     * `__key__`.
+     * This field is ignored for `delete`.
+     *
+     * If the entity already exists, only properties referenced in the mask are
+     * updated, others are left untouched.
+     * Properties referenced in the mask but not in the entity are deleted.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + */ + public Builder setPropertyMask(com.google.datastore.v1.PropertyMask.Builder builderForValue) { + if (propertyMaskBuilder_ == null) { + propertyMask_ = builderForValue.build(); + } else { + propertyMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The properties to write in this mutation.
+     * None of the properties in the mask may have a reserved name, except for
+     * `__key__`.
+     * This field is ignored for `delete`.
+     *
+     * If the entity already exists, only properties referenced in the mask are
+     * updated, others are left untouched.
+     * Properties referenced in the mask but not in the entity are deleted.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + */ + public Builder mergePropertyMask(com.google.datastore.v1.PropertyMask value) { + if (propertyMaskBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && propertyMask_ != null + && propertyMask_ != com.google.datastore.v1.PropertyMask.getDefaultInstance()) { + getPropertyMaskBuilder().mergeFrom(value); + } else { + propertyMask_ = value; + } + } else { + propertyMaskBuilder_.mergeFrom(value); + } + if (propertyMask_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The properties to write in this mutation.
+     * None of the properties in the mask may have a reserved name, except for
+     * `__key__`.
+     * This field is ignored for `delete`.
+     *
+     * If the entity already exists, only properties referenced in the mask are
+     * updated, others are left untouched.
+     * Properties referenced in the mask but not in the entity are deleted.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + */ + public Builder clearPropertyMask() { + bitField0_ = (bitField0_ & ~0x00000040); + propertyMask_ = null; + if (propertyMaskBuilder_ != null) { + propertyMaskBuilder_.dispose(); + propertyMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The properties to write in this mutation.
+     * None of the properties in the mask may have a reserved name, except for
+     * `__key__`.
+     * This field is ignored for `delete`.
+     *
+     * If the entity already exists, only properties referenced in the mask are
+     * updated, others are left untouched.
+     * Properties referenced in the mask but not in the entity are deleted.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + */ + public com.google.datastore.v1.PropertyMask.Builder getPropertyMaskBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getPropertyMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The properties to write in this mutation.
+     * None of the properties in the mask may have a reserved name, except for
+     * `__key__`.
+     * This field is ignored for `delete`.
+     *
+     * If the entity already exists, only properties referenced in the mask are
+     * updated, others are left untouched.
+     * Properties referenced in the mask but not in the entity are deleted.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + */ + public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() { + if (propertyMaskBuilder_ != null) { + return propertyMaskBuilder_.getMessageOrBuilder(); + } else { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } + } + /** + * + * + *
+     * The properties to write in this mutation.
+     * None of the properties in the mask may have a reserved name, except for
+     * `__key__`.
+     * This field is ignored for `delete`.
+     *
+     * If the entity already exists, only properties referenced in the mask are
+     * updated, others are left untouched.
+     * Properties referenced in the mask but not in the entity are deleted.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PropertyMask, + com.google.datastore.v1.PropertyMask.Builder, + com.google.datastore.v1.PropertyMaskOrBuilder> + getPropertyMaskFieldBuilder() { + if (propertyMaskBuilder_ == null) { + propertyMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PropertyMask, + com.google.datastore.v1.PropertyMask.Builder, + com.google.datastore.v1.PropertyMaskOrBuilder>( + getPropertyMask(), getParentForChildren(), isClean()); + propertyMask_ = null; + } + return propertyMaskBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/MutationOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/MutationOrBuilder.java index e833ed942..e051e6003 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/MutationOrBuilder.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/MutationOrBuilder.java @@ -246,6 +246,62 @@ public interface MutationOrBuilder */ com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + /** + * + * + *
+   * The properties to write in this mutation.
+   * None of the properties in the mask may have a reserved name, except for
+   * `__key__`.
+   * This field is ignored for `delete`.
+   *
+   * If the entity already exists, only properties referenced in the mask are
+   * updated, others are left untouched.
+   * Properties referenced in the mask but not in the entity are deleted.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + * + * @return Whether the propertyMask field is set. + */ + boolean hasPropertyMask(); + /** + * + * + *
+   * The properties to write in this mutation.
+   * None of the properties in the mask may have a reserved name, except for
+   * `__key__`.
+   * This field is ignored for `delete`.
+   *
+   * If the entity already exists, only properties referenced in the mask are
+   * updated, others are left untouched.
+   * Properties referenced in the mask but not in the entity are deleted.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + * + * @return The propertyMask. + */ + com.google.datastore.v1.PropertyMask getPropertyMask(); + /** + * + * + *
+   * The properties to write in this mutation.
+   * None of the properties in the mask may have a reserved name, except for
+   * `__key__`.
+   * This field is ignored for `delete`.
+   *
+   * If the entity already exists, only properties referenced in the mask are
+   * updated, others are left untouched.
+   * Properties referenced in the mask but not in the entity are deleted.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + */ + com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder(); + com.google.datastore.v1.Mutation.OperationCase getOperationCase(); com.google.datastore.v1.Mutation.ConflictDetectionStrategyCase getConflictDetectionStrategyCase(); diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java index 4420d5779..55691ceae 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java @@ -433,6 +433,68 @@ public com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder() { return com.google.datastore.v1.GqlQuery.getDefaultInstance(); } + public static final int PROPERTY_MASK_FIELD_NUMBER = 10; + private com.google.datastore.v1.PropertyMask propertyMask_; + /** + * + * + *
+   * The properties to return.
+   * This field must not be set for a projection query.
+   *
+   * See
+   * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + * + * @return Whether the propertyMask field is set. + */ + @java.lang.Override + public boolean hasPropertyMask() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * The properties to return.
+   * This field must not be set for a projection query.
+   *
+   * See
+   * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + * + * @return The propertyMask. + */ + @java.lang.Override + public com.google.datastore.v1.PropertyMask getPropertyMask() { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } + /** + * + * + *
+   * The properties to return.
+   * This field must not be set for a projection query.
+   *
+   * See
+   * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + */ + @java.lang.Override + public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } + public static final int EXPLAIN_OPTIONS_FIELD_NUMBER = 12; private com.google.datastore.v1.ExplainOptions explainOptions_; /** @@ -451,7 +513,7 @@ public com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder() { */ @java.lang.Override public boolean hasExplainOptions() { - return ((bitField0_ & 0x00000004) != 0); + return ((bitField0_ & 0x00000008) != 0); } /** * @@ -525,6 +587,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io com.google.protobuf.GeneratedMessageV3.writeString(output, 9, databaseId_); } if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(10, getPropertyMask()); + } + if (((bitField0_ & 0x00000008) != 0)) { output.writeMessage(12, getExplainOptions()); } getUnknownFields().writeTo(output); @@ -559,6 +624,9 @@ public int getSerializedSize() { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, databaseId_); } if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getPropertyMask()); + } + if (((bitField0_ & 0x00000008) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getExplainOptions()); } size += getUnknownFields().getSerializedSize(); @@ -586,6 +654,10 @@ public boolean equals(final java.lang.Object obj) { if (hasReadOptions()) { if (!getReadOptions().equals(other.getReadOptions())) return false; } + if (hasPropertyMask() != other.hasPropertyMask()) return false; + if (hasPropertyMask()) { + if (!getPropertyMask().equals(other.getPropertyMask())) return false; + } if (hasExplainOptions() != other.hasExplainOptions()) return false; if (hasExplainOptions()) { if (!getExplainOptions().equals(other.getExplainOptions())) return false; @@ -624,6 +696,10 @@ public int hashCode() { hash = (37 * hash) + READ_OPTIONS_FIELD_NUMBER; hash = (53 * hash) + getReadOptions().hashCode(); } + if (hasPropertyMask()) { + hash = (37 * hash) + PROPERTY_MASK_FIELD_NUMBER; + hash = (53 * hash) + getPropertyMask().hashCode(); + } if (hasExplainOptions()) { hash = (37 * hash) + EXPLAIN_OPTIONS_FIELD_NUMBER; hash = (53 * hash) + getExplainOptions().hashCode(); @@ -782,6 +858,7 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getPartitionIdFieldBuilder(); getReadOptionsFieldBuilder(); + getPropertyMaskFieldBuilder(); getExplainOptionsFieldBuilder(); } } @@ -808,6 +885,11 @@ public Builder clear() { if (gqlQueryBuilder_ != null) { gqlQueryBuilder_.clear(); } + propertyMask_ = null; + if (propertyMaskBuilder_ != null) { + propertyMaskBuilder_.dispose(); + propertyMaskBuilder_ = null; + } explainOptions_ = null; if (explainOptionsBuilder_ != null) { explainOptionsBuilder_.dispose(); @@ -870,9 +952,14 @@ private void buildPartial0(com.google.datastore.v1.RunQueryRequest result) { to_bitField0_ |= 0x00000002; } if (((from_bitField0_ & 0x00000040) != 0)) { + result.propertyMask_ = + propertyMaskBuilder_ == null ? propertyMask_ : propertyMaskBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000080) != 0)) { result.explainOptions_ = explainOptionsBuilder_ == null ? explainOptions_ : explainOptionsBuilder_.build(); - to_bitField0_ |= 0x00000004; + to_bitField0_ |= 0x00000008; } result.bitField0_ |= to_bitField0_; } @@ -949,6 +1036,9 @@ public Builder mergeFrom(com.google.datastore.v1.RunQueryRequest other) { if (other.hasReadOptions()) { mergeReadOptions(other.getReadOptions()); } + if (other.hasPropertyMask()) { + mergePropertyMask(other.getPropertyMask()); + } if (other.hasExplainOptions()) { mergeExplainOptions(other.getExplainOptions()); } @@ -1030,10 +1120,16 @@ public Builder mergeFrom( bitField0_ |= 0x00000002; break; } // case 74 + case 82: + { + input.readMessage(getPropertyMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 82 case 98: { input.readMessage(getExplainOptionsFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; break; } // case 98 default: @@ -2104,6 +2200,227 @@ public com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder() { return gqlQueryBuilder_; } + private com.google.datastore.v1.PropertyMask propertyMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PropertyMask, + com.google.datastore.v1.PropertyMask.Builder, + com.google.datastore.v1.PropertyMaskOrBuilder> + propertyMaskBuilder_; + /** + * + * + *
+     * The properties to return.
+     * This field must not be set for a projection query.
+     *
+     * See
+     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + * + * @return Whether the propertyMask field is set. + */ + public boolean hasPropertyMask() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * The properties to return.
+     * This field must not be set for a projection query.
+     *
+     * See
+     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + * + * @return The propertyMask. + */ + public com.google.datastore.v1.PropertyMask getPropertyMask() { + if (propertyMaskBuilder_ == null) { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } else { + return propertyMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The properties to return.
+     * This field must not be set for a projection query.
+     *
+     * See
+     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + */ + public Builder setPropertyMask(com.google.datastore.v1.PropertyMask value) { + if (propertyMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + propertyMask_ = value; + } else { + propertyMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The properties to return.
+     * This field must not be set for a projection query.
+     *
+     * See
+     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + */ + public Builder setPropertyMask(com.google.datastore.v1.PropertyMask.Builder builderForValue) { + if (propertyMaskBuilder_ == null) { + propertyMask_ = builderForValue.build(); + } else { + propertyMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The properties to return.
+     * This field must not be set for a projection query.
+     *
+     * See
+     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + */ + public Builder mergePropertyMask(com.google.datastore.v1.PropertyMask value) { + if (propertyMaskBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && propertyMask_ != null + && propertyMask_ != com.google.datastore.v1.PropertyMask.getDefaultInstance()) { + getPropertyMaskBuilder().mergeFrom(value); + } else { + propertyMask_ = value; + } + } else { + propertyMaskBuilder_.mergeFrom(value); + } + if (propertyMask_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The properties to return.
+     * This field must not be set for a projection query.
+     *
+     * See
+     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + */ + public Builder clearPropertyMask() { + bitField0_ = (bitField0_ & ~0x00000040); + propertyMask_ = null; + if (propertyMaskBuilder_ != null) { + propertyMaskBuilder_.dispose(); + propertyMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The properties to return.
+     * This field must not be set for a projection query.
+     *
+     * See
+     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + */ + public com.google.datastore.v1.PropertyMask.Builder getPropertyMaskBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getPropertyMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The properties to return.
+     * This field must not be set for a projection query.
+     *
+     * See
+     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + */ + public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() { + if (propertyMaskBuilder_ != null) { + return propertyMaskBuilder_.getMessageOrBuilder(); + } else { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } + } + /** + * + * + *
+     * The properties to return.
+     * This field must not be set for a projection query.
+     *
+     * See
+     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PropertyMask, + com.google.datastore.v1.PropertyMask.Builder, + com.google.datastore.v1.PropertyMaskOrBuilder> + getPropertyMaskFieldBuilder() { + if (propertyMaskBuilder_ == null) { + propertyMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PropertyMask, + com.google.datastore.v1.PropertyMask.Builder, + com.google.datastore.v1.PropertyMaskOrBuilder>( + getPropertyMask(), getParentForChildren(), isClean()); + propertyMask_ = null; + } + return propertyMaskBuilder_; + } + private com.google.datastore.v1.ExplainOptions explainOptions_; private com.google.protobuf.SingleFieldBuilderV3< com.google.datastore.v1.ExplainOptions, @@ -2125,7 +2442,7 @@ public com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder() { * @return Whether the explainOptions field is set. */ public boolean hasExplainOptions() { - return ((bitField0_ & 0x00000040) != 0); + return ((bitField0_ & 0x00000080) != 0); } /** * @@ -2171,7 +2488,7 @@ public Builder setExplainOptions(com.google.datastore.v1.ExplainOptions value) { } else { explainOptionsBuilder_.setMessage(value); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -2194,7 +2511,7 @@ public Builder setExplainOptions( } else { explainOptionsBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -2212,7 +2529,7 @@ public Builder setExplainOptions( */ public Builder mergeExplainOptions(com.google.datastore.v1.ExplainOptions value) { if (explainOptionsBuilder_ == null) { - if (((bitField0_ & 0x00000040) != 0) + if (((bitField0_ & 0x00000080) != 0) && explainOptions_ != null && explainOptions_ != com.google.datastore.v1.ExplainOptions.getDefaultInstance()) { getExplainOptionsBuilder().mergeFrom(value); @@ -2223,7 +2540,7 @@ public Builder mergeExplainOptions(com.google.datastore.v1.ExplainOptions value) explainOptionsBuilder_.mergeFrom(value); } if (explainOptions_ != null) { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); } return this; @@ -2241,7 +2558,7 @@ public Builder mergeExplainOptions(com.google.datastore.v1.ExplainOptions value) * */ public Builder clearExplainOptions() { - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000080); explainOptions_ = null; if (explainOptionsBuilder_ != null) { explainOptionsBuilder_.dispose(); @@ -2263,7 +2580,7 @@ public Builder clearExplainOptions() { * */ public com.google.datastore.v1.ExplainOptions.Builder getExplainOptionsBuilder() { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return getExplainOptionsFieldBuilder().getBuilder(); } diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequestOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequestOrBuilder.java index 9e7a6f0b9..55218e0e9 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequestOrBuilder.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequestOrBuilder.java @@ -229,6 +229,53 @@ public interface RunQueryRequestOrBuilder */ com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder(); + /** + * + * + *
+   * The properties to return.
+   * This field must not be set for a projection query.
+   *
+   * See
+   * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + * + * @return Whether the propertyMask field is set. + */ + boolean hasPropertyMask(); + /** + * + * + *
+   * The properties to return.
+   * This field must not be set for a projection query.
+   *
+   * See
+   * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + * + * @return The propertyMask. + */ + com.google.datastore.v1.PropertyMask getPropertyMask(); + /** + * + * + *
+   * The properties to return.
+   * This field must not be set for a projection query.
+   *
+   * See
+   * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + */ + com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder(); + /** * * diff --git a/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/datastore.proto b/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/datastore.proto index fbbabb0a3..92b5038ea 100644 --- a/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/datastore.proto +++ b/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/datastore.proto @@ -173,6 +173,14 @@ message LookupRequest { // Required. Keys of entities to look up. repeated Key keys = 3 [(google.api.field_behavior) = REQUIRED]; + + // The properties to return. Defaults to returning all properties. + // + // If this field is set and an entity has a property not referenced in the + // mask, it will be absent from [LookupResponse.found.entity.properties][]. + // + // The entity's key is always returned. + PropertyMask property_mask = 5; } // The response for [Datastore.Lookup][google.datastore.v1.Datastore.Lookup]. @@ -234,6 +242,13 @@ message RunQueryRequest { GqlQuery gql_query = 7; } + // The properties to return. + // This field must not be set for a projection query. + // + // See + // [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask]. + PropertyMask property_mask = 10; + // Optional. Explain options for the query. If set, additional query // statistics will be returned. If not, only query results will be returned. ExplainOptions explain_options = 12 [(google.api.field_behavior) = OPTIONAL]; @@ -526,6 +541,16 @@ message Mutation { // mutation conflicts. google.protobuf.Timestamp update_time = 11; } + + // The properties to write in this mutation. + // None of the properties in the mask may have a reserved name, except for + // `__key__`. + // This field is ignored for `delete`. + // + // If the entity already exists, only properties referenced in the mask are + // updated, others are left untouched. + // Properties referenced in the mask but not in the entity are deleted. + PropertyMask property_mask = 9; } // The result of applying a mutation. @@ -555,6 +580,23 @@ message MutationResult { bool conflict_detected = 5; } +// The set of arbitrarily nested property paths used to restrict an operation to +// only a subset of properties in an entity. +message PropertyMask { + // The paths to the properties covered by this mask. + // + // A path is a list of property names separated by dots (`.`), for example + // `foo.bar` means the property `bar` inside the entity property `foo` inside + // the entity associated with this path. + // + // If a property name contains a dot `.` or a backslash `\`, then that + // name must be escaped. + // + // A path must not be empty, and may not reference a value inside an + // [array value][google.datastore.v1.Value.array_value]. + repeated string paths = 1; +} + // The options shared by read requests. message ReadOptions { // The possible values for read consistencies. From c6383cda6312b10c53c283a40d6a3a2a8a5ab44a Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Thu, 20 Jun 2024 21:22:39 +0000 Subject: [PATCH 09/17] Revert "restore proto folder" This reverts commit 59046f83269c16fb775d1069b54ee5de0749b8e5. --- proto-google-cloud-datastore-admin-v1/pom.xml | 4 +- proto-google-cloud-datastore-v1/pom.xml | 4 +- .../google/datastore/v1/DatastoreProto.java | 310 +++++++-------- .../google/datastore/v1/LookupRequest.java | 329 ---------------- .../datastore/v1/LookupRequestOrBuilder.java | 50 --- .../com/google/datastore/v1/Mutation.java | 366 +----------------- .../datastore/v1/MutationOrBuilder.java | 56 --- .../google/datastore/v1/RunQueryRequest.java | 337 +--------------- .../v1/RunQueryRequestOrBuilder.java | 47 --- .../proto/google/datastore/v1/datastore.proto | 42 -- 10 files changed, 160 insertions(+), 1385 deletions(-) diff --git a/proto-google-cloud-datastore-admin-v1/pom.xml b/proto-google-cloud-datastore-admin-v1/pom.xml index 94759e4ad..b7d230c93 100644 --- a/proto-google-cloud-datastore-admin-v1/pom.xml +++ b/proto-google-cloud-datastore-admin-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-datastore-admin-v1 - 2.20.1 + 2.19.4-SNAPSHOT proto-google-cloud-datastore-admin-v1 Proto library for google-cloud-datastore com.google.cloud google-cloud-datastore-parent - 2.20.1 + 2.19.4-SNAPSHOT diff --git a/proto-google-cloud-datastore-v1/pom.xml b/proto-google-cloud-datastore-v1/pom.xml index 3d41fdbe2..406872937 100644 --- a/proto-google-cloud-datastore-v1/pom.xml +++ b/proto-google-cloud-datastore-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-datastore-v1 - 0.111.1 + 0.110.4-SNAPSHOT proto-google-cloud-datastore-v1 PROTO library for proto-google-cloud-datastore-v1 com.google.cloud google-cloud-datastore-parent - 2.20.1 + 2.19.4-SNAPSHOT diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/DatastoreProto.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/DatastoreProto.java index e637dd010..1b8753e35 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/DatastoreProto.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/DatastoreProto.java @@ -100,10 +100,6 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_datastore_v1_MutationResult_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_datastore_v1_MutationResult_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_datastore_v1_PropertyMask_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_datastore_v1_PropertyMask_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_datastore_v1_ReadOptions_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -138,157 +134,151 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "entity.proto\032\037google/datastore/v1/query." + "proto\032\'google/datastore/v1/query_profile" + ".proto\032\037google/protobuf/timestamp.proto\"" - + "\334\001\n\rLookupRequest\022\027\n\nproject_id\030\010 \001(\tB\003\340" + + "\242\001\n\rLookupRequest\022\027\n\nproject_id\030\010 \001(\tB\003\340" + "A\002\022\023\n\013database_id\030\t \001(\t\0226\n\014read_options\030" + "\001 \001(\0132 .google.datastore.v1.ReadOptions\022" + "+\n\004keys\030\003 \003(\0132\030.google.datastore.v1.KeyB" - + "\003\340A\002\0228\n\rproperty_mask\030\005 \001(\0132!.google.dat" - + "astore.v1.PropertyMask\"\346\001\n\016LookupRespons" - + "e\0220\n\005found\030\001 \003(\0132!.google.datastore.v1.E" - + "ntityResult\0222\n\007missing\030\002 \003(\0132!.google.da" - + "tastore.v1.EntityResult\022*\n\010deferred\030\003 \003(" - + "\0132\030.google.datastore.v1.Key\022\023\n\013transacti" - + "on\030\005 \001(\014\022-\n\tread_time\030\007 \001(\0132\032.google.pro" - + "tobuf.Timestamp\"\233\003\n\017RunQueryRequest\022\027\n\np" - + "roject_id\030\010 \001(\tB\003\340A\002\022\023\n\013database_id\030\t \001(" - + "\t\0226\n\014partition_id\030\002 \001(\0132 .google.datasto" - + "re.v1.PartitionId\0226\n\014read_options\030\001 \001(\0132" - + " .google.datastore.v1.ReadOptions\022+\n\005que" - + "ry\030\003 \001(\0132\032.google.datastore.v1.QueryH\000\0222" - + "\n\tgql_query\030\007 \001(\0132\035.google.datastore.v1." - + "GqlQueryH\000\0228\n\rproperty_mask\030\n \001(\0132!.goog" - + "le.datastore.v1.PropertyMask\022A\n\017explain_" - + "options\030\014 \001(\0132#.google.datastore.v1.Expl" - + "ainOptionsB\003\340A\001B\014\n\nquery_type\"\306\001\n\020RunQue" - + "ryResponse\0224\n\005batch\030\001 \001(\0132%.google.datas" - + "tore.v1.QueryResultBatch\022)\n\005query\030\002 \001(\0132" - + "\032.google.datastore.v1.Query\022\023\n\013transacti" - + "on\030\005 \001(\014\022<\n\017explain_metrics\030\t \001(\0132#.goog" - + "le.datastore.v1.ExplainMetrics\"\203\003\n\032RunAg" - + "gregationQueryRequest\022\027\n\nproject_id\030\010 \001(" - + "\tB\003\340A\002\022\023\n\013database_id\030\t \001(\t\0226\n\014partition" - + "_id\030\002 \001(\0132 .google.datastore.v1.Partitio" - + "nId\0226\n\014read_options\030\001 \001(\0132 .google.datas" - + "tore.v1.ReadOptions\022B\n\021aggregation_query" - + "\030\003 \001(\0132%.google.datastore.v1.Aggregation" - + "QueryH\000\0222\n\tgql_query\030\007 \001(\0132\035.google.data" - + "store.v1.GqlQueryH\000\022A\n\017explain_options\030\013" - + " \001(\0132#.google.datastore.v1.ExplainOption" - + "sB\003\340A\001B\014\n\nquery_type\"\342\001\n\033RunAggregationQ" - + "ueryResponse\022:\n\005batch\030\001 \001(\0132+.google.dat" - + "astore.v1.AggregationResultBatch\0224\n\005quer" - + "y\030\002 \001(\0132%.google.datastore.v1.Aggregatio" - + "nQuery\022\023\n\013transaction\030\005 \001(\014\022<\n\017explain_m" - + "etrics\030\t \001(\0132#.google.datastore.v1.Expla" - + "inMetrics\"\215\001\n\027BeginTransactionRequest\022\027\n" - + "\nproject_id\030\010 \001(\tB\003\340A\002\022\023\n\013database_id\030\t " - + "\001(\t\022D\n\023transaction_options\030\n \001(\0132\'.googl" - + "e.datastore.v1.TransactionOptions\"/\n\030Beg" - + "inTransactionResponse\022\023\n\013transaction\030\001 \001" - + "(\014\"Y\n\017RollbackRequest\022\027\n\nproject_id\030\010 \001(" - + "\tB\003\340A\002\022\023\n\013database_id\030\t \001(\t\022\030\n\013transacti" - + "on\030\001 \001(\014B\003\340A\002\"\022\n\020RollbackResponse\"\350\002\n\rCo" - + "mmitRequest\022\027\n\nproject_id\030\010 \001(\tB\003\340A\002\022\023\n\013" - + "database_id\030\t \001(\t\0225\n\004mode\030\005 \001(\0162\'.google" - + ".datastore.v1.CommitRequest.Mode\022\025\n\013tran" - + "saction\030\001 \001(\014H\000\022I\n\026single_use_transactio" - + "n\030\n \001(\0132\'.google.datastore.v1.Transactio" - + "nOptionsH\000\0220\n\tmutations\030\006 \003(\0132\035.google.d" - + "atastore.v1.Mutation\"F\n\004Mode\022\024\n\020MODE_UNS" - + "PECIFIED\020\000\022\021\n\rTRANSACTIONAL\020\001\022\025\n\021NON_TRA" - + "NSACTIONAL\020\002B\026\n\024transaction_selector\"\227\001\n" - + "\016CommitResponse\022=\n\020mutation_results\030\003 \003(" - + "\0132#.google.datastore.v1.MutationResult\022\025" - + "\n\rindex_updates\030\004 \001(\005\022/\n\013commit_time\030\010 \001" - + "(\0132\032.google.protobuf.Timestamp\"o\n\022Alloca" - + "teIdsRequest\022\027\n\nproject_id\030\010 \001(\tB\003\340A\002\022\023\n" - + "\013database_id\030\t \001(\t\022+\n\004keys\030\001 \003(\0132\030.googl" - + "e.datastore.v1.KeyB\003\340A\002\"=\n\023AllocateIdsRe" - + "sponse\022&\n\004keys\030\001 \003(\0132\030.google.datastore." - + "v1.Key\"n\n\021ReserveIdsRequest\022\027\n\nproject_i" - + "d\030\010 \001(\tB\003\340A\002\022\023\n\013database_id\030\t \001(\t\022+\n\004key" - + "s\030\001 \003(\0132\030.google.datastore.v1.KeyB\003\340A\002\"\024" - + "\n\022ReserveIdsResponse\"\364\002\n\010Mutation\022-\n\006ins" - + "ert\030\004 \001(\0132\033.google.datastore.v1.EntityH\000" - + "\022-\n\006update\030\005 \001(\0132\033.google.datastore.v1.E" - + "ntityH\000\022-\n\006upsert\030\006 \001(\0132\033.google.datasto" - + "re.v1.EntityH\000\022*\n\006delete\030\007 \001(\0132\030.google." - + "datastore.v1.KeyH\000\022\026\n\014base_version\030\010 \001(\003" - + "H\001\0221\n\013update_time\030\013 \001(\0132\032.google.protobu" - + "f.TimestampH\001\0228\n\rproperty_mask\030\t \001(\0132!.g" - + "oogle.datastore.v1.PropertyMaskB\013\n\topera" - + "tionB\035\n\033conflict_detection_strategy\"\305\001\n\016" - + "MutationResult\022%\n\003key\030\003 \001(\0132\030.google.dat" - + "astore.v1.Key\022\017\n\007version\030\004 \001(\003\022/\n\013create" - + "_time\030\007 \001(\0132\032.google.protobuf.Timestamp\022" - + "/\n\013update_time\030\006 \001(\0132\032.google.protobuf.T" - + "imestamp\022\031\n\021conflict_detected\030\005 \001(\010\"\035\n\014P" - + "ropertyMask\022\r\n\005paths\030\001 \003(\t\"\312\002\n\013ReadOptio" - + "ns\022L\n\020read_consistency\030\001 \001(\01620.google.da" - + "tastore.v1.ReadOptions.ReadConsistencyH\000" - + "\022\025\n\013transaction\030\002 \001(\014H\000\022B\n\017new_transacti" - + "on\030\003 \001(\0132\'.google.datastore.v1.Transacti" - + "onOptionsH\000\022/\n\tread_time\030\004 \001(\0132\032.google." - + "protobuf.TimestampH\000\"M\n\017ReadConsistency\022" - + " \n\034READ_CONSISTENCY_UNSPECIFIED\020\000\022\n\n\006STR" - + "ONG\020\001\022\014\n\010EVENTUAL\020\002B\022\n\020consistency_type\"" - + "\222\002\n\022TransactionOptions\022G\n\nread_write\030\001 \001" - + "(\01321.google.datastore.v1.TransactionOpti" - + "ons.ReadWriteH\000\022E\n\tread_only\030\002 \001(\01320.goo" - + "gle.datastore.v1.TransactionOptions.Read" - + "OnlyH\000\032)\n\tReadWrite\022\034\n\024previous_transact" - + "ion\030\001 \001(\014\0329\n\010ReadOnly\022-\n\tread_time\030\001 \001(\013" - + "2\032.google.protobuf.TimestampB\006\n\004mode2\341\r\n" - + "\tDatastore\022\300\001\n\006Lookup\022\".google.datastore" - + ".v1.LookupRequest\032#.google.datastore.v1." - + "LookupResponse\"m\332A\034project_id,read_optio" - + "ns,keys\202\323\344\223\002%\" /v1/projects/{project_id}" - + ":lookup:\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013databa" - + "se_id\022\251\001\n\010RunQuery\022$.google.datastore.v1" - + ".RunQueryRequest\032%.google.datastore.v1.R" - + "unQueryResponse\"P\202\323\344\223\002\'\"\"/v1/projects/{p" - + "roject_id}:runQuery:\001*\212\323\344\223\002\035\022\014\n\nproject_" - + "id\022\r\n\013database_id\022\325\001\n\023RunAggregationQuer" - + "y\022/.google.datastore.v1.RunAggregationQu" - + "eryRequest\0320.google.datastore.v1.RunAggr" - + "egationQueryResponse\"[\202\323\344\223\0022\"-/v1/projec" - + "ts/{project_id}:runAggregationQuery:\001*\212\323" - + "\344\223\002\035\022\014\n\nproject_id\022\r\n\013database_id\022\326\001\n\020Be" - + "ginTransaction\022,.google.datastore.v1.Beg" - + "inTransactionRequest\032-.google.datastore." - + "v1.BeginTransactionResponse\"e\332A\nproject_" - + "id\202\323\344\223\002/\"*/v1/projects/{project_id}:begi" - + "nTransaction:\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013d" - + "atabase_id\022\346\001\n\006Commit\022\".google.datastore" - + ".v1.CommitRequest\032#.google.datastore.v1." - + "CommitResponse\"\222\001\332A%project_id,mode,tran" - + "saction,mutations\332A\031project_id,mode,muta" - + "tions\202\323\344\223\002%\" /v1/projects/{project_id}:c" - + "ommit:\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013database" - + "_id\022\302\001\n\010Rollback\022$.google.datastore.v1.R" - + "ollbackRequest\032%.google.datastore.v1.Rol" - + "lbackResponse\"i\332A\026project_id,transaction" - + "\202\323\344\223\002\'\"\"/v1/projects/{project_id}:rollba" - + "ck:\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013database_id" - + "\022\307\001\n\013AllocateIds\022\'.google.datastore.v1.A" - + "llocateIdsRequest\032(.google.datastore.v1." - + "AllocateIdsResponse\"e\332A\017project_id,keys\202" - + "\323\344\223\002*\"%/v1/projects/{project_id}:allocat" - + "eIds:\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013database_" - + "id\022\303\001\n\nReserveIds\022&.google.datastore.v1." - + "ReserveIdsRequest\032\'.google.datastore.v1." - + "ReserveIdsResponse\"d\332A\017project_id,keys\202\323" - + "\344\223\002)\"$/v1/projects/{project_id}:reserveI" - + "ds:\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013database_id" - + "\032v\312A\030datastore.googleapis.com\322AXhttps://" - + "www.googleapis.com/auth/cloud-platform,h" - + "ttps://www.googleapis.com/auth/datastore" - + "B\300\001\n\027com.google.datastore.v1B\016DatastoreP" - + "rotoP\001Z - * The properties to return. Defaults to returning all properties. - * - * If this field is set and an entity has a property not referenced in the - * mask, it will be absent from [LookupResponse.found.entity.properties][]. - * - * The entity's key is always returned. - * - * - * .google.datastore.v1.PropertyMask property_mask = 5; - * - * @return Whether the propertyMask field is set. - */ - @java.lang.Override - public boolean hasPropertyMask() { - return ((bitField0_ & 0x00000002) != 0); - } - /** - * - * - *
-   * The properties to return. Defaults to returning all properties.
-   *
-   * If this field is set and an entity has a property not referenced in the
-   * mask, it will be absent from [LookupResponse.found.entity.properties][].
-   *
-   * The entity's key is always returned.
-   * 
- * - * .google.datastore.v1.PropertyMask property_mask = 5; - * - * @return The propertyMask. - */ - @java.lang.Override - public com.google.datastore.v1.PropertyMask getPropertyMask() { - return propertyMask_ == null - ? com.google.datastore.v1.PropertyMask.getDefaultInstance() - : propertyMask_; - } - /** - * - * - *
-   * The properties to return. Defaults to returning all properties.
-   *
-   * If this field is set and an entity has a property not referenced in the
-   * mask, it will be absent from [LookupResponse.found.entity.properties][].
-   *
-   * The entity's key is always returned.
-   * 
- * - * .google.datastore.v1.PropertyMask property_mask = 5; - */ - @java.lang.Override - public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() { - return propertyMask_ == null - ? com.google.datastore.v1.PropertyMask.getDefaultInstance() - : propertyMask_; - } - private byte memoizedIsInitialized = -1; @java.lang.Override @@ -384,9 +319,6 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < keys_.size(); i++) { output.writeMessage(3, keys_.get(i)); } - if (((bitField0_ & 0x00000002) != 0)) { - output.writeMessage(5, getPropertyMask()); - } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 8, projectId_); } @@ -408,9 +340,6 @@ public int getSerializedSize() { for (int i = 0; i < keys_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, keys_.get(i)); } - if (((bitField0_ & 0x00000002) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getPropertyMask()); - } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, projectId_); } @@ -439,10 +368,6 @@ public boolean equals(final java.lang.Object obj) { if (!getReadOptions().equals(other.getReadOptions())) return false; } if (!getKeysList().equals(other.getKeysList())) return false; - if (hasPropertyMask() != other.hasPropertyMask()) return false; - if (hasPropertyMask()) { - if (!getPropertyMask().equals(other.getPropertyMask())) return false; - } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -466,10 +391,6 @@ public int hashCode() { hash = (37 * hash) + KEYS_FIELD_NUMBER; hash = (53 * hash) + getKeysList().hashCode(); } - if (hasPropertyMask()) { - hash = (37 * hash) + PROPERTY_MASK_FIELD_NUMBER; - hash = (53 * hash) + getPropertyMask().hashCode(); - } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -611,7 +532,6 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getReadOptionsFieldBuilder(); getKeysFieldBuilder(); - getPropertyMaskFieldBuilder(); } } @@ -633,11 +553,6 @@ public Builder clear() { keysBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000008); - propertyMask_ = null; - if (propertyMaskBuilder_ != null) { - propertyMaskBuilder_.dispose(); - propertyMaskBuilder_ = null; - } return this; } @@ -699,11 +614,6 @@ private void buildPartial0(com.google.datastore.v1.LookupRequest result) { readOptionsBuilder_ == null ? readOptions_ : readOptionsBuilder_.build(); to_bitField0_ |= 0x00000001; } - if (((from_bitField0_ & 0x00000010) != 0)) { - result.propertyMask_ = - propertyMaskBuilder_ == null ? propertyMask_ : propertyMaskBuilder_.build(); - to_bitField0_ |= 0x00000002; - } result.bitField0_ |= to_bitField0_; } @@ -792,9 +702,6 @@ public Builder mergeFrom(com.google.datastore.v1.LookupRequest other) { } } } - if (other.hasPropertyMask()) { - mergePropertyMask(other.getPropertyMask()); - } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -839,12 +746,6 @@ public Builder mergeFrom( } break; } // case 26 - case 42: - { - input.readMessage(getPropertyMaskFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000010; - break; - } // case 42 case 66: { projectId_ = input.readStringRequireUtf8(); @@ -1648,236 +1549,6 @@ public java.util.List getKeysBuilderList() return keysBuilder_; } - private com.google.datastore.v1.PropertyMask propertyMask_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.datastore.v1.PropertyMask, - com.google.datastore.v1.PropertyMask.Builder, - com.google.datastore.v1.PropertyMaskOrBuilder> - propertyMaskBuilder_; - /** - * - * - *
-     * The properties to return. Defaults to returning all properties.
-     *
-     * If this field is set and an entity has a property not referenced in the
-     * mask, it will be absent from [LookupResponse.found.entity.properties][].
-     *
-     * The entity's key is always returned.
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 5; - * - * @return Whether the propertyMask field is set. - */ - public boolean hasPropertyMask() { - return ((bitField0_ & 0x00000010) != 0); - } - /** - * - * - *
-     * The properties to return. Defaults to returning all properties.
-     *
-     * If this field is set and an entity has a property not referenced in the
-     * mask, it will be absent from [LookupResponse.found.entity.properties][].
-     *
-     * The entity's key is always returned.
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 5; - * - * @return The propertyMask. - */ - public com.google.datastore.v1.PropertyMask getPropertyMask() { - if (propertyMaskBuilder_ == null) { - return propertyMask_ == null - ? com.google.datastore.v1.PropertyMask.getDefaultInstance() - : propertyMask_; - } else { - return propertyMaskBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The properties to return. Defaults to returning all properties.
-     *
-     * If this field is set and an entity has a property not referenced in the
-     * mask, it will be absent from [LookupResponse.found.entity.properties][].
-     *
-     * The entity's key is always returned.
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 5; - */ - public Builder setPropertyMask(com.google.datastore.v1.PropertyMask value) { - if (propertyMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - propertyMask_ = value; - } else { - propertyMaskBuilder_.setMessage(value); - } - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * - * - *
-     * The properties to return. Defaults to returning all properties.
-     *
-     * If this field is set and an entity has a property not referenced in the
-     * mask, it will be absent from [LookupResponse.found.entity.properties][].
-     *
-     * The entity's key is always returned.
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 5; - */ - public Builder setPropertyMask(com.google.datastore.v1.PropertyMask.Builder builderForValue) { - if (propertyMaskBuilder_ == null) { - propertyMask_ = builderForValue.build(); - } else { - propertyMaskBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000010; - onChanged(); - return this; - } - /** - * - * - *
-     * The properties to return. Defaults to returning all properties.
-     *
-     * If this field is set and an entity has a property not referenced in the
-     * mask, it will be absent from [LookupResponse.found.entity.properties][].
-     *
-     * The entity's key is always returned.
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 5; - */ - public Builder mergePropertyMask(com.google.datastore.v1.PropertyMask value) { - if (propertyMaskBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0) - && propertyMask_ != null - && propertyMask_ != com.google.datastore.v1.PropertyMask.getDefaultInstance()) { - getPropertyMaskBuilder().mergeFrom(value); - } else { - propertyMask_ = value; - } - } else { - propertyMaskBuilder_.mergeFrom(value); - } - if (propertyMask_ != null) { - bitField0_ |= 0x00000010; - onChanged(); - } - return this; - } - /** - * - * - *
-     * The properties to return. Defaults to returning all properties.
-     *
-     * If this field is set and an entity has a property not referenced in the
-     * mask, it will be absent from [LookupResponse.found.entity.properties][].
-     *
-     * The entity's key is always returned.
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 5; - */ - public Builder clearPropertyMask() { - bitField0_ = (bitField0_ & ~0x00000010); - propertyMask_ = null; - if (propertyMaskBuilder_ != null) { - propertyMaskBuilder_.dispose(); - propertyMaskBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * The properties to return. Defaults to returning all properties.
-     *
-     * If this field is set and an entity has a property not referenced in the
-     * mask, it will be absent from [LookupResponse.found.entity.properties][].
-     *
-     * The entity's key is always returned.
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 5; - */ - public com.google.datastore.v1.PropertyMask.Builder getPropertyMaskBuilder() { - bitField0_ |= 0x00000010; - onChanged(); - return getPropertyMaskFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The properties to return. Defaults to returning all properties.
-     *
-     * If this field is set and an entity has a property not referenced in the
-     * mask, it will be absent from [LookupResponse.found.entity.properties][].
-     *
-     * The entity's key is always returned.
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 5; - */ - public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() { - if (propertyMaskBuilder_ != null) { - return propertyMaskBuilder_.getMessageOrBuilder(); - } else { - return propertyMask_ == null - ? com.google.datastore.v1.PropertyMask.getDefaultInstance() - : propertyMask_; - } - } - /** - * - * - *
-     * The properties to return. Defaults to returning all properties.
-     *
-     * If this field is set and an entity has a property not referenced in the
-     * mask, it will be absent from [LookupResponse.found.entity.properties][].
-     *
-     * The entity's key is always returned.
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.datastore.v1.PropertyMask, - com.google.datastore.v1.PropertyMask.Builder, - com.google.datastore.v1.PropertyMaskOrBuilder> - getPropertyMaskFieldBuilder() { - if (propertyMaskBuilder_ == null) { - propertyMaskBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.datastore.v1.PropertyMask, - com.google.datastore.v1.PropertyMask.Builder, - com.google.datastore.v1.PropertyMaskOrBuilder>( - getPropertyMask(), getParentForChildren(), isClean()); - propertyMask_ = null; - } - return propertyMaskBuilder_; - } - @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/LookupRequestOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/LookupRequestOrBuilder.java index d343eeca4..82fe24661 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/LookupRequestOrBuilder.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/LookupRequestOrBuilder.java @@ -170,54 +170,4 @@ public interface LookupRequestOrBuilder * */ com.google.datastore.v1.KeyOrBuilder getKeysOrBuilder(int index); - - /** - * - * - *
-   * The properties to return. Defaults to returning all properties.
-   *
-   * If this field is set and an entity has a property not referenced in the
-   * mask, it will be absent from [LookupResponse.found.entity.properties][].
-   *
-   * The entity's key is always returned.
-   * 
- * - * .google.datastore.v1.PropertyMask property_mask = 5; - * - * @return Whether the propertyMask field is set. - */ - boolean hasPropertyMask(); - /** - * - * - *
-   * The properties to return. Defaults to returning all properties.
-   *
-   * If this field is set and an entity has a property not referenced in the
-   * mask, it will be absent from [LookupResponse.found.entity.properties][].
-   *
-   * The entity's key is always returned.
-   * 
- * - * .google.datastore.v1.PropertyMask property_mask = 5; - * - * @return The propertyMask. - */ - com.google.datastore.v1.PropertyMask getPropertyMask(); - /** - * - * - *
-   * The properties to return. Defaults to returning all properties.
-   *
-   * If this field is set and an entity has a property not referenced in the
-   * mask, it will be absent from [LookupResponse.found.entity.properties][].
-   *
-   * The entity's key is always returned.
-   * 
- * - * .google.datastore.v1.PropertyMask property_mask = 5; - */ - com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder(); } diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Mutation.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Mutation.java index 6857d48a6..91895d180 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Mutation.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Mutation.java @@ -60,7 +60,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.datastore.v1.Mutation.class, com.google.datastore.v1.Mutation.Builder.class); } - private int bitField0_; private int operationCase_ = 0; @SuppressWarnings("serial") @@ -477,77 +476,6 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { return com.google.protobuf.Timestamp.getDefaultInstance(); } - public static final int PROPERTY_MASK_FIELD_NUMBER = 9; - private com.google.datastore.v1.PropertyMask propertyMask_; - /** - * - * - *
-   * The properties to write in this mutation.
-   * None of the properties in the mask may have a reserved name, except for
-   * `__key__`.
-   * This field is ignored for `delete`.
-   *
-   * If the entity already exists, only properties referenced in the mask are
-   * updated, others are left untouched.
-   * Properties referenced in the mask but not in the entity are deleted.
-   * 
- * - * .google.datastore.v1.PropertyMask property_mask = 9; - * - * @return Whether the propertyMask field is set. - */ - @java.lang.Override - public boolean hasPropertyMask() { - return ((bitField0_ & 0x00000001) != 0); - } - /** - * - * - *
-   * The properties to write in this mutation.
-   * None of the properties in the mask may have a reserved name, except for
-   * `__key__`.
-   * This field is ignored for `delete`.
-   *
-   * If the entity already exists, only properties referenced in the mask are
-   * updated, others are left untouched.
-   * Properties referenced in the mask but not in the entity are deleted.
-   * 
- * - * .google.datastore.v1.PropertyMask property_mask = 9; - * - * @return The propertyMask. - */ - @java.lang.Override - public com.google.datastore.v1.PropertyMask getPropertyMask() { - return propertyMask_ == null - ? com.google.datastore.v1.PropertyMask.getDefaultInstance() - : propertyMask_; - } - /** - * - * - *
-   * The properties to write in this mutation.
-   * None of the properties in the mask may have a reserved name, except for
-   * `__key__`.
-   * This field is ignored for `delete`.
-   *
-   * If the entity already exists, only properties referenced in the mask are
-   * updated, others are left untouched.
-   * Properties referenced in the mask but not in the entity are deleted.
-   * 
- * - * .google.datastore.v1.PropertyMask property_mask = 9; - */ - @java.lang.Override - public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() { - return propertyMask_ == null - ? com.google.datastore.v1.PropertyMask.getDefaultInstance() - : propertyMask_; - } - private byte memoizedIsInitialized = -1; @java.lang.Override @@ -577,9 +505,6 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (conflictDetectionStrategyCase_ == 8) { output.writeInt64(8, (long) ((java.lang.Long) conflictDetectionStrategy_)); } - if (((bitField0_ & 0x00000001) != 0)) { - output.writeMessage(9, getPropertyMask()); - } if (conflictDetectionStrategyCase_ == 11) { output.writeMessage(11, (com.google.protobuf.Timestamp) conflictDetectionStrategy_); } @@ -617,9 +542,6 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeInt64Size( 8, (long) ((java.lang.Long) conflictDetectionStrategy_)); } - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getPropertyMask()); - } if (conflictDetectionStrategyCase_ == 11) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( @@ -640,10 +562,6 @@ public boolean equals(final java.lang.Object obj) { } com.google.datastore.v1.Mutation other = (com.google.datastore.v1.Mutation) obj; - if (hasPropertyMask() != other.hasPropertyMask()) return false; - if (hasPropertyMask()) { - if (!getPropertyMask().equals(other.getPropertyMask())) return false; - } if (!getOperationCase().equals(other.getOperationCase())) return false; switch (operationCase_) { case 4: @@ -684,10 +602,6 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - if (hasPropertyMask()) { - hash = (37 * hash) + PROPERTY_MASK_FIELD_NUMBER; - hash = (53 * hash) + getPropertyMask().hashCode(); - } switch (operationCase_) { case 4: hash = (37 * hash) + INSERT_FIELD_NUMBER; @@ -848,19 +762,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.datastore.v1.Mutation.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getPropertyMaskFieldBuilder(); - } } @java.lang.Override @@ -882,11 +787,6 @@ public Builder clear() { if (updateTimeBuilder_ != null) { updateTimeBuilder_.clear(); } - propertyMask_ = null; - if (propertyMaskBuilder_ != null) { - propertyMaskBuilder_.dispose(); - propertyMaskBuilder_ = null; - } operationCase_ = 0; operation_ = null; conflictDetectionStrategyCase_ = 0; @@ -927,13 +827,6 @@ public com.google.datastore.v1.Mutation buildPartial() { private void buildPartial0(com.google.datastore.v1.Mutation result) { int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000040) != 0)) { - result.propertyMask_ = - propertyMaskBuilder_ == null ? propertyMask_ : propertyMaskBuilder_.build(); - to_bitField0_ |= 0x00000001; - } - result.bitField0_ |= to_bitField0_; } private void buildPartialOneofs(com.google.datastore.v1.Mutation result) { @@ -1003,9 +896,6 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.datastore.v1.Mutation other) { if (other == com.google.datastore.v1.Mutation.getDefaultInstance()) return this; - if (other.hasPropertyMask()) { - mergePropertyMask(other.getPropertyMask()); - } switch (other.getOperationCase()) { case INSERT: { @@ -1104,12 +994,6 @@ public Builder mergeFrom( conflictDetectionStrategyCase_ = 8; break; } // case 64 - case 74: - { - input.readMessage(getPropertyMaskFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000040; - break; - } // case 74 case 90: { input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); @@ -2322,254 +2206,6 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { return updateTimeBuilder_; } - private com.google.datastore.v1.PropertyMask propertyMask_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.datastore.v1.PropertyMask, - com.google.datastore.v1.PropertyMask.Builder, - com.google.datastore.v1.PropertyMaskOrBuilder> - propertyMaskBuilder_; - /** - * - * - *
-     * The properties to write in this mutation.
-     * None of the properties in the mask may have a reserved name, except for
-     * `__key__`.
-     * This field is ignored for `delete`.
-     *
-     * If the entity already exists, only properties referenced in the mask are
-     * updated, others are left untouched.
-     * Properties referenced in the mask but not in the entity are deleted.
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 9; - * - * @return Whether the propertyMask field is set. - */ - public boolean hasPropertyMask() { - return ((bitField0_ & 0x00000040) != 0); - } - /** - * - * - *
-     * The properties to write in this mutation.
-     * None of the properties in the mask may have a reserved name, except for
-     * `__key__`.
-     * This field is ignored for `delete`.
-     *
-     * If the entity already exists, only properties referenced in the mask are
-     * updated, others are left untouched.
-     * Properties referenced in the mask but not in the entity are deleted.
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 9; - * - * @return The propertyMask. - */ - public com.google.datastore.v1.PropertyMask getPropertyMask() { - if (propertyMaskBuilder_ == null) { - return propertyMask_ == null - ? com.google.datastore.v1.PropertyMask.getDefaultInstance() - : propertyMask_; - } else { - return propertyMaskBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The properties to write in this mutation.
-     * None of the properties in the mask may have a reserved name, except for
-     * `__key__`.
-     * This field is ignored for `delete`.
-     *
-     * If the entity already exists, only properties referenced in the mask are
-     * updated, others are left untouched.
-     * Properties referenced in the mask but not in the entity are deleted.
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 9; - */ - public Builder setPropertyMask(com.google.datastore.v1.PropertyMask value) { - if (propertyMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - propertyMask_ = value; - } else { - propertyMaskBuilder_.setMessage(value); - } - bitField0_ |= 0x00000040; - onChanged(); - return this; - } - /** - * - * - *
-     * The properties to write in this mutation.
-     * None of the properties in the mask may have a reserved name, except for
-     * `__key__`.
-     * This field is ignored for `delete`.
-     *
-     * If the entity already exists, only properties referenced in the mask are
-     * updated, others are left untouched.
-     * Properties referenced in the mask but not in the entity are deleted.
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 9; - */ - public Builder setPropertyMask(com.google.datastore.v1.PropertyMask.Builder builderForValue) { - if (propertyMaskBuilder_ == null) { - propertyMask_ = builderForValue.build(); - } else { - propertyMaskBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000040; - onChanged(); - return this; - } - /** - * - * - *
-     * The properties to write in this mutation.
-     * None of the properties in the mask may have a reserved name, except for
-     * `__key__`.
-     * This field is ignored for `delete`.
-     *
-     * If the entity already exists, only properties referenced in the mask are
-     * updated, others are left untouched.
-     * Properties referenced in the mask but not in the entity are deleted.
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 9; - */ - public Builder mergePropertyMask(com.google.datastore.v1.PropertyMask value) { - if (propertyMaskBuilder_ == null) { - if (((bitField0_ & 0x00000040) != 0) - && propertyMask_ != null - && propertyMask_ != com.google.datastore.v1.PropertyMask.getDefaultInstance()) { - getPropertyMaskBuilder().mergeFrom(value); - } else { - propertyMask_ = value; - } - } else { - propertyMaskBuilder_.mergeFrom(value); - } - if (propertyMask_ != null) { - bitField0_ |= 0x00000040; - onChanged(); - } - return this; - } - /** - * - * - *
-     * The properties to write in this mutation.
-     * None of the properties in the mask may have a reserved name, except for
-     * `__key__`.
-     * This field is ignored for `delete`.
-     *
-     * If the entity already exists, only properties referenced in the mask are
-     * updated, others are left untouched.
-     * Properties referenced in the mask but not in the entity are deleted.
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 9; - */ - public Builder clearPropertyMask() { - bitField0_ = (bitField0_ & ~0x00000040); - propertyMask_ = null; - if (propertyMaskBuilder_ != null) { - propertyMaskBuilder_.dispose(); - propertyMaskBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * The properties to write in this mutation.
-     * None of the properties in the mask may have a reserved name, except for
-     * `__key__`.
-     * This field is ignored for `delete`.
-     *
-     * If the entity already exists, only properties referenced in the mask are
-     * updated, others are left untouched.
-     * Properties referenced in the mask but not in the entity are deleted.
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 9; - */ - public com.google.datastore.v1.PropertyMask.Builder getPropertyMaskBuilder() { - bitField0_ |= 0x00000040; - onChanged(); - return getPropertyMaskFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The properties to write in this mutation.
-     * None of the properties in the mask may have a reserved name, except for
-     * `__key__`.
-     * This field is ignored for `delete`.
-     *
-     * If the entity already exists, only properties referenced in the mask are
-     * updated, others are left untouched.
-     * Properties referenced in the mask but not in the entity are deleted.
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 9; - */ - public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() { - if (propertyMaskBuilder_ != null) { - return propertyMaskBuilder_.getMessageOrBuilder(); - } else { - return propertyMask_ == null - ? com.google.datastore.v1.PropertyMask.getDefaultInstance() - : propertyMask_; - } - } - /** - * - * - *
-     * The properties to write in this mutation.
-     * None of the properties in the mask may have a reserved name, except for
-     * `__key__`.
-     * This field is ignored for `delete`.
-     *
-     * If the entity already exists, only properties referenced in the mask are
-     * updated, others are left untouched.
-     * Properties referenced in the mask but not in the entity are deleted.
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 9; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.datastore.v1.PropertyMask, - com.google.datastore.v1.PropertyMask.Builder, - com.google.datastore.v1.PropertyMaskOrBuilder> - getPropertyMaskFieldBuilder() { - if (propertyMaskBuilder_ == null) { - propertyMaskBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.datastore.v1.PropertyMask, - com.google.datastore.v1.PropertyMask.Builder, - com.google.datastore.v1.PropertyMaskOrBuilder>( - getPropertyMask(), getParentForChildren(), isClean()); - propertyMask_ = null; - } - return propertyMaskBuilder_; - } - @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/MutationOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/MutationOrBuilder.java index e051e6003..e833ed942 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/MutationOrBuilder.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/MutationOrBuilder.java @@ -246,62 +246,6 @@ public interface MutationOrBuilder */ com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); - /** - * - * - *
-   * The properties to write in this mutation.
-   * None of the properties in the mask may have a reserved name, except for
-   * `__key__`.
-   * This field is ignored for `delete`.
-   *
-   * If the entity already exists, only properties referenced in the mask are
-   * updated, others are left untouched.
-   * Properties referenced in the mask but not in the entity are deleted.
-   * 
- * - * .google.datastore.v1.PropertyMask property_mask = 9; - * - * @return Whether the propertyMask field is set. - */ - boolean hasPropertyMask(); - /** - * - * - *
-   * The properties to write in this mutation.
-   * None of the properties in the mask may have a reserved name, except for
-   * `__key__`.
-   * This field is ignored for `delete`.
-   *
-   * If the entity already exists, only properties referenced in the mask are
-   * updated, others are left untouched.
-   * Properties referenced in the mask but not in the entity are deleted.
-   * 
- * - * .google.datastore.v1.PropertyMask property_mask = 9; - * - * @return The propertyMask. - */ - com.google.datastore.v1.PropertyMask getPropertyMask(); - /** - * - * - *
-   * The properties to write in this mutation.
-   * None of the properties in the mask may have a reserved name, except for
-   * `__key__`.
-   * This field is ignored for `delete`.
-   *
-   * If the entity already exists, only properties referenced in the mask are
-   * updated, others are left untouched.
-   * Properties referenced in the mask but not in the entity are deleted.
-   * 
- * - * .google.datastore.v1.PropertyMask property_mask = 9; - */ - com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder(); - com.google.datastore.v1.Mutation.OperationCase getOperationCase(); com.google.datastore.v1.Mutation.ConflictDetectionStrategyCase getConflictDetectionStrategyCase(); diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java index 55691ceae..4420d5779 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java @@ -433,68 +433,6 @@ public com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder() { return com.google.datastore.v1.GqlQuery.getDefaultInstance(); } - public static final int PROPERTY_MASK_FIELD_NUMBER = 10; - private com.google.datastore.v1.PropertyMask propertyMask_; - /** - * - * - *
-   * The properties to return.
-   * This field must not be set for a projection query.
-   *
-   * See
-   * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
-   * 
- * - * .google.datastore.v1.PropertyMask property_mask = 10; - * - * @return Whether the propertyMask field is set. - */ - @java.lang.Override - public boolean hasPropertyMask() { - return ((bitField0_ & 0x00000004) != 0); - } - /** - * - * - *
-   * The properties to return.
-   * This field must not be set for a projection query.
-   *
-   * See
-   * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
-   * 
- * - * .google.datastore.v1.PropertyMask property_mask = 10; - * - * @return The propertyMask. - */ - @java.lang.Override - public com.google.datastore.v1.PropertyMask getPropertyMask() { - return propertyMask_ == null - ? com.google.datastore.v1.PropertyMask.getDefaultInstance() - : propertyMask_; - } - /** - * - * - *
-   * The properties to return.
-   * This field must not be set for a projection query.
-   *
-   * See
-   * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
-   * 
- * - * .google.datastore.v1.PropertyMask property_mask = 10; - */ - @java.lang.Override - public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() { - return propertyMask_ == null - ? com.google.datastore.v1.PropertyMask.getDefaultInstance() - : propertyMask_; - } - public static final int EXPLAIN_OPTIONS_FIELD_NUMBER = 12; private com.google.datastore.v1.ExplainOptions explainOptions_; /** @@ -513,7 +451,7 @@ public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() */ @java.lang.Override public boolean hasExplainOptions() { - return ((bitField0_ & 0x00000008) != 0); + return ((bitField0_ & 0x00000004) != 0); } /** * @@ -587,9 +525,6 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io com.google.protobuf.GeneratedMessageV3.writeString(output, 9, databaseId_); } if (((bitField0_ & 0x00000004) != 0)) { - output.writeMessage(10, getPropertyMask()); - } - if (((bitField0_ & 0x00000008) != 0)) { output.writeMessage(12, getExplainOptions()); } getUnknownFields().writeTo(output); @@ -624,9 +559,6 @@ public int getSerializedSize() { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, databaseId_); } if (((bitField0_ & 0x00000004) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getPropertyMask()); - } - if (((bitField0_ & 0x00000008) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getExplainOptions()); } size += getUnknownFields().getSerializedSize(); @@ -654,10 +586,6 @@ public boolean equals(final java.lang.Object obj) { if (hasReadOptions()) { if (!getReadOptions().equals(other.getReadOptions())) return false; } - if (hasPropertyMask() != other.hasPropertyMask()) return false; - if (hasPropertyMask()) { - if (!getPropertyMask().equals(other.getPropertyMask())) return false; - } if (hasExplainOptions() != other.hasExplainOptions()) return false; if (hasExplainOptions()) { if (!getExplainOptions().equals(other.getExplainOptions())) return false; @@ -696,10 +624,6 @@ public int hashCode() { hash = (37 * hash) + READ_OPTIONS_FIELD_NUMBER; hash = (53 * hash) + getReadOptions().hashCode(); } - if (hasPropertyMask()) { - hash = (37 * hash) + PROPERTY_MASK_FIELD_NUMBER; - hash = (53 * hash) + getPropertyMask().hashCode(); - } if (hasExplainOptions()) { hash = (37 * hash) + EXPLAIN_OPTIONS_FIELD_NUMBER; hash = (53 * hash) + getExplainOptions().hashCode(); @@ -858,7 +782,6 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getPartitionIdFieldBuilder(); getReadOptionsFieldBuilder(); - getPropertyMaskFieldBuilder(); getExplainOptionsFieldBuilder(); } } @@ -885,11 +808,6 @@ public Builder clear() { if (gqlQueryBuilder_ != null) { gqlQueryBuilder_.clear(); } - propertyMask_ = null; - if (propertyMaskBuilder_ != null) { - propertyMaskBuilder_.dispose(); - propertyMaskBuilder_ = null; - } explainOptions_ = null; if (explainOptionsBuilder_ != null) { explainOptionsBuilder_.dispose(); @@ -952,14 +870,9 @@ private void buildPartial0(com.google.datastore.v1.RunQueryRequest result) { to_bitField0_ |= 0x00000002; } if (((from_bitField0_ & 0x00000040) != 0)) { - result.propertyMask_ = - propertyMaskBuilder_ == null ? propertyMask_ : propertyMaskBuilder_.build(); - to_bitField0_ |= 0x00000004; - } - if (((from_bitField0_ & 0x00000080) != 0)) { result.explainOptions_ = explainOptionsBuilder_ == null ? explainOptions_ : explainOptionsBuilder_.build(); - to_bitField0_ |= 0x00000008; + to_bitField0_ |= 0x00000004; } result.bitField0_ |= to_bitField0_; } @@ -1036,9 +949,6 @@ public Builder mergeFrom(com.google.datastore.v1.RunQueryRequest other) { if (other.hasReadOptions()) { mergeReadOptions(other.getReadOptions()); } - if (other.hasPropertyMask()) { - mergePropertyMask(other.getPropertyMask()); - } if (other.hasExplainOptions()) { mergeExplainOptions(other.getExplainOptions()); } @@ -1120,16 +1030,10 @@ public Builder mergeFrom( bitField0_ |= 0x00000002; break; } // case 74 - case 82: - { - input.readMessage(getPropertyMaskFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000040; - break; - } // case 82 case 98: { input.readMessage(getExplainOptionsFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000040; break; } // case 98 default: @@ -2200,227 +2104,6 @@ public com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder() { return gqlQueryBuilder_; } - private com.google.datastore.v1.PropertyMask propertyMask_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.datastore.v1.PropertyMask, - com.google.datastore.v1.PropertyMask.Builder, - com.google.datastore.v1.PropertyMaskOrBuilder> - propertyMaskBuilder_; - /** - * - * - *
-     * The properties to return.
-     * This field must not be set for a projection query.
-     *
-     * See
-     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 10; - * - * @return Whether the propertyMask field is set. - */ - public boolean hasPropertyMask() { - return ((bitField0_ & 0x00000040) != 0); - } - /** - * - * - *
-     * The properties to return.
-     * This field must not be set for a projection query.
-     *
-     * See
-     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 10; - * - * @return The propertyMask. - */ - public com.google.datastore.v1.PropertyMask getPropertyMask() { - if (propertyMaskBuilder_ == null) { - return propertyMask_ == null - ? com.google.datastore.v1.PropertyMask.getDefaultInstance() - : propertyMask_; - } else { - return propertyMaskBuilder_.getMessage(); - } - } - /** - * - * - *
-     * The properties to return.
-     * This field must not be set for a projection query.
-     *
-     * See
-     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 10; - */ - public Builder setPropertyMask(com.google.datastore.v1.PropertyMask value) { - if (propertyMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - propertyMask_ = value; - } else { - propertyMaskBuilder_.setMessage(value); - } - bitField0_ |= 0x00000040; - onChanged(); - return this; - } - /** - * - * - *
-     * The properties to return.
-     * This field must not be set for a projection query.
-     *
-     * See
-     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 10; - */ - public Builder setPropertyMask(com.google.datastore.v1.PropertyMask.Builder builderForValue) { - if (propertyMaskBuilder_ == null) { - propertyMask_ = builderForValue.build(); - } else { - propertyMaskBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000040; - onChanged(); - return this; - } - /** - * - * - *
-     * The properties to return.
-     * This field must not be set for a projection query.
-     *
-     * See
-     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 10; - */ - public Builder mergePropertyMask(com.google.datastore.v1.PropertyMask value) { - if (propertyMaskBuilder_ == null) { - if (((bitField0_ & 0x00000040) != 0) - && propertyMask_ != null - && propertyMask_ != com.google.datastore.v1.PropertyMask.getDefaultInstance()) { - getPropertyMaskBuilder().mergeFrom(value); - } else { - propertyMask_ = value; - } - } else { - propertyMaskBuilder_.mergeFrom(value); - } - if (propertyMask_ != null) { - bitField0_ |= 0x00000040; - onChanged(); - } - return this; - } - /** - * - * - *
-     * The properties to return.
-     * This field must not be set for a projection query.
-     *
-     * See
-     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 10; - */ - public Builder clearPropertyMask() { - bitField0_ = (bitField0_ & ~0x00000040); - propertyMask_ = null; - if (propertyMaskBuilder_ != null) { - propertyMaskBuilder_.dispose(); - propertyMaskBuilder_ = null; - } - onChanged(); - return this; - } - /** - * - * - *
-     * The properties to return.
-     * This field must not be set for a projection query.
-     *
-     * See
-     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 10; - */ - public com.google.datastore.v1.PropertyMask.Builder getPropertyMaskBuilder() { - bitField0_ |= 0x00000040; - onChanged(); - return getPropertyMaskFieldBuilder().getBuilder(); - } - /** - * - * - *
-     * The properties to return.
-     * This field must not be set for a projection query.
-     *
-     * See
-     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 10; - */ - public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() { - if (propertyMaskBuilder_ != null) { - return propertyMaskBuilder_.getMessageOrBuilder(); - } else { - return propertyMask_ == null - ? com.google.datastore.v1.PropertyMask.getDefaultInstance() - : propertyMask_; - } - } - /** - * - * - *
-     * The properties to return.
-     * This field must not be set for a projection query.
-     *
-     * See
-     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
-     * 
- * - * .google.datastore.v1.PropertyMask property_mask = 10; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.datastore.v1.PropertyMask, - com.google.datastore.v1.PropertyMask.Builder, - com.google.datastore.v1.PropertyMaskOrBuilder> - getPropertyMaskFieldBuilder() { - if (propertyMaskBuilder_ == null) { - propertyMaskBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.datastore.v1.PropertyMask, - com.google.datastore.v1.PropertyMask.Builder, - com.google.datastore.v1.PropertyMaskOrBuilder>( - getPropertyMask(), getParentForChildren(), isClean()); - propertyMask_ = null; - } - return propertyMaskBuilder_; - } - private com.google.datastore.v1.ExplainOptions explainOptions_; private com.google.protobuf.SingleFieldBuilderV3< com.google.datastore.v1.ExplainOptions, @@ -2442,7 +2125,7 @@ public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() * @return Whether the explainOptions field is set. */ public boolean hasExplainOptions() { - return ((bitField0_ & 0x00000080) != 0); + return ((bitField0_ & 0x00000040) != 0); } /** * @@ -2488,7 +2171,7 @@ public Builder setExplainOptions(com.google.datastore.v1.ExplainOptions value) { } else { explainOptionsBuilder_.setMessage(value); } - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000040; onChanged(); return this; } @@ -2511,7 +2194,7 @@ public Builder setExplainOptions( } else { explainOptionsBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000040; onChanged(); return this; } @@ -2529,7 +2212,7 @@ public Builder setExplainOptions( */ public Builder mergeExplainOptions(com.google.datastore.v1.ExplainOptions value) { if (explainOptionsBuilder_ == null) { - if (((bitField0_ & 0x00000080) != 0) + if (((bitField0_ & 0x00000040) != 0) && explainOptions_ != null && explainOptions_ != com.google.datastore.v1.ExplainOptions.getDefaultInstance()) { getExplainOptionsBuilder().mergeFrom(value); @@ -2540,7 +2223,7 @@ public Builder mergeExplainOptions(com.google.datastore.v1.ExplainOptions value) explainOptionsBuilder_.mergeFrom(value); } if (explainOptions_ != null) { - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000040; onChanged(); } return this; @@ -2558,7 +2241,7 @@ public Builder mergeExplainOptions(com.google.datastore.v1.ExplainOptions value) * */ public Builder clearExplainOptions() { - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000040); explainOptions_ = null; if (explainOptionsBuilder_ != null) { explainOptionsBuilder_.dispose(); @@ -2580,7 +2263,7 @@ public Builder clearExplainOptions() { * */ public com.google.datastore.v1.ExplainOptions.Builder getExplainOptionsBuilder() { - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000040; onChanged(); return getExplainOptionsFieldBuilder().getBuilder(); } diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequestOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequestOrBuilder.java index 55218e0e9..9e7a6f0b9 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequestOrBuilder.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequestOrBuilder.java @@ -229,53 +229,6 @@ public interface RunQueryRequestOrBuilder */ com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder(); - /** - * - * - *
-   * The properties to return.
-   * This field must not be set for a projection query.
-   *
-   * See
-   * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
-   * 
- * - * .google.datastore.v1.PropertyMask property_mask = 10; - * - * @return Whether the propertyMask field is set. - */ - boolean hasPropertyMask(); - /** - * - * - *
-   * The properties to return.
-   * This field must not be set for a projection query.
-   *
-   * See
-   * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
-   * 
- * - * .google.datastore.v1.PropertyMask property_mask = 10; - * - * @return The propertyMask. - */ - com.google.datastore.v1.PropertyMask getPropertyMask(); - /** - * - * - *
-   * The properties to return.
-   * This field must not be set for a projection query.
-   *
-   * See
-   * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
-   * 
- * - * .google.datastore.v1.PropertyMask property_mask = 10; - */ - com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder(); - /** * * diff --git a/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/datastore.proto b/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/datastore.proto index 92b5038ea..fbbabb0a3 100644 --- a/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/datastore.proto +++ b/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/datastore.proto @@ -173,14 +173,6 @@ message LookupRequest { // Required. Keys of entities to look up. repeated Key keys = 3 [(google.api.field_behavior) = REQUIRED]; - - // The properties to return. Defaults to returning all properties. - // - // If this field is set and an entity has a property not referenced in the - // mask, it will be absent from [LookupResponse.found.entity.properties][]. - // - // The entity's key is always returned. - PropertyMask property_mask = 5; } // The response for [Datastore.Lookup][google.datastore.v1.Datastore.Lookup]. @@ -242,13 +234,6 @@ message RunQueryRequest { GqlQuery gql_query = 7; } - // The properties to return. - // This field must not be set for a projection query. - // - // See - // [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask]. - PropertyMask property_mask = 10; - // Optional. Explain options for the query. If set, additional query // statistics will be returned. If not, only query results will be returned. ExplainOptions explain_options = 12 [(google.api.field_behavior) = OPTIONAL]; @@ -541,16 +526,6 @@ message Mutation { // mutation conflicts. google.protobuf.Timestamp update_time = 11; } - - // The properties to write in this mutation. - // None of the properties in the mask may have a reserved name, except for - // `__key__`. - // This field is ignored for `delete`. - // - // If the entity already exists, only properties referenced in the mask are - // updated, others are left untouched. - // Properties referenced in the mask but not in the entity are deleted. - PropertyMask property_mask = 9; } // The result of applying a mutation. @@ -580,23 +555,6 @@ message MutationResult { bool conflict_detected = 5; } -// The set of arbitrarily nested property paths used to restrict an operation to -// only a subset of properties in an entity. -message PropertyMask { - // The paths to the properties covered by this mask. - // - // A path is a list of property names separated by dots (`.`), for example - // `foo.bar` means the property `bar` inside the entity property `foo` inside - // the entity associated with this path. - // - // If a property name contains a dot `.` or a backslash `\`, then that - // name must be escaped. - // - // A path must not be empty, and may not reference a value inside an - // [array value][google.datastore.v1.Value.array_value]. - repeated string paths = 1; -} - // The options shared by read requests. message ReadOptions { // The possible values for read consistencies. From 71f395b897137dd6eab6fcbdced1be32ce8400e7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 15:05:45 -0400 Subject: [PATCH 10/17] feat: New PropertyMask field which allows partial commits, lookups, and query results (#1455) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: New PropertyMask field which allows partial commits, lookups, and query results PiperOrigin-RevId: 635449160 Source-Link: https://github.com/googleapis/googleapis/commit/dde0ec1f36cb8cbf9036dd0f1e8e5eda7882db4e Source-Link: https://github.com/googleapis/googleapis-gen/commit/8caa60d9aea82964a19cdf8faf91384911db8bdd Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGNhYTYwZDlhZWE4Mjk2NGExOWNkZjhmYWY5MTM4NDkxMWRiOGJkZCJ9 * 🦉 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 --- .../google/datastore/v1/DatastoreProto.java | 310 ++++++++------- .../google/datastore/v1/LookupRequest.java | 329 ++++++++++++++++ .../datastore/v1/LookupRequestOrBuilder.java | 50 +++ .../com/google/datastore/v1/Mutation.java | 366 +++++++++++++++++- .../datastore/v1/MutationOrBuilder.java | 56 +++ .../google/datastore/v1/RunQueryRequest.java | 337 +++++++++++++++- .../v1/RunQueryRequestOrBuilder.java | 47 +++ .../proto/google/datastore/v1/datastore.proto | 42 ++ 8 files changed, 1381 insertions(+), 156 deletions(-) diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/DatastoreProto.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/DatastoreProto.java index 1b8753e35..e637dd010 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/DatastoreProto.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/DatastoreProto.java @@ -100,6 +100,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_datastore_v1_MutationResult_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_datastore_v1_MutationResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_datastore_v1_PropertyMask_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_datastore_v1_PropertyMask_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_datastore_v1_ReadOptions_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -134,151 +138,157 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "entity.proto\032\037google/datastore/v1/query." + "proto\032\'google/datastore/v1/query_profile" + ".proto\032\037google/protobuf/timestamp.proto\"" - + "\242\001\n\rLookupRequest\022\027\n\nproject_id\030\010 \001(\tB\003\340" + + "\334\001\n\rLookupRequest\022\027\n\nproject_id\030\010 \001(\tB\003\340" + "A\002\022\023\n\013database_id\030\t \001(\t\0226\n\014read_options\030" + "\001 \001(\0132 .google.datastore.v1.ReadOptions\022" + "+\n\004keys\030\003 \003(\0132\030.google.datastore.v1.KeyB" - + "\003\340A\002\"\346\001\n\016LookupResponse\0220\n\005found\030\001 \003(\0132!" - + ".google.datastore.v1.EntityResult\0222\n\007mis" - + "sing\030\002 \003(\0132!.google.datastore.v1.EntityR" - + "esult\022*\n\010deferred\030\003 \003(\0132\030.google.datasto" - + "re.v1.Key\022\023\n\013transaction\030\005 \001(\014\022-\n\tread_t" - + "ime\030\007 \001(\0132\032.google.protobuf.Timestamp\"\341\002" - + "\n\017RunQueryRequest\022\027\n\nproject_id\030\010 \001(\tB\003\340" - + "A\002\022\023\n\013database_id\030\t \001(\t\0226\n\014partition_id\030" - + "\002 \001(\0132 .google.datastore.v1.PartitionId\022" - + "6\n\014read_options\030\001 \001(\0132 .google.datastore" - + ".v1.ReadOptions\022+\n\005query\030\003 \001(\0132\032.google." - + "datastore.v1.QueryH\000\0222\n\tgql_query\030\007 \001(\0132" - + "\035.google.datastore.v1.GqlQueryH\000\022A\n\017expl" - + "ain_options\030\014 \001(\0132#.google.datastore.v1." - + "ExplainOptionsB\003\340A\001B\014\n\nquery_type\"\306\001\n\020Ru" - + "nQueryResponse\0224\n\005batch\030\001 \001(\0132%.google.d" - + "atastore.v1.QueryResultBatch\022)\n\005query\030\002 " - + "\001(\0132\032.google.datastore.v1.Query\022\023\n\013trans" - + "action\030\005 \001(\014\022<\n\017explain_metrics\030\t \001(\0132#." - + "google.datastore.v1.ExplainMetrics\"\203\003\n\032R" - + "unAggregationQueryRequest\022\027\n\nproject_id\030" - + "\010 \001(\tB\003\340A\002\022\023\n\013database_id\030\t \001(\t\0226\n\014parti" - + "tion_id\030\002 \001(\0132 .google.datastore.v1.Part" - + "itionId\0226\n\014read_options\030\001 \001(\0132 .google.d" - + "atastore.v1.ReadOptions\022B\n\021aggregation_q" - + "uery\030\003 \001(\0132%.google.datastore.v1.Aggrega" - + "tionQueryH\000\0222\n\tgql_query\030\007 \001(\0132\035.google." - + "datastore.v1.GqlQueryH\000\022A\n\017explain_optio" - + "ns\030\013 \001(\0132#.google.datastore.v1.ExplainOp" - + "tionsB\003\340A\001B\014\n\nquery_type\"\342\001\n\033RunAggregat" - + "ionQueryResponse\022:\n\005batch\030\001 \001(\0132+.google" - + ".datastore.v1.AggregationResultBatch\0224\n\005" - + "query\030\002 \001(\0132%.google.datastore.v1.Aggreg" - + "ationQuery\022\023\n\013transaction\030\005 \001(\014\022<\n\017expla" - + "in_metrics\030\t \001(\0132#.google.datastore.v1.E" - + "xplainMetrics\"\215\001\n\027BeginTransactionReques" - + "t\022\027\n\nproject_id\030\010 \001(\tB\003\340A\002\022\023\n\013database_i" - + "d\030\t \001(\t\022D\n\023transaction_options\030\n \001(\0132\'.g" - + "oogle.datastore.v1.TransactionOptions\"/\n" - + "\030BeginTransactionResponse\022\023\n\013transaction" - + "\030\001 \001(\014\"Y\n\017RollbackRequest\022\027\n\nproject_id\030" - + "\010 \001(\tB\003\340A\002\022\023\n\013database_id\030\t \001(\t\022\030\n\013trans" - + "action\030\001 \001(\014B\003\340A\002\"\022\n\020RollbackResponse\"\350\002" - + "\n\rCommitRequest\022\027\n\nproject_id\030\010 \001(\tB\003\340A\002" - + "\022\023\n\013database_id\030\t \001(\t\0225\n\004mode\030\005 \001(\0162\'.go" - + "ogle.datastore.v1.CommitRequest.Mode\022\025\n\013" - + "transaction\030\001 \001(\014H\000\022I\n\026single_use_transa" - + "ction\030\n \001(\0132\'.google.datastore.v1.Transa" - + "ctionOptionsH\000\0220\n\tmutations\030\006 \003(\0132\035.goog" - + "le.datastore.v1.Mutation\"F\n\004Mode\022\024\n\020MODE" - + "_UNSPECIFIED\020\000\022\021\n\rTRANSACTIONAL\020\001\022\025\n\021NON" - + "_TRANSACTIONAL\020\002B\026\n\024transaction_selector" - + "\"\227\001\n\016CommitResponse\022=\n\020mutation_results\030" - + "\003 \003(\0132#.google.datastore.v1.MutationResu" - + "lt\022\025\n\rindex_updates\030\004 \001(\005\022/\n\013commit_time" - + "\030\010 \001(\0132\032.google.protobuf.Timestamp\"o\n\022Al" - + "locateIdsRequest\022\027\n\nproject_id\030\010 \001(\tB\003\340A" - + "\002\022\023\n\013database_id\030\t \001(\t\022+\n\004keys\030\001 \003(\0132\030.g" - + "oogle.datastore.v1.KeyB\003\340A\002\"=\n\023AllocateI" - + "dsResponse\022&\n\004keys\030\001 \003(\0132\030.google.datast" - + "ore.v1.Key\"n\n\021ReserveIdsRequest\022\027\n\nproje" - + "ct_id\030\010 \001(\tB\003\340A\002\022\023\n\013database_id\030\t \001(\t\022+\n" - + "\004keys\030\001 \003(\0132\030.google.datastore.v1.KeyB\003\340" - + "A\002\"\024\n\022ReserveIdsResponse\"\272\002\n\010Mutation\022-\n" - + "\006insert\030\004 \001(\0132\033.google.datastore.v1.Enti" - + "tyH\000\022-\n\006update\030\005 \001(\0132\033.google.datastore." - + "v1.EntityH\000\022-\n\006upsert\030\006 \001(\0132\033.google.dat" - + "astore.v1.EntityH\000\022*\n\006delete\030\007 \001(\0132\030.goo" - + "gle.datastore.v1.KeyH\000\022\026\n\014base_version\030\010" - + " \001(\003H\001\0221\n\013update_time\030\013 \001(\0132\032.google.pro" - + "tobuf.TimestampH\001B\013\n\toperationB\035\n\033confli" - + "ct_detection_strategy\"\305\001\n\016MutationResult" - + "\022%\n\003key\030\003 \001(\0132\030.google.datastore.v1.Key\022" - + "\017\n\007version\030\004 \001(\003\022/\n\013create_time\030\007 \001(\0132\032." - + "google.protobuf.Timestamp\022/\n\013update_time" - + "\030\006 \001(\0132\032.google.protobuf.Timestamp\022\031\n\021co" - + "nflict_detected\030\005 \001(\010\"\312\002\n\013ReadOptions\022L\n" - + "\020read_consistency\030\001 \001(\01620.google.datasto" - + "re.v1.ReadOptions.ReadConsistencyH\000\022\025\n\013t" - + "ransaction\030\002 \001(\014H\000\022B\n\017new_transaction\030\003 " - + "\001(\0132\'.google.datastore.v1.TransactionOpt" - + "ionsH\000\022/\n\tread_time\030\004 \001(\0132\032.google.proto" - + "buf.TimestampH\000\"M\n\017ReadConsistency\022 \n\034RE" - + "AD_CONSISTENCY_UNSPECIFIED\020\000\022\n\n\006STRONG\020\001" - + "\022\014\n\010EVENTUAL\020\002B\022\n\020consistency_type\"\222\002\n\022T" - + "ransactionOptions\022G\n\nread_write\030\001 \001(\01321." - + "google.datastore.v1.TransactionOptions.R" - + "eadWriteH\000\022E\n\tread_only\030\002 \001(\01320.google.d" - + "atastore.v1.TransactionOptions.ReadOnlyH" - + "\000\032)\n\tReadWrite\022\034\n\024previous_transaction\030\001" - + " \001(\014\0329\n\010ReadOnly\022-\n\tread_time\030\001 \001(\0132\032.go" - + "ogle.protobuf.TimestampB\006\n\004mode2\341\r\n\tData" - + "store\022\300\001\n\006Lookup\022\".google.datastore.v1.L" - + "ookupRequest\032#.google.datastore.v1.Looku" - + "pResponse\"m\332A\034project_id,read_options,ke" - + "ys\202\323\344\223\002%\" /v1/projects/{project_id}:look" - + "up:\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013database_id" - + "\022\251\001\n\010RunQuery\022$.google.datastore.v1.RunQ" - + "ueryRequest\032%.google.datastore.v1.RunQue" - + "ryResponse\"P\202\323\344\223\002\'\"\"/v1/projects/{projec" - + "t_id}:runQuery:\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n" - + "\013database_id\022\325\001\n\023RunAggregationQuery\022/.g" - + "oogle.datastore.v1.RunAggregationQueryRe" - + "quest\0320.google.datastore.v1.RunAggregati" - + "onQueryResponse\"[\202\323\344\223\0022\"-/v1/projects/{p" - + "roject_id}:runAggregationQuery:\001*\212\323\344\223\002\035\022" - + "\014\n\nproject_id\022\r\n\013database_id\022\326\001\n\020BeginTr" - + "ansaction\022,.google.datastore.v1.BeginTra" - + "nsactionRequest\032-.google.datastore.v1.Be" - + "ginTransactionResponse\"e\332A\nproject_id\202\323\344" - + "\223\002/\"*/v1/projects/{project_id}:beginTran" - + "saction:\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013databa" - + "se_id\022\346\001\n\006Commit\022\".google.datastore.v1.C" - + "ommitRequest\032#.google.datastore.v1.Commi" - + "tResponse\"\222\001\332A%project_id,mode,transacti" - + "on,mutations\332A\031project_id,mode,mutations" - + "\202\323\344\223\002%\" /v1/projects/{project_id}:commit" - + ":\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013database_id\022\302" - + "\001\n\010Rollback\022$.google.datastore.v1.Rollba" - + "ckRequest\032%.google.datastore.v1.Rollback" - + "Response\"i\332A\026project_id,transaction\202\323\344\223\002" - + "\'\"\"/v1/projects/{project_id}:rollback:\001*" - + "\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013database_id\022\307\001\n\013" - + "AllocateIds\022\'.google.datastore.v1.Alloca" - + "teIdsRequest\032(.google.datastore.v1.Alloc" - + "ateIdsResponse\"e\332A\017project_id,keys\202\323\344\223\002*" - + "\"%/v1/projects/{project_id}:allocateIds:" - + "\001*\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013database_id\022\303\001" - + "\n\nReserveIds\022&.google.datastore.v1.Reser" - + "veIdsRequest\032\'.google.datastore.v1.Reser" - + "veIdsResponse\"d\332A\017project_id,keys\202\323\344\223\002)\"" - + "$/v1/projects/{project_id}:reserveIds:\001*" - + "\212\323\344\223\002\035\022\014\n\nproject_id\022\r\n\013database_id\032v\312A\030" - + "datastore.googleapis.com\322AXhttps://www.g" - + "oogleapis.com/auth/cloud-platform,https:" - + "//www.googleapis.com/auth/datastoreB\300\001\n\027" - + "com.google.datastore.v1B\016DatastoreProtoP" - + "\001Z + * The properties to return. Defaults to returning all properties. + * + * If this field is set and an entity has a property not referenced in the + * mask, it will be absent from [LookupResponse.found.entity.properties][]. + * + * The entity's key is always returned. + * + * + * .google.datastore.v1.PropertyMask property_mask = 5; + * + * @return Whether the propertyMask field is set. + */ + @java.lang.Override + public boolean hasPropertyMask() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * The properties to return. Defaults to returning all properties.
+   *
+   * If this field is set and an entity has a property not referenced in the
+   * mask, it will be absent from [LookupResponse.found.entity.properties][].
+   *
+   * The entity's key is always returned.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + * + * @return The propertyMask. + */ + @java.lang.Override + public com.google.datastore.v1.PropertyMask getPropertyMask() { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } + /** + * + * + *
+   * The properties to return. Defaults to returning all properties.
+   *
+   * If this field is set and an entity has a property not referenced in the
+   * mask, it will be absent from [LookupResponse.found.entity.properties][].
+   *
+   * The entity's key is always returned.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + */ + @java.lang.Override + public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -319,6 +384,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < keys_.size(); i++) { output.writeMessage(3, keys_.get(i)); } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getPropertyMask()); + } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 8, projectId_); } @@ -340,6 +408,9 @@ public int getSerializedSize() { for (int i = 0; i < keys_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, keys_.get(i)); } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getPropertyMask()); + } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, projectId_); } @@ -368,6 +439,10 @@ public boolean equals(final java.lang.Object obj) { if (!getReadOptions().equals(other.getReadOptions())) return false; } if (!getKeysList().equals(other.getKeysList())) return false; + if (hasPropertyMask() != other.hasPropertyMask()) return false; + if (hasPropertyMask()) { + if (!getPropertyMask().equals(other.getPropertyMask())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -391,6 +466,10 @@ public int hashCode() { hash = (37 * hash) + KEYS_FIELD_NUMBER; hash = (53 * hash) + getKeysList().hashCode(); } + if (hasPropertyMask()) { + hash = (37 * hash) + PROPERTY_MASK_FIELD_NUMBER; + hash = (53 * hash) + getPropertyMask().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -532,6 +611,7 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getReadOptionsFieldBuilder(); getKeysFieldBuilder(); + getPropertyMaskFieldBuilder(); } } @@ -553,6 +633,11 @@ public Builder clear() { keysBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000008); + propertyMask_ = null; + if (propertyMaskBuilder_ != null) { + propertyMaskBuilder_.dispose(); + propertyMaskBuilder_ = null; + } return this; } @@ -614,6 +699,11 @@ private void buildPartial0(com.google.datastore.v1.LookupRequest result) { readOptionsBuilder_ == null ? readOptions_ : readOptionsBuilder_.build(); to_bitField0_ |= 0x00000001; } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.propertyMask_ = + propertyMaskBuilder_ == null ? propertyMask_ : propertyMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } result.bitField0_ |= to_bitField0_; } @@ -702,6 +792,9 @@ public Builder mergeFrom(com.google.datastore.v1.LookupRequest other) { } } } + if (other.hasPropertyMask()) { + mergePropertyMask(other.getPropertyMask()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -746,6 +839,12 @@ public Builder mergeFrom( } break; } // case 26 + case 42: + { + input.readMessage(getPropertyMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 case 66: { projectId_ = input.readStringRequireUtf8(); @@ -1549,6 +1648,236 @@ public java.util.List getKeysBuilderList() return keysBuilder_; } + private com.google.datastore.v1.PropertyMask propertyMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PropertyMask, + com.google.datastore.v1.PropertyMask.Builder, + com.google.datastore.v1.PropertyMaskOrBuilder> + propertyMaskBuilder_; + /** + * + * + *
+     * The properties to return. Defaults to returning all properties.
+     *
+     * If this field is set and an entity has a property not referenced in the
+     * mask, it will be absent from [LookupResponse.found.entity.properties][].
+     *
+     * The entity's key is always returned.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + * + * @return Whether the propertyMask field is set. + */ + public boolean hasPropertyMask() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * The properties to return. Defaults to returning all properties.
+     *
+     * If this field is set and an entity has a property not referenced in the
+     * mask, it will be absent from [LookupResponse.found.entity.properties][].
+     *
+     * The entity's key is always returned.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + * + * @return The propertyMask. + */ + public com.google.datastore.v1.PropertyMask getPropertyMask() { + if (propertyMaskBuilder_ == null) { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } else { + return propertyMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The properties to return. Defaults to returning all properties.
+     *
+     * If this field is set and an entity has a property not referenced in the
+     * mask, it will be absent from [LookupResponse.found.entity.properties][].
+     *
+     * The entity's key is always returned.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + */ + public Builder setPropertyMask(com.google.datastore.v1.PropertyMask value) { + if (propertyMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + propertyMask_ = value; + } else { + propertyMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The properties to return. Defaults to returning all properties.
+     *
+     * If this field is set and an entity has a property not referenced in the
+     * mask, it will be absent from [LookupResponse.found.entity.properties][].
+     *
+     * The entity's key is always returned.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + */ + public Builder setPropertyMask(com.google.datastore.v1.PropertyMask.Builder builderForValue) { + if (propertyMaskBuilder_ == null) { + propertyMask_ = builderForValue.build(); + } else { + propertyMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The properties to return. Defaults to returning all properties.
+     *
+     * If this field is set and an entity has a property not referenced in the
+     * mask, it will be absent from [LookupResponse.found.entity.properties][].
+     *
+     * The entity's key is always returned.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + */ + public Builder mergePropertyMask(com.google.datastore.v1.PropertyMask value) { + if (propertyMaskBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && propertyMask_ != null + && propertyMask_ != com.google.datastore.v1.PropertyMask.getDefaultInstance()) { + getPropertyMaskBuilder().mergeFrom(value); + } else { + propertyMask_ = value; + } + } else { + propertyMaskBuilder_.mergeFrom(value); + } + if (propertyMask_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The properties to return. Defaults to returning all properties.
+     *
+     * If this field is set and an entity has a property not referenced in the
+     * mask, it will be absent from [LookupResponse.found.entity.properties][].
+     *
+     * The entity's key is always returned.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + */ + public Builder clearPropertyMask() { + bitField0_ = (bitField0_ & ~0x00000010); + propertyMask_ = null; + if (propertyMaskBuilder_ != null) { + propertyMaskBuilder_.dispose(); + propertyMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The properties to return. Defaults to returning all properties.
+     *
+     * If this field is set and an entity has a property not referenced in the
+     * mask, it will be absent from [LookupResponse.found.entity.properties][].
+     *
+     * The entity's key is always returned.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + */ + public com.google.datastore.v1.PropertyMask.Builder getPropertyMaskBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getPropertyMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The properties to return. Defaults to returning all properties.
+     *
+     * If this field is set and an entity has a property not referenced in the
+     * mask, it will be absent from [LookupResponse.found.entity.properties][].
+     *
+     * The entity's key is always returned.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + */ + public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() { + if (propertyMaskBuilder_ != null) { + return propertyMaskBuilder_.getMessageOrBuilder(); + } else { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } + } + /** + * + * + *
+     * The properties to return. Defaults to returning all properties.
+     *
+     * If this field is set and an entity has a property not referenced in the
+     * mask, it will be absent from [LookupResponse.found.entity.properties][].
+     *
+     * The entity's key is always returned.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PropertyMask, + com.google.datastore.v1.PropertyMask.Builder, + com.google.datastore.v1.PropertyMaskOrBuilder> + getPropertyMaskFieldBuilder() { + if (propertyMaskBuilder_ == null) { + propertyMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PropertyMask, + com.google.datastore.v1.PropertyMask.Builder, + com.google.datastore.v1.PropertyMaskOrBuilder>( + getPropertyMask(), getParentForChildren(), isClean()); + propertyMask_ = null; + } + return propertyMaskBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/LookupRequestOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/LookupRequestOrBuilder.java index 82fe24661..d343eeca4 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/LookupRequestOrBuilder.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/LookupRequestOrBuilder.java @@ -170,4 +170,54 @@ public interface LookupRequestOrBuilder * */ com.google.datastore.v1.KeyOrBuilder getKeysOrBuilder(int index); + + /** + * + * + *
+   * The properties to return. Defaults to returning all properties.
+   *
+   * If this field is set and an entity has a property not referenced in the
+   * mask, it will be absent from [LookupResponse.found.entity.properties][].
+   *
+   * The entity's key is always returned.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + * + * @return Whether the propertyMask field is set. + */ + boolean hasPropertyMask(); + /** + * + * + *
+   * The properties to return. Defaults to returning all properties.
+   *
+   * If this field is set and an entity has a property not referenced in the
+   * mask, it will be absent from [LookupResponse.found.entity.properties][].
+   *
+   * The entity's key is always returned.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + * + * @return The propertyMask. + */ + com.google.datastore.v1.PropertyMask getPropertyMask(); + /** + * + * + *
+   * The properties to return. Defaults to returning all properties.
+   *
+   * If this field is set and an entity has a property not referenced in the
+   * mask, it will be absent from [LookupResponse.found.entity.properties][].
+   *
+   * The entity's key is always returned.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 5; + */ + com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder(); } diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Mutation.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Mutation.java index 91895d180..6857d48a6 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Mutation.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/Mutation.java @@ -60,6 +60,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.datastore.v1.Mutation.class, com.google.datastore.v1.Mutation.Builder.class); } + private int bitField0_; private int operationCase_ = 0; @SuppressWarnings("serial") @@ -476,6 +477,77 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { return com.google.protobuf.Timestamp.getDefaultInstance(); } + public static final int PROPERTY_MASK_FIELD_NUMBER = 9; + private com.google.datastore.v1.PropertyMask propertyMask_; + /** + * + * + *
+   * The properties to write in this mutation.
+   * None of the properties in the mask may have a reserved name, except for
+   * `__key__`.
+   * This field is ignored for `delete`.
+   *
+   * If the entity already exists, only properties referenced in the mask are
+   * updated, others are left untouched.
+   * Properties referenced in the mask but not in the entity are deleted.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + * + * @return Whether the propertyMask field is set. + */ + @java.lang.Override + public boolean hasPropertyMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * The properties to write in this mutation.
+   * None of the properties in the mask may have a reserved name, except for
+   * `__key__`.
+   * This field is ignored for `delete`.
+   *
+   * If the entity already exists, only properties referenced in the mask are
+   * updated, others are left untouched.
+   * Properties referenced in the mask but not in the entity are deleted.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + * + * @return The propertyMask. + */ + @java.lang.Override + public com.google.datastore.v1.PropertyMask getPropertyMask() { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } + /** + * + * + *
+   * The properties to write in this mutation.
+   * None of the properties in the mask may have a reserved name, except for
+   * `__key__`.
+   * This field is ignored for `delete`.
+   *
+   * If the entity already exists, only properties referenced in the mask are
+   * updated, others are left untouched.
+   * Properties referenced in the mask but not in the entity are deleted.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + */ + @java.lang.Override + public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -505,6 +577,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (conflictDetectionStrategyCase_ == 8) { output.writeInt64(8, (long) ((java.lang.Long) conflictDetectionStrategy_)); } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(9, getPropertyMask()); + } if (conflictDetectionStrategyCase_ == 11) { output.writeMessage(11, (com.google.protobuf.Timestamp) conflictDetectionStrategy_); } @@ -542,6 +617,9 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeInt64Size( 8, (long) ((java.lang.Long) conflictDetectionStrategy_)); } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getPropertyMask()); + } if (conflictDetectionStrategyCase_ == 11) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( @@ -562,6 +640,10 @@ public boolean equals(final java.lang.Object obj) { } com.google.datastore.v1.Mutation other = (com.google.datastore.v1.Mutation) obj; + if (hasPropertyMask() != other.hasPropertyMask()) return false; + if (hasPropertyMask()) { + if (!getPropertyMask().equals(other.getPropertyMask())) return false; + } if (!getOperationCase().equals(other.getOperationCase())) return false; switch (operationCase_) { case 4: @@ -602,6 +684,10 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPropertyMask()) { + hash = (37 * hash) + PROPERTY_MASK_FIELD_NUMBER; + hash = (53 * hash) + getPropertyMask().hashCode(); + } switch (operationCase_) { case 4: hash = (37 * hash) + INSERT_FIELD_NUMBER; @@ -762,10 +848,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.datastore.v1.Mutation.newBuilder() - private Builder() {} + private Builder() { + maybeForceBuilderInitialization(); + } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPropertyMaskFieldBuilder(); + } } @java.lang.Override @@ -787,6 +882,11 @@ public Builder clear() { if (updateTimeBuilder_ != null) { updateTimeBuilder_.clear(); } + propertyMask_ = null; + if (propertyMaskBuilder_ != null) { + propertyMaskBuilder_.dispose(); + propertyMaskBuilder_ = null; + } operationCase_ = 0; operation_ = null; conflictDetectionStrategyCase_ = 0; @@ -827,6 +927,13 @@ public com.google.datastore.v1.Mutation buildPartial() { private void buildPartial0(com.google.datastore.v1.Mutation result) { int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000040) != 0)) { + result.propertyMask_ = + propertyMaskBuilder_ == null ? propertyMask_ : propertyMaskBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; } private void buildPartialOneofs(com.google.datastore.v1.Mutation result) { @@ -896,6 +1003,9 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.datastore.v1.Mutation other) { if (other == com.google.datastore.v1.Mutation.getDefaultInstance()) return this; + if (other.hasPropertyMask()) { + mergePropertyMask(other.getPropertyMask()); + } switch (other.getOperationCase()) { case INSERT: { @@ -994,6 +1104,12 @@ public Builder mergeFrom( conflictDetectionStrategyCase_ = 8; break; } // case 64 + case 74: + { + input.readMessage(getPropertyMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 74 case 90: { input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); @@ -2206,6 +2322,254 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { return updateTimeBuilder_; } + private com.google.datastore.v1.PropertyMask propertyMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PropertyMask, + com.google.datastore.v1.PropertyMask.Builder, + com.google.datastore.v1.PropertyMaskOrBuilder> + propertyMaskBuilder_; + /** + * + * + *
+     * The properties to write in this mutation.
+     * None of the properties in the mask may have a reserved name, except for
+     * `__key__`.
+     * This field is ignored for `delete`.
+     *
+     * If the entity already exists, only properties referenced in the mask are
+     * updated, others are left untouched.
+     * Properties referenced in the mask but not in the entity are deleted.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + * + * @return Whether the propertyMask field is set. + */ + public boolean hasPropertyMask() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * The properties to write in this mutation.
+     * None of the properties in the mask may have a reserved name, except for
+     * `__key__`.
+     * This field is ignored for `delete`.
+     *
+     * If the entity already exists, only properties referenced in the mask are
+     * updated, others are left untouched.
+     * Properties referenced in the mask but not in the entity are deleted.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + * + * @return The propertyMask. + */ + public com.google.datastore.v1.PropertyMask getPropertyMask() { + if (propertyMaskBuilder_ == null) { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } else { + return propertyMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The properties to write in this mutation.
+     * None of the properties in the mask may have a reserved name, except for
+     * `__key__`.
+     * This field is ignored for `delete`.
+     *
+     * If the entity already exists, only properties referenced in the mask are
+     * updated, others are left untouched.
+     * Properties referenced in the mask but not in the entity are deleted.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + */ + public Builder setPropertyMask(com.google.datastore.v1.PropertyMask value) { + if (propertyMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + propertyMask_ = value; + } else { + propertyMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The properties to write in this mutation.
+     * None of the properties in the mask may have a reserved name, except for
+     * `__key__`.
+     * This field is ignored for `delete`.
+     *
+     * If the entity already exists, only properties referenced in the mask are
+     * updated, others are left untouched.
+     * Properties referenced in the mask but not in the entity are deleted.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + */ + public Builder setPropertyMask(com.google.datastore.v1.PropertyMask.Builder builderForValue) { + if (propertyMaskBuilder_ == null) { + propertyMask_ = builderForValue.build(); + } else { + propertyMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The properties to write in this mutation.
+     * None of the properties in the mask may have a reserved name, except for
+     * `__key__`.
+     * This field is ignored for `delete`.
+     *
+     * If the entity already exists, only properties referenced in the mask are
+     * updated, others are left untouched.
+     * Properties referenced in the mask but not in the entity are deleted.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + */ + public Builder mergePropertyMask(com.google.datastore.v1.PropertyMask value) { + if (propertyMaskBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && propertyMask_ != null + && propertyMask_ != com.google.datastore.v1.PropertyMask.getDefaultInstance()) { + getPropertyMaskBuilder().mergeFrom(value); + } else { + propertyMask_ = value; + } + } else { + propertyMaskBuilder_.mergeFrom(value); + } + if (propertyMask_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The properties to write in this mutation.
+     * None of the properties in the mask may have a reserved name, except for
+     * `__key__`.
+     * This field is ignored for `delete`.
+     *
+     * If the entity already exists, only properties referenced in the mask are
+     * updated, others are left untouched.
+     * Properties referenced in the mask but not in the entity are deleted.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + */ + public Builder clearPropertyMask() { + bitField0_ = (bitField0_ & ~0x00000040); + propertyMask_ = null; + if (propertyMaskBuilder_ != null) { + propertyMaskBuilder_.dispose(); + propertyMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The properties to write in this mutation.
+     * None of the properties in the mask may have a reserved name, except for
+     * `__key__`.
+     * This field is ignored for `delete`.
+     *
+     * If the entity already exists, only properties referenced in the mask are
+     * updated, others are left untouched.
+     * Properties referenced in the mask but not in the entity are deleted.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + */ + public com.google.datastore.v1.PropertyMask.Builder getPropertyMaskBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getPropertyMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The properties to write in this mutation.
+     * None of the properties in the mask may have a reserved name, except for
+     * `__key__`.
+     * This field is ignored for `delete`.
+     *
+     * If the entity already exists, only properties referenced in the mask are
+     * updated, others are left untouched.
+     * Properties referenced in the mask but not in the entity are deleted.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + */ + public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() { + if (propertyMaskBuilder_ != null) { + return propertyMaskBuilder_.getMessageOrBuilder(); + } else { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } + } + /** + * + * + *
+     * The properties to write in this mutation.
+     * None of the properties in the mask may have a reserved name, except for
+     * `__key__`.
+     * This field is ignored for `delete`.
+     *
+     * If the entity already exists, only properties referenced in the mask are
+     * updated, others are left untouched.
+     * Properties referenced in the mask but not in the entity are deleted.
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PropertyMask, + com.google.datastore.v1.PropertyMask.Builder, + com.google.datastore.v1.PropertyMaskOrBuilder> + getPropertyMaskFieldBuilder() { + if (propertyMaskBuilder_ == null) { + propertyMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PropertyMask, + com.google.datastore.v1.PropertyMask.Builder, + com.google.datastore.v1.PropertyMaskOrBuilder>( + getPropertyMask(), getParentForChildren(), isClean()); + propertyMask_ = null; + } + return propertyMaskBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/MutationOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/MutationOrBuilder.java index e833ed942..e051e6003 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/MutationOrBuilder.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/MutationOrBuilder.java @@ -246,6 +246,62 @@ public interface MutationOrBuilder */ com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + /** + * + * + *
+   * The properties to write in this mutation.
+   * None of the properties in the mask may have a reserved name, except for
+   * `__key__`.
+   * This field is ignored for `delete`.
+   *
+   * If the entity already exists, only properties referenced in the mask are
+   * updated, others are left untouched.
+   * Properties referenced in the mask but not in the entity are deleted.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + * + * @return Whether the propertyMask field is set. + */ + boolean hasPropertyMask(); + /** + * + * + *
+   * The properties to write in this mutation.
+   * None of the properties in the mask may have a reserved name, except for
+   * `__key__`.
+   * This field is ignored for `delete`.
+   *
+   * If the entity already exists, only properties referenced in the mask are
+   * updated, others are left untouched.
+   * Properties referenced in the mask but not in the entity are deleted.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + * + * @return The propertyMask. + */ + com.google.datastore.v1.PropertyMask getPropertyMask(); + /** + * + * + *
+   * The properties to write in this mutation.
+   * None of the properties in the mask may have a reserved name, except for
+   * `__key__`.
+   * This field is ignored for `delete`.
+   *
+   * If the entity already exists, only properties referenced in the mask are
+   * updated, others are left untouched.
+   * Properties referenced in the mask but not in the entity are deleted.
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 9; + */ + com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder(); + com.google.datastore.v1.Mutation.OperationCase getOperationCase(); com.google.datastore.v1.Mutation.ConflictDetectionStrategyCase getConflictDetectionStrategyCase(); diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java index 4420d5779..55691ceae 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequest.java @@ -433,6 +433,68 @@ public com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder() { return com.google.datastore.v1.GqlQuery.getDefaultInstance(); } + public static final int PROPERTY_MASK_FIELD_NUMBER = 10; + private com.google.datastore.v1.PropertyMask propertyMask_; + /** + * + * + *
+   * The properties to return.
+   * This field must not be set for a projection query.
+   *
+   * See
+   * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + * + * @return Whether the propertyMask field is set. + */ + @java.lang.Override + public boolean hasPropertyMask() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * The properties to return.
+   * This field must not be set for a projection query.
+   *
+   * See
+   * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + * + * @return The propertyMask. + */ + @java.lang.Override + public com.google.datastore.v1.PropertyMask getPropertyMask() { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } + /** + * + * + *
+   * The properties to return.
+   * This field must not be set for a projection query.
+   *
+   * See
+   * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + */ + @java.lang.Override + public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } + public static final int EXPLAIN_OPTIONS_FIELD_NUMBER = 12; private com.google.datastore.v1.ExplainOptions explainOptions_; /** @@ -451,7 +513,7 @@ public com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder() { */ @java.lang.Override public boolean hasExplainOptions() { - return ((bitField0_ & 0x00000004) != 0); + return ((bitField0_ & 0x00000008) != 0); } /** * @@ -525,6 +587,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io com.google.protobuf.GeneratedMessageV3.writeString(output, 9, databaseId_); } if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(10, getPropertyMask()); + } + if (((bitField0_ & 0x00000008) != 0)) { output.writeMessage(12, getExplainOptions()); } getUnknownFields().writeTo(output); @@ -559,6 +624,9 @@ public int getSerializedSize() { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, databaseId_); } if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getPropertyMask()); + } + if (((bitField0_ & 0x00000008) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getExplainOptions()); } size += getUnknownFields().getSerializedSize(); @@ -586,6 +654,10 @@ public boolean equals(final java.lang.Object obj) { if (hasReadOptions()) { if (!getReadOptions().equals(other.getReadOptions())) return false; } + if (hasPropertyMask() != other.hasPropertyMask()) return false; + if (hasPropertyMask()) { + if (!getPropertyMask().equals(other.getPropertyMask())) return false; + } if (hasExplainOptions() != other.hasExplainOptions()) return false; if (hasExplainOptions()) { if (!getExplainOptions().equals(other.getExplainOptions())) return false; @@ -624,6 +696,10 @@ public int hashCode() { hash = (37 * hash) + READ_OPTIONS_FIELD_NUMBER; hash = (53 * hash) + getReadOptions().hashCode(); } + if (hasPropertyMask()) { + hash = (37 * hash) + PROPERTY_MASK_FIELD_NUMBER; + hash = (53 * hash) + getPropertyMask().hashCode(); + } if (hasExplainOptions()) { hash = (37 * hash) + EXPLAIN_OPTIONS_FIELD_NUMBER; hash = (53 * hash) + getExplainOptions().hashCode(); @@ -782,6 +858,7 @@ private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getPartitionIdFieldBuilder(); getReadOptionsFieldBuilder(); + getPropertyMaskFieldBuilder(); getExplainOptionsFieldBuilder(); } } @@ -808,6 +885,11 @@ public Builder clear() { if (gqlQueryBuilder_ != null) { gqlQueryBuilder_.clear(); } + propertyMask_ = null; + if (propertyMaskBuilder_ != null) { + propertyMaskBuilder_.dispose(); + propertyMaskBuilder_ = null; + } explainOptions_ = null; if (explainOptionsBuilder_ != null) { explainOptionsBuilder_.dispose(); @@ -870,9 +952,14 @@ private void buildPartial0(com.google.datastore.v1.RunQueryRequest result) { to_bitField0_ |= 0x00000002; } if (((from_bitField0_ & 0x00000040) != 0)) { + result.propertyMask_ = + propertyMaskBuilder_ == null ? propertyMask_ : propertyMaskBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000080) != 0)) { result.explainOptions_ = explainOptionsBuilder_ == null ? explainOptions_ : explainOptionsBuilder_.build(); - to_bitField0_ |= 0x00000004; + to_bitField0_ |= 0x00000008; } result.bitField0_ |= to_bitField0_; } @@ -949,6 +1036,9 @@ public Builder mergeFrom(com.google.datastore.v1.RunQueryRequest other) { if (other.hasReadOptions()) { mergeReadOptions(other.getReadOptions()); } + if (other.hasPropertyMask()) { + mergePropertyMask(other.getPropertyMask()); + } if (other.hasExplainOptions()) { mergeExplainOptions(other.getExplainOptions()); } @@ -1030,10 +1120,16 @@ public Builder mergeFrom( bitField0_ |= 0x00000002; break; } // case 74 + case 82: + { + input.readMessage(getPropertyMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 82 case 98: { input.readMessage(getExplainOptionsFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; break; } // case 98 default: @@ -2104,6 +2200,227 @@ public com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder() { return gqlQueryBuilder_; } + private com.google.datastore.v1.PropertyMask propertyMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PropertyMask, + com.google.datastore.v1.PropertyMask.Builder, + com.google.datastore.v1.PropertyMaskOrBuilder> + propertyMaskBuilder_; + /** + * + * + *
+     * The properties to return.
+     * This field must not be set for a projection query.
+     *
+     * See
+     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + * + * @return Whether the propertyMask field is set. + */ + public boolean hasPropertyMask() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+     * The properties to return.
+     * This field must not be set for a projection query.
+     *
+     * See
+     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + * + * @return The propertyMask. + */ + public com.google.datastore.v1.PropertyMask getPropertyMask() { + if (propertyMaskBuilder_ == null) { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } else { + return propertyMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The properties to return.
+     * This field must not be set for a projection query.
+     *
+     * See
+     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + */ + public Builder setPropertyMask(com.google.datastore.v1.PropertyMask value) { + if (propertyMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + propertyMask_ = value; + } else { + propertyMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The properties to return.
+     * This field must not be set for a projection query.
+     *
+     * See
+     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + */ + public Builder setPropertyMask(com.google.datastore.v1.PropertyMask.Builder builderForValue) { + if (propertyMaskBuilder_ == null) { + propertyMask_ = builderForValue.build(); + } else { + propertyMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * The properties to return.
+     * This field must not be set for a projection query.
+     *
+     * See
+     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + */ + public Builder mergePropertyMask(com.google.datastore.v1.PropertyMask value) { + if (propertyMaskBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && propertyMask_ != null + && propertyMask_ != com.google.datastore.v1.PropertyMask.getDefaultInstance()) { + getPropertyMaskBuilder().mergeFrom(value); + } else { + propertyMask_ = value; + } + } else { + propertyMaskBuilder_.mergeFrom(value); + } + if (propertyMask_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The properties to return.
+     * This field must not be set for a projection query.
+     *
+     * See
+     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + */ + public Builder clearPropertyMask() { + bitField0_ = (bitField0_ & ~0x00000040); + propertyMask_ = null; + if (propertyMaskBuilder_ != null) { + propertyMaskBuilder_.dispose(); + propertyMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * The properties to return.
+     * This field must not be set for a projection query.
+     *
+     * See
+     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + */ + public com.google.datastore.v1.PropertyMask.Builder getPropertyMaskBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getPropertyMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The properties to return.
+     * This field must not be set for a projection query.
+     *
+     * See
+     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + */ + public com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder() { + if (propertyMaskBuilder_ != null) { + return propertyMaskBuilder_.getMessageOrBuilder(); + } else { + return propertyMask_ == null + ? com.google.datastore.v1.PropertyMask.getDefaultInstance() + : propertyMask_; + } + } + /** + * + * + *
+     * The properties to return.
+     * This field must not be set for a projection query.
+     *
+     * See
+     * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+     * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PropertyMask, + com.google.datastore.v1.PropertyMask.Builder, + com.google.datastore.v1.PropertyMaskOrBuilder> + getPropertyMaskFieldBuilder() { + if (propertyMaskBuilder_ == null) { + propertyMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.datastore.v1.PropertyMask, + com.google.datastore.v1.PropertyMask.Builder, + com.google.datastore.v1.PropertyMaskOrBuilder>( + getPropertyMask(), getParentForChildren(), isClean()); + propertyMask_ = null; + } + return propertyMaskBuilder_; + } + private com.google.datastore.v1.ExplainOptions explainOptions_; private com.google.protobuf.SingleFieldBuilderV3< com.google.datastore.v1.ExplainOptions, @@ -2125,7 +2442,7 @@ public com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder() { * @return Whether the explainOptions field is set. */ public boolean hasExplainOptions() { - return ((bitField0_ & 0x00000040) != 0); + return ((bitField0_ & 0x00000080) != 0); } /** * @@ -2171,7 +2488,7 @@ public Builder setExplainOptions(com.google.datastore.v1.ExplainOptions value) { } else { explainOptionsBuilder_.setMessage(value); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -2194,7 +2511,7 @@ public Builder setExplainOptions( } else { explainOptionsBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -2212,7 +2529,7 @@ public Builder setExplainOptions( */ public Builder mergeExplainOptions(com.google.datastore.v1.ExplainOptions value) { if (explainOptionsBuilder_ == null) { - if (((bitField0_ & 0x00000040) != 0) + if (((bitField0_ & 0x00000080) != 0) && explainOptions_ != null && explainOptions_ != com.google.datastore.v1.ExplainOptions.getDefaultInstance()) { getExplainOptionsBuilder().mergeFrom(value); @@ -2223,7 +2540,7 @@ public Builder mergeExplainOptions(com.google.datastore.v1.ExplainOptions value) explainOptionsBuilder_.mergeFrom(value); } if (explainOptions_ != null) { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); } return this; @@ -2241,7 +2558,7 @@ public Builder mergeExplainOptions(com.google.datastore.v1.ExplainOptions value) * */ public Builder clearExplainOptions() { - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000080); explainOptions_ = null; if (explainOptionsBuilder_ != null) { explainOptionsBuilder_.dispose(); @@ -2263,7 +2580,7 @@ public Builder clearExplainOptions() { * */ public com.google.datastore.v1.ExplainOptions.Builder getExplainOptionsBuilder() { - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000080; onChanged(); return getExplainOptionsFieldBuilder().getBuilder(); } diff --git a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequestOrBuilder.java b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequestOrBuilder.java index 9e7a6f0b9..55218e0e9 100644 --- a/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequestOrBuilder.java +++ b/proto-google-cloud-datastore-v1/src/main/java/com/google/datastore/v1/RunQueryRequestOrBuilder.java @@ -229,6 +229,53 @@ public interface RunQueryRequestOrBuilder */ com.google.datastore.v1.GqlQueryOrBuilder getGqlQueryOrBuilder(); + /** + * + * + *
+   * The properties to return.
+   * This field must not be set for a projection query.
+   *
+   * See
+   * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + * + * @return Whether the propertyMask field is set. + */ + boolean hasPropertyMask(); + /** + * + * + *
+   * The properties to return.
+   * This field must not be set for a projection query.
+   *
+   * See
+   * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + * + * @return The propertyMask. + */ + com.google.datastore.v1.PropertyMask getPropertyMask(); + /** + * + * + *
+   * The properties to return.
+   * This field must not be set for a projection query.
+   *
+   * See
+   * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask].
+   * 
+ * + * .google.datastore.v1.PropertyMask property_mask = 10; + */ + com.google.datastore.v1.PropertyMaskOrBuilder getPropertyMaskOrBuilder(); + /** * * diff --git a/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/datastore.proto b/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/datastore.proto index fbbabb0a3..92b5038ea 100644 --- a/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/datastore.proto +++ b/proto-google-cloud-datastore-v1/src/main/proto/google/datastore/v1/datastore.proto @@ -173,6 +173,14 @@ message LookupRequest { // Required. Keys of entities to look up. repeated Key keys = 3 [(google.api.field_behavior) = REQUIRED]; + + // The properties to return. Defaults to returning all properties. + // + // If this field is set and an entity has a property not referenced in the + // mask, it will be absent from [LookupResponse.found.entity.properties][]. + // + // The entity's key is always returned. + PropertyMask property_mask = 5; } // The response for [Datastore.Lookup][google.datastore.v1.Datastore.Lookup]. @@ -234,6 +242,13 @@ message RunQueryRequest { GqlQuery gql_query = 7; } + // The properties to return. + // This field must not be set for a projection query. + // + // See + // [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask]. + PropertyMask property_mask = 10; + // Optional. Explain options for the query. If set, additional query // statistics will be returned. If not, only query results will be returned. ExplainOptions explain_options = 12 [(google.api.field_behavior) = OPTIONAL]; @@ -526,6 +541,16 @@ message Mutation { // mutation conflicts. google.protobuf.Timestamp update_time = 11; } + + // The properties to write in this mutation. + // None of the properties in the mask may have a reserved name, except for + // `__key__`. + // This field is ignored for `delete`. + // + // If the entity already exists, only properties referenced in the mask are + // updated, others are left untouched. + // Properties referenced in the mask but not in the entity are deleted. + PropertyMask property_mask = 9; } // The result of applying a mutation. @@ -555,6 +580,23 @@ message MutationResult { bool conflict_detected = 5; } +// The set of arbitrarily nested property paths used to restrict an operation to +// only a subset of properties in an entity. +message PropertyMask { + // The paths to the properties covered by this mask. + // + // A path is a list of property names separated by dots (`.`), for example + // `foo.bar` means the property `bar` inside the entity property `foo` inside + // the entity associated with this path. + // + // If a property name contains a dot `.` or a backslash `\`, then that + // name must be escaped. + // + // A path must not be empty, and may not reference a value inside an + // [array value][google.datastore.v1.Value.array_value]. + repeated string paths = 1; +} + // The options shared by read requests. message ReadOptions { // The possible values for read consistencies. From 7de5e2d58cd906101289923f7795705708f78e93 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Thu, 20 Jun 2024 21:33:27 +0000 Subject: [PATCH 11/17] sync config structure with that of google-cloud-java --- generation_config.yaml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/generation_config.yaml b/generation_config.yaml index b59837cb3..db350680a 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,16 +1,6 @@ gapic_generator_version: 2.41.0 -protoc_version: '25.3' googleapis_commitish: bcaed39fd1a805a6411a3992ea32dc1ba0ba7ec3 libraries_bom_version: 26.38.0 -template_excludes: - - .kokoro/presubmit/integration.cfg - - .kokoro/presubmit/graalvm-native.cfg - - .kokoro/presubmit/graalvm-native-17.cfg - - .kokoro/nightly/integration.cfg - - .kokoro/nightly/java11-integration.cfg - - .kokoro/requirements.in - - .kokoro/requirements.txt - - .github/dependabot.yml libraries: - api_shortname: "datastore" name_pretty: "Cloud Datastore" From a27887e695a77e843a605cfa7a60d3901891c789 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Tue, 25 Jun 2024 18:54:21 +0000 Subject: [PATCH 12/17] remove quotes from config yamls --- generation_config.yaml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/generation_config.yaml b/generation_config.yaml index db350680a..bcb1de100 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -2,24 +2,24 @@ gapic_generator_version: 2.41.0 googleapis_commitish: bcaed39fd1a805a6411a3992ea32dc1ba0ba7ec3 libraries_bom_version: 26.38.0 libraries: - - api_shortname: "datastore" - name_pretty: "Cloud Datastore" - product_documentation: "https://cloud.google.com/datastore" - client_documentation: "https://cloud.google.com/java/docs/reference/google-cloud-datastore/latest/history" - issue_tracker: "https://issuetracker.google.com/savedsearches/559768" - release_level: "stable" - language: "java" - repo: "googleapis/java-datastore" - repo_short: "java-datastore" - distribution_name: "com.google.cloud:google-cloud-datastore" - codeowner_team: "@googleapis/cloud-native-db-dpes @googleapis/api-datastore-sdk @googleapis/api-firestore-partners" - api_id: "datastore.googleapis.com" - library_type: "GAPIC_COMBO" - api_description: "is a fully managed, schemaless database for\nstoring non-relational data. Cloud Datastore automatically scales with\nyour users and supports ACID transactions, high availability of reads and\nwrites, strong consistency for reads and ancestor queries, and eventual\nconsistency for all other queries." - excluded_dependencies: "grpc-google-cloud-datastore-v1" - extra_versioned_modules: "datastore-v1-proto-client" - excluded_poms: "grpc-google-cloud-datastore-v1" - recommended_package: "com.google.cloud.datastore" + - api_shortname: datastore + name_pretty: Cloud Datastore + product_documentation: https://cloud.google.com/datastore + client_documentation: https://cloud.google.com/java/docs/reference/google-cloud-datastore/latest/history + issue_tracker: https://issuetracker.google.com/savedsearches/559768 + release_level: stable + language: java + repo: googleapis/java-datastore + repo_short: java-datastore + distribution_name: com.google.cloud:google-cloud-datastore + codeowner_team: @googleapis/cloud-native-db-dpes @googleapis/api-datastore-sdk @googleapis/api-firestore-partners + api_id: datastore.googleapis.com + library_type: GAPIC_COMBO + api_description: is a fully managed, schemaless database for\nstoring non-relational data. Cloud Datastore automatically scales with\nyour users and supports ACID transactions, high availability of reads and\nwrites, strong consistency for reads and ancestor queries, and eventual\nconsistency for all other queries. + excluded_dependencies: grpc-google-cloud-datastore-v1 + extra_versioned_modules: datastore-v1-proto-client + excluded_poms: grpc-google-cloud-datastore-v1 + recommended_package: com.google.cloud.datastore GAPICs: - proto_path: google/datastore/v1 - proto_path: google/datastore/admin/v1 From 592de52b7c3c0253b8aaf4213bb08798363461f6 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Tue, 25 Jun 2024 20:20:07 +0000 Subject: [PATCH 13/17] fix typo in update_generation_config.yaml --- .github/workflows/update_generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_generation_config.yaml b/.github/workflows/update_generation_config.yaml index 70b513312..3cf773992 100644 --- a/.github/workflows/update_generation_config.yaml +++ b/.github/workflows/update_generation_config.yaml @@ -35,7 +35,7 @@ jobs: set -x [ -z "$(git config user.email)" ] && git config --global user.email "cloud-java-bot@google.com" [ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot" - bash .github/scripts/update_generation_config.sh.sh \ + bash .github/scripts/update_generation_config.sh \ --base_branch "${base_branch}"\ --repo ${{ github.repository }} env: From 6eb8546bdb7fcec1e8af84dd5dda9e1ac340bd16 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Tue, 25 Jun 2024 20:26:03 +0000 Subject: [PATCH 14/17] correct --- .github/workflows/hermetic_library_generation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/hermetic_library_generation.yaml b/.github/workflows/hermetic_library_generation.yaml index 23385a1be..0c7a82a3c 100644 --- a/.github/workflows/hermetic_library_generation.yaml +++ b/.github/workflows/hermetic_library_generation.yaml @@ -31,7 +31,7 @@ jobs: set -x [ -z "$(git config user.email)" ] && git config --global user.email "cloud-java-bot@google.com" [ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot" - bash generation/hermetic_library_generation.sh \ + bash .github/scriptes/hermetic_library_generation.sh \ --target_branch ${{ github.base_ref }} \ --current_branch ${{ github.head_ref }} env: From 88bf419fb0fdc6d508ab2ecc023824f2d814127d Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 26 Jun 2024 20:47:12 +0000 Subject: [PATCH 15/17] quote codeowners_team in generation config --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index bcb1de100..13f528d79 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -12,7 +12,7 @@ libraries: repo: googleapis/java-datastore repo_short: java-datastore distribution_name: com.google.cloud:google-cloud-datastore - codeowner_team: @googleapis/cloud-native-db-dpes @googleapis/api-datastore-sdk @googleapis/api-firestore-partners + codeowner_team: '@googleapis/cloud-native-db-dpes @googleapis/api-datastore-sdk @googleapis/api-firestore-partners' api_id: datastore.googleapis.com library_type: GAPIC_COMBO api_description: is a fully managed, schemaless database for\nstoring non-relational data. Cloud Datastore automatically scales with\nyour users and supports ACID transactions, high availability of reads and\nwrites, strong consistency for reads and ancestor queries, and eventual\nconsistency for all other queries. From ce3acc20e26ffefc9891ef90dc3f3aefaf750396 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 26 Jun 2024 20:49:55 +0000 Subject: [PATCH 16/17] update generator version --- generation_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generation_config.yaml b/generation_config.yaml index 13f528d79..ae6c9c9be 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,4 +1,4 @@ -gapic_generator_version: 2.41.0 +gapic_generator_version: 2.42.0 googleapis_commitish: bcaed39fd1a805a6411a3992ea32dc1ba0ba7ec3 libraries_bom_version: 26.38.0 libraries: From 220885e5e59b9c9344310e0f55a6894f1e42239b Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 28 Jun 2024 18:54:45 +0000 Subject: [PATCH 17/17] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4520f2779..1276fd82a 100644 --- a/README.md +++ b/README.md @@ -50,20 +50,20 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.40.0') +implementation platform('com.google.cloud:libraries-bom:26.42.0') implementation 'com.google.cloud:google-cloud-datastore' ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-datastore:2.20.0' +implementation 'com.google.cloud:google-cloud-datastore:2.20.1' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-datastore" % "2.20.0" +libraryDependencies += "com.google.cloud" % "google-cloud-datastore" % "2.20.1" ``` @@ -384,7 +384,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/java-datastore/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-datastore.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-datastore/2.20.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-datastore/2.20.1 [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