1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
// This file is @generated by prost-build.
/// Encodes a query saved in the bundle.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BundledQuery {
    /// The parent resource name.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    #[prost(enumeration = "bundled_query::LimitType", tag = "3")]
    pub limit_type: i32,
    /// The query to run.
    #[prost(oneof = "bundled_query::QueryType", tags = "2")]
    pub query_type: ::core::option::Option<bundled_query::QueryType>,
}
/// Nested message and enum types in `BundledQuery`.
pub mod bundled_query {
    /// If the query is a limit query, should the limit be applied to the beginning or
    /// the end of results.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum LimitType {
        First = 0,
        Last = 1,
    }
    impl LimitType {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                LimitType::First => "FIRST",
                LimitType::Last => "LAST",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "FIRST" => Some(Self::First),
                "LAST" => Some(Self::Last),
                _ => None,
            }
        }
    }
    /// The query to run.
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum QueryType {
        /// A structured query.
        #[prost(message, tag = "2")]
        StructuredQuery(super::super::v1::StructuredQuery),
    }
}
/// A Query associated with a name, created as part of the bundle file, and can be read
/// by client SDKs once the bundle containing them is loaded.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NamedQuery {
    /// Name of the query, such that client can use the name to load this query
    /// from bundle, and resume from when the query results are materialized
    /// into this bundle.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// The query saved in the bundle.
    #[prost(message, optional, tag = "2")]
    pub bundled_query: ::core::option::Option<BundledQuery>,
    /// The read time of the query, when it is used to build the bundle. This is useful to
    /// resume the query from the bundle, once it is loaded by client SDKs.
    #[prost(message, optional, tag = "3")]
    pub read_time: ::core::option::Option<::prost_types::Timestamp>,
}
/// Metadata describing a Firestore document saved in the bundle.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BundledDocumentMetadata {
    /// The document key of a bundled document.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// The snapshot version of the document data bundled.
    #[prost(message, optional, tag = "2")]
    pub read_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Whether the document exists.
    #[prost(bool, tag = "3")]
    pub exists: bool,
    /// The names of the queries in this bundle that this document matches to.
    #[prost(string, repeated, tag = "4")]
    pub queries: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Metadata describing the bundle file/stream.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BundleMetadata {
    /// The ID of the bundle.
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    /// Time at which the documents snapshot is taken for this bundle.
    #[prost(message, optional, tag = "2")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The schema version of the bundle.
    #[prost(uint32, tag = "3")]
    pub version: u32,
    /// The number of documents in the bundle.
    #[prost(uint32, tag = "4")]
    pub total_documents: u32,
    /// The size of the bundle in bytes, excluding this `BundleMetadata`.
    #[prost(uint64, tag = "5")]
    pub total_bytes: u64,
}
/// A Firestore bundle is a length-prefixed stream of JSON representations of
/// `BundleElement`.
/// Only one `BundleMetadata` is expected, and it should be the first element.
/// The named queries follow after `metadata`. Every `document_metadata` is
/// immediately followed by a `document`.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BundleElement {
    #[prost(oneof = "bundle_element::ElementType", tags = "1, 2, 3, 4")]
    pub element_type: ::core::option::Option<bundle_element::ElementType>,
}
/// Nested message and enum types in `BundleElement`.
pub mod bundle_element {
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum ElementType {
        #[prost(message, tag = "1")]
        Metadata(super::BundleMetadata),
        #[prost(message, tag = "2")]
        NamedQuery(super::NamedQuery),
        #[prost(message, tag = "3")]
        DocumentMetadata(super::BundledDocumentMetadata),
        #[prost(message, tag = "4")]
        Document(super::super::v1::Document),
    }
}