google_cloud_firestore_admin_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_longrunning;
25extern crate google_cloud_lro;
26extern crate google_cloud_type;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// A Backup of a Cloud Firestore Database.
39///
40/// The backup contains all documents and index configurations for the given
41/// database at a specific point in time.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct Backup {
45 /// Output only. The unique resource name of the Backup.
46 ///
47 /// Format is `projects/{project}/locations/{location}/backups/{backup}`.
48 pub name: std::string::String,
49
50 /// Output only. Name of the Firestore database that the backup is from.
51 ///
52 /// Format is `projects/{project}/databases/{database}`.
53 pub database: std::string::String,
54
55 /// Output only. The system-generated UUID4 for the Firestore database that the
56 /// backup is from.
57 pub database_uid: std::string::String,
58
59 /// Output only. The backup contains an externally consistent copy of the
60 /// database at this time.
61 pub snapshot_time: std::option::Option<wkt::Timestamp>,
62
63 /// Output only. The timestamp at which this backup expires.
64 pub expire_time: std::option::Option<wkt::Timestamp>,
65
66 /// Output only. Statistics about the backup.
67 ///
68 /// This data only becomes available after the backup is fully materialized to
69 /// secondary storage. This field will be empty till then.
70 pub stats: std::option::Option<crate::model::backup::Stats>,
71
72 /// Output only. The current state of the backup.
73 pub state: crate::model::backup::State,
74
75 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
76}
77
78impl Backup {
79 pub fn new() -> Self {
80 std::default::Default::default()
81 }
82
83 /// Sets the value of [name][crate::model::Backup::name].
84 ///
85 /// # Example
86 /// ```ignore,no_run
87 /// # use google_cloud_firestore_admin_v1::model::Backup;
88 /// let x = Backup::new().set_name("example");
89 /// ```
90 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
91 self.name = v.into();
92 self
93 }
94
95 /// Sets the value of [database][crate::model::Backup::database].
96 ///
97 /// # Example
98 /// ```ignore,no_run
99 /// # use google_cloud_firestore_admin_v1::model::Backup;
100 /// let x = Backup::new().set_database("example");
101 /// ```
102 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
103 self.database = v.into();
104 self
105 }
106
107 /// Sets the value of [database_uid][crate::model::Backup::database_uid].
108 ///
109 /// # Example
110 /// ```ignore,no_run
111 /// # use google_cloud_firestore_admin_v1::model::Backup;
112 /// let x = Backup::new().set_database_uid("example");
113 /// ```
114 pub fn set_database_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
115 self.database_uid = v.into();
116 self
117 }
118
119 /// Sets the value of [snapshot_time][crate::model::Backup::snapshot_time].
120 ///
121 /// # Example
122 /// ```ignore,no_run
123 /// # use google_cloud_firestore_admin_v1::model::Backup;
124 /// use wkt::Timestamp;
125 /// let x = Backup::new().set_snapshot_time(Timestamp::default()/* use setters */);
126 /// ```
127 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
128 where
129 T: std::convert::Into<wkt::Timestamp>,
130 {
131 self.snapshot_time = std::option::Option::Some(v.into());
132 self
133 }
134
135 /// Sets or clears the value of [snapshot_time][crate::model::Backup::snapshot_time].
136 ///
137 /// # Example
138 /// ```ignore,no_run
139 /// # use google_cloud_firestore_admin_v1::model::Backup;
140 /// use wkt::Timestamp;
141 /// let x = Backup::new().set_or_clear_snapshot_time(Some(Timestamp::default()/* use setters */));
142 /// let x = Backup::new().set_or_clear_snapshot_time(None::<Timestamp>);
143 /// ```
144 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
145 where
146 T: std::convert::Into<wkt::Timestamp>,
147 {
148 self.snapshot_time = v.map(|x| x.into());
149 self
150 }
151
152 /// Sets the value of [expire_time][crate::model::Backup::expire_time].
153 ///
154 /// # Example
155 /// ```ignore,no_run
156 /// # use google_cloud_firestore_admin_v1::model::Backup;
157 /// use wkt::Timestamp;
158 /// let x = Backup::new().set_expire_time(Timestamp::default()/* use setters */);
159 /// ```
160 pub fn set_expire_time<T>(mut self, v: T) -> Self
161 where
162 T: std::convert::Into<wkt::Timestamp>,
163 {
164 self.expire_time = std::option::Option::Some(v.into());
165 self
166 }
167
168 /// Sets or clears the value of [expire_time][crate::model::Backup::expire_time].
169 ///
170 /// # Example
171 /// ```ignore,no_run
172 /// # use google_cloud_firestore_admin_v1::model::Backup;
173 /// use wkt::Timestamp;
174 /// let x = Backup::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
175 /// let x = Backup::new().set_or_clear_expire_time(None::<Timestamp>);
176 /// ```
177 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
178 where
179 T: std::convert::Into<wkt::Timestamp>,
180 {
181 self.expire_time = v.map(|x| x.into());
182 self
183 }
184
185 /// Sets the value of [stats][crate::model::Backup::stats].
186 ///
187 /// # Example
188 /// ```ignore,no_run
189 /// # use google_cloud_firestore_admin_v1::model::Backup;
190 /// use google_cloud_firestore_admin_v1::model::backup::Stats;
191 /// let x = Backup::new().set_stats(Stats::default()/* use setters */);
192 /// ```
193 pub fn set_stats<T>(mut self, v: T) -> Self
194 where
195 T: std::convert::Into<crate::model::backup::Stats>,
196 {
197 self.stats = std::option::Option::Some(v.into());
198 self
199 }
200
201 /// Sets or clears the value of [stats][crate::model::Backup::stats].
202 ///
203 /// # Example
204 /// ```ignore,no_run
205 /// # use google_cloud_firestore_admin_v1::model::Backup;
206 /// use google_cloud_firestore_admin_v1::model::backup::Stats;
207 /// let x = Backup::new().set_or_clear_stats(Some(Stats::default()/* use setters */));
208 /// let x = Backup::new().set_or_clear_stats(None::<Stats>);
209 /// ```
210 pub fn set_or_clear_stats<T>(mut self, v: std::option::Option<T>) -> Self
211 where
212 T: std::convert::Into<crate::model::backup::Stats>,
213 {
214 self.stats = v.map(|x| x.into());
215 self
216 }
217
218 /// Sets the value of [state][crate::model::Backup::state].
219 ///
220 /// # Example
221 /// ```ignore,no_run
222 /// # use google_cloud_firestore_admin_v1::model::Backup;
223 /// use google_cloud_firestore_admin_v1::model::backup::State;
224 /// let x0 = Backup::new().set_state(State::Creating);
225 /// let x1 = Backup::new().set_state(State::Ready);
226 /// let x2 = Backup::new().set_state(State::NotAvailable);
227 /// ```
228 pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
229 self.state = v.into();
230 self
231 }
232}
233
234impl wkt::message::Message for Backup {
235 fn typename() -> &'static str {
236 "type.googleapis.com/google.firestore.admin.v1.Backup"
237 }
238}
239
240/// Defines additional types related to [Backup].
241pub mod backup {
242 #[allow(unused_imports)]
243 use super::*;
244
245 /// Backup specific statistics.
246 #[derive(Clone, Default, PartialEq)]
247 #[non_exhaustive]
248 pub struct Stats {
249 /// Output only. Summation of the size of all documents and index entries in
250 /// the backup, measured in bytes.
251 pub size_bytes: i64,
252
253 /// Output only. The total number of documents contained in the backup.
254 pub document_count: i64,
255
256 /// Output only. The total number of index entries contained in the backup.
257 pub index_count: i64,
258
259 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
260 }
261
262 impl Stats {
263 pub fn new() -> Self {
264 std::default::Default::default()
265 }
266
267 /// Sets the value of [size_bytes][crate::model::backup::Stats::size_bytes].
268 ///
269 /// # Example
270 /// ```ignore,no_run
271 /// # use google_cloud_firestore_admin_v1::model::backup::Stats;
272 /// let x = Stats::new().set_size_bytes(42);
273 /// ```
274 pub fn set_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
275 self.size_bytes = v.into();
276 self
277 }
278
279 /// Sets the value of [document_count][crate::model::backup::Stats::document_count].
280 ///
281 /// # Example
282 /// ```ignore,no_run
283 /// # use google_cloud_firestore_admin_v1::model::backup::Stats;
284 /// let x = Stats::new().set_document_count(42);
285 /// ```
286 pub fn set_document_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
287 self.document_count = v.into();
288 self
289 }
290
291 /// Sets the value of [index_count][crate::model::backup::Stats::index_count].
292 ///
293 /// # Example
294 /// ```ignore,no_run
295 /// # use google_cloud_firestore_admin_v1::model::backup::Stats;
296 /// let x = Stats::new().set_index_count(42);
297 /// ```
298 pub fn set_index_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
299 self.index_count = v.into();
300 self
301 }
302 }
303
304 impl wkt::message::Message for Stats {
305 fn typename() -> &'static str {
306 "type.googleapis.com/google.firestore.admin.v1.Backup.Stats"
307 }
308 }
309
310 /// Indicate the current state of the backup.
311 ///
312 /// # Working with unknown values
313 ///
314 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
315 /// additional enum variants at any time. Adding new variants is not considered
316 /// a breaking change. Applications should write their code in anticipation of:
317 ///
318 /// - New values appearing in future releases of the client library, **and**
319 /// - New values received dynamically, without application changes.
320 ///
321 /// Please consult the [Working with enums] section in the user guide for some
322 /// guidelines.
323 ///
324 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
325 #[derive(Clone, Debug, PartialEq)]
326 #[non_exhaustive]
327 pub enum State {
328 /// The state is unspecified.
329 Unspecified,
330 /// The pending backup is still being created. Operations on the
331 /// backup will be rejected in this state.
332 Creating,
333 /// The backup is complete and ready to use.
334 Ready,
335 /// The backup is not available at this moment.
336 NotAvailable,
337 /// If set, the enum was initialized with an unknown value.
338 ///
339 /// Applications can examine the value using [State::value] or
340 /// [State::name].
341 UnknownValue(state::UnknownValue),
342 }
343
344 #[doc(hidden)]
345 pub mod state {
346 #[allow(unused_imports)]
347 use super::*;
348 #[derive(Clone, Debug, PartialEq)]
349 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
350 }
351
352 impl State {
353 /// Gets the enum value.
354 ///
355 /// Returns `None` if the enum contains an unknown value deserialized from
356 /// the string representation of enums.
357 pub fn value(&self) -> std::option::Option<i32> {
358 match self {
359 Self::Unspecified => std::option::Option::Some(0),
360 Self::Creating => std::option::Option::Some(1),
361 Self::Ready => std::option::Option::Some(2),
362 Self::NotAvailable => std::option::Option::Some(3),
363 Self::UnknownValue(u) => u.0.value(),
364 }
365 }
366
367 /// Gets the enum value as a string.
368 ///
369 /// Returns `None` if the enum contains an unknown value deserialized from
370 /// the integer representation of enums.
371 pub fn name(&self) -> std::option::Option<&str> {
372 match self {
373 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
374 Self::Creating => std::option::Option::Some("CREATING"),
375 Self::Ready => std::option::Option::Some("READY"),
376 Self::NotAvailable => std::option::Option::Some("NOT_AVAILABLE"),
377 Self::UnknownValue(u) => u.0.name(),
378 }
379 }
380 }
381
382 impl std::default::Default for State {
383 fn default() -> Self {
384 use std::convert::From;
385 Self::from(0)
386 }
387 }
388
389 impl std::fmt::Display for State {
390 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
391 wkt::internal::display_enum(f, self.name(), self.value())
392 }
393 }
394
395 impl std::convert::From<i32> for State {
396 fn from(value: i32) -> Self {
397 match value {
398 0 => Self::Unspecified,
399 1 => Self::Creating,
400 2 => Self::Ready,
401 3 => Self::NotAvailable,
402 _ => Self::UnknownValue(state::UnknownValue(
403 wkt::internal::UnknownEnumValue::Integer(value),
404 )),
405 }
406 }
407 }
408
409 impl std::convert::From<&str> for State {
410 fn from(value: &str) -> Self {
411 use std::string::ToString;
412 match value {
413 "STATE_UNSPECIFIED" => Self::Unspecified,
414 "CREATING" => Self::Creating,
415 "READY" => Self::Ready,
416 "NOT_AVAILABLE" => Self::NotAvailable,
417 _ => Self::UnknownValue(state::UnknownValue(
418 wkt::internal::UnknownEnumValue::String(value.to_string()),
419 )),
420 }
421 }
422 }
423
424 impl serde::ser::Serialize for State {
425 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
426 where
427 S: serde::Serializer,
428 {
429 match self {
430 Self::Unspecified => serializer.serialize_i32(0),
431 Self::Creating => serializer.serialize_i32(1),
432 Self::Ready => serializer.serialize_i32(2),
433 Self::NotAvailable => serializer.serialize_i32(3),
434 Self::UnknownValue(u) => u.0.serialize(serializer),
435 }
436 }
437 }
438
439 impl<'de> serde::de::Deserialize<'de> for State {
440 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
441 where
442 D: serde::Deserializer<'de>,
443 {
444 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
445 ".google.firestore.admin.v1.Backup.State",
446 ))
447 }
448 }
449}
450
451/// A Cloud Firestore Database.
452#[derive(Clone, Default, PartialEq)]
453#[non_exhaustive]
454pub struct Database {
455 /// The resource name of the Database.
456 /// Format: `projects/{project}/databases/{database}`
457 pub name: std::string::String,
458
459 /// Output only. The system-generated UUID4 for this Database.
460 pub uid: std::string::String,
461
462 /// Output only. The timestamp at which this database was created. Databases
463 /// created before 2016 do not populate create_time.
464 pub create_time: std::option::Option<wkt::Timestamp>,
465
466 /// Output only. The timestamp at which this database was most recently
467 /// updated. Note this only includes updates to the database resource and not
468 /// data contained by the database.
469 pub update_time: std::option::Option<wkt::Timestamp>,
470
471 /// Output only. The timestamp at which this database was deleted. Only set if
472 /// the database has been deleted.
473 pub delete_time: std::option::Option<wkt::Timestamp>,
474
475 /// The location of the database. Available locations are listed at
476 /// <https://cloud.google.com/firestore/docs/locations>.
477 pub location_id: std::string::String,
478
479 /// The type of the database.
480 /// See <https://cloud.google.com/datastore/docs/firestore-or-datastore> for
481 /// information about how to choose.
482 pub r#type: crate::model::database::DatabaseType,
483
484 /// The concurrency control mode to use for this database.
485 ///
486 /// If unspecified in a CreateDatabase request, this will default based on the
487 /// database edition: Optimistic for Enterprise and Pessimistic for all other
488 /// databases.
489 pub concurrency_mode: crate::model::database::ConcurrencyMode,
490
491 /// Output only. The period during which past versions of data are retained in
492 /// the database.
493 ///
494 /// Any [read][google.firestore.v1.GetDocumentRequest.read_time]
495 /// or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify
496 /// a `read_time` within this window, and will read the state of the database
497 /// at that time.
498 ///
499 /// If the PITR feature is enabled, the retention period is 7 days. Otherwise,
500 /// the retention period is 1 hour.
501 pub version_retention_period: std::option::Option<wkt::Duration>,
502
503 /// Output only. The earliest timestamp at which older versions of the data can
504 /// be read from the database. See [version_retention_period] above; this field
505 /// is populated with `now - version_retention_period`.
506 ///
507 /// This value is continuously updated, and becomes stale the moment it is
508 /// queried. If you are using this value to recover data, make sure to account
509 /// for the time from the moment when the value is queried to the moment when
510 /// you initiate the recovery.
511 pub earliest_version_time: std::option::Option<wkt::Timestamp>,
512
513 /// Whether to enable the PITR feature on this database.
514 pub point_in_time_recovery_enablement: crate::model::database::PointInTimeRecoveryEnablement,
515
516 /// The App Engine integration mode to use for this database.
517 pub app_engine_integration_mode: crate::model::database::AppEngineIntegrationMode,
518
519 /// Output only. The key_prefix for this database. This key_prefix is used, in
520 /// combination with the project ID ("\<key prefix\>~\<project id\>") to construct
521 /// the application ID that is returned from the Cloud Datastore APIs in Google
522 /// App Engine first generation runtimes.
523 ///
524 /// This value may be empty in which case the appid to use for URL-encoded keys
525 /// is the project_id (eg: foo instead of v~foo).
526 pub key_prefix: std::string::String,
527
528 /// State of delete protection for the database.
529 pub delete_protection_state: crate::model::database::DeleteProtectionState,
530
531 /// Optional. Presence indicates CMEK is enabled for this database.
532 pub cmek_config: std::option::Option<crate::model::database::CmekConfig>,
533
534 /// Output only. The database resource's prior database ID. This field is only
535 /// populated for deleted databases.
536 pub previous_id: std::string::String,
537
538 /// Output only. Information about the provenance of this database.
539 pub source_info: std::option::Option<crate::model::database::SourceInfo>,
540
541 /// Optional. Input only. Immutable. Tag keys/values directly bound to this
542 /// resource. For example:
543 /// "123/environment": "production",
544 /// "123/costCenter": "marketing"
545 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
546
547 /// Output only. Background: Free tier is the ability of a Firestore database
548 /// to use a small amount of resources every day without being charged. Once
549 /// usage exceeds the free tier limit further usage is charged.
550 ///
551 /// Whether this database can make use of the free tier. Only one database
552 /// per project can be eligible for the free tier.
553 ///
554 /// The first (or next) database that is created in a project without a free
555 /// tier database will be marked as eligible for the free tier. Databases that
556 /// are created while there is a free tier database will not be eligible for
557 /// the free tier.
558 pub free_tier: std::option::Option<bool>,
559
560 /// This checksum is computed by the server based on the value of other
561 /// fields, and may be sent on update and delete requests to ensure the
562 /// client has an up-to-date value before proceeding.
563 pub etag: std::string::String,
564
565 /// Immutable. The edition of the database.
566 pub database_edition: crate::model::database::DatabaseEdition,
567
568 /// Immutable. The default Realtime Updates mode to use for this database.
569 pub realtime_updates_mode: crate::model::RealtimeUpdatesMode,
570
571 /// Optional. The Firestore API data access mode to use for this database. If
572 /// not set on write:
573 ///
574 /// - the default value is DATA_ACCESS_MODE_DISABLED for Enterprise Edition.
575 /// - the default value is DATA_ACCESS_MODE_ENABLED for Standard Edition.
576 pub firestore_data_access_mode: crate::model::database::DataAccessMode,
577
578 /// Optional. The MongoDB compatible API data access mode to use for this
579 /// database. If not set on write, the default value is
580 /// DATA_ACCESS_MODE_ENABLED for Enterprise Edition. The value is always
581 /// DATA_ACCESS_MODE_DISABLED for Standard Edition.
582 pub mongodb_compatible_data_access_mode: crate::model::database::DataAccessMode,
583
584 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
585}
586
587impl Database {
588 pub fn new() -> Self {
589 std::default::Default::default()
590 }
591
592 /// Sets the value of [name][crate::model::Database::name].
593 ///
594 /// # Example
595 /// ```ignore,no_run
596 /// # use google_cloud_firestore_admin_v1::model::Database;
597 /// let x = Database::new().set_name("example");
598 /// ```
599 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
600 self.name = v.into();
601 self
602 }
603
604 /// Sets the value of [uid][crate::model::Database::uid].
605 ///
606 /// # Example
607 /// ```ignore,no_run
608 /// # use google_cloud_firestore_admin_v1::model::Database;
609 /// let x = Database::new().set_uid("example");
610 /// ```
611 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
612 self.uid = v.into();
613 self
614 }
615
616 /// Sets the value of [create_time][crate::model::Database::create_time].
617 ///
618 /// # Example
619 /// ```ignore,no_run
620 /// # use google_cloud_firestore_admin_v1::model::Database;
621 /// use wkt::Timestamp;
622 /// let x = Database::new().set_create_time(Timestamp::default()/* use setters */);
623 /// ```
624 pub fn set_create_time<T>(mut self, v: T) -> Self
625 where
626 T: std::convert::Into<wkt::Timestamp>,
627 {
628 self.create_time = std::option::Option::Some(v.into());
629 self
630 }
631
632 /// Sets or clears the value of [create_time][crate::model::Database::create_time].
633 ///
634 /// # Example
635 /// ```ignore,no_run
636 /// # use google_cloud_firestore_admin_v1::model::Database;
637 /// use wkt::Timestamp;
638 /// let x = Database::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
639 /// let x = Database::new().set_or_clear_create_time(None::<Timestamp>);
640 /// ```
641 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
642 where
643 T: std::convert::Into<wkt::Timestamp>,
644 {
645 self.create_time = v.map(|x| x.into());
646 self
647 }
648
649 /// Sets the value of [update_time][crate::model::Database::update_time].
650 ///
651 /// # Example
652 /// ```ignore,no_run
653 /// # use google_cloud_firestore_admin_v1::model::Database;
654 /// use wkt::Timestamp;
655 /// let x = Database::new().set_update_time(Timestamp::default()/* use setters */);
656 /// ```
657 pub fn set_update_time<T>(mut self, v: T) -> Self
658 where
659 T: std::convert::Into<wkt::Timestamp>,
660 {
661 self.update_time = std::option::Option::Some(v.into());
662 self
663 }
664
665 /// Sets or clears the value of [update_time][crate::model::Database::update_time].
666 ///
667 /// # Example
668 /// ```ignore,no_run
669 /// # use google_cloud_firestore_admin_v1::model::Database;
670 /// use wkt::Timestamp;
671 /// let x = Database::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
672 /// let x = Database::new().set_or_clear_update_time(None::<Timestamp>);
673 /// ```
674 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
675 where
676 T: std::convert::Into<wkt::Timestamp>,
677 {
678 self.update_time = v.map(|x| x.into());
679 self
680 }
681
682 /// Sets the value of [delete_time][crate::model::Database::delete_time].
683 ///
684 /// # Example
685 /// ```ignore,no_run
686 /// # use google_cloud_firestore_admin_v1::model::Database;
687 /// use wkt::Timestamp;
688 /// let x = Database::new().set_delete_time(Timestamp::default()/* use setters */);
689 /// ```
690 pub fn set_delete_time<T>(mut self, v: T) -> Self
691 where
692 T: std::convert::Into<wkt::Timestamp>,
693 {
694 self.delete_time = std::option::Option::Some(v.into());
695 self
696 }
697
698 /// Sets or clears the value of [delete_time][crate::model::Database::delete_time].
699 ///
700 /// # Example
701 /// ```ignore,no_run
702 /// # use google_cloud_firestore_admin_v1::model::Database;
703 /// use wkt::Timestamp;
704 /// let x = Database::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
705 /// let x = Database::new().set_or_clear_delete_time(None::<Timestamp>);
706 /// ```
707 pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
708 where
709 T: std::convert::Into<wkt::Timestamp>,
710 {
711 self.delete_time = v.map(|x| x.into());
712 self
713 }
714
715 /// Sets the value of [location_id][crate::model::Database::location_id].
716 ///
717 /// # Example
718 /// ```ignore,no_run
719 /// # use google_cloud_firestore_admin_v1::model::Database;
720 /// let x = Database::new().set_location_id("example");
721 /// ```
722 pub fn set_location_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
723 self.location_id = v.into();
724 self
725 }
726
727 /// Sets the value of [r#type][crate::model::Database::type].
728 ///
729 /// # Example
730 /// ```ignore,no_run
731 /// # use google_cloud_firestore_admin_v1::model::Database;
732 /// use google_cloud_firestore_admin_v1::model::database::DatabaseType;
733 /// let x0 = Database::new().set_type(DatabaseType::FirestoreNative);
734 /// let x1 = Database::new().set_type(DatabaseType::DatastoreMode);
735 /// ```
736 pub fn set_type<T: std::convert::Into<crate::model::database::DatabaseType>>(
737 mut self,
738 v: T,
739 ) -> Self {
740 self.r#type = v.into();
741 self
742 }
743
744 /// Sets the value of [concurrency_mode][crate::model::Database::concurrency_mode].
745 ///
746 /// # Example
747 /// ```ignore,no_run
748 /// # use google_cloud_firestore_admin_v1::model::Database;
749 /// use google_cloud_firestore_admin_v1::model::database::ConcurrencyMode;
750 /// let x0 = Database::new().set_concurrency_mode(ConcurrencyMode::Optimistic);
751 /// let x1 = Database::new().set_concurrency_mode(ConcurrencyMode::Pessimistic);
752 /// let x2 = Database::new().set_concurrency_mode(ConcurrencyMode::OptimisticWithEntityGroups);
753 /// ```
754 pub fn set_concurrency_mode<T: std::convert::Into<crate::model::database::ConcurrencyMode>>(
755 mut self,
756 v: T,
757 ) -> Self {
758 self.concurrency_mode = v.into();
759 self
760 }
761
762 /// Sets the value of [version_retention_period][crate::model::Database::version_retention_period].
763 ///
764 /// # Example
765 /// ```ignore,no_run
766 /// # use google_cloud_firestore_admin_v1::model::Database;
767 /// use wkt::Duration;
768 /// let x = Database::new().set_version_retention_period(Duration::default()/* use setters */);
769 /// ```
770 pub fn set_version_retention_period<T>(mut self, v: T) -> Self
771 where
772 T: std::convert::Into<wkt::Duration>,
773 {
774 self.version_retention_period = std::option::Option::Some(v.into());
775 self
776 }
777
778 /// Sets or clears the value of [version_retention_period][crate::model::Database::version_retention_period].
779 ///
780 /// # Example
781 /// ```ignore,no_run
782 /// # use google_cloud_firestore_admin_v1::model::Database;
783 /// use wkt::Duration;
784 /// let x = Database::new().set_or_clear_version_retention_period(Some(Duration::default()/* use setters */));
785 /// let x = Database::new().set_or_clear_version_retention_period(None::<Duration>);
786 /// ```
787 pub fn set_or_clear_version_retention_period<T>(mut self, v: std::option::Option<T>) -> Self
788 where
789 T: std::convert::Into<wkt::Duration>,
790 {
791 self.version_retention_period = v.map(|x| x.into());
792 self
793 }
794
795 /// Sets the value of [earliest_version_time][crate::model::Database::earliest_version_time].
796 ///
797 /// # Example
798 /// ```ignore,no_run
799 /// # use google_cloud_firestore_admin_v1::model::Database;
800 /// use wkt::Timestamp;
801 /// let x = Database::new().set_earliest_version_time(Timestamp::default()/* use setters */);
802 /// ```
803 pub fn set_earliest_version_time<T>(mut self, v: T) -> Self
804 where
805 T: std::convert::Into<wkt::Timestamp>,
806 {
807 self.earliest_version_time = std::option::Option::Some(v.into());
808 self
809 }
810
811 /// Sets or clears the value of [earliest_version_time][crate::model::Database::earliest_version_time].
812 ///
813 /// # Example
814 /// ```ignore,no_run
815 /// # use google_cloud_firestore_admin_v1::model::Database;
816 /// use wkt::Timestamp;
817 /// let x = Database::new().set_or_clear_earliest_version_time(Some(Timestamp::default()/* use setters */));
818 /// let x = Database::new().set_or_clear_earliest_version_time(None::<Timestamp>);
819 /// ```
820 pub fn set_or_clear_earliest_version_time<T>(mut self, v: std::option::Option<T>) -> Self
821 where
822 T: std::convert::Into<wkt::Timestamp>,
823 {
824 self.earliest_version_time = v.map(|x| x.into());
825 self
826 }
827
828 /// Sets the value of [point_in_time_recovery_enablement][crate::model::Database::point_in_time_recovery_enablement].
829 ///
830 /// # Example
831 /// ```ignore,no_run
832 /// # use google_cloud_firestore_admin_v1::model::Database;
833 /// use google_cloud_firestore_admin_v1::model::database::PointInTimeRecoveryEnablement;
834 /// let x0 = Database::new().set_point_in_time_recovery_enablement(PointInTimeRecoveryEnablement::PointInTimeRecoveryEnabled);
835 /// let x1 = Database::new().set_point_in_time_recovery_enablement(PointInTimeRecoveryEnablement::PointInTimeRecoveryDisabled);
836 /// ```
837 pub fn set_point_in_time_recovery_enablement<
838 T: std::convert::Into<crate::model::database::PointInTimeRecoveryEnablement>,
839 >(
840 mut self,
841 v: T,
842 ) -> Self {
843 self.point_in_time_recovery_enablement = v.into();
844 self
845 }
846
847 /// Sets the value of [app_engine_integration_mode][crate::model::Database::app_engine_integration_mode].
848 ///
849 /// # Example
850 /// ```ignore,no_run
851 /// # use google_cloud_firestore_admin_v1::model::Database;
852 /// use google_cloud_firestore_admin_v1::model::database::AppEngineIntegrationMode;
853 /// let x0 = Database::new().set_app_engine_integration_mode(AppEngineIntegrationMode::Enabled);
854 /// let x1 = Database::new().set_app_engine_integration_mode(AppEngineIntegrationMode::Disabled);
855 /// ```
856 pub fn set_app_engine_integration_mode<
857 T: std::convert::Into<crate::model::database::AppEngineIntegrationMode>,
858 >(
859 mut self,
860 v: T,
861 ) -> Self {
862 self.app_engine_integration_mode = v.into();
863 self
864 }
865
866 /// Sets the value of [key_prefix][crate::model::Database::key_prefix].
867 ///
868 /// # Example
869 /// ```ignore,no_run
870 /// # use google_cloud_firestore_admin_v1::model::Database;
871 /// let x = Database::new().set_key_prefix("example");
872 /// ```
873 pub fn set_key_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
874 self.key_prefix = v.into();
875 self
876 }
877
878 /// Sets the value of [delete_protection_state][crate::model::Database::delete_protection_state].
879 ///
880 /// # Example
881 /// ```ignore,no_run
882 /// # use google_cloud_firestore_admin_v1::model::Database;
883 /// use google_cloud_firestore_admin_v1::model::database::DeleteProtectionState;
884 /// let x0 = Database::new().set_delete_protection_state(DeleteProtectionState::DeleteProtectionDisabled);
885 /// let x1 = Database::new().set_delete_protection_state(DeleteProtectionState::DeleteProtectionEnabled);
886 /// ```
887 pub fn set_delete_protection_state<
888 T: std::convert::Into<crate::model::database::DeleteProtectionState>,
889 >(
890 mut self,
891 v: T,
892 ) -> Self {
893 self.delete_protection_state = v.into();
894 self
895 }
896
897 /// Sets the value of [cmek_config][crate::model::Database::cmek_config].
898 ///
899 /// # Example
900 /// ```ignore,no_run
901 /// # use google_cloud_firestore_admin_v1::model::Database;
902 /// use google_cloud_firestore_admin_v1::model::database::CmekConfig;
903 /// let x = Database::new().set_cmek_config(CmekConfig::default()/* use setters */);
904 /// ```
905 pub fn set_cmek_config<T>(mut self, v: T) -> Self
906 where
907 T: std::convert::Into<crate::model::database::CmekConfig>,
908 {
909 self.cmek_config = std::option::Option::Some(v.into());
910 self
911 }
912
913 /// Sets or clears the value of [cmek_config][crate::model::Database::cmek_config].
914 ///
915 /// # Example
916 /// ```ignore,no_run
917 /// # use google_cloud_firestore_admin_v1::model::Database;
918 /// use google_cloud_firestore_admin_v1::model::database::CmekConfig;
919 /// let x = Database::new().set_or_clear_cmek_config(Some(CmekConfig::default()/* use setters */));
920 /// let x = Database::new().set_or_clear_cmek_config(None::<CmekConfig>);
921 /// ```
922 pub fn set_or_clear_cmek_config<T>(mut self, v: std::option::Option<T>) -> Self
923 where
924 T: std::convert::Into<crate::model::database::CmekConfig>,
925 {
926 self.cmek_config = v.map(|x| x.into());
927 self
928 }
929
930 /// Sets the value of [previous_id][crate::model::Database::previous_id].
931 ///
932 /// # Example
933 /// ```ignore,no_run
934 /// # use google_cloud_firestore_admin_v1::model::Database;
935 /// let x = Database::new().set_previous_id("example");
936 /// ```
937 pub fn set_previous_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
938 self.previous_id = v.into();
939 self
940 }
941
942 /// Sets the value of [source_info][crate::model::Database::source_info].
943 ///
944 /// # Example
945 /// ```ignore,no_run
946 /// # use google_cloud_firestore_admin_v1::model::Database;
947 /// use google_cloud_firestore_admin_v1::model::database::SourceInfo;
948 /// let x = Database::new().set_source_info(SourceInfo::default()/* use setters */);
949 /// ```
950 pub fn set_source_info<T>(mut self, v: T) -> Self
951 where
952 T: std::convert::Into<crate::model::database::SourceInfo>,
953 {
954 self.source_info = std::option::Option::Some(v.into());
955 self
956 }
957
958 /// Sets or clears the value of [source_info][crate::model::Database::source_info].
959 ///
960 /// # Example
961 /// ```ignore,no_run
962 /// # use google_cloud_firestore_admin_v1::model::Database;
963 /// use google_cloud_firestore_admin_v1::model::database::SourceInfo;
964 /// let x = Database::new().set_or_clear_source_info(Some(SourceInfo::default()/* use setters */));
965 /// let x = Database::new().set_or_clear_source_info(None::<SourceInfo>);
966 /// ```
967 pub fn set_or_clear_source_info<T>(mut self, v: std::option::Option<T>) -> Self
968 where
969 T: std::convert::Into<crate::model::database::SourceInfo>,
970 {
971 self.source_info = v.map(|x| x.into());
972 self
973 }
974
975 /// Sets the value of [tags][crate::model::Database::tags].
976 ///
977 /// # Example
978 /// ```ignore,no_run
979 /// # use google_cloud_firestore_admin_v1::model::Database;
980 /// let x = Database::new().set_tags([
981 /// ("key0", "abc"),
982 /// ("key1", "xyz"),
983 /// ]);
984 /// ```
985 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
986 where
987 T: std::iter::IntoIterator<Item = (K, V)>,
988 K: std::convert::Into<std::string::String>,
989 V: std::convert::Into<std::string::String>,
990 {
991 use std::iter::Iterator;
992 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
993 self
994 }
995
996 /// Sets the value of [free_tier][crate::model::Database::free_tier].
997 ///
998 /// # Example
999 /// ```ignore,no_run
1000 /// # use google_cloud_firestore_admin_v1::model::Database;
1001 /// let x = Database::new().set_free_tier(true);
1002 /// ```
1003 pub fn set_free_tier<T>(mut self, v: T) -> Self
1004 where
1005 T: std::convert::Into<bool>,
1006 {
1007 self.free_tier = std::option::Option::Some(v.into());
1008 self
1009 }
1010
1011 /// Sets or clears the value of [free_tier][crate::model::Database::free_tier].
1012 ///
1013 /// # Example
1014 /// ```ignore,no_run
1015 /// # use google_cloud_firestore_admin_v1::model::Database;
1016 /// let x = Database::new().set_or_clear_free_tier(Some(false));
1017 /// let x = Database::new().set_or_clear_free_tier(None::<bool>);
1018 /// ```
1019 pub fn set_or_clear_free_tier<T>(mut self, v: std::option::Option<T>) -> Self
1020 where
1021 T: std::convert::Into<bool>,
1022 {
1023 self.free_tier = v.map(|x| x.into());
1024 self
1025 }
1026
1027 /// Sets the value of [etag][crate::model::Database::etag].
1028 ///
1029 /// # Example
1030 /// ```ignore,no_run
1031 /// # use google_cloud_firestore_admin_v1::model::Database;
1032 /// let x = Database::new().set_etag("example");
1033 /// ```
1034 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1035 self.etag = v.into();
1036 self
1037 }
1038
1039 /// Sets the value of [database_edition][crate::model::Database::database_edition].
1040 ///
1041 /// # Example
1042 /// ```ignore,no_run
1043 /// # use google_cloud_firestore_admin_v1::model::Database;
1044 /// use google_cloud_firestore_admin_v1::model::database::DatabaseEdition;
1045 /// let x0 = Database::new().set_database_edition(DatabaseEdition::Standard);
1046 /// let x1 = Database::new().set_database_edition(DatabaseEdition::Enterprise);
1047 /// ```
1048 pub fn set_database_edition<T: std::convert::Into<crate::model::database::DatabaseEdition>>(
1049 mut self,
1050 v: T,
1051 ) -> Self {
1052 self.database_edition = v.into();
1053 self
1054 }
1055
1056 /// Sets the value of [realtime_updates_mode][crate::model::Database::realtime_updates_mode].
1057 ///
1058 /// # Example
1059 /// ```ignore,no_run
1060 /// # use google_cloud_firestore_admin_v1::model::Database;
1061 /// use google_cloud_firestore_admin_v1::model::RealtimeUpdatesMode;
1062 /// let x0 = Database::new().set_realtime_updates_mode(RealtimeUpdatesMode::Enabled);
1063 /// let x1 = Database::new().set_realtime_updates_mode(RealtimeUpdatesMode::Disabled);
1064 /// ```
1065 pub fn set_realtime_updates_mode<T: std::convert::Into<crate::model::RealtimeUpdatesMode>>(
1066 mut self,
1067 v: T,
1068 ) -> Self {
1069 self.realtime_updates_mode = v.into();
1070 self
1071 }
1072
1073 /// Sets the value of [firestore_data_access_mode][crate::model::Database::firestore_data_access_mode].
1074 ///
1075 /// # Example
1076 /// ```ignore,no_run
1077 /// # use google_cloud_firestore_admin_v1::model::Database;
1078 /// use google_cloud_firestore_admin_v1::model::database::DataAccessMode;
1079 /// let x0 = Database::new().set_firestore_data_access_mode(DataAccessMode::Enabled);
1080 /// let x1 = Database::new().set_firestore_data_access_mode(DataAccessMode::Disabled);
1081 /// ```
1082 pub fn set_firestore_data_access_mode<
1083 T: std::convert::Into<crate::model::database::DataAccessMode>,
1084 >(
1085 mut self,
1086 v: T,
1087 ) -> Self {
1088 self.firestore_data_access_mode = v.into();
1089 self
1090 }
1091
1092 /// Sets the value of [mongodb_compatible_data_access_mode][crate::model::Database::mongodb_compatible_data_access_mode].
1093 ///
1094 /// # Example
1095 /// ```ignore,no_run
1096 /// # use google_cloud_firestore_admin_v1::model::Database;
1097 /// use google_cloud_firestore_admin_v1::model::database::DataAccessMode;
1098 /// let x0 = Database::new().set_mongodb_compatible_data_access_mode(DataAccessMode::Enabled);
1099 /// let x1 = Database::new().set_mongodb_compatible_data_access_mode(DataAccessMode::Disabled);
1100 /// ```
1101 pub fn set_mongodb_compatible_data_access_mode<
1102 T: std::convert::Into<crate::model::database::DataAccessMode>,
1103 >(
1104 mut self,
1105 v: T,
1106 ) -> Self {
1107 self.mongodb_compatible_data_access_mode = v.into();
1108 self
1109 }
1110}
1111
1112impl wkt::message::Message for Database {
1113 fn typename() -> &'static str {
1114 "type.googleapis.com/google.firestore.admin.v1.Database"
1115 }
1116}
1117
1118/// Defines additional types related to [Database].
1119pub mod database {
1120 #[allow(unused_imports)]
1121 use super::*;
1122
1123 /// The CMEK (Customer Managed Encryption Key) configuration for a Firestore
1124 /// database. If not present, the database is secured by the default Google
1125 /// encryption key.
1126 #[derive(Clone, Default, PartialEq)]
1127 #[non_exhaustive]
1128 pub struct CmekConfig {
1129 /// Required. Only keys in the same location as this database are allowed to
1130 /// be used for encryption.
1131 ///
1132 /// For Firestore's nam5 multi-region, this corresponds to Cloud KMS
1133 /// multi-region us. For Firestore's eur3 multi-region, this corresponds to
1134 /// Cloud KMS multi-region europe. See
1135 /// <https://cloud.google.com/kms/docs/locations>.
1136 ///
1137 /// The expected format is
1138 /// `projects/{project_id}/locations/{kms_location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
1139 pub kms_key_name: std::string::String,
1140
1141 /// Output only. Currently in-use [KMS key
1142 /// versions](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions).
1143 /// During [key rotation](https://cloud.google.com/kms/docs/key-rotation),
1144 /// there can be multiple in-use key versions.
1145 ///
1146 /// The expected format is
1147 /// `projects/{project_id}/locations/{kms_location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{key_version}`.
1148 pub active_key_version: std::vec::Vec<std::string::String>,
1149
1150 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1151 }
1152
1153 impl CmekConfig {
1154 pub fn new() -> Self {
1155 std::default::Default::default()
1156 }
1157
1158 /// Sets the value of [kms_key_name][crate::model::database::CmekConfig::kms_key_name].
1159 ///
1160 /// # Example
1161 /// ```ignore,no_run
1162 /// # use google_cloud_firestore_admin_v1::model::database::CmekConfig;
1163 /// let x = CmekConfig::new().set_kms_key_name("example");
1164 /// ```
1165 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
1166 mut self,
1167 v: T,
1168 ) -> Self {
1169 self.kms_key_name = v.into();
1170 self
1171 }
1172
1173 /// Sets the value of [active_key_version][crate::model::database::CmekConfig::active_key_version].
1174 ///
1175 /// # Example
1176 /// ```ignore,no_run
1177 /// # use google_cloud_firestore_admin_v1::model::database::CmekConfig;
1178 /// let x = CmekConfig::new().set_active_key_version(["a", "b", "c"]);
1179 /// ```
1180 pub fn set_active_key_version<T, V>(mut self, v: T) -> Self
1181 where
1182 T: std::iter::IntoIterator<Item = V>,
1183 V: std::convert::Into<std::string::String>,
1184 {
1185 use std::iter::Iterator;
1186 self.active_key_version = v.into_iter().map(|i| i.into()).collect();
1187 self
1188 }
1189 }
1190
1191 impl wkt::message::Message for CmekConfig {
1192 fn typename() -> &'static str {
1193 "type.googleapis.com/google.firestore.admin.v1.Database.CmekConfig"
1194 }
1195 }
1196
1197 /// Information about the provenance of this database.
1198 #[derive(Clone, Default, PartialEq)]
1199 #[non_exhaustive]
1200 pub struct SourceInfo {
1201 /// The associated long-running operation. This field may not be set after
1202 /// the operation has completed. Format:
1203 /// `projects/{project}/databases/{database}/operations/{operation}`.
1204 pub operation: std::string::String,
1205
1206 /// The source from which this database is derived.
1207 pub source: std::option::Option<crate::model::database::source_info::Source>,
1208
1209 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1210 }
1211
1212 impl SourceInfo {
1213 pub fn new() -> Self {
1214 std::default::Default::default()
1215 }
1216
1217 /// Sets the value of [operation][crate::model::database::SourceInfo::operation].
1218 ///
1219 /// # Example
1220 /// ```ignore,no_run
1221 /// # use google_cloud_firestore_admin_v1::model::database::SourceInfo;
1222 /// let x = SourceInfo::new().set_operation("example");
1223 /// ```
1224 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1225 self.operation = v.into();
1226 self
1227 }
1228
1229 /// Sets the value of [source][crate::model::database::SourceInfo::source].
1230 ///
1231 /// Note that all the setters affecting `source` are mutually
1232 /// exclusive.
1233 ///
1234 /// # Example
1235 /// ```ignore,no_run
1236 /// # use google_cloud_firestore_admin_v1::model::database::SourceInfo;
1237 /// use google_cloud_firestore_admin_v1::model::database::source_info::BackupSource;
1238 /// let x = SourceInfo::new().set_source(Some(
1239 /// google_cloud_firestore_admin_v1::model::database::source_info::Source::Backup(BackupSource::default().into())));
1240 /// ```
1241 pub fn set_source<
1242 T: std::convert::Into<std::option::Option<crate::model::database::source_info::Source>>,
1243 >(
1244 mut self,
1245 v: T,
1246 ) -> Self {
1247 self.source = v.into();
1248 self
1249 }
1250
1251 /// The value of [source][crate::model::database::SourceInfo::source]
1252 /// if it holds a `Backup`, `None` if the field is not set or
1253 /// holds a different branch.
1254 pub fn backup(
1255 &self,
1256 ) -> std::option::Option<&std::boxed::Box<crate::model::database::source_info::BackupSource>>
1257 {
1258 #[allow(unreachable_patterns)]
1259 self.source.as_ref().and_then(|v| match v {
1260 crate::model::database::source_info::Source::Backup(v) => {
1261 std::option::Option::Some(v)
1262 }
1263 _ => std::option::Option::None,
1264 })
1265 }
1266
1267 /// Sets the value of [source][crate::model::database::SourceInfo::source]
1268 /// to hold a `Backup`.
1269 ///
1270 /// Note that all the setters affecting `source` are
1271 /// mutually exclusive.
1272 ///
1273 /// # Example
1274 /// ```ignore,no_run
1275 /// # use google_cloud_firestore_admin_v1::model::database::SourceInfo;
1276 /// use google_cloud_firestore_admin_v1::model::database::source_info::BackupSource;
1277 /// let x = SourceInfo::new().set_backup(BackupSource::default()/* use setters */);
1278 /// assert!(x.backup().is_some());
1279 /// ```
1280 pub fn set_backup<
1281 T: std::convert::Into<std::boxed::Box<crate::model::database::source_info::BackupSource>>,
1282 >(
1283 mut self,
1284 v: T,
1285 ) -> Self {
1286 self.source = std::option::Option::Some(
1287 crate::model::database::source_info::Source::Backup(v.into()),
1288 );
1289 self
1290 }
1291 }
1292
1293 impl wkt::message::Message for SourceInfo {
1294 fn typename() -> &'static str {
1295 "type.googleapis.com/google.firestore.admin.v1.Database.SourceInfo"
1296 }
1297 }
1298
1299 /// Defines additional types related to [SourceInfo].
1300 pub mod source_info {
1301 #[allow(unused_imports)]
1302 use super::*;
1303
1304 /// Information about a backup that was used to restore a database.
1305 #[derive(Clone, Default, PartialEq)]
1306 #[non_exhaustive]
1307 pub struct BackupSource {
1308 /// The resource name of the backup that was used to restore this
1309 /// database. Format:
1310 /// `projects/{project}/locations/{location}/backups/{backup}`.
1311 pub backup: std::string::String,
1312
1313 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1314 }
1315
1316 impl BackupSource {
1317 pub fn new() -> Self {
1318 std::default::Default::default()
1319 }
1320
1321 /// Sets the value of [backup][crate::model::database::source_info::BackupSource::backup].
1322 ///
1323 /// # Example
1324 /// ```ignore,no_run
1325 /// # use google_cloud_firestore_admin_v1::model::database::source_info::BackupSource;
1326 /// let x = BackupSource::new().set_backup("example");
1327 /// ```
1328 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1329 self.backup = v.into();
1330 self
1331 }
1332 }
1333
1334 impl wkt::message::Message for BackupSource {
1335 fn typename() -> &'static str {
1336 "type.googleapis.com/google.firestore.admin.v1.Database.SourceInfo.BackupSource"
1337 }
1338 }
1339
1340 /// The source from which this database is derived.
1341 #[derive(Clone, Debug, PartialEq)]
1342 #[non_exhaustive]
1343 pub enum Source {
1344 /// If set, this database was restored from the specified backup (or a
1345 /// snapshot thereof).
1346 Backup(std::boxed::Box<crate::model::database::source_info::BackupSource>),
1347 }
1348 }
1349
1350 /// Encryption configuration for a new database being created from another
1351 /// source.
1352 ///
1353 /// The source could be a [Backup][google.firestore.admin.v1.Backup] or a
1354 /// [PitrSnapshot][google.firestore.admin.v1.PitrSnapshot].
1355 ///
1356 /// [google.firestore.admin.v1.Backup]: crate::model::Backup
1357 /// [google.firestore.admin.v1.PitrSnapshot]: crate::model::PitrSnapshot
1358 #[derive(Clone, Default, PartialEq)]
1359 #[non_exhaustive]
1360 pub struct EncryptionConfig {
1361 /// The method for encrypting the database.
1362 pub encryption_type:
1363 std::option::Option<crate::model::database::encryption_config::EncryptionType>,
1364
1365 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1366 }
1367
1368 impl EncryptionConfig {
1369 pub fn new() -> Self {
1370 std::default::Default::default()
1371 }
1372
1373 /// Sets the value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type].
1374 ///
1375 /// Note that all the setters affecting `encryption_type` are mutually
1376 /// exclusive.
1377 ///
1378 /// # Example
1379 /// ```ignore,no_run
1380 /// # use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
1381 /// use google_cloud_firestore_admin_v1::model::database::encryption_config::GoogleDefaultEncryptionOptions;
1382 /// let x = EncryptionConfig::new().set_encryption_type(Some(
1383 /// google_cloud_firestore_admin_v1::model::database::encryption_config::EncryptionType::GoogleDefaultEncryption(GoogleDefaultEncryptionOptions::default().into())));
1384 /// ```
1385 pub fn set_encryption_type<
1386 T: std::convert::Into<
1387 std::option::Option<crate::model::database::encryption_config::EncryptionType>,
1388 >,
1389 >(
1390 mut self,
1391 v: T,
1392 ) -> Self {
1393 self.encryption_type = v.into();
1394 self
1395 }
1396
1397 /// The value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type]
1398 /// if it holds a `GoogleDefaultEncryption`, `None` if the field is not set or
1399 /// holds a different branch.
1400 pub fn google_default_encryption(
1401 &self,
1402 ) -> std::option::Option<
1403 &std::boxed::Box<
1404 crate::model::database::encryption_config::GoogleDefaultEncryptionOptions,
1405 >,
1406 > {
1407 #[allow(unreachable_patterns)]
1408 self.encryption_type.as_ref().and_then(|v| match v {
1409 crate::model::database::encryption_config::EncryptionType::GoogleDefaultEncryption(v) => std::option::Option::Some(v),
1410 _ => std::option::Option::None,
1411 })
1412 }
1413
1414 /// Sets the value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type]
1415 /// to hold a `GoogleDefaultEncryption`.
1416 ///
1417 /// Note that all the setters affecting `encryption_type` are
1418 /// mutually exclusive.
1419 ///
1420 /// # Example
1421 /// ```ignore,no_run
1422 /// # use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
1423 /// use google_cloud_firestore_admin_v1::model::database::encryption_config::GoogleDefaultEncryptionOptions;
1424 /// let x = EncryptionConfig::new().set_google_default_encryption(GoogleDefaultEncryptionOptions::default()/* use setters */);
1425 /// assert!(x.google_default_encryption().is_some());
1426 /// assert!(x.use_source_encryption().is_none());
1427 /// assert!(x.customer_managed_encryption().is_none());
1428 /// ```
1429 pub fn set_google_default_encryption<
1430 T: std::convert::Into<
1431 std::boxed::Box<
1432 crate::model::database::encryption_config::GoogleDefaultEncryptionOptions,
1433 >,
1434 >,
1435 >(
1436 mut self,
1437 v: T,
1438 ) -> Self {
1439 self.encryption_type = std::option::Option::Some(
1440 crate::model::database::encryption_config::EncryptionType::GoogleDefaultEncryption(
1441 v.into(),
1442 ),
1443 );
1444 self
1445 }
1446
1447 /// The value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type]
1448 /// if it holds a `UseSourceEncryption`, `None` if the field is not set or
1449 /// holds a different branch.
1450 pub fn use_source_encryption(
1451 &self,
1452 ) -> std::option::Option<
1453 &std::boxed::Box<crate::model::database::encryption_config::SourceEncryptionOptions>,
1454 > {
1455 #[allow(unreachable_patterns)]
1456 self.encryption_type.as_ref().and_then(|v| match v {
1457 crate::model::database::encryption_config::EncryptionType::UseSourceEncryption(
1458 v,
1459 ) => std::option::Option::Some(v),
1460 _ => std::option::Option::None,
1461 })
1462 }
1463
1464 /// Sets the value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type]
1465 /// to hold a `UseSourceEncryption`.
1466 ///
1467 /// Note that all the setters affecting `encryption_type` are
1468 /// mutually exclusive.
1469 ///
1470 /// # Example
1471 /// ```ignore,no_run
1472 /// # use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
1473 /// use google_cloud_firestore_admin_v1::model::database::encryption_config::SourceEncryptionOptions;
1474 /// let x = EncryptionConfig::new().set_use_source_encryption(SourceEncryptionOptions::default()/* use setters */);
1475 /// assert!(x.use_source_encryption().is_some());
1476 /// assert!(x.google_default_encryption().is_none());
1477 /// assert!(x.customer_managed_encryption().is_none());
1478 /// ```
1479 pub fn set_use_source_encryption<
1480 T: std::convert::Into<
1481 std::boxed::Box<
1482 crate::model::database::encryption_config::SourceEncryptionOptions,
1483 >,
1484 >,
1485 >(
1486 mut self,
1487 v: T,
1488 ) -> Self {
1489 self.encryption_type = std::option::Option::Some(
1490 crate::model::database::encryption_config::EncryptionType::UseSourceEncryption(
1491 v.into(),
1492 ),
1493 );
1494 self
1495 }
1496
1497 /// The value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type]
1498 /// if it holds a `CustomerManagedEncryption`, `None` if the field is not set or
1499 /// holds a different branch.
1500 pub fn customer_managed_encryption(
1501 &self,
1502 ) -> std::option::Option<
1503 &std::boxed::Box<
1504 crate::model::database::encryption_config::CustomerManagedEncryptionOptions,
1505 >,
1506 > {
1507 #[allow(unreachable_patterns)]
1508 self.encryption_type.as_ref().and_then(|v| match v {
1509 crate::model::database::encryption_config::EncryptionType::CustomerManagedEncryption(v) => std::option::Option::Some(v),
1510 _ => std::option::Option::None,
1511 })
1512 }
1513
1514 /// Sets the value of [encryption_type][crate::model::database::EncryptionConfig::encryption_type]
1515 /// to hold a `CustomerManagedEncryption`.
1516 ///
1517 /// Note that all the setters affecting `encryption_type` are
1518 /// mutually exclusive.
1519 ///
1520 /// # Example
1521 /// ```ignore,no_run
1522 /// # use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
1523 /// use google_cloud_firestore_admin_v1::model::database::encryption_config::CustomerManagedEncryptionOptions;
1524 /// let x = EncryptionConfig::new().set_customer_managed_encryption(CustomerManagedEncryptionOptions::default()/* use setters */);
1525 /// assert!(x.customer_managed_encryption().is_some());
1526 /// assert!(x.google_default_encryption().is_none());
1527 /// assert!(x.use_source_encryption().is_none());
1528 /// ```
1529 pub fn set_customer_managed_encryption<
1530 T: std::convert::Into<
1531 std::boxed::Box<
1532 crate::model::database::encryption_config::CustomerManagedEncryptionOptions,
1533 >,
1534 >,
1535 >(
1536 mut self,
1537 v: T,
1538 ) -> Self {
1539 self.encryption_type = std::option::Option::Some(
1540 crate::model::database::encryption_config::EncryptionType::CustomerManagedEncryption(
1541 v.into()
1542 )
1543 );
1544 self
1545 }
1546 }
1547
1548 impl wkt::message::Message for EncryptionConfig {
1549 fn typename() -> &'static str {
1550 "type.googleapis.com/google.firestore.admin.v1.Database.EncryptionConfig"
1551 }
1552 }
1553
1554 /// Defines additional types related to [EncryptionConfig].
1555 pub mod encryption_config {
1556 #[allow(unused_imports)]
1557 use super::*;
1558
1559 /// The configuration options for using Google default encryption.
1560 #[derive(Clone, Default, PartialEq)]
1561 #[non_exhaustive]
1562 pub struct GoogleDefaultEncryptionOptions {
1563 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1564 }
1565
1566 impl GoogleDefaultEncryptionOptions {
1567 pub fn new() -> Self {
1568 std::default::Default::default()
1569 }
1570 }
1571
1572 impl wkt::message::Message for GoogleDefaultEncryptionOptions {
1573 fn typename() -> &'static str {
1574 "type.googleapis.com/google.firestore.admin.v1.Database.EncryptionConfig.GoogleDefaultEncryptionOptions"
1575 }
1576 }
1577
1578 /// The configuration options for using the same encryption method as the
1579 /// source.
1580 #[derive(Clone, Default, PartialEq)]
1581 #[non_exhaustive]
1582 pub struct SourceEncryptionOptions {
1583 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1584 }
1585
1586 impl SourceEncryptionOptions {
1587 pub fn new() -> Self {
1588 std::default::Default::default()
1589 }
1590 }
1591
1592 impl wkt::message::Message for SourceEncryptionOptions {
1593 fn typename() -> &'static str {
1594 "type.googleapis.com/google.firestore.admin.v1.Database.EncryptionConfig.SourceEncryptionOptions"
1595 }
1596 }
1597
1598 /// The configuration options for using CMEK (Customer Managed Encryption
1599 /// Key) encryption.
1600 #[derive(Clone, Default, PartialEq)]
1601 #[non_exhaustive]
1602 pub struct CustomerManagedEncryptionOptions {
1603 /// Required. Only keys in the same location as the database are allowed to
1604 /// be used for encryption.
1605 ///
1606 /// For Firestore's nam5 multi-region, this corresponds to Cloud KMS
1607 /// multi-region us. For Firestore's eur3 multi-region, this corresponds to
1608 /// Cloud KMS multi-region europe. See
1609 /// <https://cloud.google.com/kms/docs/locations>.
1610 ///
1611 /// The expected format is
1612 /// `projects/{project_id}/locations/{kms_location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
1613 pub kms_key_name: std::string::String,
1614
1615 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1616 }
1617
1618 impl CustomerManagedEncryptionOptions {
1619 pub fn new() -> Self {
1620 std::default::Default::default()
1621 }
1622
1623 /// Sets the value of [kms_key_name][crate::model::database::encryption_config::CustomerManagedEncryptionOptions::kms_key_name].
1624 ///
1625 /// # Example
1626 /// ```ignore,no_run
1627 /// # use google_cloud_firestore_admin_v1::model::database::encryption_config::CustomerManagedEncryptionOptions;
1628 /// let x = CustomerManagedEncryptionOptions::new().set_kms_key_name("example");
1629 /// ```
1630 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
1631 mut self,
1632 v: T,
1633 ) -> Self {
1634 self.kms_key_name = v.into();
1635 self
1636 }
1637 }
1638
1639 impl wkt::message::Message for CustomerManagedEncryptionOptions {
1640 fn typename() -> &'static str {
1641 "type.googleapis.com/google.firestore.admin.v1.Database.EncryptionConfig.CustomerManagedEncryptionOptions"
1642 }
1643 }
1644
1645 /// The method for encrypting the database.
1646 #[derive(Clone, Debug, PartialEq)]
1647 #[non_exhaustive]
1648 pub enum EncryptionType {
1649 /// Use Google default encryption.
1650 GoogleDefaultEncryption(
1651 std::boxed::Box<
1652 crate::model::database::encryption_config::GoogleDefaultEncryptionOptions,
1653 >,
1654 ),
1655 /// The database will use the same encryption configuration as the source.
1656 UseSourceEncryption(
1657 std::boxed::Box<crate::model::database::encryption_config::SourceEncryptionOptions>,
1658 ),
1659 /// Use Customer Managed Encryption Keys (CMEK) for encryption.
1660 CustomerManagedEncryption(
1661 std::boxed::Box<
1662 crate::model::database::encryption_config::CustomerManagedEncryptionOptions,
1663 >,
1664 ),
1665 }
1666 }
1667
1668 /// The type of the database.
1669 /// See <https://cloud.google.com/datastore/docs/firestore-or-datastore> for
1670 /// information about how to choose.
1671 ///
1672 /// Mode changes are only allowed if the database is empty.
1673 ///
1674 /// # Working with unknown values
1675 ///
1676 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1677 /// additional enum variants at any time. Adding new variants is not considered
1678 /// a breaking change. Applications should write their code in anticipation of:
1679 ///
1680 /// - New values appearing in future releases of the client library, **and**
1681 /// - New values received dynamically, without application changes.
1682 ///
1683 /// Please consult the [Working with enums] section in the user guide for some
1684 /// guidelines.
1685 ///
1686 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1687 #[derive(Clone, Debug, PartialEq)]
1688 #[non_exhaustive]
1689 pub enum DatabaseType {
1690 /// Not used.
1691 Unspecified,
1692 /// Firestore Native Mode
1693 FirestoreNative,
1694 /// Firestore in Datastore Mode.
1695 DatastoreMode,
1696 /// If set, the enum was initialized with an unknown value.
1697 ///
1698 /// Applications can examine the value using [DatabaseType::value] or
1699 /// [DatabaseType::name].
1700 UnknownValue(database_type::UnknownValue),
1701 }
1702
1703 #[doc(hidden)]
1704 pub mod database_type {
1705 #[allow(unused_imports)]
1706 use super::*;
1707 #[derive(Clone, Debug, PartialEq)]
1708 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1709 }
1710
1711 impl DatabaseType {
1712 /// Gets the enum value.
1713 ///
1714 /// Returns `None` if the enum contains an unknown value deserialized from
1715 /// the string representation of enums.
1716 pub fn value(&self) -> std::option::Option<i32> {
1717 match self {
1718 Self::Unspecified => std::option::Option::Some(0),
1719 Self::FirestoreNative => std::option::Option::Some(1),
1720 Self::DatastoreMode => std::option::Option::Some(2),
1721 Self::UnknownValue(u) => u.0.value(),
1722 }
1723 }
1724
1725 /// Gets the enum value as a string.
1726 ///
1727 /// Returns `None` if the enum contains an unknown value deserialized from
1728 /// the integer representation of enums.
1729 pub fn name(&self) -> std::option::Option<&str> {
1730 match self {
1731 Self::Unspecified => std::option::Option::Some("DATABASE_TYPE_UNSPECIFIED"),
1732 Self::FirestoreNative => std::option::Option::Some("FIRESTORE_NATIVE"),
1733 Self::DatastoreMode => std::option::Option::Some("DATASTORE_MODE"),
1734 Self::UnknownValue(u) => u.0.name(),
1735 }
1736 }
1737 }
1738
1739 impl std::default::Default for DatabaseType {
1740 fn default() -> Self {
1741 use std::convert::From;
1742 Self::from(0)
1743 }
1744 }
1745
1746 impl std::fmt::Display for DatabaseType {
1747 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1748 wkt::internal::display_enum(f, self.name(), self.value())
1749 }
1750 }
1751
1752 impl std::convert::From<i32> for DatabaseType {
1753 fn from(value: i32) -> Self {
1754 match value {
1755 0 => Self::Unspecified,
1756 1 => Self::FirestoreNative,
1757 2 => Self::DatastoreMode,
1758 _ => Self::UnknownValue(database_type::UnknownValue(
1759 wkt::internal::UnknownEnumValue::Integer(value),
1760 )),
1761 }
1762 }
1763 }
1764
1765 impl std::convert::From<&str> for DatabaseType {
1766 fn from(value: &str) -> Self {
1767 use std::string::ToString;
1768 match value {
1769 "DATABASE_TYPE_UNSPECIFIED" => Self::Unspecified,
1770 "FIRESTORE_NATIVE" => Self::FirestoreNative,
1771 "DATASTORE_MODE" => Self::DatastoreMode,
1772 _ => Self::UnknownValue(database_type::UnknownValue(
1773 wkt::internal::UnknownEnumValue::String(value.to_string()),
1774 )),
1775 }
1776 }
1777 }
1778
1779 impl serde::ser::Serialize for DatabaseType {
1780 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1781 where
1782 S: serde::Serializer,
1783 {
1784 match self {
1785 Self::Unspecified => serializer.serialize_i32(0),
1786 Self::FirestoreNative => serializer.serialize_i32(1),
1787 Self::DatastoreMode => serializer.serialize_i32(2),
1788 Self::UnknownValue(u) => u.0.serialize(serializer),
1789 }
1790 }
1791 }
1792
1793 impl<'de> serde::de::Deserialize<'de> for DatabaseType {
1794 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1795 where
1796 D: serde::Deserializer<'de>,
1797 {
1798 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseType>::new(
1799 ".google.firestore.admin.v1.Database.DatabaseType",
1800 ))
1801 }
1802 }
1803
1804 /// The type of concurrency control mode for transactions.
1805 ///
1806 /// # Working with unknown values
1807 ///
1808 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1809 /// additional enum variants at any time. Adding new variants is not considered
1810 /// a breaking change. Applications should write their code in anticipation of:
1811 ///
1812 /// - New values appearing in future releases of the client library, **and**
1813 /// - New values received dynamically, without application changes.
1814 ///
1815 /// Please consult the [Working with enums] section in the user guide for some
1816 /// guidelines.
1817 ///
1818 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1819 #[derive(Clone, Debug, PartialEq)]
1820 #[non_exhaustive]
1821 pub enum ConcurrencyMode {
1822 /// Not used.
1823 Unspecified,
1824 /// Use optimistic concurrency control by default. This mode is available
1825 /// for Cloud Firestore databases.
1826 ///
1827 /// This is the default setting for Cloud Firestore Enterprise Edition
1828 /// databases.
1829 Optimistic,
1830 /// Use pessimistic concurrency control by default. This mode is available
1831 /// for Cloud Firestore databases.
1832 ///
1833 /// This is the default setting for Cloud Firestore Standard Edition
1834 /// databases.
1835 Pessimistic,
1836 /// Use optimistic concurrency control with entity groups by default.
1837 ///
1838 /// This mode is enabled for some databases that were automatically upgraded
1839 /// from Cloud Datastore to Cloud Firestore with Datastore Mode.
1840 ///
1841 /// It is not recommended for any new databases, and not supported for
1842 /// Firestore Native databases.
1843 OptimisticWithEntityGroups,
1844 /// If set, the enum was initialized with an unknown value.
1845 ///
1846 /// Applications can examine the value using [ConcurrencyMode::value] or
1847 /// [ConcurrencyMode::name].
1848 UnknownValue(concurrency_mode::UnknownValue),
1849 }
1850
1851 #[doc(hidden)]
1852 pub mod concurrency_mode {
1853 #[allow(unused_imports)]
1854 use super::*;
1855 #[derive(Clone, Debug, PartialEq)]
1856 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1857 }
1858
1859 impl ConcurrencyMode {
1860 /// Gets the enum value.
1861 ///
1862 /// Returns `None` if the enum contains an unknown value deserialized from
1863 /// the string representation of enums.
1864 pub fn value(&self) -> std::option::Option<i32> {
1865 match self {
1866 Self::Unspecified => std::option::Option::Some(0),
1867 Self::Optimistic => std::option::Option::Some(1),
1868 Self::Pessimistic => std::option::Option::Some(2),
1869 Self::OptimisticWithEntityGroups => std::option::Option::Some(3),
1870 Self::UnknownValue(u) => u.0.value(),
1871 }
1872 }
1873
1874 /// Gets the enum value as a string.
1875 ///
1876 /// Returns `None` if the enum contains an unknown value deserialized from
1877 /// the integer representation of enums.
1878 pub fn name(&self) -> std::option::Option<&str> {
1879 match self {
1880 Self::Unspecified => std::option::Option::Some("CONCURRENCY_MODE_UNSPECIFIED"),
1881 Self::Optimistic => std::option::Option::Some("OPTIMISTIC"),
1882 Self::Pessimistic => std::option::Option::Some("PESSIMISTIC"),
1883 Self::OptimisticWithEntityGroups => {
1884 std::option::Option::Some("OPTIMISTIC_WITH_ENTITY_GROUPS")
1885 }
1886 Self::UnknownValue(u) => u.0.name(),
1887 }
1888 }
1889 }
1890
1891 impl std::default::Default for ConcurrencyMode {
1892 fn default() -> Self {
1893 use std::convert::From;
1894 Self::from(0)
1895 }
1896 }
1897
1898 impl std::fmt::Display for ConcurrencyMode {
1899 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1900 wkt::internal::display_enum(f, self.name(), self.value())
1901 }
1902 }
1903
1904 impl std::convert::From<i32> for ConcurrencyMode {
1905 fn from(value: i32) -> Self {
1906 match value {
1907 0 => Self::Unspecified,
1908 1 => Self::Optimistic,
1909 2 => Self::Pessimistic,
1910 3 => Self::OptimisticWithEntityGroups,
1911 _ => Self::UnknownValue(concurrency_mode::UnknownValue(
1912 wkt::internal::UnknownEnumValue::Integer(value),
1913 )),
1914 }
1915 }
1916 }
1917
1918 impl std::convert::From<&str> for ConcurrencyMode {
1919 fn from(value: &str) -> Self {
1920 use std::string::ToString;
1921 match value {
1922 "CONCURRENCY_MODE_UNSPECIFIED" => Self::Unspecified,
1923 "OPTIMISTIC" => Self::Optimistic,
1924 "PESSIMISTIC" => Self::Pessimistic,
1925 "OPTIMISTIC_WITH_ENTITY_GROUPS" => Self::OptimisticWithEntityGroups,
1926 _ => Self::UnknownValue(concurrency_mode::UnknownValue(
1927 wkt::internal::UnknownEnumValue::String(value.to_string()),
1928 )),
1929 }
1930 }
1931 }
1932
1933 impl serde::ser::Serialize for ConcurrencyMode {
1934 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1935 where
1936 S: serde::Serializer,
1937 {
1938 match self {
1939 Self::Unspecified => serializer.serialize_i32(0),
1940 Self::Optimistic => serializer.serialize_i32(1),
1941 Self::Pessimistic => serializer.serialize_i32(2),
1942 Self::OptimisticWithEntityGroups => serializer.serialize_i32(3),
1943 Self::UnknownValue(u) => u.0.serialize(serializer),
1944 }
1945 }
1946 }
1947
1948 impl<'de> serde::de::Deserialize<'de> for ConcurrencyMode {
1949 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1950 where
1951 D: serde::Deserializer<'de>,
1952 {
1953 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConcurrencyMode>::new(
1954 ".google.firestore.admin.v1.Database.ConcurrencyMode",
1955 ))
1956 }
1957 }
1958
1959 /// Point In Time Recovery feature enablement.
1960 ///
1961 /// # Working with unknown values
1962 ///
1963 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1964 /// additional enum variants at any time. Adding new variants is not considered
1965 /// a breaking change. Applications should write their code in anticipation of:
1966 ///
1967 /// - New values appearing in future releases of the client library, **and**
1968 /// - New values received dynamically, without application changes.
1969 ///
1970 /// Please consult the [Working with enums] section in the user guide for some
1971 /// guidelines.
1972 ///
1973 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1974 #[derive(Clone, Debug, PartialEq)]
1975 #[non_exhaustive]
1976 pub enum PointInTimeRecoveryEnablement {
1977 /// Not used.
1978 Unspecified,
1979 /// Reads are supported on selected versions of the data from within the past
1980 /// 7 days:
1981 ///
1982 /// * Reads against any timestamp within the past hour
1983 /// * Reads against 1-minute snapshots beyond 1 hour and within 7 days
1984 ///
1985 /// `version_retention_period` and `earliest_version_time` can be
1986 /// used to determine the supported versions.
1987 PointInTimeRecoveryEnabled,
1988 /// Reads are supported on any version of the data from within the past 1
1989 /// hour.
1990 PointInTimeRecoveryDisabled,
1991 /// If set, the enum was initialized with an unknown value.
1992 ///
1993 /// Applications can examine the value using [PointInTimeRecoveryEnablement::value] or
1994 /// [PointInTimeRecoveryEnablement::name].
1995 UnknownValue(point_in_time_recovery_enablement::UnknownValue),
1996 }
1997
1998 #[doc(hidden)]
1999 pub mod point_in_time_recovery_enablement {
2000 #[allow(unused_imports)]
2001 use super::*;
2002 #[derive(Clone, Debug, PartialEq)]
2003 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2004 }
2005
2006 impl PointInTimeRecoveryEnablement {
2007 /// Gets the enum value.
2008 ///
2009 /// Returns `None` if the enum contains an unknown value deserialized from
2010 /// the string representation of enums.
2011 pub fn value(&self) -> std::option::Option<i32> {
2012 match self {
2013 Self::Unspecified => std::option::Option::Some(0),
2014 Self::PointInTimeRecoveryEnabled => std::option::Option::Some(1),
2015 Self::PointInTimeRecoveryDisabled => std::option::Option::Some(2),
2016 Self::UnknownValue(u) => u.0.value(),
2017 }
2018 }
2019
2020 /// Gets the enum value as a string.
2021 ///
2022 /// Returns `None` if the enum contains an unknown value deserialized from
2023 /// the integer representation of enums.
2024 pub fn name(&self) -> std::option::Option<&str> {
2025 match self {
2026 Self::Unspecified => {
2027 std::option::Option::Some("POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED")
2028 }
2029 Self::PointInTimeRecoveryEnabled => {
2030 std::option::Option::Some("POINT_IN_TIME_RECOVERY_ENABLED")
2031 }
2032 Self::PointInTimeRecoveryDisabled => {
2033 std::option::Option::Some("POINT_IN_TIME_RECOVERY_DISABLED")
2034 }
2035 Self::UnknownValue(u) => u.0.name(),
2036 }
2037 }
2038 }
2039
2040 impl std::default::Default for PointInTimeRecoveryEnablement {
2041 fn default() -> Self {
2042 use std::convert::From;
2043 Self::from(0)
2044 }
2045 }
2046
2047 impl std::fmt::Display for PointInTimeRecoveryEnablement {
2048 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2049 wkt::internal::display_enum(f, self.name(), self.value())
2050 }
2051 }
2052
2053 impl std::convert::From<i32> for PointInTimeRecoveryEnablement {
2054 fn from(value: i32) -> Self {
2055 match value {
2056 0 => Self::Unspecified,
2057 1 => Self::PointInTimeRecoveryEnabled,
2058 2 => Self::PointInTimeRecoveryDisabled,
2059 _ => Self::UnknownValue(point_in_time_recovery_enablement::UnknownValue(
2060 wkt::internal::UnknownEnumValue::Integer(value),
2061 )),
2062 }
2063 }
2064 }
2065
2066 impl std::convert::From<&str> for PointInTimeRecoveryEnablement {
2067 fn from(value: &str) -> Self {
2068 use std::string::ToString;
2069 match value {
2070 "POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED" => Self::Unspecified,
2071 "POINT_IN_TIME_RECOVERY_ENABLED" => Self::PointInTimeRecoveryEnabled,
2072 "POINT_IN_TIME_RECOVERY_DISABLED" => Self::PointInTimeRecoveryDisabled,
2073 _ => Self::UnknownValue(point_in_time_recovery_enablement::UnknownValue(
2074 wkt::internal::UnknownEnumValue::String(value.to_string()),
2075 )),
2076 }
2077 }
2078 }
2079
2080 impl serde::ser::Serialize for PointInTimeRecoveryEnablement {
2081 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2082 where
2083 S: serde::Serializer,
2084 {
2085 match self {
2086 Self::Unspecified => serializer.serialize_i32(0),
2087 Self::PointInTimeRecoveryEnabled => serializer.serialize_i32(1),
2088 Self::PointInTimeRecoveryDisabled => serializer.serialize_i32(2),
2089 Self::UnknownValue(u) => u.0.serialize(serializer),
2090 }
2091 }
2092 }
2093
2094 impl<'de> serde::de::Deserialize<'de> for PointInTimeRecoveryEnablement {
2095 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2096 where
2097 D: serde::Deserializer<'de>,
2098 {
2099 deserializer.deserialize_any(
2100 wkt::internal::EnumVisitor::<PointInTimeRecoveryEnablement>::new(
2101 ".google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement",
2102 ),
2103 )
2104 }
2105 }
2106
2107 /// The type of App Engine integration mode.
2108 ///
2109 /// # Working with unknown values
2110 ///
2111 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2112 /// additional enum variants at any time. Adding new variants is not considered
2113 /// a breaking change. Applications should write their code in anticipation of:
2114 ///
2115 /// - New values appearing in future releases of the client library, **and**
2116 /// - New values received dynamically, without application changes.
2117 ///
2118 /// Please consult the [Working with enums] section in the user guide for some
2119 /// guidelines.
2120 ///
2121 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2122 #[derive(Clone, Debug, PartialEq)]
2123 #[non_exhaustive]
2124 pub enum AppEngineIntegrationMode {
2125 /// Not used.
2126 Unspecified,
2127 /// If an App Engine application exists in the same region as this database,
2128 /// App Engine configuration will impact this database. This includes
2129 /// disabling of the application & database, as well as disabling writes to
2130 /// the database.
2131 Enabled,
2132 /// App Engine has no effect on the ability of this database to serve
2133 /// requests.
2134 ///
2135 /// This is the default setting for databases created with the Firestore API.
2136 Disabled,
2137 /// If set, the enum was initialized with an unknown value.
2138 ///
2139 /// Applications can examine the value using [AppEngineIntegrationMode::value] or
2140 /// [AppEngineIntegrationMode::name].
2141 UnknownValue(app_engine_integration_mode::UnknownValue),
2142 }
2143
2144 #[doc(hidden)]
2145 pub mod app_engine_integration_mode {
2146 #[allow(unused_imports)]
2147 use super::*;
2148 #[derive(Clone, Debug, PartialEq)]
2149 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2150 }
2151
2152 impl AppEngineIntegrationMode {
2153 /// Gets the enum value.
2154 ///
2155 /// Returns `None` if the enum contains an unknown value deserialized from
2156 /// the string representation of enums.
2157 pub fn value(&self) -> std::option::Option<i32> {
2158 match self {
2159 Self::Unspecified => std::option::Option::Some(0),
2160 Self::Enabled => std::option::Option::Some(1),
2161 Self::Disabled => std::option::Option::Some(2),
2162 Self::UnknownValue(u) => u.0.value(),
2163 }
2164 }
2165
2166 /// Gets the enum value as a string.
2167 ///
2168 /// Returns `None` if the enum contains an unknown value deserialized from
2169 /// the integer representation of enums.
2170 pub fn name(&self) -> std::option::Option<&str> {
2171 match self {
2172 Self::Unspecified => {
2173 std::option::Option::Some("APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED")
2174 }
2175 Self::Enabled => std::option::Option::Some("ENABLED"),
2176 Self::Disabled => std::option::Option::Some("DISABLED"),
2177 Self::UnknownValue(u) => u.0.name(),
2178 }
2179 }
2180 }
2181
2182 impl std::default::Default for AppEngineIntegrationMode {
2183 fn default() -> Self {
2184 use std::convert::From;
2185 Self::from(0)
2186 }
2187 }
2188
2189 impl std::fmt::Display for AppEngineIntegrationMode {
2190 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2191 wkt::internal::display_enum(f, self.name(), self.value())
2192 }
2193 }
2194
2195 impl std::convert::From<i32> for AppEngineIntegrationMode {
2196 fn from(value: i32) -> Self {
2197 match value {
2198 0 => Self::Unspecified,
2199 1 => Self::Enabled,
2200 2 => Self::Disabled,
2201 _ => Self::UnknownValue(app_engine_integration_mode::UnknownValue(
2202 wkt::internal::UnknownEnumValue::Integer(value),
2203 )),
2204 }
2205 }
2206 }
2207
2208 impl std::convert::From<&str> for AppEngineIntegrationMode {
2209 fn from(value: &str) -> Self {
2210 use std::string::ToString;
2211 match value {
2212 "APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED" => Self::Unspecified,
2213 "ENABLED" => Self::Enabled,
2214 "DISABLED" => Self::Disabled,
2215 _ => Self::UnknownValue(app_engine_integration_mode::UnknownValue(
2216 wkt::internal::UnknownEnumValue::String(value.to_string()),
2217 )),
2218 }
2219 }
2220 }
2221
2222 impl serde::ser::Serialize for AppEngineIntegrationMode {
2223 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2224 where
2225 S: serde::Serializer,
2226 {
2227 match self {
2228 Self::Unspecified => serializer.serialize_i32(0),
2229 Self::Enabled => serializer.serialize_i32(1),
2230 Self::Disabled => serializer.serialize_i32(2),
2231 Self::UnknownValue(u) => u.0.serialize(serializer),
2232 }
2233 }
2234 }
2235
2236 impl<'de> serde::de::Deserialize<'de> for AppEngineIntegrationMode {
2237 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2238 where
2239 D: serde::Deserializer<'de>,
2240 {
2241 deserializer.deserialize_any(
2242 wkt::internal::EnumVisitor::<AppEngineIntegrationMode>::new(
2243 ".google.firestore.admin.v1.Database.AppEngineIntegrationMode",
2244 ),
2245 )
2246 }
2247 }
2248
2249 /// The delete protection state of the database.
2250 ///
2251 /// # Working with unknown values
2252 ///
2253 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2254 /// additional enum variants at any time. Adding new variants is not considered
2255 /// a breaking change. Applications should write their code in anticipation of:
2256 ///
2257 /// - New values appearing in future releases of the client library, **and**
2258 /// - New values received dynamically, without application changes.
2259 ///
2260 /// Please consult the [Working with enums] section in the user guide for some
2261 /// guidelines.
2262 ///
2263 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2264 #[derive(Clone, Debug, PartialEq)]
2265 #[non_exhaustive]
2266 pub enum DeleteProtectionState {
2267 /// The default value. Delete protection type is not specified
2268 Unspecified,
2269 /// Delete protection is disabled
2270 DeleteProtectionDisabled,
2271 /// Delete protection is enabled
2272 DeleteProtectionEnabled,
2273 /// If set, the enum was initialized with an unknown value.
2274 ///
2275 /// Applications can examine the value using [DeleteProtectionState::value] or
2276 /// [DeleteProtectionState::name].
2277 UnknownValue(delete_protection_state::UnknownValue),
2278 }
2279
2280 #[doc(hidden)]
2281 pub mod delete_protection_state {
2282 #[allow(unused_imports)]
2283 use super::*;
2284 #[derive(Clone, Debug, PartialEq)]
2285 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2286 }
2287
2288 impl DeleteProtectionState {
2289 /// Gets the enum value.
2290 ///
2291 /// Returns `None` if the enum contains an unknown value deserialized from
2292 /// the string representation of enums.
2293 pub fn value(&self) -> std::option::Option<i32> {
2294 match self {
2295 Self::Unspecified => std::option::Option::Some(0),
2296 Self::DeleteProtectionDisabled => std::option::Option::Some(1),
2297 Self::DeleteProtectionEnabled => std::option::Option::Some(2),
2298 Self::UnknownValue(u) => u.0.value(),
2299 }
2300 }
2301
2302 /// Gets the enum value as a string.
2303 ///
2304 /// Returns `None` if the enum contains an unknown value deserialized from
2305 /// the integer representation of enums.
2306 pub fn name(&self) -> std::option::Option<&str> {
2307 match self {
2308 Self::Unspecified => {
2309 std::option::Option::Some("DELETE_PROTECTION_STATE_UNSPECIFIED")
2310 }
2311 Self::DeleteProtectionDisabled => {
2312 std::option::Option::Some("DELETE_PROTECTION_DISABLED")
2313 }
2314 Self::DeleteProtectionEnabled => {
2315 std::option::Option::Some("DELETE_PROTECTION_ENABLED")
2316 }
2317 Self::UnknownValue(u) => u.0.name(),
2318 }
2319 }
2320 }
2321
2322 impl std::default::Default for DeleteProtectionState {
2323 fn default() -> Self {
2324 use std::convert::From;
2325 Self::from(0)
2326 }
2327 }
2328
2329 impl std::fmt::Display for DeleteProtectionState {
2330 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2331 wkt::internal::display_enum(f, self.name(), self.value())
2332 }
2333 }
2334
2335 impl std::convert::From<i32> for DeleteProtectionState {
2336 fn from(value: i32) -> Self {
2337 match value {
2338 0 => Self::Unspecified,
2339 1 => Self::DeleteProtectionDisabled,
2340 2 => Self::DeleteProtectionEnabled,
2341 _ => Self::UnknownValue(delete_protection_state::UnknownValue(
2342 wkt::internal::UnknownEnumValue::Integer(value),
2343 )),
2344 }
2345 }
2346 }
2347
2348 impl std::convert::From<&str> for DeleteProtectionState {
2349 fn from(value: &str) -> Self {
2350 use std::string::ToString;
2351 match value {
2352 "DELETE_PROTECTION_STATE_UNSPECIFIED" => Self::Unspecified,
2353 "DELETE_PROTECTION_DISABLED" => Self::DeleteProtectionDisabled,
2354 "DELETE_PROTECTION_ENABLED" => Self::DeleteProtectionEnabled,
2355 _ => Self::UnknownValue(delete_protection_state::UnknownValue(
2356 wkt::internal::UnknownEnumValue::String(value.to_string()),
2357 )),
2358 }
2359 }
2360 }
2361
2362 impl serde::ser::Serialize for DeleteProtectionState {
2363 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2364 where
2365 S: serde::Serializer,
2366 {
2367 match self {
2368 Self::Unspecified => serializer.serialize_i32(0),
2369 Self::DeleteProtectionDisabled => serializer.serialize_i32(1),
2370 Self::DeleteProtectionEnabled => serializer.serialize_i32(2),
2371 Self::UnknownValue(u) => u.0.serialize(serializer),
2372 }
2373 }
2374 }
2375
2376 impl<'de> serde::de::Deserialize<'de> for DeleteProtectionState {
2377 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2378 where
2379 D: serde::Deserializer<'de>,
2380 {
2381 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeleteProtectionState>::new(
2382 ".google.firestore.admin.v1.Database.DeleteProtectionState",
2383 ))
2384 }
2385 }
2386
2387 /// The edition of the database.
2388 ///
2389 /// # Working with unknown values
2390 ///
2391 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2392 /// additional enum variants at any time. Adding new variants is not considered
2393 /// a breaking change. Applications should write their code in anticipation of:
2394 ///
2395 /// - New values appearing in future releases of the client library, **and**
2396 /// - New values received dynamically, without application changes.
2397 ///
2398 /// Please consult the [Working with enums] section in the user guide for some
2399 /// guidelines.
2400 ///
2401 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2402 #[derive(Clone, Debug, PartialEq)]
2403 #[non_exhaustive]
2404 pub enum DatabaseEdition {
2405 /// Not used.
2406 Unspecified,
2407 /// Standard edition.
2408 ///
2409 /// This is the default setting if not specified.
2410 Standard,
2411 /// Enterprise edition.
2412 Enterprise,
2413 /// If set, the enum was initialized with an unknown value.
2414 ///
2415 /// Applications can examine the value using [DatabaseEdition::value] or
2416 /// [DatabaseEdition::name].
2417 UnknownValue(database_edition::UnknownValue),
2418 }
2419
2420 #[doc(hidden)]
2421 pub mod database_edition {
2422 #[allow(unused_imports)]
2423 use super::*;
2424 #[derive(Clone, Debug, PartialEq)]
2425 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2426 }
2427
2428 impl DatabaseEdition {
2429 /// Gets the enum value.
2430 ///
2431 /// Returns `None` if the enum contains an unknown value deserialized from
2432 /// the string representation of enums.
2433 pub fn value(&self) -> std::option::Option<i32> {
2434 match self {
2435 Self::Unspecified => std::option::Option::Some(0),
2436 Self::Standard => std::option::Option::Some(1),
2437 Self::Enterprise => std::option::Option::Some(2),
2438 Self::UnknownValue(u) => u.0.value(),
2439 }
2440 }
2441
2442 /// Gets the enum value as a string.
2443 ///
2444 /// Returns `None` if the enum contains an unknown value deserialized from
2445 /// the integer representation of enums.
2446 pub fn name(&self) -> std::option::Option<&str> {
2447 match self {
2448 Self::Unspecified => std::option::Option::Some("DATABASE_EDITION_UNSPECIFIED"),
2449 Self::Standard => std::option::Option::Some("STANDARD"),
2450 Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
2451 Self::UnknownValue(u) => u.0.name(),
2452 }
2453 }
2454 }
2455
2456 impl std::default::Default for DatabaseEdition {
2457 fn default() -> Self {
2458 use std::convert::From;
2459 Self::from(0)
2460 }
2461 }
2462
2463 impl std::fmt::Display for DatabaseEdition {
2464 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2465 wkt::internal::display_enum(f, self.name(), self.value())
2466 }
2467 }
2468
2469 impl std::convert::From<i32> for DatabaseEdition {
2470 fn from(value: i32) -> Self {
2471 match value {
2472 0 => Self::Unspecified,
2473 1 => Self::Standard,
2474 2 => Self::Enterprise,
2475 _ => Self::UnknownValue(database_edition::UnknownValue(
2476 wkt::internal::UnknownEnumValue::Integer(value),
2477 )),
2478 }
2479 }
2480 }
2481
2482 impl std::convert::From<&str> for DatabaseEdition {
2483 fn from(value: &str) -> Self {
2484 use std::string::ToString;
2485 match value {
2486 "DATABASE_EDITION_UNSPECIFIED" => Self::Unspecified,
2487 "STANDARD" => Self::Standard,
2488 "ENTERPRISE" => Self::Enterprise,
2489 _ => Self::UnknownValue(database_edition::UnknownValue(
2490 wkt::internal::UnknownEnumValue::String(value.to_string()),
2491 )),
2492 }
2493 }
2494 }
2495
2496 impl serde::ser::Serialize for DatabaseEdition {
2497 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2498 where
2499 S: serde::Serializer,
2500 {
2501 match self {
2502 Self::Unspecified => serializer.serialize_i32(0),
2503 Self::Standard => serializer.serialize_i32(1),
2504 Self::Enterprise => serializer.serialize_i32(2),
2505 Self::UnknownValue(u) => u.0.serialize(serializer),
2506 }
2507 }
2508 }
2509
2510 impl<'de> serde::de::Deserialize<'de> for DatabaseEdition {
2511 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2512 where
2513 D: serde::Deserializer<'de>,
2514 {
2515 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseEdition>::new(
2516 ".google.firestore.admin.v1.Database.DatabaseEdition",
2517 ))
2518 }
2519 }
2520
2521 /// The data access mode.
2522 ///
2523 /// # Working with unknown values
2524 ///
2525 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2526 /// additional enum variants at any time. Adding new variants is not considered
2527 /// a breaking change. Applications should write their code in anticipation of:
2528 ///
2529 /// - New values appearing in future releases of the client library, **and**
2530 /// - New values received dynamically, without application changes.
2531 ///
2532 /// Please consult the [Working with enums] section in the user guide for some
2533 /// guidelines.
2534 ///
2535 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2536 #[derive(Clone, Debug, PartialEq)]
2537 #[non_exhaustive]
2538 pub enum DataAccessMode {
2539 /// Not Used.
2540 Unspecified,
2541 /// Accessing the database through the API is allowed.
2542 Enabled,
2543 /// Accessing the database through the API is disallowed.
2544 Disabled,
2545 /// If set, the enum was initialized with an unknown value.
2546 ///
2547 /// Applications can examine the value using [DataAccessMode::value] or
2548 /// [DataAccessMode::name].
2549 UnknownValue(data_access_mode::UnknownValue),
2550 }
2551
2552 #[doc(hidden)]
2553 pub mod data_access_mode {
2554 #[allow(unused_imports)]
2555 use super::*;
2556 #[derive(Clone, Debug, PartialEq)]
2557 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2558 }
2559
2560 impl DataAccessMode {
2561 /// Gets the enum value.
2562 ///
2563 /// Returns `None` if the enum contains an unknown value deserialized from
2564 /// the string representation of enums.
2565 pub fn value(&self) -> std::option::Option<i32> {
2566 match self {
2567 Self::Unspecified => std::option::Option::Some(0),
2568 Self::Enabled => std::option::Option::Some(1),
2569 Self::Disabled => std::option::Option::Some(2),
2570 Self::UnknownValue(u) => u.0.value(),
2571 }
2572 }
2573
2574 /// Gets the enum value as a string.
2575 ///
2576 /// Returns `None` if the enum contains an unknown value deserialized from
2577 /// the integer representation of enums.
2578 pub fn name(&self) -> std::option::Option<&str> {
2579 match self {
2580 Self::Unspecified => std::option::Option::Some("DATA_ACCESS_MODE_UNSPECIFIED"),
2581 Self::Enabled => std::option::Option::Some("DATA_ACCESS_MODE_ENABLED"),
2582 Self::Disabled => std::option::Option::Some("DATA_ACCESS_MODE_DISABLED"),
2583 Self::UnknownValue(u) => u.0.name(),
2584 }
2585 }
2586 }
2587
2588 impl std::default::Default for DataAccessMode {
2589 fn default() -> Self {
2590 use std::convert::From;
2591 Self::from(0)
2592 }
2593 }
2594
2595 impl std::fmt::Display for DataAccessMode {
2596 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2597 wkt::internal::display_enum(f, self.name(), self.value())
2598 }
2599 }
2600
2601 impl std::convert::From<i32> for DataAccessMode {
2602 fn from(value: i32) -> Self {
2603 match value {
2604 0 => Self::Unspecified,
2605 1 => Self::Enabled,
2606 2 => Self::Disabled,
2607 _ => Self::UnknownValue(data_access_mode::UnknownValue(
2608 wkt::internal::UnknownEnumValue::Integer(value),
2609 )),
2610 }
2611 }
2612 }
2613
2614 impl std::convert::From<&str> for DataAccessMode {
2615 fn from(value: &str) -> Self {
2616 use std::string::ToString;
2617 match value {
2618 "DATA_ACCESS_MODE_UNSPECIFIED" => Self::Unspecified,
2619 "DATA_ACCESS_MODE_ENABLED" => Self::Enabled,
2620 "DATA_ACCESS_MODE_DISABLED" => Self::Disabled,
2621 _ => Self::UnknownValue(data_access_mode::UnknownValue(
2622 wkt::internal::UnknownEnumValue::String(value.to_string()),
2623 )),
2624 }
2625 }
2626 }
2627
2628 impl serde::ser::Serialize for DataAccessMode {
2629 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2630 where
2631 S: serde::Serializer,
2632 {
2633 match self {
2634 Self::Unspecified => serializer.serialize_i32(0),
2635 Self::Enabled => serializer.serialize_i32(1),
2636 Self::Disabled => serializer.serialize_i32(2),
2637 Self::UnknownValue(u) => u.0.serialize(serializer),
2638 }
2639 }
2640 }
2641
2642 impl<'de> serde::de::Deserialize<'de> for DataAccessMode {
2643 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2644 where
2645 D: serde::Deserializer<'de>,
2646 {
2647 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataAccessMode>::new(
2648 ".google.firestore.admin.v1.Database.DataAccessMode",
2649 ))
2650 }
2651 }
2652}
2653
2654/// Represents a single field in the database.
2655///
2656/// Fields are grouped by their "Collection Group", which represent all
2657/// collections in the database with the same ID.
2658#[derive(Clone, Default, PartialEq)]
2659#[non_exhaustive]
2660pub struct Field {
2661 /// Required. A field name of the form:
2662 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
2663 ///
2664 /// A field path can be a simple field name, e.g. `address` or a path to fields
2665 /// within `map_value` , e.g. `address.city`,
2666 /// or a special field path. The only valid special field is `*`, which
2667 /// represents any field.
2668 ///
2669 /// Field paths can be quoted using `` ` `` (backtick). The only character that
2670 /// must be escaped within a quoted field path is the backtick character
2671 /// itself, escaped using a backslash. Special characters in field paths that
2672 /// must be quoted include: `*`, `.`,
2673 /// `` ` `` (backtick), `[`, `]`, as well as any ascii symbolic characters.
2674 ///
2675 /// Examples:
2676 /// `` `address.city` `` represents a field named `address.city`, not the map
2677 /// key `city` in the field `address`. `` `*` `` represents a field named `*`,
2678 /// not any field.
2679 ///
2680 /// A special `Field` contains the default indexing settings for all fields.
2681 /// This field's resource name is:
2682 /// `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`
2683 /// Indexes defined on this `Field` will be applied to all fields which do not
2684 /// have their own `Field` index configuration.
2685 pub name: std::string::String,
2686
2687 /// The index configuration for this field. If unset, field indexing will
2688 /// revert to the configuration defined by the `ancestor_field`. To
2689 /// explicitly remove all indexes for this field, specify an index config
2690 /// with an empty list of indexes.
2691 pub index_config: std::option::Option<crate::model::field::IndexConfig>,
2692
2693 /// The TTL configuration for this `Field`.
2694 /// Setting or unsetting this will enable or disable the TTL for
2695 /// documents that have this `Field`.
2696 pub ttl_config: std::option::Option<crate::model::field::TtlConfig>,
2697
2698 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2699}
2700
2701impl Field {
2702 pub fn new() -> Self {
2703 std::default::Default::default()
2704 }
2705
2706 /// Sets the value of [name][crate::model::Field::name].
2707 ///
2708 /// # Example
2709 /// ```ignore,no_run
2710 /// # use google_cloud_firestore_admin_v1::model::Field;
2711 /// let x = Field::new().set_name("example");
2712 /// ```
2713 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2714 self.name = v.into();
2715 self
2716 }
2717
2718 /// Sets the value of [index_config][crate::model::Field::index_config].
2719 ///
2720 /// # Example
2721 /// ```ignore,no_run
2722 /// # use google_cloud_firestore_admin_v1::model::Field;
2723 /// use google_cloud_firestore_admin_v1::model::field::IndexConfig;
2724 /// let x = Field::new().set_index_config(IndexConfig::default()/* use setters */);
2725 /// ```
2726 pub fn set_index_config<T>(mut self, v: T) -> Self
2727 where
2728 T: std::convert::Into<crate::model::field::IndexConfig>,
2729 {
2730 self.index_config = std::option::Option::Some(v.into());
2731 self
2732 }
2733
2734 /// Sets or clears the value of [index_config][crate::model::Field::index_config].
2735 ///
2736 /// # Example
2737 /// ```ignore,no_run
2738 /// # use google_cloud_firestore_admin_v1::model::Field;
2739 /// use google_cloud_firestore_admin_v1::model::field::IndexConfig;
2740 /// let x = Field::new().set_or_clear_index_config(Some(IndexConfig::default()/* use setters */));
2741 /// let x = Field::new().set_or_clear_index_config(None::<IndexConfig>);
2742 /// ```
2743 pub fn set_or_clear_index_config<T>(mut self, v: std::option::Option<T>) -> Self
2744 where
2745 T: std::convert::Into<crate::model::field::IndexConfig>,
2746 {
2747 self.index_config = v.map(|x| x.into());
2748 self
2749 }
2750
2751 /// Sets the value of [ttl_config][crate::model::Field::ttl_config].
2752 ///
2753 /// # Example
2754 /// ```ignore,no_run
2755 /// # use google_cloud_firestore_admin_v1::model::Field;
2756 /// use google_cloud_firestore_admin_v1::model::field::TtlConfig;
2757 /// let x = Field::new().set_ttl_config(TtlConfig::default()/* use setters */);
2758 /// ```
2759 pub fn set_ttl_config<T>(mut self, v: T) -> Self
2760 where
2761 T: std::convert::Into<crate::model::field::TtlConfig>,
2762 {
2763 self.ttl_config = std::option::Option::Some(v.into());
2764 self
2765 }
2766
2767 /// Sets or clears the value of [ttl_config][crate::model::Field::ttl_config].
2768 ///
2769 /// # Example
2770 /// ```ignore,no_run
2771 /// # use google_cloud_firestore_admin_v1::model::Field;
2772 /// use google_cloud_firestore_admin_v1::model::field::TtlConfig;
2773 /// let x = Field::new().set_or_clear_ttl_config(Some(TtlConfig::default()/* use setters */));
2774 /// let x = Field::new().set_or_clear_ttl_config(None::<TtlConfig>);
2775 /// ```
2776 pub fn set_or_clear_ttl_config<T>(mut self, v: std::option::Option<T>) -> Self
2777 where
2778 T: std::convert::Into<crate::model::field::TtlConfig>,
2779 {
2780 self.ttl_config = v.map(|x| x.into());
2781 self
2782 }
2783}
2784
2785impl wkt::message::Message for Field {
2786 fn typename() -> &'static str {
2787 "type.googleapis.com/google.firestore.admin.v1.Field"
2788 }
2789}
2790
2791/// Defines additional types related to [Field].
2792pub mod field {
2793 #[allow(unused_imports)]
2794 use super::*;
2795
2796 /// The index configuration for this field.
2797 #[derive(Clone, Default, PartialEq)]
2798 #[non_exhaustive]
2799 pub struct IndexConfig {
2800 /// The indexes supported for this field.
2801 pub indexes: std::vec::Vec<crate::model::Index>,
2802
2803 /// Output only. When true, the `Field`'s index configuration is set from the
2804 /// configuration specified by the `ancestor_field`.
2805 /// When false, the `Field`'s index configuration is defined explicitly.
2806 pub uses_ancestor_config: bool,
2807
2808 /// Output only. Specifies the resource name of the `Field` from which this
2809 /// field's index configuration is set (when `uses_ancestor_config` is true),
2810 /// or from which it *would* be set if this field had no index configuration
2811 /// (when `uses_ancestor_config` is false).
2812 pub ancestor_field: std::string::String,
2813
2814 /// Output only
2815 /// When true, the `Field`'s index configuration is in the process of being
2816 /// reverted. Once complete, the index config will transition to the same
2817 /// state as the field specified by `ancestor_field`, at which point
2818 /// `uses_ancestor_config` will be `true` and `reverting` will be `false`.
2819 pub reverting: bool,
2820
2821 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2822 }
2823
2824 impl IndexConfig {
2825 pub fn new() -> Self {
2826 std::default::Default::default()
2827 }
2828
2829 /// Sets the value of [indexes][crate::model::field::IndexConfig::indexes].
2830 ///
2831 /// # Example
2832 /// ```ignore,no_run
2833 /// # use google_cloud_firestore_admin_v1::model::field::IndexConfig;
2834 /// use google_cloud_firestore_admin_v1::model::Index;
2835 /// let x = IndexConfig::new()
2836 /// .set_indexes([
2837 /// Index::default()/* use setters */,
2838 /// Index::default()/* use (different) setters */,
2839 /// ]);
2840 /// ```
2841 pub fn set_indexes<T, V>(mut self, v: T) -> Self
2842 where
2843 T: std::iter::IntoIterator<Item = V>,
2844 V: std::convert::Into<crate::model::Index>,
2845 {
2846 use std::iter::Iterator;
2847 self.indexes = v.into_iter().map(|i| i.into()).collect();
2848 self
2849 }
2850
2851 /// Sets the value of [uses_ancestor_config][crate::model::field::IndexConfig::uses_ancestor_config].
2852 ///
2853 /// # Example
2854 /// ```ignore,no_run
2855 /// # use google_cloud_firestore_admin_v1::model::field::IndexConfig;
2856 /// let x = IndexConfig::new().set_uses_ancestor_config(true);
2857 /// ```
2858 pub fn set_uses_ancestor_config<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2859 self.uses_ancestor_config = v.into();
2860 self
2861 }
2862
2863 /// Sets the value of [ancestor_field][crate::model::field::IndexConfig::ancestor_field].
2864 ///
2865 /// # Example
2866 /// ```ignore,no_run
2867 /// # use google_cloud_firestore_admin_v1::model::field::IndexConfig;
2868 /// let x = IndexConfig::new().set_ancestor_field("example");
2869 /// ```
2870 pub fn set_ancestor_field<T: std::convert::Into<std::string::String>>(
2871 mut self,
2872 v: T,
2873 ) -> Self {
2874 self.ancestor_field = v.into();
2875 self
2876 }
2877
2878 /// Sets the value of [reverting][crate::model::field::IndexConfig::reverting].
2879 ///
2880 /// # Example
2881 /// ```ignore,no_run
2882 /// # use google_cloud_firestore_admin_v1::model::field::IndexConfig;
2883 /// let x = IndexConfig::new().set_reverting(true);
2884 /// ```
2885 pub fn set_reverting<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2886 self.reverting = v.into();
2887 self
2888 }
2889 }
2890
2891 impl wkt::message::Message for IndexConfig {
2892 fn typename() -> &'static str {
2893 "type.googleapis.com/google.firestore.admin.v1.Field.IndexConfig"
2894 }
2895 }
2896
2897 /// The TTL (time-to-live) configuration for documents that have this `Field`
2898 /// set.
2899 ///
2900 /// Storing a timestamp value into a TTL-enabled field will be treated as
2901 /// the document's absolute expiration time. For Enterprise edition databases,
2902 /// the timestamp value may also be stored in an array value in the
2903 /// TTL-enabled field.
2904 ///
2905 /// Timestamp values in the past indicate that the document is eligible for
2906 /// immediate expiration. Using any other data type or leaving the field absent
2907 /// will disable expiration for the individual document.
2908 #[derive(Clone, Default, PartialEq)]
2909 #[non_exhaustive]
2910 pub struct TtlConfig {
2911 /// Output only. The state of the TTL configuration.
2912 pub state: crate::model::field::ttl_config::State,
2913
2914 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2915 }
2916
2917 impl TtlConfig {
2918 pub fn new() -> Self {
2919 std::default::Default::default()
2920 }
2921
2922 /// Sets the value of [state][crate::model::field::TtlConfig::state].
2923 ///
2924 /// # Example
2925 /// ```ignore,no_run
2926 /// # use google_cloud_firestore_admin_v1::model::field::TtlConfig;
2927 /// use google_cloud_firestore_admin_v1::model::field::ttl_config::State;
2928 /// let x0 = TtlConfig::new().set_state(State::Creating);
2929 /// let x1 = TtlConfig::new().set_state(State::Active);
2930 /// let x2 = TtlConfig::new().set_state(State::NeedsRepair);
2931 /// ```
2932 pub fn set_state<T: std::convert::Into<crate::model::field::ttl_config::State>>(
2933 mut self,
2934 v: T,
2935 ) -> Self {
2936 self.state = v.into();
2937 self
2938 }
2939 }
2940
2941 impl wkt::message::Message for TtlConfig {
2942 fn typename() -> &'static str {
2943 "type.googleapis.com/google.firestore.admin.v1.Field.TtlConfig"
2944 }
2945 }
2946
2947 /// Defines additional types related to [TtlConfig].
2948 pub mod ttl_config {
2949 #[allow(unused_imports)]
2950 use super::*;
2951
2952 /// The state of applying the TTL configuration to all documents.
2953 ///
2954 /// # Working with unknown values
2955 ///
2956 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2957 /// additional enum variants at any time. Adding new variants is not considered
2958 /// a breaking change. Applications should write their code in anticipation of:
2959 ///
2960 /// - New values appearing in future releases of the client library, **and**
2961 /// - New values received dynamically, without application changes.
2962 ///
2963 /// Please consult the [Working with enums] section in the user guide for some
2964 /// guidelines.
2965 ///
2966 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2967 #[derive(Clone, Debug, PartialEq)]
2968 #[non_exhaustive]
2969 pub enum State {
2970 /// The state is unspecified or unknown.
2971 Unspecified,
2972 /// The TTL is being applied. There is an active long-running operation to
2973 /// track the change. Newly written documents will have TTLs applied as
2974 /// requested. Requested TTLs on existing documents are still being
2975 /// processed. When TTLs on all existing documents have been processed, the
2976 /// state will move to 'ACTIVE'.
2977 Creating,
2978 /// The TTL is active for all documents.
2979 Active,
2980 /// The TTL configuration could not be enabled for all existing documents.
2981 /// Newly written documents will continue to have their TTL applied.
2982 /// The LRO returned when last attempting to enable TTL for this `Field`
2983 /// has failed, and may have more details.
2984 NeedsRepair,
2985 /// If set, the enum was initialized with an unknown value.
2986 ///
2987 /// Applications can examine the value using [State::value] or
2988 /// [State::name].
2989 UnknownValue(state::UnknownValue),
2990 }
2991
2992 #[doc(hidden)]
2993 pub mod state {
2994 #[allow(unused_imports)]
2995 use super::*;
2996 #[derive(Clone, Debug, PartialEq)]
2997 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2998 }
2999
3000 impl State {
3001 /// Gets the enum value.
3002 ///
3003 /// Returns `None` if the enum contains an unknown value deserialized from
3004 /// the string representation of enums.
3005 pub fn value(&self) -> std::option::Option<i32> {
3006 match self {
3007 Self::Unspecified => std::option::Option::Some(0),
3008 Self::Creating => std::option::Option::Some(1),
3009 Self::Active => std::option::Option::Some(2),
3010 Self::NeedsRepair => std::option::Option::Some(3),
3011 Self::UnknownValue(u) => u.0.value(),
3012 }
3013 }
3014
3015 /// Gets the enum value as a string.
3016 ///
3017 /// Returns `None` if the enum contains an unknown value deserialized from
3018 /// the integer representation of enums.
3019 pub fn name(&self) -> std::option::Option<&str> {
3020 match self {
3021 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3022 Self::Creating => std::option::Option::Some("CREATING"),
3023 Self::Active => std::option::Option::Some("ACTIVE"),
3024 Self::NeedsRepair => std::option::Option::Some("NEEDS_REPAIR"),
3025 Self::UnknownValue(u) => u.0.name(),
3026 }
3027 }
3028 }
3029
3030 impl std::default::Default for State {
3031 fn default() -> Self {
3032 use std::convert::From;
3033 Self::from(0)
3034 }
3035 }
3036
3037 impl std::fmt::Display for State {
3038 fn fmt(
3039 &self,
3040 f: &mut std::fmt::Formatter<'_>,
3041 ) -> std::result::Result<(), std::fmt::Error> {
3042 wkt::internal::display_enum(f, self.name(), self.value())
3043 }
3044 }
3045
3046 impl std::convert::From<i32> for State {
3047 fn from(value: i32) -> Self {
3048 match value {
3049 0 => Self::Unspecified,
3050 1 => Self::Creating,
3051 2 => Self::Active,
3052 3 => Self::NeedsRepair,
3053 _ => Self::UnknownValue(state::UnknownValue(
3054 wkt::internal::UnknownEnumValue::Integer(value),
3055 )),
3056 }
3057 }
3058 }
3059
3060 impl std::convert::From<&str> for State {
3061 fn from(value: &str) -> Self {
3062 use std::string::ToString;
3063 match value {
3064 "STATE_UNSPECIFIED" => Self::Unspecified,
3065 "CREATING" => Self::Creating,
3066 "ACTIVE" => Self::Active,
3067 "NEEDS_REPAIR" => Self::NeedsRepair,
3068 _ => Self::UnknownValue(state::UnknownValue(
3069 wkt::internal::UnknownEnumValue::String(value.to_string()),
3070 )),
3071 }
3072 }
3073 }
3074
3075 impl serde::ser::Serialize for State {
3076 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3077 where
3078 S: serde::Serializer,
3079 {
3080 match self {
3081 Self::Unspecified => serializer.serialize_i32(0),
3082 Self::Creating => serializer.serialize_i32(1),
3083 Self::Active => serializer.serialize_i32(2),
3084 Self::NeedsRepair => serializer.serialize_i32(3),
3085 Self::UnknownValue(u) => u.0.serialize(serializer),
3086 }
3087 }
3088 }
3089
3090 impl<'de> serde::de::Deserialize<'de> for State {
3091 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3092 where
3093 D: serde::Deserializer<'de>,
3094 {
3095 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3096 ".google.firestore.admin.v1.Field.TtlConfig.State",
3097 ))
3098 }
3099 }
3100 }
3101}
3102
3103/// A request to list the Firestore Databases in all locations for a project.
3104#[derive(Clone, Default, PartialEq)]
3105#[non_exhaustive]
3106pub struct ListDatabasesRequest {
3107 /// Required. A parent name of the form
3108 /// `projects/{project_id}`
3109 pub parent: std::string::String,
3110
3111 /// If true, also returns deleted resources.
3112 pub show_deleted: bool,
3113
3114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3115}
3116
3117impl ListDatabasesRequest {
3118 pub fn new() -> Self {
3119 std::default::Default::default()
3120 }
3121
3122 /// Sets the value of [parent][crate::model::ListDatabasesRequest::parent].
3123 ///
3124 /// # Example
3125 /// ```ignore,no_run
3126 /// # use google_cloud_firestore_admin_v1::model::ListDatabasesRequest;
3127 /// let x = ListDatabasesRequest::new().set_parent("example");
3128 /// ```
3129 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3130 self.parent = v.into();
3131 self
3132 }
3133
3134 /// Sets the value of [show_deleted][crate::model::ListDatabasesRequest::show_deleted].
3135 ///
3136 /// # Example
3137 /// ```ignore,no_run
3138 /// # use google_cloud_firestore_admin_v1::model::ListDatabasesRequest;
3139 /// let x = ListDatabasesRequest::new().set_show_deleted(true);
3140 /// ```
3141 pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3142 self.show_deleted = v.into();
3143 self
3144 }
3145}
3146
3147impl wkt::message::Message for ListDatabasesRequest {
3148 fn typename() -> &'static str {
3149 "type.googleapis.com/google.firestore.admin.v1.ListDatabasesRequest"
3150 }
3151}
3152
3153/// The request for
3154/// [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.CreateDatabase].
3155///
3156/// [google.firestore.admin.v1.FirestoreAdmin.CreateDatabase]: crate::client::FirestoreAdmin::create_database
3157#[derive(Clone, Default, PartialEq)]
3158#[non_exhaustive]
3159pub struct CreateDatabaseRequest {
3160 /// Required. A parent name of the form
3161 /// `projects/{project_id}`
3162 pub parent: std::string::String,
3163
3164 /// Required. The Database to create.
3165 pub database: std::option::Option<crate::model::Database>,
3166
3167 /// Required. The ID to use for the database, which will become the final
3168 /// component of the database's resource name.
3169 ///
3170 /// This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
3171 /// with first character a letter and the last a letter or a number. Must not
3172 /// be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
3173 ///
3174 /// "(default)" database ID is also valid if the database is Standard edition.
3175 pub database_id: std::string::String,
3176
3177 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3178}
3179
3180impl CreateDatabaseRequest {
3181 pub fn new() -> Self {
3182 std::default::Default::default()
3183 }
3184
3185 /// Sets the value of [parent][crate::model::CreateDatabaseRequest::parent].
3186 ///
3187 /// # Example
3188 /// ```ignore,no_run
3189 /// # use google_cloud_firestore_admin_v1::model::CreateDatabaseRequest;
3190 /// let x = CreateDatabaseRequest::new().set_parent("example");
3191 /// ```
3192 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3193 self.parent = v.into();
3194 self
3195 }
3196
3197 /// Sets the value of [database][crate::model::CreateDatabaseRequest::database].
3198 ///
3199 /// # Example
3200 /// ```ignore,no_run
3201 /// # use google_cloud_firestore_admin_v1::model::CreateDatabaseRequest;
3202 /// use google_cloud_firestore_admin_v1::model::Database;
3203 /// let x = CreateDatabaseRequest::new().set_database(Database::default()/* use setters */);
3204 /// ```
3205 pub fn set_database<T>(mut self, v: T) -> Self
3206 where
3207 T: std::convert::Into<crate::model::Database>,
3208 {
3209 self.database = std::option::Option::Some(v.into());
3210 self
3211 }
3212
3213 /// Sets or clears the value of [database][crate::model::CreateDatabaseRequest::database].
3214 ///
3215 /// # Example
3216 /// ```ignore,no_run
3217 /// # use google_cloud_firestore_admin_v1::model::CreateDatabaseRequest;
3218 /// use google_cloud_firestore_admin_v1::model::Database;
3219 /// let x = CreateDatabaseRequest::new().set_or_clear_database(Some(Database::default()/* use setters */));
3220 /// let x = CreateDatabaseRequest::new().set_or_clear_database(None::<Database>);
3221 /// ```
3222 pub fn set_or_clear_database<T>(mut self, v: std::option::Option<T>) -> Self
3223 where
3224 T: std::convert::Into<crate::model::Database>,
3225 {
3226 self.database = v.map(|x| x.into());
3227 self
3228 }
3229
3230 /// Sets the value of [database_id][crate::model::CreateDatabaseRequest::database_id].
3231 ///
3232 /// # Example
3233 /// ```ignore,no_run
3234 /// # use google_cloud_firestore_admin_v1::model::CreateDatabaseRequest;
3235 /// let x = CreateDatabaseRequest::new().set_database_id("example");
3236 /// ```
3237 pub fn set_database_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3238 self.database_id = v.into();
3239 self
3240 }
3241}
3242
3243impl wkt::message::Message for CreateDatabaseRequest {
3244 fn typename() -> &'static str {
3245 "type.googleapis.com/google.firestore.admin.v1.CreateDatabaseRequest"
3246 }
3247}
3248
3249/// Metadata related to the create database operation.
3250#[derive(Clone, Default, PartialEq)]
3251#[non_exhaustive]
3252pub struct CreateDatabaseMetadata {
3253 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3254}
3255
3256impl CreateDatabaseMetadata {
3257 pub fn new() -> Self {
3258 std::default::Default::default()
3259 }
3260}
3261
3262impl wkt::message::Message for CreateDatabaseMetadata {
3263 fn typename() -> &'static str {
3264 "type.googleapis.com/google.firestore.admin.v1.CreateDatabaseMetadata"
3265 }
3266}
3267
3268/// The list of databases for a project.
3269#[derive(Clone, Default, PartialEq)]
3270#[non_exhaustive]
3271pub struct ListDatabasesResponse {
3272 /// The databases in the project.
3273 pub databases: std::vec::Vec<crate::model::Database>,
3274
3275 /// In the event that data about individual databases cannot be listed they
3276 /// will be recorded here.
3277 ///
3278 /// An example entry might be: projects/some_project/locations/some_location
3279 /// This can happen if the Cloud Region that the Database resides in is
3280 /// currently unavailable. In this case we can't fetch all the details about
3281 /// the database. You may be able to get a more detailed error message
3282 /// (or possibly fetch the resource) by sending a 'Get' request for the
3283 /// resource or a 'List' request for the specific location.
3284 pub unreachable: std::vec::Vec<std::string::String>,
3285
3286 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3287}
3288
3289impl ListDatabasesResponse {
3290 pub fn new() -> Self {
3291 std::default::Default::default()
3292 }
3293
3294 /// Sets the value of [databases][crate::model::ListDatabasesResponse::databases].
3295 ///
3296 /// # Example
3297 /// ```ignore,no_run
3298 /// # use google_cloud_firestore_admin_v1::model::ListDatabasesResponse;
3299 /// use google_cloud_firestore_admin_v1::model::Database;
3300 /// let x = ListDatabasesResponse::new()
3301 /// .set_databases([
3302 /// Database::default()/* use setters */,
3303 /// Database::default()/* use (different) setters */,
3304 /// ]);
3305 /// ```
3306 pub fn set_databases<T, V>(mut self, v: T) -> Self
3307 where
3308 T: std::iter::IntoIterator<Item = V>,
3309 V: std::convert::Into<crate::model::Database>,
3310 {
3311 use std::iter::Iterator;
3312 self.databases = v.into_iter().map(|i| i.into()).collect();
3313 self
3314 }
3315
3316 /// Sets the value of [unreachable][crate::model::ListDatabasesResponse::unreachable].
3317 ///
3318 /// # Example
3319 /// ```ignore,no_run
3320 /// # use google_cloud_firestore_admin_v1::model::ListDatabasesResponse;
3321 /// let x = ListDatabasesResponse::new().set_unreachable(["a", "b", "c"]);
3322 /// ```
3323 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3324 where
3325 T: std::iter::IntoIterator<Item = V>,
3326 V: std::convert::Into<std::string::String>,
3327 {
3328 use std::iter::Iterator;
3329 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3330 self
3331 }
3332}
3333
3334impl wkt::message::Message for ListDatabasesResponse {
3335 fn typename() -> &'static str {
3336 "type.googleapis.com/google.firestore.admin.v1.ListDatabasesResponse"
3337 }
3338}
3339
3340/// The request for
3341/// [FirestoreAdmin.GetDatabase][google.firestore.admin.v1.FirestoreAdmin.GetDatabase].
3342///
3343/// [google.firestore.admin.v1.FirestoreAdmin.GetDatabase]: crate::client::FirestoreAdmin::get_database
3344#[derive(Clone, Default, PartialEq)]
3345#[non_exhaustive]
3346pub struct GetDatabaseRequest {
3347 /// Required. A name of the form
3348 /// `projects/{project_id}/databases/{database_id}`
3349 pub name: std::string::String,
3350
3351 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3352}
3353
3354impl GetDatabaseRequest {
3355 pub fn new() -> Self {
3356 std::default::Default::default()
3357 }
3358
3359 /// Sets the value of [name][crate::model::GetDatabaseRequest::name].
3360 ///
3361 /// # Example
3362 /// ```ignore,no_run
3363 /// # use google_cloud_firestore_admin_v1::model::GetDatabaseRequest;
3364 /// let x = GetDatabaseRequest::new().set_name("example");
3365 /// ```
3366 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3367 self.name = v.into();
3368 self
3369 }
3370}
3371
3372impl wkt::message::Message for GetDatabaseRequest {
3373 fn typename() -> &'static str {
3374 "type.googleapis.com/google.firestore.admin.v1.GetDatabaseRequest"
3375 }
3376}
3377
3378/// The request for
3379/// [FirestoreAdmin.UpdateDatabase][google.firestore.admin.v1.FirestoreAdmin.UpdateDatabase].
3380///
3381/// [google.firestore.admin.v1.FirestoreAdmin.UpdateDatabase]: crate::client::FirestoreAdmin::update_database
3382#[derive(Clone, Default, PartialEq)]
3383#[non_exhaustive]
3384pub struct UpdateDatabaseRequest {
3385 /// Required. The database to update.
3386 pub database: std::option::Option<crate::model::Database>,
3387
3388 /// The list of fields to be updated.
3389 pub update_mask: std::option::Option<wkt::FieldMask>,
3390
3391 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3392}
3393
3394impl UpdateDatabaseRequest {
3395 pub fn new() -> Self {
3396 std::default::Default::default()
3397 }
3398
3399 /// Sets the value of [database][crate::model::UpdateDatabaseRequest::database].
3400 ///
3401 /// # Example
3402 /// ```ignore,no_run
3403 /// # use google_cloud_firestore_admin_v1::model::UpdateDatabaseRequest;
3404 /// use google_cloud_firestore_admin_v1::model::Database;
3405 /// let x = UpdateDatabaseRequest::new().set_database(Database::default()/* use setters */);
3406 /// ```
3407 pub fn set_database<T>(mut self, v: T) -> Self
3408 where
3409 T: std::convert::Into<crate::model::Database>,
3410 {
3411 self.database = std::option::Option::Some(v.into());
3412 self
3413 }
3414
3415 /// Sets or clears the value of [database][crate::model::UpdateDatabaseRequest::database].
3416 ///
3417 /// # Example
3418 /// ```ignore,no_run
3419 /// # use google_cloud_firestore_admin_v1::model::UpdateDatabaseRequest;
3420 /// use google_cloud_firestore_admin_v1::model::Database;
3421 /// let x = UpdateDatabaseRequest::new().set_or_clear_database(Some(Database::default()/* use setters */));
3422 /// let x = UpdateDatabaseRequest::new().set_or_clear_database(None::<Database>);
3423 /// ```
3424 pub fn set_or_clear_database<T>(mut self, v: std::option::Option<T>) -> Self
3425 where
3426 T: std::convert::Into<crate::model::Database>,
3427 {
3428 self.database = v.map(|x| x.into());
3429 self
3430 }
3431
3432 /// Sets the value of [update_mask][crate::model::UpdateDatabaseRequest::update_mask].
3433 ///
3434 /// # Example
3435 /// ```ignore,no_run
3436 /// # use google_cloud_firestore_admin_v1::model::UpdateDatabaseRequest;
3437 /// use wkt::FieldMask;
3438 /// let x = UpdateDatabaseRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3439 /// ```
3440 pub fn set_update_mask<T>(mut self, v: T) -> Self
3441 where
3442 T: std::convert::Into<wkt::FieldMask>,
3443 {
3444 self.update_mask = std::option::Option::Some(v.into());
3445 self
3446 }
3447
3448 /// Sets or clears the value of [update_mask][crate::model::UpdateDatabaseRequest::update_mask].
3449 ///
3450 /// # Example
3451 /// ```ignore,no_run
3452 /// # use google_cloud_firestore_admin_v1::model::UpdateDatabaseRequest;
3453 /// use wkt::FieldMask;
3454 /// let x = UpdateDatabaseRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3455 /// let x = UpdateDatabaseRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3456 /// ```
3457 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3458 where
3459 T: std::convert::Into<wkt::FieldMask>,
3460 {
3461 self.update_mask = v.map(|x| x.into());
3462 self
3463 }
3464}
3465
3466impl wkt::message::Message for UpdateDatabaseRequest {
3467 fn typename() -> &'static str {
3468 "type.googleapis.com/google.firestore.admin.v1.UpdateDatabaseRequest"
3469 }
3470}
3471
3472/// Metadata related to the update database operation.
3473#[derive(Clone, Default, PartialEq)]
3474#[non_exhaustive]
3475pub struct UpdateDatabaseMetadata {
3476 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3477}
3478
3479impl UpdateDatabaseMetadata {
3480 pub fn new() -> Self {
3481 std::default::Default::default()
3482 }
3483}
3484
3485impl wkt::message::Message for UpdateDatabaseMetadata {
3486 fn typename() -> &'static str {
3487 "type.googleapis.com/google.firestore.admin.v1.UpdateDatabaseMetadata"
3488 }
3489}
3490
3491/// The request for
3492/// [FirestoreAdmin.DeleteDatabase][google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase].
3493///
3494/// [google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase]: crate::client::FirestoreAdmin::delete_database
3495#[derive(Clone, Default, PartialEq)]
3496#[non_exhaustive]
3497pub struct DeleteDatabaseRequest {
3498 /// Required. A name of the form
3499 /// `projects/{project_id}/databases/{database_id}`
3500 pub name: std::string::String,
3501
3502 /// The current etag of the Database.
3503 /// If an etag is provided and does not match the current etag of the database,
3504 /// deletion will be blocked and a FAILED_PRECONDITION error will be returned.
3505 pub etag: std::string::String,
3506
3507 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3508}
3509
3510impl DeleteDatabaseRequest {
3511 pub fn new() -> Self {
3512 std::default::Default::default()
3513 }
3514
3515 /// Sets the value of [name][crate::model::DeleteDatabaseRequest::name].
3516 ///
3517 /// # Example
3518 /// ```ignore,no_run
3519 /// # use google_cloud_firestore_admin_v1::model::DeleteDatabaseRequest;
3520 /// let x = DeleteDatabaseRequest::new().set_name("example");
3521 /// ```
3522 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3523 self.name = v.into();
3524 self
3525 }
3526
3527 /// Sets the value of [etag][crate::model::DeleteDatabaseRequest::etag].
3528 ///
3529 /// # Example
3530 /// ```ignore,no_run
3531 /// # use google_cloud_firestore_admin_v1::model::DeleteDatabaseRequest;
3532 /// let x = DeleteDatabaseRequest::new().set_etag("example");
3533 /// ```
3534 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3535 self.etag = v.into();
3536 self
3537 }
3538}
3539
3540impl wkt::message::Message for DeleteDatabaseRequest {
3541 fn typename() -> &'static str {
3542 "type.googleapis.com/google.firestore.admin.v1.DeleteDatabaseRequest"
3543 }
3544}
3545
3546/// Metadata related to the delete database operation.
3547#[derive(Clone, Default, PartialEq)]
3548#[non_exhaustive]
3549pub struct DeleteDatabaseMetadata {
3550 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3551}
3552
3553impl DeleteDatabaseMetadata {
3554 pub fn new() -> Self {
3555 std::default::Default::default()
3556 }
3557}
3558
3559impl wkt::message::Message for DeleteDatabaseMetadata {
3560 fn typename() -> &'static str {
3561 "type.googleapis.com/google.firestore.admin.v1.DeleteDatabaseMetadata"
3562 }
3563}
3564
3565/// The request for
3566/// [FirestoreAdmin.CreateUserCreds][google.firestore.admin.v1.FirestoreAdmin.CreateUserCreds].
3567///
3568/// [google.firestore.admin.v1.FirestoreAdmin.CreateUserCreds]: crate::client::FirestoreAdmin::create_user_creds
3569#[derive(Clone, Default, PartialEq)]
3570#[non_exhaustive]
3571pub struct CreateUserCredsRequest {
3572 /// Required. A parent name of the form
3573 /// `projects/{project_id}/databases/{database_id}`
3574 pub parent: std::string::String,
3575
3576 /// Required. The user creds to create.
3577 pub user_creds: std::option::Option<crate::model::UserCreds>,
3578
3579 /// Required. The ID to use for the user creds, which will become the final
3580 /// component of the user creds's resource name.
3581 ///
3582 /// This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
3583 /// with first character a letter and the last a letter or a number. Must not
3584 /// be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
3585 pub user_creds_id: std::string::String,
3586
3587 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3588}
3589
3590impl CreateUserCredsRequest {
3591 pub fn new() -> Self {
3592 std::default::Default::default()
3593 }
3594
3595 /// Sets the value of [parent][crate::model::CreateUserCredsRequest::parent].
3596 ///
3597 /// # Example
3598 /// ```ignore,no_run
3599 /// # use google_cloud_firestore_admin_v1::model::CreateUserCredsRequest;
3600 /// let x = CreateUserCredsRequest::new().set_parent("example");
3601 /// ```
3602 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3603 self.parent = v.into();
3604 self
3605 }
3606
3607 /// Sets the value of [user_creds][crate::model::CreateUserCredsRequest::user_creds].
3608 ///
3609 /// # Example
3610 /// ```ignore,no_run
3611 /// # use google_cloud_firestore_admin_v1::model::CreateUserCredsRequest;
3612 /// use google_cloud_firestore_admin_v1::model::UserCreds;
3613 /// let x = CreateUserCredsRequest::new().set_user_creds(UserCreds::default()/* use setters */);
3614 /// ```
3615 pub fn set_user_creds<T>(mut self, v: T) -> Self
3616 where
3617 T: std::convert::Into<crate::model::UserCreds>,
3618 {
3619 self.user_creds = std::option::Option::Some(v.into());
3620 self
3621 }
3622
3623 /// Sets or clears the value of [user_creds][crate::model::CreateUserCredsRequest::user_creds].
3624 ///
3625 /// # Example
3626 /// ```ignore,no_run
3627 /// # use google_cloud_firestore_admin_v1::model::CreateUserCredsRequest;
3628 /// use google_cloud_firestore_admin_v1::model::UserCreds;
3629 /// let x = CreateUserCredsRequest::new().set_or_clear_user_creds(Some(UserCreds::default()/* use setters */));
3630 /// let x = CreateUserCredsRequest::new().set_or_clear_user_creds(None::<UserCreds>);
3631 /// ```
3632 pub fn set_or_clear_user_creds<T>(mut self, v: std::option::Option<T>) -> Self
3633 where
3634 T: std::convert::Into<crate::model::UserCreds>,
3635 {
3636 self.user_creds = v.map(|x| x.into());
3637 self
3638 }
3639
3640 /// Sets the value of [user_creds_id][crate::model::CreateUserCredsRequest::user_creds_id].
3641 ///
3642 /// # Example
3643 /// ```ignore,no_run
3644 /// # use google_cloud_firestore_admin_v1::model::CreateUserCredsRequest;
3645 /// let x = CreateUserCredsRequest::new().set_user_creds_id("example");
3646 /// ```
3647 pub fn set_user_creds_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3648 self.user_creds_id = v.into();
3649 self
3650 }
3651}
3652
3653impl wkt::message::Message for CreateUserCredsRequest {
3654 fn typename() -> &'static str {
3655 "type.googleapis.com/google.firestore.admin.v1.CreateUserCredsRequest"
3656 }
3657}
3658
3659/// The request for
3660/// [FirestoreAdmin.GetUserCreds][google.firestore.admin.v1.FirestoreAdmin.GetUserCreds].
3661///
3662/// [google.firestore.admin.v1.FirestoreAdmin.GetUserCreds]: crate::client::FirestoreAdmin::get_user_creds
3663#[derive(Clone, Default, PartialEq)]
3664#[non_exhaustive]
3665pub struct GetUserCredsRequest {
3666 /// Required. A name of the form
3667 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3668 pub name: std::string::String,
3669
3670 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3671}
3672
3673impl GetUserCredsRequest {
3674 pub fn new() -> Self {
3675 std::default::Default::default()
3676 }
3677
3678 /// Sets the value of [name][crate::model::GetUserCredsRequest::name].
3679 ///
3680 /// # Example
3681 /// ```ignore,no_run
3682 /// # use google_cloud_firestore_admin_v1::model::GetUserCredsRequest;
3683 /// let x = GetUserCredsRequest::new().set_name("example");
3684 /// ```
3685 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3686 self.name = v.into();
3687 self
3688 }
3689}
3690
3691impl wkt::message::Message for GetUserCredsRequest {
3692 fn typename() -> &'static str {
3693 "type.googleapis.com/google.firestore.admin.v1.GetUserCredsRequest"
3694 }
3695}
3696
3697/// The request for
3698/// [FirestoreAdmin.ListUserCreds][google.firestore.admin.v1.FirestoreAdmin.ListUserCreds].
3699///
3700/// [google.firestore.admin.v1.FirestoreAdmin.ListUserCreds]: crate::client::FirestoreAdmin::list_user_creds
3701#[derive(Clone, Default, PartialEq)]
3702#[non_exhaustive]
3703pub struct ListUserCredsRequest {
3704 /// Required. A parent database name of the form
3705 /// `projects/{project_id}/databases/{database_id}`
3706 pub parent: std::string::String,
3707
3708 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3709}
3710
3711impl ListUserCredsRequest {
3712 pub fn new() -> Self {
3713 std::default::Default::default()
3714 }
3715
3716 /// Sets the value of [parent][crate::model::ListUserCredsRequest::parent].
3717 ///
3718 /// # Example
3719 /// ```ignore,no_run
3720 /// # use google_cloud_firestore_admin_v1::model::ListUserCredsRequest;
3721 /// let x = ListUserCredsRequest::new().set_parent("example");
3722 /// ```
3723 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3724 self.parent = v.into();
3725 self
3726 }
3727}
3728
3729impl wkt::message::Message for ListUserCredsRequest {
3730 fn typename() -> &'static str {
3731 "type.googleapis.com/google.firestore.admin.v1.ListUserCredsRequest"
3732 }
3733}
3734
3735/// The response for
3736/// [FirestoreAdmin.ListUserCreds][google.firestore.admin.v1.FirestoreAdmin.ListUserCreds].
3737///
3738/// [google.firestore.admin.v1.FirestoreAdmin.ListUserCreds]: crate::client::FirestoreAdmin::list_user_creds
3739#[derive(Clone, Default, PartialEq)]
3740#[non_exhaustive]
3741pub struct ListUserCredsResponse {
3742 /// The user creds for the database.
3743 pub user_creds: std::vec::Vec<crate::model::UserCreds>,
3744
3745 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3746}
3747
3748impl ListUserCredsResponse {
3749 pub fn new() -> Self {
3750 std::default::Default::default()
3751 }
3752
3753 /// Sets the value of [user_creds][crate::model::ListUserCredsResponse::user_creds].
3754 ///
3755 /// # Example
3756 /// ```ignore,no_run
3757 /// # use google_cloud_firestore_admin_v1::model::ListUserCredsResponse;
3758 /// use google_cloud_firestore_admin_v1::model::UserCreds;
3759 /// let x = ListUserCredsResponse::new()
3760 /// .set_user_creds([
3761 /// UserCreds::default()/* use setters */,
3762 /// UserCreds::default()/* use (different) setters */,
3763 /// ]);
3764 /// ```
3765 pub fn set_user_creds<T, V>(mut self, v: T) -> Self
3766 where
3767 T: std::iter::IntoIterator<Item = V>,
3768 V: std::convert::Into<crate::model::UserCreds>,
3769 {
3770 use std::iter::Iterator;
3771 self.user_creds = v.into_iter().map(|i| i.into()).collect();
3772 self
3773 }
3774}
3775
3776impl wkt::message::Message for ListUserCredsResponse {
3777 fn typename() -> &'static str {
3778 "type.googleapis.com/google.firestore.admin.v1.ListUserCredsResponse"
3779 }
3780}
3781
3782/// The request for
3783/// [FirestoreAdmin.EnableUserCreds][google.firestore.admin.v1.FirestoreAdmin.EnableUserCreds].
3784///
3785/// [google.firestore.admin.v1.FirestoreAdmin.EnableUserCreds]: crate::client::FirestoreAdmin::enable_user_creds
3786#[derive(Clone, Default, PartialEq)]
3787#[non_exhaustive]
3788pub struct EnableUserCredsRequest {
3789 /// Required. A name of the form
3790 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3791 pub name: std::string::String,
3792
3793 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3794}
3795
3796impl EnableUserCredsRequest {
3797 pub fn new() -> Self {
3798 std::default::Default::default()
3799 }
3800
3801 /// Sets the value of [name][crate::model::EnableUserCredsRequest::name].
3802 ///
3803 /// # Example
3804 /// ```ignore,no_run
3805 /// # use google_cloud_firestore_admin_v1::model::EnableUserCredsRequest;
3806 /// let x = EnableUserCredsRequest::new().set_name("example");
3807 /// ```
3808 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3809 self.name = v.into();
3810 self
3811 }
3812}
3813
3814impl wkt::message::Message for EnableUserCredsRequest {
3815 fn typename() -> &'static str {
3816 "type.googleapis.com/google.firestore.admin.v1.EnableUserCredsRequest"
3817 }
3818}
3819
3820/// The request for
3821/// [FirestoreAdmin.DisableUserCreds][google.firestore.admin.v1.FirestoreAdmin.DisableUserCreds].
3822///
3823/// [google.firestore.admin.v1.FirestoreAdmin.DisableUserCreds]: crate::client::FirestoreAdmin::disable_user_creds
3824#[derive(Clone, Default, PartialEq)]
3825#[non_exhaustive]
3826pub struct DisableUserCredsRequest {
3827 /// Required. A name of the form
3828 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3829 pub name: std::string::String,
3830
3831 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3832}
3833
3834impl DisableUserCredsRequest {
3835 pub fn new() -> Self {
3836 std::default::Default::default()
3837 }
3838
3839 /// Sets the value of [name][crate::model::DisableUserCredsRequest::name].
3840 ///
3841 /// # Example
3842 /// ```ignore,no_run
3843 /// # use google_cloud_firestore_admin_v1::model::DisableUserCredsRequest;
3844 /// let x = DisableUserCredsRequest::new().set_name("example");
3845 /// ```
3846 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3847 self.name = v.into();
3848 self
3849 }
3850}
3851
3852impl wkt::message::Message for DisableUserCredsRequest {
3853 fn typename() -> &'static str {
3854 "type.googleapis.com/google.firestore.admin.v1.DisableUserCredsRequest"
3855 }
3856}
3857
3858/// The request for
3859/// [FirestoreAdmin.ResetUserPassword][google.firestore.admin.v1.FirestoreAdmin.ResetUserPassword].
3860///
3861/// [google.firestore.admin.v1.FirestoreAdmin.ResetUserPassword]: crate::client::FirestoreAdmin::reset_user_password
3862#[derive(Clone, Default, PartialEq)]
3863#[non_exhaustive]
3864pub struct ResetUserPasswordRequest {
3865 /// Required. A name of the form
3866 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3867 pub name: std::string::String,
3868
3869 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3870}
3871
3872impl ResetUserPasswordRequest {
3873 pub fn new() -> Self {
3874 std::default::Default::default()
3875 }
3876
3877 /// Sets the value of [name][crate::model::ResetUserPasswordRequest::name].
3878 ///
3879 /// # Example
3880 /// ```ignore,no_run
3881 /// # use google_cloud_firestore_admin_v1::model::ResetUserPasswordRequest;
3882 /// let x = ResetUserPasswordRequest::new().set_name("example");
3883 /// ```
3884 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3885 self.name = v.into();
3886 self
3887 }
3888}
3889
3890impl wkt::message::Message for ResetUserPasswordRequest {
3891 fn typename() -> &'static str {
3892 "type.googleapis.com/google.firestore.admin.v1.ResetUserPasswordRequest"
3893 }
3894}
3895
3896/// The request for
3897/// [FirestoreAdmin.DeleteUserCreds][google.firestore.admin.v1.FirestoreAdmin.DeleteUserCreds].
3898///
3899/// [google.firestore.admin.v1.FirestoreAdmin.DeleteUserCreds]: crate::client::FirestoreAdmin::delete_user_creds
3900#[derive(Clone, Default, PartialEq)]
3901#[non_exhaustive]
3902pub struct DeleteUserCredsRequest {
3903 /// Required. A name of the form
3904 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3905 pub name: std::string::String,
3906
3907 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3908}
3909
3910impl DeleteUserCredsRequest {
3911 pub fn new() -> Self {
3912 std::default::Default::default()
3913 }
3914
3915 /// Sets the value of [name][crate::model::DeleteUserCredsRequest::name].
3916 ///
3917 /// # Example
3918 /// ```ignore,no_run
3919 /// # use google_cloud_firestore_admin_v1::model::DeleteUserCredsRequest;
3920 /// let x = DeleteUserCredsRequest::new().set_name("example");
3921 /// ```
3922 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3923 self.name = v.into();
3924 self
3925 }
3926}
3927
3928impl wkt::message::Message for DeleteUserCredsRequest {
3929 fn typename() -> &'static str {
3930 "type.googleapis.com/google.firestore.admin.v1.DeleteUserCredsRequest"
3931 }
3932}
3933
3934/// The request for
3935/// [FirestoreAdmin.CreateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedule].
3936///
3937/// [google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedule]: crate::client::FirestoreAdmin::create_backup_schedule
3938#[derive(Clone, Default, PartialEq)]
3939#[non_exhaustive]
3940pub struct CreateBackupScheduleRequest {
3941 /// Required. The parent database.
3942 ///
3943 /// Format `projects/{project}/databases/{database}`
3944 pub parent: std::string::String,
3945
3946 /// Required. The backup schedule to create.
3947 pub backup_schedule: std::option::Option<crate::model::BackupSchedule>,
3948
3949 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3950}
3951
3952impl CreateBackupScheduleRequest {
3953 pub fn new() -> Self {
3954 std::default::Default::default()
3955 }
3956
3957 /// Sets the value of [parent][crate::model::CreateBackupScheduleRequest::parent].
3958 ///
3959 /// # Example
3960 /// ```ignore,no_run
3961 /// # use google_cloud_firestore_admin_v1::model::CreateBackupScheduleRequest;
3962 /// let x = CreateBackupScheduleRequest::new().set_parent("example");
3963 /// ```
3964 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3965 self.parent = v.into();
3966 self
3967 }
3968
3969 /// Sets the value of [backup_schedule][crate::model::CreateBackupScheduleRequest::backup_schedule].
3970 ///
3971 /// # Example
3972 /// ```ignore,no_run
3973 /// # use google_cloud_firestore_admin_v1::model::CreateBackupScheduleRequest;
3974 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
3975 /// let x = CreateBackupScheduleRequest::new().set_backup_schedule(BackupSchedule::default()/* use setters */);
3976 /// ```
3977 pub fn set_backup_schedule<T>(mut self, v: T) -> Self
3978 where
3979 T: std::convert::Into<crate::model::BackupSchedule>,
3980 {
3981 self.backup_schedule = std::option::Option::Some(v.into());
3982 self
3983 }
3984
3985 /// Sets or clears the value of [backup_schedule][crate::model::CreateBackupScheduleRequest::backup_schedule].
3986 ///
3987 /// # Example
3988 /// ```ignore,no_run
3989 /// # use google_cloud_firestore_admin_v1::model::CreateBackupScheduleRequest;
3990 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
3991 /// let x = CreateBackupScheduleRequest::new().set_or_clear_backup_schedule(Some(BackupSchedule::default()/* use setters */));
3992 /// let x = CreateBackupScheduleRequest::new().set_or_clear_backup_schedule(None::<BackupSchedule>);
3993 /// ```
3994 pub fn set_or_clear_backup_schedule<T>(mut self, v: std::option::Option<T>) -> Self
3995 where
3996 T: std::convert::Into<crate::model::BackupSchedule>,
3997 {
3998 self.backup_schedule = v.map(|x| x.into());
3999 self
4000 }
4001}
4002
4003impl wkt::message::Message for CreateBackupScheduleRequest {
4004 fn typename() -> &'static str {
4005 "type.googleapis.com/google.firestore.admin.v1.CreateBackupScheduleRequest"
4006 }
4007}
4008
4009/// The request for
4010/// [FirestoreAdmin.GetBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.GetBackupSchedule].
4011///
4012/// [google.firestore.admin.v1.FirestoreAdmin.GetBackupSchedule]: crate::client::FirestoreAdmin::get_backup_schedule
4013#[derive(Clone, Default, PartialEq)]
4014#[non_exhaustive]
4015pub struct GetBackupScheduleRequest {
4016 /// Required. The name of the backup schedule.
4017 ///
4018 /// Format
4019 /// `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
4020 pub name: std::string::String,
4021
4022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4023}
4024
4025impl GetBackupScheduleRequest {
4026 pub fn new() -> Self {
4027 std::default::Default::default()
4028 }
4029
4030 /// Sets the value of [name][crate::model::GetBackupScheduleRequest::name].
4031 ///
4032 /// # Example
4033 /// ```ignore,no_run
4034 /// # use google_cloud_firestore_admin_v1::model::GetBackupScheduleRequest;
4035 /// let x = GetBackupScheduleRequest::new().set_name("example");
4036 /// ```
4037 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4038 self.name = v.into();
4039 self
4040 }
4041}
4042
4043impl wkt::message::Message for GetBackupScheduleRequest {
4044 fn typename() -> &'static str {
4045 "type.googleapis.com/google.firestore.admin.v1.GetBackupScheduleRequest"
4046 }
4047}
4048
4049/// The request for
4050/// [FirestoreAdmin.UpdateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedule].
4051///
4052/// [google.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedule]: crate::client::FirestoreAdmin::update_backup_schedule
4053#[derive(Clone, Default, PartialEq)]
4054#[non_exhaustive]
4055pub struct UpdateBackupScheduleRequest {
4056 /// Required. The backup schedule to update.
4057 pub backup_schedule: std::option::Option<crate::model::BackupSchedule>,
4058
4059 /// The list of fields to be updated.
4060 pub update_mask: std::option::Option<wkt::FieldMask>,
4061
4062 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4063}
4064
4065impl UpdateBackupScheduleRequest {
4066 pub fn new() -> Self {
4067 std::default::Default::default()
4068 }
4069
4070 /// Sets the value of [backup_schedule][crate::model::UpdateBackupScheduleRequest::backup_schedule].
4071 ///
4072 /// # Example
4073 /// ```ignore,no_run
4074 /// # use google_cloud_firestore_admin_v1::model::UpdateBackupScheduleRequest;
4075 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
4076 /// let x = UpdateBackupScheduleRequest::new().set_backup_schedule(BackupSchedule::default()/* use setters */);
4077 /// ```
4078 pub fn set_backup_schedule<T>(mut self, v: T) -> Self
4079 where
4080 T: std::convert::Into<crate::model::BackupSchedule>,
4081 {
4082 self.backup_schedule = std::option::Option::Some(v.into());
4083 self
4084 }
4085
4086 /// Sets or clears the value of [backup_schedule][crate::model::UpdateBackupScheduleRequest::backup_schedule].
4087 ///
4088 /// # Example
4089 /// ```ignore,no_run
4090 /// # use google_cloud_firestore_admin_v1::model::UpdateBackupScheduleRequest;
4091 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
4092 /// let x = UpdateBackupScheduleRequest::new().set_or_clear_backup_schedule(Some(BackupSchedule::default()/* use setters */));
4093 /// let x = UpdateBackupScheduleRequest::new().set_or_clear_backup_schedule(None::<BackupSchedule>);
4094 /// ```
4095 pub fn set_or_clear_backup_schedule<T>(mut self, v: std::option::Option<T>) -> Self
4096 where
4097 T: std::convert::Into<crate::model::BackupSchedule>,
4098 {
4099 self.backup_schedule = v.map(|x| x.into());
4100 self
4101 }
4102
4103 /// Sets the value of [update_mask][crate::model::UpdateBackupScheduleRequest::update_mask].
4104 ///
4105 /// # Example
4106 /// ```ignore,no_run
4107 /// # use google_cloud_firestore_admin_v1::model::UpdateBackupScheduleRequest;
4108 /// use wkt::FieldMask;
4109 /// let x = UpdateBackupScheduleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4110 /// ```
4111 pub fn set_update_mask<T>(mut self, v: T) -> Self
4112 where
4113 T: std::convert::Into<wkt::FieldMask>,
4114 {
4115 self.update_mask = std::option::Option::Some(v.into());
4116 self
4117 }
4118
4119 /// Sets or clears the value of [update_mask][crate::model::UpdateBackupScheduleRequest::update_mask].
4120 ///
4121 /// # Example
4122 /// ```ignore,no_run
4123 /// # use google_cloud_firestore_admin_v1::model::UpdateBackupScheduleRequest;
4124 /// use wkt::FieldMask;
4125 /// let x = UpdateBackupScheduleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4126 /// let x = UpdateBackupScheduleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4127 /// ```
4128 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4129 where
4130 T: std::convert::Into<wkt::FieldMask>,
4131 {
4132 self.update_mask = v.map(|x| x.into());
4133 self
4134 }
4135}
4136
4137impl wkt::message::Message for UpdateBackupScheduleRequest {
4138 fn typename() -> &'static str {
4139 "type.googleapis.com/google.firestore.admin.v1.UpdateBackupScheduleRequest"
4140 }
4141}
4142
4143/// The request for
4144/// [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules].
4145///
4146/// [google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules]: crate::client::FirestoreAdmin::list_backup_schedules
4147#[derive(Clone, Default, PartialEq)]
4148#[non_exhaustive]
4149pub struct ListBackupSchedulesRequest {
4150 /// Required. The parent database.
4151 ///
4152 /// Format is `projects/{project}/databases/{database}`.
4153 pub parent: std::string::String,
4154
4155 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4156}
4157
4158impl ListBackupSchedulesRequest {
4159 pub fn new() -> Self {
4160 std::default::Default::default()
4161 }
4162
4163 /// Sets the value of [parent][crate::model::ListBackupSchedulesRequest::parent].
4164 ///
4165 /// # Example
4166 /// ```ignore,no_run
4167 /// # use google_cloud_firestore_admin_v1::model::ListBackupSchedulesRequest;
4168 /// let x = ListBackupSchedulesRequest::new().set_parent("example");
4169 /// ```
4170 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4171 self.parent = v.into();
4172 self
4173 }
4174}
4175
4176impl wkt::message::Message for ListBackupSchedulesRequest {
4177 fn typename() -> &'static str {
4178 "type.googleapis.com/google.firestore.admin.v1.ListBackupSchedulesRequest"
4179 }
4180}
4181
4182/// The response for
4183/// [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules].
4184///
4185/// [google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules]: crate::client::FirestoreAdmin::list_backup_schedules
4186#[derive(Clone, Default, PartialEq)]
4187#[non_exhaustive]
4188pub struct ListBackupSchedulesResponse {
4189 /// List of all backup schedules.
4190 pub backup_schedules: std::vec::Vec<crate::model::BackupSchedule>,
4191
4192 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4193}
4194
4195impl ListBackupSchedulesResponse {
4196 pub fn new() -> Self {
4197 std::default::Default::default()
4198 }
4199
4200 /// Sets the value of [backup_schedules][crate::model::ListBackupSchedulesResponse::backup_schedules].
4201 ///
4202 /// # Example
4203 /// ```ignore,no_run
4204 /// # use google_cloud_firestore_admin_v1::model::ListBackupSchedulesResponse;
4205 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
4206 /// let x = ListBackupSchedulesResponse::new()
4207 /// .set_backup_schedules([
4208 /// BackupSchedule::default()/* use setters */,
4209 /// BackupSchedule::default()/* use (different) setters */,
4210 /// ]);
4211 /// ```
4212 pub fn set_backup_schedules<T, V>(mut self, v: T) -> Self
4213 where
4214 T: std::iter::IntoIterator<Item = V>,
4215 V: std::convert::Into<crate::model::BackupSchedule>,
4216 {
4217 use std::iter::Iterator;
4218 self.backup_schedules = v.into_iter().map(|i| i.into()).collect();
4219 self
4220 }
4221}
4222
4223impl wkt::message::Message for ListBackupSchedulesResponse {
4224 fn typename() -> &'static str {
4225 "type.googleapis.com/google.firestore.admin.v1.ListBackupSchedulesResponse"
4226 }
4227}
4228
4229/// The request for [FirestoreAdmin.DeleteBackupSchedules][].
4230#[derive(Clone, Default, PartialEq)]
4231#[non_exhaustive]
4232pub struct DeleteBackupScheduleRequest {
4233 /// Required. The name of the backup schedule.
4234 ///
4235 /// Format
4236 /// `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
4237 pub name: std::string::String,
4238
4239 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4240}
4241
4242impl DeleteBackupScheduleRequest {
4243 pub fn new() -> Self {
4244 std::default::Default::default()
4245 }
4246
4247 /// Sets the value of [name][crate::model::DeleteBackupScheduleRequest::name].
4248 ///
4249 /// # Example
4250 /// ```ignore,no_run
4251 /// # use google_cloud_firestore_admin_v1::model::DeleteBackupScheduleRequest;
4252 /// let x = DeleteBackupScheduleRequest::new().set_name("example");
4253 /// ```
4254 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4255 self.name = v.into();
4256 self
4257 }
4258}
4259
4260impl wkt::message::Message for DeleteBackupScheduleRequest {
4261 fn typename() -> &'static str {
4262 "type.googleapis.com/google.firestore.admin.v1.DeleteBackupScheduleRequest"
4263 }
4264}
4265
4266/// The request for
4267/// [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
4268///
4269/// [google.firestore.admin.v1.FirestoreAdmin.CreateIndex]: crate::client::FirestoreAdmin::create_index
4270#[derive(Clone, Default, PartialEq)]
4271#[non_exhaustive]
4272pub struct CreateIndexRequest {
4273 /// Required. A parent name of the form
4274 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
4275 pub parent: std::string::String,
4276
4277 /// Required. The composite index to create.
4278 pub index: std::option::Option<crate::model::Index>,
4279
4280 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4281}
4282
4283impl CreateIndexRequest {
4284 pub fn new() -> Self {
4285 std::default::Default::default()
4286 }
4287
4288 /// Sets the value of [parent][crate::model::CreateIndexRequest::parent].
4289 ///
4290 /// # Example
4291 /// ```ignore,no_run
4292 /// # use google_cloud_firestore_admin_v1::model::CreateIndexRequest;
4293 /// let x = CreateIndexRequest::new().set_parent("example");
4294 /// ```
4295 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4296 self.parent = v.into();
4297 self
4298 }
4299
4300 /// Sets the value of [index][crate::model::CreateIndexRequest::index].
4301 ///
4302 /// # Example
4303 /// ```ignore,no_run
4304 /// # use google_cloud_firestore_admin_v1::model::CreateIndexRequest;
4305 /// use google_cloud_firestore_admin_v1::model::Index;
4306 /// let x = CreateIndexRequest::new().set_index(Index::default()/* use setters */);
4307 /// ```
4308 pub fn set_index<T>(mut self, v: T) -> Self
4309 where
4310 T: std::convert::Into<crate::model::Index>,
4311 {
4312 self.index = std::option::Option::Some(v.into());
4313 self
4314 }
4315
4316 /// Sets or clears the value of [index][crate::model::CreateIndexRequest::index].
4317 ///
4318 /// # Example
4319 /// ```ignore,no_run
4320 /// # use google_cloud_firestore_admin_v1::model::CreateIndexRequest;
4321 /// use google_cloud_firestore_admin_v1::model::Index;
4322 /// let x = CreateIndexRequest::new().set_or_clear_index(Some(Index::default()/* use setters */));
4323 /// let x = CreateIndexRequest::new().set_or_clear_index(None::<Index>);
4324 /// ```
4325 pub fn set_or_clear_index<T>(mut self, v: std::option::Option<T>) -> Self
4326 where
4327 T: std::convert::Into<crate::model::Index>,
4328 {
4329 self.index = v.map(|x| x.into());
4330 self
4331 }
4332}
4333
4334impl wkt::message::Message for CreateIndexRequest {
4335 fn typename() -> &'static str {
4336 "type.googleapis.com/google.firestore.admin.v1.CreateIndexRequest"
4337 }
4338}
4339
4340/// The request for
4341/// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes].
4342///
4343/// [google.firestore.admin.v1.FirestoreAdmin.ListIndexes]: crate::client::FirestoreAdmin::list_indexes
4344#[derive(Clone, Default, PartialEq)]
4345#[non_exhaustive]
4346pub struct ListIndexesRequest {
4347 /// Required. A parent name of the form
4348 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
4349 pub parent: std::string::String,
4350
4351 /// The filter to apply to list results.
4352 pub filter: std::string::String,
4353
4354 /// The number of results to return.
4355 pub page_size: i32,
4356
4357 /// A page token, returned from a previous call to
4358 /// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes],
4359 /// that may be used to get the next page of results.
4360 ///
4361 /// [google.firestore.admin.v1.FirestoreAdmin.ListIndexes]: crate::client::FirestoreAdmin::list_indexes
4362 pub page_token: std::string::String,
4363
4364 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4365}
4366
4367impl ListIndexesRequest {
4368 pub fn new() -> Self {
4369 std::default::Default::default()
4370 }
4371
4372 /// Sets the value of [parent][crate::model::ListIndexesRequest::parent].
4373 ///
4374 /// # Example
4375 /// ```ignore,no_run
4376 /// # use google_cloud_firestore_admin_v1::model::ListIndexesRequest;
4377 /// let x = ListIndexesRequest::new().set_parent("example");
4378 /// ```
4379 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4380 self.parent = v.into();
4381 self
4382 }
4383
4384 /// Sets the value of [filter][crate::model::ListIndexesRequest::filter].
4385 ///
4386 /// # Example
4387 /// ```ignore,no_run
4388 /// # use google_cloud_firestore_admin_v1::model::ListIndexesRequest;
4389 /// let x = ListIndexesRequest::new().set_filter("example");
4390 /// ```
4391 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4392 self.filter = v.into();
4393 self
4394 }
4395
4396 /// Sets the value of [page_size][crate::model::ListIndexesRequest::page_size].
4397 ///
4398 /// # Example
4399 /// ```ignore,no_run
4400 /// # use google_cloud_firestore_admin_v1::model::ListIndexesRequest;
4401 /// let x = ListIndexesRequest::new().set_page_size(42);
4402 /// ```
4403 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4404 self.page_size = v.into();
4405 self
4406 }
4407
4408 /// Sets the value of [page_token][crate::model::ListIndexesRequest::page_token].
4409 ///
4410 /// # Example
4411 /// ```ignore,no_run
4412 /// # use google_cloud_firestore_admin_v1::model::ListIndexesRequest;
4413 /// let x = ListIndexesRequest::new().set_page_token("example");
4414 /// ```
4415 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4416 self.page_token = v.into();
4417 self
4418 }
4419}
4420
4421impl wkt::message::Message for ListIndexesRequest {
4422 fn typename() -> &'static str {
4423 "type.googleapis.com/google.firestore.admin.v1.ListIndexesRequest"
4424 }
4425}
4426
4427/// The response for
4428/// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes].
4429///
4430/// [google.firestore.admin.v1.FirestoreAdmin.ListIndexes]: crate::client::FirestoreAdmin::list_indexes
4431#[derive(Clone, Default, PartialEq)]
4432#[non_exhaustive]
4433pub struct ListIndexesResponse {
4434 /// The requested indexes.
4435 pub indexes: std::vec::Vec<crate::model::Index>,
4436
4437 /// A page token that may be used to request another page of results. If blank,
4438 /// this is the last page.
4439 pub next_page_token: std::string::String,
4440
4441 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4442}
4443
4444impl ListIndexesResponse {
4445 pub fn new() -> Self {
4446 std::default::Default::default()
4447 }
4448
4449 /// Sets the value of [indexes][crate::model::ListIndexesResponse::indexes].
4450 ///
4451 /// # Example
4452 /// ```ignore,no_run
4453 /// # use google_cloud_firestore_admin_v1::model::ListIndexesResponse;
4454 /// use google_cloud_firestore_admin_v1::model::Index;
4455 /// let x = ListIndexesResponse::new()
4456 /// .set_indexes([
4457 /// Index::default()/* use setters */,
4458 /// Index::default()/* use (different) setters */,
4459 /// ]);
4460 /// ```
4461 pub fn set_indexes<T, V>(mut self, v: T) -> Self
4462 where
4463 T: std::iter::IntoIterator<Item = V>,
4464 V: std::convert::Into<crate::model::Index>,
4465 {
4466 use std::iter::Iterator;
4467 self.indexes = v.into_iter().map(|i| i.into()).collect();
4468 self
4469 }
4470
4471 /// Sets the value of [next_page_token][crate::model::ListIndexesResponse::next_page_token].
4472 ///
4473 /// # Example
4474 /// ```ignore,no_run
4475 /// # use google_cloud_firestore_admin_v1::model::ListIndexesResponse;
4476 /// let x = ListIndexesResponse::new().set_next_page_token("example");
4477 /// ```
4478 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4479 self.next_page_token = v.into();
4480 self
4481 }
4482}
4483
4484impl wkt::message::Message for ListIndexesResponse {
4485 fn typename() -> &'static str {
4486 "type.googleapis.com/google.firestore.admin.v1.ListIndexesResponse"
4487 }
4488}
4489
4490#[doc(hidden)]
4491impl google_cloud_gax::paginator::internal::PageableResponse for ListIndexesResponse {
4492 type PageItem = crate::model::Index;
4493
4494 fn items(self) -> std::vec::Vec<Self::PageItem> {
4495 self.indexes
4496 }
4497
4498 fn next_page_token(&self) -> std::string::String {
4499 use std::clone::Clone;
4500 self.next_page_token.clone()
4501 }
4502}
4503
4504/// The request for
4505/// [FirestoreAdmin.GetIndex][google.firestore.admin.v1.FirestoreAdmin.GetIndex].
4506///
4507/// [google.firestore.admin.v1.FirestoreAdmin.GetIndex]: crate::client::FirestoreAdmin::get_index
4508#[derive(Clone, Default, PartialEq)]
4509#[non_exhaustive]
4510pub struct GetIndexRequest {
4511 /// Required. A name of the form
4512 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
4513 pub name: std::string::String,
4514
4515 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4516}
4517
4518impl GetIndexRequest {
4519 pub fn new() -> Self {
4520 std::default::Default::default()
4521 }
4522
4523 /// Sets the value of [name][crate::model::GetIndexRequest::name].
4524 ///
4525 /// # Example
4526 /// ```ignore,no_run
4527 /// # use google_cloud_firestore_admin_v1::model::GetIndexRequest;
4528 /// let x = GetIndexRequest::new().set_name("example");
4529 /// ```
4530 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4531 self.name = v.into();
4532 self
4533 }
4534}
4535
4536impl wkt::message::Message for GetIndexRequest {
4537 fn typename() -> &'static str {
4538 "type.googleapis.com/google.firestore.admin.v1.GetIndexRequest"
4539 }
4540}
4541
4542/// The request for
4543/// [FirestoreAdmin.DeleteIndex][google.firestore.admin.v1.FirestoreAdmin.DeleteIndex].
4544///
4545/// [google.firestore.admin.v1.FirestoreAdmin.DeleteIndex]: crate::client::FirestoreAdmin::delete_index
4546#[derive(Clone, Default, PartialEq)]
4547#[non_exhaustive]
4548pub struct DeleteIndexRequest {
4549 /// Required. A name of the form
4550 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
4551 pub name: std::string::String,
4552
4553 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4554}
4555
4556impl DeleteIndexRequest {
4557 pub fn new() -> Self {
4558 std::default::Default::default()
4559 }
4560
4561 /// Sets the value of [name][crate::model::DeleteIndexRequest::name].
4562 ///
4563 /// # Example
4564 /// ```ignore,no_run
4565 /// # use google_cloud_firestore_admin_v1::model::DeleteIndexRequest;
4566 /// let x = DeleteIndexRequest::new().set_name("example");
4567 /// ```
4568 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4569 self.name = v.into();
4570 self
4571 }
4572}
4573
4574impl wkt::message::Message for DeleteIndexRequest {
4575 fn typename() -> &'static str {
4576 "type.googleapis.com/google.firestore.admin.v1.DeleteIndexRequest"
4577 }
4578}
4579
4580/// The request for
4581/// [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField].
4582///
4583/// [google.firestore.admin.v1.FirestoreAdmin.UpdateField]: crate::client::FirestoreAdmin::update_field
4584#[derive(Clone, Default, PartialEq)]
4585#[non_exhaustive]
4586pub struct UpdateFieldRequest {
4587 /// Required. The field to be updated.
4588 pub field: std::option::Option<crate::model::Field>,
4589
4590 /// A mask, relative to the field. If specified, only configuration specified
4591 /// by this field_mask will be updated in the field.
4592 pub update_mask: std::option::Option<wkt::FieldMask>,
4593
4594 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4595}
4596
4597impl UpdateFieldRequest {
4598 pub fn new() -> Self {
4599 std::default::Default::default()
4600 }
4601
4602 /// Sets the value of [field][crate::model::UpdateFieldRequest::field].
4603 ///
4604 /// # Example
4605 /// ```ignore,no_run
4606 /// # use google_cloud_firestore_admin_v1::model::UpdateFieldRequest;
4607 /// use google_cloud_firestore_admin_v1::model::Field;
4608 /// let x = UpdateFieldRequest::new().set_field(Field::default()/* use setters */);
4609 /// ```
4610 pub fn set_field<T>(mut self, v: T) -> Self
4611 where
4612 T: std::convert::Into<crate::model::Field>,
4613 {
4614 self.field = std::option::Option::Some(v.into());
4615 self
4616 }
4617
4618 /// Sets or clears the value of [field][crate::model::UpdateFieldRequest::field].
4619 ///
4620 /// # Example
4621 /// ```ignore,no_run
4622 /// # use google_cloud_firestore_admin_v1::model::UpdateFieldRequest;
4623 /// use google_cloud_firestore_admin_v1::model::Field;
4624 /// let x = UpdateFieldRequest::new().set_or_clear_field(Some(Field::default()/* use setters */));
4625 /// let x = UpdateFieldRequest::new().set_or_clear_field(None::<Field>);
4626 /// ```
4627 pub fn set_or_clear_field<T>(mut self, v: std::option::Option<T>) -> Self
4628 where
4629 T: std::convert::Into<crate::model::Field>,
4630 {
4631 self.field = v.map(|x| x.into());
4632 self
4633 }
4634
4635 /// Sets the value of [update_mask][crate::model::UpdateFieldRequest::update_mask].
4636 ///
4637 /// # Example
4638 /// ```ignore,no_run
4639 /// # use google_cloud_firestore_admin_v1::model::UpdateFieldRequest;
4640 /// use wkt::FieldMask;
4641 /// let x = UpdateFieldRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4642 /// ```
4643 pub fn set_update_mask<T>(mut self, v: T) -> Self
4644 where
4645 T: std::convert::Into<wkt::FieldMask>,
4646 {
4647 self.update_mask = std::option::Option::Some(v.into());
4648 self
4649 }
4650
4651 /// Sets or clears the value of [update_mask][crate::model::UpdateFieldRequest::update_mask].
4652 ///
4653 /// # Example
4654 /// ```ignore,no_run
4655 /// # use google_cloud_firestore_admin_v1::model::UpdateFieldRequest;
4656 /// use wkt::FieldMask;
4657 /// let x = UpdateFieldRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4658 /// let x = UpdateFieldRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4659 /// ```
4660 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4661 where
4662 T: std::convert::Into<wkt::FieldMask>,
4663 {
4664 self.update_mask = v.map(|x| x.into());
4665 self
4666 }
4667}
4668
4669impl wkt::message::Message for UpdateFieldRequest {
4670 fn typename() -> &'static str {
4671 "type.googleapis.com/google.firestore.admin.v1.UpdateFieldRequest"
4672 }
4673}
4674
4675/// The request for
4676/// [FirestoreAdmin.GetField][google.firestore.admin.v1.FirestoreAdmin.GetField].
4677///
4678/// [google.firestore.admin.v1.FirestoreAdmin.GetField]: crate::client::FirestoreAdmin::get_field
4679#[derive(Clone, Default, PartialEq)]
4680#[non_exhaustive]
4681pub struct GetFieldRequest {
4682 /// Required. A name of the form
4683 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
4684 pub name: std::string::String,
4685
4686 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4687}
4688
4689impl GetFieldRequest {
4690 pub fn new() -> Self {
4691 std::default::Default::default()
4692 }
4693
4694 /// Sets the value of [name][crate::model::GetFieldRequest::name].
4695 ///
4696 /// # Example
4697 /// ```ignore,no_run
4698 /// # use google_cloud_firestore_admin_v1::model::GetFieldRequest;
4699 /// let x = GetFieldRequest::new().set_name("example");
4700 /// ```
4701 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4702 self.name = v.into();
4703 self
4704 }
4705}
4706
4707impl wkt::message::Message for GetFieldRequest {
4708 fn typename() -> &'static str {
4709 "type.googleapis.com/google.firestore.admin.v1.GetFieldRequest"
4710 }
4711}
4712
4713/// The request for
4714/// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields].
4715///
4716/// [google.firestore.admin.v1.FirestoreAdmin.ListFields]: crate::client::FirestoreAdmin::list_fields
4717#[derive(Clone, Default, PartialEq)]
4718#[non_exhaustive]
4719pub struct ListFieldsRequest {
4720 /// Required. A parent name of the form
4721 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
4722 pub parent: std::string::String,
4723
4724 /// The filter to apply to list results. Currently,
4725 /// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
4726 /// only supports listing fields that have been explicitly overridden. To issue
4727 /// this query, call
4728 /// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
4729 /// with a filter that includes `indexConfig.usesAncestorConfig:false` or
4730 /// `ttlConfig:*`.
4731 ///
4732 /// [google.firestore.admin.v1.FirestoreAdmin.ListFields]: crate::client::FirestoreAdmin::list_fields
4733 pub filter: std::string::String,
4734
4735 /// The number of results to return.
4736 pub page_size: i32,
4737
4738 /// A page token, returned from a previous call to
4739 /// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields],
4740 /// that may be used to get the next page of results.
4741 ///
4742 /// [google.firestore.admin.v1.FirestoreAdmin.ListFields]: crate::client::FirestoreAdmin::list_fields
4743 pub page_token: std::string::String,
4744
4745 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4746}
4747
4748impl ListFieldsRequest {
4749 pub fn new() -> Self {
4750 std::default::Default::default()
4751 }
4752
4753 /// Sets the value of [parent][crate::model::ListFieldsRequest::parent].
4754 ///
4755 /// # Example
4756 /// ```ignore,no_run
4757 /// # use google_cloud_firestore_admin_v1::model::ListFieldsRequest;
4758 /// let x = ListFieldsRequest::new().set_parent("example");
4759 /// ```
4760 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4761 self.parent = v.into();
4762 self
4763 }
4764
4765 /// Sets the value of [filter][crate::model::ListFieldsRequest::filter].
4766 ///
4767 /// # Example
4768 /// ```ignore,no_run
4769 /// # use google_cloud_firestore_admin_v1::model::ListFieldsRequest;
4770 /// let x = ListFieldsRequest::new().set_filter("example");
4771 /// ```
4772 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4773 self.filter = v.into();
4774 self
4775 }
4776
4777 /// Sets the value of [page_size][crate::model::ListFieldsRequest::page_size].
4778 ///
4779 /// # Example
4780 /// ```ignore,no_run
4781 /// # use google_cloud_firestore_admin_v1::model::ListFieldsRequest;
4782 /// let x = ListFieldsRequest::new().set_page_size(42);
4783 /// ```
4784 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4785 self.page_size = v.into();
4786 self
4787 }
4788
4789 /// Sets the value of [page_token][crate::model::ListFieldsRequest::page_token].
4790 ///
4791 /// # Example
4792 /// ```ignore,no_run
4793 /// # use google_cloud_firestore_admin_v1::model::ListFieldsRequest;
4794 /// let x = ListFieldsRequest::new().set_page_token("example");
4795 /// ```
4796 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4797 self.page_token = v.into();
4798 self
4799 }
4800}
4801
4802impl wkt::message::Message for ListFieldsRequest {
4803 fn typename() -> &'static str {
4804 "type.googleapis.com/google.firestore.admin.v1.ListFieldsRequest"
4805 }
4806}
4807
4808/// The response for
4809/// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields].
4810///
4811/// [google.firestore.admin.v1.FirestoreAdmin.ListFields]: crate::client::FirestoreAdmin::list_fields
4812#[derive(Clone, Default, PartialEq)]
4813#[non_exhaustive]
4814pub struct ListFieldsResponse {
4815 /// The requested fields.
4816 pub fields: std::vec::Vec<crate::model::Field>,
4817
4818 /// A page token that may be used to request another page of results. If blank,
4819 /// this is the last page.
4820 pub next_page_token: std::string::String,
4821
4822 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4823}
4824
4825impl ListFieldsResponse {
4826 pub fn new() -> Self {
4827 std::default::Default::default()
4828 }
4829
4830 /// Sets the value of [fields][crate::model::ListFieldsResponse::fields].
4831 ///
4832 /// # Example
4833 /// ```ignore,no_run
4834 /// # use google_cloud_firestore_admin_v1::model::ListFieldsResponse;
4835 /// use google_cloud_firestore_admin_v1::model::Field;
4836 /// let x = ListFieldsResponse::new()
4837 /// .set_fields([
4838 /// Field::default()/* use setters */,
4839 /// Field::default()/* use (different) setters */,
4840 /// ]);
4841 /// ```
4842 pub fn set_fields<T, V>(mut self, v: T) -> Self
4843 where
4844 T: std::iter::IntoIterator<Item = V>,
4845 V: std::convert::Into<crate::model::Field>,
4846 {
4847 use std::iter::Iterator;
4848 self.fields = v.into_iter().map(|i| i.into()).collect();
4849 self
4850 }
4851
4852 /// Sets the value of [next_page_token][crate::model::ListFieldsResponse::next_page_token].
4853 ///
4854 /// # Example
4855 /// ```ignore,no_run
4856 /// # use google_cloud_firestore_admin_v1::model::ListFieldsResponse;
4857 /// let x = ListFieldsResponse::new().set_next_page_token("example");
4858 /// ```
4859 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4860 self.next_page_token = v.into();
4861 self
4862 }
4863}
4864
4865impl wkt::message::Message for ListFieldsResponse {
4866 fn typename() -> &'static str {
4867 "type.googleapis.com/google.firestore.admin.v1.ListFieldsResponse"
4868 }
4869}
4870
4871#[doc(hidden)]
4872impl google_cloud_gax::paginator::internal::PageableResponse for ListFieldsResponse {
4873 type PageItem = crate::model::Field;
4874
4875 fn items(self) -> std::vec::Vec<Self::PageItem> {
4876 self.fields
4877 }
4878
4879 fn next_page_token(&self) -> std::string::String {
4880 use std::clone::Clone;
4881 self.next_page_token.clone()
4882 }
4883}
4884
4885/// The request for
4886/// [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments].
4887///
4888/// [google.firestore.admin.v1.FirestoreAdmin.ExportDocuments]: crate::client::FirestoreAdmin::export_documents
4889#[derive(Clone, Default, PartialEq)]
4890#[non_exhaustive]
4891pub struct ExportDocumentsRequest {
4892 /// Required. Database to export. Should be of the form:
4893 /// `projects/{project_id}/databases/{database_id}`.
4894 pub name: std::string::String,
4895
4896 /// IDs of the collection groups to export. Unspecified means all
4897 /// collection groups. Each collection group in this list must be unique.
4898 pub collection_ids: std::vec::Vec<std::string::String>,
4899
4900 /// The output URI. Currently only supports Google Cloud Storage URIs of the
4901 /// form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name
4902 /// of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional
4903 /// Google Cloud Storage namespace path. When
4904 /// choosing a name, be sure to consider Google Cloud Storage naming
4905 /// guidelines: <https://cloud.google.com/storage/docs/naming>.
4906 /// If the URI is a bucket (without a namespace path), a prefix will be
4907 /// generated based on the start time.
4908 pub output_uri_prefix: std::string::String,
4909
4910 /// An empty list represents all namespaces. This is the preferred
4911 /// usage for databases that don't use namespaces.
4912 ///
4913 /// An empty string element represents the default namespace. This should be
4914 /// used if the database has data in non-default namespaces, but doesn't want
4915 /// to include them. Each namespace in this list must be unique.
4916 pub namespace_ids: std::vec::Vec<std::string::String>,
4917
4918 /// The timestamp that corresponds to the version of the database to be
4919 /// exported. The timestamp must be in the past, rounded to the minute and not
4920 /// older than
4921 /// [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
4922 /// If specified, then the exported documents will represent a consistent view
4923 /// of the database at the provided time. Otherwise, there are no guarantees
4924 /// about the consistency of the exported documents.
4925 ///
4926 /// [google.firestore.admin.v1.Database.earliest_version_time]: crate::model::Database::earliest_version_time
4927 pub snapshot_time: std::option::Option<wkt::Timestamp>,
4928
4929 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4930}
4931
4932impl ExportDocumentsRequest {
4933 pub fn new() -> Self {
4934 std::default::Default::default()
4935 }
4936
4937 /// Sets the value of [name][crate::model::ExportDocumentsRequest::name].
4938 ///
4939 /// # Example
4940 /// ```ignore,no_run
4941 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
4942 /// let x = ExportDocumentsRequest::new().set_name("example");
4943 /// ```
4944 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4945 self.name = v.into();
4946 self
4947 }
4948
4949 /// Sets the value of [collection_ids][crate::model::ExportDocumentsRequest::collection_ids].
4950 ///
4951 /// # Example
4952 /// ```ignore,no_run
4953 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
4954 /// let x = ExportDocumentsRequest::new().set_collection_ids(["a", "b", "c"]);
4955 /// ```
4956 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
4957 where
4958 T: std::iter::IntoIterator<Item = V>,
4959 V: std::convert::Into<std::string::String>,
4960 {
4961 use std::iter::Iterator;
4962 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
4963 self
4964 }
4965
4966 /// Sets the value of [output_uri_prefix][crate::model::ExportDocumentsRequest::output_uri_prefix].
4967 ///
4968 /// # Example
4969 /// ```ignore,no_run
4970 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
4971 /// let x = ExportDocumentsRequest::new().set_output_uri_prefix("example");
4972 /// ```
4973 pub fn set_output_uri_prefix<T: std::convert::Into<std::string::String>>(
4974 mut self,
4975 v: T,
4976 ) -> Self {
4977 self.output_uri_prefix = v.into();
4978 self
4979 }
4980
4981 /// Sets the value of [namespace_ids][crate::model::ExportDocumentsRequest::namespace_ids].
4982 ///
4983 /// # Example
4984 /// ```ignore,no_run
4985 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
4986 /// let x = ExportDocumentsRequest::new().set_namespace_ids(["a", "b", "c"]);
4987 /// ```
4988 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
4989 where
4990 T: std::iter::IntoIterator<Item = V>,
4991 V: std::convert::Into<std::string::String>,
4992 {
4993 use std::iter::Iterator;
4994 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
4995 self
4996 }
4997
4998 /// Sets the value of [snapshot_time][crate::model::ExportDocumentsRequest::snapshot_time].
4999 ///
5000 /// # Example
5001 /// ```ignore,no_run
5002 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
5003 /// use wkt::Timestamp;
5004 /// let x = ExportDocumentsRequest::new().set_snapshot_time(Timestamp::default()/* use setters */);
5005 /// ```
5006 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
5007 where
5008 T: std::convert::Into<wkt::Timestamp>,
5009 {
5010 self.snapshot_time = std::option::Option::Some(v.into());
5011 self
5012 }
5013
5014 /// Sets or clears the value of [snapshot_time][crate::model::ExportDocumentsRequest::snapshot_time].
5015 ///
5016 /// # Example
5017 /// ```ignore,no_run
5018 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
5019 /// use wkt::Timestamp;
5020 /// let x = ExportDocumentsRequest::new().set_or_clear_snapshot_time(Some(Timestamp::default()/* use setters */));
5021 /// let x = ExportDocumentsRequest::new().set_or_clear_snapshot_time(None::<Timestamp>);
5022 /// ```
5023 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
5024 where
5025 T: std::convert::Into<wkt::Timestamp>,
5026 {
5027 self.snapshot_time = v.map(|x| x.into());
5028 self
5029 }
5030}
5031
5032impl wkt::message::Message for ExportDocumentsRequest {
5033 fn typename() -> &'static str {
5034 "type.googleapis.com/google.firestore.admin.v1.ExportDocumentsRequest"
5035 }
5036}
5037
5038/// The request for
5039/// [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments].
5040///
5041/// [google.firestore.admin.v1.FirestoreAdmin.ImportDocuments]: crate::client::FirestoreAdmin::import_documents
5042#[derive(Clone, Default, PartialEq)]
5043#[non_exhaustive]
5044pub struct ImportDocumentsRequest {
5045 /// Required. Database to import into. Should be of the form:
5046 /// `projects/{project_id}/databases/{database_id}`.
5047 pub name: std::string::String,
5048
5049 /// IDs of the collection groups to import. Unspecified means all collection
5050 /// groups that were included in the export. Each collection group in this list
5051 /// must be unique.
5052 pub collection_ids: std::vec::Vec<std::string::String>,
5053
5054 /// Location of the exported files.
5055 /// This must match the output_uri_prefix of an ExportDocumentsResponse from
5056 /// an export that has completed successfully.
5057 /// See:
5058 /// [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix].
5059 ///
5060 /// [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix]: crate::model::ExportDocumentsResponse::output_uri_prefix
5061 pub input_uri_prefix: std::string::String,
5062
5063 /// An empty list represents all namespaces. This is the preferred
5064 /// usage for databases that don't use namespaces.
5065 ///
5066 /// An empty string element represents the default namespace. This should be
5067 /// used if the database has data in non-default namespaces, but doesn't want
5068 /// to include them. Each namespace in this list must be unique.
5069 pub namespace_ids: std::vec::Vec<std::string::String>,
5070
5071 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5072}
5073
5074impl ImportDocumentsRequest {
5075 pub fn new() -> Self {
5076 std::default::Default::default()
5077 }
5078
5079 /// Sets the value of [name][crate::model::ImportDocumentsRequest::name].
5080 ///
5081 /// # Example
5082 /// ```ignore,no_run
5083 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsRequest;
5084 /// let x = ImportDocumentsRequest::new().set_name("example");
5085 /// ```
5086 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5087 self.name = v.into();
5088 self
5089 }
5090
5091 /// Sets the value of [collection_ids][crate::model::ImportDocumentsRequest::collection_ids].
5092 ///
5093 /// # Example
5094 /// ```ignore,no_run
5095 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsRequest;
5096 /// let x = ImportDocumentsRequest::new().set_collection_ids(["a", "b", "c"]);
5097 /// ```
5098 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
5099 where
5100 T: std::iter::IntoIterator<Item = V>,
5101 V: std::convert::Into<std::string::String>,
5102 {
5103 use std::iter::Iterator;
5104 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
5105 self
5106 }
5107
5108 /// Sets the value of [input_uri_prefix][crate::model::ImportDocumentsRequest::input_uri_prefix].
5109 ///
5110 /// # Example
5111 /// ```ignore,no_run
5112 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsRequest;
5113 /// let x = ImportDocumentsRequest::new().set_input_uri_prefix("example");
5114 /// ```
5115 pub fn set_input_uri_prefix<T: std::convert::Into<std::string::String>>(
5116 mut self,
5117 v: T,
5118 ) -> Self {
5119 self.input_uri_prefix = v.into();
5120 self
5121 }
5122
5123 /// Sets the value of [namespace_ids][crate::model::ImportDocumentsRequest::namespace_ids].
5124 ///
5125 /// # Example
5126 /// ```ignore,no_run
5127 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsRequest;
5128 /// let x = ImportDocumentsRequest::new().set_namespace_ids(["a", "b", "c"]);
5129 /// ```
5130 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
5131 where
5132 T: std::iter::IntoIterator<Item = V>,
5133 V: std::convert::Into<std::string::String>,
5134 {
5135 use std::iter::Iterator;
5136 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
5137 self
5138 }
5139}
5140
5141impl wkt::message::Message for ImportDocumentsRequest {
5142 fn typename() -> &'static str {
5143 "type.googleapis.com/google.firestore.admin.v1.ImportDocumentsRequest"
5144 }
5145}
5146
5147/// The request for
5148/// [FirestoreAdmin.BulkDeleteDocuments][google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments].
5149///
5150/// When both collection_ids and namespace_ids are set, only documents satisfying
5151/// both conditions will be deleted.
5152///
5153/// Requests with namespace_ids and collection_ids both empty will be rejected.
5154/// Please use
5155/// [FirestoreAdmin.DeleteDatabase][google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase]
5156/// instead.
5157///
5158/// [google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments]: crate::client::FirestoreAdmin::bulk_delete_documents
5159/// [google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase]: crate::client::FirestoreAdmin::delete_database
5160#[derive(Clone, Default, PartialEq)]
5161#[non_exhaustive]
5162pub struct BulkDeleteDocumentsRequest {
5163 /// Required. Database to operate. Should be of the form:
5164 /// `projects/{project_id}/databases/{database_id}`.
5165 pub name: std::string::String,
5166
5167 /// Optional. IDs of the collection groups to delete. Unspecified means all
5168 /// collection groups.
5169 ///
5170 /// Each collection group in this list must be unique.
5171 pub collection_ids: std::vec::Vec<std::string::String>,
5172
5173 /// Optional. Namespaces to delete.
5174 ///
5175 /// An empty list means all namespaces. This is the recommended
5176 /// usage for databases that don't use namespaces.
5177 ///
5178 /// An empty string element represents the default namespace. This should be
5179 /// used if the database has data in non-default namespaces, but doesn't want
5180 /// to delete from them.
5181 ///
5182 /// Each namespace in this list must be unique.
5183 pub namespace_ids: std::vec::Vec<std::string::String>,
5184
5185 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5186}
5187
5188impl BulkDeleteDocumentsRequest {
5189 pub fn new() -> Self {
5190 std::default::Default::default()
5191 }
5192
5193 /// Sets the value of [name][crate::model::BulkDeleteDocumentsRequest::name].
5194 ///
5195 /// # Example
5196 /// ```ignore,no_run
5197 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsRequest;
5198 /// let x = BulkDeleteDocumentsRequest::new().set_name("example");
5199 /// ```
5200 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5201 self.name = v.into();
5202 self
5203 }
5204
5205 /// Sets the value of [collection_ids][crate::model::BulkDeleteDocumentsRequest::collection_ids].
5206 ///
5207 /// # Example
5208 /// ```ignore,no_run
5209 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsRequest;
5210 /// let x = BulkDeleteDocumentsRequest::new().set_collection_ids(["a", "b", "c"]);
5211 /// ```
5212 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
5213 where
5214 T: std::iter::IntoIterator<Item = V>,
5215 V: std::convert::Into<std::string::String>,
5216 {
5217 use std::iter::Iterator;
5218 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
5219 self
5220 }
5221
5222 /// Sets the value of [namespace_ids][crate::model::BulkDeleteDocumentsRequest::namespace_ids].
5223 ///
5224 /// # Example
5225 /// ```ignore,no_run
5226 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsRequest;
5227 /// let x = BulkDeleteDocumentsRequest::new().set_namespace_ids(["a", "b", "c"]);
5228 /// ```
5229 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
5230 where
5231 T: std::iter::IntoIterator<Item = V>,
5232 V: std::convert::Into<std::string::String>,
5233 {
5234 use std::iter::Iterator;
5235 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
5236 self
5237 }
5238}
5239
5240impl wkt::message::Message for BulkDeleteDocumentsRequest {
5241 fn typename() -> &'static str {
5242 "type.googleapis.com/google.firestore.admin.v1.BulkDeleteDocumentsRequest"
5243 }
5244}
5245
5246/// The response for
5247/// [FirestoreAdmin.BulkDeleteDocuments][google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments].
5248///
5249/// [google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments]: crate::client::FirestoreAdmin::bulk_delete_documents
5250#[derive(Clone, Default, PartialEq)]
5251#[non_exhaustive]
5252pub struct BulkDeleteDocumentsResponse {
5253 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5254}
5255
5256impl BulkDeleteDocumentsResponse {
5257 pub fn new() -> Self {
5258 std::default::Default::default()
5259 }
5260}
5261
5262impl wkt::message::Message for BulkDeleteDocumentsResponse {
5263 fn typename() -> &'static str {
5264 "type.googleapis.com/google.firestore.admin.v1.BulkDeleteDocumentsResponse"
5265 }
5266}
5267
5268/// The request for
5269/// [FirestoreAdmin.GetBackup][google.firestore.admin.v1.FirestoreAdmin.GetBackup].
5270///
5271/// [google.firestore.admin.v1.FirestoreAdmin.GetBackup]: crate::client::FirestoreAdmin::get_backup
5272#[derive(Clone, Default, PartialEq)]
5273#[non_exhaustive]
5274pub struct GetBackupRequest {
5275 /// Required. Name of the backup to fetch.
5276 ///
5277 /// Format is `projects/{project}/locations/{location}/backups/{backup}`.
5278 pub name: std::string::String,
5279
5280 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5281}
5282
5283impl GetBackupRequest {
5284 pub fn new() -> Self {
5285 std::default::Default::default()
5286 }
5287
5288 /// Sets the value of [name][crate::model::GetBackupRequest::name].
5289 ///
5290 /// # Example
5291 /// ```ignore,no_run
5292 /// # use google_cloud_firestore_admin_v1::model::GetBackupRequest;
5293 /// let x = GetBackupRequest::new().set_name("example");
5294 /// ```
5295 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5296 self.name = v.into();
5297 self
5298 }
5299}
5300
5301impl wkt::message::Message for GetBackupRequest {
5302 fn typename() -> &'static str {
5303 "type.googleapis.com/google.firestore.admin.v1.GetBackupRequest"
5304 }
5305}
5306
5307/// The request for
5308/// [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups].
5309///
5310/// [google.firestore.admin.v1.FirestoreAdmin.ListBackups]: crate::client::FirestoreAdmin::list_backups
5311#[derive(Clone, Default, PartialEq)]
5312#[non_exhaustive]
5313pub struct ListBackupsRequest {
5314 /// Required. The location to list backups from.
5315 ///
5316 /// Format is `projects/{project}/locations/{location}`.
5317 /// Use `{location} = '-'` to list backups from all locations for the given
5318 /// project. This allows listing backups from a single location or from all
5319 /// locations.
5320 pub parent: std::string::String,
5321
5322 /// An expression that filters the list of returned backups.
5323 ///
5324 /// A filter expression consists of a field name, a comparison operator, and a
5325 /// value for filtering.
5326 /// The value must be a string, a number, or a boolean. The comparison operator
5327 /// must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
5328 /// Colon `:` is the contains operator. Filter rules are not case sensitive.
5329 ///
5330 /// The following fields in the [Backup][google.firestore.admin.v1.Backup] are
5331 /// eligible for filtering:
5332 ///
5333 /// * `database_uid` (supports `=` only)
5334 ///
5335 /// [google.firestore.admin.v1.Backup]: crate::model::Backup
5336 pub filter: std::string::String,
5337
5338 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5339}
5340
5341impl ListBackupsRequest {
5342 pub fn new() -> Self {
5343 std::default::Default::default()
5344 }
5345
5346 /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
5347 ///
5348 /// # Example
5349 /// ```ignore,no_run
5350 /// # use google_cloud_firestore_admin_v1::model::ListBackupsRequest;
5351 /// let x = ListBackupsRequest::new().set_parent("example");
5352 /// ```
5353 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5354 self.parent = v.into();
5355 self
5356 }
5357
5358 /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
5359 ///
5360 /// # Example
5361 /// ```ignore,no_run
5362 /// # use google_cloud_firestore_admin_v1::model::ListBackupsRequest;
5363 /// let x = ListBackupsRequest::new().set_filter("example");
5364 /// ```
5365 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5366 self.filter = v.into();
5367 self
5368 }
5369}
5370
5371impl wkt::message::Message for ListBackupsRequest {
5372 fn typename() -> &'static str {
5373 "type.googleapis.com/google.firestore.admin.v1.ListBackupsRequest"
5374 }
5375}
5376
5377/// The response for
5378/// [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups].
5379///
5380/// [google.firestore.admin.v1.FirestoreAdmin.ListBackups]: crate::client::FirestoreAdmin::list_backups
5381#[derive(Clone, Default, PartialEq)]
5382#[non_exhaustive]
5383pub struct ListBackupsResponse {
5384 /// List of all backups for the project.
5385 pub backups: std::vec::Vec<crate::model::Backup>,
5386
5387 /// List of locations that existing backups were not able to be fetched from.
5388 ///
5389 /// Instead of failing the entire requests when a single location is
5390 /// unreachable, this response returns a partial result set and list of
5391 /// locations unable to be reached here. The request can be retried against a
5392 /// single location to get a concrete error.
5393 pub unreachable: std::vec::Vec<std::string::String>,
5394
5395 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5396}
5397
5398impl ListBackupsResponse {
5399 pub fn new() -> Self {
5400 std::default::Default::default()
5401 }
5402
5403 /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
5404 ///
5405 /// # Example
5406 /// ```ignore,no_run
5407 /// # use google_cloud_firestore_admin_v1::model::ListBackupsResponse;
5408 /// use google_cloud_firestore_admin_v1::model::Backup;
5409 /// let x = ListBackupsResponse::new()
5410 /// .set_backups([
5411 /// Backup::default()/* use setters */,
5412 /// Backup::default()/* use (different) setters */,
5413 /// ]);
5414 /// ```
5415 pub fn set_backups<T, V>(mut self, v: T) -> Self
5416 where
5417 T: std::iter::IntoIterator<Item = V>,
5418 V: std::convert::Into<crate::model::Backup>,
5419 {
5420 use std::iter::Iterator;
5421 self.backups = v.into_iter().map(|i| i.into()).collect();
5422 self
5423 }
5424
5425 /// Sets the value of [unreachable][crate::model::ListBackupsResponse::unreachable].
5426 ///
5427 /// # Example
5428 /// ```ignore,no_run
5429 /// # use google_cloud_firestore_admin_v1::model::ListBackupsResponse;
5430 /// let x = ListBackupsResponse::new().set_unreachable(["a", "b", "c"]);
5431 /// ```
5432 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5433 where
5434 T: std::iter::IntoIterator<Item = V>,
5435 V: std::convert::Into<std::string::String>,
5436 {
5437 use std::iter::Iterator;
5438 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5439 self
5440 }
5441}
5442
5443impl wkt::message::Message for ListBackupsResponse {
5444 fn typename() -> &'static str {
5445 "type.googleapis.com/google.firestore.admin.v1.ListBackupsResponse"
5446 }
5447}
5448
5449/// The request for
5450/// [FirestoreAdmin.DeleteBackup][google.firestore.admin.v1.FirestoreAdmin.DeleteBackup].
5451///
5452/// [google.firestore.admin.v1.FirestoreAdmin.DeleteBackup]: crate::client::FirestoreAdmin::delete_backup
5453#[derive(Clone, Default, PartialEq)]
5454#[non_exhaustive]
5455pub struct DeleteBackupRequest {
5456 /// Required. Name of the backup to delete.
5457 ///
5458 /// format is `projects/{project}/locations/{location}/backups/{backup}`.
5459 pub name: std::string::String,
5460
5461 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5462}
5463
5464impl DeleteBackupRequest {
5465 pub fn new() -> Self {
5466 std::default::Default::default()
5467 }
5468
5469 /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
5470 ///
5471 /// # Example
5472 /// ```ignore,no_run
5473 /// # use google_cloud_firestore_admin_v1::model::DeleteBackupRequest;
5474 /// let x = DeleteBackupRequest::new().set_name("example");
5475 /// ```
5476 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5477 self.name = v.into();
5478 self
5479 }
5480}
5481
5482impl wkt::message::Message for DeleteBackupRequest {
5483 fn typename() -> &'static str {
5484 "type.googleapis.com/google.firestore.admin.v1.DeleteBackupRequest"
5485 }
5486}
5487
5488/// The request message for
5489/// [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.FirestoreAdmin.RestoreDatabase].
5490///
5491/// [google.firestore.admin.v1.FirestoreAdmin.RestoreDatabase]: crate::client::FirestoreAdmin::restore_database
5492#[derive(Clone, Default, PartialEq)]
5493#[non_exhaustive]
5494pub struct RestoreDatabaseRequest {
5495 /// Required. The project to restore the database in. Format is
5496 /// `projects/{project_id}`.
5497 pub parent: std::string::String,
5498
5499 /// Required. The ID to use for the database, which will become the final
5500 /// component of the database's resource name. This database ID must not be
5501 /// associated with an existing database.
5502 ///
5503 /// This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
5504 /// with first character a letter and the last a letter or a number. Must not
5505 /// be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
5506 ///
5507 /// "(default)" database ID is also valid if the database is Standard edition.
5508 pub database_id: std::string::String,
5509
5510 /// Required. Backup to restore from. Must be from the same project as the
5511 /// parent.
5512 ///
5513 /// The restored database will be created in the same location as the source
5514 /// backup.
5515 ///
5516 /// Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
5517 pub backup: std::string::String,
5518
5519 /// Optional. Encryption configuration for the restored database.
5520 ///
5521 /// If this field is not specified, the restored database will use
5522 /// the same encryption configuration as the backup, namely
5523 /// [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
5524 ///
5525 /// [google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption]: crate::model::database::EncryptionConfig::encryption_type
5526 pub encryption_config: std::option::Option<crate::model::database::EncryptionConfig>,
5527
5528 /// Optional. Immutable. Tags to be bound to the restored database.
5529 ///
5530 /// The tags should be provided in the format of
5531 /// `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
5532 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
5533
5534 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5535}
5536
5537impl RestoreDatabaseRequest {
5538 pub fn new() -> Self {
5539 std::default::Default::default()
5540 }
5541
5542 /// Sets the value of [parent][crate::model::RestoreDatabaseRequest::parent].
5543 ///
5544 /// # Example
5545 /// ```ignore,no_run
5546 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5547 /// let x = RestoreDatabaseRequest::new().set_parent("example");
5548 /// ```
5549 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5550 self.parent = v.into();
5551 self
5552 }
5553
5554 /// Sets the value of [database_id][crate::model::RestoreDatabaseRequest::database_id].
5555 ///
5556 /// # Example
5557 /// ```ignore,no_run
5558 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5559 /// let x = RestoreDatabaseRequest::new().set_database_id("example");
5560 /// ```
5561 pub fn set_database_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5562 self.database_id = v.into();
5563 self
5564 }
5565
5566 /// Sets the value of [backup][crate::model::RestoreDatabaseRequest::backup].
5567 ///
5568 /// # Example
5569 /// ```ignore,no_run
5570 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5571 /// let x = RestoreDatabaseRequest::new().set_backup("example");
5572 /// ```
5573 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5574 self.backup = v.into();
5575 self
5576 }
5577
5578 /// Sets the value of [encryption_config][crate::model::RestoreDatabaseRequest::encryption_config].
5579 ///
5580 /// # Example
5581 /// ```ignore,no_run
5582 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5583 /// use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
5584 /// let x = RestoreDatabaseRequest::new().set_encryption_config(EncryptionConfig::default()/* use setters */);
5585 /// ```
5586 pub fn set_encryption_config<T>(mut self, v: T) -> Self
5587 where
5588 T: std::convert::Into<crate::model::database::EncryptionConfig>,
5589 {
5590 self.encryption_config = std::option::Option::Some(v.into());
5591 self
5592 }
5593
5594 /// Sets or clears the value of [encryption_config][crate::model::RestoreDatabaseRequest::encryption_config].
5595 ///
5596 /// # Example
5597 /// ```ignore,no_run
5598 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5599 /// use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
5600 /// let x = RestoreDatabaseRequest::new().set_or_clear_encryption_config(Some(EncryptionConfig::default()/* use setters */));
5601 /// let x = RestoreDatabaseRequest::new().set_or_clear_encryption_config(None::<EncryptionConfig>);
5602 /// ```
5603 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
5604 where
5605 T: std::convert::Into<crate::model::database::EncryptionConfig>,
5606 {
5607 self.encryption_config = v.map(|x| x.into());
5608 self
5609 }
5610
5611 /// Sets the value of [tags][crate::model::RestoreDatabaseRequest::tags].
5612 ///
5613 /// # Example
5614 /// ```ignore,no_run
5615 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5616 /// let x = RestoreDatabaseRequest::new().set_tags([
5617 /// ("key0", "abc"),
5618 /// ("key1", "xyz"),
5619 /// ]);
5620 /// ```
5621 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
5622 where
5623 T: std::iter::IntoIterator<Item = (K, V)>,
5624 K: std::convert::Into<std::string::String>,
5625 V: std::convert::Into<std::string::String>,
5626 {
5627 use std::iter::Iterator;
5628 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5629 self
5630 }
5631}
5632
5633impl wkt::message::Message for RestoreDatabaseRequest {
5634 fn typename() -> &'static str {
5635 "type.googleapis.com/google.firestore.admin.v1.RestoreDatabaseRequest"
5636 }
5637}
5638
5639/// The request message for
5640/// [FirestoreAdmin.CloneDatabase][google.firestore.admin.v1.FirestoreAdmin.CloneDatabase].
5641///
5642/// [google.firestore.admin.v1.FirestoreAdmin.CloneDatabase]: crate::client::FirestoreAdmin::clone_database
5643#[derive(Clone, Default, PartialEq)]
5644#[non_exhaustive]
5645pub struct CloneDatabaseRequest {
5646 /// Required. The project to clone the database in. Format is
5647 /// `projects/{project_id}`.
5648 pub parent: std::string::String,
5649
5650 /// Required. The ID to use for the database, which will become the final
5651 /// component of the database's resource name. This database ID must not be
5652 /// associated with an existing database.
5653 ///
5654 /// This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
5655 /// with first character a letter and the last a letter or a number. Must not
5656 /// be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
5657 ///
5658 /// "(default)" database ID is also valid if the database is Standard edition.
5659 pub database_id: std::string::String,
5660
5661 /// Required. Specification of the PITR data to clone from. The source database
5662 /// must exist.
5663 ///
5664 /// The cloned database will be created in the same location as the source
5665 /// database.
5666 pub pitr_snapshot: std::option::Option<crate::model::PitrSnapshot>,
5667
5668 /// Optional. Encryption configuration for the cloned database.
5669 ///
5670 /// If this field is not specified, the cloned database will use
5671 /// the same encryption configuration as the source database, namely
5672 /// [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
5673 ///
5674 /// [google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption]: crate::model::database::EncryptionConfig::encryption_type
5675 pub encryption_config: std::option::Option<crate::model::database::EncryptionConfig>,
5676
5677 /// Optional. Immutable. Tags to be bound to the cloned database.
5678 ///
5679 /// The tags should be provided in the format of
5680 /// `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
5681 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
5682
5683 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5684}
5685
5686impl CloneDatabaseRequest {
5687 pub fn new() -> Self {
5688 std::default::Default::default()
5689 }
5690
5691 /// Sets the value of [parent][crate::model::CloneDatabaseRequest::parent].
5692 ///
5693 /// # Example
5694 /// ```ignore,no_run
5695 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5696 /// let x = CloneDatabaseRequest::new().set_parent("example");
5697 /// ```
5698 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5699 self.parent = v.into();
5700 self
5701 }
5702
5703 /// Sets the value of [database_id][crate::model::CloneDatabaseRequest::database_id].
5704 ///
5705 /// # Example
5706 /// ```ignore,no_run
5707 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5708 /// let x = CloneDatabaseRequest::new().set_database_id("example");
5709 /// ```
5710 pub fn set_database_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5711 self.database_id = v.into();
5712 self
5713 }
5714
5715 /// Sets the value of [pitr_snapshot][crate::model::CloneDatabaseRequest::pitr_snapshot].
5716 ///
5717 /// # Example
5718 /// ```ignore,no_run
5719 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5720 /// use google_cloud_firestore_admin_v1::model::PitrSnapshot;
5721 /// let x = CloneDatabaseRequest::new().set_pitr_snapshot(PitrSnapshot::default()/* use setters */);
5722 /// ```
5723 pub fn set_pitr_snapshot<T>(mut self, v: T) -> Self
5724 where
5725 T: std::convert::Into<crate::model::PitrSnapshot>,
5726 {
5727 self.pitr_snapshot = std::option::Option::Some(v.into());
5728 self
5729 }
5730
5731 /// Sets or clears the value of [pitr_snapshot][crate::model::CloneDatabaseRequest::pitr_snapshot].
5732 ///
5733 /// # Example
5734 /// ```ignore,no_run
5735 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5736 /// use google_cloud_firestore_admin_v1::model::PitrSnapshot;
5737 /// let x = CloneDatabaseRequest::new().set_or_clear_pitr_snapshot(Some(PitrSnapshot::default()/* use setters */));
5738 /// let x = CloneDatabaseRequest::new().set_or_clear_pitr_snapshot(None::<PitrSnapshot>);
5739 /// ```
5740 pub fn set_or_clear_pitr_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
5741 where
5742 T: std::convert::Into<crate::model::PitrSnapshot>,
5743 {
5744 self.pitr_snapshot = v.map(|x| x.into());
5745 self
5746 }
5747
5748 /// Sets the value of [encryption_config][crate::model::CloneDatabaseRequest::encryption_config].
5749 ///
5750 /// # Example
5751 /// ```ignore,no_run
5752 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5753 /// use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
5754 /// let x = CloneDatabaseRequest::new().set_encryption_config(EncryptionConfig::default()/* use setters */);
5755 /// ```
5756 pub fn set_encryption_config<T>(mut self, v: T) -> Self
5757 where
5758 T: std::convert::Into<crate::model::database::EncryptionConfig>,
5759 {
5760 self.encryption_config = std::option::Option::Some(v.into());
5761 self
5762 }
5763
5764 /// Sets or clears the value of [encryption_config][crate::model::CloneDatabaseRequest::encryption_config].
5765 ///
5766 /// # Example
5767 /// ```ignore,no_run
5768 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5769 /// use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
5770 /// let x = CloneDatabaseRequest::new().set_or_clear_encryption_config(Some(EncryptionConfig::default()/* use setters */));
5771 /// let x = CloneDatabaseRequest::new().set_or_clear_encryption_config(None::<EncryptionConfig>);
5772 /// ```
5773 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
5774 where
5775 T: std::convert::Into<crate::model::database::EncryptionConfig>,
5776 {
5777 self.encryption_config = v.map(|x| x.into());
5778 self
5779 }
5780
5781 /// Sets the value of [tags][crate::model::CloneDatabaseRequest::tags].
5782 ///
5783 /// # Example
5784 /// ```ignore,no_run
5785 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5786 /// let x = CloneDatabaseRequest::new().set_tags([
5787 /// ("key0", "abc"),
5788 /// ("key1", "xyz"),
5789 /// ]);
5790 /// ```
5791 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
5792 where
5793 T: std::iter::IntoIterator<Item = (K, V)>,
5794 K: std::convert::Into<std::string::String>,
5795 V: std::convert::Into<std::string::String>,
5796 {
5797 use std::iter::Iterator;
5798 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5799 self
5800 }
5801}
5802
5803impl wkt::message::Message for CloneDatabaseRequest {
5804 fn typename() -> &'static str {
5805 "type.googleapis.com/google.firestore.admin.v1.CloneDatabaseRequest"
5806 }
5807}
5808
5809/// Cloud Firestore indexes enable simple and complex queries against
5810/// documents in a database.
5811#[derive(Clone, Default, PartialEq)]
5812#[non_exhaustive]
5813pub struct Index {
5814 /// Output only. A server defined name for this index.
5815 /// The form of this name for composite indexes will be:
5816 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}`
5817 /// For single field indexes, this field will be empty.
5818 pub name: std::string::String,
5819
5820 /// Indexes with a collection query scope specified allow queries
5821 /// against a collection that is the child of a specific document, specified at
5822 /// query time, and that has the same collection ID.
5823 ///
5824 /// Indexes with a collection group query scope specified allow queries against
5825 /// all collections descended from a specific document, specified at query
5826 /// time, and that have the same collection ID as this index.
5827 pub query_scope: crate::model::index::QueryScope,
5828
5829 /// The API scope supported by this index.
5830 pub api_scope: crate::model::index::ApiScope,
5831
5832 /// The fields supported by this index.
5833 ///
5834 /// For composite indexes, this requires a minimum of 2 and a maximum of 100
5835 /// fields. The last field entry is always for the field path `__name__`. If,
5836 /// on creation, `__name__` was not specified as the last field, it will be
5837 /// added automatically with the same direction as that of the last field
5838 /// defined. If the final field in a composite index is not directional, the
5839 /// `__name__` will be ordered ASCENDING (unless explicitly specified).
5840 ///
5841 /// For single field indexes, this will always be exactly one entry with a
5842 /// field path equal to the field path of the associated field.
5843 pub fields: std::vec::Vec<crate::model::index::IndexField>,
5844
5845 /// Output only. The serving state of the index.
5846 pub state: crate::model::index::State,
5847
5848 /// Immutable. The density configuration of the index.
5849 pub density: crate::model::index::Density,
5850
5851 /// Optional. Whether the index is multikey. By default, the index is not
5852 /// multikey. For non-multikey indexes, none of the paths in the index
5853 /// definition reach or traverse an array, except via an explicit array index.
5854 /// For multikey indexes, at most one of the paths in the index definition
5855 /// reach or traverse an array, except via an explicit array index. Violations
5856 /// will result in errors.
5857 ///
5858 /// Note this field only applies to index with MONGODB_COMPATIBLE_API ApiScope.
5859 pub multikey: bool,
5860
5861 /// Optional. The number of shards for the index.
5862 pub shard_count: i32,
5863
5864 /// Optional. Whether it is an unique index. Unique index ensures all values
5865 /// for the indexed field(s) are unique across documents.
5866 pub unique: bool,
5867
5868 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5869}
5870
5871impl Index {
5872 pub fn new() -> Self {
5873 std::default::Default::default()
5874 }
5875
5876 /// Sets the value of [name][crate::model::Index::name].
5877 ///
5878 /// # Example
5879 /// ```ignore,no_run
5880 /// # use google_cloud_firestore_admin_v1::model::Index;
5881 /// let x = Index::new().set_name("example");
5882 /// ```
5883 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5884 self.name = v.into();
5885 self
5886 }
5887
5888 /// Sets the value of [query_scope][crate::model::Index::query_scope].
5889 ///
5890 /// # Example
5891 /// ```ignore,no_run
5892 /// # use google_cloud_firestore_admin_v1::model::Index;
5893 /// use google_cloud_firestore_admin_v1::model::index::QueryScope;
5894 /// let x0 = Index::new().set_query_scope(QueryScope::Collection);
5895 /// let x1 = Index::new().set_query_scope(QueryScope::CollectionGroup);
5896 /// let x2 = Index::new().set_query_scope(QueryScope::CollectionRecursive);
5897 /// ```
5898 pub fn set_query_scope<T: std::convert::Into<crate::model::index::QueryScope>>(
5899 mut self,
5900 v: T,
5901 ) -> Self {
5902 self.query_scope = v.into();
5903 self
5904 }
5905
5906 /// Sets the value of [api_scope][crate::model::Index::api_scope].
5907 ///
5908 /// # Example
5909 /// ```ignore,no_run
5910 /// # use google_cloud_firestore_admin_v1::model::Index;
5911 /// use google_cloud_firestore_admin_v1::model::index::ApiScope;
5912 /// let x0 = Index::new().set_api_scope(ApiScope::DatastoreModeApi);
5913 /// let x1 = Index::new().set_api_scope(ApiScope::MongodbCompatibleApi);
5914 /// ```
5915 pub fn set_api_scope<T: std::convert::Into<crate::model::index::ApiScope>>(
5916 mut self,
5917 v: T,
5918 ) -> Self {
5919 self.api_scope = v.into();
5920 self
5921 }
5922
5923 /// Sets the value of [fields][crate::model::Index::fields].
5924 ///
5925 /// # Example
5926 /// ```ignore,no_run
5927 /// # use google_cloud_firestore_admin_v1::model::Index;
5928 /// use google_cloud_firestore_admin_v1::model::index::IndexField;
5929 /// let x = Index::new()
5930 /// .set_fields([
5931 /// IndexField::default()/* use setters */,
5932 /// IndexField::default()/* use (different) setters */,
5933 /// ]);
5934 /// ```
5935 pub fn set_fields<T, V>(mut self, v: T) -> Self
5936 where
5937 T: std::iter::IntoIterator<Item = V>,
5938 V: std::convert::Into<crate::model::index::IndexField>,
5939 {
5940 use std::iter::Iterator;
5941 self.fields = v.into_iter().map(|i| i.into()).collect();
5942 self
5943 }
5944
5945 /// Sets the value of [state][crate::model::Index::state].
5946 ///
5947 /// # Example
5948 /// ```ignore,no_run
5949 /// # use google_cloud_firestore_admin_v1::model::Index;
5950 /// use google_cloud_firestore_admin_v1::model::index::State;
5951 /// let x0 = Index::new().set_state(State::Creating);
5952 /// let x1 = Index::new().set_state(State::Ready);
5953 /// let x2 = Index::new().set_state(State::NeedsRepair);
5954 /// ```
5955 pub fn set_state<T: std::convert::Into<crate::model::index::State>>(mut self, v: T) -> Self {
5956 self.state = v.into();
5957 self
5958 }
5959
5960 /// Sets the value of [density][crate::model::Index::density].
5961 ///
5962 /// # Example
5963 /// ```ignore,no_run
5964 /// # use google_cloud_firestore_admin_v1::model::Index;
5965 /// use google_cloud_firestore_admin_v1::model::index::Density;
5966 /// let x0 = Index::new().set_density(Density::SparseAll);
5967 /// let x1 = Index::new().set_density(Density::SparseAny);
5968 /// let x2 = Index::new().set_density(Density::Dense);
5969 /// ```
5970 pub fn set_density<T: std::convert::Into<crate::model::index::Density>>(
5971 mut self,
5972 v: T,
5973 ) -> Self {
5974 self.density = v.into();
5975 self
5976 }
5977
5978 /// Sets the value of [multikey][crate::model::Index::multikey].
5979 ///
5980 /// # Example
5981 /// ```ignore,no_run
5982 /// # use google_cloud_firestore_admin_v1::model::Index;
5983 /// let x = Index::new().set_multikey(true);
5984 /// ```
5985 pub fn set_multikey<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5986 self.multikey = v.into();
5987 self
5988 }
5989
5990 /// Sets the value of [shard_count][crate::model::Index::shard_count].
5991 ///
5992 /// # Example
5993 /// ```ignore,no_run
5994 /// # use google_cloud_firestore_admin_v1::model::Index;
5995 /// let x = Index::new().set_shard_count(42);
5996 /// ```
5997 pub fn set_shard_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5998 self.shard_count = v.into();
5999 self
6000 }
6001
6002 /// Sets the value of [unique][crate::model::Index::unique].
6003 ///
6004 /// # Example
6005 /// ```ignore,no_run
6006 /// # use google_cloud_firestore_admin_v1::model::Index;
6007 /// let x = Index::new().set_unique(true);
6008 /// ```
6009 pub fn set_unique<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6010 self.unique = v.into();
6011 self
6012 }
6013}
6014
6015impl wkt::message::Message for Index {
6016 fn typename() -> &'static str {
6017 "type.googleapis.com/google.firestore.admin.v1.Index"
6018 }
6019}
6020
6021/// Defines additional types related to [Index].
6022pub mod index {
6023 #[allow(unused_imports)]
6024 use super::*;
6025
6026 /// A field in an index.
6027 /// The field_path describes which field is indexed, the value_mode describes
6028 /// how the field value is indexed.
6029 #[derive(Clone, Default, PartialEq)]
6030 #[non_exhaustive]
6031 pub struct IndexField {
6032 /// Can be __name__.
6033 /// For single field indexes, this must match the name of the field or may
6034 /// be omitted.
6035 pub field_path: std::string::String,
6036
6037 /// How the field value is indexed.
6038 pub value_mode: std::option::Option<crate::model::index::index_field::ValueMode>,
6039
6040 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6041 }
6042
6043 impl IndexField {
6044 pub fn new() -> Self {
6045 std::default::Default::default()
6046 }
6047
6048 /// Sets the value of [field_path][crate::model::index::IndexField::field_path].
6049 ///
6050 /// # Example
6051 /// ```ignore,no_run
6052 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
6053 /// let x = IndexField::new().set_field_path("example");
6054 /// ```
6055 pub fn set_field_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6056 self.field_path = v.into();
6057 self
6058 }
6059
6060 /// Sets the value of [value_mode][crate::model::index::IndexField::value_mode].
6061 ///
6062 /// Note that all the setters affecting `value_mode` are mutually
6063 /// exclusive.
6064 ///
6065 /// # Example
6066 /// ```ignore,no_run
6067 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
6068 /// use google_cloud_firestore_admin_v1::model::index::index_field::Order;
6069 /// let x0 = IndexField::new().set_value_mode(Some(
6070 /// google_cloud_firestore_admin_v1::model::index::index_field::ValueMode::Order(Order::Ascending)));
6071 /// let x1 = IndexField::new().set_value_mode(Some(
6072 /// google_cloud_firestore_admin_v1::model::index::index_field::ValueMode::Order(Order::Descending)));
6073 /// ```
6074 pub fn set_value_mode<
6075 T: std::convert::Into<std::option::Option<crate::model::index::index_field::ValueMode>>,
6076 >(
6077 mut self,
6078 v: T,
6079 ) -> Self {
6080 self.value_mode = v.into();
6081 self
6082 }
6083
6084 /// The value of [value_mode][crate::model::index::IndexField::value_mode]
6085 /// if it holds a `Order`, `None` if the field is not set or
6086 /// holds a different branch.
6087 pub fn order(&self) -> std::option::Option<&crate::model::index::index_field::Order> {
6088 #[allow(unreachable_patterns)]
6089 self.value_mode.as_ref().and_then(|v| match v {
6090 crate::model::index::index_field::ValueMode::Order(v) => {
6091 std::option::Option::Some(v)
6092 }
6093 _ => std::option::Option::None,
6094 })
6095 }
6096
6097 /// Sets the value of [value_mode][crate::model::index::IndexField::value_mode]
6098 /// to hold a `Order`.
6099 ///
6100 /// Note that all the setters affecting `value_mode` are
6101 /// mutually exclusive.
6102 ///
6103 /// # Example
6104 /// ```ignore,no_run
6105 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
6106 /// use google_cloud_firestore_admin_v1::model::index::index_field::Order;
6107 /// let x0 = IndexField::new().set_order(Order::Ascending);
6108 /// let x1 = IndexField::new().set_order(Order::Descending);
6109 /// assert!(x0.order().is_some());
6110 /// assert!(x0.array_config().is_none());
6111 /// assert!(x0.vector_config().is_none());
6112 /// assert!(x1.order().is_some());
6113 /// assert!(x1.array_config().is_none());
6114 /// assert!(x1.vector_config().is_none());
6115 /// ```
6116 pub fn set_order<T: std::convert::Into<crate::model::index::index_field::Order>>(
6117 mut self,
6118 v: T,
6119 ) -> Self {
6120 self.value_mode = std::option::Option::Some(
6121 crate::model::index::index_field::ValueMode::Order(v.into()),
6122 );
6123 self
6124 }
6125
6126 /// The value of [value_mode][crate::model::index::IndexField::value_mode]
6127 /// if it holds a `ArrayConfig`, `None` if the field is not set or
6128 /// holds a different branch.
6129 pub fn array_config(
6130 &self,
6131 ) -> std::option::Option<&crate::model::index::index_field::ArrayConfig> {
6132 #[allow(unreachable_patterns)]
6133 self.value_mode.as_ref().and_then(|v| match v {
6134 crate::model::index::index_field::ValueMode::ArrayConfig(v) => {
6135 std::option::Option::Some(v)
6136 }
6137 _ => std::option::Option::None,
6138 })
6139 }
6140
6141 /// Sets the value of [value_mode][crate::model::index::IndexField::value_mode]
6142 /// to hold a `ArrayConfig`.
6143 ///
6144 /// Note that all the setters affecting `value_mode` are
6145 /// mutually exclusive.
6146 ///
6147 /// # Example
6148 /// ```ignore,no_run
6149 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
6150 /// use google_cloud_firestore_admin_v1::model::index::index_field::ArrayConfig;
6151 /// let x0 = IndexField::new().set_array_config(ArrayConfig::Contains);
6152 /// assert!(x0.array_config().is_some());
6153 /// assert!(x0.order().is_none());
6154 /// assert!(x0.vector_config().is_none());
6155 /// ```
6156 pub fn set_array_config<
6157 T: std::convert::Into<crate::model::index::index_field::ArrayConfig>,
6158 >(
6159 mut self,
6160 v: T,
6161 ) -> Self {
6162 self.value_mode = std::option::Option::Some(
6163 crate::model::index::index_field::ValueMode::ArrayConfig(v.into()),
6164 );
6165 self
6166 }
6167
6168 /// The value of [value_mode][crate::model::index::IndexField::value_mode]
6169 /// if it holds a `VectorConfig`, `None` if the field is not set or
6170 /// holds a different branch.
6171 pub fn vector_config(
6172 &self,
6173 ) -> std::option::Option<&std::boxed::Box<crate::model::index::index_field::VectorConfig>>
6174 {
6175 #[allow(unreachable_patterns)]
6176 self.value_mode.as_ref().and_then(|v| match v {
6177 crate::model::index::index_field::ValueMode::VectorConfig(v) => {
6178 std::option::Option::Some(v)
6179 }
6180 _ => std::option::Option::None,
6181 })
6182 }
6183
6184 /// Sets the value of [value_mode][crate::model::index::IndexField::value_mode]
6185 /// to hold a `VectorConfig`.
6186 ///
6187 /// Note that all the setters affecting `value_mode` are
6188 /// mutually exclusive.
6189 ///
6190 /// # Example
6191 /// ```ignore,no_run
6192 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
6193 /// use google_cloud_firestore_admin_v1::model::index::index_field::VectorConfig;
6194 /// let x = IndexField::new().set_vector_config(VectorConfig::default()/* use setters */);
6195 /// assert!(x.vector_config().is_some());
6196 /// assert!(x.order().is_none());
6197 /// assert!(x.array_config().is_none());
6198 /// ```
6199 pub fn set_vector_config<
6200 T: std::convert::Into<std::boxed::Box<crate::model::index::index_field::VectorConfig>>,
6201 >(
6202 mut self,
6203 v: T,
6204 ) -> Self {
6205 self.value_mode = std::option::Option::Some(
6206 crate::model::index::index_field::ValueMode::VectorConfig(v.into()),
6207 );
6208 self
6209 }
6210 }
6211
6212 impl wkt::message::Message for IndexField {
6213 fn typename() -> &'static str {
6214 "type.googleapis.com/google.firestore.admin.v1.Index.IndexField"
6215 }
6216 }
6217
6218 /// Defines additional types related to [IndexField].
6219 pub mod index_field {
6220 #[allow(unused_imports)]
6221 use super::*;
6222
6223 /// The index configuration to support vector search operations
6224 #[derive(Clone, Default, PartialEq)]
6225 #[non_exhaustive]
6226 pub struct VectorConfig {
6227 /// Required. The vector dimension this configuration applies to.
6228 ///
6229 /// The resulting index will only include vectors of this dimension, and
6230 /// can be used for vector search with the same dimension.
6231 pub dimension: i32,
6232
6233 /// The type of index used.
6234 pub r#type: std::option::Option<crate::model::index::index_field::vector_config::Type>,
6235
6236 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6237 }
6238
6239 impl VectorConfig {
6240 pub fn new() -> Self {
6241 std::default::Default::default()
6242 }
6243
6244 /// Sets the value of [dimension][crate::model::index::index_field::VectorConfig::dimension].
6245 ///
6246 /// # Example
6247 /// ```ignore,no_run
6248 /// # use google_cloud_firestore_admin_v1::model::index::index_field::VectorConfig;
6249 /// let x = VectorConfig::new().set_dimension(42);
6250 /// ```
6251 pub fn set_dimension<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6252 self.dimension = v.into();
6253 self
6254 }
6255
6256 /// Sets the value of [r#type][crate::model::index::index_field::VectorConfig::type].
6257 ///
6258 /// Note that all the setters affecting `r#type` are mutually
6259 /// exclusive.
6260 ///
6261 /// # Example
6262 /// ```ignore,no_run
6263 /// # use google_cloud_firestore_admin_v1::model::index::index_field::VectorConfig;
6264 /// use google_cloud_firestore_admin_v1::model::index::index_field::vector_config::FlatIndex;
6265 /// let x = VectorConfig::new().set_type(Some(
6266 /// google_cloud_firestore_admin_v1::model::index::index_field::vector_config::Type::Flat(FlatIndex::default().into())));
6267 /// ```
6268 pub fn set_type<
6269 T: std::convert::Into<
6270 std::option::Option<crate::model::index::index_field::vector_config::Type>,
6271 >,
6272 >(
6273 mut self,
6274 v: T,
6275 ) -> Self {
6276 self.r#type = v.into();
6277 self
6278 }
6279
6280 /// The value of [r#type][crate::model::index::index_field::VectorConfig::r#type]
6281 /// if it holds a `Flat`, `None` if the field is not set or
6282 /// holds a different branch.
6283 pub fn flat(
6284 &self,
6285 ) -> std::option::Option<
6286 &std::boxed::Box<crate::model::index::index_field::vector_config::FlatIndex>,
6287 > {
6288 #[allow(unreachable_patterns)]
6289 self.r#type.as_ref().and_then(|v| match v {
6290 crate::model::index::index_field::vector_config::Type::Flat(v) => {
6291 std::option::Option::Some(v)
6292 }
6293 _ => std::option::Option::None,
6294 })
6295 }
6296
6297 /// Sets the value of [r#type][crate::model::index::index_field::VectorConfig::r#type]
6298 /// to hold a `Flat`.
6299 ///
6300 /// Note that all the setters affecting `r#type` are
6301 /// mutually exclusive.
6302 ///
6303 /// # Example
6304 /// ```ignore,no_run
6305 /// # use google_cloud_firestore_admin_v1::model::index::index_field::VectorConfig;
6306 /// use google_cloud_firestore_admin_v1::model::index::index_field::vector_config::FlatIndex;
6307 /// let x = VectorConfig::new().set_flat(FlatIndex::default()/* use setters */);
6308 /// assert!(x.flat().is_some());
6309 /// ```
6310 pub fn set_flat<
6311 T: std::convert::Into<
6312 std::boxed::Box<crate::model::index::index_field::vector_config::FlatIndex>,
6313 >,
6314 >(
6315 mut self,
6316 v: T,
6317 ) -> Self {
6318 self.r#type = std::option::Option::Some(
6319 crate::model::index::index_field::vector_config::Type::Flat(v.into()),
6320 );
6321 self
6322 }
6323 }
6324
6325 impl wkt::message::Message for VectorConfig {
6326 fn typename() -> &'static str {
6327 "type.googleapis.com/google.firestore.admin.v1.Index.IndexField.VectorConfig"
6328 }
6329 }
6330
6331 /// Defines additional types related to [VectorConfig].
6332 pub mod vector_config {
6333 #[allow(unused_imports)]
6334 use super::*;
6335
6336 /// An index that stores vectors in a flat data structure, and supports
6337 /// exhaustive search.
6338 #[derive(Clone, Default, PartialEq)]
6339 #[non_exhaustive]
6340 pub struct FlatIndex {
6341 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6342 }
6343
6344 impl FlatIndex {
6345 pub fn new() -> Self {
6346 std::default::Default::default()
6347 }
6348 }
6349
6350 impl wkt::message::Message for FlatIndex {
6351 fn typename() -> &'static str {
6352 "type.googleapis.com/google.firestore.admin.v1.Index.IndexField.VectorConfig.FlatIndex"
6353 }
6354 }
6355
6356 /// The type of index used.
6357 #[derive(Clone, Debug, PartialEq)]
6358 #[non_exhaustive]
6359 pub enum Type {
6360 /// Indicates the vector index is a flat index.
6361 Flat(std::boxed::Box<crate::model::index::index_field::vector_config::FlatIndex>),
6362 }
6363 }
6364
6365 /// The supported orderings.
6366 ///
6367 /// # Working with unknown values
6368 ///
6369 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6370 /// additional enum variants at any time. Adding new variants is not considered
6371 /// a breaking change. Applications should write their code in anticipation of:
6372 ///
6373 /// - New values appearing in future releases of the client library, **and**
6374 /// - New values received dynamically, without application changes.
6375 ///
6376 /// Please consult the [Working with enums] section in the user guide for some
6377 /// guidelines.
6378 ///
6379 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6380 #[derive(Clone, Debug, PartialEq)]
6381 #[non_exhaustive]
6382 pub enum Order {
6383 /// The ordering is unspecified. Not a valid option.
6384 Unspecified,
6385 /// The field is ordered by ascending field value.
6386 Ascending,
6387 /// The field is ordered by descending field value.
6388 Descending,
6389 /// If set, the enum was initialized with an unknown value.
6390 ///
6391 /// Applications can examine the value using [Order::value] or
6392 /// [Order::name].
6393 UnknownValue(order::UnknownValue),
6394 }
6395
6396 #[doc(hidden)]
6397 pub mod order {
6398 #[allow(unused_imports)]
6399 use super::*;
6400 #[derive(Clone, Debug, PartialEq)]
6401 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6402 }
6403
6404 impl Order {
6405 /// Gets the enum value.
6406 ///
6407 /// Returns `None` if the enum contains an unknown value deserialized from
6408 /// the string representation of enums.
6409 pub fn value(&self) -> std::option::Option<i32> {
6410 match self {
6411 Self::Unspecified => std::option::Option::Some(0),
6412 Self::Ascending => std::option::Option::Some(1),
6413 Self::Descending => std::option::Option::Some(2),
6414 Self::UnknownValue(u) => u.0.value(),
6415 }
6416 }
6417
6418 /// Gets the enum value as a string.
6419 ///
6420 /// Returns `None` if the enum contains an unknown value deserialized from
6421 /// the integer representation of enums.
6422 pub fn name(&self) -> std::option::Option<&str> {
6423 match self {
6424 Self::Unspecified => std::option::Option::Some("ORDER_UNSPECIFIED"),
6425 Self::Ascending => std::option::Option::Some("ASCENDING"),
6426 Self::Descending => std::option::Option::Some("DESCENDING"),
6427 Self::UnknownValue(u) => u.0.name(),
6428 }
6429 }
6430 }
6431
6432 impl std::default::Default for Order {
6433 fn default() -> Self {
6434 use std::convert::From;
6435 Self::from(0)
6436 }
6437 }
6438
6439 impl std::fmt::Display for Order {
6440 fn fmt(
6441 &self,
6442 f: &mut std::fmt::Formatter<'_>,
6443 ) -> std::result::Result<(), std::fmt::Error> {
6444 wkt::internal::display_enum(f, self.name(), self.value())
6445 }
6446 }
6447
6448 impl std::convert::From<i32> for Order {
6449 fn from(value: i32) -> Self {
6450 match value {
6451 0 => Self::Unspecified,
6452 1 => Self::Ascending,
6453 2 => Self::Descending,
6454 _ => Self::UnknownValue(order::UnknownValue(
6455 wkt::internal::UnknownEnumValue::Integer(value),
6456 )),
6457 }
6458 }
6459 }
6460
6461 impl std::convert::From<&str> for Order {
6462 fn from(value: &str) -> Self {
6463 use std::string::ToString;
6464 match value {
6465 "ORDER_UNSPECIFIED" => Self::Unspecified,
6466 "ASCENDING" => Self::Ascending,
6467 "DESCENDING" => Self::Descending,
6468 _ => Self::UnknownValue(order::UnknownValue(
6469 wkt::internal::UnknownEnumValue::String(value.to_string()),
6470 )),
6471 }
6472 }
6473 }
6474
6475 impl serde::ser::Serialize for Order {
6476 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6477 where
6478 S: serde::Serializer,
6479 {
6480 match self {
6481 Self::Unspecified => serializer.serialize_i32(0),
6482 Self::Ascending => serializer.serialize_i32(1),
6483 Self::Descending => serializer.serialize_i32(2),
6484 Self::UnknownValue(u) => u.0.serialize(serializer),
6485 }
6486 }
6487 }
6488
6489 impl<'de> serde::de::Deserialize<'de> for Order {
6490 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6491 where
6492 D: serde::Deserializer<'de>,
6493 {
6494 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Order>::new(
6495 ".google.firestore.admin.v1.Index.IndexField.Order",
6496 ))
6497 }
6498 }
6499
6500 /// The supported array value configurations.
6501 ///
6502 /// # Working with unknown values
6503 ///
6504 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6505 /// additional enum variants at any time. Adding new variants is not considered
6506 /// a breaking change. Applications should write their code in anticipation of:
6507 ///
6508 /// - New values appearing in future releases of the client library, **and**
6509 /// - New values received dynamically, without application changes.
6510 ///
6511 /// Please consult the [Working with enums] section in the user guide for some
6512 /// guidelines.
6513 ///
6514 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6515 #[derive(Clone, Debug, PartialEq)]
6516 #[non_exhaustive]
6517 pub enum ArrayConfig {
6518 /// The index does not support additional array queries.
6519 Unspecified,
6520 /// The index supports array containment queries.
6521 Contains,
6522 /// If set, the enum was initialized with an unknown value.
6523 ///
6524 /// Applications can examine the value using [ArrayConfig::value] or
6525 /// [ArrayConfig::name].
6526 UnknownValue(array_config::UnknownValue),
6527 }
6528
6529 #[doc(hidden)]
6530 pub mod array_config {
6531 #[allow(unused_imports)]
6532 use super::*;
6533 #[derive(Clone, Debug, PartialEq)]
6534 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6535 }
6536
6537 impl ArrayConfig {
6538 /// Gets the enum value.
6539 ///
6540 /// Returns `None` if the enum contains an unknown value deserialized from
6541 /// the string representation of enums.
6542 pub fn value(&self) -> std::option::Option<i32> {
6543 match self {
6544 Self::Unspecified => std::option::Option::Some(0),
6545 Self::Contains => std::option::Option::Some(1),
6546 Self::UnknownValue(u) => u.0.value(),
6547 }
6548 }
6549
6550 /// Gets the enum value as a string.
6551 ///
6552 /// Returns `None` if the enum contains an unknown value deserialized from
6553 /// the integer representation of enums.
6554 pub fn name(&self) -> std::option::Option<&str> {
6555 match self {
6556 Self::Unspecified => std::option::Option::Some("ARRAY_CONFIG_UNSPECIFIED"),
6557 Self::Contains => std::option::Option::Some("CONTAINS"),
6558 Self::UnknownValue(u) => u.0.name(),
6559 }
6560 }
6561 }
6562
6563 impl std::default::Default for ArrayConfig {
6564 fn default() -> Self {
6565 use std::convert::From;
6566 Self::from(0)
6567 }
6568 }
6569
6570 impl std::fmt::Display for ArrayConfig {
6571 fn fmt(
6572 &self,
6573 f: &mut std::fmt::Formatter<'_>,
6574 ) -> std::result::Result<(), std::fmt::Error> {
6575 wkt::internal::display_enum(f, self.name(), self.value())
6576 }
6577 }
6578
6579 impl std::convert::From<i32> for ArrayConfig {
6580 fn from(value: i32) -> Self {
6581 match value {
6582 0 => Self::Unspecified,
6583 1 => Self::Contains,
6584 _ => Self::UnknownValue(array_config::UnknownValue(
6585 wkt::internal::UnknownEnumValue::Integer(value),
6586 )),
6587 }
6588 }
6589 }
6590
6591 impl std::convert::From<&str> for ArrayConfig {
6592 fn from(value: &str) -> Self {
6593 use std::string::ToString;
6594 match value {
6595 "ARRAY_CONFIG_UNSPECIFIED" => Self::Unspecified,
6596 "CONTAINS" => Self::Contains,
6597 _ => Self::UnknownValue(array_config::UnknownValue(
6598 wkt::internal::UnknownEnumValue::String(value.to_string()),
6599 )),
6600 }
6601 }
6602 }
6603
6604 impl serde::ser::Serialize for ArrayConfig {
6605 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6606 where
6607 S: serde::Serializer,
6608 {
6609 match self {
6610 Self::Unspecified => serializer.serialize_i32(0),
6611 Self::Contains => serializer.serialize_i32(1),
6612 Self::UnknownValue(u) => u.0.serialize(serializer),
6613 }
6614 }
6615 }
6616
6617 impl<'de> serde::de::Deserialize<'de> for ArrayConfig {
6618 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6619 where
6620 D: serde::Deserializer<'de>,
6621 {
6622 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ArrayConfig>::new(
6623 ".google.firestore.admin.v1.Index.IndexField.ArrayConfig",
6624 ))
6625 }
6626 }
6627
6628 /// How the field value is indexed.
6629 #[derive(Clone, Debug, PartialEq)]
6630 #[non_exhaustive]
6631 pub enum ValueMode {
6632 /// Indicates that this field supports ordering by the specified order or
6633 /// comparing using =, !=, <, <=, >, >=.
6634 Order(crate::model::index::index_field::Order),
6635 /// Indicates that this field supports operations on `array_value`s.
6636 ArrayConfig(crate::model::index::index_field::ArrayConfig),
6637 /// Indicates that this field supports nearest neighbor and distance
6638 /// operations on vector.
6639 VectorConfig(std::boxed::Box<crate::model::index::index_field::VectorConfig>),
6640 }
6641 }
6642
6643 /// Query Scope defines the scope at which a query is run. This is specified on
6644 /// a StructuredQuery's `from` field.
6645 ///
6646 /// # Working with unknown values
6647 ///
6648 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6649 /// additional enum variants at any time. Adding new variants is not considered
6650 /// a breaking change. Applications should write their code in anticipation of:
6651 ///
6652 /// - New values appearing in future releases of the client library, **and**
6653 /// - New values received dynamically, without application changes.
6654 ///
6655 /// Please consult the [Working with enums] section in the user guide for some
6656 /// guidelines.
6657 ///
6658 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6659 #[derive(Clone, Debug, PartialEq)]
6660 #[non_exhaustive]
6661 pub enum QueryScope {
6662 /// The query scope is unspecified. Not a valid option.
6663 Unspecified,
6664 /// Indexes with a collection query scope specified allow queries
6665 /// against a collection that is the child of a specific document, specified
6666 /// at query time, and that has the collection ID specified by the index.
6667 Collection,
6668 /// Indexes with a collection group query scope specified allow queries
6669 /// against all collections that has the collection ID specified by the
6670 /// index.
6671 CollectionGroup,
6672 /// Include all the collections's ancestor in the index. Only available for
6673 /// Datastore Mode databases.
6674 CollectionRecursive,
6675 /// If set, the enum was initialized with an unknown value.
6676 ///
6677 /// Applications can examine the value using [QueryScope::value] or
6678 /// [QueryScope::name].
6679 UnknownValue(query_scope::UnknownValue),
6680 }
6681
6682 #[doc(hidden)]
6683 pub mod query_scope {
6684 #[allow(unused_imports)]
6685 use super::*;
6686 #[derive(Clone, Debug, PartialEq)]
6687 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6688 }
6689
6690 impl QueryScope {
6691 /// Gets the enum value.
6692 ///
6693 /// Returns `None` if the enum contains an unknown value deserialized from
6694 /// the string representation of enums.
6695 pub fn value(&self) -> std::option::Option<i32> {
6696 match self {
6697 Self::Unspecified => std::option::Option::Some(0),
6698 Self::Collection => std::option::Option::Some(1),
6699 Self::CollectionGroup => std::option::Option::Some(2),
6700 Self::CollectionRecursive => std::option::Option::Some(3),
6701 Self::UnknownValue(u) => u.0.value(),
6702 }
6703 }
6704
6705 /// Gets the enum value as a string.
6706 ///
6707 /// Returns `None` if the enum contains an unknown value deserialized from
6708 /// the integer representation of enums.
6709 pub fn name(&self) -> std::option::Option<&str> {
6710 match self {
6711 Self::Unspecified => std::option::Option::Some("QUERY_SCOPE_UNSPECIFIED"),
6712 Self::Collection => std::option::Option::Some("COLLECTION"),
6713 Self::CollectionGroup => std::option::Option::Some("COLLECTION_GROUP"),
6714 Self::CollectionRecursive => std::option::Option::Some("COLLECTION_RECURSIVE"),
6715 Self::UnknownValue(u) => u.0.name(),
6716 }
6717 }
6718 }
6719
6720 impl std::default::Default for QueryScope {
6721 fn default() -> Self {
6722 use std::convert::From;
6723 Self::from(0)
6724 }
6725 }
6726
6727 impl std::fmt::Display for QueryScope {
6728 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6729 wkt::internal::display_enum(f, self.name(), self.value())
6730 }
6731 }
6732
6733 impl std::convert::From<i32> for QueryScope {
6734 fn from(value: i32) -> Self {
6735 match value {
6736 0 => Self::Unspecified,
6737 1 => Self::Collection,
6738 2 => Self::CollectionGroup,
6739 3 => Self::CollectionRecursive,
6740 _ => Self::UnknownValue(query_scope::UnknownValue(
6741 wkt::internal::UnknownEnumValue::Integer(value),
6742 )),
6743 }
6744 }
6745 }
6746
6747 impl std::convert::From<&str> for QueryScope {
6748 fn from(value: &str) -> Self {
6749 use std::string::ToString;
6750 match value {
6751 "QUERY_SCOPE_UNSPECIFIED" => Self::Unspecified,
6752 "COLLECTION" => Self::Collection,
6753 "COLLECTION_GROUP" => Self::CollectionGroup,
6754 "COLLECTION_RECURSIVE" => Self::CollectionRecursive,
6755 _ => Self::UnknownValue(query_scope::UnknownValue(
6756 wkt::internal::UnknownEnumValue::String(value.to_string()),
6757 )),
6758 }
6759 }
6760 }
6761
6762 impl serde::ser::Serialize for QueryScope {
6763 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6764 where
6765 S: serde::Serializer,
6766 {
6767 match self {
6768 Self::Unspecified => serializer.serialize_i32(0),
6769 Self::Collection => serializer.serialize_i32(1),
6770 Self::CollectionGroup => serializer.serialize_i32(2),
6771 Self::CollectionRecursive => serializer.serialize_i32(3),
6772 Self::UnknownValue(u) => u.0.serialize(serializer),
6773 }
6774 }
6775 }
6776
6777 impl<'de> serde::de::Deserialize<'de> for QueryScope {
6778 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6779 where
6780 D: serde::Deserializer<'de>,
6781 {
6782 deserializer.deserialize_any(wkt::internal::EnumVisitor::<QueryScope>::new(
6783 ".google.firestore.admin.v1.Index.QueryScope",
6784 ))
6785 }
6786 }
6787
6788 /// API Scope defines the APIs (Firestore Native, or Firestore in
6789 /// Datastore Mode) that are supported for queries.
6790 ///
6791 /// # Working with unknown values
6792 ///
6793 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6794 /// additional enum variants at any time. Adding new variants is not considered
6795 /// a breaking change. Applications should write their code in anticipation of:
6796 ///
6797 /// - New values appearing in future releases of the client library, **and**
6798 /// - New values received dynamically, without application changes.
6799 ///
6800 /// Please consult the [Working with enums] section in the user guide for some
6801 /// guidelines.
6802 ///
6803 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6804 #[derive(Clone, Debug, PartialEq)]
6805 #[non_exhaustive]
6806 pub enum ApiScope {
6807 /// The index can only be used by the Firestore Native query API.
6808 /// This is the default.
6809 AnyApi,
6810 /// The index can only be used by the Firestore in Datastore Mode query API.
6811 DatastoreModeApi,
6812 /// The index can only be used by the MONGODB_COMPATIBLE_API.
6813 MongodbCompatibleApi,
6814 /// If set, the enum was initialized with an unknown value.
6815 ///
6816 /// Applications can examine the value using [ApiScope::value] or
6817 /// [ApiScope::name].
6818 UnknownValue(api_scope::UnknownValue),
6819 }
6820
6821 #[doc(hidden)]
6822 pub mod api_scope {
6823 #[allow(unused_imports)]
6824 use super::*;
6825 #[derive(Clone, Debug, PartialEq)]
6826 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6827 }
6828
6829 impl ApiScope {
6830 /// Gets the enum value.
6831 ///
6832 /// Returns `None` if the enum contains an unknown value deserialized from
6833 /// the string representation of enums.
6834 pub fn value(&self) -> std::option::Option<i32> {
6835 match self {
6836 Self::AnyApi => std::option::Option::Some(0),
6837 Self::DatastoreModeApi => std::option::Option::Some(1),
6838 Self::MongodbCompatibleApi => std::option::Option::Some(2),
6839 Self::UnknownValue(u) => u.0.value(),
6840 }
6841 }
6842
6843 /// Gets the enum value as a string.
6844 ///
6845 /// Returns `None` if the enum contains an unknown value deserialized from
6846 /// the integer representation of enums.
6847 pub fn name(&self) -> std::option::Option<&str> {
6848 match self {
6849 Self::AnyApi => std::option::Option::Some("ANY_API"),
6850 Self::DatastoreModeApi => std::option::Option::Some("DATASTORE_MODE_API"),
6851 Self::MongodbCompatibleApi => std::option::Option::Some("MONGODB_COMPATIBLE_API"),
6852 Self::UnknownValue(u) => u.0.name(),
6853 }
6854 }
6855 }
6856
6857 impl std::default::Default for ApiScope {
6858 fn default() -> Self {
6859 use std::convert::From;
6860 Self::from(0)
6861 }
6862 }
6863
6864 impl std::fmt::Display for ApiScope {
6865 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6866 wkt::internal::display_enum(f, self.name(), self.value())
6867 }
6868 }
6869
6870 impl std::convert::From<i32> for ApiScope {
6871 fn from(value: i32) -> Self {
6872 match value {
6873 0 => Self::AnyApi,
6874 1 => Self::DatastoreModeApi,
6875 2 => Self::MongodbCompatibleApi,
6876 _ => Self::UnknownValue(api_scope::UnknownValue(
6877 wkt::internal::UnknownEnumValue::Integer(value),
6878 )),
6879 }
6880 }
6881 }
6882
6883 impl std::convert::From<&str> for ApiScope {
6884 fn from(value: &str) -> Self {
6885 use std::string::ToString;
6886 match value {
6887 "ANY_API" => Self::AnyApi,
6888 "DATASTORE_MODE_API" => Self::DatastoreModeApi,
6889 "MONGODB_COMPATIBLE_API" => Self::MongodbCompatibleApi,
6890 _ => Self::UnknownValue(api_scope::UnknownValue(
6891 wkt::internal::UnknownEnumValue::String(value.to_string()),
6892 )),
6893 }
6894 }
6895 }
6896
6897 impl serde::ser::Serialize for ApiScope {
6898 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6899 where
6900 S: serde::Serializer,
6901 {
6902 match self {
6903 Self::AnyApi => serializer.serialize_i32(0),
6904 Self::DatastoreModeApi => serializer.serialize_i32(1),
6905 Self::MongodbCompatibleApi => serializer.serialize_i32(2),
6906 Self::UnknownValue(u) => u.0.serialize(serializer),
6907 }
6908 }
6909 }
6910
6911 impl<'de> serde::de::Deserialize<'de> for ApiScope {
6912 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6913 where
6914 D: serde::Deserializer<'de>,
6915 {
6916 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ApiScope>::new(
6917 ".google.firestore.admin.v1.Index.ApiScope",
6918 ))
6919 }
6920 }
6921
6922 /// The state of an index. During index creation, an index will be in the
6923 /// `CREATING` state. If the index is created successfully, it will transition
6924 /// to the `READY` state. If the index creation encounters a problem, the index
6925 /// will transition to the `NEEDS_REPAIR` state.
6926 ///
6927 /// # Working with unknown values
6928 ///
6929 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6930 /// additional enum variants at any time. Adding new variants is not considered
6931 /// a breaking change. Applications should write their code in anticipation of:
6932 ///
6933 /// - New values appearing in future releases of the client library, **and**
6934 /// - New values received dynamically, without application changes.
6935 ///
6936 /// Please consult the [Working with enums] section in the user guide for some
6937 /// guidelines.
6938 ///
6939 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6940 #[derive(Clone, Debug, PartialEq)]
6941 #[non_exhaustive]
6942 pub enum State {
6943 /// The state is unspecified.
6944 Unspecified,
6945 /// The index is being created.
6946 /// There is an active long-running operation for the index.
6947 /// The index is updated when writing a document.
6948 /// Some index data may exist.
6949 Creating,
6950 /// The index is ready to be used.
6951 /// The index is updated when writing a document.
6952 /// The index is fully populated from all stored documents it applies to.
6953 Ready,
6954 /// The index was being created, but something went wrong.
6955 /// There is no active long-running operation for the index,
6956 /// and the most recently finished long-running operation failed.
6957 /// The index is not updated when writing a document.
6958 /// Some index data may exist.
6959 /// Use the google.longrunning.Operations API to determine why the operation
6960 /// that last attempted to create this index failed, then re-create the
6961 /// index.
6962 NeedsRepair,
6963 /// If set, the enum was initialized with an unknown value.
6964 ///
6965 /// Applications can examine the value using [State::value] or
6966 /// [State::name].
6967 UnknownValue(state::UnknownValue),
6968 }
6969
6970 #[doc(hidden)]
6971 pub mod state {
6972 #[allow(unused_imports)]
6973 use super::*;
6974 #[derive(Clone, Debug, PartialEq)]
6975 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6976 }
6977
6978 impl State {
6979 /// Gets the enum value.
6980 ///
6981 /// Returns `None` if the enum contains an unknown value deserialized from
6982 /// the string representation of enums.
6983 pub fn value(&self) -> std::option::Option<i32> {
6984 match self {
6985 Self::Unspecified => std::option::Option::Some(0),
6986 Self::Creating => std::option::Option::Some(1),
6987 Self::Ready => std::option::Option::Some(2),
6988 Self::NeedsRepair => std::option::Option::Some(3),
6989 Self::UnknownValue(u) => u.0.value(),
6990 }
6991 }
6992
6993 /// Gets the enum value as a string.
6994 ///
6995 /// Returns `None` if the enum contains an unknown value deserialized from
6996 /// the integer representation of enums.
6997 pub fn name(&self) -> std::option::Option<&str> {
6998 match self {
6999 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7000 Self::Creating => std::option::Option::Some("CREATING"),
7001 Self::Ready => std::option::Option::Some("READY"),
7002 Self::NeedsRepair => std::option::Option::Some("NEEDS_REPAIR"),
7003 Self::UnknownValue(u) => u.0.name(),
7004 }
7005 }
7006 }
7007
7008 impl std::default::Default for State {
7009 fn default() -> Self {
7010 use std::convert::From;
7011 Self::from(0)
7012 }
7013 }
7014
7015 impl std::fmt::Display for State {
7016 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7017 wkt::internal::display_enum(f, self.name(), self.value())
7018 }
7019 }
7020
7021 impl std::convert::From<i32> for State {
7022 fn from(value: i32) -> Self {
7023 match value {
7024 0 => Self::Unspecified,
7025 1 => Self::Creating,
7026 2 => Self::Ready,
7027 3 => Self::NeedsRepair,
7028 _ => Self::UnknownValue(state::UnknownValue(
7029 wkt::internal::UnknownEnumValue::Integer(value),
7030 )),
7031 }
7032 }
7033 }
7034
7035 impl std::convert::From<&str> for State {
7036 fn from(value: &str) -> Self {
7037 use std::string::ToString;
7038 match value {
7039 "STATE_UNSPECIFIED" => Self::Unspecified,
7040 "CREATING" => Self::Creating,
7041 "READY" => Self::Ready,
7042 "NEEDS_REPAIR" => Self::NeedsRepair,
7043 _ => Self::UnknownValue(state::UnknownValue(
7044 wkt::internal::UnknownEnumValue::String(value.to_string()),
7045 )),
7046 }
7047 }
7048 }
7049
7050 impl serde::ser::Serialize for State {
7051 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7052 where
7053 S: serde::Serializer,
7054 {
7055 match self {
7056 Self::Unspecified => serializer.serialize_i32(0),
7057 Self::Creating => serializer.serialize_i32(1),
7058 Self::Ready => serializer.serialize_i32(2),
7059 Self::NeedsRepair => serializer.serialize_i32(3),
7060 Self::UnknownValue(u) => u.0.serialize(serializer),
7061 }
7062 }
7063 }
7064
7065 impl<'de> serde::de::Deserialize<'de> for State {
7066 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7067 where
7068 D: serde::Deserializer<'de>,
7069 {
7070 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7071 ".google.firestore.admin.v1.Index.State",
7072 ))
7073 }
7074 }
7075
7076 /// The density configuration for the index.
7077 ///
7078 /// # Working with unknown values
7079 ///
7080 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7081 /// additional enum variants at any time. Adding new variants is not considered
7082 /// a breaking change. Applications should write their code in anticipation of:
7083 ///
7084 /// - New values appearing in future releases of the client library, **and**
7085 /// - New values received dynamically, without application changes.
7086 ///
7087 /// Please consult the [Working with enums] section in the user guide for some
7088 /// guidelines.
7089 ///
7090 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7091 #[derive(Clone, Debug, PartialEq)]
7092 #[non_exhaustive]
7093 pub enum Density {
7094 /// Unspecified. It will use database default setting. This value is input
7095 /// only.
7096 Unspecified,
7097 /// An index entry will only exist if ALL fields are present in the document.
7098 ///
7099 /// This is both the default and only allowed value for Standard Edition
7100 /// databases (for both Cloud Firestore `ANY_API` and Cloud Datastore
7101 /// `DATASTORE_MODE_API`).
7102 ///
7103 /// Take for example the following document:
7104 ///
7105 /// ```norust
7106 /// {
7107 /// "__name__": "...",
7108 /// "a": 1,
7109 /// "b": 2,
7110 /// "c": 3
7111 /// }
7112 /// ```
7113 ///
7114 /// an index on `(a ASC, b ASC, c ASC, __name__ ASC)` will generate an index
7115 /// entry for this document since `a`, 'b', `c`, and `__name__` are all
7116 /// present but an index of `(a ASC, d ASC, __name__ ASC)` will not generate
7117 /// an index entry for this document since `d` is missing.
7118 ///
7119 /// This means that such indexes can only be used to serve a query when the
7120 /// query has either implicit or explicit requirements that all fields from
7121 /// the index are present.
7122 SparseAll,
7123 /// An index entry will exist if ANY field are present in the document.
7124 ///
7125 /// This is used as the definition of a sparse index for Enterprise Edition
7126 /// databases.
7127 ///
7128 /// Take for example the following document:
7129 ///
7130 /// ```norust
7131 /// {
7132 /// "__name__": "...",
7133 /// "a": 1,
7134 /// "b": 2,
7135 /// "c": 3
7136 /// }
7137 /// ```
7138 ///
7139 /// an index on `(a ASC, d ASC)` will generate an index entry for this
7140 /// document since `a` is present, and will fill in an `unset` value for `d`.
7141 /// An index on `(d ASC, e ASC)` will not generate any index entry as neither
7142 /// `d` nor `e` are present.
7143 ///
7144 /// An index that contains `__name__` will generate an index entry for all
7145 /// documents since Firestore guarantees that all documents have a `__name__`
7146 /// field.
7147 SparseAny,
7148 /// An index entry will exist regardless of if the fields are present or not.
7149 ///
7150 /// This is the default density for an Enterprise Edition database.
7151 ///
7152 /// The index will store `unset` values for fields that are not present in
7153 /// the document.
7154 Dense,
7155 /// If set, the enum was initialized with an unknown value.
7156 ///
7157 /// Applications can examine the value using [Density::value] or
7158 /// [Density::name].
7159 UnknownValue(density::UnknownValue),
7160 }
7161
7162 #[doc(hidden)]
7163 pub mod density {
7164 #[allow(unused_imports)]
7165 use super::*;
7166 #[derive(Clone, Debug, PartialEq)]
7167 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7168 }
7169
7170 impl Density {
7171 /// Gets the enum value.
7172 ///
7173 /// Returns `None` if the enum contains an unknown value deserialized from
7174 /// the string representation of enums.
7175 pub fn value(&self) -> std::option::Option<i32> {
7176 match self {
7177 Self::Unspecified => std::option::Option::Some(0),
7178 Self::SparseAll => std::option::Option::Some(1),
7179 Self::SparseAny => std::option::Option::Some(2),
7180 Self::Dense => std::option::Option::Some(3),
7181 Self::UnknownValue(u) => u.0.value(),
7182 }
7183 }
7184
7185 /// Gets the enum value as a string.
7186 ///
7187 /// Returns `None` if the enum contains an unknown value deserialized from
7188 /// the integer representation of enums.
7189 pub fn name(&self) -> std::option::Option<&str> {
7190 match self {
7191 Self::Unspecified => std::option::Option::Some("DENSITY_UNSPECIFIED"),
7192 Self::SparseAll => std::option::Option::Some("SPARSE_ALL"),
7193 Self::SparseAny => std::option::Option::Some("SPARSE_ANY"),
7194 Self::Dense => std::option::Option::Some("DENSE"),
7195 Self::UnknownValue(u) => u.0.name(),
7196 }
7197 }
7198 }
7199
7200 impl std::default::Default for Density {
7201 fn default() -> Self {
7202 use std::convert::From;
7203 Self::from(0)
7204 }
7205 }
7206
7207 impl std::fmt::Display for Density {
7208 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7209 wkt::internal::display_enum(f, self.name(), self.value())
7210 }
7211 }
7212
7213 impl std::convert::From<i32> for Density {
7214 fn from(value: i32) -> Self {
7215 match value {
7216 0 => Self::Unspecified,
7217 1 => Self::SparseAll,
7218 2 => Self::SparseAny,
7219 3 => Self::Dense,
7220 _ => Self::UnknownValue(density::UnknownValue(
7221 wkt::internal::UnknownEnumValue::Integer(value),
7222 )),
7223 }
7224 }
7225 }
7226
7227 impl std::convert::From<&str> for Density {
7228 fn from(value: &str) -> Self {
7229 use std::string::ToString;
7230 match value {
7231 "DENSITY_UNSPECIFIED" => Self::Unspecified,
7232 "SPARSE_ALL" => Self::SparseAll,
7233 "SPARSE_ANY" => Self::SparseAny,
7234 "DENSE" => Self::Dense,
7235 _ => Self::UnknownValue(density::UnknownValue(
7236 wkt::internal::UnknownEnumValue::String(value.to_string()),
7237 )),
7238 }
7239 }
7240 }
7241
7242 impl serde::ser::Serialize for Density {
7243 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7244 where
7245 S: serde::Serializer,
7246 {
7247 match self {
7248 Self::Unspecified => serializer.serialize_i32(0),
7249 Self::SparseAll => serializer.serialize_i32(1),
7250 Self::SparseAny => serializer.serialize_i32(2),
7251 Self::Dense => serializer.serialize_i32(3),
7252 Self::UnknownValue(u) => u.0.serialize(serializer),
7253 }
7254 }
7255 }
7256
7257 impl<'de> serde::de::Deserialize<'de> for Density {
7258 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7259 where
7260 D: serde::Deserializer<'de>,
7261 {
7262 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Density>::new(
7263 ".google.firestore.admin.v1.Index.Density",
7264 ))
7265 }
7266 }
7267}
7268
7269/// The metadata message for
7270/// [google.cloud.location.Location.metadata][google.cloud.location.Location.metadata].
7271///
7272/// [google.cloud.location.Location.metadata]: google_cloud_location::model::Location::metadata
7273#[derive(Clone, Default, PartialEq)]
7274#[non_exhaustive]
7275pub struct LocationMetadata {
7276 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7277}
7278
7279impl LocationMetadata {
7280 pub fn new() -> Self {
7281 std::default::Default::default()
7282 }
7283}
7284
7285impl wkt::message::Message for LocationMetadata {
7286 fn typename() -> &'static str {
7287 "type.googleapis.com/google.firestore.admin.v1.LocationMetadata"
7288 }
7289}
7290
7291/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
7292/// results from
7293/// [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
7294///
7295/// [google.firestore.admin.v1.FirestoreAdmin.CreateIndex]: crate::client::FirestoreAdmin::create_index
7296/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
7297#[derive(Clone, Default, PartialEq)]
7298#[non_exhaustive]
7299pub struct IndexOperationMetadata {
7300 /// The time this operation started.
7301 pub start_time: std::option::Option<wkt::Timestamp>,
7302
7303 /// The time this operation completed. Will be unset if operation still in
7304 /// progress.
7305 pub end_time: std::option::Option<wkt::Timestamp>,
7306
7307 /// The index resource that this operation is acting on. For example:
7308 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
7309 pub index: std::string::String,
7310
7311 /// The state of the operation.
7312 pub state: crate::model::OperationState,
7313
7314 /// The progress, in documents, of this operation.
7315 pub progress_documents: std::option::Option<crate::model::Progress>,
7316
7317 /// The progress, in bytes, of this operation.
7318 pub progress_bytes: std::option::Option<crate::model::Progress>,
7319
7320 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7321}
7322
7323impl IndexOperationMetadata {
7324 pub fn new() -> Self {
7325 std::default::Default::default()
7326 }
7327
7328 /// Sets the value of [start_time][crate::model::IndexOperationMetadata::start_time].
7329 ///
7330 /// # Example
7331 /// ```ignore,no_run
7332 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7333 /// use wkt::Timestamp;
7334 /// let x = IndexOperationMetadata::new().set_start_time(Timestamp::default()/* use setters */);
7335 /// ```
7336 pub fn set_start_time<T>(mut self, v: T) -> Self
7337 where
7338 T: std::convert::Into<wkt::Timestamp>,
7339 {
7340 self.start_time = std::option::Option::Some(v.into());
7341 self
7342 }
7343
7344 /// Sets or clears the value of [start_time][crate::model::IndexOperationMetadata::start_time].
7345 ///
7346 /// # Example
7347 /// ```ignore,no_run
7348 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7349 /// use wkt::Timestamp;
7350 /// let x = IndexOperationMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
7351 /// let x = IndexOperationMetadata::new().set_or_clear_start_time(None::<Timestamp>);
7352 /// ```
7353 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
7354 where
7355 T: std::convert::Into<wkt::Timestamp>,
7356 {
7357 self.start_time = v.map(|x| x.into());
7358 self
7359 }
7360
7361 /// Sets the value of [end_time][crate::model::IndexOperationMetadata::end_time].
7362 ///
7363 /// # Example
7364 /// ```ignore,no_run
7365 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7366 /// use wkt::Timestamp;
7367 /// let x = IndexOperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
7368 /// ```
7369 pub fn set_end_time<T>(mut self, v: T) -> Self
7370 where
7371 T: std::convert::Into<wkt::Timestamp>,
7372 {
7373 self.end_time = std::option::Option::Some(v.into());
7374 self
7375 }
7376
7377 /// Sets or clears the value of [end_time][crate::model::IndexOperationMetadata::end_time].
7378 ///
7379 /// # Example
7380 /// ```ignore,no_run
7381 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7382 /// use wkt::Timestamp;
7383 /// let x = IndexOperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
7384 /// let x = IndexOperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
7385 /// ```
7386 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7387 where
7388 T: std::convert::Into<wkt::Timestamp>,
7389 {
7390 self.end_time = v.map(|x| x.into());
7391 self
7392 }
7393
7394 /// Sets the value of [index][crate::model::IndexOperationMetadata::index].
7395 ///
7396 /// # Example
7397 /// ```ignore,no_run
7398 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7399 /// let x = IndexOperationMetadata::new().set_index("example");
7400 /// ```
7401 pub fn set_index<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7402 self.index = v.into();
7403 self
7404 }
7405
7406 /// Sets the value of [state][crate::model::IndexOperationMetadata::state].
7407 ///
7408 /// # Example
7409 /// ```ignore,no_run
7410 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7411 /// use google_cloud_firestore_admin_v1::model::OperationState;
7412 /// let x0 = IndexOperationMetadata::new().set_state(OperationState::Initializing);
7413 /// let x1 = IndexOperationMetadata::new().set_state(OperationState::Processing);
7414 /// let x2 = IndexOperationMetadata::new().set_state(OperationState::Cancelling);
7415 /// ```
7416 pub fn set_state<T: std::convert::Into<crate::model::OperationState>>(mut self, v: T) -> Self {
7417 self.state = v.into();
7418 self
7419 }
7420
7421 /// Sets the value of [progress_documents][crate::model::IndexOperationMetadata::progress_documents].
7422 ///
7423 /// # Example
7424 /// ```ignore,no_run
7425 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7426 /// use google_cloud_firestore_admin_v1::model::Progress;
7427 /// let x = IndexOperationMetadata::new().set_progress_documents(Progress::default()/* use setters */);
7428 /// ```
7429 pub fn set_progress_documents<T>(mut self, v: T) -> Self
7430 where
7431 T: std::convert::Into<crate::model::Progress>,
7432 {
7433 self.progress_documents = std::option::Option::Some(v.into());
7434 self
7435 }
7436
7437 /// Sets or clears the value of [progress_documents][crate::model::IndexOperationMetadata::progress_documents].
7438 ///
7439 /// # Example
7440 /// ```ignore,no_run
7441 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7442 /// use google_cloud_firestore_admin_v1::model::Progress;
7443 /// let x = IndexOperationMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
7444 /// let x = IndexOperationMetadata::new().set_or_clear_progress_documents(None::<Progress>);
7445 /// ```
7446 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
7447 where
7448 T: std::convert::Into<crate::model::Progress>,
7449 {
7450 self.progress_documents = v.map(|x| x.into());
7451 self
7452 }
7453
7454 /// Sets the value of [progress_bytes][crate::model::IndexOperationMetadata::progress_bytes].
7455 ///
7456 /// # Example
7457 /// ```ignore,no_run
7458 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7459 /// use google_cloud_firestore_admin_v1::model::Progress;
7460 /// let x = IndexOperationMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
7461 /// ```
7462 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
7463 where
7464 T: std::convert::Into<crate::model::Progress>,
7465 {
7466 self.progress_bytes = std::option::Option::Some(v.into());
7467 self
7468 }
7469
7470 /// Sets or clears the value of [progress_bytes][crate::model::IndexOperationMetadata::progress_bytes].
7471 ///
7472 /// # Example
7473 /// ```ignore,no_run
7474 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7475 /// use google_cloud_firestore_admin_v1::model::Progress;
7476 /// let x = IndexOperationMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
7477 /// let x = IndexOperationMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
7478 /// ```
7479 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
7480 where
7481 T: std::convert::Into<crate::model::Progress>,
7482 {
7483 self.progress_bytes = v.map(|x| x.into());
7484 self
7485 }
7486}
7487
7488impl wkt::message::Message for IndexOperationMetadata {
7489 fn typename() -> &'static str {
7490 "type.googleapis.com/google.firestore.admin.v1.IndexOperationMetadata"
7491 }
7492}
7493
7494/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
7495/// results from
7496/// [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField].
7497///
7498/// [google.firestore.admin.v1.FirestoreAdmin.UpdateField]: crate::client::FirestoreAdmin::update_field
7499/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
7500#[derive(Clone, Default, PartialEq)]
7501#[non_exhaustive]
7502pub struct FieldOperationMetadata {
7503 /// The time this operation started.
7504 pub start_time: std::option::Option<wkt::Timestamp>,
7505
7506 /// The time this operation completed. Will be unset if operation still in
7507 /// progress.
7508 pub end_time: std::option::Option<wkt::Timestamp>,
7509
7510 /// The field resource that this operation is acting on. For example:
7511 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
7512 pub field: std::string::String,
7513
7514 /// A list of
7515 /// [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
7516 /// which describe the intent of this operation.
7517 ///
7518 /// [google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta]: crate::model::field_operation_metadata::IndexConfigDelta
7519 pub index_config_deltas:
7520 std::vec::Vec<crate::model::field_operation_metadata::IndexConfigDelta>,
7521
7522 /// The state of the operation.
7523 pub state: crate::model::OperationState,
7524
7525 /// The progress, in documents, of this operation.
7526 pub progress_documents: std::option::Option<crate::model::Progress>,
7527
7528 /// The progress, in bytes, of this operation.
7529 pub progress_bytes: std::option::Option<crate::model::Progress>,
7530
7531 /// Describes the deltas of TTL configuration.
7532 pub ttl_config_delta:
7533 std::option::Option<crate::model::field_operation_metadata::TtlConfigDelta>,
7534
7535 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7536}
7537
7538impl FieldOperationMetadata {
7539 pub fn new() -> Self {
7540 std::default::Default::default()
7541 }
7542
7543 /// Sets the value of [start_time][crate::model::FieldOperationMetadata::start_time].
7544 ///
7545 /// # Example
7546 /// ```ignore,no_run
7547 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7548 /// use wkt::Timestamp;
7549 /// let x = FieldOperationMetadata::new().set_start_time(Timestamp::default()/* use setters */);
7550 /// ```
7551 pub fn set_start_time<T>(mut self, v: T) -> Self
7552 where
7553 T: std::convert::Into<wkt::Timestamp>,
7554 {
7555 self.start_time = std::option::Option::Some(v.into());
7556 self
7557 }
7558
7559 /// Sets or clears the value of [start_time][crate::model::FieldOperationMetadata::start_time].
7560 ///
7561 /// # Example
7562 /// ```ignore,no_run
7563 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7564 /// use wkt::Timestamp;
7565 /// let x = FieldOperationMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
7566 /// let x = FieldOperationMetadata::new().set_or_clear_start_time(None::<Timestamp>);
7567 /// ```
7568 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
7569 where
7570 T: std::convert::Into<wkt::Timestamp>,
7571 {
7572 self.start_time = v.map(|x| x.into());
7573 self
7574 }
7575
7576 /// Sets the value of [end_time][crate::model::FieldOperationMetadata::end_time].
7577 ///
7578 /// # Example
7579 /// ```ignore,no_run
7580 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7581 /// use wkt::Timestamp;
7582 /// let x = FieldOperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
7583 /// ```
7584 pub fn set_end_time<T>(mut self, v: T) -> Self
7585 where
7586 T: std::convert::Into<wkt::Timestamp>,
7587 {
7588 self.end_time = std::option::Option::Some(v.into());
7589 self
7590 }
7591
7592 /// Sets or clears the value of [end_time][crate::model::FieldOperationMetadata::end_time].
7593 ///
7594 /// # Example
7595 /// ```ignore,no_run
7596 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7597 /// use wkt::Timestamp;
7598 /// let x = FieldOperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
7599 /// let x = FieldOperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
7600 /// ```
7601 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7602 where
7603 T: std::convert::Into<wkt::Timestamp>,
7604 {
7605 self.end_time = v.map(|x| x.into());
7606 self
7607 }
7608
7609 /// Sets the value of [field][crate::model::FieldOperationMetadata::field].
7610 ///
7611 /// # Example
7612 /// ```ignore,no_run
7613 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7614 /// let x = FieldOperationMetadata::new().set_field("example");
7615 /// ```
7616 pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7617 self.field = v.into();
7618 self
7619 }
7620
7621 /// Sets the value of [index_config_deltas][crate::model::FieldOperationMetadata::index_config_deltas].
7622 ///
7623 /// # Example
7624 /// ```ignore,no_run
7625 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7626 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::IndexConfigDelta;
7627 /// let x = FieldOperationMetadata::new()
7628 /// .set_index_config_deltas([
7629 /// IndexConfigDelta::default()/* use setters */,
7630 /// IndexConfigDelta::default()/* use (different) setters */,
7631 /// ]);
7632 /// ```
7633 pub fn set_index_config_deltas<T, V>(mut self, v: T) -> Self
7634 where
7635 T: std::iter::IntoIterator<Item = V>,
7636 V: std::convert::Into<crate::model::field_operation_metadata::IndexConfigDelta>,
7637 {
7638 use std::iter::Iterator;
7639 self.index_config_deltas = v.into_iter().map(|i| i.into()).collect();
7640 self
7641 }
7642
7643 /// Sets the value of [state][crate::model::FieldOperationMetadata::state].
7644 ///
7645 /// # Example
7646 /// ```ignore,no_run
7647 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7648 /// use google_cloud_firestore_admin_v1::model::OperationState;
7649 /// let x0 = FieldOperationMetadata::new().set_state(OperationState::Initializing);
7650 /// let x1 = FieldOperationMetadata::new().set_state(OperationState::Processing);
7651 /// let x2 = FieldOperationMetadata::new().set_state(OperationState::Cancelling);
7652 /// ```
7653 pub fn set_state<T: std::convert::Into<crate::model::OperationState>>(mut self, v: T) -> Self {
7654 self.state = v.into();
7655 self
7656 }
7657
7658 /// Sets the value of [progress_documents][crate::model::FieldOperationMetadata::progress_documents].
7659 ///
7660 /// # Example
7661 /// ```ignore,no_run
7662 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7663 /// use google_cloud_firestore_admin_v1::model::Progress;
7664 /// let x = FieldOperationMetadata::new().set_progress_documents(Progress::default()/* use setters */);
7665 /// ```
7666 pub fn set_progress_documents<T>(mut self, v: T) -> Self
7667 where
7668 T: std::convert::Into<crate::model::Progress>,
7669 {
7670 self.progress_documents = std::option::Option::Some(v.into());
7671 self
7672 }
7673
7674 /// Sets or clears the value of [progress_documents][crate::model::FieldOperationMetadata::progress_documents].
7675 ///
7676 /// # Example
7677 /// ```ignore,no_run
7678 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7679 /// use google_cloud_firestore_admin_v1::model::Progress;
7680 /// let x = FieldOperationMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
7681 /// let x = FieldOperationMetadata::new().set_or_clear_progress_documents(None::<Progress>);
7682 /// ```
7683 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
7684 where
7685 T: std::convert::Into<crate::model::Progress>,
7686 {
7687 self.progress_documents = v.map(|x| x.into());
7688 self
7689 }
7690
7691 /// Sets the value of [progress_bytes][crate::model::FieldOperationMetadata::progress_bytes].
7692 ///
7693 /// # Example
7694 /// ```ignore,no_run
7695 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7696 /// use google_cloud_firestore_admin_v1::model::Progress;
7697 /// let x = FieldOperationMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
7698 /// ```
7699 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
7700 where
7701 T: std::convert::Into<crate::model::Progress>,
7702 {
7703 self.progress_bytes = std::option::Option::Some(v.into());
7704 self
7705 }
7706
7707 /// Sets or clears the value of [progress_bytes][crate::model::FieldOperationMetadata::progress_bytes].
7708 ///
7709 /// # Example
7710 /// ```ignore,no_run
7711 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7712 /// use google_cloud_firestore_admin_v1::model::Progress;
7713 /// let x = FieldOperationMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
7714 /// let x = FieldOperationMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
7715 /// ```
7716 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
7717 where
7718 T: std::convert::Into<crate::model::Progress>,
7719 {
7720 self.progress_bytes = v.map(|x| x.into());
7721 self
7722 }
7723
7724 /// Sets the value of [ttl_config_delta][crate::model::FieldOperationMetadata::ttl_config_delta].
7725 ///
7726 /// # Example
7727 /// ```ignore,no_run
7728 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7729 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::TtlConfigDelta;
7730 /// let x = FieldOperationMetadata::new().set_ttl_config_delta(TtlConfigDelta::default()/* use setters */);
7731 /// ```
7732 pub fn set_ttl_config_delta<T>(mut self, v: T) -> Self
7733 where
7734 T: std::convert::Into<crate::model::field_operation_metadata::TtlConfigDelta>,
7735 {
7736 self.ttl_config_delta = std::option::Option::Some(v.into());
7737 self
7738 }
7739
7740 /// Sets or clears the value of [ttl_config_delta][crate::model::FieldOperationMetadata::ttl_config_delta].
7741 ///
7742 /// # Example
7743 /// ```ignore,no_run
7744 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7745 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::TtlConfigDelta;
7746 /// let x = FieldOperationMetadata::new().set_or_clear_ttl_config_delta(Some(TtlConfigDelta::default()/* use setters */));
7747 /// let x = FieldOperationMetadata::new().set_or_clear_ttl_config_delta(None::<TtlConfigDelta>);
7748 /// ```
7749 pub fn set_or_clear_ttl_config_delta<T>(mut self, v: std::option::Option<T>) -> Self
7750 where
7751 T: std::convert::Into<crate::model::field_operation_metadata::TtlConfigDelta>,
7752 {
7753 self.ttl_config_delta = v.map(|x| x.into());
7754 self
7755 }
7756}
7757
7758impl wkt::message::Message for FieldOperationMetadata {
7759 fn typename() -> &'static str {
7760 "type.googleapis.com/google.firestore.admin.v1.FieldOperationMetadata"
7761 }
7762}
7763
7764/// Defines additional types related to [FieldOperationMetadata].
7765pub mod field_operation_metadata {
7766 #[allow(unused_imports)]
7767 use super::*;
7768
7769 /// Information about an index configuration change.
7770 #[derive(Clone, Default, PartialEq)]
7771 #[non_exhaustive]
7772 pub struct IndexConfigDelta {
7773 /// Specifies how the index is changing.
7774 pub change_type: crate::model::field_operation_metadata::index_config_delta::ChangeType,
7775
7776 /// The index being changed.
7777 pub index: std::option::Option<crate::model::Index>,
7778
7779 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7780 }
7781
7782 impl IndexConfigDelta {
7783 pub fn new() -> Self {
7784 std::default::Default::default()
7785 }
7786
7787 /// Sets the value of [change_type][crate::model::field_operation_metadata::IndexConfigDelta::change_type].
7788 ///
7789 /// # Example
7790 /// ```ignore,no_run
7791 /// # use google_cloud_firestore_admin_v1::model::field_operation_metadata::IndexConfigDelta;
7792 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::index_config_delta::ChangeType;
7793 /// let x0 = IndexConfigDelta::new().set_change_type(ChangeType::Add);
7794 /// let x1 = IndexConfigDelta::new().set_change_type(ChangeType::Remove);
7795 /// ```
7796 pub fn set_change_type<
7797 T: std::convert::Into<
7798 crate::model::field_operation_metadata::index_config_delta::ChangeType,
7799 >,
7800 >(
7801 mut self,
7802 v: T,
7803 ) -> Self {
7804 self.change_type = v.into();
7805 self
7806 }
7807
7808 /// Sets the value of [index][crate::model::field_operation_metadata::IndexConfigDelta::index].
7809 ///
7810 /// # Example
7811 /// ```ignore,no_run
7812 /// # use google_cloud_firestore_admin_v1::model::field_operation_metadata::IndexConfigDelta;
7813 /// use google_cloud_firestore_admin_v1::model::Index;
7814 /// let x = IndexConfigDelta::new().set_index(Index::default()/* use setters */);
7815 /// ```
7816 pub fn set_index<T>(mut self, v: T) -> Self
7817 where
7818 T: std::convert::Into<crate::model::Index>,
7819 {
7820 self.index = std::option::Option::Some(v.into());
7821 self
7822 }
7823
7824 /// Sets or clears the value of [index][crate::model::field_operation_metadata::IndexConfigDelta::index].
7825 ///
7826 /// # Example
7827 /// ```ignore,no_run
7828 /// # use google_cloud_firestore_admin_v1::model::field_operation_metadata::IndexConfigDelta;
7829 /// use google_cloud_firestore_admin_v1::model::Index;
7830 /// let x = IndexConfigDelta::new().set_or_clear_index(Some(Index::default()/* use setters */));
7831 /// let x = IndexConfigDelta::new().set_or_clear_index(None::<Index>);
7832 /// ```
7833 pub fn set_or_clear_index<T>(mut self, v: std::option::Option<T>) -> Self
7834 where
7835 T: std::convert::Into<crate::model::Index>,
7836 {
7837 self.index = v.map(|x| x.into());
7838 self
7839 }
7840 }
7841
7842 impl wkt::message::Message for IndexConfigDelta {
7843 fn typename() -> &'static str {
7844 "type.googleapis.com/google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta"
7845 }
7846 }
7847
7848 /// Defines additional types related to [IndexConfigDelta].
7849 pub mod index_config_delta {
7850 #[allow(unused_imports)]
7851 use super::*;
7852
7853 /// Specifies how the index is changing.
7854 ///
7855 /// # Working with unknown values
7856 ///
7857 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7858 /// additional enum variants at any time. Adding new variants is not considered
7859 /// a breaking change. Applications should write their code in anticipation of:
7860 ///
7861 /// - New values appearing in future releases of the client library, **and**
7862 /// - New values received dynamically, without application changes.
7863 ///
7864 /// Please consult the [Working with enums] section in the user guide for some
7865 /// guidelines.
7866 ///
7867 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7868 #[derive(Clone, Debug, PartialEq)]
7869 #[non_exhaustive]
7870 pub enum ChangeType {
7871 /// The type of change is not specified or known.
7872 Unspecified,
7873 /// The single field index is being added.
7874 Add,
7875 /// The single field index is being removed.
7876 Remove,
7877 /// If set, the enum was initialized with an unknown value.
7878 ///
7879 /// Applications can examine the value using [ChangeType::value] or
7880 /// [ChangeType::name].
7881 UnknownValue(change_type::UnknownValue),
7882 }
7883
7884 #[doc(hidden)]
7885 pub mod change_type {
7886 #[allow(unused_imports)]
7887 use super::*;
7888 #[derive(Clone, Debug, PartialEq)]
7889 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7890 }
7891
7892 impl ChangeType {
7893 /// Gets the enum value.
7894 ///
7895 /// Returns `None` if the enum contains an unknown value deserialized from
7896 /// the string representation of enums.
7897 pub fn value(&self) -> std::option::Option<i32> {
7898 match self {
7899 Self::Unspecified => std::option::Option::Some(0),
7900 Self::Add => std::option::Option::Some(1),
7901 Self::Remove => std::option::Option::Some(2),
7902 Self::UnknownValue(u) => u.0.value(),
7903 }
7904 }
7905
7906 /// Gets the enum value as a string.
7907 ///
7908 /// Returns `None` if the enum contains an unknown value deserialized from
7909 /// the integer representation of enums.
7910 pub fn name(&self) -> std::option::Option<&str> {
7911 match self {
7912 Self::Unspecified => std::option::Option::Some("CHANGE_TYPE_UNSPECIFIED"),
7913 Self::Add => std::option::Option::Some("ADD"),
7914 Self::Remove => std::option::Option::Some("REMOVE"),
7915 Self::UnknownValue(u) => u.0.name(),
7916 }
7917 }
7918 }
7919
7920 impl std::default::Default for ChangeType {
7921 fn default() -> Self {
7922 use std::convert::From;
7923 Self::from(0)
7924 }
7925 }
7926
7927 impl std::fmt::Display for ChangeType {
7928 fn fmt(
7929 &self,
7930 f: &mut std::fmt::Formatter<'_>,
7931 ) -> std::result::Result<(), std::fmt::Error> {
7932 wkt::internal::display_enum(f, self.name(), self.value())
7933 }
7934 }
7935
7936 impl std::convert::From<i32> for ChangeType {
7937 fn from(value: i32) -> Self {
7938 match value {
7939 0 => Self::Unspecified,
7940 1 => Self::Add,
7941 2 => Self::Remove,
7942 _ => Self::UnknownValue(change_type::UnknownValue(
7943 wkt::internal::UnknownEnumValue::Integer(value),
7944 )),
7945 }
7946 }
7947 }
7948
7949 impl std::convert::From<&str> for ChangeType {
7950 fn from(value: &str) -> Self {
7951 use std::string::ToString;
7952 match value {
7953 "CHANGE_TYPE_UNSPECIFIED" => Self::Unspecified,
7954 "ADD" => Self::Add,
7955 "REMOVE" => Self::Remove,
7956 _ => Self::UnknownValue(change_type::UnknownValue(
7957 wkt::internal::UnknownEnumValue::String(value.to_string()),
7958 )),
7959 }
7960 }
7961 }
7962
7963 impl serde::ser::Serialize for ChangeType {
7964 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7965 where
7966 S: serde::Serializer,
7967 {
7968 match self {
7969 Self::Unspecified => serializer.serialize_i32(0),
7970 Self::Add => serializer.serialize_i32(1),
7971 Self::Remove => serializer.serialize_i32(2),
7972 Self::UnknownValue(u) => u.0.serialize(serializer),
7973 }
7974 }
7975 }
7976
7977 impl<'de> serde::de::Deserialize<'de> for ChangeType {
7978 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7979 where
7980 D: serde::Deserializer<'de>,
7981 {
7982 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ChangeType>::new(
7983 ".google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType",
7984 ))
7985 }
7986 }
7987 }
7988
7989 /// Information about a TTL configuration change.
7990 #[derive(Clone, Default, PartialEq)]
7991 #[non_exhaustive]
7992 pub struct TtlConfigDelta {
7993 /// Specifies how the TTL configuration is changing.
7994 pub change_type: crate::model::field_operation_metadata::ttl_config_delta::ChangeType,
7995
7996 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7997 }
7998
7999 impl TtlConfigDelta {
8000 pub fn new() -> Self {
8001 std::default::Default::default()
8002 }
8003
8004 /// Sets the value of [change_type][crate::model::field_operation_metadata::TtlConfigDelta::change_type].
8005 ///
8006 /// # Example
8007 /// ```ignore,no_run
8008 /// # use google_cloud_firestore_admin_v1::model::field_operation_metadata::TtlConfigDelta;
8009 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::ttl_config_delta::ChangeType;
8010 /// let x0 = TtlConfigDelta::new().set_change_type(ChangeType::Add);
8011 /// let x1 = TtlConfigDelta::new().set_change_type(ChangeType::Remove);
8012 /// ```
8013 pub fn set_change_type<
8014 T: std::convert::Into<
8015 crate::model::field_operation_metadata::ttl_config_delta::ChangeType,
8016 >,
8017 >(
8018 mut self,
8019 v: T,
8020 ) -> Self {
8021 self.change_type = v.into();
8022 self
8023 }
8024 }
8025
8026 impl wkt::message::Message for TtlConfigDelta {
8027 fn typename() -> &'static str {
8028 "type.googleapis.com/google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta"
8029 }
8030 }
8031
8032 /// Defines additional types related to [TtlConfigDelta].
8033 pub mod ttl_config_delta {
8034 #[allow(unused_imports)]
8035 use super::*;
8036
8037 /// Specifies how the TTL config is changing.
8038 ///
8039 /// # Working with unknown values
8040 ///
8041 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8042 /// additional enum variants at any time. Adding new variants is not considered
8043 /// a breaking change. Applications should write their code in anticipation of:
8044 ///
8045 /// - New values appearing in future releases of the client library, **and**
8046 /// - New values received dynamically, without application changes.
8047 ///
8048 /// Please consult the [Working with enums] section in the user guide for some
8049 /// guidelines.
8050 ///
8051 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8052 #[derive(Clone, Debug, PartialEq)]
8053 #[non_exhaustive]
8054 pub enum ChangeType {
8055 /// The type of change is not specified or known.
8056 Unspecified,
8057 /// The TTL config is being added.
8058 Add,
8059 /// The TTL config is being removed.
8060 Remove,
8061 /// If set, the enum was initialized with an unknown value.
8062 ///
8063 /// Applications can examine the value using [ChangeType::value] or
8064 /// [ChangeType::name].
8065 UnknownValue(change_type::UnknownValue),
8066 }
8067
8068 #[doc(hidden)]
8069 pub mod change_type {
8070 #[allow(unused_imports)]
8071 use super::*;
8072 #[derive(Clone, Debug, PartialEq)]
8073 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8074 }
8075
8076 impl ChangeType {
8077 /// Gets the enum value.
8078 ///
8079 /// Returns `None` if the enum contains an unknown value deserialized from
8080 /// the string representation of enums.
8081 pub fn value(&self) -> std::option::Option<i32> {
8082 match self {
8083 Self::Unspecified => std::option::Option::Some(0),
8084 Self::Add => std::option::Option::Some(1),
8085 Self::Remove => std::option::Option::Some(2),
8086 Self::UnknownValue(u) => u.0.value(),
8087 }
8088 }
8089
8090 /// Gets the enum value as a string.
8091 ///
8092 /// Returns `None` if the enum contains an unknown value deserialized from
8093 /// the integer representation of enums.
8094 pub fn name(&self) -> std::option::Option<&str> {
8095 match self {
8096 Self::Unspecified => std::option::Option::Some("CHANGE_TYPE_UNSPECIFIED"),
8097 Self::Add => std::option::Option::Some("ADD"),
8098 Self::Remove => std::option::Option::Some("REMOVE"),
8099 Self::UnknownValue(u) => u.0.name(),
8100 }
8101 }
8102 }
8103
8104 impl std::default::Default for ChangeType {
8105 fn default() -> Self {
8106 use std::convert::From;
8107 Self::from(0)
8108 }
8109 }
8110
8111 impl std::fmt::Display for ChangeType {
8112 fn fmt(
8113 &self,
8114 f: &mut std::fmt::Formatter<'_>,
8115 ) -> std::result::Result<(), std::fmt::Error> {
8116 wkt::internal::display_enum(f, self.name(), self.value())
8117 }
8118 }
8119
8120 impl std::convert::From<i32> for ChangeType {
8121 fn from(value: i32) -> Self {
8122 match value {
8123 0 => Self::Unspecified,
8124 1 => Self::Add,
8125 2 => Self::Remove,
8126 _ => Self::UnknownValue(change_type::UnknownValue(
8127 wkt::internal::UnknownEnumValue::Integer(value),
8128 )),
8129 }
8130 }
8131 }
8132
8133 impl std::convert::From<&str> for ChangeType {
8134 fn from(value: &str) -> Self {
8135 use std::string::ToString;
8136 match value {
8137 "CHANGE_TYPE_UNSPECIFIED" => Self::Unspecified,
8138 "ADD" => Self::Add,
8139 "REMOVE" => Self::Remove,
8140 _ => Self::UnknownValue(change_type::UnknownValue(
8141 wkt::internal::UnknownEnumValue::String(value.to_string()),
8142 )),
8143 }
8144 }
8145 }
8146
8147 impl serde::ser::Serialize for ChangeType {
8148 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8149 where
8150 S: serde::Serializer,
8151 {
8152 match self {
8153 Self::Unspecified => serializer.serialize_i32(0),
8154 Self::Add => serializer.serialize_i32(1),
8155 Self::Remove => serializer.serialize_i32(2),
8156 Self::UnknownValue(u) => u.0.serialize(serializer),
8157 }
8158 }
8159 }
8160
8161 impl<'de> serde::de::Deserialize<'de> for ChangeType {
8162 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8163 where
8164 D: serde::Deserializer<'de>,
8165 {
8166 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ChangeType>::new(
8167 ".google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType",
8168 ))
8169 }
8170 }
8171 }
8172}
8173
8174/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
8175/// results from
8176/// [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments].
8177///
8178/// [google.firestore.admin.v1.FirestoreAdmin.ExportDocuments]: crate::client::FirestoreAdmin::export_documents
8179/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8180#[derive(Clone, Default, PartialEq)]
8181#[non_exhaustive]
8182pub struct ExportDocumentsMetadata {
8183 /// The time this operation started.
8184 pub start_time: std::option::Option<wkt::Timestamp>,
8185
8186 /// The time this operation completed. Will be unset if operation still in
8187 /// progress.
8188 pub end_time: std::option::Option<wkt::Timestamp>,
8189
8190 /// The state of the export operation.
8191 pub operation_state: crate::model::OperationState,
8192
8193 /// The progress, in documents, of this operation.
8194 pub progress_documents: std::option::Option<crate::model::Progress>,
8195
8196 /// The progress, in bytes, of this operation.
8197 pub progress_bytes: std::option::Option<crate::model::Progress>,
8198
8199 /// Which collection IDs are being exported.
8200 pub collection_ids: std::vec::Vec<std::string::String>,
8201
8202 /// Where the documents are being exported to.
8203 pub output_uri_prefix: std::string::String,
8204
8205 /// Which namespace IDs are being exported.
8206 pub namespace_ids: std::vec::Vec<std::string::String>,
8207
8208 /// The timestamp that corresponds to the version of the database that is being
8209 /// exported. If unspecified, there are no guarantees about the consistency of
8210 /// the documents being exported.
8211 pub snapshot_time: std::option::Option<wkt::Timestamp>,
8212
8213 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8214}
8215
8216impl ExportDocumentsMetadata {
8217 pub fn new() -> Self {
8218 std::default::Default::default()
8219 }
8220
8221 /// Sets the value of [start_time][crate::model::ExportDocumentsMetadata::start_time].
8222 ///
8223 /// # Example
8224 /// ```ignore,no_run
8225 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8226 /// use wkt::Timestamp;
8227 /// let x = ExportDocumentsMetadata::new().set_start_time(Timestamp::default()/* use setters */);
8228 /// ```
8229 pub fn set_start_time<T>(mut self, v: T) -> Self
8230 where
8231 T: std::convert::Into<wkt::Timestamp>,
8232 {
8233 self.start_time = std::option::Option::Some(v.into());
8234 self
8235 }
8236
8237 /// Sets or clears the value of [start_time][crate::model::ExportDocumentsMetadata::start_time].
8238 ///
8239 /// # Example
8240 /// ```ignore,no_run
8241 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8242 /// use wkt::Timestamp;
8243 /// let x = ExportDocumentsMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
8244 /// let x = ExportDocumentsMetadata::new().set_or_clear_start_time(None::<Timestamp>);
8245 /// ```
8246 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8247 where
8248 T: std::convert::Into<wkt::Timestamp>,
8249 {
8250 self.start_time = v.map(|x| x.into());
8251 self
8252 }
8253
8254 /// Sets the value of [end_time][crate::model::ExportDocumentsMetadata::end_time].
8255 ///
8256 /// # Example
8257 /// ```ignore,no_run
8258 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8259 /// use wkt::Timestamp;
8260 /// let x = ExportDocumentsMetadata::new().set_end_time(Timestamp::default()/* use setters */);
8261 /// ```
8262 pub fn set_end_time<T>(mut self, v: T) -> Self
8263 where
8264 T: std::convert::Into<wkt::Timestamp>,
8265 {
8266 self.end_time = std::option::Option::Some(v.into());
8267 self
8268 }
8269
8270 /// Sets or clears the value of [end_time][crate::model::ExportDocumentsMetadata::end_time].
8271 ///
8272 /// # Example
8273 /// ```ignore,no_run
8274 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8275 /// use wkt::Timestamp;
8276 /// let x = ExportDocumentsMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8277 /// let x = ExportDocumentsMetadata::new().set_or_clear_end_time(None::<Timestamp>);
8278 /// ```
8279 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8280 where
8281 T: std::convert::Into<wkt::Timestamp>,
8282 {
8283 self.end_time = v.map(|x| x.into());
8284 self
8285 }
8286
8287 /// Sets the value of [operation_state][crate::model::ExportDocumentsMetadata::operation_state].
8288 ///
8289 /// # Example
8290 /// ```ignore,no_run
8291 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8292 /// use google_cloud_firestore_admin_v1::model::OperationState;
8293 /// let x0 = ExportDocumentsMetadata::new().set_operation_state(OperationState::Initializing);
8294 /// let x1 = ExportDocumentsMetadata::new().set_operation_state(OperationState::Processing);
8295 /// let x2 = ExportDocumentsMetadata::new().set_operation_state(OperationState::Cancelling);
8296 /// ```
8297 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
8298 mut self,
8299 v: T,
8300 ) -> Self {
8301 self.operation_state = v.into();
8302 self
8303 }
8304
8305 /// Sets the value of [progress_documents][crate::model::ExportDocumentsMetadata::progress_documents].
8306 ///
8307 /// # Example
8308 /// ```ignore,no_run
8309 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8310 /// use google_cloud_firestore_admin_v1::model::Progress;
8311 /// let x = ExportDocumentsMetadata::new().set_progress_documents(Progress::default()/* use setters */);
8312 /// ```
8313 pub fn set_progress_documents<T>(mut self, v: T) -> Self
8314 where
8315 T: std::convert::Into<crate::model::Progress>,
8316 {
8317 self.progress_documents = std::option::Option::Some(v.into());
8318 self
8319 }
8320
8321 /// Sets or clears the value of [progress_documents][crate::model::ExportDocumentsMetadata::progress_documents].
8322 ///
8323 /// # Example
8324 /// ```ignore,no_run
8325 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8326 /// use google_cloud_firestore_admin_v1::model::Progress;
8327 /// let x = ExportDocumentsMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
8328 /// let x = ExportDocumentsMetadata::new().set_or_clear_progress_documents(None::<Progress>);
8329 /// ```
8330 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
8331 where
8332 T: std::convert::Into<crate::model::Progress>,
8333 {
8334 self.progress_documents = v.map(|x| x.into());
8335 self
8336 }
8337
8338 /// Sets the value of [progress_bytes][crate::model::ExportDocumentsMetadata::progress_bytes].
8339 ///
8340 /// # Example
8341 /// ```ignore,no_run
8342 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8343 /// use google_cloud_firestore_admin_v1::model::Progress;
8344 /// let x = ExportDocumentsMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
8345 /// ```
8346 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
8347 where
8348 T: std::convert::Into<crate::model::Progress>,
8349 {
8350 self.progress_bytes = std::option::Option::Some(v.into());
8351 self
8352 }
8353
8354 /// Sets or clears the value of [progress_bytes][crate::model::ExportDocumentsMetadata::progress_bytes].
8355 ///
8356 /// # Example
8357 /// ```ignore,no_run
8358 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8359 /// use google_cloud_firestore_admin_v1::model::Progress;
8360 /// let x = ExportDocumentsMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
8361 /// let x = ExportDocumentsMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
8362 /// ```
8363 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8364 where
8365 T: std::convert::Into<crate::model::Progress>,
8366 {
8367 self.progress_bytes = v.map(|x| x.into());
8368 self
8369 }
8370
8371 /// Sets the value of [collection_ids][crate::model::ExportDocumentsMetadata::collection_ids].
8372 ///
8373 /// # Example
8374 /// ```ignore,no_run
8375 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8376 /// let x = ExportDocumentsMetadata::new().set_collection_ids(["a", "b", "c"]);
8377 /// ```
8378 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
8379 where
8380 T: std::iter::IntoIterator<Item = V>,
8381 V: std::convert::Into<std::string::String>,
8382 {
8383 use std::iter::Iterator;
8384 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
8385 self
8386 }
8387
8388 /// Sets the value of [output_uri_prefix][crate::model::ExportDocumentsMetadata::output_uri_prefix].
8389 ///
8390 /// # Example
8391 /// ```ignore,no_run
8392 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8393 /// let x = ExportDocumentsMetadata::new().set_output_uri_prefix("example");
8394 /// ```
8395 pub fn set_output_uri_prefix<T: std::convert::Into<std::string::String>>(
8396 mut self,
8397 v: T,
8398 ) -> Self {
8399 self.output_uri_prefix = v.into();
8400 self
8401 }
8402
8403 /// Sets the value of [namespace_ids][crate::model::ExportDocumentsMetadata::namespace_ids].
8404 ///
8405 /// # Example
8406 /// ```ignore,no_run
8407 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8408 /// let x = ExportDocumentsMetadata::new().set_namespace_ids(["a", "b", "c"]);
8409 /// ```
8410 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
8411 where
8412 T: std::iter::IntoIterator<Item = V>,
8413 V: std::convert::Into<std::string::String>,
8414 {
8415 use std::iter::Iterator;
8416 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
8417 self
8418 }
8419
8420 /// Sets the value of [snapshot_time][crate::model::ExportDocumentsMetadata::snapshot_time].
8421 ///
8422 /// # Example
8423 /// ```ignore,no_run
8424 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8425 /// use wkt::Timestamp;
8426 /// let x = ExportDocumentsMetadata::new().set_snapshot_time(Timestamp::default()/* use setters */);
8427 /// ```
8428 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
8429 where
8430 T: std::convert::Into<wkt::Timestamp>,
8431 {
8432 self.snapshot_time = std::option::Option::Some(v.into());
8433 self
8434 }
8435
8436 /// Sets or clears the value of [snapshot_time][crate::model::ExportDocumentsMetadata::snapshot_time].
8437 ///
8438 /// # Example
8439 /// ```ignore,no_run
8440 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8441 /// use wkt::Timestamp;
8442 /// let x = ExportDocumentsMetadata::new().set_or_clear_snapshot_time(Some(Timestamp::default()/* use setters */));
8443 /// let x = ExportDocumentsMetadata::new().set_or_clear_snapshot_time(None::<Timestamp>);
8444 /// ```
8445 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
8446 where
8447 T: std::convert::Into<wkt::Timestamp>,
8448 {
8449 self.snapshot_time = v.map(|x| x.into());
8450 self
8451 }
8452}
8453
8454impl wkt::message::Message for ExportDocumentsMetadata {
8455 fn typename() -> &'static str {
8456 "type.googleapis.com/google.firestore.admin.v1.ExportDocumentsMetadata"
8457 }
8458}
8459
8460/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
8461/// results from
8462/// [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments].
8463///
8464/// [google.firestore.admin.v1.FirestoreAdmin.ImportDocuments]: crate::client::FirestoreAdmin::import_documents
8465/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8466#[derive(Clone, Default, PartialEq)]
8467#[non_exhaustive]
8468pub struct ImportDocumentsMetadata {
8469 /// The time this operation started.
8470 pub start_time: std::option::Option<wkt::Timestamp>,
8471
8472 /// The time this operation completed. Will be unset if operation still in
8473 /// progress.
8474 pub end_time: std::option::Option<wkt::Timestamp>,
8475
8476 /// The state of the import operation.
8477 pub operation_state: crate::model::OperationState,
8478
8479 /// The progress, in documents, of this operation.
8480 pub progress_documents: std::option::Option<crate::model::Progress>,
8481
8482 /// The progress, in bytes, of this operation.
8483 pub progress_bytes: std::option::Option<crate::model::Progress>,
8484
8485 /// Which collection IDs are being imported.
8486 pub collection_ids: std::vec::Vec<std::string::String>,
8487
8488 /// The location of the documents being imported.
8489 pub input_uri_prefix: std::string::String,
8490
8491 /// Which namespace IDs are being imported.
8492 pub namespace_ids: std::vec::Vec<std::string::String>,
8493
8494 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8495}
8496
8497impl ImportDocumentsMetadata {
8498 pub fn new() -> Self {
8499 std::default::Default::default()
8500 }
8501
8502 /// Sets the value of [start_time][crate::model::ImportDocumentsMetadata::start_time].
8503 ///
8504 /// # Example
8505 /// ```ignore,no_run
8506 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8507 /// use wkt::Timestamp;
8508 /// let x = ImportDocumentsMetadata::new().set_start_time(Timestamp::default()/* use setters */);
8509 /// ```
8510 pub fn set_start_time<T>(mut self, v: T) -> Self
8511 where
8512 T: std::convert::Into<wkt::Timestamp>,
8513 {
8514 self.start_time = std::option::Option::Some(v.into());
8515 self
8516 }
8517
8518 /// Sets or clears the value of [start_time][crate::model::ImportDocumentsMetadata::start_time].
8519 ///
8520 /// # Example
8521 /// ```ignore,no_run
8522 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8523 /// use wkt::Timestamp;
8524 /// let x = ImportDocumentsMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
8525 /// let x = ImportDocumentsMetadata::new().set_or_clear_start_time(None::<Timestamp>);
8526 /// ```
8527 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8528 where
8529 T: std::convert::Into<wkt::Timestamp>,
8530 {
8531 self.start_time = v.map(|x| x.into());
8532 self
8533 }
8534
8535 /// Sets the value of [end_time][crate::model::ImportDocumentsMetadata::end_time].
8536 ///
8537 /// # Example
8538 /// ```ignore,no_run
8539 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8540 /// use wkt::Timestamp;
8541 /// let x = ImportDocumentsMetadata::new().set_end_time(Timestamp::default()/* use setters */);
8542 /// ```
8543 pub fn set_end_time<T>(mut self, v: T) -> Self
8544 where
8545 T: std::convert::Into<wkt::Timestamp>,
8546 {
8547 self.end_time = std::option::Option::Some(v.into());
8548 self
8549 }
8550
8551 /// Sets or clears the value of [end_time][crate::model::ImportDocumentsMetadata::end_time].
8552 ///
8553 /// # Example
8554 /// ```ignore,no_run
8555 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8556 /// use wkt::Timestamp;
8557 /// let x = ImportDocumentsMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8558 /// let x = ImportDocumentsMetadata::new().set_or_clear_end_time(None::<Timestamp>);
8559 /// ```
8560 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8561 where
8562 T: std::convert::Into<wkt::Timestamp>,
8563 {
8564 self.end_time = v.map(|x| x.into());
8565 self
8566 }
8567
8568 /// Sets the value of [operation_state][crate::model::ImportDocumentsMetadata::operation_state].
8569 ///
8570 /// # Example
8571 /// ```ignore,no_run
8572 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8573 /// use google_cloud_firestore_admin_v1::model::OperationState;
8574 /// let x0 = ImportDocumentsMetadata::new().set_operation_state(OperationState::Initializing);
8575 /// let x1 = ImportDocumentsMetadata::new().set_operation_state(OperationState::Processing);
8576 /// let x2 = ImportDocumentsMetadata::new().set_operation_state(OperationState::Cancelling);
8577 /// ```
8578 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
8579 mut self,
8580 v: T,
8581 ) -> Self {
8582 self.operation_state = v.into();
8583 self
8584 }
8585
8586 /// Sets the value of [progress_documents][crate::model::ImportDocumentsMetadata::progress_documents].
8587 ///
8588 /// # Example
8589 /// ```ignore,no_run
8590 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8591 /// use google_cloud_firestore_admin_v1::model::Progress;
8592 /// let x = ImportDocumentsMetadata::new().set_progress_documents(Progress::default()/* use setters */);
8593 /// ```
8594 pub fn set_progress_documents<T>(mut self, v: T) -> Self
8595 where
8596 T: std::convert::Into<crate::model::Progress>,
8597 {
8598 self.progress_documents = std::option::Option::Some(v.into());
8599 self
8600 }
8601
8602 /// Sets or clears the value of [progress_documents][crate::model::ImportDocumentsMetadata::progress_documents].
8603 ///
8604 /// # Example
8605 /// ```ignore,no_run
8606 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8607 /// use google_cloud_firestore_admin_v1::model::Progress;
8608 /// let x = ImportDocumentsMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
8609 /// let x = ImportDocumentsMetadata::new().set_or_clear_progress_documents(None::<Progress>);
8610 /// ```
8611 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
8612 where
8613 T: std::convert::Into<crate::model::Progress>,
8614 {
8615 self.progress_documents = v.map(|x| x.into());
8616 self
8617 }
8618
8619 /// Sets the value of [progress_bytes][crate::model::ImportDocumentsMetadata::progress_bytes].
8620 ///
8621 /// # Example
8622 /// ```ignore,no_run
8623 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8624 /// use google_cloud_firestore_admin_v1::model::Progress;
8625 /// let x = ImportDocumentsMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
8626 /// ```
8627 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
8628 where
8629 T: std::convert::Into<crate::model::Progress>,
8630 {
8631 self.progress_bytes = std::option::Option::Some(v.into());
8632 self
8633 }
8634
8635 /// Sets or clears the value of [progress_bytes][crate::model::ImportDocumentsMetadata::progress_bytes].
8636 ///
8637 /// # Example
8638 /// ```ignore,no_run
8639 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8640 /// use google_cloud_firestore_admin_v1::model::Progress;
8641 /// let x = ImportDocumentsMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
8642 /// let x = ImportDocumentsMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
8643 /// ```
8644 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8645 where
8646 T: std::convert::Into<crate::model::Progress>,
8647 {
8648 self.progress_bytes = v.map(|x| x.into());
8649 self
8650 }
8651
8652 /// Sets the value of [collection_ids][crate::model::ImportDocumentsMetadata::collection_ids].
8653 ///
8654 /// # Example
8655 /// ```ignore,no_run
8656 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8657 /// let x = ImportDocumentsMetadata::new().set_collection_ids(["a", "b", "c"]);
8658 /// ```
8659 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
8660 where
8661 T: std::iter::IntoIterator<Item = V>,
8662 V: std::convert::Into<std::string::String>,
8663 {
8664 use std::iter::Iterator;
8665 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
8666 self
8667 }
8668
8669 /// Sets the value of [input_uri_prefix][crate::model::ImportDocumentsMetadata::input_uri_prefix].
8670 ///
8671 /// # Example
8672 /// ```ignore,no_run
8673 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8674 /// let x = ImportDocumentsMetadata::new().set_input_uri_prefix("example");
8675 /// ```
8676 pub fn set_input_uri_prefix<T: std::convert::Into<std::string::String>>(
8677 mut self,
8678 v: T,
8679 ) -> Self {
8680 self.input_uri_prefix = v.into();
8681 self
8682 }
8683
8684 /// Sets the value of [namespace_ids][crate::model::ImportDocumentsMetadata::namespace_ids].
8685 ///
8686 /// # Example
8687 /// ```ignore,no_run
8688 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8689 /// let x = ImportDocumentsMetadata::new().set_namespace_ids(["a", "b", "c"]);
8690 /// ```
8691 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
8692 where
8693 T: std::iter::IntoIterator<Item = V>,
8694 V: std::convert::Into<std::string::String>,
8695 {
8696 use std::iter::Iterator;
8697 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
8698 self
8699 }
8700}
8701
8702impl wkt::message::Message for ImportDocumentsMetadata {
8703 fn typename() -> &'static str {
8704 "type.googleapis.com/google.firestore.admin.v1.ImportDocumentsMetadata"
8705 }
8706}
8707
8708/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
8709/// results from
8710/// [FirestoreAdmin.BulkDeleteDocuments][google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments].
8711///
8712/// [google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments]: crate::client::FirestoreAdmin::bulk_delete_documents
8713/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8714#[derive(Clone, Default, PartialEq)]
8715#[non_exhaustive]
8716pub struct BulkDeleteDocumentsMetadata {
8717 /// The time this operation started.
8718 pub start_time: std::option::Option<wkt::Timestamp>,
8719
8720 /// The time this operation completed. Will be unset if operation still in
8721 /// progress.
8722 pub end_time: std::option::Option<wkt::Timestamp>,
8723
8724 /// The state of the operation.
8725 pub operation_state: crate::model::OperationState,
8726
8727 /// The progress, in documents, of this operation.
8728 pub progress_documents: std::option::Option<crate::model::Progress>,
8729
8730 /// The progress, in bytes, of this operation.
8731 pub progress_bytes: std::option::Option<crate::model::Progress>,
8732
8733 /// The IDs of the collection groups that are being deleted.
8734 pub collection_ids: std::vec::Vec<std::string::String>,
8735
8736 /// Which namespace IDs are being deleted.
8737 pub namespace_ids: std::vec::Vec<std::string::String>,
8738
8739 /// The timestamp that corresponds to the version of the database that is being
8740 /// read to get the list of documents to delete. This time can also be used as
8741 /// the timestamp of PITR in case of disaster recovery (subject to PITR window
8742 /// limit).
8743 pub snapshot_time: std::option::Option<wkt::Timestamp>,
8744
8745 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8746}
8747
8748impl BulkDeleteDocumentsMetadata {
8749 pub fn new() -> Self {
8750 std::default::Default::default()
8751 }
8752
8753 /// Sets the value of [start_time][crate::model::BulkDeleteDocumentsMetadata::start_time].
8754 ///
8755 /// # Example
8756 /// ```ignore,no_run
8757 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8758 /// use wkt::Timestamp;
8759 /// let x = BulkDeleteDocumentsMetadata::new().set_start_time(Timestamp::default()/* use setters */);
8760 /// ```
8761 pub fn set_start_time<T>(mut self, v: T) -> Self
8762 where
8763 T: std::convert::Into<wkt::Timestamp>,
8764 {
8765 self.start_time = std::option::Option::Some(v.into());
8766 self
8767 }
8768
8769 /// Sets or clears the value of [start_time][crate::model::BulkDeleteDocumentsMetadata::start_time].
8770 ///
8771 /// # Example
8772 /// ```ignore,no_run
8773 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8774 /// use wkt::Timestamp;
8775 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
8776 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_start_time(None::<Timestamp>);
8777 /// ```
8778 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8779 where
8780 T: std::convert::Into<wkt::Timestamp>,
8781 {
8782 self.start_time = v.map(|x| x.into());
8783 self
8784 }
8785
8786 /// Sets the value of [end_time][crate::model::BulkDeleteDocumentsMetadata::end_time].
8787 ///
8788 /// # Example
8789 /// ```ignore,no_run
8790 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8791 /// use wkt::Timestamp;
8792 /// let x = BulkDeleteDocumentsMetadata::new().set_end_time(Timestamp::default()/* use setters */);
8793 /// ```
8794 pub fn set_end_time<T>(mut self, v: T) -> Self
8795 where
8796 T: std::convert::Into<wkt::Timestamp>,
8797 {
8798 self.end_time = std::option::Option::Some(v.into());
8799 self
8800 }
8801
8802 /// Sets or clears the value of [end_time][crate::model::BulkDeleteDocumentsMetadata::end_time].
8803 ///
8804 /// # Example
8805 /// ```ignore,no_run
8806 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8807 /// use wkt::Timestamp;
8808 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8809 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_end_time(None::<Timestamp>);
8810 /// ```
8811 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8812 where
8813 T: std::convert::Into<wkt::Timestamp>,
8814 {
8815 self.end_time = v.map(|x| x.into());
8816 self
8817 }
8818
8819 /// Sets the value of [operation_state][crate::model::BulkDeleteDocumentsMetadata::operation_state].
8820 ///
8821 /// # Example
8822 /// ```ignore,no_run
8823 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8824 /// use google_cloud_firestore_admin_v1::model::OperationState;
8825 /// let x0 = BulkDeleteDocumentsMetadata::new().set_operation_state(OperationState::Initializing);
8826 /// let x1 = BulkDeleteDocumentsMetadata::new().set_operation_state(OperationState::Processing);
8827 /// let x2 = BulkDeleteDocumentsMetadata::new().set_operation_state(OperationState::Cancelling);
8828 /// ```
8829 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
8830 mut self,
8831 v: T,
8832 ) -> Self {
8833 self.operation_state = v.into();
8834 self
8835 }
8836
8837 /// Sets the value of [progress_documents][crate::model::BulkDeleteDocumentsMetadata::progress_documents].
8838 ///
8839 /// # Example
8840 /// ```ignore,no_run
8841 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8842 /// use google_cloud_firestore_admin_v1::model::Progress;
8843 /// let x = BulkDeleteDocumentsMetadata::new().set_progress_documents(Progress::default()/* use setters */);
8844 /// ```
8845 pub fn set_progress_documents<T>(mut self, v: T) -> Self
8846 where
8847 T: std::convert::Into<crate::model::Progress>,
8848 {
8849 self.progress_documents = std::option::Option::Some(v.into());
8850 self
8851 }
8852
8853 /// Sets or clears the value of [progress_documents][crate::model::BulkDeleteDocumentsMetadata::progress_documents].
8854 ///
8855 /// # Example
8856 /// ```ignore,no_run
8857 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8858 /// use google_cloud_firestore_admin_v1::model::Progress;
8859 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
8860 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_progress_documents(None::<Progress>);
8861 /// ```
8862 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
8863 where
8864 T: std::convert::Into<crate::model::Progress>,
8865 {
8866 self.progress_documents = v.map(|x| x.into());
8867 self
8868 }
8869
8870 /// Sets the value of [progress_bytes][crate::model::BulkDeleteDocumentsMetadata::progress_bytes].
8871 ///
8872 /// # Example
8873 /// ```ignore,no_run
8874 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8875 /// use google_cloud_firestore_admin_v1::model::Progress;
8876 /// let x = BulkDeleteDocumentsMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
8877 /// ```
8878 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
8879 where
8880 T: std::convert::Into<crate::model::Progress>,
8881 {
8882 self.progress_bytes = std::option::Option::Some(v.into());
8883 self
8884 }
8885
8886 /// Sets or clears the value of [progress_bytes][crate::model::BulkDeleteDocumentsMetadata::progress_bytes].
8887 ///
8888 /// # Example
8889 /// ```ignore,no_run
8890 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8891 /// use google_cloud_firestore_admin_v1::model::Progress;
8892 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
8893 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
8894 /// ```
8895 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8896 where
8897 T: std::convert::Into<crate::model::Progress>,
8898 {
8899 self.progress_bytes = v.map(|x| x.into());
8900 self
8901 }
8902
8903 /// Sets the value of [collection_ids][crate::model::BulkDeleteDocumentsMetadata::collection_ids].
8904 ///
8905 /// # Example
8906 /// ```ignore,no_run
8907 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8908 /// let x = BulkDeleteDocumentsMetadata::new().set_collection_ids(["a", "b", "c"]);
8909 /// ```
8910 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
8911 where
8912 T: std::iter::IntoIterator<Item = V>,
8913 V: std::convert::Into<std::string::String>,
8914 {
8915 use std::iter::Iterator;
8916 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
8917 self
8918 }
8919
8920 /// Sets the value of [namespace_ids][crate::model::BulkDeleteDocumentsMetadata::namespace_ids].
8921 ///
8922 /// # Example
8923 /// ```ignore,no_run
8924 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8925 /// let x = BulkDeleteDocumentsMetadata::new().set_namespace_ids(["a", "b", "c"]);
8926 /// ```
8927 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
8928 where
8929 T: std::iter::IntoIterator<Item = V>,
8930 V: std::convert::Into<std::string::String>,
8931 {
8932 use std::iter::Iterator;
8933 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
8934 self
8935 }
8936
8937 /// Sets the value of [snapshot_time][crate::model::BulkDeleteDocumentsMetadata::snapshot_time].
8938 ///
8939 /// # Example
8940 /// ```ignore,no_run
8941 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8942 /// use wkt::Timestamp;
8943 /// let x = BulkDeleteDocumentsMetadata::new().set_snapshot_time(Timestamp::default()/* use setters */);
8944 /// ```
8945 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
8946 where
8947 T: std::convert::Into<wkt::Timestamp>,
8948 {
8949 self.snapshot_time = std::option::Option::Some(v.into());
8950 self
8951 }
8952
8953 /// Sets or clears the value of [snapshot_time][crate::model::BulkDeleteDocumentsMetadata::snapshot_time].
8954 ///
8955 /// # Example
8956 /// ```ignore,no_run
8957 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8958 /// use wkt::Timestamp;
8959 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_snapshot_time(Some(Timestamp::default()/* use setters */));
8960 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_snapshot_time(None::<Timestamp>);
8961 /// ```
8962 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
8963 where
8964 T: std::convert::Into<wkt::Timestamp>,
8965 {
8966 self.snapshot_time = v.map(|x| x.into());
8967 self
8968 }
8969}
8970
8971impl wkt::message::Message for BulkDeleteDocumentsMetadata {
8972 fn typename() -> &'static str {
8973 "type.googleapis.com/google.firestore.admin.v1.BulkDeleteDocumentsMetadata"
8974 }
8975}
8976
8977/// Returned in the [google.longrunning.Operation][google.longrunning.Operation]
8978/// response field.
8979///
8980/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8981#[derive(Clone, Default, PartialEq)]
8982#[non_exhaustive]
8983pub struct ExportDocumentsResponse {
8984 /// Location of the output files. This can be used to begin an import
8985 /// into Cloud Firestore (this project or another project) after the operation
8986 /// completes successfully.
8987 pub output_uri_prefix: std::string::String,
8988
8989 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8990}
8991
8992impl ExportDocumentsResponse {
8993 pub fn new() -> Self {
8994 std::default::Default::default()
8995 }
8996
8997 /// Sets the value of [output_uri_prefix][crate::model::ExportDocumentsResponse::output_uri_prefix].
8998 ///
8999 /// # Example
9000 /// ```ignore,no_run
9001 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsResponse;
9002 /// let x = ExportDocumentsResponse::new().set_output_uri_prefix("example");
9003 /// ```
9004 pub fn set_output_uri_prefix<T: std::convert::Into<std::string::String>>(
9005 mut self,
9006 v: T,
9007 ) -> Self {
9008 self.output_uri_prefix = v.into();
9009 self
9010 }
9011}
9012
9013impl wkt::message::Message for ExportDocumentsResponse {
9014 fn typename() -> &'static str {
9015 "type.googleapis.com/google.firestore.admin.v1.ExportDocumentsResponse"
9016 }
9017}
9018
9019/// Metadata for the [long-running operation][google.longrunning.Operation] from
9020/// the [RestoreDatabase][google.firestore.admin.v1.RestoreDatabase] request.
9021///
9022/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
9023#[derive(Clone, Default, PartialEq)]
9024#[non_exhaustive]
9025pub struct RestoreDatabaseMetadata {
9026 /// The time the restore was started.
9027 pub start_time: std::option::Option<wkt::Timestamp>,
9028
9029 /// The time the restore finished, unset for ongoing restores.
9030 pub end_time: std::option::Option<wkt::Timestamp>,
9031
9032 /// The operation state of the restore.
9033 pub operation_state: crate::model::OperationState,
9034
9035 /// The name of the database being restored to.
9036 pub database: std::string::String,
9037
9038 /// The name of the backup restoring from.
9039 pub backup: std::string::String,
9040
9041 /// How far along the restore is as an estimated percentage of remaining time.
9042 pub progress_percentage: std::option::Option<crate::model::Progress>,
9043
9044 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9045}
9046
9047impl RestoreDatabaseMetadata {
9048 pub fn new() -> Self {
9049 std::default::Default::default()
9050 }
9051
9052 /// Sets the value of [start_time][crate::model::RestoreDatabaseMetadata::start_time].
9053 ///
9054 /// # Example
9055 /// ```ignore,no_run
9056 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9057 /// use wkt::Timestamp;
9058 /// let x = RestoreDatabaseMetadata::new().set_start_time(Timestamp::default()/* use setters */);
9059 /// ```
9060 pub fn set_start_time<T>(mut self, v: T) -> Self
9061 where
9062 T: std::convert::Into<wkt::Timestamp>,
9063 {
9064 self.start_time = std::option::Option::Some(v.into());
9065 self
9066 }
9067
9068 /// Sets or clears the value of [start_time][crate::model::RestoreDatabaseMetadata::start_time].
9069 ///
9070 /// # Example
9071 /// ```ignore,no_run
9072 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9073 /// use wkt::Timestamp;
9074 /// let x = RestoreDatabaseMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
9075 /// let x = RestoreDatabaseMetadata::new().set_or_clear_start_time(None::<Timestamp>);
9076 /// ```
9077 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
9078 where
9079 T: std::convert::Into<wkt::Timestamp>,
9080 {
9081 self.start_time = v.map(|x| x.into());
9082 self
9083 }
9084
9085 /// Sets the value of [end_time][crate::model::RestoreDatabaseMetadata::end_time].
9086 ///
9087 /// # Example
9088 /// ```ignore,no_run
9089 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9090 /// use wkt::Timestamp;
9091 /// let x = RestoreDatabaseMetadata::new().set_end_time(Timestamp::default()/* use setters */);
9092 /// ```
9093 pub fn set_end_time<T>(mut self, v: T) -> Self
9094 where
9095 T: std::convert::Into<wkt::Timestamp>,
9096 {
9097 self.end_time = std::option::Option::Some(v.into());
9098 self
9099 }
9100
9101 /// Sets or clears the value of [end_time][crate::model::RestoreDatabaseMetadata::end_time].
9102 ///
9103 /// # Example
9104 /// ```ignore,no_run
9105 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9106 /// use wkt::Timestamp;
9107 /// let x = RestoreDatabaseMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
9108 /// let x = RestoreDatabaseMetadata::new().set_or_clear_end_time(None::<Timestamp>);
9109 /// ```
9110 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9111 where
9112 T: std::convert::Into<wkt::Timestamp>,
9113 {
9114 self.end_time = v.map(|x| x.into());
9115 self
9116 }
9117
9118 /// Sets the value of [operation_state][crate::model::RestoreDatabaseMetadata::operation_state].
9119 ///
9120 /// # Example
9121 /// ```ignore,no_run
9122 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9123 /// use google_cloud_firestore_admin_v1::model::OperationState;
9124 /// let x0 = RestoreDatabaseMetadata::new().set_operation_state(OperationState::Initializing);
9125 /// let x1 = RestoreDatabaseMetadata::new().set_operation_state(OperationState::Processing);
9126 /// let x2 = RestoreDatabaseMetadata::new().set_operation_state(OperationState::Cancelling);
9127 /// ```
9128 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
9129 mut self,
9130 v: T,
9131 ) -> Self {
9132 self.operation_state = v.into();
9133 self
9134 }
9135
9136 /// Sets the value of [database][crate::model::RestoreDatabaseMetadata::database].
9137 ///
9138 /// # Example
9139 /// ```ignore,no_run
9140 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9141 /// let x = RestoreDatabaseMetadata::new().set_database("example");
9142 /// ```
9143 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9144 self.database = v.into();
9145 self
9146 }
9147
9148 /// Sets the value of [backup][crate::model::RestoreDatabaseMetadata::backup].
9149 ///
9150 /// # Example
9151 /// ```ignore,no_run
9152 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9153 /// let x = RestoreDatabaseMetadata::new().set_backup("example");
9154 /// ```
9155 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9156 self.backup = v.into();
9157 self
9158 }
9159
9160 /// Sets the value of [progress_percentage][crate::model::RestoreDatabaseMetadata::progress_percentage].
9161 ///
9162 /// # Example
9163 /// ```ignore,no_run
9164 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9165 /// use google_cloud_firestore_admin_v1::model::Progress;
9166 /// let x = RestoreDatabaseMetadata::new().set_progress_percentage(Progress::default()/* use setters */);
9167 /// ```
9168 pub fn set_progress_percentage<T>(mut self, v: T) -> Self
9169 where
9170 T: std::convert::Into<crate::model::Progress>,
9171 {
9172 self.progress_percentage = std::option::Option::Some(v.into());
9173 self
9174 }
9175
9176 /// Sets or clears the value of [progress_percentage][crate::model::RestoreDatabaseMetadata::progress_percentage].
9177 ///
9178 /// # Example
9179 /// ```ignore,no_run
9180 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9181 /// use google_cloud_firestore_admin_v1::model::Progress;
9182 /// let x = RestoreDatabaseMetadata::new().set_or_clear_progress_percentage(Some(Progress::default()/* use setters */));
9183 /// let x = RestoreDatabaseMetadata::new().set_or_clear_progress_percentage(None::<Progress>);
9184 /// ```
9185 pub fn set_or_clear_progress_percentage<T>(mut self, v: std::option::Option<T>) -> Self
9186 where
9187 T: std::convert::Into<crate::model::Progress>,
9188 {
9189 self.progress_percentage = v.map(|x| x.into());
9190 self
9191 }
9192}
9193
9194impl wkt::message::Message for RestoreDatabaseMetadata {
9195 fn typename() -> &'static str {
9196 "type.googleapis.com/google.firestore.admin.v1.RestoreDatabaseMetadata"
9197 }
9198}
9199
9200/// Metadata for the [long-running operation][google.longrunning.Operation] from
9201/// the [CloneDatabase][google.firestore.admin.v1.CloneDatabase] request.
9202///
9203/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
9204#[derive(Clone, Default, PartialEq)]
9205#[non_exhaustive]
9206pub struct CloneDatabaseMetadata {
9207 /// The time the clone was started.
9208 pub start_time: std::option::Option<wkt::Timestamp>,
9209
9210 /// The time the clone finished, unset for ongoing clones.
9211 pub end_time: std::option::Option<wkt::Timestamp>,
9212
9213 /// The operation state of the clone.
9214 pub operation_state: crate::model::OperationState,
9215
9216 /// The name of the database being cloned to.
9217 pub database: std::string::String,
9218
9219 /// The snapshot from which this database was cloned.
9220 pub pitr_snapshot: std::option::Option<crate::model::PitrSnapshot>,
9221
9222 /// How far along the clone is as an estimated percentage of remaining time.
9223 pub progress_percentage: std::option::Option<crate::model::Progress>,
9224
9225 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9226}
9227
9228impl CloneDatabaseMetadata {
9229 pub fn new() -> Self {
9230 std::default::Default::default()
9231 }
9232
9233 /// Sets the value of [start_time][crate::model::CloneDatabaseMetadata::start_time].
9234 ///
9235 /// # Example
9236 /// ```ignore,no_run
9237 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9238 /// use wkt::Timestamp;
9239 /// let x = CloneDatabaseMetadata::new().set_start_time(Timestamp::default()/* use setters */);
9240 /// ```
9241 pub fn set_start_time<T>(mut self, v: T) -> Self
9242 where
9243 T: std::convert::Into<wkt::Timestamp>,
9244 {
9245 self.start_time = std::option::Option::Some(v.into());
9246 self
9247 }
9248
9249 /// Sets or clears the value of [start_time][crate::model::CloneDatabaseMetadata::start_time].
9250 ///
9251 /// # Example
9252 /// ```ignore,no_run
9253 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9254 /// use wkt::Timestamp;
9255 /// let x = CloneDatabaseMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
9256 /// let x = CloneDatabaseMetadata::new().set_or_clear_start_time(None::<Timestamp>);
9257 /// ```
9258 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
9259 where
9260 T: std::convert::Into<wkt::Timestamp>,
9261 {
9262 self.start_time = v.map(|x| x.into());
9263 self
9264 }
9265
9266 /// Sets the value of [end_time][crate::model::CloneDatabaseMetadata::end_time].
9267 ///
9268 /// # Example
9269 /// ```ignore,no_run
9270 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9271 /// use wkt::Timestamp;
9272 /// let x = CloneDatabaseMetadata::new().set_end_time(Timestamp::default()/* use setters */);
9273 /// ```
9274 pub fn set_end_time<T>(mut self, v: T) -> Self
9275 where
9276 T: std::convert::Into<wkt::Timestamp>,
9277 {
9278 self.end_time = std::option::Option::Some(v.into());
9279 self
9280 }
9281
9282 /// Sets or clears the value of [end_time][crate::model::CloneDatabaseMetadata::end_time].
9283 ///
9284 /// # Example
9285 /// ```ignore,no_run
9286 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9287 /// use wkt::Timestamp;
9288 /// let x = CloneDatabaseMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
9289 /// let x = CloneDatabaseMetadata::new().set_or_clear_end_time(None::<Timestamp>);
9290 /// ```
9291 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9292 where
9293 T: std::convert::Into<wkt::Timestamp>,
9294 {
9295 self.end_time = v.map(|x| x.into());
9296 self
9297 }
9298
9299 /// Sets the value of [operation_state][crate::model::CloneDatabaseMetadata::operation_state].
9300 ///
9301 /// # Example
9302 /// ```ignore,no_run
9303 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9304 /// use google_cloud_firestore_admin_v1::model::OperationState;
9305 /// let x0 = CloneDatabaseMetadata::new().set_operation_state(OperationState::Initializing);
9306 /// let x1 = CloneDatabaseMetadata::new().set_operation_state(OperationState::Processing);
9307 /// let x2 = CloneDatabaseMetadata::new().set_operation_state(OperationState::Cancelling);
9308 /// ```
9309 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
9310 mut self,
9311 v: T,
9312 ) -> Self {
9313 self.operation_state = v.into();
9314 self
9315 }
9316
9317 /// Sets the value of [database][crate::model::CloneDatabaseMetadata::database].
9318 ///
9319 /// # Example
9320 /// ```ignore,no_run
9321 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9322 /// let x = CloneDatabaseMetadata::new().set_database("example");
9323 /// ```
9324 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9325 self.database = v.into();
9326 self
9327 }
9328
9329 /// Sets the value of [pitr_snapshot][crate::model::CloneDatabaseMetadata::pitr_snapshot].
9330 ///
9331 /// # Example
9332 /// ```ignore,no_run
9333 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9334 /// use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9335 /// let x = CloneDatabaseMetadata::new().set_pitr_snapshot(PitrSnapshot::default()/* use setters */);
9336 /// ```
9337 pub fn set_pitr_snapshot<T>(mut self, v: T) -> Self
9338 where
9339 T: std::convert::Into<crate::model::PitrSnapshot>,
9340 {
9341 self.pitr_snapshot = std::option::Option::Some(v.into());
9342 self
9343 }
9344
9345 /// Sets or clears the value of [pitr_snapshot][crate::model::CloneDatabaseMetadata::pitr_snapshot].
9346 ///
9347 /// # Example
9348 /// ```ignore,no_run
9349 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9350 /// use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9351 /// let x = CloneDatabaseMetadata::new().set_or_clear_pitr_snapshot(Some(PitrSnapshot::default()/* use setters */));
9352 /// let x = CloneDatabaseMetadata::new().set_or_clear_pitr_snapshot(None::<PitrSnapshot>);
9353 /// ```
9354 pub fn set_or_clear_pitr_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
9355 where
9356 T: std::convert::Into<crate::model::PitrSnapshot>,
9357 {
9358 self.pitr_snapshot = v.map(|x| x.into());
9359 self
9360 }
9361
9362 /// Sets the value of [progress_percentage][crate::model::CloneDatabaseMetadata::progress_percentage].
9363 ///
9364 /// # Example
9365 /// ```ignore,no_run
9366 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9367 /// use google_cloud_firestore_admin_v1::model::Progress;
9368 /// let x = CloneDatabaseMetadata::new().set_progress_percentage(Progress::default()/* use setters */);
9369 /// ```
9370 pub fn set_progress_percentage<T>(mut self, v: T) -> Self
9371 where
9372 T: std::convert::Into<crate::model::Progress>,
9373 {
9374 self.progress_percentage = std::option::Option::Some(v.into());
9375 self
9376 }
9377
9378 /// Sets or clears the value of [progress_percentage][crate::model::CloneDatabaseMetadata::progress_percentage].
9379 ///
9380 /// # Example
9381 /// ```ignore,no_run
9382 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9383 /// use google_cloud_firestore_admin_v1::model::Progress;
9384 /// let x = CloneDatabaseMetadata::new().set_or_clear_progress_percentage(Some(Progress::default()/* use setters */));
9385 /// let x = CloneDatabaseMetadata::new().set_or_clear_progress_percentage(None::<Progress>);
9386 /// ```
9387 pub fn set_or_clear_progress_percentage<T>(mut self, v: std::option::Option<T>) -> Self
9388 where
9389 T: std::convert::Into<crate::model::Progress>,
9390 {
9391 self.progress_percentage = v.map(|x| x.into());
9392 self
9393 }
9394}
9395
9396impl wkt::message::Message for CloneDatabaseMetadata {
9397 fn typename() -> &'static str {
9398 "type.googleapis.com/google.firestore.admin.v1.CloneDatabaseMetadata"
9399 }
9400}
9401
9402/// Describes the progress of the operation.
9403/// Unit of work is generic and must be interpreted based on where
9404/// [Progress][google.firestore.admin.v1.Progress] is used.
9405///
9406/// [google.firestore.admin.v1.Progress]: crate::model::Progress
9407#[derive(Clone, Default, PartialEq)]
9408#[non_exhaustive]
9409pub struct Progress {
9410 /// The amount of work estimated.
9411 pub estimated_work: i64,
9412
9413 /// The amount of work completed.
9414 pub completed_work: i64,
9415
9416 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9417}
9418
9419impl Progress {
9420 pub fn new() -> Self {
9421 std::default::Default::default()
9422 }
9423
9424 /// Sets the value of [estimated_work][crate::model::Progress::estimated_work].
9425 ///
9426 /// # Example
9427 /// ```ignore,no_run
9428 /// # use google_cloud_firestore_admin_v1::model::Progress;
9429 /// let x = Progress::new().set_estimated_work(42);
9430 /// ```
9431 pub fn set_estimated_work<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9432 self.estimated_work = v.into();
9433 self
9434 }
9435
9436 /// Sets the value of [completed_work][crate::model::Progress::completed_work].
9437 ///
9438 /// # Example
9439 /// ```ignore,no_run
9440 /// # use google_cloud_firestore_admin_v1::model::Progress;
9441 /// let x = Progress::new().set_completed_work(42);
9442 /// ```
9443 pub fn set_completed_work<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9444 self.completed_work = v.into();
9445 self
9446 }
9447}
9448
9449impl wkt::message::Message for Progress {
9450 fn typename() -> &'static str {
9451 "type.googleapis.com/google.firestore.admin.v1.Progress"
9452 }
9453}
9454
9455/// A backup schedule for a Cloud Firestore Database.
9456///
9457/// This resource is owned by the database it is backing up, and is deleted along
9458/// with the database. The actual backups are not though.
9459#[derive(Clone, Default, PartialEq)]
9460#[non_exhaustive]
9461pub struct BackupSchedule {
9462 /// Output only. The unique backup schedule identifier across all locations and
9463 /// databases for the given project.
9464 ///
9465 /// This will be auto-assigned.
9466 ///
9467 /// Format is
9468 /// `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
9469 pub name: std::string::String,
9470
9471 /// Output only. The timestamp at which this backup schedule was created and
9472 /// effective since.
9473 ///
9474 /// No backups will be created for this schedule before this time.
9475 pub create_time: std::option::Option<wkt::Timestamp>,
9476
9477 /// Output only. The timestamp at which this backup schedule was most recently
9478 /// updated. When a backup schedule is first created, this is the same as
9479 /// create_time.
9480 pub update_time: std::option::Option<wkt::Timestamp>,
9481
9482 /// At what relative time in the future, compared to its creation time,
9483 /// the backup should be deleted, e.g. keep backups for 7 days.
9484 ///
9485 /// The maximum supported retention period is 14 weeks.
9486 pub retention: std::option::Option<wkt::Duration>,
9487
9488 /// A oneof field to represent when backups will be taken.
9489 pub recurrence: std::option::Option<crate::model::backup_schedule::Recurrence>,
9490
9491 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9492}
9493
9494impl BackupSchedule {
9495 pub fn new() -> Self {
9496 std::default::Default::default()
9497 }
9498
9499 /// Sets the value of [name][crate::model::BackupSchedule::name].
9500 ///
9501 /// # Example
9502 /// ```ignore,no_run
9503 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9504 /// let x = BackupSchedule::new().set_name("example");
9505 /// ```
9506 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9507 self.name = v.into();
9508 self
9509 }
9510
9511 /// Sets the value of [create_time][crate::model::BackupSchedule::create_time].
9512 ///
9513 /// # Example
9514 /// ```ignore,no_run
9515 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9516 /// use wkt::Timestamp;
9517 /// let x = BackupSchedule::new().set_create_time(Timestamp::default()/* use setters */);
9518 /// ```
9519 pub fn set_create_time<T>(mut self, v: T) -> Self
9520 where
9521 T: std::convert::Into<wkt::Timestamp>,
9522 {
9523 self.create_time = std::option::Option::Some(v.into());
9524 self
9525 }
9526
9527 /// Sets or clears the value of [create_time][crate::model::BackupSchedule::create_time].
9528 ///
9529 /// # Example
9530 /// ```ignore,no_run
9531 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9532 /// use wkt::Timestamp;
9533 /// let x = BackupSchedule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9534 /// let x = BackupSchedule::new().set_or_clear_create_time(None::<Timestamp>);
9535 /// ```
9536 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9537 where
9538 T: std::convert::Into<wkt::Timestamp>,
9539 {
9540 self.create_time = v.map(|x| x.into());
9541 self
9542 }
9543
9544 /// Sets the value of [update_time][crate::model::BackupSchedule::update_time].
9545 ///
9546 /// # Example
9547 /// ```ignore,no_run
9548 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9549 /// use wkt::Timestamp;
9550 /// let x = BackupSchedule::new().set_update_time(Timestamp::default()/* use setters */);
9551 /// ```
9552 pub fn set_update_time<T>(mut self, v: T) -> Self
9553 where
9554 T: std::convert::Into<wkt::Timestamp>,
9555 {
9556 self.update_time = std::option::Option::Some(v.into());
9557 self
9558 }
9559
9560 /// Sets or clears the value of [update_time][crate::model::BackupSchedule::update_time].
9561 ///
9562 /// # Example
9563 /// ```ignore,no_run
9564 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9565 /// use wkt::Timestamp;
9566 /// let x = BackupSchedule::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9567 /// let x = BackupSchedule::new().set_or_clear_update_time(None::<Timestamp>);
9568 /// ```
9569 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9570 where
9571 T: std::convert::Into<wkt::Timestamp>,
9572 {
9573 self.update_time = v.map(|x| x.into());
9574 self
9575 }
9576
9577 /// Sets the value of [retention][crate::model::BackupSchedule::retention].
9578 ///
9579 /// # Example
9580 /// ```ignore,no_run
9581 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9582 /// use wkt::Duration;
9583 /// let x = BackupSchedule::new().set_retention(Duration::default()/* use setters */);
9584 /// ```
9585 pub fn set_retention<T>(mut self, v: T) -> Self
9586 where
9587 T: std::convert::Into<wkt::Duration>,
9588 {
9589 self.retention = std::option::Option::Some(v.into());
9590 self
9591 }
9592
9593 /// Sets or clears the value of [retention][crate::model::BackupSchedule::retention].
9594 ///
9595 /// # Example
9596 /// ```ignore,no_run
9597 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9598 /// use wkt::Duration;
9599 /// let x = BackupSchedule::new().set_or_clear_retention(Some(Duration::default()/* use setters */));
9600 /// let x = BackupSchedule::new().set_or_clear_retention(None::<Duration>);
9601 /// ```
9602 pub fn set_or_clear_retention<T>(mut self, v: std::option::Option<T>) -> Self
9603 where
9604 T: std::convert::Into<wkt::Duration>,
9605 {
9606 self.retention = v.map(|x| x.into());
9607 self
9608 }
9609
9610 /// Sets the value of [recurrence][crate::model::BackupSchedule::recurrence].
9611 ///
9612 /// Note that all the setters affecting `recurrence` are mutually
9613 /// exclusive.
9614 ///
9615 /// # Example
9616 /// ```ignore,no_run
9617 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9618 /// use google_cloud_firestore_admin_v1::model::DailyRecurrence;
9619 /// let x = BackupSchedule::new().set_recurrence(Some(
9620 /// google_cloud_firestore_admin_v1::model::backup_schedule::Recurrence::DailyRecurrence(DailyRecurrence::default().into())));
9621 /// ```
9622 pub fn set_recurrence<
9623 T: std::convert::Into<std::option::Option<crate::model::backup_schedule::Recurrence>>,
9624 >(
9625 mut self,
9626 v: T,
9627 ) -> Self {
9628 self.recurrence = v.into();
9629 self
9630 }
9631
9632 /// The value of [recurrence][crate::model::BackupSchedule::recurrence]
9633 /// if it holds a `DailyRecurrence`, `None` if the field is not set or
9634 /// holds a different branch.
9635 pub fn daily_recurrence(
9636 &self,
9637 ) -> std::option::Option<&std::boxed::Box<crate::model::DailyRecurrence>> {
9638 #[allow(unreachable_patterns)]
9639 self.recurrence.as_ref().and_then(|v| match v {
9640 crate::model::backup_schedule::Recurrence::DailyRecurrence(v) => {
9641 std::option::Option::Some(v)
9642 }
9643 _ => std::option::Option::None,
9644 })
9645 }
9646
9647 /// Sets the value of [recurrence][crate::model::BackupSchedule::recurrence]
9648 /// to hold a `DailyRecurrence`.
9649 ///
9650 /// Note that all the setters affecting `recurrence` are
9651 /// mutually exclusive.
9652 ///
9653 /// # Example
9654 /// ```ignore,no_run
9655 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9656 /// use google_cloud_firestore_admin_v1::model::DailyRecurrence;
9657 /// let x = BackupSchedule::new().set_daily_recurrence(DailyRecurrence::default()/* use setters */);
9658 /// assert!(x.daily_recurrence().is_some());
9659 /// assert!(x.weekly_recurrence().is_none());
9660 /// ```
9661 pub fn set_daily_recurrence<
9662 T: std::convert::Into<std::boxed::Box<crate::model::DailyRecurrence>>,
9663 >(
9664 mut self,
9665 v: T,
9666 ) -> Self {
9667 self.recurrence = std::option::Option::Some(
9668 crate::model::backup_schedule::Recurrence::DailyRecurrence(v.into()),
9669 );
9670 self
9671 }
9672
9673 /// The value of [recurrence][crate::model::BackupSchedule::recurrence]
9674 /// if it holds a `WeeklyRecurrence`, `None` if the field is not set or
9675 /// holds a different branch.
9676 pub fn weekly_recurrence(
9677 &self,
9678 ) -> std::option::Option<&std::boxed::Box<crate::model::WeeklyRecurrence>> {
9679 #[allow(unreachable_patterns)]
9680 self.recurrence.as_ref().and_then(|v| match v {
9681 crate::model::backup_schedule::Recurrence::WeeklyRecurrence(v) => {
9682 std::option::Option::Some(v)
9683 }
9684 _ => std::option::Option::None,
9685 })
9686 }
9687
9688 /// Sets the value of [recurrence][crate::model::BackupSchedule::recurrence]
9689 /// to hold a `WeeklyRecurrence`.
9690 ///
9691 /// Note that all the setters affecting `recurrence` are
9692 /// mutually exclusive.
9693 ///
9694 /// # Example
9695 /// ```ignore,no_run
9696 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9697 /// use google_cloud_firestore_admin_v1::model::WeeklyRecurrence;
9698 /// let x = BackupSchedule::new().set_weekly_recurrence(WeeklyRecurrence::default()/* use setters */);
9699 /// assert!(x.weekly_recurrence().is_some());
9700 /// assert!(x.daily_recurrence().is_none());
9701 /// ```
9702 pub fn set_weekly_recurrence<
9703 T: std::convert::Into<std::boxed::Box<crate::model::WeeklyRecurrence>>,
9704 >(
9705 mut self,
9706 v: T,
9707 ) -> Self {
9708 self.recurrence = std::option::Option::Some(
9709 crate::model::backup_schedule::Recurrence::WeeklyRecurrence(v.into()),
9710 );
9711 self
9712 }
9713}
9714
9715impl wkt::message::Message for BackupSchedule {
9716 fn typename() -> &'static str {
9717 "type.googleapis.com/google.firestore.admin.v1.BackupSchedule"
9718 }
9719}
9720
9721/// Defines additional types related to [BackupSchedule].
9722pub mod backup_schedule {
9723 #[allow(unused_imports)]
9724 use super::*;
9725
9726 /// A oneof field to represent when backups will be taken.
9727 #[derive(Clone, Debug, PartialEq)]
9728 #[non_exhaustive]
9729 pub enum Recurrence {
9730 /// For a schedule that runs daily.
9731 DailyRecurrence(std::boxed::Box<crate::model::DailyRecurrence>),
9732 /// For a schedule that runs weekly on a specific day.
9733 WeeklyRecurrence(std::boxed::Box<crate::model::WeeklyRecurrence>),
9734 }
9735}
9736
9737/// Represents a recurring schedule that runs every day.
9738///
9739/// The time zone is UTC.
9740#[derive(Clone, Default, PartialEq)]
9741#[non_exhaustive]
9742pub struct DailyRecurrence {
9743 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9744}
9745
9746impl DailyRecurrence {
9747 pub fn new() -> Self {
9748 std::default::Default::default()
9749 }
9750}
9751
9752impl wkt::message::Message for DailyRecurrence {
9753 fn typename() -> &'static str {
9754 "type.googleapis.com/google.firestore.admin.v1.DailyRecurrence"
9755 }
9756}
9757
9758/// Represents a recurring schedule that runs on a specified day of the week.
9759///
9760/// The time zone is UTC.
9761#[derive(Clone, Default, PartialEq)]
9762#[non_exhaustive]
9763pub struct WeeklyRecurrence {
9764 /// The day of week to run.
9765 ///
9766 /// DAY_OF_WEEK_UNSPECIFIED is not allowed.
9767 pub day: google_cloud_type::model::DayOfWeek,
9768
9769 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9770}
9771
9772impl WeeklyRecurrence {
9773 pub fn new() -> Self {
9774 std::default::Default::default()
9775 }
9776
9777 /// Sets the value of [day][crate::model::WeeklyRecurrence::day].
9778 ///
9779 /// # Example
9780 /// ```ignore,no_run
9781 /// # use google_cloud_firestore_admin_v1::model::WeeklyRecurrence;
9782 /// use google_cloud_type::model::DayOfWeek;
9783 /// let x0 = WeeklyRecurrence::new().set_day(DayOfWeek::Monday);
9784 /// let x1 = WeeklyRecurrence::new().set_day(DayOfWeek::Tuesday);
9785 /// let x2 = WeeklyRecurrence::new().set_day(DayOfWeek::Wednesday);
9786 /// ```
9787 pub fn set_day<T: std::convert::Into<google_cloud_type::model::DayOfWeek>>(
9788 mut self,
9789 v: T,
9790 ) -> Self {
9791 self.day = v.into();
9792 self
9793 }
9794}
9795
9796impl wkt::message::Message for WeeklyRecurrence {
9797 fn typename() -> &'static str {
9798 "type.googleapis.com/google.firestore.admin.v1.WeeklyRecurrence"
9799 }
9800}
9801
9802/// A consistent snapshot of a database at a specific point in time.
9803/// A PITR (Point-in-time recovery) snapshot with previous versions of a
9804/// database's data is available for every minute up to the associated database's
9805/// data retention period. If the PITR feature is enabled, the retention period
9806/// is 7 days; otherwise, it is one hour.
9807#[derive(Clone, Default, PartialEq)]
9808#[non_exhaustive]
9809pub struct PitrSnapshot {
9810 /// Required. The name of the database that this was a snapshot of. Format:
9811 /// `projects/{project}/databases/{database}`.
9812 pub database: std::string::String,
9813
9814 /// Output only. Public UUID of the database the snapshot was associated with.
9815 pub database_uid: ::bytes::Bytes,
9816
9817 /// Required. Snapshot time of the database.
9818 pub snapshot_time: std::option::Option<wkt::Timestamp>,
9819
9820 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9821}
9822
9823impl PitrSnapshot {
9824 pub fn new() -> Self {
9825 std::default::Default::default()
9826 }
9827
9828 /// Sets the value of [database][crate::model::PitrSnapshot::database].
9829 ///
9830 /// # Example
9831 /// ```ignore,no_run
9832 /// # use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9833 /// let x = PitrSnapshot::new().set_database("example");
9834 /// ```
9835 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9836 self.database = v.into();
9837 self
9838 }
9839
9840 /// Sets the value of [database_uid][crate::model::PitrSnapshot::database_uid].
9841 ///
9842 /// # Example
9843 /// ```ignore,no_run
9844 /// # use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9845 /// let x = PitrSnapshot::new().set_database_uid(bytes::Bytes::from_static(b"example"));
9846 /// ```
9847 pub fn set_database_uid<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
9848 self.database_uid = v.into();
9849 self
9850 }
9851
9852 /// Sets the value of [snapshot_time][crate::model::PitrSnapshot::snapshot_time].
9853 ///
9854 /// # Example
9855 /// ```ignore,no_run
9856 /// # use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9857 /// use wkt::Timestamp;
9858 /// let x = PitrSnapshot::new().set_snapshot_time(Timestamp::default()/* use setters */);
9859 /// ```
9860 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
9861 where
9862 T: std::convert::Into<wkt::Timestamp>,
9863 {
9864 self.snapshot_time = std::option::Option::Some(v.into());
9865 self
9866 }
9867
9868 /// Sets or clears the value of [snapshot_time][crate::model::PitrSnapshot::snapshot_time].
9869 ///
9870 /// # Example
9871 /// ```ignore,no_run
9872 /// # use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9873 /// use wkt::Timestamp;
9874 /// let x = PitrSnapshot::new().set_or_clear_snapshot_time(Some(Timestamp::default()/* use setters */));
9875 /// let x = PitrSnapshot::new().set_or_clear_snapshot_time(None::<Timestamp>);
9876 /// ```
9877 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
9878 where
9879 T: std::convert::Into<wkt::Timestamp>,
9880 {
9881 self.snapshot_time = v.map(|x| x.into());
9882 self
9883 }
9884}
9885
9886impl wkt::message::Message for PitrSnapshot {
9887 fn typename() -> &'static str {
9888 "type.googleapis.com/google.firestore.admin.v1.PitrSnapshot"
9889 }
9890}
9891
9892/// A Cloud Firestore User Creds.
9893#[derive(Clone, Default, PartialEq)]
9894#[non_exhaustive]
9895pub struct UserCreds {
9896 /// Identifier. The resource name of the UserCreds.
9897 /// Format:
9898 /// `projects/{project}/databases/{database}/userCreds/{user_creds}`
9899 pub name: std::string::String,
9900
9901 /// Output only. The time the user creds were created.
9902 pub create_time: std::option::Option<wkt::Timestamp>,
9903
9904 /// Output only. The time the user creds were last updated.
9905 pub update_time: std::option::Option<wkt::Timestamp>,
9906
9907 /// Output only. Whether the user creds are enabled or disabled. Defaults to
9908 /// ENABLED on creation.
9909 pub state: crate::model::user_creds::State,
9910
9911 /// Output only. The plaintext server-generated password for the user creds.
9912 /// Only populated in responses for CreateUserCreds and ResetUserPassword.
9913 pub secure_password: std::string::String,
9914
9915 /// Identity associated with this User Creds.
9916 pub user_creds_identity: std::option::Option<crate::model::user_creds::UserCredsIdentity>,
9917
9918 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9919}
9920
9921impl UserCreds {
9922 pub fn new() -> Self {
9923 std::default::Default::default()
9924 }
9925
9926 /// Sets the value of [name][crate::model::UserCreds::name].
9927 ///
9928 /// # Example
9929 /// ```ignore,no_run
9930 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
9931 /// let x = UserCreds::new().set_name("example");
9932 /// ```
9933 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9934 self.name = v.into();
9935 self
9936 }
9937
9938 /// Sets the value of [create_time][crate::model::UserCreds::create_time].
9939 ///
9940 /// # Example
9941 /// ```ignore,no_run
9942 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
9943 /// use wkt::Timestamp;
9944 /// let x = UserCreds::new().set_create_time(Timestamp::default()/* use setters */);
9945 /// ```
9946 pub fn set_create_time<T>(mut self, v: T) -> Self
9947 where
9948 T: std::convert::Into<wkt::Timestamp>,
9949 {
9950 self.create_time = std::option::Option::Some(v.into());
9951 self
9952 }
9953
9954 /// Sets or clears the value of [create_time][crate::model::UserCreds::create_time].
9955 ///
9956 /// # Example
9957 /// ```ignore,no_run
9958 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
9959 /// use wkt::Timestamp;
9960 /// let x = UserCreds::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9961 /// let x = UserCreds::new().set_or_clear_create_time(None::<Timestamp>);
9962 /// ```
9963 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9964 where
9965 T: std::convert::Into<wkt::Timestamp>,
9966 {
9967 self.create_time = v.map(|x| x.into());
9968 self
9969 }
9970
9971 /// Sets the value of [update_time][crate::model::UserCreds::update_time].
9972 ///
9973 /// # Example
9974 /// ```ignore,no_run
9975 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
9976 /// use wkt::Timestamp;
9977 /// let x = UserCreds::new().set_update_time(Timestamp::default()/* use setters */);
9978 /// ```
9979 pub fn set_update_time<T>(mut self, v: T) -> Self
9980 where
9981 T: std::convert::Into<wkt::Timestamp>,
9982 {
9983 self.update_time = std::option::Option::Some(v.into());
9984 self
9985 }
9986
9987 /// Sets or clears the value of [update_time][crate::model::UserCreds::update_time].
9988 ///
9989 /// # Example
9990 /// ```ignore,no_run
9991 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
9992 /// use wkt::Timestamp;
9993 /// let x = UserCreds::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9994 /// let x = UserCreds::new().set_or_clear_update_time(None::<Timestamp>);
9995 /// ```
9996 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9997 where
9998 T: std::convert::Into<wkt::Timestamp>,
9999 {
10000 self.update_time = v.map(|x| x.into());
10001 self
10002 }
10003
10004 /// Sets the value of [state][crate::model::UserCreds::state].
10005 ///
10006 /// # Example
10007 /// ```ignore,no_run
10008 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
10009 /// use google_cloud_firestore_admin_v1::model::user_creds::State;
10010 /// let x0 = UserCreds::new().set_state(State::Enabled);
10011 /// let x1 = UserCreds::new().set_state(State::Disabled);
10012 /// ```
10013 pub fn set_state<T: std::convert::Into<crate::model::user_creds::State>>(
10014 mut self,
10015 v: T,
10016 ) -> Self {
10017 self.state = v.into();
10018 self
10019 }
10020
10021 /// Sets the value of [secure_password][crate::model::UserCreds::secure_password].
10022 ///
10023 /// # Example
10024 /// ```ignore,no_run
10025 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
10026 /// let x = UserCreds::new().set_secure_password("example");
10027 /// ```
10028 pub fn set_secure_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10029 self.secure_password = v.into();
10030 self
10031 }
10032
10033 /// Sets the value of [user_creds_identity][crate::model::UserCreds::user_creds_identity].
10034 ///
10035 /// Note that all the setters affecting `user_creds_identity` are mutually
10036 /// exclusive.
10037 ///
10038 /// # Example
10039 /// ```ignore,no_run
10040 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
10041 /// use google_cloud_firestore_admin_v1::model::user_creds::ResourceIdentity;
10042 /// let x = UserCreds::new().set_user_creds_identity(Some(
10043 /// google_cloud_firestore_admin_v1::model::user_creds::UserCredsIdentity::ResourceIdentity(ResourceIdentity::default().into())));
10044 /// ```
10045 pub fn set_user_creds_identity<
10046 T: std::convert::Into<std::option::Option<crate::model::user_creds::UserCredsIdentity>>,
10047 >(
10048 mut self,
10049 v: T,
10050 ) -> Self {
10051 self.user_creds_identity = v.into();
10052 self
10053 }
10054
10055 /// The value of [user_creds_identity][crate::model::UserCreds::user_creds_identity]
10056 /// if it holds a `ResourceIdentity`, `None` if the field is not set or
10057 /// holds a different branch.
10058 pub fn resource_identity(
10059 &self,
10060 ) -> std::option::Option<&std::boxed::Box<crate::model::user_creds::ResourceIdentity>> {
10061 #[allow(unreachable_patterns)]
10062 self.user_creds_identity.as_ref().and_then(|v| match v {
10063 crate::model::user_creds::UserCredsIdentity::ResourceIdentity(v) => {
10064 std::option::Option::Some(v)
10065 }
10066 _ => std::option::Option::None,
10067 })
10068 }
10069
10070 /// Sets the value of [user_creds_identity][crate::model::UserCreds::user_creds_identity]
10071 /// to hold a `ResourceIdentity`.
10072 ///
10073 /// Note that all the setters affecting `user_creds_identity` are
10074 /// mutually exclusive.
10075 ///
10076 /// # Example
10077 /// ```ignore,no_run
10078 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
10079 /// use google_cloud_firestore_admin_v1::model::user_creds::ResourceIdentity;
10080 /// let x = UserCreds::new().set_resource_identity(ResourceIdentity::default()/* use setters */);
10081 /// assert!(x.resource_identity().is_some());
10082 /// ```
10083 pub fn set_resource_identity<
10084 T: std::convert::Into<std::boxed::Box<crate::model::user_creds::ResourceIdentity>>,
10085 >(
10086 mut self,
10087 v: T,
10088 ) -> Self {
10089 self.user_creds_identity = std::option::Option::Some(
10090 crate::model::user_creds::UserCredsIdentity::ResourceIdentity(v.into()),
10091 );
10092 self
10093 }
10094}
10095
10096impl wkt::message::Message for UserCreds {
10097 fn typename() -> &'static str {
10098 "type.googleapis.com/google.firestore.admin.v1.UserCreds"
10099 }
10100}
10101
10102/// Defines additional types related to [UserCreds].
10103pub mod user_creds {
10104 #[allow(unused_imports)]
10105 use super::*;
10106
10107 /// Describes a Resource Identity principal.
10108 #[derive(Clone, Default, PartialEq)]
10109 #[non_exhaustive]
10110 pub struct ResourceIdentity {
10111 /// Output only. Principal identifier string.
10112 /// See: <https://cloud.google.com/iam/docs/principal-identifiers>
10113 pub principal: std::string::String,
10114
10115 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10116 }
10117
10118 impl ResourceIdentity {
10119 pub fn new() -> Self {
10120 std::default::Default::default()
10121 }
10122
10123 /// Sets the value of [principal][crate::model::user_creds::ResourceIdentity::principal].
10124 ///
10125 /// # Example
10126 /// ```ignore,no_run
10127 /// # use google_cloud_firestore_admin_v1::model::user_creds::ResourceIdentity;
10128 /// let x = ResourceIdentity::new().set_principal("example");
10129 /// ```
10130 pub fn set_principal<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10131 self.principal = v.into();
10132 self
10133 }
10134 }
10135
10136 impl wkt::message::Message for ResourceIdentity {
10137 fn typename() -> &'static str {
10138 "type.googleapis.com/google.firestore.admin.v1.UserCreds.ResourceIdentity"
10139 }
10140 }
10141
10142 /// The state of the user creds (ENABLED or DISABLED).
10143 ///
10144 /// # Working with unknown values
10145 ///
10146 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10147 /// additional enum variants at any time. Adding new variants is not considered
10148 /// a breaking change. Applications should write their code in anticipation of:
10149 ///
10150 /// - New values appearing in future releases of the client library, **and**
10151 /// - New values received dynamically, without application changes.
10152 ///
10153 /// Please consult the [Working with enums] section in the user guide for some
10154 /// guidelines.
10155 ///
10156 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10157 #[derive(Clone, Debug, PartialEq)]
10158 #[non_exhaustive]
10159 pub enum State {
10160 /// The default value. Should not be used.
10161 Unspecified,
10162 /// The user creds are enabled.
10163 Enabled,
10164 /// The user creds are disabled.
10165 Disabled,
10166 /// If set, the enum was initialized with an unknown value.
10167 ///
10168 /// Applications can examine the value using [State::value] or
10169 /// [State::name].
10170 UnknownValue(state::UnknownValue),
10171 }
10172
10173 #[doc(hidden)]
10174 pub mod state {
10175 #[allow(unused_imports)]
10176 use super::*;
10177 #[derive(Clone, Debug, PartialEq)]
10178 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10179 }
10180
10181 impl State {
10182 /// Gets the enum value.
10183 ///
10184 /// Returns `None` if the enum contains an unknown value deserialized from
10185 /// the string representation of enums.
10186 pub fn value(&self) -> std::option::Option<i32> {
10187 match self {
10188 Self::Unspecified => std::option::Option::Some(0),
10189 Self::Enabled => std::option::Option::Some(1),
10190 Self::Disabled => std::option::Option::Some(2),
10191 Self::UnknownValue(u) => u.0.value(),
10192 }
10193 }
10194
10195 /// Gets the enum value as a string.
10196 ///
10197 /// Returns `None` if the enum contains an unknown value deserialized from
10198 /// the integer representation of enums.
10199 pub fn name(&self) -> std::option::Option<&str> {
10200 match self {
10201 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10202 Self::Enabled => std::option::Option::Some("ENABLED"),
10203 Self::Disabled => std::option::Option::Some("DISABLED"),
10204 Self::UnknownValue(u) => u.0.name(),
10205 }
10206 }
10207 }
10208
10209 impl std::default::Default for State {
10210 fn default() -> Self {
10211 use std::convert::From;
10212 Self::from(0)
10213 }
10214 }
10215
10216 impl std::fmt::Display for State {
10217 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10218 wkt::internal::display_enum(f, self.name(), self.value())
10219 }
10220 }
10221
10222 impl std::convert::From<i32> for State {
10223 fn from(value: i32) -> Self {
10224 match value {
10225 0 => Self::Unspecified,
10226 1 => Self::Enabled,
10227 2 => Self::Disabled,
10228 _ => Self::UnknownValue(state::UnknownValue(
10229 wkt::internal::UnknownEnumValue::Integer(value),
10230 )),
10231 }
10232 }
10233 }
10234
10235 impl std::convert::From<&str> for State {
10236 fn from(value: &str) -> Self {
10237 use std::string::ToString;
10238 match value {
10239 "STATE_UNSPECIFIED" => Self::Unspecified,
10240 "ENABLED" => Self::Enabled,
10241 "DISABLED" => Self::Disabled,
10242 _ => Self::UnknownValue(state::UnknownValue(
10243 wkt::internal::UnknownEnumValue::String(value.to_string()),
10244 )),
10245 }
10246 }
10247 }
10248
10249 impl serde::ser::Serialize for State {
10250 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10251 where
10252 S: serde::Serializer,
10253 {
10254 match self {
10255 Self::Unspecified => serializer.serialize_i32(0),
10256 Self::Enabled => serializer.serialize_i32(1),
10257 Self::Disabled => serializer.serialize_i32(2),
10258 Self::UnknownValue(u) => u.0.serialize(serializer),
10259 }
10260 }
10261 }
10262
10263 impl<'de> serde::de::Deserialize<'de> for State {
10264 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10265 where
10266 D: serde::Deserializer<'de>,
10267 {
10268 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10269 ".google.firestore.admin.v1.UserCreds.State",
10270 ))
10271 }
10272 }
10273
10274 /// Identity associated with this User Creds.
10275 #[derive(Clone, Debug, PartialEq)]
10276 #[non_exhaustive]
10277 pub enum UserCredsIdentity {
10278 /// Resource Identity descriptor.
10279 ResourceIdentity(std::boxed::Box<crate::model::user_creds::ResourceIdentity>),
10280 }
10281}
10282
10283/// Describes the state of the operation.
10284///
10285/// # Working with unknown values
10286///
10287/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10288/// additional enum variants at any time. Adding new variants is not considered
10289/// a breaking change. Applications should write their code in anticipation of:
10290///
10291/// - New values appearing in future releases of the client library, **and**
10292/// - New values received dynamically, without application changes.
10293///
10294/// Please consult the [Working with enums] section in the user guide for some
10295/// guidelines.
10296///
10297/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10298#[derive(Clone, Debug, PartialEq)]
10299#[non_exhaustive]
10300pub enum OperationState {
10301 /// Unspecified.
10302 Unspecified,
10303 /// Request is being prepared for processing.
10304 Initializing,
10305 /// Request is actively being processed.
10306 Processing,
10307 /// Request is in the process of being cancelled after user called
10308 /// google.longrunning.Operations.CancelOperation on the operation.
10309 Cancelling,
10310 /// Request has been processed and is in its finalization stage.
10311 Finalizing,
10312 /// Request has completed successfully.
10313 Successful,
10314 /// Request has finished being processed, but encountered an error.
10315 Failed,
10316 /// Request has finished being cancelled after user called
10317 /// google.longrunning.Operations.CancelOperation.
10318 Cancelled,
10319 /// If set, the enum was initialized with an unknown value.
10320 ///
10321 /// Applications can examine the value using [OperationState::value] or
10322 /// [OperationState::name].
10323 UnknownValue(operation_state::UnknownValue),
10324}
10325
10326#[doc(hidden)]
10327pub mod operation_state {
10328 #[allow(unused_imports)]
10329 use super::*;
10330 #[derive(Clone, Debug, PartialEq)]
10331 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10332}
10333
10334impl OperationState {
10335 /// Gets the enum value.
10336 ///
10337 /// Returns `None` if the enum contains an unknown value deserialized from
10338 /// the string representation of enums.
10339 pub fn value(&self) -> std::option::Option<i32> {
10340 match self {
10341 Self::Unspecified => std::option::Option::Some(0),
10342 Self::Initializing => std::option::Option::Some(1),
10343 Self::Processing => std::option::Option::Some(2),
10344 Self::Cancelling => std::option::Option::Some(3),
10345 Self::Finalizing => std::option::Option::Some(4),
10346 Self::Successful => std::option::Option::Some(5),
10347 Self::Failed => std::option::Option::Some(6),
10348 Self::Cancelled => std::option::Option::Some(7),
10349 Self::UnknownValue(u) => u.0.value(),
10350 }
10351 }
10352
10353 /// Gets the enum value as a string.
10354 ///
10355 /// Returns `None` if the enum contains an unknown value deserialized from
10356 /// the integer representation of enums.
10357 pub fn name(&self) -> std::option::Option<&str> {
10358 match self {
10359 Self::Unspecified => std::option::Option::Some("OPERATION_STATE_UNSPECIFIED"),
10360 Self::Initializing => std::option::Option::Some("INITIALIZING"),
10361 Self::Processing => std::option::Option::Some("PROCESSING"),
10362 Self::Cancelling => std::option::Option::Some("CANCELLING"),
10363 Self::Finalizing => std::option::Option::Some("FINALIZING"),
10364 Self::Successful => std::option::Option::Some("SUCCESSFUL"),
10365 Self::Failed => std::option::Option::Some("FAILED"),
10366 Self::Cancelled => std::option::Option::Some("CANCELLED"),
10367 Self::UnknownValue(u) => u.0.name(),
10368 }
10369 }
10370}
10371
10372impl std::default::Default for OperationState {
10373 fn default() -> Self {
10374 use std::convert::From;
10375 Self::from(0)
10376 }
10377}
10378
10379impl std::fmt::Display for OperationState {
10380 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10381 wkt::internal::display_enum(f, self.name(), self.value())
10382 }
10383}
10384
10385impl std::convert::From<i32> for OperationState {
10386 fn from(value: i32) -> Self {
10387 match value {
10388 0 => Self::Unspecified,
10389 1 => Self::Initializing,
10390 2 => Self::Processing,
10391 3 => Self::Cancelling,
10392 4 => Self::Finalizing,
10393 5 => Self::Successful,
10394 6 => Self::Failed,
10395 7 => Self::Cancelled,
10396 _ => Self::UnknownValue(operation_state::UnknownValue(
10397 wkt::internal::UnknownEnumValue::Integer(value),
10398 )),
10399 }
10400 }
10401}
10402
10403impl std::convert::From<&str> for OperationState {
10404 fn from(value: &str) -> Self {
10405 use std::string::ToString;
10406 match value {
10407 "OPERATION_STATE_UNSPECIFIED" => Self::Unspecified,
10408 "INITIALIZING" => Self::Initializing,
10409 "PROCESSING" => Self::Processing,
10410 "CANCELLING" => Self::Cancelling,
10411 "FINALIZING" => Self::Finalizing,
10412 "SUCCESSFUL" => Self::Successful,
10413 "FAILED" => Self::Failed,
10414 "CANCELLED" => Self::Cancelled,
10415 _ => Self::UnknownValue(operation_state::UnknownValue(
10416 wkt::internal::UnknownEnumValue::String(value.to_string()),
10417 )),
10418 }
10419 }
10420}
10421
10422impl serde::ser::Serialize for OperationState {
10423 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10424 where
10425 S: serde::Serializer,
10426 {
10427 match self {
10428 Self::Unspecified => serializer.serialize_i32(0),
10429 Self::Initializing => serializer.serialize_i32(1),
10430 Self::Processing => serializer.serialize_i32(2),
10431 Self::Cancelling => serializer.serialize_i32(3),
10432 Self::Finalizing => serializer.serialize_i32(4),
10433 Self::Successful => serializer.serialize_i32(5),
10434 Self::Failed => serializer.serialize_i32(6),
10435 Self::Cancelled => serializer.serialize_i32(7),
10436 Self::UnknownValue(u) => u.0.serialize(serializer),
10437 }
10438 }
10439}
10440
10441impl<'de> serde::de::Deserialize<'de> for OperationState {
10442 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10443 where
10444 D: serde::Deserializer<'de>,
10445 {
10446 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationState>::new(
10447 ".google.firestore.admin.v1.OperationState",
10448 ))
10449 }
10450}
10451
10452/// The Realtime Updates mode.
10453///
10454/// # Working with unknown values
10455///
10456/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10457/// additional enum variants at any time. Adding new variants is not considered
10458/// a breaking change. Applications should write their code in anticipation of:
10459///
10460/// - New values appearing in future releases of the client library, **and**
10461/// - New values received dynamically, without application changes.
10462///
10463/// Please consult the [Working with enums] section in the user guide for some
10464/// guidelines.
10465///
10466/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10467#[derive(Clone, Debug, PartialEq)]
10468#[non_exhaustive]
10469pub enum RealtimeUpdatesMode {
10470 /// The Realtime Updates feature is not specified.
10471 Unspecified,
10472 /// The Realtime Updates feature is enabled by default.
10473 ///
10474 /// This could potentially degrade write performance for the database.
10475 Enabled,
10476 /// The Realtime Updates feature is disabled by default.
10477 Disabled,
10478 /// If set, the enum was initialized with an unknown value.
10479 ///
10480 /// Applications can examine the value using [RealtimeUpdatesMode::value] or
10481 /// [RealtimeUpdatesMode::name].
10482 UnknownValue(realtime_updates_mode::UnknownValue),
10483}
10484
10485#[doc(hidden)]
10486pub mod realtime_updates_mode {
10487 #[allow(unused_imports)]
10488 use super::*;
10489 #[derive(Clone, Debug, PartialEq)]
10490 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10491}
10492
10493impl RealtimeUpdatesMode {
10494 /// Gets the enum value.
10495 ///
10496 /// Returns `None` if the enum contains an unknown value deserialized from
10497 /// the string representation of enums.
10498 pub fn value(&self) -> std::option::Option<i32> {
10499 match self {
10500 Self::Unspecified => std::option::Option::Some(0),
10501 Self::Enabled => std::option::Option::Some(1),
10502 Self::Disabled => std::option::Option::Some(2),
10503 Self::UnknownValue(u) => u.0.value(),
10504 }
10505 }
10506
10507 /// Gets the enum value as a string.
10508 ///
10509 /// Returns `None` if the enum contains an unknown value deserialized from
10510 /// the integer representation of enums.
10511 pub fn name(&self) -> std::option::Option<&str> {
10512 match self {
10513 Self::Unspecified => std::option::Option::Some("REALTIME_UPDATES_MODE_UNSPECIFIED"),
10514 Self::Enabled => std::option::Option::Some("REALTIME_UPDATES_MODE_ENABLED"),
10515 Self::Disabled => std::option::Option::Some("REALTIME_UPDATES_MODE_DISABLED"),
10516 Self::UnknownValue(u) => u.0.name(),
10517 }
10518 }
10519}
10520
10521impl std::default::Default for RealtimeUpdatesMode {
10522 fn default() -> Self {
10523 use std::convert::From;
10524 Self::from(0)
10525 }
10526}
10527
10528impl std::fmt::Display for RealtimeUpdatesMode {
10529 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10530 wkt::internal::display_enum(f, self.name(), self.value())
10531 }
10532}
10533
10534impl std::convert::From<i32> for RealtimeUpdatesMode {
10535 fn from(value: i32) -> Self {
10536 match value {
10537 0 => Self::Unspecified,
10538 1 => Self::Enabled,
10539 2 => Self::Disabled,
10540 _ => Self::UnknownValue(realtime_updates_mode::UnknownValue(
10541 wkt::internal::UnknownEnumValue::Integer(value),
10542 )),
10543 }
10544 }
10545}
10546
10547impl std::convert::From<&str> for RealtimeUpdatesMode {
10548 fn from(value: &str) -> Self {
10549 use std::string::ToString;
10550 match value {
10551 "REALTIME_UPDATES_MODE_UNSPECIFIED" => Self::Unspecified,
10552 "REALTIME_UPDATES_MODE_ENABLED" => Self::Enabled,
10553 "REALTIME_UPDATES_MODE_DISABLED" => Self::Disabled,
10554 _ => Self::UnknownValue(realtime_updates_mode::UnknownValue(
10555 wkt::internal::UnknownEnumValue::String(value.to_string()),
10556 )),
10557 }
10558 }
10559}
10560
10561impl serde::ser::Serialize for RealtimeUpdatesMode {
10562 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10563 where
10564 S: serde::Serializer,
10565 {
10566 match self {
10567 Self::Unspecified => serializer.serialize_i32(0),
10568 Self::Enabled => serializer.serialize_i32(1),
10569 Self::Disabled => serializer.serialize_i32(2),
10570 Self::UnknownValue(u) => u.0.serialize(serializer),
10571 }
10572 }
10573}
10574
10575impl<'de> serde::de::Deserialize<'de> for RealtimeUpdatesMode {
10576 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10577 where
10578 D: serde::Deserializer<'de>,
10579 {
10580 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RealtimeUpdatesMode>::new(
10581 ".google.firestore.admin.v1.RealtimeUpdatesMode",
10582 ))
10583 }
10584}