maybe_document.proto 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Copyright 2018 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 firestore.client;
  16. option java_multiple_files = true;
  17. option java_package = "com.google.firebase.firestore.proto";
  18. option objc_class_prefix = "FSTPB";
  19. import "google/firestore/v1/document.proto";
  20. import "google/protobuf/timestamp.proto";
  21. // A message indicating that the document is known to not exist.
  22. message NoDocument {
  23. // The name of the document that does not exist, in the standard format:
  24. // `projects/{project_id}/databases/{database_id}/documents/{document_path}`
  25. string name = 1;
  26. // The time at which we observed that it does not exist.
  27. google.protobuf.Timestamp read_time = 2;
  28. }
  29. // A message indicating that the document that is known to exist but its data
  30. // is unknown.
  31. message UnknownDocument {
  32. // The name of the document that is known to exist, in the standard format:
  33. // `projects/{project_id}/databases/{database_id}/documents/{document_path}`
  34. string name = 1;
  35. // The version at which we know the document exists.
  36. google.protobuf.Timestamp version = 2;
  37. }
  38. // Represents either an existing document, the explicitly known absence of a
  39. // document, or a document that is known to exist (at some version) but whose
  40. // contents are unknown.
  41. message MaybeDocument {
  42. oneof document_type {
  43. // Used if the document is known to not exist.
  44. NoDocument no_document = 1;
  45. // The document (if it exists).
  46. google.firestore.v1.Document document = 2;
  47. // Used if the document is known to exist but its data is unknown.
  48. UnknownDocument unknown_document = 3;
  49. }
  50. // `has_committed_mutations` marks documents that were written to the remote
  51. // document store based on a write acknowledgment. These documents are
  52. // potentially inconsistent with the backend's copy and use the write's
  53. // commit version as their document version.
  54. bool has_committed_mutations = 4;
  55. }