diff --git a/.repo-metadata.json b/.repo-metadata.json index e6ebd09de..a80b45d8a 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -2,19 +2,20 @@ "api_shortname": "datastore", "name_pretty": "Cloud Datastore", "product_documentation": "https://cloud.google.com/datastore", + "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.", "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", + "transport": "both", "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.", + "requires_billing": true, + "codeowner_team": "@googleapis/cloud-native-db-dpes @googleapis/api-datastore-sdk @googleapis/api-firestore-partners", "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" -} + "issue_tracker": "https://issuetracker.google.com/savedsearches/559768", + "extra_versioned_modules": "datastore-v1-proto-client" +} \ No newline at end of file diff --git a/README.md b/README.md index 0a6931db2..383f8d516 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.39.0') +implementation platform('com.google.cloud:libraries-bom:26.40.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.19.3' +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.19.3" +libraryDependencies += "com.google.cloud" % "google-cloud-datastore" % "2.20.1" ``` @@ -80,7 +80,7 @@ The client application making API calls must be granted [authorization scopes][a ### Prerequisites You will need a [Google Cloud Platform Console][developer-console] project with the Cloud Datastore [API enabled][enable-api]. - +You will need to [enable billing][enable-billing] to use Google Cloud Datastore. [Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. @@ -292,6 +292,10 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-datastore/tre To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. +## Transport + +Cloud Datastore uses both gRPC and HTTP/JSON for the transport layer. + ## Supported Java Versions Java 8 or above is required for using this client. @@ -384,7 +388,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.19.3 +[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 @@ -396,7 +400,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [contributing]: https://github.com/googleapis/java-datastore/blob/main/CONTRIBUTING.md [code-of-conduct]: https://github.com/googleapis/java-datastore/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct [license]: https://github.com/googleapis/java-datastore/blob/main/LICENSE - +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing [enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=datastore.googleapis.com [libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png diff --git a/generation_config.yaml b/generation_config.yaml index b59837cb3..65b24e74d 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: bcaed39fd1a805a6411a3992ea32dc1ba0ba7ec3 +googleapis_commitish: 573205a81b9b96ea6d4e0365373839b59f4b427e 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/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. diff --git a/renovate.json b/renovate.json index 7b2939806..046589f23 100644 --- a/renovate.json +++ b/renovate.json @@ -20,7 +20,7 @@ "customManagers": [ { "customType": "regex", - "fileMatch": [ + "fileMatch": [ "^.kokoro/presubmit/graalvm-native.*.cfg$" ], "matchStrings": ["value: \"gcr.io/cloud-devrel-public-resources/graalvm.*:(?.*?)\""], @@ -30,7 +30,7 @@ { "customType": "regex", "fileMatch": [ - "^.github/workflows/unmanaged_dependency_check.yaml$" + "^.github/workflows/unmanaged_dependency_check.yaml$" ], "matchStrings": ["uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v(?.+?)\\n"], "depNameTemplate": "com.google.cloud:sdk-platform-java-config",