google_cloud_firestore_admin_v1/model.rs
1// Copyright 2025 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// https://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//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_longrunning;
25extern crate google_cloud_lro;
26extern crate google_cloud_type;
27extern crate lazy_static;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// A Backup of a Cloud Firestore Database.
40///
41/// The backup contains all documents and index configurations for the given
42/// database at a specific point in time.
43#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct Backup {
46 /// Output only. The unique resource name of the Backup.
47 ///
48 /// Format is `projects/{project}/locations/{location}/backups/{backup}`.
49 pub name: std::string::String,
50
51 /// Output only. Name of the Firestore database that the backup is from.
52 ///
53 /// Format is `projects/{project}/databases/{database}`.
54 pub database: std::string::String,
55
56 /// Output only. The system-generated UUID4 for the Firestore database that the
57 /// backup is from.
58 pub database_uid: std::string::String,
59
60 /// Output only. The backup contains an externally consistent copy of the
61 /// database at this time.
62 pub snapshot_time: std::option::Option<wkt::Timestamp>,
63
64 /// Output only. The timestamp at which this backup expires.
65 pub expire_time: std::option::Option<wkt::Timestamp>,
66
67 /// Output only. Statistics about the backup.
68 ///
69 /// This data only becomes available after the backup is fully materialized to
70 /// secondary storage. This field will be empty till then.
71 pub stats: std::option::Option<crate::model::backup::Stats>,
72
73 /// Output only. The current state of the backup.
74 pub state: crate::model::backup::State,
75
76 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
77}
78
79impl Backup {
80 pub fn new() -> Self {
81 std::default::Default::default()
82 }
83
84 /// Sets the value of [name][crate::model::Backup::name].
85 ///
86 /// # Example
87 /// ```ignore,no_run
88 /// # use google_cloud_firestore_admin_v1::model::Backup;
89 /// let x = Backup::new().set_name("example");
90 /// ```
91 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
92 self.name = v.into();
93 self
94 }
95
96 /// Sets the value of [database][crate::model::Backup::database].
97 ///
98 /// # Example
99 /// ```ignore,no_run
100 /// # use google_cloud_firestore_admin_v1::model::Backup;
101 /// let x = Backup::new().set_database("example");
102 /// ```
103 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
104 self.database = v.into();
105 self
106 }
107
108 /// Sets the value of [database_uid][crate::model::Backup::database_uid].
109 ///
110 /// # Example
111 /// ```ignore,no_run
112 /// # use google_cloud_firestore_admin_v1::model::Backup;
113 /// let x = Backup::new().set_database_uid("example");
114 /// ```
115 pub fn set_database_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
116 self.database_uid = v.into();
117 self
118 }
119
120 /// Sets the value of [snapshot_time][crate::model::Backup::snapshot_time].
121 ///
122 /// # Example
123 /// ```ignore,no_run
124 /// # use google_cloud_firestore_admin_v1::model::Backup;
125 /// use wkt::Timestamp;
126 /// let x = Backup::new().set_snapshot_time(Timestamp::default()/* use setters */);
127 /// ```
128 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
129 where
130 T: std::convert::Into<wkt::Timestamp>,
131 {
132 self.snapshot_time = std::option::Option::Some(v.into());
133 self
134 }
135
136 /// Sets or clears the value of [snapshot_time][crate::model::Backup::snapshot_time].
137 ///
138 /// # Example
139 /// ```ignore,no_run
140 /// # use google_cloud_firestore_admin_v1::model::Backup;
141 /// use wkt::Timestamp;
142 /// let x = Backup::new().set_or_clear_snapshot_time(Some(Timestamp::default()/* use setters */));
143 /// let x = Backup::new().set_or_clear_snapshot_time(None::<Timestamp>);
144 /// ```
145 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
146 where
147 T: std::convert::Into<wkt::Timestamp>,
148 {
149 self.snapshot_time = v.map(|x| x.into());
150 self
151 }
152
153 /// Sets the value of [expire_time][crate::model::Backup::expire_time].
154 ///
155 /// # Example
156 /// ```ignore,no_run
157 /// # use google_cloud_firestore_admin_v1::model::Backup;
158 /// use wkt::Timestamp;
159 /// let x = Backup::new().set_expire_time(Timestamp::default()/* use setters */);
160 /// ```
161 pub fn set_expire_time<T>(mut self, v: T) -> Self
162 where
163 T: std::convert::Into<wkt::Timestamp>,
164 {
165 self.expire_time = std::option::Option::Some(v.into());
166 self
167 }
168
169 /// Sets or clears the value of [expire_time][crate::model::Backup::expire_time].
170 ///
171 /// # Example
172 /// ```ignore,no_run
173 /// # use google_cloud_firestore_admin_v1::model::Backup;
174 /// use wkt::Timestamp;
175 /// let x = Backup::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
176 /// let x = Backup::new().set_or_clear_expire_time(None::<Timestamp>);
177 /// ```
178 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
179 where
180 T: std::convert::Into<wkt::Timestamp>,
181 {
182 self.expire_time = v.map(|x| x.into());
183 self
184 }
185
186 /// Sets the value of [stats][crate::model::Backup::stats].
187 ///
188 /// # Example
189 /// ```ignore,no_run
190 /// # use google_cloud_firestore_admin_v1::model::Backup;
191 /// use google_cloud_firestore_admin_v1::model::backup::Stats;
192 /// let x = Backup::new().set_stats(Stats::default()/* use setters */);
193 /// ```
194 pub fn set_stats<T>(mut self, v: T) -> Self
195 where
196 T: std::convert::Into<crate::model::backup::Stats>,
197 {
198 self.stats = std::option::Option::Some(v.into());
199 self
200 }
201
202 /// Sets or clears the value of [stats][crate::model::Backup::stats].
203 ///
204 /// # Example
205 /// ```ignore,no_run
206 /// # use google_cloud_firestore_admin_v1::model::Backup;
207 /// use google_cloud_firestore_admin_v1::model::backup::Stats;
208 /// let x = Backup::new().set_or_clear_stats(Some(Stats::default()/* use setters */));
209 /// let x = Backup::new().set_or_clear_stats(None::<Stats>);
210 /// ```
211 pub fn set_or_clear_stats<T>(mut self, v: std::option::Option<T>) -> Self
212 where
213 T: std::convert::Into<crate::model::backup::Stats>,
214 {
215 self.stats = v.map(|x| x.into());
216 self
217 }
218
219 /// Sets the value of [state][crate::model::Backup::state].
220 ///
221 /// # Example
222 /// ```ignore,no_run
223 /// # use google_cloud_firestore_admin_v1::model::Backup;
224 /// use google_cloud_firestore_admin_v1::model::backup::State;
225 /// let x0 = Backup::new().set_state(State::Creating);
226 /// let x1 = Backup::new().set_state(State::Ready);
227 /// let x2 = Backup::new().set_state(State::NotAvailable);
228 /// ```
229 pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
230 self.state = v.into();
231 self
232 }
233}
234
235impl wkt::message::Message for Backup {
236 fn typename() -> &'static str {
237 "type.googleapis.com/google.firestore.admin.v1.Backup"
238 }
239}
240
241/// Defines additional types related to [Backup].
242pub mod backup {
243 #[allow(unused_imports)]
244 use super::*;
245
246 /// Backup specific statistics.
247 #[derive(Clone, Default, PartialEq)]
248 #[non_exhaustive]
249 pub struct Stats {
250 /// Output only. Summation of the size of all documents and index entries in
251 /// the backup, measured in bytes.
252 pub size_bytes: i64,
253
254 /// Output only. The total number of documents contained in the backup.
255 pub document_count: i64,
256
257 /// Output only. The total number of index entries contained in the backup.
258 pub index_count: i64,
259
260 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
261 }
262
263 impl Stats {
264 pub fn new() -> Self {
265 std::default::Default::default()
266 }
267
268 /// Sets the value of [size_bytes][crate::model::backup::Stats::size_bytes].
269 ///
270 /// # Example
271 /// ```ignore,no_run
272 /// # use google_cloud_firestore_admin_v1::model::backup::Stats;
273 /// let x = Stats::new().set_size_bytes(42);
274 /// ```
275 pub fn set_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
276 self.size_bytes = v.into();
277 self
278 }
279
280 /// Sets the value of [document_count][crate::model::backup::Stats::document_count].
281 ///
282 /// # Example
283 /// ```ignore,no_run
284 /// # use google_cloud_firestore_admin_v1::model::backup::Stats;
285 /// let x = Stats::new().set_document_count(42);
286 /// ```
287 pub fn set_document_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
288 self.document_count = v.into();
289 self
290 }
291
292 /// Sets the value of [index_count][crate::model::backup::Stats::index_count].
293 ///
294 /// # Example
295 /// ```ignore,no_run
296 /// # use google_cloud_firestore_admin_v1::model::backup::Stats;
297 /// let x = Stats::new().set_index_count(42);
298 /// ```
299 pub fn set_index_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
300 self.index_count = v.into();
301 self
302 }
303 }
304
305 impl wkt::message::Message for Stats {
306 fn typename() -> &'static str {
307 "type.googleapis.com/google.firestore.admin.v1.Backup.Stats"
308 }
309 }
310
311 /// Indicate the current state of the backup.
312 ///
313 /// # Working with unknown values
314 ///
315 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
316 /// additional enum variants at any time. Adding new variants is not considered
317 /// a breaking change. Applications should write their code in anticipation of:
318 ///
319 /// - New values appearing in future releases of the client library, **and**
320 /// - New values received dynamically, without application changes.
321 ///
322 /// Please consult the [Working with enums] section in the user guide for some
323 /// guidelines.
324 ///
325 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
326 #[derive(Clone, Debug, PartialEq)]
327 #[non_exhaustive]
328 pub enum State {
329 /// The state is unspecified.
330 Unspecified,
331 /// The pending backup is still being created. Operations on the
332 /// backup will be rejected in this state.
333 Creating,
334 /// The backup is complete and ready to use.
335 Ready,
336 /// The backup is not available at this moment.
337 NotAvailable,
338 /// If set, the enum was initialized with an unknown value.
339 ///
340 /// Applications can examine the value using [State::value] or
341 /// [State::name].
342 UnknownValue(state::UnknownValue),
343 }
344
345 #[doc(hidden)]
346 pub mod state {
347 #[allow(unused_imports)]
348 use super::*;
349 #[derive(Clone, Debug, PartialEq)]
350 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
351 }
352
353 impl State {
354 /// Gets the enum value.
355 ///
356 /// Returns `None` if the enum contains an unknown value deserialized from
357 /// the string representation of enums.
358 pub fn value(&self) -> std::option::Option<i32> {
359 match self {
360 Self::Unspecified => std::option::Option::Some(0),
361 Self::Creating => std::option::Option::Some(1),
362 Self::Ready => std::option::Option::Some(2),
363 Self::NotAvailable => std::option::Option::Some(3),
364 Self::UnknownValue(u) => u.0.value(),
365 }
366 }
367
368 /// Gets the enum value as a string.
369 ///
370 /// Returns `None` if the enum contains an unknown value deserialized from
371 /// the integer representation of enums.
372 pub fn name(&self) -> std::option::Option<&str> {
373 match self {
374 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
375 Self::Creating => std::option::Option::Some("CREATING"),
376 Self::Ready => std::option::Option::Some("READY"),
377 Self::NotAvailable => std::option::Option::Some("NOT_AVAILABLE"),
378 Self::UnknownValue(u) => u.0.name(),
379 }
380 }
381 }
382
383 impl std::default::Default for State {
384 fn default() -> Self {
385 use std::convert::From;
386 Self::from(0)
387 }
388 }
389
390 impl std::fmt::Display for State {
391 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
392 wkt::internal::display_enum(f, self.name(), self.value())
393 }
394 }
395
396 impl std::convert::From<i32> for State {
397 fn from(value: i32) -> Self {
398 match value {
399 0 => Self::Unspecified,
400 1 => Self::Creating,
401 2 => Self::Ready,
402 3 => Self::NotAvailable,
403 _ => Self::UnknownValue(state::UnknownValue(
404 wkt::internal::UnknownEnumValue::Integer(value),
405 )),
406 }
407 }
408 }
409
410 impl std::convert::From<&str> for State {
411 fn from(value: &str) -> Self {
412 use std::string::ToString;
413 match value {
414 "STATE_UNSPECIFIED" => Self::Unspecified,
415 "CREATING" => Self::Creating,
416 "READY" => Self::Ready,
417 "NOT_AVAILABLE" => Self::NotAvailable,
418 _ => Self::UnknownValue(state::UnknownValue(
419 wkt::internal::UnknownEnumValue::String(value.to_string()),
420 )),
421 }
422 }
423 }
424
425 impl serde::ser::Serialize for State {
426 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
427 where
428 S: serde::Serializer,
429 {
430 match self {
431 Self::Unspecified => serializer.serialize_i32(0),
432 Self::Creating => serializer.serialize_i32(1),
433 Self::Ready => serializer.serialize_i32(2),
434 Self::NotAvailable => serializer.serialize_i32(3),
435 Self::UnknownValue(u) => u.0.serialize(serializer),
436 }
437 }
438 }
439
440 impl<'de> serde::de::Deserialize<'de> for State {
441 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
442 where
443 D: serde::Deserializer<'de>,
444 {
445 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
446 ".google.firestore.admin.v1.Backup.State",
447 ))
448 }
449 }
450}
451
452/// A Cloud Firestore Database.
453#[derive(Clone, Default, PartialEq)]
454#[non_exhaustive]
455pub struct Database {
456 /// The resource name of the Database.
457 /// Format: `projects/{project}/databases/{database}`
458 pub name: std::string::String,
459
460 /// Output only. The system-generated UUID4 for this Database.
461 pub uid: std::string::String,
462
463 /// Output only. The timestamp at which this database was created. Databases
464 /// created before 2016 do not populate create_time.
465 pub create_time: std::option::Option<wkt::Timestamp>,
466
467 /// Output only. The timestamp at which this database was most recently
468 /// updated. Note this only includes updates to the database resource and not
469 /// data contained by the database.
470 pub update_time: std::option::Option<wkt::Timestamp>,
471
472 /// Output only. The timestamp at which this database was deleted. Only set if
473 /// the database has been deleted.
474 pub delete_time: std::option::Option<wkt::Timestamp>,
475
476 /// The location of the database. Available locations are listed at
477 /// <https://cloud.google.com/firestore/docs/locations>.
478 pub location_id: std::string::String,
479
480 /// The type of the database.
481 /// See <https://cloud.google.com/datastore/docs/firestore-or-datastore> for
482 /// information about how to choose.
483 pub r#type: crate::model::database::DatabaseType,
484
485 /// The concurrency control mode to use for this database.
486 ///
487 /// If unspecified in a CreateDatabase request, this will default based on the
488 /// database edition: Optimistic for Enterprise and Pessimistic for all other
489 /// databases.
490 pub concurrency_mode: crate::model::database::ConcurrencyMode,
491
492 /// Output only. The period during which past versions of data are retained in
493 /// the database.
494 ///
495 /// Any [read][google.firestore.v1.GetDocumentRequest.read_time]
496 /// or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify
497 /// a `read_time` within this window, and will read the state of the database
498 /// at that time.
499 ///
500 /// If the PITR feature is enabled, the retention period is 7 days. Otherwise,
501 /// the retention period is 1 hour.
502 pub version_retention_period: std::option::Option<wkt::Duration>,
503
504 /// Output only. The earliest timestamp at which older versions of the data can
505 /// be read from the database. See [version_retention_period] above; this field
506 /// is populated with `now - version_retention_period`.
507 ///
508 /// This value is continuously updated, and becomes stale the moment it is
509 /// queried. If you are using this value to recover data, make sure to account
510 /// for the time from the moment when the value is queried to the moment when
511 /// you initiate the recovery.
512 pub earliest_version_time: std::option::Option<wkt::Timestamp>,
513
514 /// Whether to enable the PITR feature on this database.
515 pub point_in_time_recovery_enablement: crate::model::database::PointInTimeRecoveryEnablement,
516
517 /// The App Engine integration mode to use for this database.
518 pub app_engine_integration_mode: crate::model::database::AppEngineIntegrationMode,
519
520 /// Output only. The key_prefix for this database. This key_prefix is used, in
521 /// combination with the project ID ("\<key prefix\>~\<project id\>") to construct
522 /// the application ID that is returned from the Cloud Datastore APIs in Google
523 /// App Engine first generation runtimes.
524 ///
525 /// This value may be empty in which case the appid to use for URL-encoded keys
526 /// is the project_id (eg: foo instead of v~foo).
527 pub key_prefix: std::string::String,
528
529 /// State of delete protection for the database.
530 pub delete_protection_state: crate::model::database::DeleteProtectionState,
531
532 /// Optional. Presence indicates CMEK is enabled for this database.
533 pub cmek_config: std::option::Option<crate::model::database::CmekConfig>,
534
535 /// Output only. The database resource's prior database ID. This field is only
536 /// populated for deleted databases.
537 pub previous_id: std::string::String,
538
539 /// Output only. Information about the provenance of this database.
540 pub source_info: std::option::Option<crate::model::database::SourceInfo>,
541
542 /// Optional. Input only. Immutable. Tag keys/values directly bound to this
543 /// resource. For example:
544 /// "123/environment": "production",
545 /// "123/costCenter": "marketing"
546 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
547
548 /// Output only. Background: Free tier is the ability of a Firestore database
549 /// to use a small amount of resources every day without being charged. Once
550 /// usage exceeds the free tier limit further usage is charged.
551 ///
552 /// Whether this database can make use of the free tier. Only one database
553 /// per project can be eligible for the free tier.
554 ///
555 /// The first (or next) database that is created in a project without a free
556 /// tier database will be marked as eligible for the free tier. Databases that
557 /// are created while there is a free tier database will not be eligible for
558 /// the free tier.
559 pub free_tier: std::option::Option<bool>,
560
561 /// This checksum is computed by the server based on the value of other
562 /// fields, and may be sent on update and delete requests to ensure the
563 /// client has an up-to-date value before proceeding.
564 pub etag: std::string::String,
565
566 /// Immutable. The edition of the database.
567 pub database_edition: crate::model::database::DatabaseEdition,
568
569 /// Immutable. The default Realtime Updates mode to use for this database.
570 pub realtime_updates_mode: crate::model::RealtimeUpdatesMode,
571
572 /// Optional. The Firestore API data access mode to use for this database. If
573 /// not set on write:
574 ///
575 /// - the default value is DATA_ACCESS_MODE_DISABLED for Enterprise Edition.
576 /// - the default value is DATA_ACCESS_MODE_ENABLED for Standard Edition.
577 pub firestore_data_access_mode: crate::model::database::DataAccessMode,
578
579 /// Optional. The MongoDB compatible API data access mode to use for this
580 /// database. If not set on write, the default value is
581 /// DATA_ACCESS_MODE_ENABLED for Enterprise Edition. The value is always
582 /// DATA_ACCESS_MODE_DISABLED for Standard Edition.
583 pub mongodb_compatible_data_access_mode: crate::model::database::DataAccessMode,
584
585 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
586}
587
588impl Database {
589 pub fn new() -> Self {
590 std::default::Default::default()
591 }
592
593 /// Sets the value of [name][crate::model::Database::name].
594 ///
595 /// # Example
596 /// ```ignore,no_run
597 /// # use google_cloud_firestore_admin_v1::model::Database;
598 /// let x = Database::new().set_name("example");
599 /// ```
600 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
601 self.name = v.into();
602 self
603 }
604
605 /// Sets the value of [uid][crate::model::Database::uid].
606 ///
607 /// # Example
608 /// ```ignore,no_run
609 /// # use google_cloud_firestore_admin_v1::model::Database;
610 /// let x = Database::new().set_uid("example");
611 /// ```
612 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
613 self.uid = v.into();
614 self
615 }
616
617 /// Sets the value of [create_time][crate::model::Database::create_time].
618 ///
619 /// # Example
620 /// ```ignore,no_run
621 /// # use google_cloud_firestore_admin_v1::model::Database;
622 /// use wkt::Timestamp;
623 /// let x = Database::new().set_create_time(Timestamp::default()/* use setters */);
624 /// ```
625 pub fn set_create_time<T>(mut self, v: T) -> Self
626 where
627 T: std::convert::Into<wkt::Timestamp>,
628 {
629 self.create_time = std::option::Option::Some(v.into());
630 self
631 }
632
633 /// Sets or clears the value of [create_time][crate::model::Database::create_time].
634 ///
635 /// # Example
636 /// ```ignore,no_run
637 /// # use google_cloud_firestore_admin_v1::model::Database;
638 /// use wkt::Timestamp;
639 /// let x = Database::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
640 /// let x = Database::new().set_or_clear_create_time(None::<Timestamp>);
641 /// ```
642 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
643 where
644 T: std::convert::Into<wkt::Timestamp>,
645 {
646 self.create_time = v.map(|x| x.into());
647 self
648 }
649
650 /// Sets the value of [update_time][crate::model::Database::update_time].
651 ///
652 /// # Example
653 /// ```ignore,no_run
654 /// # use google_cloud_firestore_admin_v1::model::Database;
655 /// use wkt::Timestamp;
656 /// let x = Database::new().set_update_time(Timestamp::default()/* use setters */);
657 /// ```
658 pub fn set_update_time<T>(mut self, v: T) -> Self
659 where
660 T: std::convert::Into<wkt::Timestamp>,
661 {
662 self.update_time = std::option::Option::Some(v.into());
663 self
664 }
665
666 /// Sets or clears the value of [update_time][crate::model::Database::update_time].
667 ///
668 /// # Example
669 /// ```ignore,no_run
670 /// # use google_cloud_firestore_admin_v1::model::Database;
671 /// use wkt::Timestamp;
672 /// let x = Database::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
673 /// let x = Database::new().set_or_clear_update_time(None::<Timestamp>);
674 /// ```
675 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
676 where
677 T: std::convert::Into<wkt::Timestamp>,
678 {
679 self.update_time = v.map(|x| x.into());
680 self
681 }
682
683 /// Sets the value of [delete_time][crate::model::Database::delete_time].
684 ///
685 /// # Example
686 /// ```ignore,no_run
687 /// # use google_cloud_firestore_admin_v1::model::Database;
688 /// use wkt::Timestamp;
689 /// let x = Database::new().set_delete_time(Timestamp::default()/* use setters */);
690 /// ```
691 pub fn set_delete_time<T>(mut self, v: T) -> Self
692 where
693 T: std::convert::Into<wkt::Timestamp>,
694 {
695 self.delete_time = std::option::Option::Some(v.into());
696 self
697 }
698
699 /// Sets or clears the value of [delete_time][crate::model::Database::delete_time].
700 ///
701 /// # Example
702 /// ```ignore,no_run
703 /// # use google_cloud_firestore_admin_v1::model::Database;
704 /// use wkt::Timestamp;
705 /// let x = Database::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
706 /// let x = Database::new().set_or_clear_delete_time(None::<Timestamp>);
707 /// ```
708 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
709 where
710 T: std::convert::Into<wkt::Timestamp>,
711 {
712 self.delete_time = v.map(|x| x.into());
713 self
714 }
715
716 /// Sets the value of [location_id][crate::model::Database::location_id].
717 ///
718 /// # Example
719 /// ```ignore,no_run
720 /// # use google_cloud_firestore_admin_v1::model::Database;
721 /// let x = Database::new().set_location_id("example");
722 /// ```
723 pub fn set_location_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
724 self.location_id = v.into();
725 self
726 }
727
728 /// Sets the value of [r#type][crate::model::Database::type].
729 ///
730 /// # Example
731 /// ```ignore,no_run
732 /// # use google_cloud_firestore_admin_v1::model::Database;
733 /// use google_cloud_firestore_admin_v1::model::database::DatabaseType;
734 /// let x0 = Database::new().set_type(DatabaseType::FirestoreNative);
735 /// let x1 = Database::new().set_type(DatabaseType::DatastoreMode);
736 /// ```
737 pub fn set_type<T: std::convert::Into<crate::model::database::DatabaseType>>(
738 mut self,
739 v: T,
740 ) -> Self {
741 self.r#type = v.into();
742 self
743 }
744
745 /// Sets the value of [concurrency_mode][crate::model::Database::concurrency_mode].
746 ///
747 /// # Example
748 /// ```ignore,no_run
749 /// # use google_cloud_firestore_admin_v1::model::Database;
750 /// use google_cloud_firestore_admin_v1::model::database::ConcurrencyMode;
751 /// let x0 = Database::new().set_concurrency_mode(ConcurrencyMode::Optimistic);
752 /// let x1 = Database::new().set_concurrency_mode(ConcurrencyMode::Pessimistic);
753 /// let x2 = Database::new().set_concurrency_mode(ConcurrencyMode::OptimisticWithEntityGroups);
754 /// ```
755 pub fn set_concurrency_mode<T: std::convert::Into<crate::model::database::ConcurrencyMode>>(
756 mut self,
757 v: T,
758 ) -> Self {
759 self.concurrency_mode = v.into();
760 self
761 }
762
763 /// Sets the value of [version_retention_period][crate::model::Database::version_retention_period].
764 ///
765 /// # Example
766 /// ```ignore,no_run
767 /// # use google_cloud_firestore_admin_v1::model::Database;
768 /// use wkt::Duration;
769 /// let x = Database::new().set_version_retention_period(Duration::default()/* use setters */);
770 /// ```
771 pub fn set_version_retention_period<T>(mut self, v: T) -> Self
772 where
773 T: std::convert::Into<wkt::Duration>,
774 {
775 self.version_retention_period = std::option::Option::Some(v.into());
776 self
777 }
778
779 /// Sets or clears the value of [version_retention_period][crate::model::Database::version_retention_period].
780 ///
781 /// # Example
782 /// ```ignore,no_run
783 /// # use google_cloud_firestore_admin_v1::model::Database;
784 /// use wkt::Duration;
785 /// let x = Database::new().set_or_clear_version_retention_period(Some(Duration::default()/* use setters */));
786 /// let x = Database::new().set_or_clear_version_retention_period(None::<Duration>);
787 /// ```
788 pub fn set_or_clear_version_retention_period<T>(mut self, v: std::option::Option<T>) -> Self
789 where
790 T: std::convert::Into<wkt::Duration>,
791 {
792 self.version_retention_period = v.map(|x| x.into());
793 self
794 }
795
796 /// Sets the value of [earliest_version_time][crate::model::Database::earliest_version_time].
797 ///
798 /// # Example
799 /// ```ignore,no_run
800 /// # use google_cloud_firestore_admin_v1::model::Database;
801 /// use wkt::Timestamp;
802 /// let x = Database::new().set_earliest_version_time(Timestamp::default()/* use setters */);
803 /// ```
804 pub fn set_earliest_version_time<T>(mut self, v: T) -> Self
805 where
806 T: std::convert::Into<wkt::Timestamp>,
807 {
808 self.earliest_version_time = std::option::Option::Some(v.into());
809 self
810 }
811
812 /// Sets or clears the value of [earliest_version_time][crate::model::Database::earliest_version_time].
813 ///
814 /// # Example
815 /// ```ignore,no_run
816 /// # use google_cloud_firestore_admin_v1::model::Database;
817 /// use wkt::Timestamp;
818 /// let x = Database::new().set_or_clear_earliest_version_time(Some(Timestamp::default()/* use setters */));
819 /// let x = Database::new().set_or_clear_earliest_version_time(None::<Timestamp>);
820 /// ```
821 pub fn set_or_clear_earliest_version_time<T>(mut self, v: std::option::Option<T>) -> Self
822 where
823 T: std::convert::Into<wkt::Timestamp>,
824 {
825 self.earliest_version_time = v.map(|x| x.into());
826 self
827 }
828
829 /// Sets the value of [point_in_time_recovery_enablement][crate::model::Database::point_in_time_recovery_enablement].
830 ///
831 /// # Example
832 /// ```ignore,no_run
833 /// # use google_cloud_firestore_admin_v1::model::Database;
834 /// use google_cloud_firestore_admin_v1::model::database::PointInTimeRecoveryEnablement;
835 /// let x0 = Database::new().set_point_in_time_recovery_enablement(PointInTimeRecoveryEnablement::PointInTimeRecoveryEnabled);
836 /// let x1 = Database::new().set_point_in_time_recovery_enablement(PointInTimeRecoveryEnablement::PointInTimeRecoveryDisabled);
837 /// ```
838 pub fn set_point_in_time_recovery_enablement<
839 T: std::convert::Into<crate::model::database::PointInTimeRecoveryEnablement>,
840 >(
841 mut self,
842 v: T,
843 ) -> Self {
844 self.point_in_time_recovery_enablement = v.into();
845 self
846 }
847
848 /// Sets the value of [app_engine_integration_mode][crate::model::Database::app_engine_integration_mode].
849 ///
850 /// # Example
851 /// ```ignore,no_run
852 /// # use google_cloud_firestore_admin_v1::model::Database;
853 /// use google_cloud_firestore_admin_v1::model::database::AppEngineIntegrationMode;
854 /// let x0 = Database::new().set_app_engine_integration_mode(AppEngineIntegrationMode::Enabled);
855 /// let x1 = Database::new().set_app_engine_integration_mode(AppEngineIntegrationMode::Disabled);
856 /// ```
857 pub fn set_app_engine_integration_mode<
858 T: std::convert::Into<crate::model::database::AppEngineIntegrationMode>,
859 >(
860 mut self,
861 v: T,
862 ) -> Self {
863 self.app_engine_integration_mode = v.into();
864 self
865 }
866
867 /// Sets the value of [key_prefix][crate::model::Database::key_prefix].
868 ///
869 /// # Example
870 /// ```ignore,no_run
871 /// # use google_cloud_firestore_admin_v1::model::Database;
872 /// let x = Database::new().set_key_prefix("example");
873 /// ```
874 pub fn set_key_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
875 self.key_prefix = v.into();
876 self
877 }
878
879 /// Sets the value of [delete_protection_state][crate::model::Database::delete_protection_state].
880 ///
881 /// # Example
882 /// ```ignore,no_run
883 /// # use google_cloud_firestore_admin_v1::model::Database;
884 /// use google_cloud_firestore_admin_v1::model::database::DeleteProtectionState;
885 /// let x0 = Database::new().set_delete_protection_state(DeleteProtectionState::DeleteProtectionDisabled);
886 /// let x1 = Database::new().set_delete_protection_state(DeleteProtectionState::DeleteProtectionEnabled);
887 /// ```
888 pub fn set_delete_protection_state<
889 T: std::convert::Into<crate::model::database::DeleteProtectionState>,
890 >(
891 mut self,
892 v: T,
893 ) -> Self {
894 self.delete_protection_state = v.into();
895 self
896 }
897
898 /// Sets the value of [cmek_config][crate::model::Database::cmek_config].
899 ///
900 /// # Example
901 /// ```ignore,no_run
902 /// # use google_cloud_firestore_admin_v1::model::Database;
903 /// use google_cloud_firestore_admin_v1::model::database::CmekConfig;
904 /// let x = Database::new().set_cmek_config(CmekConfig::default()/* use setters */);
905 /// ```
906 pub fn set_cmek_config<T>(mut self, v: T) -> Self
907 where
908 T: std::convert::Into<crate::model::database::CmekConfig>,
909 {
910 self.cmek_config = std::option::Option::Some(v.into());
911 self
912 }
913
914 /// Sets or clears the value of [cmek_config][crate::model::Database::cmek_config].
915 ///
916 /// # Example
917 /// ```ignore,no_run
918 /// # use google_cloud_firestore_admin_v1::model::Database;
919 /// use google_cloud_firestore_admin_v1::model::database::CmekConfig;
920 /// let x = Database::new().set_or_clear_cmek_config(Some(CmekConfig::default()/* use setters */));
921 /// let x = Database::new().set_or_clear_cmek_config(None::<CmekConfig>);
922 /// ```
923 pub fn set_or_clear_cmek_config<T>(mut self, v: std::option::Option<T>) -> Self
924 where
925 T: std::convert::Into<crate::model::database::CmekConfig>,
926 {
927 self.cmek_config = v.map(|x| x.into());
928 self
929 }
930
931 /// Sets the value of [previous_id][crate::model::Database::previous_id].
932 ///
933 /// # Example
934 /// ```ignore,no_run
935 /// # use google_cloud_firestore_admin_v1::model::Database;
936 /// let x = Database::new().set_previous_id("example");
937 /// ```
938 pub fn set_previous_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
939 self.previous_id = v.into();
940 self
941 }
942
943 /// Sets the value of [source_info][crate::model::Database::source_info].
944 ///
945 /// # Example
946 /// ```ignore,no_run
947 /// # use google_cloud_firestore_admin_v1::model::Database;
948 /// use google_cloud_firestore_admin_v1::model::database::SourceInfo;
949 /// let x = Database::new().set_source_info(SourceInfo::default()/* use setters */);
950 /// ```
951 pub fn set_source_info<T>(mut self, v: T) -> Self
952 where
953 T: std::convert::Into<crate::model::database::SourceInfo>,
954 {
955 self.source_info = std::option::Option::Some(v.into());
956 self
957 }
958
959 /// Sets or clears the value of [source_info][crate::model::Database::source_info].
960 ///
961 /// # Example
962 /// ```ignore,no_run
963 /// # use google_cloud_firestore_admin_v1::model::Database;
964 /// use google_cloud_firestore_admin_v1::model::database::SourceInfo;
965 /// let x = Database::new().set_or_clear_source_info(Some(SourceInfo::default()/* use setters */));
966 /// let x = Database::new().set_or_clear_source_info(None::<SourceInfo>);
967 /// ```
968 pub fn set_or_clear_source_info<T>(mut self, v: std::option::Option<T>) -> Self
969 where
970 T: std::convert::Into<crate::model::database::SourceInfo>,
971 {
972 self.source_info = v.map(|x| x.into());
973 self
974 }
975
976 /// Sets the value of [tags][crate::model::Database::tags].
977 ///
978 /// # Example
979 /// ```ignore,no_run
980 /// # use google_cloud_firestore_admin_v1::model::Database;
981 /// let x = Database::new().set_tags([
982 /// ("key0", "abc"),
983 /// ("key1", "xyz"),
984 /// ]);
985 /// ```
986 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
987 where
988 T: std::iter::IntoIterator<Item = (K, V)>,
989 K: std::convert::Into<std::string::String>,
990 V: std::convert::Into<std::string::String>,
991 {
992 use std::iter::Iterator;
993 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
994 self
995 }
996
997 /// Sets the value of [free_tier][crate::model::Database::free_tier].
998 ///
999 /// # Example
1000 /// ```ignore,no_run
1001 /// # use google_cloud_firestore_admin_v1::model::Database;
1002 /// let x = Database::new().set_free_tier(true);
1003 /// ```
1004 pub fn set_free_tier<T>(mut self, v: T) -> Self
1005 where
1006 T: std::convert::Into<bool>,
1007 {
1008 self.free_tier = std::option::Option::Some(v.into());
1009 self
1010 }
1011
1012 /// Sets or clears the value of [free_tier][crate::model::Database::free_tier].
1013 ///
1014 /// # Example
1015 /// ```ignore,no_run
1016 /// # use google_cloud_firestore_admin_v1::model::Database;
1017 /// let x = Database::new().set_or_clear_free_tier(Some(false));
1018 /// let x = Database::new().set_or_clear_free_tier(None::<bool>);
1019 /// ```
1020 pub fn set_or_clear_free_tier<T>(mut self, v: std::option::Option<T>) -> Self
1021 where
1022 T: std::convert::Into<bool>,
1023 {
1024 self.free_tier = v.map(|x| x.into());
1025 self
1026 }
1027
1028 /// Sets the value of [etag][crate::model::Database::etag].
1029 ///
1030 /// # Example
1031 /// ```ignore,no_run
1032 /// # use google_cloud_firestore_admin_v1::model::Database;
1033 /// let x = Database::new().set_etag("example");
1034 /// ```
1035 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1036 self.etag = v.into();
1037 self
1038 }
1039
1040 /// Sets the value of [database_edition][crate::model::Database::database_edition].
1041 ///
1042 /// # Example
1043 /// ```ignore,no_run
1044 /// # use google_cloud_firestore_admin_v1::model::Database;
1045 /// use google_cloud_firestore_admin_v1::model::database::DatabaseEdition;
1046 /// let x0 = Database::new().set_database_edition(DatabaseEdition::Standard);
1047 /// let x1 = Database::new().set_database_edition(DatabaseEdition::Enterprise);
1048 /// ```
1049 pub fn set_database_edition<T: std::convert::Into<crate::model::database::DatabaseEdition>>(
1050 mut self,
1051 v: T,
1052 ) -> Self {
1053 self.database_edition = v.into();
1054 self
1055 }
1056
1057 /// Sets the value of [realtime_updates_mode][crate::model::Database::realtime_updates_mode].
1058 ///
1059 /// # Example
1060 /// ```ignore,no_run
1061 /// # use google_cloud_firestore_admin_v1::model::Database;
1062 /// use google_cloud_firestore_admin_v1::model::RealtimeUpdatesMode;
1063 /// let x0 = Database::new().set_realtime_updates_mode(RealtimeUpdatesMode::Enabled);
1064 /// let x1 = Database::new().set_realtime_updates_mode(RealtimeUpdatesMode::Disabled);
1065 /// ```
1066 pub fn set_realtime_updates_mode<T: std::convert::Into<crate::model::RealtimeUpdatesMode>>(
1067 mut self,
1068 v: T,
1069 ) -> Self {
1070 self.realtime_updates_mode = v.into();
1071 self
1072 }
1073
1074 /// Sets the value of [firestore_data_access_mode][crate::model::Database::firestore_data_access_mode].
1075 ///
1076 /// # Example
1077 /// ```ignore,no_run
1078 /// # use google_cloud_firestore_admin_v1::model::Database;
1079 /// use google_cloud_firestore_admin_v1::model::database::DataAccessMode;
1080 /// let x0 = Database::new().set_firestore_data_access_mode(DataAccessMode::Enabled);
1081 /// let x1 = Database::new().set_firestore_data_access_mode(DataAccessMode::Disabled);
1082 /// ```
1083 pub fn set_firestore_data_access_mode<
1084 T: std::convert::Into<crate::model::database::DataAccessMode>,
1085 >(
1086 mut self,
1087 v: T,
1088 ) -> Self {
1089 self.firestore_data_access_mode = v.into();
1090 self
1091 }
1092
1093 /// Sets the value of [mongodb_compatible_data_access_mode][crate::model::Database::mongodb_compatible_data_access_mode].
1094 ///
1095 /// # Example
1096 /// ```ignore,no_run
1097 /// # use google_cloud_firestore_admin_v1::model::Database;
1098 /// use google_cloud_firestore_admin_v1::model::database::DataAccessMode;
1099 /// let x0 = Database::new().set_mongodb_compatible_data_access_mode(DataAccessMode::Enabled);
1100 /// let x1 = Database::new().set_mongodb_compatible_data_access_mode(DataAccessMode::Disabled);
1101 /// ```
1102 pub fn set_mongodb_compatible_data_access_mode<
1103 T: std::convert::Into<crate::model::database::DataAccessMode>,
1104 >(
1105 mut self,
1106 v: T,
1107 ) -> Self {
1108 self.mongodb_compatible_data_access_mode = v.into();
1109 self
1110 }
1111}
1112
1113impl wkt::message::Message for Database {
1114 fn typename() -> &'static str {
1115 "type.googleapis.com/google.firestore.admin.v1.Database"
1116 }
1117}
1118
1119/// Defines additional types related to [Database].
1120pub mod database {
1121 #[allow(unused_imports)]
1122 use super::*;
1123
1124 /// The CMEK (Customer Managed Encryption Key) configuration for a Firestore
1125 /// database. If not present, the database is secured by the default Google
1126 /// encryption key.
1127 #[derive(Clone, Default, PartialEq)]
1128 #[non_exhaustive]
1129 pub struct CmekConfig {
1130 /// Required. Only keys in the same location as this database are allowed to
1131 /// be used for encryption.
1132 ///
1133 /// For Firestore's nam5 multi-region, this corresponds to Cloud KMS
1134 /// multi-region us. For Firestore's eur3 multi-region, this corresponds to
1135 /// Cloud KMS multi-region europe. See
1136 /// <https://cloud.google.com/kms/docs/locations>.
1137 ///
1138 /// The expected format is
1139 /// `projects/{project_id}/locations/{kms_location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
1140 pub kms_key_name: std::string::String,
1141
1142 /// Output only. Currently in-use [KMS key
1143 /// versions](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions).
1144 /// During [key rotation](https://cloud.google.com/kms/docs/key-rotation),
1145 /// there can be multiple in-use key versions.
1146 ///
1147 /// The expected format is
1148 /// `projects/{project_id}/locations/{kms_location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{key_version}`.
1149 pub active_key_version: std::vec::Vec<std::string::String>,
1150
1151 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1152 }
1153
1154 impl CmekConfig {
1155 pub fn new() -> Self {
1156 std::default::Default::default()
1157 }
1158
1159 /// Sets the value of [kms_key_name][crate::model::database::CmekConfig::kms_key_name].
1160 ///
1161 /// # Example
1162 /// ```ignore,no_run
1163 /// # use google_cloud_firestore_admin_v1::model::database::CmekConfig;
1164 /// let x = CmekConfig::new().set_kms_key_name("example");
1165 /// ```
1166 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
1167 mut self,
1168 v: T,
1169 ) -> Self {
1170 self.kms_key_name = v.into();
1171 self
1172 }
1173
1174 /// Sets the value of [active_key_version][crate::model::database::CmekConfig::active_key_version].
1175 ///
1176 /// # Example
1177 /// ```ignore,no_run
1178 /// # use google_cloud_firestore_admin_v1::model::database::CmekConfig;
1179 /// let x = CmekConfig::new().set_active_key_version(["a", "b", "c"]);
1180 /// ```
1181 pub fn set_active_key_version<T, V>(mut self, v: T) -> Self
1182 where
1183 T: std::iter::IntoIterator<Item = V>,
1184 V: std::convert::Into<std::string::String>,
1185 {
1186 use std::iter::Iterator;
1187 self.active_key_version = v.into_iter().map(|i| i.into()).collect();
1188 self
1189 }
1190 }
1191
1192 impl wkt::message::Message for CmekConfig {
1193 fn typename() -> &'static str {
1194 "type.googleapis.com/google.firestore.admin.v1.Database.CmekConfig"
1195 }
1196 }
1197
1198 /// Information about the provenance of this database.
1199 #[derive(Clone, Default, PartialEq)]
1200 #[non_exhaustive]
1201 pub struct SourceInfo {
1202 /// The associated long-running operation. This field may not be set after
1203 /// the operation has completed. Format:
1204 /// `projects/{project}/databases/{database}/operations/{operation}`.
1205 pub operation: std::string::String,
1206
1207 /// The source from which this database is derived.
1208 pub source: std::option::Option<crate::model::database::source_info::Source>,
1209
1210 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1211 }
1212
1213 impl SourceInfo {
1214 pub fn new() -> Self {
1215 std::default::Default::default()
1216 }
1217
1218 /// Sets the value of [operation][crate::model::database::SourceInfo::operation].
1219 ///
1220 /// # Example
1221 /// ```ignore,no_run
1222 /// # use google_cloud_firestore_admin_v1::model::database::SourceInfo;
1223 /// let x = SourceInfo::new().set_operation("example");
1224 /// ```
1225 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1226 self.operation = v.into();
1227 self
1228 }
1229
1230 /// Sets the value of [source][crate::model::database::SourceInfo::source].
1231 ///
1232 /// Note that all the setters affecting `source` are mutually
1233 /// exclusive.
1234 ///
1235 /// # Example
1236 /// ```ignore,no_run
1237 /// # use google_cloud_firestore_admin_v1::model::database::SourceInfo;
1238 /// use google_cloud_firestore_admin_v1::model::database::source_info::BackupSource;
1239 /// let x = SourceInfo::new().set_source(Some(
1240 /// google_cloud_firestore_admin_v1::model::database::source_info::Source::Backup(BackupSource::default().into())));
1241 /// ```
1242 pub fn set_source<
1243 T: std::convert::Into<std::option::Option<crate::model::database::source_info::Source>>,
1244 >(
1245 mut self,
1246 v: T,
1247 ) -> Self {
1248 self.source = v.into();
1249 self
1250 }
1251
1252 /// The value of [source][crate::model::database::SourceInfo::source]
1253 /// if it holds a `Backup`, `None` if the field is not set or
1254 /// holds a different branch.
1255 pub fn backup(
1256 &self,
1257 ) -> std::option::Option<&std::boxed::Box<crate::model::database::source_info::BackupSource>>
1258 {
1259 #[allow(unreachable_patterns)]
1260 self.source.as_ref().and_then(|v| match v {
1261 crate::model::database::source_info::Source::Backup(v) => {
1262 std::option::Option::Some(v)
1263 }
1264 _ => std::option::Option::None,
1265 })
1266 }
1267
1268 /// Sets the value of [source][crate::model::database::SourceInfo::source]
1269 /// to hold a `Backup`.
1270 ///
1271 /// Note that all the setters affecting `source` are
1272 /// mutually exclusive.
1273 ///
1274 /// # Example
1275 /// ```ignore,no_run
1276 /// # use google_cloud_firestore_admin_v1::model::database::SourceInfo;
1277 /// use google_cloud_firestore_admin_v1::model::database::source_info::BackupSource;
1278 /// let x = SourceInfo::new().set_backup(BackupSource::default()/* use setters */);
1279 /// assert!(x.backup().is_some());
1280 /// ```
1281 pub fn set_backup<
1282 T: std::convert::Into<std::boxed::Box<crate::model::database::source_info::BackupSource>>,
1283 >(
1284 mut self,
1285 v: T,
1286 ) -> Self {
1287 self.source = std::option::Option::Some(
1288 crate::model::database::source_info::Source::Backup(v.into()),
1289 );
1290 self
1291 }
1292 }
1293
1294 impl wkt::message::Message for SourceInfo {
1295 fn typename() -> &'static str {
1296 "type.googleapis.com/google.firestore.admin.v1.Database.SourceInfo"
1297 }
1298 }
1299
1300 /// Defines additional types related to [SourceInfo].
1301 pub mod source_info {
1302 #[allow(unused_imports)]
1303 use super::*;
1304
1305 /// Information about a backup that was used to restore a database.
1306 #[derive(Clone, Default, PartialEq)]
1307 #[non_exhaustive]
1308 pub struct BackupSource {
1309 /// The resource name of the backup that was used to restore this
1310 /// database. Format:
1311 /// `projects/{project}/locations/{location}/backups/{backup}`.
1312 pub backup: std::string::String,
1313
1314 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1315 }
1316
1317 impl BackupSource {
1318 pub fn new() -> Self {
1319 std::default::Default::default()
1320 }
1321
1322 /// Sets the value of [backup][crate::model::database::source_info::BackupSource::backup].
1323 ///
1324 /// # Example
1325 /// ```ignore,no_run
1326 /// # use google_cloud_firestore_admin_v1::model::database::source_info::BackupSource;
1327 /// let x = BackupSource::new().set_backup("example");
1328 /// ```
1329 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1330 self.backup = v.into();
1331 self
1332 }
1333 }
1334
1335 impl wkt::message::Message for BackupSource {
1336 fn typename() -> &'static str {
1337 "type.googleapis.com/google.firestore.admin.v1.Database.SourceInfo.BackupSource"
1338 }
1339 }
1340
1341 /// The source from which this database is derived.
1342 #[derive(Clone, Debug, PartialEq)]
1343 #[non_exhaustive]
1344 pub enum Source {
1345 /// If set, this database was restored from the specified backup (or a
1346 /// snapshot thereof).
1347 Backup(std::boxed::Box<crate::model::database::source_info::BackupSource>),
1348 }
1349 }
1350
1351 /// Encryption configuration for a new database being created from another
1352 /// source.
1353 ///
1354 /// The source could be a [Backup][google.firestore.admin.v1.Backup] or a
1355 /// [PitrSnapshot][google.firestore.admin.v1.PitrSnapshot].
1356 ///
1357 /// [google.firestore.admin.v1.Backup]: crate::model::Backup
1358 /// [google.firestore.admin.v1.PitrSnapshot]: crate::model::PitrSnapshot
1359 #[derive(Clone, Default, PartialEq)]
1360 #[non_exhaustive]
1361 pub struct EncryptionConfig {
1362 /// The method for encrypting the database.
1363 pub encryption_type:
1364 std::option::Option<crate::model::database::encryption_config::EncryptionType>,
1365
1366 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1367 }
1368
1369 impl EncryptionConfig {
1370 pub fn new() -> Self {
1371 std::default::Default::default()
1372 }
1373
1374 /// Sets the value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type].
1375 ///
1376 /// Note that all the setters affecting `encryption_type` are mutually
1377 /// exclusive.
1378 ///
1379 /// # Example
1380 /// ```ignore,no_run
1381 /// # use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
1382 /// use google_cloud_firestore_admin_v1::model::database::encryption_config::GoogleDefaultEncryptionOptions;
1383 /// let x = EncryptionConfig::new().set_encryption_type(Some(
1384 /// google_cloud_firestore_admin_v1::model::database::encryption_config::EncryptionType::GoogleDefaultEncryption(GoogleDefaultEncryptionOptions::default().into())));
1385 /// ```
1386 pub fn set_encryption_type<
1387 T: std::convert::Into<
1388 std::option::Option<crate::model::database::encryption_config::EncryptionType>,
1389 >,
1390 >(
1391 mut self,
1392 v: T,
1393 ) -> Self {
1394 self.encryption_type = v.into();
1395 self
1396 }
1397
1398 /// The value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type]
1399 /// if it holds a `GoogleDefaultEncryption`, `None` if the field is not set or
1400 /// holds a different branch.
1401 pub fn google_default_encryption(
1402 &self,
1403 ) -> std::option::Option<
1404 &std::boxed::Box<
1405 crate::model::database::encryption_config::GoogleDefaultEncryptionOptions,
1406 >,
1407 > {
1408 #[allow(unreachable_patterns)]
1409 self.encryption_type.as_ref().and_then(|v| match v {
1410 crate::model::database::encryption_config::EncryptionType::GoogleDefaultEncryption(v) => std::option::Option::Some(v),
1411 _ => std::option::Option::None,
1412 })
1413 }
1414
1415 /// Sets the value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type]
1416 /// to hold a `GoogleDefaultEncryption`.
1417 ///
1418 /// Note that all the setters affecting `encryption_type` are
1419 /// mutually exclusive.
1420 ///
1421 /// # Example
1422 /// ```ignore,no_run
1423 /// # use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
1424 /// use google_cloud_firestore_admin_v1::model::database::encryption_config::GoogleDefaultEncryptionOptions;
1425 /// let x = EncryptionConfig::new().set_google_default_encryption(GoogleDefaultEncryptionOptions::default()/* use setters */);
1426 /// assert!(x.google_default_encryption().is_some());
1427 /// assert!(x.use_source_encryption().is_none());
1428 /// assert!(x.customer_managed_encryption().is_none());
1429 /// ```
1430 pub fn set_google_default_encryption<
1431 T: std::convert::Into<
1432 std::boxed::Box<
1433 crate::model::database::encryption_config::GoogleDefaultEncryptionOptions,
1434 >,
1435 >,
1436 >(
1437 mut self,
1438 v: T,
1439 ) -> Self {
1440 self.encryption_type = std::option::Option::Some(
1441 crate::model::database::encryption_config::EncryptionType::GoogleDefaultEncryption(
1442 v.into(),
1443 ),
1444 );
1445 self
1446 }
1447
1448 /// The value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type]
1449 /// if it holds a `UseSourceEncryption`, `None` if the field is not set or
1450 /// holds a different branch.
1451 pub fn use_source_encryption(
1452 &self,
1453 ) -> std::option::Option<
1454 &std::boxed::Box<crate::model::database::encryption_config::SourceEncryptionOptions>,
1455 > {
1456 #[allow(unreachable_patterns)]
1457 self.encryption_type.as_ref().and_then(|v| match v {
1458 crate::model::database::encryption_config::EncryptionType::UseSourceEncryption(
1459 v,
1460 ) => std::option::Option::Some(v),
1461 _ => std::option::Option::None,
1462 })
1463 }
1464
1465 /// Sets the value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type]
1466 /// to hold a `UseSourceEncryption`.
1467 ///
1468 /// Note that all the setters affecting `encryption_type` are
1469 /// mutually exclusive.
1470 ///
1471 /// # Example
1472 /// ```ignore,no_run
1473 /// # use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
1474 /// use google_cloud_firestore_admin_v1::model::database::encryption_config::SourceEncryptionOptions;
1475 /// let x = EncryptionConfig::new().set_use_source_encryption(SourceEncryptionOptions::default()/* use setters */);
1476 /// assert!(x.use_source_encryption().is_some());
1477 /// assert!(x.google_default_encryption().is_none());
1478 /// assert!(x.customer_managed_encryption().is_none());
1479 /// ```
1480 pub fn set_use_source_encryption<
1481 T: std::convert::Into<
1482 std::boxed::Box<
1483 crate::model::database::encryption_config::SourceEncryptionOptions,
1484 >,
1485 >,
1486 >(
1487 mut self,
1488 v: T,
1489 ) -> Self {
1490 self.encryption_type = std::option::Option::Some(
1491 crate::model::database::encryption_config::EncryptionType::UseSourceEncryption(
1492 v.into(),
1493 ),
1494 );
1495 self
1496 }
1497
1498 /// The value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type]
1499 /// if it holds a `CustomerManagedEncryption`, `None` if the field is not set or
1500 /// holds a different branch.
1501 pub fn customer_managed_encryption(
1502 &self,
1503 ) -> std::option::Option<
1504 &std::boxed::Box<
1505 crate::model::database::encryption_config::CustomerManagedEncryptionOptions,
1506 >,
1507 > {
1508 #[allow(unreachable_patterns)]
1509 self.encryption_type.as_ref().and_then(|v| match v {
1510 crate::model::database::encryption_config::EncryptionType::CustomerManagedEncryption(v) => std::option::Option::Some(v),
1511 _ => std::option::Option::None,
1512 })
1513 }
1514
1515 /// Sets the value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type]
1516 /// to hold a `CustomerManagedEncryption`.
1517 ///
1518 /// Note that all the setters affecting `encryption_type` are
1519 /// mutually exclusive.
1520 ///
1521 /// # Example
1522 /// ```ignore,no_run
1523 /// # use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
1524 /// use google_cloud_firestore_admin_v1::model::database::encryption_config::CustomerManagedEncryptionOptions;
1525 /// let x = EncryptionConfig::new().set_customer_managed_encryption(CustomerManagedEncryptionOptions::default()/* use setters */);
1526 /// assert!(x.customer_managed_encryption().is_some());
1527 /// assert!(x.google_default_encryption().is_none());
1528 /// assert!(x.use_source_encryption().is_none());
1529 /// ```
1530 pub fn set_customer_managed_encryption<
1531 T: std::convert::Into<
1532 std::boxed::Box<
1533 crate::model::database::encryption_config::CustomerManagedEncryptionOptions,
1534 >,
1535 >,
1536 >(
1537 mut self,
1538 v: T,
1539 ) -> Self {
1540 self.encryption_type = std::option::Option::Some(
1541 crate::model::database::encryption_config::EncryptionType::CustomerManagedEncryption(
1542 v.into()
1543 )
1544 );
1545 self
1546 }
1547 }
1548
1549 impl wkt::message::Message for EncryptionConfig {
1550 fn typename() -> &'static str {
1551 "type.googleapis.com/google.firestore.admin.v1.Database.EncryptionConfig"
1552 }
1553 }
1554
1555 /// Defines additional types related to [EncryptionConfig].
1556 pub mod encryption_config {
1557 #[allow(unused_imports)]
1558 use super::*;
1559
1560 /// The configuration options for using Google default encryption.
1561 #[derive(Clone, Default, PartialEq)]
1562 #[non_exhaustive]
1563 pub struct GoogleDefaultEncryptionOptions {
1564 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1565 }
1566
1567 impl GoogleDefaultEncryptionOptions {
1568 pub fn new() -> Self {
1569 std::default::Default::default()
1570 }
1571 }
1572
1573 impl wkt::message::Message for GoogleDefaultEncryptionOptions {
1574 fn typename() -> &'static str {
1575 "type.googleapis.com/google.firestore.admin.v1.Database.EncryptionConfig.GoogleDefaultEncryptionOptions"
1576 }
1577 }
1578
1579 /// The configuration options for using the same encryption method as the
1580 /// source.
1581 #[derive(Clone, Default, PartialEq)]
1582 #[non_exhaustive]
1583 pub struct SourceEncryptionOptions {
1584 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1585 }
1586
1587 impl SourceEncryptionOptions {
1588 pub fn new() -> Self {
1589 std::default::Default::default()
1590 }
1591 }
1592
1593 impl wkt::message::Message for SourceEncryptionOptions {
1594 fn typename() -> &'static str {
1595 "type.googleapis.com/google.firestore.admin.v1.Database.EncryptionConfig.SourceEncryptionOptions"
1596 }
1597 }
1598
1599 /// The configuration options for using CMEK (Customer Managed Encryption
1600 /// Key) encryption.
1601 #[derive(Clone, Default, PartialEq)]
1602 #[non_exhaustive]
1603 pub struct CustomerManagedEncryptionOptions {
1604 /// Required. Only keys in the same location as the database are allowed to
1605 /// be used for encryption.
1606 ///
1607 /// For Firestore's nam5 multi-region, this corresponds to Cloud KMS
1608 /// multi-region us. For Firestore's eur3 multi-region, this corresponds to
1609 /// Cloud KMS multi-region europe. See
1610 /// <https://cloud.google.com/kms/docs/locations>.
1611 ///
1612 /// The expected format is
1613 /// `projects/{project_id}/locations/{kms_location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
1614 pub kms_key_name: std::string::String,
1615
1616 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1617 }
1618
1619 impl CustomerManagedEncryptionOptions {
1620 pub fn new() -> Self {
1621 std::default::Default::default()
1622 }
1623
1624 /// Sets the value of [kms_key_name][crate::model::database::encryption_config::CustomerManagedEncryptionOptions::kms_key_name].
1625 ///
1626 /// # Example
1627 /// ```ignore,no_run
1628 /// # use google_cloud_firestore_admin_v1::model::database::encryption_config::CustomerManagedEncryptionOptions;
1629 /// let x = CustomerManagedEncryptionOptions::new().set_kms_key_name("example");
1630 /// ```
1631 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
1632 mut self,
1633 v: T,
1634 ) -> Self {
1635 self.kms_key_name = v.into();
1636 self
1637 }
1638 }
1639
1640 impl wkt::message::Message for CustomerManagedEncryptionOptions {
1641 fn typename() -> &'static str {
1642 "type.googleapis.com/google.firestore.admin.v1.Database.EncryptionConfig.CustomerManagedEncryptionOptions"
1643 }
1644 }
1645
1646 /// The method for encrypting the database.
1647 #[derive(Clone, Debug, PartialEq)]
1648 #[non_exhaustive]
1649 pub enum EncryptionType {
1650 /// Use Google default encryption.
1651 GoogleDefaultEncryption(
1652 std::boxed::Box<
1653 crate::model::database::encryption_config::GoogleDefaultEncryptionOptions,
1654 >,
1655 ),
1656 /// The database will use the same encryption configuration as the source.
1657 UseSourceEncryption(
1658 std::boxed::Box<crate::model::database::encryption_config::SourceEncryptionOptions>,
1659 ),
1660 /// Use Customer Managed Encryption Keys (CMEK) for encryption.
1661 CustomerManagedEncryption(
1662 std::boxed::Box<
1663 crate::model::database::encryption_config::CustomerManagedEncryptionOptions,
1664 >,
1665 ),
1666 }
1667 }
1668
1669 /// The type of the database.
1670 /// See <https://cloud.google.com/datastore/docs/firestore-or-datastore> for
1671 /// information about how to choose.
1672 ///
1673 /// Mode changes are only allowed if the database is empty.
1674 ///
1675 /// # Working with unknown values
1676 ///
1677 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1678 /// additional enum variants at any time. Adding new variants is not considered
1679 /// a breaking change. Applications should write their code in anticipation of:
1680 ///
1681 /// - New values appearing in future releases of the client library, **and**
1682 /// - New values received dynamically, without application changes.
1683 ///
1684 /// Please consult the [Working with enums] section in the user guide for some
1685 /// guidelines.
1686 ///
1687 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1688 #[derive(Clone, Debug, PartialEq)]
1689 #[non_exhaustive]
1690 pub enum DatabaseType {
1691 /// Not used.
1692 Unspecified,
1693 /// Firestore Native Mode
1694 FirestoreNative,
1695 /// Firestore in Datastore Mode.
1696 DatastoreMode,
1697 /// If set, the enum was initialized with an unknown value.
1698 ///
1699 /// Applications can examine the value using [DatabaseType::value] or
1700 /// [DatabaseType::name].
1701 UnknownValue(database_type::UnknownValue),
1702 }
1703
1704 #[doc(hidden)]
1705 pub mod database_type {
1706 #[allow(unused_imports)]
1707 use super::*;
1708 #[derive(Clone, Debug, PartialEq)]
1709 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1710 }
1711
1712 impl DatabaseType {
1713 /// Gets the enum value.
1714 ///
1715 /// Returns `None` if the enum contains an unknown value deserialized from
1716 /// the string representation of enums.
1717 pub fn value(&self) -> std::option::Option<i32> {
1718 match self {
1719 Self::Unspecified => std::option::Option::Some(0),
1720 Self::FirestoreNative => std::option::Option::Some(1),
1721 Self::DatastoreMode => std::option::Option::Some(2),
1722 Self::UnknownValue(u) => u.0.value(),
1723 }
1724 }
1725
1726 /// Gets the enum value as a string.
1727 ///
1728 /// Returns `None` if the enum contains an unknown value deserialized from
1729 /// the integer representation of enums.
1730 pub fn name(&self) -> std::option::Option<&str> {
1731 match self {
1732 Self::Unspecified => std::option::Option::Some("DATABASE_TYPE_UNSPECIFIED"),
1733 Self::FirestoreNative => std::option::Option::Some("FIRESTORE_NATIVE"),
1734 Self::DatastoreMode => std::option::Option::Some("DATASTORE_MODE"),
1735 Self::UnknownValue(u) => u.0.name(),
1736 }
1737 }
1738 }
1739
1740 impl std::default::Default for DatabaseType {
1741 fn default() -> Self {
1742 use std::convert::From;
1743 Self::from(0)
1744 }
1745 }
1746
1747 impl std::fmt::Display for DatabaseType {
1748 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1749 wkt::internal::display_enum(f, self.name(), self.value())
1750 }
1751 }
1752
1753 impl std::convert::From<i32> for DatabaseType {
1754 fn from(value: i32) -> Self {
1755 match value {
1756 0 => Self::Unspecified,
1757 1 => Self::FirestoreNative,
1758 2 => Self::DatastoreMode,
1759 _ => Self::UnknownValue(database_type::UnknownValue(
1760 wkt::internal::UnknownEnumValue::Integer(value),
1761 )),
1762 }
1763 }
1764 }
1765
1766 impl std::convert::From<&str> for DatabaseType {
1767 fn from(value: &str) -> Self {
1768 use std::string::ToString;
1769 match value {
1770 "DATABASE_TYPE_UNSPECIFIED" => Self::Unspecified,
1771 "FIRESTORE_NATIVE" => Self::FirestoreNative,
1772 "DATASTORE_MODE" => Self::DatastoreMode,
1773 _ => Self::UnknownValue(database_type::UnknownValue(
1774 wkt::internal::UnknownEnumValue::String(value.to_string()),
1775 )),
1776 }
1777 }
1778 }
1779
1780 impl serde::ser::Serialize for DatabaseType {
1781 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1782 where
1783 S: serde::Serializer,
1784 {
1785 match self {
1786 Self::Unspecified => serializer.serialize_i32(0),
1787 Self::FirestoreNative => serializer.serialize_i32(1),
1788 Self::DatastoreMode => serializer.serialize_i32(2),
1789 Self::UnknownValue(u) => u.0.serialize(serializer),
1790 }
1791 }
1792 }
1793
1794 impl<'de> serde::de::Deserialize<'de> for DatabaseType {
1795 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1796 where
1797 D: serde::Deserializer<'de>,
1798 {
1799 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseType>::new(
1800 ".google.firestore.admin.v1.Database.DatabaseType",
1801 ))
1802 }
1803 }
1804
1805 /// The type of concurrency control mode for transactions.
1806 ///
1807 /// # Working with unknown values
1808 ///
1809 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1810 /// additional enum variants at any time. Adding new variants is not considered
1811 /// a breaking change. Applications should write their code in anticipation of:
1812 ///
1813 /// - New values appearing in future releases of the client library, **and**
1814 /// - New values received dynamically, without application changes.
1815 ///
1816 /// Please consult the [Working with enums] section in the user guide for some
1817 /// guidelines.
1818 ///
1819 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1820 #[derive(Clone, Debug, PartialEq)]
1821 #[non_exhaustive]
1822 pub enum ConcurrencyMode {
1823 /// Not used.
1824 Unspecified,
1825 /// Use optimistic concurrency control by default. This mode is available
1826 /// for Cloud Firestore databases.
1827 ///
1828 /// This is the default setting for Cloud Firestore Enterprise Edition
1829 /// databases.
1830 Optimistic,
1831 /// Use pessimistic concurrency control by default. This mode is available
1832 /// for Cloud Firestore databases.
1833 ///
1834 /// This is the default setting for Cloud Firestore Standard Edition
1835 /// databases.
1836 Pessimistic,
1837 /// Use optimistic concurrency control with entity groups by default.
1838 ///
1839 /// This mode is enabled for some databases that were automatically upgraded
1840 /// from Cloud Datastore to Cloud Firestore with Datastore Mode.
1841 ///
1842 /// It is not recommended for any new databases, and not supported for
1843 /// Firestore Native databases.
1844 OptimisticWithEntityGroups,
1845 /// If set, the enum was initialized with an unknown value.
1846 ///
1847 /// Applications can examine the value using [ConcurrencyMode::value] or
1848 /// [ConcurrencyMode::name].
1849 UnknownValue(concurrency_mode::UnknownValue),
1850 }
1851
1852 #[doc(hidden)]
1853 pub mod concurrency_mode {
1854 #[allow(unused_imports)]
1855 use super::*;
1856 #[derive(Clone, Debug, PartialEq)]
1857 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1858 }
1859
1860 impl ConcurrencyMode {
1861 /// Gets the enum value.
1862 ///
1863 /// Returns `None` if the enum contains an unknown value deserialized from
1864 /// the string representation of enums.
1865 pub fn value(&self) -> std::option::Option<i32> {
1866 match self {
1867 Self::Unspecified => std::option::Option::Some(0),
1868 Self::Optimistic => std::option::Option::Some(1),
1869 Self::Pessimistic => std::option::Option::Some(2),
1870 Self::OptimisticWithEntityGroups => std::option::Option::Some(3),
1871 Self::UnknownValue(u) => u.0.value(),
1872 }
1873 }
1874
1875 /// Gets the enum value as a string.
1876 ///
1877 /// Returns `None` if the enum contains an unknown value deserialized from
1878 /// the integer representation of enums.
1879 pub fn name(&self) -> std::option::Option<&str> {
1880 match self {
1881 Self::Unspecified => std::option::Option::Some("CONCURRENCY_MODE_UNSPECIFIED"),
1882 Self::Optimistic => std::option::Option::Some("OPTIMISTIC"),
1883 Self::Pessimistic => std::option::Option::Some("PESSIMISTIC"),
1884 Self::OptimisticWithEntityGroups => {
1885 std::option::Option::Some("OPTIMISTIC_WITH_ENTITY_GROUPS")
1886 }
1887 Self::UnknownValue(u) => u.0.name(),
1888 }
1889 }
1890 }
1891
1892 impl std::default::Default for ConcurrencyMode {
1893 fn default() -> Self {
1894 use std::convert::From;
1895 Self::from(0)
1896 }
1897 }
1898
1899 impl std::fmt::Display for ConcurrencyMode {
1900 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1901 wkt::internal::display_enum(f, self.name(), self.value())
1902 }
1903 }
1904
1905 impl std::convert::From<i32> for ConcurrencyMode {
1906 fn from(value: i32) -> Self {
1907 match value {
1908 0 => Self::Unspecified,
1909 1 => Self::Optimistic,
1910 2 => Self::Pessimistic,
1911 3 => Self::OptimisticWithEntityGroups,
1912 _ => Self::UnknownValue(concurrency_mode::UnknownValue(
1913 wkt::internal::UnknownEnumValue::Integer(value),
1914 )),
1915 }
1916 }
1917 }
1918
1919 impl std::convert::From<&str> for ConcurrencyMode {
1920 fn from(value: &str) -> Self {
1921 use std::string::ToString;
1922 match value {
1923 "CONCURRENCY_MODE_UNSPECIFIED" => Self::Unspecified,
1924 "OPTIMISTIC" => Self::Optimistic,
1925 "PESSIMISTIC" => Self::Pessimistic,
1926 "OPTIMISTIC_WITH_ENTITY_GROUPS" => Self::OptimisticWithEntityGroups,
1927 _ => Self::UnknownValue(concurrency_mode::UnknownValue(
1928 wkt::internal::UnknownEnumValue::String(value.to_string()),
1929 )),
1930 }
1931 }
1932 }
1933
1934 impl serde::ser::Serialize for ConcurrencyMode {
1935 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1936 where
1937 S: serde::Serializer,
1938 {
1939 match self {
1940 Self::Unspecified => serializer.serialize_i32(0),
1941 Self::Optimistic => serializer.serialize_i32(1),
1942 Self::Pessimistic => serializer.serialize_i32(2),
1943 Self::OptimisticWithEntityGroups => serializer.serialize_i32(3),
1944 Self::UnknownValue(u) => u.0.serialize(serializer),
1945 }
1946 }
1947 }
1948
1949 impl<'de> serde::de::Deserialize<'de> for ConcurrencyMode {
1950 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1951 where
1952 D: serde::Deserializer<'de>,
1953 {
1954 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConcurrencyMode>::new(
1955 ".google.firestore.admin.v1.Database.ConcurrencyMode",
1956 ))
1957 }
1958 }
1959
1960 /// Point In Time Recovery feature enablement.
1961 ///
1962 /// # Working with unknown values
1963 ///
1964 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1965 /// additional enum variants at any time. Adding new variants is not considered
1966 /// a breaking change. Applications should write their code in anticipation of:
1967 ///
1968 /// - New values appearing in future releases of the client library, **and**
1969 /// - New values received dynamically, without application changes.
1970 ///
1971 /// Please consult the [Working with enums] section in the user guide for some
1972 /// guidelines.
1973 ///
1974 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1975 #[derive(Clone, Debug, PartialEq)]
1976 #[non_exhaustive]
1977 pub enum PointInTimeRecoveryEnablement {
1978 /// Not used.
1979 Unspecified,
1980 /// Reads are supported on selected versions of the data from within the past
1981 /// 7 days:
1982 ///
1983 /// * Reads against any timestamp within the past hour
1984 /// * Reads against 1-minute snapshots beyond 1 hour and within 7 days
1985 ///
1986 /// `version_retention_period` and `earliest_version_time` can be
1987 /// used to determine the supported versions.
1988 PointInTimeRecoveryEnabled,
1989 /// Reads are supported on any version of the data from within the past 1
1990 /// hour.
1991 PointInTimeRecoveryDisabled,
1992 /// If set, the enum was initialized with an unknown value.
1993 ///
1994 /// Applications can examine the value using [PointInTimeRecoveryEnablement::value] or
1995 /// [PointInTimeRecoveryEnablement::name].
1996 UnknownValue(point_in_time_recovery_enablement::UnknownValue),
1997 }
1998
1999 #[doc(hidden)]
2000 pub mod point_in_time_recovery_enablement {
2001 #[allow(unused_imports)]
2002 use super::*;
2003 #[derive(Clone, Debug, PartialEq)]
2004 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2005 }
2006
2007 impl PointInTimeRecoveryEnablement {
2008 /// Gets the enum value.
2009 ///
2010 /// Returns `None` if the enum contains an unknown value deserialized from
2011 /// the string representation of enums.
2012 pub fn value(&self) -> std::option::Option<i32> {
2013 match self {
2014 Self::Unspecified => std::option::Option::Some(0),
2015 Self::PointInTimeRecoveryEnabled => std::option::Option::Some(1),
2016 Self::PointInTimeRecoveryDisabled => std::option::Option::Some(2),
2017 Self::UnknownValue(u) => u.0.value(),
2018 }
2019 }
2020
2021 /// Gets the enum value as a string.
2022 ///
2023 /// Returns `None` if the enum contains an unknown value deserialized from
2024 /// the integer representation of enums.
2025 pub fn name(&self) -> std::option::Option<&str> {
2026 match self {
2027 Self::Unspecified => {
2028 std::option::Option::Some("POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED")
2029 }
2030 Self::PointInTimeRecoveryEnabled => {
2031 std::option::Option::Some("POINT_IN_TIME_RECOVERY_ENABLED")
2032 }
2033 Self::PointInTimeRecoveryDisabled => {
2034 std::option::Option::Some("POINT_IN_TIME_RECOVERY_DISABLED")
2035 }
2036 Self::UnknownValue(u) => u.0.name(),
2037 }
2038 }
2039 }
2040
2041 impl std::default::Default for PointInTimeRecoveryEnablement {
2042 fn default() -> Self {
2043 use std::convert::From;
2044 Self::from(0)
2045 }
2046 }
2047
2048 impl std::fmt::Display for PointInTimeRecoveryEnablement {
2049 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2050 wkt::internal::display_enum(f, self.name(), self.value())
2051 }
2052 }
2053
2054 impl std::convert::From<i32> for PointInTimeRecoveryEnablement {
2055 fn from(value: i32) -> Self {
2056 match value {
2057 0 => Self::Unspecified,
2058 1 => Self::PointInTimeRecoveryEnabled,
2059 2 => Self::PointInTimeRecoveryDisabled,
2060 _ => Self::UnknownValue(point_in_time_recovery_enablement::UnknownValue(
2061 wkt::internal::UnknownEnumValue::Integer(value),
2062 )),
2063 }
2064 }
2065 }
2066
2067 impl std::convert::From<&str> for PointInTimeRecoveryEnablement {
2068 fn from(value: &str) -> Self {
2069 use std::string::ToString;
2070 match value {
2071 "POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED" => Self::Unspecified,
2072 "POINT_IN_TIME_RECOVERY_ENABLED" => Self::PointInTimeRecoveryEnabled,
2073 "POINT_IN_TIME_RECOVERY_DISABLED" => Self::PointInTimeRecoveryDisabled,
2074 _ => Self::UnknownValue(point_in_time_recovery_enablement::UnknownValue(
2075 wkt::internal::UnknownEnumValue::String(value.to_string()),
2076 )),
2077 }
2078 }
2079 }
2080
2081 impl serde::ser::Serialize for PointInTimeRecoveryEnablement {
2082 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2083 where
2084 S: serde::Serializer,
2085 {
2086 match self {
2087 Self::Unspecified => serializer.serialize_i32(0),
2088 Self::PointInTimeRecoveryEnabled => serializer.serialize_i32(1),
2089 Self::PointInTimeRecoveryDisabled => serializer.serialize_i32(2),
2090 Self::UnknownValue(u) => u.0.serialize(serializer),
2091 }
2092 }
2093 }
2094
2095 impl<'de> serde::de::Deserialize<'de> for PointInTimeRecoveryEnablement {
2096 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2097 where
2098 D: serde::Deserializer<'de>,
2099 {
2100 deserializer.deserialize_any(
2101 wkt::internal::EnumVisitor::<PointInTimeRecoveryEnablement>::new(
2102 ".google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement",
2103 ),
2104 )
2105 }
2106 }
2107
2108 /// The type of App Engine integration mode.
2109 ///
2110 /// # Working with unknown values
2111 ///
2112 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2113 /// additional enum variants at any time. Adding new variants is not considered
2114 /// a breaking change. Applications should write their code in anticipation of:
2115 ///
2116 /// - New values appearing in future releases of the client library, **and**
2117 /// - New values received dynamically, without application changes.
2118 ///
2119 /// Please consult the [Working with enums] section in the user guide for some
2120 /// guidelines.
2121 ///
2122 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2123 #[derive(Clone, Debug, PartialEq)]
2124 #[non_exhaustive]
2125 pub enum AppEngineIntegrationMode {
2126 /// Not used.
2127 Unspecified,
2128 /// If an App Engine application exists in the same region as this database,
2129 /// App Engine configuration will impact this database. This includes
2130 /// disabling of the application & database, as well as disabling writes to
2131 /// the database.
2132 Enabled,
2133 /// App Engine has no effect on the ability of this database to serve
2134 /// requests.
2135 ///
2136 /// This is the default setting for databases created with the Firestore API.
2137 Disabled,
2138 /// If set, the enum was initialized with an unknown value.
2139 ///
2140 /// Applications can examine the value using [AppEngineIntegrationMode::value] or
2141 /// [AppEngineIntegrationMode::name].
2142 UnknownValue(app_engine_integration_mode::UnknownValue),
2143 }
2144
2145 #[doc(hidden)]
2146 pub mod app_engine_integration_mode {
2147 #[allow(unused_imports)]
2148 use super::*;
2149 #[derive(Clone, Debug, PartialEq)]
2150 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2151 }
2152
2153 impl AppEngineIntegrationMode {
2154 /// Gets the enum value.
2155 ///
2156 /// Returns `None` if the enum contains an unknown value deserialized from
2157 /// the string representation of enums.
2158 pub fn value(&self) -> std::option::Option<i32> {
2159 match self {
2160 Self::Unspecified => std::option::Option::Some(0),
2161 Self::Enabled => std::option::Option::Some(1),
2162 Self::Disabled => std::option::Option::Some(2),
2163 Self::UnknownValue(u) => u.0.value(),
2164 }
2165 }
2166
2167 /// Gets the enum value as a string.
2168 ///
2169 /// Returns `None` if the enum contains an unknown value deserialized from
2170 /// the integer representation of enums.
2171 pub fn name(&self) -> std::option::Option<&str> {
2172 match self {
2173 Self::Unspecified => {
2174 std::option::Option::Some("APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED")
2175 }
2176 Self::Enabled => std::option::Option::Some("ENABLED"),
2177 Self::Disabled => std::option::Option::Some("DISABLED"),
2178 Self::UnknownValue(u) => u.0.name(),
2179 }
2180 }
2181 }
2182
2183 impl std::default::Default for AppEngineIntegrationMode {
2184 fn default() -> Self {
2185 use std::convert::From;
2186 Self::from(0)
2187 }
2188 }
2189
2190 impl std::fmt::Display for AppEngineIntegrationMode {
2191 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2192 wkt::internal::display_enum(f, self.name(), self.value())
2193 }
2194 }
2195
2196 impl std::convert::From<i32> for AppEngineIntegrationMode {
2197 fn from(value: i32) -> Self {
2198 match value {
2199 0 => Self::Unspecified,
2200 1 => Self::Enabled,
2201 2 => Self::Disabled,
2202 _ => Self::UnknownValue(app_engine_integration_mode::UnknownValue(
2203 wkt::internal::UnknownEnumValue::Integer(value),
2204 )),
2205 }
2206 }
2207 }
2208
2209 impl std::convert::From<&str> for AppEngineIntegrationMode {
2210 fn from(value: &str) -> Self {
2211 use std::string::ToString;
2212 match value {
2213 "APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED" => Self::Unspecified,
2214 "ENABLED" => Self::Enabled,
2215 "DISABLED" => Self::Disabled,
2216 _ => Self::UnknownValue(app_engine_integration_mode::UnknownValue(
2217 wkt::internal::UnknownEnumValue::String(value.to_string()),
2218 )),
2219 }
2220 }
2221 }
2222
2223 impl serde::ser::Serialize for AppEngineIntegrationMode {
2224 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2225 where
2226 S: serde::Serializer,
2227 {
2228 match self {
2229 Self::Unspecified => serializer.serialize_i32(0),
2230 Self::Enabled => serializer.serialize_i32(1),
2231 Self::Disabled => serializer.serialize_i32(2),
2232 Self::UnknownValue(u) => u.0.serialize(serializer),
2233 }
2234 }
2235 }
2236
2237 impl<'de> serde::de::Deserialize<'de> for AppEngineIntegrationMode {
2238 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2239 where
2240 D: serde::Deserializer<'de>,
2241 {
2242 deserializer.deserialize_any(
2243 wkt::internal::EnumVisitor::<AppEngineIntegrationMode>::new(
2244 ".google.firestore.admin.v1.Database.AppEngineIntegrationMode",
2245 ),
2246 )
2247 }
2248 }
2249
2250 /// The delete protection state of the database.
2251 ///
2252 /// # Working with unknown values
2253 ///
2254 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2255 /// additional enum variants at any time. Adding new variants is not considered
2256 /// a breaking change. Applications should write their code in anticipation of:
2257 ///
2258 /// - New values appearing in future releases of the client library, **and**
2259 /// - New values received dynamically, without application changes.
2260 ///
2261 /// Please consult the [Working with enums] section in the user guide for some
2262 /// guidelines.
2263 ///
2264 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2265 #[derive(Clone, Debug, PartialEq)]
2266 #[non_exhaustive]
2267 pub enum DeleteProtectionState {
2268 /// The default value. Delete protection type is not specified
2269 Unspecified,
2270 /// Delete protection is disabled
2271 DeleteProtectionDisabled,
2272 /// Delete protection is enabled
2273 DeleteProtectionEnabled,
2274 /// If set, the enum was initialized with an unknown value.
2275 ///
2276 /// Applications can examine the value using [DeleteProtectionState::value] or
2277 /// [DeleteProtectionState::name].
2278 UnknownValue(delete_protection_state::UnknownValue),
2279 }
2280
2281 #[doc(hidden)]
2282 pub mod delete_protection_state {
2283 #[allow(unused_imports)]
2284 use super::*;
2285 #[derive(Clone, Debug, PartialEq)]
2286 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2287 }
2288
2289 impl DeleteProtectionState {
2290 /// Gets the enum value.
2291 ///
2292 /// Returns `None` if the enum contains an unknown value deserialized from
2293 /// the string representation of enums.
2294 pub fn value(&self) -> std::option::Option<i32> {
2295 match self {
2296 Self::Unspecified => std::option::Option::Some(0),
2297 Self::DeleteProtectionDisabled => std::option::Option::Some(1),
2298 Self::DeleteProtectionEnabled => std::option::Option::Some(2),
2299 Self::UnknownValue(u) => u.0.value(),
2300 }
2301 }
2302
2303 /// Gets the enum value as a string.
2304 ///
2305 /// Returns `None` if the enum contains an unknown value deserialized from
2306 /// the integer representation of enums.
2307 pub fn name(&self) -> std::option::Option<&str> {
2308 match self {
2309 Self::Unspecified => {
2310 std::option::Option::Some("DELETE_PROTECTION_STATE_UNSPECIFIED")
2311 }
2312 Self::DeleteProtectionDisabled => {
2313 std::option::Option::Some("DELETE_PROTECTION_DISABLED")
2314 }
2315 Self::DeleteProtectionEnabled => {
2316 std::option::Option::Some("DELETE_PROTECTION_ENABLED")
2317 }
2318 Self::UnknownValue(u) => u.0.name(),
2319 }
2320 }
2321 }
2322
2323 impl std::default::Default for DeleteProtectionState {
2324 fn default() -> Self {
2325 use std::convert::From;
2326 Self::from(0)
2327 }
2328 }
2329
2330 impl std::fmt::Display for DeleteProtectionState {
2331 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2332 wkt::internal::display_enum(f, self.name(), self.value())
2333 }
2334 }
2335
2336 impl std::convert::From<i32> for DeleteProtectionState {
2337 fn from(value: i32) -> Self {
2338 match value {
2339 0 => Self::Unspecified,
2340 1 => Self::DeleteProtectionDisabled,
2341 2 => Self::DeleteProtectionEnabled,
2342 _ => Self::UnknownValue(delete_protection_state::UnknownValue(
2343 wkt::internal::UnknownEnumValue::Integer(value),
2344 )),
2345 }
2346 }
2347 }
2348
2349 impl std::convert::From<&str> for DeleteProtectionState {
2350 fn from(value: &str) -> Self {
2351 use std::string::ToString;
2352 match value {
2353 "DELETE_PROTECTION_STATE_UNSPECIFIED" => Self::Unspecified,
2354 "DELETE_PROTECTION_DISABLED" => Self::DeleteProtectionDisabled,
2355 "DELETE_PROTECTION_ENABLED" => Self::DeleteProtectionEnabled,
2356 _ => Self::UnknownValue(delete_protection_state::UnknownValue(
2357 wkt::internal::UnknownEnumValue::String(value.to_string()),
2358 )),
2359 }
2360 }
2361 }
2362
2363 impl serde::ser::Serialize for DeleteProtectionState {
2364 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2365 where
2366 S: serde::Serializer,
2367 {
2368 match self {
2369 Self::Unspecified => serializer.serialize_i32(0),
2370 Self::DeleteProtectionDisabled => serializer.serialize_i32(1),
2371 Self::DeleteProtectionEnabled => serializer.serialize_i32(2),
2372 Self::UnknownValue(u) => u.0.serialize(serializer),
2373 }
2374 }
2375 }
2376
2377 impl<'de> serde::de::Deserialize<'de> for DeleteProtectionState {
2378 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2379 where
2380 D: serde::Deserializer<'de>,
2381 {
2382 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeleteProtectionState>::new(
2383 ".google.firestore.admin.v1.Database.DeleteProtectionState",
2384 ))
2385 }
2386 }
2387
2388 /// The edition of the database.
2389 ///
2390 /// # Working with unknown values
2391 ///
2392 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2393 /// additional enum variants at any time. Adding new variants is not considered
2394 /// a breaking change. Applications should write their code in anticipation of:
2395 ///
2396 /// - New values appearing in future releases of the client library, **and**
2397 /// - New values received dynamically, without application changes.
2398 ///
2399 /// Please consult the [Working with enums] section in the user guide for some
2400 /// guidelines.
2401 ///
2402 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2403 #[derive(Clone, Debug, PartialEq)]
2404 #[non_exhaustive]
2405 pub enum DatabaseEdition {
2406 /// Not used.
2407 Unspecified,
2408 /// Standard edition.
2409 ///
2410 /// This is the default setting if not specified.
2411 Standard,
2412 /// Enterprise edition.
2413 Enterprise,
2414 /// If set, the enum was initialized with an unknown value.
2415 ///
2416 /// Applications can examine the value using [DatabaseEdition::value] or
2417 /// [DatabaseEdition::name].
2418 UnknownValue(database_edition::UnknownValue),
2419 }
2420
2421 #[doc(hidden)]
2422 pub mod database_edition {
2423 #[allow(unused_imports)]
2424 use super::*;
2425 #[derive(Clone, Debug, PartialEq)]
2426 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2427 }
2428
2429 impl DatabaseEdition {
2430 /// Gets the enum value.
2431 ///
2432 /// Returns `None` if the enum contains an unknown value deserialized from
2433 /// the string representation of enums.
2434 pub fn value(&self) -> std::option::Option<i32> {
2435 match self {
2436 Self::Unspecified => std::option::Option::Some(0),
2437 Self::Standard => std::option::Option::Some(1),
2438 Self::Enterprise => std::option::Option::Some(2),
2439 Self::UnknownValue(u) => u.0.value(),
2440 }
2441 }
2442
2443 /// Gets the enum value as a string.
2444 ///
2445 /// Returns `None` if the enum contains an unknown value deserialized from
2446 /// the integer representation of enums.
2447 pub fn name(&self) -> std::option::Option<&str> {
2448 match self {
2449 Self::Unspecified => std::option::Option::Some("DATABASE_EDITION_UNSPECIFIED"),
2450 Self::Standard => std::option::Option::Some("STANDARD"),
2451 Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
2452 Self::UnknownValue(u) => u.0.name(),
2453 }
2454 }
2455 }
2456
2457 impl std::default::Default for DatabaseEdition {
2458 fn default() -> Self {
2459 use std::convert::From;
2460 Self::from(0)
2461 }
2462 }
2463
2464 impl std::fmt::Display for DatabaseEdition {
2465 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2466 wkt::internal::display_enum(f, self.name(), self.value())
2467 }
2468 }
2469
2470 impl std::convert::From<i32> for DatabaseEdition {
2471 fn from(value: i32) -> Self {
2472 match value {
2473 0 => Self::Unspecified,
2474 1 => Self::Standard,
2475 2 => Self::Enterprise,
2476 _ => Self::UnknownValue(database_edition::UnknownValue(
2477 wkt::internal::UnknownEnumValue::Integer(value),
2478 )),
2479 }
2480 }
2481 }
2482
2483 impl std::convert::From<&str> for DatabaseEdition {
2484 fn from(value: &str) -> Self {
2485 use std::string::ToString;
2486 match value {
2487 "DATABASE_EDITION_UNSPECIFIED" => Self::Unspecified,
2488 "STANDARD" => Self::Standard,
2489 "ENTERPRISE" => Self::Enterprise,
2490 _ => Self::UnknownValue(database_edition::UnknownValue(
2491 wkt::internal::UnknownEnumValue::String(value.to_string()),
2492 )),
2493 }
2494 }
2495 }
2496
2497 impl serde::ser::Serialize for DatabaseEdition {
2498 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2499 where
2500 S: serde::Serializer,
2501 {
2502 match self {
2503 Self::Unspecified => serializer.serialize_i32(0),
2504 Self::Standard => serializer.serialize_i32(1),
2505 Self::Enterprise => serializer.serialize_i32(2),
2506 Self::UnknownValue(u) => u.0.serialize(serializer),
2507 }
2508 }
2509 }
2510
2511 impl<'de> serde::de::Deserialize<'de> for DatabaseEdition {
2512 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2513 where
2514 D: serde::Deserializer<'de>,
2515 {
2516 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseEdition>::new(
2517 ".google.firestore.admin.v1.Database.DatabaseEdition",
2518 ))
2519 }
2520 }
2521
2522 /// The data access mode.
2523 ///
2524 /// # Working with unknown values
2525 ///
2526 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2527 /// additional enum variants at any time. Adding new variants is not considered
2528 /// a breaking change. Applications should write their code in anticipation of:
2529 ///
2530 /// - New values appearing in future releases of the client library, **and**
2531 /// - New values received dynamically, without application changes.
2532 ///
2533 /// Please consult the [Working with enums] section in the user guide for some
2534 /// guidelines.
2535 ///
2536 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2537 #[derive(Clone, Debug, PartialEq)]
2538 #[non_exhaustive]
2539 pub enum DataAccessMode {
2540 /// Not Used.
2541 Unspecified,
2542 /// Accessing the database through the API is allowed.
2543 Enabled,
2544 /// Accessing the database through the API is disallowed.
2545 Disabled,
2546 /// If set, the enum was initialized with an unknown value.
2547 ///
2548 /// Applications can examine the value using [DataAccessMode::value] or
2549 /// [DataAccessMode::name].
2550 UnknownValue(data_access_mode::UnknownValue),
2551 }
2552
2553 #[doc(hidden)]
2554 pub mod data_access_mode {
2555 #[allow(unused_imports)]
2556 use super::*;
2557 #[derive(Clone, Debug, PartialEq)]
2558 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2559 }
2560
2561 impl DataAccessMode {
2562 /// Gets the enum value.
2563 ///
2564 /// Returns `None` if the enum contains an unknown value deserialized from
2565 /// the string representation of enums.
2566 pub fn value(&self) -> std::option::Option<i32> {
2567 match self {
2568 Self::Unspecified => std::option::Option::Some(0),
2569 Self::Enabled => std::option::Option::Some(1),
2570 Self::Disabled => std::option::Option::Some(2),
2571 Self::UnknownValue(u) => u.0.value(),
2572 }
2573 }
2574
2575 /// Gets the enum value as a string.
2576 ///
2577 /// Returns `None` if the enum contains an unknown value deserialized from
2578 /// the integer representation of enums.
2579 pub fn name(&self) -> std::option::Option<&str> {
2580 match self {
2581 Self::Unspecified => std::option::Option::Some("DATA_ACCESS_MODE_UNSPECIFIED"),
2582 Self::Enabled => std::option::Option::Some("DATA_ACCESS_MODE_ENABLED"),
2583 Self::Disabled => std::option::Option::Some("DATA_ACCESS_MODE_DISABLED"),
2584 Self::UnknownValue(u) => u.0.name(),
2585 }
2586 }
2587 }
2588
2589 impl std::default::Default for DataAccessMode {
2590 fn default() -> Self {
2591 use std::convert::From;
2592 Self::from(0)
2593 }
2594 }
2595
2596 impl std::fmt::Display for DataAccessMode {
2597 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2598 wkt::internal::display_enum(f, self.name(), self.value())
2599 }
2600 }
2601
2602 impl std::convert::From<i32> for DataAccessMode {
2603 fn from(value: i32) -> Self {
2604 match value {
2605 0 => Self::Unspecified,
2606 1 => Self::Enabled,
2607 2 => Self::Disabled,
2608 _ => Self::UnknownValue(data_access_mode::UnknownValue(
2609 wkt::internal::UnknownEnumValue::Integer(value),
2610 )),
2611 }
2612 }
2613 }
2614
2615 impl std::convert::From<&str> for DataAccessMode {
2616 fn from(value: &str) -> Self {
2617 use std::string::ToString;
2618 match value {
2619 "DATA_ACCESS_MODE_UNSPECIFIED" => Self::Unspecified,
2620 "DATA_ACCESS_MODE_ENABLED" => Self::Enabled,
2621 "DATA_ACCESS_MODE_DISABLED" => Self::Disabled,
2622 _ => Self::UnknownValue(data_access_mode::UnknownValue(
2623 wkt::internal::UnknownEnumValue::String(value.to_string()),
2624 )),
2625 }
2626 }
2627 }
2628
2629 impl serde::ser::Serialize for DataAccessMode {
2630 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2631 where
2632 S: serde::Serializer,
2633 {
2634 match self {
2635 Self::Unspecified => serializer.serialize_i32(0),
2636 Self::Enabled => serializer.serialize_i32(1),
2637 Self::Disabled => serializer.serialize_i32(2),
2638 Self::UnknownValue(u) => u.0.serialize(serializer),
2639 }
2640 }
2641 }
2642
2643 impl<'de> serde::de::Deserialize<'de> for DataAccessMode {
2644 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2645 where
2646 D: serde::Deserializer<'de>,
2647 {
2648 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataAccessMode>::new(
2649 ".google.firestore.admin.v1.Database.DataAccessMode",
2650 ))
2651 }
2652 }
2653}
2654
2655/// Represents a single field in the database.
2656///
2657/// Fields are grouped by their "Collection Group", which represent all
2658/// collections in the database with the same ID.
2659#[derive(Clone, Default, PartialEq)]
2660#[non_exhaustive]
2661pub struct Field {
2662 /// Required. A field name of the form:
2663 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
2664 ///
2665 /// A field path can be a simple field name, e.g. `address` or a path to fields
2666 /// within `map_value` , e.g. `address.city`,
2667 /// or a special field path. The only valid special field is `*`, which
2668 /// represents any field.
2669 ///
2670 /// Field paths can be quoted using `` ` `` (backtick). The only character that
2671 /// must be escaped within a quoted field path is the backtick character
2672 /// itself, escaped using a backslash. Special characters in field paths that
2673 /// must be quoted include: `*`, `.`,
2674 /// `` ` `` (backtick), `[`, `]`, as well as any ascii symbolic characters.
2675 ///
2676 /// Examples:
2677 /// `` `address.city` `` represents a field named `address.city`, not the map
2678 /// key `city` in the field `address`. `` `*` `` represents a field named `*`,
2679 /// not any field.
2680 ///
2681 /// A special `Field` contains the default indexing settings for all fields.
2682 /// This field's resource name is:
2683 /// `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`
2684 /// Indexes defined on this `Field` will be applied to all fields which do not
2685 /// have their own `Field` index configuration.
2686 pub name: std::string::String,
2687
2688 /// The index configuration for this field. If unset, field indexing will
2689 /// revert to the configuration defined by the `ancestor_field`. To
2690 /// explicitly remove all indexes for this field, specify an index config
2691 /// with an empty list of indexes.
2692 pub index_config: std::option::Option<crate::model::field::IndexConfig>,
2693
2694 /// The TTL configuration for this `Field`.
2695 /// Setting or unsetting this will enable or disable the TTL for
2696 /// documents that have this `Field`.
2697 pub ttl_config: std::option::Option<crate::model::field::TtlConfig>,
2698
2699 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2700}
2701
2702impl Field {
2703 pub fn new() -> Self {
2704 std::default::Default::default()
2705 }
2706
2707 /// Sets the value of [name][crate::model::Field::name].
2708 ///
2709 /// # Example
2710 /// ```ignore,no_run
2711 /// # use google_cloud_firestore_admin_v1::model::Field;
2712 /// let x = Field::new().set_name("example");
2713 /// ```
2714 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2715 self.name = v.into();
2716 self
2717 }
2718
2719 /// Sets the value of [index_config][crate::model::Field::index_config].
2720 ///
2721 /// # Example
2722 /// ```ignore,no_run
2723 /// # use google_cloud_firestore_admin_v1::model::Field;
2724 /// use google_cloud_firestore_admin_v1::model::field::IndexConfig;
2725 /// let x = Field::new().set_index_config(IndexConfig::default()/* use setters */);
2726 /// ```
2727 pub fn set_index_config<T>(mut self, v: T) -> Self
2728 where
2729 T: std::convert::Into<crate::model::field::IndexConfig>,
2730 {
2731 self.index_config = std::option::Option::Some(v.into());
2732 self
2733 }
2734
2735 /// Sets or clears the value of [index_config][crate::model::Field::index_config].
2736 ///
2737 /// # Example
2738 /// ```ignore,no_run
2739 /// # use google_cloud_firestore_admin_v1::model::Field;
2740 /// use google_cloud_firestore_admin_v1::model::field::IndexConfig;
2741 /// let x = Field::new().set_or_clear_index_config(Some(IndexConfig::default()/* use setters */));
2742 /// let x = Field::new().set_or_clear_index_config(None::<IndexConfig>);
2743 /// ```
2744 pub fn set_or_clear_index_config<T>(mut self, v: std::option::Option<T>) -> Self
2745 where
2746 T: std::convert::Into<crate::model::field::IndexConfig>,
2747 {
2748 self.index_config = v.map(|x| x.into());
2749 self
2750 }
2751
2752 /// Sets the value of [ttl_config][crate::model::Field::ttl_config].
2753 ///
2754 /// # Example
2755 /// ```ignore,no_run
2756 /// # use google_cloud_firestore_admin_v1::model::Field;
2757 /// use google_cloud_firestore_admin_v1::model::field::TtlConfig;
2758 /// let x = Field::new().set_ttl_config(TtlConfig::default()/* use setters */);
2759 /// ```
2760 pub fn set_ttl_config<T>(mut self, v: T) -> Self
2761 where
2762 T: std::convert::Into<crate::model::field::TtlConfig>,
2763 {
2764 self.ttl_config = std::option::Option::Some(v.into());
2765 self
2766 }
2767
2768 /// Sets or clears the value of [ttl_config][crate::model::Field::ttl_config].
2769 ///
2770 /// # Example
2771 /// ```ignore,no_run
2772 /// # use google_cloud_firestore_admin_v1::model::Field;
2773 /// use google_cloud_firestore_admin_v1::model::field::TtlConfig;
2774 /// let x = Field::new().set_or_clear_ttl_config(Some(TtlConfig::default()/* use setters */));
2775 /// let x = Field::new().set_or_clear_ttl_config(None::<TtlConfig>);
2776 /// ```
2777 pub fn set_or_clear_ttl_config<T>(mut self, v: std::option::Option<T>) -> Self
2778 where
2779 T: std::convert::Into<crate::model::field::TtlConfig>,
2780 {
2781 self.ttl_config = v.map(|x| x.into());
2782 self
2783 }
2784}
2785
2786impl wkt::message::Message for Field {
2787 fn typename() -> &'static str {
2788 "type.googleapis.com/google.firestore.admin.v1.Field"
2789 }
2790}
2791
2792/// Defines additional types related to [Field].
2793pub mod field {
2794 #[allow(unused_imports)]
2795 use super::*;
2796
2797 /// The index configuration for this field.
2798 #[derive(Clone, Default, PartialEq)]
2799 #[non_exhaustive]
2800 pub struct IndexConfig {
2801 /// The indexes supported for this field.
2802 pub indexes: std::vec::Vec<crate::model::Index>,
2803
2804 /// Output only. When true, the `Field`'s index configuration is set from the
2805 /// configuration specified by the `ancestor_field`.
2806 /// When false, the `Field`'s index configuration is defined explicitly.
2807 pub uses_ancestor_config: bool,
2808
2809 /// Output only. Specifies the resource name of the `Field` from which this
2810 /// field's index configuration is set (when `uses_ancestor_config` is true),
2811 /// or from which it *would* be set if this field had no index configuration
2812 /// (when `uses_ancestor_config` is false).
2813 pub ancestor_field: std::string::String,
2814
2815 /// Output only
2816 /// When true, the `Field`'s index configuration is in the process of being
2817 /// reverted. Once complete, the index config will transition to the same
2818 /// state as the field specified by `ancestor_field`, at which point
2819 /// `uses_ancestor_config` will be `true` and `reverting` will be `false`.
2820 pub reverting: bool,
2821
2822 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2823 }
2824
2825 impl IndexConfig {
2826 pub fn new() -> Self {
2827 std::default::Default::default()
2828 }
2829
2830 /// Sets the value of [indexes][crate::model::field::IndexConfig::indexes].
2831 ///
2832 /// # Example
2833 /// ```ignore,no_run
2834 /// # use google_cloud_firestore_admin_v1::model::field::IndexConfig;
2835 /// use google_cloud_firestore_admin_v1::model::Index;
2836 /// let x = IndexConfig::new()
2837 /// .set_indexes([
2838 /// Index::default()/* use setters */,
2839 /// Index::default()/* use (different) setters */,
2840 /// ]);
2841 /// ```
2842 pub fn set_indexes<T, V>(mut self, v: T) -> Self
2843 where
2844 T: std::iter::IntoIterator<Item = V>,
2845 V: std::convert::Into<crate::model::Index>,
2846 {
2847 use std::iter::Iterator;
2848 self.indexes = v.into_iter().map(|i| i.into()).collect();
2849 self
2850 }
2851
2852 /// Sets the value of [uses_ancestor_config][crate::model::field::IndexConfig::uses_ancestor_config].
2853 ///
2854 /// # Example
2855 /// ```ignore,no_run
2856 /// # use google_cloud_firestore_admin_v1::model::field::IndexConfig;
2857 /// let x = IndexConfig::new().set_uses_ancestor_config(true);
2858 /// ```
2859 pub fn set_uses_ancestor_config<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2860 self.uses_ancestor_config = v.into();
2861 self
2862 }
2863
2864 /// Sets the value of [ancestor_field][crate::model::field::IndexConfig::ancestor_field].
2865 ///
2866 /// # Example
2867 /// ```ignore,no_run
2868 /// # use google_cloud_firestore_admin_v1::model::field::IndexConfig;
2869 /// let x = IndexConfig::new().set_ancestor_field("example");
2870 /// ```
2871 pub fn set_ancestor_field<T: std::convert::Into<std::string::String>>(
2872 mut self,
2873 v: T,
2874 ) -> Self {
2875 self.ancestor_field = v.into();
2876 self
2877 }
2878
2879 /// Sets the value of [reverting][crate::model::field::IndexConfig::reverting].
2880 ///
2881 /// # Example
2882 /// ```ignore,no_run
2883 /// # use google_cloud_firestore_admin_v1::model::field::IndexConfig;
2884 /// let x = IndexConfig::new().set_reverting(true);
2885 /// ```
2886 pub fn set_reverting<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2887 self.reverting = v.into();
2888 self
2889 }
2890 }
2891
2892 impl wkt::message::Message for IndexConfig {
2893 fn typename() -> &'static str {
2894 "type.googleapis.com/google.firestore.admin.v1.Field.IndexConfig"
2895 }
2896 }
2897
2898 /// The TTL (time-to-live) configuration for documents that have this `Field`
2899 /// set.
2900 ///
2901 /// Storing a timestamp value into a TTL-enabled field will be treated as
2902 /// the document's absolute expiration time. For Enterprise edition databases,
2903 /// the timestamp value may also be stored in an array value in the
2904 /// TTL-enabled field.
2905 ///
2906 /// Timestamp values in the past indicate that the document is eligible for
2907 /// immediate expiration. Using any other data type or leaving the field absent
2908 /// will disable expiration for the individual document.
2909 #[derive(Clone, Default, PartialEq)]
2910 #[non_exhaustive]
2911 pub struct TtlConfig {
2912 /// Output only. The state of the TTL configuration.
2913 pub state: crate::model::field::ttl_config::State,
2914
2915 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2916 }
2917
2918 impl TtlConfig {
2919 pub fn new() -> Self {
2920 std::default::Default::default()
2921 }
2922
2923 /// Sets the value of [state][crate::model::field::TtlConfig::state].
2924 ///
2925 /// # Example
2926 /// ```ignore,no_run
2927 /// # use google_cloud_firestore_admin_v1::model::field::TtlConfig;
2928 /// use google_cloud_firestore_admin_v1::model::field::ttl_config::State;
2929 /// let x0 = TtlConfig::new().set_state(State::Creating);
2930 /// let x1 = TtlConfig::new().set_state(State::Active);
2931 /// let x2 = TtlConfig::new().set_state(State::NeedsRepair);
2932 /// ```
2933 pub fn set_state<T: std::convert::Into<crate::model::field::ttl_config::State>>(
2934 mut self,
2935 v: T,
2936 ) -> Self {
2937 self.state = v.into();
2938 self
2939 }
2940 }
2941
2942 impl wkt::message::Message for TtlConfig {
2943 fn typename() -> &'static str {
2944 "type.googleapis.com/google.firestore.admin.v1.Field.TtlConfig"
2945 }
2946 }
2947
2948 /// Defines additional types related to [TtlConfig].
2949 pub mod ttl_config {
2950 #[allow(unused_imports)]
2951 use super::*;
2952
2953 /// The state of applying the TTL configuration to all documents.
2954 ///
2955 /// # Working with unknown values
2956 ///
2957 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2958 /// additional enum variants at any time. Adding new variants is not considered
2959 /// a breaking change. Applications should write their code in anticipation of:
2960 ///
2961 /// - New values appearing in future releases of the client library, **and**
2962 /// - New values received dynamically, without application changes.
2963 ///
2964 /// Please consult the [Working with enums] section in the user guide for some
2965 /// guidelines.
2966 ///
2967 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2968 #[derive(Clone, Debug, PartialEq)]
2969 #[non_exhaustive]
2970 pub enum State {
2971 /// The state is unspecified or unknown.
2972 Unspecified,
2973 /// The TTL is being applied. There is an active long-running operation to
2974 /// track the change. Newly written documents will have TTLs applied as
2975 /// requested. Requested TTLs on existing documents are still being
2976 /// processed. When TTLs on all existing documents have been processed, the
2977 /// state will move to 'ACTIVE'.
2978 Creating,
2979 /// The TTL is active for all documents.
2980 Active,
2981 /// The TTL configuration could not be enabled for all existing documents.
2982 /// Newly written documents will continue to have their TTL applied.
2983 /// The LRO returned when last attempting to enable TTL for this `Field`
2984 /// has failed, and may have more details.
2985 NeedsRepair,
2986 /// If set, the enum was initialized with an unknown value.
2987 ///
2988 /// Applications can examine the value using [State::value] or
2989 /// [State::name].
2990 UnknownValue(state::UnknownValue),
2991 }
2992
2993 #[doc(hidden)]
2994 pub mod state {
2995 #[allow(unused_imports)]
2996 use super::*;
2997 #[derive(Clone, Debug, PartialEq)]
2998 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2999 }
3000
3001 impl State {
3002 /// Gets the enum value.
3003 ///
3004 /// Returns `None` if the enum contains an unknown value deserialized from
3005 /// the string representation of enums.
3006 pub fn value(&self) -> std::option::Option<i32> {
3007 match self {
3008 Self::Unspecified => std::option::Option::Some(0),
3009 Self::Creating => std::option::Option::Some(1),
3010 Self::Active => std::option::Option::Some(2),
3011 Self::NeedsRepair => std::option::Option::Some(3),
3012 Self::UnknownValue(u) => u.0.value(),
3013 }
3014 }
3015
3016 /// Gets the enum value as a string.
3017 ///
3018 /// Returns `None` if the enum contains an unknown value deserialized from
3019 /// the integer representation of enums.
3020 pub fn name(&self) -> std::option::Option<&str> {
3021 match self {
3022 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3023 Self::Creating => std::option::Option::Some("CREATING"),
3024 Self::Active => std::option::Option::Some("ACTIVE"),
3025 Self::NeedsRepair => std::option::Option::Some("NEEDS_REPAIR"),
3026 Self::UnknownValue(u) => u.0.name(),
3027 }
3028 }
3029 }
3030
3031 impl std::default::Default for State {
3032 fn default() -> Self {
3033 use std::convert::From;
3034 Self::from(0)
3035 }
3036 }
3037
3038 impl std::fmt::Display for State {
3039 fn fmt(
3040 &self,
3041 f: &mut std::fmt::Formatter<'_>,
3042 ) -> std::result::Result<(), std::fmt::Error> {
3043 wkt::internal::display_enum(f, self.name(), self.value())
3044 }
3045 }
3046
3047 impl std::convert::From<i32> for State {
3048 fn from(value: i32) -> Self {
3049 match value {
3050 0 => Self::Unspecified,
3051 1 => Self::Creating,
3052 2 => Self::Active,
3053 3 => Self::NeedsRepair,
3054 _ => Self::UnknownValue(state::UnknownValue(
3055 wkt::internal::UnknownEnumValue::Integer(value),
3056 )),
3057 }
3058 }
3059 }
3060
3061 impl std::convert::From<&str> for State {
3062 fn from(value: &str) -> Self {
3063 use std::string::ToString;
3064 match value {
3065 "STATE_UNSPECIFIED" => Self::Unspecified,
3066 "CREATING" => Self::Creating,
3067 "ACTIVE" => Self::Active,
3068 "NEEDS_REPAIR" => Self::NeedsRepair,
3069 _ => Self::UnknownValue(state::UnknownValue(
3070 wkt::internal::UnknownEnumValue::String(value.to_string()),
3071 )),
3072 }
3073 }
3074 }
3075
3076 impl serde::ser::Serialize for State {
3077 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3078 where
3079 S: serde::Serializer,
3080 {
3081 match self {
3082 Self::Unspecified => serializer.serialize_i32(0),
3083 Self::Creating => serializer.serialize_i32(1),
3084 Self::Active => serializer.serialize_i32(2),
3085 Self::NeedsRepair => serializer.serialize_i32(3),
3086 Self::UnknownValue(u) => u.0.serialize(serializer),
3087 }
3088 }
3089 }
3090
3091 impl<'de> serde::de::Deserialize<'de> for State {
3092 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3093 where
3094 D: serde::Deserializer<'de>,
3095 {
3096 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3097 ".google.firestore.admin.v1.Field.TtlConfig.State",
3098 ))
3099 }
3100 }
3101 }
3102}
3103
3104/// A request to list the Firestore Databases in all locations for a project.
3105#[derive(Clone, Default, PartialEq)]
3106#[non_exhaustive]
3107pub struct ListDatabasesRequest {
3108 /// Required. A parent name of the form
3109 /// `projects/{project_id}`
3110 pub parent: std::string::String,
3111
3112 /// If true, also returns deleted resources.
3113 pub show_deleted: bool,
3114
3115 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3116}
3117
3118impl ListDatabasesRequest {
3119 pub fn new() -> Self {
3120 std::default::Default::default()
3121 }
3122
3123 /// Sets the value of [parent][crate::model::ListDatabasesRequest::parent].
3124 ///
3125 /// # Example
3126 /// ```ignore,no_run
3127 /// # use google_cloud_firestore_admin_v1::model::ListDatabasesRequest;
3128 /// let x = ListDatabasesRequest::new().set_parent("example");
3129 /// ```
3130 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3131 self.parent = v.into();
3132 self
3133 }
3134
3135 /// Sets the value of [show_deleted][crate::model::ListDatabasesRequest::show_deleted].
3136 ///
3137 /// # Example
3138 /// ```ignore,no_run
3139 /// # use google_cloud_firestore_admin_v1::model::ListDatabasesRequest;
3140 /// let x = ListDatabasesRequest::new().set_show_deleted(true);
3141 /// ```
3142 pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3143 self.show_deleted = v.into();
3144 self
3145 }
3146}
3147
3148impl wkt::message::Message for ListDatabasesRequest {
3149 fn typename() -> &'static str {
3150 "type.googleapis.com/google.firestore.admin.v1.ListDatabasesRequest"
3151 }
3152}
3153
3154/// The request for
3155/// [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.CreateDatabase].
3156///
3157/// [google.firestore.admin.v1.FirestoreAdmin.CreateDatabase]: crate::client::FirestoreAdmin::create_database
3158#[derive(Clone, Default, PartialEq)]
3159#[non_exhaustive]
3160pub struct CreateDatabaseRequest {
3161 /// Required. A parent name of the form
3162 /// `projects/{project_id}`
3163 pub parent: std::string::String,
3164
3165 /// Required. The Database to create.
3166 pub database: std::option::Option<crate::model::Database>,
3167
3168 /// Required. The ID to use for the database, which will become the final
3169 /// component of the database's resource name.
3170 ///
3171 /// This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
3172 /// with first character a letter and the last a letter or a number. Must not
3173 /// be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
3174 ///
3175 /// "(default)" database ID is also valid if the database is Standard edition.
3176 pub database_id: std::string::String,
3177
3178 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3179}
3180
3181impl CreateDatabaseRequest {
3182 pub fn new() -> Self {
3183 std::default::Default::default()
3184 }
3185
3186 /// Sets the value of [parent][crate::model::CreateDatabaseRequest::parent].
3187 ///
3188 /// # Example
3189 /// ```ignore,no_run
3190 /// # use google_cloud_firestore_admin_v1::model::CreateDatabaseRequest;
3191 /// let x = CreateDatabaseRequest::new().set_parent("example");
3192 /// ```
3193 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3194 self.parent = v.into();
3195 self
3196 }
3197
3198 /// Sets the value of [database][crate::model::CreateDatabaseRequest::database].
3199 ///
3200 /// # Example
3201 /// ```ignore,no_run
3202 /// # use google_cloud_firestore_admin_v1::model::CreateDatabaseRequest;
3203 /// use google_cloud_firestore_admin_v1::model::Database;
3204 /// let x = CreateDatabaseRequest::new().set_database(Database::default()/* use setters */);
3205 /// ```
3206 pub fn set_database<T>(mut self, v: T) -> Self
3207 where
3208 T: std::convert::Into<crate::model::Database>,
3209 {
3210 self.database = std::option::Option::Some(v.into());
3211 self
3212 }
3213
3214 /// Sets or clears the value of [database][crate::model::CreateDatabaseRequest::database].
3215 ///
3216 /// # Example
3217 /// ```ignore,no_run
3218 /// # use google_cloud_firestore_admin_v1::model::CreateDatabaseRequest;
3219 /// use google_cloud_firestore_admin_v1::model::Database;
3220 /// let x = CreateDatabaseRequest::new().set_or_clear_database(Some(Database::default()/* use setters */));
3221 /// let x = CreateDatabaseRequest::new().set_or_clear_database(None::<Database>);
3222 /// ```
3223 pub fn set_or_clear_database<T>(mut self, v: std::option::Option<T>) -> Self
3224 where
3225 T: std::convert::Into<crate::model::Database>,
3226 {
3227 self.database = v.map(|x| x.into());
3228 self
3229 }
3230
3231 /// Sets the value of [database_id][crate::model::CreateDatabaseRequest::database_id].
3232 ///
3233 /// # Example
3234 /// ```ignore,no_run
3235 /// # use google_cloud_firestore_admin_v1::model::CreateDatabaseRequest;
3236 /// let x = CreateDatabaseRequest::new().set_database_id("example");
3237 /// ```
3238 pub fn set_database_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3239 self.database_id = v.into();
3240 self
3241 }
3242}
3243
3244impl wkt::message::Message for CreateDatabaseRequest {
3245 fn typename() -> &'static str {
3246 "type.googleapis.com/google.firestore.admin.v1.CreateDatabaseRequest"
3247 }
3248}
3249
3250/// Metadata related to the create database operation.
3251#[derive(Clone, Default, PartialEq)]
3252#[non_exhaustive]
3253pub struct CreateDatabaseMetadata {
3254 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3255}
3256
3257impl CreateDatabaseMetadata {
3258 pub fn new() -> Self {
3259 std::default::Default::default()
3260 }
3261}
3262
3263impl wkt::message::Message for CreateDatabaseMetadata {
3264 fn typename() -> &'static str {
3265 "type.googleapis.com/google.firestore.admin.v1.CreateDatabaseMetadata"
3266 }
3267}
3268
3269/// The list of databases for a project.
3270#[derive(Clone, Default, PartialEq)]
3271#[non_exhaustive]
3272pub struct ListDatabasesResponse {
3273 /// The databases in the project.
3274 pub databases: std::vec::Vec<crate::model::Database>,
3275
3276 /// In the event that data about individual databases cannot be listed they
3277 /// will be recorded here.
3278 ///
3279 /// An example entry might be: projects/some_project/locations/some_location
3280 /// This can happen if the Cloud Region that the Database resides in is
3281 /// currently unavailable. In this case we can't fetch all the details about
3282 /// the database. You may be able to get a more detailed error message
3283 /// (or possibly fetch the resource) by sending a 'Get' request for the
3284 /// resource or a 'List' request for the specific location.
3285 pub unreachable: std::vec::Vec<std::string::String>,
3286
3287 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3288}
3289
3290impl ListDatabasesResponse {
3291 pub fn new() -> Self {
3292 std::default::Default::default()
3293 }
3294
3295 /// Sets the value of [databases][crate::model::ListDatabasesResponse::databases].
3296 ///
3297 /// # Example
3298 /// ```ignore,no_run
3299 /// # use google_cloud_firestore_admin_v1::model::ListDatabasesResponse;
3300 /// use google_cloud_firestore_admin_v1::model::Database;
3301 /// let x = ListDatabasesResponse::new()
3302 /// .set_databases([
3303 /// Database::default()/* use setters */,
3304 /// Database::default()/* use (different) setters */,
3305 /// ]);
3306 /// ```
3307 pub fn set_databases<T, V>(mut self, v: T) -> Self
3308 where
3309 T: std::iter::IntoIterator<Item = V>,
3310 V: std::convert::Into<crate::model::Database>,
3311 {
3312 use std::iter::Iterator;
3313 self.databases = v.into_iter().map(|i| i.into()).collect();
3314 self
3315 }
3316
3317 /// Sets the value of [unreachable][crate::model::ListDatabasesResponse::unreachable].
3318 ///
3319 /// # Example
3320 /// ```ignore,no_run
3321 /// # use google_cloud_firestore_admin_v1::model::ListDatabasesResponse;
3322 /// let x = ListDatabasesResponse::new().set_unreachable(["a", "b", "c"]);
3323 /// ```
3324 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3325 where
3326 T: std::iter::IntoIterator<Item = V>,
3327 V: std::convert::Into<std::string::String>,
3328 {
3329 use std::iter::Iterator;
3330 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3331 self
3332 }
3333}
3334
3335impl wkt::message::Message for ListDatabasesResponse {
3336 fn typename() -> &'static str {
3337 "type.googleapis.com/google.firestore.admin.v1.ListDatabasesResponse"
3338 }
3339}
3340
3341/// The request for
3342/// [FirestoreAdmin.GetDatabase][google.firestore.admin.v1.FirestoreAdmin.GetDatabase].
3343///
3344/// [google.firestore.admin.v1.FirestoreAdmin.GetDatabase]: crate::client::FirestoreAdmin::get_database
3345#[derive(Clone, Default, PartialEq)]
3346#[non_exhaustive]
3347pub struct GetDatabaseRequest {
3348 /// Required. A name of the form
3349 /// `projects/{project_id}/databases/{database_id}`
3350 pub name: std::string::String,
3351
3352 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3353}
3354
3355impl GetDatabaseRequest {
3356 pub fn new() -> Self {
3357 std::default::Default::default()
3358 }
3359
3360 /// Sets the value of [name][crate::model::GetDatabaseRequest::name].
3361 ///
3362 /// # Example
3363 /// ```ignore,no_run
3364 /// # use google_cloud_firestore_admin_v1::model::GetDatabaseRequest;
3365 /// let x = GetDatabaseRequest::new().set_name("example");
3366 /// ```
3367 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3368 self.name = v.into();
3369 self
3370 }
3371}
3372
3373impl wkt::message::Message for GetDatabaseRequest {
3374 fn typename() -> &'static str {
3375 "type.googleapis.com/google.firestore.admin.v1.GetDatabaseRequest"
3376 }
3377}
3378
3379/// The request for
3380/// [FirestoreAdmin.UpdateDatabase][google.firestore.admin.v1.FirestoreAdmin.UpdateDatabase].
3381///
3382/// [google.firestore.admin.v1.FirestoreAdmin.UpdateDatabase]: crate::client::FirestoreAdmin::update_database
3383#[derive(Clone, Default, PartialEq)]
3384#[non_exhaustive]
3385pub struct UpdateDatabaseRequest {
3386 /// Required. The database to update.
3387 pub database: std::option::Option<crate::model::Database>,
3388
3389 /// The list of fields to be updated.
3390 pub update_mask: std::option::Option<wkt::FieldMask>,
3391
3392 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3393}
3394
3395impl UpdateDatabaseRequest {
3396 pub fn new() -> Self {
3397 std::default::Default::default()
3398 }
3399
3400 /// Sets the value of [database][crate::model::UpdateDatabaseRequest::database].
3401 ///
3402 /// # Example
3403 /// ```ignore,no_run
3404 /// # use google_cloud_firestore_admin_v1::model::UpdateDatabaseRequest;
3405 /// use google_cloud_firestore_admin_v1::model::Database;
3406 /// let x = UpdateDatabaseRequest::new().set_database(Database::default()/* use setters */);
3407 /// ```
3408 pub fn set_database<T>(mut self, v: T) -> Self
3409 where
3410 T: std::convert::Into<crate::model::Database>,
3411 {
3412 self.database = std::option::Option::Some(v.into());
3413 self
3414 }
3415
3416 /// Sets or clears the value of [database][crate::model::UpdateDatabaseRequest::database].
3417 ///
3418 /// # Example
3419 /// ```ignore,no_run
3420 /// # use google_cloud_firestore_admin_v1::model::UpdateDatabaseRequest;
3421 /// use google_cloud_firestore_admin_v1::model::Database;
3422 /// let x = UpdateDatabaseRequest::new().set_or_clear_database(Some(Database::default()/* use setters */));
3423 /// let x = UpdateDatabaseRequest::new().set_or_clear_database(None::<Database>);
3424 /// ```
3425 pub fn set_or_clear_database<T>(mut self, v: std::option::Option<T>) -> Self
3426 where
3427 T: std::convert::Into<crate::model::Database>,
3428 {
3429 self.database = v.map(|x| x.into());
3430 self
3431 }
3432
3433 /// Sets the value of [update_mask][crate::model::UpdateDatabaseRequest::update_mask].
3434 ///
3435 /// # Example
3436 /// ```ignore,no_run
3437 /// # use google_cloud_firestore_admin_v1::model::UpdateDatabaseRequest;
3438 /// use wkt::FieldMask;
3439 /// let x = UpdateDatabaseRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3440 /// ```
3441 pub fn set_update_mask<T>(mut self, v: T) -> Self
3442 where
3443 T: std::convert::Into<wkt::FieldMask>,
3444 {
3445 self.update_mask = std::option::Option::Some(v.into());
3446 self
3447 }
3448
3449 /// Sets or clears the value of [update_mask][crate::model::UpdateDatabaseRequest::update_mask].
3450 ///
3451 /// # Example
3452 /// ```ignore,no_run
3453 /// # use google_cloud_firestore_admin_v1::model::UpdateDatabaseRequest;
3454 /// use wkt::FieldMask;
3455 /// let x = UpdateDatabaseRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3456 /// let x = UpdateDatabaseRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3457 /// ```
3458 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3459 where
3460 T: std::convert::Into<wkt::FieldMask>,
3461 {
3462 self.update_mask = v.map(|x| x.into());
3463 self
3464 }
3465}
3466
3467impl wkt::message::Message for UpdateDatabaseRequest {
3468 fn typename() -> &'static str {
3469 "type.googleapis.com/google.firestore.admin.v1.UpdateDatabaseRequest"
3470 }
3471}
3472
3473/// Metadata related to the update database operation.
3474#[derive(Clone, Default, PartialEq)]
3475#[non_exhaustive]
3476pub struct UpdateDatabaseMetadata {
3477 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3478}
3479
3480impl UpdateDatabaseMetadata {
3481 pub fn new() -> Self {
3482 std::default::Default::default()
3483 }
3484}
3485
3486impl wkt::message::Message for UpdateDatabaseMetadata {
3487 fn typename() -> &'static str {
3488 "type.googleapis.com/google.firestore.admin.v1.UpdateDatabaseMetadata"
3489 }
3490}
3491
3492/// The request for
3493/// [FirestoreAdmin.DeleteDatabase][google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase].
3494///
3495/// [google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase]: crate::client::FirestoreAdmin::delete_database
3496#[derive(Clone, Default, PartialEq)]
3497#[non_exhaustive]
3498pub struct DeleteDatabaseRequest {
3499 /// Required. A name of the form
3500 /// `projects/{project_id}/databases/{database_id}`
3501 pub name: std::string::String,
3502
3503 /// The current etag of the Database.
3504 /// If an etag is provided and does not match the current etag of the database,
3505 /// deletion will be blocked and a FAILED_PRECONDITION error will be returned.
3506 pub etag: std::string::String,
3507
3508 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3509}
3510
3511impl DeleteDatabaseRequest {
3512 pub fn new() -> Self {
3513 std::default::Default::default()
3514 }
3515
3516 /// Sets the value of [name][crate::model::DeleteDatabaseRequest::name].
3517 ///
3518 /// # Example
3519 /// ```ignore,no_run
3520 /// # use google_cloud_firestore_admin_v1::model::DeleteDatabaseRequest;
3521 /// let x = DeleteDatabaseRequest::new().set_name("example");
3522 /// ```
3523 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3524 self.name = v.into();
3525 self
3526 }
3527
3528 /// Sets the value of [etag][crate::model::DeleteDatabaseRequest::etag].
3529 ///
3530 /// # Example
3531 /// ```ignore,no_run
3532 /// # use google_cloud_firestore_admin_v1::model::DeleteDatabaseRequest;
3533 /// let x = DeleteDatabaseRequest::new().set_etag("example");
3534 /// ```
3535 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3536 self.etag = v.into();
3537 self
3538 }
3539}
3540
3541impl wkt::message::Message for DeleteDatabaseRequest {
3542 fn typename() -> &'static str {
3543 "type.googleapis.com/google.firestore.admin.v1.DeleteDatabaseRequest"
3544 }
3545}
3546
3547/// Metadata related to the delete database operation.
3548#[derive(Clone, Default, PartialEq)]
3549#[non_exhaustive]
3550pub struct DeleteDatabaseMetadata {
3551 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3552}
3553
3554impl DeleteDatabaseMetadata {
3555 pub fn new() -> Self {
3556 std::default::Default::default()
3557 }
3558}
3559
3560impl wkt::message::Message for DeleteDatabaseMetadata {
3561 fn typename() -> &'static str {
3562 "type.googleapis.com/google.firestore.admin.v1.DeleteDatabaseMetadata"
3563 }
3564}
3565
3566/// The request for
3567/// [FirestoreAdmin.CreateUserCreds][google.firestore.admin.v1.FirestoreAdmin.CreateUserCreds].
3568///
3569/// [google.firestore.admin.v1.FirestoreAdmin.CreateUserCreds]: crate::client::FirestoreAdmin::create_user_creds
3570#[derive(Clone, Default, PartialEq)]
3571#[non_exhaustive]
3572pub struct CreateUserCredsRequest {
3573 /// Required. A parent name of the form
3574 /// `projects/{project_id}/databases/{database_id}`
3575 pub parent: std::string::String,
3576
3577 /// Required. The user creds to create.
3578 pub user_creds: std::option::Option<crate::model::UserCreds>,
3579
3580 /// Required. The ID to use for the user creds, which will become the final
3581 /// component of the user creds's resource name.
3582 ///
3583 /// This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
3584 /// with first character a letter and the last a letter or a number. Must not
3585 /// be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
3586 pub user_creds_id: std::string::String,
3587
3588 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3589}
3590
3591impl CreateUserCredsRequest {
3592 pub fn new() -> Self {
3593 std::default::Default::default()
3594 }
3595
3596 /// Sets the value of [parent][crate::model::CreateUserCredsRequest::parent].
3597 ///
3598 /// # Example
3599 /// ```ignore,no_run
3600 /// # use google_cloud_firestore_admin_v1::model::CreateUserCredsRequest;
3601 /// let x = CreateUserCredsRequest::new().set_parent("example");
3602 /// ```
3603 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3604 self.parent = v.into();
3605 self
3606 }
3607
3608 /// Sets the value of [user_creds][crate::model::CreateUserCredsRequest::user_creds].
3609 ///
3610 /// # Example
3611 /// ```ignore,no_run
3612 /// # use google_cloud_firestore_admin_v1::model::CreateUserCredsRequest;
3613 /// use google_cloud_firestore_admin_v1::model::UserCreds;
3614 /// let x = CreateUserCredsRequest::new().set_user_creds(UserCreds::default()/* use setters */);
3615 /// ```
3616 pub fn set_user_creds<T>(mut self, v: T) -> Self
3617 where
3618 T: std::convert::Into<crate::model::UserCreds>,
3619 {
3620 self.user_creds = std::option::Option::Some(v.into());
3621 self
3622 }
3623
3624 /// Sets or clears the value of [user_creds][crate::model::CreateUserCredsRequest::user_creds].
3625 ///
3626 /// # Example
3627 /// ```ignore,no_run
3628 /// # use google_cloud_firestore_admin_v1::model::CreateUserCredsRequest;
3629 /// use google_cloud_firestore_admin_v1::model::UserCreds;
3630 /// let x = CreateUserCredsRequest::new().set_or_clear_user_creds(Some(UserCreds::default()/* use setters */));
3631 /// let x = CreateUserCredsRequest::new().set_or_clear_user_creds(None::<UserCreds>);
3632 /// ```
3633 pub fn set_or_clear_user_creds<T>(mut self, v: std::option::Option<T>) -> Self
3634 where
3635 T: std::convert::Into<crate::model::UserCreds>,
3636 {
3637 self.user_creds = v.map(|x| x.into());
3638 self
3639 }
3640
3641 /// Sets the value of [user_creds_id][crate::model::CreateUserCredsRequest::user_creds_id].
3642 ///
3643 /// # Example
3644 /// ```ignore,no_run
3645 /// # use google_cloud_firestore_admin_v1::model::CreateUserCredsRequest;
3646 /// let x = CreateUserCredsRequest::new().set_user_creds_id("example");
3647 /// ```
3648 pub fn set_user_creds_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3649 self.user_creds_id = v.into();
3650 self
3651 }
3652}
3653
3654impl wkt::message::Message for CreateUserCredsRequest {
3655 fn typename() -> &'static str {
3656 "type.googleapis.com/google.firestore.admin.v1.CreateUserCredsRequest"
3657 }
3658}
3659
3660/// The request for
3661/// [FirestoreAdmin.GetUserCreds][google.firestore.admin.v1.FirestoreAdmin.GetUserCreds].
3662///
3663/// [google.firestore.admin.v1.FirestoreAdmin.GetUserCreds]: crate::client::FirestoreAdmin::get_user_creds
3664#[derive(Clone, Default, PartialEq)]
3665#[non_exhaustive]
3666pub struct GetUserCredsRequest {
3667 /// Required. A name of the form
3668 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3669 pub name: std::string::String,
3670
3671 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3672}
3673
3674impl GetUserCredsRequest {
3675 pub fn new() -> Self {
3676 std::default::Default::default()
3677 }
3678
3679 /// Sets the value of [name][crate::model::GetUserCredsRequest::name].
3680 ///
3681 /// # Example
3682 /// ```ignore,no_run
3683 /// # use google_cloud_firestore_admin_v1::model::GetUserCredsRequest;
3684 /// let x = GetUserCredsRequest::new().set_name("example");
3685 /// ```
3686 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3687 self.name = v.into();
3688 self
3689 }
3690}
3691
3692impl wkt::message::Message for GetUserCredsRequest {
3693 fn typename() -> &'static str {
3694 "type.googleapis.com/google.firestore.admin.v1.GetUserCredsRequest"
3695 }
3696}
3697
3698/// The request for
3699/// [FirestoreAdmin.ListUserCreds][google.firestore.admin.v1.FirestoreAdmin.ListUserCreds].
3700///
3701/// [google.firestore.admin.v1.FirestoreAdmin.ListUserCreds]: crate::client::FirestoreAdmin::list_user_creds
3702#[derive(Clone, Default, PartialEq)]
3703#[non_exhaustive]
3704pub struct ListUserCredsRequest {
3705 /// Required. A parent database name of the form
3706 /// `projects/{project_id}/databases/{database_id}`
3707 pub parent: std::string::String,
3708
3709 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3710}
3711
3712impl ListUserCredsRequest {
3713 pub fn new() -> Self {
3714 std::default::Default::default()
3715 }
3716
3717 /// Sets the value of [parent][crate::model::ListUserCredsRequest::parent].
3718 ///
3719 /// # Example
3720 /// ```ignore,no_run
3721 /// # use google_cloud_firestore_admin_v1::model::ListUserCredsRequest;
3722 /// let x = ListUserCredsRequest::new().set_parent("example");
3723 /// ```
3724 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3725 self.parent = v.into();
3726 self
3727 }
3728}
3729
3730impl wkt::message::Message for ListUserCredsRequest {
3731 fn typename() -> &'static str {
3732 "type.googleapis.com/google.firestore.admin.v1.ListUserCredsRequest"
3733 }
3734}
3735
3736/// The response for
3737/// [FirestoreAdmin.ListUserCreds][google.firestore.admin.v1.FirestoreAdmin.ListUserCreds].
3738///
3739/// [google.firestore.admin.v1.FirestoreAdmin.ListUserCreds]: crate::client::FirestoreAdmin::list_user_creds
3740#[derive(Clone, Default, PartialEq)]
3741#[non_exhaustive]
3742pub struct ListUserCredsResponse {
3743 /// The user creds for the database.
3744 pub user_creds: std::vec::Vec<crate::model::UserCreds>,
3745
3746 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3747}
3748
3749impl ListUserCredsResponse {
3750 pub fn new() -> Self {
3751 std::default::Default::default()
3752 }
3753
3754 /// Sets the value of [user_creds][crate::model::ListUserCredsResponse::user_creds].
3755 ///
3756 /// # Example
3757 /// ```ignore,no_run
3758 /// # use google_cloud_firestore_admin_v1::model::ListUserCredsResponse;
3759 /// use google_cloud_firestore_admin_v1::model::UserCreds;
3760 /// let x = ListUserCredsResponse::new()
3761 /// .set_user_creds([
3762 /// UserCreds::default()/* use setters */,
3763 /// UserCreds::default()/* use (different) setters */,
3764 /// ]);
3765 /// ```
3766 pub fn set_user_creds<T, V>(mut self, v: T) -> Self
3767 where
3768 T: std::iter::IntoIterator<Item = V>,
3769 V: std::convert::Into<crate::model::UserCreds>,
3770 {
3771 use std::iter::Iterator;
3772 self.user_creds = v.into_iter().map(|i| i.into()).collect();
3773 self
3774 }
3775}
3776
3777impl wkt::message::Message for ListUserCredsResponse {
3778 fn typename() -> &'static str {
3779 "type.googleapis.com/google.firestore.admin.v1.ListUserCredsResponse"
3780 }
3781}
3782
3783/// The request for
3784/// [FirestoreAdmin.EnableUserCreds][google.firestore.admin.v1.FirestoreAdmin.EnableUserCreds].
3785///
3786/// [google.firestore.admin.v1.FirestoreAdmin.EnableUserCreds]: crate::client::FirestoreAdmin::enable_user_creds
3787#[derive(Clone, Default, PartialEq)]
3788#[non_exhaustive]
3789pub struct EnableUserCredsRequest {
3790 /// Required. A name of the form
3791 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3792 pub name: std::string::String,
3793
3794 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3795}
3796
3797impl EnableUserCredsRequest {
3798 pub fn new() -> Self {
3799 std::default::Default::default()
3800 }
3801
3802 /// Sets the value of [name][crate::model::EnableUserCredsRequest::name].
3803 ///
3804 /// # Example
3805 /// ```ignore,no_run
3806 /// # use google_cloud_firestore_admin_v1::model::EnableUserCredsRequest;
3807 /// let x = EnableUserCredsRequest::new().set_name("example");
3808 /// ```
3809 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3810 self.name = v.into();
3811 self
3812 }
3813}
3814
3815impl wkt::message::Message for EnableUserCredsRequest {
3816 fn typename() -> &'static str {
3817 "type.googleapis.com/google.firestore.admin.v1.EnableUserCredsRequest"
3818 }
3819}
3820
3821/// The request for
3822/// [FirestoreAdmin.DisableUserCreds][google.firestore.admin.v1.FirestoreAdmin.DisableUserCreds].
3823///
3824/// [google.firestore.admin.v1.FirestoreAdmin.DisableUserCreds]: crate::client::FirestoreAdmin::disable_user_creds
3825#[derive(Clone, Default, PartialEq)]
3826#[non_exhaustive]
3827pub struct DisableUserCredsRequest {
3828 /// Required. A name of the form
3829 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3830 pub name: std::string::String,
3831
3832 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3833}
3834
3835impl DisableUserCredsRequest {
3836 pub fn new() -> Self {
3837 std::default::Default::default()
3838 }
3839
3840 /// Sets the value of [name][crate::model::DisableUserCredsRequest::name].
3841 ///
3842 /// # Example
3843 /// ```ignore,no_run
3844 /// # use google_cloud_firestore_admin_v1::model::DisableUserCredsRequest;
3845 /// let x = DisableUserCredsRequest::new().set_name("example");
3846 /// ```
3847 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3848 self.name = v.into();
3849 self
3850 }
3851}
3852
3853impl wkt::message::Message for DisableUserCredsRequest {
3854 fn typename() -> &'static str {
3855 "type.googleapis.com/google.firestore.admin.v1.DisableUserCredsRequest"
3856 }
3857}
3858
3859/// The request for
3860/// [FirestoreAdmin.ResetUserPassword][google.firestore.admin.v1.FirestoreAdmin.ResetUserPassword].
3861///
3862/// [google.firestore.admin.v1.FirestoreAdmin.ResetUserPassword]: crate::client::FirestoreAdmin::reset_user_password
3863#[derive(Clone, Default, PartialEq)]
3864#[non_exhaustive]
3865pub struct ResetUserPasswordRequest {
3866 /// Required. A name of the form
3867 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3868 pub name: std::string::String,
3869
3870 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3871}
3872
3873impl ResetUserPasswordRequest {
3874 pub fn new() -> Self {
3875 std::default::Default::default()
3876 }
3877
3878 /// Sets the value of [name][crate::model::ResetUserPasswordRequest::name].
3879 ///
3880 /// # Example
3881 /// ```ignore,no_run
3882 /// # use google_cloud_firestore_admin_v1::model::ResetUserPasswordRequest;
3883 /// let x = ResetUserPasswordRequest::new().set_name("example");
3884 /// ```
3885 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3886 self.name = v.into();
3887 self
3888 }
3889}
3890
3891impl wkt::message::Message for ResetUserPasswordRequest {
3892 fn typename() -> &'static str {
3893 "type.googleapis.com/google.firestore.admin.v1.ResetUserPasswordRequest"
3894 }
3895}
3896
3897/// The request for
3898/// [FirestoreAdmin.DeleteUserCreds][google.firestore.admin.v1.FirestoreAdmin.DeleteUserCreds].
3899///
3900/// [google.firestore.admin.v1.FirestoreAdmin.DeleteUserCreds]: crate::client::FirestoreAdmin::delete_user_creds
3901#[derive(Clone, Default, PartialEq)]
3902#[non_exhaustive]
3903pub struct DeleteUserCredsRequest {
3904 /// Required. A name of the form
3905 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3906 pub name: std::string::String,
3907
3908 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3909}
3910
3911impl DeleteUserCredsRequest {
3912 pub fn new() -> Self {
3913 std::default::Default::default()
3914 }
3915
3916 /// Sets the value of [name][crate::model::DeleteUserCredsRequest::name].
3917 ///
3918 /// # Example
3919 /// ```ignore,no_run
3920 /// # use google_cloud_firestore_admin_v1::model::DeleteUserCredsRequest;
3921 /// let x = DeleteUserCredsRequest::new().set_name("example");
3922 /// ```
3923 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3924 self.name = v.into();
3925 self
3926 }
3927}
3928
3929impl wkt::message::Message for DeleteUserCredsRequest {
3930 fn typename() -> &'static str {
3931 "type.googleapis.com/google.firestore.admin.v1.DeleteUserCredsRequest"
3932 }
3933}
3934
3935/// The request for
3936/// [FirestoreAdmin.CreateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedule].
3937///
3938/// [google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedule]: crate::client::FirestoreAdmin::create_backup_schedule
3939#[derive(Clone, Default, PartialEq)]
3940#[non_exhaustive]
3941pub struct CreateBackupScheduleRequest {
3942 /// Required. The parent database.
3943 ///
3944 /// Format `projects/{project}/databases/{database}`
3945 pub parent: std::string::String,
3946
3947 /// Required. The backup schedule to create.
3948 pub backup_schedule: std::option::Option<crate::model::BackupSchedule>,
3949
3950 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3951}
3952
3953impl CreateBackupScheduleRequest {
3954 pub fn new() -> Self {
3955 std::default::Default::default()
3956 }
3957
3958 /// Sets the value of [parent][crate::model::CreateBackupScheduleRequest::parent].
3959 ///
3960 /// # Example
3961 /// ```ignore,no_run
3962 /// # use google_cloud_firestore_admin_v1::model::CreateBackupScheduleRequest;
3963 /// let x = CreateBackupScheduleRequest::new().set_parent("example");
3964 /// ```
3965 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3966 self.parent = v.into();
3967 self
3968 }
3969
3970 /// Sets the value of [backup_schedule][crate::model::CreateBackupScheduleRequest::backup_schedule].
3971 ///
3972 /// # Example
3973 /// ```ignore,no_run
3974 /// # use google_cloud_firestore_admin_v1::model::CreateBackupScheduleRequest;
3975 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
3976 /// let x = CreateBackupScheduleRequest::new().set_backup_schedule(BackupSchedule::default()/* use setters */);
3977 /// ```
3978 pub fn set_backup_schedule<T>(mut self, v: T) -> Self
3979 where
3980 T: std::convert::Into<crate::model::BackupSchedule>,
3981 {
3982 self.backup_schedule = std::option::Option::Some(v.into());
3983 self
3984 }
3985
3986 /// Sets or clears the value of [backup_schedule][crate::model::CreateBackupScheduleRequest::backup_schedule].
3987 ///
3988 /// # Example
3989 /// ```ignore,no_run
3990 /// # use google_cloud_firestore_admin_v1::model::CreateBackupScheduleRequest;
3991 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
3992 /// let x = CreateBackupScheduleRequest::new().set_or_clear_backup_schedule(Some(BackupSchedule::default()/* use setters */));
3993 /// let x = CreateBackupScheduleRequest::new().set_or_clear_backup_schedule(None::<BackupSchedule>);
3994 /// ```
3995 pub fn set_or_clear_backup_schedule<T>(mut self, v: std::option::Option<T>) -> Self
3996 where
3997 T: std::convert::Into<crate::model::BackupSchedule>,
3998 {
3999 self.backup_schedule = v.map(|x| x.into());
4000 self
4001 }
4002}
4003
4004impl wkt::message::Message for CreateBackupScheduleRequest {
4005 fn typename() -> &'static str {
4006 "type.googleapis.com/google.firestore.admin.v1.CreateBackupScheduleRequest"
4007 }
4008}
4009
4010/// The request for
4011/// [FirestoreAdmin.GetBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.GetBackupSchedule].
4012///
4013/// [google.firestore.admin.v1.FirestoreAdmin.GetBackupSchedule]: crate::client::FirestoreAdmin::get_backup_schedule
4014#[derive(Clone, Default, PartialEq)]
4015#[non_exhaustive]
4016pub struct GetBackupScheduleRequest {
4017 /// Required. The name of the backup schedule.
4018 ///
4019 /// Format
4020 /// `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
4021 pub name: std::string::String,
4022
4023 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4024}
4025
4026impl GetBackupScheduleRequest {
4027 pub fn new() -> Self {
4028 std::default::Default::default()
4029 }
4030
4031 /// Sets the value of [name][crate::model::GetBackupScheduleRequest::name].
4032 ///
4033 /// # Example
4034 /// ```ignore,no_run
4035 /// # use google_cloud_firestore_admin_v1::model::GetBackupScheduleRequest;
4036 /// let x = GetBackupScheduleRequest::new().set_name("example");
4037 /// ```
4038 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4039 self.name = v.into();
4040 self
4041 }
4042}
4043
4044impl wkt::message::Message for GetBackupScheduleRequest {
4045 fn typename() -> &'static str {
4046 "type.googleapis.com/google.firestore.admin.v1.GetBackupScheduleRequest"
4047 }
4048}
4049
4050/// The request for
4051/// [FirestoreAdmin.UpdateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedule].
4052///
4053/// [google.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedule]: crate::client::FirestoreAdmin::update_backup_schedule
4054#[derive(Clone, Default, PartialEq)]
4055#[non_exhaustive]
4056pub struct UpdateBackupScheduleRequest {
4057 /// Required. The backup schedule to update.
4058 pub backup_schedule: std::option::Option<crate::model::BackupSchedule>,
4059
4060 /// The list of fields to be updated.
4061 pub update_mask: std::option::Option<wkt::FieldMask>,
4062
4063 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4064}
4065
4066impl UpdateBackupScheduleRequest {
4067 pub fn new() -> Self {
4068 std::default::Default::default()
4069 }
4070
4071 /// Sets the value of [backup_schedule][crate::model::UpdateBackupScheduleRequest::backup_schedule].
4072 ///
4073 /// # Example
4074 /// ```ignore,no_run
4075 /// # use google_cloud_firestore_admin_v1::model::UpdateBackupScheduleRequest;
4076 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
4077 /// let x = UpdateBackupScheduleRequest::new().set_backup_schedule(BackupSchedule::default()/* use setters */);
4078 /// ```
4079 pub fn set_backup_schedule<T>(mut self, v: T) -> Self
4080 where
4081 T: std::convert::Into<crate::model::BackupSchedule>,
4082 {
4083 self.backup_schedule = std::option::Option::Some(v.into());
4084 self
4085 }
4086
4087 /// Sets or clears the value of [backup_schedule][crate::model::UpdateBackupScheduleRequest::backup_schedule].
4088 ///
4089 /// # Example
4090 /// ```ignore,no_run
4091 /// # use google_cloud_firestore_admin_v1::model::UpdateBackupScheduleRequest;
4092 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
4093 /// let x = UpdateBackupScheduleRequest::new().set_or_clear_backup_schedule(Some(BackupSchedule::default()/* use setters */));
4094 /// let x = UpdateBackupScheduleRequest::new().set_or_clear_backup_schedule(None::<BackupSchedule>);
4095 /// ```
4096 pub fn set_or_clear_backup_schedule<T>(mut self, v: std::option::Option<T>) -> Self
4097 where
4098 T: std::convert::Into<crate::model::BackupSchedule>,
4099 {
4100 self.backup_schedule = v.map(|x| x.into());
4101 self
4102 }
4103
4104 /// Sets the value of [update_mask][crate::model::UpdateBackupScheduleRequest::update_mask].
4105 ///
4106 /// # Example
4107 /// ```ignore,no_run
4108 /// # use google_cloud_firestore_admin_v1::model::UpdateBackupScheduleRequest;
4109 /// use wkt::FieldMask;
4110 /// let x = UpdateBackupScheduleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4111 /// ```
4112 pub fn set_update_mask<T>(mut self, v: T) -> Self
4113 where
4114 T: std::convert::Into<wkt::FieldMask>,
4115 {
4116 self.update_mask = std::option::Option::Some(v.into());
4117 self
4118 }
4119
4120 /// Sets or clears the value of [update_mask][crate::model::UpdateBackupScheduleRequest::update_mask].
4121 ///
4122 /// # Example
4123 /// ```ignore,no_run
4124 /// # use google_cloud_firestore_admin_v1::model::UpdateBackupScheduleRequest;
4125 /// use wkt::FieldMask;
4126 /// let x = UpdateBackupScheduleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4127 /// let x = UpdateBackupScheduleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4128 /// ```
4129 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4130 where
4131 T: std::convert::Into<wkt::FieldMask>,
4132 {
4133 self.update_mask = v.map(|x| x.into());
4134 self
4135 }
4136}
4137
4138impl wkt::message::Message for UpdateBackupScheduleRequest {
4139 fn typename() -> &'static str {
4140 "type.googleapis.com/google.firestore.admin.v1.UpdateBackupScheduleRequest"
4141 }
4142}
4143
4144/// The request for
4145/// [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules].
4146///
4147/// [google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules]: crate::client::FirestoreAdmin::list_backup_schedules
4148#[derive(Clone, Default, PartialEq)]
4149#[non_exhaustive]
4150pub struct ListBackupSchedulesRequest {
4151 /// Required. The parent database.
4152 ///
4153 /// Format is `projects/{project}/databases/{database}`.
4154 pub parent: std::string::String,
4155
4156 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4157}
4158
4159impl ListBackupSchedulesRequest {
4160 pub fn new() -> Self {
4161 std::default::Default::default()
4162 }
4163
4164 /// Sets the value of [parent][crate::model::ListBackupSchedulesRequest::parent].
4165 ///
4166 /// # Example
4167 /// ```ignore,no_run
4168 /// # use google_cloud_firestore_admin_v1::model::ListBackupSchedulesRequest;
4169 /// let x = ListBackupSchedulesRequest::new().set_parent("example");
4170 /// ```
4171 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4172 self.parent = v.into();
4173 self
4174 }
4175}
4176
4177impl wkt::message::Message for ListBackupSchedulesRequest {
4178 fn typename() -> &'static str {
4179 "type.googleapis.com/google.firestore.admin.v1.ListBackupSchedulesRequest"
4180 }
4181}
4182
4183/// The response for
4184/// [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules].
4185///
4186/// [google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules]: crate::client::FirestoreAdmin::list_backup_schedules
4187#[derive(Clone, Default, PartialEq)]
4188#[non_exhaustive]
4189pub struct ListBackupSchedulesResponse {
4190 /// List of all backup schedules.
4191 pub backup_schedules: std::vec::Vec<crate::model::BackupSchedule>,
4192
4193 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4194}
4195
4196impl ListBackupSchedulesResponse {
4197 pub fn new() -> Self {
4198 std::default::Default::default()
4199 }
4200
4201 /// Sets the value of [backup_schedules][crate::model::ListBackupSchedulesResponse::backup_schedules].
4202 ///
4203 /// # Example
4204 /// ```ignore,no_run
4205 /// # use google_cloud_firestore_admin_v1::model::ListBackupSchedulesResponse;
4206 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
4207 /// let x = ListBackupSchedulesResponse::new()
4208 /// .set_backup_schedules([
4209 /// BackupSchedule::default()/* use setters */,
4210 /// BackupSchedule::default()/* use (different) setters */,
4211 /// ]);
4212 /// ```
4213 pub fn set_backup_schedules<T, V>(mut self, v: T) -> Self
4214 where
4215 T: std::iter::IntoIterator<Item = V>,
4216 V: std::convert::Into<crate::model::BackupSchedule>,
4217 {
4218 use std::iter::Iterator;
4219 self.backup_schedules = v.into_iter().map(|i| i.into()).collect();
4220 self
4221 }
4222}
4223
4224impl wkt::message::Message for ListBackupSchedulesResponse {
4225 fn typename() -> &'static str {
4226 "type.googleapis.com/google.firestore.admin.v1.ListBackupSchedulesResponse"
4227 }
4228}
4229
4230/// The request for [FirestoreAdmin.DeleteBackupSchedules][].
4231#[derive(Clone, Default, PartialEq)]
4232#[non_exhaustive]
4233pub struct DeleteBackupScheduleRequest {
4234 /// Required. The name of the backup schedule.
4235 ///
4236 /// Format
4237 /// `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
4238 pub name: std::string::String,
4239
4240 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4241}
4242
4243impl DeleteBackupScheduleRequest {
4244 pub fn new() -> Self {
4245 std::default::Default::default()
4246 }
4247
4248 /// Sets the value of [name][crate::model::DeleteBackupScheduleRequest::name].
4249 ///
4250 /// # Example
4251 /// ```ignore,no_run
4252 /// # use google_cloud_firestore_admin_v1::model::DeleteBackupScheduleRequest;
4253 /// let x = DeleteBackupScheduleRequest::new().set_name("example");
4254 /// ```
4255 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4256 self.name = v.into();
4257 self
4258 }
4259}
4260
4261impl wkt::message::Message for DeleteBackupScheduleRequest {
4262 fn typename() -> &'static str {
4263 "type.googleapis.com/google.firestore.admin.v1.DeleteBackupScheduleRequest"
4264 }
4265}
4266
4267/// The request for
4268/// [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
4269///
4270/// [google.firestore.admin.v1.FirestoreAdmin.CreateIndex]: crate::client::FirestoreAdmin::create_index
4271#[derive(Clone, Default, PartialEq)]
4272#[non_exhaustive]
4273pub struct CreateIndexRequest {
4274 /// Required. A parent name of the form
4275 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
4276 pub parent: std::string::String,
4277
4278 /// Required. The composite index to create.
4279 pub index: std::option::Option<crate::model::Index>,
4280
4281 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4282}
4283
4284impl CreateIndexRequest {
4285 pub fn new() -> Self {
4286 std::default::Default::default()
4287 }
4288
4289 /// Sets the value of [parent][crate::model::CreateIndexRequest::parent].
4290 ///
4291 /// # Example
4292 /// ```ignore,no_run
4293 /// # use google_cloud_firestore_admin_v1::model::CreateIndexRequest;
4294 /// let x = CreateIndexRequest::new().set_parent("example");
4295 /// ```
4296 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4297 self.parent = v.into();
4298 self
4299 }
4300
4301 /// Sets the value of [index][crate::model::CreateIndexRequest::index].
4302 ///
4303 /// # Example
4304 /// ```ignore,no_run
4305 /// # use google_cloud_firestore_admin_v1::model::CreateIndexRequest;
4306 /// use google_cloud_firestore_admin_v1::model::Index;
4307 /// let x = CreateIndexRequest::new().set_index(Index::default()/* use setters */);
4308 /// ```
4309 pub fn set_index<T>(mut self, v: T) -> Self
4310 where
4311 T: std::convert::Into<crate::model::Index>,
4312 {
4313 self.index = std::option::Option::Some(v.into());
4314 self
4315 }
4316
4317 /// Sets or clears the value of [index][crate::model::CreateIndexRequest::index].
4318 ///
4319 /// # Example
4320 /// ```ignore,no_run
4321 /// # use google_cloud_firestore_admin_v1::model::CreateIndexRequest;
4322 /// use google_cloud_firestore_admin_v1::model::Index;
4323 /// let x = CreateIndexRequest::new().set_or_clear_index(Some(Index::default()/* use setters */));
4324 /// let x = CreateIndexRequest::new().set_or_clear_index(None::<Index>);
4325 /// ```
4326 pub fn set_or_clear_index<T>(mut self, v: std::option::Option<T>) -> Self
4327 where
4328 T: std::convert::Into<crate::model::Index>,
4329 {
4330 self.index = v.map(|x| x.into());
4331 self
4332 }
4333}
4334
4335impl wkt::message::Message for CreateIndexRequest {
4336 fn typename() -> &'static str {
4337 "type.googleapis.com/google.firestore.admin.v1.CreateIndexRequest"
4338 }
4339}
4340
4341/// The request for
4342/// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes].
4343///
4344/// [google.firestore.admin.v1.FirestoreAdmin.ListIndexes]: crate::client::FirestoreAdmin::list_indexes
4345#[derive(Clone, Default, PartialEq)]
4346#[non_exhaustive]
4347pub struct ListIndexesRequest {
4348 /// Required. A parent name of the form
4349 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
4350 pub parent: std::string::String,
4351
4352 /// The filter to apply to list results.
4353 pub filter: std::string::String,
4354
4355 /// The number of results to return.
4356 pub page_size: i32,
4357
4358 /// A page token, returned from a previous call to
4359 /// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes],
4360 /// that may be used to get the next page of results.
4361 ///
4362 /// [google.firestore.admin.v1.FirestoreAdmin.ListIndexes]: crate::client::FirestoreAdmin::list_indexes
4363 pub page_token: std::string::String,
4364
4365 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4366}
4367
4368impl ListIndexesRequest {
4369 pub fn new() -> Self {
4370 std::default::Default::default()
4371 }
4372
4373 /// Sets the value of [parent][crate::model::ListIndexesRequest::parent].
4374 ///
4375 /// # Example
4376 /// ```ignore,no_run
4377 /// # use google_cloud_firestore_admin_v1::model::ListIndexesRequest;
4378 /// let x = ListIndexesRequest::new().set_parent("example");
4379 /// ```
4380 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4381 self.parent = v.into();
4382 self
4383 }
4384
4385 /// Sets the value of [filter][crate::model::ListIndexesRequest::filter].
4386 ///
4387 /// # Example
4388 /// ```ignore,no_run
4389 /// # use google_cloud_firestore_admin_v1::model::ListIndexesRequest;
4390 /// let x = ListIndexesRequest::new().set_filter("example");
4391 /// ```
4392 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4393 self.filter = v.into();
4394 self
4395 }
4396
4397 /// Sets the value of [page_size][crate::model::ListIndexesRequest::page_size].
4398 ///
4399 /// # Example
4400 /// ```ignore,no_run
4401 /// # use google_cloud_firestore_admin_v1::model::ListIndexesRequest;
4402 /// let x = ListIndexesRequest::new().set_page_size(42);
4403 /// ```
4404 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4405 self.page_size = v.into();
4406 self
4407 }
4408
4409 /// Sets the value of [page_token][crate::model::ListIndexesRequest::page_token].
4410 ///
4411 /// # Example
4412 /// ```ignore,no_run
4413 /// # use google_cloud_firestore_admin_v1::model::ListIndexesRequest;
4414 /// let x = ListIndexesRequest::new().set_page_token("example");
4415 /// ```
4416 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4417 self.page_token = v.into();
4418 self
4419 }
4420}
4421
4422impl wkt::message::Message for ListIndexesRequest {
4423 fn typename() -> &'static str {
4424 "type.googleapis.com/google.firestore.admin.v1.ListIndexesRequest"
4425 }
4426}
4427
4428/// The response for
4429/// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes].
4430///
4431/// [google.firestore.admin.v1.FirestoreAdmin.ListIndexes]: crate::client::FirestoreAdmin::list_indexes
4432#[derive(Clone, Default, PartialEq)]
4433#[non_exhaustive]
4434pub struct ListIndexesResponse {
4435 /// The requested indexes.
4436 pub indexes: std::vec::Vec<crate::model::Index>,
4437
4438 /// A page token that may be used to request another page of results. If blank,
4439 /// this is the last page.
4440 pub next_page_token: std::string::String,
4441
4442 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4443}
4444
4445impl ListIndexesResponse {
4446 pub fn new() -> Self {
4447 std::default::Default::default()
4448 }
4449
4450 /// Sets the value of [indexes][crate::model::ListIndexesResponse::indexes].
4451 ///
4452 /// # Example
4453 /// ```ignore,no_run
4454 /// # use google_cloud_firestore_admin_v1::model::ListIndexesResponse;
4455 /// use google_cloud_firestore_admin_v1::model::Index;
4456 /// let x = ListIndexesResponse::new()
4457 /// .set_indexes([
4458 /// Index::default()/* use setters */,
4459 /// Index::default()/* use (different) setters */,
4460 /// ]);
4461 /// ```
4462 pub fn set_indexes<T, V>(mut self, v: T) -> Self
4463 where
4464 T: std::iter::IntoIterator<Item = V>,
4465 V: std::convert::Into<crate::model::Index>,
4466 {
4467 use std::iter::Iterator;
4468 self.indexes = v.into_iter().map(|i| i.into()).collect();
4469 self
4470 }
4471
4472 /// Sets the value of [next_page_token][crate::model::ListIndexesResponse::next_page_token].
4473 ///
4474 /// # Example
4475 /// ```ignore,no_run
4476 /// # use google_cloud_firestore_admin_v1::model::ListIndexesResponse;
4477 /// let x = ListIndexesResponse::new().set_next_page_token("example");
4478 /// ```
4479 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4480 self.next_page_token = v.into();
4481 self
4482 }
4483}
4484
4485impl wkt::message::Message for ListIndexesResponse {
4486 fn typename() -> &'static str {
4487 "type.googleapis.com/google.firestore.admin.v1.ListIndexesResponse"
4488 }
4489}
4490
4491#[doc(hidden)]
4492impl google_cloud_gax::paginator::internal::PageableResponse for ListIndexesResponse {
4493 type PageItem = crate::model::Index;
4494
4495 fn items(self) -> std::vec::Vec<Self::PageItem> {
4496 self.indexes
4497 }
4498
4499 fn next_page_token(&self) -> std::string::String {
4500 use std::clone::Clone;
4501 self.next_page_token.clone()
4502 }
4503}
4504
4505/// The request for
4506/// [FirestoreAdmin.GetIndex][google.firestore.admin.v1.FirestoreAdmin.GetIndex].
4507///
4508/// [google.firestore.admin.v1.FirestoreAdmin.GetIndex]: crate::client::FirestoreAdmin::get_index
4509#[derive(Clone, Default, PartialEq)]
4510#[non_exhaustive]
4511pub struct GetIndexRequest {
4512 /// Required. A name of the form
4513 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
4514 pub name: std::string::String,
4515
4516 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4517}
4518
4519impl GetIndexRequest {
4520 pub fn new() -> Self {
4521 std::default::Default::default()
4522 }
4523
4524 /// Sets the value of [name][crate::model::GetIndexRequest::name].
4525 ///
4526 /// # Example
4527 /// ```ignore,no_run
4528 /// # use google_cloud_firestore_admin_v1::model::GetIndexRequest;
4529 /// let x = GetIndexRequest::new().set_name("example");
4530 /// ```
4531 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4532 self.name = v.into();
4533 self
4534 }
4535}
4536
4537impl wkt::message::Message for GetIndexRequest {
4538 fn typename() -> &'static str {
4539 "type.googleapis.com/google.firestore.admin.v1.GetIndexRequest"
4540 }
4541}
4542
4543/// The request for
4544/// [FirestoreAdmin.DeleteIndex][google.firestore.admin.v1.FirestoreAdmin.DeleteIndex].
4545///
4546/// [google.firestore.admin.v1.FirestoreAdmin.DeleteIndex]: crate::client::FirestoreAdmin::delete_index
4547#[derive(Clone, Default, PartialEq)]
4548#[non_exhaustive]
4549pub struct DeleteIndexRequest {
4550 /// Required. A name of the form
4551 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
4552 pub name: std::string::String,
4553
4554 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4555}
4556
4557impl DeleteIndexRequest {
4558 pub fn new() -> Self {
4559 std::default::Default::default()
4560 }
4561
4562 /// Sets the value of [name][crate::model::DeleteIndexRequest::name].
4563 ///
4564 /// # Example
4565 /// ```ignore,no_run
4566 /// # use google_cloud_firestore_admin_v1::model::DeleteIndexRequest;
4567 /// let x = DeleteIndexRequest::new().set_name("example");
4568 /// ```
4569 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4570 self.name = v.into();
4571 self
4572 }
4573}
4574
4575impl wkt::message::Message for DeleteIndexRequest {
4576 fn typename() -> &'static str {
4577 "type.googleapis.com/google.firestore.admin.v1.DeleteIndexRequest"
4578 }
4579}
4580
4581/// The request for
4582/// [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField].
4583///
4584/// [google.firestore.admin.v1.FirestoreAdmin.UpdateField]: crate::client::FirestoreAdmin::update_field
4585#[derive(Clone, Default, PartialEq)]
4586#[non_exhaustive]
4587pub struct UpdateFieldRequest {
4588 /// Required. The field to be updated.
4589 pub field: std::option::Option<crate::model::Field>,
4590
4591 /// A mask, relative to the field. If specified, only configuration specified
4592 /// by this field_mask will be updated in the field.
4593 pub update_mask: std::option::Option<wkt::FieldMask>,
4594
4595 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4596}
4597
4598impl UpdateFieldRequest {
4599 pub fn new() -> Self {
4600 std::default::Default::default()
4601 }
4602
4603 /// Sets the value of [field][crate::model::UpdateFieldRequest::field].
4604 ///
4605 /// # Example
4606 /// ```ignore,no_run
4607 /// # use google_cloud_firestore_admin_v1::model::UpdateFieldRequest;
4608 /// use google_cloud_firestore_admin_v1::model::Field;
4609 /// let x = UpdateFieldRequest::new().set_field(Field::default()/* use setters */);
4610 /// ```
4611 pub fn set_field<T>(mut self, v: T) -> Self
4612 where
4613 T: std::convert::Into<crate::model::Field>,
4614 {
4615 self.field = std::option::Option::Some(v.into());
4616 self
4617 }
4618
4619 /// Sets or clears the value of [field][crate::model::UpdateFieldRequest::field].
4620 ///
4621 /// # Example
4622 /// ```ignore,no_run
4623 /// # use google_cloud_firestore_admin_v1::model::UpdateFieldRequest;
4624 /// use google_cloud_firestore_admin_v1::model::Field;
4625 /// let x = UpdateFieldRequest::new().set_or_clear_field(Some(Field::default()/* use setters */));
4626 /// let x = UpdateFieldRequest::new().set_or_clear_field(None::<Field>);
4627 /// ```
4628 pub fn set_or_clear_field<T>(mut self, v: std::option::Option<T>) -> Self
4629 where
4630 T: std::convert::Into<crate::model::Field>,
4631 {
4632 self.field = v.map(|x| x.into());
4633 self
4634 }
4635
4636 /// Sets the value of [update_mask][crate::model::UpdateFieldRequest::update_mask].
4637 ///
4638 /// # Example
4639 /// ```ignore,no_run
4640 /// # use google_cloud_firestore_admin_v1::model::UpdateFieldRequest;
4641 /// use wkt::FieldMask;
4642 /// let x = UpdateFieldRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4643 /// ```
4644 pub fn set_update_mask<T>(mut self, v: T) -> Self
4645 where
4646 T: std::convert::Into<wkt::FieldMask>,
4647 {
4648 self.update_mask = std::option::Option::Some(v.into());
4649 self
4650 }
4651
4652 /// Sets or clears the value of [update_mask][crate::model::UpdateFieldRequest::update_mask].
4653 ///
4654 /// # Example
4655 /// ```ignore,no_run
4656 /// # use google_cloud_firestore_admin_v1::model::UpdateFieldRequest;
4657 /// use wkt::FieldMask;
4658 /// let x = UpdateFieldRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4659 /// let x = UpdateFieldRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4660 /// ```
4661 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4662 where
4663 T: std::convert::Into<wkt::FieldMask>,
4664 {
4665 self.update_mask = v.map(|x| x.into());
4666 self
4667 }
4668}
4669
4670impl wkt::message::Message for UpdateFieldRequest {
4671 fn typename() -> &'static str {
4672 "type.googleapis.com/google.firestore.admin.v1.UpdateFieldRequest"
4673 }
4674}
4675
4676/// The request for
4677/// [FirestoreAdmin.GetField][google.firestore.admin.v1.FirestoreAdmin.GetField].
4678///
4679/// [google.firestore.admin.v1.FirestoreAdmin.GetField]: crate::client::FirestoreAdmin::get_field
4680#[derive(Clone, Default, PartialEq)]
4681#[non_exhaustive]
4682pub struct GetFieldRequest {
4683 /// Required. A name of the form
4684 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
4685 pub name: std::string::String,
4686
4687 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4688}
4689
4690impl GetFieldRequest {
4691 pub fn new() -> Self {
4692 std::default::Default::default()
4693 }
4694
4695 /// Sets the value of [name][crate::model::GetFieldRequest::name].
4696 ///
4697 /// # Example
4698 /// ```ignore,no_run
4699 /// # use google_cloud_firestore_admin_v1::model::GetFieldRequest;
4700 /// let x = GetFieldRequest::new().set_name("example");
4701 /// ```
4702 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4703 self.name = v.into();
4704 self
4705 }
4706}
4707
4708impl wkt::message::Message for GetFieldRequest {
4709 fn typename() -> &'static str {
4710 "type.googleapis.com/google.firestore.admin.v1.GetFieldRequest"
4711 }
4712}
4713
4714/// The request for
4715/// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields].
4716///
4717/// [google.firestore.admin.v1.FirestoreAdmin.ListFields]: crate::client::FirestoreAdmin::list_fields
4718#[derive(Clone, Default, PartialEq)]
4719#[non_exhaustive]
4720pub struct ListFieldsRequest {
4721 /// Required. A parent name of the form
4722 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
4723 pub parent: std::string::String,
4724
4725 /// The filter to apply to list results. Currently,
4726 /// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
4727 /// only supports listing fields that have been explicitly overridden. To issue
4728 /// this query, call
4729 /// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
4730 /// with a filter that includes `indexConfig.usesAncestorConfig:false` or
4731 /// `ttlConfig:*`.
4732 ///
4733 /// [google.firestore.admin.v1.FirestoreAdmin.ListFields]: crate::client::FirestoreAdmin::list_fields
4734 pub filter: std::string::String,
4735
4736 /// The number of results to return.
4737 pub page_size: i32,
4738
4739 /// A page token, returned from a previous call to
4740 /// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields],
4741 /// that may be used to get the next page of results.
4742 ///
4743 /// [google.firestore.admin.v1.FirestoreAdmin.ListFields]: crate::client::FirestoreAdmin::list_fields
4744 pub page_token: std::string::String,
4745
4746 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4747}
4748
4749impl ListFieldsRequest {
4750 pub fn new() -> Self {
4751 std::default::Default::default()
4752 }
4753
4754 /// Sets the value of [parent][crate::model::ListFieldsRequest::parent].
4755 ///
4756 /// # Example
4757 /// ```ignore,no_run
4758 /// # use google_cloud_firestore_admin_v1::model::ListFieldsRequest;
4759 /// let x = ListFieldsRequest::new().set_parent("example");
4760 /// ```
4761 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4762 self.parent = v.into();
4763 self
4764 }
4765
4766 /// Sets the value of [filter][crate::model::ListFieldsRequest::filter].
4767 ///
4768 /// # Example
4769 /// ```ignore,no_run
4770 /// # use google_cloud_firestore_admin_v1::model::ListFieldsRequest;
4771 /// let x = ListFieldsRequest::new().set_filter("example");
4772 /// ```
4773 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4774 self.filter = v.into();
4775 self
4776 }
4777
4778 /// Sets the value of [page_size][crate::model::ListFieldsRequest::page_size].
4779 ///
4780 /// # Example
4781 /// ```ignore,no_run
4782 /// # use google_cloud_firestore_admin_v1::model::ListFieldsRequest;
4783 /// let x = ListFieldsRequest::new().set_page_size(42);
4784 /// ```
4785 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4786 self.page_size = v.into();
4787 self
4788 }
4789
4790 /// Sets the value of [page_token][crate::model::ListFieldsRequest::page_token].
4791 ///
4792 /// # Example
4793 /// ```ignore,no_run
4794 /// # use google_cloud_firestore_admin_v1::model::ListFieldsRequest;
4795 /// let x = ListFieldsRequest::new().set_page_token("example");
4796 /// ```
4797 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4798 self.page_token = v.into();
4799 self
4800 }
4801}
4802
4803impl wkt::message::Message for ListFieldsRequest {
4804 fn typename() -> &'static str {
4805 "type.googleapis.com/google.firestore.admin.v1.ListFieldsRequest"
4806 }
4807}
4808
4809/// The response for
4810/// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields].
4811///
4812/// [google.firestore.admin.v1.FirestoreAdmin.ListFields]: crate::client::FirestoreAdmin::list_fields
4813#[derive(Clone, Default, PartialEq)]
4814#[non_exhaustive]
4815pub struct ListFieldsResponse {
4816 /// The requested fields.
4817 pub fields: std::vec::Vec<crate::model::Field>,
4818
4819 /// A page token that may be used to request another page of results. If blank,
4820 /// this is the last page.
4821 pub next_page_token: std::string::String,
4822
4823 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4824}
4825
4826impl ListFieldsResponse {
4827 pub fn new() -> Self {
4828 std::default::Default::default()
4829 }
4830
4831 /// Sets the value of [fields][crate::model::ListFieldsResponse::fields].
4832 ///
4833 /// # Example
4834 /// ```ignore,no_run
4835 /// # use google_cloud_firestore_admin_v1::model::ListFieldsResponse;
4836 /// use google_cloud_firestore_admin_v1::model::Field;
4837 /// let x = ListFieldsResponse::new()
4838 /// .set_fields([
4839 /// Field::default()/* use setters */,
4840 /// Field::default()/* use (different) setters */,
4841 /// ]);
4842 /// ```
4843 pub fn set_fields<T, V>(mut self, v: T) -> Self
4844 where
4845 T: std::iter::IntoIterator<Item = V>,
4846 V: std::convert::Into<crate::model::Field>,
4847 {
4848 use std::iter::Iterator;
4849 self.fields = v.into_iter().map(|i| i.into()).collect();
4850 self
4851 }
4852
4853 /// Sets the value of [next_page_token][crate::model::ListFieldsResponse::next_page_token].
4854 ///
4855 /// # Example
4856 /// ```ignore,no_run
4857 /// # use google_cloud_firestore_admin_v1::model::ListFieldsResponse;
4858 /// let x = ListFieldsResponse::new().set_next_page_token("example");
4859 /// ```
4860 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4861 self.next_page_token = v.into();
4862 self
4863 }
4864}
4865
4866impl wkt::message::Message for ListFieldsResponse {
4867 fn typename() -> &'static str {
4868 "type.googleapis.com/google.firestore.admin.v1.ListFieldsResponse"
4869 }
4870}
4871
4872#[doc(hidden)]
4873impl google_cloud_gax::paginator::internal::PageableResponse for ListFieldsResponse {
4874 type PageItem = crate::model::Field;
4875
4876 fn items(self) -> std::vec::Vec<Self::PageItem> {
4877 self.fields
4878 }
4879
4880 fn next_page_token(&self) -> std::string::String {
4881 use std::clone::Clone;
4882 self.next_page_token.clone()
4883 }
4884}
4885
4886/// The request for
4887/// [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments].
4888///
4889/// [google.firestore.admin.v1.FirestoreAdmin.ExportDocuments]: crate::client::FirestoreAdmin::export_documents
4890#[derive(Clone, Default, PartialEq)]
4891#[non_exhaustive]
4892pub struct ExportDocumentsRequest {
4893 /// Required. Database to export. Should be of the form:
4894 /// `projects/{project_id}/databases/{database_id}`.
4895 pub name: std::string::String,
4896
4897 /// IDs of the collection groups to export. Unspecified means all
4898 /// collection groups. Each collection group in this list must be unique.
4899 pub collection_ids: std::vec::Vec<std::string::String>,
4900
4901 /// The output URI. Currently only supports Google Cloud Storage URIs of the
4902 /// form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name
4903 /// of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional
4904 /// Google Cloud Storage namespace path. When
4905 /// choosing a name, be sure to consider Google Cloud Storage naming
4906 /// guidelines: <https://cloud.google.com/storage/docs/naming>.
4907 /// If the URI is a bucket (without a namespace path), a prefix will be
4908 /// generated based on the start time.
4909 pub output_uri_prefix: std::string::String,
4910
4911 /// An empty list represents all namespaces. This is the preferred
4912 /// usage for databases that don't use namespaces.
4913 ///
4914 /// An empty string element represents the default namespace. This should be
4915 /// used if the database has data in non-default namespaces, but doesn't want
4916 /// to include them. Each namespace in this list must be unique.
4917 pub namespace_ids: std::vec::Vec<std::string::String>,
4918
4919 /// The timestamp that corresponds to the version of the database to be
4920 /// exported. The timestamp must be in the past, rounded to the minute and not
4921 /// older than
4922 /// [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
4923 /// If specified, then the exported documents will represent a consistent view
4924 /// of the database at the provided time. Otherwise, there are no guarantees
4925 /// about the consistency of the exported documents.
4926 ///
4927 /// [google.firestore.admin.v1.Database.earliest_version_time]: crate::model::Database::earliest_version_time
4928 pub snapshot_time: std::option::Option<wkt::Timestamp>,
4929
4930 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4931}
4932
4933impl ExportDocumentsRequest {
4934 pub fn new() -> Self {
4935 std::default::Default::default()
4936 }
4937
4938 /// Sets the value of [name][crate::model::ExportDocumentsRequest::name].
4939 ///
4940 /// # Example
4941 /// ```ignore,no_run
4942 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
4943 /// let x = ExportDocumentsRequest::new().set_name("example");
4944 /// ```
4945 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4946 self.name = v.into();
4947 self
4948 }
4949
4950 /// Sets the value of [collection_ids][crate::model::ExportDocumentsRequest::collection_ids].
4951 ///
4952 /// # Example
4953 /// ```ignore,no_run
4954 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
4955 /// let x = ExportDocumentsRequest::new().set_collection_ids(["a", "b", "c"]);
4956 /// ```
4957 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
4958 where
4959 T: std::iter::IntoIterator<Item = V>,
4960 V: std::convert::Into<std::string::String>,
4961 {
4962 use std::iter::Iterator;
4963 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
4964 self
4965 }
4966
4967 /// Sets the value of [output_uri_prefix][crate::model::ExportDocumentsRequest::output_uri_prefix].
4968 ///
4969 /// # Example
4970 /// ```ignore,no_run
4971 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
4972 /// let x = ExportDocumentsRequest::new().set_output_uri_prefix("example");
4973 /// ```
4974 pub fn set_output_uri_prefix<T: std::convert::Into<std::string::String>>(
4975 mut self,
4976 v: T,
4977 ) -> Self {
4978 self.output_uri_prefix = v.into();
4979 self
4980 }
4981
4982 /// Sets the value of [namespace_ids][crate::model::ExportDocumentsRequest::namespace_ids].
4983 ///
4984 /// # Example
4985 /// ```ignore,no_run
4986 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
4987 /// let x = ExportDocumentsRequest::new().set_namespace_ids(["a", "b", "c"]);
4988 /// ```
4989 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
4990 where
4991 T: std::iter::IntoIterator<Item = V>,
4992 V: std::convert::Into<std::string::String>,
4993 {
4994 use std::iter::Iterator;
4995 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
4996 self
4997 }
4998
4999 /// Sets the value of [snapshot_time][crate::model::ExportDocumentsRequest::snapshot_time].
5000 ///
5001 /// # Example
5002 /// ```ignore,no_run
5003 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
5004 /// use wkt::Timestamp;
5005 /// let x = ExportDocumentsRequest::new().set_snapshot_time(Timestamp::default()/* use setters */);
5006 /// ```
5007 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
5008 where
5009 T: std::convert::Into<wkt::Timestamp>,
5010 {
5011 self.snapshot_time = std::option::Option::Some(v.into());
5012 self
5013 }
5014
5015 /// Sets or clears the value of [snapshot_time][crate::model::ExportDocumentsRequest::snapshot_time].
5016 ///
5017 /// # Example
5018 /// ```ignore,no_run
5019 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
5020 /// use wkt::Timestamp;
5021 /// let x = ExportDocumentsRequest::new().set_or_clear_snapshot_time(Some(Timestamp::default()/* use setters */));
5022 /// let x = ExportDocumentsRequest::new().set_or_clear_snapshot_time(None::<Timestamp>);
5023 /// ```
5024 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
5025 where
5026 T: std::convert::Into<wkt::Timestamp>,
5027 {
5028 self.snapshot_time = v.map(|x| x.into());
5029 self
5030 }
5031}
5032
5033impl wkt::message::Message for ExportDocumentsRequest {
5034 fn typename() -> &'static str {
5035 "type.googleapis.com/google.firestore.admin.v1.ExportDocumentsRequest"
5036 }
5037}
5038
5039/// The request for
5040/// [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments].
5041///
5042/// [google.firestore.admin.v1.FirestoreAdmin.ImportDocuments]: crate::client::FirestoreAdmin::import_documents
5043#[derive(Clone, Default, PartialEq)]
5044#[non_exhaustive]
5045pub struct ImportDocumentsRequest {
5046 /// Required. Database to import into. Should be of the form:
5047 /// `projects/{project_id}/databases/{database_id}`.
5048 pub name: std::string::String,
5049
5050 /// IDs of the collection groups to import. Unspecified means all collection
5051 /// groups that were included in the export. Each collection group in this list
5052 /// must be unique.
5053 pub collection_ids: std::vec::Vec<std::string::String>,
5054
5055 /// Location of the exported files.
5056 /// This must match the output_uri_prefix of an ExportDocumentsResponse from
5057 /// an export that has completed successfully.
5058 /// See:
5059 /// [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix].
5060 ///
5061 /// [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix]: crate::model::ExportDocumentsResponse::output_uri_prefix
5062 pub input_uri_prefix: std::string::String,
5063
5064 /// An empty list represents all namespaces. This is the preferred
5065 /// usage for databases that don't use namespaces.
5066 ///
5067 /// An empty string element represents the default namespace. This should be
5068 /// used if the database has data in non-default namespaces, but doesn't want
5069 /// to include them. Each namespace in this list must be unique.
5070 pub namespace_ids: std::vec::Vec<std::string::String>,
5071
5072 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5073}
5074
5075impl ImportDocumentsRequest {
5076 pub fn new() -> Self {
5077 std::default::Default::default()
5078 }
5079
5080 /// Sets the value of [name][crate::model::ImportDocumentsRequest::name].
5081 ///
5082 /// # Example
5083 /// ```ignore,no_run
5084 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsRequest;
5085 /// let x = ImportDocumentsRequest::new().set_name("example");
5086 /// ```
5087 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5088 self.name = v.into();
5089 self
5090 }
5091
5092 /// Sets the value of [collection_ids][crate::model::ImportDocumentsRequest::collection_ids].
5093 ///
5094 /// # Example
5095 /// ```ignore,no_run
5096 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsRequest;
5097 /// let x = ImportDocumentsRequest::new().set_collection_ids(["a", "b", "c"]);
5098 /// ```
5099 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
5100 where
5101 T: std::iter::IntoIterator<Item = V>,
5102 V: std::convert::Into<std::string::String>,
5103 {
5104 use std::iter::Iterator;
5105 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
5106 self
5107 }
5108
5109 /// Sets the value of [input_uri_prefix][crate::model::ImportDocumentsRequest::input_uri_prefix].
5110 ///
5111 /// # Example
5112 /// ```ignore,no_run
5113 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsRequest;
5114 /// let x = ImportDocumentsRequest::new().set_input_uri_prefix("example");
5115 /// ```
5116 pub fn set_input_uri_prefix<T: std::convert::Into<std::string::String>>(
5117 mut self,
5118 v: T,
5119 ) -> Self {
5120 self.input_uri_prefix = v.into();
5121 self
5122 }
5123
5124 /// Sets the value of [namespace_ids][crate::model::ImportDocumentsRequest::namespace_ids].
5125 ///
5126 /// # Example
5127 /// ```ignore,no_run
5128 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsRequest;
5129 /// let x = ImportDocumentsRequest::new().set_namespace_ids(["a", "b", "c"]);
5130 /// ```
5131 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
5132 where
5133 T: std::iter::IntoIterator<Item = V>,
5134 V: std::convert::Into<std::string::String>,
5135 {
5136 use std::iter::Iterator;
5137 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
5138 self
5139 }
5140}
5141
5142impl wkt::message::Message for ImportDocumentsRequest {
5143 fn typename() -> &'static str {
5144 "type.googleapis.com/google.firestore.admin.v1.ImportDocumentsRequest"
5145 }
5146}
5147
5148/// The request for
5149/// [FirestoreAdmin.BulkDeleteDocuments][google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments].
5150///
5151/// When both collection_ids and namespace_ids are set, only documents satisfying
5152/// both conditions will be deleted.
5153///
5154/// Requests with namespace_ids and collection_ids both empty will be rejected.
5155/// Please use
5156/// [FirestoreAdmin.DeleteDatabase][google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase]
5157/// instead.
5158///
5159/// [google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments]: crate::client::FirestoreAdmin::bulk_delete_documents
5160/// [google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase]: crate::client::FirestoreAdmin::delete_database
5161#[derive(Clone, Default, PartialEq)]
5162#[non_exhaustive]
5163pub struct BulkDeleteDocumentsRequest {
5164 /// Required. Database to operate. Should be of the form:
5165 /// `projects/{project_id}/databases/{database_id}`.
5166 pub name: std::string::String,
5167
5168 /// Optional. IDs of the collection groups to delete. Unspecified means all
5169 /// collection groups.
5170 ///
5171 /// Each collection group in this list must be unique.
5172 pub collection_ids: std::vec::Vec<std::string::String>,
5173
5174 /// Optional. Namespaces to delete.
5175 ///
5176 /// An empty list means all namespaces. This is the recommended
5177 /// usage for databases that don't use namespaces.
5178 ///
5179 /// An empty string element represents the default namespace. This should be
5180 /// used if the database has data in non-default namespaces, but doesn't want
5181 /// to delete from them.
5182 ///
5183 /// Each namespace in this list must be unique.
5184 pub namespace_ids: std::vec::Vec<std::string::String>,
5185
5186 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5187}
5188
5189impl BulkDeleteDocumentsRequest {
5190 pub fn new() -> Self {
5191 std::default::Default::default()
5192 }
5193
5194 /// Sets the value of [name][crate::model::BulkDeleteDocumentsRequest::name].
5195 ///
5196 /// # Example
5197 /// ```ignore,no_run
5198 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsRequest;
5199 /// let x = BulkDeleteDocumentsRequest::new().set_name("example");
5200 /// ```
5201 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5202 self.name = v.into();
5203 self
5204 }
5205
5206 /// Sets the value of [collection_ids][crate::model::BulkDeleteDocumentsRequest::collection_ids].
5207 ///
5208 /// # Example
5209 /// ```ignore,no_run
5210 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsRequest;
5211 /// let x = BulkDeleteDocumentsRequest::new().set_collection_ids(["a", "b", "c"]);
5212 /// ```
5213 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
5214 where
5215 T: std::iter::IntoIterator<Item = V>,
5216 V: std::convert::Into<std::string::String>,
5217 {
5218 use std::iter::Iterator;
5219 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
5220 self
5221 }
5222
5223 /// Sets the value of [namespace_ids][crate::model::BulkDeleteDocumentsRequest::namespace_ids].
5224 ///
5225 /// # Example
5226 /// ```ignore,no_run
5227 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsRequest;
5228 /// let x = BulkDeleteDocumentsRequest::new().set_namespace_ids(["a", "b", "c"]);
5229 /// ```
5230 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
5231 where
5232 T: std::iter::IntoIterator<Item = V>,
5233 V: std::convert::Into<std::string::String>,
5234 {
5235 use std::iter::Iterator;
5236 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
5237 self
5238 }
5239}
5240
5241impl wkt::message::Message for BulkDeleteDocumentsRequest {
5242 fn typename() -> &'static str {
5243 "type.googleapis.com/google.firestore.admin.v1.BulkDeleteDocumentsRequest"
5244 }
5245}
5246
5247/// The response for
5248/// [FirestoreAdmin.BulkDeleteDocuments][google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments].
5249///
5250/// [google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments]: crate::client::FirestoreAdmin::bulk_delete_documents
5251#[derive(Clone, Default, PartialEq)]
5252#[non_exhaustive]
5253pub struct BulkDeleteDocumentsResponse {
5254 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5255}
5256
5257impl BulkDeleteDocumentsResponse {
5258 pub fn new() -> Self {
5259 std::default::Default::default()
5260 }
5261}
5262
5263impl wkt::message::Message for BulkDeleteDocumentsResponse {
5264 fn typename() -> &'static str {
5265 "type.googleapis.com/google.firestore.admin.v1.BulkDeleteDocumentsResponse"
5266 }
5267}
5268
5269/// The request for
5270/// [FirestoreAdmin.GetBackup][google.firestore.admin.v1.FirestoreAdmin.GetBackup].
5271///
5272/// [google.firestore.admin.v1.FirestoreAdmin.GetBackup]: crate::client::FirestoreAdmin::get_backup
5273#[derive(Clone, Default, PartialEq)]
5274#[non_exhaustive]
5275pub struct GetBackupRequest {
5276 /// Required. Name of the backup to fetch.
5277 ///
5278 /// Format is `projects/{project}/locations/{location}/backups/{backup}`.
5279 pub name: std::string::String,
5280
5281 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5282}
5283
5284impl GetBackupRequest {
5285 pub fn new() -> Self {
5286 std::default::Default::default()
5287 }
5288
5289 /// Sets the value of [name][crate::model::GetBackupRequest::name].
5290 ///
5291 /// # Example
5292 /// ```ignore,no_run
5293 /// # use google_cloud_firestore_admin_v1::model::GetBackupRequest;
5294 /// let x = GetBackupRequest::new().set_name("example");
5295 /// ```
5296 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5297 self.name = v.into();
5298 self
5299 }
5300}
5301
5302impl wkt::message::Message for GetBackupRequest {
5303 fn typename() -> &'static str {
5304 "type.googleapis.com/google.firestore.admin.v1.GetBackupRequest"
5305 }
5306}
5307
5308/// The request for
5309/// [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups].
5310///
5311/// [google.firestore.admin.v1.FirestoreAdmin.ListBackups]: crate::client::FirestoreAdmin::list_backups
5312#[derive(Clone, Default, PartialEq)]
5313#[non_exhaustive]
5314pub struct ListBackupsRequest {
5315 /// Required. The location to list backups from.
5316 ///
5317 /// Format is `projects/{project}/locations/{location}`.
5318 /// Use `{location} = '-'` to list backups from all locations for the given
5319 /// project. This allows listing backups from a single location or from all
5320 /// locations.
5321 pub parent: std::string::String,
5322
5323 /// An expression that filters the list of returned backups.
5324 ///
5325 /// A filter expression consists of a field name, a comparison operator, and a
5326 /// value for filtering.
5327 /// The value must be a string, a number, or a boolean. The comparison operator
5328 /// must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
5329 /// Colon `:` is the contains operator. Filter rules are not case sensitive.
5330 ///
5331 /// The following fields in the [Backup][google.firestore.admin.v1.Backup] are
5332 /// eligible for filtering:
5333 ///
5334 /// * `database_uid` (supports `=` only)
5335 ///
5336 /// [google.firestore.admin.v1.Backup]: crate::model::Backup
5337 pub filter: std::string::String,
5338
5339 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5340}
5341
5342impl ListBackupsRequest {
5343 pub fn new() -> Self {
5344 std::default::Default::default()
5345 }
5346
5347 /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
5348 ///
5349 /// # Example
5350 /// ```ignore,no_run
5351 /// # use google_cloud_firestore_admin_v1::model::ListBackupsRequest;
5352 /// let x = ListBackupsRequest::new().set_parent("example");
5353 /// ```
5354 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5355 self.parent = v.into();
5356 self
5357 }
5358
5359 /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
5360 ///
5361 /// # Example
5362 /// ```ignore,no_run
5363 /// # use google_cloud_firestore_admin_v1::model::ListBackupsRequest;
5364 /// let x = ListBackupsRequest::new().set_filter("example");
5365 /// ```
5366 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5367 self.filter = v.into();
5368 self
5369 }
5370}
5371
5372impl wkt::message::Message for ListBackupsRequest {
5373 fn typename() -> &'static str {
5374 "type.googleapis.com/google.firestore.admin.v1.ListBackupsRequest"
5375 }
5376}
5377
5378/// The response for
5379/// [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups].
5380///
5381/// [google.firestore.admin.v1.FirestoreAdmin.ListBackups]: crate::client::FirestoreAdmin::list_backups
5382#[derive(Clone, Default, PartialEq)]
5383#[non_exhaustive]
5384pub struct ListBackupsResponse {
5385 /// List of all backups for the project.
5386 pub backups: std::vec::Vec<crate::model::Backup>,
5387
5388 /// List of locations that existing backups were not able to be fetched from.
5389 ///
5390 /// Instead of failing the entire requests when a single location is
5391 /// unreachable, this response returns a partial result set and list of
5392 /// locations unable to be reached here. The request can be retried against a
5393 /// single location to get a concrete error.
5394 pub unreachable: std::vec::Vec<std::string::String>,
5395
5396 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5397}
5398
5399impl ListBackupsResponse {
5400 pub fn new() -> Self {
5401 std::default::Default::default()
5402 }
5403
5404 /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
5405 ///
5406 /// # Example
5407 /// ```ignore,no_run
5408 /// # use google_cloud_firestore_admin_v1::model::ListBackupsResponse;
5409 /// use google_cloud_firestore_admin_v1::model::Backup;
5410 /// let x = ListBackupsResponse::new()
5411 /// .set_backups([
5412 /// Backup::default()/* use setters */,
5413 /// Backup::default()/* use (different) setters */,
5414 /// ]);
5415 /// ```
5416 pub fn set_backups<T, V>(mut self, v: T) -> Self
5417 where
5418 T: std::iter::IntoIterator<Item = V>,
5419 V: std::convert::Into<crate::model::Backup>,
5420 {
5421 use std::iter::Iterator;
5422 self.backups = v.into_iter().map(|i| i.into()).collect();
5423 self
5424 }
5425
5426 /// Sets the value of [unreachable][crate::model::ListBackupsResponse::unreachable].
5427 ///
5428 /// # Example
5429 /// ```ignore,no_run
5430 /// # use google_cloud_firestore_admin_v1::model::ListBackupsResponse;
5431 /// let x = ListBackupsResponse::new().set_unreachable(["a", "b", "c"]);
5432 /// ```
5433 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5434 where
5435 T: std::iter::IntoIterator<Item = V>,
5436 V: std::convert::Into<std::string::String>,
5437 {
5438 use std::iter::Iterator;
5439 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5440 self
5441 }
5442}
5443
5444impl wkt::message::Message for ListBackupsResponse {
5445 fn typename() -> &'static str {
5446 "type.googleapis.com/google.firestore.admin.v1.ListBackupsResponse"
5447 }
5448}
5449
5450/// The request for
5451/// [FirestoreAdmin.DeleteBackup][google.firestore.admin.v1.FirestoreAdmin.DeleteBackup].
5452///
5453/// [google.firestore.admin.v1.FirestoreAdmin.DeleteBackup]: crate::client::FirestoreAdmin::delete_backup
5454#[derive(Clone, Default, PartialEq)]
5455#[non_exhaustive]
5456pub struct DeleteBackupRequest {
5457 /// Required. Name of the backup to delete.
5458 ///
5459 /// format is `projects/{project}/locations/{location}/backups/{backup}`.
5460 pub name: std::string::String,
5461
5462 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5463}
5464
5465impl DeleteBackupRequest {
5466 pub fn new() -> Self {
5467 std::default::Default::default()
5468 }
5469
5470 /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
5471 ///
5472 /// # Example
5473 /// ```ignore,no_run
5474 /// # use google_cloud_firestore_admin_v1::model::DeleteBackupRequest;
5475 /// let x = DeleteBackupRequest::new().set_name("example");
5476 /// ```
5477 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5478 self.name = v.into();
5479 self
5480 }
5481}
5482
5483impl wkt::message::Message for DeleteBackupRequest {
5484 fn typename() -> &'static str {
5485 "type.googleapis.com/google.firestore.admin.v1.DeleteBackupRequest"
5486 }
5487}
5488
5489/// The request message for
5490/// [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.FirestoreAdmin.RestoreDatabase].
5491///
5492/// [google.firestore.admin.v1.FirestoreAdmin.RestoreDatabase]: crate::client::FirestoreAdmin::restore_database
5493#[derive(Clone, Default, PartialEq)]
5494#[non_exhaustive]
5495pub struct RestoreDatabaseRequest {
5496 /// Required. The project to restore the database in. Format is
5497 /// `projects/{project_id}`.
5498 pub parent: std::string::String,
5499
5500 /// Required. The ID to use for the database, which will become the final
5501 /// component of the database's resource name. This database ID must not be
5502 /// associated with an existing database.
5503 ///
5504 /// This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
5505 /// with first character a letter and the last a letter or a number. Must not
5506 /// be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
5507 ///
5508 /// "(default)" database ID is also valid if the database is Standard edition.
5509 pub database_id: std::string::String,
5510
5511 /// Required. Backup to restore from. Must be from the same project as the
5512 /// parent.
5513 ///
5514 /// The restored database will be created in the same location as the source
5515 /// backup.
5516 ///
5517 /// Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
5518 pub backup: std::string::String,
5519
5520 /// Optional. Encryption configuration for the restored database.
5521 ///
5522 /// If this field is not specified, the restored database will use
5523 /// the same encryption configuration as the backup, namely
5524 /// [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
5525 ///
5526 /// [google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption]: crate::model::database::EncryptionConfig::encryption_type
5527 pub encryption_config: std::option::Option<crate::model::database::EncryptionConfig>,
5528
5529 /// Optional. Immutable. Tags to be bound to the restored database.
5530 ///
5531 /// The tags should be provided in the format of
5532 /// `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
5533 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
5534
5535 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5536}
5537
5538impl RestoreDatabaseRequest {
5539 pub fn new() -> Self {
5540 std::default::Default::default()
5541 }
5542
5543 /// Sets the value of [parent][crate::model::RestoreDatabaseRequest::parent].
5544 ///
5545 /// # Example
5546 /// ```ignore,no_run
5547 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5548 /// let x = RestoreDatabaseRequest::new().set_parent("example");
5549 /// ```
5550 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5551 self.parent = v.into();
5552 self
5553 }
5554
5555 /// Sets the value of [database_id][crate::model::RestoreDatabaseRequest::database_id].
5556 ///
5557 /// # Example
5558 /// ```ignore,no_run
5559 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5560 /// let x = RestoreDatabaseRequest::new().set_database_id("example");
5561 /// ```
5562 pub fn set_database_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5563 self.database_id = v.into();
5564 self
5565 }
5566
5567 /// Sets the value of [backup][crate::model::RestoreDatabaseRequest::backup].
5568 ///
5569 /// # Example
5570 /// ```ignore,no_run
5571 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5572 /// let x = RestoreDatabaseRequest::new().set_backup("example");
5573 /// ```
5574 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5575 self.backup = v.into();
5576 self
5577 }
5578
5579 /// Sets the value of [encryption_config][crate::model::RestoreDatabaseRequest::encryption_config].
5580 ///
5581 /// # Example
5582 /// ```ignore,no_run
5583 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5584 /// use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
5585 /// let x = RestoreDatabaseRequest::new().set_encryption_config(EncryptionConfig::default()/* use setters */);
5586 /// ```
5587 pub fn set_encryption_config<T>(mut self, v: T) -> Self
5588 where
5589 T: std::convert::Into<crate::model::database::EncryptionConfig>,
5590 {
5591 self.encryption_config = std::option::Option::Some(v.into());
5592 self
5593 }
5594
5595 /// Sets or clears the value of [encryption_config][crate::model::RestoreDatabaseRequest::encryption_config].
5596 ///
5597 /// # Example
5598 /// ```ignore,no_run
5599 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5600 /// use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
5601 /// let x = RestoreDatabaseRequest::new().set_or_clear_encryption_config(Some(EncryptionConfig::default()/* use setters */));
5602 /// let x = RestoreDatabaseRequest::new().set_or_clear_encryption_config(None::<EncryptionConfig>);
5603 /// ```
5604 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
5605 where
5606 T: std::convert::Into<crate::model::database::EncryptionConfig>,
5607 {
5608 self.encryption_config = v.map(|x| x.into());
5609 self
5610 }
5611
5612 /// Sets the value of [tags][crate::model::RestoreDatabaseRequest::tags].
5613 ///
5614 /// # Example
5615 /// ```ignore,no_run
5616 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5617 /// let x = RestoreDatabaseRequest::new().set_tags([
5618 /// ("key0", "abc"),
5619 /// ("key1", "xyz"),
5620 /// ]);
5621 /// ```
5622 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
5623 where
5624 T: std::iter::IntoIterator<Item = (K, V)>,
5625 K: std::convert::Into<std::string::String>,
5626 V: std::convert::Into<std::string::String>,
5627 {
5628 use std::iter::Iterator;
5629 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5630 self
5631 }
5632}
5633
5634impl wkt::message::Message for RestoreDatabaseRequest {
5635 fn typename() -> &'static str {
5636 "type.googleapis.com/google.firestore.admin.v1.RestoreDatabaseRequest"
5637 }
5638}
5639
5640/// The request message for
5641/// [FirestoreAdmin.CloneDatabase][google.firestore.admin.v1.FirestoreAdmin.CloneDatabase].
5642///
5643/// [google.firestore.admin.v1.FirestoreAdmin.CloneDatabase]: crate::client::FirestoreAdmin::clone_database
5644#[derive(Clone, Default, PartialEq)]
5645#[non_exhaustive]
5646pub struct CloneDatabaseRequest {
5647 /// Required. The project to clone the database in. Format is
5648 /// `projects/{project_id}`.
5649 pub parent: std::string::String,
5650
5651 /// Required. The ID to use for the database, which will become the final
5652 /// component of the database's resource name. This database ID must not be
5653 /// associated with an existing database.
5654 ///
5655 /// This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
5656 /// with first character a letter and the last a letter or a number. Must not
5657 /// be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
5658 ///
5659 /// "(default)" database ID is also valid if the database is Standard edition.
5660 pub database_id: std::string::String,
5661
5662 /// Required. Specification of the PITR data to clone from. The source database
5663 /// must exist.
5664 ///
5665 /// The cloned database will be created in the same location as the source
5666 /// database.
5667 pub pitr_snapshot: std::option::Option<crate::model::PitrSnapshot>,
5668
5669 /// Optional. Encryption configuration for the cloned database.
5670 ///
5671 /// If this field is not specified, the cloned database will use
5672 /// the same encryption configuration as the source database, namely
5673 /// [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
5674 ///
5675 /// [google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption]: crate::model::database::EncryptionConfig::encryption_type
5676 pub encryption_config: std::option::Option<crate::model::database::EncryptionConfig>,
5677
5678 /// Optional. Immutable. Tags to be bound to the cloned database.
5679 ///
5680 /// The tags should be provided in the format of
5681 /// `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
5682 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
5683
5684 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5685}
5686
5687impl CloneDatabaseRequest {
5688 pub fn new() -> Self {
5689 std::default::Default::default()
5690 }
5691
5692 /// Sets the value of [parent][crate::model::CloneDatabaseRequest::parent].
5693 ///
5694 /// # Example
5695 /// ```ignore,no_run
5696 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5697 /// let x = CloneDatabaseRequest::new().set_parent("example");
5698 /// ```
5699 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5700 self.parent = v.into();
5701 self
5702 }
5703
5704 /// Sets the value of [database_id][crate::model::CloneDatabaseRequest::database_id].
5705 ///
5706 /// # Example
5707 /// ```ignore,no_run
5708 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5709 /// let x = CloneDatabaseRequest::new().set_database_id("example");
5710 /// ```
5711 pub fn set_database_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5712 self.database_id = v.into();
5713 self
5714 }
5715
5716 /// Sets the value of [pitr_snapshot][crate::model::CloneDatabaseRequest::pitr_snapshot].
5717 ///
5718 /// # Example
5719 /// ```ignore,no_run
5720 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5721 /// use google_cloud_firestore_admin_v1::model::PitrSnapshot;
5722 /// let x = CloneDatabaseRequest::new().set_pitr_snapshot(PitrSnapshot::default()/* use setters */);
5723 /// ```
5724 pub fn set_pitr_snapshot<T>(mut self, v: T) -> Self
5725 where
5726 T: std::convert::Into<crate::model::PitrSnapshot>,
5727 {
5728 self.pitr_snapshot = std::option::Option::Some(v.into());
5729 self
5730 }
5731
5732 /// Sets or clears the value of [pitr_snapshot][crate::model::CloneDatabaseRequest::pitr_snapshot].
5733 ///
5734 /// # Example
5735 /// ```ignore,no_run
5736 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5737 /// use google_cloud_firestore_admin_v1::model::PitrSnapshot;
5738 /// let x = CloneDatabaseRequest::new().set_or_clear_pitr_snapshot(Some(PitrSnapshot::default()/* use setters */));
5739 /// let x = CloneDatabaseRequest::new().set_or_clear_pitr_snapshot(None::<PitrSnapshot>);
5740 /// ```
5741 pub fn set_or_clear_pitr_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
5742 where
5743 T: std::convert::Into<crate::model::PitrSnapshot>,
5744 {
5745 self.pitr_snapshot = v.map(|x| x.into());
5746 self
5747 }
5748
5749 /// Sets the value of [encryption_config][crate::model::CloneDatabaseRequest::encryption_config].
5750 ///
5751 /// # Example
5752 /// ```ignore,no_run
5753 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5754 /// use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
5755 /// let x = CloneDatabaseRequest::new().set_encryption_config(EncryptionConfig::default()/* use setters */);
5756 /// ```
5757 pub fn set_encryption_config<T>(mut self, v: T) -> Self
5758 where
5759 T: std::convert::Into<crate::model::database::EncryptionConfig>,
5760 {
5761 self.encryption_config = std::option::Option::Some(v.into());
5762 self
5763 }
5764
5765 /// Sets or clears the value of [encryption_config][crate::model::CloneDatabaseRequest::encryption_config].
5766 ///
5767 /// # Example
5768 /// ```ignore,no_run
5769 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5770 /// use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
5771 /// let x = CloneDatabaseRequest::new().set_or_clear_encryption_config(Some(EncryptionConfig::default()/* use setters */));
5772 /// let x = CloneDatabaseRequest::new().set_or_clear_encryption_config(None::<EncryptionConfig>);
5773 /// ```
5774 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
5775 where
5776 T: std::convert::Into<crate::model::database::EncryptionConfig>,
5777 {
5778 self.encryption_config = v.map(|x| x.into());
5779 self
5780 }
5781
5782 /// Sets the value of [tags][crate::model::CloneDatabaseRequest::tags].
5783 ///
5784 /// # Example
5785 /// ```ignore,no_run
5786 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5787 /// let x = CloneDatabaseRequest::new().set_tags([
5788 /// ("key0", "abc"),
5789 /// ("key1", "xyz"),
5790 /// ]);
5791 /// ```
5792 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
5793 where
5794 T: std::iter::IntoIterator<Item = (K, V)>,
5795 K: std::convert::Into<std::string::String>,
5796 V: std::convert::Into<std::string::String>,
5797 {
5798 use std::iter::Iterator;
5799 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5800 self
5801 }
5802}
5803
5804impl wkt::message::Message for CloneDatabaseRequest {
5805 fn typename() -> &'static str {
5806 "type.googleapis.com/google.firestore.admin.v1.CloneDatabaseRequest"
5807 }
5808}
5809
5810/// Cloud Firestore indexes enable simple and complex queries against
5811/// documents in a database.
5812#[derive(Clone, Default, PartialEq)]
5813#[non_exhaustive]
5814pub struct Index {
5815 /// Output only. A server defined name for this index.
5816 /// The form of this name for composite indexes will be:
5817 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}`
5818 /// For single field indexes, this field will be empty.
5819 pub name: std::string::String,
5820
5821 /// Indexes with a collection query scope specified allow queries
5822 /// against a collection that is the child of a specific document, specified at
5823 /// query time, and that has the same collection ID.
5824 ///
5825 /// Indexes with a collection group query scope specified allow queries against
5826 /// all collections descended from a specific document, specified at query
5827 /// time, and that have the same collection ID as this index.
5828 pub query_scope: crate::model::index::QueryScope,
5829
5830 /// The API scope supported by this index.
5831 pub api_scope: crate::model::index::ApiScope,
5832
5833 /// The fields supported by this index.
5834 ///
5835 /// For composite indexes, this requires a minimum of 2 and a maximum of 100
5836 /// fields. The last field entry is always for the field path `__name__`. If,
5837 /// on creation, `__name__` was not specified as the last field, it will be
5838 /// added automatically with the same direction as that of the last field
5839 /// defined. If the final field in a composite index is not directional, the
5840 /// `__name__` will be ordered ASCENDING (unless explicitly specified).
5841 ///
5842 /// For single field indexes, this will always be exactly one entry with a
5843 /// field path equal to the field path of the associated field.
5844 pub fields: std::vec::Vec<crate::model::index::IndexField>,
5845
5846 /// Output only. The serving state of the index.
5847 pub state: crate::model::index::State,
5848
5849 /// Immutable. The density configuration of the index.
5850 pub density: crate::model::index::Density,
5851
5852 /// Optional. Whether the index is multikey. By default, the index is not
5853 /// multikey. For non-multikey indexes, none of the paths in the index
5854 /// definition reach or traverse an array, except via an explicit array index.
5855 /// For multikey indexes, at most one of the paths in the index definition
5856 /// reach or traverse an array, except via an explicit array index. Violations
5857 /// will result in errors.
5858 ///
5859 /// Note this field only applies to index with MONGODB_COMPATIBLE_API ApiScope.
5860 pub multikey: bool,
5861
5862 /// Optional. The number of shards for the index.
5863 pub shard_count: i32,
5864
5865 /// Optional. Whether it is an unique index. Unique index ensures all values
5866 /// for the indexed field(s) are unique across documents.
5867 pub unique: bool,
5868
5869 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5870}
5871
5872impl Index {
5873 pub fn new() -> Self {
5874 std::default::Default::default()
5875 }
5876
5877 /// Sets the value of [name][crate::model::Index::name].
5878 ///
5879 /// # Example
5880 /// ```ignore,no_run
5881 /// # use google_cloud_firestore_admin_v1::model::Index;
5882 /// let x = Index::new().set_name("example");
5883 /// ```
5884 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5885 self.name = v.into();
5886 self
5887 }
5888
5889 /// Sets the value of [query_scope][crate::model::Index::query_scope].
5890 ///
5891 /// # Example
5892 /// ```ignore,no_run
5893 /// # use google_cloud_firestore_admin_v1::model::Index;
5894 /// use google_cloud_firestore_admin_v1::model::index::QueryScope;
5895 /// let x0 = Index::new().set_query_scope(QueryScope::Collection);
5896 /// let x1 = Index::new().set_query_scope(QueryScope::CollectionGroup);
5897 /// let x2 = Index::new().set_query_scope(QueryScope::CollectionRecursive);
5898 /// ```
5899 pub fn set_query_scope<T: std::convert::Into<crate::model::index::QueryScope>>(
5900 mut self,
5901 v: T,
5902 ) -> Self {
5903 self.query_scope = v.into();
5904 self
5905 }
5906
5907 /// Sets the value of [api_scope][crate::model::Index::api_scope].
5908 ///
5909 /// # Example
5910 /// ```ignore,no_run
5911 /// # use google_cloud_firestore_admin_v1::model::Index;
5912 /// use google_cloud_firestore_admin_v1::model::index::ApiScope;
5913 /// let x0 = Index::new().set_api_scope(ApiScope::DatastoreModeApi);
5914 /// let x1 = Index::new().set_api_scope(ApiScope::MongodbCompatibleApi);
5915 /// ```
5916 pub fn set_api_scope<T: std::convert::Into<crate::model::index::ApiScope>>(
5917 mut self,
5918 v: T,
5919 ) -> Self {
5920 self.api_scope = v.into();
5921 self
5922 }
5923
5924 /// Sets the value of [fields][crate::model::Index::fields].
5925 ///
5926 /// # Example
5927 /// ```ignore,no_run
5928 /// # use google_cloud_firestore_admin_v1::model::Index;
5929 /// use google_cloud_firestore_admin_v1::model::index::IndexField;
5930 /// let x = Index::new()
5931 /// .set_fields([
5932 /// IndexField::default()/* use setters */,
5933 /// IndexField::default()/* use (different) setters */,
5934 /// ]);
5935 /// ```
5936 pub fn set_fields<T, V>(mut self, v: T) -> Self
5937 where
5938 T: std::iter::IntoIterator<Item = V>,
5939 V: std::convert::Into<crate::model::index::IndexField>,
5940 {
5941 use std::iter::Iterator;
5942 self.fields = v.into_iter().map(|i| i.into()).collect();
5943 self
5944 }
5945
5946 /// Sets the value of [state][crate::model::Index::state].
5947 ///
5948 /// # Example
5949 /// ```ignore,no_run
5950 /// # use google_cloud_firestore_admin_v1::model::Index;
5951 /// use google_cloud_firestore_admin_v1::model::index::State;
5952 /// let x0 = Index::new().set_state(State::Creating);
5953 /// let x1 = Index::new().set_state(State::Ready);
5954 /// let x2 = Index::new().set_state(State::NeedsRepair);
5955 /// ```
5956 pub fn set_state<T: std::convert::Into<crate::model::index::State>>(mut self, v: T) -> Self {
5957 self.state = v.into();
5958 self
5959 }
5960
5961 /// Sets the value of [density][crate::model::Index::density].
5962 ///
5963 /// # Example
5964 /// ```ignore,no_run
5965 /// # use google_cloud_firestore_admin_v1::model::Index;
5966 /// use google_cloud_firestore_admin_v1::model::index::Density;
5967 /// let x0 = Index::new().set_density(Density::SparseAll);
5968 /// let x1 = Index::new().set_density(Density::SparseAny);
5969 /// let x2 = Index::new().set_density(Density::Dense);
5970 /// ```
5971 pub fn set_density<T: std::convert::Into<crate::model::index::Density>>(
5972 mut self,
5973 v: T,
5974 ) -> Self {
5975 self.density = v.into();
5976 self
5977 }
5978
5979 /// Sets the value of [multikey][crate::model::Index::multikey].
5980 ///
5981 /// # Example
5982 /// ```ignore,no_run
5983 /// # use google_cloud_firestore_admin_v1::model::Index;
5984 /// let x = Index::new().set_multikey(true);
5985 /// ```
5986 pub fn set_multikey<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5987 self.multikey = v.into();
5988 self
5989 }
5990
5991 /// Sets the value of [shard_count][crate::model::Index::shard_count].
5992 ///
5993 /// # Example
5994 /// ```ignore,no_run
5995 /// # use google_cloud_firestore_admin_v1::model::Index;
5996 /// let x = Index::new().set_shard_count(42);
5997 /// ```
5998 pub fn set_shard_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5999 self.shard_count = v.into();
6000 self
6001 }
6002
6003 /// Sets the value of [unique][crate::model::Index::unique].
6004 ///
6005 /// # Example
6006 /// ```ignore,no_run
6007 /// # use google_cloud_firestore_admin_v1::model::Index;
6008 /// let x = Index::new().set_unique(true);
6009 /// ```
6010 pub fn set_unique<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6011 self.unique = v.into();
6012 self
6013 }
6014}
6015
6016impl wkt::message::Message for Index {
6017 fn typename() -> &'static str {
6018 "type.googleapis.com/google.firestore.admin.v1.Index"
6019 }
6020}
6021
6022/// Defines additional types related to [Index].
6023pub mod index {
6024 #[allow(unused_imports)]
6025 use super::*;
6026
6027 /// A field in an index.
6028 /// The field_path describes which field is indexed, the value_mode describes
6029 /// how the field value is indexed.
6030 #[derive(Clone, Default, PartialEq)]
6031 #[non_exhaustive]
6032 pub struct IndexField {
6033 /// Can be __name__.
6034 /// For single field indexes, this must match the name of the field or may
6035 /// be omitted.
6036 pub field_path: std::string::String,
6037
6038 /// How the field value is indexed.
6039 pub value_mode: std::option::Option<crate::model::index::index_field::ValueMode>,
6040
6041 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6042 }
6043
6044 impl IndexField {
6045 pub fn new() -> Self {
6046 std::default::Default::default()
6047 }
6048
6049 /// Sets the value of [field_path][crate::model::index::IndexField::field_path].
6050 ///
6051 /// # Example
6052 /// ```ignore,no_run
6053 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
6054 /// let x = IndexField::new().set_field_path("example");
6055 /// ```
6056 pub fn set_field_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6057 self.field_path = v.into();
6058 self
6059 }
6060
6061 /// Sets the value of [value_mode][crate::model::index::IndexField::value_mode].
6062 ///
6063 /// Note that all the setters affecting `value_mode` are mutually
6064 /// exclusive.
6065 ///
6066 /// # Example
6067 /// ```ignore,no_run
6068 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
6069 /// use google_cloud_firestore_admin_v1::model::index::index_field::Order;
6070 /// let x0 = IndexField::new().set_value_mode(Some(
6071 /// google_cloud_firestore_admin_v1::model::index::index_field::ValueMode::Order(Order::Ascending)));
6072 /// let x1 = IndexField::new().set_value_mode(Some(
6073 /// google_cloud_firestore_admin_v1::model::index::index_field::ValueMode::Order(Order::Descending)));
6074 /// ```
6075 pub fn set_value_mode<
6076 T: std::convert::Into<std::option::Option<crate::model::index::index_field::ValueMode>>,
6077 >(
6078 mut self,
6079 v: T,
6080 ) -> Self {
6081 self.value_mode = v.into();
6082 self
6083 }
6084
6085 /// The value of [value_mode][crate::model::index::IndexField::value_mode]
6086 /// if it holds a `Order`, `None` if the field is not set or
6087 /// holds a different branch.
6088 pub fn order(&self) -> std::option::Option<&crate::model::index::index_field::Order> {
6089 #[allow(unreachable_patterns)]
6090 self.value_mode.as_ref().and_then(|v| match v {
6091 crate::model::index::index_field::ValueMode::Order(v) => {
6092 std::option::Option::Some(v)
6093 }
6094 _ => std::option::Option::None,
6095 })
6096 }
6097
6098 /// Sets the value of [value_mode][crate::model::index::IndexField::value_mode]
6099 /// to hold a `Order`.
6100 ///
6101 /// Note that all the setters affecting `value_mode` are
6102 /// mutually exclusive.
6103 ///
6104 /// # Example
6105 /// ```ignore,no_run
6106 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
6107 /// use google_cloud_firestore_admin_v1::model::index::index_field::Order;
6108 /// let x0 = IndexField::new().set_order(Order::Ascending);
6109 /// let x1 = IndexField::new().set_order(Order::Descending);
6110 /// assert!(x0.order().is_some());
6111 /// assert!(x0.array_config().is_none());
6112 /// assert!(x0.vector_config().is_none());
6113 /// assert!(x1.order().is_some());
6114 /// assert!(x1.array_config().is_none());
6115 /// assert!(x1.vector_config().is_none());
6116 /// ```
6117 pub fn set_order<T: std::convert::Into<crate::model::index::index_field::Order>>(
6118 mut self,
6119 v: T,
6120 ) -> Self {
6121 self.value_mode = std::option::Option::Some(
6122 crate::model::index::index_field::ValueMode::Order(v.into()),
6123 );
6124 self
6125 }
6126
6127 /// The value of [value_mode][crate::model::index::IndexField::value_mode]
6128 /// if it holds a `ArrayConfig`, `None` if the field is not set or
6129 /// holds a different branch.
6130 pub fn array_config(
6131 &self,
6132 ) -> std::option::Option<&crate::model::index::index_field::ArrayConfig> {
6133 #[allow(unreachable_patterns)]
6134 self.value_mode.as_ref().and_then(|v| match v {
6135 crate::model::index::index_field::ValueMode::ArrayConfig(v) => {
6136 std::option::Option::Some(v)
6137 }
6138 _ => std::option::Option::None,
6139 })
6140 }
6141
6142 /// Sets the value of [value_mode][crate::model::index::IndexField::value_mode]
6143 /// to hold a `ArrayConfig`.
6144 ///
6145 /// Note that all the setters affecting `value_mode` are
6146 /// mutually exclusive.
6147 ///
6148 /// # Example
6149 /// ```ignore,no_run
6150 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
6151 /// use google_cloud_firestore_admin_v1::model::index::index_field::ArrayConfig;
6152 /// let x0 = IndexField::new().set_array_config(ArrayConfig::Contains);
6153 /// assert!(x0.array_config().is_some());
6154 /// assert!(x0.order().is_none());
6155 /// assert!(x0.vector_config().is_none());
6156 /// ```
6157 pub fn set_array_config<
6158 T: std::convert::Into<crate::model::index::index_field::ArrayConfig>,
6159 >(
6160 mut self,
6161 v: T,
6162 ) -> Self {
6163 self.value_mode = std::option::Option::Some(
6164 crate::model::index::index_field::ValueMode::ArrayConfig(v.into()),
6165 );
6166 self
6167 }
6168
6169 /// The value of [value_mode][crate::model::index::IndexField::value_mode]
6170 /// if it holds a `VectorConfig`, `None` if the field is not set or
6171 /// holds a different branch.
6172 pub fn vector_config(
6173 &self,
6174 ) -> std::option::Option<&std::boxed::Box<crate::model::index::index_field::VectorConfig>>
6175 {
6176 #[allow(unreachable_patterns)]
6177 self.value_mode.as_ref().and_then(|v| match v {
6178 crate::model::index::index_field::ValueMode::VectorConfig(v) => {
6179 std::option::Option::Some(v)
6180 }
6181 _ => std::option::Option::None,
6182 })
6183 }
6184
6185 /// Sets the value of [value_mode][crate::model::index::IndexField::value_mode]
6186 /// to hold a `VectorConfig`.
6187 ///
6188 /// Note that all the setters affecting `value_mode` are
6189 /// mutually exclusive.
6190 ///
6191 /// # Example
6192 /// ```ignore,no_run
6193 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
6194 /// use google_cloud_firestore_admin_v1::model::index::index_field::VectorConfig;
6195 /// let x = IndexField::new().set_vector_config(VectorConfig::default()/* use setters */);
6196 /// assert!(x.vector_config().is_some());
6197 /// assert!(x.order().is_none());
6198 /// assert!(x.array_config().is_none());
6199 /// ```
6200 pub fn set_vector_config<
6201 T: std::convert::Into<std::boxed::Box<crate::model::index::index_field::VectorConfig>>,
6202 >(
6203 mut self,
6204 v: T,
6205 ) -> Self {
6206 self.value_mode = std::option::Option::Some(
6207 crate::model::index::index_field::ValueMode::VectorConfig(v.into()),
6208 );
6209 self
6210 }
6211 }
6212
6213 impl wkt::message::Message for IndexField {
6214 fn typename() -> &'static str {
6215 "type.googleapis.com/google.firestore.admin.v1.Index.IndexField"
6216 }
6217 }
6218
6219 /// Defines additional types related to [IndexField].
6220 pub mod index_field {
6221 #[allow(unused_imports)]
6222 use super::*;
6223
6224 /// The index configuration to support vector search operations
6225 #[derive(Clone, Default, PartialEq)]
6226 #[non_exhaustive]
6227 pub struct VectorConfig {
6228 /// Required. The vector dimension this configuration applies to.
6229 ///
6230 /// The resulting index will only include vectors of this dimension, and
6231 /// can be used for vector search with the same dimension.
6232 pub dimension: i32,
6233
6234 /// The type of index used.
6235 pub r#type: std::option::Option<crate::model::index::index_field::vector_config::Type>,
6236
6237 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6238 }
6239
6240 impl VectorConfig {
6241 pub fn new() -> Self {
6242 std::default::Default::default()
6243 }
6244
6245 /// Sets the value of [dimension][crate::model::index::index_field::VectorConfig::dimension].
6246 ///
6247 /// # Example
6248 /// ```ignore,no_run
6249 /// # use google_cloud_firestore_admin_v1::model::index::index_field::VectorConfig;
6250 /// let x = VectorConfig::new().set_dimension(42);
6251 /// ```
6252 pub fn set_dimension<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6253 self.dimension = v.into();
6254 self
6255 }
6256
6257 /// Sets the value of [r#type][crate::model::index::index_field::VectorConfig::type].
6258 ///
6259 /// Note that all the setters affecting `r#type` are mutually
6260 /// exclusive.
6261 ///
6262 /// # Example
6263 /// ```ignore,no_run
6264 /// # use google_cloud_firestore_admin_v1::model::index::index_field::VectorConfig;
6265 /// use google_cloud_firestore_admin_v1::model::index::index_field::vector_config::FlatIndex;
6266 /// let x = VectorConfig::new().set_type(Some(
6267 /// google_cloud_firestore_admin_v1::model::index::index_field::vector_config::Type::Flat(FlatIndex::default().into())));
6268 /// ```
6269 pub fn set_type<
6270 T: std::convert::Into<
6271 std::option::Option<crate::model::index::index_field::vector_config::Type>,
6272 >,
6273 >(
6274 mut self,
6275 v: T,
6276 ) -> Self {
6277 self.r#type = v.into();
6278 self
6279 }
6280
6281 /// The value of [r#type][crate::model::index::index_field::VectorConfig::r#type]
6282 /// if it holds a `Flat`, `None` if the field is not set or
6283 /// holds a different branch.
6284 pub fn flat(
6285 &self,
6286 ) -> std::option::Option<
6287 &std::boxed::Box<crate::model::index::index_field::vector_config::FlatIndex>,
6288 > {
6289 #[allow(unreachable_patterns)]
6290 self.r#type.as_ref().and_then(|v| match v {
6291 crate::model::index::index_field::vector_config::Type::Flat(v) => {
6292 std::option::Option::Some(v)
6293 }
6294 _ => std::option::Option::None,
6295 })
6296 }
6297
6298 /// Sets the value of [r#type][crate::model::index::index_field::VectorConfig::r#type]
6299 /// to hold a `Flat`.
6300 ///
6301 /// Note that all the setters affecting `r#type` are
6302 /// mutually exclusive.
6303 ///
6304 /// # Example
6305 /// ```ignore,no_run
6306 /// # use google_cloud_firestore_admin_v1::model::index::index_field::VectorConfig;
6307 /// use google_cloud_firestore_admin_v1::model::index::index_field::vector_config::FlatIndex;
6308 /// let x = VectorConfig::new().set_flat(FlatIndex::default()/* use setters */);
6309 /// assert!(x.flat().is_some());
6310 /// ```
6311 pub fn set_flat<
6312 T: std::convert::Into<
6313 std::boxed::Box<crate::model::index::index_field::vector_config::FlatIndex>,
6314 >,
6315 >(
6316 mut self,
6317 v: T,
6318 ) -> Self {
6319 self.r#type = std::option::Option::Some(
6320 crate::model::index::index_field::vector_config::Type::Flat(v.into()),
6321 );
6322 self
6323 }
6324 }
6325
6326 impl wkt::message::Message for VectorConfig {
6327 fn typename() -> &'static str {
6328 "type.googleapis.com/google.firestore.admin.v1.Index.IndexField.VectorConfig"
6329 }
6330 }
6331
6332 /// Defines additional types related to [VectorConfig].
6333 pub mod vector_config {
6334 #[allow(unused_imports)]
6335 use super::*;
6336
6337 /// An index that stores vectors in a flat data structure, and supports
6338 /// exhaustive search.
6339 #[derive(Clone, Default, PartialEq)]
6340 #[non_exhaustive]
6341 pub struct FlatIndex {
6342 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6343 }
6344
6345 impl FlatIndex {
6346 pub fn new() -> Self {
6347 std::default::Default::default()
6348 }
6349 }
6350
6351 impl wkt::message::Message for FlatIndex {
6352 fn typename() -> &'static str {
6353 "type.googleapis.com/google.firestore.admin.v1.Index.IndexField.VectorConfig.FlatIndex"
6354 }
6355 }
6356
6357 /// The type of index used.
6358 #[derive(Clone, Debug, PartialEq)]
6359 #[non_exhaustive]
6360 pub enum Type {
6361 /// Indicates the vector index is a flat index.
6362 Flat(std::boxed::Box<crate::model::index::index_field::vector_config::FlatIndex>),
6363 }
6364 }
6365
6366 /// The supported orderings.
6367 ///
6368 /// # Working with unknown values
6369 ///
6370 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6371 /// additional enum variants at any time. Adding new variants is not considered
6372 /// a breaking change. Applications should write their code in anticipation of:
6373 ///
6374 /// - New values appearing in future releases of the client library, **and**
6375 /// - New values received dynamically, without application changes.
6376 ///
6377 /// Please consult the [Working with enums] section in the user guide for some
6378 /// guidelines.
6379 ///
6380 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6381 #[derive(Clone, Debug, PartialEq)]
6382 #[non_exhaustive]
6383 pub enum Order {
6384 /// The ordering is unspecified. Not a valid option.
6385 Unspecified,
6386 /// The field is ordered by ascending field value.
6387 Ascending,
6388 /// The field is ordered by descending field value.
6389 Descending,
6390 /// If set, the enum was initialized with an unknown value.
6391 ///
6392 /// Applications can examine the value using [Order::value] or
6393 /// [Order::name].
6394 UnknownValue(order::UnknownValue),
6395 }
6396
6397 #[doc(hidden)]
6398 pub mod order {
6399 #[allow(unused_imports)]
6400 use super::*;
6401 #[derive(Clone, Debug, PartialEq)]
6402 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6403 }
6404
6405 impl Order {
6406 /// Gets the enum value.
6407 ///
6408 /// Returns `None` if the enum contains an unknown value deserialized from
6409 /// the string representation of enums.
6410 pub fn value(&self) -> std::option::Option<i32> {
6411 match self {
6412 Self::Unspecified => std::option::Option::Some(0),
6413 Self::Ascending => std::option::Option::Some(1),
6414 Self::Descending => std::option::Option::Some(2),
6415 Self::UnknownValue(u) => u.0.value(),
6416 }
6417 }
6418
6419 /// Gets the enum value as a string.
6420 ///
6421 /// Returns `None` if the enum contains an unknown value deserialized from
6422 /// the integer representation of enums.
6423 pub fn name(&self) -> std::option::Option<&str> {
6424 match self {
6425 Self::Unspecified => std::option::Option::Some("ORDER_UNSPECIFIED"),
6426 Self::Ascending => std::option::Option::Some("ASCENDING"),
6427 Self::Descending => std::option::Option::Some("DESCENDING"),
6428 Self::UnknownValue(u) => u.0.name(),
6429 }
6430 }
6431 }
6432
6433 impl std::default::Default for Order {
6434 fn default() -> Self {
6435 use std::convert::From;
6436 Self::from(0)
6437 }
6438 }
6439
6440 impl std::fmt::Display for Order {
6441 fn fmt(
6442 &self,
6443 f: &mut std::fmt::Formatter<'_>,
6444 ) -> std::result::Result<(), std::fmt::Error> {
6445 wkt::internal::display_enum(f, self.name(), self.value())
6446 }
6447 }
6448
6449 impl std::convert::From<i32> for Order {
6450 fn from(value: i32) -> Self {
6451 match value {
6452 0 => Self::Unspecified,
6453 1 => Self::Ascending,
6454 2 => Self::Descending,
6455 _ => Self::UnknownValue(order::UnknownValue(
6456 wkt::internal::UnknownEnumValue::Integer(value),
6457 )),
6458 }
6459 }
6460 }
6461
6462 impl std::convert::From<&str> for Order {
6463 fn from(value: &str) -> Self {
6464 use std::string::ToString;
6465 match value {
6466 "ORDER_UNSPECIFIED" => Self::Unspecified,
6467 "ASCENDING" => Self::Ascending,
6468 "DESCENDING" => Self::Descending,
6469 _ => Self::UnknownValue(order::UnknownValue(
6470 wkt::internal::UnknownEnumValue::String(value.to_string()),
6471 )),
6472 }
6473 }
6474 }
6475
6476 impl serde::ser::Serialize for Order {
6477 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6478 where
6479 S: serde::Serializer,
6480 {
6481 match self {
6482 Self::Unspecified => serializer.serialize_i32(0),
6483 Self::Ascending => serializer.serialize_i32(1),
6484 Self::Descending => serializer.serialize_i32(2),
6485 Self::UnknownValue(u) => u.0.serialize(serializer),
6486 }
6487 }
6488 }
6489
6490 impl<'de> serde::de::Deserialize<'de> for Order {
6491 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6492 where
6493 D: serde::Deserializer<'de>,
6494 {
6495 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Order>::new(
6496 ".google.firestore.admin.v1.Index.IndexField.Order",
6497 ))
6498 }
6499 }
6500
6501 /// The supported array value configurations.
6502 ///
6503 /// # Working with unknown values
6504 ///
6505 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6506 /// additional enum variants at any time. Adding new variants is not considered
6507 /// a breaking change. Applications should write their code in anticipation of:
6508 ///
6509 /// - New values appearing in future releases of the client library, **and**
6510 /// - New values received dynamically, without application changes.
6511 ///
6512 /// Please consult the [Working with enums] section in the user guide for some
6513 /// guidelines.
6514 ///
6515 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6516 #[derive(Clone, Debug, PartialEq)]
6517 #[non_exhaustive]
6518 pub enum ArrayConfig {
6519 /// The index does not support additional array queries.
6520 Unspecified,
6521 /// The index supports array containment queries.
6522 Contains,
6523 /// If set, the enum was initialized with an unknown value.
6524 ///
6525 /// Applications can examine the value using [ArrayConfig::value] or
6526 /// [ArrayConfig::name].
6527 UnknownValue(array_config::UnknownValue),
6528 }
6529
6530 #[doc(hidden)]
6531 pub mod array_config {
6532 #[allow(unused_imports)]
6533 use super::*;
6534 #[derive(Clone, Debug, PartialEq)]
6535 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6536 }
6537
6538 impl ArrayConfig {
6539 /// Gets the enum value.
6540 ///
6541 /// Returns `None` if the enum contains an unknown value deserialized from
6542 /// the string representation of enums.
6543 pub fn value(&self) -> std::option::Option<i32> {
6544 match self {
6545 Self::Unspecified => std::option::Option::Some(0),
6546 Self::Contains => std::option::Option::Some(1),
6547 Self::UnknownValue(u) => u.0.value(),
6548 }
6549 }
6550
6551 /// Gets the enum value as a string.
6552 ///
6553 /// Returns `None` if the enum contains an unknown value deserialized from
6554 /// the integer representation of enums.
6555 pub fn name(&self) -> std::option::Option<&str> {
6556 match self {
6557 Self::Unspecified => std::option::Option::Some("ARRAY_CONFIG_UNSPECIFIED"),
6558 Self::Contains => std::option::Option::Some("CONTAINS"),
6559 Self::UnknownValue(u) => u.0.name(),
6560 }
6561 }
6562 }
6563
6564 impl std::default::Default for ArrayConfig {
6565 fn default() -> Self {
6566 use std::convert::From;
6567 Self::from(0)
6568 }
6569 }
6570
6571 impl std::fmt::Display for ArrayConfig {
6572 fn fmt(
6573 &self,
6574 f: &mut std::fmt::Formatter<'_>,
6575 ) -> std::result::Result<(), std::fmt::Error> {
6576 wkt::internal::display_enum(f, self.name(), self.value())
6577 }
6578 }
6579
6580 impl std::convert::From<i32> for ArrayConfig {
6581 fn from(value: i32) -> Self {
6582 match value {
6583 0 => Self::Unspecified,
6584 1 => Self::Contains,
6585 _ => Self::UnknownValue(array_config::UnknownValue(
6586 wkt::internal::UnknownEnumValue::Integer(value),
6587 )),
6588 }
6589 }
6590 }
6591
6592 impl std::convert::From<&str> for ArrayConfig {
6593 fn from(value: &str) -> Self {
6594 use std::string::ToString;
6595 match value {
6596 "ARRAY_CONFIG_UNSPECIFIED" => Self::Unspecified,
6597 "CONTAINS" => Self::Contains,
6598 _ => Self::UnknownValue(array_config::UnknownValue(
6599 wkt::internal::UnknownEnumValue::String(value.to_string()),
6600 )),
6601 }
6602 }
6603 }
6604
6605 impl serde::ser::Serialize for ArrayConfig {
6606 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6607 where
6608 S: serde::Serializer,
6609 {
6610 match self {
6611 Self::Unspecified => serializer.serialize_i32(0),
6612 Self::Contains => serializer.serialize_i32(1),
6613 Self::UnknownValue(u) => u.0.serialize(serializer),
6614 }
6615 }
6616 }
6617
6618 impl<'de> serde::de::Deserialize<'de> for ArrayConfig {
6619 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6620 where
6621 D: serde::Deserializer<'de>,
6622 {
6623 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ArrayConfig>::new(
6624 ".google.firestore.admin.v1.Index.IndexField.ArrayConfig",
6625 ))
6626 }
6627 }
6628
6629 /// How the field value is indexed.
6630 #[derive(Clone, Debug, PartialEq)]
6631 #[non_exhaustive]
6632 pub enum ValueMode {
6633 /// Indicates that this field supports ordering by the specified order or
6634 /// comparing using =, !=, <, <=, >, >=.
6635 Order(crate::model::index::index_field::Order),
6636 /// Indicates that this field supports operations on `array_value`s.
6637 ArrayConfig(crate::model::index::index_field::ArrayConfig),
6638 /// Indicates that this field supports nearest neighbor and distance
6639 /// operations on vector.
6640 VectorConfig(std::boxed::Box<crate::model::index::index_field::VectorConfig>),
6641 }
6642 }
6643
6644 /// Query Scope defines the scope at which a query is run. This is specified on
6645 /// a StructuredQuery's `from` field.
6646 ///
6647 /// # Working with unknown values
6648 ///
6649 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6650 /// additional enum variants at any time. Adding new variants is not considered
6651 /// a breaking change. Applications should write their code in anticipation of:
6652 ///
6653 /// - New values appearing in future releases of the client library, **and**
6654 /// - New values received dynamically, without application changes.
6655 ///
6656 /// Please consult the [Working with enums] section in the user guide for some
6657 /// guidelines.
6658 ///
6659 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6660 #[derive(Clone, Debug, PartialEq)]
6661 #[non_exhaustive]
6662 pub enum QueryScope {
6663 /// The query scope is unspecified. Not a valid option.
6664 Unspecified,
6665 /// Indexes with a collection query scope specified allow queries
6666 /// against a collection that is the child of a specific document, specified
6667 /// at query time, and that has the collection ID specified by the index.
6668 Collection,
6669 /// Indexes with a collection group query scope specified allow queries
6670 /// against all collections that has the collection ID specified by the
6671 /// index.
6672 CollectionGroup,
6673 /// Include all the collections's ancestor in the index. Only available for
6674 /// Datastore Mode databases.
6675 CollectionRecursive,
6676 /// If set, the enum was initialized with an unknown value.
6677 ///
6678 /// Applications can examine the value using [QueryScope::value] or
6679 /// [QueryScope::name].
6680 UnknownValue(query_scope::UnknownValue),
6681 }
6682
6683 #[doc(hidden)]
6684 pub mod query_scope {
6685 #[allow(unused_imports)]
6686 use super::*;
6687 #[derive(Clone, Debug, PartialEq)]
6688 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6689 }
6690
6691 impl QueryScope {
6692 /// Gets the enum value.
6693 ///
6694 /// Returns `None` if the enum contains an unknown value deserialized from
6695 /// the string representation of enums.
6696 pub fn value(&self) -> std::option::Option<i32> {
6697 match self {
6698 Self::Unspecified => std::option::Option::Some(0),
6699 Self::Collection => std::option::Option::Some(1),
6700 Self::CollectionGroup => std::option::Option::Some(2),
6701 Self::CollectionRecursive => std::option::Option::Some(3),
6702 Self::UnknownValue(u) => u.0.value(),
6703 }
6704 }
6705
6706 /// Gets the enum value as a string.
6707 ///
6708 /// Returns `None` if the enum contains an unknown value deserialized from
6709 /// the integer representation of enums.
6710 pub fn name(&self) -> std::option::Option<&str> {
6711 match self {
6712 Self::Unspecified => std::option::Option::Some("QUERY_SCOPE_UNSPECIFIED"),
6713 Self::Collection => std::option::Option::Some("COLLECTION"),
6714 Self::CollectionGroup => std::option::Option::Some("COLLECTION_GROUP"),
6715 Self::CollectionRecursive => std::option::Option::Some("COLLECTION_RECURSIVE"),
6716 Self::UnknownValue(u) => u.0.name(),
6717 }
6718 }
6719 }
6720
6721 impl std::default::Default for QueryScope {
6722 fn default() -> Self {
6723 use std::convert::From;
6724 Self::from(0)
6725 }
6726 }
6727
6728 impl std::fmt::Display for QueryScope {
6729 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6730 wkt::internal::display_enum(f, self.name(), self.value())
6731 }
6732 }
6733
6734 impl std::convert::From<i32> for QueryScope {
6735 fn from(value: i32) -> Self {
6736 match value {
6737 0 => Self::Unspecified,
6738 1 => Self::Collection,
6739 2 => Self::CollectionGroup,
6740 3 => Self::CollectionRecursive,
6741 _ => Self::UnknownValue(query_scope::UnknownValue(
6742 wkt::internal::UnknownEnumValue::Integer(value),
6743 )),
6744 }
6745 }
6746 }
6747
6748 impl std::convert::From<&str> for QueryScope {
6749 fn from(value: &str) -> Self {
6750 use std::string::ToString;
6751 match value {
6752 "QUERY_SCOPE_UNSPECIFIED" => Self::Unspecified,
6753 "COLLECTION" => Self::Collection,
6754 "COLLECTION_GROUP" => Self::CollectionGroup,
6755 "COLLECTION_RECURSIVE" => Self::CollectionRecursive,
6756 _ => Self::UnknownValue(query_scope::UnknownValue(
6757 wkt::internal::UnknownEnumValue::String(value.to_string()),
6758 )),
6759 }
6760 }
6761 }
6762
6763 impl serde::ser::Serialize for QueryScope {
6764 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6765 where
6766 S: serde::Serializer,
6767 {
6768 match self {
6769 Self::Unspecified => serializer.serialize_i32(0),
6770 Self::Collection => serializer.serialize_i32(1),
6771 Self::CollectionGroup => serializer.serialize_i32(2),
6772 Self::CollectionRecursive => serializer.serialize_i32(3),
6773 Self::UnknownValue(u) => u.0.serialize(serializer),
6774 }
6775 }
6776 }
6777
6778 impl<'de> serde::de::Deserialize<'de> for QueryScope {
6779 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6780 where
6781 D: serde::Deserializer<'de>,
6782 {
6783 deserializer.deserialize_any(wkt::internal::EnumVisitor::<QueryScope>::new(
6784 ".google.firestore.admin.v1.Index.QueryScope",
6785 ))
6786 }
6787 }
6788
6789 /// API Scope defines the APIs (Firestore Native, or Firestore in
6790 /// Datastore Mode) that are supported for queries.
6791 ///
6792 /// # Working with unknown values
6793 ///
6794 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6795 /// additional enum variants at any time. Adding new variants is not considered
6796 /// a breaking change. Applications should write their code in anticipation of:
6797 ///
6798 /// - New values appearing in future releases of the client library, **and**
6799 /// - New values received dynamically, without application changes.
6800 ///
6801 /// Please consult the [Working with enums] section in the user guide for some
6802 /// guidelines.
6803 ///
6804 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6805 #[derive(Clone, Debug, PartialEq)]
6806 #[non_exhaustive]
6807 pub enum ApiScope {
6808 /// The index can only be used by the Firestore Native query API.
6809 /// This is the default.
6810 AnyApi,
6811 /// The index can only be used by the Firestore in Datastore Mode query API.
6812 DatastoreModeApi,
6813 /// The index can only be used by the MONGODB_COMPATIBLE_API.
6814 MongodbCompatibleApi,
6815 /// If set, the enum was initialized with an unknown value.
6816 ///
6817 /// Applications can examine the value using [ApiScope::value] or
6818 /// [ApiScope::name].
6819 UnknownValue(api_scope::UnknownValue),
6820 }
6821
6822 #[doc(hidden)]
6823 pub mod api_scope {
6824 #[allow(unused_imports)]
6825 use super::*;
6826 #[derive(Clone, Debug, PartialEq)]
6827 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6828 }
6829
6830 impl ApiScope {
6831 /// Gets the enum value.
6832 ///
6833 /// Returns `None` if the enum contains an unknown value deserialized from
6834 /// the string representation of enums.
6835 pub fn value(&self) -> std::option::Option<i32> {
6836 match self {
6837 Self::AnyApi => std::option::Option::Some(0),
6838 Self::DatastoreModeApi => std::option::Option::Some(1),
6839 Self::MongodbCompatibleApi => std::option::Option::Some(2),
6840 Self::UnknownValue(u) => u.0.value(),
6841 }
6842 }
6843
6844 /// Gets the enum value as a string.
6845 ///
6846 /// Returns `None` if the enum contains an unknown value deserialized from
6847 /// the integer representation of enums.
6848 pub fn name(&self) -> std::option::Option<&str> {
6849 match self {
6850 Self::AnyApi => std::option::Option::Some("ANY_API"),
6851 Self::DatastoreModeApi => std::option::Option::Some("DATASTORE_MODE_API"),
6852 Self::MongodbCompatibleApi => std::option::Option::Some("MONGODB_COMPATIBLE_API"),
6853 Self::UnknownValue(u) => u.0.name(),
6854 }
6855 }
6856 }
6857
6858 impl std::default::Default for ApiScope {
6859 fn default() -> Self {
6860 use std::convert::From;
6861 Self::from(0)
6862 }
6863 }
6864
6865 impl std::fmt::Display for ApiScope {
6866 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6867 wkt::internal::display_enum(f, self.name(), self.value())
6868 }
6869 }
6870
6871 impl std::convert::From<i32> for ApiScope {
6872 fn from(value: i32) -> Self {
6873 match value {
6874 0 => Self::AnyApi,
6875 1 => Self::DatastoreModeApi,
6876 2 => Self::MongodbCompatibleApi,
6877 _ => Self::UnknownValue(api_scope::UnknownValue(
6878 wkt::internal::UnknownEnumValue::Integer(value),
6879 )),
6880 }
6881 }
6882 }
6883
6884 impl std::convert::From<&str> for ApiScope {
6885 fn from(value: &str) -> Self {
6886 use std::string::ToString;
6887 match value {
6888 "ANY_API" => Self::AnyApi,
6889 "DATASTORE_MODE_API" => Self::DatastoreModeApi,
6890 "MONGODB_COMPATIBLE_API" => Self::MongodbCompatibleApi,
6891 _ => Self::UnknownValue(api_scope::UnknownValue(
6892 wkt::internal::UnknownEnumValue::String(value.to_string()),
6893 )),
6894 }
6895 }
6896 }
6897
6898 impl serde::ser::Serialize for ApiScope {
6899 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6900 where
6901 S: serde::Serializer,
6902 {
6903 match self {
6904 Self::AnyApi => serializer.serialize_i32(0),
6905 Self::DatastoreModeApi => serializer.serialize_i32(1),
6906 Self::MongodbCompatibleApi => serializer.serialize_i32(2),
6907 Self::UnknownValue(u) => u.0.serialize(serializer),
6908 }
6909 }
6910 }
6911
6912 impl<'de> serde::de::Deserialize<'de> for ApiScope {
6913 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6914 where
6915 D: serde::Deserializer<'de>,
6916 {
6917 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ApiScope>::new(
6918 ".google.firestore.admin.v1.Index.ApiScope",
6919 ))
6920 }
6921 }
6922
6923 /// The state of an index. During index creation, an index will be in the
6924 /// `CREATING` state. If the index is created successfully, it will transition
6925 /// to the `READY` state. If the index creation encounters a problem, the index
6926 /// will transition to the `NEEDS_REPAIR` state.
6927 ///
6928 /// # Working with unknown values
6929 ///
6930 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6931 /// additional enum variants at any time. Adding new variants is not considered
6932 /// a breaking change. Applications should write their code in anticipation of:
6933 ///
6934 /// - New values appearing in future releases of the client library, **and**
6935 /// - New values received dynamically, without application changes.
6936 ///
6937 /// Please consult the [Working with enums] section in the user guide for some
6938 /// guidelines.
6939 ///
6940 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6941 #[derive(Clone, Debug, PartialEq)]
6942 #[non_exhaustive]
6943 pub enum State {
6944 /// The state is unspecified.
6945 Unspecified,
6946 /// The index is being created.
6947 /// There is an active long-running operation for the index.
6948 /// The index is updated when writing a document.
6949 /// Some index data may exist.
6950 Creating,
6951 /// The index is ready to be used.
6952 /// The index is updated when writing a document.
6953 /// The index is fully populated from all stored documents it applies to.
6954 Ready,
6955 /// The index was being created, but something went wrong.
6956 /// There is no active long-running operation for the index,
6957 /// and the most recently finished long-running operation failed.
6958 /// The index is not updated when writing a document.
6959 /// Some index data may exist.
6960 /// Use the google.longrunning.Operations API to determine why the operation
6961 /// that last attempted to create this index failed, then re-create the
6962 /// index.
6963 NeedsRepair,
6964 /// If set, the enum was initialized with an unknown value.
6965 ///
6966 /// Applications can examine the value using [State::value] or
6967 /// [State::name].
6968 UnknownValue(state::UnknownValue),
6969 }
6970
6971 #[doc(hidden)]
6972 pub mod state {
6973 #[allow(unused_imports)]
6974 use super::*;
6975 #[derive(Clone, Debug, PartialEq)]
6976 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6977 }
6978
6979 impl State {
6980 /// Gets the enum value.
6981 ///
6982 /// Returns `None` if the enum contains an unknown value deserialized from
6983 /// the string representation of enums.
6984 pub fn value(&self) -> std::option::Option<i32> {
6985 match self {
6986 Self::Unspecified => std::option::Option::Some(0),
6987 Self::Creating => std::option::Option::Some(1),
6988 Self::Ready => std::option::Option::Some(2),
6989 Self::NeedsRepair => std::option::Option::Some(3),
6990 Self::UnknownValue(u) => u.0.value(),
6991 }
6992 }
6993
6994 /// Gets the enum value as a string.
6995 ///
6996 /// Returns `None` if the enum contains an unknown value deserialized from
6997 /// the integer representation of enums.
6998 pub fn name(&self) -> std::option::Option<&str> {
6999 match self {
7000 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7001 Self::Creating => std::option::Option::Some("CREATING"),
7002 Self::Ready => std::option::Option::Some("READY"),
7003 Self::NeedsRepair => std::option::Option::Some("NEEDS_REPAIR"),
7004 Self::UnknownValue(u) => u.0.name(),
7005 }
7006 }
7007 }
7008
7009 impl std::default::Default for State {
7010 fn default() -> Self {
7011 use std::convert::From;
7012 Self::from(0)
7013 }
7014 }
7015
7016 impl std::fmt::Display for State {
7017 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7018 wkt::internal::display_enum(f, self.name(), self.value())
7019 }
7020 }
7021
7022 impl std::convert::From<i32> for State {
7023 fn from(value: i32) -> Self {
7024 match value {
7025 0 => Self::Unspecified,
7026 1 => Self::Creating,
7027 2 => Self::Ready,
7028 3 => Self::NeedsRepair,
7029 _ => Self::UnknownValue(state::UnknownValue(
7030 wkt::internal::UnknownEnumValue::Integer(value),
7031 )),
7032 }
7033 }
7034 }
7035
7036 impl std::convert::From<&str> for State {
7037 fn from(value: &str) -> Self {
7038 use std::string::ToString;
7039 match value {
7040 "STATE_UNSPECIFIED" => Self::Unspecified,
7041 "CREATING" => Self::Creating,
7042 "READY" => Self::Ready,
7043 "NEEDS_REPAIR" => Self::NeedsRepair,
7044 _ => Self::UnknownValue(state::UnknownValue(
7045 wkt::internal::UnknownEnumValue::String(value.to_string()),
7046 )),
7047 }
7048 }
7049 }
7050
7051 impl serde::ser::Serialize for State {
7052 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7053 where
7054 S: serde::Serializer,
7055 {
7056 match self {
7057 Self::Unspecified => serializer.serialize_i32(0),
7058 Self::Creating => serializer.serialize_i32(1),
7059 Self::Ready => serializer.serialize_i32(2),
7060 Self::NeedsRepair => serializer.serialize_i32(3),
7061 Self::UnknownValue(u) => u.0.serialize(serializer),
7062 }
7063 }
7064 }
7065
7066 impl<'de> serde::de::Deserialize<'de> for State {
7067 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7068 where
7069 D: serde::Deserializer<'de>,
7070 {
7071 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7072 ".google.firestore.admin.v1.Index.State",
7073 ))
7074 }
7075 }
7076
7077 /// The density configuration for the index.
7078 ///
7079 /// # Working with unknown values
7080 ///
7081 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7082 /// additional enum variants at any time. Adding new variants is not considered
7083 /// a breaking change. Applications should write their code in anticipation of:
7084 ///
7085 /// - New values appearing in future releases of the client library, **and**
7086 /// - New values received dynamically, without application changes.
7087 ///
7088 /// Please consult the [Working with enums] section in the user guide for some
7089 /// guidelines.
7090 ///
7091 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7092 #[derive(Clone, Debug, PartialEq)]
7093 #[non_exhaustive]
7094 pub enum Density {
7095 /// Unspecified. It will use database default setting. This value is input
7096 /// only.
7097 Unspecified,
7098 /// An index entry will only exist if ALL fields are present in the document.
7099 ///
7100 /// This is both the default and only allowed value for Standard Edition
7101 /// databases (for both Cloud Firestore `ANY_API` and Cloud Datastore
7102 /// `DATASTORE_MODE_API`).
7103 ///
7104 /// Take for example the following document:
7105 ///
7106 /// ```norust
7107 /// {
7108 /// "__name__": "...",
7109 /// "a": 1,
7110 /// "b": 2,
7111 /// "c": 3
7112 /// }
7113 /// ```
7114 ///
7115 /// an index on `(a ASC, b ASC, c ASC, __name__ ASC)` will generate an index
7116 /// entry for this document since `a`, 'b', `c`, and `__name__` are all
7117 /// present but an index of `(a ASC, d ASC, __name__ ASC)` will not generate
7118 /// an index entry for this document since `d` is missing.
7119 ///
7120 /// This means that such indexes can only be used to serve a query when the
7121 /// query has either implicit or explicit requirements that all fields from
7122 /// the index are present.
7123 SparseAll,
7124 /// An index entry will exist if ANY field are present in the document.
7125 ///
7126 /// This is used as the definition of a sparse index for Enterprise Edition
7127 /// databases.
7128 ///
7129 /// Take for example the following document:
7130 ///
7131 /// ```norust
7132 /// {
7133 /// "__name__": "...",
7134 /// "a": 1,
7135 /// "b": 2,
7136 /// "c": 3
7137 /// }
7138 /// ```
7139 ///
7140 /// an index on `(a ASC, d ASC)` will generate an index entry for this
7141 /// document since `a` is present, and will fill in an `unset` value for `d`.
7142 /// An index on `(d ASC, e ASC)` will not generate any index entry as neither
7143 /// `d` nor `e` are present.
7144 ///
7145 /// An index that contains `__name__` will generate an index entry for all
7146 /// documents since Firestore guarantees that all documents have a `__name__`
7147 /// field.
7148 SparseAny,
7149 /// An index entry will exist regardless of if the fields are present or not.
7150 ///
7151 /// This is the default density for an Enterprise Edition database.
7152 ///
7153 /// The index will store `unset` values for fields that are not present in
7154 /// the document.
7155 Dense,
7156 /// If set, the enum was initialized with an unknown value.
7157 ///
7158 /// Applications can examine the value using [Density::value] or
7159 /// [Density::name].
7160 UnknownValue(density::UnknownValue),
7161 }
7162
7163 #[doc(hidden)]
7164 pub mod density {
7165 #[allow(unused_imports)]
7166 use super::*;
7167 #[derive(Clone, Debug, PartialEq)]
7168 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7169 }
7170
7171 impl Density {
7172 /// Gets the enum value.
7173 ///
7174 /// Returns `None` if the enum contains an unknown value deserialized from
7175 /// the string representation of enums.
7176 pub fn value(&self) -> std::option::Option<i32> {
7177 match self {
7178 Self::Unspecified => std::option::Option::Some(0),
7179 Self::SparseAll => std::option::Option::Some(1),
7180 Self::SparseAny => std::option::Option::Some(2),
7181 Self::Dense => std::option::Option::Some(3),
7182 Self::UnknownValue(u) => u.0.value(),
7183 }
7184 }
7185
7186 /// Gets the enum value as a string.
7187 ///
7188 /// Returns `None` if the enum contains an unknown value deserialized from
7189 /// the integer representation of enums.
7190 pub fn name(&self) -> std::option::Option<&str> {
7191 match self {
7192 Self::Unspecified => std::option::Option::Some("DENSITY_UNSPECIFIED"),
7193 Self::SparseAll => std::option::Option::Some("SPARSE_ALL"),
7194 Self::SparseAny => std::option::Option::Some("SPARSE_ANY"),
7195 Self::Dense => std::option::Option::Some("DENSE"),
7196 Self::UnknownValue(u) => u.0.name(),
7197 }
7198 }
7199 }
7200
7201 impl std::default::Default for Density {
7202 fn default() -> Self {
7203 use std::convert::From;
7204 Self::from(0)
7205 }
7206 }
7207
7208 impl std::fmt::Display for Density {
7209 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7210 wkt::internal::display_enum(f, self.name(), self.value())
7211 }
7212 }
7213
7214 impl std::convert::From<i32> for Density {
7215 fn from(value: i32) -> Self {
7216 match value {
7217 0 => Self::Unspecified,
7218 1 => Self::SparseAll,
7219 2 => Self::SparseAny,
7220 3 => Self::Dense,
7221 _ => Self::UnknownValue(density::UnknownValue(
7222 wkt::internal::UnknownEnumValue::Integer(value),
7223 )),
7224 }
7225 }
7226 }
7227
7228 impl std::convert::From<&str> for Density {
7229 fn from(value: &str) -> Self {
7230 use std::string::ToString;
7231 match value {
7232 "DENSITY_UNSPECIFIED" => Self::Unspecified,
7233 "SPARSE_ALL" => Self::SparseAll,
7234 "SPARSE_ANY" => Self::SparseAny,
7235 "DENSE" => Self::Dense,
7236 _ => Self::UnknownValue(density::UnknownValue(
7237 wkt::internal::UnknownEnumValue::String(value.to_string()),
7238 )),
7239 }
7240 }
7241 }
7242
7243 impl serde::ser::Serialize for Density {
7244 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7245 where
7246 S: serde::Serializer,
7247 {
7248 match self {
7249 Self::Unspecified => serializer.serialize_i32(0),
7250 Self::SparseAll => serializer.serialize_i32(1),
7251 Self::SparseAny => serializer.serialize_i32(2),
7252 Self::Dense => serializer.serialize_i32(3),
7253 Self::UnknownValue(u) => u.0.serialize(serializer),
7254 }
7255 }
7256 }
7257
7258 impl<'de> serde::de::Deserialize<'de> for Density {
7259 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7260 where
7261 D: serde::Deserializer<'de>,
7262 {
7263 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Density>::new(
7264 ".google.firestore.admin.v1.Index.Density",
7265 ))
7266 }
7267 }
7268}
7269
7270/// The metadata message for
7271/// [google.cloud.location.Location.metadata][google.cloud.location.Location.metadata].
7272///
7273/// [google.cloud.location.Location.metadata]: google_cloud_location::model::Location::metadata
7274#[derive(Clone, Default, PartialEq)]
7275#[non_exhaustive]
7276pub struct LocationMetadata {
7277 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7278}
7279
7280impl LocationMetadata {
7281 pub fn new() -> Self {
7282 std::default::Default::default()
7283 }
7284}
7285
7286impl wkt::message::Message for LocationMetadata {
7287 fn typename() -> &'static str {
7288 "type.googleapis.com/google.firestore.admin.v1.LocationMetadata"
7289 }
7290}
7291
7292/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
7293/// results from
7294/// [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
7295///
7296/// [google.firestore.admin.v1.FirestoreAdmin.CreateIndex]: crate::client::FirestoreAdmin::create_index
7297/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
7298#[derive(Clone, Default, PartialEq)]
7299#[non_exhaustive]
7300pub struct IndexOperationMetadata {
7301 /// The time this operation started.
7302 pub start_time: std::option::Option<wkt::Timestamp>,
7303
7304 /// The time this operation completed. Will be unset if operation still in
7305 /// progress.
7306 pub end_time: std::option::Option<wkt::Timestamp>,
7307
7308 /// The index resource that this operation is acting on. For example:
7309 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
7310 pub index: std::string::String,
7311
7312 /// The state of the operation.
7313 pub state: crate::model::OperationState,
7314
7315 /// The progress, in documents, of this operation.
7316 pub progress_documents: std::option::Option<crate::model::Progress>,
7317
7318 /// The progress, in bytes, of this operation.
7319 pub progress_bytes: std::option::Option<crate::model::Progress>,
7320
7321 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7322}
7323
7324impl IndexOperationMetadata {
7325 pub fn new() -> Self {
7326 std::default::Default::default()
7327 }
7328
7329 /// Sets the value of [start_time][crate::model::IndexOperationMetadata::start_time].
7330 ///
7331 /// # Example
7332 /// ```ignore,no_run
7333 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7334 /// use wkt::Timestamp;
7335 /// let x = IndexOperationMetadata::new().set_start_time(Timestamp::default()/* use setters */);
7336 /// ```
7337 pub fn set_start_time<T>(mut self, v: T) -> Self
7338 where
7339 T: std::convert::Into<wkt::Timestamp>,
7340 {
7341 self.start_time = std::option::Option::Some(v.into());
7342 self
7343 }
7344
7345 /// Sets or clears the value of [start_time][crate::model::IndexOperationMetadata::start_time].
7346 ///
7347 /// # Example
7348 /// ```ignore,no_run
7349 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7350 /// use wkt::Timestamp;
7351 /// let x = IndexOperationMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
7352 /// let x = IndexOperationMetadata::new().set_or_clear_start_time(None::<Timestamp>);
7353 /// ```
7354 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
7355 where
7356 T: std::convert::Into<wkt::Timestamp>,
7357 {
7358 self.start_time = v.map(|x| x.into());
7359 self
7360 }
7361
7362 /// Sets the value of [end_time][crate::model::IndexOperationMetadata::end_time].
7363 ///
7364 /// # Example
7365 /// ```ignore,no_run
7366 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7367 /// use wkt::Timestamp;
7368 /// let x = IndexOperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
7369 /// ```
7370 pub fn set_end_time<T>(mut self, v: T) -> Self
7371 where
7372 T: std::convert::Into<wkt::Timestamp>,
7373 {
7374 self.end_time = std::option::Option::Some(v.into());
7375 self
7376 }
7377
7378 /// Sets or clears the value of [end_time][crate::model::IndexOperationMetadata::end_time].
7379 ///
7380 /// # Example
7381 /// ```ignore,no_run
7382 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7383 /// use wkt::Timestamp;
7384 /// let x = IndexOperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
7385 /// let x = IndexOperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
7386 /// ```
7387 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7388 where
7389 T: std::convert::Into<wkt::Timestamp>,
7390 {
7391 self.end_time = v.map(|x| x.into());
7392 self
7393 }
7394
7395 /// Sets the value of [index][crate::model::IndexOperationMetadata::index].
7396 ///
7397 /// # Example
7398 /// ```ignore,no_run
7399 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7400 /// let x = IndexOperationMetadata::new().set_index("example");
7401 /// ```
7402 pub fn set_index<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7403 self.index = v.into();
7404 self
7405 }
7406
7407 /// Sets the value of [state][crate::model::IndexOperationMetadata::state].
7408 ///
7409 /// # Example
7410 /// ```ignore,no_run
7411 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7412 /// use google_cloud_firestore_admin_v1::model::OperationState;
7413 /// let x0 = IndexOperationMetadata::new().set_state(OperationState::Initializing);
7414 /// let x1 = IndexOperationMetadata::new().set_state(OperationState::Processing);
7415 /// let x2 = IndexOperationMetadata::new().set_state(OperationState::Cancelling);
7416 /// ```
7417 pub fn set_state<T: std::convert::Into<crate::model::OperationState>>(mut self, v: T) -> Self {
7418 self.state = v.into();
7419 self
7420 }
7421
7422 /// Sets the value of [progress_documents][crate::model::IndexOperationMetadata::progress_documents].
7423 ///
7424 /// # Example
7425 /// ```ignore,no_run
7426 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7427 /// use google_cloud_firestore_admin_v1::model::Progress;
7428 /// let x = IndexOperationMetadata::new().set_progress_documents(Progress::default()/* use setters */);
7429 /// ```
7430 pub fn set_progress_documents<T>(mut self, v: T) -> Self
7431 where
7432 T: std::convert::Into<crate::model::Progress>,
7433 {
7434 self.progress_documents = std::option::Option::Some(v.into());
7435 self
7436 }
7437
7438 /// Sets or clears the value of [progress_documents][crate::model::IndexOperationMetadata::progress_documents].
7439 ///
7440 /// # Example
7441 /// ```ignore,no_run
7442 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7443 /// use google_cloud_firestore_admin_v1::model::Progress;
7444 /// let x = IndexOperationMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
7445 /// let x = IndexOperationMetadata::new().set_or_clear_progress_documents(None::<Progress>);
7446 /// ```
7447 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
7448 where
7449 T: std::convert::Into<crate::model::Progress>,
7450 {
7451 self.progress_documents = v.map(|x| x.into());
7452 self
7453 }
7454
7455 /// Sets the value of [progress_bytes][crate::model::IndexOperationMetadata::progress_bytes].
7456 ///
7457 /// # Example
7458 /// ```ignore,no_run
7459 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7460 /// use google_cloud_firestore_admin_v1::model::Progress;
7461 /// let x = IndexOperationMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
7462 /// ```
7463 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
7464 where
7465 T: std::convert::Into<crate::model::Progress>,
7466 {
7467 self.progress_bytes = std::option::Option::Some(v.into());
7468 self
7469 }
7470
7471 /// Sets or clears the value of [progress_bytes][crate::model::IndexOperationMetadata::progress_bytes].
7472 ///
7473 /// # Example
7474 /// ```ignore,no_run
7475 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7476 /// use google_cloud_firestore_admin_v1::model::Progress;
7477 /// let x = IndexOperationMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
7478 /// let x = IndexOperationMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
7479 /// ```
7480 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
7481 where
7482 T: std::convert::Into<crate::model::Progress>,
7483 {
7484 self.progress_bytes = v.map(|x| x.into());
7485 self
7486 }
7487}
7488
7489impl wkt::message::Message for IndexOperationMetadata {
7490 fn typename() -> &'static str {
7491 "type.googleapis.com/google.firestore.admin.v1.IndexOperationMetadata"
7492 }
7493}
7494
7495/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
7496/// results from
7497/// [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField].
7498///
7499/// [google.firestore.admin.v1.FirestoreAdmin.UpdateField]: crate::client::FirestoreAdmin::update_field
7500/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
7501#[derive(Clone, Default, PartialEq)]
7502#[non_exhaustive]
7503pub struct FieldOperationMetadata {
7504 /// The time this operation started.
7505 pub start_time: std::option::Option<wkt::Timestamp>,
7506
7507 /// The time this operation completed. Will be unset if operation still in
7508 /// progress.
7509 pub end_time: std::option::Option<wkt::Timestamp>,
7510
7511 /// The field resource that this operation is acting on. For example:
7512 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
7513 pub field: std::string::String,
7514
7515 /// A list of
7516 /// [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
7517 /// which describe the intent of this operation.
7518 ///
7519 /// [google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta]: crate::model::field_operation_metadata::IndexConfigDelta
7520 pub index_config_deltas:
7521 std::vec::Vec<crate::model::field_operation_metadata::IndexConfigDelta>,
7522
7523 /// The state of the operation.
7524 pub state: crate::model::OperationState,
7525
7526 /// The progress, in documents, of this operation.
7527 pub progress_documents: std::option::Option<crate::model::Progress>,
7528
7529 /// The progress, in bytes, of this operation.
7530 pub progress_bytes: std::option::Option<crate::model::Progress>,
7531
7532 /// Describes the deltas of TTL configuration.
7533 pub ttl_config_delta:
7534 std::option::Option<crate::model::field_operation_metadata::TtlConfigDelta>,
7535
7536 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7537}
7538
7539impl FieldOperationMetadata {
7540 pub fn new() -> Self {
7541 std::default::Default::default()
7542 }
7543
7544 /// Sets the value of [start_time][crate::model::FieldOperationMetadata::start_time].
7545 ///
7546 /// # Example
7547 /// ```ignore,no_run
7548 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7549 /// use wkt::Timestamp;
7550 /// let x = FieldOperationMetadata::new().set_start_time(Timestamp::default()/* use setters */);
7551 /// ```
7552 pub fn set_start_time<T>(mut self, v: T) -> Self
7553 where
7554 T: std::convert::Into<wkt::Timestamp>,
7555 {
7556 self.start_time = std::option::Option::Some(v.into());
7557 self
7558 }
7559
7560 /// Sets or clears the value of [start_time][crate::model::FieldOperationMetadata::start_time].
7561 ///
7562 /// # Example
7563 /// ```ignore,no_run
7564 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7565 /// use wkt::Timestamp;
7566 /// let x = FieldOperationMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
7567 /// let x = FieldOperationMetadata::new().set_or_clear_start_time(None::<Timestamp>);
7568 /// ```
7569 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
7570 where
7571 T: std::convert::Into<wkt::Timestamp>,
7572 {
7573 self.start_time = v.map(|x| x.into());
7574 self
7575 }
7576
7577 /// Sets the value of [end_time][crate::model::FieldOperationMetadata::end_time].
7578 ///
7579 /// # Example
7580 /// ```ignore,no_run
7581 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7582 /// use wkt::Timestamp;
7583 /// let x = FieldOperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
7584 /// ```
7585 pub fn set_end_time<T>(mut self, v: T) -> Self
7586 where
7587 T: std::convert::Into<wkt::Timestamp>,
7588 {
7589 self.end_time = std::option::Option::Some(v.into());
7590 self
7591 }
7592
7593 /// Sets or clears the value of [end_time][crate::model::FieldOperationMetadata::end_time].
7594 ///
7595 /// # Example
7596 /// ```ignore,no_run
7597 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7598 /// use wkt::Timestamp;
7599 /// let x = FieldOperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
7600 /// let x = FieldOperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
7601 /// ```
7602 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7603 where
7604 T: std::convert::Into<wkt::Timestamp>,
7605 {
7606 self.end_time = v.map(|x| x.into());
7607 self
7608 }
7609
7610 /// Sets the value of [field][crate::model::FieldOperationMetadata::field].
7611 ///
7612 /// # Example
7613 /// ```ignore,no_run
7614 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7615 /// let x = FieldOperationMetadata::new().set_field("example");
7616 /// ```
7617 pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7618 self.field = v.into();
7619 self
7620 }
7621
7622 /// Sets the value of [index_config_deltas][crate::model::FieldOperationMetadata::index_config_deltas].
7623 ///
7624 /// # Example
7625 /// ```ignore,no_run
7626 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7627 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::IndexConfigDelta;
7628 /// let x = FieldOperationMetadata::new()
7629 /// .set_index_config_deltas([
7630 /// IndexConfigDelta::default()/* use setters */,
7631 /// IndexConfigDelta::default()/* use (different) setters */,
7632 /// ]);
7633 /// ```
7634 pub fn set_index_config_deltas<T, V>(mut self, v: T) -> Self
7635 where
7636 T: std::iter::IntoIterator<Item = V>,
7637 V: std::convert::Into<crate::model::field_operation_metadata::IndexConfigDelta>,
7638 {
7639 use std::iter::Iterator;
7640 self.index_config_deltas = v.into_iter().map(|i| i.into()).collect();
7641 self
7642 }
7643
7644 /// Sets the value of [state][crate::model::FieldOperationMetadata::state].
7645 ///
7646 /// # Example
7647 /// ```ignore,no_run
7648 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7649 /// use google_cloud_firestore_admin_v1::model::OperationState;
7650 /// let x0 = FieldOperationMetadata::new().set_state(OperationState::Initializing);
7651 /// let x1 = FieldOperationMetadata::new().set_state(OperationState::Processing);
7652 /// let x2 = FieldOperationMetadata::new().set_state(OperationState::Cancelling);
7653 /// ```
7654 pub fn set_state<T: std::convert::Into<crate::model::OperationState>>(mut self, v: T) -> Self {
7655 self.state = v.into();
7656 self
7657 }
7658
7659 /// Sets the value of [progress_documents][crate::model::FieldOperationMetadata::progress_documents].
7660 ///
7661 /// # Example
7662 /// ```ignore,no_run
7663 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7664 /// use google_cloud_firestore_admin_v1::model::Progress;
7665 /// let x = FieldOperationMetadata::new().set_progress_documents(Progress::default()/* use setters */);
7666 /// ```
7667 pub fn set_progress_documents<T>(mut self, v: T) -> Self
7668 where
7669 T: std::convert::Into<crate::model::Progress>,
7670 {
7671 self.progress_documents = std::option::Option::Some(v.into());
7672 self
7673 }
7674
7675 /// Sets or clears the value of [progress_documents][crate::model::FieldOperationMetadata::progress_documents].
7676 ///
7677 /// # Example
7678 /// ```ignore,no_run
7679 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7680 /// use google_cloud_firestore_admin_v1::model::Progress;
7681 /// let x = FieldOperationMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
7682 /// let x = FieldOperationMetadata::new().set_or_clear_progress_documents(None::<Progress>);
7683 /// ```
7684 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
7685 where
7686 T: std::convert::Into<crate::model::Progress>,
7687 {
7688 self.progress_documents = v.map(|x| x.into());
7689 self
7690 }
7691
7692 /// Sets the value of [progress_bytes][crate::model::FieldOperationMetadata::progress_bytes].
7693 ///
7694 /// # Example
7695 /// ```ignore,no_run
7696 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7697 /// use google_cloud_firestore_admin_v1::model::Progress;
7698 /// let x = FieldOperationMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
7699 /// ```
7700 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
7701 where
7702 T: std::convert::Into<crate::model::Progress>,
7703 {
7704 self.progress_bytes = std::option::Option::Some(v.into());
7705 self
7706 }
7707
7708 /// Sets or clears the value of [progress_bytes][crate::model::FieldOperationMetadata::progress_bytes].
7709 ///
7710 /// # Example
7711 /// ```ignore,no_run
7712 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7713 /// use google_cloud_firestore_admin_v1::model::Progress;
7714 /// let x = FieldOperationMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
7715 /// let x = FieldOperationMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
7716 /// ```
7717 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
7718 where
7719 T: std::convert::Into<crate::model::Progress>,
7720 {
7721 self.progress_bytes = v.map(|x| x.into());
7722 self
7723 }
7724
7725 /// Sets the value of [ttl_config_delta][crate::model::FieldOperationMetadata::ttl_config_delta].
7726 ///
7727 /// # Example
7728 /// ```ignore,no_run
7729 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7730 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::TtlConfigDelta;
7731 /// let x = FieldOperationMetadata::new().set_ttl_config_delta(TtlConfigDelta::default()/* use setters */);
7732 /// ```
7733 pub fn set_ttl_config_delta<T>(mut self, v: T) -> Self
7734 where
7735 T: std::convert::Into<crate::model::field_operation_metadata::TtlConfigDelta>,
7736 {
7737 self.ttl_config_delta = std::option::Option::Some(v.into());
7738 self
7739 }
7740
7741 /// Sets or clears the value of [ttl_config_delta][crate::model::FieldOperationMetadata::ttl_config_delta].
7742 ///
7743 /// # Example
7744 /// ```ignore,no_run
7745 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7746 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::TtlConfigDelta;
7747 /// let x = FieldOperationMetadata::new().set_or_clear_ttl_config_delta(Some(TtlConfigDelta::default()/* use setters */));
7748 /// let x = FieldOperationMetadata::new().set_or_clear_ttl_config_delta(None::<TtlConfigDelta>);
7749 /// ```
7750 pub fn set_or_clear_ttl_config_delta<T>(mut self, v: std::option::Option<T>) -> Self
7751 where
7752 T: std::convert::Into<crate::model::field_operation_metadata::TtlConfigDelta>,
7753 {
7754 self.ttl_config_delta = v.map(|x| x.into());
7755 self
7756 }
7757}
7758
7759impl wkt::message::Message for FieldOperationMetadata {
7760 fn typename() -> &'static str {
7761 "type.googleapis.com/google.firestore.admin.v1.FieldOperationMetadata"
7762 }
7763}
7764
7765/// Defines additional types related to [FieldOperationMetadata].
7766pub mod field_operation_metadata {
7767 #[allow(unused_imports)]
7768 use super::*;
7769
7770 /// Information about an index configuration change.
7771 #[derive(Clone, Default, PartialEq)]
7772 #[non_exhaustive]
7773 pub struct IndexConfigDelta {
7774 /// Specifies how the index is changing.
7775 pub change_type: crate::model::field_operation_metadata::index_config_delta::ChangeType,
7776
7777 /// The index being changed.
7778 pub index: std::option::Option<crate::model::Index>,
7779
7780 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7781 }
7782
7783 impl IndexConfigDelta {
7784 pub fn new() -> Self {
7785 std::default::Default::default()
7786 }
7787
7788 /// Sets the value of [change_type][crate::model::field_operation_metadata::IndexConfigDelta::change_type].
7789 ///
7790 /// # Example
7791 /// ```ignore,no_run
7792 /// # use google_cloud_firestore_admin_v1::model::field_operation_metadata::IndexConfigDelta;
7793 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::index_config_delta::ChangeType;
7794 /// let x0 = IndexConfigDelta::new().set_change_type(ChangeType::Add);
7795 /// let x1 = IndexConfigDelta::new().set_change_type(ChangeType::Remove);
7796 /// ```
7797 pub fn set_change_type<
7798 T: std::convert::Into<
7799 crate::model::field_operation_metadata::index_config_delta::ChangeType,
7800 >,
7801 >(
7802 mut self,
7803 v: T,
7804 ) -> Self {
7805 self.change_type = v.into();
7806 self
7807 }
7808
7809 /// Sets the value of [index][crate::model::field_operation_metadata::IndexConfigDelta::index].
7810 ///
7811 /// # Example
7812 /// ```ignore,no_run
7813 /// # use google_cloud_firestore_admin_v1::model::field_operation_metadata::IndexConfigDelta;
7814 /// use google_cloud_firestore_admin_v1::model::Index;
7815 /// let x = IndexConfigDelta::new().set_index(Index::default()/* use setters */);
7816 /// ```
7817 pub fn set_index<T>(mut self, v: T) -> Self
7818 where
7819 T: std::convert::Into<crate::model::Index>,
7820 {
7821 self.index = std::option::Option::Some(v.into());
7822 self
7823 }
7824
7825 /// Sets or clears the value of [index][crate::model::field_operation_metadata::IndexConfigDelta::index].
7826 ///
7827 /// # Example
7828 /// ```ignore,no_run
7829 /// # use google_cloud_firestore_admin_v1::model::field_operation_metadata::IndexConfigDelta;
7830 /// use google_cloud_firestore_admin_v1::model::Index;
7831 /// let x = IndexConfigDelta::new().set_or_clear_index(Some(Index::default()/* use setters */));
7832 /// let x = IndexConfigDelta::new().set_or_clear_index(None::<Index>);
7833 /// ```
7834 pub fn set_or_clear_index<T>(mut self, v: std::option::Option<T>) -> Self
7835 where
7836 T: std::convert::Into<crate::model::Index>,
7837 {
7838 self.index = v.map(|x| x.into());
7839 self
7840 }
7841 }
7842
7843 impl wkt::message::Message for IndexConfigDelta {
7844 fn typename() -> &'static str {
7845 "type.googleapis.com/google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta"
7846 }
7847 }
7848
7849 /// Defines additional types related to [IndexConfigDelta].
7850 pub mod index_config_delta {
7851 #[allow(unused_imports)]
7852 use super::*;
7853
7854 /// Specifies how the index is changing.
7855 ///
7856 /// # Working with unknown values
7857 ///
7858 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7859 /// additional enum variants at any time. Adding new variants is not considered
7860 /// a breaking change. Applications should write their code in anticipation of:
7861 ///
7862 /// - New values appearing in future releases of the client library, **and**
7863 /// - New values received dynamically, without application changes.
7864 ///
7865 /// Please consult the [Working with enums] section in the user guide for some
7866 /// guidelines.
7867 ///
7868 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7869 #[derive(Clone, Debug, PartialEq)]
7870 #[non_exhaustive]
7871 pub enum ChangeType {
7872 /// The type of change is not specified or known.
7873 Unspecified,
7874 /// The single field index is being added.
7875 Add,
7876 /// The single field index is being removed.
7877 Remove,
7878 /// If set, the enum was initialized with an unknown value.
7879 ///
7880 /// Applications can examine the value using [ChangeType::value] or
7881 /// [ChangeType::name].
7882 UnknownValue(change_type::UnknownValue),
7883 }
7884
7885 #[doc(hidden)]
7886 pub mod change_type {
7887 #[allow(unused_imports)]
7888 use super::*;
7889 #[derive(Clone, Debug, PartialEq)]
7890 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7891 }
7892
7893 impl ChangeType {
7894 /// Gets the enum value.
7895 ///
7896 /// Returns `None` if the enum contains an unknown value deserialized from
7897 /// the string representation of enums.
7898 pub fn value(&self) -> std::option::Option<i32> {
7899 match self {
7900 Self::Unspecified => std::option::Option::Some(0),
7901 Self::Add => std::option::Option::Some(1),
7902 Self::Remove => std::option::Option::Some(2),
7903 Self::UnknownValue(u) => u.0.value(),
7904 }
7905 }
7906
7907 /// Gets the enum value as a string.
7908 ///
7909 /// Returns `None` if the enum contains an unknown value deserialized from
7910 /// the integer representation of enums.
7911 pub fn name(&self) -> std::option::Option<&str> {
7912 match self {
7913 Self::Unspecified => std::option::Option::Some("CHANGE_TYPE_UNSPECIFIED"),
7914 Self::Add => std::option::Option::Some("ADD"),
7915 Self::Remove => std::option::Option::Some("REMOVE"),
7916 Self::UnknownValue(u) => u.0.name(),
7917 }
7918 }
7919 }
7920
7921 impl std::default::Default for ChangeType {
7922 fn default() -> Self {
7923 use std::convert::From;
7924 Self::from(0)
7925 }
7926 }
7927
7928 impl std::fmt::Display for ChangeType {
7929 fn fmt(
7930 &self,
7931 f: &mut std::fmt::Formatter<'_>,
7932 ) -> std::result::Result<(), std::fmt::Error> {
7933 wkt::internal::display_enum(f, self.name(), self.value())
7934 }
7935 }
7936
7937 impl std::convert::From<i32> for ChangeType {
7938 fn from(value: i32) -> Self {
7939 match value {
7940 0 => Self::Unspecified,
7941 1 => Self::Add,
7942 2 => Self::Remove,
7943 _ => Self::UnknownValue(change_type::UnknownValue(
7944 wkt::internal::UnknownEnumValue::Integer(value),
7945 )),
7946 }
7947 }
7948 }
7949
7950 impl std::convert::From<&str> for ChangeType {
7951 fn from(value: &str) -> Self {
7952 use std::string::ToString;
7953 match value {
7954 "CHANGE_TYPE_UNSPECIFIED" => Self::Unspecified,
7955 "ADD" => Self::Add,
7956 "REMOVE" => Self::Remove,
7957 _ => Self::UnknownValue(change_type::UnknownValue(
7958 wkt::internal::UnknownEnumValue::String(value.to_string()),
7959 )),
7960 }
7961 }
7962 }
7963
7964 impl serde::ser::Serialize for ChangeType {
7965 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7966 where
7967 S: serde::Serializer,
7968 {
7969 match self {
7970 Self::Unspecified => serializer.serialize_i32(0),
7971 Self::Add => serializer.serialize_i32(1),
7972 Self::Remove => serializer.serialize_i32(2),
7973 Self::UnknownValue(u) => u.0.serialize(serializer),
7974 }
7975 }
7976 }
7977
7978 impl<'de> serde::de::Deserialize<'de> for ChangeType {
7979 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7980 where
7981 D: serde::Deserializer<'de>,
7982 {
7983 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ChangeType>::new(
7984 ".google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType",
7985 ))
7986 }
7987 }
7988 }
7989
7990 /// Information about a TTL configuration change.
7991 #[derive(Clone, Default, PartialEq)]
7992 #[non_exhaustive]
7993 pub struct TtlConfigDelta {
7994 /// Specifies how the TTL configuration is changing.
7995 pub change_type: crate::model::field_operation_metadata::ttl_config_delta::ChangeType,
7996
7997 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7998 }
7999
8000 impl TtlConfigDelta {
8001 pub fn new() -> Self {
8002 std::default::Default::default()
8003 }
8004
8005 /// Sets the value of [change_type][crate::model::field_operation_metadata::TtlConfigDelta::change_type].
8006 ///
8007 /// # Example
8008 /// ```ignore,no_run
8009 /// # use google_cloud_firestore_admin_v1::model::field_operation_metadata::TtlConfigDelta;
8010 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::ttl_config_delta::ChangeType;
8011 /// let x0 = TtlConfigDelta::new().set_change_type(ChangeType::Add);
8012 /// let x1 = TtlConfigDelta::new().set_change_type(ChangeType::Remove);
8013 /// ```
8014 pub fn set_change_type<
8015 T: std::convert::Into<
8016 crate::model::field_operation_metadata::ttl_config_delta::ChangeType,
8017 >,
8018 >(
8019 mut self,
8020 v: T,
8021 ) -> Self {
8022 self.change_type = v.into();
8023 self
8024 }
8025 }
8026
8027 impl wkt::message::Message for TtlConfigDelta {
8028 fn typename() -> &'static str {
8029 "type.googleapis.com/google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta"
8030 }
8031 }
8032
8033 /// Defines additional types related to [TtlConfigDelta].
8034 pub mod ttl_config_delta {
8035 #[allow(unused_imports)]
8036 use super::*;
8037
8038 /// Specifies how the TTL config is changing.
8039 ///
8040 /// # Working with unknown values
8041 ///
8042 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8043 /// additional enum variants at any time. Adding new variants is not considered
8044 /// a breaking change. Applications should write their code in anticipation of:
8045 ///
8046 /// - New values appearing in future releases of the client library, **and**
8047 /// - New values received dynamically, without application changes.
8048 ///
8049 /// Please consult the [Working with enums] section in the user guide for some
8050 /// guidelines.
8051 ///
8052 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8053 #[derive(Clone, Debug, PartialEq)]
8054 #[non_exhaustive]
8055 pub enum ChangeType {
8056 /// The type of change is not specified or known.
8057 Unspecified,
8058 /// The TTL config is being added.
8059 Add,
8060 /// The TTL config is being removed.
8061 Remove,
8062 /// If set, the enum was initialized with an unknown value.
8063 ///
8064 /// Applications can examine the value using [ChangeType::value] or
8065 /// [ChangeType::name].
8066 UnknownValue(change_type::UnknownValue),
8067 }
8068
8069 #[doc(hidden)]
8070 pub mod change_type {
8071 #[allow(unused_imports)]
8072 use super::*;
8073 #[derive(Clone, Debug, PartialEq)]
8074 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8075 }
8076
8077 impl ChangeType {
8078 /// Gets the enum value.
8079 ///
8080 /// Returns `None` if the enum contains an unknown value deserialized from
8081 /// the string representation of enums.
8082 pub fn value(&self) -> std::option::Option<i32> {
8083 match self {
8084 Self::Unspecified => std::option::Option::Some(0),
8085 Self::Add => std::option::Option::Some(1),
8086 Self::Remove => std::option::Option::Some(2),
8087 Self::UnknownValue(u) => u.0.value(),
8088 }
8089 }
8090
8091 /// Gets the enum value as a string.
8092 ///
8093 /// Returns `None` if the enum contains an unknown value deserialized from
8094 /// the integer representation of enums.
8095 pub fn name(&self) -> std::option::Option<&str> {
8096 match self {
8097 Self::Unspecified => std::option::Option::Some("CHANGE_TYPE_UNSPECIFIED"),
8098 Self::Add => std::option::Option::Some("ADD"),
8099 Self::Remove => std::option::Option::Some("REMOVE"),
8100 Self::UnknownValue(u) => u.0.name(),
8101 }
8102 }
8103 }
8104
8105 impl std::default::Default for ChangeType {
8106 fn default() -> Self {
8107 use std::convert::From;
8108 Self::from(0)
8109 }
8110 }
8111
8112 impl std::fmt::Display for ChangeType {
8113 fn fmt(
8114 &self,
8115 f: &mut std::fmt::Formatter<'_>,
8116 ) -> std::result::Result<(), std::fmt::Error> {
8117 wkt::internal::display_enum(f, self.name(), self.value())
8118 }
8119 }
8120
8121 impl std::convert::From<i32> for ChangeType {
8122 fn from(value: i32) -> Self {
8123 match value {
8124 0 => Self::Unspecified,
8125 1 => Self::Add,
8126 2 => Self::Remove,
8127 _ => Self::UnknownValue(change_type::UnknownValue(
8128 wkt::internal::UnknownEnumValue::Integer(value),
8129 )),
8130 }
8131 }
8132 }
8133
8134 impl std::convert::From<&str> for ChangeType {
8135 fn from(value: &str) -> Self {
8136 use std::string::ToString;
8137 match value {
8138 "CHANGE_TYPE_UNSPECIFIED" => Self::Unspecified,
8139 "ADD" => Self::Add,
8140 "REMOVE" => Self::Remove,
8141 _ => Self::UnknownValue(change_type::UnknownValue(
8142 wkt::internal::UnknownEnumValue::String(value.to_string()),
8143 )),
8144 }
8145 }
8146 }
8147
8148 impl serde::ser::Serialize for ChangeType {
8149 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8150 where
8151 S: serde::Serializer,
8152 {
8153 match self {
8154 Self::Unspecified => serializer.serialize_i32(0),
8155 Self::Add => serializer.serialize_i32(1),
8156 Self::Remove => serializer.serialize_i32(2),
8157 Self::UnknownValue(u) => u.0.serialize(serializer),
8158 }
8159 }
8160 }
8161
8162 impl<'de> serde::de::Deserialize<'de> for ChangeType {
8163 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8164 where
8165 D: serde::Deserializer<'de>,
8166 {
8167 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ChangeType>::new(
8168 ".google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType",
8169 ))
8170 }
8171 }
8172 }
8173}
8174
8175/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
8176/// results from
8177/// [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments].
8178///
8179/// [google.firestore.admin.v1.FirestoreAdmin.ExportDocuments]: crate::client::FirestoreAdmin::export_documents
8180/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8181#[derive(Clone, Default, PartialEq)]
8182#[non_exhaustive]
8183pub struct ExportDocumentsMetadata {
8184 /// The time this operation started.
8185 pub start_time: std::option::Option<wkt::Timestamp>,
8186
8187 /// The time this operation completed. Will be unset if operation still in
8188 /// progress.
8189 pub end_time: std::option::Option<wkt::Timestamp>,
8190
8191 /// The state of the export operation.
8192 pub operation_state: crate::model::OperationState,
8193
8194 /// The progress, in documents, of this operation.
8195 pub progress_documents: std::option::Option<crate::model::Progress>,
8196
8197 /// The progress, in bytes, of this operation.
8198 pub progress_bytes: std::option::Option<crate::model::Progress>,
8199
8200 /// Which collection IDs are being exported.
8201 pub collection_ids: std::vec::Vec<std::string::String>,
8202
8203 /// Where the documents are being exported to.
8204 pub output_uri_prefix: std::string::String,
8205
8206 /// Which namespace IDs are being exported.
8207 pub namespace_ids: std::vec::Vec<std::string::String>,
8208
8209 /// The timestamp that corresponds to the version of the database that is being
8210 /// exported. If unspecified, there are no guarantees about the consistency of
8211 /// the documents being exported.
8212 pub snapshot_time: std::option::Option<wkt::Timestamp>,
8213
8214 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8215}
8216
8217impl ExportDocumentsMetadata {
8218 pub fn new() -> Self {
8219 std::default::Default::default()
8220 }
8221
8222 /// Sets the value of [start_time][crate::model::ExportDocumentsMetadata::start_time].
8223 ///
8224 /// # Example
8225 /// ```ignore,no_run
8226 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8227 /// use wkt::Timestamp;
8228 /// let x = ExportDocumentsMetadata::new().set_start_time(Timestamp::default()/* use setters */);
8229 /// ```
8230 pub fn set_start_time<T>(mut self, v: T) -> Self
8231 where
8232 T: std::convert::Into<wkt::Timestamp>,
8233 {
8234 self.start_time = std::option::Option::Some(v.into());
8235 self
8236 }
8237
8238 /// Sets or clears the value of [start_time][crate::model::ExportDocumentsMetadata::start_time].
8239 ///
8240 /// # Example
8241 /// ```ignore,no_run
8242 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8243 /// use wkt::Timestamp;
8244 /// let x = ExportDocumentsMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
8245 /// let x = ExportDocumentsMetadata::new().set_or_clear_start_time(None::<Timestamp>);
8246 /// ```
8247 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8248 where
8249 T: std::convert::Into<wkt::Timestamp>,
8250 {
8251 self.start_time = v.map(|x| x.into());
8252 self
8253 }
8254
8255 /// Sets the value of [end_time][crate::model::ExportDocumentsMetadata::end_time].
8256 ///
8257 /// # Example
8258 /// ```ignore,no_run
8259 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8260 /// use wkt::Timestamp;
8261 /// let x = ExportDocumentsMetadata::new().set_end_time(Timestamp::default()/* use setters */);
8262 /// ```
8263 pub fn set_end_time<T>(mut self, v: T) -> Self
8264 where
8265 T: std::convert::Into<wkt::Timestamp>,
8266 {
8267 self.end_time = std::option::Option::Some(v.into());
8268 self
8269 }
8270
8271 /// Sets or clears the value of [end_time][crate::model::ExportDocumentsMetadata::end_time].
8272 ///
8273 /// # Example
8274 /// ```ignore,no_run
8275 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8276 /// use wkt::Timestamp;
8277 /// let x = ExportDocumentsMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8278 /// let x = ExportDocumentsMetadata::new().set_or_clear_end_time(None::<Timestamp>);
8279 /// ```
8280 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8281 where
8282 T: std::convert::Into<wkt::Timestamp>,
8283 {
8284 self.end_time = v.map(|x| x.into());
8285 self
8286 }
8287
8288 /// Sets the value of [operation_state][crate::model::ExportDocumentsMetadata::operation_state].
8289 ///
8290 /// # Example
8291 /// ```ignore,no_run
8292 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8293 /// use google_cloud_firestore_admin_v1::model::OperationState;
8294 /// let x0 = ExportDocumentsMetadata::new().set_operation_state(OperationState::Initializing);
8295 /// let x1 = ExportDocumentsMetadata::new().set_operation_state(OperationState::Processing);
8296 /// let x2 = ExportDocumentsMetadata::new().set_operation_state(OperationState::Cancelling);
8297 /// ```
8298 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
8299 mut self,
8300 v: T,
8301 ) -> Self {
8302 self.operation_state = v.into();
8303 self
8304 }
8305
8306 /// Sets the value of [progress_documents][crate::model::ExportDocumentsMetadata::progress_documents].
8307 ///
8308 /// # Example
8309 /// ```ignore,no_run
8310 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8311 /// use google_cloud_firestore_admin_v1::model::Progress;
8312 /// let x = ExportDocumentsMetadata::new().set_progress_documents(Progress::default()/* use setters */);
8313 /// ```
8314 pub fn set_progress_documents<T>(mut self, v: T) -> Self
8315 where
8316 T: std::convert::Into<crate::model::Progress>,
8317 {
8318 self.progress_documents = std::option::Option::Some(v.into());
8319 self
8320 }
8321
8322 /// Sets or clears the value of [progress_documents][crate::model::ExportDocumentsMetadata::progress_documents].
8323 ///
8324 /// # Example
8325 /// ```ignore,no_run
8326 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8327 /// use google_cloud_firestore_admin_v1::model::Progress;
8328 /// let x = ExportDocumentsMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
8329 /// let x = ExportDocumentsMetadata::new().set_or_clear_progress_documents(None::<Progress>);
8330 /// ```
8331 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
8332 where
8333 T: std::convert::Into<crate::model::Progress>,
8334 {
8335 self.progress_documents = v.map(|x| x.into());
8336 self
8337 }
8338
8339 /// Sets the value of [progress_bytes][crate::model::ExportDocumentsMetadata::progress_bytes].
8340 ///
8341 /// # Example
8342 /// ```ignore,no_run
8343 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8344 /// use google_cloud_firestore_admin_v1::model::Progress;
8345 /// let x = ExportDocumentsMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
8346 /// ```
8347 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
8348 where
8349 T: std::convert::Into<crate::model::Progress>,
8350 {
8351 self.progress_bytes = std::option::Option::Some(v.into());
8352 self
8353 }
8354
8355 /// Sets or clears the value of [progress_bytes][crate::model::ExportDocumentsMetadata::progress_bytes].
8356 ///
8357 /// # Example
8358 /// ```ignore,no_run
8359 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8360 /// use google_cloud_firestore_admin_v1::model::Progress;
8361 /// let x = ExportDocumentsMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
8362 /// let x = ExportDocumentsMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
8363 /// ```
8364 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8365 where
8366 T: std::convert::Into<crate::model::Progress>,
8367 {
8368 self.progress_bytes = v.map(|x| x.into());
8369 self
8370 }
8371
8372 /// Sets the value of [collection_ids][crate::model::ExportDocumentsMetadata::collection_ids].
8373 ///
8374 /// # Example
8375 /// ```ignore,no_run
8376 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8377 /// let x = ExportDocumentsMetadata::new().set_collection_ids(["a", "b", "c"]);
8378 /// ```
8379 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
8380 where
8381 T: std::iter::IntoIterator<Item = V>,
8382 V: std::convert::Into<std::string::String>,
8383 {
8384 use std::iter::Iterator;
8385 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
8386 self
8387 }
8388
8389 /// Sets the value of [output_uri_prefix][crate::model::ExportDocumentsMetadata::output_uri_prefix].
8390 ///
8391 /// # Example
8392 /// ```ignore,no_run
8393 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8394 /// let x = ExportDocumentsMetadata::new().set_output_uri_prefix("example");
8395 /// ```
8396 pub fn set_output_uri_prefix<T: std::convert::Into<std::string::String>>(
8397 mut self,
8398 v: T,
8399 ) -> Self {
8400 self.output_uri_prefix = v.into();
8401 self
8402 }
8403
8404 /// Sets the value of [namespace_ids][crate::model::ExportDocumentsMetadata::namespace_ids].
8405 ///
8406 /// # Example
8407 /// ```ignore,no_run
8408 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8409 /// let x = ExportDocumentsMetadata::new().set_namespace_ids(["a", "b", "c"]);
8410 /// ```
8411 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
8412 where
8413 T: std::iter::IntoIterator<Item = V>,
8414 V: std::convert::Into<std::string::String>,
8415 {
8416 use std::iter::Iterator;
8417 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
8418 self
8419 }
8420
8421 /// Sets the value of [snapshot_time][crate::model::ExportDocumentsMetadata::snapshot_time].
8422 ///
8423 /// # Example
8424 /// ```ignore,no_run
8425 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8426 /// use wkt::Timestamp;
8427 /// let x = ExportDocumentsMetadata::new().set_snapshot_time(Timestamp::default()/* use setters */);
8428 /// ```
8429 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
8430 where
8431 T: std::convert::Into<wkt::Timestamp>,
8432 {
8433 self.snapshot_time = std::option::Option::Some(v.into());
8434 self
8435 }
8436
8437 /// Sets or clears the value of [snapshot_time][crate::model::ExportDocumentsMetadata::snapshot_time].
8438 ///
8439 /// # Example
8440 /// ```ignore,no_run
8441 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8442 /// use wkt::Timestamp;
8443 /// let x = ExportDocumentsMetadata::new().set_or_clear_snapshot_time(Some(Timestamp::default()/* use setters */));
8444 /// let x = ExportDocumentsMetadata::new().set_or_clear_snapshot_time(None::<Timestamp>);
8445 /// ```
8446 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
8447 where
8448 T: std::convert::Into<wkt::Timestamp>,
8449 {
8450 self.snapshot_time = v.map(|x| x.into());
8451 self
8452 }
8453}
8454
8455impl wkt::message::Message for ExportDocumentsMetadata {
8456 fn typename() -> &'static str {
8457 "type.googleapis.com/google.firestore.admin.v1.ExportDocumentsMetadata"
8458 }
8459}
8460
8461/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
8462/// results from
8463/// [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments].
8464///
8465/// [google.firestore.admin.v1.FirestoreAdmin.ImportDocuments]: crate::client::FirestoreAdmin::import_documents
8466/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8467#[derive(Clone, Default, PartialEq)]
8468#[non_exhaustive]
8469pub struct ImportDocumentsMetadata {
8470 /// The time this operation started.
8471 pub start_time: std::option::Option<wkt::Timestamp>,
8472
8473 /// The time this operation completed. Will be unset if operation still in
8474 /// progress.
8475 pub end_time: std::option::Option<wkt::Timestamp>,
8476
8477 /// The state of the import operation.
8478 pub operation_state: crate::model::OperationState,
8479
8480 /// The progress, in documents, of this operation.
8481 pub progress_documents: std::option::Option<crate::model::Progress>,
8482
8483 /// The progress, in bytes, of this operation.
8484 pub progress_bytes: std::option::Option<crate::model::Progress>,
8485
8486 /// Which collection IDs are being imported.
8487 pub collection_ids: std::vec::Vec<std::string::String>,
8488
8489 /// The location of the documents being imported.
8490 pub input_uri_prefix: std::string::String,
8491
8492 /// Which namespace IDs are being imported.
8493 pub namespace_ids: std::vec::Vec<std::string::String>,
8494
8495 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8496}
8497
8498impl ImportDocumentsMetadata {
8499 pub fn new() -> Self {
8500 std::default::Default::default()
8501 }
8502
8503 /// Sets the value of [start_time][crate::model::ImportDocumentsMetadata::start_time].
8504 ///
8505 /// # Example
8506 /// ```ignore,no_run
8507 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8508 /// use wkt::Timestamp;
8509 /// let x = ImportDocumentsMetadata::new().set_start_time(Timestamp::default()/* use setters */);
8510 /// ```
8511 pub fn set_start_time<T>(mut self, v: T) -> Self
8512 where
8513 T: std::convert::Into<wkt::Timestamp>,
8514 {
8515 self.start_time = std::option::Option::Some(v.into());
8516 self
8517 }
8518
8519 /// Sets or clears the value of [start_time][crate::model::ImportDocumentsMetadata::start_time].
8520 ///
8521 /// # Example
8522 /// ```ignore,no_run
8523 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8524 /// use wkt::Timestamp;
8525 /// let x = ImportDocumentsMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
8526 /// let x = ImportDocumentsMetadata::new().set_or_clear_start_time(None::<Timestamp>);
8527 /// ```
8528 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8529 where
8530 T: std::convert::Into<wkt::Timestamp>,
8531 {
8532 self.start_time = v.map(|x| x.into());
8533 self
8534 }
8535
8536 /// Sets the value of [end_time][crate::model::ImportDocumentsMetadata::end_time].
8537 ///
8538 /// # Example
8539 /// ```ignore,no_run
8540 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8541 /// use wkt::Timestamp;
8542 /// let x = ImportDocumentsMetadata::new().set_end_time(Timestamp::default()/* use setters */);
8543 /// ```
8544 pub fn set_end_time<T>(mut self, v: T) -> Self
8545 where
8546 T: std::convert::Into<wkt::Timestamp>,
8547 {
8548 self.end_time = std::option::Option::Some(v.into());
8549 self
8550 }
8551
8552 /// Sets or clears the value of [end_time][crate::model::ImportDocumentsMetadata::end_time].
8553 ///
8554 /// # Example
8555 /// ```ignore,no_run
8556 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8557 /// use wkt::Timestamp;
8558 /// let x = ImportDocumentsMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8559 /// let x = ImportDocumentsMetadata::new().set_or_clear_end_time(None::<Timestamp>);
8560 /// ```
8561 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8562 where
8563 T: std::convert::Into<wkt::Timestamp>,
8564 {
8565 self.end_time = v.map(|x| x.into());
8566 self
8567 }
8568
8569 /// Sets the value of [operation_state][crate::model::ImportDocumentsMetadata::operation_state].
8570 ///
8571 /// # Example
8572 /// ```ignore,no_run
8573 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8574 /// use google_cloud_firestore_admin_v1::model::OperationState;
8575 /// let x0 = ImportDocumentsMetadata::new().set_operation_state(OperationState::Initializing);
8576 /// let x1 = ImportDocumentsMetadata::new().set_operation_state(OperationState::Processing);
8577 /// let x2 = ImportDocumentsMetadata::new().set_operation_state(OperationState::Cancelling);
8578 /// ```
8579 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
8580 mut self,
8581 v: T,
8582 ) -> Self {
8583 self.operation_state = v.into();
8584 self
8585 }
8586
8587 /// Sets the value of [progress_documents][crate::model::ImportDocumentsMetadata::progress_documents].
8588 ///
8589 /// # Example
8590 /// ```ignore,no_run
8591 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8592 /// use google_cloud_firestore_admin_v1::model::Progress;
8593 /// let x = ImportDocumentsMetadata::new().set_progress_documents(Progress::default()/* use setters */);
8594 /// ```
8595 pub fn set_progress_documents<T>(mut self, v: T) -> Self
8596 where
8597 T: std::convert::Into<crate::model::Progress>,
8598 {
8599 self.progress_documents = std::option::Option::Some(v.into());
8600 self
8601 }
8602
8603 /// Sets or clears the value of [progress_documents][crate::model::ImportDocumentsMetadata::progress_documents].
8604 ///
8605 /// # Example
8606 /// ```ignore,no_run
8607 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8608 /// use google_cloud_firestore_admin_v1::model::Progress;
8609 /// let x = ImportDocumentsMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
8610 /// let x = ImportDocumentsMetadata::new().set_or_clear_progress_documents(None::<Progress>);
8611 /// ```
8612 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
8613 where
8614 T: std::convert::Into<crate::model::Progress>,
8615 {
8616 self.progress_documents = v.map(|x| x.into());
8617 self
8618 }
8619
8620 /// Sets the value of [progress_bytes][crate::model::ImportDocumentsMetadata::progress_bytes].
8621 ///
8622 /// # Example
8623 /// ```ignore,no_run
8624 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8625 /// use google_cloud_firestore_admin_v1::model::Progress;
8626 /// let x = ImportDocumentsMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
8627 /// ```
8628 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
8629 where
8630 T: std::convert::Into<crate::model::Progress>,
8631 {
8632 self.progress_bytes = std::option::Option::Some(v.into());
8633 self
8634 }
8635
8636 /// Sets or clears the value of [progress_bytes][crate::model::ImportDocumentsMetadata::progress_bytes].
8637 ///
8638 /// # Example
8639 /// ```ignore,no_run
8640 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8641 /// use google_cloud_firestore_admin_v1::model::Progress;
8642 /// let x = ImportDocumentsMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
8643 /// let x = ImportDocumentsMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
8644 /// ```
8645 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8646 where
8647 T: std::convert::Into<crate::model::Progress>,
8648 {
8649 self.progress_bytes = v.map(|x| x.into());
8650 self
8651 }
8652
8653 /// Sets the value of [collection_ids][crate::model::ImportDocumentsMetadata::collection_ids].
8654 ///
8655 /// # Example
8656 /// ```ignore,no_run
8657 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8658 /// let x = ImportDocumentsMetadata::new().set_collection_ids(["a", "b", "c"]);
8659 /// ```
8660 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
8661 where
8662 T: std::iter::IntoIterator<Item = V>,
8663 V: std::convert::Into<std::string::String>,
8664 {
8665 use std::iter::Iterator;
8666 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
8667 self
8668 }
8669
8670 /// Sets the value of [input_uri_prefix][crate::model::ImportDocumentsMetadata::input_uri_prefix].
8671 ///
8672 /// # Example
8673 /// ```ignore,no_run
8674 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8675 /// let x = ImportDocumentsMetadata::new().set_input_uri_prefix("example");
8676 /// ```
8677 pub fn set_input_uri_prefix<T: std::convert::Into<std::string::String>>(
8678 mut self,
8679 v: T,
8680 ) -> Self {
8681 self.input_uri_prefix = v.into();
8682 self
8683 }
8684
8685 /// Sets the value of [namespace_ids][crate::model::ImportDocumentsMetadata::namespace_ids].
8686 ///
8687 /// # Example
8688 /// ```ignore,no_run
8689 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8690 /// let x = ImportDocumentsMetadata::new().set_namespace_ids(["a", "b", "c"]);
8691 /// ```
8692 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
8693 where
8694 T: std::iter::IntoIterator<Item = V>,
8695 V: std::convert::Into<std::string::String>,
8696 {
8697 use std::iter::Iterator;
8698 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
8699 self
8700 }
8701}
8702
8703impl wkt::message::Message for ImportDocumentsMetadata {
8704 fn typename() -> &'static str {
8705 "type.googleapis.com/google.firestore.admin.v1.ImportDocumentsMetadata"
8706 }
8707}
8708
8709/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
8710/// results from
8711/// [FirestoreAdmin.BulkDeleteDocuments][google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments].
8712///
8713/// [google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments]: crate::client::FirestoreAdmin::bulk_delete_documents
8714/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8715#[derive(Clone, Default, PartialEq)]
8716#[non_exhaustive]
8717pub struct BulkDeleteDocumentsMetadata {
8718 /// The time this operation started.
8719 pub start_time: std::option::Option<wkt::Timestamp>,
8720
8721 /// The time this operation completed. Will be unset if operation still in
8722 /// progress.
8723 pub end_time: std::option::Option<wkt::Timestamp>,
8724
8725 /// The state of the operation.
8726 pub operation_state: crate::model::OperationState,
8727
8728 /// The progress, in documents, of this operation.
8729 pub progress_documents: std::option::Option<crate::model::Progress>,
8730
8731 /// The progress, in bytes, of this operation.
8732 pub progress_bytes: std::option::Option<crate::model::Progress>,
8733
8734 /// The IDs of the collection groups that are being deleted.
8735 pub collection_ids: std::vec::Vec<std::string::String>,
8736
8737 /// Which namespace IDs are being deleted.
8738 pub namespace_ids: std::vec::Vec<std::string::String>,
8739
8740 /// The timestamp that corresponds to the version of the database that is being
8741 /// read to get the list of documents to delete. This time can also be used as
8742 /// the timestamp of PITR in case of disaster recovery (subject to PITR window
8743 /// limit).
8744 pub snapshot_time: std::option::Option<wkt::Timestamp>,
8745
8746 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8747}
8748
8749impl BulkDeleteDocumentsMetadata {
8750 pub fn new() -> Self {
8751 std::default::Default::default()
8752 }
8753
8754 /// Sets the value of [start_time][crate::model::BulkDeleteDocumentsMetadata::start_time].
8755 ///
8756 /// # Example
8757 /// ```ignore,no_run
8758 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8759 /// use wkt::Timestamp;
8760 /// let x = BulkDeleteDocumentsMetadata::new().set_start_time(Timestamp::default()/* use setters */);
8761 /// ```
8762 pub fn set_start_time<T>(mut self, v: T) -> Self
8763 where
8764 T: std::convert::Into<wkt::Timestamp>,
8765 {
8766 self.start_time = std::option::Option::Some(v.into());
8767 self
8768 }
8769
8770 /// Sets or clears the value of [start_time][crate::model::BulkDeleteDocumentsMetadata::start_time].
8771 ///
8772 /// # Example
8773 /// ```ignore,no_run
8774 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8775 /// use wkt::Timestamp;
8776 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
8777 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_start_time(None::<Timestamp>);
8778 /// ```
8779 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8780 where
8781 T: std::convert::Into<wkt::Timestamp>,
8782 {
8783 self.start_time = v.map(|x| x.into());
8784 self
8785 }
8786
8787 /// Sets the value of [end_time][crate::model::BulkDeleteDocumentsMetadata::end_time].
8788 ///
8789 /// # Example
8790 /// ```ignore,no_run
8791 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8792 /// use wkt::Timestamp;
8793 /// let x = BulkDeleteDocumentsMetadata::new().set_end_time(Timestamp::default()/* use setters */);
8794 /// ```
8795 pub fn set_end_time<T>(mut self, v: T) -> Self
8796 where
8797 T: std::convert::Into<wkt::Timestamp>,
8798 {
8799 self.end_time = std::option::Option::Some(v.into());
8800 self
8801 }
8802
8803 /// Sets or clears the value of [end_time][crate::model::BulkDeleteDocumentsMetadata::end_time].
8804 ///
8805 /// # Example
8806 /// ```ignore,no_run
8807 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8808 /// use wkt::Timestamp;
8809 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8810 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_end_time(None::<Timestamp>);
8811 /// ```
8812 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8813 where
8814 T: std::convert::Into<wkt::Timestamp>,
8815 {
8816 self.end_time = v.map(|x| x.into());
8817 self
8818 }
8819
8820 /// Sets the value of [operation_state][crate::model::BulkDeleteDocumentsMetadata::operation_state].
8821 ///
8822 /// # Example
8823 /// ```ignore,no_run
8824 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8825 /// use google_cloud_firestore_admin_v1::model::OperationState;
8826 /// let x0 = BulkDeleteDocumentsMetadata::new().set_operation_state(OperationState::Initializing);
8827 /// let x1 = BulkDeleteDocumentsMetadata::new().set_operation_state(OperationState::Processing);
8828 /// let x2 = BulkDeleteDocumentsMetadata::new().set_operation_state(OperationState::Cancelling);
8829 /// ```
8830 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
8831 mut self,
8832 v: T,
8833 ) -> Self {
8834 self.operation_state = v.into();
8835 self
8836 }
8837
8838 /// Sets the value of [progress_documents][crate::model::BulkDeleteDocumentsMetadata::progress_documents].
8839 ///
8840 /// # Example
8841 /// ```ignore,no_run
8842 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8843 /// use google_cloud_firestore_admin_v1::model::Progress;
8844 /// let x = BulkDeleteDocumentsMetadata::new().set_progress_documents(Progress::default()/* use setters */);
8845 /// ```
8846 pub fn set_progress_documents<T>(mut self, v: T) -> Self
8847 where
8848 T: std::convert::Into<crate::model::Progress>,
8849 {
8850 self.progress_documents = std::option::Option::Some(v.into());
8851 self
8852 }
8853
8854 /// Sets or clears the value of [progress_documents][crate::model::BulkDeleteDocumentsMetadata::progress_documents].
8855 ///
8856 /// # Example
8857 /// ```ignore,no_run
8858 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8859 /// use google_cloud_firestore_admin_v1::model::Progress;
8860 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
8861 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_progress_documents(None::<Progress>);
8862 /// ```
8863 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
8864 where
8865 T: std::convert::Into<crate::model::Progress>,
8866 {
8867 self.progress_documents = v.map(|x| x.into());
8868 self
8869 }
8870
8871 /// Sets the value of [progress_bytes][crate::model::BulkDeleteDocumentsMetadata::progress_bytes].
8872 ///
8873 /// # Example
8874 /// ```ignore,no_run
8875 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8876 /// use google_cloud_firestore_admin_v1::model::Progress;
8877 /// let x = BulkDeleteDocumentsMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
8878 /// ```
8879 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
8880 where
8881 T: std::convert::Into<crate::model::Progress>,
8882 {
8883 self.progress_bytes = std::option::Option::Some(v.into());
8884 self
8885 }
8886
8887 /// Sets or clears the value of [progress_bytes][crate::model::BulkDeleteDocumentsMetadata::progress_bytes].
8888 ///
8889 /// # Example
8890 /// ```ignore,no_run
8891 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8892 /// use google_cloud_firestore_admin_v1::model::Progress;
8893 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
8894 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
8895 /// ```
8896 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8897 where
8898 T: std::convert::Into<crate::model::Progress>,
8899 {
8900 self.progress_bytes = v.map(|x| x.into());
8901 self
8902 }
8903
8904 /// Sets the value of [collection_ids][crate::model::BulkDeleteDocumentsMetadata::collection_ids].
8905 ///
8906 /// # Example
8907 /// ```ignore,no_run
8908 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8909 /// let x = BulkDeleteDocumentsMetadata::new().set_collection_ids(["a", "b", "c"]);
8910 /// ```
8911 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
8912 where
8913 T: std::iter::IntoIterator<Item = V>,
8914 V: std::convert::Into<std::string::String>,
8915 {
8916 use std::iter::Iterator;
8917 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
8918 self
8919 }
8920
8921 /// Sets the value of [namespace_ids][crate::model::BulkDeleteDocumentsMetadata::namespace_ids].
8922 ///
8923 /// # Example
8924 /// ```ignore,no_run
8925 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8926 /// let x = BulkDeleteDocumentsMetadata::new().set_namespace_ids(["a", "b", "c"]);
8927 /// ```
8928 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
8929 where
8930 T: std::iter::IntoIterator<Item = V>,
8931 V: std::convert::Into<std::string::String>,
8932 {
8933 use std::iter::Iterator;
8934 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
8935 self
8936 }
8937
8938 /// Sets the value of [snapshot_time][crate::model::BulkDeleteDocumentsMetadata::snapshot_time].
8939 ///
8940 /// # Example
8941 /// ```ignore,no_run
8942 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8943 /// use wkt::Timestamp;
8944 /// let x = BulkDeleteDocumentsMetadata::new().set_snapshot_time(Timestamp::default()/* use setters */);
8945 /// ```
8946 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
8947 where
8948 T: std::convert::Into<wkt::Timestamp>,
8949 {
8950 self.snapshot_time = std::option::Option::Some(v.into());
8951 self
8952 }
8953
8954 /// Sets or clears the value of [snapshot_time][crate::model::BulkDeleteDocumentsMetadata::snapshot_time].
8955 ///
8956 /// # Example
8957 /// ```ignore,no_run
8958 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8959 /// use wkt::Timestamp;
8960 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_snapshot_time(Some(Timestamp::default()/* use setters */));
8961 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_snapshot_time(None::<Timestamp>);
8962 /// ```
8963 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
8964 where
8965 T: std::convert::Into<wkt::Timestamp>,
8966 {
8967 self.snapshot_time = v.map(|x| x.into());
8968 self
8969 }
8970}
8971
8972impl wkt::message::Message for BulkDeleteDocumentsMetadata {
8973 fn typename() -> &'static str {
8974 "type.googleapis.com/google.firestore.admin.v1.BulkDeleteDocumentsMetadata"
8975 }
8976}
8977
8978/// Returned in the [google.longrunning.Operation][google.longrunning.Operation]
8979/// response field.
8980///
8981/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8982#[derive(Clone, Default, PartialEq)]
8983#[non_exhaustive]
8984pub struct ExportDocumentsResponse {
8985 /// Location of the output files. This can be used to begin an import
8986 /// into Cloud Firestore (this project or another project) after the operation
8987 /// completes successfully.
8988 pub output_uri_prefix: std::string::String,
8989
8990 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8991}
8992
8993impl ExportDocumentsResponse {
8994 pub fn new() -> Self {
8995 std::default::Default::default()
8996 }
8997
8998 /// Sets the value of [output_uri_prefix][crate::model::ExportDocumentsResponse::output_uri_prefix].
8999 ///
9000 /// # Example
9001 /// ```ignore,no_run
9002 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsResponse;
9003 /// let x = ExportDocumentsResponse::new().set_output_uri_prefix("example");
9004 /// ```
9005 pub fn set_output_uri_prefix<T: std::convert::Into<std::string::String>>(
9006 mut self,
9007 v: T,
9008 ) -> Self {
9009 self.output_uri_prefix = v.into();
9010 self
9011 }
9012}
9013
9014impl wkt::message::Message for ExportDocumentsResponse {
9015 fn typename() -> &'static str {
9016 "type.googleapis.com/google.firestore.admin.v1.ExportDocumentsResponse"
9017 }
9018}
9019
9020/// Metadata for the [long-running operation][google.longrunning.Operation] from
9021/// the [RestoreDatabase][google.firestore.admin.v1.RestoreDatabase] request.
9022///
9023/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
9024#[derive(Clone, Default, PartialEq)]
9025#[non_exhaustive]
9026pub struct RestoreDatabaseMetadata {
9027 /// The time the restore was started.
9028 pub start_time: std::option::Option<wkt::Timestamp>,
9029
9030 /// The time the restore finished, unset for ongoing restores.
9031 pub end_time: std::option::Option<wkt::Timestamp>,
9032
9033 /// The operation state of the restore.
9034 pub operation_state: crate::model::OperationState,
9035
9036 /// The name of the database being restored to.
9037 pub database: std::string::String,
9038
9039 /// The name of the backup restoring from.
9040 pub backup: std::string::String,
9041
9042 /// How far along the restore is as an estimated percentage of remaining time.
9043 pub progress_percentage: std::option::Option<crate::model::Progress>,
9044
9045 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9046}
9047
9048impl RestoreDatabaseMetadata {
9049 pub fn new() -> Self {
9050 std::default::Default::default()
9051 }
9052
9053 /// Sets the value of [start_time][crate::model::RestoreDatabaseMetadata::start_time].
9054 ///
9055 /// # Example
9056 /// ```ignore,no_run
9057 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9058 /// use wkt::Timestamp;
9059 /// let x = RestoreDatabaseMetadata::new().set_start_time(Timestamp::default()/* use setters */);
9060 /// ```
9061 pub fn set_start_time<T>(mut self, v: T) -> Self
9062 where
9063 T: std::convert::Into<wkt::Timestamp>,
9064 {
9065 self.start_time = std::option::Option::Some(v.into());
9066 self
9067 }
9068
9069 /// Sets or clears the value of [start_time][crate::model::RestoreDatabaseMetadata::start_time].
9070 ///
9071 /// # Example
9072 /// ```ignore,no_run
9073 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9074 /// use wkt::Timestamp;
9075 /// let x = RestoreDatabaseMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
9076 /// let x = RestoreDatabaseMetadata::new().set_or_clear_start_time(None::<Timestamp>);
9077 /// ```
9078 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
9079 where
9080 T: std::convert::Into<wkt::Timestamp>,
9081 {
9082 self.start_time = v.map(|x| x.into());
9083 self
9084 }
9085
9086 /// Sets the value of [end_time][crate::model::RestoreDatabaseMetadata::end_time].
9087 ///
9088 /// # Example
9089 /// ```ignore,no_run
9090 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9091 /// use wkt::Timestamp;
9092 /// let x = RestoreDatabaseMetadata::new().set_end_time(Timestamp::default()/* use setters */);
9093 /// ```
9094 pub fn set_end_time<T>(mut self, v: T) -> Self
9095 where
9096 T: std::convert::Into<wkt::Timestamp>,
9097 {
9098 self.end_time = std::option::Option::Some(v.into());
9099 self
9100 }
9101
9102 /// Sets or clears the value of [end_time][crate::model::RestoreDatabaseMetadata::end_time].
9103 ///
9104 /// # Example
9105 /// ```ignore,no_run
9106 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9107 /// use wkt::Timestamp;
9108 /// let x = RestoreDatabaseMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
9109 /// let x = RestoreDatabaseMetadata::new().set_or_clear_end_time(None::<Timestamp>);
9110 /// ```
9111 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9112 where
9113 T: std::convert::Into<wkt::Timestamp>,
9114 {
9115 self.end_time = v.map(|x| x.into());
9116 self
9117 }
9118
9119 /// Sets the value of [operation_state][crate::model::RestoreDatabaseMetadata::operation_state].
9120 ///
9121 /// # Example
9122 /// ```ignore,no_run
9123 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9124 /// use google_cloud_firestore_admin_v1::model::OperationState;
9125 /// let x0 = RestoreDatabaseMetadata::new().set_operation_state(OperationState::Initializing);
9126 /// let x1 = RestoreDatabaseMetadata::new().set_operation_state(OperationState::Processing);
9127 /// let x2 = RestoreDatabaseMetadata::new().set_operation_state(OperationState::Cancelling);
9128 /// ```
9129 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
9130 mut self,
9131 v: T,
9132 ) -> Self {
9133 self.operation_state = v.into();
9134 self
9135 }
9136
9137 /// Sets the value of [database][crate::model::RestoreDatabaseMetadata::database].
9138 ///
9139 /// # Example
9140 /// ```ignore,no_run
9141 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9142 /// let x = RestoreDatabaseMetadata::new().set_database("example");
9143 /// ```
9144 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9145 self.database = v.into();
9146 self
9147 }
9148
9149 /// Sets the value of [backup][crate::model::RestoreDatabaseMetadata::backup].
9150 ///
9151 /// # Example
9152 /// ```ignore,no_run
9153 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9154 /// let x = RestoreDatabaseMetadata::new().set_backup("example");
9155 /// ```
9156 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9157 self.backup = v.into();
9158 self
9159 }
9160
9161 /// Sets the value of [progress_percentage][crate::model::RestoreDatabaseMetadata::progress_percentage].
9162 ///
9163 /// # Example
9164 /// ```ignore,no_run
9165 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9166 /// use google_cloud_firestore_admin_v1::model::Progress;
9167 /// let x = RestoreDatabaseMetadata::new().set_progress_percentage(Progress::default()/* use setters */);
9168 /// ```
9169 pub fn set_progress_percentage<T>(mut self, v: T) -> Self
9170 where
9171 T: std::convert::Into<crate::model::Progress>,
9172 {
9173 self.progress_percentage = std::option::Option::Some(v.into());
9174 self
9175 }
9176
9177 /// Sets or clears the value of [progress_percentage][crate::model::RestoreDatabaseMetadata::progress_percentage].
9178 ///
9179 /// # Example
9180 /// ```ignore,no_run
9181 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9182 /// use google_cloud_firestore_admin_v1::model::Progress;
9183 /// let x = RestoreDatabaseMetadata::new().set_or_clear_progress_percentage(Some(Progress::default()/* use setters */));
9184 /// let x = RestoreDatabaseMetadata::new().set_or_clear_progress_percentage(None::<Progress>);
9185 /// ```
9186 pub fn set_or_clear_progress_percentage<T>(mut self, v: std::option::Option<T>) -> Self
9187 where
9188 T: std::convert::Into<crate::model::Progress>,
9189 {
9190 self.progress_percentage = v.map(|x| x.into());
9191 self
9192 }
9193}
9194
9195impl wkt::message::Message for RestoreDatabaseMetadata {
9196 fn typename() -> &'static str {
9197 "type.googleapis.com/google.firestore.admin.v1.RestoreDatabaseMetadata"
9198 }
9199}
9200
9201/// Metadata for the [long-running operation][google.longrunning.Operation] from
9202/// the [CloneDatabase][google.firestore.admin.v1.CloneDatabase] request.
9203///
9204/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
9205#[derive(Clone, Default, PartialEq)]
9206#[non_exhaustive]
9207pub struct CloneDatabaseMetadata {
9208 /// The time the clone was started.
9209 pub start_time: std::option::Option<wkt::Timestamp>,
9210
9211 /// The time the clone finished, unset for ongoing clones.
9212 pub end_time: std::option::Option<wkt::Timestamp>,
9213
9214 /// The operation state of the clone.
9215 pub operation_state: crate::model::OperationState,
9216
9217 /// The name of the database being cloned to.
9218 pub database: std::string::String,
9219
9220 /// The snapshot from which this database was cloned.
9221 pub pitr_snapshot: std::option::Option<crate::model::PitrSnapshot>,
9222
9223 /// How far along the clone is as an estimated percentage of remaining time.
9224 pub progress_percentage: std::option::Option<crate::model::Progress>,
9225
9226 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9227}
9228
9229impl CloneDatabaseMetadata {
9230 pub fn new() -> Self {
9231 std::default::Default::default()
9232 }
9233
9234 /// Sets the value of [start_time][crate::model::CloneDatabaseMetadata::start_time].
9235 ///
9236 /// # Example
9237 /// ```ignore,no_run
9238 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9239 /// use wkt::Timestamp;
9240 /// let x = CloneDatabaseMetadata::new().set_start_time(Timestamp::default()/* use setters */);
9241 /// ```
9242 pub fn set_start_time<T>(mut self, v: T) -> Self
9243 where
9244 T: std::convert::Into<wkt::Timestamp>,
9245 {
9246 self.start_time = std::option::Option::Some(v.into());
9247 self
9248 }
9249
9250 /// Sets or clears the value of [start_time][crate::model::CloneDatabaseMetadata::start_time].
9251 ///
9252 /// # Example
9253 /// ```ignore,no_run
9254 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9255 /// use wkt::Timestamp;
9256 /// let x = CloneDatabaseMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
9257 /// let x = CloneDatabaseMetadata::new().set_or_clear_start_time(None::<Timestamp>);
9258 /// ```
9259 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
9260 where
9261 T: std::convert::Into<wkt::Timestamp>,
9262 {
9263 self.start_time = v.map(|x| x.into());
9264 self
9265 }
9266
9267 /// Sets the value of [end_time][crate::model::CloneDatabaseMetadata::end_time].
9268 ///
9269 /// # Example
9270 /// ```ignore,no_run
9271 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9272 /// use wkt::Timestamp;
9273 /// let x = CloneDatabaseMetadata::new().set_end_time(Timestamp::default()/* use setters */);
9274 /// ```
9275 pub fn set_end_time<T>(mut self, v: T) -> Self
9276 where
9277 T: std::convert::Into<wkt::Timestamp>,
9278 {
9279 self.end_time = std::option::Option::Some(v.into());
9280 self
9281 }
9282
9283 /// Sets or clears the value of [end_time][crate::model::CloneDatabaseMetadata::end_time].
9284 ///
9285 /// # Example
9286 /// ```ignore,no_run
9287 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9288 /// use wkt::Timestamp;
9289 /// let x = CloneDatabaseMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
9290 /// let x = CloneDatabaseMetadata::new().set_or_clear_end_time(None::<Timestamp>);
9291 /// ```
9292 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9293 where
9294 T: std::convert::Into<wkt::Timestamp>,
9295 {
9296 self.end_time = v.map(|x| x.into());
9297 self
9298 }
9299
9300 /// Sets the value of [operation_state][crate::model::CloneDatabaseMetadata::operation_state].
9301 ///
9302 /// # Example
9303 /// ```ignore,no_run
9304 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9305 /// use google_cloud_firestore_admin_v1::model::OperationState;
9306 /// let x0 = CloneDatabaseMetadata::new().set_operation_state(OperationState::Initializing);
9307 /// let x1 = CloneDatabaseMetadata::new().set_operation_state(OperationState::Processing);
9308 /// let x2 = CloneDatabaseMetadata::new().set_operation_state(OperationState::Cancelling);
9309 /// ```
9310 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
9311 mut self,
9312 v: T,
9313 ) -> Self {
9314 self.operation_state = v.into();
9315 self
9316 }
9317
9318 /// Sets the value of [database][crate::model::CloneDatabaseMetadata::database].
9319 ///
9320 /// # Example
9321 /// ```ignore,no_run
9322 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9323 /// let x = CloneDatabaseMetadata::new().set_database("example");
9324 /// ```
9325 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9326 self.database = v.into();
9327 self
9328 }
9329
9330 /// Sets the value of [pitr_snapshot][crate::model::CloneDatabaseMetadata::pitr_snapshot].
9331 ///
9332 /// # Example
9333 /// ```ignore,no_run
9334 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9335 /// use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9336 /// let x = CloneDatabaseMetadata::new().set_pitr_snapshot(PitrSnapshot::default()/* use setters */);
9337 /// ```
9338 pub fn set_pitr_snapshot<T>(mut self, v: T) -> Self
9339 where
9340 T: std::convert::Into<crate::model::PitrSnapshot>,
9341 {
9342 self.pitr_snapshot = std::option::Option::Some(v.into());
9343 self
9344 }
9345
9346 /// Sets or clears the value of [pitr_snapshot][crate::model::CloneDatabaseMetadata::pitr_snapshot].
9347 ///
9348 /// # Example
9349 /// ```ignore,no_run
9350 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9351 /// use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9352 /// let x = CloneDatabaseMetadata::new().set_or_clear_pitr_snapshot(Some(PitrSnapshot::default()/* use setters */));
9353 /// let x = CloneDatabaseMetadata::new().set_or_clear_pitr_snapshot(None::<PitrSnapshot>);
9354 /// ```
9355 pub fn set_or_clear_pitr_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
9356 where
9357 T: std::convert::Into<crate::model::PitrSnapshot>,
9358 {
9359 self.pitr_snapshot = v.map(|x| x.into());
9360 self
9361 }
9362
9363 /// Sets the value of [progress_percentage][crate::model::CloneDatabaseMetadata::progress_percentage].
9364 ///
9365 /// # Example
9366 /// ```ignore,no_run
9367 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9368 /// use google_cloud_firestore_admin_v1::model::Progress;
9369 /// let x = CloneDatabaseMetadata::new().set_progress_percentage(Progress::default()/* use setters */);
9370 /// ```
9371 pub fn set_progress_percentage<T>(mut self, v: T) -> Self
9372 where
9373 T: std::convert::Into<crate::model::Progress>,
9374 {
9375 self.progress_percentage = std::option::Option::Some(v.into());
9376 self
9377 }
9378
9379 /// Sets or clears the value of [progress_percentage][crate::model::CloneDatabaseMetadata::progress_percentage].
9380 ///
9381 /// # Example
9382 /// ```ignore,no_run
9383 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9384 /// use google_cloud_firestore_admin_v1::model::Progress;
9385 /// let x = CloneDatabaseMetadata::new().set_or_clear_progress_percentage(Some(Progress::default()/* use setters */));
9386 /// let x = CloneDatabaseMetadata::new().set_or_clear_progress_percentage(None::<Progress>);
9387 /// ```
9388 pub fn set_or_clear_progress_percentage<T>(mut self, v: std::option::Option<T>) -> Self
9389 where
9390 T: std::convert::Into<crate::model::Progress>,
9391 {
9392 self.progress_percentage = v.map(|x| x.into());
9393 self
9394 }
9395}
9396
9397impl wkt::message::Message for CloneDatabaseMetadata {
9398 fn typename() -> &'static str {
9399 "type.googleapis.com/google.firestore.admin.v1.CloneDatabaseMetadata"
9400 }
9401}
9402
9403/// Describes the progress of the operation.
9404/// Unit of work is generic and must be interpreted based on where
9405/// [Progress][google.firestore.admin.v1.Progress] is used.
9406///
9407/// [google.firestore.admin.v1.Progress]: crate::model::Progress
9408#[derive(Clone, Default, PartialEq)]
9409#[non_exhaustive]
9410pub struct Progress {
9411 /// The amount of work estimated.
9412 pub estimated_work: i64,
9413
9414 /// The amount of work completed.
9415 pub completed_work: i64,
9416
9417 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9418}
9419
9420impl Progress {
9421 pub fn new() -> Self {
9422 std::default::Default::default()
9423 }
9424
9425 /// Sets the value of [estimated_work][crate::model::Progress::estimated_work].
9426 ///
9427 /// # Example
9428 /// ```ignore,no_run
9429 /// # use google_cloud_firestore_admin_v1::model::Progress;
9430 /// let x = Progress::new().set_estimated_work(42);
9431 /// ```
9432 pub fn set_estimated_work<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9433 self.estimated_work = v.into();
9434 self
9435 }
9436
9437 /// Sets the value of [completed_work][crate::model::Progress::completed_work].
9438 ///
9439 /// # Example
9440 /// ```ignore,no_run
9441 /// # use google_cloud_firestore_admin_v1::model::Progress;
9442 /// let x = Progress::new().set_completed_work(42);
9443 /// ```
9444 pub fn set_completed_work<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9445 self.completed_work = v.into();
9446 self
9447 }
9448}
9449
9450impl wkt::message::Message for Progress {
9451 fn typename() -> &'static str {
9452 "type.googleapis.com/google.firestore.admin.v1.Progress"
9453 }
9454}
9455
9456/// A backup schedule for a Cloud Firestore Database.
9457///
9458/// This resource is owned by the database it is backing up, and is deleted along
9459/// with the database. The actual backups are not though.
9460#[derive(Clone, Default, PartialEq)]
9461#[non_exhaustive]
9462pub struct BackupSchedule {
9463 /// Output only. The unique backup schedule identifier across all locations and
9464 /// databases for the given project.
9465 ///
9466 /// This will be auto-assigned.
9467 ///
9468 /// Format is
9469 /// `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
9470 pub name: std::string::String,
9471
9472 /// Output only. The timestamp at which this backup schedule was created and
9473 /// effective since.
9474 ///
9475 /// No backups will be created for this schedule before this time.
9476 pub create_time: std::option::Option<wkt::Timestamp>,
9477
9478 /// Output only. The timestamp at which this backup schedule was most recently
9479 /// updated. When a backup schedule is first created, this is the same as
9480 /// create_time.
9481 pub update_time: std::option::Option<wkt::Timestamp>,
9482
9483 /// At what relative time in the future, compared to its creation time,
9484 /// the backup should be deleted, e.g. keep backups for 7 days.
9485 ///
9486 /// The maximum supported retention period is 14 weeks.
9487 pub retention: std::option::Option<wkt::Duration>,
9488
9489 /// A oneof field to represent when backups will be taken.
9490 pub recurrence: std::option::Option<crate::model::backup_schedule::Recurrence>,
9491
9492 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9493}
9494
9495impl BackupSchedule {
9496 pub fn new() -> Self {
9497 std::default::Default::default()
9498 }
9499
9500 /// Sets the value of [name][crate::model::BackupSchedule::name].
9501 ///
9502 /// # Example
9503 /// ```ignore,no_run
9504 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9505 /// let x = BackupSchedule::new().set_name("example");
9506 /// ```
9507 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9508 self.name = v.into();
9509 self
9510 }
9511
9512 /// Sets the value of [create_time][crate::model::BackupSchedule::create_time].
9513 ///
9514 /// # Example
9515 /// ```ignore,no_run
9516 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9517 /// use wkt::Timestamp;
9518 /// let x = BackupSchedule::new().set_create_time(Timestamp::default()/* use setters */);
9519 /// ```
9520 pub fn set_create_time<T>(mut self, v: T) -> Self
9521 where
9522 T: std::convert::Into<wkt::Timestamp>,
9523 {
9524 self.create_time = std::option::Option::Some(v.into());
9525 self
9526 }
9527
9528 /// Sets or clears the value of [create_time][crate::model::BackupSchedule::create_time].
9529 ///
9530 /// # Example
9531 /// ```ignore,no_run
9532 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9533 /// use wkt::Timestamp;
9534 /// let x = BackupSchedule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9535 /// let x = BackupSchedule::new().set_or_clear_create_time(None::<Timestamp>);
9536 /// ```
9537 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9538 where
9539 T: std::convert::Into<wkt::Timestamp>,
9540 {
9541 self.create_time = v.map(|x| x.into());
9542 self
9543 }
9544
9545 /// Sets the value of [update_time][crate::model::BackupSchedule::update_time].
9546 ///
9547 /// # Example
9548 /// ```ignore,no_run
9549 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9550 /// use wkt::Timestamp;
9551 /// let x = BackupSchedule::new().set_update_time(Timestamp::default()/* use setters */);
9552 /// ```
9553 pub fn set_update_time<T>(mut self, v: T) -> Self
9554 where
9555 T: std::convert::Into<wkt::Timestamp>,
9556 {
9557 self.update_time = std::option::Option::Some(v.into());
9558 self
9559 }
9560
9561 /// Sets or clears the value of [update_time][crate::model::BackupSchedule::update_time].
9562 ///
9563 /// # Example
9564 /// ```ignore,no_run
9565 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9566 /// use wkt::Timestamp;
9567 /// let x = BackupSchedule::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9568 /// let x = BackupSchedule::new().set_or_clear_update_time(None::<Timestamp>);
9569 /// ```
9570 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9571 where
9572 T: std::convert::Into<wkt::Timestamp>,
9573 {
9574 self.update_time = v.map(|x| x.into());
9575 self
9576 }
9577
9578 /// Sets the value of [retention][crate::model::BackupSchedule::retention].
9579 ///
9580 /// # Example
9581 /// ```ignore,no_run
9582 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9583 /// use wkt::Duration;
9584 /// let x = BackupSchedule::new().set_retention(Duration::default()/* use setters */);
9585 /// ```
9586 pub fn set_retention<T>(mut self, v: T) -> Self
9587 where
9588 T: std::convert::Into<wkt::Duration>,
9589 {
9590 self.retention = std::option::Option::Some(v.into());
9591 self
9592 }
9593
9594 /// Sets or clears the value of [retention][crate::model::BackupSchedule::retention].
9595 ///
9596 /// # Example
9597 /// ```ignore,no_run
9598 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9599 /// use wkt::Duration;
9600 /// let x = BackupSchedule::new().set_or_clear_retention(Some(Duration::default()/* use setters */));
9601 /// let x = BackupSchedule::new().set_or_clear_retention(None::<Duration>);
9602 /// ```
9603 pub fn set_or_clear_retention<T>(mut self, v: std::option::Option<T>) -> Self
9604 where
9605 T: std::convert::Into<wkt::Duration>,
9606 {
9607 self.retention = v.map(|x| x.into());
9608 self
9609 }
9610
9611 /// Sets the value of [recurrence][crate::model::BackupSchedule::recurrence].
9612 ///
9613 /// Note that all the setters affecting `recurrence` are mutually
9614 /// exclusive.
9615 ///
9616 /// # Example
9617 /// ```ignore,no_run
9618 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9619 /// use google_cloud_firestore_admin_v1::model::DailyRecurrence;
9620 /// let x = BackupSchedule::new().set_recurrence(Some(
9621 /// google_cloud_firestore_admin_v1::model::backup_schedule::Recurrence::DailyRecurrence(DailyRecurrence::default().into())));
9622 /// ```
9623 pub fn set_recurrence<
9624 T: std::convert::Into<std::option::Option<crate::model::backup_schedule::Recurrence>>,
9625 >(
9626 mut self,
9627 v: T,
9628 ) -> Self {
9629 self.recurrence = v.into();
9630 self
9631 }
9632
9633 /// The value of [recurrence][crate::model::BackupSchedule::recurrence]
9634 /// if it holds a `DailyRecurrence`, `None` if the field is not set or
9635 /// holds a different branch.
9636 pub fn daily_recurrence(
9637 &self,
9638 ) -> std::option::Option<&std::boxed::Box<crate::model::DailyRecurrence>> {
9639 #[allow(unreachable_patterns)]
9640 self.recurrence.as_ref().and_then(|v| match v {
9641 crate::model::backup_schedule::Recurrence::DailyRecurrence(v) => {
9642 std::option::Option::Some(v)
9643 }
9644 _ => std::option::Option::None,
9645 })
9646 }
9647
9648 /// Sets the value of [recurrence][crate::model::BackupSchedule::recurrence]
9649 /// to hold a `DailyRecurrence`.
9650 ///
9651 /// Note that all the setters affecting `recurrence` are
9652 /// mutually exclusive.
9653 ///
9654 /// # Example
9655 /// ```ignore,no_run
9656 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9657 /// use google_cloud_firestore_admin_v1::model::DailyRecurrence;
9658 /// let x = BackupSchedule::new().set_daily_recurrence(DailyRecurrence::default()/* use setters */);
9659 /// assert!(x.daily_recurrence().is_some());
9660 /// assert!(x.weekly_recurrence().is_none());
9661 /// ```
9662 pub fn set_daily_recurrence<
9663 T: std::convert::Into<std::boxed::Box<crate::model::DailyRecurrence>>,
9664 >(
9665 mut self,
9666 v: T,
9667 ) -> Self {
9668 self.recurrence = std::option::Option::Some(
9669 crate::model::backup_schedule::Recurrence::DailyRecurrence(v.into()),
9670 );
9671 self
9672 }
9673
9674 /// The value of [recurrence][crate::model::BackupSchedule::recurrence]
9675 /// if it holds a `WeeklyRecurrence`, `None` if the field is not set or
9676 /// holds a different branch.
9677 pub fn weekly_recurrence(
9678 &self,
9679 ) -> std::option::Option<&std::boxed::Box<crate::model::WeeklyRecurrence>> {
9680 #[allow(unreachable_patterns)]
9681 self.recurrence.as_ref().and_then(|v| match v {
9682 crate::model::backup_schedule::Recurrence::WeeklyRecurrence(v) => {
9683 std::option::Option::Some(v)
9684 }
9685 _ => std::option::Option::None,
9686 })
9687 }
9688
9689 /// Sets the value of [recurrence][crate::model::BackupSchedule::recurrence]
9690 /// to hold a `WeeklyRecurrence`.
9691 ///
9692 /// Note that all the setters affecting `recurrence` are
9693 /// mutually exclusive.
9694 ///
9695 /// # Example
9696 /// ```ignore,no_run
9697 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9698 /// use google_cloud_firestore_admin_v1::model::WeeklyRecurrence;
9699 /// let x = BackupSchedule::new().set_weekly_recurrence(WeeklyRecurrence::default()/* use setters */);
9700 /// assert!(x.weekly_recurrence().is_some());
9701 /// assert!(x.daily_recurrence().is_none());
9702 /// ```
9703 pub fn set_weekly_recurrence<
9704 T: std::convert::Into<std::boxed::Box<crate::model::WeeklyRecurrence>>,
9705 >(
9706 mut self,
9707 v: T,
9708 ) -> Self {
9709 self.recurrence = std::option::Option::Some(
9710 crate::model::backup_schedule::Recurrence::WeeklyRecurrence(v.into()),
9711 );
9712 self
9713 }
9714}
9715
9716impl wkt::message::Message for BackupSchedule {
9717 fn typename() -> &'static str {
9718 "type.googleapis.com/google.firestore.admin.v1.BackupSchedule"
9719 }
9720}
9721
9722/// Defines additional types related to [BackupSchedule].
9723pub mod backup_schedule {
9724 #[allow(unused_imports)]
9725 use super::*;
9726
9727 /// A oneof field to represent when backups will be taken.
9728 #[derive(Clone, Debug, PartialEq)]
9729 #[non_exhaustive]
9730 pub enum Recurrence {
9731 /// For a schedule that runs daily.
9732 DailyRecurrence(std::boxed::Box<crate::model::DailyRecurrence>),
9733 /// For a schedule that runs weekly on a specific day.
9734 WeeklyRecurrence(std::boxed::Box<crate::model::WeeklyRecurrence>),
9735 }
9736}
9737
9738/// Represents a recurring schedule that runs every day.
9739///
9740/// The time zone is UTC.
9741#[derive(Clone, Default, PartialEq)]
9742#[non_exhaustive]
9743pub struct DailyRecurrence {
9744 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9745}
9746
9747impl DailyRecurrence {
9748 pub fn new() -> Self {
9749 std::default::Default::default()
9750 }
9751}
9752
9753impl wkt::message::Message for DailyRecurrence {
9754 fn typename() -> &'static str {
9755 "type.googleapis.com/google.firestore.admin.v1.DailyRecurrence"
9756 }
9757}
9758
9759/// Represents a recurring schedule that runs on a specified day of the week.
9760///
9761/// The time zone is UTC.
9762#[derive(Clone, Default, PartialEq)]
9763#[non_exhaustive]
9764pub struct WeeklyRecurrence {
9765 /// The day of week to run.
9766 ///
9767 /// DAY_OF_WEEK_UNSPECIFIED is not allowed.
9768 pub day: google_cloud_type::model::DayOfWeek,
9769
9770 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9771}
9772
9773impl WeeklyRecurrence {
9774 pub fn new() -> Self {
9775 std::default::Default::default()
9776 }
9777
9778 /// Sets the value of [day][crate::model::WeeklyRecurrence::day].
9779 ///
9780 /// # Example
9781 /// ```ignore,no_run
9782 /// # use google_cloud_firestore_admin_v1::model::WeeklyRecurrence;
9783 /// use google_cloud_type::model::DayOfWeek;
9784 /// let x0 = WeeklyRecurrence::new().set_day(DayOfWeek::Monday);
9785 /// let x1 = WeeklyRecurrence::new().set_day(DayOfWeek::Tuesday);
9786 /// let x2 = WeeklyRecurrence::new().set_day(DayOfWeek::Wednesday);
9787 /// ```
9788 pub fn set_day<T: std::convert::Into<google_cloud_type::model::DayOfWeek>>(
9789 mut self,
9790 v: T,
9791 ) -> Self {
9792 self.day = v.into();
9793 self
9794 }
9795}
9796
9797impl wkt::message::Message for WeeklyRecurrence {
9798 fn typename() -> &'static str {
9799 "type.googleapis.com/google.firestore.admin.v1.WeeklyRecurrence"
9800 }
9801}
9802
9803/// A consistent snapshot of a database at a specific point in time.
9804/// A PITR (Point-in-time recovery) snapshot with previous versions of a
9805/// database's data is available for every minute up to the associated database's
9806/// data retention period. If the PITR feature is enabled, the retention period
9807/// is 7 days; otherwise, it is one hour.
9808#[derive(Clone, Default, PartialEq)]
9809#[non_exhaustive]
9810pub struct PitrSnapshot {
9811 /// Required. The name of the database that this was a snapshot of. Format:
9812 /// `projects/{project}/databases/{database}`.
9813 pub database: std::string::String,
9814
9815 /// Output only. Public UUID of the database the snapshot was associated with.
9816 pub database_uid: ::bytes::Bytes,
9817
9818 /// Required. Snapshot time of the database.
9819 pub snapshot_time: std::option::Option<wkt::Timestamp>,
9820
9821 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9822}
9823
9824impl PitrSnapshot {
9825 pub fn new() -> Self {
9826 std::default::Default::default()
9827 }
9828
9829 /// Sets the value of [database][crate::model::PitrSnapshot::database].
9830 ///
9831 /// # Example
9832 /// ```ignore,no_run
9833 /// # use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9834 /// let x = PitrSnapshot::new().set_database("example");
9835 /// ```
9836 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9837 self.database = v.into();
9838 self
9839 }
9840
9841 /// Sets the value of [database_uid][crate::model::PitrSnapshot::database_uid].
9842 ///
9843 /// # Example
9844 /// ```ignore,no_run
9845 /// # use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9846 /// let x = PitrSnapshot::new().set_database_uid(bytes::Bytes::from_static(b"example"));
9847 /// ```
9848 pub fn set_database_uid<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
9849 self.database_uid = v.into();
9850 self
9851 }
9852
9853 /// Sets the value of [snapshot_time][crate::model::PitrSnapshot::snapshot_time].
9854 ///
9855 /// # Example
9856 /// ```ignore,no_run
9857 /// # use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9858 /// use wkt::Timestamp;
9859 /// let x = PitrSnapshot::new().set_snapshot_time(Timestamp::default()/* use setters */);
9860 /// ```
9861 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
9862 where
9863 T: std::convert::Into<wkt::Timestamp>,
9864 {
9865 self.snapshot_time = std::option::Option::Some(v.into());
9866 self
9867 }
9868
9869 /// Sets or clears the value of [snapshot_time][crate::model::PitrSnapshot::snapshot_time].
9870 ///
9871 /// # Example
9872 /// ```ignore,no_run
9873 /// # use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9874 /// use wkt::Timestamp;
9875 /// let x = PitrSnapshot::new().set_or_clear_snapshot_time(Some(Timestamp::default()/* use setters */));
9876 /// let x = PitrSnapshot::new().set_or_clear_snapshot_time(None::<Timestamp>);
9877 /// ```
9878 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
9879 where
9880 T: std::convert::Into<wkt::Timestamp>,
9881 {
9882 self.snapshot_time = v.map(|x| x.into());
9883 self
9884 }
9885}
9886
9887impl wkt::message::Message for PitrSnapshot {
9888 fn typename() -> &'static str {
9889 "type.googleapis.com/google.firestore.admin.v1.PitrSnapshot"
9890 }
9891}
9892
9893/// A Cloud Firestore User Creds.
9894#[derive(Clone, Default, PartialEq)]
9895#[non_exhaustive]
9896pub struct UserCreds {
9897 /// Identifier. The resource name of the UserCreds.
9898 /// Format:
9899 /// `projects/{project}/databases/{database}/userCreds/{user_creds}`
9900 pub name: std::string::String,
9901
9902 /// Output only. The time the user creds were created.
9903 pub create_time: std::option::Option<wkt::Timestamp>,
9904
9905 /// Output only. The time the user creds were last updated.
9906 pub update_time: std::option::Option<wkt::Timestamp>,
9907
9908 /// Output only. Whether the user creds are enabled or disabled. Defaults to
9909 /// ENABLED on creation.
9910 pub state: crate::model::user_creds::State,
9911
9912 /// Output only. The plaintext server-generated password for the user creds.
9913 /// Only populated in responses for CreateUserCreds and ResetUserPassword.
9914 pub secure_password: std::string::String,
9915
9916 /// Identity associated with this User Creds.
9917 pub user_creds_identity: std::option::Option<crate::model::user_creds::UserCredsIdentity>,
9918
9919 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9920}
9921
9922impl UserCreds {
9923 pub fn new() -> Self {
9924 std::default::Default::default()
9925 }
9926
9927 /// Sets the value of [name][crate::model::UserCreds::name].
9928 ///
9929 /// # Example
9930 /// ```ignore,no_run
9931 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
9932 /// let x = UserCreds::new().set_name("example");
9933 /// ```
9934 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9935 self.name = v.into();
9936 self
9937 }
9938
9939 /// Sets the value of [create_time][crate::model::UserCreds::create_time].
9940 ///
9941 /// # Example
9942 /// ```ignore,no_run
9943 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
9944 /// use wkt::Timestamp;
9945 /// let x = UserCreds::new().set_create_time(Timestamp::default()/* use setters */);
9946 /// ```
9947 pub fn set_create_time<T>(mut self, v: T) -> Self
9948 where
9949 T: std::convert::Into<wkt::Timestamp>,
9950 {
9951 self.create_time = std::option::Option::Some(v.into());
9952 self
9953 }
9954
9955 /// Sets or clears the value of [create_time][crate::model::UserCreds::create_time].
9956 ///
9957 /// # Example
9958 /// ```ignore,no_run
9959 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
9960 /// use wkt::Timestamp;
9961 /// let x = UserCreds::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9962 /// let x = UserCreds::new().set_or_clear_create_time(None::<Timestamp>);
9963 /// ```
9964 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9965 where
9966 T: std::convert::Into<wkt::Timestamp>,
9967 {
9968 self.create_time = v.map(|x| x.into());
9969 self
9970 }
9971
9972 /// Sets the value of [update_time][crate::model::UserCreds::update_time].
9973 ///
9974 /// # Example
9975 /// ```ignore,no_run
9976 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
9977 /// use wkt::Timestamp;
9978 /// let x = UserCreds::new().set_update_time(Timestamp::default()/* use setters */);
9979 /// ```
9980 pub fn set_update_time<T>(mut self, v: T) -> Self
9981 where
9982 T: std::convert::Into<wkt::Timestamp>,
9983 {
9984 self.update_time = std::option::Option::Some(v.into());
9985 self
9986 }
9987
9988 /// Sets or clears the value of [update_time][crate::model::UserCreds::update_time].
9989 ///
9990 /// # Example
9991 /// ```ignore,no_run
9992 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
9993 /// use wkt::Timestamp;
9994 /// let x = UserCreds::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9995 /// let x = UserCreds::new().set_or_clear_update_time(None::<Timestamp>);
9996 /// ```
9997 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9998 where
9999 T: std::convert::Into<wkt::Timestamp>,
10000 {
10001 self.update_time = v.map(|x| x.into());
10002 self
10003 }
10004
10005 /// Sets the value of [state][crate::model::UserCreds::state].
10006 ///
10007 /// # Example
10008 /// ```ignore,no_run
10009 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
10010 /// use google_cloud_firestore_admin_v1::model::user_creds::State;
10011 /// let x0 = UserCreds::new().set_state(State::Enabled);
10012 /// let x1 = UserCreds::new().set_state(State::Disabled);
10013 /// ```
10014 pub fn set_state<T: std::convert::Into<crate::model::user_creds::State>>(
10015 mut self,
10016 v: T,
10017 ) -> Self {
10018 self.state = v.into();
10019 self
10020 }
10021
10022 /// Sets the value of [secure_password][crate::model::UserCreds::secure_password].
10023 ///
10024 /// # Example
10025 /// ```ignore,no_run
10026 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
10027 /// let x = UserCreds::new().set_secure_password("example");
10028 /// ```
10029 pub fn set_secure_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10030 self.secure_password = v.into();
10031 self
10032 }
10033
10034 /// Sets the value of [user_creds_identity][crate::model::UserCreds::user_creds_identity].
10035 ///
10036 /// Note that all the setters affecting `user_creds_identity` are mutually
10037 /// exclusive.
10038 ///
10039 /// # Example
10040 /// ```ignore,no_run
10041 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
10042 /// use google_cloud_firestore_admin_v1::model::user_creds::ResourceIdentity;
10043 /// let x = UserCreds::new().set_user_creds_identity(Some(
10044 /// google_cloud_firestore_admin_v1::model::user_creds::UserCredsIdentity::ResourceIdentity(ResourceIdentity::default().into())));
10045 /// ```
10046 pub fn set_user_creds_identity<
10047 T: std::convert::Into<std::option::Option<crate::model::user_creds::UserCredsIdentity>>,
10048 >(
10049 mut self,
10050 v: T,
10051 ) -> Self {
10052 self.user_creds_identity = v.into();
10053 self
10054 }
10055
10056 /// The value of [user_creds_identity][crate::model::UserCreds::user_creds_identity]
10057 /// if it holds a `ResourceIdentity`, `None` if the field is not set or
10058 /// holds a different branch.
10059 pub fn resource_identity(
10060 &self,
10061 ) -> std::option::Option<&std::boxed::Box<crate::model::user_creds::ResourceIdentity>> {
10062 #[allow(unreachable_patterns)]
10063 self.user_creds_identity.as_ref().and_then(|v| match v {
10064 crate::model::user_creds::UserCredsIdentity::ResourceIdentity(v) => {
10065 std::option::Option::Some(v)
10066 }
10067 _ => std::option::Option::None,
10068 })
10069 }
10070
10071 /// Sets the value of [user_creds_identity][crate::model::UserCreds::user_creds_identity]
10072 /// to hold a `ResourceIdentity`.
10073 ///
10074 /// Note that all the setters affecting `user_creds_identity` are
10075 /// mutually exclusive.
10076 ///
10077 /// # Example
10078 /// ```ignore,no_run
10079 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
10080 /// use google_cloud_firestore_admin_v1::model::user_creds::ResourceIdentity;
10081 /// let x = UserCreds::new().set_resource_identity(ResourceIdentity::default()/* use setters */);
10082 /// assert!(x.resource_identity().is_some());
10083 /// ```
10084 pub fn set_resource_identity<
10085 T: std::convert::Into<std::boxed::Box<crate::model::user_creds::ResourceIdentity>>,
10086 >(
10087 mut self,
10088 v: T,
10089 ) -> Self {
10090 self.user_creds_identity = std::option::Option::Some(
10091 crate::model::user_creds::UserCredsIdentity::ResourceIdentity(v.into()),
10092 );
10093 self
10094 }
10095}
10096
10097impl wkt::message::Message for UserCreds {
10098 fn typename() -> &'static str {
10099 "type.googleapis.com/google.firestore.admin.v1.UserCreds"
10100 }
10101}
10102
10103/// Defines additional types related to [UserCreds].
10104pub mod user_creds {
10105 #[allow(unused_imports)]
10106 use super::*;
10107
10108 /// Describes a Resource Identity principal.
10109 #[derive(Clone, Default, PartialEq)]
10110 #[non_exhaustive]
10111 pub struct ResourceIdentity {
10112 /// Output only. Principal identifier string.
10113 /// See: <https://cloud.google.com/iam/docs/principal-identifiers>
10114 pub principal: std::string::String,
10115
10116 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10117 }
10118
10119 impl ResourceIdentity {
10120 pub fn new() -> Self {
10121 std::default::Default::default()
10122 }
10123
10124 /// Sets the value of [principal][crate::model::user_creds::ResourceIdentity::principal].
10125 ///
10126 /// # Example
10127 /// ```ignore,no_run
10128 /// # use google_cloud_firestore_admin_v1::model::user_creds::ResourceIdentity;
10129 /// let x = ResourceIdentity::new().set_principal("example");
10130 /// ```
10131 pub fn set_principal<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10132 self.principal = v.into();
10133 self
10134 }
10135 }
10136
10137 impl wkt::message::Message for ResourceIdentity {
10138 fn typename() -> &'static str {
10139 "type.googleapis.com/google.firestore.admin.v1.UserCreds.ResourceIdentity"
10140 }
10141 }
10142
10143 /// The state of the user creds (ENABLED or DISABLED).
10144 ///
10145 /// # Working with unknown values
10146 ///
10147 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10148 /// additional enum variants at any time. Adding new variants is not considered
10149 /// a breaking change. Applications should write their code in anticipation of:
10150 ///
10151 /// - New values appearing in future releases of the client library, **and**
10152 /// - New values received dynamically, without application changes.
10153 ///
10154 /// Please consult the [Working with enums] section in the user guide for some
10155 /// guidelines.
10156 ///
10157 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10158 #[derive(Clone, Debug, PartialEq)]
10159 #[non_exhaustive]
10160 pub enum State {
10161 /// The default value. Should not be used.
10162 Unspecified,
10163 /// The user creds are enabled.
10164 Enabled,
10165 /// The user creds are disabled.
10166 Disabled,
10167 /// If set, the enum was initialized with an unknown value.
10168 ///
10169 /// Applications can examine the value using [State::value] or
10170 /// [State::name].
10171 UnknownValue(state::UnknownValue),
10172 }
10173
10174 #[doc(hidden)]
10175 pub mod state {
10176 #[allow(unused_imports)]
10177 use super::*;
10178 #[derive(Clone, Debug, PartialEq)]
10179 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10180 }
10181
10182 impl State {
10183 /// Gets the enum value.
10184 ///
10185 /// Returns `None` if the enum contains an unknown value deserialized from
10186 /// the string representation of enums.
10187 pub fn value(&self) -> std::option::Option<i32> {
10188 match self {
10189 Self::Unspecified => std::option::Option::Some(0),
10190 Self::Enabled => std::option::Option::Some(1),
10191 Self::Disabled => std::option::Option::Some(2),
10192 Self::UnknownValue(u) => u.0.value(),
10193 }
10194 }
10195
10196 /// Gets the enum value as a string.
10197 ///
10198 /// Returns `None` if the enum contains an unknown value deserialized from
10199 /// the integer representation of enums.
10200 pub fn name(&self) -> std::option::Option<&str> {
10201 match self {
10202 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10203 Self::Enabled => std::option::Option::Some("ENABLED"),
10204 Self::Disabled => std::option::Option::Some("DISABLED"),
10205 Self::UnknownValue(u) => u.0.name(),
10206 }
10207 }
10208 }
10209
10210 impl std::default::Default for State {
10211 fn default() -> Self {
10212 use std::convert::From;
10213 Self::from(0)
10214 }
10215 }
10216
10217 impl std::fmt::Display for State {
10218 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10219 wkt::internal::display_enum(f, self.name(), self.value())
10220 }
10221 }
10222
10223 impl std::convert::From<i32> for State {
10224 fn from(value: i32) -> Self {
10225 match value {
10226 0 => Self::Unspecified,
10227 1 => Self::Enabled,
10228 2 => Self::Disabled,
10229 _ => Self::UnknownValue(state::UnknownValue(
10230 wkt::internal::UnknownEnumValue::Integer(value),
10231 )),
10232 }
10233 }
10234 }
10235
10236 impl std::convert::From<&str> for State {
10237 fn from(value: &str) -> Self {
10238 use std::string::ToString;
10239 match value {
10240 "STATE_UNSPECIFIED" => Self::Unspecified,
10241 "ENABLED" => Self::Enabled,
10242 "DISABLED" => Self::Disabled,
10243 _ => Self::UnknownValue(state::UnknownValue(
10244 wkt::internal::UnknownEnumValue::String(value.to_string()),
10245 )),
10246 }
10247 }
10248 }
10249
10250 impl serde::ser::Serialize for State {
10251 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10252 where
10253 S: serde::Serializer,
10254 {
10255 match self {
10256 Self::Unspecified => serializer.serialize_i32(0),
10257 Self::Enabled => serializer.serialize_i32(1),
10258 Self::Disabled => serializer.serialize_i32(2),
10259 Self::UnknownValue(u) => u.0.serialize(serializer),
10260 }
10261 }
10262 }
10263
10264 impl<'de> serde::de::Deserialize<'de> for State {
10265 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10266 where
10267 D: serde::Deserializer<'de>,
10268 {
10269 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10270 ".google.firestore.admin.v1.UserCreds.State",
10271 ))
10272 }
10273 }
10274
10275 /// Identity associated with this User Creds.
10276 #[derive(Clone, Debug, PartialEq)]
10277 #[non_exhaustive]
10278 pub enum UserCredsIdentity {
10279 /// Resource Identity descriptor.
10280 ResourceIdentity(std::boxed::Box<crate::model::user_creds::ResourceIdentity>),
10281 }
10282}
10283
10284/// Describes the state of the operation.
10285///
10286/// # Working with unknown values
10287///
10288/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10289/// additional enum variants at any time. Adding new variants is not considered
10290/// a breaking change. Applications should write their code in anticipation of:
10291///
10292/// - New values appearing in future releases of the client library, **and**
10293/// - New values received dynamically, without application changes.
10294///
10295/// Please consult the [Working with enums] section in the user guide for some
10296/// guidelines.
10297///
10298/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10299#[derive(Clone, Debug, PartialEq)]
10300#[non_exhaustive]
10301pub enum OperationState {
10302 /// Unspecified.
10303 Unspecified,
10304 /// Request is being prepared for processing.
10305 Initializing,
10306 /// Request is actively being processed.
10307 Processing,
10308 /// Request is in the process of being cancelled after user called
10309 /// google.longrunning.Operations.CancelOperation on the operation.
10310 Cancelling,
10311 /// Request has been processed and is in its finalization stage.
10312 Finalizing,
10313 /// Request has completed successfully.
10314 Successful,
10315 /// Request has finished being processed, but encountered an error.
10316 Failed,
10317 /// Request has finished being cancelled after user called
10318 /// google.longrunning.Operations.CancelOperation.
10319 Cancelled,
10320 /// If set, the enum was initialized with an unknown value.
10321 ///
10322 /// Applications can examine the value using [OperationState::value] or
10323 /// [OperationState::name].
10324 UnknownValue(operation_state::UnknownValue),
10325}
10326
10327#[doc(hidden)]
10328pub mod operation_state {
10329 #[allow(unused_imports)]
10330 use super::*;
10331 #[derive(Clone, Debug, PartialEq)]
10332 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10333}
10334
10335impl OperationState {
10336 /// Gets the enum value.
10337 ///
10338 /// Returns `None` if the enum contains an unknown value deserialized from
10339 /// the string representation of enums.
10340 pub fn value(&self) -> std::option::Option<i32> {
10341 match self {
10342 Self::Unspecified => std::option::Option::Some(0),
10343 Self::Initializing => std::option::Option::Some(1),
10344 Self::Processing => std::option::Option::Some(2),
10345 Self::Cancelling => std::option::Option::Some(3),
10346 Self::Finalizing => std::option::Option::Some(4),
10347 Self::Successful => std::option::Option::Some(5),
10348 Self::Failed => std::option::Option::Some(6),
10349 Self::Cancelled => std::option::Option::Some(7),
10350 Self::UnknownValue(u) => u.0.value(),
10351 }
10352 }
10353
10354 /// Gets the enum value as a string.
10355 ///
10356 /// Returns `None` if the enum contains an unknown value deserialized from
10357 /// the integer representation of enums.
10358 pub fn name(&self) -> std::option::Option<&str> {
10359 match self {
10360 Self::Unspecified => std::option::Option::Some("OPERATION_STATE_UNSPECIFIED"),
10361 Self::Initializing => std::option::Option::Some("INITIALIZING"),
10362 Self::Processing => std::option::Option::Some("PROCESSING"),
10363 Self::Cancelling => std::option::Option::Some("CANCELLING"),
10364 Self::Finalizing => std::option::Option::Some("FINALIZING"),
10365 Self::Successful => std::option::Option::Some("SUCCESSFUL"),
10366 Self::Failed => std::option::Option::Some("FAILED"),
10367 Self::Cancelled => std::option::Option::Some("CANCELLED"),
10368 Self::UnknownValue(u) => u.0.name(),
10369 }
10370 }
10371}
10372
10373impl std::default::Default for OperationState {
10374 fn default() -> Self {
10375 use std::convert::From;
10376 Self::from(0)
10377 }
10378}
10379
10380impl std::fmt::Display for OperationState {
10381 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10382 wkt::internal::display_enum(f, self.name(), self.value())
10383 }
10384}
10385
10386impl std::convert::From<i32> for OperationState {
10387 fn from(value: i32) -> Self {
10388 match value {
10389 0 => Self::Unspecified,
10390 1 => Self::Initializing,
10391 2 => Self::Processing,
10392 3 => Self::Cancelling,
10393 4 => Self::Finalizing,
10394 5 => Self::Successful,
10395 6 => Self::Failed,
10396 7 => Self::Cancelled,
10397 _ => Self::UnknownValue(operation_state::UnknownValue(
10398 wkt::internal::UnknownEnumValue::Integer(value),
10399 )),
10400 }
10401 }
10402}
10403
10404impl std::convert::From<&str> for OperationState {
10405 fn from(value: &str) -> Self {
10406 use std::string::ToString;
10407 match value {
10408 "OPERATION_STATE_UNSPECIFIED" => Self::Unspecified,
10409 "INITIALIZING" => Self::Initializing,
10410 "PROCESSING" => Self::Processing,
10411 "CANCELLING" => Self::Cancelling,
10412 "FINALIZING" => Self::Finalizing,
10413 "SUCCESSFUL" => Self::Successful,
10414 "FAILED" => Self::Failed,
10415 "CANCELLED" => Self::Cancelled,
10416 _ => Self::UnknownValue(operation_state::UnknownValue(
10417 wkt::internal::UnknownEnumValue::String(value.to_string()),
10418 )),
10419 }
10420 }
10421}
10422
10423impl serde::ser::Serialize for OperationState {
10424 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10425 where
10426 S: serde::Serializer,
10427 {
10428 match self {
10429 Self::Unspecified => serializer.serialize_i32(0),
10430 Self::Initializing => serializer.serialize_i32(1),
10431 Self::Processing => serializer.serialize_i32(2),
10432 Self::Cancelling => serializer.serialize_i32(3),
10433 Self::Finalizing => serializer.serialize_i32(4),
10434 Self::Successful => serializer.serialize_i32(5),
10435 Self::Failed => serializer.serialize_i32(6),
10436 Self::Cancelled => serializer.serialize_i32(7),
10437 Self::UnknownValue(u) => u.0.serialize(serializer),
10438 }
10439 }
10440}
10441
10442impl<'de> serde::de::Deserialize<'de> for OperationState {
10443 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10444 where
10445 D: serde::Deserializer<'de>,
10446 {
10447 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationState>::new(
10448 ".google.firestore.admin.v1.OperationState",
10449 ))
10450 }
10451}
10452
10453/// The Realtime Updates mode.
10454///
10455/// # Working with unknown values
10456///
10457/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10458/// additional enum variants at any time. Adding new variants is not considered
10459/// a breaking change. Applications should write their code in anticipation of:
10460///
10461/// - New values appearing in future releases of the client library, **and**
10462/// - New values received dynamically, without application changes.
10463///
10464/// Please consult the [Working with enums] section in the user guide for some
10465/// guidelines.
10466///
10467/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10468#[derive(Clone, Debug, PartialEq)]
10469#[non_exhaustive]
10470pub enum RealtimeUpdatesMode {
10471 /// The Realtime Updates feature is not specified.
10472 Unspecified,
10473 /// The Realtime Updates feature is enabled by default.
10474 ///
10475 /// This could potentially degrade write performance for the database.
10476 Enabled,
10477 /// The Realtime Updates feature is disabled by default.
10478 Disabled,
10479 /// If set, the enum was initialized with an unknown value.
10480 ///
10481 /// Applications can examine the value using [RealtimeUpdatesMode::value] or
10482 /// [RealtimeUpdatesMode::name].
10483 UnknownValue(realtime_updates_mode::UnknownValue),
10484}
10485
10486#[doc(hidden)]
10487pub mod realtime_updates_mode {
10488 #[allow(unused_imports)]
10489 use super::*;
10490 #[derive(Clone, Debug, PartialEq)]
10491 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10492}
10493
10494impl RealtimeUpdatesMode {
10495 /// Gets the enum value.
10496 ///
10497 /// Returns `None` if the enum contains an unknown value deserialized from
10498 /// the string representation of enums.
10499 pub fn value(&self) -> std::option::Option<i32> {
10500 match self {
10501 Self::Unspecified => std::option::Option::Some(0),
10502 Self::Enabled => std::option::Option::Some(1),
10503 Self::Disabled => std::option::Option::Some(2),
10504 Self::UnknownValue(u) => u.0.value(),
10505 }
10506 }
10507
10508 /// Gets the enum value as a string.
10509 ///
10510 /// Returns `None` if the enum contains an unknown value deserialized from
10511 /// the integer representation of enums.
10512 pub fn name(&self) -> std::option::Option<&str> {
10513 match self {
10514 Self::Unspecified => std::option::Option::Some("REALTIME_UPDATES_MODE_UNSPECIFIED"),
10515 Self::Enabled => std::option::Option::Some("REALTIME_UPDATES_MODE_ENABLED"),
10516 Self::Disabled => std::option::Option::Some("REALTIME_UPDATES_MODE_DISABLED"),
10517 Self::UnknownValue(u) => u.0.name(),
10518 }
10519 }
10520}
10521
10522impl std::default::Default for RealtimeUpdatesMode {
10523 fn default() -> Self {
10524 use std::convert::From;
10525 Self::from(0)
10526 }
10527}
10528
10529impl std::fmt::Display for RealtimeUpdatesMode {
10530 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10531 wkt::internal::display_enum(f, self.name(), self.value())
10532 }
10533}
10534
10535impl std::convert::From<i32> for RealtimeUpdatesMode {
10536 fn from(value: i32) -> Self {
10537 match value {
10538 0 => Self::Unspecified,
10539 1 => Self::Enabled,
10540 2 => Self::Disabled,
10541 _ => Self::UnknownValue(realtime_updates_mode::UnknownValue(
10542 wkt::internal::UnknownEnumValue::Integer(value),
10543 )),
10544 }
10545 }
10546}
10547
10548impl std::convert::From<&str> for RealtimeUpdatesMode {
10549 fn from(value: &str) -> Self {
10550 use std::string::ToString;
10551 match value {
10552 "REALTIME_UPDATES_MODE_UNSPECIFIED" => Self::Unspecified,
10553 "REALTIME_UPDATES_MODE_ENABLED" => Self::Enabled,
10554 "REALTIME_UPDATES_MODE_DISABLED" => Self::Disabled,
10555 _ => Self::UnknownValue(realtime_updates_mode::UnknownValue(
10556 wkt::internal::UnknownEnumValue::String(value.to_string()),
10557 )),
10558 }
10559 }
10560}
10561
10562impl serde::ser::Serialize for RealtimeUpdatesMode {
10563 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10564 where
10565 S: serde::Serializer,
10566 {
10567 match self {
10568 Self::Unspecified => serializer.serialize_i32(0),
10569 Self::Enabled => serializer.serialize_i32(1),
10570 Self::Disabled => serializer.serialize_i32(2),
10571 Self::UnknownValue(u) => u.0.serialize(serializer),
10572 }
10573 }
10574}
10575
10576impl<'de> serde::de::Deserialize<'de> for RealtimeUpdatesMode {
10577 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10578 where
10579 D: serde::Deserializer<'de>,
10580 {
10581 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RealtimeUpdatesMode>::new(
10582 ".google.firestore.admin.v1.RealtimeUpdatesMode",
10583 ))
10584 }
10585}