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 gax;
23extern crate gaxi;
24extern crate gtype;
25extern crate lazy_static;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// A Backup of a Cloud Firestore Database.
41///
42/// The backup contains all documents and index configurations for the given
43/// database at a specific point in time.
44#[derive(Clone, Default, PartialEq)]
45#[non_exhaustive]
46pub struct Backup {
47 /// Output only. The unique resource name of the Backup.
48 ///
49 /// Format is `projects/{project}/locations/{location}/backups/{backup}`.
50 pub name: std::string::String,
51
52 /// Output only. Name of the Firestore database that the backup is from.
53 ///
54 /// Format is `projects/{project}/databases/{database}`.
55 pub database: std::string::String,
56
57 /// Output only. The system-generated UUID4 for the Firestore database that the
58 /// backup is from.
59 pub database_uid: std::string::String,
60
61 /// Output only. The backup contains an externally consistent copy of the
62 /// database at this time.
63 pub snapshot_time: std::option::Option<wkt::Timestamp>,
64
65 /// Output only. The timestamp at which this backup expires.
66 pub expire_time: std::option::Option<wkt::Timestamp>,
67
68 /// Output only. Statistics about the backup.
69 ///
70 /// This data only becomes available after the backup is fully materialized to
71 /// secondary storage. This field will be empty till then.
72 pub stats: std::option::Option<crate::model::backup::Stats>,
73
74 /// Output only. The current state of the backup.
75 pub state: crate::model::backup::State,
76
77 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
78}
79
80impl Backup {
81 pub fn new() -> Self {
82 std::default::Default::default()
83 }
84
85 /// Sets the value of [name][crate::model::Backup::name].
86 ///
87 /// # Example
88 /// ```ignore,no_run
89 /// # use google_cloud_firestore_admin_v1::model::Backup;
90 /// let x = Backup::new().set_name("example");
91 /// ```
92 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
93 self.name = v.into();
94 self
95 }
96
97 /// Sets the value of [database][crate::model::Backup::database].
98 ///
99 /// # Example
100 /// ```ignore,no_run
101 /// # use google_cloud_firestore_admin_v1::model::Backup;
102 /// let x = Backup::new().set_database("example");
103 /// ```
104 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
105 self.database = v.into();
106 self
107 }
108
109 /// Sets the value of [database_uid][crate::model::Backup::database_uid].
110 ///
111 /// # Example
112 /// ```ignore,no_run
113 /// # use google_cloud_firestore_admin_v1::model::Backup;
114 /// let x = Backup::new().set_database_uid("example");
115 /// ```
116 pub fn set_database_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
117 self.database_uid = v.into();
118 self
119 }
120
121 /// Sets the value of [snapshot_time][crate::model::Backup::snapshot_time].
122 ///
123 /// # Example
124 /// ```ignore,no_run
125 /// # use google_cloud_firestore_admin_v1::model::Backup;
126 /// use wkt::Timestamp;
127 /// let x = Backup::new().set_snapshot_time(Timestamp::default()/* use setters */);
128 /// ```
129 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
130 where
131 T: std::convert::Into<wkt::Timestamp>,
132 {
133 self.snapshot_time = std::option::Option::Some(v.into());
134 self
135 }
136
137 /// Sets or clears the value of [snapshot_time][crate::model::Backup::snapshot_time].
138 ///
139 /// # Example
140 /// ```ignore,no_run
141 /// # use google_cloud_firestore_admin_v1::model::Backup;
142 /// use wkt::Timestamp;
143 /// let x = Backup::new().set_or_clear_snapshot_time(Some(Timestamp::default()/* use setters */));
144 /// let x = Backup::new().set_or_clear_snapshot_time(None::<Timestamp>);
145 /// ```
146 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
147 where
148 T: std::convert::Into<wkt::Timestamp>,
149 {
150 self.snapshot_time = v.map(|x| x.into());
151 self
152 }
153
154 /// Sets the value of [expire_time][crate::model::Backup::expire_time].
155 ///
156 /// # Example
157 /// ```ignore,no_run
158 /// # use google_cloud_firestore_admin_v1::model::Backup;
159 /// use wkt::Timestamp;
160 /// let x = Backup::new().set_expire_time(Timestamp::default()/* use setters */);
161 /// ```
162 pub fn set_expire_time<T>(mut self, v: T) -> Self
163 where
164 T: std::convert::Into<wkt::Timestamp>,
165 {
166 self.expire_time = std::option::Option::Some(v.into());
167 self
168 }
169
170 /// Sets or clears the value of [expire_time][crate::model::Backup::expire_time].
171 ///
172 /// # Example
173 /// ```ignore,no_run
174 /// # use google_cloud_firestore_admin_v1::model::Backup;
175 /// use wkt::Timestamp;
176 /// let x = Backup::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
177 /// let x = Backup::new().set_or_clear_expire_time(None::<Timestamp>);
178 /// ```
179 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
180 where
181 T: std::convert::Into<wkt::Timestamp>,
182 {
183 self.expire_time = v.map(|x| x.into());
184 self
185 }
186
187 /// Sets the value of [stats][crate::model::Backup::stats].
188 ///
189 /// # Example
190 /// ```ignore,no_run
191 /// # use google_cloud_firestore_admin_v1::model::Backup;
192 /// use google_cloud_firestore_admin_v1::model::backup::Stats;
193 /// let x = Backup::new().set_stats(Stats::default()/* use setters */);
194 /// ```
195 pub fn set_stats<T>(mut self, v: T) -> Self
196 where
197 T: std::convert::Into<crate::model::backup::Stats>,
198 {
199 self.stats = std::option::Option::Some(v.into());
200 self
201 }
202
203 /// Sets or clears the value of [stats][crate::model::Backup::stats].
204 ///
205 /// # Example
206 /// ```ignore,no_run
207 /// # use google_cloud_firestore_admin_v1::model::Backup;
208 /// use google_cloud_firestore_admin_v1::model::backup::Stats;
209 /// let x = Backup::new().set_or_clear_stats(Some(Stats::default()/* use setters */));
210 /// let x = Backup::new().set_or_clear_stats(None::<Stats>);
211 /// ```
212 pub fn set_or_clear_stats<T>(mut self, v: std::option::Option<T>) -> Self
213 where
214 T: std::convert::Into<crate::model::backup::Stats>,
215 {
216 self.stats = v.map(|x| x.into());
217 self
218 }
219
220 /// Sets the value of [state][crate::model::Backup::state].
221 ///
222 /// # Example
223 /// ```ignore,no_run
224 /// # use google_cloud_firestore_admin_v1::model::Backup;
225 /// use google_cloud_firestore_admin_v1::model::backup::State;
226 /// let x0 = Backup::new().set_state(State::Creating);
227 /// let x1 = Backup::new().set_state(State::Ready);
228 /// let x2 = Backup::new().set_state(State::NotAvailable);
229 /// ```
230 pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
231 self.state = v.into();
232 self
233 }
234}
235
236impl wkt::message::Message for Backup {
237 fn typename() -> &'static str {
238 "type.googleapis.com/google.firestore.admin.v1.Backup"
239 }
240}
241
242/// Defines additional types related to [Backup].
243pub mod backup {
244 #[allow(unused_imports)]
245 use super::*;
246
247 /// Backup specific statistics.
248 #[derive(Clone, Default, PartialEq)]
249 #[non_exhaustive]
250 pub struct Stats {
251 /// Output only. Summation of the size of all documents and index entries in
252 /// the backup, measured in bytes.
253 pub size_bytes: i64,
254
255 /// Output only. The total number of documents contained in the backup.
256 pub document_count: i64,
257
258 /// Output only. The total number of index entries contained in the backup.
259 pub index_count: i64,
260
261 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
262 }
263
264 impl Stats {
265 pub fn new() -> Self {
266 std::default::Default::default()
267 }
268
269 /// Sets the value of [size_bytes][crate::model::backup::Stats::size_bytes].
270 ///
271 /// # Example
272 /// ```ignore,no_run
273 /// # use google_cloud_firestore_admin_v1::model::backup::Stats;
274 /// let x = Stats::new().set_size_bytes(42);
275 /// ```
276 pub fn set_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
277 self.size_bytes = v.into();
278 self
279 }
280
281 /// Sets the value of [document_count][crate::model::backup::Stats::document_count].
282 ///
283 /// # Example
284 /// ```ignore,no_run
285 /// # use google_cloud_firestore_admin_v1::model::backup::Stats;
286 /// let x = Stats::new().set_document_count(42);
287 /// ```
288 pub fn set_document_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
289 self.document_count = v.into();
290 self
291 }
292
293 /// Sets the value of [index_count][crate::model::backup::Stats::index_count].
294 ///
295 /// # Example
296 /// ```ignore,no_run
297 /// # use google_cloud_firestore_admin_v1::model::backup::Stats;
298 /// let x = Stats::new().set_index_count(42);
299 /// ```
300 pub fn set_index_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
301 self.index_count = v.into();
302 self
303 }
304 }
305
306 impl wkt::message::Message for Stats {
307 fn typename() -> &'static str {
308 "type.googleapis.com/google.firestore.admin.v1.Backup.Stats"
309 }
310 }
311
312 /// Indicate the current state of the backup.
313 ///
314 /// # Working with unknown values
315 ///
316 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
317 /// additional enum variants at any time. Adding new variants is not considered
318 /// a breaking change. Applications should write their code in anticipation of:
319 ///
320 /// - New values appearing in future releases of the client library, **and**
321 /// - New values received dynamically, without application changes.
322 ///
323 /// Please consult the [Working with enums] section in the user guide for some
324 /// guidelines.
325 ///
326 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
327 #[derive(Clone, Debug, PartialEq)]
328 #[non_exhaustive]
329 pub enum State {
330 /// The state is unspecified.
331 Unspecified,
332 /// The pending backup is still being created. Operations on the
333 /// backup will be rejected in this state.
334 Creating,
335 /// The backup is complete and ready to use.
336 Ready,
337 /// The backup is not available at this moment.
338 NotAvailable,
339 /// If set, the enum was initialized with an unknown value.
340 ///
341 /// Applications can examine the value using [State::value] or
342 /// [State::name].
343 UnknownValue(state::UnknownValue),
344 }
345
346 #[doc(hidden)]
347 pub mod state {
348 #[allow(unused_imports)]
349 use super::*;
350 #[derive(Clone, Debug, PartialEq)]
351 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
352 }
353
354 impl State {
355 /// Gets the enum value.
356 ///
357 /// Returns `None` if the enum contains an unknown value deserialized from
358 /// the string representation of enums.
359 pub fn value(&self) -> std::option::Option<i32> {
360 match self {
361 Self::Unspecified => std::option::Option::Some(0),
362 Self::Creating => std::option::Option::Some(1),
363 Self::Ready => std::option::Option::Some(2),
364 Self::NotAvailable => std::option::Option::Some(3),
365 Self::UnknownValue(u) => u.0.value(),
366 }
367 }
368
369 /// Gets the enum value as a string.
370 ///
371 /// Returns `None` if the enum contains an unknown value deserialized from
372 /// the integer representation of enums.
373 pub fn name(&self) -> std::option::Option<&str> {
374 match self {
375 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
376 Self::Creating => std::option::Option::Some("CREATING"),
377 Self::Ready => std::option::Option::Some("READY"),
378 Self::NotAvailable => std::option::Option::Some("NOT_AVAILABLE"),
379 Self::UnknownValue(u) => u.0.name(),
380 }
381 }
382 }
383
384 impl std::default::Default for State {
385 fn default() -> Self {
386 use std::convert::From;
387 Self::from(0)
388 }
389 }
390
391 impl std::fmt::Display for State {
392 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
393 wkt::internal::display_enum(f, self.name(), self.value())
394 }
395 }
396
397 impl std::convert::From<i32> for State {
398 fn from(value: i32) -> Self {
399 match value {
400 0 => Self::Unspecified,
401 1 => Self::Creating,
402 2 => Self::Ready,
403 3 => Self::NotAvailable,
404 _ => Self::UnknownValue(state::UnknownValue(
405 wkt::internal::UnknownEnumValue::Integer(value),
406 )),
407 }
408 }
409 }
410
411 impl std::convert::From<&str> for State {
412 fn from(value: &str) -> Self {
413 use std::string::ToString;
414 match value {
415 "STATE_UNSPECIFIED" => Self::Unspecified,
416 "CREATING" => Self::Creating,
417 "READY" => Self::Ready,
418 "NOT_AVAILABLE" => Self::NotAvailable,
419 _ => Self::UnknownValue(state::UnknownValue(
420 wkt::internal::UnknownEnumValue::String(value.to_string()),
421 )),
422 }
423 }
424 }
425
426 impl serde::ser::Serialize for State {
427 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
428 where
429 S: serde::Serializer,
430 {
431 match self {
432 Self::Unspecified => serializer.serialize_i32(0),
433 Self::Creating => serializer.serialize_i32(1),
434 Self::Ready => serializer.serialize_i32(2),
435 Self::NotAvailable => serializer.serialize_i32(3),
436 Self::UnknownValue(u) => u.0.serialize(serializer),
437 }
438 }
439 }
440
441 impl<'de> serde::de::Deserialize<'de> for State {
442 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
443 where
444 D: serde::Deserializer<'de>,
445 {
446 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
447 ".google.firestore.admin.v1.Backup.State",
448 ))
449 }
450 }
451}
452
453/// A Cloud Firestore Database.
454#[derive(Clone, Default, PartialEq)]
455#[non_exhaustive]
456pub struct Database {
457 /// The resource name of the Database.
458 /// Format: `projects/{project}/databases/{database}`
459 pub name: std::string::String,
460
461 /// Output only. The system-generated UUID4 for this Database.
462 pub uid: std::string::String,
463
464 /// Output only. The timestamp at which this database was created. Databases
465 /// created before 2016 do not populate create_time.
466 pub create_time: std::option::Option<wkt::Timestamp>,
467
468 /// Output only. The timestamp at which this database was most recently
469 /// updated. Note this only includes updates to the database resource and not
470 /// data contained by the database.
471 pub update_time: std::option::Option<wkt::Timestamp>,
472
473 /// Output only. The timestamp at which this database was deleted. Only set if
474 /// the database has been deleted.
475 pub delete_time: std::option::Option<wkt::Timestamp>,
476
477 /// The location of the database. Available locations are listed at
478 /// <https://cloud.google.com/firestore/docs/locations>.
479 pub location_id: std::string::String,
480
481 /// The type of the database.
482 /// See <https://cloud.google.com/datastore/docs/firestore-or-datastore> for
483 /// information about how to choose.
484 pub r#type: crate::model::database::DatabaseType,
485
486 /// The concurrency control mode to use for this database.
487 pub concurrency_mode: crate::model::database::ConcurrencyMode,
488
489 /// Output only. The period during which past versions of data are retained in
490 /// the database.
491 ///
492 /// Any [read][google.firestore.v1.GetDocumentRequest.read_time]
493 /// or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify
494 /// a `read_time` within this window, and will read the state of the database
495 /// at that time.
496 ///
497 /// If the PITR feature is enabled, the retention period is 7 days. Otherwise,
498 /// the retention period is 1 hour.
499 pub version_retention_period: std::option::Option<wkt::Duration>,
500
501 /// Output only. The earliest timestamp at which older versions of the data can
502 /// be read from the database. See [version_retention_period] above; this field
503 /// is populated with `now - version_retention_period`.
504 ///
505 /// This value is continuously updated, and becomes stale the moment it is
506 /// queried. If you are using this value to recover data, make sure to account
507 /// for the time from the moment when the value is queried to the moment when
508 /// you initiate the recovery.
509 pub earliest_version_time: std::option::Option<wkt::Timestamp>,
510
511 /// Whether to enable the PITR feature on this database.
512 pub point_in_time_recovery_enablement: crate::model::database::PointInTimeRecoveryEnablement,
513
514 /// The App Engine integration mode to use for this database.
515 pub app_engine_integration_mode: crate::model::database::AppEngineIntegrationMode,
516
517 /// Output only. The key_prefix for this database. This key_prefix is used, in
518 /// combination with the project ID ("\<key prefix\>~\<project id\>") to construct
519 /// the application ID that is returned from the Cloud Datastore APIs in Google
520 /// App Engine first generation runtimes.
521 ///
522 /// This value may be empty in which case the appid to use for URL-encoded keys
523 /// is the project_id (eg: foo instead of v~foo).
524 pub key_prefix: std::string::String,
525
526 /// State of delete protection for the database.
527 pub delete_protection_state: crate::model::database::DeleteProtectionState,
528
529 /// Optional. Presence indicates CMEK is enabled for this database.
530 pub cmek_config: std::option::Option<crate::model::database::CmekConfig>,
531
532 /// Output only. The database resource's prior database ID. This field is only
533 /// populated for deleted databases.
534 pub previous_id: std::string::String,
535
536 /// Output only. Information about the provenance of this database.
537 pub source_info: std::option::Option<crate::model::database::SourceInfo>,
538
539 /// Optional. Input only. Immutable. Tag keys/values directly bound to this
540 /// resource. For example:
541 /// "123/environment": "production",
542 /// "123/costCenter": "marketing"
543 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
544
545 /// Output only. Background: Free tier is the ability of a Firestore database
546 /// to use a small amount of resources every day without being charged. Once
547 /// usage exceeds the free tier limit further usage is charged.
548 ///
549 /// Whether this database can make use of the free tier. Only one database
550 /// per project can be eligible for the free tier.
551 ///
552 /// The first (or next) database that is created in a project without a free
553 /// tier database will be marked as eligible for the free tier. Databases that
554 /// are created while there is a free tier database will not be eligible for
555 /// the free tier.
556 pub free_tier: std::option::Option<bool>,
557
558 /// This checksum is computed by the server based on the value of other
559 /// fields, and may be sent on update and delete requests to ensure the
560 /// client has an up-to-date value before proceeding.
561 pub etag: std::string::String,
562
563 /// Immutable. The edition of the database.
564 pub database_edition: crate::model::database::DatabaseEdition,
565
566 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
567}
568
569impl Database {
570 pub fn new() -> Self {
571 std::default::Default::default()
572 }
573
574 /// Sets the value of [name][crate::model::Database::name].
575 ///
576 /// # Example
577 /// ```ignore,no_run
578 /// # use google_cloud_firestore_admin_v1::model::Database;
579 /// let x = Database::new().set_name("example");
580 /// ```
581 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
582 self.name = v.into();
583 self
584 }
585
586 /// Sets the value of [uid][crate::model::Database::uid].
587 ///
588 /// # Example
589 /// ```ignore,no_run
590 /// # use google_cloud_firestore_admin_v1::model::Database;
591 /// let x = Database::new().set_uid("example");
592 /// ```
593 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
594 self.uid = v.into();
595 self
596 }
597
598 /// Sets the value of [create_time][crate::model::Database::create_time].
599 ///
600 /// # Example
601 /// ```ignore,no_run
602 /// # use google_cloud_firestore_admin_v1::model::Database;
603 /// use wkt::Timestamp;
604 /// let x = Database::new().set_create_time(Timestamp::default()/* use setters */);
605 /// ```
606 pub fn set_create_time<T>(mut self, v: T) -> Self
607 where
608 T: std::convert::Into<wkt::Timestamp>,
609 {
610 self.create_time = std::option::Option::Some(v.into());
611 self
612 }
613
614 /// Sets or clears the value of [create_time][crate::model::Database::create_time].
615 ///
616 /// # Example
617 /// ```ignore,no_run
618 /// # use google_cloud_firestore_admin_v1::model::Database;
619 /// use wkt::Timestamp;
620 /// let x = Database::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
621 /// let x = Database::new().set_or_clear_create_time(None::<Timestamp>);
622 /// ```
623 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
624 where
625 T: std::convert::Into<wkt::Timestamp>,
626 {
627 self.create_time = v.map(|x| x.into());
628 self
629 }
630
631 /// Sets the value of [update_time][crate::model::Database::update_time].
632 ///
633 /// # Example
634 /// ```ignore,no_run
635 /// # use google_cloud_firestore_admin_v1::model::Database;
636 /// use wkt::Timestamp;
637 /// let x = Database::new().set_update_time(Timestamp::default()/* use setters */);
638 /// ```
639 pub fn set_update_time<T>(mut self, v: T) -> Self
640 where
641 T: std::convert::Into<wkt::Timestamp>,
642 {
643 self.update_time = std::option::Option::Some(v.into());
644 self
645 }
646
647 /// Sets or clears the value of [update_time][crate::model::Database::update_time].
648 ///
649 /// # Example
650 /// ```ignore,no_run
651 /// # use google_cloud_firestore_admin_v1::model::Database;
652 /// use wkt::Timestamp;
653 /// let x = Database::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
654 /// let x = Database::new().set_or_clear_update_time(None::<Timestamp>);
655 /// ```
656 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
657 where
658 T: std::convert::Into<wkt::Timestamp>,
659 {
660 self.update_time = v.map(|x| x.into());
661 self
662 }
663
664 /// Sets the value of [delete_time][crate::model::Database::delete_time].
665 ///
666 /// # Example
667 /// ```ignore,no_run
668 /// # use google_cloud_firestore_admin_v1::model::Database;
669 /// use wkt::Timestamp;
670 /// let x = Database::new().set_delete_time(Timestamp::default()/* use setters */);
671 /// ```
672 pub fn set_delete_time<T>(mut self, v: T) -> Self
673 where
674 T: std::convert::Into<wkt::Timestamp>,
675 {
676 self.delete_time = std::option::Option::Some(v.into());
677 self
678 }
679
680 /// Sets or clears the value of [delete_time][crate::model::Database::delete_time].
681 ///
682 /// # Example
683 /// ```ignore,no_run
684 /// # use google_cloud_firestore_admin_v1::model::Database;
685 /// use wkt::Timestamp;
686 /// let x = Database::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
687 /// let x = Database::new().set_or_clear_delete_time(None::<Timestamp>);
688 /// ```
689 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
690 where
691 T: std::convert::Into<wkt::Timestamp>,
692 {
693 self.delete_time = v.map(|x| x.into());
694 self
695 }
696
697 /// Sets the value of [location_id][crate::model::Database::location_id].
698 ///
699 /// # Example
700 /// ```ignore,no_run
701 /// # use google_cloud_firestore_admin_v1::model::Database;
702 /// let x = Database::new().set_location_id("example");
703 /// ```
704 pub fn set_location_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
705 self.location_id = v.into();
706 self
707 }
708
709 /// Sets the value of [r#type][crate::model::Database::type].
710 ///
711 /// # Example
712 /// ```ignore,no_run
713 /// # use google_cloud_firestore_admin_v1::model::Database;
714 /// use google_cloud_firestore_admin_v1::model::database::DatabaseType;
715 /// let x0 = Database::new().set_type(DatabaseType::FirestoreNative);
716 /// let x1 = Database::new().set_type(DatabaseType::DatastoreMode);
717 /// ```
718 pub fn set_type<T: std::convert::Into<crate::model::database::DatabaseType>>(
719 mut self,
720 v: T,
721 ) -> Self {
722 self.r#type = v.into();
723 self
724 }
725
726 /// Sets the value of [concurrency_mode][crate::model::Database::concurrency_mode].
727 ///
728 /// # Example
729 /// ```ignore,no_run
730 /// # use google_cloud_firestore_admin_v1::model::Database;
731 /// use google_cloud_firestore_admin_v1::model::database::ConcurrencyMode;
732 /// let x0 = Database::new().set_concurrency_mode(ConcurrencyMode::Optimistic);
733 /// let x1 = Database::new().set_concurrency_mode(ConcurrencyMode::Pessimistic);
734 /// let x2 = Database::new().set_concurrency_mode(ConcurrencyMode::OptimisticWithEntityGroups);
735 /// ```
736 pub fn set_concurrency_mode<T: std::convert::Into<crate::model::database::ConcurrencyMode>>(
737 mut self,
738 v: T,
739 ) -> Self {
740 self.concurrency_mode = v.into();
741 self
742 }
743
744 /// Sets the value of [version_retention_period][crate::model::Database::version_retention_period].
745 ///
746 /// # Example
747 /// ```ignore,no_run
748 /// # use google_cloud_firestore_admin_v1::model::Database;
749 /// use wkt::Duration;
750 /// let x = Database::new().set_version_retention_period(Duration::default()/* use setters */);
751 /// ```
752 pub fn set_version_retention_period<T>(mut self, v: T) -> Self
753 where
754 T: std::convert::Into<wkt::Duration>,
755 {
756 self.version_retention_period = std::option::Option::Some(v.into());
757 self
758 }
759
760 /// Sets or clears the value of [version_retention_period][crate::model::Database::version_retention_period].
761 ///
762 /// # Example
763 /// ```ignore,no_run
764 /// # use google_cloud_firestore_admin_v1::model::Database;
765 /// use wkt::Duration;
766 /// let x = Database::new().set_or_clear_version_retention_period(Some(Duration::default()/* use setters */));
767 /// let x = Database::new().set_or_clear_version_retention_period(None::<Duration>);
768 /// ```
769 pub fn set_or_clear_version_retention_period<T>(mut self, v: std::option::Option<T>) -> Self
770 where
771 T: std::convert::Into<wkt::Duration>,
772 {
773 self.version_retention_period = v.map(|x| x.into());
774 self
775 }
776
777 /// Sets the value of [earliest_version_time][crate::model::Database::earliest_version_time].
778 ///
779 /// # Example
780 /// ```ignore,no_run
781 /// # use google_cloud_firestore_admin_v1::model::Database;
782 /// use wkt::Timestamp;
783 /// let x = Database::new().set_earliest_version_time(Timestamp::default()/* use setters */);
784 /// ```
785 pub fn set_earliest_version_time<T>(mut self, v: T) -> Self
786 where
787 T: std::convert::Into<wkt::Timestamp>,
788 {
789 self.earliest_version_time = std::option::Option::Some(v.into());
790 self
791 }
792
793 /// Sets or clears the value of [earliest_version_time][crate::model::Database::earliest_version_time].
794 ///
795 /// # Example
796 /// ```ignore,no_run
797 /// # use google_cloud_firestore_admin_v1::model::Database;
798 /// use wkt::Timestamp;
799 /// let x = Database::new().set_or_clear_earliest_version_time(Some(Timestamp::default()/* use setters */));
800 /// let x = Database::new().set_or_clear_earliest_version_time(None::<Timestamp>);
801 /// ```
802 pub fn set_or_clear_earliest_version_time<T>(mut self, v: std::option::Option<T>) -> Self
803 where
804 T: std::convert::Into<wkt::Timestamp>,
805 {
806 self.earliest_version_time = v.map(|x| x.into());
807 self
808 }
809
810 /// Sets the value of [point_in_time_recovery_enablement][crate::model::Database::point_in_time_recovery_enablement].
811 ///
812 /// # Example
813 /// ```ignore,no_run
814 /// # use google_cloud_firestore_admin_v1::model::Database;
815 /// use google_cloud_firestore_admin_v1::model::database::PointInTimeRecoveryEnablement;
816 /// let x0 = Database::new().set_point_in_time_recovery_enablement(PointInTimeRecoveryEnablement::PointInTimeRecoveryEnabled);
817 /// let x1 = Database::new().set_point_in_time_recovery_enablement(PointInTimeRecoveryEnablement::PointInTimeRecoveryDisabled);
818 /// ```
819 pub fn set_point_in_time_recovery_enablement<
820 T: std::convert::Into<crate::model::database::PointInTimeRecoveryEnablement>,
821 >(
822 mut self,
823 v: T,
824 ) -> Self {
825 self.point_in_time_recovery_enablement = v.into();
826 self
827 }
828
829 /// Sets the value of [app_engine_integration_mode][crate::model::Database::app_engine_integration_mode].
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::AppEngineIntegrationMode;
835 /// let x0 = Database::new().set_app_engine_integration_mode(AppEngineIntegrationMode::Enabled);
836 /// let x1 = Database::new().set_app_engine_integration_mode(AppEngineIntegrationMode::Disabled);
837 /// ```
838 pub fn set_app_engine_integration_mode<
839 T: std::convert::Into<crate::model::database::AppEngineIntegrationMode>,
840 >(
841 mut self,
842 v: T,
843 ) -> Self {
844 self.app_engine_integration_mode = v.into();
845 self
846 }
847
848 /// Sets the value of [key_prefix][crate::model::Database::key_prefix].
849 ///
850 /// # Example
851 /// ```ignore,no_run
852 /// # use google_cloud_firestore_admin_v1::model::Database;
853 /// let x = Database::new().set_key_prefix("example");
854 /// ```
855 pub fn set_key_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
856 self.key_prefix = v.into();
857 self
858 }
859
860 /// Sets the value of [delete_protection_state][crate::model::Database::delete_protection_state].
861 ///
862 /// # Example
863 /// ```ignore,no_run
864 /// # use google_cloud_firestore_admin_v1::model::Database;
865 /// use google_cloud_firestore_admin_v1::model::database::DeleteProtectionState;
866 /// let x0 = Database::new().set_delete_protection_state(DeleteProtectionState::DeleteProtectionDisabled);
867 /// let x1 = Database::new().set_delete_protection_state(DeleteProtectionState::DeleteProtectionEnabled);
868 /// ```
869 pub fn set_delete_protection_state<
870 T: std::convert::Into<crate::model::database::DeleteProtectionState>,
871 >(
872 mut self,
873 v: T,
874 ) -> Self {
875 self.delete_protection_state = v.into();
876 self
877 }
878
879 /// Sets the value of [cmek_config][crate::model::Database::cmek_config].
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::CmekConfig;
885 /// let x = Database::new().set_cmek_config(CmekConfig::default()/* use setters */);
886 /// ```
887 pub fn set_cmek_config<T>(mut self, v: T) -> Self
888 where
889 T: std::convert::Into<crate::model::database::CmekConfig>,
890 {
891 self.cmek_config = std::option::Option::Some(v.into());
892 self
893 }
894
895 /// Sets or clears the value of [cmek_config][crate::model::Database::cmek_config].
896 ///
897 /// # Example
898 /// ```ignore,no_run
899 /// # use google_cloud_firestore_admin_v1::model::Database;
900 /// use google_cloud_firestore_admin_v1::model::database::CmekConfig;
901 /// let x = Database::new().set_or_clear_cmek_config(Some(CmekConfig::default()/* use setters */));
902 /// let x = Database::new().set_or_clear_cmek_config(None::<CmekConfig>);
903 /// ```
904 pub fn set_or_clear_cmek_config<T>(mut self, v: std::option::Option<T>) -> Self
905 where
906 T: std::convert::Into<crate::model::database::CmekConfig>,
907 {
908 self.cmek_config = v.map(|x| x.into());
909 self
910 }
911
912 /// Sets the value of [previous_id][crate::model::Database::previous_id].
913 ///
914 /// # Example
915 /// ```ignore,no_run
916 /// # use google_cloud_firestore_admin_v1::model::Database;
917 /// let x = Database::new().set_previous_id("example");
918 /// ```
919 pub fn set_previous_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
920 self.previous_id = v.into();
921 self
922 }
923
924 /// Sets the value of [source_info][crate::model::Database::source_info].
925 ///
926 /// # Example
927 /// ```ignore,no_run
928 /// # use google_cloud_firestore_admin_v1::model::Database;
929 /// use google_cloud_firestore_admin_v1::model::database::SourceInfo;
930 /// let x = Database::new().set_source_info(SourceInfo::default()/* use setters */);
931 /// ```
932 pub fn set_source_info<T>(mut self, v: T) -> Self
933 where
934 T: std::convert::Into<crate::model::database::SourceInfo>,
935 {
936 self.source_info = std::option::Option::Some(v.into());
937 self
938 }
939
940 /// Sets or clears the value of [source_info][crate::model::Database::source_info].
941 ///
942 /// # Example
943 /// ```ignore,no_run
944 /// # use google_cloud_firestore_admin_v1::model::Database;
945 /// use google_cloud_firestore_admin_v1::model::database::SourceInfo;
946 /// let x = Database::new().set_or_clear_source_info(Some(SourceInfo::default()/* use setters */));
947 /// let x = Database::new().set_or_clear_source_info(None::<SourceInfo>);
948 /// ```
949 pub fn set_or_clear_source_info<T>(mut self, v: std::option::Option<T>) -> Self
950 where
951 T: std::convert::Into<crate::model::database::SourceInfo>,
952 {
953 self.source_info = v.map(|x| x.into());
954 self
955 }
956
957 /// Sets the value of [tags][crate::model::Database::tags].
958 ///
959 /// # Example
960 /// ```ignore,no_run
961 /// # use google_cloud_firestore_admin_v1::model::Database;
962 /// let x = Database::new().set_tags([
963 /// ("key0", "abc"),
964 /// ("key1", "xyz"),
965 /// ]);
966 /// ```
967 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
968 where
969 T: std::iter::IntoIterator<Item = (K, V)>,
970 K: std::convert::Into<std::string::String>,
971 V: std::convert::Into<std::string::String>,
972 {
973 use std::iter::Iterator;
974 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
975 self
976 }
977
978 /// Sets the value of [free_tier][crate::model::Database::free_tier].
979 ///
980 /// # Example
981 /// ```ignore,no_run
982 /// # use google_cloud_firestore_admin_v1::model::Database;
983 /// let x = Database::new().set_free_tier(true);
984 /// ```
985 pub fn set_free_tier<T>(mut self, v: T) -> Self
986 where
987 T: std::convert::Into<bool>,
988 {
989 self.free_tier = std::option::Option::Some(v.into());
990 self
991 }
992
993 /// Sets or clears the value of [free_tier][crate::model::Database::free_tier].
994 ///
995 /// # Example
996 /// ```ignore,no_run
997 /// # use google_cloud_firestore_admin_v1::model::Database;
998 /// let x = Database::new().set_or_clear_free_tier(Some(false));
999 /// let x = Database::new().set_or_clear_free_tier(None::<bool>);
1000 /// ```
1001 pub fn set_or_clear_free_tier<T>(mut self, v: std::option::Option<T>) -> Self
1002 where
1003 T: std::convert::Into<bool>,
1004 {
1005 self.free_tier = v.map(|x| x.into());
1006 self
1007 }
1008
1009 /// Sets the value of [etag][crate::model::Database::etag].
1010 ///
1011 /// # Example
1012 /// ```ignore,no_run
1013 /// # use google_cloud_firestore_admin_v1::model::Database;
1014 /// let x = Database::new().set_etag("example");
1015 /// ```
1016 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1017 self.etag = v.into();
1018 self
1019 }
1020
1021 /// Sets the value of [database_edition][crate::model::Database::database_edition].
1022 ///
1023 /// # Example
1024 /// ```ignore,no_run
1025 /// # use google_cloud_firestore_admin_v1::model::Database;
1026 /// use google_cloud_firestore_admin_v1::model::database::DatabaseEdition;
1027 /// let x0 = Database::new().set_database_edition(DatabaseEdition::Standard);
1028 /// let x1 = Database::new().set_database_edition(DatabaseEdition::Enterprise);
1029 /// ```
1030 pub fn set_database_edition<T: std::convert::Into<crate::model::database::DatabaseEdition>>(
1031 mut self,
1032 v: T,
1033 ) -> Self {
1034 self.database_edition = v.into();
1035 self
1036 }
1037}
1038
1039impl wkt::message::Message for Database {
1040 fn typename() -> &'static str {
1041 "type.googleapis.com/google.firestore.admin.v1.Database"
1042 }
1043}
1044
1045/// Defines additional types related to [Database].
1046pub mod database {
1047 #[allow(unused_imports)]
1048 use super::*;
1049
1050 /// The CMEK (Customer Managed Encryption Key) configuration for a Firestore
1051 /// database. If not present, the database is secured by the default Google
1052 /// encryption key.
1053 #[derive(Clone, Default, PartialEq)]
1054 #[non_exhaustive]
1055 pub struct CmekConfig {
1056 /// Required. Only keys in the same location as this database are allowed to
1057 /// be used for encryption.
1058 ///
1059 /// For Firestore's nam5 multi-region, this corresponds to Cloud KMS
1060 /// multi-region us. For Firestore's eur3 multi-region, this corresponds to
1061 /// Cloud KMS multi-region europe. See
1062 /// <https://cloud.google.com/kms/docs/locations>.
1063 ///
1064 /// The expected format is
1065 /// `projects/{project_id}/locations/{kms_location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
1066 pub kms_key_name: std::string::String,
1067
1068 /// Output only. Currently in-use [KMS key
1069 /// versions](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions).
1070 /// During [key rotation](https://cloud.google.com/kms/docs/key-rotation),
1071 /// there can be multiple in-use key versions.
1072 ///
1073 /// The expected format is
1074 /// `projects/{project_id}/locations/{kms_location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{key_version}`.
1075 pub active_key_version: std::vec::Vec<std::string::String>,
1076
1077 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1078 }
1079
1080 impl CmekConfig {
1081 pub fn new() -> Self {
1082 std::default::Default::default()
1083 }
1084
1085 /// Sets the value of [kms_key_name][crate::model::database::CmekConfig::kms_key_name].
1086 ///
1087 /// # Example
1088 /// ```ignore,no_run
1089 /// # use google_cloud_firestore_admin_v1::model::database::CmekConfig;
1090 /// let x = CmekConfig::new().set_kms_key_name("example");
1091 /// ```
1092 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
1093 mut self,
1094 v: T,
1095 ) -> Self {
1096 self.kms_key_name = v.into();
1097 self
1098 }
1099
1100 /// Sets the value of [active_key_version][crate::model::database::CmekConfig::active_key_version].
1101 ///
1102 /// # Example
1103 /// ```ignore,no_run
1104 /// # use google_cloud_firestore_admin_v1::model::database::CmekConfig;
1105 /// let x = CmekConfig::new().set_active_key_version(["a", "b", "c"]);
1106 /// ```
1107 pub fn set_active_key_version<T, V>(mut self, v: T) -> Self
1108 where
1109 T: std::iter::IntoIterator<Item = V>,
1110 V: std::convert::Into<std::string::String>,
1111 {
1112 use std::iter::Iterator;
1113 self.active_key_version = v.into_iter().map(|i| i.into()).collect();
1114 self
1115 }
1116 }
1117
1118 impl wkt::message::Message for CmekConfig {
1119 fn typename() -> &'static str {
1120 "type.googleapis.com/google.firestore.admin.v1.Database.CmekConfig"
1121 }
1122 }
1123
1124 /// Information about the provenance of this database.
1125 #[derive(Clone, Default, PartialEq)]
1126 #[non_exhaustive]
1127 pub struct SourceInfo {
1128 /// The associated long-running operation. This field may not be set after
1129 /// the operation has completed. Format:
1130 /// `projects/{project}/databases/{database}/operations/{operation}`.
1131 pub operation: std::string::String,
1132
1133 /// The source from which this database is derived.
1134 pub source: std::option::Option<crate::model::database::source_info::Source>,
1135
1136 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1137 }
1138
1139 impl SourceInfo {
1140 pub fn new() -> Self {
1141 std::default::Default::default()
1142 }
1143
1144 /// Sets the value of [operation][crate::model::database::SourceInfo::operation].
1145 ///
1146 /// # Example
1147 /// ```ignore,no_run
1148 /// # use google_cloud_firestore_admin_v1::model::database::SourceInfo;
1149 /// let x = SourceInfo::new().set_operation("example");
1150 /// ```
1151 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1152 self.operation = v.into();
1153 self
1154 }
1155
1156 /// Sets the value of [source][crate::model::database::SourceInfo::source].
1157 ///
1158 /// Note that all the setters affecting `source` are mutually
1159 /// exclusive.
1160 ///
1161 /// # Example
1162 /// ```ignore,no_run
1163 /// # use google_cloud_firestore_admin_v1::model::database::SourceInfo;
1164 /// use google_cloud_firestore_admin_v1::model::database::source_info::BackupSource;
1165 /// let x = SourceInfo::new().set_source(Some(
1166 /// google_cloud_firestore_admin_v1::model::database::source_info::Source::Backup(BackupSource::default().into())));
1167 /// ```
1168 pub fn set_source<
1169 T: std::convert::Into<std::option::Option<crate::model::database::source_info::Source>>,
1170 >(
1171 mut self,
1172 v: T,
1173 ) -> Self {
1174 self.source = v.into();
1175 self
1176 }
1177
1178 /// The value of [source][crate::model::database::SourceInfo::source]
1179 /// if it holds a `Backup`, `None` if the field is not set or
1180 /// holds a different branch.
1181 pub fn backup(
1182 &self,
1183 ) -> std::option::Option<&std::boxed::Box<crate::model::database::source_info::BackupSource>>
1184 {
1185 #[allow(unreachable_patterns)]
1186 self.source.as_ref().and_then(|v| match v {
1187 crate::model::database::source_info::Source::Backup(v) => {
1188 std::option::Option::Some(v)
1189 }
1190 _ => std::option::Option::None,
1191 })
1192 }
1193
1194 /// Sets the value of [source][crate::model::database::SourceInfo::source]
1195 /// to hold a `Backup`.
1196 ///
1197 /// Note that all the setters affecting `source` are
1198 /// mutually exclusive.
1199 ///
1200 /// # Example
1201 /// ```ignore,no_run
1202 /// # use google_cloud_firestore_admin_v1::model::database::SourceInfo;
1203 /// use google_cloud_firestore_admin_v1::model::database::source_info::BackupSource;
1204 /// let x = SourceInfo::new().set_backup(BackupSource::default()/* use setters */);
1205 /// assert!(x.backup().is_some());
1206 /// ```
1207 pub fn set_backup<
1208 T: std::convert::Into<std::boxed::Box<crate::model::database::source_info::BackupSource>>,
1209 >(
1210 mut self,
1211 v: T,
1212 ) -> Self {
1213 self.source = std::option::Option::Some(
1214 crate::model::database::source_info::Source::Backup(v.into()),
1215 );
1216 self
1217 }
1218 }
1219
1220 impl wkt::message::Message for SourceInfo {
1221 fn typename() -> &'static str {
1222 "type.googleapis.com/google.firestore.admin.v1.Database.SourceInfo"
1223 }
1224 }
1225
1226 /// Defines additional types related to [SourceInfo].
1227 pub mod source_info {
1228 #[allow(unused_imports)]
1229 use super::*;
1230
1231 /// Information about a backup that was used to restore a database.
1232 #[derive(Clone, Default, PartialEq)]
1233 #[non_exhaustive]
1234 pub struct BackupSource {
1235 /// The resource name of the backup that was used to restore this
1236 /// database. Format:
1237 /// `projects/{project}/locations/{location}/backups/{backup}`.
1238 pub backup: std::string::String,
1239
1240 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1241 }
1242
1243 impl BackupSource {
1244 pub fn new() -> Self {
1245 std::default::Default::default()
1246 }
1247
1248 /// Sets the value of [backup][crate::model::database::source_info::BackupSource::backup].
1249 ///
1250 /// # Example
1251 /// ```ignore,no_run
1252 /// # use google_cloud_firestore_admin_v1::model::database::source_info::BackupSource;
1253 /// let x = BackupSource::new().set_backup("example");
1254 /// ```
1255 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1256 self.backup = v.into();
1257 self
1258 }
1259 }
1260
1261 impl wkt::message::Message for BackupSource {
1262 fn typename() -> &'static str {
1263 "type.googleapis.com/google.firestore.admin.v1.Database.SourceInfo.BackupSource"
1264 }
1265 }
1266
1267 /// The source from which this database is derived.
1268 #[derive(Clone, Debug, PartialEq)]
1269 #[non_exhaustive]
1270 pub enum Source {
1271 /// If set, this database was restored from the specified backup (or a
1272 /// snapshot thereof).
1273 Backup(std::boxed::Box<crate::model::database::source_info::BackupSource>),
1274 }
1275 }
1276
1277 /// Encryption configuration for a new database being created from another
1278 /// source.
1279 ///
1280 /// The source could be a [Backup][google.firestore.admin.v1.Backup] .
1281 ///
1282 /// [google.firestore.admin.v1.Backup]: crate::model::Backup
1283 #[derive(Clone, Default, PartialEq)]
1284 #[non_exhaustive]
1285 pub struct EncryptionConfig {
1286 /// The method for encrypting the database.
1287 pub encryption_type:
1288 std::option::Option<crate::model::database::encryption_config::EncryptionType>,
1289
1290 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1291 }
1292
1293 impl EncryptionConfig {
1294 pub fn new() -> Self {
1295 std::default::Default::default()
1296 }
1297
1298 /// Sets the value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type].
1299 ///
1300 /// Note that all the setters affecting `encryption_type` are mutually
1301 /// exclusive.
1302 ///
1303 /// # Example
1304 /// ```ignore,no_run
1305 /// # use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
1306 /// use google_cloud_firestore_admin_v1::model::database::encryption_config::GoogleDefaultEncryptionOptions;
1307 /// let x = EncryptionConfig::new().set_encryption_type(Some(
1308 /// google_cloud_firestore_admin_v1::model::database::encryption_config::EncryptionType::GoogleDefaultEncryption(GoogleDefaultEncryptionOptions::default().into())));
1309 /// ```
1310 pub fn set_encryption_type<
1311 T: std::convert::Into<
1312 std::option::Option<crate::model::database::encryption_config::EncryptionType>,
1313 >,
1314 >(
1315 mut self,
1316 v: T,
1317 ) -> Self {
1318 self.encryption_type = v.into();
1319 self
1320 }
1321
1322 /// The value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type]
1323 /// if it holds a `GoogleDefaultEncryption`, `None` if the field is not set or
1324 /// holds a different branch.
1325 pub fn google_default_encryption(
1326 &self,
1327 ) -> std::option::Option<
1328 &std::boxed::Box<
1329 crate::model::database::encryption_config::GoogleDefaultEncryptionOptions,
1330 >,
1331 > {
1332 #[allow(unreachable_patterns)]
1333 self.encryption_type.as_ref().and_then(|v| match v {
1334 crate::model::database::encryption_config::EncryptionType::GoogleDefaultEncryption(v) => std::option::Option::Some(v),
1335 _ => std::option::Option::None,
1336 })
1337 }
1338
1339 /// Sets the value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type]
1340 /// to hold a `GoogleDefaultEncryption`.
1341 ///
1342 /// Note that all the setters affecting `encryption_type` are
1343 /// mutually exclusive.
1344 ///
1345 /// # Example
1346 /// ```ignore,no_run
1347 /// # use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
1348 /// use google_cloud_firestore_admin_v1::model::database::encryption_config::GoogleDefaultEncryptionOptions;
1349 /// let x = EncryptionConfig::new().set_google_default_encryption(GoogleDefaultEncryptionOptions::default()/* use setters */);
1350 /// assert!(x.google_default_encryption().is_some());
1351 /// assert!(x.use_source_encryption().is_none());
1352 /// assert!(x.customer_managed_encryption().is_none());
1353 /// ```
1354 pub fn set_google_default_encryption<
1355 T: std::convert::Into<
1356 std::boxed::Box<
1357 crate::model::database::encryption_config::GoogleDefaultEncryptionOptions,
1358 >,
1359 >,
1360 >(
1361 mut self,
1362 v: T,
1363 ) -> Self {
1364 self.encryption_type = std::option::Option::Some(
1365 crate::model::database::encryption_config::EncryptionType::GoogleDefaultEncryption(
1366 v.into(),
1367 ),
1368 );
1369 self
1370 }
1371
1372 /// The value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type]
1373 /// if it holds a `UseSourceEncryption`, `None` if the field is not set or
1374 /// holds a different branch.
1375 pub fn use_source_encryption(
1376 &self,
1377 ) -> std::option::Option<
1378 &std::boxed::Box<crate::model::database::encryption_config::SourceEncryptionOptions>,
1379 > {
1380 #[allow(unreachable_patterns)]
1381 self.encryption_type.as_ref().and_then(|v| match v {
1382 crate::model::database::encryption_config::EncryptionType::UseSourceEncryption(
1383 v,
1384 ) => std::option::Option::Some(v),
1385 _ => std::option::Option::None,
1386 })
1387 }
1388
1389 /// Sets the value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type]
1390 /// to hold a `UseSourceEncryption`.
1391 ///
1392 /// Note that all the setters affecting `encryption_type` are
1393 /// mutually exclusive.
1394 ///
1395 /// # Example
1396 /// ```ignore,no_run
1397 /// # use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
1398 /// use google_cloud_firestore_admin_v1::model::database::encryption_config::SourceEncryptionOptions;
1399 /// let x = EncryptionConfig::new().set_use_source_encryption(SourceEncryptionOptions::default()/* use setters */);
1400 /// assert!(x.use_source_encryption().is_some());
1401 /// assert!(x.google_default_encryption().is_none());
1402 /// assert!(x.customer_managed_encryption().is_none());
1403 /// ```
1404 pub fn set_use_source_encryption<
1405 T: std::convert::Into<
1406 std::boxed::Box<
1407 crate::model::database::encryption_config::SourceEncryptionOptions,
1408 >,
1409 >,
1410 >(
1411 mut self,
1412 v: T,
1413 ) -> Self {
1414 self.encryption_type = std::option::Option::Some(
1415 crate::model::database::encryption_config::EncryptionType::UseSourceEncryption(
1416 v.into(),
1417 ),
1418 );
1419 self
1420 }
1421
1422 /// The value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type]
1423 /// if it holds a `CustomerManagedEncryption`, `None` if the field is not set or
1424 /// holds a different branch.
1425 pub fn customer_managed_encryption(
1426 &self,
1427 ) -> std::option::Option<
1428 &std::boxed::Box<
1429 crate::model::database::encryption_config::CustomerManagedEncryptionOptions,
1430 >,
1431 > {
1432 #[allow(unreachable_patterns)]
1433 self.encryption_type.as_ref().and_then(|v| match v {
1434 crate::model::database::encryption_config::EncryptionType::CustomerManagedEncryption(v) => std::option::Option::Some(v),
1435 _ => std::option::Option::None,
1436 })
1437 }
1438
1439 /// Sets the value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type]
1440 /// to hold a `CustomerManagedEncryption`.
1441 ///
1442 /// Note that all the setters affecting `encryption_type` are
1443 /// mutually exclusive.
1444 ///
1445 /// # Example
1446 /// ```ignore,no_run
1447 /// # use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
1448 /// use google_cloud_firestore_admin_v1::model::database::encryption_config::CustomerManagedEncryptionOptions;
1449 /// let x = EncryptionConfig::new().set_customer_managed_encryption(CustomerManagedEncryptionOptions::default()/* use setters */);
1450 /// assert!(x.customer_managed_encryption().is_some());
1451 /// assert!(x.google_default_encryption().is_none());
1452 /// assert!(x.use_source_encryption().is_none());
1453 /// ```
1454 pub fn set_customer_managed_encryption<
1455 T: std::convert::Into<
1456 std::boxed::Box<
1457 crate::model::database::encryption_config::CustomerManagedEncryptionOptions,
1458 >,
1459 >,
1460 >(
1461 mut self,
1462 v: T,
1463 ) -> Self {
1464 self.encryption_type = std::option::Option::Some(
1465 crate::model::database::encryption_config::EncryptionType::CustomerManagedEncryption(
1466 v.into()
1467 )
1468 );
1469 self
1470 }
1471 }
1472
1473 impl wkt::message::Message for EncryptionConfig {
1474 fn typename() -> &'static str {
1475 "type.googleapis.com/google.firestore.admin.v1.Database.EncryptionConfig"
1476 }
1477 }
1478
1479 /// Defines additional types related to [EncryptionConfig].
1480 pub mod encryption_config {
1481 #[allow(unused_imports)]
1482 use super::*;
1483
1484 /// The configuration options for using Google default encryption.
1485 #[derive(Clone, Default, PartialEq)]
1486 #[non_exhaustive]
1487 pub struct GoogleDefaultEncryptionOptions {
1488 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1489 }
1490
1491 impl GoogleDefaultEncryptionOptions {
1492 pub fn new() -> Self {
1493 std::default::Default::default()
1494 }
1495 }
1496
1497 impl wkt::message::Message for GoogleDefaultEncryptionOptions {
1498 fn typename() -> &'static str {
1499 "type.googleapis.com/google.firestore.admin.v1.Database.EncryptionConfig.GoogleDefaultEncryptionOptions"
1500 }
1501 }
1502
1503 /// The configuration options for using the same encryption method as the
1504 /// source.
1505 #[derive(Clone, Default, PartialEq)]
1506 #[non_exhaustive]
1507 pub struct SourceEncryptionOptions {
1508 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1509 }
1510
1511 impl SourceEncryptionOptions {
1512 pub fn new() -> Self {
1513 std::default::Default::default()
1514 }
1515 }
1516
1517 impl wkt::message::Message for SourceEncryptionOptions {
1518 fn typename() -> &'static str {
1519 "type.googleapis.com/google.firestore.admin.v1.Database.EncryptionConfig.SourceEncryptionOptions"
1520 }
1521 }
1522
1523 /// The configuration options for using CMEK (Customer Managed Encryption
1524 /// Key) encryption.
1525 #[derive(Clone, Default, PartialEq)]
1526 #[non_exhaustive]
1527 pub struct CustomerManagedEncryptionOptions {
1528 /// Required. Only keys in the same location as the database are allowed to
1529 /// be used for encryption.
1530 ///
1531 /// For Firestore's nam5 multi-region, this corresponds to Cloud KMS
1532 /// multi-region us. For Firestore's eur3 multi-region, this corresponds to
1533 /// Cloud KMS multi-region europe. See
1534 /// <https://cloud.google.com/kms/docs/locations>.
1535 ///
1536 /// The expected format is
1537 /// `projects/{project_id}/locations/{kms_location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
1538 pub kms_key_name: std::string::String,
1539
1540 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1541 }
1542
1543 impl CustomerManagedEncryptionOptions {
1544 pub fn new() -> Self {
1545 std::default::Default::default()
1546 }
1547
1548 /// Sets the value of [kms_key_name][crate::model::database::encryption_config::CustomerManagedEncryptionOptions::kms_key_name].
1549 ///
1550 /// # Example
1551 /// ```ignore,no_run
1552 /// # use google_cloud_firestore_admin_v1::model::database::encryption_config::CustomerManagedEncryptionOptions;
1553 /// let x = CustomerManagedEncryptionOptions::new().set_kms_key_name("example");
1554 /// ```
1555 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
1556 mut self,
1557 v: T,
1558 ) -> Self {
1559 self.kms_key_name = v.into();
1560 self
1561 }
1562 }
1563
1564 impl wkt::message::Message for CustomerManagedEncryptionOptions {
1565 fn typename() -> &'static str {
1566 "type.googleapis.com/google.firestore.admin.v1.Database.EncryptionConfig.CustomerManagedEncryptionOptions"
1567 }
1568 }
1569
1570 /// The method for encrypting the database.
1571 #[derive(Clone, Debug, PartialEq)]
1572 #[non_exhaustive]
1573 pub enum EncryptionType {
1574 /// Use Google default encryption.
1575 GoogleDefaultEncryption(
1576 std::boxed::Box<
1577 crate::model::database::encryption_config::GoogleDefaultEncryptionOptions,
1578 >,
1579 ),
1580 /// The database will use the same encryption configuration as the source.
1581 UseSourceEncryption(
1582 std::boxed::Box<crate::model::database::encryption_config::SourceEncryptionOptions>,
1583 ),
1584 /// Use Customer Managed Encryption Keys (CMEK) for encryption.
1585 CustomerManagedEncryption(
1586 std::boxed::Box<
1587 crate::model::database::encryption_config::CustomerManagedEncryptionOptions,
1588 >,
1589 ),
1590 }
1591 }
1592
1593 /// The type of the database.
1594 /// See <https://cloud.google.com/datastore/docs/firestore-or-datastore> for
1595 /// information about how to choose.
1596 ///
1597 /// Mode changes are only allowed if the database is empty.
1598 ///
1599 /// # Working with unknown values
1600 ///
1601 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1602 /// additional enum variants at any time. Adding new variants is not considered
1603 /// a breaking change. Applications should write their code in anticipation of:
1604 ///
1605 /// - New values appearing in future releases of the client library, **and**
1606 /// - New values received dynamically, without application changes.
1607 ///
1608 /// Please consult the [Working with enums] section in the user guide for some
1609 /// guidelines.
1610 ///
1611 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1612 #[derive(Clone, Debug, PartialEq)]
1613 #[non_exhaustive]
1614 pub enum DatabaseType {
1615 /// Not used.
1616 Unspecified,
1617 /// Firestore Native Mode
1618 FirestoreNative,
1619 /// Firestore in Datastore Mode.
1620 DatastoreMode,
1621 /// If set, the enum was initialized with an unknown value.
1622 ///
1623 /// Applications can examine the value using [DatabaseType::value] or
1624 /// [DatabaseType::name].
1625 UnknownValue(database_type::UnknownValue),
1626 }
1627
1628 #[doc(hidden)]
1629 pub mod database_type {
1630 #[allow(unused_imports)]
1631 use super::*;
1632 #[derive(Clone, Debug, PartialEq)]
1633 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1634 }
1635
1636 impl DatabaseType {
1637 /// Gets the enum value.
1638 ///
1639 /// Returns `None` if the enum contains an unknown value deserialized from
1640 /// the string representation of enums.
1641 pub fn value(&self) -> std::option::Option<i32> {
1642 match self {
1643 Self::Unspecified => std::option::Option::Some(0),
1644 Self::FirestoreNative => std::option::Option::Some(1),
1645 Self::DatastoreMode => std::option::Option::Some(2),
1646 Self::UnknownValue(u) => u.0.value(),
1647 }
1648 }
1649
1650 /// Gets the enum value as a string.
1651 ///
1652 /// Returns `None` if the enum contains an unknown value deserialized from
1653 /// the integer representation of enums.
1654 pub fn name(&self) -> std::option::Option<&str> {
1655 match self {
1656 Self::Unspecified => std::option::Option::Some("DATABASE_TYPE_UNSPECIFIED"),
1657 Self::FirestoreNative => std::option::Option::Some("FIRESTORE_NATIVE"),
1658 Self::DatastoreMode => std::option::Option::Some("DATASTORE_MODE"),
1659 Self::UnknownValue(u) => u.0.name(),
1660 }
1661 }
1662 }
1663
1664 impl std::default::Default for DatabaseType {
1665 fn default() -> Self {
1666 use std::convert::From;
1667 Self::from(0)
1668 }
1669 }
1670
1671 impl std::fmt::Display for DatabaseType {
1672 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1673 wkt::internal::display_enum(f, self.name(), self.value())
1674 }
1675 }
1676
1677 impl std::convert::From<i32> for DatabaseType {
1678 fn from(value: i32) -> Self {
1679 match value {
1680 0 => Self::Unspecified,
1681 1 => Self::FirestoreNative,
1682 2 => Self::DatastoreMode,
1683 _ => Self::UnknownValue(database_type::UnknownValue(
1684 wkt::internal::UnknownEnumValue::Integer(value),
1685 )),
1686 }
1687 }
1688 }
1689
1690 impl std::convert::From<&str> for DatabaseType {
1691 fn from(value: &str) -> Self {
1692 use std::string::ToString;
1693 match value {
1694 "DATABASE_TYPE_UNSPECIFIED" => Self::Unspecified,
1695 "FIRESTORE_NATIVE" => Self::FirestoreNative,
1696 "DATASTORE_MODE" => Self::DatastoreMode,
1697 _ => Self::UnknownValue(database_type::UnknownValue(
1698 wkt::internal::UnknownEnumValue::String(value.to_string()),
1699 )),
1700 }
1701 }
1702 }
1703
1704 impl serde::ser::Serialize for DatabaseType {
1705 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1706 where
1707 S: serde::Serializer,
1708 {
1709 match self {
1710 Self::Unspecified => serializer.serialize_i32(0),
1711 Self::FirestoreNative => serializer.serialize_i32(1),
1712 Self::DatastoreMode => serializer.serialize_i32(2),
1713 Self::UnknownValue(u) => u.0.serialize(serializer),
1714 }
1715 }
1716 }
1717
1718 impl<'de> serde::de::Deserialize<'de> for DatabaseType {
1719 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1720 where
1721 D: serde::Deserializer<'de>,
1722 {
1723 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseType>::new(
1724 ".google.firestore.admin.v1.Database.DatabaseType",
1725 ))
1726 }
1727 }
1728
1729 /// The type of concurrency control mode for transactions.
1730 ///
1731 /// # Working with unknown values
1732 ///
1733 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1734 /// additional enum variants at any time. Adding new variants is not considered
1735 /// a breaking change. Applications should write their code in anticipation of:
1736 ///
1737 /// - New values appearing in future releases of the client library, **and**
1738 /// - New values received dynamically, without application changes.
1739 ///
1740 /// Please consult the [Working with enums] section in the user guide for some
1741 /// guidelines.
1742 ///
1743 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1744 #[derive(Clone, Debug, PartialEq)]
1745 #[non_exhaustive]
1746 pub enum ConcurrencyMode {
1747 /// Not used.
1748 Unspecified,
1749 /// Use optimistic concurrency control by default. This mode is available
1750 /// for Cloud Firestore databases.
1751 Optimistic,
1752 /// Use pessimistic concurrency control by default. This mode is available
1753 /// for Cloud Firestore databases.
1754 ///
1755 /// This is the default setting for Cloud Firestore.
1756 Pessimistic,
1757 /// Use optimistic concurrency control with entity groups by default.
1758 ///
1759 /// This is the only available mode for Cloud Datastore.
1760 ///
1761 /// This mode is also available for Cloud Firestore with Datastore Mode but
1762 /// is not recommended.
1763 OptimisticWithEntityGroups,
1764 /// If set, the enum was initialized with an unknown value.
1765 ///
1766 /// Applications can examine the value using [ConcurrencyMode::value] or
1767 /// [ConcurrencyMode::name].
1768 UnknownValue(concurrency_mode::UnknownValue),
1769 }
1770
1771 #[doc(hidden)]
1772 pub mod concurrency_mode {
1773 #[allow(unused_imports)]
1774 use super::*;
1775 #[derive(Clone, Debug, PartialEq)]
1776 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1777 }
1778
1779 impl ConcurrencyMode {
1780 /// Gets the enum value.
1781 ///
1782 /// Returns `None` if the enum contains an unknown value deserialized from
1783 /// the string representation of enums.
1784 pub fn value(&self) -> std::option::Option<i32> {
1785 match self {
1786 Self::Unspecified => std::option::Option::Some(0),
1787 Self::Optimistic => std::option::Option::Some(1),
1788 Self::Pessimistic => std::option::Option::Some(2),
1789 Self::OptimisticWithEntityGroups => std::option::Option::Some(3),
1790 Self::UnknownValue(u) => u.0.value(),
1791 }
1792 }
1793
1794 /// Gets the enum value as a string.
1795 ///
1796 /// Returns `None` if the enum contains an unknown value deserialized from
1797 /// the integer representation of enums.
1798 pub fn name(&self) -> std::option::Option<&str> {
1799 match self {
1800 Self::Unspecified => std::option::Option::Some("CONCURRENCY_MODE_UNSPECIFIED"),
1801 Self::Optimistic => std::option::Option::Some("OPTIMISTIC"),
1802 Self::Pessimistic => std::option::Option::Some("PESSIMISTIC"),
1803 Self::OptimisticWithEntityGroups => {
1804 std::option::Option::Some("OPTIMISTIC_WITH_ENTITY_GROUPS")
1805 }
1806 Self::UnknownValue(u) => u.0.name(),
1807 }
1808 }
1809 }
1810
1811 impl std::default::Default for ConcurrencyMode {
1812 fn default() -> Self {
1813 use std::convert::From;
1814 Self::from(0)
1815 }
1816 }
1817
1818 impl std::fmt::Display for ConcurrencyMode {
1819 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1820 wkt::internal::display_enum(f, self.name(), self.value())
1821 }
1822 }
1823
1824 impl std::convert::From<i32> for ConcurrencyMode {
1825 fn from(value: i32) -> Self {
1826 match value {
1827 0 => Self::Unspecified,
1828 1 => Self::Optimistic,
1829 2 => Self::Pessimistic,
1830 3 => Self::OptimisticWithEntityGroups,
1831 _ => Self::UnknownValue(concurrency_mode::UnknownValue(
1832 wkt::internal::UnknownEnumValue::Integer(value),
1833 )),
1834 }
1835 }
1836 }
1837
1838 impl std::convert::From<&str> for ConcurrencyMode {
1839 fn from(value: &str) -> Self {
1840 use std::string::ToString;
1841 match value {
1842 "CONCURRENCY_MODE_UNSPECIFIED" => Self::Unspecified,
1843 "OPTIMISTIC" => Self::Optimistic,
1844 "PESSIMISTIC" => Self::Pessimistic,
1845 "OPTIMISTIC_WITH_ENTITY_GROUPS" => Self::OptimisticWithEntityGroups,
1846 _ => Self::UnknownValue(concurrency_mode::UnknownValue(
1847 wkt::internal::UnknownEnumValue::String(value.to_string()),
1848 )),
1849 }
1850 }
1851 }
1852
1853 impl serde::ser::Serialize for ConcurrencyMode {
1854 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1855 where
1856 S: serde::Serializer,
1857 {
1858 match self {
1859 Self::Unspecified => serializer.serialize_i32(0),
1860 Self::Optimistic => serializer.serialize_i32(1),
1861 Self::Pessimistic => serializer.serialize_i32(2),
1862 Self::OptimisticWithEntityGroups => serializer.serialize_i32(3),
1863 Self::UnknownValue(u) => u.0.serialize(serializer),
1864 }
1865 }
1866 }
1867
1868 impl<'de> serde::de::Deserialize<'de> for ConcurrencyMode {
1869 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1870 where
1871 D: serde::Deserializer<'de>,
1872 {
1873 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConcurrencyMode>::new(
1874 ".google.firestore.admin.v1.Database.ConcurrencyMode",
1875 ))
1876 }
1877 }
1878
1879 /// Point In Time Recovery feature enablement.
1880 ///
1881 /// # Working with unknown values
1882 ///
1883 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1884 /// additional enum variants at any time. Adding new variants is not considered
1885 /// a breaking change. Applications should write their code in anticipation of:
1886 ///
1887 /// - New values appearing in future releases of the client library, **and**
1888 /// - New values received dynamically, without application changes.
1889 ///
1890 /// Please consult the [Working with enums] section in the user guide for some
1891 /// guidelines.
1892 ///
1893 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1894 #[derive(Clone, Debug, PartialEq)]
1895 #[non_exhaustive]
1896 pub enum PointInTimeRecoveryEnablement {
1897 /// Not used.
1898 Unspecified,
1899 /// Reads are supported on selected versions of the data from within the past
1900 /// 7 days:
1901 ///
1902 /// * Reads against any timestamp within the past hour
1903 /// * Reads against 1-minute snapshots beyond 1 hour and within 7 days
1904 ///
1905 /// `version_retention_period` and `earliest_version_time` can be
1906 /// used to determine the supported versions.
1907 PointInTimeRecoveryEnabled,
1908 /// Reads are supported on any version of the data from within the past 1
1909 /// hour.
1910 PointInTimeRecoveryDisabled,
1911 /// If set, the enum was initialized with an unknown value.
1912 ///
1913 /// Applications can examine the value using [PointInTimeRecoveryEnablement::value] or
1914 /// [PointInTimeRecoveryEnablement::name].
1915 UnknownValue(point_in_time_recovery_enablement::UnknownValue),
1916 }
1917
1918 #[doc(hidden)]
1919 pub mod point_in_time_recovery_enablement {
1920 #[allow(unused_imports)]
1921 use super::*;
1922 #[derive(Clone, Debug, PartialEq)]
1923 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1924 }
1925
1926 impl PointInTimeRecoveryEnablement {
1927 /// Gets the enum value.
1928 ///
1929 /// Returns `None` if the enum contains an unknown value deserialized from
1930 /// the string representation of enums.
1931 pub fn value(&self) -> std::option::Option<i32> {
1932 match self {
1933 Self::Unspecified => std::option::Option::Some(0),
1934 Self::PointInTimeRecoveryEnabled => std::option::Option::Some(1),
1935 Self::PointInTimeRecoveryDisabled => std::option::Option::Some(2),
1936 Self::UnknownValue(u) => u.0.value(),
1937 }
1938 }
1939
1940 /// Gets the enum value as a string.
1941 ///
1942 /// Returns `None` if the enum contains an unknown value deserialized from
1943 /// the integer representation of enums.
1944 pub fn name(&self) -> std::option::Option<&str> {
1945 match self {
1946 Self::Unspecified => {
1947 std::option::Option::Some("POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED")
1948 }
1949 Self::PointInTimeRecoveryEnabled => {
1950 std::option::Option::Some("POINT_IN_TIME_RECOVERY_ENABLED")
1951 }
1952 Self::PointInTimeRecoveryDisabled => {
1953 std::option::Option::Some("POINT_IN_TIME_RECOVERY_DISABLED")
1954 }
1955 Self::UnknownValue(u) => u.0.name(),
1956 }
1957 }
1958 }
1959
1960 impl std::default::Default for PointInTimeRecoveryEnablement {
1961 fn default() -> Self {
1962 use std::convert::From;
1963 Self::from(0)
1964 }
1965 }
1966
1967 impl std::fmt::Display for PointInTimeRecoveryEnablement {
1968 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1969 wkt::internal::display_enum(f, self.name(), self.value())
1970 }
1971 }
1972
1973 impl std::convert::From<i32> for PointInTimeRecoveryEnablement {
1974 fn from(value: i32) -> Self {
1975 match value {
1976 0 => Self::Unspecified,
1977 1 => Self::PointInTimeRecoveryEnabled,
1978 2 => Self::PointInTimeRecoveryDisabled,
1979 _ => Self::UnknownValue(point_in_time_recovery_enablement::UnknownValue(
1980 wkt::internal::UnknownEnumValue::Integer(value),
1981 )),
1982 }
1983 }
1984 }
1985
1986 impl std::convert::From<&str> for PointInTimeRecoveryEnablement {
1987 fn from(value: &str) -> Self {
1988 use std::string::ToString;
1989 match value {
1990 "POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED" => Self::Unspecified,
1991 "POINT_IN_TIME_RECOVERY_ENABLED" => Self::PointInTimeRecoveryEnabled,
1992 "POINT_IN_TIME_RECOVERY_DISABLED" => Self::PointInTimeRecoveryDisabled,
1993 _ => Self::UnknownValue(point_in_time_recovery_enablement::UnknownValue(
1994 wkt::internal::UnknownEnumValue::String(value.to_string()),
1995 )),
1996 }
1997 }
1998 }
1999
2000 impl serde::ser::Serialize for PointInTimeRecoveryEnablement {
2001 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2002 where
2003 S: serde::Serializer,
2004 {
2005 match self {
2006 Self::Unspecified => serializer.serialize_i32(0),
2007 Self::PointInTimeRecoveryEnabled => serializer.serialize_i32(1),
2008 Self::PointInTimeRecoveryDisabled => serializer.serialize_i32(2),
2009 Self::UnknownValue(u) => u.0.serialize(serializer),
2010 }
2011 }
2012 }
2013
2014 impl<'de> serde::de::Deserialize<'de> for PointInTimeRecoveryEnablement {
2015 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2016 where
2017 D: serde::Deserializer<'de>,
2018 {
2019 deserializer.deserialize_any(
2020 wkt::internal::EnumVisitor::<PointInTimeRecoveryEnablement>::new(
2021 ".google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement",
2022 ),
2023 )
2024 }
2025 }
2026
2027 /// The type of App Engine integration mode.
2028 ///
2029 /// # Working with unknown values
2030 ///
2031 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2032 /// additional enum variants at any time. Adding new variants is not considered
2033 /// a breaking change. Applications should write their code in anticipation of:
2034 ///
2035 /// - New values appearing in future releases of the client library, **and**
2036 /// - New values received dynamically, without application changes.
2037 ///
2038 /// Please consult the [Working with enums] section in the user guide for some
2039 /// guidelines.
2040 ///
2041 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2042 #[derive(Clone, Debug, PartialEq)]
2043 #[non_exhaustive]
2044 pub enum AppEngineIntegrationMode {
2045 /// Not used.
2046 Unspecified,
2047 /// If an App Engine application exists in the same region as this database,
2048 /// App Engine configuration will impact this database. This includes
2049 /// disabling of the application & database, as well as disabling writes to
2050 /// the database.
2051 Enabled,
2052 /// App Engine has no effect on the ability of this database to serve
2053 /// requests.
2054 ///
2055 /// This is the default setting for databases created with the Firestore API.
2056 Disabled,
2057 /// If set, the enum was initialized with an unknown value.
2058 ///
2059 /// Applications can examine the value using [AppEngineIntegrationMode::value] or
2060 /// [AppEngineIntegrationMode::name].
2061 UnknownValue(app_engine_integration_mode::UnknownValue),
2062 }
2063
2064 #[doc(hidden)]
2065 pub mod app_engine_integration_mode {
2066 #[allow(unused_imports)]
2067 use super::*;
2068 #[derive(Clone, Debug, PartialEq)]
2069 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2070 }
2071
2072 impl AppEngineIntegrationMode {
2073 /// Gets the enum value.
2074 ///
2075 /// Returns `None` if the enum contains an unknown value deserialized from
2076 /// the string representation of enums.
2077 pub fn value(&self) -> std::option::Option<i32> {
2078 match self {
2079 Self::Unspecified => std::option::Option::Some(0),
2080 Self::Enabled => std::option::Option::Some(1),
2081 Self::Disabled => std::option::Option::Some(2),
2082 Self::UnknownValue(u) => u.0.value(),
2083 }
2084 }
2085
2086 /// Gets the enum value as a string.
2087 ///
2088 /// Returns `None` if the enum contains an unknown value deserialized from
2089 /// the integer representation of enums.
2090 pub fn name(&self) -> std::option::Option<&str> {
2091 match self {
2092 Self::Unspecified => {
2093 std::option::Option::Some("APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED")
2094 }
2095 Self::Enabled => std::option::Option::Some("ENABLED"),
2096 Self::Disabled => std::option::Option::Some("DISABLED"),
2097 Self::UnknownValue(u) => u.0.name(),
2098 }
2099 }
2100 }
2101
2102 impl std::default::Default for AppEngineIntegrationMode {
2103 fn default() -> Self {
2104 use std::convert::From;
2105 Self::from(0)
2106 }
2107 }
2108
2109 impl std::fmt::Display for AppEngineIntegrationMode {
2110 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2111 wkt::internal::display_enum(f, self.name(), self.value())
2112 }
2113 }
2114
2115 impl std::convert::From<i32> for AppEngineIntegrationMode {
2116 fn from(value: i32) -> Self {
2117 match value {
2118 0 => Self::Unspecified,
2119 1 => Self::Enabled,
2120 2 => Self::Disabled,
2121 _ => Self::UnknownValue(app_engine_integration_mode::UnknownValue(
2122 wkt::internal::UnknownEnumValue::Integer(value),
2123 )),
2124 }
2125 }
2126 }
2127
2128 impl std::convert::From<&str> for AppEngineIntegrationMode {
2129 fn from(value: &str) -> Self {
2130 use std::string::ToString;
2131 match value {
2132 "APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED" => Self::Unspecified,
2133 "ENABLED" => Self::Enabled,
2134 "DISABLED" => Self::Disabled,
2135 _ => Self::UnknownValue(app_engine_integration_mode::UnknownValue(
2136 wkt::internal::UnknownEnumValue::String(value.to_string()),
2137 )),
2138 }
2139 }
2140 }
2141
2142 impl serde::ser::Serialize for AppEngineIntegrationMode {
2143 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2144 where
2145 S: serde::Serializer,
2146 {
2147 match self {
2148 Self::Unspecified => serializer.serialize_i32(0),
2149 Self::Enabled => serializer.serialize_i32(1),
2150 Self::Disabled => serializer.serialize_i32(2),
2151 Self::UnknownValue(u) => u.0.serialize(serializer),
2152 }
2153 }
2154 }
2155
2156 impl<'de> serde::de::Deserialize<'de> for AppEngineIntegrationMode {
2157 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2158 where
2159 D: serde::Deserializer<'de>,
2160 {
2161 deserializer.deserialize_any(
2162 wkt::internal::EnumVisitor::<AppEngineIntegrationMode>::new(
2163 ".google.firestore.admin.v1.Database.AppEngineIntegrationMode",
2164 ),
2165 )
2166 }
2167 }
2168
2169 /// The delete protection state of the database.
2170 ///
2171 /// # Working with unknown values
2172 ///
2173 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2174 /// additional enum variants at any time. Adding new variants is not considered
2175 /// a breaking change. Applications should write their code in anticipation of:
2176 ///
2177 /// - New values appearing in future releases of the client library, **and**
2178 /// - New values received dynamically, without application changes.
2179 ///
2180 /// Please consult the [Working with enums] section in the user guide for some
2181 /// guidelines.
2182 ///
2183 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2184 #[derive(Clone, Debug, PartialEq)]
2185 #[non_exhaustive]
2186 pub enum DeleteProtectionState {
2187 /// The default value. Delete protection type is not specified
2188 Unspecified,
2189 /// Delete protection is disabled
2190 DeleteProtectionDisabled,
2191 /// Delete protection is enabled
2192 DeleteProtectionEnabled,
2193 /// If set, the enum was initialized with an unknown value.
2194 ///
2195 /// Applications can examine the value using [DeleteProtectionState::value] or
2196 /// [DeleteProtectionState::name].
2197 UnknownValue(delete_protection_state::UnknownValue),
2198 }
2199
2200 #[doc(hidden)]
2201 pub mod delete_protection_state {
2202 #[allow(unused_imports)]
2203 use super::*;
2204 #[derive(Clone, Debug, PartialEq)]
2205 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2206 }
2207
2208 impl DeleteProtectionState {
2209 /// Gets the enum value.
2210 ///
2211 /// Returns `None` if the enum contains an unknown value deserialized from
2212 /// the string representation of enums.
2213 pub fn value(&self) -> std::option::Option<i32> {
2214 match self {
2215 Self::Unspecified => std::option::Option::Some(0),
2216 Self::DeleteProtectionDisabled => std::option::Option::Some(1),
2217 Self::DeleteProtectionEnabled => std::option::Option::Some(2),
2218 Self::UnknownValue(u) => u.0.value(),
2219 }
2220 }
2221
2222 /// Gets the enum value as a string.
2223 ///
2224 /// Returns `None` if the enum contains an unknown value deserialized from
2225 /// the integer representation of enums.
2226 pub fn name(&self) -> std::option::Option<&str> {
2227 match self {
2228 Self::Unspecified => {
2229 std::option::Option::Some("DELETE_PROTECTION_STATE_UNSPECIFIED")
2230 }
2231 Self::DeleteProtectionDisabled => {
2232 std::option::Option::Some("DELETE_PROTECTION_DISABLED")
2233 }
2234 Self::DeleteProtectionEnabled => {
2235 std::option::Option::Some("DELETE_PROTECTION_ENABLED")
2236 }
2237 Self::UnknownValue(u) => u.0.name(),
2238 }
2239 }
2240 }
2241
2242 impl std::default::Default for DeleteProtectionState {
2243 fn default() -> Self {
2244 use std::convert::From;
2245 Self::from(0)
2246 }
2247 }
2248
2249 impl std::fmt::Display for DeleteProtectionState {
2250 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2251 wkt::internal::display_enum(f, self.name(), self.value())
2252 }
2253 }
2254
2255 impl std::convert::From<i32> for DeleteProtectionState {
2256 fn from(value: i32) -> Self {
2257 match value {
2258 0 => Self::Unspecified,
2259 1 => Self::DeleteProtectionDisabled,
2260 2 => Self::DeleteProtectionEnabled,
2261 _ => Self::UnknownValue(delete_protection_state::UnknownValue(
2262 wkt::internal::UnknownEnumValue::Integer(value),
2263 )),
2264 }
2265 }
2266 }
2267
2268 impl std::convert::From<&str> for DeleteProtectionState {
2269 fn from(value: &str) -> Self {
2270 use std::string::ToString;
2271 match value {
2272 "DELETE_PROTECTION_STATE_UNSPECIFIED" => Self::Unspecified,
2273 "DELETE_PROTECTION_DISABLED" => Self::DeleteProtectionDisabled,
2274 "DELETE_PROTECTION_ENABLED" => Self::DeleteProtectionEnabled,
2275 _ => Self::UnknownValue(delete_protection_state::UnknownValue(
2276 wkt::internal::UnknownEnumValue::String(value.to_string()),
2277 )),
2278 }
2279 }
2280 }
2281
2282 impl serde::ser::Serialize for DeleteProtectionState {
2283 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2284 where
2285 S: serde::Serializer,
2286 {
2287 match self {
2288 Self::Unspecified => serializer.serialize_i32(0),
2289 Self::DeleteProtectionDisabled => serializer.serialize_i32(1),
2290 Self::DeleteProtectionEnabled => serializer.serialize_i32(2),
2291 Self::UnknownValue(u) => u.0.serialize(serializer),
2292 }
2293 }
2294 }
2295
2296 impl<'de> serde::de::Deserialize<'de> for DeleteProtectionState {
2297 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2298 where
2299 D: serde::Deserializer<'de>,
2300 {
2301 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeleteProtectionState>::new(
2302 ".google.firestore.admin.v1.Database.DeleteProtectionState",
2303 ))
2304 }
2305 }
2306
2307 /// The edition of the database.
2308 ///
2309 /// # Working with unknown values
2310 ///
2311 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2312 /// additional enum variants at any time. Adding new variants is not considered
2313 /// a breaking change. Applications should write their code in anticipation of:
2314 ///
2315 /// - New values appearing in future releases of the client library, **and**
2316 /// - New values received dynamically, without application changes.
2317 ///
2318 /// Please consult the [Working with enums] section in the user guide for some
2319 /// guidelines.
2320 ///
2321 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2322 #[derive(Clone, Debug, PartialEq)]
2323 #[non_exhaustive]
2324 pub enum DatabaseEdition {
2325 /// Not used.
2326 Unspecified,
2327 /// Standard edition.
2328 ///
2329 /// This is the default setting if not specified.
2330 Standard,
2331 /// Enterprise edition.
2332 Enterprise,
2333 /// If set, the enum was initialized with an unknown value.
2334 ///
2335 /// Applications can examine the value using [DatabaseEdition::value] or
2336 /// [DatabaseEdition::name].
2337 UnknownValue(database_edition::UnknownValue),
2338 }
2339
2340 #[doc(hidden)]
2341 pub mod database_edition {
2342 #[allow(unused_imports)]
2343 use super::*;
2344 #[derive(Clone, Debug, PartialEq)]
2345 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2346 }
2347
2348 impl DatabaseEdition {
2349 /// Gets the enum value.
2350 ///
2351 /// Returns `None` if the enum contains an unknown value deserialized from
2352 /// the string representation of enums.
2353 pub fn value(&self) -> std::option::Option<i32> {
2354 match self {
2355 Self::Unspecified => std::option::Option::Some(0),
2356 Self::Standard => std::option::Option::Some(1),
2357 Self::Enterprise => std::option::Option::Some(2),
2358 Self::UnknownValue(u) => u.0.value(),
2359 }
2360 }
2361
2362 /// Gets the enum value as a string.
2363 ///
2364 /// Returns `None` if the enum contains an unknown value deserialized from
2365 /// the integer representation of enums.
2366 pub fn name(&self) -> std::option::Option<&str> {
2367 match self {
2368 Self::Unspecified => std::option::Option::Some("DATABASE_EDITION_UNSPECIFIED"),
2369 Self::Standard => std::option::Option::Some("STANDARD"),
2370 Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
2371 Self::UnknownValue(u) => u.0.name(),
2372 }
2373 }
2374 }
2375
2376 impl std::default::Default for DatabaseEdition {
2377 fn default() -> Self {
2378 use std::convert::From;
2379 Self::from(0)
2380 }
2381 }
2382
2383 impl std::fmt::Display for DatabaseEdition {
2384 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2385 wkt::internal::display_enum(f, self.name(), self.value())
2386 }
2387 }
2388
2389 impl std::convert::From<i32> for DatabaseEdition {
2390 fn from(value: i32) -> Self {
2391 match value {
2392 0 => Self::Unspecified,
2393 1 => Self::Standard,
2394 2 => Self::Enterprise,
2395 _ => Self::UnknownValue(database_edition::UnknownValue(
2396 wkt::internal::UnknownEnumValue::Integer(value),
2397 )),
2398 }
2399 }
2400 }
2401
2402 impl std::convert::From<&str> for DatabaseEdition {
2403 fn from(value: &str) -> Self {
2404 use std::string::ToString;
2405 match value {
2406 "DATABASE_EDITION_UNSPECIFIED" => Self::Unspecified,
2407 "STANDARD" => Self::Standard,
2408 "ENTERPRISE" => Self::Enterprise,
2409 _ => Self::UnknownValue(database_edition::UnknownValue(
2410 wkt::internal::UnknownEnumValue::String(value.to_string()),
2411 )),
2412 }
2413 }
2414 }
2415
2416 impl serde::ser::Serialize for DatabaseEdition {
2417 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2418 where
2419 S: serde::Serializer,
2420 {
2421 match self {
2422 Self::Unspecified => serializer.serialize_i32(0),
2423 Self::Standard => serializer.serialize_i32(1),
2424 Self::Enterprise => serializer.serialize_i32(2),
2425 Self::UnknownValue(u) => u.0.serialize(serializer),
2426 }
2427 }
2428 }
2429
2430 impl<'de> serde::de::Deserialize<'de> for DatabaseEdition {
2431 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2432 where
2433 D: serde::Deserializer<'de>,
2434 {
2435 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseEdition>::new(
2436 ".google.firestore.admin.v1.Database.DatabaseEdition",
2437 ))
2438 }
2439 }
2440}
2441
2442/// Represents a single field in the database.
2443///
2444/// Fields are grouped by their "Collection Group", which represent all
2445/// collections in the database with the same ID.
2446#[derive(Clone, Default, PartialEq)]
2447#[non_exhaustive]
2448pub struct Field {
2449 /// Required. A field name of the form:
2450 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
2451 ///
2452 /// A field path can be a simple field name, e.g. `address` or a path to fields
2453 /// within `map_value` , e.g. `address.city`,
2454 /// or a special field path. The only valid special field is `*`, which
2455 /// represents any field.
2456 ///
2457 /// Field paths can be quoted using `` ` `` (backtick). The only character that
2458 /// must be escaped within a quoted field path is the backtick character
2459 /// itself, escaped using a backslash. Special characters in field paths that
2460 /// must be quoted include: `*`, `.`,
2461 /// `` ` `` (backtick), `[`, `]`, as well as any ascii symbolic characters.
2462 ///
2463 /// Examples:
2464 /// `` `address.city` `` represents a field named `address.city`, not the map
2465 /// key `city` in the field `address`. `` `*` `` represents a field named `*`,
2466 /// not any field.
2467 ///
2468 /// A special `Field` contains the default indexing settings for all fields.
2469 /// This field's resource name is:
2470 /// `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`
2471 /// Indexes defined on this `Field` will be applied to all fields which do not
2472 /// have their own `Field` index configuration.
2473 pub name: std::string::String,
2474
2475 /// The index configuration for this field. If unset, field indexing will
2476 /// revert to the configuration defined by the `ancestor_field`. To
2477 /// explicitly remove all indexes for this field, specify an index config
2478 /// with an empty list of indexes.
2479 pub index_config: std::option::Option<crate::model::field::IndexConfig>,
2480
2481 /// The TTL configuration for this `Field`.
2482 /// Setting or unsetting this will enable or disable the TTL for
2483 /// documents that have this `Field`.
2484 pub ttl_config: std::option::Option<crate::model::field::TtlConfig>,
2485
2486 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2487}
2488
2489impl Field {
2490 pub fn new() -> Self {
2491 std::default::Default::default()
2492 }
2493
2494 /// Sets the value of [name][crate::model::Field::name].
2495 ///
2496 /// # Example
2497 /// ```ignore,no_run
2498 /// # use google_cloud_firestore_admin_v1::model::Field;
2499 /// let x = Field::new().set_name("example");
2500 /// ```
2501 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2502 self.name = v.into();
2503 self
2504 }
2505
2506 /// Sets the value of [index_config][crate::model::Field::index_config].
2507 ///
2508 /// # Example
2509 /// ```ignore,no_run
2510 /// # use google_cloud_firestore_admin_v1::model::Field;
2511 /// use google_cloud_firestore_admin_v1::model::field::IndexConfig;
2512 /// let x = Field::new().set_index_config(IndexConfig::default()/* use setters */);
2513 /// ```
2514 pub fn set_index_config<T>(mut self, v: T) -> Self
2515 where
2516 T: std::convert::Into<crate::model::field::IndexConfig>,
2517 {
2518 self.index_config = std::option::Option::Some(v.into());
2519 self
2520 }
2521
2522 /// Sets or clears the value of [index_config][crate::model::Field::index_config].
2523 ///
2524 /// # Example
2525 /// ```ignore,no_run
2526 /// # use google_cloud_firestore_admin_v1::model::Field;
2527 /// use google_cloud_firestore_admin_v1::model::field::IndexConfig;
2528 /// let x = Field::new().set_or_clear_index_config(Some(IndexConfig::default()/* use setters */));
2529 /// let x = Field::new().set_or_clear_index_config(None::<IndexConfig>);
2530 /// ```
2531 pub fn set_or_clear_index_config<T>(mut self, v: std::option::Option<T>) -> Self
2532 where
2533 T: std::convert::Into<crate::model::field::IndexConfig>,
2534 {
2535 self.index_config = v.map(|x| x.into());
2536 self
2537 }
2538
2539 /// Sets the value of [ttl_config][crate::model::Field::ttl_config].
2540 ///
2541 /// # Example
2542 /// ```ignore,no_run
2543 /// # use google_cloud_firestore_admin_v1::model::Field;
2544 /// use google_cloud_firestore_admin_v1::model::field::TtlConfig;
2545 /// let x = Field::new().set_ttl_config(TtlConfig::default()/* use setters */);
2546 /// ```
2547 pub fn set_ttl_config<T>(mut self, v: T) -> Self
2548 where
2549 T: std::convert::Into<crate::model::field::TtlConfig>,
2550 {
2551 self.ttl_config = std::option::Option::Some(v.into());
2552 self
2553 }
2554
2555 /// Sets or clears the value of [ttl_config][crate::model::Field::ttl_config].
2556 ///
2557 /// # Example
2558 /// ```ignore,no_run
2559 /// # use google_cloud_firestore_admin_v1::model::Field;
2560 /// use google_cloud_firestore_admin_v1::model::field::TtlConfig;
2561 /// let x = Field::new().set_or_clear_ttl_config(Some(TtlConfig::default()/* use setters */));
2562 /// let x = Field::new().set_or_clear_ttl_config(None::<TtlConfig>);
2563 /// ```
2564 pub fn set_or_clear_ttl_config<T>(mut self, v: std::option::Option<T>) -> Self
2565 where
2566 T: std::convert::Into<crate::model::field::TtlConfig>,
2567 {
2568 self.ttl_config = v.map(|x| x.into());
2569 self
2570 }
2571}
2572
2573impl wkt::message::Message for Field {
2574 fn typename() -> &'static str {
2575 "type.googleapis.com/google.firestore.admin.v1.Field"
2576 }
2577}
2578
2579/// Defines additional types related to [Field].
2580pub mod field {
2581 #[allow(unused_imports)]
2582 use super::*;
2583
2584 /// The index configuration for this field.
2585 #[derive(Clone, Default, PartialEq)]
2586 #[non_exhaustive]
2587 pub struct IndexConfig {
2588 /// The indexes supported for this field.
2589 pub indexes: std::vec::Vec<crate::model::Index>,
2590
2591 /// Output only. When true, the `Field`'s index configuration is set from the
2592 /// configuration specified by the `ancestor_field`.
2593 /// When false, the `Field`'s index configuration is defined explicitly.
2594 pub uses_ancestor_config: bool,
2595
2596 /// Output only. Specifies the resource name of the `Field` from which this
2597 /// field's index configuration is set (when `uses_ancestor_config` is true),
2598 /// or from which it *would* be set if this field had no index configuration
2599 /// (when `uses_ancestor_config` is false).
2600 pub ancestor_field: std::string::String,
2601
2602 /// Output only
2603 /// When true, the `Field`'s index configuration is in the process of being
2604 /// reverted. Once complete, the index config will transition to the same
2605 /// state as the field specified by `ancestor_field`, at which point
2606 /// `uses_ancestor_config` will be `true` and `reverting` will be `false`.
2607 pub reverting: bool,
2608
2609 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2610 }
2611
2612 impl IndexConfig {
2613 pub fn new() -> Self {
2614 std::default::Default::default()
2615 }
2616
2617 /// Sets the value of [indexes][crate::model::field::IndexConfig::indexes].
2618 ///
2619 /// # Example
2620 /// ```ignore,no_run
2621 /// # use google_cloud_firestore_admin_v1::model::field::IndexConfig;
2622 /// use google_cloud_firestore_admin_v1::model::Index;
2623 /// let x = IndexConfig::new()
2624 /// .set_indexes([
2625 /// Index::default()/* use setters */,
2626 /// Index::default()/* use (different) setters */,
2627 /// ]);
2628 /// ```
2629 pub fn set_indexes<T, V>(mut self, v: T) -> Self
2630 where
2631 T: std::iter::IntoIterator<Item = V>,
2632 V: std::convert::Into<crate::model::Index>,
2633 {
2634 use std::iter::Iterator;
2635 self.indexes = v.into_iter().map(|i| i.into()).collect();
2636 self
2637 }
2638
2639 /// Sets the value of [uses_ancestor_config][crate::model::field::IndexConfig::uses_ancestor_config].
2640 ///
2641 /// # Example
2642 /// ```ignore,no_run
2643 /// # use google_cloud_firestore_admin_v1::model::field::IndexConfig;
2644 /// let x = IndexConfig::new().set_uses_ancestor_config(true);
2645 /// ```
2646 pub fn set_uses_ancestor_config<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2647 self.uses_ancestor_config = v.into();
2648 self
2649 }
2650
2651 /// Sets the value of [ancestor_field][crate::model::field::IndexConfig::ancestor_field].
2652 ///
2653 /// # Example
2654 /// ```ignore,no_run
2655 /// # use google_cloud_firestore_admin_v1::model::field::IndexConfig;
2656 /// let x = IndexConfig::new().set_ancestor_field("example");
2657 /// ```
2658 pub fn set_ancestor_field<T: std::convert::Into<std::string::String>>(
2659 mut self,
2660 v: T,
2661 ) -> Self {
2662 self.ancestor_field = v.into();
2663 self
2664 }
2665
2666 /// Sets the value of [reverting][crate::model::field::IndexConfig::reverting].
2667 ///
2668 /// # Example
2669 /// ```ignore,no_run
2670 /// # use google_cloud_firestore_admin_v1::model::field::IndexConfig;
2671 /// let x = IndexConfig::new().set_reverting(true);
2672 /// ```
2673 pub fn set_reverting<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2674 self.reverting = v.into();
2675 self
2676 }
2677 }
2678
2679 impl wkt::message::Message for IndexConfig {
2680 fn typename() -> &'static str {
2681 "type.googleapis.com/google.firestore.admin.v1.Field.IndexConfig"
2682 }
2683 }
2684
2685 /// The TTL (time-to-live) configuration for documents that have this `Field`
2686 /// set.
2687 ///
2688 /// Storing a timestamp value into a TTL-enabled field will be treated as
2689 /// the document's absolute expiration time. Timestamp values in the past
2690 /// indicate that the document is eligible for immediate expiration. Using any
2691 /// other data type or leaving the field absent will disable expiration for the
2692 /// individual document.
2693 #[derive(Clone, Default, PartialEq)]
2694 #[non_exhaustive]
2695 pub struct TtlConfig {
2696 /// Output only. The state of the TTL configuration.
2697 pub state: crate::model::field::ttl_config::State,
2698
2699 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2700 }
2701
2702 impl TtlConfig {
2703 pub fn new() -> Self {
2704 std::default::Default::default()
2705 }
2706
2707 /// Sets the value of [state][crate::model::field::TtlConfig::state].
2708 ///
2709 /// # Example
2710 /// ```ignore,no_run
2711 /// # use google_cloud_firestore_admin_v1::model::field::TtlConfig;
2712 /// use google_cloud_firestore_admin_v1::model::field::ttl_config::State;
2713 /// let x0 = TtlConfig::new().set_state(State::Creating);
2714 /// let x1 = TtlConfig::new().set_state(State::Active);
2715 /// let x2 = TtlConfig::new().set_state(State::NeedsRepair);
2716 /// ```
2717 pub fn set_state<T: std::convert::Into<crate::model::field::ttl_config::State>>(
2718 mut self,
2719 v: T,
2720 ) -> Self {
2721 self.state = v.into();
2722 self
2723 }
2724 }
2725
2726 impl wkt::message::Message for TtlConfig {
2727 fn typename() -> &'static str {
2728 "type.googleapis.com/google.firestore.admin.v1.Field.TtlConfig"
2729 }
2730 }
2731
2732 /// Defines additional types related to [TtlConfig].
2733 pub mod ttl_config {
2734 #[allow(unused_imports)]
2735 use super::*;
2736
2737 /// The state of applying the TTL configuration to all documents.
2738 ///
2739 /// # Working with unknown values
2740 ///
2741 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2742 /// additional enum variants at any time. Adding new variants is not considered
2743 /// a breaking change. Applications should write their code in anticipation of:
2744 ///
2745 /// - New values appearing in future releases of the client library, **and**
2746 /// - New values received dynamically, without application changes.
2747 ///
2748 /// Please consult the [Working with enums] section in the user guide for some
2749 /// guidelines.
2750 ///
2751 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2752 #[derive(Clone, Debug, PartialEq)]
2753 #[non_exhaustive]
2754 pub enum State {
2755 /// The state is unspecified or unknown.
2756 Unspecified,
2757 /// The TTL is being applied. There is an active long-running operation to
2758 /// track the change. Newly written documents will have TTLs applied as
2759 /// requested. Requested TTLs on existing documents are still being
2760 /// processed. When TTLs on all existing documents have been processed, the
2761 /// state will move to 'ACTIVE'.
2762 Creating,
2763 /// The TTL is active for all documents.
2764 Active,
2765 /// The TTL configuration could not be enabled for all existing documents.
2766 /// Newly written documents will continue to have their TTL applied.
2767 /// The LRO returned when last attempting to enable TTL for this `Field`
2768 /// has failed, and may have more details.
2769 NeedsRepair,
2770 /// If set, the enum was initialized with an unknown value.
2771 ///
2772 /// Applications can examine the value using [State::value] or
2773 /// [State::name].
2774 UnknownValue(state::UnknownValue),
2775 }
2776
2777 #[doc(hidden)]
2778 pub mod state {
2779 #[allow(unused_imports)]
2780 use super::*;
2781 #[derive(Clone, Debug, PartialEq)]
2782 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2783 }
2784
2785 impl State {
2786 /// Gets the enum value.
2787 ///
2788 /// Returns `None` if the enum contains an unknown value deserialized from
2789 /// the string representation of enums.
2790 pub fn value(&self) -> std::option::Option<i32> {
2791 match self {
2792 Self::Unspecified => std::option::Option::Some(0),
2793 Self::Creating => std::option::Option::Some(1),
2794 Self::Active => std::option::Option::Some(2),
2795 Self::NeedsRepair => std::option::Option::Some(3),
2796 Self::UnknownValue(u) => u.0.value(),
2797 }
2798 }
2799
2800 /// Gets the enum value as a string.
2801 ///
2802 /// Returns `None` if the enum contains an unknown value deserialized from
2803 /// the integer representation of enums.
2804 pub fn name(&self) -> std::option::Option<&str> {
2805 match self {
2806 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2807 Self::Creating => std::option::Option::Some("CREATING"),
2808 Self::Active => std::option::Option::Some("ACTIVE"),
2809 Self::NeedsRepair => std::option::Option::Some("NEEDS_REPAIR"),
2810 Self::UnknownValue(u) => u.0.name(),
2811 }
2812 }
2813 }
2814
2815 impl std::default::Default for State {
2816 fn default() -> Self {
2817 use std::convert::From;
2818 Self::from(0)
2819 }
2820 }
2821
2822 impl std::fmt::Display for State {
2823 fn fmt(
2824 &self,
2825 f: &mut std::fmt::Formatter<'_>,
2826 ) -> std::result::Result<(), std::fmt::Error> {
2827 wkt::internal::display_enum(f, self.name(), self.value())
2828 }
2829 }
2830
2831 impl std::convert::From<i32> for State {
2832 fn from(value: i32) -> Self {
2833 match value {
2834 0 => Self::Unspecified,
2835 1 => Self::Creating,
2836 2 => Self::Active,
2837 3 => Self::NeedsRepair,
2838 _ => Self::UnknownValue(state::UnknownValue(
2839 wkt::internal::UnknownEnumValue::Integer(value),
2840 )),
2841 }
2842 }
2843 }
2844
2845 impl std::convert::From<&str> for State {
2846 fn from(value: &str) -> Self {
2847 use std::string::ToString;
2848 match value {
2849 "STATE_UNSPECIFIED" => Self::Unspecified,
2850 "CREATING" => Self::Creating,
2851 "ACTIVE" => Self::Active,
2852 "NEEDS_REPAIR" => Self::NeedsRepair,
2853 _ => Self::UnknownValue(state::UnknownValue(
2854 wkt::internal::UnknownEnumValue::String(value.to_string()),
2855 )),
2856 }
2857 }
2858 }
2859
2860 impl serde::ser::Serialize for State {
2861 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2862 where
2863 S: serde::Serializer,
2864 {
2865 match self {
2866 Self::Unspecified => serializer.serialize_i32(0),
2867 Self::Creating => serializer.serialize_i32(1),
2868 Self::Active => serializer.serialize_i32(2),
2869 Self::NeedsRepair => serializer.serialize_i32(3),
2870 Self::UnknownValue(u) => u.0.serialize(serializer),
2871 }
2872 }
2873 }
2874
2875 impl<'de> serde::de::Deserialize<'de> for State {
2876 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2877 where
2878 D: serde::Deserializer<'de>,
2879 {
2880 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2881 ".google.firestore.admin.v1.Field.TtlConfig.State",
2882 ))
2883 }
2884 }
2885 }
2886}
2887
2888/// A request to list the Firestore Databases in all locations for a project.
2889#[derive(Clone, Default, PartialEq)]
2890#[non_exhaustive]
2891pub struct ListDatabasesRequest {
2892 /// Required. A parent name of the form
2893 /// `projects/{project_id}`
2894 pub parent: std::string::String,
2895
2896 /// If true, also returns deleted resources.
2897 pub show_deleted: bool,
2898
2899 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2900}
2901
2902impl ListDatabasesRequest {
2903 pub fn new() -> Self {
2904 std::default::Default::default()
2905 }
2906
2907 /// Sets the value of [parent][crate::model::ListDatabasesRequest::parent].
2908 ///
2909 /// # Example
2910 /// ```ignore,no_run
2911 /// # use google_cloud_firestore_admin_v1::model::ListDatabasesRequest;
2912 /// let x = ListDatabasesRequest::new().set_parent("example");
2913 /// ```
2914 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2915 self.parent = v.into();
2916 self
2917 }
2918
2919 /// Sets the value of [show_deleted][crate::model::ListDatabasesRequest::show_deleted].
2920 ///
2921 /// # Example
2922 /// ```ignore,no_run
2923 /// # use google_cloud_firestore_admin_v1::model::ListDatabasesRequest;
2924 /// let x = ListDatabasesRequest::new().set_show_deleted(true);
2925 /// ```
2926 pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2927 self.show_deleted = v.into();
2928 self
2929 }
2930}
2931
2932impl wkt::message::Message for ListDatabasesRequest {
2933 fn typename() -> &'static str {
2934 "type.googleapis.com/google.firestore.admin.v1.ListDatabasesRequest"
2935 }
2936}
2937
2938/// The request for
2939/// [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.CreateDatabase].
2940///
2941/// [google.firestore.admin.v1.FirestoreAdmin.CreateDatabase]: crate::client::FirestoreAdmin::create_database
2942#[derive(Clone, Default, PartialEq)]
2943#[non_exhaustive]
2944pub struct CreateDatabaseRequest {
2945 /// Required. A parent name of the form
2946 /// `projects/{project_id}`
2947 pub parent: std::string::String,
2948
2949 /// Required. The Database to create.
2950 pub database: std::option::Option<crate::model::Database>,
2951
2952 /// Required. The ID to use for the database, which will become the final
2953 /// component of the database's resource name.
2954 ///
2955 /// This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
2956 /// with first character a letter and the last a letter or a number. Must not
2957 /// be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
2958 ///
2959 /// "(default)" database ID is also valid.
2960 pub database_id: std::string::String,
2961
2962 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2963}
2964
2965impl CreateDatabaseRequest {
2966 pub fn new() -> Self {
2967 std::default::Default::default()
2968 }
2969
2970 /// Sets the value of [parent][crate::model::CreateDatabaseRequest::parent].
2971 ///
2972 /// # Example
2973 /// ```ignore,no_run
2974 /// # use google_cloud_firestore_admin_v1::model::CreateDatabaseRequest;
2975 /// let x = CreateDatabaseRequest::new().set_parent("example");
2976 /// ```
2977 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2978 self.parent = v.into();
2979 self
2980 }
2981
2982 /// Sets the value of [database][crate::model::CreateDatabaseRequest::database].
2983 ///
2984 /// # Example
2985 /// ```ignore,no_run
2986 /// # use google_cloud_firestore_admin_v1::model::CreateDatabaseRequest;
2987 /// use google_cloud_firestore_admin_v1::model::Database;
2988 /// let x = CreateDatabaseRequest::new().set_database(Database::default()/* use setters */);
2989 /// ```
2990 pub fn set_database<T>(mut self, v: T) -> Self
2991 where
2992 T: std::convert::Into<crate::model::Database>,
2993 {
2994 self.database = std::option::Option::Some(v.into());
2995 self
2996 }
2997
2998 /// Sets or clears the value of [database][crate::model::CreateDatabaseRequest::database].
2999 ///
3000 /// # Example
3001 /// ```ignore,no_run
3002 /// # use google_cloud_firestore_admin_v1::model::CreateDatabaseRequest;
3003 /// use google_cloud_firestore_admin_v1::model::Database;
3004 /// let x = CreateDatabaseRequest::new().set_or_clear_database(Some(Database::default()/* use setters */));
3005 /// let x = CreateDatabaseRequest::new().set_or_clear_database(None::<Database>);
3006 /// ```
3007 pub fn set_or_clear_database<T>(mut self, v: std::option::Option<T>) -> Self
3008 where
3009 T: std::convert::Into<crate::model::Database>,
3010 {
3011 self.database = v.map(|x| x.into());
3012 self
3013 }
3014
3015 /// Sets the value of [database_id][crate::model::CreateDatabaseRequest::database_id].
3016 ///
3017 /// # Example
3018 /// ```ignore,no_run
3019 /// # use google_cloud_firestore_admin_v1::model::CreateDatabaseRequest;
3020 /// let x = CreateDatabaseRequest::new().set_database_id("example");
3021 /// ```
3022 pub fn set_database_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3023 self.database_id = v.into();
3024 self
3025 }
3026}
3027
3028impl wkt::message::Message for CreateDatabaseRequest {
3029 fn typename() -> &'static str {
3030 "type.googleapis.com/google.firestore.admin.v1.CreateDatabaseRequest"
3031 }
3032}
3033
3034/// Metadata related to the create database operation.
3035#[derive(Clone, Default, PartialEq)]
3036#[non_exhaustive]
3037pub struct CreateDatabaseMetadata {
3038 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3039}
3040
3041impl CreateDatabaseMetadata {
3042 pub fn new() -> Self {
3043 std::default::Default::default()
3044 }
3045}
3046
3047impl wkt::message::Message for CreateDatabaseMetadata {
3048 fn typename() -> &'static str {
3049 "type.googleapis.com/google.firestore.admin.v1.CreateDatabaseMetadata"
3050 }
3051}
3052
3053/// The list of databases for a project.
3054#[derive(Clone, Default, PartialEq)]
3055#[non_exhaustive]
3056pub struct ListDatabasesResponse {
3057 /// The databases in the project.
3058 pub databases: std::vec::Vec<crate::model::Database>,
3059
3060 /// In the event that data about individual databases cannot be listed they
3061 /// will be recorded here.
3062 ///
3063 /// An example entry might be: projects/some_project/locations/some_location
3064 /// This can happen if the Cloud Region that the Database resides in is
3065 /// currently unavailable. In this case we can't fetch all the details about
3066 /// the database. You may be able to get a more detailed error message
3067 /// (or possibly fetch the resource) by sending a 'Get' request for the
3068 /// resource or a 'List' request for the specific location.
3069 pub unreachable: std::vec::Vec<std::string::String>,
3070
3071 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3072}
3073
3074impl ListDatabasesResponse {
3075 pub fn new() -> Self {
3076 std::default::Default::default()
3077 }
3078
3079 /// Sets the value of [databases][crate::model::ListDatabasesResponse::databases].
3080 ///
3081 /// # Example
3082 /// ```ignore,no_run
3083 /// # use google_cloud_firestore_admin_v1::model::ListDatabasesResponse;
3084 /// use google_cloud_firestore_admin_v1::model::Database;
3085 /// let x = ListDatabasesResponse::new()
3086 /// .set_databases([
3087 /// Database::default()/* use setters */,
3088 /// Database::default()/* use (different) setters */,
3089 /// ]);
3090 /// ```
3091 pub fn set_databases<T, V>(mut self, v: T) -> Self
3092 where
3093 T: std::iter::IntoIterator<Item = V>,
3094 V: std::convert::Into<crate::model::Database>,
3095 {
3096 use std::iter::Iterator;
3097 self.databases = v.into_iter().map(|i| i.into()).collect();
3098 self
3099 }
3100
3101 /// Sets the value of [unreachable][crate::model::ListDatabasesResponse::unreachable].
3102 ///
3103 /// # Example
3104 /// ```ignore,no_run
3105 /// # use google_cloud_firestore_admin_v1::model::ListDatabasesResponse;
3106 /// let x = ListDatabasesResponse::new().set_unreachable(["a", "b", "c"]);
3107 /// ```
3108 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3109 where
3110 T: std::iter::IntoIterator<Item = V>,
3111 V: std::convert::Into<std::string::String>,
3112 {
3113 use std::iter::Iterator;
3114 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3115 self
3116 }
3117}
3118
3119impl wkt::message::Message for ListDatabasesResponse {
3120 fn typename() -> &'static str {
3121 "type.googleapis.com/google.firestore.admin.v1.ListDatabasesResponse"
3122 }
3123}
3124
3125/// The request for
3126/// [FirestoreAdmin.GetDatabase][google.firestore.admin.v1.FirestoreAdmin.GetDatabase].
3127///
3128/// [google.firestore.admin.v1.FirestoreAdmin.GetDatabase]: crate::client::FirestoreAdmin::get_database
3129#[derive(Clone, Default, PartialEq)]
3130#[non_exhaustive]
3131pub struct GetDatabaseRequest {
3132 /// Required. A name of the form
3133 /// `projects/{project_id}/databases/{database_id}`
3134 pub name: std::string::String,
3135
3136 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3137}
3138
3139impl GetDatabaseRequest {
3140 pub fn new() -> Self {
3141 std::default::Default::default()
3142 }
3143
3144 /// Sets the value of [name][crate::model::GetDatabaseRequest::name].
3145 ///
3146 /// # Example
3147 /// ```ignore,no_run
3148 /// # use google_cloud_firestore_admin_v1::model::GetDatabaseRequest;
3149 /// let x = GetDatabaseRequest::new().set_name("example");
3150 /// ```
3151 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3152 self.name = v.into();
3153 self
3154 }
3155}
3156
3157impl wkt::message::Message for GetDatabaseRequest {
3158 fn typename() -> &'static str {
3159 "type.googleapis.com/google.firestore.admin.v1.GetDatabaseRequest"
3160 }
3161}
3162
3163/// The request for
3164/// [FirestoreAdmin.UpdateDatabase][google.firestore.admin.v1.FirestoreAdmin.UpdateDatabase].
3165///
3166/// [google.firestore.admin.v1.FirestoreAdmin.UpdateDatabase]: crate::client::FirestoreAdmin::update_database
3167#[derive(Clone, Default, PartialEq)]
3168#[non_exhaustive]
3169pub struct UpdateDatabaseRequest {
3170 /// Required. The database to update.
3171 pub database: std::option::Option<crate::model::Database>,
3172
3173 /// The list of fields to be updated.
3174 pub update_mask: std::option::Option<wkt::FieldMask>,
3175
3176 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3177}
3178
3179impl UpdateDatabaseRequest {
3180 pub fn new() -> Self {
3181 std::default::Default::default()
3182 }
3183
3184 /// Sets the value of [database][crate::model::UpdateDatabaseRequest::database].
3185 ///
3186 /// # Example
3187 /// ```ignore,no_run
3188 /// # use google_cloud_firestore_admin_v1::model::UpdateDatabaseRequest;
3189 /// use google_cloud_firestore_admin_v1::model::Database;
3190 /// let x = UpdateDatabaseRequest::new().set_database(Database::default()/* use setters */);
3191 /// ```
3192 pub fn set_database<T>(mut self, v: T) -> Self
3193 where
3194 T: std::convert::Into<crate::model::Database>,
3195 {
3196 self.database = std::option::Option::Some(v.into());
3197 self
3198 }
3199
3200 /// Sets or clears the value of [database][crate::model::UpdateDatabaseRequest::database].
3201 ///
3202 /// # Example
3203 /// ```ignore,no_run
3204 /// # use google_cloud_firestore_admin_v1::model::UpdateDatabaseRequest;
3205 /// use google_cloud_firestore_admin_v1::model::Database;
3206 /// let x = UpdateDatabaseRequest::new().set_or_clear_database(Some(Database::default()/* use setters */));
3207 /// let x = UpdateDatabaseRequest::new().set_or_clear_database(None::<Database>);
3208 /// ```
3209 pub fn set_or_clear_database<T>(mut self, v: std::option::Option<T>) -> Self
3210 where
3211 T: std::convert::Into<crate::model::Database>,
3212 {
3213 self.database = v.map(|x| x.into());
3214 self
3215 }
3216
3217 /// Sets the value of [update_mask][crate::model::UpdateDatabaseRequest::update_mask].
3218 ///
3219 /// # Example
3220 /// ```ignore,no_run
3221 /// # use google_cloud_firestore_admin_v1::model::UpdateDatabaseRequest;
3222 /// use wkt::FieldMask;
3223 /// let x = UpdateDatabaseRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3224 /// ```
3225 pub fn set_update_mask<T>(mut self, v: T) -> Self
3226 where
3227 T: std::convert::Into<wkt::FieldMask>,
3228 {
3229 self.update_mask = std::option::Option::Some(v.into());
3230 self
3231 }
3232
3233 /// Sets or clears the value of [update_mask][crate::model::UpdateDatabaseRequest::update_mask].
3234 ///
3235 /// # Example
3236 /// ```ignore,no_run
3237 /// # use google_cloud_firestore_admin_v1::model::UpdateDatabaseRequest;
3238 /// use wkt::FieldMask;
3239 /// let x = UpdateDatabaseRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3240 /// let x = UpdateDatabaseRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3241 /// ```
3242 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3243 where
3244 T: std::convert::Into<wkt::FieldMask>,
3245 {
3246 self.update_mask = v.map(|x| x.into());
3247 self
3248 }
3249}
3250
3251impl wkt::message::Message for UpdateDatabaseRequest {
3252 fn typename() -> &'static str {
3253 "type.googleapis.com/google.firestore.admin.v1.UpdateDatabaseRequest"
3254 }
3255}
3256
3257/// Metadata related to the update database operation.
3258#[derive(Clone, Default, PartialEq)]
3259#[non_exhaustive]
3260pub struct UpdateDatabaseMetadata {
3261 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3262}
3263
3264impl UpdateDatabaseMetadata {
3265 pub fn new() -> Self {
3266 std::default::Default::default()
3267 }
3268}
3269
3270impl wkt::message::Message for UpdateDatabaseMetadata {
3271 fn typename() -> &'static str {
3272 "type.googleapis.com/google.firestore.admin.v1.UpdateDatabaseMetadata"
3273 }
3274}
3275
3276/// The request for
3277/// [FirestoreAdmin.DeleteDatabase][google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase].
3278///
3279/// [google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase]: crate::client::FirestoreAdmin::delete_database
3280#[derive(Clone, Default, PartialEq)]
3281#[non_exhaustive]
3282pub struct DeleteDatabaseRequest {
3283 /// Required. A name of the form
3284 /// `projects/{project_id}/databases/{database_id}`
3285 pub name: std::string::String,
3286
3287 /// The current etag of the Database.
3288 /// If an etag is provided and does not match the current etag of the database,
3289 /// deletion will be blocked and a FAILED_PRECONDITION error will be returned.
3290 pub etag: std::string::String,
3291
3292 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3293}
3294
3295impl DeleteDatabaseRequest {
3296 pub fn new() -> Self {
3297 std::default::Default::default()
3298 }
3299
3300 /// Sets the value of [name][crate::model::DeleteDatabaseRequest::name].
3301 ///
3302 /// # Example
3303 /// ```ignore,no_run
3304 /// # use google_cloud_firestore_admin_v1::model::DeleteDatabaseRequest;
3305 /// let x = DeleteDatabaseRequest::new().set_name("example");
3306 /// ```
3307 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3308 self.name = v.into();
3309 self
3310 }
3311
3312 /// Sets the value of [etag][crate::model::DeleteDatabaseRequest::etag].
3313 ///
3314 /// # Example
3315 /// ```ignore,no_run
3316 /// # use google_cloud_firestore_admin_v1::model::DeleteDatabaseRequest;
3317 /// let x = DeleteDatabaseRequest::new().set_etag("example");
3318 /// ```
3319 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3320 self.etag = v.into();
3321 self
3322 }
3323}
3324
3325impl wkt::message::Message for DeleteDatabaseRequest {
3326 fn typename() -> &'static str {
3327 "type.googleapis.com/google.firestore.admin.v1.DeleteDatabaseRequest"
3328 }
3329}
3330
3331/// Metadata related to the delete database operation.
3332#[derive(Clone, Default, PartialEq)]
3333#[non_exhaustive]
3334pub struct DeleteDatabaseMetadata {
3335 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3336}
3337
3338impl DeleteDatabaseMetadata {
3339 pub fn new() -> Self {
3340 std::default::Default::default()
3341 }
3342}
3343
3344impl wkt::message::Message for DeleteDatabaseMetadata {
3345 fn typename() -> &'static str {
3346 "type.googleapis.com/google.firestore.admin.v1.DeleteDatabaseMetadata"
3347 }
3348}
3349
3350/// The request for
3351/// [FirestoreAdmin.CreateUserCreds][google.firestore.admin.v1.FirestoreAdmin.CreateUserCreds].
3352///
3353/// [google.firestore.admin.v1.FirestoreAdmin.CreateUserCreds]: crate::client::FirestoreAdmin::create_user_creds
3354#[derive(Clone, Default, PartialEq)]
3355#[non_exhaustive]
3356pub struct CreateUserCredsRequest {
3357 /// Required. A parent name of the form
3358 /// `projects/{project_id}/databases/{database_id}`
3359 pub parent: std::string::String,
3360
3361 /// Required. The user creds to create.
3362 pub user_creds: std::option::Option<crate::model::UserCreds>,
3363
3364 /// Required. The ID to use for the user creds, which will become the final
3365 /// component of the user creds's resource name.
3366 ///
3367 /// This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
3368 /// with first character a letter and the last a letter or a number. Must not
3369 /// be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
3370 pub user_creds_id: std::string::String,
3371
3372 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3373}
3374
3375impl CreateUserCredsRequest {
3376 pub fn new() -> Self {
3377 std::default::Default::default()
3378 }
3379
3380 /// Sets the value of [parent][crate::model::CreateUserCredsRequest::parent].
3381 ///
3382 /// # Example
3383 /// ```ignore,no_run
3384 /// # use google_cloud_firestore_admin_v1::model::CreateUserCredsRequest;
3385 /// let x = CreateUserCredsRequest::new().set_parent("example");
3386 /// ```
3387 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3388 self.parent = v.into();
3389 self
3390 }
3391
3392 /// Sets the value of [user_creds][crate::model::CreateUserCredsRequest::user_creds].
3393 ///
3394 /// # Example
3395 /// ```ignore,no_run
3396 /// # use google_cloud_firestore_admin_v1::model::CreateUserCredsRequest;
3397 /// use google_cloud_firestore_admin_v1::model::UserCreds;
3398 /// let x = CreateUserCredsRequest::new().set_user_creds(UserCreds::default()/* use setters */);
3399 /// ```
3400 pub fn set_user_creds<T>(mut self, v: T) -> Self
3401 where
3402 T: std::convert::Into<crate::model::UserCreds>,
3403 {
3404 self.user_creds = std::option::Option::Some(v.into());
3405 self
3406 }
3407
3408 /// Sets or clears the value of [user_creds][crate::model::CreateUserCredsRequest::user_creds].
3409 ///
3410 /// # Example
3411 /// ```ignore,no_run
3412 /// # use google_cloud_firestore_admin_v1::model::CreateUserCredsRequest;
3413 /// use google_cloud_firestore_admin_v1::model::UserCreds;
3414 /// let x = CreateUserCredsRequest::new().set_or_clear_user_creds(Some(UserCreds::default()/* use setters */));
3415 /// let x = CreateUserCredsRequest::new().set_or_clear_user_creds(None::<UserCreds>);
3416 /// ```
3417 pub fn set_or_clear_user_creds<T>(mut self, v: std::option::Option<T>) -> Self
3418 where
3419 T: std::convert::Into<crate::model::UserCreds>,
3420 {
3421 self.user_creds = v.map(|x| x.into());
3422 self
3423 }
3424
3425 /// Sets the value of [user_creds_id][crate::model::CreateUserCredsRequest::user_creds_id].
3426 ///
3427 /// # Example
3428 /// ```ignore,no_run
3429 /// # use google_cloud_firestore_admin_v1::model::CreateUserCredsRequest;
3430 /// let x = CreateUserCredsRequest::new().set_user_creds_id("example");
3431 /// ```
3432 pub fn set_user_creds_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3433 self.user_creds_id = v.into();
3434 self
3435 }
3436}
3437
3438impl wkt::message::Message for CreateUserCredsRequest {
3439 fn typename() -> &'static str {
3440 "type.googleapis.com/google.firestore.admin.v1.CreateUserCredsRequest"
3441 }
3442}
3443
3444/// The request for
3445/// [FirestoreAdmin.GetUserCreds][google.firestore.admin.v1.FirestoreAdmin.GetUserCreds].
3446///
3447/// [google.firestore.admin.v1.FirestoreAdmin.GetUserCreds]: crate::client::FirestoreAdmin::get_user_creds
3448#[derive(Clone, Default, PartialEq)]
3449#[non_exhaustive]
3450pub struct GetUserCredsRequest {
3451 /// Required. A name of the form
3452 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3453 pub name: std::string::String,
3454
3455 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3456}
3457
3458impl GetUserCredsRequest {
3459 pub fn new() -> Self {
3460 std::default::Default::default()
3461 }
3462
3463 /// Sets the value of [name][crate::model::GetUserCredsRequest::name].
3464 ///
3465 /// # Example
3466 /// ```ignore,no_run
3467 /// # use google_cloud_firestore_admin_v1::model::GetUserCredsRequest;
3468 /// let x = GetUserCredsRequest::new().set_name("example");
3469 /// ```
3470 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3471 self.name = v.into();
3472 self
3473 }
3474}
3475
3476impl wkt::message::Message for GetUserCredsRequest {
3477 fn typename() -> &'static str {
3478 "type.googleapis.com/google.firestore.admin.v1.GetUserCredsRequest"
3479 }
3480}
3481
3482/// The request for
3483/// [FirestoreAdmin.ListUserCreds][google.firestore.admin.v1.FirestoreAdmin.ListUserCreds].
3484///
3485/// [google.firestore.admin.v1.FirestoreAdmin.ListUserCreds]: crate::client::FirestoreAdmin::list_user_creds
3486#[derive(Clone, Default, PartialEq)]
3487#[non_exhaustive]
3488pub struct ListUserCredsRequest {
3489 /// Required. A parent database name of the form
3490 /// `projects/{project_id}/databases/{database_id}`
3491 pub parent: std::string::String,
3492
3493 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3494}
3495
3496impl ListUserCredsRequest {
3497 pub fn new() -> Self {
3498 std::default::Default::default()
3499 }
3500
3501 /// Sets the value of [parent][crate::model::ListUserCredsRequest::parent].
3502 ///
3503 /// # Example
3504 /// ```ignore,no_run
3505 /// # use google_cloud_firestore_admin_v1::model::ListUserCredsRequest;
3506 /// let x = ListUserCredsRequest::new().set_parent("example");
3507 /// ```
3508 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3509 self.parent = v.into();
3510 self
3511 }
3512}
3513
3514impl wkt::message::Message for ListUserCredsRequest {
3515 fn typename() -> &'static str {
3516 "type.googleapis.com/google.firestore.admin.v1.ListUserCredsRequest"
3517 }
3518}
3519
3520/// The response for
3521/// [FirestoreAdmin.ListUserCreds][google.firestore.admin.v1.FirestoreAdmin.ListUserCreds].
3522///
3523/// [google.firestore.admin.v1.FirestoreAdmin.ListUserCreds]: crate::client::FirestoreAdmin::list_user_creds
3524#[derive(Clone, Default, PartialEq)]
3525#[non_exhaustive]
3526pub struct ListUserCredsResponse {
3527 /// The user creds for the database.
3528 pub user_creds: std::vec::Vec<crate::model::UserCreds>,
3529
3530 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3531}
3532
3533impl ListUserCredsResponse {
3534 pub fn new() -> Self {
3535 std::default::Default::default()
3536 }
3537
3538 /// Sets the value of [user_creds][crate::model::ListUserCredsResponse::user_creds].
3539 ///
3540 /// # Example
3541 /// ```ignore,no_run
3542 /// # use google_cloud_firestore_admin_v1::model::ListUserCredsResponse;
3543 /// use google_cloud_firestore_admin_v1::model::UserCreds;
3544 /// let x = ListUserCredsResponse::new()
3545 /// .set_user_creds([
3546 /// UserCreds::default()/* use setters */,
3547 /// UserCreds::default()/* use (different) setters */,
3548 /// ]);
3549 /// ```
3550 pub fn set_user_creds<T, V>(mut self, v: T) -> Self
3551 where
3552 T: std::iter::IntoIterator<Item = V>,
3553 V: std::convert::Into<crate::model::UserCreds>,
3554 {
3555 use std::iter::Iterator;
3556 self.user_creds = v.into_iter().map(|i| i.into()).collect();
3557 self
3558 }
3559}
3560
3561impl wkt::message::Message for ListUserCredsResponse {
3562 fn typename() -> &'static str {
3563 "type.googleapis.com/google.firestore.admin.v1.ListUserCredsResponse"
3564 }
3565}
3566
3567/// The request for
3568/// [FirestoreAdmin.EnableUserCreds][google.firestore.admin.v1.FirestoreAdmin.EnableUserCreds].
3569///
3570/// [google.firestore.admin.v1.FirestoreAdmin.EnableUserCreds]: crate::client::FirestoreAdmin::enable_user_creds
3571#[derive(Clone, Default, PartialEq)]
3572#[non_exhaustive]
3573pub struct EnableUserCredsRequest {
3574 /// Required. A name of the form
3575 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3576 pub name: std::string::String,
3577
3578 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3579}
3580
3581impl EnableUserCredsRequest {
3582 pub fn new() -> Self {
3583 std::default::Default::default()
3584 }
3585
3586 /// Sets the value of [name][crate::model::EnableUserCredsRequest::name].
3587 ///
3588 /// # Example
3589 /// ```ignore,no_run
3590 /// # use google_cloud_firestore_admin_v1::model::EnableUserCredsRequest;
3591 /// let x = EnableUserCredsRequest::new().set_name("example");
3592 /// ```
3593 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3594 self.name = v.into();
3595 self
3596 }
3597}
3598
3599impl wkt::message::Message for EnableUserCredsRequest {
3600 fn typename() -> &'static str {
3601 "type.googleapis.com/google.firestore.admin.v1.EnableUserCredsRequest"
3602 }
3603}
3604
3605/// The request for
3606/// [FirestoreAdmin.DisableUserCreds][google.firestore.admin.v1.FirestoreAdmin.DisableUserCreds].
3607///
3608/// [google.firestore.admin.v1.FirestoreAdmin.DisableUserCreds]: crate::client::FirestoreAdmin::disable_user_creds
3609#[derive(Clone, Default, PartialEq)]
3610#[non_exhaustive]
3611pub struct DisableUserCredsRequest {
3612 /// Required. A name of the form
3613 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3614 pub name: std::string::String,
3615
3616 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3617}
3618
3619impl DisableUserCredsRequest {
3620 pub fn new() -> Self {
3621 std::default::Default::default()
3622 }
3623
3624 /// Sets the value of [name][crate::model::DisableUserCredsRequest::name].
3625 ///
3626 /// # Example
3627 /// ```ignore,no_run
3628 /// # use google_cloud_firestore_admin_v1::model::DisableUserCredsRequest;
3629 /// let x = DisableUserCredsRequest::new().set_name("example");
3630 /// ```
3631 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3632 self.name = v.into();
3633 self
3634 }
3635}
3636
3637impl wkt::message::Message for DisableUserCredsRequest {
3638 fn typename() -> &'static str {
3639 "type.googleapis.com/google.firestore.admin.v1.DisableUserCredsRequest"
3640 }
3641}
3642
3643/// The request for
3644/// [FirestoreAdmin.ResetUserPassword][google.firestore.admin.v1.FirestoreAdmin.ResetUserPassword].
3645///
3646/// [google.firestore.admin.v1.FirestoreAdmin.ResetUserPassword]: crate::client::FirestoreAdmin::reset_user_password
3647#[derive(Clone, Default, PartialEq)]
3648#[non_exhaustive]
3649pub struct ResetUserPasswordRequest {
3650 /// Required. A name of the form
3651 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3652 pub name: std::string::String,
3653
3654 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3655}
3656
3657impl ResetUserPasswordRequest {
3658 pub fn new() -> Self {
3659 std::default::Default::default()
3660 }
3661
3662 /// Sets the value of [name][crate::model::ResetUserPasswordRequest::name].
3663 ///
3664 /// # Example
3665 /// ```ignore,no_run
3666 /// # use google_cloud_firestore_admin_v1::model::ResetUserPasswordRequest;
3667 /// let x = ResetUserPasswordRequest::new().set_name("example");
3668 /// ```
3669 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3670 self.name = v.into();
3671 self
3672 }
3673}
3674
3675impl wkt::message::Message for ResetUserPasswordRequest {
3676 fn typename() -> &'static str {
3677 "type.googleapis.com/google.firestore.admin.v1.ResetUserPasswordRequest"
3678 }
3679}
3680
3681/// The request for
3682/// [FirestoreAdmin.DeleteUserCreds][google.firestore.admin.v1.FirestoreAdmin.DeleteUserCreds].
3683///
3684/// [google.firestore.admin.v1.FirestoreAdmin.DeleteUserCreds]: crate::client::FirestoreAdmin::delete_user_creds
3685#[derive(Clone, Default, PartialEq)]
3686#[non_exhaustive]
3687pub struct DeleteUserCredsRequest {
3688 /// Required. A name of the form
3689 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3690 pub name: std::string::String,
3691
3692 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3693}
3694
3695impl DeleteUserCredsRequest {
3696 pub fn new() -> Self {
3697 std::default::Default::default()
3698 }
3699
3700 /// Sets the value of [name][crate::model::DeleteUserCredsRequest::name].
3701 ///
3702 /// # Example
3703 /// ```ignore,no_run
3704 /// # use google_cloud_firestore_admin_v1::model::DeleteUserCredsRequest;
3705 /// let x = DeleteUserCredsRequest::new().set_name("example");
3706 /// ```
3707 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3708 self.name = v.into();
3709 self
3710 }
3711}
3712
3713impl wkt::message::Message for DeleteUserCredsRequest {
3714 fn typename() -> &'static str {
3715 "type.googleapis.com/google.firestore.admin.v1.DeleteUserCredsRequest"
3716 }
3717}
3718
3719/// The request for
3720/// [FirestoreAdmin.CreateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedule].
3721///
3722/// [google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedule]: crate::client::FirestoreAdmin::create_backup_schedule
3723#[derive(Clone, Default, PartialEq)]
3724#[non_exhaustive]
3725pub struct CreateBackupScheduleRequest {
3726 /// Required. The parent database.
3727 ///
3728 /// Format `projects/{project}/databases/{database}`
3729 pub parent: std::string::String,
3730
3731 /// Required. The backup schedule to create.
3732 pub backup_schedule: std::option::Option<crate::model::BackupSchedule>,
3733
3734 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3735}
3736
3737impl CreateBackupScheduleRequest {
3738 pub fn new() -> Self {
3739 std::default::Default::default()
3740 }
3741
3742 /// Sets the value of [parent][crate::model::CreateBackupScheduleRequest::parent].
3743 ///
3744 /// # Example
3745 /// ```ignore,no_run
3746 /// # use google_cloud_firestore_admin_v1::model::CreateBackupScheduleRequest;
3747 /// let x = CreateBackupScheduleRequest::new().set_parent("example");
3748 /// ```
3749 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3750 self.parent = v.into();
3751 self
3752 }
3753
3754 /// Sets the value of [backup_schedule][crate::model::CreateBackupScheduleRequest::backup_schedule].
3755 ///
3756 /// # Example
3757 /// ```ignore,no_run
3758 /// # use google_cloud_firestore_admin_v1::model::CreateBackupScheduleRequest;
3759 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
3760 /// let x = CreateBackupScheduleRequest::new().set_backup_schedule(BackupSchedule::default()/* use setters */);
3761 /// ```
3762 pub fn set_backup_schedule<T>(mut self, v: T) -> Self
3763 where
3764 T: std::convert::Into<crate::model::BackupSchedule>,
3765 {
3766 self.backup_schedule = std::option::Option::Some(v.into());
3767 self
3768 }
3769
3770 /// Sets or clears the value of [backup_schedule][crate::model::CreateBackupScheduleRequest::backup_schedule].
3771 ///
3772 /// # Example
3773 /// ```ignore,no_run
3774 /// # use google_cloud_firestore_admin_v1::model::CreateBackupScheduleRequest;
3775 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
3776 /// let x = CreateBackupScheduleRequest::new().set_or_clear_backup_schedule(Some(BackupSchedule::default()/* use setters */));
3777 /// let x = CreateBackupScheduleRequest::new().set_or_clear_backup_schedule(None::<BackupSchedule>);
3778 /// ```
3779 pub fn set_or_clear_backup_schedule<T>(mut self, v: std::option::Option<T>) -> Self
3780 where
3781 T: std::convert::Into<crate::model::BackupSchedule>,
3782 {
3783 self.backup_schedule = v.map(|x| x.into());
3784 self
3785 }
3786}
3787
3788impl wkt::message::Message for CreateBackupScheduleRequest {
3789 fn typename() -> &'static str {
3790 "type.googleapis.com/google.firestore.admin.v1.CreateBackupScheduleRequest"
3791 }
3792}
3793
3794/// The request for
3795/// [FirestoreAdmin.GetBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.GetBackupSchedule].
3796///
3797/// [google.firestore.admin.v1.FirestoreAdmin.GetBackupSchedule]: crate::client::FirestoreAdmin::get_backup_schedule
3798#[derive(Clone, Default, PartialEq)]
3799#[non_exhaustive]
3800pub struct GetBackupScheduleRequest {
3801 /// Required. The name of the backup schedule.
3802 ///
3803 /// Format
3804 /// `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
3805 pub name: std::string::String,
3806
3807 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3808}
3809
3810impl GetBackupScheduleRequest {
3811 pub fn new() -> Self {
3812 std::default::Default::default()
3813 }
3814
3815 /// Sets the value of [name][crate::model::GetBackupScheduleRequest::name].
3816 ///
3817 /// # Example
3818 /// ```ignore,no_run
3819 /// # use google_cloud_firestore_admin_v1::model::GetBackupScheduleRequest;
3820 /// let x = GetBackupScheduleRequest::new().set_name("example");
3821 /// ```
3822 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3823 self.name = v.into();
3824 self
3825 }
3826}
3827
3828impl wkt::message::Message for GetBackupScheduleRequest {
3829 fn typename() -> &'static str {
3830 "type.googleapis.com/google.firestore.admin.v1.GetBackupScheduleRequest"
3831 }
3832}
3833
3834/// The request for
3835/// [FirestoreAdmin.UpdateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedule].
3836///
3837/// [google.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedule]: crate::client::FirestoreAdmin::update_backup_schedule
3838#[derive(Clone, Default, PartialEq)]
3839#[non_exhaustive]
3840pub struct UpdateBackupScheduleRequest {
3841 /// Required. The backup schedule to update.
3842 pub backup_schedule: std::option::Option<crate::model::BackupSchedule>,
3843
3844 /// The list of fields to be updated.
3845 pub update_mask: std::option::Option<wkt::FieldMask>,
3846
3847 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3848}
3849
3850impl UpdateBackupScheduleRequest {
3851 pub fn new() -> Self {
3852 std::default::Default::default()
3853 }
3854
3855 /// Sets the value of [backup_schedule][crate::model::UpdateBackupScheduleRequest::backup_schedule].
3856 ///
3857 /// # Example
3858 /// ```ignore,no_run
3859 /// # use google_cloud_firestore_admin_v1::model::UpdateBackupScheduleRequest;
3860 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
3861 /// let x = UpdateBackupScheduleRequest::new().set_backup_schedule(BackupSchedule::default()/* use setters */);
3862 /// ```
3863 pub fn set_backup_schedule<T>(mut self, v: T) -> Self
3864 where
3865 T: std::convert::Into<crate::model::BackupSchedule>,
3866 {
3867 self.backup_schedule = std::option::Option::Some(v.into());
3868 self
3869 }
3870
3871 /// Sets or clears the value of [backup_schedule][crate::model::UpdateBackupScheduleRequest::backup_schedule].
3872 ///
3873 /// # Example
3874 /// ```ignore,no_run
3875 /// # use google_cloud_firestore_admin_v1::model::UpdateBackupScheduleRequest;
3876 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
3877 /// let x = UpdateBackupScheduleRequest::new().set_or_clear_backup_schedule(Some(BackupSchedule::default()/* use setters */));
3878 /// let x = UpdateBackupScheduleRequest::new().set_or_clear_backup_schedule(None::<BackupSchedule>);
3879 /// ```
3880 pub fn set_or_clear_backup_schedule<T>(mut self, v: std::option::Option<T>) -> Self
3881 where
3882 T: std::convert::Into<crate::model::BackupSchedule>,
3883 {
3884 self.backup_schedule = v.map(|x| x.into());
3885 self
3886 }
3887
3888 /// Sets the value of [update_mask][crate::model::UpdateBackupScheduleRequest::update_mask].
3889 ///
3890 /// # Example
3891 /// ```ignore,no_run
3892 /// # use google_cloud_firestore_admin_v1::model::UpdateBackupScheduleRequest;
3893 /// use wkt::FieldMask;
3894 /// let x = UpdateBackupScheduleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3895 /// ```
3896 pub fn set_update_mask<T>(mut self, v: T) -> Self
3897 where
3898 T: std::convert::Into<wkt::FieldMask>,
3899 {
3900 self.update_mask = std::option::Option::Some(v.into());
3901 self
3902 }
3903
3904 /// Sets or clears the value of [update_mask][crate::model::UpdateBackupScheduleRequest::update_mask].
3905 ///
3906 /// # Example
3907 /// ```ignore,no_run
3908 /// # use google_cloud_firestore_admin_v1::model::UpdateBackupScheduleRequest;
3909 /// use wkt::FieldMask;
3910 /// let x = UpdateBackupScheduleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3911 /// let x = UpdateBackupScheduleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3912 /// ```
3913 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3914 where
3915 T: std::convert::Into<wkt::FieldMask>,
3916 {
3917 self.update_mask = v.map(|x| x.into());
3918 self
3919 }
3920}
3921
3922impl wkt::message::Message for UpdateBackupScheduleRequest {
3923 fn typename() -> &'static str {
3924 "type.googleapis.com/google.firestore.admin.v1.UpdateBackupScheduleRequest"
3925 }
3926}
3927
3928/// The request for
3929/// [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules].
3930///
3931/// [google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules]: crate::client::FirestoreAdmin::list_backup_schedules
3932#[derive(Clone, Default, PartialEq)]
3933#[non_exhaustive]
3934pub struct ListBackupSchedulesRequest {
3935 /// Required. The parent database.
3936 ///
3937 /// Format is `projects/{project}/databases/{database}`.
3938 pub parent: std::string::String,
3939
3940 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3941}
3942
3943impl ListBackupSchedulesRequest {
3944 pub fn new() -> Self {
3945 std::default::Default::default()
3946 }
3947
3948 /// Sets the value of [parent][crate::model::ListBackupSchedulesRequest::parent].
3949 ///
3950 /// # Example
3951 /// ```ignore,no_run
3952 /// # use google_cloud_firestore_admin_v1::model::ListBackupSchedulesRequest;
3953 /// let x = ListBackupSchedulesRequest::new().set_parent("example");
3954 /// ```
3955 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3956 self.parent = v.into();
3957 self
3958 }
3959}
3960
3961impl wkt::message::Message for ListBackupSchedulesRequest {
3962 fn typename() -> &'static str {
3963 "type.googleapis.com/google.firestore.admin.v1.ListBackupSchedulesRequest"
3964 }
3965}
3966
3967/// The response for
3968/// [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules].
3969///
3970/// [google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules]: crate::client::FirestoreAdmin::list_backup_schedules
3971#[derive(Clone, Default, PartialEq)]
3972#[non_exhaustive]
3973pub struct ListBackupSchedulesResponse {
3974 /// List of all backup schedules.
3975 pub backup_schedules: std::vec::Vec<crate::model::BackupSchedule>,
3976
3977 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3978}
3979
3980impl ListBackupSchedulesResponse {
3981 pub fn new() -> Self {
3982 std::default::Default::default()
3983 }
3984
3985 /// Sets the value of [backup_schedules][crate::model::ListBackupSchedulesResponse::backup_schedules].
3986 ///
3987 /// # Example
3988 /// ```ignore,no_run
3989 /// # use google_cloud_firestore_admin_v1::model::ListBackupSchedulesResponse;
3990 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
3991 /// let x = ListBackupSchedulesResponse::new()
3992 /// .set_backup_schedules([
3993 /// BackupSchedule::default()/* use setters */,
3994 /// BackupSchedule::default()/* use (different) setters */,
3995 /// ]);
3996 /// ```
3997 pub fn set_backup_schedules<T, V>(mut self, v: T) -> Self
3998 where
3999 T: std::iter::IntoIterator<Item = V>,
4000 V: std::convert::Into<crate::model::BackupSchedule>,
4001 {
4002 use std::iter::Iterator;
4003 self.backup_schedules = v.into_iter().map(|i| i.into()).collect();
4004 self
4005 }
4006}
4007
4008impl wkt::message::Message for ListBackupSchedulesResponse {
4009 fn typename() -> &'static str {
4010 "type.googleapis.com/google.firestore.admin.v1.ListBackupSchedulesResponse"
4011 }
4012}
4013
4014/// The request for [FirestoreAdmin.DeleteBackupSchedules][].
4015#[derive(Clone, Default, PartialEq)]
4016#[non_exhaustive]
4017pub struct DeleteBackupScheduleRequest {
4018 /// Required. The name of the backup schedule.
4019 ///
4020 /// Format
4021 /// `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
4022 pub name: std::string::String,
4023
4024 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4025}
4026
4027impl DeleteBackupScheduleRequest {
4028 pub fn new() -> Self {
4029 std::default::Default::default()
4030 }
4031
4032 /// Sets the value of [name][crate::model::DeleteBackupScheduleRequest::name].
4033 ///
4034 /// # Example
4035 /// ```ignore,no_run
4036 /// # use google_cloud_firestore_admin_v1::model::DeleteBackupScheduleRequest;
4037 /// let x = DeleteBackupScheduleRequest::new().set_name("example");
4038 /// ```
4039 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4040 self.name = v.into();
4041 self
4042 }
4043}
4044
4045impl wkt::message::Message for DeleteBackupScheduleRequest {
4046 fn typename() -> &'static str {
4047 "type.googleapis.com/google.firestore.admin.v1.DeleteBackupScheduleRequest"
4048 }
4049}
4050
4051/// The request for
4052/// [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
4053///
4054/// [google.firestore.admin.v1.FirestoreAdmin.CreateIndex]: crate::client::FirestoreAdmin::create_index
4055#[derive(Clone, Default, PartialEq)]
4056#[non_exhaustive]
4057pub struct CreateIndexRequest {
4058 /// Required. A parent name of the form
4059 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
4060 pub parent: std::string::String,
4061
4062 /// Required. The composite index to create.
4063 pub index: std::option::Option<crate::model::Index>,
4064
4065 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4066}
4067
4068impl CreateIndexRequest {
4069 pub fn new() -> Self {
4070 std::default::Default::default()
4071 }
4072
4073 /// Sets the value of [parent][crate::model::CreateIndexRequest::parent].
4074 ///
4075 /// # Example
4076 /// ```ignore,no_run
4077 /// # use google_cloud_firestore_admin_v1::model::CreateIndexRequest;
4078 /// let x = CreateIndexRequest::new().set_parent("example");
4079 /// ```
4080 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4081 self.parent = v.into();
4082 self
4083 }
4084
4085 /// Sets the value of [index][crate::model::CreateIndexRequest::index].
4086 ///
4087 /// # Example
4088 /// ```ignore,no_run
4089 /// # use google_cloud_firestore_admin_v1::model::CreateIndexRequest;
4090 /// use google_cloud_firestore_admin_v1::model::Index;
4091 /// let x = CreateIndexRequest::new().set_index(Index::default()/* use setters */);
4092 /// ```
4093 pub fn set_index<T>(mut self, v: T) -> Self
4094 where
4095 T: std::convert::Into<crate::model::Index>,
4096 {
4097 self.index = std::option::Option::Some(v.into());
4098 self
4099 }
4100
4101 /// Sets or clears the value of [index][crate::model::CreateIndexRequest::index].
4102 ///
4103 /// # Example
4104 /// ```ignore,no_run
4105 /// # use google_cloud_firestore_admin_v1::model::CreateIndexRequest;
4106 /// use google_cloud_firestore_admin_v1::model::Index;
4107 /// let x = CreateIndexRequest::new().set_or_clear_index(Some(Index::default()/* use setters */));
4108 /// let x = CreateIndexRequest::new().set_or_clear_index(None::<Index>);
4109 /// ```
4110 pub fn set_or_clear_index<T>(mut self, v: std::option::Option<T>) -> Self
4111 where
4112 T: std::convert::Into<crate::model::Index>,
4113 {
4114 self.index = v.map(|x| x.into());
4115 self
4116 }
4117}
4118
4119impl wkt::message::Message for CreateIndexRequest {
4120 fn typename() -> &'static str {
4121 "type.googleapis.com/google.firestore.admin.v1.CreateIndexRequest"
4122 }
4123}
4124
4125/// The request for
4126/// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes].
4127///
4128/// [google.firestore.admin.v1.FirestoreAdmin.ListIndexes]: crate::client::FirestoreAdmin::list_indexes
4129#[derive(Clone, Default, PartialEq)]
4130#[non_exhaustive]
4131pub struct ListIndexesRequest {
4132 /// Required. A parent name of the form
4133 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
4134 pub parent: std::string::String,
4135
4136 /// The filter to apply to list results.
4137 pub filter: std::string::String,
4138
4139 /// The number of results to return.
4140 pub page_size: i32,
4141
4142 /// A page token, returned from a previous call to
4143 /// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes],
4144 /// that may be used to get the next page of results.
4145 ///
4146 /// [google.firestore.admin.v1.FirestoreAdmin.ListIndexes]: crate::client::FirestoreAdmin::list_indexes
4147 pub page_token: std::string::String,
4148
4149 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4150}
4151
4152impl ListIndexesRequest {
4153 pub fn new() -> Self {
4154 std::default::Default::default()
4155 }
4156
4157 /// Sets the value of [parent][crate::model::ListIndexesRequest::parent].
4158 ///
4159 /// # Example
4160 /// ```ignore,no_run
4161 /// # use google_cloud_firestore_admin_v1::model::ListIndexesRequest;
4162 /// let x = ListIndexesRequest::new().set_parent("example");
4163 /// ```
4164 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4165 self.parent = v.into();
4166 self
4167 }
4168
4169 /// Sets the value of [filter][crate::model::ListIndexesRequest::filter].
4170 ///
4171 /// # Example
4172 /// ```ignore,no_run
4173 /// # use google_cloud_firestore_admin_v1::model::ListIndexesRequest;
4174 /// let x = ListIndexesRequest::new().set_filter("example");
4175 /// ```
4176 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4177 self.filter = v.into();
4178 self
4179 }
4180
4181 /// Sets the value of [page_size][crate::model::ListIndexesRequest::page_size].
4182 ///
4183 /// # Example
4184 /// ```ignore,no_run
4185 /// # use google_cloud_firestore_admin_v1::model::ListIndexesRequest;
4186 /// let x = ListIndexesRequest::new().set_page_size(42);
4187 /// ```
4188 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4189 self.page_size = v.into();
4190 self
4191 }
4192
4193 /// Sets the value of [page_token][crate::model::ListIndexesRequest::page_token].
4194 ///
4195 /// # Example
4196 /// ```ignore,no_run
4197 /// # use google_cloud_firestore_admin_v1::model::ListIndexesRequest;
4198 /// let x = ListIndexesRequest::new().set_page_token("example");
4199 /// ```
4200 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4201 self.page_token = v.into();
4202 self
4203 }
4204}
4205
4206impl wkt::message::Message for ListIndexesRequest {
4207 fn typename() -> &'static str {
4208 "type.googleapis.com/google.firestore.admin.v1.ListIndexesRequest"
4209 }
4210}
4211
4212/// The response for
4213/// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes].
4214///
4215/// [google.firestore.admin.v1.FirestoreAdmin.ListIndexes]: crate::client::FirestoreAdmin::list_indexes
4216#[derive(Clone, Default, PartialEq)]
4217#[non_exhaustive]
4218pub struct ListIndexesResponse {
4219 /// The requested indexes.
4220 pub indexes: std::vec::Vec<crate::model::Index>,
4221
4222 /// A page token that may be used to request another page of results. If blank,
4223 /// this is the last page.
4224 pub next_page_token: std::string::String,
4225
4226 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4227}
4228
4229impl ListIndexesResponse {
4230 pub fn new() -> Self {
4231 std::default::Default::default()
4232 }
4233
4234 /// Sets the value of [indexes][crate::model::ListIndexesResponse::indexes].
4235 ///
4236 /// # Example
4237 /// ```ignore,no_run
4238 /// # use google_cloud_firestore_admin_v1::model::ListIndexesResponse;
4239 /// use google_cloud_firestore_admin_v1::model::Index;
4240 /// let x = ListIndexesResponse::new()
4241 /// .set_indexes([
4242 /// Index::default()/* use setters */,
4243 /// Index::default()/* use (different) setters */,
4244 /// ]);
4245 /// ```
4246 pub fn set_indexes<T, V>(mut self, v: T) -> Self
4247 where
4248 T: std::iter::IntoIterator<Item = V>,
4249 V: std::convert::Into<crate::model::Index>,
4250 {
4251 use std::iter::Iterator;
4252 self.indexes = v.into_iter().map(|i| i.into()).collect();
4253 self
4254 }
4255
4256 /// Sets the value of [next_page_token][crate::model::ListIndexesResponse::next_page_token].
4257 ///
4258 /// # Example
4259 /// ```ignore,no_run
4260 /// # use google_cloud_firestore_admin_v1::model::ListIndexesResponse;
4261 /// let x = ListIndexesResponse::new().set_next_page_token("example");
4262 /// ```
4263 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4264 self.next_page_token = v.into();
4265 self
4266 }
4267}
4268
4269impl wkt::message::Message for ListIndexesResponse {
4270 fn typename() -> &'static str {
4271 "type.googleapis.com/google.firestore.admin.v1.ListIndexesResponse"
4272 }
4273}
4274
4275#[doc(hidden)]
4276impl gax::paginator::internal::PageableResponse for ListIndexesResponse {
4277 type PageItem = crate::model::Index;
4278
4279 fn items(self) -> std::vec::Vec<Self::PageItem> {
4280 self.indexes
4281 }
4282
4283 fn next_page_token(&self) -> std::string::String {
4284 use std::clone::Clone;
4285 self.next_page_token.clone()
4286 }
4287}
4288
4289/// The request for
4290/// [FirestoreAdmin.GetIndex][google.firestore.admin.v1.FirestoreAdmin.GetIndex].
4291///
4292/// [google.firestore.admin.v1.FirestoreAdmin.GetIndex]: crate::client::FirestoreAdmin::get_index
4293#[derive(Clone, Default, PartialEq)]
4294#[non_exhaustive]
4295pub struct GetIndexRequest {
4296 /// Required. A name of the form
4297 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
4298 pub name: std::string::String,
4299
4300 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4301}
4302
4303impl GetIndexRequest {
4304 pub fn new() -> Self {
4305 std::default::Default::default()
4306 }
4307
4308 /// Sets the value of [name][crate::model::GetIndexRequest::name].
4309 ///
4310 /// # Example
4311 /// ```ignore,no_run
4312 /// # use google_cloud_firestore_admin_v1::model::GetIndexRequest;
4313 /// let x = GetIndexRequest::new().set_name("example");
4314 /// ```
4315 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4316 self.name = v.into();
4317 self
4318 }
4319}
4320
4321impl wkt::message::Message for GetIndexRequest {
4322 fn typename() -> &'static str {
4323 "type.googleapis.com/google.firestore.admin.v1.GetIndexRequest"
4324 }
4325}
4326
4327/// The request for
4328/// [FirestoreAdmin.DeleteIndex][google.firestore.admin.v1.FirestoreAdmin.DeleteIndex].
4329///
4330/// [google.firestore.admin.v1.FirestoreAdmin.DeleteIndex]: crate::client::FirestoreAdmin::delete_index
4331#[derive(Clone, Default, PartialEq)]
4332#[non_exhaustive]
4333pub struct DeleteIndexRequest {
4334 /// Required. A name of the form
4335 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
4336 pub name: std::string::String,
4337
4338 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4339}
4340
4341impl DeleteIndexRequest {
4342 pub fn new() -> Self {
4343 std::default::Default::default()
4344 }
4345
4346 /// Sets the value of [name][crate::model::DeleteIndexRequest::name].
4347 ///
4348 /// # Example
4349 /// ```ignore,no_run
4350 /// # use google_cloud_firestore_admin_v1::model::DeleteIndexRequest;
4351 /// let x = DeleteIndexRequest::new().set_name("example");
4352 /// ```
4353 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4354 self.name = v.into();
4355 self
4356 }
4357}
4358
4359impl wkt::message::Message for DeleteIndexRequest {
4360 fn typename() -> &'static str {
4361 "type.googleapis.com/google.firestore.admin.v1.DeleteIndexRequest"
4362 }
4363}
4364
4365/// The request for
4366/// [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField].
4367///
4368/// [google.firestore.admin.v1.FirestoreAdmin.UpdateField]: crate::client::FirestoreAdmin::update_field
4369#[derive(Clone, Default, PartialEq)]
4370#[non_exhaustive]
4371pub struct UpdateFieldRequest {
4372 /// Required. The field to be updated.
4373 pub field: std::option::Option<crate::model::Field>,
4374
4375 /// A mask, relative to the field. If specified, only configuration specified
4376 /// by this field_mask will be updated in the field.
4377 pub update_mask: std::option::Option<wkt::FieldMask>,
4378
4379 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4380}
4381
4382impl UpdateFieldRequest {
4383 pub fn new() -> Self {
4384 std::default::Default::default()
4385 }
4386
4387 /// Sets the value of [field][crate::model::UpdateFieldRequest::field].
4388 ///
4389 /// # Example
4390 /// ```ignore,no_run
4391 /// # use google_cloud_firestore_admin_v1::model::UpdateFieldRequest;
4392 /// use google_cloud_firestore_admin_v1::model::Field;
4393 /// let x = UpdateFieldRequest::new().set_field(Field::default()/* use setters */);
4394 /// ```
4395 pub fn set_field<T>(mut self, v: T) -> Self
4396 where
4397 T: std::convert::Into<crate::model::Field>,
4398 {
4399 self.field = std::option::Option::Some(v.into());
4400 self
4401 }
4402
4403 /// Sets or clears the value of [field][crate::model::UpdateFieldRequest::field].
4404 ///
4405 /// # Example
4406 /// ```ignore,no_run
4407 /// # use google_cloud_firestore_admin_v1::model::UpdateFieldRequest;
4408 /// use google_cloud_firestore_admin_v1::model::Field;
4409 /// let x = UpdateFieldRequest::new().set_or_clear_field(Some(Field::default()/* use setters */));
4410 /// let x = UpdateFieldRequest::new().set_or_clear_field(None::<Field>);
4411 /// ```
4412 pub fn set_or_clear_field<T>(mut self, v: std::option::Option<T>) -> Self
4413 where
4414 T: std::convert::Into<crate::model::Field>,
4415 {
4416 self.field = v.map(|x| x.into());
4417 self
4418 }
4419
4420 /// Sets the value of [update_mask][crate::model::UpdateFieldRequest::update_mask].
4421 ///
4422 /// # Example
4423 /// ```ignore,no_run
4424 /// # use google_cloud_firestore_admin_v1::model::UpdateFieldRequest;
4425 /// use wkt::FieldMask;
4426 /// let x = UpdateFieldRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4427 /// ```
4428 pub fn set_update_mask<T>(mut self, v: T) -> Self
4429 where
4430 T: std::convert::Into<wkt::FieldMask>,
4431 {
4432 self.update_mask = std::option::Option::Some(v.into());
4433 self
4434 }
4435
4436 /// Sets or clears the value of [update_mask][crate::model::UpdateFieldRequest::update_mask].
4437 ///
4438 /// # Example
4439 /// ```ignore,no_run
4440 /// # use google_cloud_firestore_admin_v1::model::UpdateFieldRequest;
4441 /// use wkt::FieldMask;
4442 /// let x = UpdateFieldRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4443 /// let x = UpdateFieldRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4444 /// ```
4445 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4446 where
4447 T: std::convert::Into<wkt::FieldMask>,
4448 {
4449 self.update_mask = v.map(|x| x.into());
4450 self
4451 }
4452}
4453
4454impl wkt::message::Message for UpdateFieldRequest {
4455 fn typename() -> &'static str {
4456 "type.googleapis.com/google.firestore.admin.v1.UpdateFieldRequest"
4457 }
4458}
4459
4460/// The request for
4461/// [FirestoreAdmin.GetField][google.firestore.admin.v1.FirestoreAdmin.GetField].
4462///
4463/// [google.firestore.admin.v1.FirestoreAdmin.GetField]: crate::client::FirestoreAdmin::get_field
4464#[derive(Clone, Default, PartialEq)]
4465#[non_exhaustive]
4466pub struct GetFieldRequest {
4467 /// Required. A name of the form
4468 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
4469 pub name: std::string::String,
4470
4471 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4472}
4473
4474impl GetFieldRequest {
4475 pub fn new() -> Self {
4476 std::default::Default::default()
4477 }
4478
4479 /// Sets the value of [name][crate::model::GetFieldRequest::name].
4480 ///
4481 /// # Example
4482 /// ```ignore,no_run
4483 /// # use google_cloud_firestore_admin_v1::model::GetFieldRequest;
4484 /// let x = GetFieldRequest::new().set_name("example");
4485 /// ```
4486 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4487 self.name = v.into();
4488 self
4489 }
4490}
4491
4492impl wkt::message::Message for GetFieldRequest {
4493 fn typename() -> &'static str {
4494 "type.googleapis.com/google.firestore.admin.v1.GetFieldRequest"
4495 }
4496}
4497
4498/// The request for
4499/// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields].
4500///
4501/// [google.firestore.admin.v1.FirestoreAdmin.ListFields]: crate::client::FirestoreAdmin::list_fields
4502#[derive(Clone, Default, PartialEq)]
4503#[non_exhaustive]
4504pub struct ListFieldsRequest {
4505 /// Required. A parent name of the form
4506 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
4507 pub parent: std::string::String,
4508
4509 /// The filter to apply to list results. Currently,
4510 /// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
4511 /// only supports listing fields that have been explicitly overridden. To issue
4512 /// this query, call
4513 /// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
4514 /// with a filter that includes `indexConfig.usesAncestorConfig:false` or
4515 /// `ttlConfig:*`.
4516 ///
4517 /// [google.firestore.admin.v1.FirestoreAdmin.ListFields]: crate::client::FirestoreAdmin::list_fields
4518 pub filter: std::string::String,
4519
4520 /// The number of results to return.
4521 pub page_size: i32,
4522
4523 /// A page token, returned from a previous call to
4524 /// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields],
4525 /// that may be used to get the next page of results.
4526 ///
4527 /// [google.firestore.admin.v1.FirestoreAdmin.ListFields]: crate::client::FirestoreAdmin::list_fields
4528 pub page_token: std::string::String,
4529
4530 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4531}
4532
4533impl ListFieldsRequest {
4534 pub fn new() -> Self {
4535 std::default::Default::default()
4536 }
4537
4538 /// Sets the value of [parent][crate::model::ListFieldsRequest::parent].
4539 ///
4540 /// # Example
4541 /// ```ignore,no_run
4542 /// # use google_cloud_firestore_admin_v1::model::ListFieldsRequest;
4543 /// let x = ListFieldsRequest::new().set_parent("example");
4544 /// ```
4545 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4546 self.parent = v.into();
4547 self
4548 }
4549
4550 /// Sets the value of [filter][crate::model::ListFieldsRequest::filter].
4551 ///
4552 /// # Example
4553 /// ```ignore,no_run
4554 /// # use google_cloud_firestore_admin_v1::model::ListFieldsRequest;
4555 /// let x = ListFieldsRequest::new().set_filter("example");
4556 /// ```
4557 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4558 self.filter = v.into();
4559 self
4560 }
4561
4562 /// Sets the value of [page_size][crate::model::ListFieldsRequest::page_size].
4563 ///
4564 /// # Example
4565 /// ```ignore,no_run
4566 /// # use google_cloud_firestore_admin_v1::model::ListFieldsRequest;
4567 /// let x = ListFieldsRequest::new().set_page_size(42);
4568 /// ```
4569 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4570 self.page_size = v.into();
4571 self
4572 }
4573
4574 /// Sets the value of [page_token][crate::model::ListFieldsRequest::page_token].
4575 ///
4576 /// # Example
4577 /// ```ignore,no_run
4578 /// # use google_cloud_firestore_admin_v1::model::ListFieldsRequest;
4579 /// let x = ListFieldsRequest::new().set_page_token("example");
4580 /// ```
4581 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4582 self.page_token = v.into();
4583 self
4584 }
4585}
4586
4587impl wkt::message::Message for ListFieldsRequest {
4588 fn typename() -> &'static str {
4589 "type.googleapis.com/google.firestore.admin.v1.ListFieldsRequest"
4590 }
4591}
4592
4593/// The response for
4594/// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields].
4595///
4596/// [google.firestore.admin.v1.FirestoreAdmin.ListFields]: crate::client::FirestoreAdmin::list_fields
4597#[derive(Clone, Default, PartialEq)]
4598#[non_exhaustive]
4599pub struct ListFieldsResponse {
4600 /// The requested fields.
4601 pub fields: std::vec::Vec<crate::model::Field>,
4602
4603 /// A page token that may be used to request another page of results. If blank,
4604 /// this is the last page.
4605 pub next_page_token: std::string::String,
4606
4607 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4608}
4609
4610impl ListFieldsResponse {
4611 pub fn new() -> Self {
4612 std::default::Default::default()
4613 }
4614
4615 /// Sets the value of [fields][crate::model::ListFieldsResponse::fields].
4616 ///
4617 /// # Example
4618 /// ```ignore,no_run
4619 /// # use google_cloud_firestore_admin_v1::model::ListFieldsResponse;
4620 /// use google_cloud_firestore_admin_v1::model::Field;
4621 /// let x = ListFieldsResponse::new()
4622 /// .set_fields([
4623 /// Field::default()/* use setters */,
4624 /// Field::default()/* use (different) setters */,
4625 /// ]);
4626 /// ```
4627 pub fn set_fields<T, V>(mut self, v: T) -> Self
4628 where
4629 T: std::iter::IntoIterator<Item = V>,
4630 V: std::convert::Into<crate::model::Field>,
4631 {
4632 use std::iter::Iterator;
4633 self.fields = v.into_iter().map(|i| i.into()).collect();
4634 self
4635 }
4636
4637 /// Sets the value of [next_page_token][crate::model::ListFieldsResponse::next_page_token].
4638 ///
4639 /// # Example
4640 /// ```ignore,no_run
4641 /// # use google_cloud_firestore_admin_v1::model::ListFieldsResponse;
4642 /// let x = ListFieldsResponse::new().set_next_page_token("example");
4643 /// ```
4644 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4645 self.next_page_token = v.into();
4646 self
4647 }
4648}
4649
4650impl wkt::message::Message for ListFieldsResponse {
4651 fn typename() -> &'static str {
4652 "type.googleapis.com/google.firestore.admin.v1.ListFieldsResponse"
4653 }
4654}
4655
4656#[doc(hidden)]
4657impl gax::paginator::internal::PageableResponse for ListFieldsResponse {
4658 type PageItem = crate::model::Field;
4659
4660 fn items(self) -> std::vec::Vec<Self::PageItem> {
4661 self.fields
4662 }
4663
4664 fn next_page_token(&self) -> std::string::String {
4665 use std::clone::Clone;
4666 self.next_page_token.clone()
4667 }
4668}
4669
4670/// The request for
4671/// [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments].
4672///
4673/// [google.firestore.admin.v1.FirestoreAdmin.ExportDocuments]: crate::client::FirestoreAdmin::export_documents
4674#[derive(Clone, Default, PartialEq)]
4675#[non_exhaustive]
4676pub struct ExportDocumentsRequest {
4677 /// Required. Database to export. Should be of the form:
4678 /// `projects/{project_id}/databases/{database_id}`.
4679 pub name: std::string::String,
4680
4681 /// Which collection IDs to export. Unspecified means all collections. Each
4682 /// collection ID in this list must be unique.
4683 pub collection_ids: std::vec::Vec<std::string::String>,
4684
4685 /// The output URI. Currently only supports Google Cloud Storage URIs of the
4686 /// form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name
4687 /// of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional
4688 /// Google Cloud Storage namespace path. When
4689 /// choosing a name, be sure to consider Google Cloud Storage naming
4690 /// guidelines: <https://cloud.google.com/storage/docs/naming>.
4691 /// If the URI is a bucket (without a namespace path), a prefix will be
4692 /// generated based on the start time.
4693 pub output_uri_prefix: std::string::String,
4694
4695 /// An empty list represents all namespaces. This is the preferred
4696 /// usage for databases that don't use namespaces.
4697 ///
4698 /// An empty string element represents the default namespace. This should be
4699 /// used if the database has data in non-default namespaces, but doesn't want
4700 /// to include them. Each namespace in this list must be unique.
4701 pub namespace_ids: std::vec::Vec<std::string::String>,
4702
4703 /// The timestamp that corresponds to the version of the database to be
4704 /// exported. The timestamp must be in the past, rounded to the minute and not
4705 /// older than
4706 /// [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
4707 /// If specified, then the exported documents will represent a consistent view
4708 /// of the database at the provided time. Otherwise, there are no guarantees
4709 /// about the consistency of the exported documents.
4710 ///
4711 /// [google.firestore.admin.v1.Database.earliest_version_time]: crate::model::Database::earliest_version_time
4712 pub snapshot_time: std::option::Option<wkt::Timestamp>,
4713
4714 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4715}
4716
4717impl ExportDocumentsRequest {
4718 pub fn new() -> Self {
4719 std::default::Default::default()
4720 }
4721
4722 /// Sets the value of [name][crate::model::ExportDocumentsRequest::name].
4723 ///
4724 /// # Example
4725 /// ```ignore,no_run
4726 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
4727 /// let x = ExportDocumentsRequest::new().set_name("example");
4728 /// ```
4729 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4730 self.name = v.into();
4731 self
4732 }
4733
4734 /// Sets the value of [collection_ids][crate::model::ExportDocumentsRequest::collection_ids].
4735 ///
4736 /// # Example
4737 /// ```ignore,no_run
4738 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
4739 /// let x = ExportDocumentsRequest::new().set_collection_ids(["a", "b", "c"]);
4740 /// ```
4741 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
4742 where
4743 T: std::iter::IntoIterator<Item = V>,
4744 V: std::convert::Into<std::string::String>,
4745 {
4746 use std::iter::Iterator;
4747 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
4748 self
4749 }
4750
4751 /// Sets the value of [output_uri_prefix][crate::model::ExportDocumentsRequest::output_uri_prefix].
4752 ///
4753 /// # Example
4754 /// ```ignore,no_run
4755 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
4756 /// let x = ExportDocumentsRequest::new().set_output_uri_prefix("example");
4757 /// ```
4758 pub fn set_output_uri_prefix<T: std::convert::Into<std::string::String>>(
4759 mut self,
4760 v: T,
4761 ) -> Self {
4762 self.output_uri_prefix = v.into();
4763 self
4764 }
4765
4766 /// Sets the value of [namespace_ids][crate::model::ExportDocumentsRequest::namespace_ids].
4767 ///
4768 /// # Example
4769 /// ```ignore,no_run
4770 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
4771 /// let x = ExportDocumentsRequest::new().set_namespace_ids(["a", "b", "c"]);
4772 /// ```
4773 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
4774 where
4775 T: std::iter::IntoIterator<Item = V>,
4776 V: std::convert::Into<std::string::String>,
4777 {
4778 use std::iter::Iterator;
4779 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
4780 self
4781 }
4782
4783 /// Sets the value of [snapshot_time][crate::model::ExportDocumentsRequest::snapshot_time].
4784 ///
4785 /// # Example
4786 /// ```ignore,no_run
4787 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
4788 /// use wkt::Timestamp;
4789 /// let x = ExportDocumentsRequest::new().set_snapshot_time(Timestamp::default()/* use setters */);
4790 /// ```
4791 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
4792 where
4793 T: std::convert::Into<wkt::Timestamp>,
4794 {
4795 self.snapshot_time = std::option::Option::Some(v.into());
4796 self
4797 }
4798
4799 /// Sets or clears the value of [snapshot_time][crate::model::ExportDocumentsRequest::snapshot_time].
4800 ///
4801 /// # Example
4802 /// ```ignore,no_run
4803 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
4804 /// use wkt::Timestamp;
4805 /// let x = ExportDocumentsRequest::new().set_or_clear_snapshot_time(Some(Timestamp::default()/* use setters */));
4806 /// let x = ExportDocumentsRequest::new().set_or_clear_snapshot_time(None::<Timestamp>);
4807 /// ```
4808 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
4809 where
4810 T: std::convert::Into<wkt::Timestamp>,
4811 {
4812 self.snapshot_time = v.map(|x| x.into());
4813 self
4814 }
4815}
4816
4817impl wkt::message::Message for ExportDocumentsRequest {
4818 fn typename() -> &'static str {
4819 "type.googleapis.com/google.firestore.admin.v1.ExportDocumentsRequest"
4820 }
4821}
4822
4823/// The request for
4824/// [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments].
4825///
4826/// [google.firestore.admin.v1.FirestoreAdmin.ImportDocuments]: crate::client::FirestoreAdmin::import_documents
4827#[derive(Clone, Default, PartialEq)]
4828#[non_exhaustive]
4829pub struct ImportDocumentsRequest {
4830 /// Required. Database to import into. Should be of the form:
4831 /// `projects/{project_id}/databases/{database_id}`.
4832 pub name: std::string::String,
4833
4834 /// Which collection IDs to import. Unspecified means all collections included
4835 /// in the import. Each collection ID in this list must be unique.
4836 pub collection_ids: std::vec::Vec<std::string::String>,
4837
4838 /// Location of the exported files.
4839 /// This must match the output_uri_prefix of an ExportDocumentsResponse from
4840 /// an export that has completed successfully.
4841 /// See:
4842 /// [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix].
4843 ///
4844 /// [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix]: crate::model::ExportDocumentsResponse::output_uri_prefix
4845 pub input_uri_prefix: std::string::String,
4846
4847 /// An empty list represents all namespaces. This is the preferred
4848 /// usage for databases that don't use namespaces.
4849 ///
4850 /// An empty string element represents the default namespace. This should be
4851 /// used if the database has data in non-default namespaces, but doesn't want
4852 /// to include them. Each namespace in this list must be unique.
4853 pub namespace_ids: std::vec::Vec<std::string::String>,
4854
4855 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4856}
4857
4858impl ImportDocumentsRequest {
4859 pub fn new() -> Self {
4860 std::default::Default::default()
4861 }
4862
4863 /// Sets the value of [name][crate::model::ImportDocumentsRequest::name].
4864 ///
4865 /// # Example
4866 /// ```ignore,no_run
4867 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsRequest;
4868 /// let x = ImportDocumentsRequest::new().set_name("example");
4869 /// ```
4870 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4871 self.name = v.into();
4872 self
4873 }
4874
4875 /// Sets the value of [collection_ids][crate::model::ImportDocumentsRequest::collection_ids].
4876 ///
4877 /// # Example
4878 /// ```ignore,no_run
4879 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsRequest;
4880 /// let x = ImportDocumentsRequest::new().set_collection_ids(["a", "b", "c"]);
4881 /// ```
4882 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
4883 where
4884 T: std::iter::IntoIterator<Item = V>,
4885 V: std::convert::Into<std::string::String>,
4886 {
4887 use std::iter::Iterator;
4888 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
4889 self
4890 }
4891
4892 /// Sets the value of [input_uri_prefix][crate::model::ImportDocumentsRequest::input_uri_prefix].
4893 ///
4894 /// # Example
4895 /// ```ignore,no_run
4896 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsRequest;
4897 /// let x = ImportDocumentsRequest::new().set_input_uri_prefix("example");
4898 /// ```
4899 pub fn set_input_uri_prefix<T: std::convert::Into<std::string::String>>(
4900 mut self,
4901 v: T,
4902 ) -> Self {
4903 self.input_uri_prefix = v.into();
4904 self
4905 }
4906
4907 /// Sets the value of [namespace_ids][crate::model::ImportDocumentsRequest::namespace_ids].
4908 ///
4909 /// # Example
4910 /// ```ignore,no_run
4911 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsRequest;
4912 /// let x = ImportDocumentsRequest::new().set_namespace_ids(["a", "b", "c"]);
4913 /// ```
4914 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
4915 where
4916 T: std::iter::IntoIterator<Item = V>,
4917 V: std::convert::Into<std::string::String>,
4918 {
4919 use std::iter::Iterator;
4920 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
4921 self
4922 }
4923}
4924
4925impl wkt::message::Message for ImportDocumentsRequest {
4926 fn typename() -> &'static str {
4927 "type.googleapis.com/google.firestore.admin.v1.ImportDocumentsRequest"
4928 }
4929}
4930
4931/// The request for
4932/// [FirestoreAdmin.BulkDeleteDocuments][google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments].
4933///
4934/// When both collection_ids and namespace_ids are set, only documents satisfying
4935/// both conditions will be deleted.
4936///
4937/// Requests with namespace_ids and collection_ids both empty will be rejected.
4938/// Please use
4939/// [FirestoreAdmin.DeleteDatabase][google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase]
4940/// instead.
4941///
4942/// [google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments]: crate::client::FirestoreAdmin::bulk_delete_documents
4943/// [google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase]: crate::client::FirestoreAdmin::delete_database
4944#[derive(Clone, Default, PartialEq)]
4945#[non_exhaustive]
4946pub struct BulkDeleteDocumentsRequest {
4947 /// Required. Database to operate. Should be of the form:
4948 /// `projects/{project_id}/databases/{database_id}`.
4949 pub name: std::string::String,
4950
4951 /// Optional. IDs of the collection groups to delete. Unspecified means all
4952 /// collection groups.
4953 ///
4954 /// Each collection group in this list must be unique.
4955 pub collection_ids: std::vec::Vec<std::string::String>,
4956
4957 /// Optional. Namespaces to delete.
4958 ///
4959 /// An empty list means all namespaces. This is the recommended
4960 /// usage for databases that don't use namespaces.
4961 ///
4962 /// An empty string element represents the default namespace. This should be
4963 /// used if the database has data in non-default namespaces, but doesn't want
4964 /// to delete from them.
4965 ///
4966 /// Each namespace in this list must be unique.
4967 pub namespace_ids: std::vec::Vec<std::string::String>,
4968
4969 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4970}
4971
4972impl BulkDeleteDocumentsRequest {
4973 pub fn new() -> Self {
4974 std::default::Default::default()
4975 }
4976
4977 /// Sets the value of [name][crate::model::BulkDeleteDocumentsRequest::name].
4978 ///
4979 /// # Example
4980 /// ```ignore,no_run
4981 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsRequest;
4982 /// let x = BulkDeleteDocumentsRequest::new().set_name("example");
4983 /// ```
4984 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4985 self.name = v.into();
4986 self
4987 }
4988
4989 /// Sets the value of [collection_ids][crate::model::BulkDeleteDocumentsRequest::collection_ids].
4990 ///
4991 /// # Example
4992 /// ```ignore,no_run
4993 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsRequest;
4994 /// let x = BulkDeleteDocumentsRequest::new().set_collection_ids(["a", "b", "c"]);
4995 /// ```
4996 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
4997 where
4998 T: std::iter::IntoIterator<Item = V>,
4999 V: std::convert::Into<std::string::String>,
5000 {
5001 use std::iter::Iterator;
5002 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
5003 self
5004 }
5005
5006 /// Sets the value of [namespace_ids][crate::model::BulkDeleteDocumentsRequest::namespace_ids].
5007 ///
5008 /// # Example
5009 /// ```ignore,no_run
5010 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsRequest;
5011 /// let x = BulkDeleteDocumentsRequest::new().set_namespace_ids(["a", "b", "c"]);
5012 /// ```
5013 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
5014 where
5015 T: std::iter::IntoIterator<Item = V>,
5016 V: std::convert::Into<std::string::String>,
5017 {
5018 use std::iter::Iterator;
5019 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
5020 self
5021 }
5022}
5023
5024impl wkt::message::Message for BulkDeleteDocumentsRequest {
5025 fn typename() -> &'static str {
5026 "type.googleapis.com/google.firestore.admin.v1.BulkDeleteDocumentsRequest"
5027 }
5028}
5029
5030/// The response for
5031/// [FirestoreAdmin.BulkDeleteDocuments][google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments].
5032///
5033/// [google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments]: crate::client::FirestoreAdmin::bulk_delete_documents
5034#[derive(Clone, Default, PartialEq)]
5035#[non_exhaustive]
5036pub struct BulkDeleteDocumentsResponse {
5037 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5038}
5039
5040impl BulkDeleteDocumentsResponse {
5041 pub fn new() -> Self {
5042 std::default::Default::default()
5043 }
5044}
5045
5046impl wkt::message::Message for BulkDeleteDocumentsResponse {
5047 fn typename() -> &'static str {
5048 "type.googleapis.com/google.firestore.admin.v1.BulkDeleteDocumentsResponse"
5049 }
5050}
5051
5052/// The request for
5053/// [FirestoreAdmin.GetBackup][google.firestore.admin.v1.FirestoreAdmin.GetBackup].
5054///
5055/// [google.firestore.admin.v1.FirestoreAdmin.GetBackup]: crate::client::FirestoreAdmin::get_backup
5056#[derive(Clone, Default, PartialEq)]
5057#[non_exhaustive]
5058pub struct GetBackupRequest {
5059 /// Required. Name of the backup to fetch.
5060 ///
5061 /// Format is `projects/{project}/locations/{location}/backups/{backup}`.
5062 pub name: std::string::String,
5063
5064 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5065}
5066
5067impl GetBackupRequest {
5068 pub fn new() -> Self {
5069 std::default::Default::default()
5070 }
5071
5072 /// Sets the value of [name][crate::model::GetBackupRequest::name].
5073 ///
5074 /// # Example
5075 /// ```ignore,no_run
5076 /// # use google_cloud_firestore_admin_v1::model::GetBackupRequest;
5077 /// let x = GetBackupRequest::new().set_name("example");
5078 /// ```
5079 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5080 self.name = v.into();
5081 self
5082 }
5083}
5084
5085impl wkt::message::Message for GetBackupRequest {
5086 fn typename() -> &'static str {
5087 "type.googleapis.com/google.firestore.admin.v1.GetBackupRequest"
5088 }
5089}
5090
5091/// The request for
5092/// [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups].
5093///
5094/// [google.firestore.admin.v1.FirestoreAdmin.ListBackups]: crate::client::FirestoreAdmin::list_backups
5095#[derive(Clone, Default, PartialEq)]
5096#[non_exhaustive]
5097pub struct ListBackupsRequest {
5098 /// Required. The location to list backups from.
5099 ///
5100 /// Format is `projects/{project}/locations/{location}`.
5101 /// Use `{location} = '-'` to list backups from all locations for the given
5102 /// project. This allows listing backups from a single location or from all
5103 /// locations.
5104 pub parent: std::string::String,
5105
5106 /// An expression that filters the list of returned backups.
5107 ///
5108 /// A filter expression consists of a field name, a comparison operator, and a
5109 /// value for filtering.
5110 /// The value must be a string, a number, or a boolean. The comparison operator
5111 /// must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
5112 /// Colon `:` is the contains operator. Filter rules are not case sensitive.
5113 ///
5114 /// The following fields in the [Backup][google.firestore.admin.v1.Backup] are
5115 /// eligible for filtering:
5116 ///
5117 /// * `database_uid` (supports `=` only)
5118 ///
5119 /// [google.firestore.admin.v1.Backup]: crate::model::Backup
5120 pub filter: std::string::String,
5121
5122 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5123}
5124
5125impl ListBackupsRequest {
5126 pub fn new() -> Self {
5127 std::default::Default::default()
5128 }
5129
5130 /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
5131 ///
5132 /// # Example
5133 /// ```ignore,no_run
5134 /// # use google_cloud_firestore_admin_v1::model::ListBackupsRequest;
5135 /// let x = ListBackupsRequest::new().set_parent("example");
5136 /// ```
5137 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5138 self.parent = v.into();
5139 self
5140 }
5141
5142 /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
5143 ///
5144 /// # Example
5145 /// ```ignore,no_run
5146 /// # use google_cloud_firestore_admin_v1::model::ListBackupsRequest;
5147 /// let x = ListBackupsRequest::new().set_filter("example");
5148 /// ```
5149 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5150 self.filter = v.into();
5151 self
5152 }
5153}
5154
5155impl wkt::message::Message for ListBackupsRequest {
5156 fn typename() -> &'static str {
5157 "type.googleapis.com/google.firestore.admin.v1.ListBackupsRequest"
5158 }
5159}
5160
5161/// The response for
5162/// [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups].
5163///
5164/// [google.firestore.admin.v1.FirestoreAdmin.ListBackups]: crate::client::FirestoreAdmin::list_backups
5165#[derive(Clone, Default, PartialEq)]
5166#[non_exhaustive]
5167pub struct ListBackupsResponse {
5168 /// List of all backups for the project.
5169 pub backups: std::vec::Vec<crate::model::Backup>,
5170
5171 /// List of locations that existing backups were not able to be fetched from.
5172 ///
5173 /// Instead of failing the entire requests when a single location is
5174 /// unreachable, this response returns a partial result set and list of
5175 /// locations unable to be reached here. The request can be retried against a
5176 /// single location to get a concrete error.
5177 pub unreachable: std::vec::Vec<std::string::String>,
5178
5179 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5180}
5181
5182impl ListBackupsResponse {
5183 pub fn new() -> Self {
5184 std::default::Default::default()
5185 }
5186
5187 /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
5188 ///
5189 /// # Example
5190 /// ```ignore,no_run
5191 /// # use google_cloud_firestore_admin_v1::model::ListBackupsResponse;
5192 /// use google_cloud_firestore_admin_v1::model::Backup;
5193 /// let x = ListBackupsResponse::new()
5194 /// .set_backups([
5195 /// Backup::default()/* use setters */,
5196 /// Backup::default()/* use (different) setters */,
5197 /// ]);
5198 /// ```
5199 pub fn set_backups<T, V>(mut self, v: T) -> Self
5200 where
5201 T: std::iter::IntoIterator<Item = V>,
5202 V: std::convert::Into<crate::model::Backup>,
5203 {
5204 use std::iter::Iterator;
5205 self.backups = v.into_iter().map(|i| i.into()).collect();
5206 self
5207 }
5208
5209 /// Sets the value of [unreachable][crate::model::ListBackupsResponse::unreachable].
5210 ///
5211 /// # Example
5212 /// ```ignore,no_run
5213 /// # use google_cloud_firestore_admin_v1::model::ListBackupsResponse;
5214 /// let x = ListBackupsResponse::new().set_unreachable(["a", "b", "c"]);
5215 /// ```
5216 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5217 where
5218 T: std::iter::IntoIterator<Item = V>,
5219 V: std::convert::Into<std::string::String>,
5220 {
5221 use std::iter::Iterator;
5222 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5223 self
5224 }
5225}
5226
5227impl wkt::message::Message for ListBackupsResponse {
5228 fn typename() -> &'static str {
5229 "type.googleapis.com/google.firestore.admin.v1.ListBackupsResponse"
5230 }
5231}
5232
5233/// The request for
5234/// [FirestoreAdmin.DeleteBackup][google.firestore.admin.v1.FirestoreAdmin.DeleteBackup].
5235///
5236/// [google.firestore.admin.v1.FirestoreAdmin.DeleteBackup]: crate::client::FirestoreAdmin::delete_backup
5237#[derive(Clone, Default, PartialEq)]
5238#[non_exhaustive]
5239pub struct DeleteBackupRequest {
5240 /// Required. Name of the backup to delete.
5241 ///
5242 /// format is `projects/{project}/locations/{location}/backups/{backup}`.
5243 pub name: std::string::String,
5244
5245 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5246}
5247
5248impl DeleteBackupRequest {
5249 pub fn new() -> Self {
5250 std::default::Default::default()
5251 }
5252
5253 /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
5254 ///
5255 /// # Example
5256 /// ```ignore,no_run
5257 /// # use google_cloud_firestore_admin_v1::model::DeleteBackupRequest;
5258 /// let x = DeleteBackupRequest::new().set_name("example");
5259 /// ```
5260 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5261 self.name = v.into();
5262 self
5263 }
5264}
5265
5266impl wkt::message::Message for DeleteBackupRequest {
5267 fn typename() -> &'static str {
5268 "type.googleapis.com/google.firestore.admin.v1.DeleteBackupRequest"
5269 }
5270}
5271
5272/// The request message for
5273/// [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.FirestoreAdmin.RestoreDatabase].
5274///
5275/// [google.firestore.admin.v1.FirestoreAdmin.RestoreDatabase]: crate::client::FirestoreAdmin::restore_database
5276#[derive(Clone, Default, PartialEq)]
5277#[non_exhaustive]
5278pub struct RestoreDatabaseRequest {
5279 /// Required. The project to restore the database in. Format is
5280 /// `projects/{project_id}`.
5281 pub parent: std::string::String,
5282
5283 /// Required. The ID to use for the database, which will become the final
5284 /// component of the database's resource name. This database ID must not be
5285 /// associated with an existing database.
5286 ///
5287 /// This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
5288 /// with first character a letter and the last a letter or a number. Must not
5289 /// be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
5290 ///
5291 /// "(default)" database ID is also valid.
5292 pub database_id: std::string::String,
5293
5294 /// Required. Backup to restore from. Must be from the same project as the
5295 /// parent.
5296 ///
5297 /// The restored database will be created in the same location as the source
5298 /// backup.
5299 ///
5300 /// Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
5301 pub backup: std::string::String,
5302
5303 /// Optional. Encryption configuration for the restored database.
5304 ///
5305 /// If this field is not specified, the restored database will use
5306 /// the same encryption configuration as the backup, namely
5307 /// [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
5308 ///
5309 /// [google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption]: crate::model::database::EncryptionConfig::encryption_type
5310 pub encryption_config: std::option::Option<crate::model::database::EncryptionConfig>,
5311
5312 /// Optional. Immutable. Tags to be bound to the restored database.
5313 ///
5314 /// The tags should be provided in the format of
5315 /// `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
5316 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
5317
5318 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5319}
5320
5321impl RestoreDatabaseRequest {
5322 pub fn new() -> Self {
5323 std::default::Default::default()
5324 }
5325
5326 /// Sets the value of [parent][crate::model::RestoreDatabaseRequest::parent].
5327 ///
5328 /// # Example
5329 /// ```ignore,no_run
5330 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5331 /// let x = RestoreDatabaseRequest::new().set_parent("example");
5332 /// ```
5333 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5334 self.parent = v.into();
5335 self
5336 }
5337
5338 /// Sets the value of [database_id][crate::model::RestoreDatabaseRequest::database_id].
5339 ///
5340 /// # Example
5341 /// ```ignore,no_run
5342 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5343 /// let x = RestoreDatabaseRequest::new().set_database_id("example");
5344 /// ```
5345 pub fn set_database_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5346 self.database_id = v.into();
5347 self
5348 }
5349
5350 /// Sets the value of [backup][crate::model::RestoreDatabaseRequest::backup].
5351 ///
5352 /// # Example
5353 /// ```ignore,no_run
5354 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5355 /// let x = RestoreDatabaseRequest::new().set_backup("example");
5356 /// ```
5357 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5358 self.backup = v.into();
5359 self
5360 }
5361
5362 /// Sets the value of [encryption_config][crate::model::RestoreDatabaseRequest::encryption_config].
5363 ///
5364 /// # Example
5365 /// ```ignore,no_run
5366 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5367 /// use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
5368 /// let x = RestoreDatabaseRequest::new().set_encryption_config(EncryptionConfig::default()/* use setters */);
5369 /// ```
5370 pub fn set_encryption_config<T>(mut self, v: T) -> Self
5371 where
5372 T: std::convert::Into<crate::model::database::EncryptionConfig>,
5373 {
5374 self.encryption_config = std::option::Option::Some(v.into());
5375 self
5376 }
5377
5378 /// Sets or clears the value of [encryption_config][crate::model::RestoreDatabaseRequest::encryption_config].
5379 ///
5380 /// # Example
5381 /// ```ignore,no_run
5382 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5383 /// use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
5384 /// let x = RestoreDatabaseRequest::new().set_or_clear_encryption_config(Some(EncryptionConfig::default()/* use setters */));
5385 /// let x = RestoreDatabaseRequest::new().set_or_clear_encryption_config(None::<EncryptionConfig>);
5386 /// ```
5387 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
5388 where
5389 T: std::convert::Into<crate::model::database::EncryptionConfig>,
5390 {
5391 self.encryption_config = v.map(|x| x.into());
5392 self
5393 }
5394
5395 /// Sets the value of [tags][crate::model::RestoreDatabaseRequest::tags].
5396 ///
5397 /// # Example
5398 /// ```ignore,no_run
5399 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5400 /// let x = RestoreDatabaseRequest::new().set_tags([
5401 /// ("key0", "abc"),
5402 /// ("key1", "xyz"),
5403 /// ]);
5404 /// ```
5405 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
5406 where
5407 T: std::iter::IntoIterator<Item = (K, V)>,
5408 K: std::convert::Into<std::string::String>,
5409 V: std::convert::Into<std::string::String>,
5410 {
5411 use std::iter::Iterator;
5412 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5413 self
5414 }
5415}
5416
5417impl wkt::message::Message for RestoreDatabaseRequest {
5418 fn typename() -> &'static str {
5419 "type.googleapis.com/google.firestore.admin.v1.RestoreDatabaseRequest"
5420 }
5421}
5422
5423/// The request message for
5424/// [FirestoreAdmin.CloneDatabase][google.firestore.admin.v1.FirestoreAdmin.CloneDatabase].
5425///
5426/// [google.firestore.admin.v1.FirestoreAdmin.CloneDatabase]: crate::client::FirestoreAdmin::clone_database
5427#[derive(Clone, Default, PartialEq)]
5428#[non_exhaustive]
5429pub struct CloneDatabaseRequest {
5430 /// Required. The project to clone the database in. Format is
5431 /// `projects/{project_id}`.
5432 pub parent: std::string::String,
5433
5434 /// Required. The ID to use for the database, which will become the final
5435 /// component of the database's resource name. This database ID must not be
5436 /// associated with an existing database.
5437 ///
5438 /// This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
5439 /// with first character a letter and the last a letter or a number. Must not
5440 /// be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
5441 ///
5442 /// "(default)" database ID is also valid.
5443 pub database_id: std::string::String,
5444
5445 /// Required. Specification of the PITR data to clone from. The source database
5446 /// must exist.
5447 ///
5448 /// The cloned database will be created in the same location as the source
5449 /// database.
5450 pub pitr_snapshot: std::option::Option<crate::model::PitrSnapshot>,
5451
5452 /// Optional. Encryption configuration for the cloned database.
5453 ///
5454 /// If this field is not specified, the cloned database will use
5455 /// the same encryption configuration as the source database, namely
5456 /// [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
5457 ///
5458 /// [google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption]: crate::model::database::EncryptionConfig::encryption_type
5459 pub encryption_config: std::option::Option<crate::model::database::EncryptionConfig>,
5460
5461 /// Optional. Immutable. Tags to be bound to the cloned database.
5462 ///
5463 /// The tags should be provided in the format of
5464 /// `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
5465 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
5466
5467 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5468}
5469
5470impl CloneDatabaseRequest {
5471 pub fn new() -> Self {
5472 std::default::Default::default()
5473 }
5474
5475 /// Sets the value of [parent][crate::model::CloneDatabaseRequest::parent].
5476 ///
5477 /// # Example
5478 /// ```ignore,no_run
5479 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5480 /// let x = CloneDatabaseRequest::new().set_parent("example");
5481 /// ```
5482 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5483 self.parent = v.into();
5484 self
5485 }
5486
5487 /// Sets the value of [database_id][crate::model::CloneDatabaseRequest::database_id].
5488 ///
5489 /// # Example
5490 /// ```ignore,no_run
5491 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5492 /// let x = CloneDatabaseRequest::new().set_database_id("example");
5493 /// ```
5494 pub fn set_database_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5495 self.database_id = v.into();
5496 self
5497 }
5498
5499 /// Sets the value of [pitr_snapshot][crate::model::CloneDatabaseRequest::pitr_snapshot].
5500 ///
5501 /// # Example
5502 /// ```ignore,no_run
5503 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5504 /// use google_cloud_firestore_admin_v1::model::PitrSnapshot;
5505 /// let x = CloneDatabaseRequest::new().set_pitr_snapshot(PitrSnapshot::default()/* use setters */);
5506 /// ```
5507 pub fn set_pitr_snapshot<T>(mut self, v: T) -> Self
5508 where
5509 T: std::convert::Into<crate::model::PitrSnapshot>,
5510 {
5511 self.pitr_snapshot = std::option::Option::Some(v.into());
5512 self
5513 }
5514
5515 /// Sets or clears the value of [pitr_snapshot][crate::model::CloneDatabaseRequest::pitr_snapshot].
5516 ///
5517 /// # Example
5518 /// ```ignore,no_run
5519 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5520 /// use google_cloud_firestore_admin_v1::model::PitrSnapshot;
5521 /// let x = CloneDatabaseRequest::new().set_or_clear_pitr_snapshot(Some(PitrSnapshot::default()/* use setters */));
5522 /// let x = CloneDatabaseRequest::new().set_or_clear_pitr_snapshot(None::<PitrSnapshot>);
5523 /// ```
5524 pub fn set_or_clear_pitr_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
5525 where
5526 T: std::convert::Into<crate::model::PitrSnapshot>,
5527 {
5528 self.pitr_snapshot = v.map(|x| x.into());
5529 self
5530 }
5531
5532 /// Sets the value of [encryption_config][crate::model::CloneDatabaseRequest::encryption_config].
5533 ///
5534 /// # Example
5535 /// ```ignore,no_run
5536 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5537 /// use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
5538 /// let x = CloneDatabaseRequest::new().set_encryption_config(EncryptionConfig::default()/* use setters */);
5539 /// ```
5540 pub fn set_encryption_config<T>(mut self, v: T) -> Self
5541 where
5542 T: std::convert::Into<crate::model::database::EncryptionConfig>,
5543 {
5544 self.encryption_config = std::option::Option::Some(v.into());
5545 self
5546 }
5547
5548 /// Sets or clears the value of [encryption_config][crate::model::CloneDatabaseRequest::encryption_config].
5549 ///
5550 /// # Example
5551 /// ```ignore,no_run
5552 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5553 /// use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
5554 /// let x = CloneDatabaseRequest::new().set_or_clear_encryption_config(Some(EncryptionConfig::default()/* use setters */));
5555 /// let x = CloneDatabaseRequest::new().set_or_clear_encryption_config(None::<EncryptionConfig>);
5556 /// ```
5557 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
5558 where
5559 T: std::convert::Into<crate::model::database::EncryptionConfig>,
5560 {
5561 self.encryption_config = v.map(|x| x.into());
5562 self
5563 }
5564
5565 /// Sets the value of [tags][crate::model::CloneDatabaseRequest::tags].
5566 ///
5567 /// # Example
5568 /// ```ignore,no_run
5569 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5570 /// let x = CloneDatabaseRequest::new().set_tags([
5571 /// ("key0", "abc"),
5572 /// ("key1", "xyz"),
5573 /// ]);
5574 /// ```
5575 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
5576 where
5577 T: std::iter::IntoIterator<Item = (K, V)>,
5578 K: std::convert::Into<std::string::String>,
5579 V: std::convert::Into<std::string::String>,
5580 {
5581 use std::iter::Iterator;
5582 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5583 self
5584 }
5585}
5586
5587impl wkt::message::Message for CloneDatabaseRequest {
5588 fn typename() -> &'static str {
5589 "type.googleapis.com/google.firestore.admin.v1.CloneDatabaseRequest"
5590 }
5591}
5592
5593/// Cloud Firestore indexes enable simple and complex queries against
5594/// documents in a database.
5595#[derive(Clone, Default, PartialEq)]
5596#[non_exhaustive]
5597pub struct Index {
5598 /// Output only. A server defined name for this index.
5599 /// The form of this name for composite indexes will be:
5600 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}`
5601 /// For single field indexes, this field will be empty.
5602 pub name: std::string::String,
5603
5604 /// Indexes with a collection query scope specified allow queries
5605 /// against a collection that is the child of a specific document, specified at
5606 /// query time, and that has the same collection ID.
5607 ///
5608 /// Indexes with a collection group query scope specified allow queries against
5609 /// all collections descended from a specific document, specified at query
5610 /// time, and that have the same collection ID as this index.
5611 pub query_scope: crate::model::index::QueryScope,
5612
5613 /// The API scope supported by this index.
5614 pub api_scope: crate::model::index::ApiScope,
5615
5616 /// The fields supported by this index.
5617 ///
5618 /// For composite indexes, this requires a minimum of 2 and a maximum of 100
5619 /// fields. The last field entry is always for the field path `__name__`. If,
5620 /// on creation, `__name__` was not specified as the last field, it will be
5621 /// added automatically with the same direction as that of the last field
5622 /// defined. If the final field in a composite index is not directional, the
5623 /// `__name__` will be ordered ASCENDING (unless explicitly specified).
5624 ///
5625 /// For single field indexes, this will always be exactly one entry with a
5626 /// field path equal to the field path of the associated field.
5627 pub fields: std::vec::Vec<crate::model::index::IndexField>,
5628
5629 /// Output only. The serving state of the index.
5630 pub state: crate::model::index::State,
5631
5632 /// Immutable. The density configuration of the index.
5633 pub density: crate::model::index::Density,
5634
5635 /// Optional. Whether the index is multikey. By default, the index is not
5636 /// multikey. For non-multikey indexes, none of the paths in the index
5637 /// definition reach or traverse an array, except via an explicit array index.
5638 /// For multikey indexes, at most one of the paths in the index definition
5639 /// reach or traverse an array, except via an explicit array index. Violations
5640 /// will result in errors.
5641 ///
5642 /// Note this field only applies to index with MONGODB_COMPATIBLE_API ApiScope.
5643 pub multikey: bool,
5644
5645 /// Optional. The number of shards for the index.
5646 pub shard_count: i32,
5647
5648 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5649}
5650
5651impl Index {
5652 pub fn new() -> Self {
5653 std::default::Default::default()
5654 }
5655
5656 /// Sets the value of [name][crate::model::Index::name].
5657 ///
5658 /// # Example
5659 /// ```ignore,no_run
5660 /// # use google_cloud_firestore_admin_v1::model::Index;
5661 /// let x = Index::new().set_name("example");
5662 /// ```
5663 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5664 self.name = v.into();
5665 self
5666 }
5667
5668 /// Sets the value of [query_scope][crate::model::Index::query_scope].
5669 ///
5670 /// # Example
5671 /// ```ignore,no_run
5672 /// # use google_cloud_firestore_admin_v1::model::Index;
5673 /// use google_cloud_firestore_admin_v1::model::index::QueryScope;
5674 /// let x0 = Index::new().set_query_scope(QueryScope::Collection);
5675 /// let x1 = Index::new().set_query_scope(QueryScope::CollectionGroup);
5676 /// let x2 = Index::new().set_query_scope(QueryScope::CollectionRecursive);
5677 /// ```
5678 pub fn set_query_scope<T: std::convert::Into<crate::model::index::QueryScope>>(
5679 mut self,
5680 v: T,
5681 ) -> Self {
5682 self.query_scope = v.into();
5683 self
5684 }
5685
5686 /// Sets the value of [api_scope][crate::model::Index::api_scope].
5687 ///
5688 /// # Example
5689 /// ```ignore,no_run
5690 /// # use google_cloud_firestore_admin_v1::model::Index;
5691 /// use google_cloud_firestore_admin_v1::model::index::ApiScope;
5692 /// let x0 = Index::new().set_api_scope(ApiScope::DatastoreModeApi);
5693 /// let x1 = Index::new().set_api_scope(ApiScope::MongodbCompatibleApi);
5694 /// ```
5695 pub fn set_api_scope<T: std::convert::Into<crate::model::index::ApiScope>>(
5696 mut self,
5697 v: T,
5698 ) -> Self {
5699 self.api_scope = v.into();
5700 self
5701 }
5702
5703 /// Sets the value of [fields][crate::model::Index::fields].
5704 ///
5705 /// # Example
5706 /// ```ignore,no_run
5707 /// # use google_cloud_firestore_admin_v1::model::Index;
5708 /// use google_cloud_firestore_admin_v1::model::index::IndexField;
5709 /// let x = Index::new()
5710 /// .set_fields([
5711 /// IndexField::default()/* use setters */,
5712 /// IndexField::default()/* use (different) setters */,
5713 /// ]);
5714 /// ```
5715 pub fn set_fields<T, V>(mut self, v: T) -> Self
5716 where
5717 T: std::iter::IntoIterator<Item = V>,
5718 V: std::convert::Into<crate::model::index::IndexField>,
5719 {
5720 use std::iter::Iterator;
5721 self.fields = v.into_iter().map(|i| i.into()).collect();
5722 self
5723 }
5724
5725 /// Sets the value of [state][crate::model::Index::state].
5726 ///
5727 /// # Example
5728 /// ```ignore,no_run
5729 /// # use google_cloud_firestore_admin_v1::model::Index;
5730 /// use google_cloud_firestore_admin_v1::model::index::State;
5731 /// let x0 = Index::new().set_state(State::Creating);
5732 /// let x1 = Index::new().set_state(State::Ready);
5733 /// let x2 = Index::new().set_state(State::NeedsRepair);
5734 /// ```
5735 pub fn set_state<T: std::convert::Into<crate::model::index::State>>(mut self, v: T) -> Self {
5736 self.state = v.into();
5737 self
5738 }
5739
5740 /// Sets the value of [density][crate::model::Index::density].
5741 ///
5742 /// # Example
5743 /// ```ignore,no_run
5744 /// # use google_cloud_firestore_admin_v1::model::Index;
5745 /// use google_cloud_firestore_admin_v1::model::index::Density;
5746 /// let x0 = Index::new().set_density(Density::SparseAll);
5747 /// let x1 = Index::new().set_density(Density::SparseAny);
5748 /// let x2 = Index::new().set_density(Density::Dense);
5749 /// ```
5750 pub fn set_density<T: std::convert::Into<crate::model::index::Density>>(
5751 mut self,
5752 v: T,
5753 ) -> Self {
5754 self.density = v.into();
5755 self
5756 }
5757
5758 /// Sets the value of [multikey][crate::model::Index::multikey].
5759 ///
5760 /// # Example
5761 /// ```ignore,no_run
5762 /// # use google_cloud_firestore_admin_v1::model::Index;
5763 /// let x = Index::new().set_multikey(true);
5764 /// ```
5765 pub fn set_multikey<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5766 self.multikey = v.into();
5767 self
5768 }
5769
5770 /// Sets the value of [shard_count][crate::model::Index::shard_count].
5771 ///
5772 /// # Example
5773 /// ```ignore,no_run
5774 /// # use google_cloud_firestore_admin_v1::model::Index;
5775 /// let x = Index::new().set_shard_count(42);
5776 /// ```
5777 pub fn set_shard_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5778 self.shard_count = v.into();
5779 self
5780 }
5781}
5782
5783impl wkt::message::Message for Index {
5784 fn typename() -> &'static str {
5785 "type.googleapis.com/google.firestore.admin.v1.Index"
5786 }
5787}
5788
5789/// Defines additional types related to [Index].
5790pub mod index {
5791 #[allow(unused_imports)]
5792 use super::*;
5793
5794 /// A field in an index.
5795 /// The field_path describes which field is indexed, the value_mode describes
5796 /// how the field value is indexed.
5797 #[derive(Clone, Default, PartialEq)]
5798 #[non_exhaustive]
5799 pub struct IndexField {
5800 /// Can be __name__.
5801 /// For single field indexes, this must match the name of the field or may
5802 /// be omitted.
5803 pub field_path: std::string::String,
5804
5805 /// How the field value is indexed.
5806 pub value_mode: std::option::Option<crate::model::index::index_field::ValueMode>,
5807
5808 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5809 }
5810
5811 impl IndexField {
5812 pub fn new() -> Self {
5813 std::default::Default::default()
5814 }
5815
5816 /// Sets the value of [field_path][crate::model::index::IndexField::field_path].
5817 ///
5818 /// # Example
5819 /// ```ignore,no_run
5820 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
5821 /// let x = IndexField::new().set_field_path("example");
5822 /// ```
5823 pub fn set_field_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5824 self.field_path = v.into();
5825 self
5826 }
5827
5828 /// Sets the value of [value_mode][crate::model::index::IndexField::value_mode].
5829 ///
5830 /// Note that all the setters affecting `value_mode` are mutually
5831 /// exclusive.
5832 ///
5833 /// # Example
5834 /// ```ignore,no_run
5835 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
5836 /// use google_cloud_firestore_admin_v1::model::index::index_field::Order;
5837 /// let x0 = IndexField::new().set_value_mode(Some(
5838 /// google_cloud_firestore_admin_v1::model::index::index_field::ValueMode::Order(Order::Ascending)));
5839 /// let x1 = IndexField::new().set_value_mode(Some(
5840 /// google_cloud_firestore_admin_v1::model::index::index_field::ValueMode::Order(Order::Descending)));
5841 /// ```
5842 pub fn set_value_mode<
5843 T: std::convert::Into<std::option::Option<crate::model::index::index_field::ValueMode>>,
5844 >(
5845 mut self,
5846 v: T,
5847 ) -> Self {
5848 self.value_mode = v.into();
5849 self
5850 }
5851
5852 /// The value of [value_mode][crate::model::index::IndexField::value_mode]
5853 /// if it holds a `Order`, `None` if the field is not set or
5854 /// holds a different branch.
5855 pub fn order(&self) -> std::option::Option<&crate::model::index::index_field::Order> {
5856 #[allow(unreachable_patterns)]
5857 self.value_mode.as_ref().and_then(|v| match v {
5858 crate::model::index::index_field::ValueMode::Order(v) => {
5859 std::option::Option::Some(v)
5860 }
5861 _ => std::option::Option::None,
5862 })
5863 }
5864
5865 /// Sets the value of [value_mode][crate::model::index::IndexField::value_mode]
5866 /// to hold a `Order`.
5867 ///
5868 /// Note that all the setters affecting `value_mode` are
5869 /// mutually exclusive.
5870 ///
5871 /// # Example
5872 /// ```ignore,no_run
5873 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
5874 /// use google_cloud_firestore_admin_v1::model::index::index_field::Order;
5875 /// let x0 = IndexField::new().set_order(Order::Ascending);
5876 /// let x1 = IndexField::new().set_order(Order::Descending);
5877 /// assert!(x0.order().is_some());
5878 /// assert!(x0.array_config().is_none());
5879 /// assert!(x0.vector_config().is_none());
5880 /// assert!(x1.order().is_some());
5881 /// assert!(x1.array_config().is_none());
5882 /// assert!(x1.vector_config().is_none());
5883 /// ```
5884 pub fn set_order<T: std::convert::Into<crate::model::index::index_field::Order>>(
5885 mut self,
5886 v: T,
5887 ) -> Self {
5888 self.value_mode = std::option::Option::Some(
5889 crate::model::index::index_field::ValueMode::Order(v.into()),
5890 );
5891 self
5892 }
5893
5894 /// The value of [value_mode][crate::model::index::IndexField::value_mode]
5895 /// if it holds a `ArrayConfig`, `None` if the field is not set or
5896 /// holds a different branch.
5897 pub fn array_config(
5898 &self,
5899 ) -> std::option::Option<&crate::model::index::index_field::ArrayConfig> {
5900 #[allow(unreachable_patterns)]
5901 self.value_mode.as_ref().and_then(|v| match v {
5902 crate::model::index::index_field::ValueMode::ArrayConfig(v) => {
5903 std::option::Option::Some(v)
5904 }
5905 _ => std::option::Option::None,
5906 })
5907 }
5908
5909 /// Sets the value of [value_mode][crate::model::index::IndexField::value_mode]
5910 /// to hold a `ArrayConfig`.
5911 ///
5912 /// Note that all the setters affecting `value_mode` are
5913 /// mutually exclusive.
5914 ///
5915 /// # Example
5916 /// ```ignore,no_run
5917 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
5918 /// use google_cloud_firestore_admin_v1::model::index::index_field::ArrayConfig;
5919 /// let x0 = IndexField::new().set_array_config(ArrayConfig::Contains);
5920 /// assert!(x0.array_config().is_some());
5921 /// assert!(x0.order().is_none());
5922 /// assert!(x0.vector_config().is_none());
5923 /// ```
5924 pub fn set_array_config<
5925 T: std::convert::Into<crate::model::index::index_field::ArrayConfig>,
5926 >(
5927 mut self,
5928 v: T,
5929 ) -> Self {
5930 self.value_mode = std::option::Option::Some(
5931 crate::model::index::index_field::ValueMode::ArrayConfig(v.into()),
5932 );
5933 self
5934 }
5935
5936 /// The value of [value_mode][crate::model::index::IndexField::value_mode]
5937 /// if it holds a `VectorConfig`, `None` if the field is not set or
5938 /// holds a different branch.
5939 pub fn vector_config(
5940 &self,
5941 ) -> std::option::Option<&std::boxed::Box<crate::model::index::index_field::VectorConfig>>
5942 {
5943 #[allow(unreachable_patterns)]
5944 self.value_mode.as_ref().and_then(|v| match v {
5945 crate::model::index::index_field::ValueMode::VectorConfig(v) => {
5946 std::option::Option::Some(v)
5947 }
5948 _ => std::option::Option::None,
5949 })
5950 }
5951
5952 /// Sets the value of [value_mode][crate::model::index::IndexField::value_mode]
5953 /// to hold a `VectorConfig`.
5954 ///
5955 /// Note that all the setters affecting `value_mode` are
5956 /// mutually exclusive.
5957 ///
5958 /// # Example
5959 /// ```ignore,no_run
5960 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
5961 /// use google_cloud_firestore_admin_v1::model::index::index_field::VectorConfig;
5962 /// let x = IndexField::new().set_vector_config(VectorConfig::default()/* use setters */);
5963 /// assert!(x.vector_config().is_some());
5964 /// assert!(x.order().is_none());
5965 /// assert!(x.array_config().is_none());
5966 /// ```
5967 pub fn set_vector_config<
5968 T: std::convert::Into<std::boxed::Box<crate::model::index::index_field::VectorConfig>>,
5969 >(
5970 mut self,
5971 v: T,
5972 ) -> Self {
5973 self.value_mode = std::option::Option::Some(
5974 crate::model::index::index_field::ValueMode::VectorConfig(v.into()),
5975 );
5976 self
5977 }
5978 }
5979
5980 impl wkt::message::Message for IndexField {
5981 fn typename() -> &'static str {
5982 "type.googleapis.com/google.firestore.admin.v1.Index.IndexField"
5983 }
5984 }
5985
5986 /// Defines additional types related to [IndexField].
5987 pub mod index_field {
5988 #[allow(unused_imports)]
5989 use super::*;
5990
5991 /// The index configuration to support vector search operations
5992 #[derive(Clone, Default, PartialEq)]
5993 #[non_exhaustive]
5994 pub struct VectorConfig {
5995 /// Required. The vector dimension this configuration applies to.
5996 ///
5997 /// The resulting index will only include vectors of this dimension, and
5998 /// can be used for vector search with the same dimension.
5999 pub dimension: i32,
6000
6001 /// The type of index used.
6002 pub r#type: std::option::Option<crate::model::index::index_field::vector_config::Type>,
6003
6004 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6005 }
6006
6007 impl VectorConfig {
6008 pub fn new() -> Self {
6009 std::default::Default::default()
6010 }
6011
6012 /// Sets the value of [dimension][crate::model::index::index_field::VectorConfig::dimension].
6013 ///
6014 /// # Example
6015 /// ```ignore,no_run
6016 /// # use google_cloud_firestore_admin_v1::model::index::index_field::VectorConfig;
6017 /// let x = VectorConfig::new().set_dimension(42);
6018 /// ```
6019 pub fn set_dimension<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6020 self.dimension = v.into();
6021 self
6022 }
6023
6024 /// Sets the value of [r#type][crate::model::index::index_field::VectorConfig::type].
6025 ///
6026 /// Note that all the setters affecting `r#type` are mutually
6027 /// exclusive.
6028 ///
6029 /// # Example
6030 /// ```ignore,no_run
6031 /// # use google_cloud_firestore_admin_v1::model::index::index_field::VectorConfig;
6032 /// use google_cloud_firestore_admin_v1::model::index::index_field::vector_config::FlatIndex;
6033 /// let x = VectorConfig::new().set_type(Some(
6034 /// google_cloud_firestore_admin_v1::model::index::index_field::vector_config::Type::Flat(FlatIndex::default().into())));
6035 /// ```
6036 pub fn set_type<
6037 T: std::convert::Into<
6038 std::option::Option<crate::model::index::index_field::vector_config::Type>,
6039 >,
6040 >(
6041 mut self,
6042 v: T,
6043 ) -> Self {
6044 self.r#type = v.into();
6045 self
6046 }
6047
6048 /// The value of [r#type][crate::model::index::index_field::VectorConfig::r#type]
6049 /// if it holds a `Flat`, `None` if the field is not set or
6050 /// holds a different branch.
6051 pub fn flat(
6052 &self,
6053 ) -> std::option::Option<
6054 &std::boxed::Box<crate::model::index::index_field::vector_config::FlatIndex>,
6055 > {
6056 #[allow(unreachable_patterns)]
6057 self.r#type.as_ref().and_then(|v| match v {
6058 crate::model::index::index_field::vector_config::Type::Flat(v) => {
6059 std::option::Option::Some(v)
6060 }
6061 _ => std::option::Option::None,
6062 })
6063 }
6064
6065 /// Sets the value of [r#type][crate::model::index::index_field::VectorConfig::r#type]
6066 /// to hold a `Flat`.
6067 ///
6068 /// Note that all the setters affecting `r#type` are
6069 /// mutually exclusive.
6070 ///
6071 /// # Example
6072 /// ```ignore,no_run
6073 /// # use google_cloud_firestore_admin_v1::model::index::index_field::VectorConfig;
6074 /// use google_cloud_firestore_admin_v1::model::index::index_field::vector_config::FlatIndex;
6075 /// let x = VectorConfig::new().set_flat(FlatIndex::default()/* use setters */);
6076 /// assert!(x.flat().is_some());
6077 /// ```
6078 pub fn set_flat<
6079 T: std::convert::Into<
6080 std::boxed::Box<crate::model::index::index_field::vector_config::FlatIndex>,
6081 >,
6082 >(
6083 mut self,
6084 v: T,
6085 ) -> Self {
6086 self.r#type = std::option::Option::Some(
6087 crate::model::index::index_field::vector_config::Type::Flat(v.into()),
6088 );
6089 self
6090 }
6091 }
6092
6093 impl wkt::message::Message for VectorConfig {
6094 fn typename() -> &'static str {
6095 "type.googleapis.com/google.firestore.admin.v1.Index.IndexField.VectorConfig"
6096 }
6097 }
6098
6099 /// Defines additional types related to [VectorConfig].
6100 pub mod vector_config {
6101 #[allow(unused_imports)]
6102 use super::*;
6103
6104 /// An index that stores vectors in a flat data structure, and supports
6105 /// exhaustive search.
6106 #[derive(Clone, Default, PartialEq)]
6107 #[non_exhaustive]
6108 pub struct FlatIndex {
6109 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6110 }
6111
6112 impl FlatIndex {
6113 pub fn new() -> Self {
6114 std::default::Default::default()
6115 }
6116 }
6117
6118 impl wkt::message::Message for FlatIndex {
6119 fn typename() -> &'static str {
6120 "type.googleapis.com/google.firestore.admin.v1.Index.IndexField.VectorConfig.FlatIndex"
6121 }
6122 }
6123
6124 /// The type of index used.
6125 #[derive(Clone, Debug, PartialEq)]
6126 #[non_exhaustive]
6127 pub enum Type {
6128 /// Indicates the vector index is a flat index.
6129 Flat(std::boxed::Box<crate::model::index::index_field::vector_config::FlatIndex>),
6130 }
6131 }
6132
6133 /// The supported orderings.
6134 ///
6135 /// # Working with unknown values
6136 ///
6137 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6138 /// additional enum variants at any time. Adding new variants is not considered
6139 /// a breaking change. Applications should write their code in anticipation of:
6140 ///
6141 /// - New values appearing in future releases of the client library, **and**
6142 /// - New values received dynamically, without application changes.
6143 ///
6144 /// Please consult the [Working with enums] section in the user guide for some
6145 /// guidelines.
6146 ///
6147 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6148 #[derive(Clone, Debug, PartialEq)]
6149 #[non_exhaustive]
6150 pub enum Order {
6151 /// The ordering is unspecified. Not a valid option.
6152 Unspecified,
6153 /// The field is ordered by ascending field value.
6154 Ascending,
6155 /// The field is ordered by descending field value.
6156 Descending,
6157 /// If set, the enum was initialized with an unknown value.
6158 ///
6159 /// Applications can examine the value using [Order::value] or
6160 /// [Order::name].
6161 UnknownValue(order::UnknownValue),
6162 }
6163
6164 #[doc(hidden)]
6165 pub mod order {
6166 #[allow(unused_imports)]
6167 use super::*;
6168 #[derive(Clone, Debug, PartialEq)]
6169 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6170 }
6171
6172 impl Order {
6173 /// Gets the enum value.
6174 ///
6175 /// Returns `None` if the enum contains an unknown value deserialized from
6176 /// the string representation of enums.
6177 pub fn value(&self) -> std::option::Option<i32> {
6178 match self {
6179 Self::Unspecified => std::option::Option::Some(0),
6180 Self::Ascending => std::option::Option::Some(1),
6181 Self::Descending => std::option::Option::Some(2),
6182 Self::UnknownValue(u) => u.0.value(),
6183 }
6184 }
6185
6186 /// Gets the enum value as a string.
6187 ///
6188 /// Returns `None` if the enum contains an unknown value deserialized from
6189 /// the integer representation of enums.
6190 pub fn name(&self) -> std::option::Option<&str> {
6191 match self {
6192 Self::Unspecified => std::option::Option::Some("ORDER_UNSPECIFIED"),
6193 Self::Ascending => std::option::Option::Some("ASCENDING"),
6194 Self::Descending => std::option::Option::Some("DESCENDING"),
6195 Self::UnknownValue(u) => u.0.name(),
6196 }
6197 }
6198 }
6199
6200 impl std::default::Default for Order {
6201 fn default() -> Self {
6202 use std::convert::From;
6203 Self::from(0)
6204 }
6205 }
6206
6207 impl std::fmt::Display for Order {
6208 fn fmt(
6209 &self,
6210 f: &mut std::fmt::Formatter<'_>,
6211 ) -> std::result::Result<(), std::fmt::Error> {
6212 wkt::internal::display_enum(f, self.name(), self.value())
6213 }
6214 }
6215
6216 impl std::convert::From<i32> for Order {
6217 fn from(value: i32) -> Self {
6218 match value {
6219 0 => Self::Unspecified,
6220 1 => Self::Ascending,
6221 2 => Self::Descending,
6222 _ => Self::UnknownValue(order::UnknownValue(
6223 wkt::internal::UnknownEnumValue::Integer(value),
6224 )),
6225 }
6226 }
6227 }
6228
6229 impl std::convert::From<&str> for Order {
6230 fn from(value: &str) -> Self {
6231 use std::string::ToString;
6232 match value {
6233 "ORDER_UNSPECIFIED" => Self::Unspecified,
6234 "ASCENDING" => Self::Ascending,
6235 "DESCENDING" => Self::Descending,
6236 _ => Self::UnknownValue(order::UnknownValue(
6237 wkt::internal::UnknownEnumValue::String(value.to_string()),
6238 )),
6239 }
6240 }
6241 }
6242
6243 impl serde::ser::Serialize for Order {
6244 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6245 where
6246 S: serde::Serializer,
6247 {
6248 match self {
6249 Self::Unspecified => serializer.serialize_i32(0),
6250 Self::Ascending => serializer.serialize_i32(1),
6251 Self::Descending => serializer.serialize_i32(2),
6252 Self::UnknownValue(u) => u.0.serialize(serializer),
6253 }
6254 }
6255 }
6256
6257 impl<'de> serde::de::Deserialize<'de> for Order {
6258 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6259 where
6260 D: serde::Deserializer<'de>,
6261 {
6262 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Order>::new(
6263 ".google.firestore.admin.v1.Index.IndexField.Order",
6264 ))
6265 }
6266 }
6267
6268 /// The supported array value configurations.
6269 ///
6270 /// # Working with unknown values
6271 ///
6272 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6273 /// additional enum variants at any time. Adding new variants is not considered
6274 /// a breaking change. Applications should write their code in anticipation of:
6275 ///
6276 /// - New values appearing in future releases of the client library, **and**
6277 /// - New values received dynamically, without application changes.
6278 ///
6279 /// Please consult the [Working with enums] section in the user guide for some
6280 /// guidelines.
6281 ///
6282 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6283 #[derive(Clone, Debug, PartialEq)]
6284 #[non_exhaustive]
6285 pub enum ArrayConfig {
6286 /// The index does not support additional array queries.
6287 Unspecified,
6288 /// The index supports array containment queries.
6289 Contains,
6290 /// If set, the enum was initialized with an unknown value.
6291 ///
6292 /// Applications can examine the value using [ArrayConfig::value] or
6293 /// [ArrayConfig::name].
6294 UnknownValue(array_config::UnknownValue),
6295 }
6296
6297 #[doc(hidden)]
6298 pub mod array_config {
6299 #[allow(unused_imports)]
6300 use super::*;
6301 #[derive(Clone, Debug, PartialEq)]
6302 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6303 }
6304
6305 impl ArrayConfig {
6306 /// Gets the enum value.
6307 ///
6308 /// Returns `None` if the enum contains an unknown value deserialized from
6309 /// the string representation of enums.
6310 pub fn value(&self) -> std::option::Option<i32> {
6311 match self {
6312 Self::Unspecified => std::option::Option::Some(0),
6313 Self::Contains => std::option::Option::Some(1),
6314 Self::UnknownValue(u) => u.0.value(),
6315 }
6316 }
6317
6318 /// Gets the enum value as a string.
6319 ///
6320 /// Returns `None` if the enum contains an unknown value deserialized from
6321 /// the integer representation of enums.
6322 pub fn name(&self) -> std::option::Option<&str> {
6323 match self {
6324 Self::Unspecified => std::option::Option::Some("ARRAY_CONFIG_UNSPECIFIED"),
6325 Self::Contains => std::option::Option::Some("CONTAINS"),
6326 Self::UnknownValue(u) => u.0.name(),
6327 }
6328 }
6329 }
6330
6331 impl std::default::Default for ArrayConfig {
6332 fn default() -> Self {
6333 use std::convert::From;
6334 Self::from(0)
6335 }
6336 }
6337
6338 impl std::fmt::Display for ArrayConfig {
6339 fn fmt(
6340 &self,
6341 f: &mut std::fmt::Formatter<'_>,
6342 ) -> std::result::Result<(), std::fmt::Error> {
6343 wkt::internal::display_enum(f, self.name(), self.value())
6344 }
6345 }
6346
6347 impl std::convert::From<i32> for ArrayConfig {
6348 fn from(value: i32) -> Self {
6349 match value {
6350 0 => Self::Unspecified,
6351 1 => Self::Contains,
6352 _ => Self::UnknownValue(array_config::UnknownValue(
6353 wkt::internal::UnknownEnumValue::Integer(value),
6354 )),
6355 }
6356 }
6357 }
6358
6359 impl std::convert::From<&str> for ArrayConfig {
6360 fn from(value: &str) -> Self {
6361 use std::string::ToString;
6362 match value {
6363 "ARRAY_CONFIG_UNSPECIFIED" => Self::Unspecified,
6364 "CONTAINS" => Self::Contains,
6365 _ => Self::UnknownValue(array_config::UnknownValue(
6366 wkt::internal::UnknownEnumValue::String(value.to_string()),
6367 )),
6368 }
6369 }
6370 }
6371
6372 impl serde::ser::Serialize for ArrayConfig {
6373 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6374 where
6375 S: serde::Serializer,
6376 {
6377 match self {
6378 Self::Unspecified => serializer.serialize_i32(0),
6379 Self::Contains => serializer.serialize_i32(1),
6380 Self::UnknownValue(u) => u.0.serialize(serializer),
6381 }
6382 }
6383 }
6384
6385 impl<'de> serde::de::Deserialize<'de> for ArrayConfig {
6386 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6387 where
6388 D: serde::Deserializer<'de>,
6389 {
6390 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ArrayConfig>::new(
6391 ".google.firestore.admin.v1.Index.IndexField.ArrayConfig",
6392 ))
6393 }
6394 }
6395
6396 /// How the field value is indexed.
6397 #[derive(Clone, Debug, PartialEq)]
6398 #[non_exhaustive]
6399 pub enum ValueMode {
6400 /// Indicates that this field supports ordering by the specified order or
6401 /// comparing using =, !=, <, <=, >, >=.
6402 Order(crate::model::index::index_field::Order),
6403 /// Indicates that this field supports operations on `array_value`s.
6404 ArrayConfig(crate::model::index::index_field::ArrayConfig),
6405 /// Indicates that this field supports nearest neighbor and distance
6406 /// operations on vector.
6407 VectorConfig(std::boxed::Box<crate::model::index::index_field::VectorConfig>),
6408 }
6409 }
6410
6411 /// Query Scope defines the scope at which a query is run. This is specified on
6412 /// a StructuredQuery's `from` field.
6413 ///
6414 /// # Working with unknown values
6415 ///
6416 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6417 /// additional enum variants at any time. Adding new variants is not considered
6418 /// a breaking change. Applications should write their code in anticipation of:
6419 ///
6420 /// - New values appearing in future releases of the client library, **and**
6421 /// - New values received dynamically, without application changes.
6422 ///
6423 /// Please consult the [Working with enums] section in the user guide for some
6424 /// guidelines.
6425 ///
6426 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6427 #[derive(Clone, Debug, PartialEq)]
6428 #[non_exhaustive]
6429 pub enum QueryScope {
6430 /// The query scope is unspecified. Not a valid option.
6431 Unspecified,
6432 /// Indexes with a collection query scope specified allow queries
6433 /// against a collection that is the child of a specific document, specified
6434 /// at query time, and that has the collection ID specified by the index.
6435 Collection,
6436 /// Indexes with a collection group query scope specified allow queries
6437 /// against all collections that has the collection ID specified by the
6438 /// index.
6439 CollectionGroup,
6440 /// Include all the collections's ancestor in the index. Only available for
6441 /// Datastore Mode databases.
6442 CollectionRecursive,
6443 /// If set, the enum was initialized with an unknown value.
6444 ///
6445 /// Applications can examine the value using [QueryScope::value] or
6446 /// [QueryScope::name].
6447 UnknownValue(query_scope::UnknownValue),
6448 }
6449
6450 #[doc(hidden)]
6451 pub mod query_scope {
6452 #[allow(unused_imports)]
6453 use super::*;
6454 #[derive(Clone, Debug, PartialEq)]
6455 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6456 }
6457
6458 impl QueryScope {
6459 /// Gets the enum value.
6460 ///
6461 /// Returns `None` if the enum contains an unknown value deserialized from
6462 /// the string representation of enums.
6463 pub fn value(&self) -> std::option::Option<i32> {
6464 match self {
6465 Self::Unspecified => std::option::Option::Some(0),
6466 Self::Collection => std::option::Option::Some(1),
6467 Self::CollectionGroup => std::option::Option::Some(2),
6468 Self::CollectionRecursive => std::option::Option::Some(3),
6469 Self::UnknownValue(u) => u.0.value(),
6470 }
6471 }
6472
6473 /// Gets the enum value as a string.
6474 ///
6475 /// Returns `None` if the enum contains an unknown value deserialized from
6476 /// the integer representation of enums.
6477 pub fn name(&self) -> std::option::Option<&str> {
6478 match self {
6479 Self::Unspecified => std::option::Option::Some("QUERY_SCOPE_UNSPECIFIED"),
6480 Self::Collection => std::option::Option::Some("COLLECTION"),
6481 Self::CollectionGroup => std::option::Option::Some("COLLECTION_GROUP"),
6482 Self::CollectionRecursive => std::option::Option::Some("COLLECTION_RECURSIVE"),
6483 Self::UnknownValue(u) => u.0.name(),
6484 }
6485 }
6486 }
6487
6488 impl std::default::Default for QueryScope {
6489 fn default() -> Self {
6490 use std::convert::From;
6491 Self::from(0)
6492 }
6493 }
6494
6495 impl std::fmt::Display for QueryScope {
6496 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6497 wkt::internal::display_enum(f, self.name(), self.value())
6498 }
6499 }
6500
6501 impl std::convert::From<i32> for QueryScope {
6502 fn from(value: i32) -> Self {
6503 match value {
6504 0 => Self::Unspecified,
6505 1 => Self::Collection,
6506 2 => Self::CollectionGroup,
6507 3 => Self::CollectionRecursive,
6508 _ => Self::UnknownValue(query_scope::UnknownValue(
6509 wkt::internal::UnknownEnumValue::Integer(value),
6510 )),
6511 }
6512 }
6513 }
6514
6515 impl std::convert::From<&str> for QueryScope {
6516 fn from(value: &str) -> Self {
6517 use std::string::ToString;
6518 match value {
6519 "QUERY_SCOPE_UNSPECIFIED" => Self::Unspecified,
6520 "COLLECTION" => Self::Collection,
6521 "COLLECTION_GROUP" => Self::CollectionGroup,
6522 "COLLECTION_RECURSIVE" => Self::CollectionRecursive,
6523 _ => Self::UnknownValue(query_scope::UnknownValue(
6524 wkt::internal::UnknownEnumValue::String(value.to_string()),
6525 )),
6526 }
6527 }
6528 }
6529
6530 impl serde::ser::Serialize for QueryScope {
6531 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6532 where
6533 S: serde::Serializer,
6534 {
6535 match self {
6536 Self::Unspecified => serializer.serialize_i32(0),
6537 Self::Collection => serializer.serialize_i32(1),
6538 Self::CollectionGroup => serializer.serialize_i32(2),
6539 Self::CollectionRecursive => serializer.serialize_i32(3),
6540 Self::UnknownValue(u) => u.0.serialize(serializer),
6541 }
6542 }
6543 }
6544
6545 impl<'de> serde::de::Deserialize<'de> for QueryScope {
6546 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6547 where
6548 D: serde::Deserializer<'de>,
6549 {
6550 deserializer.deserialize_any(wkt::internal::EnumVisitor::<QueryScope>::new(
6551 ".google.firestore.admin.v1.Index.QueryScope",
6552 ))
6553 }
6554 }
6555
6556 /// API Scope defines the APIs (Firestore Native, or Firestore in
6557 /// Datastore Mode) that are supported for queries.
6558 ///
6559 /// # Working with unknown values
6560 ///
6561 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6562 /// additional enum variants at any time. Adding new variants is not considered
6563 /// a breaking change. Applications should write their code in anticipation of:
6564 ///
6565 /// - New values appearing in future releases of the client library, **and**
6566 /// - New values received dynamically, without application changes.
6567 ///
6568 /// Please consult the [Working with enums] section in the user guide for some
6569 /// guidelines.
6570 ///
6571 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6572 #[derive(Clone, Debug, PartialEq)]
6573 #[non_exhaustive]
6574 pub enum ApiScope {
6575 /// The index can only be used by the Firestore Native query API.
6576 /// This is the default.
6577 AnyApi,
6578 /// The index can only be used by the Firestore in Datastore Mode query API.
6579 DatastoreModeApi,
6580 /// The index can only be used by the MONGODB_COMPATIBLE_API.
6581 MongodbCompatibleApi,
6582 /// If set, the enum was initialized with an unknown value.
6583 ///
6584 /// Applications can examine the value using [ApiScope::value] or
6585 /// [ApiScope::name].
6586 UnknownValue(api_scope::UnknownValue),
6587 }
6588
6589 #[doc(hidden)]
6590 pub mod api_scope {
6591 #[allow(unused_imports)]
6592 use super::*;
6593 #[derive(Clone, Debug, PartialEq)]
6594 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6595 }
6596
6597 impl ApiScope {
6598 /// Gets the enum value.
6599 ///
6600 /// Returns `None` if the enum contains an unknown value deserialized from
6601 /// the string representation of enums.
6602 pub fn value(&self) -> std::option::Option<i32> {
6603 match self {
6604 Self::AnyApi => std::option::Option::Some(0),
6605 Self::DatastoreModeApi => std::option::Option::Some(1),
6606 Self::MongodbCompatibleApi => std::option::Option::Some(2),
6607 Self::UnknownValue(u) => u.0.value(),
6608 }
6609 }
6610
6611 /// Gets the enum value as a string.
6612 ///
6613 /// Returns `None` if the enum contains an unknown value deserialized from
6614 /// the integer representation of enums.
6615 pub fn name(&self) -> std::option::Option<&str> {
6616 match self {
6617 Self::AnyApi => std::option::Option::Some("ANY_API"),
6618 Self::DatastoreModeApi => std::option::Option::Some("DATASTORE_MODE_API"),
6619 Self::MongodbCompatibleApi => std::option::Option::Some("MONGODB_COMPATIBLE_API"),
6620 Self::UnknownValue(u) => u.0.name(),
6621 }
6622 }
6623 }
6624
6625 impl std::default::Default for ApiScope {
6626 fn default() -> Self {
6627 use std::convert::From;
6628 Self::from(0)
6629 }
6630 }
6631
6632 impl std::fmt::Display for ApiScope {
6633 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6634 wkt::internal::display_enum(f, self.name(), self.value())
6635 }
6636 }
6637
6638 impl std::convert::From<i32> for ApiScope {
6639 fn from(value: i32) -> Self {
6640 match value {
6641 0 => Self::AnyApi,
6642 1 => Self::DatastoreModeApi,
6643 2 => Self::MongodbCompatibleApi,
6644 _ => Self::UnknownValue(api_scope::UnknownValue(
6645 wkt::internal::UnknownEnumValue::Integer(value),
6646 )),
6647 }
6648 }
6649 }
6650
6651 impl std::convert::From<&str> for ApiScope {
6652 fn from(value: &str) -> Self {
6653 use std::string::ToString;
6654 match value {
6655 "ANY_API" => Self::AnyApi,
6656 "DATASTORE_MODE_API" => Self::DatastoreModeApi,
6657 "MONGODB_COMPATIBLE_API" => Self::MongodbCompatibleApi,
6658 _ => Self::UnknownValue(api_scope::UnknownValue(
6659 wkt::internal::UnknownEnumValue::String(value.to_string()),
6660 )),
6661 }
6662 }
6663 }
6664
6665 impl serde::ser::Serialize for ApiScope {
6666 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6667 where
6668 S: serde::Serializer,
6669 {
6670 match self {
6671 Self::AnyApi => serializer.serialize_i32(0),
6672 Self::DatastoreModeApi => serializer.serialize_i32(1),
6673 Self::MongodbCompatibleApi => serializer.serialize_i32(2),
6674 Self::UnknownValue(u) => u.0.serialize(serializer),
6675 }
6676 }
6677 }
6678
6679 impl<'de> serde::de::Deserialize<'de> for ApiScope {
6680 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6681 where
6682 D: serde::Deserializer<'de>,
6683 {
6684 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ApiScope>::new(
6685 ".google.firestore.admin.v1.Index.ApiScope",
6686 ))
6687 }
6688 }
6689
6690 /// The state of an index. During index creation, an index will be in the
6691 /// `CREATING` state. If the index is created successfully, it will transition
6692 /// to the `READY` state. If the index creation encounters a problem, the index
6693 /// will transition to the `NEEDS_REPAIR` state.
6694 ///
6695 /// # Working with unknown values
6696 ///
6697 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6698 /// additional enum variants at any time. Adding new variants is not considered
6699 /// a breaking change. Applications should write their code in anticipation of:
6700 ///
6701 /// - New values appearing in future releases of the client library, **and**
6702 /// - New values received dynamically, without application changes.
6703 ///
6704 /// Please consult the [Working with enums] section in the user guide for some
6705 /// guidelines.
6706 ///
6707 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6708 #[derive(Clone, Debug, PartialEq)]
6709 #[non_exhaustive]
6710 pub enum State {
6711 /// The state is unspecified.
6712 Unspecified,
6713 /// The index is being created.
6714 /// There is an active long-running operation for the index.
6715 /// The index is updated when writing a document.
6716 /// Some index data may exist.
6717 Creating,
6718 /// The index is ready to be used.
6719 /// The index is updated when writing a document.
6720 /// The index is fully populated from all stored documents it applies to.
6721 Ready,
6722 /// The index was being created, but something went wrong.
6723 /// There is no active long-running operation for the index,
6724 /// and the most recently finished long-running operation failed.
6725 /// The index is not updated when writing a document.
6726 /// Some index data may exist.
6727 /// Use the google.longrunning.Operations API to determine why the operation
6728 /// that last attempted to create this index failed, then re-create the
6729 /// index.
6730 NeedsRepair,
6731 /// If set, the enum was initialized with an unknown value.
6732 ///
6733 /// Applications can examine the value using [State::value] or
6734 /// [State::name].
6735 UnknownValue(state::UnknownValue),
6736 }
6737
6738 #[doc(hidden)]
6739 pub mod state {
6740 #[allow(unused_imports)]
6741 use super::*;
6742 #[derive(Clone, Debug, PartialEq)]
6743 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6744 }
6745
6746 impl State {
6747 /// Gets the enum value.
6748 ///
6749 /// Returns `None` if the enum contains an unknown value deserialized from
6750 /// the string representation of enums.
6751 pub fn value(&self) -> std::option::Option<i32> {
6752 match self {
6753 Self::Unspecified => std::option::Option::Some(0),
6754 Self::Creating => std::option::Option::Some(1),
6755 Self::Ready => std::option::Option::Some(2),
6756 Self::NeedsRepair => std::option::Option::Some(3),
6757 Self::UnknownValue(u) => u.0.value(),
6758 }
6759 }
6760
6761 /// Gets the enum value as a string.
6762 ///
6763 /// Returns `None` if the enum contains an unknown value deserialized from
6764 /// the integer representation of enums.
6765 pub fn name(&self) -> std::option::Option<&str> {
6766 match self {
6767 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6768 Self::Creating => std::option::Option::Some("CREATING"),
6769 Self::Ready => std::option::Option::Some("READY"),
6770 Self::NeedsRepair => std::option::Option::Some("NEEDS_REPAIR"),
6771 Self::UnknownValue(u) => u.0.name(),
6772 }
6773 }
6774 }
6775
6776 impl std::default::Default for State {
6777 fn default() -> Self {
6778 use std::convert::From;
6779 Self::from(0)
6780 }
6781 }
6782
6783 impl std::fmt::Display for State {
6784 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6785 wkt::internal::display_enum(f, self.name(), self.value())
6786 }
6787 }
6788
6789 impl std::convert::From<i32> for State {
6790 fn from(value: i32) -> Self {
6791 match value {
6792 0 => Self::Unspecified,
6793 1 => Self::Creating,
6794 2 => Self::Ready,
6795 3 => Self::NeedsRepair,
6796 _ => Self::UnknownValue(state::UnknownValue(
6797 wkt::internal::UnknownEnumValue::Integer(value),
6798 )),
6799 }
6800 }
6801 }
6802
6803 impl std::convert::From<&str> for State {
6804 fn from(value: &str) -> Self {
6805 use std::string::ToString;
6806 match value {
6807 "STATE_UNSPECIFIED" => Self::Unspecified,
6808 "CREATING" => Self::Creating,
6809 "READY" => Self::Ready,
6810 "NEEDS_REPAIR" => Self::NeedsRepair,
6811 _ => Self::UnknownValue(state::UnknownValue(
6812 wkt::internal::UnknownEnumValue::String(value.to_string()),
6813 )),
6814 }
6815 }
6816 }
6817
6818 impl serde::ser::Serialize for State {
6819 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6820 where
6821 S: serde::Serializer,
6822 {
6823 match self {
6824 Self::Unspecified => serializer.serialize_i32(0),
6825 Self::Creating => serializer.serialize_i32(1),
6826 Self::Ready => serializer.serialize_i32(2),
6827 Self::NeedsRepair => serializer.serialize_i32(3),
6828 Self::UnknownValue(u) => u.0.serialize(serializer),
6829 }
6830 }
6831 }
6832
6833 impl<'de> serde::de::Deserialize<'de> for State {
6834 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6835 where
6836 D: serde::Deserializer<'de>,
6837 {
6838 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6839 ".google.firestore.admin.v1.Index.State",
6840 ))
6841 }
6842 }
6843
6844 /// The density configuration for the index.
6845 ///
6846 /// # Working with unknown values
6847 ///
6848 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6849 /// additional enum variants at any time. Adding new variants is not considered
6850 /// a breaking change. Applications should write their code in anticipation of:
6851 ///
6852 /// - New values appearing in future releases of the client library, **and**
6853 /// - New values received dynamically, without application changes.
6854 ///
6855 /// Please consult the [Working with enums] section in the user guide for some
6856 /// guidelines.
6857 ///
6858 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6859 #[derive(Clone, Debug, PartialEq)]
6860 #[non_exhaustive]
6861 pub enum Density {
6862 /// Unspecified. It will use database default setting. This value is input
6863 /// only.
6864 Unspecified,
6865 /// In order for an index entry to be added, the document must
6866 /// contain all fields specified in the index.
6867 ///
6868 /// This is the only allowed value for indexes having ApiScope `ANY_API` and
6869 /// `DATASTORE_MODE_API`.
6870 SparseAll,
6871 /// In order for an index entry to be added, the document must
6872 /// contain at least one of the fields specified in the index.
6873 /// Non-existent fields are treated as having a NULL value when generating
6874 /// index entries.
6875 SparseAny,
6876 /// An index entry will be added regardless of whether the
6877 /// document contains any of the fields specified in the index.
6878 /// Non-existent fields are treated as having a NULL value when generating
6879 /// index entries.
6880 Dense,
6881 /// If set, the enum was initialized with an unknown value.
6882 ///
6883 /// Applications can examine the value using [Density::value] or
6884 /// [Density::name].
6885 UnknownValue(density::UnknownValue),
6886 }
6887
6888 #[doc(hidden)]
6889 pub mod density {
6890 #[allow(unused_imports)]
6891 use super::*;
6892 #[derive(Clone, Debug, PartialEq)]
6893 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6894 }
6895
6896 impl Density {
6897 /// Gets the enum value.
6898 ///
6899 /// Returns `None` if the enum contains an unknown value deserialized from
6900 /// the string representation of enums.
6901 pub fn value(&self) -> std::option::Option<i32> {
6902 match self {
6903 Self::Unspecified => std::option::Option::Some(0),
6904 Self::SparseAll => std::option::Option::Some(1),
6905 Self::SparseAny => std::option::Option::Some(2),
6906 Self::Dense => std::option::Option::Some(3),
6907 Self::UnknownValue(u) => u.0.value(),
6908 }
6909 }
6910
6911 /// Gets the enum value as a string.
6912 ///
6913 /// Returns `None` if the enum contains an unknown value deserialized from
6914 /// the integer representation of enums.
6915 pub fn name(&self) -> std::option::Option<&str> {
6916 match self {
6917 Self::Unspecified => std::option::Option::Some("DENSITY_UNSPECIFIED"),
6918 Self::SparseAll => std::option::Option::Some("SPARSE_ALL"),
6919 Self::SparseAny => std::option::Option::Some("SPARSE_ANY"),
6920 Self::Dense => std::option::Option::Some("DENSE"),
6921 Self::UnknownValue(u) => u.0.name(),
6922 }
6923 }
6924 }
6925
6926 impl std::default::Default for Density {
6927 fn default() -> Self {
6928 use std::convert::From;
6929 Self::from(0)
6930 }
6931 }
6932
6933 impl std::fmt::Display for Density {
6934 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6935 wkt::internal::display_enum(f, self.name(), self.value())
6936 }
6937 }
6938
6939 impl std::convert::From<i32> for Density {
6940 fn from(value: i32) -> Self {
6941 match value {
6942 0 => Self::Unspecified,
6943 1 => Self::SparseAll,
6944 2 => Self::SparseAny,
6945 3 => Self::Dense,
6946 _ => Self::UnknownValue(density::UnknownValue(
6947 wkt::internal::UnknownEnumValue::Integer(value),
6948 )),
6949 }
6950 }
6951 }
6952
6953 impl std::convert::From<&str> for Density {
6954 fn from(value: &str) -> Self {
6955 use std::string::ToString;
6956 match value {
6957 "DENSITY_UNSPECIFIED" => Self::Unspecified,
6958 "SPARSE_ALL" => Self::SparseAll,
6959 "SPARSE_ANY" => Self::SparseAny,
6960 "DENSE" => Self::Dense,
6961 _ => Self::UnknownValue(density::UnknownValue(
6962 wkt::internal::UnknownEnumValue::String(value.to_string()),
6963 )),
6964 }
6965 }
6966 }
6967
6968 impl serde::ser::Serialize for Density {
6969 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6970 where
6971 S: serde::Serializer,
6972 {
6973 match self {
6974 Self::Unspecified => serializer.serialize_i32(0),
6975 Self::SparseAll => serializer.serialize_i32(1),
6976 Self::SparseAny => serializer.serialize_i32(2),
6977 Self::Dense => serializer.serialize_i32(3),
6978 Self::UnknownValue(u) => u.0.serialize(serializer),
6979 }
6980 }
6981 }
6982
6983 impl<'de> serde::de::Deserialize<'de> for Density {
6984 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6985 where
6986 D: serde::Deserializer<'de>,
6987 {
6988 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Density>::new(
6989 ".google.firestore.admin.v1.Index.Density",
6990 ))
6991 }
6992 }
6993}
6994
6995/// The metadata message for
6996/// [google.cloud.location.Location.metadata][google.cloud.location.Location.metadata].
6997///
6998/// [google.cloud.location.Location.metadata]: location::model::Location::metadata
6999#[derive(Clone, Default, PartialEq)]
7000#[non_exhaustive]
7001pub struct LocationMetadata {
7002 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7003}
7004
7005impl LocationMetadata {
7006 pub fn new() -> Self {
7007 std::default::Default::default()
7008 }
7009}
7010
7011impl wkt::message::Message for LocationMetadata {
7012 fn typename() -> &'static str {
7013 "type.googleapis.com/google.firestore.admin.v1.LocationMetadata"
7014 }
7015}
7016
7017/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
7018/// results from
7019/// [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
7020///
7021/// [google.firestore.admin.v1.FirestoreAdmin.CreateIndex]: crate::client::FirestoreAdmin::create_index
7022/// [google.longrunning.Operation]: longrunning::model::Operation
7023#[derive(Clone, Default, PartialEq)]
7024#[non_exhaustive]
7025pub struct IndexOperationMetadata {
7026 /// The time this operation started.
7027 pub start_time: std::option::Option<wkt::Timestamp>,
7028
7029 /// The time this operation completed. Will be unset if operation still in
7030 /// progress.
7031 pub end_time: std::option::Option<wkt::Timestamp>,
7032
7033 /// The index resource that this operation is acting on. For example:
7034 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
7035 pub index: std::string::String,
7036
7037 /// The state of the operation.
7038 pub state: crate::model::OperationState,
7039
7040 /// The progress, in documents, of this operation.
7041 pub progress_documents: std::option::Option<crate::model::Progress>,
7042
7043 /// The progress, in bytes, of this operation.
7044 pub progress_bytes: std::option::Option<crate::model::Progress>,
7045
7046 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7047}
7048
7049impl IndexOperationMetadata {
7050 pub fn new() -> Self {
7051 std::default::Default::default()
7052 }
7053
7054 /// Sets the value of [start_time][crate::model::IndexOperationMetadata::start_time].
7055 ///
7056 /// # Example
7057 /// ```ignore,no_run
7058 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7059 /// use wkt::Timestamp;
7060 /// let x = IndexOperationMetadata::new().set_start_time(Timestamp::default()/* use setters */);
7061 /// ```
7062 pub fn set_start_time<T>(mut self, v: T) -> Self
7063 where
7064 T: std::convert::Into<wkt::Timestamp>,
7065 {
7066 self.start_time = std::option::Option::Some(v.into());
7067 self
7068 }
7069
7070 /// Sets or clears the value of [start_time][crate::model::IndexOperationMetadata::start_time].
7071 ///
7072 /// # Example
7073 /// ```ignore,no_run
7074 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7075 /// use wkt::Timestamp;
7076 /// let x = IndexOperationMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
7077 /// let x = IndexOperationMetadata::new().set_or_clear_start_time(None::<Timestamp>);
7078 /// ```
7079 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
7080 where
7081 T: std::convert::Into<wkt::Timestamp>,
7082 {
7083 self.start_time = v.map(|x| x.into());
7084 self
7085 }
7086
7087 /// Sets the value of [end_time][crate::model::IndexOperationMetadata::end_time].
7088 ///
7089 /// # Example
7090 /// ```ignore,no_run
7091 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7092 /// use wkt::Timestamp;
7093 /// let x = IndexOperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
7094 /// ```
7095 pub fn set_end_time<T>(mut self, v: T) -> Self
7096 where
7097 T: std::convert::Into<wkt::Timestamp>,
7098 {
7099 self.end_time = std::option::Option::Some(v.into());
7100 self
7101 }
7102
7103 /// Sets or clears the value of [end_time][crate::model::IndexOperationMetadata::end_time].
7104 ///
7105 /// # Example
7106 /// ```ignore,no_run
7107 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7108 /// use wkt::Timestamp;
7109 /// let x = IndexOperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
7110 /// let x = IndexOperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
7111 /// ```
7112 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7113 where
7114 T: std::convert::Into<wkt::Timestamp>,
7115 {
7116 self.end_time = v.map(|x| x.into());
7117 self
7118 }
7119
7120 /// Sets the value of [index][crate::model::IndexOperationMetadata::index].
7121 ///
7122 /// # Example
7123 /// ```ignore,no_run
7124 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7125 /// let x = IndexOperationMetadata::new().set_index("example");
7126 /// ```
7127 pub fn set_index<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7128 self.index = v.into();
7129 self
7130 }
7131
7132 /// Sets the value of [state][crate::model::IndexOperationMetadata::state].
7133 ///
7134 /// # Example
7135 /// ```ignore,no_run
7136 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7137 /// use google_cloud_firestore_admin_v1::model::OperationState;
7138 /// let x0 = IndexOperationMetadata::new().set_state(OperationState::Initializing);
7139 /// let x1 = IndexOperationMetadata::new().set_state(OperationState::Processing);
7140 /// let x2 = IndexOperationMetadata::new().set_state(OperationState::Cancelling);
7141 /// ```
7142 pub fn set_state<T: std::convert::Into<crate::model::OperationState>>(mut self, v: T) -> Self {
7143 self.state = v.into();
7144 self
7145 }
7146
7147 /// Sets the value of [progress_documents][crate::model::IndexOperationMetadata::progress_documents].
7148 ///
7149 /// # Example
7150 /// ```ignore,no_run
7151 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7152 /// use google_cloud_firestore_admin_v1::model::Progress;
7153 /// let x = IndexOperationMetadata::new().set_progress_documents(Progress::default()/* use setters */);
7154 /// ```
7155 pub fn set_progress_documents<T>(mut self, v: T) -> Self
7156 where
7157 T: std::convert::Into<crate::model::Progress>,
7158 {
7159 self.progress_documents = std::option::Option::Some(v.into());
7160 self
7161 }
7162
7163 /// Sets or clears the value of [progress_documents][crate::model::IndexOperationMetadata::progress_documents].
7164 ///
7165 /// # Example
7166 /// ```ignore,no_run
7167 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7168 /// use google_cloud_firestore_admin_v1::model::Progress;
7169 /// let x = IndexOperationMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
7170 /// let x = IndexOperationMetadata::new().set_or_clear_progress_documents(None::<Progress>);
7171 /// ```
7172 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
7173 where
7174 T: std::convert::Into<crate::model::Progress>,
7175 {
7176 self.progress_documents = v.map(|x| x.into());
7177 self
7178 }
7179
7180 /// Sets the value of [progress_bytes][crate::model::IndexOperationMetadata::progress_bytes].
7181 ///
7182 /// # Example
7183 /// ```ignore,no_run
7184 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7185 /// use google_cloud_firestore_admin_v1::model::Progress;
7186 /// let x = IndexOperationMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
7187 /// ```
7188 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
7189 where
7190 T: std::convert::Into<crate::model::Progress>,
7191 {
7192 self.progress_bytes = std::option::Option::Some(v.into());
7193 self
7194 }
7195
7196 /// Sets or clears the value of [progress_bytes][crate::model::IndexOperationMetadata::progress_bytes].
7197 ///
7198 /// # Example
7199 /// ```ignore,no_run
7200 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7201 /// use google_cloud_firestore_admin_v1::model::Progress;
7202 /// let x = IndexOperationMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
7203 /// let x = IndexOperationMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
7204 /// ```
7205 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
7206 where
7207 T: std::convert::Into<crate::model::Progress>,
7208 {
7209 self.progress_bytes = v.map(|x| x.into());
7210 self
7211 }
7212}
7213
7214impl wkt::message::Message for IndexOperationMetadata {
7215 fn typename() -> &'static str {
7216 "type.googleapis.com/google.firestore.admin.v1.IndexOperationMetadata"
7217 }
7218}
7219
7220/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
7221/// results from
7222/// [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField].
7223///
7224/// [google.firestore.admin.v1.FirestoreAdmin.UpdateField]: crate::client::FirestoreAdmin::update_field
7225/// [google.longrunning.Operation]: longrunning::model::Operation
7226#[derive(Clone, Default, PartialEq)]
7227#[non_exhaustive]
7228pub struct FieldOperationMetadata {
7229 /// The time this operation started.
7230 pub start_time: std::option::Option<wkt::Timestamp>,
7231
7232 /// The time this operation completed. Will be unset if operation still in
7233 /// progress.
7234 pub end_time: std::option::Option<wkt::Timestamp>,
7235
7236 /// The field resource that this operation is acting on. For example:
7237 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
7238 pub field: std::string::String,
7239
7240 /// A list of
7241 /// [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
7242 /// which describe the intent of this operation.
7243 ///
7244 /// [google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta]: crate::model::field_operation_metadata::IndexConfigDelta
7245 pub index_config_deltas:
7246 std::vec::Vec<crate::model::field_operation_metadata::IndexConfigDelta>,
7247
7248 /// The state of the operation.
7249 pub state: crate::model::OperationState,
7250
7251 /// The progress, in documents, of this operation.
7252 pub progress_documents: std::option::Option<crate::model::Progress>,
7253
7254 /// The progress, in bytes, of this operation.
7255 pub progress_bytes: std::option::Option<crate::model::Progress>,
7256
7257 /// Describes the deltas of TTL configuration.
7258 pub ttl_config_delta:
7259 std::option::Option<crate::model::field_operation_metadata::TtlConfigDelta>,
7260
7261 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7262}
7263
7264impl FieldOperationMetadata {
7265 pub fn new() -> Self {
7266 std::default::Default::default()
7267 }
7268
7269 /// Sets the value of [start_time][crate::model::FieldOperationMetadata::start_time].
7270 ///
7271 /// # Example
7272 /// ```ignore,no_run
7273 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7274 /// use wkt::Timestamp;
7275 /// let x = FieldOperationMetadata::new().set_start_time(Timestamp::default()/* use setters */);
7276 /// ```
7277 pub fn set_start_time<T>(mut self, v: T) -> Self
7278 where
7279 T: std::convert::Into<wkt::Timestamp>,
7280 {
7281 self.start_time = std::option::Option::Some(v.into());
7282 self
7283 }
7284
7285 /// Sets or clears the value of [start_time][crate::model::FieldOperationMetadata::start_time].
7286 ///
7287 /// # Example
7288 /// ```ignore,no_run
7289 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7290 /// use wkt::Timestamp;
7291 /// let x = FieldOperationMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
7292 /// let x = FieldOperationMetadata::new().set_or_clear_start_time(None::<Timestamp>);
7293 /// ```
7294 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
7295 where
7296 T: std::convert::Into<wkt::Timestamp>,
7297 {
7298 self.start_time = v.map(|x| x.into());
7299 self
7300 }
7301
7302 /// Sets the value of [end_time][crate::model::FieldOperationMetadata::end_time].
7303 ///
7304 /// # Example
7305 /// ```ignore,no_run
7306 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7307 /// use wkt::Timestamp;
7308 /// let x = FieldOperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
7309 /// ```
7310 pub fn set_end_time<T>(mut self, v: T) -> Self
7311 where
7312 T: std::convert::Into<wkt::Timestamp>,
7313 {
7314 self.end_time = std::option::Option::Some(v.into());
7315 self
7316 }
7317
7318 /// Sets or clears the value of [end_time][crate::model::FieldOperationMetadata::end_time].
7319 ///
7320 /// # Example
7321 /// ```ignore,no_run
7322 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7323 /// use wkt::Timestamp;
7324 /// let x = FieldOperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
7325 /// let x = FieldOperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
7326 /// ```
7327 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7328 where
7329 T: std::convert::Into<wkt::Timestamp>,
7330 {
7331 self.end_time = v.map(|x| x.into());
7332 self
7333 }
7334
7335 /// Sets the value of [field][crate::model::FieldOperationMetadata::field].
7336 ///
7337 /// # Example
7338 /// ```ignore,no_run
7339 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7340 /// let x = FieldOperationMetadata::new().set_field("example");
7341 /// ```
7342 pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7343 self.field = v.into();
7344 self
7345 }
7346
7347 /// Sets the value of [index_config_deltas][crate::model::FieldOperationMetadata::index_config_deltas].
7348 ///
7349 /// # Example
7350 /// ```ignore,no_run
7351 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7352 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::IndexConfigDelta;
7353 /// let x = FieldOperationMetadata::new()
7354 /// .set_index_config_deltas([
7355 /// IndexConfigDelta::default()/* use setters */,
7356 /// IndexConfigDelta::default()/* use (different) setters */,
7357 /// ]);
7358 /// ```
7359 pub fn set_index_config_deltas<T, V>(mut self, v: T) -> Self
7360 where
7361 T: std::iter::IntoIterator<Item = V>,
7362 V: std::convert::Into<crate::model::field_operation_metadata::IndexConfigDelta>,
7363 {
7364 use std::iter::Iterator;
7365 self.index_config_deltas = v.into_iter().map(|i| i.into()).collect();
7366 self
7367 }
7368
7369 /// Sets the value of [state][crate::model::FieldOperationMetadata::state].
7370 ///
7371 /// # Example
7372 /// ```ignore,no_run
7373 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7374 /// use google_cloud_firestore_admin_v1::model::OperationState;
7375 /// let x0 = FieldOperationMetadata::new().set_state(OperationState::Initializing);
7376 /// let x1 = FieldOperationMetadata::new().set_state(OperationState::Processing);
7377 /// let x2 = FieldOperationMetadata::new().set_state(OperationState::Cancelling);
7378 /// ```
7379 pub fn set_state<T: std::convert::Into<crate::model::OperationState>>(mut self, v: T) -> Self {
7380 self.state = v.into();
7381 self
7382 }
7383
7384 /// Sets the value of [progress_documents][crate::model::FieldOperationMetadata::progress_documents].
7385 ///
7386 /// # Example
7387 /// ```ignore,no_run
7388 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7389 /// use google_cloud_firestore_admin_v1::model::Progress;
7390 /// let x = FieldOperationMetadata::new().set_progress_documents(Progress::default()/* use setters */);
7391 /// ```
7392 pub fn set_progress_documents<T>(mut self, v: T) -> Self
7393 where
7394 T: std::convert::Into<crate::model::Progress>,
7395 {
7396 self.progress_documents = std::option::Option::Some(v.into());
7397 self
7398 }
7399
7400 /// Sets or clears the value of [progress_documents][crate::model::FieldOperationMetadata::progress_documents].
7401 ///
7402 /// # Example
7403 /// ```ignore,no_run
7404 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7405 /// use google_cloud_firestore_admin_v1::model::Progress;
7406 /// let x = FieldOperationMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
7407 /// let x = FieldOperationMetadata::new().set_or_clear_progress_documents(None::<Progress>);
7408 /// ```
7409 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
7410 where
7411 T: std::convert::Into<crate::model::Progress>,
7412 {
7413 self.progress_documents = v.map(|x| x.into());
7414 self
7415 }
7416
7417 /// Sets the value of [progress_bytes][crate::model::FieldOperationMetadata::progress_bytes].
7418 ///
7419 /// # Example
7420 /// ```ignore,no_run
7421 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7422 /// use google_cloud_firestore_admin_v1::model::Progress;
7423 /// let x = FieldOperationMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
7424 /// ```
7425 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
7426 where
7427 T: std::convert::Into<crate::model::Progress>,
7428 {
7429 self.progress_bytes = std::option::Option::Some(v.into());
7430 self
7431 }
7432
7433 /// Sets or clears the value of [progress_bytes][crate::model::FieldOperationMetadata::progress_bytes].
7434 ///
7435 /// # Example
7436 /// ```ignore,no_run
7437 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7438 /// use google_cloud_firestore_admin_v1::model::Progress;
7439 /// let x = FieldOperationMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
7440 /// let x = FieldOperationMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
7441 /// ```
7442 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
7443 where
7444 T: std::convert::Into<crate::model::Progress>,
7445 {
7446 self.progress_bytes = v.map(|x| x.into());
7447 self
7448 }
7449
7450 /// Sets the value of [ttl_config_delta][crate::model::FieldOperationMetadata::ttl_config_delta].
7451 ///
7452 /// # Example
7453 /// ```ignore,no_run
7454 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7455 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::TtlConfigDelta;
7456 /// let x = FieldOperationMetadata::new().set_ttl_config_delta(TtlConfigDelta::default()/* use setters */);
7457 /// ```
7458 pub fn set_ttl_config_delta<T>(mut self, v: T) -> Self
7459 where
7460 T: std::convert::Into<crate::model::field_operation_metadata::TtlConfigDelta>,
7461 {
7462 self.ttl_config_delta = std::option::Option::Some(v.into());
7463 self
7464 }
7465
7466 /// Sets or clears the value of [ttl_config_delta][crate::model::FieldOperationMetadata::ttl_config_delta].
7467 ///
7468 /// # Example
7469 /// ```ignore,no_run
7470 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7471 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::TtlConfigDelta;
7472 /// let x = FieldOperationMetadata::new().set_or_clear_ttl_config_delta(Some(TtlConfigDelta::default()/* use setters */));
7473 /// let x = FieldOperationMetadata::new().set_or_clear_ttl_config_delta(None::<TtlConfigDelta>);
7474 /// ```
7475 pub fn set_or_clear_ttl_config_delta<T>(mut self, v: std::option::Option<T>) -> Self
7476 where
7477 T: std::convert::Into<crate::model::field_operation_metadata::TtlConfigDelta>,
7478 {
7479 self.ttl_config_delta = v.map(|x| x.into());
7480 self
7481 }
7482}
7483
7484impl wkt::message::Message for FieldOperationMetadata {
7485 fn typename() -> &'static str {
7486 "type.googleapis.com/google.firestore.admin.v1.FieldOperationMetadata"
7487 }
7488}
7489
7490/// Defines additional types related to [FieldOperationMetadata].
7491pub mod field_operation_metadata {
7492 #[allow(unused_imports)]
7493 use super::*;
7494
7495 /// Information about an index configuration change.
7496 #[derive(Clone, Default, PartialEq)]
7497 #[non_exhaustive]
7498 pub struct IndexConfigDelta {
7499 /// Specifies how the index is changing.
7500 pub change_type: crate::model::field_operation_metadata::index_config_delta::ChangeType,
7501
7502 /// The index being changed.
7503 pub index: std::option::Option<crate::model::Index>,
7504
7505 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7506 }
7507
7508 impl IndexConfigDelta {
7509 pub fn new() -> Self {
7510 std::default::Default::default()
7511 }
7512
7513 /// Sets the value of [change_type][crate::model::field_operation_metadata::IndexConfigDelta::change_type].
7514 ///
7515 /// # Example
7516 /// ```ignore,no_run
7517 /// # use google_cloud_firestore_admin_v1::model::field_operation_metadata::IndexConfigDelta;
7518 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::index_config_delta::ChangeType;
7519 /// let x0 = IndexConfigDelta::new().set_change_type(ChangeType::Add);
7520 /// let x1 = IndexConfigDelta::new().set_change_type(ChangeType::Remove);
7521 /// ```
7522 pub fn set_change_type<
7523 T: std::convert::Into<
7524 crate::model::field_operation_metadata::index_config_delta::ChangeType,
7525 >,
7526 >(
7527 mut self,
7528 v: T,
7529 ) -> Self {
7530 self.change_type = v.into();
7531 self
7532 }
7533
7534 /// Sets the value of [index][crate::model::field_operation_metadata::IndexConfigDelta::index].
7535 ///
7536 /// # Example
7537 /// ```ignore,no_run
7538 /// # use google_cloud_firestore_admin_v1::model::field_operation_metadata::IndexConfigDelta;
7539 /// use google_cloud_firestore_admin_v1::model::Index;
7540 /// let x = IndexConfigDelta::new().set_index(Index::default()/* use setters */);
7541 /// ```
7542 pub fn set_index<T>(mut self, v: T) -> Self
7543 where
7544 T: std::convert::Into<crate::model::Index>,
7545 {
7546 self.index = std::option::Option::Some(v.into());
7547 self
7548 }
7549
7550 /// Sets or clears the value of [index][crate::model::field_operation_metadata::IndexConfigDelta::index].
7551 ///
7552 /// # Example
7553 /// ```ignore,no_run
7554 /// # use google_cloud_firestore_admin_v1::model::field_operation_metadata::IndexConfigDelta;
7555 /// use google_cloud_firestore_admin_v1::model::Index;
7556 /// let x = IndexConfigDelta::new().set_or_clear_index(Some(Index::default()/* use setters */));
7557 /// let x = IndexConfigDelta::new().set_or_clear_index(None::<Index>);
7558 /// ```
7559 pub fn set_or_clear_index<T>(mut self, v: std::option::Option<T>) -> Self
7560 where
7561 T: std::convert::Into<crate::model::Index>,
7562 {
7563 self.index = v.map(|x| x.into());
7564 self
7565 }
7566 }
7567
7568 impl wkt::message::Message for IndexConfigDelta {
7569 fn typename() -> &'static str {
7570 "type.googleapis.com/google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta"
7571 }
7572 }
7573
7574 /// Defines additional types related to [IndexConfigDelta].
7575 pub mod index_config_delta {
7576 #[allow(unused_imports)]
7577 use super::*;
7578
7579 /// Specifies how the index is changing.
7580 ///
7581 /// # Working with unknown values
7582 ///
7583 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7584 /// additional enum variants at any time. Adding new variants is not considered
7585 /// a breaking change. Applications should write their code in anticipation of:
7586 ///
7587 /// - New values appearing in future releases of the client library, **and**
7588 /// - New values received dynamically, without application changes.
7589 ///
7590 /// Please consult the [Working with enums] section in the user guide for some
7591 /// guidelines.
7592 ///
7593 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7594 #[derive(Clone, Debug, PartialEq)]
7595 #[non_exhaustive]
7596 pub enum ChangeType {
7597 /// The type of change is not specified or known.
7598 Unspecified,
7599 /// The single field index is being added.
7600 Add,
7601 /// The single field index is being removed.
7602 Remove,
7603 /// If set, the enum was initialized with an unknown value.
7604 ///
7605 /// Applications can examine the value using [ChangeType::value] or
7606 /// [ChangeType::name].
7607 UnknownValue(change_type::UnknownValue),
7608 }
7609
7610 #[doc(hidden)]
7611 pub mod change_type {
7612 #[allow(unused_imports)]
7613 use super::*;
7614 #[derive(Clone, Debug, PartialEq)]
7615 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7616 }
7617
7618 impl ChangeType {
7619 /// Gets the enum value.
7620 ///
7621 /// Returns `None` if the enum contains an unknown value deserialized from
7622 /// the string representation of enums.
7623 pub fn value(&self) -> std::option::Option<i32> {
7624 match self {
7625 Self::Unspecified => std::option::Option::Some(0),
7626 Self::Add => std::option::Option::Some(1),
7627 Self::Remove => std::option::Option::Some(2),
7628 Self::UnknownValue(u) => u.0.value(),
7629 }
7630 }
7631
7632 /// Gets the enum value as a string.
7633 ///
7634 /// Returns `None` if the enum contains an unknown value deserialized from
7635 /// the integer representation of enums.
7636 pub fn name(&self) -> std::option::Option<&str> {
7637 match self {
7638 Self::Unspecified => std::option::Option::Some("CHANGE_TYPE_UNSPECIFIED"),
7639 Self::Add => std::option::Option::Some("ADD"),
7640 Self::Remove => std::option::Option::Some("REMOVE"),
7641 Self::UnknownValue(u) => u.0.name(),
7642 }
7643 }
7644 }
7645
7646 impl std::default::Default for ChangeType {
7647 fn default() -> Self {
7648 use std::convert::From;
7649 Self::from(0)
7650 }
7651 }
7652
7653 impl std::fmt::Display for ChangeType {
7654 fn fmt(
7655 &self,
7656 f: &mut std::fmt::Formatter<'_>,
7657 ) -> std::result::Result<(), std::fmt::Error> {
7658 wkt::internal::display_enum(f, self.name(), self.value())
7659 }
7660 }
7661
7662 impl std::convert::From<i32> for ChangeType {
7663 fn from(value: i32) -> Self {
7664 match value {
7665 0 => Self::Unspecified,
7666 1 => Self::Add,
7667 2 => Self::Remove,
7668 _ => Self::UnknownValue(change_type::UnknownValue(
7669 wkt::internal::UnknownEnumValue::Integer(value),
7670 )),
7671 }
7672 }
7673 }
7674
7675 impl std::convert::From<&str> for ChangeType {
7676 fn from(value: &str) -> Self {
7677 use std::string::ToString;
7678 match value {
7679 "CHANGE_TYPE_UNSPECIFIED" => Self::Unspecified,
7680 "ADD" => Self::Add,
7681 "REMOVE" => Self::Remove,
7682 _ => Self::UnknownValue(change_type::UnknownValue(
7683 wkt::internal::UnknownEnumValue::String(value.to_string()),
7684 )),
7685 }
7686 }
7687 }
7688
7689 impl serde::ser::Serialize for ChangeType {
7690 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7691 where
7692 S: serde::Serializer,
7693 {
7694 match self {
7695 Self::Unspecified => serializer.serialize_i32(0),
7696 Self::Add => serializer.serialize_i32(1),
7697 Self::Remove => serializer.serialize_i32(2),
7698 Self::UnknownValue(u) => u.0.serialize(serializer),
7699 }
7700 }
7701 }
7702
7703 impl<'de> serde::de::Deserialize<'de> for ChangeType {
7704 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7705 where
7706 D: serde::Deserializer<'de>,
7707 {
7708 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ChangeType>::new(
7709 ".google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType",
7710 ))
7711 }
7712 }
7713 }
7714
7715 /// Information about a TTL configuration change.
7716 #[derive(Clone, Default, PartialEq)]
7717 #[non_exhaustive]
7718 pub struct TtlConfigDelta {
7719 /// Specifies how the TTL configuration is changing.
7720 pub change_type: crate::model::field_operation_metadata::ttl_config_delta::ChangeType,
7721
7722 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7723 }
7724
7725 impl TtlConfigDelta {
7726 pub fn new() -> Self {
7727 std::default::Default::default()
7728 }
7729
7730 /// Sets the value of [change_type][crate::model::field_operation_metadata::TtlConfigDelta::change_type].
7731 ///
7732 /// # Example
7733 /// ```ignore,no_run
7734 /// # use google_cloud_firestore_admin_v1::model::field_operation_metadata::TtlConfigDelta;
7735 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::ttl_config_delta::ChangeType;
7736 /// let x0 = TtlConfigDelta::new().set_change_type(ChangeType::Add);
7737 /// let x1 = TtlConfigDelta::new().set_change_type(ChangeType::Remove);
7738 /// ```
7739 pub fn set_change_type<
7740 T: std::convert::Into<
7741 crate::model::field_operation_metadata::ttl_config_delta::ChangeType,
7742 >,
7743 >(
7744 mut self,
7745 v: T,
7746 ) -> Self {
7747 self.change_type = v.into();
7748 self
7749 }
7750 }
7751
7752 impl wkt::message::Message for TtlConfigDelta {
7753 fn typename() -> &'static str {
7754 "type.googleapis.com/google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta"
7755 }
7756 }
7757
7758 /// Defines additional types related to [TtlConfigDelta].
7759 pub mod ttl_config_delta {
7760 #[allow(unused_imports)]
7761 use super::*;
7762
7763 /// Specifies how the TTL config is changing.
7764 ///
7765 /// # Working with unknown values
7766 ///
7767 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7768 /// additional enum variants at any time. Adding new variants is not considered
7769 /// a breaking change. Applications should write their code in anticipation of:
7770 ///
7771 /// - New values appearing in future releases of the client library, **and**
7772 /// - New values received dynamically, without application changes.
7773 ///
7774 /// Please consult the [Working with enums] section in the user guide for some
7775 /// guidelines.
7776 ///
7777 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7778 #[derive(Clone, Debug, PartialEq)]
7779 #[non_exhaustive]
7780 pub enum ChangeType {
7781 /// The type of change is not specified or known.
7782 Unspecified,
7783 /// The TTL config is being added.
7784 Add,
7785 /// The TTL config is being removed.
7786 Remove,
7787 /// If set, the enum was initialized with an unknown value.
7788 ///
7789 /// Applications can examine the value using [ChangeType::value] or
7790 /// [ChangeType::name].
7791 UnknownValue(change_type::UnknownValue),
7792 }
7793
7794 #[doc(hidden)]
7795 pub mod change_type {
7796 #[allow(unused_imports)]
7797 use super::*;
7798 #[derive(Clone, Debug, PartialEq)]
7799 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7800 }
7801
7802 impl ChangeType {
7803 /// Gets the enum value.
7804 ///
7805 /// Returns `None` if the enum contains an unknown value deserialized from
7806 /// the string representation of enums.
7807 pub fn value(&self) -> std::option::Option<i32> {
7808 match self {
7809 Self::Unspecified => std::option::Option::Some(0),
7810 Self::Add => std::option::Option::Some(1),
7811 Self::Remove => std::option::Option::Some(2),
7812 Self::UnknownValue(u) => u.0.value(),
7813 }
7814 }
7815
7816 /// Gets the enum value as a string.
7817 ///
7818 /// Returns `None` if the enum contains an unknown value deserialized from
7819 /// the integer representation of enums.
7820 pub fn name(&self) -> std::option::Option<&str> {
7821 match self {
7822 Self::Unspecified => std::option::Option::Some("CHANGE_TYPE_UNSPECIFIED"),
7823 Self::Add => std::option::Option::Some("ADD"),
7824 Self::Remove => std::option::Option::Some("REMOVE"),
7825 Self::UnknownValue(u) => u.0.name(),
7826 }
7827 }
7828 }
7829
7830 impl std::default::Default for ChangeType {
7831 fn default() -> Self {
7832 use std::convert::From;
7833 Self::from(0)
7834 }
7835 }
7836
7837 impl std::fmt::Display for ChangeType {
7838 fn fmt(
7839 &self,
7840 f: &mut std::fmt::Formatter<'_>,
7841 ) -> std::result::Result<(), std::fmt::Error> {
7842 wkt::internal::display_enum(f, self.name(), self.value())
7843 }
7844 }
7845
7846 impl std::convert::From<i32> for ChangeType {
7847 fn from(value: i32) -> Self {
7848 match value {
7849 0 => Self::Unspecified,
7850 1 => Self::Add,
7851 2 => Self::Remove,
7852 _ => Self::UnknownValue(change_type::UnknownValue(
7853 wkt::internal::UnknownEnumValue::Integer(value),
7854 )),
7855 }
7856 }
7857 }
7858
7859 impl std::convert::From<&str> for ChangeType {
7860 fn from(value: &str) -> Self {
7861 use std::string::ToString;
7862 match value {
7863 "CHANGE_TYPE_UNSPECIFIED" => Self::Unspecified,
7864 "ADD" => Self::Add,
7865 "REMOVE" => Self::Remove,
7866 _ => Self::UnknownValue(change_type::UnknownValue(
7867 wkt::internal::UnknownEnumValue::String(value.to_string()),
7868 )),
7869 }
7870 }
7871 }
7872
7873 impl serde::ser::Serialize for ChangeType {
7874 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7875 where
7876 S: serde::Serializer,
7877 {
7878 match self {
7879 Self::Unspecified => serializer.serialize_i32(0),
7880 Self::Add => serializer.serialize_i32(1),
7881 Self::Remove => serializer.serialize_i32(2),
7882 Self::UnknownValue(u) => u.0.serialize(serializer),
7883 }
7884 }
7885 }
7886
7887 impl<'de> serde::de::Deserialize<'de> for ChangeType {
7888 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7889 where
7890 D: serde::Deserializer<'de>,
7891 {
7892 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ChangeType>::new(
7893 ".google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType",
7894 ))
7895 }
7896 }
7897 }
7898}
7899
7900/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
7901/// results from
7902/// [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments].
7903///
7904/// [google.firestore.admin.v1.FirestoreAdmin.ExportDocuments]: crate::client::FirestoreAdmin::export_documents
7905/// [google.longrunning.Operation]: longrunning::model::Operation
7906#[derive(Clone, Default, PartialEq)]
7907#[non_exhaustive]
7908pub struct ExportDocumentsMetadata {
7909 /// The time this operation started.
7910 pub start_time: std::option::Option<wkt::Timestamp>,
7911
7912 /// The time this operation completed. Will be unset if operation still in
7913 /// progress.
7914 pub end_time: std::option::Option<wkt::Timestamp>,
7915
7916 /// The state of the export operation.
7917 pub operation_state: crate::model::OperationState,
7918
7919 /// The progress, in documents, of this operation.
7920 pub progress_documents: std::option::Option<crate::model::Progress>,
7921
7922 /// The progress, in bytes, of this operation.
7923 pub progress_bytes: std::option::Option<crate::model::Progress>,
7924
7925 /// Which collection IDs are being exported.
7926 pub collection_ids: std::vec::Vec<std::string::String>,
7927
7928 /// Where the documents are being exported to.
7929 pub output_uri_prefix: std::string::String,
7930
7931 /// Which namespace IDs are being exported.
7932 pub namespace_ids: std::vec::Vec<std::string::String>,
7933
7934 /// The timestamp that corresponds to the version of the database that is being
7935 /// exported. If unspecified, there are no guarantees about the consistency of
7936 /// the documents being exported.
7937 pub snapshot_time: std::option::Option<wkt::Timestamp>,
7938
7939 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7940}
7941
7942impl ExportDocumentsMetadata {
7943 pub fn new() -> Self {
7944 std::default::Default::default()
7945 }
7946
7947 /// Sets the value of [start_time][crate::model::ExportDocumentsMetadata::start_time].
7948 ///
7949 /// # Example
7950 /// ```ignore,no_run
7951 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
7952 /// use wkt::Timestamp;
7953 /// let x = ExportDocumentsMetadata::new().set_start_time(Timestamp::default()/* use setters */);
7954 /// ```
7955 pub fn set_start_time<T>(mut self, v: T) -> Self
7956 where
7957 T: std::convert::Into<wkt::Timestamp>,
7958 {
7959 self.start_time = std::option::Option::Some(v.into());
7960 self
7961 }
7962
7963 /// Sets or clears the value of [start_time][crate::model::ExportDocumentsMetadata::start_time].
7964 ///
7965 /// # Example
7966 /// ```ignore,no_run
7967 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
7968 /// use wkt::Timestamp;
7969 /// let x = ExportDocumentsMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
7970 /// let x = ExportDocumentsMetadata::new().set_or_clear_start_time(None::<Timestamp>);
7971 /// ```
7972 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
7973 where
7974 T: std::convert::Into<wkt::Timestamp>,
7975 {
7976 self.start_time = v.map(|x| x.into());
7977 self
7978 }
7979
7980 /// Sets the value of [end_time][crate::model::ExportDocumentsMetadata::end_time].
7981 ///
7982 /// # Example
7983 /// ```ignore,no_run
7984 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
7985 /// use wkt::Timestamp;
7986 /// let x = ExportDocumentsMetadata::new().set_end_time(Timestamp::default()/* use setters */);
7987 /// ```
7988 pub fn set_end_time<T>(mut self, v: T) -> Self
7989 where
7990 T: std::convert::Into<wkt::Timestamp>,
7991 {
7992 self.end_time = std::option::Option::Some(v.into());
7993 self
7994 }
7995
7996 /// Sets or clears the value of [end_time][crate::model::ExportDocumentsMetadata::end_time].
7997 ///
7998 /// # Example
7999 /// ```ignore,no_run
8000 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8001 /// use wkt::Timestamp;
8002 /// let x = ExportDocumentsMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8003 /// let x = ExportDocumentsMetadata::new().set_or_clear_end_time(None::<Timestamp>);
8004 /// ```
8005 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8006 where
8007 T: std::convert::Into<wkt::Timestamp>,
8008 {
8009 self.end_time = v.map(|x| x.into());
8010 self
8011 }
8012
8013 /// Sets the value of [operation_state][crate::model::ExportDocumentsMetadata::operation_state].
8014 ///
8015 /// # Example
8016 /// ```ignore,no_run
8017 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8018 /// use google_cloud_firestore_admin_v1::model::OperationState;
8019 /// let x0 = ExportDocumentsMetadata::new().set_operation_state(OperationState::Initializing);
8020 /// let x1 = ExportDocumentsMetadata::new().set_operation_state(OperationState::Processing);
8021 /// let x2 = ExportDocumentsMetadata::new().set_operation_state(OperationState::Cancelling);
8022 /// ```
8023 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
8024 mut self,
8025 v: T,
8026 ) -> Self {
8027 self.operation_state = v.into();
8028 self
8029 }
8030
8031 /// Sets the value of [progress_documents][crate::model::ExportDocumentsMetadata::progress_documents].
8032 ///
8033 /// # Example
8034 /// ```ignore,no_run
8035 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8036 /// use google_cloud_firestore_admin_v1::model::Progress;
8037 /// let x = ExportDocumentsMetadata::new().set_progress_documents(Progress::default()/* use setters */);
8038 /// ```
8039 pub fn set_progress_documents<T>(mut self, v: T) -> Self
8040 where
8041 T: std::convert::Into<crate::model::Progress>,
8042 {
8043 self.progress_documents = std::option::Option::Some(v.into());
8044 self
8045 }
8046
8047 /// Sets or clears the value of [progress_documents][crate::model::ExportDocumentsMetadata::progress_documents].
8048 ///
8049 /// # Example
8050 /// ```ignore,no_run
8051 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8052 /// use google_cloud_firestore_admin_v1::model::Progress;
8053 /// let x = ExportDocumentsMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
8054 /// let x = ExportDocumentsMetadata::new().set_or_clear_progress_documents(None::<Progress>);
8055 /// ```
8056 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
8057 where
8058 T: std::convert::Into<crate::model::Progress>,
8059 {
8060 self.progress_documents = v.map(|x| x.into());
8061 self
8062 }
8063
8064 /// Sets the value of [progress_bytes][crate::model::ExportDocumentsMetadata::progress_bytes].
8065 ///
8066 /// # Example
8067 /// ```ignore,no_run
8068 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8069 /// use google_cloud_firestore_admin_v1::model::Progress;
8070 /// let x = ExportDocumentsMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
8071 /// ```
8072 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
8073 where
8074 T: std::convert::Into<crate::model::Progress>,
8075 {
8076 self.progress_bytes = std::option::Option::Some(v.into());
8077 self
8078 }
8079
8080 /// Sets or clears the value of [progress_bytes][crate::model::ExportDocumentsMetadata::progress_bytes].
8081 ///
8082 /// # Example
8083 /// ```ignore,no_run
8084 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8085 /// use google_cloud_firestore_admin_v1::model::Progress;
8086 /// let x = ExportDocumentsMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
8087 /// let x = ExportDocumentsMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
8088 /// ```
8089 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8090 where
8091 T: std::convert::Into<crate::model::Progress>,
8092 {
8093 self.progress_bytes = v.map(|x| x.into());
8094 self
8095 }
8096
8097 /// Sets the value of [collection_ids][crate::model::ExportDocumentsMetadata::collection_ids].
8098 ///
8099 /// # Example
8100 /// ```ignore,no_run
8101 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8102 /// let x = ExportDocumentsMetadata::new().set_collection_ids(["a", "b", "c"]);
8103 /// ```
8104 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
8105 where
8106 T: std::iter::IntoIterator<Item = V>,
8107 V: std::convert::Into<std::string::String>,
8108 {
8109 use std::iter::Iterator;
8110 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
8111 self
8112 }
8113
8114 /// Sets the value of [output_uri_prefix][crate::model::ExportDocumentsMetadata::output_uri_prefix].
8115 ///
8116 /// # Example
8117 /// ```ignore,no_run
8118 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8119 /// let x = ExportDocumentsMetadata::new().set_output_uri_prefix("example");
8120 /// ```
8121 pub fn set_output_uri_prefix<T: std::convert::Into<std::string::String>>(
8122 mut self,
8123 v: T,
8124 ) -> Self {
8125 self.output_uri_prefix = v.into();
8126 self
8127 }
8128
8129 /// Sets the value of [namespace_ids][crate::model::ExportDocumentsMetadata::namespace_ids].
8130 ///
8131 /// # Example
8132 /// ```ignore,no_run
8133 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8134 /// let x = ExportDocumentsMetadata::new().set_namespace_ids(["a", "b", "c"]);
8135 /// ```
8136 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
8137 where
8138 T: std::iter::IntoIterator<Item = V>,
8139 V: std::convert::Into<std::string::String>,
8140 {
8141 use std::iter::Iterator;
8142 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
8143 self
8144 }
8145
8146 /// Sets the value of [snapshot_time][crate::model::ExportDocumentsMetadata::snapshot_time].
8147 ///
8148 /// # Example
8149 /// ```ignore,no_run
8150 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8151 /// use wkt::Timestamp;
8152 /// let x = ExportDocumentsMetadata::new().set_snapshot_time(Timestamp::default()/* use setters */);
8153 /// ```
8154 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
8155 where
8156 T: std::convert::Into<wkt::Timestamp>,
8157 {
8158 self.snapshot_time = std::option::Option::Some(v.into());
8159 self
8160 }
8161
8162 /// Sets or clears the value of [snapshot_time][crate::model::ExportDocumentsMetadata::snapshot_time].
8163 ///
8164 /// # Example
8165 /// ```ignore,no_run
8166 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8167 /// use wkt::Timestamp;
8168 /// let x = ExportDocumentsMetadata::new().set_or_clear_snapshot_time(Some(Timestamp::default()/* use setters */));
8169 /// let x = ExportDocumentsMetadata::new().set_or_clear_snapshot_time(None::<Timestamp>);
8170 /// ```
8171 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
8172 where
8173 T: std::convert::Into<wkt::Timestamp>,
8174 {
8175 self.snapshot_time = v.map(|x| x.into());
8176 self
8177 }
8178}
8179
8180impl wkt::message::Message for ExportDocumentsMetadata {
8181 fn typename() -> &'static str {
8182 "type.googleapis.com/google.firestore.admin.v1.ExportDocumentsMetadata"
8183 }
8184}
8185
8186/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
8187/// results from
8188/// [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments].
8189///
8190/// [google.firestore.admin.v1.FirestoreAdmin.ImportDocuments]: crate::client::FirestoreAdmin::import_documents
8191/// [google.longrunning.Operation]: longrunning::model::Operation
8192#[derive(Clone, Default, PartialEq)]
8193#[non_exhaustive]
8194pub struct ImportDocumentsMetadata {
8195 /// The time this operation started.
8196 pub start_time: std::option::Option<wkt::Timestamp>,
8197
8198 /// The time this operation completed. Will be unset if operation still in
8199 /// progress.
8200 pub end_time: std::option::Option<wkt::Timestamp>,
8201
8202 /// The state of the import operation.
8203 pub operation_state: crate::model::OperationState,
8204
8205 /// The progress, in documents, of this operation.
8206 pub progress_documents: std::option::Option<crate::model::Progress>,
8207
8208 /// The progress, in bytes, of this operation.
8209 pub progress_bytes: std::option::Option<crate::model::Progress>,
8210
8211 /// Which collection IDs are being imported.
8212 pub collection_ids: std::vec::Vec<std::string::String>,
8213
8214 /// The location of the documents being imported.
8215 pub input_uri_prefix: std::string::String,
8216
8217 /// Which namespace IDs are being imported.
8218 pub namespace_ids: std::vec::Vec<std::string::String>,
8219
8220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8221}
8222
8223impl ImportDocumentsMetadata {
8224 pub fn new() -> Self {
8225 std::default::Default::default()
8226 }
8227
8228 /// Sets the value of [start_time][crate::model::ImportDocumentsMetadata::start_time].
8229 ///
8230 /// # Example
8231 /// ```ignore,no_run
8232 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8233 /// use wkt::Timestamp;
8234 /// let x = ImportDocumentsMetadata::new().set_start_time(Timestamp::default()/* use setters */);
8235 /// ```
8236 pub fn set_start_time<T>(mut self, v: T) -> Self
8237 where
8238 T: std::convert::Into<wkt::Timestamp>,
8239 {
8240 self.start_time = std::option::Option::Some(v.into());
8241 self
8242 }
8243
8244 /// Sets or clears the value of [start_time][crate::model::ImportDocumentsMetadata::start_time].
8245 ///
8246 /// # Example
8247 /// ```ignore,no_run
8248 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8249 /// use wkt::Timestamp;
8250 /// let x = ImportDocumentsMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
8251 /// let x = ImportDocumentsMetadata::new().set_or_clear_start_time(None::<Timestamp>);
8252 /// ```
8253 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8254 where
8255 T: std::convert::Into<wkt::Timestamp>,
8256 {
8257 self.start_time = v.map(|x| x.into());
8258 self
8259 }
8260
8261 /// Sets the value of [end_time][crate::model::ImportDocumentsMetadata::end_time].
8262 ///
8263 /// # Example
8264 /// ```ignore,no_run
8265 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8266 /// use wkt::Timestamp;
8267 /// let x = ImportDocumentsMetadata::new().set_end_time(Timestamp::default()/* use setters */);
8268 /// ```
8269 pub fn set_end_time<T>(mut self, v: T) -> Self
8270 where
8271 T: std::convert::Into<wkt::Timestamp>,
8272 {
8273 self.end_time = std::option::Option::Some(v.into());
8274 self
8275 }
8276
8277 /// Sets or clears the value of [end_time][crate::model::ImportDocumentsMetadata::end_time].
8278 ///
8279 /// # Example
8280 /// ```ignore,no_run
8281 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8282 /// use wkt::Timestamp;
8283 /// let x = ImportDocumentsMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8284 /// let x = ImportDocumentsMetadata::new().set_or_clear_end_time(None::<Timestamp>);
8285 /// ```
8286 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8287 where
8288 T: std::convert::Into<wkt::Timestamp>,
8289 {
8290 self.end_time = v.map(|x| x.into());
8291 self
8292 }
8293
8294 /// Sets the value of [operation_state][crate::model::ImportDocumentsMetadata::operation_state].
8295 ///
8296 /// # Example
8297 /// ```ignore,no_run
8298 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8299 /// use google_cloud_firestore_admin_v1::model::OperationState;
8300 /// let x0 = ImportDocumentsMetadata::new().set_operation_state(OperationState::Initializing);
8301 /// let x1 = ImportDocumentsMetadata::new().set_operation_state(OperationState::Processing);
8302 /// let x2 = ImportDocumentsMetadata::new().set_operation_state(OperationState::Cancelling);
8303 /// ```
8304 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
8305 mut self,
8306 v: T,
8307 ) -> Self {
8308 self.operation_state = v.into();
8309 self
8310 }
8311
8312 /// Sets the value of [progress_documents][crate::model::ImportDocumentsMetadata::progress_documents].
8313 ///
8314 /// # Example
8315 /// ```ignore,no_run
8316 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8317 /// use google_cloud_firestore_admin_v1::model::Progress;
8318 /// let x = ImportDocumentsMetadata::new().set_progress_documents(Progress::default()/* use setters */);
8319 /// ```
8320 pub fn set_progress_documents<T>(mut self, v: T) -> Self
8321 where
8322 T: std::convert::Into<crate::model::Progress>,
8323 {
8324 self.progress_documents = std::option::Option::Some(v.into());
8325 self
8326 }
8327
8328 /// Sets or clears the value of [progress_documents][crate::model::ImportDocumentsMetadata::progress_documents].
8329 ///
8330 /// # Example
8331 /// ```ignore,no_run
8332 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8333 /// use google_cloud_firestore_admin_v1::model::Progress;
8334 /// let x = ImportDocumentsMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
8335 /// let x = ImportDocumentsMetadata::new().set_or_clear_progress_documents(None::<Progress>);
8336 /// ```
8337 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
8338 where
8339 T: std::convert::Into<crate::model::Progress>,
8340 {
8341 self.progress_documents = v.map(|x| x.into());
8342 self
8343 }
8344
8345 /// Sets the value of [progress_bytes][crate::model::ImportDocumentsMetadata::progress_bytes].
8346 ///
8347 /// # Example
8348 /// ```ignore,no_run
8349 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8350 /// use google_cloud_firestore_admin_v1::model::Progress;
8351 /// let x = ImportDocumentsMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
8352 /// ```
8353 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
8354 where
8355 T: std::convert::Into<crate::model::Progress>,
8356 {
8357 self.progress_bytes = std::option::Option::Some(v.into());
8358 self
8359 }
8360
8361 /// Sets or clears the value of [progress_bytes][crate::model::ImportDocumentsMetadata::progress_bytes].
8362 ///
8363 /// # Example
8364 /// ```ignore,no_run
8365 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8366 /// use google_cloud_firestore_admin_v1::model::Progress;
8367 /// let x = ImportDocumentsMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
8368 /// let x = ImportDocumentsMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
8369 /// ```
8370 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8371 where
8372 T: std::convert::Into<crate::model::Progress>,
8373 {
8374 self.progress_bytes = v.map(|x| x.into());
8375 self
8376 }
8377
8378 /// Sets the value of [collection_ids][crate::model::ImportDocumentsMetadata::collection_ids].
8379 ///
8380 /// # Example
8381 /// ```ignore,no_run
8382 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8383 /// let x = ImportDocumentsMetadata::new().set_collection_ids(["a", "b", "c"]);
8384 /// ```
8385 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
8386 where
8387 T: std::iter::IntoIterator<Item = V>,
8388 V: std::convert::Into<std::string::String>,
8389 {
8390 use std::iter::Iterator;
8391 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
8392 self
8393 }
8394
8395 /// Sets the value of [input_uri_prefix][crate::model::ImportDocumentsMetadata::input_uri_prefix].
8396 ///
8397 /// # Example
8398 /// ```ignore,no_run
8399 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8400 /// let x = ImportDocumentsMetadata::new().set_input_uri_prefix("example");
8401 /// ```
8402 pub fn set_input_uri_prefix<T: std::convert::Into<std::string::String>>(
8403 mut self,
8404 v: T,
8405 ) -> Self {
8406 self.input_uri_prefix = v.into();
8407 self
8408 }
8409
8410 /// Sets the value of [namespace_ids][crate::model::ImportDocumentsMetadata::namespace_ids].
8411 ///
8412 /// # Example
8413 /// ```ignore,no_run
8414 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8415 /// let x = ImportDocumentsMetadata::new().set_namespace_ids(["a", "b", "c"]);
8416 /// ```
8417 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
8418 where
8419 T: std::iter::IntoIterator<Item = V>,
8420 V: std::convert::Into<std::string::String>,
8421 {
8422 use std::iter::Iterator;
8423 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
8424 self
8425 }
8426}
8427
8428impl wkt::message::Message for ImportDocumentsMetadata {
8429 fn typename() -> &'static str {
8430 "type.googleapis.com/google.firestore.admin.v1.ImportDocumentsMetadata"
8431 }
8432}
8433
8434/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
8435/// results from
8436/// [FirestoreAdmin.BulkDeleteDocuments][google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments].
8437///
8438/// [google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments]: crate::client::FirestoreAdmin::bulk_delete_documents
8439/// [google.longrunning.Operation]: longrunning::model::Operation
8440#[derive(Clone, Default, PartialEq)]
8441#[non_exhaustive]
8442pub struct BulkDeleteDocumentsMetadata {
8443 /// The time this operation started.
8444 pub start_time: std::option::Option<wkt::Timestamp>,
8445
8446 /// The time this operation completed. Will be unset if operation still in
8447 /// progress.
8448 pub end_time: std::option::Option<wkt::Timestamp>,
8449
8450 /// The state of the operation.
8451 pub operation_state: crate::model::OperationState,
8452
8453 /// The progress, in documents, of this operation.
8454 pub progress_documents: std::option::Option<crate::model::Progress>,
8455
8456 /// The progress, in bytes, of this operation.
8457 pub progress_bytes: std::option::Option<crate::model::Progress>,
8458
8459 /// The IDs of the collection groups that are being deleted.
8460 pub collection_ids: std::vec::Vec<std::string::String>,
8461
8462 /// Which namespace IDs are being deleted.
8463 pub namespace_ids: std::vec::Vec<std::string::String>,
8464
8465 /// The timestamp that corresponds to the version of the database that is being
8466 /// read to get the list of documents to delete. This time can also be used as
8467 /// the timestamp of PITR in case of disaster recovery (subject to PITR window
8468 /// limit).
8469 pub snapshot_time: std::option::Option<wkt::Timestamp>,
8470
8471 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8472}
8473
8474impl BulkDeleteDocumentsMetadata {
8475 pub fn new() -> Self {
8476 std::default::Default::default()
8477 }
8478
8479 /// Sets the value of [start_time][crate::model::BulkDeleteDocumentsMetadata::start_time].
8480 ///
8481 /// # Example
8482 /// ```ignore,no_run
8483 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8484 /// use wkt::Timestamp;
8485 /// let x = BulkDeleteDocumentsMetadata::new().set_start_time(Timestamp::default()/* use setters */);
8486 /// ```
8487 pub fn set_start_time<T>(mut self, v: T) -> Self
8488 where
8489 T: std::convert::Into<wkt::Timestamp>,
8490 {
8491 self.start_time = std::option::Option::Some(v.into());
8492 self
8493 }
8494
8495 /// Sets or clears the value of [start_time][crate::model::BulkDeleteDocumentsMetadata::start_time].
8496 ///
8497 /// # Example
8498 /// ```ignore,no_run
8499 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8500 /// use wkt::Timestamp;
8501 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
8502 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_start_time(None::<Timestamp>);
8503 /// ```
8504 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8505 where
8506 T: std::convert::Into<wkt::Timestamp>,
8507 {
8508 self.start_time = v.map(|x| x.into());
8509 self
8510 }
8511
8512 /// Sets the value of [end_time][crate::model::BulkDeleteDocumentsMetadata::end_time].
8513 ///
8514 /// # Example
8515 /// ```ignore,no_run
8516 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8517 /// use wkt::Timestamp;
8518 /// let x = BulkDeleteDocumentsMetadata::new().set_end_time(Timestamp::default()/* use setters */);
8519 /// ```
8520 pub fn set_end_time<T>(mut self, v: T) -> Self
8521 where
8522 T: std::convert::Into<wkt::Timestamp>,
8523 {
8524 self.end_time = std::option::Option::Some(v.into());
8525 self
8526 }
8527
8528 /// Sets or clears the value of [end_time][crate::model::BulkDeleteDocumentsMetadata::end_time].
8529 ///
8530 /// # Example
8531 /// ```ignore,no_run
8532 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8533 /// use wkt::Timestamp;
8534 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8535 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_end_time(None::<Timestamp>);
8536 /// ```
8537 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8538 where
8539 T: std::convert::Into<wkt::Timestamp>,
8540 {
8541 self.end_time = v.map(|x| x.into());
8542 self
8543 }
8544
8545 /// Sets the value of [operation_state][crate::model::BulkDeleteDocumentsMetadata::operation_state].
8546 ///
8547 /// # Example
8548 /// ```ignore,no_run
8549 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8550 /// use google_cloud_firestore_admin_v1::model::OperationState;
8551 /// let x0 = BulkDeleteDocumentsMetadata::new().set_operation_state(OperationState::Initializing);
8552 /// let x1 = BulkDeleteDocumentsMetadata::new().set_operation_state(OperationState::Processing);
8553 /// let x2 = BulkDeleteDocumentsMetadata::new().set_operation_state(OperationState::Cancelling);
8554 /// ```
8555 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
8556 mut self,
8557 v: T,
8558 ) -> Self {
8559 self.operation_state = v.into();
8560 self
8561 }
8562
8563 /// Sets the value of [progress_documents][crate::model::BulkDeleteDocumentsMetadata::progress_documents].
8564 ///
8565 /// # Example
8566 /// ```ignore,no_run
8567 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8568 /// use google_cloud_firestore_admin_v1::model::Progress;
8569 /// let x = BulkDeleteDocumentsMetadata::new().set_progress_documents(Progress::default()/* use setters */);
8570 /// ```
8571 pub fn set_progress_documents<T>(mut self, v: T) -> Self
8572 where
8573 T: std::convert::Into<crate::model::Progress>,
8574 {
8575 self.progress_documents = std::option::Option::Some(v.into());
8576 self
8577 }
8578
8579 /// Sets or clears the value of [progress_documents][crate::model::BulkDeleteDocumentsMetadata::progress_documents].
8580 ///
8581 /// # Example
8582 /// ```ignore,no_run
8583 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8584 /// use google_cloud_firestore_admin_v1::model::Progress;
8585 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
8586 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_progress_documents(None::<Progress>);
8587 /// ```
8588 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
8589 where
8590 T: std::convert::Into<crate::model::Progress>,
8591 {
8592 self.progress_documents = v.map(|x| x.into());
8593 self
8594 }
8595
8596 /// Sets the value of [progress_bytes][crate::model::BulkDeleteDocumentsMetadata::progress_bytes].
8597 ///
8598 /// # Example
8599 /// ```ignore,no_run
8600 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8601 /// use google_cloud_firestore_admin_v1::model::Progress;
8602 /// let x = BulkDeleteDocumentsMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
8603 /// ```
8604 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
8605 where
8606 T: std::convert::Into<crate::model::Progress>,
8607 {
8608 self.progress_bytes = std::option::Option::Some(v.into());
8609 self
8610 }
8611
8612 /// Sets or clears the value of [progress_bytes][crate::model::BulkDeleteDocumentsMetadata::progress_bytes].
8613 ///
8614 /// # Example
8615 /// ```ignore,no_run
8616 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8617 /// use google_cloud_firestore_admin_v1::model::Progress;
8618 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
8619 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
8620 /// ```
8621 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8622 where
8623 T: std::convert::Into<crate::model::Progress>,
8624 {
8625 self.progress_bytes = v.map(|x| x.into());
8626 self
8627 }
8628
8629 /// Sets the value of [collection_ids][crate::model::BulkDeleteDocumentsMetadata::collection_ids].
8630 ///
8631 /// # Example
8632 /// ```ignore,no_run
8633 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8634 /// let x = BulkDeleteDocumentsMetadata::new().set_collection_ids(["a", "b", "c"]);
8635 /// ```
8636 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
8637 where
8638 T: std::iter::IntoIterator<Item = V>,
8639 V: std::convert::Into<std::string::String>,
8640 {
8641 use std::iter::Iterator;
8642 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
8643 self
8644 }
8645
8646 /// Sets the value of [namespace_ids][crate::model::BulkDeleteDocumentsMetadata::namespace_ids].
8647 ///
8648 /// # Example
8649 /// ```ignore,no_run
8650 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8651 /// let x = BulkDeleteDocumentsMetadata::new().set_namespace_ids(["a", "b", "c"]);
8652 /// ```
8653 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
8654 where
8655 T: std::iter::IntoIterator<Item = V>,
8656 V: std::convert::Into<std::string::String>,
8657 {
8658 use std::iter::Iterator;
8659 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
8660 self
8661 }
8662
8663 /// Sets the value of [snapshot_time][crate::model::BulkDeleteDocumentsMetadata::snapshot_time].
8664 ///
8665 /// # Example
8666 /// ```ignore,no_run
8667 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8668 /// use wkt::Timestamp;
8669 /// let x = BulkDeleteDocumentsMetadata::new().set_snapshot_time(Timestamp::default()/* use setters */);
8670 /// ```
8671 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
8672 where
8673 T: std::convert::Into<wkt::Timestamp>,
8674 {
8675 self.snapshot_time = std::option::Option::Some(v.into());
8676 self
8677 }
8678
8679 /// Sets or clears the value of [snapshot_time][crate::model::BulkDeleteDocumentsMetadata::snapshot_time].
8680 ///
8681 /// # Example
8682 /// ```ignore,no_run
8683 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8684 /// use wkt::Timestamp;
8685 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_snapshot_time(Some(Timestamp::default()/* use setters */));
8686 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_snapshot_time(None::<Timestamp>);
8687 /// ```
8688 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
8689 where
8690 T: std::convert::Into<wkt::Timestamp>,
8691 {
8692 self.snapshot_time = v.map(|x| x.into());
8693 self
8694 }
8695}
8696
8697impl wkt::message::Message for BulkDeleteDocumentsMetadata {
8698 fn typename() -> &'static str {
8699 "type.googleapis.com/google.firestore.admin.v1.BulkDeleteDocumentsMetadata"
8700 }
8701}
8702
8703/// Returned in the [google.longrunning.Operation][google.longrunning.Operation]
8704/// response field.
8705///
8706/// [google.longrunning.Operation]: longrunning::model::Operation
8707#[derive(Clone, Default, PartialEq)]
8708#[non_exhaustive]
8709pub struct ExportDocumentsResponse {
8710 /// Location of the output files. This can be used to begin an import
8711 /// into Cloud Firestore (this project or another project) after the operation
8712 /// completes successfully.
8713 pub output_uri_prefix: std::string::String,
8714
8715 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8716}
8717
8718impl ExportDocumentsResponse {
8719 pub fn new() -> Self {
8720 std::default::Default::default()
8721 }
8722
8723 /// Sets the value of [output_uri_prefix][crate::model::ExportDocumentsResponse::output_uri_prefix].
8724 ///
8725 /// # Example
8726 /// ```ignore,no_run
8727 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsResponse;
8728 /// let x = ExportDocumentsResponse::new().set_output_uri_prefix("example");
8729 /// ```
8730 pub fn set_output_uri_prefix<T: std::convert::Into<std::string::String>>(
8731 mut self,
8732 v: T,
8733 ) -> Self {
8734 self.output_uri_prefix = v.into();
8735 self
8736 }
8737}
8738
8739impl wkt::message::Message for ExportDocumentsResponse {
8740 fn typename() -> &'static str {
8741 "type.googleapis.com/google.firestore.admin.v1.ExportDocumentsResponse"
8742 }
8743}
8744
8745/// Metadata for the [long-running operation][google.longrunning.Operation] from
8746/// the [RestoreDatabase][google.firestore.admin.v1.RestoreDatabase] request.
8747///
8748/// [google.longrunning.Operation]: longrunning::model::Operation
8749#[derive(Clone, Default, PartialEq)]
8750#[non_exhaustive]
8751pub struct RestoreDatabaseMetadata {
8752 /// The time the restore was started.
8753 pub start_time: std::option::Option<wkt::Timestamp>,
8754
8755 /// The time the restore finished, unset for ongoing restores.
8756 pub end_time: std::option::Option<wkt::Timestamp>,
8757
8758 /// The operation state of the restore.
8759 pub operation_state: crate::model::OperationState,
8760
8761 /// The name of the database being restored to.
8762 pub database: std::string::String,
8763
8764 /// The name of the backup restoring from.
8765 pub backup: std::string::String,
8766
8767 /// How far along the restore is as an estimated percentage of remaining time.
8768 pub progress_percentage: std::option::Option<crate::model::Progress>,
8769
8770 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8771}
8772
8773impl RestoreDatabaseMetadata {
8774 pub fn new() -> Self {
8775 std::default::Default::default()
8776 }
8777
8778 /// Sets the value of [start_time][crate::model::RestoreDatabaseMetadata::start_time].
8779 ///
8780 /// # Example
8781 /// ```ignore,no_run
8782 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
8783 /// use wkt::Timestamp;
8784 /// let x = RestoreDatabaseMetadata::new().set_start_time(Timestamp::default()/* use setters */);
8785 /// ```
8786 pub fn set_start_time<T>(mut self, v: T) -> Self
8787 where
8788 T: std::convert::Into<wkt::Timestamp>,
8789 {
8790 self.start_time = std::option::Option::Some(v.into());
8791 self
8792 }
8793
8794 /// Sets or clears the value of [start_time][crate::model::RestoreDatabaseMetadata::start_time].
8795 ///
8796 /// # Example
8797 /// ```ignore,no_run
8798 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
8799 /// use wkt::Timestamp;
8800 /// let x = RestoreDatabaseMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
8801 /// let x = RestoreDatabaseMetadata::new().set_or_clear_start_time(None::<Timestamp>);
8802 /// ```
8803 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8804 where
8805 T: std::convert::Into<wkt::Timestamp>,
8806 {
8807 self.start_time = v.map(|x| x.into());
8808 self
8809 }
8810
8811 /// Sets the value of [end_time][crate::model::RestoreDatabaseMetadata::end_time].
8812 ///
8813 /// # Example
8814 /// ```ignore,no_run
8815 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
8816 /// use wkt::Timestamp;
8817 /// let x = RestoreDatabaseMetadata::new().set_end_time(Timestamp::default()/* use setters */);
8818 /// ```
8819 pub fn set_end_time<T>(mut self, v: T) -> Self
8820 where
8821 T: std::convert::Into<wkt::Timestamp>,
8822 {
8823 self.end_time = std::option::Option::Some(v.into());
8824 self
8825 }
8826
8827 /// Sets or clears the value of [end_time][crate::model::RestoreDatabaseMetadata::end_time].
8828 ///
8829 /// # Example
8830 /// ```ignore,no_run
8831 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
8832 /// use wkt::Timestamp;
8833 /// let x = RestoreDatabaseMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8834 /// let x = RestoreDatabaseMetadata::new().set_or_clear_end_time(None::<Timestamp>);
8835 /// ```
8836 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8837 where
8838 T: std::convert::Into<wkt::Timestamp>,
8839 {
8840 self.end_time = v.map(|x| x.into());
8841 self
8842 }
8843
8844 /// Sets the value of [operation_state][crate::model::RestoreDatabaseMetadata::operation_state].
8845 ///
8846 /// # Example
8847 /// ```ignore,no_run
8848 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
8849 /// use google_cloud_firestore_admin_v1::model::OperationState;
8850 /// let x0 = RestoreDatabaseMetadata::new().set_operation_state(OperationState::Initializing);
8851 /// let x1 = RestoreDatabaseMetadata::new().set_operation_state(OperationState::Processing);
8852 /// let x2 = RestoreDatabaseMetadata::new().set_operation_state(OperationState::Cancelling);
8853 /// ```
8854 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
8855 mut self,
8856 v: T,
8857 ) -> Self {
8858 self.operation_state = v.into();
8859 self
8860 }
8861
8862 /// Sets the value of [database][crate::model::RestoreDatabaseMetadata::database].
8863 ///
8864 /// # Example
8865 /// ```ignore,no_run
8866 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
8867 /// let x = RestoreDatabaseMetadata::new().set_database("example");
8868 /// ```
8869 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8870 self.database = v.into();
8871 self
8872 }
8873
8874 /// Sets the value of [backup][crate::model::RestoreDatabaseMetadata::backup].
8875 ///
8876 /// # Example
8877 /// ```ignore,no_run
8878 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
8879 /// let x = RestoreDatabaseMetadata::new().set_backup("example");
8880 /// ```
8881 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8882 self.backup = v.into();
8883 self
8884 }
8885
8886 /// Sets the value of [progress_percentage][crate::model::RestoreDatabaseMetadata::progress_percentage].
8887 ///
8888 /// # Example
8889 /// ```ignore,no_run
8890 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
8891 /// use google_cloud_firestore_admin_v1::model::Progress;
8892 /// let x = RestoreDatabaseMetadata::new().set_progress_percentage(Progress::default()/* use setters */);
8893 /// ```
8894 pub fn set_progress_percentage<T>(mut self, v: T) -> Self
8895 where
8896 T: std::convert::Into<crate::model::Progress>,
8897 {
8898 self.progress_percentage = std::option::Option::Some(v.into());
8899 self
8900 }
8901
8902 /// Sets or clears the value of [progress_percentage][crate::model::RestoreDatabaseMetadata::progress_percentage].
8903 ///
8904 /// # Example
8905 /// ```ignore,no_run
8906 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
8907 /// use google_cloud_firestore_admin_v1::model::Progress;
8908 /// let x = RestoreDatabaseMetadata::new().set_or_clear_progress_percentage(Some(Progress::default()/* use setters */));
8909 /// let x = RestoreDatabaseMetadata::new().set_or_clear_progress_percentage(None::<Progress>);
8910 /// ```
8911 pub fn set_or_clear_progress_percentage<T>(mut self, v: std::option::Option<T>) -> Self
8912 where
8913 T: std::convert::Into<crate::model::Progress>,
8914 {
8915 self.progress_percentage = v.map(|x| x.into());
8916 self
8917 }
8918}
8919
8920impl wkt::message::Message for RestoreDatabaseMetadata {
8921 fn typename() -> &'static str {
8922 "type.googleapis.com/google.firestore.admin.v1.RestoreDatabaseMetadata"
8923 }
8924}
8925
8926/// Metadata for the [long-running operation][google.longrunning.Operation] from
8927/// the [CloneDatabase][google.firestore.admin.v1.CloneDatabase] request.
8928///
8929/// [google.longrunning.Operation]: longrunning::model::Operation
8930#[derive(Clone, Default, PartialEq)]
8931#[non_exhaustive]
8932pub struct CloneDatabaseMetadata {
8933 /// The time the clone was started.
8934 pub start_time: std::option::Option<wkt::Timestamp>,
8935
8936 /// The time the clone finished, unset for ongoing clones.
8937 pub end_time: std::option::Option<wkt::Timestamp>,
8938
8939 /// The operation state of the clone.
8940 pub operation_state: crate::model::OperationState,
8941
8942 /// The name of the database being cloned to.
8943 pub database: std::string::String,
8944
8945 /// The snapshot from which this database was cloned.
8946 pub pitr_snapshot: std::option::Option<crate::model::PitrSnapshot>,
8947
8948 /// How far along the clone is as an estimated percentage of remaining time.
8949 pub progress_percentage: std::option::Option<crate::model::Progress>,
8950
8951 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8952}
8953
8954impl CloneDatabaseMetadata {
8955 pub fn new() -> Self {
8956 std::default::Default::default()
8957 }
8958
8959 /// Sets the value of [start_time][crate::model::CloneDatabaseMetadata::start_time].
8960 ///
8961 /// # Example
8962 /// ```ignore,no_run
8963 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
8964 /// use wkt::Timestamp;
8965 /// let x = CloneDatabaseMetadata::new().set_start_time(Timestamp::default()/* use setters */);
8966 /// ```
8967 pub fn set_start_time<T>(mut self, v: T) -> Self
8968 where
8969 T: std::convert::Into<wkt::Timestamp>,
8970 {
8971 self.start_time = std::option::Option::Some(v.into());
8972 self
8973 }
8974
8975 /// Sets or clears the value of [start_time][crate::model::CloneDatabaseMetadata::start_time].
8976 ///
8977 /// # Example
8978 /// ```ignore,no_run
8979 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
8980 /// use wkt::Timestamp;
8981 /// let x = CloneDatabaseMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
8982 /// let x = CloneDatabaseMetadata::new().set_or_clear_start_time(None::<Timestamp>);
8983 /// ```
8984 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8985 where
8986 T: std::convert::Into<wkt::Timestamp>,
8987 {
8988 self.start_time = v.map(|x| x.into());
8989 self
8990 }
8991
8992 /// Sets the value of [end_time][crate::model::CloneDatabaseMetadata::end_time].
8993 ///
8994 /// # Example
8995 /// ```ignore,no_run
8996 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
8997 /// use wkt::Timestamp;
8998 /// let x = CloneDatabaseMetadata::new().set_end_time(Timestamp::default()/* use setters */);
8999 /// ```
9000 pub fn set_end_time<T>(mut self, v: T) -> Self
9001 where
9002 T: std::convert::Into<wkt::Timestamp>,
9003 {
9004 self.end_time = std::option::Option::Some(v.into());
9005 self
9006 }
9007
9008 /// Sets or clears the value of [end_time][crate::model::CloneDatabaseMetadata::end_time].
9009 ///
9010 /// # Example
9011 /// ```ignore,no_run
9012 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9013 /// use wkt::Timestamp;
9014 /// let x = CloneDatabaseMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
9015 /// let x = CloneDatabaseMetadata::new().set_or_clear_end_time(None::<Timestamp>);
9016 /// ```
9017 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9018 where
9019 T: std::convert::Into<wkt::Timestamp>,
9020 {
9021 self.end_time = v.map(|x| x.into());
9022 self
9023 }
9024
9025 /// Sets the value of [operation_state][crate::model::CloneDatabaseMetadata::operation_state].
9026 ///
9027 /// # Example
9028 /// ```ignore,no_run
9029 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9030 /// use google_cloud_firestore_admin_v1::model::OperationState;
9031 /// let x0 = CloneDatabaseMetadata::new().set_operation_state(OperationState::Initializing);
9032 /// let x1 = CloneDatabaseMetadata::new().set_operation_state(OperationState::Processing);
9033 /// let x2 = CloneDatabaseMetadata::new().set_operation_state(OperationState::Cancelling);
9034 /// ```
9035 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
9036 mut self,
9037 v: T,
9038 ) -> Self {
9039 self.operation_state = v.into();
9040 self
9041 }
9042
9043 /// Sets the value of [database][crate::model::CloneDatabaseMetadata::database].
9044 ///
9045 /// # Example
9046 /// ```ignore,no_run
9047 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9048 /// let x = CloneDatabaseMetadata::new().set_database("example");
9049 /// ```
9050 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9051 self.database = v.into();
9052 self
9053 }
9054
9055 /// Sets the value of [pitr_snapshot][crate::model::CloneDatabaseMetadata::pitr_snapshot].
9056 ///
9057 /// # Example
9058 /// ```ignore,no_run
9059 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9060 /// use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9061 /// let x = CloneDatabaseMetadata::new().set_pitr_snapshot(PitrSnapshot::default()/* use setters */);
9062 /// ```
9063 pub fn set_pitr_snapshot<T>(mut self, v: T) -> Self
9064 where
9065 T: std::convert::Into<crate::model::PitrSnapshot>,
9066 {
9067 self.pitr_snapshot = std::option::Option::Some(v.into());
9068 self
9069 }
9070
9071 /// Sets or clears the value of [pitr_snapshot][crate::model::CloneDatabaseMetadata::pitr_snapshot].
9072 ///
9073 /// # Example
9074 /// ```ignore,no_run
9075 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9076 /// use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9077 /// let x = CloneDatabaseMetadata::new().set_or_clear_pitr_snapshot(Some(PitrSnapshot::default()/* use setters */));
9078 /// let x = CloneDatabaseMetadata::new().set_or_clear_pitr_snapshot(None::<PitrSnapshot>);
9079 /// ```
9080 pub fn set_or_clear_pitr_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
9081 where
9082 T: std::convert::Into<crate::model::PitrSnapshot>,
9083 {
9084 self.pitr_snapshot = v.map(|x| x.into());
9085 self
9086 }
9087
9088 /// Sets the value of [progress_percentage][crate::model::CloneDatabaseMetadata::progress_percentage].
9089 ///
9090 /// # Example
9091 /// ```ignore,no_run
9092 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9093 /// use google_cloud_firestore_admin_v1::model::Progress;
9094 /// let x = CloneDatabaseMetadata::new().set_progress_percentage(Progress::default()/* use setters */);
9095 /// ```
9096 pub fn set_progress_percentage<T>(mut self, v: T) -> Self
9097 where
9098 T: std::convert::Into<crate::model::Progress>,
9099 {
9100 self.progress_percentage = std::option::Option::Some(v.into());
9101 self
9102 }
9103
9104 /// Sets or clears the value of [progress_percentage][crate::model::CloneDatabaseMetadata::progress_percentage].
9105 ///
9106 /// # Example
9107 /// ```ignore,no_run
9108 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9109 /// use google_cloud_firestore_admin_v1::model::Progress;
9110 /// let x = CloneDatabaseMetadata::new().set_or_clear_progress_percentage(Some(Progress::default()/* use setters */));
9111 /// let x = CloneDatabaseMetadata::new().set_or_clear_progress_percentage(None::<Progress>);
9112 /// ```
9113 pub fn set_or_clear_progress_percentage<T>(mut self, v: std::option::Option<T>) -> Self
9114 where
9115 T: std::convert::Into<crate::model::Progress>,
9116 {
9117 self.progress_percentage = v.map(|x| x.into());
9118 self
9119 }
9120}
9121
9122impl wkt::message::Message for CloneDatabaseMetadata {
9123 fn typename() -> &'static str {
9124 "type.googleapis.com/google.firestore.admin.v1.CloneDatabaseMetadata"
9125 }
9126}
9127
9128/// Describes the progress of the operation.
9129/// Unit of work is generic and must be interpreted based on where
9130/// [Progress][google.firestore.admin.v1.Progress] is used.
9131///
9132/// [google.firestore.admin.v1.Progress]: crate::model::Progress
9133#[derive(Clone, Default, PartialEq)]
9134#[non_exhaustive]
9135pub struct Progress {
9136 /// The amount of work estimated.
9137 pub estimated_work: i64,
9138
9139 /// The amount of work completed.
9140 pub completed_work: i64,
9141
9142 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9143}
9144
9145impl Progress {
9146 pub fn new() -> Self {
9147 std::default::Default::default()
9148 }
9149
9150 /// Sets the value of [estimated_work][crate::model::Progress::estimated_work].
9151 ///
9152 /// # Example
9153 /// ```ignore,no_run
9154 /// # use google_cloud_firestore_admin_v1::model::Progress;
9155 /// let x = Progress::new().set_estimated_work(42);
9156 /// ```
9157 pub fn set_estimated_work<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9158 self.estimated_work = v.into();
9159 self
9160 }
9161
9162 /// Sets the value of [completed_work][crate::model::Progress::completed_work].
9163 ///
9164 /// # Example
9165 /// ```ignore,no_run
9166 /// # use google_cloud_firestore_admin_v1::model::Progress;
9167 /// let x = Progress::new().set_completed_work(42);
9168 /// ```
9169 pub fn set_completed_work<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9170 self.completed_work = v.into();
9171 self
9172 }
9173}
9174
9175impl wkt::message::Message for Progress {
9176 fn typename() -> &'static str {
9177 "type.googleapis.com/google.firestore.admin.v1.Progress"
9178 }
9179}
9180
9181/// A backup schedule for a Cloud Firestore Database.
9182///
9183/// This resource is owned by the database it is backing up, and is deleted along
9184/// with the database. The actual backups are not though.
9185#[derive(Clone, Default, PartialEq)]
9186#[non_exhaustive]
9187pub struct BackupSchedule {
9188 /// Output only. The unique backup schedule identifier across all locations and
9189 /// databases for the given project.
9190 ///
9191 /// This will be auto-assigned.
9192 ///
9193 /// Format is
9194 /// `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
9195 pub name: std::string::String,
9196
9197 /// Output only. The timestamp at which this backup schedule was created and
9198 /// effective since.
9199 ///
9200 /// No backups will be created for this schedule before this time.
9201 pub create_time: std::option::Option<wkt::Timestamp>,
9202
9203 /// Output only. The timestamp at which this backup schedule was most recently
9204 /// updated. When a backup schedule is first created, this is the same as
9205 /// create_time.
9206 pub update_time: std::option::Option<wkt::Timestamp>,
9207
9208 /// At what relative time in the future, compared to its creation time,
9209 /// the backup should be deleted, e.g. keep backups for 7 days.
9210 ///
9211 /// The maximum supported retention period is 14 weeks.
9212 pub retention: std::option::Option<wkt::Duration>,
9213
9214 /// A oneof field to represent when backups will be taken.
9215 pub recurrence: std::option::Option<crate::model::backup_schedule::Recurrence>,
9216
9217 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9218}
9219
9220impl BackupSchedule {
9221 pub fn new() -> Self {
9222 std::default::Default::default()
9223 }
9224
9225 /// Sets the value of [name][crate::model::BackupSchedule::name].
9226 ///
9227 /// # Example
9228 /// ```ignore,no_run
9229 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9230 /// let x = BackupSchedule::new().set_name("example");
9231 /// ```
9232 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9233 self.name = v.into();
9234 self
9235 }
9236
9237 /// Sets the value of [create_time][crate::model::BackupSchedule::create_time].
9238 ///
9239 /// # Example
9240 /// ```ignore,no_run
9241 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9242 /// use wkt::Timestamp;
9243 /// let x = BackupSchedule::new().set_create_time(Timestamp::default()/* use setters */);
9244 /// ```
9245 pub fn set_create_time<T>(mut self, v: T) -> Self
9246 where
9247 T: std::convert::Into<wkt::Timestamp>,
9248 {
9249 self.create_time = std::option::Option::Some(v.into());
9250 self
9251 }
9252
9253 /// Sets or clears the value of [create_time][crate::model::BackupSchedule::create_time].
9254 ///
9255 /// # Example
9256 /// ```ignore,no_run
9257 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9258 /// use wkt::Timestamp;
9259 /// let x = BackupSchedule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9260 /// let x = BackupSchedule::new().set_or_clear_create_time(None::<Timestamp>);
9261 /// ```
9262 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9263 where
9264 T: std::convert::Into<wkt::Timestamp>,
9265 {
9266 self.create_time = v.map(|x| x.into());
9267 self
9268 }
9269
9270 /// Sets the value of [update_time][crate::model::BackupSchedule::update_time].
9271 ///
9272 /// # Example
9273 /// ```ignore,no_run
9274 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9275 /// use wkt::Timestamp;
9276 /// let x = BackupSchedule::new().set_update_time(Timestamp::default()/* use setters */);
9277 /// ```
9278 pub fn set_update_time<T>(mut self, v: T) -> Self
9279 where
9280 T: std::convert::Into<wkt::Timestamp>,
9281 {
9282 self.update_time = std::option::Option::Some(v.into());
9283 self
9284 }
9285
9286 /// Sets or clears the value of [update_time][crate::model::BackupSchedule::update_time].
9287 ///
9288 /// # Example
9289 /// ```ignore,no_run
9290 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9291 /// use wkt::Timestamp;
9292 /// let x = BackupSchedule::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9293 /// let x = BackupSchedule::new().set_or_clear_update_time(None::<Timestamp>);
9294 /// ```
9295 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9296 where
9297 T: std::convert::Into<wkt::Timestamp>,
9298 {
9299 self.update_time = v.map(|x| x.into());
9300 self
9301 }
9302
9303 /// Sets the value of [retention][crate::model::BackupSchedule::retention].
9304 ///
9305 /// # Example
9306 /// ```ignore,no_run
9307 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9308 /// use wkt::Duration;
9309 /// let x = BackupSchedule::new().set_retention(Duration::default()/* use setters */);
9310 /// ```
9311 pub fn set_retention<T>(mut self, v: T) -> Self
9312 where
9313 T: std::convert::Into<wkt::Duration>,
9314 {
9315 self.retention = std::option::Option::Some(v.into());
9316 self
9317 }
9318
9319 /// Sets or clears the value of [retention][crate::model::BackupSchedule::retention].
9320 ///
9321 /// # Example
9322 /// ```ignore,no_run
9323 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9324 /// use wkt::Duration;
9325 /// let x = BackupSchedule::new().set_or_clear_retention(Some(Duration::default()/* use setters */));
9326 /// let x = BackupSchedule::new().set_or_clear_retention(None::<Duration>);
9327 /// ```
9328 pub fn set_or_clear_retention<T>(mut self, v: std::option::Option<T>) -> Self
9329 where
9330 T: std::convert::Into<wkt::Duration>,
9331 {
9332 self.retention = v.map(|x| x.into());
9333 self
9334 }
9335
9336 /// Sets the value of [recurrence][crate::model::BackupSchedule::recurrence].
9337 ///
9338 /// Note that all the setters affecting `recurrence` are mutually
9339 /// exclusive.
9340 ///
9341 /// # Example
9342 /// ```ignore,no_run
9343 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9344 /// use google_cloud_firestore_admin_v1::model::DailyRecurrence;
9345 /// let x = BackupSchedule::new().set_recurrence(Some(
9346 /// google_cloud_firestore_admin_v1::model::backup_schedule::Recurrence::DailyRecurrence(DailyRecurrence::default().into())));
9347 /// ```
9348 pub fn set_recurrence<
9349 T: std::convert::Into<std::option::Option<crate::model::backup_schedule::Recurrence>>,
9350 >(
9351 mut self,
9352 v: T,
9353 ) -> Self {
9354 self.recurrence = v.into();
9355 self
9356 }
9357
9358 /// The value of [recurrence][crate::model::BackupSchedule::recurrence]
9359 /// if it holds a `DailyRecurrence`, `None` if the field is not set or
9360 /// holds a different branch.
9361 pub fn daily_recurrence(
9362 &self,
9363 ) -> std::option::Option<&std::boxed::Box<crate::model::DailyRecurrence>> {
9364 #[allow(unreachable_patterns)]
9365 self.recurrence.as_ref().and_then(|v| match v {
9366 crate::model::backup_schedule::Recurrence::DailyRecurrence(v) => {
9367 std::option::Option::Some(v)
9368 }
9369 _ => std::option::Option::None,
9370 })
9371 }
9372
9373 /// Sets the value of [recurrence][crate::model::BackupSchedule::recurrence]
9374 /// to hold a `DailyRecurrence`.
9375 ///
9376 /// Note that all the setters affecting `recurrence` are
9377 /// mutually exclusive.
9378 ///
9379 /// # Example
9380 /// ```ignore,no_run
9381 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9382 /// use google_cloud_firestore_admin_v1::model::DailyRecurrence;
9383 /// let x = BackupSchedule::new().set_daily_recurrence(DailyRecurrence::default()/* use setters */);
9384 /// assert!(x.daily_recurrence().is_some());
9385 /// assert!(x.weekly_recurrence().is_none());
9386 /// ```
9387 pub fn set_daily_recurrence<
9388 T: std::convert::Into<std::boxed::Box<crate::model::DailyRecurrence>>,
9389 >(
9390 mut self,
9391 v: T,
9392 ) -> Self {
9393 self.recurrence = std::option::Option::Some(
9394 crate::model::backup_schedule::Recurrence::DailyRecurrence(v.into()),
9395 );
9396 self
9397 }
9398
9399 /// The value of [recurrence][crate::model::BackupSchedule::recurrence]
9400 /// if it holds a `WeeklyRecurrence`, `None` if the field is not set or
9401 /// holds a different branch.
9402 pub fn weekly_recurrence(
9403 &self,
9404 ) -> std::option::Option<&std::boxed::Box<crate::model::WeeklyRecurrence>> {
9405 #[allow(unreachable_patterns)]
9406 self.recurrence.as_ref().and_then(|v| match v {
9407 crate::model::backup_schedule::Recurrence::WeeklyRecurrence(v) => {
9408 std::option::Option::Some(v)
9409 }
9410 _ => std::option::Option::None,
9411 })
9412 }
9413
9414 /// Sets the value of [recurrence][crate::model::BackupSchedule::recurrence]
9415 /// to hold a `WeeklyRecurrence`.
9416 ///
9417 /// Note that all the setters affecting `recurrence` are
9418 /// mutually exclusive.
9419 ///
9420 /// # Example
9421 /// ```ignore,no_run
9422 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9423 /// use google_cloud_firestore_admin_v1::model::WeeklyRecurrence;
9424 /// let x = BackupSchedule::new().set_weekly_recurrence(WeeklyRecurrence::default()/* use setters */);
9425 /// assert!(x.weekly_recurrence().is_some());
9426 /// assert!(x.daily_recurrence().is_none());
9427 /// ```
9428 pub fn set_weekly_recurrence<
9429 T: std::convert::Into<std::boxed::Box<crate::model::WeeklyRecurrence>>,
9430 >(
9431 mut self,
9432 v: T,
9433 ) -> Self {
9434 self.recurrence = std::option::Option::Some(
9435 crate::model::backup_schedule::Recurrence::WeeklyRecurrence(v.into()),
9436 );
9437 self
9438 }
9439}
9440
9441impl wkt::message::Message for BackupSchedule {
9442 fn typename() -> &'static str {
9443 "type.googleapis.com/google.firestore.admin.v1.BackupSchedule"
9444 }
9445}
9446
9447/// Defines additional types related to [BackupSchedule].
9448pub mod backup_schedule {
9449 #[allow(unused_imports)]
9450 use super::*;
9451
9452 /// A oneof field to represent when backups will be taken.
9453 #[derive(Clone, Debug, PartialEq)]
9454 #[non_exhaustive]
9455 pub enum Recurrence {
9456 /// For a schedule that runs daily.
9457 DailyRecurrence(std::boxed::Box<crate::model::DailyRecurrence>),
9458 /// For a schedule that runs weekly on a specific day.
9459 WeeklyRecurrence(std::boxed::Box<crate::model::WeeklyRecurrence>),
9460 }
9461}
9462
9463/// Represents a recurring schedule that runs every day.
9464///
9465/// The time zone is UTC.
9466#[derive(Clone, Default, PartialEq)]
9467#[non_exhaustive]
9468pub struct DailyRecurrence {
9469 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9470}
9471
9472impl DailyRecurrence {
9473 pub fn new() -> Self {
9474 std::default::Default::default()
9475 }
9476}
9477
9478impl wkt::message::Message for DailyRecurrence {
9479 fn typename() -> &'static str {
9480 "type.googleapis.com/google.firestore.admin.v1.DailyRecurrence"
9481 }
9482}
9483
9484/// Represents a recurring schedule that runs on a specified day of the week.
9485///
9486/// The time zone is UTC.
9487#[derive(Clone, Default, PartialEq)]
9488#[non_exhaustive]
9489pub struct WeeklyRecurrence {
9490 /// The day of week to run.
9491 ///
9492 /// DAY_OF_WEEK_UNSPECIFIED is not allowed.
9493 pub day: gtype::model::DayOfWeek,
9494
9495 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9496}
9497
9498impl WeeklyRecurrence {
9499 pub fn new() -> Self {
9500 std::default::Default::default()
9501 }
9502
9503 /// Sets the value of [day][crate::model::WeeklyRecurrence::day].
9504 ///
9505 /// # Example
9506 /// ```ignore,no_run
9507 /// # use google_cloud_firestore_admin_v1::model::WeeklyRecurrence;
9508 /// use gtype::model::DayOfWeek;
9509 /// let x0 = WeeklyRecurrence::new().set_day(DayOfWeek::Monday);
9510 /// let x1 = WeeklyRecurrence::new().set_day(DayOfWeek::Tuesday);
9511 /// let x2 = WeeklyRecurrence::new().set_day(DayOfWeek::Wednesday);
9512 /// ```
9513 pub fn set_day<T: std::convert::Into<gtype::model::DayOfWeek>>(mut self, v: T) -> Self {
9514 self.day = v.into();
9515 self
9516 }
9517}
9518
9519impl wkt::message::Message for WeeklyRecurrence {
9520 fn typename() -> &'static str {
9521 "type.googleapis.com/google.firestore.admin.v1.WeeklyRecurrence"
9522 }
9523}
9524
9525/// A consistent snapshot of a database at a specific point in time.
9526/// A PITR (Point-in-time recovery) snapshot with previous versions of a
9527/// database's data is available for every minute up to the associated database's
9528/// data retention period. If the PITR feature is enabled, the retention period
9529/// is 7 days; otherwise, it is one hour.
9530#[derive(Clone, Default, PartialEq)]
9531#[non_exhaustive]
9532pub struct PitrSnapshot {
9533 /// Required. The name of the database that this was a snapshot of. Format:
9534 /// `projects/{project}/databases/{database}`.
9535 pub database: std::string::String,
9536
9537 /// Output only. Public UUID of the database the snapshot was associated with.
9538 pub database_uid: ::bytes::Bytes,
9539
9540 /// Required. Snapshot time of the database.
9541 pub snapshot_time: std::option::Option<wkt::Timestamp>,
9542
9543 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9544}
9545
9546impl PitrSnapshot {
9547 pub fn new() -> Self {
9548 std::default::Default::default()
9549 }
9550
9551 /// Sets the value of [database][crate::model::PitrSnapshot::database].
9552 ///
9553 /// # Example
9554 /// ```ignore,no_run
9555 /// # use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9556 /// let x = PitrSnapshot::new().set_database("example");
9557 /// ```
9558 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9559 self.database = v.into();
9560 self
9561 }
9562
9563 /// Sets the value of [database_uid][crate::model::PitrSnapshot::database_uid].
9564 ///
9565 /// # Example
9566 /// ```ignore,no_run
9567 /// # use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9568 /// let x = PitrSnapshot::new().set_database_uid(bytes::Bytes::from_static(b"example"));
9569 /// ```
9570 pub fn set_database_uid<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
9571 self.database_uid = v.into();
9572 self
9573 }
9574
9575 /// Sets the value of [snapshot_time][crate::model::PitrSnapshot::snapshot_time].
9576 ///
9577 /// # Example
9578 /// ```ignore,no_run
9579 /// # use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9580 /// use wkt::Timestamp;
9581 /// let x = PitrSnapshot::new().set_snapshot_time(Timestamp::default()/* use setters */);
9582 /// ```
9583 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
9584 where
9585 T: std::convert::Into<wkt::Timestamp>,
9586 {
9587 self.snapshot_time = std::option::Option::Some(v.into());
9588 self
9589 }
9590
9591 /// Sets or clears the value of [snapshot_time][crate::model::PitrSnapshot::snapshot_time].
9592 ///
9593 /// # Example
9594 /// ```ignore,no_run
9595 /// # use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9596 /// use wkt::Timestamp;
9597 /// let x = PitrSnapshot::new().set_or_clear_snapshot_time(Some(Timestamp::default()/* use setters */));
9598 /// let x = PitrSnapshot::new().set_or_clear_snapshot_time(None::<Timestamp>);
9599 /// ```
9600 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
9601 where
9602 T: std::convert::Into<wkt::Timestamp>,
9603 {
9604 self.snapshot_time = v.map(|x| x.into());
9605 self
9606 }
9607}
9608
9609impl wkt::message::Message for PitrSnapshot {
9610 fn typename() -> &'static str {
9611 "type.googleapis.com/google.firestore.admin.v1.PitrSnapshot"
9612 }
9613}
9614
9615/// A Cloud Firestore User Creds.
9616#[derive(Clone, Default, PartialEq)]
9617#[non_exhaustive]
9618pub struct UserCreds {
9619 /// Identifier. The resource name of the UserCreds.
9620 /// Format:
9621 /// `projects/{project}/databases/{database}/userCreds/{user_creds}`
9622 pub name: std::string::String,
9623
9624 /// Output only. The time the user creds were created.
9625 pub create_time: std::option::Option<wkt::Timestamp>,
9626
9627 /// Output only. The time the user creds were last updated.
9628 pub update_time: std::option::Option<wkt::Timestamp>,
9629
9630 /// Output only. Whether the user creds are enabled or disabled. Defaults to
9631 /// ENABLED on creation.
9632 pub state: crate::model::user_creds::State,
9633
9634 /// Output only. The plaintext server-generated password for the user creds.
9635 /// Only populated in responses for CreateUserCreds and ResetUserPassword.
9636 pub secure_password: std::string::String,
9637
9638 /// Identity associated with this User Creds.
9639 pub user_creds_identity: std::option::Option<crate::model::user_creds::UserCredsIdentity>,
9640
9641 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9642}
9643
9644impl UserCreds {
9645 pub fn new() -> Self {
9646 std::default::Default::default()
9647 }
9648
9649 /// Sets the value of [name][crate::model::UserCreds::name].
9650 ///
9651 /// # Example
9652 /// ```ignore,no_run
9653 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
9654 /// let x = UserCreds::new().set_name("example");
9655 /// ```
9656 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9657 self.name = v.into();
9658 self
9659 }
9660
9661 /// Sets the value of [create_time][crate::model::UserCreds::create_time].
9662 ///
9663 /// # Example
9664 /// ```ignore,no_run
9665 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
9666 /// use wkt::Timestamp;
9667 /// let x = UserCreds::new().set_create_time(Timestamp::default()/* use setters */);
9668 /// ```
9669 pub fn set_create_time<T>(mut self, v: T) -> Self
9670 where
9671 T: std::convert::Into<wkt::Timestamp>,
9672 {
9673 self.create_time = std::option::Option::Some(v.into());
9674 self
9675 }
9676
9677 /// Sets or clears the value of [create_time][crate::model::UserCreds::create_time].
9678 ///
9679 /// # Example
9680 /// ```ignore,no_run
9681 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
9682 /// use wkt::Timestamp;
9683 /// let x = UserCreds::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9684 /// let x = UserCreds::new().set_or_clear_create_time(None::<Timestamp>);
9685 /// ```
9686 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9687 where
9688 T: std::convert::Into<wkt::Timestamp>,
9689 {
9690 self.create_time = v.map(|x| x.into());
9691 self
9692 }
9693
9694 /// Sets the value of [update_time][crate::model::UserCreds::update_time].
9695 ///
9696 /// # Example
9697 /// ```ignore,no_run
9698 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
9699 /// use wkt::Timestamp;
9700 /// let x = UserCreds::new().set_update_time(Timestamp::default()/* use setters */);
9701 /// ```
9702 pub fn set_update_time<T>(mut self, v: T) -> Self
9703 where
9704 T: std::convert::Into<wkt::Timestamp>,
9705 {
9706 self.update_time = std::option::Option::Some(v.into());
9707 self
9708 }
9709
9710 /// Sets or clears the value of [update_time][crate::model::UserCreds::update_time].
9711 ///
9712 /// # Example
9713 /// ```ignore,no_run
9714 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
9715 /// use wkt::Timestamp;
9716 /// let x = UserCreds::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9717 /// let x = UserCreds::new().set_or_clear_update_time(None::<Timestamp>);
9718 /// ```
9719 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9720 where
9721 T: std::convert::Into<wkt::Timestamp>,
9722 {
9723 self.update_time = v.map(|x| x.into());
9724 self
9725 }
9726
9727 /// Sets the value of [state][crate::model::UserCreds::state].
9728 ///
9729 /// # Example
9730 /// ```ignore,no_run
9731 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
9732 /// use google_cloud_firestore_admin_v1::model::user_creds::State;
9733 /// let x0 = UserCreds::new().set_state(State::Enabled);
9734 /// let x1 = UserCreds::new().set_state(State::Disabled);
9735 /// ```
9736 pub fn set_state<T: std::convert::Into<crate::model::user_creds::State>>(
9737 mut self,
9738 v: T,
9739 ) -> Self {
9740 self.state = v.into();
9741 self
9742 }
9743
9744 /// Sets the value of [secure_password][crate::model::UserCreds::secure_password].
9745 ///
9746 /// # Example
9747 /// ```ignore,no_run
9748 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
9749 /// let x = UserCreds::new().set_secure_password("example");
9750 /// ```
9751 pub fn set_secure_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9752 self.secure_password = v.into();
9753 self
9754 }
9755
9756 /// Sets the value of [user_creds_identity][crate::model::UserCreds::user_creds_identity].
9757 ///
9758 /// Note that all the setters affecting `user_creds_identity` are mutually
9759 /// exclusive.
9760 ///
9761 /// # Example
9762 /// ```ignore,no_run
9763 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
9764 /// use google_cloud_firestore_admin_v1::model::user_creds::ResourceIdentity;
9765 /// let x = UserCreds::new().set_user_creds_identity(Some(
9766 /// google_cloud_firestore_admin_v1::model::user_creds::UserCredsIdentity::ResourceIdentity(ResourceIdentity::default().into())));
9767 /// ```
9768 pub fn set_user_creds_identity<
9769 T: std::convert::Into<std::option::Option<crate::model::user_creds::UserCredsIdentity>>,
9770 >(
9771 mut self,
9772 v: T,
9773 ) -> Self {
9774 self.user_creds_identity = v.into();
9775 self
9776 }
9777
9778 /// The value of [user_creds_identity][crate::model::UserCreds::user_creds_identity]
9779 /// if it holds a `ResourceIdentity`, `None` if the field is not set or
9780 /// holds a different branch.
9781 pub fn resource_identity(
9782 &self,
9783 ) -> std::option::Option<&std::boxed::Box<crate::model::user_creds::ResourceIdentity>> {
9784 #[allow(unreachable_patterns)]
9785 self.user_creds_identity.as_ref().and_then(|v| match v {
9786 crate::model::user_creds::UserCredsIdentity::ResourceIdentity(v) => {
9787 std::option::Option::Some(v)
9788 }
9789 _ => std::option::Option::None,
9790 })
9791 }
9792
9793 /// Sets the value of [user_creds_identity][crate::model::UserCreds::user_creds_identity]
9794 /// to hold a `ResourceIdentity`.
9795 ///
9796 /// Note that all the setters affecting `user_creds_identity` are
9797 /// mutually exclusive.
9798 ///
9799 /// # Example
9800 /// ```ignore,no_run
9801 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
9802 /// use google_cloud_firestore_admin_v1::model::user_creds::ResourceIdentity;
9803 /// let x = UserCreds::new().set_resource_identity(ResourceIdentity::default()/* use setters */);
9804 /// assert!(x.resource_identity().is_some());
9805 /// ```
9806 pub fn set_resource_identity<
9807 T: std::convert::Into<std::boxed::Box<crate::model::user_creds::ResourceIdentity>>,
9808 >(
9809 mut self,
9810 v: T,
9811 ) -> Self {
9812 self.user_creds_identity = std::option::Option::Some(
9813 crate::model::user_creds::UserCredsIdentity::ResourceIdentity(v.into()),
9814 );
9815 self
9816 }
9817}
9818
9819impl wkt::message::Message for UserCreds {
9820 fn typename() -> &'static str {
9821 "type.googleapis.com/google.firestore.admin.v1.UserCreds"
9822 }
9823}
9824
9825/// Defines additional types related to [UserCreds].
9826pub mod user_creds {
9827 #[allow(unused_imports)]
9828 use super::*;
9829
9830 /// Describes a Resource Identity principal.
9831 #[derive(Clone, Default, PartialEq)]
9832 #[non_exhaustive]
9833 pub struct ResourceIdentity {
9834 /// Output only. Principal identifier string.
9835 /// See: <https://cloud.google.com/iam/docs/principal-identifiers>
9836 pub principal: std::string::String,
9837
9838 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9839 }
9840
9841 impl ResourceIdentity {
9842 pub fn new() -> Self {
9843 std::default::Default::default()
9844 }
9845
9846 /// Sets the value of [principal][crate::model::user_creds::ResourceIdentity::principal].
9847 ///
9848 /// # Example
9849 /// ```ignore,no_run
9850 /// # use google_cloud_firestore_admin_v1::model::user_creds::ResourceIdentity;
9851 /// let x = ResourceIdentity::new().set_principal("example");
9852 /// ```
9853 pub fn set_principal<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9854 self.principal = v.into();
9855 self
9856 }
9857 }
9858
9859 impl wkt::message::Message for ResourceIdentity {
9860 fn typename() -> &'static str {
9861 "type.googleapis.com/google.firestore.admin.v1.UserCreds.ResourceIdentity"
9862 }
9863 }
9864
9865 /// The state of the user creds (ENABLED or DISABLED).
9866 ///
9867 /// # Working with unknown values
9868 ///
9869 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9870 /// additional enum variants at any time. Adding new variants is not considered
9871 /// a breaking change. Applications should write their code in anticipation of:
9872 ///
9873 /// - New values appearing in future releases of the client library, **and**
9874 /// - New values received dynamically, without application changes.
9875 ///
9876 /// Please consult the [Working with enums] section in the user guide for some
9877 /// guidelines.
9878 ///
9879 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9880 #[derive(Clone, Debug, PartialEq)]
9881 #[non_exhaustive]
9882 pub enum State {
9883 /// The default value. Should not be used.
9884 Unspecified,
9885 /// The user creds are enabled.
9886 Enabled,
9887 /// The user creds are disabled.
9888 Disabled,
9889 /// If set, the enum was initialized with an unknown value.
9890 ///
9891 /// Applications can examine the value using [State::value] or
9892 /// [State::name].
9893 UnknownValue(state::UnknownValue),
9894 }
9895
9896 #[doc(hidden)]
9897 pub mod state {
9898 #[allow(unused_imports)]
9899 use super::*;
9900 #[derive(Clone, Debug, PartialEq)]
9901 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9902 }
9903
9904 impl State {
9905 /// Gets the enum value.
9906 ///
9907 /// Returns `None` if the enum contains an unknown value deserialized from
9908 /// the string representation of enums.
9909 pub fn value(&self) -> std::option::Option<i32> {
9910 match self {
9911 Self::Unspecified => std::option::Option::Some(0),
9912 Self::Enabled => std::option::Option::Some(1),
9913 Self::Disabled => std::option::Option::Some(2),
9914 Self::UnknownValue(u) => u.0.value(),
9915 }
9916 }
9917
9918 /// Gets the enum value as a string.
9919 ///
9920 /// Returns `None` if the enum contains an unknown value deserialized from
9921 /// the integer representation of enums.
9922 pub fn name(&self) -> std::option::Option<&str> {
9923 match self {
9924 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9925 Self::Enabled => std::option::Option::Some("ENABLED"),
9926 Self::Disabled => std::option::Option::Some("DISABLED"),
9927 Self::UnknownValue(u) => u.0.name(),
9928 }
9929 }
9930 }
9931
9932 impl std::default::Default for State {
9933 fn default() -> Self {
9934 use std::convert::From;
9935 Self::from(0)
9936 }
9937 }
9938
9939 impl std::fmt::Display for State {
9940 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9941 wkt::internal::display_enum(f, self.name(), self.value())
9942 }
9943 }
9944
9945 impl std::convert::From<i32> for State {
9946 fn from(value: i32) -> Self {
9947 match value {
9948 0 => Self::Unspecified,
9949 1 => Self::Enabled,
9950 2 => Self::Disabled,
9951 _ => Self::UnknownValue(state::UnknownValue(
9952 wkt::internal::UnknownEnumValue::Integer(value),
9953 )),
9954 }
9955 }
9956 }
9957
9958 impl std::convert::From<&str> for State {
9959 fn from(value: &str) -> Self {
9960 use std::string::ToString;
9961 match value {
9962 "STATE_UNSPECIFIED" => Self::Unspecified,
9963 "ENABLED" => Self::Enabled,
9964 "DISABLED" => Self::Disabled,
9965 _ => Self::UnknownValue(state::UnknownValue(
9966 wkt::internal::UnknownEnumValue::String(value.to_string()),
9967 )),
9968 }
9969 }
9970 }
9971
9972 impl serde::ser::Serialize for State {
9973 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9974 where
9975 S: serde::Serializer,
9976 {
9977 match self {
9978 Self::Unspecified => serializer.serialize_i32(0),
9979 Self::Enabled => serializer.serialize_i32(1),
9980 Self::Disabled => serializer.serialize_i32(2),
9981 Self::UnknownValue(u) => u.0.serialize(serializer),
9982 }
9983 }
9984 }
9985
9986 impl<'de> serde::de::Deserialize<'de> for State {
9987 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9988 where
9989 D: serde::Deserializer<'de>,
9990 {
9991 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9992 ".google.firestore.admin.v1.UserCreds.State",
9993 ))
9994 }
9995 }
9996
9997 /// Identity associated with this User Creds.
9998 #[derive(Clone, Debug, PartialEq)]
9999 #[non_exhaustive]
10000 pub enum UserCredsIdentity {
10001 /// Resource Identity descriptor.
10002 ResourceIdentity(std::boxed::Box<crate::model::user_creds::ResourceIdentity>),
10003 }
10004}
10005
10006/// Describes the state of the operation.
10007///
10008/// # Working with unknown values
10009///
10010/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10011/// additional enum variants at any time. Adding new variants is not considered
10012/// a breaking change. Applications should write their code in anticipation of:
10013///
10014/// - New values appearing in future releases of the client library, **and**
10015/// - New values received dynamically, without application changes.
10016///
10017/// Please consult the [Working with enums] section in the user guide for some
10018/// guidelines.
10019///
10020/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10021#[derive(Clone, Debug, PartialEq)]
10022#[non_exhaustive]
10023pub enum OperationState {
10024 /// Unspecified.
10025 Unspecified,
10026 /// Request is being prepared for processing.
10027 Initializing,
10028 /// Request is actively being processed.
10029 Processing,
10030 /// Request is in the process of being cancelled after user called
10031 /// google.longrunning.Operations.CancelOperation on the operation.
10032 Cancelling,
10033 /// Request has been processed and is in its finalization stage.
10034 Finalizing,
10035 /// Request has completed successfully.
10036 Successful,
10037 /// Request has finished being processed, but encountered an error.
10038 Failed,
10039 /// Request has finished being cancelled after user called
10040 /// google.longrunning.Operations.CancelOperation.
10041 Cancelled,
10042 /// If set, the enum was initialized with an unknown value.
10043 ///
10044 /// Applications can examine the value using [OperationState::value] or
10045 /// [OperationState::name].
10046 UnknownValue(operation_state::UnknownValue),
10047}
10048
10049#[doc(hidden)]
10050pub mod operation_state {
10051 #[allow(unused_imports)]
10052 use super::*;
10053 #[derive(Clone, Debug, PartialEq)]
10054 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10055}
10056
10057impl OperationState {
10058 /// Gets the enum value.
10059 ///
10060 /// Returns `None` if the enum contains an unknown value deserialized from
10061 /// the string representation of enums.
10062 pub fn value(&self) -> std::option::Option<i32> {
10063 match self {
10064 Self::Unspecified => std::option::Option::Some(0),
10065 Self::Initializing => std::option::Option::Some(1),
10066 Self::Processing => std::option::Option::Some(2),
10067 Self::Cancelling => std::option::Option::Some(3),
10068 Self::Finalizing => std::option::Option::Some(4),
10069 Self::Successful => std::option::Option::Some(5),
10070 Self::Failed => std::option::Option::Some(6),
10071 Self::Cancelled => std::option::Option::Some(7),
10072 Self::UnknownValue(u) => u.0.value(),
10073 }
10074 }
10075
10076 /// Gets the enum value as a string.
10077 ///
10078 /// Returns `None` if the enum contains an unknown value deserialized from
10079 /// the integer representation of enums.
10080 pub fn name(&self) -> std::option::Option<&str> {
10081 match self {
10082 Self::Unspecified => std::option::Option::Some("OPERATION_STATE_UNSPECIFIED"),
10083 Self::Initializing => std::option::Option::Some("INITIALIZING"),
10084 Self::Processing => std::option::Option::Some("PROCESSING"),
10085 Self::Cancelling => std::option::Option::Some("CANCELLING"),
10086 Self::Finalizing => std::option::Option::Some("FINALIZING"),
10087 Self::Successful => std::option::Option::Some("SUCCESSFUL"),
10088 Self::Failed => std::option::Option::Some("FAILED"),
10089 Self::Cancelled => std::option::Option::Some("CANCELLED"),
10090 Self::UnknownValue(u) => u.0.name(),
10091 }
10092 }
10093}
10094
10095impl std::default::Default for OperationState {
10096 fn default() -> Self {
10097 use std::convert::From;
10098 Self::from(0)
10099 }
10100}
10101
10102impl std::fmt::Display for OperationState {
10103 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10104 wkt::internal::display_enum(f, self.name(), self.value())
10105 }
10106}
10107
10108impl std::convert::From<i32> for OperationState {
10109 fn from(value: i32) -> Self {
10110 match value {
10111 0 => Self::Unspecified,
10112 1 => Self::Initializing,
10113 2 => Self::Processing,
10114 3 => Self::Cancelling,
10115 4 => Self::Finalizing,
10116 5 => Self::Successful,
10117 6 => Self::Failed,
10118 7 => Self::Cancelled,
10119 _ => Self::UnknownValue(operation_state::UnknownValue(
10120 wkt::internal::UnknownEnumValue::Integer(value),
10121 )),
10122 }
10123 }
10124}
10125
10126impl std::convert::From<&str> for OperationState {
10127 fn from(value: &str) -> Self {
10128 use std::string::ToString;
10129 match value {
10130 "OPERATION_STATE_UNSPECIFIED" => Self::Unspecified,
10131 "INITIALIZING" => Self::Initializing,
10132 "PROCESSING" => Self::Processing,
10133 "CANCELLING" => Self::Cancelling,
10134 "FINALIZING" => Self::Finalizing,
10135 "SUCCESSFUL" => Self::Successful,
10136 "FAILED" => Self::Failed,
10137 "CANCELLED" => Self::Cancelled,
10138 _ => Self::UnknownValue(operation_state::UnknownValue(
10139 wkt::internal::UnknownEnumValue::String(value.to_string()),
10140 )),
10141 }
10142 }
10143}
10144
10145impl serde::ser::Serialize for OperationState {
10146 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10147 where
10148 S: serde::Serializer,
10149 {
10150 match self {
10151 Self::Unspecified => serializer.serialize_i32(0),
10152 Self::Initializing => serializer.serialize_i32(1),
10153 Self::Processing => serializer.serialize_i32(2),
10154 Self::Cancelling => serializer.serialize_i32(3),
10155 Self::Finalizing => serializer.serialize_i32(4),
10156 Self::Successful => serializer.serialize_i32(5),
10157 Self::Failed => serializer.serialize_i32(6),
10158 Self::Cancelled => serializer.serialize_i32(7),
10159 Self::UnknownValue(u) => u.0.serialize(serializer),
10160 }
10161 }
10162}
10163
10164impl<'de> serde::de::Deserialize<'de> for OperationState {
10165 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10166 where
10167 D: serde::Deserializer<'de>,
10168 {
10169 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationState>::new(
10170 ".google.firestore.admin.v1.OperationState",
10171 ))
10172 }
10173}