common.proto 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.firestore.v1beta1;
  16. import "google/protobuf/timestamp.proto";
  17. option csharp_namespace = "Google.Cloud.Firestore.V1Beta1";
  18. option go_package = "google.golang.org/genproto/googleapis/firestore/v1beta1;firestore";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "CommonProto";
  21. option java_package = "com.google.firestore.v1beta1";
  22. option objc_class_prefix = "GCFS";
  23. option php_namespace = "Google\\Cloud\\Firestore\\V1beta1";
  24. option ruby_package = "Google::Cloud::Firestore::V1beta1";
  25. // A set of field paths on a document.
  26. // Used to restrict a get or update operation on a document to a subset of its
  27. // fields.
  28. // This is different from standard field masks, as this is always scoped to a
  29. // [Document][google.firestore.v1beta1.Document], and takes in account the dynamic nature of [Value][google.firestore.v1beta1.Value].
  30. message DocumentMask {
  31. // The list of field paths in the mask. See [Document.fields][google.firestore.v1beta1.Document.fields] for a field
  32. // path syntax reference.
  33. repeated string field_paths = 1;
  34. }
  35. // A precondition on a document, used for conditional operations.
  36. message Precondition {
  37. // The type of precondition.
  38. oneof condition_type {
  39. // When set to `true`, the target document must exist.
  40. // When set to `false`, the target document must not exist.
  41. bool exists = 1;
  42. // When set, the target document must exist and have been last updated at
  43. // that time.
  44. google.protobuf.Timestamp update_time = 2;
  45. }
  46. }
  47. // Options for creating a new transaction.
  48. message TransactionOptions {
  49. // Options for a transaction that can be used to read and write documents.
  50. message ReadWrite {
  51. // An optional transaction to retry.
  52. bytes retry_transaction = 1;
  53. }
  54. // Options for a transaction that can only be used to read documents.
  55. message ReadOnly {
  56. // The consistency mode for this transaction. If not set, defaults to strong
  57. // consistency.
  58. oneof consistency_selector {
  59. // Reads documents at the given time.
  60. // This may not be older than 60 seconds.
  61. google.protobuf.Timestamp read_time = 2;
  62. }
  63. }
  64. // The mode of the transaction.
  65. oneof mode {
  66. // The transaction can only be used for read operations.
  67. ReadOnly read_only = 2;
  68. // The transaction can be used for both read and write operations.
  69. ReadWrite read_write = 3;
  70. }
  71. }