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://googleapis.github.io/google-cloud-rust/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://googleapis.github.io/google-cloud-rust/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://googleapis.github.io/google-cloud-rust/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://googleapis.github.io/google-cloud-rust/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://googleapis.github.io/google-cloud-rust/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://googleapis.github.io/google-cloud-rust/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://googleapis.github.io/google-cloud-rust/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://googleapis.github.io/google-cloud-rust/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 /// A timestamp stored in a TTL-enabled field will be used to determine the
2901 /// expiration time of the document. The expiration time is the sum
2902 /// of the timestamp value and the `expiration_offset`.
2903 ///
2904 /// For Enterprise edition databases, the timestamp value may alternatively be
2905 /// stored in an array value in the TTL-enabled field.
2906 ///
2907 /// An expiration time in the past indicates that the document is eligible for
2908 /// immediate expiration. Using any other data type or leaving the field absent
2909 /// will disable expiration for the individual document.
2910 #[derive(Clone, Default, PartialEq)]
2911 #[non_exhaustive]
2912 pub struct TtlConfig {
2913 /// Output only. The state of the TTL configuration.
2914 pub state: crate::model::field::ttl_config::State,
2915
2916 /// Optional. The offset, relative to the timestamp value from the
2917 /// TTL-enabled field, used to determine the document's expiration time.
2918 ///
2919 /// `expiration_offset.seconds` must be between 0 and 2,147,483,647
2920 /// inclusive. Values more precise than seconds are rejected.
2921 ///
2922 /// If unset, defaults to 0, in which case the expiration time is the same
2923 /// as the timestamp value from the TTL-enabled field.
2924 pub expiration_offset: std::option::Option<wkt::Duration>,
2925
2926 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2927 }
2928
2929 impl TtlConfig {
2930 pub fn new() -> Self {
2931 std::default::Default::default()
2932 }
2933
2934 /// Sets the value of [state][crate::model::field::TtlConfig::state].
2935 ///
2936 /// # Example
2937 /// ```ignore,no_run
2938 /// # use google_cloud_firestore_admin_v1::model::field::TtlConfig;
2939 /// use google_cloud_firestore_admin_v1::model::field::ttl_config::State;
2940 /// let x0 = TtlConfig::new().set_state(State::Creating);
2941 /// let x1 = TtlConfig::new().set_state(State::Active);
2942 /// let x2 = TtlConfig::new().set_state(State::NeedsRepair);
2943 /// ```
2944 pub fn set_state<T: std::convert::Into<crate::model::field::ttl_config::State>>(
2945 mut self,
2946 v: T,
2947 ) -> Self {
2948 self.state = v.into();
2949 self
2950 }
2951
2952 /// Sets the value of [expiration_offset][crate::model::field::TtlConfig::expiration_offset].
2953 ///
2954 /// # Example
2955 /// ```ignore,no_run
2956 /// # use google_cloud_firestore_admin_v1::model::field::TtlConfig;
2957 /// use wkt::Duration;
2958 /// let x = TtlConfig::new().set_expiration_offset(Duration::default()/* use setters */);
2959 /// ```
2960 pub fn set_expiration_offset<T>(mut self, v: T) -> Self
2961 where
2962 T: std::convert::Into<wkt::Duration>,
2963 {
2964 self.expiration_offset = std::option::Option::Some(v.into());
2965 self
2966 }
2967
2968 /// Sets or clears the value of [expiration_offset][crate::model::field::TtlConfig::expiration_offset].
2969 ///
2970 /// # Example
2971 /// ```ignore,no_run
2972 /// # use google_cloud_firestore_admin_v1::model::field::TtlConfig;
2973 /// use wkt::Duration;
2974 /// let x = TtlConfig::new().set_or_clear_expiration_offset(Some(Duration::default()/* use setters */));
2975 /// let x = TtlConfig::new().set_or_clear_expiration_offset(None::<Duration>);
2976 /// ```
2977 pub fn set_or_clear_expiration_offset<T>(mut self, v: std::option::Option<T>) -> Self
2978 where
2979 T: std::convert::Into<wkt::Duration>,
2980 {
2981 self.expiration_offset = v.map(|x| x.into());
2982 self
2983 }
2984 }
2985
2986 impl wkt::message::Message for TtlConfig {
2987 fn typename() -> &'static str {
2988 "type.googleapis.com/google.firestore.admin.v1.Field.TtlConfig"
2989 }
2990 }
2991
2992 /// Defines additional types related to [TtlConfig].
2993 pub mod ttl_config {
2994 #[allow(unused_imports)]
2995 use super::*;
2996
2997 /// The state of applying the TTL configuration to all documents.
2998 ///
2999 /// # Working with unknown values
3000 ///
3001 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3002 /// additional enum variants at any time. Adding new variants is not considered
3003 /// a breaking change. Applications should write their code in anticipation of:
3004 ///
3005 /// - New values appearing in future releases of the client library, **and**
3006 /// - New values received dynamically, without application changes.
3007 ///
3008 /// Please consult the [Working with enums] section in the user guide for some
3009 /// guidelines.
3010 ///
3011 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3012 #[derive(Clone, Debug, PartialEq)]
3013 #[non_exhaustive]
3014 pub enum State {
3015 /// The state is unspecified or unknown.
3016 Unspecified,
3017 /// The TTL is being applied. There is an active long-running operation to
3018 /// track the change. Newly written documents will have TTLs applied as
3019 /// requested. Requested TTLs on existing documents are still being
3020 /// processed. When TTLs on all existing documents have been processed, the
3021 /// state will move to 'ACTIVE'.
3022 Creating,
3023 /// The TTL is active for all documents.
3024 Active,
3025 /// The TTL configuration could not be enabled for all existing documents.
3026 /// Newly written documents will continue to have their TTL applied.
3027 /// The LRO returned when last attempting to enable TTL for this `Field`
3028 /// has failed, and may have more details.
3029 NeedsRepair,
3030 /// If set, the enum was initialized with an unknown value.
3031 ///
3032 /// Applications can examine the value using [State::value] or
3033 /// [State::name].
3034 UnknownValue(state::UnknownValue),
3035 }
3036
3037 #[doc(hidden)]
3038 pub mod state {
3039 #[allow(unused_imports)]
3040 use super::*;
3041 #[derive(Clone, Debug, PartialEq)]
3042 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3043 }
3044
3045 impl State {
3046 /// Gets the enum value.
3047 ///
3048 /// Returns `None` if the enum contains an unknown value deserialized from
3049 /// the string representation of enums.
3050 pub fn value(&self) -> std::option::Option<i32> {
3051 match self {
3052 Self::Unspecified => std::option::Option::Some(0),
3053 Self::Creating => std::option::Option::Some(1),
3054 Self::Active => std::option::Option::Some(2),
3055 Self::NeedsRepair => std::option::Option::Some(3),
3056 Self::UnknownValue(u) => u.0.value(),
3057 }
3058 }
3059
3060 /// Gets the enum value as a string.
3061 ///
3062 /// Returns `None` if the enum contains an unknown value deserialized from
3063 /// the integer representation of enums.
3064 pub fn name(&self) -> std::option::Option<&str> {
3065 match self {
3066 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3067 Self::Creating => std::option::Option::Some("CREATING"),
3068 Self::Active => std::option::Option::Some("ACTIVE"),
3069 Self::NeedsRepair => std::option::Option::Some("NEEDS_REPAIR"),
3070 Self::UnknownValue(u) => u.0.name(),
3071 }
3072 }
3073 }
3074
3075 impl std::default::Default for State {
3076 fn default() -> Self {
3077 use std::convert::From;
3078 Self::from(0)
3079 }
3080 }
3081
3082 impl std::fmt::Display for State {
3083 fn fmt(
3084 &self,
3085 f: &mut std::fmt::Formatter<'_>,
3086 ) -> std::result::Result<(), std::fmt::Error> {
3087 wkt::internal::display_enum(f, self.name(), self.value())
3088 }
3089 }
3090
3091 impl std::convert::From<i32> for State {
3092 fn from(value: i32) -> Self {
3093 match value {
3094 0 => Self::Unspecified,
3095 1 => Self::Creating,
3096 2 => Self::Active,
3097 3 => Self::NeedsRepair,
3098 _ => Self::UnknownValue(state::UnknownValue(
3099 wkt::internal::UnknownEnumValue::Integer(value),
3100 )),
3101 }
3102 }
3103 }
3104
3105 impl std::convert::From<&str> for State {
3106 fn from(value: &str) -> Self {
3107 use std::string::ToString;
3108 match value {
3109 "STATE_UNSPECIFIED" => Self::Unspecified,
3110 "CREATING" => Self::Creating,
3111 "ACTIVE" => Self::Active,
3112 "NEEDS_REPAIR" => Self::NeedsRepair,
3113 _ => Self::UnknownValue(state::UnknownValue(
3114 wkt::internal::UnknownEnumValue::String(value.to_string()),
3115 )),
3116 }
3117 }
3118 }
3119
3120 impl serde::ser::Serialize for State {
3121 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3122 where
3123 S: serde::Serializer,
3124 {
3125 match self {
3126 Self::Unspecified => serializer.serialize_i32(0),
3127 Self::Creating => serializer.serialize_i32(1),
3128 Self::Active => serializer.serialize_i32(2),
3129 Self::NeedsRepair => serializer.serialize_i32(3),
3130 Self::UnknownValue(u) => u.0.serialize(serializer),
3131 }
3132 }
3133 }
3134
3135 impl<'de> serde::de::Deserialize<'de> for State {
3136 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3137 where
3138 D: serde::Deserializer<'de>,
3139 {
3140 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3141 ".google.firestore.admin.v1.Field.TtlConfig.State",
3142 ))
3143 }
3144 }
3145 }
3146}
3147
3148/// A request to list the Firestore Databases in all locations for a project.
3149#[derive(Clone, Default, PartialEq)]
3150#[non_exhaustive]
3151pub struct ListDatabasesRequest {
3152 /// Required. A parent name of the form
3153 /// `projects/{project_id}`
3154 pub parent: std::string::String,
3155
3156 /// If true, also returns deleted resources.
3157 pub show_deleted: bool,
3158
3159 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3160}
3161
3162impl ListDatabasesRequest {
3163 pub fn new() -> Self {
3164 std::default::Default::default()
3165 }
3166
3167 /// Sets the value of [parent][crate::model::ListDatabasesRequest::parent].
3168 ///
3169 /// # Example
3170 /// ```ignore,no_run
3171 /// # use google_cloud_firestore_admin_v1::model::ListDatabasesRequest;
3172 /// let x = ListDatabasesRequest::new().set_parent("example");
3173 /// ```
3174 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3175 self.parent = v.into();
3176 self
3177 }
3178
3179 /// Sets the value of [show_deleted][crate::model::ListDatabasesRequest::show_deleted].
3180 ///
3181 /// # Example
3182 /// ```ignore,no_run
3183 /// # use google_cloud_firestore_admin_v1::model::ListDatabasesRequest;
3184 /// let x = ListDatabasesRequest::new().set_show_deleted(true);
3185 /// ```
3186 pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3187 self.show_deleted = v.into();
3188 self
3189 }
3190}
3191
3192impl wkt::message::Message for ListDatabasesRequest {
3193 fn typename() -> &'static str {
3194 "type.googleapis.com/google.firestore.admin.v1.ListDatabasesRequest"
3195 }
3196}
3197
3198/// The request for
3199/// [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.CreateDatabase].
3200///
3201/// [google.firestore.admin.v1.FirestoreAdmin.CreateDatabase]: crate::client::FirestoreAdmin::create_database
3202#[derive(Clone, Default, PartialEq)]
3203#[non_exhaustive]
3204pub struct CreateDatabaseRequest {
3205 /// Required. A parent name of the form
3206 /// `projects/{project_id}`
3207 pub parent: std::string::String,
3208
3209 /// Required. The Database to create.
3210 pub database: std::option::Option<crate::model::Database>,
3211
3212 /// Required. The ID to use for the database, which will become the final
3213 /// component of the database's resource name.
3214 ///
3215 /// This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
3216 /// with first character a letter and the last a letter or a number. Must not
3217 /// be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
3218 ///
3219 /// "(default)" database ID is also valid if the database is Standard edition.
3220 pub database_id: std::string::String,
3221
3222 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3223}
3224
3225impl CreateDatabaseRequest {
3226 pub fn new() -> Self {
3227 std::default::Default::default()
3228 }
3229
3230 /// Sets the value of [parent][crate::model::CreateDatabaseRequest::parent].
3231 ///
3232 /// # Example
3233 /// ```ignore,no_run
3234 /// # use google_cloud_firestore_admin_v1::model::CreateDatabaseRequest;
3235 /// let x = CreateDatabaseRequest::new().set_parent("example");
3236 /// ```
3237 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3238 self.parent = v.into();
3239 self
3240 }
3241
3242 /// Sets the value of [database][crate::model::CreateDatabaseRequest::database].
3243 ///
3244 /// # Example
3245 /// ```ignore,no_run
3246 /// # use google_cloud_firestore_admin_v1::model::CreateDatabaseRequest;
3247 /// use google_cloud_firestore_admin_v1::model::Database;
3248 /// let x = CreateDatabaseRequest::new().set_database(Database::default()/* use setters */);
3249 /// ```
3250 pub fn set_database<T>(mut self, v: T) -> Self
3251 where
3252 T: std::convert::Into<crate::model::Database>,
3253 {
3254 self.database = std::option::Option::Some(v.into());
3255 self
3256 }
3257
3258 /// Sets or clears the value of [database][crate::model::CreateDatabaseRequest::database].
3259 ///
3260 /// # Example
3261 /// ```ignore,no_run
3262 /// # use google_cloud_firestore_admin_v1::model::CreateDatabaseRequest;
3263 /// use google_cloud_firestore_admin_v1::model::Database;
3264 /// let x = CreateDatabaseRequest::new().set_or_clear_database(Some(Database::default()/* use setters */));
3265 /// let x = CreateDatabaseRequest::new().set_or_clear_database(None::<Database>);
3266 /// ```
3267 pub fn set_or_clear_database<T>(mut self, v: std::option::Option<T>) -> Self
3268 where
3269 T: std::convert::Into<crate::model::Database>,
3270 {
3271 self.database = v.map(|x| x.into());
3272 self
3273 }
3274
3275 /// Sets the value of [database_id][crate::model::CreateDatabaseRequest::database_id].
3276 ///
3277 /// # Example
3278 /// ```ignore,no_run
3279 /// # use google_cloud_firestore_admin_v1::model::CreateDatabaseRequest;
3280 /// let x = CreateDatabaseRequest::new().set_database_id("example");
3281 /// ```
3282 pub fn set_database_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3283 self.database_id = v.into();
3284 self
3285 }
3286}
3287
3288impl wkt::message::Message for CreateDatabaseRequest {
3289 fn typename() -> &'static str {
3290 "type.googleapis.com/google.firestore.admin.v1.CreateDatabaseRequest"
3291 }
3292}
3293
3294/// Metadata related to the create database operation.
3295#[derive(Clone, Default, PartialEq)]
3296#[non_exhaustive]
3297pub struct CreateDatabaseMetadata {
3298 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3299}
3300
3301impl CreateDatabaseMetadata {
3302 pub fn new() -> Self {
3303 std::default::Default::default()
3304 }
3305}
3306
3307impl wkt::message::Message for CreateDatabaseMetadata {
3308 fn typename() -> &'static str {
3309 "type.googleapis.com/google.firestore.admin.v1.CreateDatabaseMetadata"
3310 }
3311}
3312
3313/// The list of databases for a project.
3314#[derive(Clone, Default, PartialEq)]
3315#[non_exhaustive]
3316pub struct ListDatabasesResponse {
3317 /// The databases in the project.
3318 pub databases: std::vec::Vec<crate::model::Database>,
3319
3320 /// In the event that data about individual databases cannot be listed they
3321 /// will be recorded here.
3322 ///
3323 /// An example entry might be: projects/some_project/locations/some_location
3324 /// This can happen if the Cloud Region that the Database resides in is
3325 /// currently unavailable. In this case we can't fetch all the details about
3326 /// the database. You may be able to get a more detailed error message
3327 /// (or possibly fetch the resource) by sending a 'Get' request for the
3328 /// resource or a 'List' request for the specific location.
3329 pub unreachable: std::vec::Vec<std::string::String>,
3330
3331 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3332}
3333
3334impl ListDatabasesResponse {
3335 pub fn new() -> Self {
3336 std::default::Default::default()
3337 }
3338
3339 /// Sets the value of [databases][crate::model::ListDatabasesResponse::databases].
3340 ///
3341 /// # Example
3342 /// ```ignore,no_run
3343 /// # use google_cloud_firestore_admin_v1::model::ListDatabasesResponse;
3344 /// use google_cloud_firestore_admin_v1::model::Database;
3345 /// let x = ListDatabasesResponse::new()
3346 /// .set_databases([
3347 /// Database::default()/* use setters */,
3348 /// Database::default()/* use (different) setters */,
3349 /// ]);
3350 /// ```
3351 pub fn set_databases<T, V>(mut self, v: T) -> Self
3352 where
3353 T: std::iter::IntoIterator<Item = V>,
3354 V: std::convert::Into<crate::model::Database>,
3355 {
3356 use std::iter::Iterator;
3357 self.databases = v.into_iter().map(|i| i.into()).collect();
3358 self
3359 }
3360
3361 /// Sets the value of [unreachable][crate::model::ListDatabasesResponse::unreachable].
3362 ///
3363 /// # Example
3364 /// ```ignore,no_run
3365 /// # use google_cloud_firestore_admin_v1::model::ListDatabasesResponse;
3366 /// let x = ListDatabasesResponse::new().set_unreachable(["a", "b", "c"]);
3367 /// ```
3368 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3369 where
3370 T: std::iter::IntoIterator<Item = V>,
3371 V: std::convert::Into<std::string::String>,
3372 {
3373 use std::iter::Iterator;
3374 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3375 self
3376 }
3377}
3378
3379impl wkt::message::Message for ListDatabasesResponse {
3380 fn typename() -> &'static str {
3381 "type.googleapis.com/google.firestore.admin.v1.ListDatabasesResponse"
3382 }
3383}
3384
3385/// The request for
3386/// [FirestoreAdmin.GetDatabase][google.firestore.admin.v1.FirestoreAdmin.GetDatabase].
3387///
3388/// [google.firestore.admin.v1.FirestoreAdmin.GetDatabase]: crate::client::FirestoreAdmin::get_database
3389#[derive(Clone, Default, PartialEq)]
3390#[non_exhaustive]
3391pub struct GetDatabaseRequest {
3392 /// Required. A name of the form
3393 /// `projects/{project_id}/databases/{database_id}`
3394 pub name: std::string::String,
3395
3396 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3397}
3398
3399impl GetDatabaseRequest {
3400 pub fn new() -> Self {
3401 std::default::Default::default()
3402 }
3403
3404 /// Sets the value of [name][crate::model::GetDatabaseRequest::name].
3405 ///
3406 /// # Example
3407 /// ```ignore,no_run
3408 /// # use google_cloud_firestore_admin_v1::model::GetDatabaseRequest;
3409 /// let x = GetDatabaseRequest::new().set_name("example");
3410 /// ```
3411 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3412 self.name = v.into();
3413 self
3414 }
3415}
3416
3417impl wkt::message::Message for GetDatabaseRequest {
3418 fn typename() -> &'static str {
3419 "type.googleapis.com/google.firestore.admin.v1.GetDatabaseRequest"
3420 }
3421}
3422
3423/// The request for
3424/// [FirestoreAdmin.UpdateDatabase][google.firestore.admin.v1.FirestoreAdmin.UpdateDatabase].
3425///
3426/// [google.firestore.admin.v1.FirestoreAdmin.UpdateDatabase]: crate::client::FirestoreAdmin::update_database
3427#[derive(Clone, Default, PartialEq)]
3428#[non_exhaustive]
3429pub struct UpdateDatabaseRequest {
3430 /// Required. The database to update.
3431 pub database: std::option::Option<crate::model::Database>,
3432
3433 /// The list of fields to be updated.
3434 pub update_mask: std::option::Option<wkt::FieldMask>,
3435
3436 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3437}
3438
3439impl UpdateDatabaseRequest {
3440 pub fn new() -> Self {
3441 std::default::Default::default()
3442 }
3443
3444 /// Sets the value of [database][crate::model::UpdateDatabaseRequest::database].
3445 ///
3446 /// # Example
3447 /// ```ignore,no_run
3448 /// # use google_cloud_firestore_admin_v1::model::UpdateDatabaseRequest;
3449 /// use google_cloud_firestore_admin_v1::model::Database;
3450 /// let x = UpdateDatabaseRequest::new().set_database(Database::default()/* use setters */);
3451 /// ```
3452 pub fn set_database<T>(mut self, v: T) -> Self
3453 where
3454 T: std::convert::Into<crate::model::Database>,
3455 {
3456 self.database = std::option::Option::Some(v.into());
3457 self
3458 }
3459
3460 /// Sets or clears the value of [database][crate::model::UpdateDatabaseRequest::database].
3461 ///
3462 /// # Example
3463 /// ```ignore,no_run
3464 /// # use google_cloud_firestore_admin_v1::model::UpdateDatabaseRequest;
3465 /// use google_cloud_firestore_admin_v1::model::Database;
3466 /// let x = UpdateDatabaseRequest::new().set_or_clear_database(Some(Database::default()/* use setters */));
3467 /// let x = UpdateDatabaseRequest::new().set_or_clear_database(None::<Database>);
3468 /// ```
3469 pub fn set_or_clear_database<T>(mut self, v: std::option::Option<T>) -> Self
3470 where
3471 T: std::convert::Into<crate::model::Database>,
3472 {
3473 self.database = v.map(|x| x.into());
3474 self
3475 }
3476
3477 /// Sets the value of [update_mask][crate::model::UpdateDatabaseRequest::update_mask].
3478 ///
3479 /// # Example
3480 /// ```ignore,no_run
3481 /// # use google_cloud_firestore_admin_v1::model::UpdateDatabaseRequest;
3482 /// use wkt::FieldMask;
3483 /// let x = UpdateDatabaseRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3484 /// ```
3485 pub fn set_update_mask<T>(mut self, v: T) -> Self
3486 where
3487 T: std::convert::Into<wkt::FieldMask>,
3488 {
3489 self.update_mask = std::option::Option::Some(v.into());
3490 self
3491 }
3492
3493 /// Sets or clears the value of [update_mask][crate::model::UpdateDatabaseRequest::update_mask].
3494 ///
3495 /// # Example
3496 /// ```ignore,no_run
3497 /// # use google_cloud_firestore_admin_v1::model::UpdateDatabaseRequest;
3498 /// use wkt::FieldMask;
3499 /// let x = UpdateDatabaseRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3500 /// let x = UpdateDatabaseRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3501 /// ```
3502 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3503 where
3504 T: std::convert::Into<wkt::FieldMask>,
3505 {
3506 self.update_mask = v.map(|x| x.into());
3507 self
3508 }
3509}
3510
3511impl wkt::message::Message for UpdateDatabaseRequest {
3512 fn typename() -> &'static str {
3513 "type.googleapis.com/google.firestore.admin.v1.UpdateDatabaseRequest"
3514 }
3515}
3516
3517/// Metadata related to the update database operation.
3518#[derive(Clone, Default, PartialEq)]
3519#[non_exhaustive]
3520pub struct UpdateDatabaseMetadata {
3521 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3522}
3523
3524impl UpdateDatabaseMetadata {
3525 pub fn new() -> Self {
3526 std::default::Default::default()
3527 }
3528}
3529
3530impl wkt::message::Message for UpdateDatabaseMetadata {
3531 fn typename() -> &'static str {
3532 "type.googleapis.com/google.firestore.admin.v1.UpdateDatabaseMetadata"
3533 }
3534}
3535
3536/// The request for
3537/// [FirestoreAdmin.DeleteDatabase][google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase].
3538///
3539/// [google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase]: crate::client::FirestoreAdmin::delete_database
3540#[derive(Clone, Default, PartialEq)]
3541#[non_exhaustive]
3542pub struct DeleteDatabaseRequest {
3543 /// Required. A name of the form
3544 /// `projects/{project_id}/databases/{database_id}`
3545 pub name: std::string::String,
3546
3547 /// The current etag of the Database.
3548 /// If an etag is provided and does not match the current etag of the database,
3549 /// deletion will be blocked and a FAILED_PRECONDITION error will be returned.
3550 pub etag: std::string::String,
3551
3552 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3553}
3554
3555impl DeleteDatabaseRequest {
3556 pub fn new() -> Self {
3557 std::default::Default::default()
3558 }
3559
3560 /// Sets the value of [name][crate::model::DeleteDatabaseRequest::name].
3561 ///
3562 /// # Example
3563 /// ```ignore,no_run
3564 /// # use google_cloud_firestore_admin_v1::model::DeleteDatabaseRequest;
3565 /// let x = DeleteDatabaseRequest::new().set_name("example");
3566 /// ```
3567 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3568 self.name = v.into();
3569 self
3570 }
3571
3572 /// Sets the value of [etag][crate::model::DeleteDatabaseRequest::etag].
3573 ///
3574 /// # Example
3575 /// ```ignore,no_run
3576 /// # use google_cloud_firestore_admin_v1::model::DeleteDatabaseRequest;
3577 /// let x = DeleteDatabaseRequest::new().set_etag("example");
3578 /// ```
3579 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3580 self.etag = v.into();
3581 self
3582 }
3583}
3584
3585impl wkt::message::Message for DeleteDatabaseRequest {
3586 fn typename() -> &'static str {
3587 "type.googleapis.com/google.firestore.admin.v1.DeleteDatabaseRequest"
3588 }
3589}
3590
3591/// Metadata related to the delete database operation.
3592#[derive(Clone, Default, PartialEq)]
3593#[non_exhaustive]
3594pub struct DeleteDatabaseMetadata {
3595 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3596}
3597
3598impl DeleteDatabaseMetadata {
3599 pub fn new() -> Self {
3600 std::default::Default::default()
3601 }
3602}
3603
3604impl wkt::message::Message for DeleteDatabaseMetadata {
3605 fn typename() -> &'static str {
3606 "type.googleapis.com/google.firestore.admin.v1.DeleteDatabaseMetadata"
3607 }
3608}
3609
3610/// The request for
3611/// [FirestoreAdmin.CreateUserCreds][google.firestore.admin.v1.FirestoreAdmin.CreateUserCreds].
3612///
3613/// [google.firestore.admin.v1.FirestoreAdmin.CreateUserCreds]: crate::client::FirestoreAdmin::create_user_creds
3614#[derive(Clone, Default, PartialEq)]
3615#[non_exhaustive]
3616pub struct CreateUserCredsRequest {
3617 /// Required. A parent name of the form
3618 /// `projects/{project_id}/databases/{database_id}`
3619 pub parent: std::string::String,
3620
3621 /// Required. The user creds to create.
3622 pub user_creds: std::option::Option<crate::model::UserCreds>,
3623
3624 /// Required. The ID to use for the user creds, which will become the final
3625 /// component of the user creds's resource name.
3626 ///
3627 /// This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
3628 /// with first character a letter and the last a letter or a number. Must not
3629 /// be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
3630 pub user_creds_id: std::string::String,
3631
3632 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3633}
3634
3635impl CreateUserCredsRequest {
3636 pub fn new() -> Self {
3637 std::default::Default::default()
3638 }
3639
3640 /// Sets the value of [parent][crate::model::CreateUserCredsRequest::parent].
3641 ///
3642 /// # Example
3643 /// ```ignore,no_run
3644 /// # use google_cloud_firestore_admin_v1::model::CreateUserCredsRequest;
3645 /// let x = CreateUserCredsRequest::new().set_parent("example");
3646 /// ```
3647 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3648 self.parent = v.into();
3649 self
3650 }
3651
3652 /// Sets the value of [user_creds][crate::model::CreateUserCredsRequest::user_creds].
3653 ///
3654 /// # Example
3655 /// ```ignore,no_run
3656 /// # use google_cloud_firestore_admin_v1::model::CreateUserCredsRequest;
3657 /// use google_cloud_firestore_admin_v1::model::UserCreds;
3658 /// let x = CreateUserCredsRequest::new().set_user_creds(UserCreds::default()/* use setters */);
3659 /// ```
3660 pub fn set_user_creds<T>(mut self, v: T) -> Self
3661 where
3662 T: std::convert::Into<crate::model::UserCreds>,
3663 {
3664 self.user_creds = std::option::Option::Some(v.into());
3665 self
3666 }
3667
3668 /// Sets or clears the value of [user_creds][crate::model::CreateUserCredsRequest::user_creds].
3669 ///
3670 /// # Example
3671 /// ```ignore,no_run
3672 /// # use google_cloud_firestore_admin_v1::model::CreateUserCredsRequest;
3673 /// use google_cloud_firestore_admin_v1::model::UserCreds;
3674 /// let x = CreateUserCredsRequest::new().set_or_clear_user_creds(Some(UserCreds::default()/* use setters */));
3675 /// let x = CreateUserCredsRequest::new().set_or_clear_user_creds(None::<UserCreds>);
3676 /// ```
3677 pub fn set_or_clear_user_creds<T>(mut self, v: std::option::Option<T>) -> Self
3678 where
3679 T: std::convert::Into<crate::model::UserCreds>,
3680 {
3681 self.user_creds = v.map(|x| x.into());
3682 self
3683 }
3684
3685 /// Sets the value of [user_creds_id][crate::model::CreateUserCredsRequest::user_creds_id].
3686 ///
3687 /// # Example
3688 /// ```ignore,no_run
3689 /// # use google_cloud_firestore_admin_v1::model::CreateUserCredsRequest;
3690 /// let x = CreateUserCredsRequest::new().set_user_creds_id("example");
3691 /// ```
3692 pub fn set_user_creds_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3693 self.user_creds_id = v.into();
3694 self
3695 }
3696}
3697
3698impl wkt::message::Message for CreateUserCredsRequest {
3699 fn typename() -> &'static str {
3700 "type.googleapis.com/google.firestore.admin.v1.CreateUserCredsRequest"
3701 }
3702}
3703
3704/// The request for
3705/// [FirestoreAdmin.GetUserCreds][google.firestore.admin.v1.FirestoreAdmin.GetUserCreds].
3706///
3707/// [google.firestore.admin.v1.FirestoreAdmin.GetUserCreds]: crate::client::FirestoreAdmin::get_user_creds
3708#[derive(Clone, Default, PartialEq)]
3709#[non_exhaustive]
3710pub struct GetUserCredsRequest {
3711 /// Required. A name of the form
3712 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3713 pub name: std::string::String,
3714
3715 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3716}
3717
3718impl GetUserCredsRequest {
3719 pub fn new() -> Self {
3720 std::default::Default::default()
3721 }
3722
3723 /// Sets the value of [name][crate::model::GetUserCredsRequest::name].
3724 ///
3725 /// # Example
3726 /// ```ignore,no_run
3727 /// # use google_cloud_firestore_admin_v1::model::GetUserCredsRequest;
3728 /// let x = GetUserCredsRequest::new().set_name("example");
3729 /// ```
3730 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3731 self.name = v.into();
3732 self
3733 }
3734}
3735
3736impl wkt::message::Message for GetUserCredsRequest {
3737 fn typename() -> &'static str {
3738 "type.googleapis.com/google.firestore.admin.v1.GetUserCredsRequest"
3739 }
3740}
3741
3742/// The request for
3743/// [FirestoreAdmin.ListUserCreds][google.firestore.admin.v1.FirestoreAdmin.ListUserCreds].
3744///
3745/// [google.firestore.admin.v1.FirestoreAdmin.ListUserCreds]: crate::client::FirestoreAdmin::list_user_creds
3746#[derive(Clone, Default, PartialEq)]
3747#[non_exhaustive]
3748pub struct ListUserCredsRequest {
3749 /// Required. A parent database name of the form
3750 /// `projects/{project_id}/databases/{database_id}`
3751 pub parent: std::string::String,
3752
3753 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3754}
3755
3756impl ListUserCredsRequest {
3757 pub fn new() -> Self {
3758 std::default::Default::default()
3759 }
3760
3761 /// Sets the value of [parent][crate::model::ListUserCredsRequest::parent].
3762 ///
3763 /// # Example
3764 /// ```ignore,no_run
3765 /// # use google_cloud_firestore_admin_v1::model::ListUserCredsRequest;
3766 /// let x = ListUserCredsRequest::new().set_parent("example");
3767 /// ```
3768 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3769 self.parent = v.into();
3770 self
3771 }
3772}
3773
3774impl wkt::message::Message for ListUserCredsRequest {
3775 fn typename() -> &'static str {
3776 "type.googleapis.com/google.firestore.admin.v1.ListUserCredsRequest"
3777 }
3778}
3779
3780/// The response for
3781/// [FirestoreAdmin.ListUserCreds][google.firestore.admin.v1.FirestoreAdmin.ListUserCreds].
3782///
3783/// [google.firestore.admin.v1.FirestoreAdmin.ListUserCreds]: crate::client::FirestoreAdmin::list_user_creds
3784#[derive(Clone, Default, PartialEq)]
3785#[non_exhaustive]
3786pub struct ListUserCredsResponse {
3787 /// The user creds for the database.
3788 pub user_creds: std::vec::Vec<crate::model::UserCreds>,
3789
3790 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3791}
3792
3793impl ListUserCredsResponse {
3794 pub fn new() -> Self {
3795 std::default::Default::default()
3796 }
3797
3798 /// Sets the value of [user_creds][crate::model::ListUserCredsResponse::user_creds].
3799 ///
3800 /// # Example
3801 /// ```ignore,no_run
3802 /// # use google_cloud_firestore_admin_v1::model::ListUserCredsResponse;
3803 /// use google_cloud_firestore_admin_v1::model::UserCreds;
3804 /// let x = ListUserCredsResponse::new()
3805 /// .set_user_creds([
3806 /// UserCreds::default()/* use setters */,
3807 /// UserCreds::default()/* use (different) setters */,
3808 /// ]);
3809 /// ```
3810 pub fn set_user_creds<T, V>(mut self, v: T) -> Self
3811 where
3812 T: std::iter::IntoIterator<Item = V>,
3813 V: std::convert::Into<crate::model::UserCreds>,
3814 {
3815 use std::iter::Iterator;
3816 self.user_creds = v.into_iter().map(|i| i.into()).collect();
3817 self
3818 }
3819}
3820
3821impl wkt::message::Message for ListUserCredsResponse {
3822 fn typename() -> &'static str {
3823 "type.googleapis.com/google.firestore.admin.v1.ListUserCredsResponse"
3824 }
3825}
3826
3827/// The request for
3828/// [FirestoreAdmin.EnableUserCreds][google.firestore.admin.v1.FirestoreAdmin.EnableUserCreds].
3829///
3830/// [google.firestore.admin.v1.FirestoreAdmin.EnableUserCreds]: crate::client::FirestoreAdmin::enable_user_creds
3831#[derive(Clone, Default, PartialEq)]
3832#[non_exhaustive]
3833pub struct EnableUserCredsRequest {
3834 /// Required. A name of the form
3835 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3836 pub name: std::string::String,
3837
3838 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3839}
3840
3841impl EnableUserCredsRequest {
3842 pub fn new() -> Self {
3843 std::default::Default::default()
3844 }
3845
3846 /// Sets the value of [name][crate::model::EnableUserCredsRequest::name].
3847 ///
3848 /// # Example
3849 /// ```ignore,no_run
3850 /// # use google_cloud_firestore_admin_v1::model::EnableUserCredsRequest;
3851 /// let x = EnableUserCredsRequest::new().set_name("example");
3852 /// ```
3853 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3854 self.name = v.into();
3855 self
3856 }
3857}
3858
3859impl wkt::message::Message for EnableUserCredsRequest {
3860 fn typename() -> &'static str {
3861 "type.googleapis.com/google.firestore.admin.v1.EnableUserCredsRequest"
3862 }
3863}
3864
3865/// The request for
3866/// [FirestoreAdmin.DisableUserCreds][google.firestore.admin.v1.FirestoreAdmin.DisableUserCreds].
3867///
3868/// [google.firestore.admin.v1.FirestoreAdmin.DisableUserCreds]: crate::client::FirestoreAdmin::disable_user_creds
3869#[derive(Clone, Default, PartialEq)]
3870#[non_exhaustive]
3871pub struct DisableUserCredsRequest {
3872 /// Required. A name of the form
3873 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3874 pub name: std::string::String,
3875
3876 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3877}
3878
3879impl DisableUserCredsRequest {
3880 pub fn new() -> Self {
3881 std::default::Default::default()
3882 }
3883
3884 /// Sets the value of [name][crate::model::DisableUserCredsRequest::name].
3885 ///
3886 /// # Example
3887 /// ```ignore,no_run
3888 /// # use google_cloud_firestore_admin_v1::model::DisableUserCredsRequest;
3889 /// let x = DisableUserCredsRequest::new().set_name("example");
3890 /// ```
3891 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3892 self.name = v.into();
3893 self
3894 }
3895}
3896
3897impl wkt::message::Message for DisableUserCredsRequest {
3898 fn typename() -> &'static str {
3899 "type.googleapis.com/google.firestore.admin.v1.DisableUserCredsRequest"
3900 }
3901}
3902
3903/// The request for
3904/// [FirestoreAdmin.ResetUserPassword][google.firestore.admin.v1.FirestoreAdmin.ResetUserPassword].
3905///
3906/// [google.firestore.admin.v1.FirestoreAdmin.ResetUserPassword]: crate::client::FirestoreAdmin::reset_user_password
3907#[derive(Clone, Default, PartialEq)]
3908#[non_exhaustive]
3909pub struct ResetUserPasswordRequest {
3910 /// Required. A name of the form
3911 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3912 pub name: std::string::String,
3913
3914 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3915}
3916
3917impl ResetUserPasswordRequest {
3918 pub fn new() -> Self {
3919 std::default::Default::default()
3920 }
3921
3922 /// Sets the value of [name][crate::model::ResetUserPasswordRequest::name].
3923 ///
3924 /// # Example
3925 /// ```ignore,no_run
3926 /// # use google_cloud_firestore_admin_v1::model::ResetUserPasswordRequest;
3927 /// let x = ResetUserPasswordRequest::new().set_name("example");
3928 /// ```
3929 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3930 self.name = v.into();
3931 self
3932 }
3933}
3934
3935impl wkt::message::Message for ResetUserPasswordRequest {
3936 fn typename() -> &'static str {
3937 "type.googleapis.com/google.firestore.admin.v1.ResetUserPasswordRequest"
3938 }
3939}
3940
3941/// The request for
3942/// [FirestoreAdmin.DeleteUserCreds][google.firestore.admin.v1.FirestoreAdmin.DeleteUserCreds].
3943///
3944/// [google.firestore.admin.v1.FirestoreAdmin.DeleteUserCreds]: crate::client::FirestoreAdmin::delete_user_creds
3945#[derive(Clone, Default, PartialEq)]
3946#[non_exhaustive]
3947pub struct DeleteUserCredsRequest {
3948 /// Required. A name of the form
3949 /// `projects/{project_id}/databases/{database_id}/userCreds/{user_creds_id}`
3950 pub name: std::string::String,
3951
3952 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3953}
3954
3955impl DeleteUserCredsRequest {
3956 pub fn new() -> Self {
3957 std::default::Default::default()
3958 }
3959
3960 /// Sets the value of [name][crate::model::DeleteUserCredsRequest::name].
3961 ///
3962 /// # Example
3963 /// ```ignore,no_run
3964 /// # use google_cloud_firestore_admin_v1::model::DeleteUserCredsRequest;
3965 /// let x = DeleteUserCredsRequest::new().set_name("example");
3966 /// ```
3967 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3968 self.name = v.into();
3969 self
3970 }
3971}
3972
3973impl wkt::message::Message for DeleteUserCredsRequest {
3974 fn typename() -> &'static str {
3975 "type.googleapis.com/google.firestore.admin.v1.DeleteUserCredsRequest"
3976 }
3977}
3978
3979/// The request for
3980/// [FirestoreAdmin.CreateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedule].
3981///
3982/// [google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedule]: crate::client::FirestoreAdmin::create_backup_schedule
3983#[derive(Clone, Default, PartialEq)]
3984#[non_exhaustive]
3985pub struct CreateBackupScheduleRequest {
3986 /// Required. The parent database.
3987 ///
3988 /// Format `projects/{project}/databases/{database}`
3989 pub parent: std::string::String,
3990
3991 /// Required. The backup schedule to create.
3992 pub backup_schedule: std::option::Option<crate::model::BackupSchedule>,
3993
3994 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3995}
3996
3997impl CreateBackupScheduleRequest {
3998 pub fn new() -> Self {
3999 std::default::Default::default()
4000 }
4001
4002 /// Sets the value of [parent][crate::model::CreateBackupScheduleRequest::parent].
4003 ///
4004 /// # Example
4005 /// ```ignore,no_run
4006 /// # use google_cloud_firestore_admin_v1::model::CreateBackupScheduleRequest;
4007 /// let x = CreateBackupScheduleRequest::new().set_parent("example");
4008 /// ```
4009 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4010 self.parent = v.into();
4011 self
4012 }
4013
4014 /// Sets the value of [backup_schedule][crate::model::CreateBackupScheduleRequest::backup_schedule].
4015 ///
4016 /// # Example
4017 /// ```ignore,no_run
4018 /// # use google_cloud_firestore_admin_v1::model::CreateBackupScheduleRequest;
4019 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
4020 /// let x = CreateBackupScheduleRequest::new().set_backup_schedule(BackupSchedule::default()/* use setters */);
4021 /// ```
4022 pub fn set_backup_schedule<T>(mut self, v: T) -> Self
4023 where
4024 T: std::convert::Into<crate::model::BackupSchedule>,
4025 {
4026 self.backup_schedule = std::option::Option::Some(v.into());
4027 self
4028 }
4029
4030 /// Sets or clears the value of [backup_schedule][crate::model::CreateBackupScheduleRequest::backup_schedule].
4031 ///
4032 /// # Example
4033 /// ```ignore,no_run
4034 /// # use google_cloud_firestore_admin_v1::model::CreateBackupScheduleRequest;
4035 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
4036 /// let x = CreateBackupScheduleRequest::new().set_or_clear_backup_schedule(Some(BackupSchedule::default()/* use setters */));
4037 /// let x = CreateBackupScheduleRequest::new().set_or_clear_backup_schedule(None::<BackupSchedule>);
4038 /// ```
4039 pub fn set_or_clear_backup_schedule<T>(mut self, v: std::option::Option<T>) -> Self
4040 where
4041 T: std::convert::Into<crate::model::BackupSchedule>,
4042 {
4043 self.backup_schedule = v.map(|x| x.into());
4044 self
4045 }
4046}
4047
4048impl wkt::message::Message for CreateBackupScheduleRequest {
4049 fn typename() -> &'static str {
4050 "type.googleapis.com/google.firestore.admin.v1.CreateBackupScheduleRequest"
4051 }
4052}
4053
4054/// The request for
4055/// [FirestoreAdmin.GetBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.GetBackupSchedule].
4056///
4057/// [google.firestore.admin.v1.FirestoreAdmin.GetBackupSchedule]: crate::client::FirestoreAdmin::get_backup_schedule
4058#[derive(Clone, Default, PartialEq)]
4059#[non_exhaustive]
4060pub struct GetBackupScheduleRequest {
4061 /// Required. The name of the backup schedule.
4062 ///
4063 /// Format
4064 /// `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
4065 pub name: std::string::String,
4066
4067 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4068}
4069
4070impl GetBackupScheduleRequest {
4071 pub fn new() -> Self {
4072 std::default::Default::default()
4073 }
4074
4075 /// Sets the value of [name][crate::model::GetBackupScheduleRequest::name].
4076 ///
4077 /// # Example
4078 /// ```ignore,no_run
4079 /// # use google_cloud_firestore_admin_v1::model::GetBackupScheduleRequest;
4080 /// let x = GetBackupScheduleRequest::new().set_name("example");
4081 /// ```
4082 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4083 self.name = v.into();
4084 self
4085 }
4086}
4087
4088impl wkt::message::Message for GetBackupScheduleRequest {
4089 fn typename() -> &'static str {
4090 "type.googleapis.com/google.firestore.admin.v1.GetBackupScheduleRequest"
4091 }
4092}
4093
4094/// The request for
4095/// [FirestoreAdmin.UpdateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedule].
4096///
4097/// [google.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedule]: crate::client::FirestoreAdmin::update_backup_schedule
4098#[derive(Clone, Default, PartialEq)]
4099#[non_exhaustive]
4100pub struct UpdateBackupScheduleRequest {
4101 /// Required. The backup schedule to update.
4102 pub backup_schedule: std::option::Option<crate::model::BackupSchedule>,
4103
4104 /// The list of fields to be updated.
4105 pub update_mask: std::option::Option<wkt::FieldMask>,
4106
4107 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4108}
4109
4110impl UpdateBackupScheduleRequest {
4111 pub fn new() -> Self {
4112 std::default::Default::default()
4113 }
4114
4115 /// Sets the value of [backup_schedule][crate::model::UpdateBackupScheduleRequest::backup_schedule].
4116 ///
4117 /// # Example
4118 /// ```ignore,no_run
4119 /// # use google_cloud_firestore_admin_v1::model::UpdateBackupScheduleRequest;
4120 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
4121 /// let x = UpdateBackupScheduleRequest::new().set_backup_schedule(BackupSchedule::default()/* use setters */);
4122 /// ```
4123 pub fn set_backup_schedule<T>(mut self, v: T) -> Self
4124 where
4125 T: std::convert::Into<crate::model::BackupSchedule>,
4126 {
4127 self.backup_schedule = std::option::Option::Some(v.into());
4128 self
4129 }
4130
4131 /// Sets or clears the value of [backup_schedule][crate::model::UpdateBackupScheduleRequest::backup_schedule].
4132 ///
4133 /// # Example
4134 /// ```ignore,no_run
4135 /// # use google_cloud_firestore_admin_v1::model::UpdateBackupScheduleRequest;
4136 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
4137 /// let x = UpdateBackupScheduleRequest::new().set_or_clear_backup_schedule(Some(BackupSchedule::default()/* use setters */));
4138 /// let x = UpdateBackupScheduleRequest::new().set_or_clear_backup_schedule(None::<BackupSchedule>);
4139 /// ```
4140 pub fn set_or_clear_backup_schedule<T>(mut self, v: std::option::Option<T>) -> Self
4141 where
4142 T: std::convert::Into<crate::model::BackupSchedule>,
4143 {
4144 self.backup_schedule = v.map(|x| x.into());
4145 self
4146 }
4147
4148 /// Sets the value of [update_mask][crate::model::UpdateBackupScheduleRequest::update_mask].
4149 ///
4150 /// # Example
4151 /// ```ignore,no_run
4152 /// # use google_cloud_firestore_admin_v1::model::UpdateBackupScheduleRequest;
4153 /// use wkt::FieldMask;
4154 /// let x = UpdateBackupScheduleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4155 /// ```
4156 pub fn set_update_mask<T>(mut self, v: T) -> Self
4157 where
4158 T: std::convert::Into<wkt::FieldMask>,
4159 {
4160 self.update_mask = std::option::Option::Some(v.into());
4161 self
4162 }
4163
4164 /// Sets or clears the value of [update_mask][crate::model::UpdateBackupScheduleRequest::update_mask].
4165 ///
4166 /// # Example
4167 /// ```ignore,no_run
4168 /// # use google_cloud_firestore_admin_v1::model::UpdateBackupScheduleRequest;
4169 /// use wkt::FieldMask;
4170 /// let x = UpdateBackupScheduleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4171 /// let x = UpdateBackupScheduleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4172 /// ```
4173 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4174 where
4175 T: std::convert::Into<wkt::FieldMask>,
4176 {
4177 self.update_mask = v.map(|x| x.into());
4178 self
4179 }
4180}
4181
4182impl wkt::message::Message for UpdateBackupScheduleRequest {
4183 fn typename() -> &'static str {
4184 "type.googleapis.com/google.firestore.admin.v1.UpdateBackupScheduleRequest"
4185 }
4186}
4187
4188/// The request for
4189/// [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules].
4190///
4191/// [google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules]: crate::client::FirestoreAdmin::list_backup_schedules
4192#[derive(Clone, Default, PartialEq)]
4193#[non_exhaustive]
4194pub struct ListBackupSchedulesRequest {
4195 /// Required. The parent database.
4196 ///
4197 /// Format is `projects/{project}/databases/{database}`.
4198 pub parent: std::string::String,
4199
4200 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4201}
4202
4203impl ListBackupSchedulesRequest {
4204 pub fn new() -> Self {
4205 std::default::Default::default()
4206 }
4207
4208 /// Sets the value of [parent][crate::model::ListBackupSchedulesRequest::parent].
4209 ///
4210 /// # Example
4211 /// ```ignore,no_run
4212 /// # use google_cloud_firestore_admin_v1::model::ListBackupSchedulesRequest;
4213 /// let x = ListBackupSchedulesRequest::new().set_parent("example");
4214 /// ```
4215 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4216 self.parent = v.into();
4217 self
4218 }
4219}
4220
4221impl wkt::message::Message for ListBackupSchedulesRequest {
4222 fn typename() -> &'static str {
4223 "type.googleapis.com/google.firestore.admin.v1.ListBackupSchedulesRequest"
4224 }
4225}
4226
4227/// The response for
4228/// [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules].
4229///
4230/// [google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules]: crate::client::FirestoreAdmin::list_backup_schedules
4231#[derive(Clone, Default, PartialEq)]
4232#[non_exhaustive]
4233pub struct ListBackupSchedulesResponse {
4234 /// List of all backup schedules.
4235 pub backup_schedules: std::vec::Vec<crate::model::BackupSchedule>,
4236
4237 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4238}
4239
4240impl ListBackupSchedulesResponse {
4241 pub fn new() -> Self {
4242 std::default::Default::default()
4243 }
4244
4245 /// Sets the value of [backup_schedules][crate::model::ListBackupSchedulesResponse::backup_schedules].
4246 ///
4247 /// # Example
4248 /// ```ignore,no_run
4249 /// # use google_cloud_firestore_admin_v1::model::ListBackupSchedulesResponse;
4250 /// use google_cloud_firestore_admin_v1::model::BackupSchedule;
4251 /// let x = ListBackupSchedulesResponse::new()
4252 /// .set_backup_schedules([
4253 /// BackupSchedule::default()/* use setters */,
4254 /// BackupSchedule::default()/* use (different) setters */,
4255 /// ]);
4256 /// ```
4257 pub fn set_backup_schedules<T, V>(mut self, v: T) -> Self
4258 where
4259 T: std::iter::IntoIterator<Item = V>,
4260 V: std::convert::Into<crate::model::BackupSchedule>,
4261 {
4262 use std::iter::Iterator;
4263 self.backup_schedules = v.into_iter().map(|i| i.into()).collect();
4264 self
4265 }
4266}
4267
4268impl wkt::message::Message for ListBackupSchedulesResponse {
4269 fn typename() -> &'static str {
4270 "type.googleapis.com/google.firestore.admin.v1.ListBackupSchedulesResponse"
4271 }
4272}
4273
4274/// The request for [FirestoreAdmin.DeleteBackupSchedules][].
4275#[derive(Clone, Default, PartialEq)]
4276#[non_exhaustive]
4277pub struct DeleteBackupScheduleRequest {
4278 /// Required. The name of the backup schedule.
4279 ///
4280 /// Format
4281 /// `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
4282 pub name: std::string::String,
4283
4284 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4285}
4286
4287impl DeleteBackupScheduleRequest {
4288 pub fn new() -> Self {
4289 std::default::Default::default()
4290 }
4291
4292 /// Sets the value of [name][crate::model::DeleteBackupScheduleRequest::name].
4293 ///
4294 /// # Example
4295 /// ```ignore,no_run
4296 /// # use google_cloud_firestore_admin_v1::model::DeleteBackupScheduleRequest;
4297 /// let x = DeleteBackupScheduleRequest::new().set_name("example");
4298 /// ```
4299 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4300 self.name = v.into();
4301 self
4302 }
4303}
4304
4305impl wkt::message::Message for DeleteBackupScheduleRequest {
4306 fn typename() -> &'static str {
4307 "type.googleapis.com/google.firestore.admin.v1.DeleteBackupScheduleRequest"
4308 }
4309}
4310
4311/// The request for
4312/// [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
4313///
4314/// [google.firestore.admin.v1.FirestoreAdmin.CreateIndex]: crate::client::FirestoreAdmin::create_index
4315#[derive(Clone, Default, PartialEq)]
4316#[non_exhaustive]
4317pub struct CreateIndexRequest {
4318 /// Required. A parent name of the form
4319 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
4320 pub parent: std::string::String,
4321
4322 /// Required. The composite index to create.
4323 pub index: std::option::Option<crate::model::Index>,
4324
4325 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4326}
4327
4328impl CreateIndexRequest {
4329 pub fn new() -> Self {
4330 std::default::Default::default()
4331 }
4332
4333 /// Sets the value of [parent][crate::model::CreateIndexRequest::parent].
4334 ///
4335 /// # Example
4336 /// ```ignore,no_run
4337 /// # use google_cloud_firestore_admin_v1::model::CreateIndexRequest;
4338 /// let x = CreateIndexRequest::new().set_parent("example");
4339 /// ```
4340 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4341 self.parent = v.into();
4342 self
4343 }
4344
4345 /// Sets the value of [index][crate::model::CreateIndexRequest::index].
4346 ///
4347 /// # Example
4348 /// ```ignore,no_run
4349 /// # use google_cloud_firestore_admin_v1::model::CreateIndexRequest;
4350 /// use google_cloud_firestore_admin_v1::model::Index;
4351 /// let x = CreateIndexRequest::new().set_index(Index::default()/* use setters */);
4352 /// ```
4353 pub fn set_index<T>(mut self, v: T) -> Self
4354 where
4355 T: std::convert::Into<crate::model::Index>,
4356 {
4357 self.index = std::option::Option::Some(v.into());
4358 self
4359 }
4360
4361 /// Sets or clears the value of [index][crate::model::CreateIndexRequest::index].
4362 ///
4363 /// # Example
4364 /// ```ignore,no_run
4365 /// # use google_cloud_firestore_admin_v1::model::CreateIndexRequest;
4366 /// use google_cloud_firestore_admin_v1::model::Index;
4367 /// let x = CreateIndexRequest::new().set_or_clear_index(Some(Index::default()/* use setters */));
4368 /// let x = CreateIndexRequest::new().set_or_clear_index(None::<Index>);
4369 /// ```
4370 pub fn set_or_clear_index<T>(mut self, v: std::option::Option<T>) -> Self
4371 where
4372 T: std::convert::Into<crate::model::Index>,
4373 {
4374 self.index = v.map(|x| x.into());
4375 self
4376 }
4377}
4378
4379impl wkt::message::Message for CreateIndexRequest {
4380 fn typename() -> &'static str {
4381 "type.googleapis.com/google.firestore.admin.v1.CreateIndexRequest"
4382 }
4383}
4384
4385/// The request for
4386/// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes].
4387///
4388/// [google.firestore.admin.v1.FirestoreAdmin.ListIndexes]: crate::client::FirestoreAdmin::list_indexes
4389#[derive(Clone, Default, PartialEq)]
4390#[non_exhaustive]
4391pub struct ListIndexesRequest {
4392 /// Required. A parent name of the form
4393 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
4394 pub parent: std::string::String,
4395
4396 /// The filter to apply to list results.
4397 pub filter: std::string::String,
4398
4399 /// The number of results to return.
4400 pub page_size: i32,
4401
4402 /// A page token, returned from a previous call to
4403 /// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes],
4404 /// that may be used to get the next page of results.
4405 ///
4406 /// [google.firestore.admin.v1.FirestoreAdmin.ListIndexes]: crate::client::FirestoreAdmin::list_indexes
4407 pub page_token: std::string::String,
4408
4409 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4410}
4411
4412impl ListIndexesRequest {
4413 pub fn new() -> Self {
4414 std::default::Default::default()
4415 }
4416
4417 /// Sets the value of [parent][crate::model::ListIndexesRequest::parent].
4418 ///
4419 /// # Example
4420 /// ```ignore,no_run
4421 /// # use google_cloud_firestore_admin_v1::model::ListIndexesRequest;
4422 /// let x = ListIndexesRequest::new().set_parent("example");
4423 /// ```
4424 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4425 self.parent = v.into();
4426 self
4427 }
4428
4429 /// Sets the value of [filter][crate::model::ListIndexesRequest::filter].
4430 ///
4431 /// # Example
4432 /// ```ignore,no_run
4433 /// # use google_cloud_firestore_admin_v1::model::ListIndexesRequest;
4434 /// let x = ListIndexesRequest::new().set_filter("example");
4435 /// ```
4436 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4437 self.filter = v.into();
4438 self
4439 }
4440
4441 /// Sets the value of [page_size][crate::model::ListIndexesRequest::page_size].
4442 ///
4443 /// # Example
4444 /// ```ignore,no_run
4445 /// # use google_cloud_firestore_admin_v1::model::ListIndexesRequest;
4446 /// let x = ListIndexesRequest::new().set_page_size(42);
4447 /// ```
4448 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4449 self.page_size = v.into();
4450 self
4451 }
4452
4453 /// Sets the value of [page_token][crate::model::ListIndexesRequest::page_token].
4454 ///
4455 /// # Example
4456 /// ```ignore,no_run
4457 /// # use google_cloud_firestore_admin_v1::model::ListIndexesRequest;
4458 /// let x = ListIndexesRequest::new().set_page_token("example");
4459 /// ```
4460 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4461 self.page_token = v.into();
4462 self
4463 }
4464}
4465
4466impl wkt::message::Message for ListIndexesRequest {
4467 fn typename() -> &'static str {
4468 "type.googleapis.com/google.firestore.admin.v1.ListIndexesRequest"
4469 }
4470}
4471
4472/// The response for
4473/// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes].
4474///
4475/// [google.firestore.admin.v1.FirestoreAdmin.ListIndexes]: crate::client::FirestoreAdmin::list_indexes
4476#[derive(Clone, Default, PartialEq)]
4477#[non_exhaustive]
4478pub struct ListIndexesResponse {
4479 /// The requested indexes.
4480 pub indexes: std::vec::Vec<crate::model::Index>,
4481
4482 /// A page token that may be used to request another page of results. If blank,
4483 /// this is the last page.
4484 pub next_page_token: std::string::String,
4485
4486 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4487}
4488
4489impl ListIndexesResponse {
4490 pub fn new() -> Self {
4491 std::default::Default::default()
4492 }
4493
4494 /// Sets the value of [indexes][crate::model::ListIndexesResponse::indexes].
4495 ///
4496 /// # Example
4497 /// ```ignore,no_run
4498 /// # use google_cloud_firestore_admin_v1::model::ListIndexesResponse;
4499 /// use google_cloud_firestore_admin_v1::model::Index;
4500 /// let x = ListIndexesResponse::new()
4501 /// .set_indexes([
4502 /// Index::default()/* use setters */,
4503 /// Index::default()/* use (different) setters */,
4504 /// ]);
4505 /// ```
4506 pub fn set_indexes<T, V>(mut self, v: T) -> Self
4507 where
4508 T: std::iter::IntoIterator<Item = V>,
4509 V: std::convert::Into<crate::model::Index>,
4510 {
4511 use std::iter::Iterator;
4512 self.indexes = v.into_iter().map(|i| i.into()).collect();
4513 self
4514 }
4515
4516 /// Sets the value of [next_page_token][crate::model::ListIndexesResponse::next_page_token].
4517 ///
4518 /// # Example
4519 /// ```ignore,no_run
4520 /// # use google_cloud_firestore_admin_v1::model::ListIndexesResponse;
4521 /// let x = ListIndexesResponse::new().set_next_page_token("example");
4522 /// ```
4523 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4524 self.next_page_token = v.into();
4525 self
4526 }
4527}
4528
4529impl wkt::message::Message for ListIndexesResponse {
4530 fn typename() -> &'static str {
4531 "type.googleapis.com/google.firestore.admin.v1.ListIndexesResponse"
4532 }
4533}
4534
4535#[doc(hidden)]
4536impl google_cloud_gax::paginator::internal::PageableResponse for ListIndexesResponse {
4537 type PageItem = crate::model::Index;
4538
4539 fn items(self) -> std::vec::Vec<Self::PageItem> {
4540 self.indexes
4541 }
4542
4543 fn next_page_token(&self) -> std::string::String {
4544 use std::clone::Clone;
4545 self.next_page_token.clone()
4546 }
4547}
4548
4549/// The request for
4550/// [FirestoreAdmin.GetIndex][google.firestore.admin.v1.FirestoreAdmin.GetIndex].
4551///
4552/// [google.firestore.admin.v1.FirestoreAdmin.GetIndex]: crate::client::FirestoreAdmin::get_index
4553#[derive(Clone, Default, PartialEq)]
4554#[non_exhaustive]
4555pub struct GetIndexRequest {
4556 /// Required. A name of the form
4557 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
4558 pub name: std::string::String,
4559
4560 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4561}
4562
4563impl GetIndexRequest {
4564 pub fn new() -> Self {
4565 std::default::Default::default()
4566 }
4567
4568 /// Sets the value of [name][crate::model::GetIndexRequest::name].
4569 ///
4570 /// # Example
4571 /// ```ignore,no_run
4572 /// # use google_cloud_firestore_admin_v1::model::GetIndexRequest;
4573 /// let x = GetIndexRequest::new().set_name("example");
4574 /// ```
4575 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4576 self.name = v.into();
4577 self
4578 }
4579}
4580
4581impl wkt::message::Message for GetIndexRequest {
4582 fn typename() -> &'static str {
4583 "type.googleapis.com/google.firestore.admin.v1.GetIndexRequest"
4584 }
4585}
4586
4587/// The request for
4588/// [FirestoreAdmin.DeleteIndex][google.firestore.admin.v1.FirestoreAdmin.DeleteIndex].
4589///
4590/// [google.firestore.admin.v1.FirestoreAdmin.DeleteIndex]: crate::client::FirestoreAdmin::delete_index
4591#[derive(Clone, Default, PartialEq)]
4592#[non_exhaustive]
4593pub struct DeleteIndexRequest {
4594 /// Required. A name of the form
4595 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
4596 pub name: std::string::String,
4597
4598 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4599}
4600
4601impl DeleteIndexRequest {
4602 pub fn new() -> Self {
4603 std::default::Default::default()
4604 }
4605
4606 /// Sets the value of [name][crate::model::DeleteIndexRequest::name].
4607 ///
4608 /// # Example
4609 /// ```ignore,no_run
4610 /// # use google_cloud_firestore_admin_v1::model::DeleteIndexRequest;
4611 /// let x = DeleteIndexRequest::new().set_name("example");
4612 /// ```
4613 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4614 self.name = v.into();
4615 self
4616 }
4617}
4618
4619impl wkt::message::Message for DeleteIndexRequest {
4620 fn typename() -> &'static str {
4621 "type.googleapis.com/google.firestore.admin.v1.DeleteIndexRequest"
4622 }
4623}
4624
4625/// The request for
4626/// [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField].
4627///
4628/// [google.firestore.admin.v1.FirestoreAdmin.UpdateField]: crate::client::FirestoreAdmin::update_field
4629#[derive(Clone, Default, PartialEq)]
4630#[non_exhaustive]
4631pub struct UpdateFieldRequest {
4632 /// Required. The field to be updated.
4633 pub field: std::option::Option<crate::model::Field>,
4634
4635 /// A mask, relative to the field. If specified, only configuration specified
4636 /// by this field_mask will be updated in the field.
4637 pub update_mask: std::option::Option<wkt::FieldMask>,
4638
4639 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4640}
4641
4642impl UpdateFieldRequest {
4643 pub fn new() -> Self {
4644 std::default::Default::default()
4645 }
4646
4647 /// Sets the value of [field][crate::model::UpdateFieldRequest::field].
4648 ///
4649 /// # Example
4650 /// ```ignore,no_run
4651 /// # use google_cloud_firestore_admin_v1::model::UpdateFieldRequest;
4652 /// use google_cloud_firestore_admin_v1::model::Field;
4653 /// let x = UpdateFieldRequest::new().set_field(Field::default()/* use setters */);
4654 /// ```
4655 pub fn set_field<T>(mut self, v: T) -> Self
4656 where
4657 T: std::convert::Into<crate::model::Field>,
4658 {
4659 self.field = std::option::Option::Some(v.into());
4660 self
4661 }
4662
4663 /// Sets or clears the value of [field][crate::model::UpdateFieldRequest::field].
4664 ///
4665 /// # Example
4666 /// ```ignore,no_run
4667 /// # use google_cloud_firestore_admin_v1::model::UpdateFieldRequest;
4668 /// use google_cloud_firestore_admin_v1::model::Field;
4669 /// let x = UpdateFieldRequest::new().set_or_clear_field(Some(Field::default()/* use setters */));
4670 /// let x = UpdateFieldRequest::new().set_or_clear_field(None::<Field>);
4671 /// ```
4672 pub fn set_or_clear_field<T>(mut self, v: std::option::Option<T>) -> Self
4673 where
4674 T: std::convert::Into<crate::model::Field>,
4675 {
4676 self.field = v.map(|x| x.into());
4677 self
4678 }
4679
4680 /// Sets the value of [update_mask][crate::model::UpdateFieldRequest::update_mask].
4681 ///
4682 /// # Example
4683 /// ```ignore,no_run
4684 /// # use google_cloud_firestore_admin_v1::model::UpdateFieldRequest;
4685 /// use wkt::FieldMask;
4686 /// let x = UpdateFieldRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4687 /// ```
4688 pub fn set_update_mask<T>(mut self, v: T) -> Self
4689 where
4690 T: std::convert::Into<wkt::FieldMask>,
4691 {
4692 self.update_mask = std::option::Option::Some(v.into());
4693 self
4694 }
4695
4696 /// Sets or clears the value of [update_mask][crate::model::UpdateFieldRequest::update_mask].
4697 ///
4698 /// # Example
4699 /// ```ignore,no_run
4700 /// # use google_cloud_firestore_admin_v1::model::UpdateFieldRequest;
4701 /// use wkt::FieldMask;
4702 /// let x = UpdateFieldRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4703 /// let x = UpdateFieldRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4704 /// ```
4705 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4706 where
4707 T: std::convert::Into<wkt::FieldMask>,
4708 {
4709 self.update_mask = v.map(|x| x.into());
4710 self
4711 }
4712}
4713
4714impl wkt::message::Message for UpdateFieldRequest {
4715 fn typename() -> &'static str {
4716 "type.googleapis.com/google.firestore.admin.v1.UpdateFieldRequest"
4717 }
4718}
4719
4720/// The request for
4721/// [FirestoreAdmin.GetField][google.firestore.admin.v1.FirestoreAdmin.GetField].
4722///
4723/// [google.firestore.admin.v1.FirestoreAdmin.GetField]: crate::client::FirestoreAdmin::get_field
4724#[derive(Clone, Default, PartialEq)]
4725#[non_exhaustive]
4726pub struct GetFieldRequest {
4727 /// Required. A name of the form
4728 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
4729 pub name: std::string::String,
4730
4731 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4732}
4733
4734impl GetFieldRequest {
4735 pub fn new() -> Self {
4736 std::default::Default::default()
4737 }
4738
4739 /// Sets the value of [name][crate::model::GetFieldRequest::name].
4740 ///
4741 /// # Example
4742 /// ```ignore,no_run
4743 /// # use google_cloud_firestore_admin_v1::model::GetFieldRequest;
4744 /// let x = GetFieldRequest::new().set_name("example");
4745 /// ```
4746 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4747 self.name = v.into();
4748 self
4749 }
4750}
4751
4752impl wkt::message::Message for GetFieldRequest {
4753 fn typename() -> &'static str {
4754 "type.googleapis.com/google.firestore.admin.v1.GetFieldRequest"
4755 }
4756}
4757
4758/// The request for
4759/// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields].
4760///
4761/// [google.firestore.admin.v1.FirestoreAdmin.ListFields]: crate::client::FirestoreAdmin::list_fields
4762#[derive(Clone, Default, PartialEq)]
4763#[non_exhaustive]
4764pub struct ListFieldsRequest {
4765 /// Required. A parent name of the form
4766 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
4767 pub parent: std::string::String,
4768
4769 /// The filter to apply to list results. Currently,
4770 /// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
4771 /// only supports listing fields that have been explicitly overridden. To issue
4772 /// this query, call
4773 /// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
4774 /// with a filter that includes `indexConfig.usesAncestorConfig:false` or
4775 /// `ttlConfig:*`.
4776 ///
4777 /// [google.firestore.admin.v1.FirestoreAdmin.ListFields]: crate::client::FirestoreAdmin::list_fields
4778 pub filter: std::string::String,
4779
4780 /// The number of results to return.
4781 pub page_size: i32,
4782
4783 /// A page token, returned from a previous call to
4784 /// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields],
4785 /// that may be used to get the next page of results.
4786 ///
4787 /// [google.firestore.admin.v1.FirestoreAdmin.ListFields]: crate::client::FirestoreAdmin::list_fields
4788 pub page_token: std::string::String,
4789
4790 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4791}
4792
4793impl ListFieldsRequest {
4794 pub fn new() -> Self {
4795 std::default::Default::default()
4796 }
4797
4798 /// Sets the value of [parent][crate::model::ListFieldsRequest::parent].
4799 ///
4800 /// # Example
4801 /// ```ignore,no_run
4802 /// # use google_cloud_firestore_admin_v1::model::ListFieldsRequest;
4803 /// let x = ListFieldsRequest::new().set_parent("example");
4804 /// ```
4805 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4806 self.parent = v.into();
4807 self
4808 }
4809
4810 /// Sets the value of [filter][crate::model::ListFieldsRequest::filter].
4811 ///
4812 /// # Example
4813 /// ```ignore,no_run
4814 /// # use google_cloud_firestore_admin_v1::model::ListFieldsRequest;
4815 /// let x = ListFieldsRequest::new().set_filter("example");
4816 /// ```
4817 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4818 self.filter = v.into();
4819 self
4820 }
4821
4822 /// Sets the value of [page_size][crate::model::ListFieldsRequest::page_size].
4823 ///
4824 /// # Example
4825 /// ```ignore,no_run
4826 /// # use google_cloud_firestore_admin_v1::model::ListFieldsRequest;
4827 /// let x = ListFieldsRequest::new().set_page_size(42);
4828 /// ```
4829 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4830 self.page_size = v.into();
4831 self
4832 }
4833
4834 /// Sets the value of [page_token][crate::model::ListFieldsRequest::page_token].
4835 ///
4836 /// # Example
4837 /// ```ignore,no_run
4838 /// # use google_cloud_firestore_admin_v1::model::ListFieldsRequest;
4839 /// let x = ListFieldsRequest::new().set_page_token("example");
4840 /// ```
4841 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4842 self.page_token = v.into();
4843 self
4844 }
4845}
4846
4847impl wkt::message::Message for ListFieldsRequest {
4848 fn typename() -> &'static str {
4849 "type.googleapis.com/google.firestore.admin.v1.ListFieldsRequest"
4850 }
4851}
4852
4853/// The response for
4854/// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields].
4855///
4856/// [google.firestore.admin.v1.FirestoreAdmin.ListFields]: crate::client::FirestoreAdmin::list_fields
4857#[derive(Clone, Default, PartialEq)]
4858#[non_exhaustive]
4859pub struct ListFieldsResponse {
4860 /// The requested fields.
4861 pub fields: std::vec::Vec<crate::model::Field>,
4862
4863 /// A page token that may be used to request another page of results. If blank,
4864 /// this is the last page.
4865 pub next_page_token: std::string::String,
4866
4867 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4868}
4869
4870impl ListFieldsResponse {
4871 pub fn new() -> Self {
4872 std::default::Default::default()
4873 }
4874
4875 /// Sets the value of [fields][crate::model::ListFieldsResponse::fields].
4876 ///
4877 /// # Example
4878 /// ```ignore,no_run
4879 /// # use google_cloud_firestore_admin_v1::model::ListFieldsResponse;
4880 /// use google_cloud_firestore_admin_v1::model::Field;
4881 /// let x = ListFieldsResponse::new()
4882 /// .set_fields([
4883 /// Field::default()/* use setters */,
4884 /// Field::default()/* use (different) setters */,
4885 /// ]);
4886 /// ```
4887 pub fn set_fields<T, V>(mut self, v: T) -> Self
4888 where
4889 T: std::iter::IntoIterator<Item = V>,
4890 V: std::convert::Into<crate::model::Field>,
4891 {
4892 use std::iter::Iterator;
4893 self.fields = v.into_iter().map(|i| i.into()).collect();
4894 self
4895 }
4896
4897 /// Sets the value of [next_page_token][crate::model::ListFieldsResponse::next_page_token].
4898 ///
4899 /// # Example
4900 /// ```ignore,no_run
4901 /// # use google_cloud_firestore_admin_v1::model::ListFieldsResponse;
4902 /// let x = ListFieldsResponse::new().set_next_page_token("example");
4903 /// ```
4904 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4905 self.next_page_token = v.into();
4906 self
4907 }
4908}
4909
4910impl wkt::message::Message for ListFieldsResponse {
4911 fn typename() -> &'static str {
4912 "type.googleapis.com/google.firestore.admin.v1.ListFieldsResponse"
4913 }
4914}
4915
4916#[doc(hidden)]
4917impl google_cloud_gax::paginator::internal::PageableResponse for ListFieldsResponse {
4918 type PageItem = crate::model::Field;
4919
4920 fn items(self) -> std::vec::Vec<Self::PageItem> {
4921 self.fields
4922 }
4923
4924 fn next_page_token(&self) -> std::string::String {
4925 use std::clone::Clone;
4926 self.next_page_token.clone()
4927 }
4928}
4929
4930/// The request for
4931/// [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments].
4932///
4933/// [google.firestore.admin.v1.FirestoreAdmin.ExportDocuments]: crate::client::FirestoreAdmin::export_documents
4934#[derive(Clone, Default, PartialEq)]
4935#[non_exhaustive]
4936pub struct ExportDocumentsRequest {
4937 /// Required. Database to export. Should be of the form:
4938 /// `projects/{project_id}/databases/{database_id}`.
4939 pub name: std::string::String,
4940
4941 /// IDs of the collection groups to export. Unspecified means all
4942 /// collection groups. Each collection group in this list must be unique.
4943 pub collection_ids: std::vec::Vec<std::string::String>,
4944
4945 /// The output URI. Currently only supports Google Cloud Storage URIs of the
4946 /// form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name
4947 /// of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional
4948 /// Google Cloud Storage namespace path. When
4949 /// choosing a name, be sure to consider Google Cloud Storage naming
4950 /// guidelines: <https://cloud.google.com/storage/docs/naming>.
4951 /// If the URI is a bucket (without a namespace path), a prefix will be
4952 /// generated based on the start time.
4953 pub output_uri_prefix: std::string::String,
4954
4955 /// An empty list represents all namespaces. This is the preferred
4956 /// usage for databases that don't use namespaces.
4957 ///
4958 /// An empty string element represents the default namespace. This should be
4959 /// used if the database has data in non-default namespaces, but doesn't want
4960 /// to include them. Each namespace in this list must be unique.
4961 pub namespace_ids: std::vec::Vec<std::string::String>,
4962
4963 /// The timestamp that corresponds to the version of the database to be
4964 /// exported. The timestamp must be in the past, rounded to the minute and not
4965 /// older than
4966 /// [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
4967 /// If specified, then the exported documents will represent a consistent view
4968 /// of the database at the provided time. Otherwise, there are no guarantees
4969 /// about the consistency of the exported documents.
4970 ///
4971 /// [google.firestore.admin.v1.Database.earliest_version_time]: crate::model::Database::earliest_version_time
4972 pub snapshot_time: std::option::Option<wkt::Timestamp>,
4973
4974 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4975}
4976
4977impl ExportDocumentsRequest {
4978 pub fn new() -> Self {
4979 std::default::Default::default()
4980 }
4981
4982 /// Sets the value of [name][crate::model::ExportDocumentsRequest::name].
4983 ///
4984 /// # Example
4985 /// ```ignore,no_run
4986 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
4987 /// let x = ExportDocumentsRequest::new().set_name("example");
4988 /// ```
4989 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4990 self.name = v.into();
4991 self
4992 }
4993
4994 /// Sets the value of [collection_ids][crate::model::ExportDocumentsRequest::collection_ids].
4995 ///
4996 /// # Example
4997 /// ```ignore,no_run
4998 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
4999 /// let x = ExportDocumentsRequest::new().set_collection_ids(["a", "b", "c"]);
5000 /// ```
5001 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
5002 where
5003 T: std::iter::IntoIterator<Item = V>,
5004 V: std::convert::Into<std::string::String>,
5005 {
5006 use std::iter::Iterator;
5007 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
5008 self
5009 }
5010
5011 /// Sets the value of [output_uri_prefix][crate::model::ExportDocumentsRequest::output_uri_prefix].
5012 ///
5013 /// # Example
5014 /// ```ignore,no_run
5015 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
5016 /// let x = ExportDocumentsRequest::new().set_output_uri_prefix("example");
5017 /// ```
5018 pub fn set_output_uri_prefix<T: std::convert::Into<std::string::String>>(
5019 mut self,
5020 v: T,
5021 ) -> Self {
5022 self.output_uri_prefix = v.into();
5023 self
5024 }
5025
5026 /// Sets the value of [namespace_ids][crate::model::ExportDocumentsRequest::namespace_ids].
5027 ///
5028 /// # Example
5029 /// ```ignore,no_run
5030 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
5031 /// let x = ExportDocumentsRequest::new().set_namespace_ids(["a", "b", "c"]);
5032 /// ```
5033 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
5034 where
5035 T: std::iter::IntoIterator<Item = V>,
5036 V: std::convert::Into<std::string::String>,
5037 {
5038 use std::iter::Iterator;
5039 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
5040 self
5041 }
5042
5043 /// Sets the value of [snapshot_time][crate::model::ExportDocumentsRequest::snapshot_time].
5044 ///
5045 /// # Example
5046 /// ```ignore,no_run
5047 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
5048 /// use wkt::Timestamp;
5049 /// let x = ExportDocumentsRequest::new().set_snapshot_time(Timestamp::default()/* use setters */);
5050 /// ```
5051 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
5052 where
5053 T: std::convert::Into<wkt::Timestamp>,
5054 {
5055 self.snapshot_time = std::option::Option::Some(v.into());
5056 self
5057 }
5058
5059 /// Sets or clears the value of [snapshot_time][crate::model::ExportDocumentsRequest::snapshot_time].
5060 ///
5061 /// # Example
5062 /// ```ignore,no_run
5063 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsRequest;
5064 /// use wkt::Timestamp;
5065 /// let x = ExportDocumentsRequest::new().set_or_clear_snapshot_time(Some(Timestamp::default()/* use setters */));
5066 /// let x = ExportDocumentsRequest::new().set_or_clear_snapshot_time(None::<Timestamp>);
5067 /// ```
5068 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
5069 where
5070 T: std::convert::Into<wkt::Timestamp>,
5071 {
5072 self.snapshot_time = v.map(|x| x.into());
5073 self
5074 }
5075}
5076
5077impl wkt::message::Message for ExportDocumentsRequest {
5078 fn typename() -> &'static str {
5079 "type.googleapis.com/google.firestore.admin.v1.ExportDocumentsRequest"
5080 }
5081}
5082
5083/// The request for
5084/// [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments].
5085///
5086/// [google.firestore.admin.v1.FirestoreAdmin.ImportDocuments]: crate::client::FirestoreAdmin::import_documents
5087#[derive(Clone, Default, PartialEq)]
5088#[non_exhaustive]
5089pub struct ImportDocumentsRequest {
5090 /// Required. Database to import into. Should be of the form:
5091 /// `projects/{project_id}/databases/{database_id}`.
5092 pub name: std::string::String,
5093
5094 /// IDs of the collection groups to import. Unspecified means all collection
5095 /// groups that were included in the export. Each collection group in this list
5096 /// must be unique.
5097 pub collection_ids: std::vec::Vec<std::string::String>,
5098
5099 /// Location of the exported files.
5100 /// This must match the output_uri_prefix of an ExportDocumentsResponse from
5101 /// an export that has completed successfully.
5102 /// See:
5103 /// [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix].
5104 ///
5105 /// [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix]: crate::model::ExportDocumentsResponse::output_uri_prefix
5106 pub input_uri_prefix: std::string::String,
5107
5108 /// An empty list represents all namespaces. This is the preferred
5109 /// usage for databases that don't use namespaces.
5110 ///
5111 /// An empty string element represents the default namespace. This should be
5112 /// used if the database has data in non-default namespaces, but doesn't want
5113 /// to include them. Each namespace in this list must be unique.
5114 pub namespace_ids: std::vec::Vec<std::string::String>,
5115
5116 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5117}
5118
5119impl ImportDocumentsRequest {
5120 pub fn new() -> Self {
5121 std::default::Default::default()
5122 }
5123
5124 /// Sets the value of [name][crate::model::ImportDocumentsRequest::name].
5125 ///
5126 /// # Example
5127 /// ```ignore,no_run
5128 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsRequest;
5129 /// let x = ImportDocumentsRequest::new().set_name("example");
5130 /// ```
5131 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5132 self.name = v.into();
5133 self
5134 }
5135
5136 /// Sets the value of [collection_ids][crate::model::ImportDocumentsRequest::collection_ids].
5137 ///
5138 /// # Example
5139 /// ```ignore,no_run
5140 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsRequest;
5141 /// let x = ImportDocumentsRequest::new().set_collection_ids(["a", "b", "c"]);
5142 /// ```
5143 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
5144 where
5145 T: std::iter::IntoIterator<Item = V>,
5146 V: std::convert::Into<std::string::String>,
5147 {
5148 use std::iter::Iterator;
5149 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
5150 self
5151 }
5152
5153 /// Sets the value of [input_uri_prefix][crate::model::ImportDocumentsRequest::input_uri_prefix].
5154 ///
5155 /// # Example
5156 /// ```ignore,no_run
5157 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsRequest;
5158 /// let x = ImportDocumentsRequest::new().set_input_uri_prefix("example");
5159 /// ```
5160 pub fn set_input_uri_prefix<T: std::convert::Into<std::string::String>>(
5161 mut self,
5162 v: T,
5163 ) -> Self {
5164 self.input_uri_prefix = v.into();
5165 self
5166 }
5167
5168 /// Sets the value of [namespace_ids][crate::model::ImportDocumentsRequest::namespace_ids].
5169 ///
5170 /// # Example
5171 /// ```ignore,no_run
5172 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsRequest;
5173 /// let x = ImportDocumentsRequest::new().set_namespace_ids(["a", "b", "c"]);
5174 /// ```
5175 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
5176 where
5177 T: std::iter::IntoIterator<Item = V>,
5178 V: std::convert::Into<std::string::String>,
5179 {
5180 use std::iter::Iterator;
5181 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
5182 self
5183 }
5184}
5185
5186impl wkt::message::Message for ImportDocumentsRequest {
5187 fn typename() -> &'static str {
5188 "type.googleapis.com/google.firestore.admin.v1.ImportDocumentsRequest"
5189 }
5190}
5191
5192/// The request for
5193/// [FirestoreAdmin.BulkDeleteDocuments][google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments].
5194///
5195/// When both collection_ids and namespace_ids are set, only documents satisfying
5196/// both conditions will be deleted.
5197///
5198/// Requests with namespace_ids and collection_ids both empty will be rejected.
5199/// Please use
5200/// [FirestoreAdmin.DeleteDatabase][google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase]
5201/// instead.
5202///
5203/// [google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments]: crate::client::FirestoreAdmin::bulk_delete_documents
5204/// [google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase]: crate::client::FirestoreAdmin::delete_database
5205#[derive(Clone, Default, PartialEq)]
5206#[non_exhaustive]
5207pub struct BulkDeleteDocumentsRequest {
5208 /// Required. Database to operate. Should be of the form:
5209 /// `projects/{project_id}/databases/{database_id}`.
5210 pub name: std::string::String,
5211
5212 /// Optional. IDs of the collection groups to delete. Unspecified means all
5213 /// collection groups.
5214 ///
5215 /// Each collection group in this list must be unique.
5216 pub collection_ids: std::vec::Vec<std::string::String>,
5217
5218 /// Optional. Namespaces to delete.
5219 ///
5220 /// An empty list means all namespaces. This is the recommended
5221 /// usage for databases that don't use namespaces.
5222 ///
5223 /// An empty string element represents the default namespace. This should be
5224 /// used if the database has data in non-default namespaces, but doesn't want
5225 /// to delete from them.
5226 ///
5227 /// Each namespace in this list must be unique.
5228 pub namespace_ids: std::vec::Vec<std::string::String>,
5229
5230 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5231}
5232
5233impl BulkDeleteDocumentsRequest {
5234 pub fn new() -> Self {
5235 std::default::Default::default()
5236 }
5237
5238 /// Sets the value of [name][crate::model::BulkDeleteDocumentsRequest::name].
5239 ///
5240 /// # Example
5241 /// ```ignore,no_run
5242 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsRequest;
5243 /// let x = BulkDeleteDocumentsRequest::new().set_name("example");
5244 /// ```
5245 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5246 self.name = v.into();
5247 self
5248 }
5249
5250 /// Sets the value of [collection_ids][crate::model::BulkDeleteDocumentsRequest::collection_ids].
5251 ///
5252 /// # Example
5253 /// ```ignore,no_run
5254 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsRequest;
5255 /// let x = BulkDeleteDocumentsRequest::new().set_collection_ids(["a", "b", "c"]);
5256 /// ```
5257 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
5258 where
5259 T: std::iter::IntoIterator<Item = V>,
5260 V: std::convert::Into<std::string::String>,
5261 {
5262 use std::iter::Iterator;
5263 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
5264 self
5265 }
5266
5267 /// Sets the value of [namespace_ids][crate::model::BulkDeleteDocumentsRequest::namespace_ids].
5268 ///
5269 /// # Example
5270 /// ```ignore,no_run
5271 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsRequest;
5272 /// let x = BulkDeleteDocumentsRequest::new().set_namespace_ids(["a", "b", "c"]);
5273 /// ```
5274 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
5275 where
5276 T: std::iter::IntoIterator<Item = V>,
5277 V: std::convert::Into<std::string::String>,
5278 {
5279 use std::iter::Iterator;
5280 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
5281 self
5282 }
5283}
5284
5285impl wkt::message::Message for BulkDeleteDocumentsRequest {
5286 fn typename() -> &'static str {
5287 "type.googleapis.com/google.firestore.admin.v1.BulkDeleteDocumentsRequest"
5288 }
5289}
5290
5291/// The response for
5292/// [FirestoreAdmin.BulkDeleteDocuments][google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments].
5293///
5294/// [google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments]: crate::client::FirestoreAdmin::bulk_delete_documents
5295#[derive(Clone, Default, PartialEq)]
5296#[non_exhaustive]
5297pub struct BulkDeleteDocumentsResponse {
5298 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5299}
5300
5301impl BulkDeleteDocumentsResponse {
5302 pub fn new() -> Self {
5303 std::default::Default::default()
5304 }
5305}
5306
5307impl wkt::message::Message for BulkDeleteDocumentsResponse {
5308 fn typename() -> &'static str {
5309 "type.googleapis.com/google.firestore.admin.v1.BulkDeleteDocumentsResponse"
5310 }
5311}
5312
5313/// The request for
5314/// [FirestoreAdmin.GetBackup][google.firestore.admin.v1.FirestoreAdmin.GetBackup].
5315///
5316/// [google.firestore.admin.v1.FirestoreAdmin.GetBackup]: crate::client::FirestoreAdmin::get_backup
5317#[derive(Clone, Default, PartialEq)]
5318#[non_exhaustive]
5319pub struct GetBackupRequest {
5320 /// Required. Name of the backup to fetch.
5321 ///
5322 /// Format is `projects/{project}/locations/{location}/backups/{backup}`.
5323 pub name: std::string::String,
5324
5325 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5326}
5327
5328impl GetBackupRequest {
5329 pub fn new() -> Self {
5330 std::default::Default::default()
5331 }
5332
5333 /// Sets the value of [name][crate::model::GetBackupRequest::name].
5334 ///
5335 /// # Example
5336 /// ```ignore,no_run
5337 /// # use google_cloud_firestore_admin_v1::model::GetBackupRequest;
5338 /// let x = GetBackupRequest::new().set_name("example");
5339 /// ```
5340 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5341 self.name = v.into();
5342 self
5343 }
5344}
5345
5346impl wkt::message::Message for GetBackupRequest {
5347 fn typename() -> &'static str {
5348 "type.googleapis.com/google.firestore.admin.v1.GetBackupRequest"
5349 }
5350}
5351
5352/// The request for
5353/// [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups].
5354///
5355/// [google.firestore.admin.v1.FirestoreAdmin.ListBackups]: crate::client::FirestoreAdmin::list_backups
5356#[derive(Clone, Default, PartialEq)]
5357#[non_exhaustive]
5358pub struct ListBackupsRequest {
5359 /// Required. The location to list backups from.
5360 ///
5361 /// Format is `projects/{project}/locations/{location}`.
5362 /// Use `{location} = '-'` to list backups from all locations for the given
5363 /// project. This allows listing backups from a single location or from all
5364 /// locations.
5365 pub parent: std::string::String,
5366
5367 /// An expression that filters the list of returned backups.
5368 ///
5369 /// A filter expression consists of a field name, a comparison operator, and a
5370 /// value for filtering.
5371 /// The value must be a string, a number, or a boolean. The comparison operator
5372 /// must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
5373 /// Colon `:` is the contains operator. Filter rules are not case sensitive.
5374 ///
5375 /// The following fields in the [Backup][google.firestore.admin.v1.Backup] are
5376 /// eligible for filtering:
5377 ///
5378 /// * `database_uid` (supports `=` only)
5379 ///
5380 /// [google.firestore.admin.v1.Backup]: crate::model::Backup
5381 pub filter: std::string::String,
5382
5383 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5384}
5385
5386impl ListBackupsRequest {
5387 pub fn new() -> Self {
5388 std::default::Default::default()
5389 }
5390
5391 /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
5392 ///
5393 /// # Example
5394 /// ```ignore,no_run
5395 /// # use google_cloud_firestore_admin_v1::model::ListBackupsRequest;
5396 /// let x = ListBackupsRequest::new().set_parent("example");
5397 /// ```
5398 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5399 self.parent = v.into();
5400 self
5401 }
5402
5403 /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
5404 ///
5405 /// # Example
5406 /// ```ignore,no_run
5407 /// # use google_cloud_firestore_admin_v1::model::ListBackupsRequest;
5408 /// let x = ListBackupsRequest::new().set_filter("example");
5409 /// ```
5410 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5411 self.filter = v.into();
5412 self
5413 }
5414}
5415
5416impl wkt::message::Message for ListBackupsRequest {
5417 fn typename() -> &'static str {
5418 "type.googleapis.com/google.firestore.admin.v1.ListBackupsRequest"
5419 }
5420}
5421
5422/// The response for
5423/// [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups].
5424///
5425/// [google.firestore.admin.v1.FirestoreAdmin.ListBackups]: crate::client::FirestoreAdmin::list_backups
5426#[derive(Clone, Default, PartialEq)]
5427#[non_exhaustive]
5428pub struct ListBackupsResponse {
5429 /// List of all backups for the project.
5430 pub backups: std::vec::Vec<crate::model::Backup>,
5431
5432 /// List of locations that existing backups were not able to be fetched from.
5433 ///
5434 /// Instead of failing the entire requests when a single location is
5435 /// unreachable, this response returns a partial result set and list of
5436 /// locations unable to be reached here. The request can be retried against a
5437 /// single location to get a concrete error.
5438 pub unreachable: std::vec::Vec<std::string::String>,
5439
5440 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5441}
5442
5443impl ListBackupsResponse {
5444 pub fn new() -> Self {
5445 std::default::Default::default()
5446 }
5447
5448 /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
5449 ///
5450 /// # Example
5451 /// ```ignore,no_run
5452 /// # use google_cloud_firestore_admin_v1::model::ListBackupsResponse;
5453 /// use google_cloud_firestore_admin_v1::model::Backup;
5454 /// let x = ListBackupsResponse::new()
5455 /// .set_backups([
5456 /// Backup::default()/* use setters */,
5457 /// Backup::default()/* use (different) setters */,
5458 /// ]);
5459 /// ```
5460 pub fn set_backups<T, V>(mut self, v: T) -> Self
5461 where
5462 T: std::iter::IntoIterator<Item = V>,
5463 V: std::convert::Into<crate::model::Backup>,
5464 {
5465 use std::iter::Iterator;
5466 self.backups = v.into_iter().map(|i| i.into()).collect();
5467 self
5468 }
5469
5470 /// Sets the value of [unreachable][crate::model::ListBackupsResponse::unreachable].
5471 ///
5472 /// # Example
5473 /// ```ignore,no_run
5474 /// # use google_cloud_firestore_admin_v1::model::ListBackupsResponse;
5475 /// let x = ListBackupsResponse::new().set_unreachable(["a", "b", "c"]);
5476 /// ```
5477 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5478 where
5479 T: std::iter::IntoIterator<Item = V>,
5480 V: std::convert::Into<std::string::String>,
5481 {
5482 use std::iter::Iterator;
5483 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5484 self
5485 }
5486}
5487
5488impl wkt::message::Message for ListBackupsResponse {
5489 fn typename() -> &'static str {
5490 "type.googleapis.com/google.firestore.admin.v1.ListBackupsResponse"
5491 }
5492}
5493
5494/// The request for
5495/// [FirestoreAdmin.DeleteBackup][google.firestore.admin.v1.FirestoreAdmin.DeleteBackup].
5496///
5497/// [google.firestore.admin.v1.FirestoreAdmin.DeleteBackup]: crate::client::FirestoreAdmin::delete_backup
5498#[derive(Clone, Default, PartialEq)]
5499#[non_exhaustive]
5500pub struct DeleteBackupRequest {
5501 /// Required. Name of the backup to delete.
5502 ///
5503 /// format is `projects/{project}/locations/{location}/backups/{backup}`.
5504 pub name: std::string::String,
5505
5506 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5507}
5508
5509impl DeleteBackupRequest {
5510 pub fn new() -> Self {
5511 std::default::Default::default()
5512 }
5513
5514 /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
5515 ///
5516 /// # Example
5517 /// ```ignore,no_run
5518 /// # use google_cloud_firestore_admin_v1::model::DeleteBackupRequest;
5519 /// let x = DeleteBackupRequest::new().set_name("example");
5520 /// ```
5521 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5522 self.name = v.into();
5523 self
5524 }
5525}
5526
5527impl wkt::message::Message for DeleteBackupRequest {
5528 fn typename() -> &'static str {
5529 "type.googleapis.com/google.firestore.admin.v1.DeleteBackupRequest"
5530 }
5531}
5532
5533/// The request message for
5534/// [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.FirestoreAdmin.RestoreDatabase].
5535///
5536/// [google.firestore.admin.v1.FirestoreAdmin.RestoreDatabase]: crate::client::FirestoreAdmin::restore_database
5537#[derive(Clone, Default, PartialEq)]
5538#[non_exhaustive]
5539pub struct RestoreDatabaseRequest {
5540 /// Required. The project to restore the database in. Format is
5541 /// `projects/{project_id}`.
5542 pub parent: std::string::String,
5543
5544 /// Required. The ID to use for the database, which will become the final
5545 /// component of the database's resource name. This database ID must not be
5546 /// associated with an existing database.
5547 ///
5548 /// This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
5549 /// with first character a letter and the last a letter or a number. Must not
5550 /// be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
5551 ///
5552 /// "(default)" database ID is also valid if the database is Standard edition.
5553 pub database_id: std::string::String,
5554
5555 /// Required. Backup to restore from. Must be from the same project as the
5556 /// parent.
5557 ///
5558 /// The restored database will be created in the same location as the source
5559 /// backup.
5560 ///
5561 /// Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
5562 pub backup: std::string::String,
5563
5564 /// Optional. Encryption configuration for the restored database.
5565 ///
5566 /// If this field is not specified, the restored database will use
5567 /// the same encryption configuration as the backup, namely
5568 /// [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
5569 ///
5570 /// [google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption]: crate::model::database::EncryptionConfig::encryption_type
5571 pub encryption_config: std::option::Option<crate::model::database::EncryptionConfig>,
5572
5573 /// Optional. Immutable. Tags to be bound to the restored database.
5574 ///
5575 /// The tags should be provided in the format of
5576 /// `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
5577 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
5578
5579 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5580}
5581
5582impl RestoreDatabaseRequest {
5583 pub fn new() -> Self {
5584 std::default::Default::default()
5585 }
5586
5587 /// Sets the value of [parent][crate::model::RestoreDatabaseRequest::parent].
5588 ///
5589 /// # Example
5590 /// ```ignore,no_run
5591 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5592 /// let x = RestoreDatabaseRequest::new().set_parent("example");
5593 /// ```
5594 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5595 self.parent = v.into();
5596 self
5597 }
5598
5599 /// Sets the value of [database_id][crate::model::RestoreDatabaseRequest::database_id].
5600 ///
5601 /// # Example
5602 /// ```ignore,no_run
5603 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5604 /// let x = RestoreDatabaseRequest::new().set_database_id("example");
5605 /// ```
5606 pub fn set_database_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5607 self.database_id = v.into();
5608 self
5609 }
5610
5611 /// Sets the value of [backup][crate::model::RestoreDatabaseRequest::backup].
5612 ///
5613 /// # Example
5614 /// ```ignore,no_run
5615 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5616 /// let x = RestoreDatabaseRequest::new().set_backup("example");
5617 /// ```
5618 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5619 self.backup = v.into();
5620 self
5621 }
5622
5623 /// Sets the value of [encryption_config][crate::model::RestoreDatabaseRequest::encryption_config].
5624 ///
5625 /// # Example
5626 /// ```ignore,no_run
5627 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5628 /// use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
5629 /// let x = RestoreDatabaseRequest::new().set_encryption_config(EncryptionConfig::default()/* use setters */);
5630 /// ```
5631 pub fn set_encryption_config<T>(mut self, v: T) -> Self
5632 where
5633 T: std::convert::Into<crate::model::database::EncryptionConfig>,
5634 {
5635 self.encryption_config = std::option::Option::Some(v.into());
5636 self
5637 }
5638
5639 /// Sets or clears the value of [encryption_config][crate::model::RestoreDatabaseRequest::encryption_config].
5640 ///
5641 /// # Example
5642 /// ```ignore,no_run
5643 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5644 /// use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
5645 /// let x = RestoreDatabaseRequest::new().set_or_clear_encryption_config(Some(EncryptionConfig::default()/* use setters */));
5646 /// let x = RestoreDatabaseRequest::new().set_or_clear_encryption_config(None::<EncryptionConfig>);
5647 /// ```
5648 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
5649 where
5650 T: std::convert::Into<crate::model::database::EncryptionConfig>,
5651 {
5652 self.encryption_config = v.map(|x| x.into());
5653 self
5654 }
5655
5656 /// Sets the value of [tags][crate::model::RestoreDatabaseRequest::tags].
5657 ///
5658 /// # Example
5659 /// ```ignore,no_run
5660 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseRequest;
5661 /// let x = RestoreDatabaseRequest::new().set_tags([
5662 /// ("key0", "abc"),
5663 /// ("key1", "xyz"),
5664 /// ]);
5665 /// ```
5666 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
5667 where
5668 T: std::iter::IntoIterator<Item = (K, V)>,
5669 K: std::convert::Into<std::string::String>,
5670 V: std::convert::Into<std::string::String>,
5671 {
5672 use std::iter::Iterator;
5673 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5674 self
5675 }
5676}
5677
5678impl wkt::message::Message for RestoreDatabaseRequest {
5679 fn typename() -> &'static str {
5680 "type.googleapis.com/google.firestore.admin.v1.RestoreDatabaseRequest"
5681 }
5682}
5683
5684/// The request message for
5685/// [FirestoreAdmin.CloneDatabase][google.firestore.admin.v1.FirestoreAdmin.CloneDatabase].
5686///
5687/// [google.firestore.admin.v1.FirestoreAdmin.CloneDatabase]: crate::client::FirestoreAdmin::clone_database
5688#[derive(Clone, Default, PartialEq)]
5689#[non_exhaustive]
5690pub struct CloneDatabaseRequest {
5691 /// Required. The project to clone the database in. Format is
5692 /// `projects/{project_id}`.
5693 pub parent: std::string::String,
5694
5695 /// Required. The ID to use for the database, which will become the final
5696 /// component of the database's resource name. This database ID must not be
5697 /// associated with an existing database.
5698 ///
5699 /// This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
5700 /// with first character a letter and the last a letter or a number. Must not
5701 /// be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
5702 ///
5703 /// "(default)" database ID is also valid if the database is Standard edition.
5704 pub database_id: std::string::String,
5705
5706 /// Required. Specification of the PITR data to clone from. The source database
5707 /// must exist.
5708 ///
5709 /// The cloned database will be created in the same location as the source
5710 /// database.
5711 pub pitr_snapshot: std::option::Option<crate::model::PitrSnapshot>,
5712
5713 /// Optional. Encryption configuration for the cloned database.
5714 ///
5715 /// If this field is not specified, the cloned database will use
5716 /// the same encryption configuration as the source database, namely
5717 /// [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
5718 ///
5719 /// [google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption]: crate::model::database::EncryptionConfig::encryption_type
5720 pub encryption_config: std::option::Option<crate::model::database::EncryptionConfig>,
5721
5722 /// Optional. Immutable. Tags to be bound to the cloned database.
5723 ///
5724 /// The tags should be provided in the format of
5725 /// `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
5726 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
5727
5728 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5729}
5730
5731impl CloneDatabaseRequest {
5732 pub fn new() -> Self {
5733 std::default::Default::default()
5734 }
5735
5736 /// Sets the value of [parent][crate::model::CloneDatabaseRequest::parent].
5737 ///
5738 /// # Example
5739 /// ```ignore,no_run
5740 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5741 /// let x = CloneDatabaseRequest::new().set_parent("example");
5742 /// ```
5743 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5744 self.parent = v.into();
5745 self
5746 }
5747
5748 /// Sets the value of [database_id][crate::model::CloneDatabaseRequest::database_id].
5749 ///
5750 /// # Example
5751 /// ```ignore,no_run
5752 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5753 /// let x = CloneDatabaseRequest::new().set_database_id("example");
5754 /// ```
5755 pub fn set_database_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5756 self.database_id = v.into();
5757 self
5758 }
5759
5760 /// Sets the value of [pitr_snapshot][crate::model::CloneDatabaseRequest::pitr_snapshot].
5761 ///
5762 /// # Example
5763 /// ```ignore,no_run
5764 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5765 /// use google_cloud_firestore_admin_v1::model::PitrSnapshot;
5766 /// let x = CloneDatabaseRequest::new().set_pitr_snapshot(PitrSnapshot::default()/* use setters */);
5767 /// ```
5768 pub fn set_pitr_snapshot<T>(mut self, v: T) -> Self
5769 where
5770 T: std::convert::Into<crate::model::PitrSnapshot>,
5771 {
5772 self.pitr_snapshot = std::option::Option::Some(v.into());
5773 self
5774 }
5775
5776 /// Sets or clears the value of [pitr_snapshot][crate::model::CloneDatabaseRequest::pitr_snapshot].
5777 ///
5778 /// # Example
5779 /// ```ignore,no_run
5780 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5781 /// use google_cloud_firestore_admin_v1::model::PitrSnapshot;
5782 /// let x = CloneDatabaseRequest::new().set_or_clear_pitr_snapshot(Some(PitrSnapshot::default()/* use setters */));
5783 /// let x = CloneDatabaseRequest::new().set_or_clear_pitr_snapshot(None::<PitrSnapshot>);
5784 /// ```
5785 pub fn set_or_clear_pitr_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
5786 where
5787 T: std::convert::Into<crate::model::PitrSnapshot>,
5788 {
5789 self.pitr_snapshot = v.map(|x| x.into());
5790 self
5791 }
5792
5793 /// Sets the value of [encryption_config][crate::model::CloneDatabaseRequest::encryption_config].
5794 ///
5795 /// # Example
5796 /// ```ignore,no_run
5797 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5798 /// use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
5799 /// let x = CloneDatabaseRequest::new().set_encryption_config(EncryptionConfig::default()/* use setters */);
5800 /// ```
5801 pub fn set_encryption_config<T>(mut self, v: T) -> Self
5802 where
5803 T: std::convert::Into<crate::model::database::EncryptionConfig>,
5804 {
5805 self.encryption_config = std::option::Option::Some(v.into());
5806 self
5807 }
5808
5809 /// Sets or clears the value of [encryption_config][crate::model::CloneDatabaseRequest::encryption_config].
5810 ///
5811 /// # Example
5812 /// ```ignore,no_run
5813 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5814 /// use google_cloud_firestore_admin_v1::model::database::EncryptionConfig;
5815 /// let x = CloneDatabaseRequest::new().set_or_clear_encryption_config(Some(EncryptionConfig::default()/* use setters */));
5816 /// let x = CloneDatabaseRequest::new().set_or_clear_encryption_config(None::<EncryptionConfig>);
5817 /// ```
5818 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
5819 where
5820 T: std::convert::Into<crate::model::database::EncryptionConfig>,
5821 {
5822 self.encryption_config = v.map(|x| x.into());
5823 self
5824 }
5825
5826 /// Sets the value of [tags][crate::model::CloneDatabaseRequest::tags].
5827 ///
5828 /// # Example
5829 /// ```ignore,no_run
5830 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseRequest;
5831 /// let x = CloneDatabaseRequest::new().set_tags([
5832 /// ("key0", "abc"),
5833 /// ("key1", "xyz"),
5834 /// ]);
5835 /// ```
5836 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
5837 where
5838 T: std::iter::IntoIterator<Item = (K, V)>,
5839 K: std::convert::Into<std::string::String>,
5840 V: std::convert::Into<std::string::String>,
5841 {
5842 use std::iter::Iterator;
5843 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5844 self
5845 }
5846}
5847
5848impl wkt::message::Message for CloneDatabaseRequest {
5849 fn typename() -> &'static str {
5850 "type.googleapis.com/google.firestore.admin.v1.CloneDatabaseRequest"
5851 }
5852}
5853
5854/// Cloud Firestore indexes enable simple and complex queries against
5855/// documents in a database.
5856#[derive(Clone, Default, PartialEq)]
5857#[non_exhaustive]
5858pub struct Index {
5859 /// Output only. A server defined name for this index.
5860 /// The form of this name for composite indexes will be:
5861 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}`
5862 /// For single field indexes, this field will be empty.
5863 pub name: std::string::String,
5864
5865 /// Indexes with a collection query scope specified allow queries
5866 /// against a collection that is the child of a specific document, specified at
5867 /// query time, and that has the same collection ID.
5868 ///
5869 /// Indexes with a collection group query scope specified allow queries against
5870 /// all collections descended from a specific document, specified at query
5871 /// time, and that have the same collection ID as this index.
5872 pub query_scope: crate::model::index::QueryScope,
5873
5874 /// The API scope supported by this index.
5875 pub api_scope: crate::model::index::ApiScope,
5876
5877 /// The fields supported by this index.
5878 ///
5879 /// For composite indexes, this requires a minimum of 2 and a maximum of 100
5880 /// fields. The last field entry is always for the field path `__name__`. If,
5881 /// on creation, `__name__` was not specified as the last field, it will be
5882 /// added automatically with the same direction as that of the last field
5883 /// defined. If the final field in a composite index is not directional, the
5884 /// `__name__` will be ordered ASCENDING (unless explicitly specified).
5885 ///
5886 /// For single field indexes, this will always be exactly one entry with a
5887 /// field path equal to the field path of the associated field.
5888 pub fields: std::vec::Vec<crate::model::index::IndexField>,
5889
5890 /// Output only. The serving state of the index.
5891 pub state: crate::model::index::State,
5892
5893 /// Immutable. The density configuration of the index.
5894 pub density: crate::model::index::Density,
5895
5896 /// Optional. Whether the index is multikey. By default, the index is not
5897 /// multikey. For non-multikey indexes, none of the paths in the index
5898 /// definition reach or traverse an array, except via an explicit array index.
5899 /// For multikey indexes, at most one of the paths in the index definition
5900 /// reach or traverse an array, except via an explicit array index. Violations
5901 /// will result in errors.
5902 ///
5903 /// Note this field only applies to index with MONGODB_COMPATIBLE_API ApiScope.
5904 pub multikey: bool,
5905
5906 /// Optional. The number of shards for the index.
5907 pub shard_count: i32,
5908
5909 /// Optional. Whether it is an unique index. Unique index ensures all values
5910 /// for the indexed field(s) are unique across documents.
5911 pub unique: bool,
5912
5913 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5914}
5915
5916impl Index {
5917 pub fn new() -> Self {
5918 std::default::Default::default()
5919 }
5920
5921 /// Sets the value of [name][crate::model::Index::name].
5922 ///
5923 /// # Example
5924 /// ```ignore,no_run
5925 /// # use google_cloud_firestore_admin_v1::model::Index;
5926 /// let x = Index::new().set_name("example");
5927 /// ```
5928 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5929 self.name = v.into();
5930 self
5931 }
5932
5933 /// Sets the value of [query_scope][crate::model::Index::query_scope].
5934 ///
5935 /// # Example
5936 /// ```ignore,no_run
5937 /// # use google_cloud_firestore_admin_v1::model::Index;
5938 /// use google_cloud_firestore_admin_v1::model::index::QueryScope;
5939 /// let x0 = Index::new().set_query_scope(QueryScope::Collection);
5940 /// let x1 = Index::new().set_query_scope(QueryScope::CollectionGroup);
5941 /// let x2 = Index::new().set_query_scope(QueryScope::CollectionRecursive);
5942 /// ```
5943 pub fn set_query_scope<T: std::convert::Into<crate::model::index::QueryScope>>(
5944 mut self,
5945 v: T,
5946 ) -> Self {
5947 self.query_scope = v.into();
5948 self
5949 }
5950
5951 /// Sets the value of [api_scope][crate::model::Index::api_scope].
5952 ///
5953 /// # Example
5954 /// ```ignore,no_run
5955 /// # use google_cloud_firestore_admin_v1::model::Index;
5956 /// use google_cloud_firestore_admin_v1::model::index::ApiScope;
5957 /// let x0 = Index::new().set_api_scope(ApiScope::DatastoreModeApi);
5958 /// let x1 = Index::new().set_api_scope(ApiScope::MongodbCompatibleApi);
5959 /// ```
5960 pub fn set_api_scope<T: std::convert::Into<crate::model::index::ApiScope>>(
5961 mut self,
5962 v: T,
5963 ) -> Self {
5964 self.api_scope = v.into();
5965 self
5966 }
5967
5968 /// Sets the value of [fields][crate::model::Index::fields].
5969 ///
5970 /// # Example
5971 /// ```ignore,no_run
5972 /// # use google_cloud_firestore_admin_v1::model::Index;
5973 /// use google_cloud_firestore_admin_v1::model::index::IndexField;
5974 /// let x = Index::new()
5975 /// .set_fields([
5976 /// IndexField::default()/* use setters */,
5977 /// IndexField::default()/* use (different) setters */,
5978 /// ]);
5979 /// ```
5980 pub fn set_fields<T, V>(mut self, v: T) -> Self
5981 where
5982 T: std::iter::IntoIterator<Item = V>,
5983 V: std::convert::Into<crate::model::index::IndexField>,
5984 {
5985 use std::iter::Iterator;
5986 self.fields = v.into_iter().map(|i| i.into()).collect();
5987 self
5988 }
5989
5990 /// Sets the value of [state][crate::model::Index::state].
5991 ///
5992 /// # Example
5993 /// ```ignore,no_run
5994 /// # use google_cloud_firestore_admin_v1::model::Index;
5995 /// use google_cloud_firestore_admin_v1::model::index::State;
5996 /// let x0 = Index::new().set_state(State::Creating);
5997 /// let x1 = Index::new().set_state(State::Ready);
5998 /// let x2 = Index::new().set_state(State::NeedsRepair);
5999 /// ```
6000 pub fn set_state<T: std::convert::Into<crate::model::index::State>>(mut self, v: T) -> Self {
6001 self.state = v.into();
6002 self
6003 }
6004
6005 /// Sets the value of [density][crate::model::Index::density].
6006 ///
6007 /// # Example
6008 /// ```ignore,no_run
6009 /// # use google_cloud_firestore_admin_v1::model::Index;
6010 /// use google_cloud_firestore_admin_v1::model::index::Density;
6011 /// let x0 = Index::new().set_density(Density::SparseAll);
6012 /// let x1 = Index::new().set_density(Density::SparseAny);
6013 /// let x2 = Index::new().set_density(Density::Dense);
6014 /// ```
6015 pub fn set_density<T: std::convert::Into<crate::model::index::Density>>(
6016 mut self,
6017 v: T,
6018 ) -> Self {
6019 self.density = v.into();
6020 self
6021 }
6022
6023 /// Sets the value of [multikey][crate::model::Index::multikey].
6024 ///
6025 /// # Example
6026 /// ```ignore,no_run
6027 /// # use google_cloud_firestore_admin_v1::model::Index;
6028 /// let x = Index::new().set_multikey(true);
6029 /// ```
6030 pub fn set_multikey<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6031 self.multikey = v.into();
6032 self
6033 }
6034
6035 /// Sets the value of [shard_count][crate::model::Index::shard_count].
6036 ///
6037 /// # Example
6038 /// ```ignore,no_run
6039 /// # use google_cloud_firestore_admin_v1::model::Index;
6040 /// let x = Index::new().set_shard_count(42);
6041 /// ```
6042 pub fn set_shard_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6043 self.shard_count = v.into();
6044 self
6045 }
6046
6047 /// Sets the value of [unique][crate::model::Index::unique].
6048 ///
6049 /// # Example
6050 /// ```ignore,no_run
6051 /// # use google_cloud_firestore_admin_v1::model::Index;
6052 /// let x = Index::new().set_unique(true);
6053 /// ```
6054 pub fn set_unique<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6055 self.unique = v.into();
6056 self
6057 }
6058}
6059
6060impl wkt::message::Message for Index {
6061 fn typename() -> &'static str {
6062 "type.googleapis.com/google.firestore.admin.v1.Index"
6063 }
6064}
6065
6066/// Defines additional types related to [Index].
6067pub mod index {
6068 #[allow(unused_imports)]
6069 use super::*;
6070
6071 /// A field in an index.
6072 /// The field_path describes which field is indexed, the value_mode describes
6073 /// how the field value is indexed.
6074 #[derive(Clone, Default, PartialEq)]
6075 #[non_exhaustive]
6076 pub struct IndexField {
6077 /// Can be __name__.
6078 /// For single field indexes, this must match the name of the field or may
6079 /// be omitted.
6080 pub field_path: std::string::String,
6081
6082 /// How the field value is indexed.
6083 pub value_mode: std::option::Option<crate::model::index::index_field::ValueMode>,
6084
6085 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6086 }
6087
6088 impl IndexField {
6089 pub fn new() -> Self {
6090 std::default::Default::default()
6091 }
6092
6093 /// Sets the value of [field_path][crate::model::index::IndexField::field_path].
6094 ///
6095 /// # Example
6096 /// ```ignore,no_run
6097 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
6098 /// let x = IndexField::new().set_field_path("example");
6099 /// ```
6100 pub fn set_field_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6101 self.field_path = v.into();
6102 self
6103 }
6104
6105 /// Sets the value of [value_mode][crate::model::index::IndexField::value_mode].
6106 ///
6107 /// Note that all the setters affecting `value_mode` are mutually
6108 /// exclusive.
6109 ///
6110 /// # Example
6111 /// ```ignore,no_run
6112 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
6113 /// use google_cloud_firestore_admin_v1::model::index::index_field::Order;
6114 /// let x0 = IndexField::new().set_value_mode(Some(
6115 /// google_cloud_firestore_admin_v1::model::index::index_field::ValueMode::Order(Order::Ascending)));
6116 /// let x1 = IndexField::new().set_value_mode(Some(
6117 /// google_cloud_firestore_admin_v1::model::index::index_field::ValueMode::Order(Order::Descending)));
6118 /// ```
6119 pub fn set_value_mode<
6120 T: std::convert::Into<std::option::Option<crate::model::index::index_field::ValueMode>>,
6121 >(
6122 mut self,
6123 v: T,
6124 ) -> Self {
6125 self.value_mode = v.into();
6126 self
6127 }
6128
6129 /// The value of [value_mode][crate::model::index::IndexField::value_mode]
6130 /// if it holds a `Order`, `None` if the field is not set or
6131 /// holds a different branch.
6132 pub fn order(&self) -> std::option::Option<&crate::model::index::index_field::Order> {
6133 #[allow(unreachable_patterns)]
6134 self.value_mode.as_ref().and_then(|v| match v {
6135 crate::model::index::index_field::ValueMode::Order(v) => {
6136 std::option::Option::Some(v)
6137 }
6138 _ => std::option::Option::None,
6139 })
6140 }
6141
6142 /// Sets the value of [value_mode][crate::model::index::IndexField::value_mode]
6143 /// to hold a `Order`.
6144 ///
6145 /// Note that all the setters affecting `value_mode` are
6146 /// mutually exclusive.
6147 ///
6148 /// # Example
6149 /// ```ignore,no_run
6150 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
6151 /// use google_cloud_firestore_admin_v1::model::index::index_field::Order;
6152 /// let x0 = IndexField::new().set_order(Order::Ascending);
6153 /// let x1 = IndexField::new().set_order(Order::Descending);
6154 /// assert!(x0.order().is_some());
6155 /// assert!(x0.array_config().is_none());
6156 /// assert!(x0.vector_config().is_none());
6157 /// assert!(x1.order().is_some());
6158 /// assert!(x1.array_config().is_none());
6159 /// assert!(x1.vector_config().is_none());
6160 /// ```
6161 pub fn set_order<T: std::convert::Into<crate::model::index::index_field::Order>>(
6162 mut self,
6163 v: T,
6164 ) -> Self {
6165 self.value_mode = std::option::Option::Some(
6166 crate::model::index::index_field::ValueMode::Order(v.into()),
6167 );
6168 self
6169 }
6170
6171 /// The value of [value_mode][crate::model::index::IndexField::value_mode]
6172 /// if it holds a `ArrayConfig`, `None` if the field is not set or
6173 /// holds a different branch.
6174 pub fn array_config(
6175 &self,
6176 ) -> std::option::Option<&crate::model::index::index_field::ArrayConfig> {
6177 #[allow(unreachable_patterns)]
6178 self.value_mode.as_ref().and_then(|v| match v {
6179 crate::model::index::index_field::ValueMode::ArrayConfig(v) => {
6180 std::option::Option::Some(v)
6181 }
6182 _ => std::option::Option::None,
6183 })
6184 }
6185
6186 /// Sets the value of [value_mode][crate::model::index::IndexField::value_mode]
6187 /// to hold a `ArrayConfig`.
6188 ///
6189 /// Note that all the setters affecting `value_mode` are
6190 /// mutually exclusive.
6191 ///
6192 /// # Example
6193 /// ```ignore,no_run
6194 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
6195 /// use google_cloud_firestore_admin_v1::model::index::index_field::ArrayConfig;
6196 /// let x0 = IndexField::new().set_array_config(ArrayConfig::Contains);
6197 /// assert!(x0.array_config().is_some());
6198 /// assert!(x0.order().is_none());
6199 /// assert!(x0.vector_config().is_none());
6200 /// ```
6201 pub fn set_array_config<
6202 T: std::convert::Into<crate::model::index::index_field::ArrayConfig>,
6203 >(
6204 mut self,
6205 v: T,
6206 ) -> Self {
6207 self.value_mode = std::option::Option::Some(
6208 crate::model::index::index_field::ValueMode::ArrayConfig(v.into()),
6209 );
6210 self
6211 }
6212
6213 /// The value of [value_mode][crate::model::index::IndexField::value_mode]
6214 /// if it holds a `VectorConfig`, `None` if the field is not set or
6215 /// holds a different branch.
6216 pub fn vector_config(
6217 &self,
6218 ) -> std::option::Option<&std::boxed::Box<crate::model::index::index_field::VectorConfig>>
6219 {
6220 #[allow(unreachable_patterns)]
6221 self.value_mode.as_ref().and_then(|v| match v {
6222 crate::model::index::index_field::ValueMode::VectorConfig(v) => {
6223 std::option::Option::Some(v)
6224 }
6225 _ => std::option::Option::None,
6226 })
6227 }
6228
6229 /// Sets the value of [value_mode][crate::model::index::IndexField::value_mode]
6230 /// to hold a `VectorConfig`.
6231 ///
6232 /// Note that all the setters affecting `value_mode` are
6233 /// mutually exclusive.
6234 ///
6235 /// # Example
6236 /// ```ignore,no_run
6237 /// # use google_cloud_firestore_admin_v1::model::index::IndexField;
6238 /// use google_cloud_firestore_admin_v1::model::index::index_field::VectorConfig;
6239 /// let x = IndexField::new().set_vector_config(VectorConfig::default()/* use setters */);
6240 /// assert!(x.vector_config().is_some());
6241 /// assert!(x.order().is_none());
6242 /// assert!(x.array_config().is_none());
6243 /// ```
6244 pub fn set_vector_config<
6245 T: std::convert::Into<std::boxed::Box<crate::model::index::index_field::VectorConfig>>,
6246 >(
6247 mut self,
6248 v: T,
6249 ) -> Self {
6250 self.value_mode = std::option::Option::Some(
6251 crate::model::index::index_field::ValueMode::VectorConfig(v.into()),
6252 );
6253 self
6254 }
6255 }
6256
6257 impl wkt::message::Message for IndexField {
6258 fn typename() -> &'static str {
6259 "type.googleapis.com/google.firestore.admin.v1.Index.IndexField"
6260 }
6261 }
6262
6263 /// Defines additional types related to [IndexField].
6264 pub mod index_field {
6265 #[allow(unused_imports)]
6266 use super::*;
6267
6268 /// The index configuration to support vector search operations
6269 #[derive(Clone, Default, PartialEq)]
6270 #[non_exhaustive]
6271 pub struct VectorConfig {
6272 /// Required. The vector dimension this configuration applies to.
6273 ///
6274 /// The resulting index will only include vectors of this dimension, and
6275 /// can be used for vector search with the same dimension.
6276 pub dimension: i32,
6277
6278 /// The type of index used.
6279 pub r#type: std::option::Option<crate::model::index::index_field::vector_config::Type>,
6280
6281 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6282 }
6283
6284 impl VectorConfig {
6285 pub fn new() -> Self {
6286 std::default::Default::default()
6287 }
6288
6289 /// Sets the value of [dimension][crate::model::index::index_field::VectorConfig::dimension].
6290 ///
6291 /// # Example
6292 /// ```ignore,no_run
6293 /// # use google_cloud_firestore_admin_v1::model::index::index_field::VectorConfig;
6294 /// let x = VectorConfig::new().set_dimension(42);
6295 /// ```
6296 pub fn set_dimension<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6297 self.dimension = v.into();
6298 self
6299 }
6300
6301 /// Sets the value of [r#type][crate::model::index::index_field::VectorConfig::type].
6302 ///
6303 /// Note that all the setters affecting `r#type` are mutually
6304 /// exclusive.
6305 ///
6306 /// # Example
6307 /// ```ignore,no_run
6308 /// # use google_cloud_firestore_admin_v1::model::index::index_field::VectorConfig;
6309 /// use google_cloud_firestore_admin_v1::model::index::index_field::vector_config::FlatIndex;
6310 /// let x = VectorConfig::new().set_type(Some(
6311 /// google_cloud_firestore_admin_v1::model::index::index_field::vector_config::Type::Flat(FlatIndex::default().into())));
6312 /// ```
6313 pub fn set_type<
6314 T: std::convert::Into<
6315 std::option::Option<crate::model::index::index_field::vector_config::Type>,
6316 >,
6317 >(
6318 mut self,
6319 v: T,
6320 ) -> Self {
6321 self.r#type = v.into();
6322 self
6323 }
6324
6325 /// The value of [r#type][crate::model::index::index_field::VectorConfig::r#type]
6326 /// if it holds a `Flat`, `None` if the field is not set or
6327 /// holds a different branch.
6328 pub fn flat(
6329 &self,
6330 ) -> std::option::Option<
6331 &std::boxed::Box<crate::model::index::index_field::vector_config::FlatIndex>,
6332 > {
6333 #[allow(unreachable_patterns)]
6334 self.r#type.as_ref().and_then(|v| match v {
6335 crate::model::index::index_field::vector_config::Type::Flat(v) => {
6336 std::option::Option::Some(v)
6337 }
6338 _ => std::option::Option::None,
6339 })
6340 }
6341
6342 /// Sets the value of [r#type][crate::model::index::index_field::VectorConfig::r#type]
6343 /// to hold a `Flat`.
6344 ///
6345 /// Note that all the setters affecting `r#type` are
6346 /// mutually exclusive.
6347 ///
6348 /// # Example
6349 /// ```ignore,no_run
6350 /// # use google_cloud_firestore_admin_v1::model::index::index_field::VectorConfig;
6351 /// use google_cloud_firestore_admin_v1::model::index::index_field::vector_config::FlatIndex;
6352 /// let x = VectorConfig::new().set_flat(FlatIndex::default()/* use setters */);
6353 /// assert!(x.flat().is_some());
6354 /// ```
6355 pub fn set_flat<
6356 T: std::convert::Into<
6357 std::boxed::Box<crate::model::index::index_field::vector_config::FlatIndex>,
6358 >,
6359 >(
6360 mut self,
6361 v: T,
6362 ) -> Self {
6363 self.r#type = std::option::Option::Some(
6364 crate::model::index::index_field::vector_config::Type::Flat(v.into()),
6365 );
6366 self
6367 }
6368 }
6369
6370 impl wkt::message::Message for VectorConfig {
6371 fn typename() -> &'static str {
6372 "type.googleapis.com/google.firestore.admin.v1.Index.IndexField.VectorConfig"
6373 }
6374 }
6375
6376 /// Defines additional types related to [VectorConfig].
6377 pub mod vector_config {
6378 #[allow(unused_imports)]
6379 use super::*;
6380
6381 /// An index that stores vectors in a flat data structure, and supports
6382 /// exhaustive search.
6383 #[derive(Clone, Default, PartialEq)]
6384 #[non_exhaustive]
6385 pub struct FlatIndex {
6386 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6387 }
6388
6389 impl FlatIndex {
6390 pub fn new() -> Self {
6391 std::default::Default::default()
6392 }
6393 }
6394
6395 impl wkt::message::Message for FlatIndex {
6396 fn typename() -> &'static str {
6397 "type.googleapis.com/google.firestore.admin.v1.Index.IndexField.VectorConfig.FlatIndex"
6398 }
6399 }
6400
6401 /// The type of index used.
6402 #[derive(Clone, Debug, PartialEq)]
6403 #[non_exhaustive]
6404 pub enum Type {
6405 /// Indicates the vector index is a flat index.
6406 Flat(std::boxed::Box<crate::model::index::index_field::vector_config::FlatIndex>),
6407 }
6408 }
6409
6410 /// The supported orderings.
6411 ///
6412 /// # Working with unknown values
6413 ///
6414 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6415 /// additional enum variants at any time. Adding new variants is not considered
6416 /// a breaking change. Applications should write their code in anticipation of:
6417 ///
6418 /// - New values appearing in future releases of the client library, **and**
6419 /// - New values received dynamically, without application changes.
6420 ///
6421 /// Please consult the [Working with enums] section in the user guide for some
6422 /// guidelines.
6423 ///
6424 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6425 #[derive(Clone, Debug, PartialEq)]
6426 #[non_exhaustive]
6427 pub enum Order {
6428 /// The ordering is unspecified. Not a valid option.
6429 Unspecified,
6430 /// The field is ordered by ascending field value.
6431 Ascending,
6432 /// The field is ordered by descending field value.
6433 Descending,
6434 /// If set, the enum was initialized with an unknown value.
6435 ///
6436 /// Applications can examine the value using [Order::value] or
6437 /// [Order::name].
6438 UnknownValue(order::UnknownValue),
6439 }
6440
6441 #[doc(hidden)]
6442 pub mod order {
6443 #[allow(unused_imports)]
6444 use super::*;
6445 #[derive(Clone, Debug, PartialEq)]
6446 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6447 }
6448
6449 impl Order {
6450 /// Gets the enum value.
6451 ///
6452 /// Returns `None` if the enum contains an unknown value deserialized from
6453 /// the string representation of enums.
6454 pub fn value(&self) -> std::option::Option<i32> {
6455 match self {
6456 Self::Unspecified => std::option::Option::Some(0),
6457 Self::Ascending => std::option::Option::Some(1),
6458 Self::Descending => std::option::Option::Some(2),
6459 Self::UnknownValue(u) => u.0.value(),
6460 }
6461 }
6462
6463 /// Gets the enum value as a string.
6464 ///
6465 /// Returns `None` if the enum contains an unknown value deserialized from
6466 /// the integer representation of enums.
6467 pub fn name(&self) -> std::option::Option<&str> {
6468 match self {
6469 Self::Unspecified => std::option::Option::Some("ORDER_UNSPECIFIED"),
6470 Self::Ascending => std::option::Option::Some("ASCENDING"),
6471 Self::Descending => std::option::Option::Some("DESCENDING"),
6472 Self::UnknownValue(u) => u.0.name(),
6473 }
6474 }
6475 }
6476
6477 impl std::default::Default for Order {
6478 fn default() -> Self {
6479 use std::convert::From;
6480 Self::from(0)
6481 }
6482 }
6483
6484 impl std::fmt::Display for Order {
6485 fn fmt(
6486 &self,
6487 f: &mut std::fmt::Formatter<'_>,
6488 ) -> std::result::Result<(), std::fmt::Error> {
6489 wkt::internal::display_enum(f, self.name(), self.value())
6490 }
6491 }
6492
6493 impl std::convert::From<i32> for Order {
6494 fn from(value: i32) -> Self {
6495 match value {
6496 0 => Self::Unspecified,
6497 1 => Self::Ascending,
6498 2 => Self::Descending,
6499 _ => Self::UnknownValue(order::UnknownValue(
6500 wkt::internal::UnknownEnumValue::Integer(value),
6501 )),
6502 }
6503 }
6504 }
6505
6506 impl std::convert::From<&str> for Order {
6507 fn from(value: &str) -> Self {
6508 use std::string::ToString;
6509 match value {
6510 "ORDER_UNSPECIFIED" => Self::Unspecified,
6511 "ASCENDING" => Self::Ascending,
6512 "DESCENDING" => Self::Descending,
6513 _ => Self::UnknownValue(order::UnknownValue(
6514 wkt::internal::UnknownEnumValue::String(value.to_string()),
6515 )),
6516 }
6517 }
6518 }
6519
6520 impl serde::ser::Serialize for Order {
6521 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6522 where
6523 S: serde::Serializer,
6524 {
6525 match self {
6526 Self::Unspecified => serializer.serialize_i32(0),
6527 Self::Ascending => serializer.serialize_i32(1),
6528 Self::Descending => serializer.serialize_i32(2),
6529 Self::UnknownValue(u) => u.0.serialize(serializer),
6530 }
6531 }
6532 }
6533
6534 impl<'de> serde::de::Deserialize<'de> for Order {
6535 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6536 where
6537 D: serde::Deserializer<'de>,
6538 {
6539 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Order>::new(
6540 ".google.firestore.admin.v1.Index.IndexField.Order",
6541 ))
6542 }
6543 }
6544
6545 /// The supported array value configurations.
6546 ///
6547 /// # Working with unknown values
6548 ///
6549 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6550 /// additional enum variants at any time. Adding new variants is not considered
6551 /// a breaking change. Applications should write their code in anticipation of:
6552 ///
6553 /// - New values appearing in future releases of the client library, **and**
6554 /// - New values received dynamically, without application changes.
6555 ///
6556 /// Please consult the [Working with enums] section in the user guide for some
6557 /// guidelines.
6558 ///
6559 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6560 #[derive(Clone, Debug, PartialEq)]
6561 #[non_exhaustive]
6562 pub enum ArrayConfig {
6563 /// The index does not support additional array queries.
6564 Unspecified,
6565 /// The index supports array containment queries.
6566 Contains,
6567 /// If set, the enum was initialized with an unknown value.
6568 ///
6569 /// Applications can examine the value using [ArrayConfig::value] or
6570 /// [ArrayConfig::name].
6571 UnknownValue(array_config::UnknownValue),
6572 }
6573
6574 #[doc(hidden)]
6575 pub mod array_config {
6576 #[allow(unused_imports)]
6577 use super::*;
6578 #[derive(Clone, Debug, PartialEq)]
6579 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6580 }
6581
6582 impl ArrayConfig {
6583 /// Gets the enum value.
6584 ///
6585 /// Returns `None` if the enum contains an unknown value deserialized from
6586 /// the string representation of enums.
6587 pub fn value(&self) -> std::option::Option<i32> {
6588 match self {
6589 Self::Unspecified => std::option::Option::Some(0),
6590 Self::Contains => std::option::Option::Some(1),
6591 Self::UnknownValue(u) => u.0.value(),
6592 }
6593 }
6594
6595 /// Gets the enum value as a string.
6596 ///
6597 /// Returns `None` if the enum contains an unknown value deserialized from
6598 /// the integer representation of enums.
6599 pub fn name(&self) -> std::option::Option<&str> {
6600 match self {
6601 Self::Unspecified => std::option::Option::Some("ARRAY_CONFIG_UNSPECIFIED"),
6602 Self::Contains => std::option::Option::Some("CONTAINS"),
6603 Self::UnknownValue(u) => u.0.name(),
6604 }
6605 }
6606 }
6607
6608 impl std::default::Default for ArrayConfig {
6609 fn default() -> Self {
6610 use std::convert::From;
6611 Self::from(0)
6612 }
6613 }
6614
6615 impl std::fmt::Display for ArrayConfig {
6616 fn fmt(
6617 &self,
6618 f: &mut std::fmt::Formatter<'_>,
6619 ) -> std::result::Result<(), std::fmt::Error> {
6620 wkt::internal::display_enum(f, self.name(), self.value())
6621 }
6622 }
6623
6624 impl std::convert::From<i32> for ArrayConfig {
6625 fn from(value: i32) -> Self {
6626 match value {
6627 0 => Self::Unspecified,
6628 1 => Self::Contains,
6629 _ => Self::UnknownValue(array_config::UnknownValue(
6630 wkt::internal::UnknownEnumValue::Integer(value),
6631 )),
6632 }
6633 }
6634 }
6635
6636 impl std::convert::From<&str> for ArrayConfig {
6637 fn from(value: &str) -> Self {
6638 use std::string::ToString;
6639 match value {
6640 "ARRAY_CONFIG_UNSPECIFIED" => Self::Unspecified,
6641 "CONTAINS" => Self::Contains,
6642 _ => Self::UnknownValue(array_config::UnknownValue(
6643 wkt::internal::UnknownEnumValue::String(value.to_string()),
6644 )),
6645 }
6646 }
6647 }
6648
6649 impl serde::ser::Serialize for ArrayConfig {
6650 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6651 where
6652 S: serde::Serializer,
6653 {
6654 match self {
6655 Self::Unspecified => serializer.serialize_i32(0),
6656 Self::Contains => serializer.serialize_i32(1),
6657 Self::UnknownValue(u) => u.0.serialize(serializer),
6658 }
6659 }
6660 }
6661
6662 impl<'de> serde::de::Deserialize<'de> for ArrayConfig {
6663 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6664 where
6665 D: serde::Deserializer<'de>,
6666 {
6667 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ArrayConfig>::new(
6668 ".google.firestore.admin.v1.Index.IndexField.ArrayConfig",
6669 ))
6670 }
6671 }
6672
6673 /// How the field value is indexed.
6674 #[derive(Clone, Debug, PartialEq)]
6675 #[non_exhaustive]
6676 pub enum ValueMode {
6677 /// Indicates that this field supports ordering by the specified order or
6678 /// comparing using =, !=, <, <=, >, >=.
6679 Order(crate::model::index::index_field::Order),
6680 /// Indicates that this field supports operations on `array_value`s.
6681 ArrayConfig(crate::model::index::index_field::ArrayConfig),
6682 /// Indicates that this field supports nearest neighbor and distance
6683 /// operations on vector.
6684 VectorConfig(std::boxed::Box<crate::model::index::index_field::VectorConfig>),
6685 }
6686 }
6687
6688 /// Query Scope defines the scope at which a query is run. This is specified on
6689 /// a StructuredQuery's `from` field.
6690 ///
6691 /// # Working with unknown values
6692 ///
6693 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6694 /// additional enum variants at any time. Adding new variants is not considered
6695 /// a breaking change. Applications should write their code in anticipation of:
6696 ///
6697 /// - New values appearing in future releases of the client library, **and**
6698 /// - New values received dynamically, without application changes.
6699 ///
6700 /// Please consult the [Working with enums] section in the user guide for some
6701 /// guidelines.
6702 ///
6703 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6704 #[derive(Clone, Debug, PartialEq)]
6705 #[non_exhaustive]
6706 pub enum QueryScope {
6707 /// The query scope is unspecified. Not a valid option.
6708 Unspecified,
6709 /// Indexes with a collection query scope specified allow queries
6710 /// against a collection that is the child of a specific document, specified
6711 /// at query time, and that has the collection ID specified by the index.
6712 Collection,
6713 /// Indexes with a collection group query scope specified allow queries
6714 /// against all collections that has the collection ID specified by the
6715 /// index.
6716 CollectionGroup,
6717 /// Include all the collections's ancestor in the index. Only available for
6718 /// Datastore Mode databases.
6719 CollectionRecursive,
6720 /// If set, the enum was initialized with an unknown value.
6721 ///
6722 /// Applications can examine the value using [QueryScope::value] or
6723 /// [QueryScope::name].
6724 UnknownValue(query_scope::UnknownValue),
6725 }
6726
6727 #[doc(hidden)]
6728 pub mod query_scope {
6729 #[allow(unused_imports)]
6730 use super::*;
6731 #[derive(Clone, Debug, PartialEq)]
6732 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6733 }
6734
6735 impl QueryScope {
6736 /// Gets the enum value.
6737 ///
6738 /// Returns `None` if the enum contains an unknown value deserialized from
6739 /// the string representation of enums.
6740 pub fn value(&self) -> std::option::Option<i32> {
6741 match self {
6742 Self::Unspecified => std::option::Option::Some(0),
6743 Self::Collection => std::option::Option::Some(1),
6744 Self::CollectionGroup => std::option::Option::Some(2),
6745 Self::CollectionRecursive => std::option::Option::Some(3),
6746 Self::UnknownValue(u) => u.0.value(),
6747 }
6748 }
6749
6750 /// Gets the enum value as a string.
6751 ///
6752 /// Returns `None` if the enum contains an unknown value deserialized from
6753 /// the integer representation of enums.
6754 pub fn name(&self) -> std::option::Option<&str> {
6755 match self {
6756 Self::Unspecified => std::option::Option::Some("QUERY_SCOPE_UNSPECIFIED"),
6757 Self::Collection => std::option::Option::Some("COLLECTION"),
6758 Self::CollectionGroup => std::option::Option::Some("COLLECTION_GROUP"),
6759 Self::CollectionRecursive => std::option::Option::Some("COLLECTION_RECURSIVE"),
6760 Self::UnknownValue(u) => u.0.name(),
6761 }
6762 }
6763 }
6764
6765 impl std::default::Default for QueryScope {
6766 fn default() -> Self {
6767 use std::convert::From;
6768 Self::from(0)
6769 }
6770 }
6771
6772 impl std::fmt::Display for QueryScope {
6773 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6774 wkt::internal::display_enum(f, self.name(), self.value())
6775 }
6776 }
6777
6778 impl std::convert::From<i32> for QueryScope {
6779 fn from(value: i32) -> Self {
6780 match value {
6781 0 => Self::Unspecified,
6782 1 => Self::Collection,
6783 2 => Self::CollectionGroup,
6784 3 => Self::CollectionRecursive,
6785 _ => Self::UnknownValue(query_scope::UnknownValue(
6786 wkt::internal::UnknownEnumValue::Integer(value),
6787 )),
6788 }
6789 }
6790 }
6791
6792 impl std::convert::From<&str> for QueryScope {
6793 fn from(value: &str) -> Self {
6794 use std::string::ToString;
6795 match value {
6796 "QUERY_SCOPE_UNSPECIFIED" => Self::Unspecified,
6797 "COLLECTION" => Self::Collection,
6798 "COLLECTION_GROUP" => Self::CollectionGroup,
6799 "COLLECTION_RECURSIVE" => Self::CollectionRecursive,
6800 _ => Self::UnknownValue(query_scope::UnknownValue(
6801 wkt::internal::UnknownEnumValue::String(value.to_string()),
6802 )),
6803 }
6804 }
6805 }
6806
6807 impl serde::ser::Serialize for QueryScope {
6808 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6809 where
6810 S: serde::Serializer,
6811 {
6812 match self {
6813 Self::Unspecified => serializer.serialize_i32(0),
6814 Self::Collection => serializer.serialize_i32(1),
6815 Self::CollectionGroup => serializer.serialize_i32(2),
6816 Self::CollectionRecursive => serializer.serialize_i32(3),
6817 Self::UnknownValue(u) => u.0.serialize(serializer),
6818 }
6819 }
6820 }
6821
6822 impl<'de> serde::de::Deserialize<'de> for QueryScope {
6823 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6824 where
6825 D: serde::Deserializer<'de>,
6826 {
6827 deserializer.deserialize_any(wkt::internal::EnumVisitor::<QueryScope>::new(
6828 ".google.firestore.admin.v1.Index.QueryScope",
6829 ))
6830 }
6831 }
6832
6833 /// API Scope defines the APIs (Firestore Native, or Firestore in
6834 /// Datastore Mode) that are supported for queries.
6835 ///
6836 /// # Working with unknown values
6837 ///
6838 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6839 /// additional enum variants at any time. Adding new variants is not considered
6840 /// a breaking change. Applications should write their code in anticipation of:
6841 ///
6842 /// - New values appearing in future releases of the client library, **and**
6843 /// - New values received dynamically, without application changes.
6844 ///
6845 /// Please consult the [Working with enums] section in the user guide for some
6846 /// guidelines.
6847 ///
6848 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6849 #[derive(Clone, Debug, PartialEq)]
6850 #[non_exhaustive]
6851 pub enum ApiScope {
6852 /// The index can only be used by the Firestore Native query API.
6853 /// This is the default.
6854 AnyApi,
6855 /// The index can only be used by the Firestore in Datastore Mode query API.
6856 DatastoreModeApi,
6857 /// The index can only be used by the MONGODB_COMPATIBLE_API.
6858 MongodbCompatibleApi,
6859 /// If set, the enum was initialized with an unknown value.
6860 ///
6861 /// Applications can examine the value using [ApiScope::value] or
6862 /// [ApiScope::name].
6863 UnknownValue(api_scope::UnknownValue),
6864 }
6865
6866 #[doc(hidden)]
6867 pub mod api_scope {
6868 #[allow(unused_imports)]
6869 use super::*;
6870 #[derive(Clone, Debug, PartialEq)]
6871 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6872 }
6873
6874 impl ApiScope {
6875 /// Gets the enum value.
6876 ///
6877 /// Returns `None` if the enum contains an unknown value deserialized from
6878 /// the string representation of enums.
6879 pub fn value(&self) -> std::option::Option<i32> {
6880 match self {
6881 Self::AnyApi => std::option::Option::Some(0),
6882 Self::DatastoreModeApi => std::option::Option::Some(1),
6883 Self::MongodbCompatibleApi => std::option::Option::Some(2),
6884 Self::UnknownValue(u) => u.0.value(),
6885 }
6886 }
6887
6888 /// Gets the enum value as a string.
6889 ///
6890 /// Returns `None` if the enum contains an unknown value deserialized from
6891 /// the integer representation of enums.
6892 pub fn name(&self) -> std::option::Option<&str> {
6893 match self {
6894 Self::AnyApi => std::option::Option::Some("ANY_API"),
6895 Self::DatastoreModeApi => std::option::Option::Some("DATASTORE_MODE_API"),
6896 Self::MongodbCompatibleApi => std::option::Option::Some("MONGODB_COMPATIBLE_API"),
6897 Self::UnknownValue(u) => u.0.name(),
6898 }
6899 }
6900 }
6901
6902 impl std::default::Default for ApiScope {
6903 fn default() -> Self {
6904 use std::convert::From;
6905 Self::from(0)
6906 }
6907 }
6908
6909 impl std::fmt::Display for ApiScope {
6910 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6911 wkt::internal::display_enum(f, self.name(), self.value())
6912 }
6913 }
6914
6915 impl std::convert::From<i32> for ApiScope {
6916 fn from(value: i32) -> Self {
6917 match value {
6918 0 => Self::AnyApi,
6919 1 => Self::DatastoreModeApi,
6920 2 => Self::MongodbCompatibleApi,
6921 _ => Self::UnknownValue(api_scope::UnknownValue(
6922 wkt::internal::UnknownEnumValue::Integer(value),
6923 )),
6924 }
6925 }
6926 }
6927
6928 impl std::convert::From<&str> for ApiScope {
6929 fn from(value: &str) -> Self {
6930 use std::string::ToString;
6931 match value {
6932 "ANY_API" => Self::AnyApi,
6933 "DATASTORE_MODE_API" => Self::DatastoreModeApi,
6934 "MONGODB_COMPATIBLE_API" => Self::MongodbCompatibleApi,
6935 _ => Self::UnknownValue(api_scope::UnknownValue(
6936 wkt::internal::UnknownEnumValue::String(value.to_string()),
6937 )),
6938 }
6939 }
6940 }
6941
6942 impl serde::ser::Serialize for ApiScope {
6943 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6944 where
6945 S: serde::Serializer,
6946 {
6947 match self {
6948 Self::AnyApi => serializer.serialize_i32(0),
6949 Self::DatastoreModeApi => serializer.serialize_i32(1),
6950 Self::MongodbCompatibleApi => serializer.serialize_i32(2),
6951 Self::UnknownValue(u) => u.0.serialize(serializer),
6952 }
6953 }
6954 }
6955
6956 impl<'de> serde::de::Deserialize<'de> for ApiScope {
6957 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6958 where
6959 D: serde::Deserializer<'de>,
6960 {
6961 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ApiScope>::new(
6962 ".google.firestore.admin.v1.Index.ApiScope",
6963 ))
6964 }
6965 }
6966
6967 /// The state of an index. During index creation, an index will be in the
6968 /// `CREATING` state. If the index is created successfully, it will transition
6969 /// to the `READY` state. If the index creation encounters a problem, the index
6970 /// will transition to the `NEEDS_REPAIR` state.
6971 ///
6972 /// # Working with unknown values
6973 ///
6974 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6975 /// additional enum variants at any time. Adding new variants is not considered
6976 /// a breaking change. Applications should write their code in anticipation of:
6977 ///
6978 /// - New values appearing in future releases of the client library, **and**
6979 /// - New values received dynamically, without application changes.
6980 ///
6981 /// Please consult the [Working with enums] section in the user guide for some
6982 /// guidelines.
6983 ///
6984 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6985 #[derive(Clone, Debug, PartialEq)]
6986 #[non_exhaustive]
6987 pub enum State {
6988 /// The state is unspecified.
6989 Unspecified,
6990 /// The index is being created.
6991 /// There is an active long-running operation for the index.
6992 /// The index is updated when writing a document.
6993 /// Some index data may exist.
6994 Creating,
6995 /// The index is ready to be used.
6996 /// The index is updated when writing a document.
6997 /// The index is fully populated from all stored documents it applies to.
6998 Ready,
6999 /// The index was being created, but something went wrong.
7000 /// There is no active long-running operation for the index,
7001 /// and the most recently finished long-running operation failed.
7002 /// The index is not updated when writing a document.
7003 /// Some index data may exist.
7004 /// Use the google.longrunning.Operations API to determine why the operation
7005 /// that last attempted to create this index failed, then re-create the
7006 /// index.
7007 NeedsRepair,
7008 /// If set, the enum was initialized with an unknown value.
7009 ///
7010 /// Applications can examine the value using [State::value] or
7011 /// [State::name].
7012 UnknownValue(state::UnknownValue),
7013 }
7014
7015 #[doc(hidden)]
7016 pub mod state {
7017 #[allow(unused_imports)]
7018 use super::*;
7019 #[derive(Clone, Debug, PartialEq)]
7020 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7021 }
7022
7023 impl State {
7024 /// Gets the enum value.
7025 ///
7026 /// Returns `None` if the enum contains an unknown value deserialized from
7027 /// the string representation of enums.
7028 pub fn value(&self) -> std::option::Option<i32> {
7029 match self {
7030 Self::Unspecified => std::option::Option::Some(0),
7031 Self::Creating => std::option::Option::Some(1),
7032 Self::Ready => std::option::Option::Some(2),
7033 Self::NeedsRepair => std::option::Option::Some(3),
7034 Self::UnknownValue(u) => u.0.value(),
7035 }
7036 }
7037
7038 /// Gets the enum value as a string.
7039 ///
7040 /// Returns `None` if the enum contains an unknown value deserialized from
7041 /// the integer representation of enums.
7042 pub fn name(&self) -> std::option::Option<&str> {
7043 match self {
7044 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7045 Self::Creating => std::option::Option::Some("CREATING"),
7046 Self::Ready => std::option::Option::Some("READY"),
7047 Self::NeedsRepair => std::option::Option::Some("NEEDS_REPAIR"),
7048 Self::UnknownValue(u) => u.0.name(),
7049 }
7050 }
7051 }
7052
7053 impl std::default::Default for State {
7054 fn default() -> Self {
7055 use std::convert::From;
7056 Self::from(0)
7057 }
7058 }
7059
7060 impl std::fmt::Display for State {
7061 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7062 wkt::internal::display_enum(f, self.name(), self.value())
7063 }
7064 }
7065
7066 impl std::convert::From<i32> for State {
7067 fn from(value: i32) -> Self {
7068 match value {
7069 0 => Self::Unspecified,
7070 1 => Self::Creating,
7071 2 => Self::Ready,
7072 3 => Self::NeedsRepair,
7073 _ => Self::UnknownValue(state::UnknownValue(
7074 wkt::internal::UnknownEnumValue::Integer(value),
7075 )),
7076 }
7077 }
7078 }
7079
7080 impl std::convert::From<&str> for State {
7081 fn from(value: &str) -> Self {
7082 use std::string::ToString;
7083 match value {
7084 "STATE_UNSPECIFIED" => Self::Unspecified,
7085 "CREATING" => Self::Creating,
7086 "READY" => Self::Ready,
7087 "NEEDS_REPAIR" => Self::NeedsRepair,
7088 _ => Self::UnknownValue(state::UnknownValue(
7089 wkt::internal::UnknownEnumValue::String(value.to_string()),
7090 )),
7091 }
7092 }
7093 }
7094
7095 impl serde::ser::Serialize for State {
7096 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7097 where
7098 S: serde::Serializer,
7099 {
7100 match self {
7101 Self::Unspecified => serializer.serialize_i32(0),
7102 Self::Creating => serializer.serialize_i32(1),
7103 Self::Ready => serializer.serialize_i32(2),
7104 Self::NeedsRepair => serializer.serialize_i32(3),
7105 Self::UnknownValue(u) => u.0.serialize(serializer),
7106 }
7107 }
7108 }
7109
7110 impl<'de> serde::de::Deserialize<'de> for State {
7111 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7112 where
7113 D: serde::Deserializer<'de>,
7114 {
7115 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7116 ".google.firestore.admin.v1.Index.State",
7117 ))
7118 }
7119 }
7120
7121 /// The density configuration for the index.
7122 ///
7123 /// # Working with unknown values
7124 ///
7125 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7126 /// additional enum variants at any time. Adding new variants is not considered
7127 /// a breaking change. Applications should write their code in anticipation of:
7128 ///
7129 /// - New values appearing in future releases of the client library, **and**
7130 /// - New values received dynamically, without application changes.
7131 ///
7132 /// Please consult the [Working with enums] section in the user guide for some
7133 /// guidelines.
7134 ///
7135 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7136 #[derive(Clone, Debug, PartialEq)]
7137 #[non_exhaustive]
7138 pub enum Density {
7139 /// Unspecified. It will use database default setting. This value is input
7140 /// only.
7141 Unspecified,
7142 /// An index entry will only exist if ALL fields are present in the document.
7143 ///
7144 /// This is both the default and only allowed value for Standard Edition
7145 /// databases (for both Cloud Firestore `ANY_API` and Cloud Datastore
7146 /// `DATASTORE_MODE_API`).
7147 ///
7148 /// Take for example the following document:
7149 ///
7150 /// ```norust
7151 /// {
7152 /// "__name__": "...",
7153 /// "a": 1,
7154 /// "b": 2,
7155 /// "c": 3
7156 /// }
7157 /// ```
7158 ///
7159 /// an index on `(a ASC, b ASC, c ASC, __name__ ASC)` will generate an index
7160 /// entry for this document since `a`, 'b', `c`, and `__name__` are all
7161 /// present but an index of `(a ASC, d ASC, __name__ ASC)` will not generate
7162 /// an index entry for this document since `d` is missing.
7163 ///
7164 /// This means that such indexes can only be used to serve a query when the
7165 /// query has either implicit or explicit requirements that all fields from
7166 /// the index are present.
7167 SparseAll,
7168 /// An index entry will exist if ANY field are present in the document.
7169 ///
7170 /// This is used as the definition of a sparse index for Enterprise Edition
7171 /// databases.
7172 ///
7173 /// Take for example the following document:
7174 ///
7175 /// ```norust
7176 /// {
7177 /// "__name__": "...",
7178 /// "a": 1,
7179 /// "b": 2,
7180 /// "c": 3
7181 /// }
7182 /// ```
7183 ///
7184 /// an index on `(a ASC, d ASC)` will generate an index entry for this
7185 /// document since `a` is present, and will fill in an `unset` value for `d`.
7186 /// An index on `(d ASC, e ASC)` will not generate any index entry as neither
7187 /// `d` nor `e` are present.
7188 ///
7189 /// An index that contains `__name__` will generate an index entry for all
7190 /// documents since Firestore guarantees that all documents have a `__name__`
7191 /// field.
7192 SparseAny,
7193 /// An index entry will exist regardless of if the fields are present or not.
7194 ///
7195 /// This is the default density for an Enterprise Edition database.
7196 ///
7197 /// The index will store `unset` values for fields that are not present in
7198 /// the document.
7199 Dense,
7200 /// If set, the enum was initialized with an unknown value.
7201 ///
7202 /// Applications can examine the value using [Density::value] or
7203 /// [Density::name].
7204 UnknownValue(density::UnknownValue),
7205 }
7206
7207 #[doc(hidden)]
7208 pub mod density {
7209 #[allow(unused_imports)]
7210 use super::*;
7211 #[derive(Clone, Debug, PartialEq)]
7212 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7213 }
7214
7215 impl Density {
7216 /// Gets the enum value.
7217 ///
7218 /// Returns `None` if the enum contains an unknown value deserialized from
7219 /// the string representation of enums.
7220 pub fn value(&self) -> std::option::Option<i32> {
7221 match self {
7222 Self::Unspecified => std::option::Option::Some(0),
7223 Self::SparseAll => std::option::Option::Some(1),
7224 Self::SparseAny => std::option::Option::Some(2),
7225 Self::Dense => std::option::Option::Some(3),
7226 Self::UnknownValue(u) => u.0.value(),
7227 }
7228 }
7229
7230 /// Gets the enum value as a string.
7231 ///
7232 /// Returns `None` if the enum contains an unknown value deserialized from
7233 /// the integer representation of enums.
7234 pub fn name(&self) -> std::option::Option<&str> {
7235 match self {
7236 Self::Unspecified => std::option::Option::Some("DENSITY_UNSPECIFIED"),
7237 Self::SparseAll => std::option::Option::Some("SPARSE_ALL"),
7238 Self::SparseAny => std::option::Option::Some("SPARSE_ANY"),
7239 Self::Dense => std::option::Option::Some("DENSE"),
7240 Self::UnknownValue(u) => u.0.name(),
7241 }
7242 }
7243 }
7244
7245 impl std::default::Default for Density {
7246 fn default() -> Self {
7247 use std::convert::From;
7248 Self::from(0)
7249 }
7250 }
7251
7252 impl std::fmt::Display for Density {
7253 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7254 wkt::internal::display_enum(f, self.name(), self.value())
7255 }
7256 }
7257
7258 impl std::convert::From<i32> for Density {
7259 fn from(value: i32) -> Self {
7260 match value {
7261 0 => Self::Unspecified,
7262 1 => Self::SparseAll,
7263 2 => Self::SparseAny,
7264 3 => Self::Dense,
7265 _ => Self::UnknownValue(density::UnknownValue(
7266 wkt::internal::UnknownEnumValue::Integer(value),
7267 )),
7268 }
7269 }
7270 }
7271
7272 impl std::convert::From<&str> for Density {
7273 fn from(value: &str) -> Self {
7274 use std::string::ToString;
7275 match value {
7276 "DENSITY_UNSPECIFIED" => Self::Unspecified,
7277 "SPARSE_ALL" => Self::SparseAll,
7278 "SPARSE_ANY" => Self::SparseAny,
7279 "DENSE" => Self::Dense,
7280 _ => Self::UnknownValue(density::UnknownValue(
7281 wkt::internal::UnknownEnumValue::String(value.to_string()),
7282 )),
7283 }
7284 }
7285 }
7286
7287 impl serde::ser::Serialize for Density {
7288 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7289 where
7290 S: serde::Serializer,
7291 {
7292 match self {
7293 Self::Unspecified => serializer.serialize_i32(0),
7294 Self::SparseAll => serializer.serialize_i32(1),
7295 Self::SparseAny => serializer.serialize_i32(2),
7296 Self::Dense => serializer.serialize_i32(3),
7297 Self::UnknownValue(u) => u.0.serialize(serializer),
7298 }
7299 }
7300 }
7301
7302 impl<'de> serde::de::Deserialize<'de> for Density {
7303 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7304 where
7305 D: serde::Deserializer<'de>,
7306 {
7307 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Density>::new(
7308 ".google.firestore.admin.v1.Index.Density",
7309 ))
7310 }
7311 }
7312}
7313
7314/// The metadata message for
7315/// [google.cloud.location.Location.metadata][google.cloud.location.Location.metadata].
7316///
7317/// [google.cloud.location.Location.metadata]: google_cloud_location::model::Location::metadata
7318#[derive(Clone, Default, PartialEq)]
7319#[non_exhaustive]
7320pub struct LocationMetadata {
7321 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7322}
7323
7324impl LocationMetadata {
7325 pub fn new() -> Self {
7326 std::default::Default::default()
7327 }
7328}
7329
7330impl wkt::message::Message for LocationMetadata {
7331 fn typename() -> &'static str {
7332 "type.googleapis.com/google.firestore.admin.v1.LocationMetadata"
7333 }
7334}
7335
7336/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
7337/// results from
7338/// [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
7339///
7340/// [google.firestore.admin.v1.FirestoreAdmin.CreateIndex]: crate::client::FirestoreAdmin::create_index
7341/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
7342#[derive(Clone, Default, PartialEq)]
7343#[non_exhaustive]
7344pub struct IndexOperationMetadata {
7345 /// The time this operation started.
7346 pub start_time: std::option::Option<wkt::Timestamp>,
7347
7348 /// The time this operation completed. Will be unset if operation still in
7349 /// progress.
7350 pub end_time: std::option::Option<wkt::Timestamp>,
7351
7352 /// The index resource that this operation is acting on. For example:
7353 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
7354 pub index: std::string::String,
7355
7356 /// The state of the operation.
7357 pub state: crate::model::OperationState,
7358
7359 /// The progress, in documents, of this operation.
7360 pub progress_documents: std::option::Option<crate::model::Progress>,
7361
7362 /// The progress, in bytes, of this operation.
7363 pub progress_bytes: std::option::Option<crate::model::Progress>,
7364
7365 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7366}
7367
7368impl IndexOperationMetadata {
7369 pub fn new() -> Self {
7370 std::default::Default::default()
7371 }
7372
7373 /// Sets the value of [start_time][crate::model::IndexOperationMetadata::start_time].
7374 ///
7375 /// # Example
7376 /// ```ignore,no_run
7377 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7378 /// use wkt::Timestamp;
7379 /// let x = IndexOperationMetadata::new().set_start_time(Timestamp::default()/* use setters */);
7380 /// ```
7381 pub fn set_start_time<T>(mut self, v: T) -> Self
7382 where
7383 T: std::convert::Into<wkt::Timestamp>,
7384 {
7385 self.start_time = std::option::Option::Some(v.into());
7386 self
7387 }
7388
7389 /// Sets or clears the value of [start_time][crate::model::IndexOperationMetadata::start_time].
7390 ///
7391 /// # Example
7392 /// ```ignore,no_run
7393 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7394 /// use wkt::Timestamp;
7395 /// let x = IndexOperationMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
7396 /// let x = IndexOperationMetadata::new().set_or_clear_start_time(None::<Timestamp>);
7397 /// ```
7398 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
7399 where
7400 T: std::convert::Into<wkt::Timestamp>,
7401 {
7402 self.start_time = v.map(|x| x.into());
7403 self
7404 }
7405
7406 /// Sets the value of [end_time][crate::model::IndexOperationMetadata::end_time].
7407 ///
7408 /// # Example
7409 /// ```ignore,no_run
7410 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7411 /// use wkt::Timestamp;
7412 /// let x = IndexOperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
7413 /// ```
7414 pub fn set_end_time<T>(mut self, v: T) -> Self
7415 where
7416 T: std::convert::Into<wkt::Timestamp>,
7417 {
7418 self.end_time = std::option::Option::Some(v.into());
7419 self
7420 }
7421
7422 /// Sets or clears the value of [end_time][crate::model::IndexOperationMetadata::end_time].
7423 ///
7424 /// # Example
7425 /// ```ignore,no_run
7426 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7427 /// use wkt::Timestamp;
7428 /// let x = IndexOperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
7429 /// let x = IndexOperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
7430 /// ```
7431 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7432 where
7433 T: std::convert::Into<wkt::Timestamp>,
7434 {
7435 self.end_time = v.map(|x| x.into());
7436 self
7437 }
7438
7439 /// Sets the value of [index][crate::model::IndexOperationMetadata::index].
7440 ///
7441 /// # Example
7442 /// ```ignore,no_run
7443 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7444 /// let x = IndexOperationMetadata::new().set_index("example");
7445 /// ```
7446 pub fn set_index<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7447 self.index = v.into();
7448 self
7449 }
7450
7451 /// Sets the value of [state][crate::model::IndexOperationMetadata::state].
7452 ///
7453 /// # Example
7454 /// ```ignore,no_run
7455 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7456 /// use google_cloud_firestore_admin_v1::model::OperationState;
7457 /// let x0 = IndexOperationMetadata::new().set_state(OperationState::Initializing);
7458 /// let x1 = IndexOperationMetadata::new().set_state(OperationState::Processing);
7459 /// let x2 = IndexOperationMetadata::new().set_state(OperationState::Cancelling);
7460 /// ```
7461 pub fn set_state<T: std::convert::Into<crate::model::OperationState>>(mut self, v: T) -> Self {
7462 self.state = v.into();
7463 self
7464 }
7465
7466 /// Sets the value of [progress_documents][crate::model::IndexOperationMetadata::progress_documents].
7467 ///
7468 /// # Example
7469 /// ```ignore,no_run
7470 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7471 /// use google_cloud_firestore_admin_v1::model::Progress;
7472 /// let x = IndexOperationMetadata::new().set_progress_documents(Progress::default()/* use setters */);
7473 /// ```
7474 pub fn set_progress_documents<T>(mut self, v: T) -> Self
7475 where
7476 T: std::convert::Into<crate::model::Progress>,
7477 {
7478 self.progress_documents = std::option::Option::Some(v.into());
7479 self
7480 }
7481
7482 /// Sets or clears the value of [progress_documents][crate::model::IndexOperationMetadata::progress_documents].
7483 ///
7484 /// # Example
7485 /// ```ignore,no_run
7486 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7487 /// use google_cloud_firestore_admin_v1::model::Progress;
7488 /// let x = IndexOperationMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
7489 /// let x = IndexOperationMetadata::new().set_or_clear_progress_documents(None::<Progress>);
7490 /// ```
7491 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
7492 where
7493 T: std::convert::Into<crate::model::Progress>,
7494 {
7495 self.progress_documents = v.map(|x| x.into());
7496 self
7497 }
7498
7499 /// Sets the value of [progress_bytes][crate::model::IndexOperationMetadata::progress_bytes].
7500 ///
7501 /// # Example
7502 /// ```ignore,no_run
7503 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7504 /// use google_cloud_firestore_admin_v1::model::Progress;
7505 /// let x = IndexOperationMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
7506 /// ```
7507 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
7508 where
7509 T: std::convert::Into<crate::model::Progress>,
7510 {
7511 self.progress_bytes = std::option::Option::Some(v.into());
7512 self
7513 }
7514
7515 /// Sets or clears the value of [progress_bytes][crate::model::IndexOperationMetadata::progress_bytes].
7516 ///
7517 /// # Example
7518 /// ```ignore,no_run
7519 /// # use google_cloud_firestore_admin_v1::model::IndexOperationMetadata;
7520 /// use google_cloud_firestore_admin_v1::model::Progress;
7521 /// let x = IndexOperationMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
7522 /// let x = IndexOperationMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
7523 /// ```
7524 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
7525 where
7526 T: std::convert::Into<crate::model::Progress>,
7527 {
7528 self.progress_bytes = v.map(|x| x.into());
7529 self
7530 }
7531}
7532
7533impl wkt::message::Message for IndexOperationMetadata {
7534 fn typename() -> &'static str {
7535 "type.googleapis.com/google.firestore.admin.v1.IndexOperationMetadata"
7536 }
7537}
7538
7539/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
7540/// results from
7541/// [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField].
7542///
7543/// [google.firestore.admin.v1.FirestoreAdmin.UpdateField]: crate::client::FirestoreAdmin::update_field
7544/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
7545#[derive(Clone, Default, PartialEq)]
7546#[non_exhaustive]
7547pub struct FieldOperationMetadata {
7548 /// The time this operation started.
7549 pub start_time: std::option::Option<wkt::Timestamp>,
7550
7551 /// The time this operation completed. Will be unset if operation still in
7552 /// progress.
7553 pub end_time: std::option::Option<wkt::Timestamp>,
7554
7555 /// The field resource that this operation is acting on. For example:
7556 /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
7557 pub field: std::string::String,
7558
7559 /// A list of
7560 /// [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
7561 /// which describe the intent of this operation.
7562 ///
7563 /// [google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta]: crate::model::field_operation_metadata::IndexConfigDelta
7564 pub index_config_deltas:
7565 std::vec::Vec<crate::model::field_operation_metadata::IndexConfigDelta>,
7566
7567 /// The state of the operation.
7568 pub state: crate::model::OperationState,
7569
7570 /// The progress, in documents, of this operation.
7571 pub progress_documents: std::option::Option<crate::model::Progress>,
7572
7573 /// The progress, in bytes, of this operation.
7574 pub progress_bytes: std::option::Option<crate::model::Progress>,
7575
7576 /// Describes the deltas of TTL configuration.
7577 pub ttl_config_delta:
7578 std::option::Option<crate::model::field_operation_metadata::TtlConfigDelta>,
7579
7580 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7581}
7582
7583impl FieldOperationMetadata {
7584 pub fn new() -> Self {
7585 std::default::Default::default()
7586 }
7587
7588 /// Sets the value of [start_time][crate::model::FieldOperationMetadata::start_time].
7589 ///
7590 /// # Example
7591 /// ```ignore,no_run
7592 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7593 /// use wkt::Timestamp;
7594 /// let x = FieldOperationMetadata::new().set_start_time(Timestamp::default()/* use setters */);
7595 /// ```
7596 pub fn set_start_time<T>(mut self, v: T) -> Self
7597 where
7598 T: std::convert::Into<wkt::Timestamp>,
7599 {
7600 self.start_time = std::option::Option::Some(v.into());
7601 self
7602 }
7603
7604 /// Sets or clears the value of [start_time][crate::model::FieldOperationMetadata::start_time].
7605 ///
7606 /// # Example
7607 /// ```ignore,no_run
7608 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7609 /// use wkt::Timestamp;
7610 /// let x = FieldOperationMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
7611 /// let x = FieldOperationMetadata::new().set_or_clear_start_time(None::<Timestamp>);
7612 /// ```
7613 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
7614 where
7615 T: std::convert::Into<wkt::Timestamp>,
7616 {
7617 self.start_time = v.map(|x| x.into());
7618 self
7619 }
7620
7621 /// Sets the value of [end_time][crate::model::FieldOperationMetadata::end_time].
7622 ///
7623 /// # Example
7624 /// ```ignore,no_run
7625 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7626 /// use wkt::Timestamp;
7627 /// let x = FieldOperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
7628 /// ```
7629 pub fn set_end_time<T>(mut self, v: T) -> Self
7630 where
7631 T: std::convert::Into<wkt::Timestamp>,
7632 {
7633 self.end_time = std::option::Option::Some(v.into());
7634 self
7635 }
7636
7637 /// Sets or clears the value of [end_time][crate::model::FieldOperationMetadata::end_time].
7638 ///
7639 /// # Example
7640 /// ```ignore,no_run
7641 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7642 /// use wkt::Timestamp;
7643 /// let x = FieldOperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
7644 /// let x = FieldOperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
7645 /// ```
7646 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7647 where
7648 T: std::convert::Into<wkt::Timestamp>,
7649 {
7650 self.end_time = v.map(|x| x.into());
7651 self
7652 }
7653
7654 /// Sets the value of [field][crate::model::FieldOperationMetadata::field].
7655 ///
7656 /// # Example
7657 /// ```ignore,no_run
7658 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7659 /// let x = FieldOperationMetadata::new().set_field("example");
7660 /// ```
7661 pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7662 self.field = v.into();
7663 self
7664 }
7665
7666 /// Sets the value of [index_config_deltas][crate::model::FieldOperationMetadata::index_config_deltas].
7667 ///
7668 /// # Example
7669 /// ```ignore,no_run
7670 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7671 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::IndexConfigDelta;
7672 /// let x = FieldOperationMetadata::new()
7673 /// .set_index_config_deltas([
7674 /// IndexConfigDelta::default()/* use setters */,
7675 /// IndexConfigDelta::default()/* use (different) setters */,
7676 /// ]);
7677 /// ```
7678 pub fn set_index_config_deltas<T, V>(mut self, v: T) -> Self
7679 where
7680 T: std::iter::IntoIterator<Item = V>,
7681 V: std::convert::Into<crate::model::field_operation_metadata::IndexConfigDelta>,
7682 {
7683 use std::iter::Iterator;
7684 self.index_config_deltas = v.into_iter().map(|i| i.into()).collect();
7685 self
7686 }
7687
7688 /// Sets the value of [state][crate::model::FieldOperationMetadata::state].
7689 ///
7690 /// # Example
7691 /// ```ignore,no_run
7692 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7693 /// use google_cloud_firestore_admin_v1::model::OperationState;
7694 /// let x0 = FieldOperationMetadata::new().set_state(OperationState::Initializing);
7695 /// let x1 = FieldOperationMetadata::new().set_state(OperationState::Processing);
7696 /// let x2 = FieldOperationMetadata::new().set_state(OperationState::Cancelling);
7697 /// ```
7698 pub fn set_state<T: std::convert::Into<crate::model::OperationState>>(mut self, v: T) -> Self {
7699 self.state = v.into();
7700 self
7701 }
7702
7703 /// Sets the value of [progress_documents][crate::model::FieldOperationMetadata::progress_documents].
7704 ///
7705 /// # Example
7706 /// ```ignore,no_run
7707 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7708 /// use google_cloud_firestore_admin_v1::model::Progress;
7709 /// let x = FieldOperationMetadata::new().set_progress_documents(Progress::default()/* use setters */);
7710 /// ```
7711 pub fn set_progress_documents<T>(mut self, v: T) -> Self
7712 where
7713 T: std::convert::Into<crate::model::Progress>,
7714 {
7715 self.progress_documents = std::option::Option::Some(v.into());
7716 self
7717 }
7718
7719 /// Sets or clears the value of [progress_documents][crate::model::FieldOperationMetadata::progress_documents].
7720 ///
7721 /// # Example
7722 /// ```ignore,no_run
7723 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7724 /// use google_cloud_firestore_admin_v1::model::Progress;
7725 /// let x = FieldOperationMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
7726 /// let x = FieldOperationMetadata::new().set_or_clear_progress_documents(None::<Progress>);
7727 /// ```
7728 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
7729 where
7730 T: std::convert::Into<crate::model::Progress>,
7731 {
7732 self.progress_documents = v.map(|x| x.into());
7733 self
7734 }
7735
7736 /// Sets the value of [progress_bytes][crate::model::FieldOperationMetadata::progress_bytes].
7737 ///
7738 /// # Example
7739 /// ```ignore,no_run
7740 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7741 /// use google_cloud_firestore_admin_v1::model::Progress;
7742 /// let x = FieldOperationMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
7743 /// ```
7744 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
7745 where
7746 T: std::convert::Into<crate::model::Progress>,
7747 {
7748 self.progress_bytes = std::option::Option::Some(v.into());
7749 self
7750 }
7751
7752 /// Sets or clears the value of [progress_bytes][crate::model::FieldOperationMetadata::progress_bytes].
7753 ///
7754 /// # Example
7755 /// ```ignore,no_run
7756 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7757 /// use google_cloud_firestore_admin_v1::model::Progress;
7758 /// let x = FieldOperationMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
7759 /// let x = FieldOperationMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
7760 /// ```
7761 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
7762 where
7763 T: std::convert::Into<crate::model::Progress>,
7764 {
7765 self.progress_bytes = v.map(|x| x.into());
7766 self
7767 }
7768
7769 /// Sets the value of [ttl_config_delta][crate::model::FieldOperationMetadata::ttl_config_delta].
7770 ///
7771 /// # Example
7772 /// ```ignore,no_run
7773 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7774 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::TtlConfigDelta;
7775 /// let x = FieldOperationMetadata::new().set_ttl_config_delta(TtlConfigDelta::default()/* use setters */);
7776 /// ```
7777 pub fn set_ttl_config_delta<T>(mut self, v: T) -> Self
7778 where
7779 T: std::convert::Into<crate::model::field_operation_metadata::TtlConfigDelta>,
7780 {
7781 self.ttl_config_delta = std::option::Option::Some(v.into());
7782 self
7783 }
7784
7785 /// Sets or clears the value of [ttl_config_delta][crate::model::FieldOperationMetadata::ttl_config_delta].
7786 ///
7787 /// # Example
7788 /// ```ignore,no_run
7789 /// # use google_cloud_firestore_admin_v1::model::FieldOperationMetadata;
7790 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::TtlConfigDelta;
7791 /// let x = FieldOperationMetadata::new().set_or_clear_ttl_config_delta(Some(TtlConfigDelta::default()/* use setters */));
7792 /// let x = FieldOperationMetadata::new().set_or_clear_ttl_config_delta(None::<TtlConfigDelta>);
7793 /// ```
7794 pub fn set_or_clear_ttl_config_delta<T>(mut self, v: std::option::Option<T>) -> Self
7795 where
7796 T: std::convert::Into<crate::model::field_operation_metadata::TtlConfigDelta>,
7797 {
7798 self.ttl_config_delta = v.map(|x| x.into());
7799 self
7800 }
7801}
7802
7803impl wkt::message::Message for FieldOperationMetadata {
7804 fn typename() -> &'static str {
7805 "type.googleapis.com/google.firestore.admin.v1.FieldOperationMetadata"
7806 }
7807}
7808
7809/// Defines additional types related to [FieldOperationMetadata].
7810pub mod field_operation_metadata {
7811 #[allow(unused_imports)]
7812 use super::*;
7813
7814 /// Information about an index configuration change.
7815 #[derive(Clone, Default, PartialEq)]
7816 #[non_exhaustive]
7817 pub struct IndexConfigDelta {
7818 /// Specifies how the index is changing.
7819 pub change_type: crate::model::field_operation_metadata::index_config_delta::ChangeType,
7820
7821 /// The index being changed.
7822 pub index: std::option::Option<crate::model::Index>,
7823
7824 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7825 }
7826
7827 impl IndexConfigDelta {
7828 pub fn new() -> Self {
7829 std::default::Default::default()
7830 }
7831
7832 /// Sets the value of [change_type][crate::model::field_operation_metadata::IndexConfigDelta::change_type].
7833 ///
7834 /// # Example
7835 /// ```ignore,no_run
7836 /// # use google_cloud_firestore_admin_v1::model::field_operation_metadata::IndexConfigDelta;
7837 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::index_config_delta::ChangeType;
7838 /// let x0 = IndexConfigDelta::new().set_change_type(ChangeType::Add);
7839 /// let x1 = IndexConfigDelta::new().set_change_type(ChangeType::Remove);
7840 /// ```
7841 pub fn set_change_type<
7842 T: std::convert::Into<
7843 crate::model::field_operation_metadata::index_config_delta::ChangeType,
7844 >,
7845 >(
7846 mut self,
7847 v: T,
7848 ) -> Self {
7849 self.change_type = v.into();
7850 self
7851 }
7852
7853 /// Sets the value of [index][crate::model::field_operation_metadata::IndexConfigDelta::index].
7854 ///
7855 /// # Example
7856 /// ```ignore,no_run
7857 /// # use google_cloud_firestore_admin_v1::model::field_operation_metadata::IndexConfigDelta;
7858 /// use google_cloud_firestore_admin_v1::model::Index;
7859 /// let x = IndexConfigDelta::new().set_index(Index::default()/* use setters */);
7860 /// ```
7861 pub fn set_index<T>(mut self, v: T) -> Self
7862 where
7863 T: std::convert::Into<crate::model::Index>,
7864 {
7865 self.index = std::option::Option::Some(v.into());
7866 self
7867 }
7868
7869 /// Sets or clears the value of [index][crate::model::field_operation_metadata::IndexConfigDelta::index].
7870 ///
7871 /// # Example
7872 /// ```ignore,no_run
7873 /// # use google_cloud_firestore_admin_v1::model::field_operation_metadata::IndexConfigDelta;
7874 /// use google_cloud_firestore_admin_v1::model::Index;
7875 /// let x = IndexConfigDelta::new().set_or_clear_index(Some(Index::default()/* use setters */));
7876 /// let x = IndexConfigDelta::new().set_or_clear_index(None::<Index>);
7877 /// ```
7878 pub fn set_or_clear_index<T>(mut self, v: std::option::Option<T>) -> Self
7879 where
7880 T: std::convert::Into<crate::model::Index>,
7881 {
7882 self.index = v.map(|x| x.into());
7883 self
7884 }
7885 }
7886
7887 impl wkt::message::Message for IndexConfigDelta {
7888 fn typename() -> &'static str {
7889 "type.googleapis.com/google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta"
7890 }
7891 }
7892
7893 /// Defines additional types related to [IndexConfigDelta].
7894 pub mod index_config_delta {
7895 #[allow(unused_imports)]
7896 use super::*;
7897
7898 /// Specifies how the index is changing.
7899 ///
7900 /// # Working with unknown values
7901 ///
7902 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7903 /// additional enum variants at any time. Adding new variants is not considered
7904 /// a breaking change. Applications should write their code in anticipation of:
7905 ///
7906 /// - New values appearing in future releases of the client library, **and**
7907 /// - New values received dynamically, without application changes.
7908 ///
7909 /// Please consult the [Working with enums] section in the user guide for some
7910 /// guidelines.
7911 ///
7912 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7913 #[derive(Clone, Debug, PartialEq)]
7914 #[non_exhaustive]
7915 pub enum ChangeType {
7916 /// The type of change is not specified or known.
7917 Unspecified,
7918 /// The single field index is being added.
7919 Add,
7920 /// The single field index is being removed.
7921 Remove,
7922 /// If set, the enum was initialized with an unknown value.
7923 ///
7924 /// Applications can examine the value using [ChangeType::value] or
7925 /// [ChangeType::name].
7926 UnknownValue(change_type::UnknownValue),
7927 }
7928
7929 #[doc(hidden)]
7930 pub mod change_type {
7931 #[allow(unused_imports)]
7932 use super::*;
7933 #[derive(Clone, Debug, PartialEq)]
7934 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7935 }
7936
7937 impl ChangeType {
7938 /// Gets the enum value.
7939 ///
7940 /// Returns `None` if the enum contains an unknown value deserialized from
7941 /// the string representation of enums.
7942 pub fn value(&self) -> std::option::Option<i32> {
7943 match self {
7944 Self::Unspecified => std::option::Option::Some(0),
7945 Self::Add => std::option::Option::Some(1),
7946 Self::Remove => std::option::Option::Some(2),
7947 Self::UnknownValue(u) => u.0.value(),
7948 }
7949 }
7950
7951 /// Gets the enum value as a string.
7952 ///
7953 /// Returns `None` if the enum contains an unknown value deserialized from
7954 /// the integer representation of enums.
7955 pub fn name(&self) -> std::option::Option<&str> {
7956 match self {
7957 Self::Unspecified => std::option::Option::Some("CHANGE_TYPE_UNSPECIFIED"),
7958 Self::Add => std::option::Option::Some("ADD"),
7959 Self::Remove => std::option::Option::Some("REMOVE"),
7960 Self::UnknownValue(u) => u.0.name(),
7961 }
7962 }
7963 }
7964
7965 impl std::default::Default for ChangeType {
7966 fn default() -> Self {
7967 use std::convert::From;
7968 Self::from(0)
7969 }
7970 }
7971
7972 impl std::fmt::Display for ChangeType {
7973 fn fmt(
7974 &self,
7975 f: &mut std::fmt::Formatter<'_>,
7976 ) -> std::result::Result<(), std::fmt::Error> {
7977 wkt::internal::display_enum(f, self.name(), self.value())
7978 }
7979 }
7980
7981 impl std::convert::From<i32> for ChangeType {
7982 fn from(value: i32) -> Self {
7983 match value {
7984 0 => Self::Unspecified,
7985 1 => Self::Add,
7986 2 => Self::Remove,
7987 _ => Self::UnknownValue(change_type::UnknownValue(
7988 wkt::internal::UnknownEnumValue::Integer(value),
7989 )),
7990 }
7991 }
7992 }
7993
7994 impl std::convert::From<&str> for ChangeType {
7995 fn from(value: &str) -> Self {
7996 use std::string::ToString;
7997 match value {
7998 "CHANGE_TYPE_UNSPECIFIED" => Self::Unspecified,
7999 "ADD" => Self::Add,
8000 "REMOVE" => Self::Remove,
8001 _ => Self::UnknownValue(change_type::UnknownValue(
8002 wkt::internal::UnknownEnumValue::String(value.to_string()),
8003 )),
8004 }
8005 }
8006 }
8007
8008 impl serde::ser::Serialize for ChangeType {
8009 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8010 where
8011 S: serde::Serializer,
8012 {
8013 match self {
8014 Self::Unspecified => serializer.serialize_i32(0),
8015 Self::Add => serializer.serialize_i32(1),
8016 Self::Remove => serializer.serialize_i32(2),
8017 Self::UnknownValue(u) => u.0.serialize(serializer),
8018 }
8019 }
8020 }
8021
8022 impl<'de> serde::de::Deserialize<'de> for ChangeType {
8023 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8024 where
8025 D: serde::Deserializer<'de>,
8026 {
8027 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ChangeType>::new(
8028 ".google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType",
8029 ))
8030 }
8031 }
8032 }
8033
8034 /// Information about a TTL configuration change.
8035 #[derive(Clone, Default, PartialEq)]
8036 #[non_exhaustive]
8037 pub struct TtlConfigDelta {
8038 /// Specifies how the TTL configuration is changing.
8039 pub change_type: crate::model::field_operation_metadata::ttl_config_delta::ChangeType,
8040
8041 /// The offset, relative to the timestamp value in the TTL-enabled field,
8042 /// used determine the document's expiration time.
8043 pub expiration_offset: std::option::Option<wkt::Duration>,
8044
8045 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8046 }
8047
8048 impl TtlConfigDelta {
8049 pub fn new() -> Self {
8050 std::default::Default::default()
8051 }
8052
8053 /// Sets the value of [change_type][crate::model::field_operation_metadata::TtlConfigDelta::change_type].
8054 ///
8055 /// # Example
8056 /// ```ignore,no_run
8057 /// # use google_cloud_firestore_admin_v1::model::field_operation_metadata::TtlConfigDelta;
8058 /// use google_cloud_firestore_admin_v1::model::field_operation_metadata::ttl_config_delta::ChangeType;
8059 /// let x0 = TtlConfigDelta::new().set_change_type(ChangeType::Add);
8060 /// let x1 = TtlConfigDelta::new().set_change_type(ChangeType::Remove);
8061 /// ```
8062 pub fn set_change_type<
8063 T: std::convert::Into<
8064 crate::model::field_operation_metadata::ttl_config_delta::ChangeType,
8065 >,
8066 >(
8067 mut self,
8068 v: T,
8069 ) -> Self {
8070 self.change_type = v.into();
8071 self
8072 }
8073
8074 /// Sets the value of [expiration_offset][crate::model::field_operation_metadata::TtlConfigDelta::expiration_offset].
8075 ///
8076 /// # Example
8077 /// ```ignore,no_run
8078 /// # use google_cloud_firestore_admin_v1::model::field_operation_metadata::TtlConfigDelta;
8079 /// use wkt::Duration;
8080 /// let x = TtlConfigDelta::new().set_expiration_offset(Duration::default()/* use setters */);
8081 /// ```
8082 pub fn set_expiration_offset<T>(mut self, v: T) -> Self
8083 where
8084 T: std::convert::Into<wkt::Duration>,
8085 {
8086 self.expiration_offset = std::option::Option::Some(v.into());
8087 self
8088 }
8089
8090 /// Sets or clears the value of [expiration_offset][crate::model::field_operation_metadata::TtlConfigDelta::expiration_offset].
8091 ///
8092 /// # Example
8093 /// ```ignore,no_run
8094 /// # use google_cloud_firestore_admin_v1::model::field_operation_metadata::TtlConfigDelta;
8095 /// use wkt::Duration;
8096 /// let x = TtlConfigDelta::new().set_or_clear_expiration_offset(Some(Duration::default()/* use setters */));
8097 /// let x = TtlConfigDelta::new().set_or_clear_expiration_offset(None::<Duration>);
8098 /// ```
8099 pub fn set_or_clear_expiration_offset<T>(mut self, v: std::option::Option<T>) -> Self
8100 where
8101 T: std::convert::Into<wkt::Duration>,
8102 {
8103 self.expiration_offset = v.map(|x| x.into());
8104 self
8105 }
8106 }
8107
8108 impl wkt::message::Message for TtlConfigDelta {
8109 fn typename() -> &'static str {
8110 "type.googleapis.com/google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta"
8111 }
8112 }
8113
8114 /// Defines additional types related to [TtlConfigDelta].
8115 pub mod ttl_config_delta {
8116 #[allow(unused_imports)]
8117 use super::*;
8118
8119 /// Specifies how the TTL config is changing.
8120 ///
8121 /// # Working with unknown values
8122 ///
8123 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8124 /// additional enum variants at any time. Adding new variants is not considered
8125 /// a breaking change. Applications should write their code in anticipation of:
8126 ///
8127 /// - New values appearing in future releases of the client library, **and**
8128 /// - New values received dynamically, without application changes.
8129 ///
8130 /// Please consult the [Working with enums] section in the user guide for some
8131 /// guidelines.
8132 ///
8133 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8134 #[derive(Clone, Debug, PartialEq)]
8135 #[non_exhaustive]
8136 pub enum ChangeType {
8137 /// The type of change is not specified or known.
8138 Unspecified,
8139 /// The TTL config is being added.
8140 Add,
8141 /// The TTL config is being removed.
8142 Remove,
8143 /// If set, the enum was initialized with an unknown value.
8144 ///
8145 /// Applications can examine the value using [ChangeType::value] or
8146 /// [ChangeType::name].
8147 UnknownValue(change_type::UnknownValue),
8148 }
8149
8150 #[doc(hidden)]
8151 pub mod change_type {
8152 #[allow(unused_imports)]
8153 use super::*;
8154 #[derive(Clone, Debug, PartialEq)]
8155 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8156 }
8157
8158 impl ChangeType {
8159 /// Gets the enum value.
8160 ///
8161 /// Returns `None` if the enum contains an unknown value deserialized from
8162 /// the string representation of enums.
8163 pub fn value(&self) -> std::option::Option<i32> {
8164 match self {
8165 Self::Unspecified => std::option::Option::Some(0),
8166 Self::Add => std::option::Option::Some(1),
8167 Self::Remove => std::option::Option::Some(2),
8168 Self::UnknownValue(u) => u.0.value(),
8169 }
8170 }
8171
8172 /// Gets the enum value as a string.
8173 ///
8174 /// Returns `None` if the enum contains an unknown value deserialized from
8175 /// the integer representation of enums.
8176 pub fn name(&self) -> std::option::Option<&str> {
8177 match self {
8178 Self::Unspecified => std::option::Option::Some("CHANGE_TYPE_UNSPECIFIED"),
8179 Self::Add => std::option::Option::Some("ADD"),
8180 Self::Remove => std::option::Option::Some("REMOVE"),
8181 Self::UnknownValue(u) => u.0.name(),
8182 }
8183 }
8184 }
8185
8186 impl std::default::Default for ChangeType {
8187 fn default() -> Self {
8188 use std::convert::From;
8189 Self::from(0)
8190 }
8191 }
8192
8193 impl std::fmt::Display for ChangeType {
8194 fn fmt(
8195 &self,
8196 f: &mut std::fmt::Formatter<'_>,
8197 ) -> std::result::Result<(), std::fmt::Error> {
8198 wkt::internal::display_enum(f, self.name(), self.value())
8199 }
8200 }
8201
8202 impl std::convert::From<i32> for ChangeType {
8203 fn from(value: i32) -> Self {
8204 match value {
8205 0 => Self::Unspecified,
8206 1 => Self::Add,
8207 2 => Self::Remove,
8208 _ => Self::UnknownValue(change_type::UnknownValue(
8209 wkt::internal::UnknownEnumValue::Integer(value),
8210 )),
8211 }
8212 }
8213 }
8214
8215 impl std::convert::From<&str> for ChangeType {
8216 fn from(value: &str) -> Self {
8217 use std::string::ToString;
8218 match value {
8219 "CHANGE_TYPE_UNSPECIFIED" => Self::Unspecified,
8220 "ADD" => Self::Add,
8221 "REMOVE" => Self::Remove,
8222 _ => Self::UnknownValue(change_type::UnknownValue(
8223 wkt::internal::UnknownEnumValue::String(value.to_string()),
8224 )),
8225 }
8226 }
8227 }
8228
8229 impl serde::ser::Serialize for ChangeType {
8230 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8231 where
8232 S: serde::Serializer,
8233 {
8234 match self {
8235 Self::Unspecified => serializer.serialize_i32(0),
8236 Self::Add => serializer.serialize_i32(1),
8237 Self::Remove => serializer.serialize_i32(2),
8238 Self::UnknownValue(u) => u.0.serialize(serializer),
8239 }
8240 }
8241 }
8242
8243 impl<'de> serde::de::Deserialize<'de> for ChangeType {
8244 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8245 where
8246 D: serde::Deserializer<'de>,
8247 {
8248 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ChangeType>::new(
8249 ".google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType",
8250 ))
8251 }
8252 }
8253 }
8254}
8255
8256/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
8257/// results from
8258/// [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments].
8259///
8260/// [google.firestore.admin.v1.FirestoreAdmin.ExportDocuments]: crate::client::FirestoreAdmin::export_documents
8261/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8262#[derive(Clone, Default, PartialEq)]
8263#[non_exhaustive]
8264pub struct ExportDocumentsMetadata {
8265 /// The time this operation started.
8266 pub start_time: std::option::Option<wkt::Timestamp>,
8267
8268 /// The time this operation completed. Will be unset if operation still in
8269 /// progress.
8270 pub end_time: std::option::Option<wkt::Timestamp>,
8271
8272 /// The state of the export operation.
8273 pub operation_state: crate::model::OperationState,
8274
8275 /// The progress, in documents, of this operation.
8276 pub progress_documents: std::option::Option<crate::model::Progress>,
8277
8278 /// The progress, in bytes, of this operation.
8279 pub progress_bytes: std::option::Option<crate::model::Progress>,
8280
8281 /// Which collection IDs are being exported.
8282 pub collection_ids: std::vec::Vec<std::string::String>,
8283
8284 /// Where the documents are being exported to.
8285 pub output_uri_prefix: std::string::String,
8286
8287 /// Which namespace IDs are being exported.
8288 pub namespace_ids: std::vec::Vec<std::string::String>,
8289
8290 /// The timestamp that corresponds to the version of the database that is being
8291 /// exported. If unspecified, there are no guarantees about the consistency of
8292 /// the documents being exported.
8293 pub snapshot_time: std::option::Option<wkt::Timestamp>,
8294
8295 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8296}
8297
8298impl ExportDocumentsMetadata {
8299 pub fn new() -> Self {
8300 std::default::Default::default()
8301 }
8302
8303 /// Sets the value of [start_time][crate::model::ExportDocumentsMetadata::start_time].
8304 ///
8305 /// # Example
8306 /// ```ignore,no_run
8307 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8308 /// use wkt::Timestamp;
8309 /// let x = ExportDocumentsMetadata::new().set_start_time(Timestamp::default()/* use setters */);
8310 /// ```
8311 pub fn set_start_time<T>(mut self, v: T) -> Self
8312 where
8313 T: std::convert::Into<wkt::Timestamp>,
8314 {
8315 self.start_time = std::option::Option::Some(v.into());
8316 self
8317 }
8318
8319 /// Sets or clears the value of [start_time][crate::model::ExportDocumentsMetadata::start_time].
8320 ///
8321 /// # Example
8322 /// ```ignore,no_run
8323 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8324 /// use wkt::Timestamp;
8325 /// let x = ExportDocumentsMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
8326 /// let x = ExportDocumentsMetadata::new().set_or_clear_start_time(None::<Timestamp>);
8327 /// ```
8328 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8329 where
8330 T: std::convert::Into<wkt::Timestamp>,
8331 {
8332 self.start_time = v.map(|x| x.into());
8333 self
8334 }
8335
8336 /// Sets the value of [end_time][crate::model::ExportDocumentsMetadata::end_time].
8337 ///
8338 /// # Example
8339 /// ```ignore,no_run
8340 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8341 /// use wkt::Timestamp;
8342 /// let x = ExportDocumentsMetadata::new().set_end_time(Timestamp::default()/* use setters */);
8343 /// ```
8344 pub fn set_end_time<T>(mut self, v: T) -> Self
8345 where
8346 T: std::convert::Into<wkt::Timestamp>,
8347 {
8348 self.end_time = std::option::Option::Some(v.into());
8349 self
8350 }
8351
8352 /// Sets or clears the value of [end_time][crate::model::ExportDocumentsMetadata::end_time].
8353 ///
8354 /// # Example
8355 /// ```ignore,no_run
8356 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8357 /// use wkt::Timestamp;
8358 /// let x = ExportDocumentsMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8359 /// let x = ExportDocumentsMetadata::new().set_or_clear_end_time(None::<Timestamp>);
8360 /// ```
8361 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8362 where
8363 T: std::convert::Into<wkt::Timestamp>,
8364 {
8365 self.end_time = v.map(|x| x.into());
8366 self
8367 }
8368
8369 /// Sets the value of [operation_state][crate::model::ExportDocumentsMetadata::operation_state].
8370 ///
8371 /// # Example
8372 /// ```ignore,no_run
8373 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8374 /// use google_cloud_firestore_admin_v1::model::OperationState;
8375 /// let x0 = ExportDocumentsMetadata::new().set_operation_state(OperationState::Initializing);
8376 /// let x1 = ExportDocumentsMetadata::new().set_operation_state(OperationState::Processing);
8377 /// let x2 = ExportDocumentsMetadata::new().set_operation_state(OperationState::Cancelling);
8378 /// ```
8379 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
8380 mut self,
8381 v: T,
8382 ) -> Self {
8383 self.operation_state = v.into();
8384 self
8385 }
8386
8387 /// Sets the value of [progress_documents][crate::model::ExportDocumentsMetadata::progress_documents].
8388 ///
8389 /// # Example
8390 /// ```ignore,no_run
8391 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8392 /// use google_cloud_firestore_admin_v1::model::Progress;
8393 /// let x = ExportDocumentsMetadata::new().set_progress_documents(Progress::default()/* use setters */);
8394 /// ```
8395 pub fn set_progress_documents<T>(mut self, v: T) -> Self
8396 where
8397 T: std::convert::Into<crate::model::Progress>,
8398 {
8399 self.progress_documents = std::option::Option::Some(v.into());
8400 self
8401 }
8402
8403 /// Sets or clears the value of [progress_documents][crate::model::ExportDocumentsMetadata::progress_documents].
8404 ///
8405 /// # Example
8406 /// ```ignore,no_run
8407 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8408 /// use google_cloud_firestore_admin_v1::model::Progress;
8409 /// let x = ExportDocumentsMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
8410 /// let x = ExportDocumentsMetadata::new().set_or_clear_progress_documents(None::<Progress>);
8411 /// ```
8412 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
8413 where
8414 T: std::convert::Into<crate::model::Progress>,
8415 {
8416 self.progress_documents = v.map(|x| x.into());
8417 self
8418 }
8419
8420 /// Sets the value of [progress_bytes][crate::model::ExportDocumentsMetadata::progress_bytes].
8421 ///
8422 /// # Example
8423 /// ```ignore,no_run
8424 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8425 /// use google_cloud_firestore_admin_v1::model::Progress;
8426 /// let x = ExportDocumentsMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
8427 /// ```
8428 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
8429 where
8430 T: std::convert::Into<crate::model::Progress>,
8431 {
8432 self.progress_bytes = std::option::Option::Some(v.into());
8433 self
8434 }
8435
8436 /// Sets or clears the value of [progress_bytes][crate::model::ExportDocumentsMetadata::progress_bytes].
8437 ///
8438 /// # Example
8439 /// ```ignore,no_run
8440 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8441 /// use google_cloud_firestore_admin_v1::model::Progress;
8442 /// let x = ExportDocumentsMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
8443 /// let x = ExportDocumentsMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
8444 /// ```
8445 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8446 where
8447 T: std::convert::Into<crate::model::Progress>,
8448 {
8449 self.progress_bytes = v.map(|x| x.into());
8450 self
8451 }
8452
8453 /// Sets the value of [collection_ids][crate::model::ExportDocumentsMetadata::collection_ids].
8454 ///
8455 /// # Example
8456 /// ```ignore,no_run
8457 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8458 /// let x = ExportDocumentsMetadata::new().set_collection_ids(["a", "b", "c"]);
8459 /// ```
8460 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
8461 where
8462 T: std::iter::IntoIterator<Item = V>,
8463 V: std::convert::Into<std::string::String>,
8464 {
8465 use std::iter::Iterator;
8466 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
8467 self
8468 }
8469
8470 /// Sets the value of [output_uri_prefix][crate::model::ExportDocumentsMetadata::output_uri_prefix].
8471 ///
8472 /// # Example
8473 /// ```ignore,no_run
8474 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8475 /// let x = ExportDocumentsMetadata::new().set_output_uri_prefix("example");
8476 /// ```
8477 pub fn set_output_uri_prefix<T: std::convert::Into<std::string::String>>(
8478 mut self,
8479 v: T,
8480 ) -> Self {
8481 self.output_uri_prefix = v.into();
8482 self
8483 }
8484
8485 /// Sets the value of [namespace_ids][crate::model::ExportDocumentsMetadata::namespace_ids].
8486 ///
8487 /// # Example
8488 /// ```ignore,no_run
8489 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8490 /// let x = ExportDocumentsMetadata::new().set_namespace_ids(["a", "b", "c"]);
8491 /// ```
8492 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
8493 where
8494 T: std::iter::IntoIterator<Item = V>,
8495 V: std::convert::Into<std::string::String>,
8496 {
8497 use std::iter::Iterator;
8498 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
8499 self
8500 }
8501
8502 /// Sets the value of [snapshot_time][crate::model::ExportDocumentsMetadata::snapshot_time].
8503 ///
8504 /// # Example
8505 /// ```ignore,no_run
8506 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8507 /// use wkt::Timestamp;
8508 /// let x = ExportDocumentsMetadata::new().set_snapshot_time(Timestamp::default()/* use setters */);
8509 /// ```
8510 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
8511 where
8512 T: std::convert::Into<wkt::Timestamp>,
8513 {
8514 self.snapshot_time = std::option::Option::Some(v.into());
8515 self
8516 }
8517
8518 /// Sets or clears the value of [snapshot_time][crate::model::ExportDocumentsMetadata::snapshot_time].
8519 ///
8520 /// # Example
8521 /// ```ignore,no_run
8522 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsMetadata;
8523 /// use wkt::Timestamp;
8524 /// let x = ExportDocumentsMetadata::new().set_or_clear_snapshot_time(Some(Timestamp::default()/* use setters */));
8525 /// let x = ExportDocumentsMetadata::new().set_or_clear_snapshot_time(None::<Timestamp>);
8526 /// ```
8527 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
8528 where
8529 T: std::convert::Into<wkt::Timestamp>,
8530 {
8531 self.snapshot_time = v.map(|x| x.into());
8532 self
8533 }
8534}
8535
8536impl wkt::message::Message for ExportDocumentsMetadata {
8537 fn typename() -> &'static str {
8538 "type.googleapis.com/google.firestore.admin.v1.ExportDocumentsMetadata"
8539 }
8540}
8541
8542/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
8543/// results from
8544/// [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments].
8545///
8546/// [google.firestore.admin.v1.FirestoreAdmin.ImportDocuments]: crate::client::FirestoreAdmin::import_documents
8547/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8548#[derive(Clone, Default, PartialEq)]
8549#[non_exhaustive]
8550pub struct ImportDocumentsMetadata {
8551 /// The time this operation started.
8552 pub start_time: std::option::Option<wkt::Timestamp>,
8553
8554 /// The time this operation completed. Will be unset if operation still in
8555 /// progress.
8556 pub end_time: std::option::Option<wkt::Timestamp>,
8557
8558 /// The state of the import operation.
8559 pub operation_state: crate::model::OperationState,
8560
8561 /// The progress, in documents, of this operation.
8562 pub progress_documents: std::option::Option<crate::model::Progress>,
8563
8564 /// The progress, in bytes, of this operation.
8565 pub progress_bytes: std::option::Option<crate::model::Progress>,
8566
8567 /// Which collection IDs are being imported.
8568 pub collection_ids: std::vec::Vec<std::string::String>,
8569
8570 /// The location of the documents being imported.
8571 pub input_uri_prefix: std::string::String,
8572
8573 /// Which namespace IDs are being imported.
8574 pub namespace_ids: std::vec::Vec<std::string::String>,
8575
8576 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8577}
8578
8579impl ImportDocumentsMetadata {
8580 pub fn new() -> Self {
8581 std::default::Default::default()
8582 }
8583
8584 /// Sets the value of [start_time][crate::model::ImportDocumentsMetadata::start_time].
8585 ///
8586 /// # Example
8587 /// ```ignore,no_run
8588 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8589 /// use wkt::Timestamp;
8590 /// let x = ImportDocumentsMetadata::new().set_start_time(Timestamp::default()/* use setters */);
8591 /// ```
8592 pub fn set_start_time<T>(mut self, v: T) -> Self
8593 where
8594 T: std::convert::Into<wkt::Timestamp>,
8595 {
8596 self.start_time = std::option::Option::Some(v.into());
8597 self
8598 }
8599
8600 /// Sets or clears the value of [start_time][crate::model::ImportDocumentsMetadata::start_time].
8601 ///
8602 /// # Example
8603 /// ```ignore,no_run
8604 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8605 /// use wkt::Timestamp;
8606 /// let x = ImportDocumentsMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
8607 /// let x = ImportDocumentsMetadata::new().set_or_clear_start_time(None::<Timestamp>);
8608 /// ```
8609 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8610 where
8611 T: std::convert::Into<wkt::Timestamp>,
8612 {
8613 self.start_time = v.map(|x| x.into());
8614 self
8615 }
8616
8617 /// Sets the value of [end_time][crate::model::ImportDocumentsMetadata::end_time].
8618 ///
8619 /// # Example
8620 /// ```ignore,no_run
8621 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8622 /// use wkt::Timestamp;
8623 /// let x = ImportDocumentsMetadata::new().set_end_time(Timestamp::default()/* use setters */);
8624 /// ```
8625 pub fn set_end_time<T>(mut self, v: T) -> Self
8626 where
8627 T: std::convert::Into<wkt::Timestamp>,
8628 {
8629 self.end_time = std::option::Option::Some(v.into());
8630 self
8631 }
8632
8633 /// Sets or clears the value of [end_time][crate::model::ImportDocumentsMetadata::end_time].
8634 ///
8635 /// # Example
8636 /// ```ignore,no_run
8637 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8638 /// use wkt::Timestamp;
8639 /// let x = ImportDocumentsMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8640 /// let x = ImportDocumentsMetadata::new().set_or_clear_end_time(None::<Timestamp>);
8641 /// ```
8642 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8643 where
8644 T: std::convert::Into<wkt::Timestamp>,
8645 {
8646 self.end_time = v.map(|x| x.into());
8647 self
8648 }
8649
8650 /// Sets the value of [operation_state][crate::model::ImportDocumentsMetadata::operation_state].
8651 ///
8652 /// # Example
8653 /// ```ignore,no_run
8654 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8655 /// use google_cloud_firestore_admin_v1::model::OperationState;
8656 /// let x0 = ImportDocumentsMetadata::new().set_operation_state(OperationState::Initializing);
8657 /// let x1 = ImportDocumentsMetadata::new().set_operation_state(OperationState::Processing);
8658 /// let x2 = ImportDocumentsMetadata::new().set_operation_state(OperationState::Cancelling);
8659 /// ```
8660 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
8661 mut self,
8662 v: T,
8663 ) -> Self {
8664 self.operation_state = v.into();
8665 self
8666 }
8667
8668 /// Sets the value of [progress_documents][crate::model::ImportDocumentsMetadata::progress_documents].
8669 ///
8670 /// # Example
8671 /// ```ignore,no_run
8672 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8673 /// use google_cloud_firestore_admin_v1::model::Progress;
8674 /// let x = ImportDocumentsMetadata::new().set_progress_documents(Progress::default()/* use setters */);
8675 /// ```
8676 pub fn set_progress_documents<T>(mut self, v: T) -> Self
8677 where
8678 T: std::convert::Into<crate::model::Progress>,
8679 {
8680 self.progress_documents = std::option::Option::Some(v.into());
8681 self
8682 }
8683
8684 /// Sets or clears the value of [progress_documents][crate::model::ImportDocumentsMetadata::progress_documents].
8685 ///
8686 /// # Example
8687 /// ```ignore,no_run
8688 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8689 /// use google_cloud_firestore_admin_v1::model::Progress;
8690 /// let x = ImportDocumentsMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
8691 /// let x = ImportDocumentsMetadata::new().set_or_clear_progress_documents(None::<Progress>);
8692 /// ```
8693 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
8694 where
8695 T: std::convert::Into<crate::model::Progress>,
8696 {
8697 self.progress_documents = v.map(|x| x.into());
8698 self
8699 }
8700
8701 /// Sets the value of [progress_bytes][crate::model::ImportDocumentsMetadata::progress_bytes].
8702 ///
8703 /// # Example
8704 /// ```ignore,no_run
8705 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8706 /// use google_cloud_firestore_admin_v1::model::Progress;
8707 /// let x = ImportDocumentsMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
8708 /// ```
8709 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
8710 where
8711 T: std::convert::Into<crate::model::Progress>,
8712 {
8713 self.progress_bytes = std::option::Option::Some(v.into());
8714 self
8715 }
8716
8717 /// Sets or clears the value of [progress_bytes][crate::model::ImportDocumentsMetadata::progress_bytes].
8718 ///
8719 /// # Example
8720 /// ```ignore,no_run
8721 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8722 /// use google_cloud_firestore_admin_v1::model::Progress;
8723 /// let x = ImportDocumentsMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
8724 /// let x = ImportDocumentsMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
8725 /// ```
8726 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8727 where
8728 T: std::convert::Into<crate::model::Progress>,
8729 {
8730 self.progress_bytes = v.map(|x| x.into());
8731 self
8732 }
8733
8734 /// Sets the value of [collection_ids][crate::model::ImportDocumentsMetadata::collection_ids].
8735 ///
8736 /// # Example
8737 /// ```ignore,no_run
8738 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8739 /// let x = ImportDocumentsMetadata::new().set_collection_ids(["a", "b", "c"]);
8740 /// ```
8741 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
8742 where
8743 T: std::iter::IntoIterator<Item = V>,
8744 V: std::convert::Into<std::string::String>,
8745 {
8746 use std::iter::Iterator;
8747 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
8748 self
8749 }
8750
8751 /// Sets the value of [input_uri_prefix][crate::model::ImportDocumentsMetadata::input_uri_prefix].
8752 ///
8753 /// # Example
8754 /// ```ignore,no_run
8755 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8756 /// let x = ImportDocumentsMetadata::new().set_input_uri_prefix("example");
8757 /// ```
8758 pub fn set_input_uri_prefix<T: std::convert::Into<std::string::String>>(
8759 mut self,
8760 v: T,
8761 ) -> Self {
8762 self.input_uri_prefix = v.into();
8763 self
8764 }
8765
8766 /// Sets the value of [namespace_ids][crate::model::ImportDocumentsMetadata::namespace_ids].
8767 ///
8768 /// # Example
8769 /// ```ignore,no_run
8770 /// # use google_cloud_firestore_admin_v1::model::ImportDocumentsMetadata;
8771 /// let x = ImportDocumentsMetadata::new().set_namespace_ids(["a", "b", "c"]);
8772 /// ```
8773 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
8774 where
8775 T: std::iter::IntoIterator<Item = V>,
8776 V: std::convert::Into<std::string::String>,
8777 {
8778 use std::iter::Iterator;
8779 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
8780 self
8781 }
8782}
8783
8784impl wkt::message::Message for ImportDocumentsMetadata {
8785 fn typename() -> &'static str {
8786 "type.googleapis.com/google.firestore.admin.v1.ImportDocumentsMetadata"
8787 }
8788}
8789
8790/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
8791/// results from
8792/// [FirestoreAdmin.BulkDeleteDocuments][google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments].
8793///
8794/// [google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments]: crate::client::FirestoreAdmin::bulk_delete_documents
8795/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8796#[derive(Clone, Default, PartialEq)]
8797#[non_exhaustive]
8798pub struct BulkDeleteDocumentsMetadata {
8799 /// The time this operation started.
8800 pub start_time: std::option::Option<wkt::Timestamp>,
8801
8802 /// The time this operation completed. Will be unset if operation still in
8803 /// progress.
8804 pub end_time: std::option::Option<wkt::Timestamp>,
8805
8806 /// The state of the operation.
8807 pub operation_state: crate::model::OperationState,
8808
8809 /// The progress, in documents, of this operation.
8810 pub progress_documents: std::option::Option<crate::model::Progress>,
8811
8812 /// The progress, in bytes, of this operation.
8813 pub progress_bytes: std::option::Option<crate::model::Progress>,
8814
8815 /// The IDs of the collection groups that are being deleted.
8816 pub collection_ids: std::vec::Vec<std::string::String>,
8817
8818 /// Which namespace IDs are being deleted.
8819 pub namespace_ids: std::vec::Vec<std::string::String>,
8820
8821 /// The timestamp that corresponds to the version of the database that is being
8822 /// read to get the list of documents to delete. This time can also be used as
8823 /// the timestamp of PITR in case of disaster recovery (subject to PITR window
8824 /// limit).
8825 pub snapshot_time: std::option::Option<wkt::Timestamp>,
8826
8827 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8828}
8829
8830impl BulkDeleteDocumentsMetadata {
8831 pub fn new() -> Self {
8832 std::default::Default::default()
8833 }
8834
8835 /// Sets the value of [start_time][crate::model::BulkDeleteDocumentsMetadata::start_time].
8836 ///
8837 /// # Example
8838 /// ```ignore,no_run
8839 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8840 /// use wkt::Timestamp;
8841 /// let x = BulkDeleteDocumentsMetadata::new().set_start_time(Timestamp::default()/* use setters */);
8842 /// ```
8843 pub fn set_start_time<T>(mut self, v: T) -> Self
8844 where
8845 T: std::convert::Into<wkt::Timestamp>,
8846 {
8847 self.start_time = std::option::Option::Some(v.into());
8848 self
8849 }
8850
8851 /// Sets or clears the value of [start_time][crate::model::BulkDeleteDocumentsMetadata::start_time].
8852 ///
8853 /// # Example
8854 /// ```ignore,no_run
8855 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8856 /// use wkt::Timestamp;
8857 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
8858 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_start_time(None::<Timestamp>);
8859 /// ```
8860 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
8861 where
8862 T: std::convert::Into<wkt::Timestamp>,
8863 {
8864 self.start_time = v.map(|x| x.into());
8865 self
8866 }
8867
8868 /// Sets the value of [end_time][crate::model::BulkDeleteDocumentsMetadata::end_time].
8869 ///
8870 /// # Example
8871 /// ```ignore,no_run
8872 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8873 /// use wkt::Timestamp;
8874 /// let x = BulkDeleteDocumentsMetadata::new().set_end_time(Timestamp::default()/* use setters */);
8875 /// ```
8876 pub fn set_end_time<T>(mut self, v: T) -> Self
8877 where
8878 T: std::convert::Into<wkt::Timestamp>,
8879 {
8880 self.end_time = std::option::Option::Some(v.into());
8881 self
8882 }
8883
8884 /// Sets or clears the value of [end_time][crate::model::BulkDeleteDocumentsMetadata::end_time].
8885 ///
8886 /// # Example
8887 /// ```ignore,no_run
8888 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8889 /// use wkt::Timestamp;
8890 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
8891 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_end_time(None::<Timestamp>);
8892 /// ```
8893 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8894 where
8895 T: std::convert::Into<wkt::Timestamp>,
8896 {
8897 self.end_time = v.map(|x| x.into());
8898 self
8899 }
8900
8901 /// Sets the value of [operation_state][crate::model::BulkDeleteDocumentsMetadata::operation_state].
8902 ///
8903 /// # Example
8904 /// ```ignore,no_run
8905 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8906 /// use google_cloud_firestore_admin_v1::model::OperationState;
8907 /// let x0 = BulkDeleteDocumentsMetadata::new().set_operation_state(OperationState::Initializing);
8908 /// let x1 = BulkDeleteDocumentsMetadata::new().set_operation_state(OperationState::Processing);
8909 /// let x2 = BulkDeleteDocumentsMetadata::new().set_operation_state(OperationState::Cancelling);
8910 /// ```
8911 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
8912 mut self,
8913 v: T,
8914 ) -> Self {
8915 self.operation_state = v.into();
8916 self
8917 }
8918
8919 /// Sets the value of [progress_documents][crate::model::BulkDeleteDocumentsMetadata::progress_documents].
8920 ///
8921 /// # Example
8922 /// ```ignore,no_run
8923 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8924 /// use google_cloud_firestore_admin_v1::model::Progress;
8925 /// let x = BulkDeleteDocumentsMetadata::new().set_progress_documents(Progress::default()/* use setters */);
8926 /// ```
8927 pub fn set_progress_documents<T>(mut self, v: T) -> Self
8928 where
8929 T: std::convert::Into<crate::model::Progress>,
8930 {
8931 self.progress_documents = std::option::Option::Some(v.into());
8932 self
8933 }
8934
8935 /// Sets or clears the value of [progress_documents][crate::model::BulkDeleteDocumentsMetadata::progress_documents].
8936 ///
8937 /// # Example
8938 /// ```ignore,no_run
8939 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8940 /// use google_cloud_firestore_admin_v1::model::Progress;
8941 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_progress_documents(Some(Progress::default()/* use setters */));
8942 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_progress_documents(None::<Progress>);
8943 /// ```
8944 pub fn set_or_clear_progress_documents<T>(mut self, v: std::option::Option<T>) -> Self
8945 where
8946 T: std::convert::Into<crate::model::Progress>,
8947 {
8948 self.progress_documents = v.map(|x| x.into());
8949 self
8950 }
8951
8952 /// Sets the value of [progress_bytes][crate::model::BulkDeleteDocumentsMetadata::progress_bytes].
8953 ///
8954 /// # Example
8955 /// ```ignore,no_run
8956 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8957 /// use google_cloud_firestore_admin_v1::model::Progress;
8958 /// let x = BulkDeleteDocumentsMetadata::new().set_progress_bytes(Progress::default()/* use setters */);
8959 /// ```
8960 pub fn set_progress_bytes<T>(mut self, v: T) -> Self
8961 where
8962 T: std::convert::Into<crate::model::Progress>,
8963 {
8964 self.progress_bytes = std::option::Option::Some(v.into());
8965 self
8966 }
8967
8968 /// Sets or clears the value of [progress_bytes][crate::model::BulkDeleteDocumentsMetadata::progress_bytes].
8969 ///
8970 /// # Example
8971 /// ```ignore,no_run
8972 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8973 /// use google_cloud_firestore_admin_v1::model::Progress;
8974 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_progress_bytes(Some(Progress::default()/* use setters */));
8975 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_progress_bytes(None::<Progress>);
8976 /// ```
8977 pub fn set_or_clear_progress_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8978 where
8979 T: std::convert::Into<crate::model::Progress>,
8980 {
8981 self.progress_bytes = v.map(|x| x.into());
8982 self
8983 }
8984
8985 /// Sets the value of [collection_ids][crate::model::BulkDeleteDocumentsMetadata::collection_ids].
8986 ///
8987 /// # Example
8988 /// ```ignore,no_run
8989 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
8990 /// let x = BulkDeleteDocumentsMetadata::new().set_collection_ids(["a", "b", "c"]);
8991 /// ```
8992 pub fn set_collection_ids<T, V>(mut self, v: T) -> Self
8993 where
8994 T: std::iter::IntoIterator<Item = V>,
8995 V: std::convert::Into<std::string::String>,
8996 {
8997 use std::iter::Iterator;
8998 self.collection_ids = v.into_iter().map(|i| i.into()).collect();
8999 self
9000 }
9001
9002 /// Sets the value of [namespace_ids][crate::model::BulkDeleteDocumentsMetadata::namespace_ids].
9003 ///
9004 /// # Example
9005 /// ```ignore,no_run
9006 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
9007 /// let x = BulkDeleteDocumentsMetadata::new().set_namespace_ids(["a", "b", "c"]);
9008 /// ```
9009 pub fn set_namespace_ids<T, V>(mut self, v: T) -> Self
9010 where
9011 T: std::iter::IntoIterator<Item = V>,
9012 V: std::convert::Into<std::string::String>,
9013 {
9014 use std::iter::Iterator;
9015 self.namespace_ids = v.into_iter().map(|i| i.into()).collect();
9016 self
9017 }
9018
9019 /// Sets the value of [snapshot_time][crate::model::BulkDeleteDocumentsMetadata::snapshot_time].
9020 ///
9021 /// # Example
9022 /// ```ignore,no_run
9023 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
9024 /// use wkt::Timestamp;
9025 /// let x = BulkDeleteDocumentsMetadata::new().set_snapshot_time(Timestamp::default()/* use setters */);
9026 /// ```
9027 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
9028 where
9029 T: std::convert::Into<wkt::Timestamp>,
9030 {
9031 self.snapshot_time = std::option::Option::Some(v.into());
9032 self
9033 }
9034
9035 /// Sets or clears the value of [snapshot_time][crate::model::BulkDeleteDocumentsMetadata::snapshot_time].
9036 ///
9037 /// # Example
9038 /// ```ignore,no_run
9039 /// # use google_cloud_firestore_admin_v1::model::BulkDeleteDocumentsMetadata;
9040 /// use wkt::Timestamp;
9041 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_snapshot_time(Some(Timestamp::default()/* use setters */));
9042 /// let x = BulkDeleteDocumentsMetadata::new().set_or_clear_snapshot_time(None::<Timestamp>);
9043 /// ```
9044 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
9045 where
9046 T: std::convert::Into<wkt::Timestamp>,
9047 {
9048 self.snapshot_time = v.map(|x| x.into());
9049 self
9050 }
9051}
9052
9053impl wkt::message::Message for BulkDeleteDocumentsMetadata {
9054 fn typename() -> &'static str {
9055 "type.googleapis.com/google.firestore.admin.v1.BulkDeleteDocumentsMetadata"
9056 }
9057}
9058
9059/// Returned in the [google.longrunning.Operation][google.longrunning.Operation]
9060/// response field.
9061///
9062/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
9063#[derive(Clone, Default, PartialEq)]
9064#[non_exhaustive]
9065pub struct ExportDocumentsResponse {
9066 /// Location of the output files. This can be used to begin an import
9067 /// into Cloud Firestore (this project or another project) after the operation
9068 /// completes successfully.
9069 pub output_uri_prefix: std::string::String,
9070
9071 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9072}
9073
9074impl ExportDocumentsResponse {
9075 pub fn new() -> Self {
9076 std::default::Default::default()
9077 }
9078
9079 /// Sets the value of [output_uri_prefix][crate::model::ExportDocumentsResponse::output_uri_prefix].
9080 ///
9081 /// # Example
9082 /// ```ignore,no_run
9083 /// # use google_cloud_firestore_admin_v1::model::ExportDocumentsResponse;
9084 /// let x = ExportDocumentsResponse::new().set_output_uri_prefix("example");
9085 /// ```
9086 pub fn set_output_uri_prefix<T: std::convert::Into<std::string::String>>(
9087 mut self,
9088 v: T,
9089 ) -> Self {
9090 self.output_uri_prefix = v.into();
9091 self
9092 }
9093}
9094
9095impl wkt::message::Message for ExportDocumentsResponse {
9096 fn typename() -> &'static str {
9097 "type.googleapis.com/google.firestore.admin.v1.ExportDocumentsResponse"
9098 }
9099}
9100
9101/// Metadata for the [long-running operation][google.longrunning.Operation] from
9102/// the [RestoreDatabase][google.firestore.admin.v1.RestoreDatabase] request.
9103///
9104/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
9105#[derive(Clone, Default, PartialEq)]
9106#[non_exhaustive]
9107pub struct RestoreDatabaseMetadata {
9108 /// The time the restore was started.
9109 pub start_time: std::option::Option<wkt::Timestamp>,
9110
9111 /// The time the restore finished, unset for ongoing restores.
9112 pub end_time: std::option::Option<wkt::Timestamp>,
9113
9114 /// The operation state of the restore.
9115 pub operation_state: crate::model::OperationState,
9116
9117 /// The name of the database being restored to.
9118 pub database: std::string::String,
9119
9120 /// The name of the backup restoring from.
9121 pub backup: std::string::String,
9122
9123 /// How far along the restore is as an estimated percentage of remaining time.
9124 pub progress_percentage: std::option::Option<crate::model::Progress>,
9125
9126 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9127}
9128
9129impl RestoreDatabaseMetadata {
9130 pub fn new() -> Self {
9131 std::default::Default::default()
9132 }
9133
9134 /// Sets the value of [start_time][crate::model::RestoreDatabaseMetadata::start_time].
9135 ///
9136 /// # Example
9137 /// ```ignore,no_run
9138 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9139 /// use wkt::Timestamp;
9140 /// let x = RestoreDatabaseMetadata::new().set_start_time(Timestamp::default()/* use setters */);
9141 /// ```
9142 pub fn set_start_time<T>(mut self, v: T) -> Self
9143 where
9144 T: std::convert::Into<wkt::Timestamp>,
9145 {
9146 self.start_time = std::option::Option::Some(v.into());
9147 self
9148 }
9149
9150 /// Sets or clears the value of [start_time][crate::model::RestoreDatabaseMetadata::start_time].
9151 ///
9152 /// # Example
9153 /// ```ignore,no_run
9154 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9155 /// use wkt::Timestamp;
9156 /// let x = RestoreDatabaseMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
9157 /// let x = RestoreDatabaseMetadata::new().set_or_clear_start_time(None::<Timestamp>);
9158 /// ```
9159 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
9160 where
9161 T: std::convert::Into<wkt::Timestamp>,
9162 {
9163 self.start_time = v.map(|x| x.into());
9164 self
9165 }
9166
9167 /// Sets the value of [end_time][crate::model::RestoreDatabaseMetadata::end_time].
9168 ///
9169 /// # Example
9170 /// ```ignore,no_run
9171 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9172 /// use wkt::Timestamp;
9173 /// let x = RestoreDatabaseMetadata::new().set_end_time(Timestamp::default()/* use setters */);
9174 /// ```
9175 pub fn set_end_time<T>(mut self, v: T) -> Self
9176 where
9177 T: std::convert::Into<wkt::Timestamp>,
9178 {
9179 self.end_time = std::option::Option::Some(v.into());
9180 self
9181 }
9182
9183 /// Sets or clears the value of [end_time][crate::model::RestoreDatabaseMetadata::end_time].
9184 ///
9185 /// # Example
9186 /// ```ignore,no_run
9187 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9188 /// use wkt::Timestamp;
9189 /// let x = RestoreDatabaseMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
9190 /// let x = RestoreDatabaseMetadata::new().set_or_clear_end_time(None::<Timestamp>);
9191 /// ```
9192 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9193 where
9194 T: std::convert::Into<wkt::Timestamp>,
9195 {
9196 self.end_time = v.map(|x| x.into());
9197 self
9198 }
9199
9200 /// Sets the value of [operation_state][crate::model::RestoreDatabaseMetadata::operation_state].
9201 ///
9202 /// # Example
9203 /// ```ignore,no_run
9204 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9205 /// use google_cloud_firestore_admin_v1::model::OperationState;
9206 /// let x0 = RestoreDatabaseMetadata::new().set_operation_state(OperationState::Initializing);
9207 /// let x1 = RestoreDatabaseMetadata::new().set_operation_state(OperationState::Processing);
9208 /// let x2 = RestoreDatabaseMetadata::new().set_operation_state(OperationState::Cancelling);
9209 /// ```
9210 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
9211 mut self,
9212 v: T,
9213 ) -> Self {
9214 self.operation_state = v.into();
9215 self
9216 }
9217
9218 /// Sets the value of [database][crate::model::RestoreDatabaseMetadata::database].
9219 ///
9220 /// # Example
9221 /// ```ignore,no_run
9222 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9223 /// let x = RestoreDatabaseMetadata::new().set_database("example");
9224 /// ```
9225 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9226 self.database = v.into();
9227 self
9228 }
9229
9230 /// Sets the value of [backup][crate::model::RestoreDatabaseMetadata::backup].
9231 ///
9232 /// # Example
9233 /// ```ignore,no_run
9234 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9235 /// let x = RestoreDatabaseMetadata::new().set_backup("example");
9236 /// ```
9237 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9238 self.backup = v.into();
9239 self
9240 }
9241
9242 /// Sets the value of [progress_percentage][crate::model::RestoreDatabaseMetadata::progress_percentage].
9243 ///
9244 /// # Example
9245 /// ```ignore,no_run
9246 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9247 /// use google_cloud_firestore_admin_v1::model::Progress;
9248 /// let x = RestoreDatabaseMetadata::new().set_progress_percentage(Progress::default()/* use setters */);
9249 /// ```
9250 pub fn set_progress_percentage<T>(mut self, v: T) -> Self
9251 where
9252 T: std::convert::Into<crate::model::Progress>,
9253 {
9254 self.progress_percentage = std::option::Option::Some(v.into());
9255 self
9256 }
9257
9258 /// Sets or clears the value of [progress_percentage][crate::model::RestoreDatabaseMetadata::progress_percentage].
9259 ///
9260 /// # Example
9261 /// ```ignore,no_run
9262 /// # use google_cloud_firestore_admin_v1::model::RestoreDatabaseMetadata;
9263 /// use google_cloud_firestore_admin_v1::model::Progress;
9264 /// let x = RestoreDatabaseMetadata::new().set_or_clear_progress_percentage(Some(Progress::default()/* use setters */));
9265 /// let x = RestoreDatabaseMetadata::new().set_or_clear_progress_percentage(None::<Progress>);
9266 /// ```
9267 pub fn set_or_clear_progress_percentage<T>(mut self, v: std::option::Option<T>) -> Self
9268 where
9269 T: std::convert::Into<crate::model::Progress>,
9270 {
9271 self.progress_percentage = v.map(|x| x.into());
9272 self
9273 }
9274}
9275
9276impl wkt::message::Message for RestoreDatabaseMetadata {
9277 fn typename() -> &'static str {
9278 "type.googleapis.com/google.firestore.admin.v1.RestoreDatabaseMetadata"
9279 }
9280}
9281
9282/// Metadata for the [long-running operation][google.longrunning.Operation] from
9283/// the [CloneDatabase][google.firestore.admin.v1.CloneDatabase] request.
9284///
9285/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
9286#[derive(Clone, Default, PartialEq)]
9287#[non_exhaustive]
9288pub struct CloneDatabaseMetadata {
9289 /// The time the clone was started.
9290 pub start_time: std::option::Option<wkt::Timestamp>,
9291
9292 /// The time the clone finished, unset for ongoing clones.
9293 pub end_time: std::option::Option<wkt::Timestamp>,
9294
9295 /// The operation state of the clone.
9296 pub operation_state: crate::model::OperationState,
9297
9298 /// The name of the database being cloned to.
9299 pub database: std::string::String,
9300
9301 /// The snapshot from which this database was cloned.
9302 pub pitr_snapshot: std::option::Option<crate::model::PitrSnapshot>,
9303
9304 /// How far along the clone is as an estimated percentage of remaining time.
9305 pub progress_percentage: std::option::Option<crate::model::Progress>,
9306
9307 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9308}
9309
9310impl CloneDatabaseMetadata {
9311 pub fn new() -> Self {
9312 std::default::Default::default()
9313 }
9314
9315 /// Sets the value of [start_time][crate::model::CloneDatabaseMetadata::start_time].
9316 ///
9317 /// # Example
9318 /// ```ignore,no_run
9319 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9320 /// use wkt::Timestamp;
9321 /// let x = CloneDatabaseMetadata::new().set_start_time(Timestamp::default()/* use setters */);
9322 /// ```
9323 pub fn set_start_time<T>(mut self, v: T) -> Self
9324 where
9325 T: std::convert::Into<wkt::Timestamp>,
9326 {
9327 self.start_time = std::option::Option::Some(v.into());
9328 self
9329 }
9330
9331 /// Sets or clears the value of [start_time][crate::model::CloneDatabaseMetadata::start_time].
9332 ///
9333 /// # Example
9334 /// ```ignore,no_run
9335 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9336 /// use wkt::Timestamp;
9337 /// let x = CloneDatabaseMetadata::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
9338 /// let x = CloneDatabaseMetadata::new().set_or_clear_start_time(None::<Timestamp>);
9339 /// ```
9340 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
9341 where
9342 T: std::convert::Into<wkt::Timestamp>,
9343 {
9344 self.start_time = v.map(|x| x.into());
9345 self
9346 }
9347
9348 /// Sets the value of [end_time][crate::model::CloneDatabaseMetadata::end_time].
9349 ///
9350 /// # Example
9351 /// ```ignore,no_run
9352 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9353 /// use wkt::Timestamp;
9354 /// let x = CloneDatabaseMetadata::new().set_end_time(Timestamp::default()/* use setters */);
9355 /// ```
9356 pub fn set_end_time<T>(mut self, v: T) -> Self
9357 where
9358 T: std::convert::Into<wkt::Timestamp>,
9359 {
9360 self.end_time = std::option::Option::Some(v.into());
9361 self
9362 }
9363
9364 /// Sets or clears the value of [end_time][crate::model::CloneDatabaseMetadata::end_time].
9365 ///
9366 /// # Example
9367 /// ```ignore,no_run
9368 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9369 /// use wkt::Timestamp;
9370 /// let x = CloneDatabaseMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
9371 /// let x = CloneDatabaseMetadata::new().set_or_clear_end_time(None::<Timestamp>);
9372 /// ```
9373 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9374 where
9375 T: std::convert::Into<wkt::Timestamp>,
9376 {
9377 self.end_time = v.map(|x| x.into());
9378 self
9379 }
9380
9381 /// Sets the value of [operation_state][crate::model::CloneDatabaseMetadata::operation_state].
9382 ///
9383 /// # Example
9384 /// ```ignore,no_run
9385 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9386 /// use google_cloud_firestore_admin_v1::model::OperationState;
9387 /// let x0 = CloneDatabaseMetadata::new().set_operation_state(OperationState::Initializing);
9388 /// let x1 = CloneDatabaseMetadata::new().set_operation_state(OperationState::Processing);
9389 /// let x2 = CloneDatabaseMetadata::new().set_operation_state(OperationState::Cancelling);
9390 /// ```
9391 pub fn set_operation_state<T: std::convert::Into<crate::model::OperationState>>(
9392 mut self,
9393 v: T,
9394 ) -> Self {
9395 self.operation_state = v.into();
9396 self
9397 }
9398
9399 /// Sets the value of [database][crate::model::CloneDatabaseMetadata::database].
9400 ///
9401 /// # Example
9402 /// ```ignore,no_run
9403 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9404 /// let x = CloneDatabaseMetadata::new().set_database("example");
9405 /// ```
9406 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9407 self.database = v.into();
9408 self
9409 }
9410
9411 /// Sets the value of [pitr_snapshot][crate::model::CloneDatabaseMetadata::pitr_snapshot].
9412 ///
9413 /// # Example
9414 /// ```ignore,no_run
9415 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9416 /// use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9417 /// let x = CloneDatabaseMetadata::new().set_pitr_snapshot(PitrSnapshot::default()/* use setters */);
9418 /// ```
9419 pub fn set_pitr_snapshot<T>(mut self, v: T) -> Self
9420 where
9421 T: std::convert::Into<crate::model::PitrSnapshot>,
9422 {
9423 self.pitr_snapshot = std::option::Option::Some(v.into());
9424 self
9425 }
9426
9427 /// Sets or clears the value of [pitr_snapshot][crate::model::CloneDatabaseMetadata::pitr_snapshot].
9428 ///
9429 /// # Example
9430 /// ```ignore,no_run
9431 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9432 /// use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9433 /// let x = CloneDatabaseMetadata::new().set_or_clear_pitr_snapshot(Some(PitrSnapshot::default()/* use setters */));
9434 /// let x = CloneDatabaseMetadata::new().set_or_clear_pitr_snapshot(None::<PitrSnapshot>);
9435 /// ```
9436 pub fn set_or_clear_pitr_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
9437 where
9438 T: std::convert::Into<crate::model::PitrSnapshot>,
9439 {
9440 self.pitr_snapshot = v.map(|x| x.into());
9441 self
9442 }
9443
9444 /// Sets the value of [progress_percentage][crate::model::CloneDatabaseMetadata::progress_percentage].
9445 ///
9446 /// # Example
9447 /// ```ignore,no_run
9448 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9449 /// use google_cloud_firestore_admin_v1::model::Progress;
9450 /// let x = CloneDatabaseMetadata::new().set_progress_percentage(Progress::default()/* use setters */);
9451 /// ```
9452 pub fn set_progress_percentage<T>(mut self, v: T) -> Self
9453 where
9454 T: std::convert::Into<crate::model::Progress>,
9455 {
9456 self.progress_percentage = std::option::Option::Some(v.into());
9457 self
9458 }
9459
9460 /// Sets or clears the value of [progress_percentage][crate::model::CloneDatabaseMetadata::progress_percentage].
9461 ///
9462 /// # Example
9463 /// ```ignore,no_run
9464 /// # use google_cloud_firestore_admin_v1::model::CloneDatabaseMetadata;
9465 /// use google_cloud_firestore_admin_v1::model::Progress;
9466 /// let x = CloneDatabaseMetadata::new().set_or_clear_progress_percentage(Some(Progress::default()/* use setters */));
9467 /// let x = CloneDatabaseMetadata::new().set_or_clear_progress_percentage(None::<Progress>);
9468 /// ```
9469 pub fn set_or_clear_progress_percentage<T>(mut self, v: std::option::Option<T>) -> Self
9470 where
9471 T: std::convert::Into<crate::model::Progress>,
9472 {
9473 self.progress_percentage = v.map(|x| x.into());
9474 self
9475 }
9476}
9477
9478impl wkt::message::Message for CloneDatabaseMetadata {
9479 fn typename() -> &'static str {
9480 "type.googleapis.com/google.firestore.admin.v1.CloneDatabaseMetadata"
9481 }
9482}
9483
9484/// Describes the progress of the operation.
9485/// Unit of work is generic and must be interpreted based on where
9486/// [Progress][google.firestore.admin.v1.Progress] is used.
9487///
9488/// [google.firestore.admin.v1.Progress]: crate::model::Progress
9489#[derive(Clone, Default, PartialEq)]
9490#[non_exhaustive]
9491pub struct Progress {
9492 /// The amount of work estimated.
9493 pub estimated_work: i64,
9494
9495 /// The amount of work completed.
9496 pub completed_work: i64,
9497
9498 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9499}
9500
9501impl Progress {
9502 pub fn new() -> Self {
9503 std::default::Default::default()
9504 }
9505
9506 /// Sets the value of [estimated_work][crate::model::Progress::estimated_work].
9507 ///
9508 /// # Example
9509 /// ```ignore,no_run
9510 /// # use google_cloud_firestore_admin_v1::model::Progress;
9511 /// let x = Progress::new().set_estimated_work(42);
9512 /// ```
9513 pub fn set_estimated_work<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9514 self.estimated_work = v.into();
9515 self
9516 }
9517
9518 /// Sets the value of [completed_work][crate::model::Progress::completed_work].
9519 ///
9520 /// # Example
9521 /// ```ignore,no_run
9522 /// # use google_cloud_firestore_admin_v1::model::Progress;
9523 /// let x = Progress::new().set_completed_work(42);
9524 /// ```
9525 pub fn set_completed_work<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9526 self.completed_work = v.into();
9527 self
9528 }
9529}
9530
9531impl wkt::message::Message for Progress {
9532 fn typename() -> &'static str {
9533 "type.googleapis.com/google.firestore.admin.v1.Progress"
9534 }
9535}
9536
9537/// A backup schedule for a Cloud Firestore Database.
9538///
9539/// This resource is owned by the database it is backing up, and is deleted along
9540/// with the database. The actual backups are not though.
9541#[derive(Clone, Default, PartialEq)]
9542#[non_exhaustive]
9543pub struct BackupSchedule {
9544 /// Output only. The unique backup schedule identifier across all locations and
9545 /// databases for the given project.
9546 ///
9547 /// This will be auto-assigned.
9548 ///
9549 /// Format is
9550 /// `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
9551 pub name: std::string::String,
9552
9553 /// Output only. The timestamp at which this backup schedule was created and
9554 /// effective since.
9555 ///
9556 /// No backups will be created for this schedule before this time.
9557 pub create_time: std::option::Option<wkt::Timestamp>,
9558
9559 /// Output only. The timestamp at which this backup schedule was most recently
9560 /// updated. When a backup schedule is first created, this is the same as
9561 /// create_time.
9562 pub update_time: std::option::Option<wkt::Timestamp>,
9563
9564 /// At what relative time in the future, compared to its creation time,
9565 /// the backup should be deleted, e.g. keep backups for 7 days.
9566 ///
9567 /// The maximum supported retention period is 14 weeks.
9568 pub retention: std::option::Option<wkt::Duration>,
9569
9570 /// A oneof field to represent when backups will be taken.
9571 pub recurrence: std::option::Option<crate::model::backup_schedule::Recurrence>,
9572
9573 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9574}
9575
9576impl BackupSchedule {
9577 pub fn new() -> Self {
9578 std::default::Default::default()
9579 }
9580
9581 /// Sets the value of [name][crate::model::BackupSchedule::name].
9582 ///
9583 /// # Example
9584 /// ```ignore,no_run
9585 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9586 /// let x = BackupSchedule::new().set_name("example");
9587 /// ```
9588 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9589 self.name = v.into();
9590 self
9591 }
9592
9593 /// Sets the value of [create_time][crate::model::BackupSchedule::create_time].
9594 ///
9595 /// # Example
9596 /// ```ignore,no_run
9597 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9598 /// use wkt::Timestamp;
9599 /// let x = BackupSchedule::new().set_create_time(Timestamp::default()/* use setters */);
9600 /// ```
9601 pub fn set_create_time<T>(mut self, v: T) -> Self
9602 where
9603 T: std::convert::Into<wkt::Timestamp>,
9604 {
9605 self.create_time = std::option::Option::Some(v.into());
9606 self
9607 }
9608
9609 /// Sets or clears the value of [create_time][crate::model::BackupSchedule::create_time].
9610 ///
9611 /// # Example
9612 /// ```ignore,no_run
9613 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9614 /// use wkt::Timestamp;
9615 /// let x = BackupSchedule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9616 /// let x = BackupSchedule::new().set_or_clear_create_time(None::<Timestamp>);
9617 /// ```
9618 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9619 where
9620 T: std::convert::Into<wkt::Timestamp>,
9621 {
9622 self.create_time = v.map(|x| x.into());
9623 self
9624 }
9625
9626 /// Sets the value of [update_time][crate::model::BackupSchedule::update_time].
9627 ///
9628 /// # Example
9629 /// ```ignore,no_run
9630 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9631 /// use wkt::Timestamp;
9632 /// let x = BackupSchedule::new().set_update_time(Timestamp::default()/* use setters */);
9633 /// ```
9634 pub fn set_update_time<T>(mut self, v: T) -> Self
9635 where
9636 T: std::convert::Into<wkt::Timestamp>,
9637 {
9638 self.update_time = std::option::Option::Some(v.into());
9639 self
9640 }
9641
9642 /// Sets or clears the value of [update_time][crate::model::BackupSchedule::update_time].
9643 ///
9644 /// # Example
9645 /// ```ignore,no_run
9646 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9647 /// use wkt::Timestamp;
9648 /// let x = BackupSchedule::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
9649 /// let x = BackupSchedule::new().set_or_clear_update_time(None::<Timestamp>);
9650 /// ```
9651 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9652 where
9653 T: std::convert::Into<wkt::Timestamp>,
9654 {
9655 self.update_time = v.map(|x| x.into());
9656 self
9657 }
9658
9659 /// Sets the value of [retention][crate::model::BackupSchedule::retention].
9660 ///
9661 /// # Example
9662 /// ```ignore,no_run
9663 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9664 /// use wkt::Duration;
9665 /// let x = BackupSchedule::new().set_retention(Duration::default()/* use setters */);
9666 /// ```
9667 pub fn set_retention<T>(mut self, v: T) -> Self
9668 where
9669 T: std::convert::Into<wkt::Duration>,
9670 {
9671 self.retention = std::option::Option::Some(v.into());
9672 self
9673 }
9674
9675 /// Sets or clears the value of [retention][crate::model::BackupSchedule::retention].
9676 ///
9677 /// # Example
9678 /// ```ignore,no_run
9679 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9680 /// use wkt::Duration;
9681 /// let x = BackupSchedule::new().set_or_clear_retention(Some(Duration::default()/* use setters */));
9682 /// let x = BackupSchedule::new().set_or_clear_retention(None::<Duration>);
9683 /// ```
9684 pub fn set_or_clear_retention<T>(mut self, v: std::option::Option<T>) -> Self
9685 where
9686 T: std::convert::Into<wkt::Duration>,
9687 {
9688 self.retention = v.map(|x| x.into());
9689 self
9690 }
9691
9692 /// Sets the value of [recurrence][crate::model::BackupSchedule::recurrence].
9693 ///
9694 /// Note that all the setters affecting `recurrence` are mutually
9695 /// exclusive.
9696 ///
9697 /// # Example
9698 /// ```ignore,no_run
9699 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9700 /// use google_cloud_firestore_admin_v1::model::DailyRecurrence;
9701 /// let x = BackupSchedule::new().set_recurrence(Some(
9702 /// google_cloud_firestore_admin_v1::model::backup_schedule::Recurrence::DailyRecurrence(DailyRecurrence::default().into())));
9703 /// ```
9704 pub fn set_recurrence<
9705 T: std::convert::Into<std::option::Option<crate::model::backup_schedule::Recurrence>>,
9706 >(
9707 mut self,
9708 v: T,
9709 ) -> Self {
9710 self.recurrence = v.into();
9711 self
9712 }
9713
9714 /// The value of [recurrence][crate::model::BackupSchedule::recurrence]
9715 /// if it holds a `DailyRecurrence`, `None` if the field is not set or
9716 /// holds a different branch.
9717 pub fn daily_recurrence(
9718 &self,
9719 ) -> std::option::Option<&std::boxed::Box<crate::model::DailyRecurrence>> {
9720 #[allow(unreachable_patterns)]
9721 self.recurrence.as_ref().and_then(|v| match v {
9722 crate::model::backup_schedule::Recurrence::DailyRecurrence(v) => {
9723 std::option::Option::Some(v)
9724 }
9725 _ => std::option::Option::None,
9726 })
9727 }
9728
9729 /// Sets the value of [recurrence][crate::model::BackupSchedule::recurrence]
9730 /// to hold a `DailyRecurrence`.
9731 ///
9732 /// Note that all the setters affecting `recurrence` are
9733 /// mutually exclusive.
9734 ///
9735 /// # Example
9736 /// ```ignore,no_run
9737 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9738 /// use google_cloud_firestore_admin_v1::model::DailyRecurrence;
9739 /// let x = BackupSchedule::new().set_daily_recurrence(DailyRecurrence::default()/* use setters */);
9740 /// assert!(x.daily_recurrence().is_some());
9741 /// assert!(x.weekly_recurrence().is_none());
9742 /// ```
9743 pub fn set_daily_recurrence<
9744 T: std::convert::Into<std::boxed::Box<crate::model::DailyRecurrence>>,
9745 >(
9746 mut self,
9747 v: T,
9748 ) -> Self {
9749 self.recurrence = std::option::Option::Some(
9750 crate::model::backup_schedule::Recurrence::DailyRecurrence(v.into()),
9751 );
9752 self
9753 }
9754
9755 /// The value of [recurrence][crate::model::BackupSchedule::recurrence]
9756 /// if it holds a `WeeklyRecurrence`, `None` if the field is not set or
9757 /// holds a different branch.
9758 pub fn weekly_recurrence(
9759 &self,
9760 ) -> std::option::Option<&std::boxed::Box<crate::model::WeeklyRecurrence>> {
9761 #[allow(unreachable_patterns)]
9762 self.recurrence.as_ref().and_then(|v| match v {
9763 crate::model::backup_schedule::Recurrence::WeeklyRecurrence(v) => {
9764 std::option::Option::Some(v)
9765 }
9766 _ => std::option::Option::None,
9767 })
9768 }
9769
9770 /// Sets the value of [recurrence][crate::model::BackupSchedule::recurrence]
9771 /// to hold a `WeeklyRecurrence`.
9772 ///
9773 /// Note that all the setters affecting `recurrence` are
9774 /// mutually exclusive.
9775 ///
9776 /// # Example
9777 /// ```ignore,no_run
9778 /// # use google_cloud_firestore_admin_v1::model::BackupSchedule;
9779 /// use google_cloud_firestore_admin_v1::model::WeeklyRecurrence;
9780 /// let x = BackupSchedule::new().set_weekly_recurrence(WeeklyRecurrence::default()/* use setters */);
9781 /// assert!(x.weekly_recurrence().is_some());
9782 /// assert!(x.daily_recurrence().is_none());
9783 /// ```
9784 pub fn set_weekly_recurrence<
9785 T: std::convert::Into<std::boxed::Box<crate::model::WeeklyRecurrence>>,
9786 >(
9787 mut self,
9788 v: T,
9789 ) -> Self {
9790 self.recurrence = std::option::Option::Some(
9791 crate::model::backup_schedule::Recurrence::WeeklyRecurrence(v.into()),
9792 );
9793 self
9794 }
9795}
9796
9797impl wkt::message::Message for BackupSchedule {
9798 fn typename() -> &'static str {
9799 "type.googleapis.com/google.firestore.admin.v1.BackupSchedule"
9800 }
9801}
9802
9803/// Defines additional types related to [BackupSchedule].
9804pub mod backup_schedule {
9805 #[allow(unused_imports)]
9806 use super::*;
9807
9808 /// A oneof field to represent when backups will be taken.
9809 #[derive(Clone, Debug, PartialEq)]
9810 #[non_exhaustive]
9811 pub enum Recurrence {
9812 /// For a schedule that runs daily.
9813 DailyRecurrence(std::boxed::Box<crate::model::DailyRecurrence>),
9814 /// For a schedule that runs weekly on a specific day.
9815 WeeklyRecurrence(std::boxed::Box<crate::model::WeeklyRecurrence>),
9816 }
9817}
9818
9819/// Represents a recurring schedule that runs every day.
9820///
9821/// The time zone is UTC.
9822#[derive(Clone, Default, PartialEq)]
9823#[non_exhaustive]
9824pub struct DailyRecurrence {
9825 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9826}
9827
9828impl DailyRecurrence {
9829 pub fn new() -> Self {
9830 std::default::Default::default()
9831 }
9832}
9833
9834impl wkt::message::Message for DailyRecurrence {
9835 fn typename() -> &'static str {
9836 "type.googleapis.com/google.firestore.admin.v1.DailyRecurrence"
9837 }
9838}
9839
9840/// Represents a recurring schedule that runs on a specified day of the week.
9841///
9842/// The time zone is UTC.
9843#[derive(Clone, Default, PartialEq)]
9844#[non_exhaustive]
9845pub struct WeeklyRecurrence {
9846 /// The day of week to run.
9847 ///
9848 /// DAY_OF_WEEK_UNSPECIFIED is not allowed.
9849 pub day: google_cloud_type::model::DayOfWeek,
9850
9851 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9852}
9853
9854impl WeeklyRecurrence {
9855 pub fn new() -> Self {
9856 std::default::Default::default()
9857 }
9858
9859 /// Sets the value of [day][crate::model::WeeklyRecurrence::day].
9860 ///
9861 /// # Example
9862 /// ```ignore,no_run
9863 /// # use google_cloud_firestore_admin_v1::model::WeeklyRecurrence;
9864 /// use google_cloud_type::model::DayOfWeek;
9865 /// let x0 = WeeklyRecurrence::new().set_day(DayOfWeek::Monday);
9866 /// let x1 = WeeklyRecurrence::new().set_day(DayOfWeek::Tuesday);
9867 /// let x2 = WeeklyRecurrence::new().set_day(DayOfWeek::Wednesday);
9868 /// ```
9869 pub fn set_day<T: std::convert::Into<google_cloud_type::model::DayOfWeek>>(
9870 mut self,
9871 v: T,
9872 ) -> Self {
9873 self.day = v.into();
9874 self
9875 }
9876}
9877
9878impl wkt::message::Message for WeeklyRecurrence {
9879 fn typename() -> &'static str {
9880 "type.googleapis.com/google.firestore.admin.v1.WeeklyRecurrence"
9881 }
9882}
9883
9884/// A consistent snapshot of a database at a specific point in time.
9885/// A PITR (Point-in-time recovery) snapshot with previous versions of a
9886/// database's data is available for every minute up to the associated database's
9887/// data retention period. If the PITR feature is enabled, the retention period
9888/// is 7 days; otherwise, it is one hour.
9889#[derive(Clone, Default, PartialEq)]
9890#[non_exhaustive]
9891pub struct PitrSnapshot {
9892 /// Required. The name of the database that this was a snapshot of. Format:
9893 /// `projects/{project}/databases/{database}`.
9894 pub database: std::string::String,
9895
9896 /// Output only. Public UUID of the database the snapshot was associated with.
9897 pub database_uid: ::bytes::Bytes,
9898
9899 /// Required. Snapshot time of the database.
9900 pub snapshot_time: std::option::Option<wkt::Timestamp>,
9901
9902 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9903}
9904
9905impl PitrSnapshot {
9906 pub fn new() -> Self {
9907 std::default::Default::default()
9908 }
9909
9910 /// Sets the value of [database][crate::model::PitrSnapshot::database].
9911 ///
9912 /// # Example
9913 /// ```ignore,no_run
9914 /// # use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9915 /// let x = PitrSnapshot::new().set_database("example");
9916 /// ```
9917 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9918 self.database = v.into();
9919 self
9920 }
9921
9922 /// Sets the value of [database_uid][crate::model::PitrSnapshot::database_uid].
9923 ///
9924 /// # Example
9925 /// ```ignore,no_run
9926 /// # use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9927 /// let x = PitrSnapshot::new().set_database_uid(bytes::Bytes::from_static(b"example"));
9928 /// ```
9929 pub fn set_database_uid<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
9930 self.database_uid = v.into();
9931 self
9932 }
9933
9934 /// Sets the value of [snapshot_time][crate::model::PitrSnapshot::snapshot_time].
9935 ///
9936 /// # Example
9937 /// ```ignore,no_run
9938 /// # use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9939 /// use wkt::Timestamp;
9940 /// let x = PitrSnapshot::new().set_snapshot_time(Timestamp::default()/* use setters */);
9941 /// ```
9942 pub fn set_snapshot_time<T>(mut self, v: T) -> Self
9943 where
9944 T: std::convert::Into<wkt::Timestamp>,
9945 {
9946 self.snapshot_time = std::option::Option::Some(v.into());
9947 self
9948 }
9949
9950 /// Sets or clears the value of [snapshot_time][crate::model::PitrSnapshot::snapshot_time].
9951 ///
9952 /// # Example
9953 /// ```ignore,no_run
9954 /// # use google_cloud_firestore_admin_v1::model::PitrSnapshot;
9955 /// use wkt::Timestamp;
9956 /// let x = PitrSnapshot::new().set_or_clear_snapshot_time(Some(Timestamp::default()/* use setters */));
9957 /// let x = PitrSnapshot::new().set_or_clear_snapshot_time(None::<Timestamp>);
9958 /// ```
9959 pub fn set_or_clear_snapshot_time<T>(mut self, v: std::option::Option<T>) -> Self
9960 where
9961 T: std::convert::Into<wkt::Timestamp>,
9962 {
9963 self.snapshot_time = v.map(|x| x.into());
9964 self
9965 }
9966}
9967
9968impl wkt::message::Message for PitrSnapshot {
9969 fn typename() -> &'static str {
9970 "type.googleapis.com/google.firestore.admin.v1.PitrSnapshot"
9971 }
9972}
9973
9974/// A Cloud Firestore User Creds.
9975#[derive(Clone, Default, PartialEq)]
9976#[non_exhaustive]
9977pub struct UserCreds {
9978 /// Identifier. The resource name of the UserCreds.
9979 /// Format:
9980 /// `projects/{project}/databases/{database}/userCreds/{user_creds}`
9981 pub name: std::string::String,
9982
9983 /// Output only. The time the user creds were created.
9984 pub create_time: std::option::Option<wkt::Timestamp>,
9985
9986 /// Output only. The time the user creds were last updated.
9987 pub update_time: std::option::Option<wkt::Timestamp>,
9988
9989 /// Output only. Whether the user creds are enabled or disabled. Defaults to
9990 /// ENABLED on creation.
9991 pub state: crate::model::user_creds::State,
9992
9993 /// Output only. The plaintext server-generated password for the user creds.
9994 /// Only populated in responses for CreateUserCreds and ResetUserPassword.
9995 pub secure_password: std::string::String,
9996
9997 /// Identity associated with this User Creds.
9998 pub user_creds_identity: std::option::Option<crate::model::user_creds::UserCredsIdentity>,
9999
10000 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10001}
10002
10003impl UserCreds {
10004 pub fn new() -> Self {
10005 std::default::Default::default()
10006 }
10007
10008 /// Sets the value of [name][crate::model::UserCreds::name].
10009 ///
10010 /// # Example
10011 /// ```ignore,no_run
10012 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
10013 /// let x = UserCreds::new().set_name("example");
10014 /// ```
10015 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10016 self.name = v.into();
10017 self
10018 }
10019
10020 /// Sets the value of [create_time][crate::model::UserCreds::create_time].
10021 ///
10022 /// # Example
10023 /// ```ignore,no_run
10024 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
10025 /// use wkt::Timestamp;
10026 /// let x = UserCreds::new().set_create_time(Timestamp::default()/* use setters */);
10027 /// ```
10028 pub fn set_create_time<T>(mut self, v: T) -> Self
10029 where
10030 T: std::convert::Into<wkt::Timestamp>,
10031 {
10032 self.create_time = std::option::Option::Some(v.into());
10033 self
10034 }
10035
10036 /// Sets or clears the value of [create_time][crate::model::UserCreds::create_time].
10037 ///
10038 /// # Example
10039 /// ```ignore,no_run
10040 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
10041 /// use wkt::Timestamp;
10042 /// let x = UserCreds::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10043 /// let x = UserCreds::new().set_or_clear_create_time(None::<Timestamp>);
10044 /// ```
10045 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10046 where
10047 T: std::convert::Into<wkt::Timestamp>,
10048 {
10049 self.create_time = v.map(|x| x.into());
10050 self
10051 }
10052
10053 /// Sets the value of [update_time][crate::model::UserCreds::update_time].
10054 ///
10055 /// # Example
10056 /// ```ignore,no_run
10057 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
10058 /// use wkt::Timestamp;
10059 /// let x = UserCreds::new().set_update_time(Timestamp::default()/* use setters */);
10060 /// ```
10061 pub fn set_update_time<T>(mut self, v: T) -> Self
10062 where
10063 T: std::convert::Into<wkt::Timestamp>,
10064 {
10065 self.update_time = std::option::Option::Some(v.into());
10066 self
10067 }
10068
10069 /// Sets or clears the value of [update_time][crate::model::UserCreds::update_time].
10070 ///
10071 /// # Example
10072 /// ```ignore,no_run
10073 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
10074 /// use wkt::Timestamp;
10075 /// let x = UserCreds::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
10076 /// let x = UserCreds::new().set_or_clear_update_time(None::<Timestamp>);
10077 /// ```
10078 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
10079 where
10080 T: std::convert::Into<wkt::Timestamp>,
10081 {
10082 self.update_time = v.map(|x| x.into());
10083 self
10084 }
10085
10086 /// Sets the value of [state][crate::model::UserCreds::state].
10087 ///
10088 /// # Example
10089 /// ```ignore,no_run
10090 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
10091 /// use google_cloud_firestore_admin_v1::model::user_creds::State;
10092 /// let x0 = UserCreds::new().set_state(State::Enabled);
10093 /// let x1 = UserCreds::new().set_state(State::Disabled);
10094 /// ```
10095 pub fn set_state<T: std::convert::Into<crate::model::user_creds::State>>(
10096 mut self,
10097 v: T,
10098 ) -> Self {
10099 self.state = v.into();
10100 self
10101 }
10102
10103 /// Sets the value of [secure_password][crate::model::UserCreds::secure_password].
10104 ///
10105 /// # Example
10106 /// ```ignore,no_run
10107 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
10108 /// let x = UserCreds::new().set_secure_password("example");
10109 /// ```
10110 pub fn set_secure_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10111 self.secure_password = v.into();
10112 self
10113 }
10114
10115 /// Sets the value of [user_creds_identity][crate::model::UserCreds::user_creds_identity].
10116 ///
10117 /// Note that all the setters affecting `user_creds_identity` are mutually
10118 /// exclusive.
10119 ///
10120 /// # Example
10121 /// ```ignore,no_run
10122 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
10123 /// use google_cloud_firestore_admin_v1::model::user_creds::ResourceIdentity;
10124 /// let x = UserCreds::new().set_user_creds_identity(Some(
10125 /// google_cloud_firestore_admin_v1::model::user_creds::UserCredsIdentity::ResourceIdentity(ResourceIdentity::default().into())));
10126 /// ```
10127 pub fn set_user_creds_identity<
10128 T: std::convert::Into<std::option::Option<crate::model::user_creds::UserCredsIdentity>>,
10129 >(
10130 mut self,
10131 v: T,
10132 ) -> Self {
10133 self.user_creds_identity = v.into();
10134 self
10135 }
10136
10137 /// The value of [user_creds_identity][crate::model::UserCreds::user_creds_identity]
10138 /// if it holds a `ResourceIdentity`, `None` if the field is not set or
10139 /// holds a different branch.
10140 pub fn resource_identity(
10141 &self,
10142 ) -> std::option::Option<&std::boxed::Box<crate::model::user_creds::ResourceIdentity>> {
10143 #[allow(unreachable_patterns)]
10144 self.user_creds_identity.as_ref().and_then(|v| match v {
10145 crate::model::user_creds::UserCredsIdentity::ResourceIdentity(v) => {
10146 std::option::Option::Some(v)
10147 }
10148 _ => std::option::Option::None,
10149 })
10150 }
10151
10152 /// Sets the value of [user_creds_identity][crate::model::UserCreds::user_creds_identity]
10153 /// to hold a `ResourceIdentity`.
10154 ///
10155 /// Note that all the setters affecting `user_creds_identity` are
10156 /// mutually exclusive.
10157 ///
10158 /// # Example
10159 /// ```ignore,no_run
10160 /// # use google_cloud_firestore_admin_v1::model::UserCreds;
10161 /// use google_cloud_firestore_admin_v1::model::user_creds::ResourceIdentity;
10162 /// let x = UserCreds::new().set_resource_identity(ResourceIdentity::default()/* use setters */);
10163 /// assert!(x.resource_identity().is_some());
10164 /// ```
10165 pub fn set_resource_identity<
10166 T: std::convert::Into<std::boxed::Box<crate::model::user_creds::ResourceIdentity>>,
10167 >(
10168 mut self,
10169 v: T,
10170 ) -> Self {
10171 self.user_creds_identity = std::option::Option::Some(
10172 crate::model::user_creds::UserCredsIdentity::ResourceIdentity(v.into()),
10173 );
10174 self
10175 }
10176}
10177
10178impl wkt::message::Message for UserCreds {
10179 fn typename() -> &'static str {
10180 "type.googleapis.com/google.firestore.admin.v1.UserCreds"
10181 }
10182}
10183
10184/// Defines additional types related to [UserCreds].
10185pub mod user_creds {
10186 #[allow(unused_imports)]
10187 use super::*;
10188
10189 /// Describes a Resource Identity principal.
10190 #[derive(Clone, Default, PartialEq)]
10191 #[non_exhaustive]
10192 pub struct ResourceIdentity {
10193 /// Output only. Principal identifier string.
10194 /// See: <https://cloud.google.com/iam/docs/principal-identifiers>
10195 pub principal: std::string::String,
10196
10197 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10198 }
10199
10200 impl ResourceIdentity {
10201 pub fn new() -> Self {
10202 std::default::Default::default()
10203 }
10204
10205 /// Sets the value of [principal][crate::model::user_creds::ResourceIdentity::principal].
10206 ///
10207 /// # Example
10208 /// ```ignore,no_run
10209 /// # use google_cloud_firestore_admin_v1::model::user_creds::ResourceIdentity;
10210 /// let x = ResourceIdentity::new().set_principal("example");
10211 /// ```
10212 pub fn set_principal<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10213 self.principal = v.into();
10214 self
10215 }
10216 }
10217
10218 impl wkt::message::Message for ResourceIdentity {
10219 fn typename() -> &'static str {
10220 "type.googleapis.com/google.firestore.admin.v1.UserCreds.ResourceIdentity"
10221 }
10222 }
10223
10224 /// The state of the user creds (ENABLED or DISABLED).
10225 ///
10226 /// # Working with unknown values
10227 ///
10228 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10229 /// additional enum variants at any time. Adding new variants is not considered
10230 /// a breaking change. Applications should write their code in anticipation of:
10231 ///
10232 /// - New values appearing in future releases of the client library, **and**
10233 /// - New values received dynamically, without application changes.
10234 ///
10235 /// Please consult the [Working with enums] section in the user guide for some
10236 /// guidelines.
10237 ///
10238 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10239 #[derive(Clone, Debug, PartialEq)]
10240 #[non_exhaustive]
10241 pub enum State {
10242 /// The default value. Should not be used.
10243 Unspecified,
10244 /// The user creds are enabled.
10245 Enabled,
10246 /// The user creds are disabled.
10247 Disabled,
10248 /// If set, the enum was initialized with an unknown value.
10249 ///
10250 /// Applications can examine the value using [State::value] or
10251 /// [State::name].
10252 UnknownValue(state::UnknownValue),
10253 }
10254
10255 #[doc(hidden)]
10256 pub mod state {
10257 #[allow(unused_imports)]
10258 use super::*;
10259 #[derive(Clone, Debug, PartialEq)]
10260 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10261 }
10262
10263 impl State {
10264 /// Gets the enum value.
10265 ///
10266 /// Returns `None` if the enum contains an unknown value deserialized from
10267 /// the string representation of enums.
10268 pub fn value(&self) -> std::option::Option<i32> {
10269 match self {
10270 Self::Unspecified => std::option::Option::Some(0),
10271 Self::Enabled => std::option::Option::Some(1),
10272 Self::Disabled => std::option::Option::Some(2),
10273 Self::UnknownValue(u) => u.0.value(),
10274 }
10275 }
10276
10277 /// Gets the enum value as a string.
10278 ///
10279 /// Returns `None` if the enum contains an unknown value deserialized from
10280 /// the integer representation of enums.
10281 pub fn name(&self) -> std::option::Option<&str> {
10282 match self {
10283 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10284 Self::Enabled => std::option::Option::Some("ENABLED"),
10285 Self::Disabled => std::option::Option::Some("DISABLED"),
10286 Self::UnknownValue(u) => u.0.name(),
10287 }
10288 }
10289 }
10290
10291 impl std::default::Default for State {
10292 fn default() -> Self {
10293 use std::convert::From;
10294 Self::from(0)
10295 }
10296 }
10297
10298 impl std::fmt::Display for State {
10299 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10300 wkt::internal::display_enum(f, self.name(), self.value())
10301 }
10302 }
10303
10304 impl std::convert::From<i32> for State {
10305 fn from(value: i32) -> Self {
10306 match value {
10307 0 => Self::Unspecified,
10308 1 => Self::Enabled,
10309 2 => Self::Disabled,
10310 _ => Self::UnknownValue(state::UnknownValue(
10311 wkt::internal::UnknownEnumValue::Integer(value),
10312 )),
10313 }
10314 }
10315 }
10316
10317 impl std::convert::From<&str> for State {
10318 fn from(value: &str) -> Self {
10319 use std::string::ToString;
10320 match value {
10321 "STATE_UNSPECIFIED" => Self::Unspecified,
10322 "ENABLED" => Self::Enabled,
10323 "DISABLED" => Self::Disabled,
10324 _ => Self::UnknownValue(state::UnknownValue(
10325 wkt::internal::UnknownEnumValue::String(value.to_string()),
10326 )),
10327 }
10328 }
10329 }
10330
10331 impl serde::ser::Serialize for State {
10332 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10333 where
10334 S: serde::Serializer,
10335 {
10336 match self {
10337 Self::Unspecified => serializer.serialize_i32(0),
10338 Self::Enabled => serializer.serialize_i32(1),
10339 Self::Disabled => serializer.serialize_i32(2),
10340 Self::UnknownValue(u) => u.0.serialize(serializer),
10341 }
10342 }
10343 }
10344
10345 impl<'de> serde::de::Deserialize<'de> for State {
10346 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10347 where
10348 D: serde::Deserializer<'de>,
10349 {
10350 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10351 ".google.firestore.admin.v1.UserCreds.State",
10352 ))
10353 }
10354 }
10355
10356 /// Identity associated with this User Creds.
10357 #[derive(Clone, Debug, PartialEq)]
10358 #[non_exhaustive]
10359 pub enum UserCredsIdentity {
10360 /// Resource Identity descriptor.
10361 ResourceIdentity(std::boxed::Box<crate::model::user_creds::ResourceIdentity>),
10362 }
10363}
10364
10365/// Describes the state of the operation.
10366///
10367/// # Working with unknown values
10368///
10369/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10370/// additional enum variants at any time. Adding new variants is not considered
10371/// a breaking change. Applications should write their code in anticipation of:
10372///
10373/// - New values appearing in future releases of the client library, **and**
10374/// - New values received dynamically, without application changes.
10375///
10376/// Please consult the [Working with enums] section in the user guide for some
10377/// guidelines.
10378///
10379/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10380#[derive(Clone, Debug, PartialEq)]
10381#[non_exhaustive]
10382pub enum OperationState {
10383 /// Unspecified.
10384 Unspecified,
10385 /// Request is being prepared for processing.
10386 Initializing,
10387 /// Request is actively being processed.
10388 Processing,
10389 /// Request is in the process of being cancelled after user called
10390 /// google.longrunning.Operations.CancelOperation on the operation.
10391 Cancelling,
10392 /// Request has been processed and is in its finalization stage.
10393 Finalizing,
10394 /// Request has completed successfully.
10395 Successful,
10396 /// Request has finished being processed, but encountered an error.
10397 Failed,
10398 /// Request has finished being cancelled after user called
10399 /// google.longrunning.Operations.CancelOperation.
10400 Cancelled,
10401 /// If set, the enum was initialized with an unknown value.
10402 ///
10403 /// Applications can examine the value using [OperationState::value] or
10404 /// [OperationState::name].
10405 UnknownValue(operation_state::UnknownValue),
10406}
10407
10408#[doc(hidden)]
10409pub mod operation_state {
10410 #[allow(unused_imports)]
10411 use super::*;
10412 #[derive(Clone, Debug, PartialEq)]
10413 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10414}
10415
10416impl OperationState {
10417 /// Gets the enum value.
10418 ///
10419 /// Returns `None` if the enum contains an unknown value deserialized from
10420 /// the string representation of enums.
10421 pub fn value(&self) -> std::option::Option<i32> {
10422 match self {
10423 Self::Unspecified => std::option::Option::Some(0),
10424 Self::Initializing => std::option::Option::Some(1),
10425 Self::Processing => std::option::Option::Some(2),
10426 Self::Cancelling => std::option::Option::Some(3),
10427 Self::Finalizing => std::option::Option::Some(4),
10428 Self::Successful => std::option::Option::Some(5),
10429 Self::Failed => std::option::Option::Some(6),
10430 Self::Cancelled => std::option::Option::Some(7),
10431 Self::UnknownValue(u) => u.0.value(),
10432 }
10433 }
10434
10435 /// Gets the enum value as a string.
10436 ///
10437 /// Returns `None` if the enum contains an unknown value deserialized from
10438 /// the integer representation of enums.
10439 pub fn name(&self) -> std::option::Option<&str> {
10440 match self {
10441 Self::Unspecified => std::option::Option::Some("OPERATION_STATE_UNSPECIFIED"),
10442 Self::Initializing => std::option::Option::Some("INITIALIZING"),
10443 Self::Processing => std::option::Option::Some("PROCESSING"),
10444 Self::Cancelling => std::option::Option::Some("CANCELLING"),
10445 Self::Finalizing => std::option::Option::Some("FINALIZING"),
10446 Self::Successful => std::option::Option::Some("SUCCESSFUL"),
10447 Self::Failed => std::option::Option::Some("FAILED"),
10448 Self::Cancelled => std::option::Option::Some("CANCELLED"),
10449 Self::UnknownValue(u) => u.0.name(),
10450 }
10451 }
10452}
10453
10454impl std::default::Default for OperationState {
10455 fn default() -> Self {
10456 use std::convert::From;
10457 Self::from(0)
10458 }
10459}
10460
10461impl std::fmt::Display for OperationState {
10462 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10463 wkt::internal::display_enum(f, self.name(), self.value())
10464 }
10465}
10466
10467impl std::convert::From<i32> for OperationState {
10468 fn from(value: i32) -> Self {
10469 match value {
10470 0 => Self::Unspecified,
10471 1 => Self::Initializing,
10472 2 => Self::Processing,
10473 3 => Self::Cancelling,
10474 4 => Self::Finalizing,
10475 5 => Self::Successful,
10476 6 => Self::Failed,
10477 7 => Self::Cancelled,
10478 _ => Self::UnknownValue(operation_state::UnknownValue(
10479 wkt::internal::UnknownEnumValue::Integer(value),
10480 )),
10481 }
10482 }
10483}
10484
10485impl std::convert::From<&str> for OperationState {
10486 fn from(value: &str) -> Self {
10487 use std::string::ToString;
10488 match value {
10489 "OPERATION_STATE_UNSPECIFIED" => Self::Unspecified,
10490 "INITIALIZING" => Self::Initializing,
10491 "PROCESSING" => Self::Processing,
10492 "CANCELLING" => Self::Cancelling,
10493 "FINALIZING" => Self::Finalizing,
10494 "SUCCESSFUL" => Self::Successful,
10495 "FAILED" => Self::Failed,
10496 "CANCELLED" => Self::Cancelled,
10497 _ => Self::UnknownValue(operation_state::UnknownValue(
10498 wkt::internal::UnknownEnumValue::String(value.to_string()),
10499 )),
10500 }
10501 }
10502}
10503
10504impl serde::ser::Serialize for OperationState {
10505 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10506 where
10507 S: serde::Serializer,
10508 {
10509 match self {
10510 Self::Unspecified => serializer.serialize_i32(0),
10511 Self::Initializing => serializer.serialize_i32(1),
10512 Self::Processing => serializer.serialize_i32(2),
10513 Self::Cancelling => serializer.serialize_i32(3),
10514 Self::Finalizing => serializer.serialize_i32(4),
10515 Self::Successful => serializer.serialize_i32(5),
10516 Self::Failed => serializer.serialize_i32(6),
10517 Self::Cancelled => serializer.serialize_i32(7),
10518 Self::UnknownValue(u) => u.0.serialize(serializer),
10519 }
10520 }
10521}
10522
10523impl<'de> serde::de::Deserialize<'de> for OperationState {
10524 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10525 where
10526 D: serde::Deserializer<'de>,
10527 {
10528 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationState>::new(
10529 ".google.firestore.admin.v1.OperationState",
10530 ))
10531 }
10532}
10533
10534/// The Realtime Updates mode.
10535///
10536/// # Working with unknown values
10537///
10538/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10539/// additional enum variants at any time. Adding new variants is not considered
10540/// a breaking change. Applications should write their code in anticipation of:
10541///
10542/// - New values appearing in future releases of the client library, **and**
10543/// - New values received dynamically, without application changes.
10544///
10545/// Please consult the [Working with enums] section in the user guide for some
10546/// guidelines.
10547///
10548/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
10549#[derive(Clone, Debug, PartialEq)]
10550#[non_exhaustive]
10551pub enum RealtimeUpdatesMode {
10552 /// The Realtime Updates feature is not specified.
10553 Unspecified,
10554 /// The Realtime Updates feature is enabled by default.
10555 ///
10556 /// This could potentially degrade write performance for the database.
10557 Enabled,
10558 /// The Realtime Updates feature is disabled by default.
10559 Disabled,
10560 /// If set, the enum was initialized with an unknown value.
10561 ///
10562 /// Applications can examine the value using [RealtimeUpdatesMode::value] or
10563 /// [RealtimeUpdatesMode::name].
10564 UnknownValue(realtime_updates_mode::UnknownValue),
10565}
10566
10567#[doc(hidden)]
10568pub mod realtime_updates_mode {
10569 #[allow(unused_imports)]
10570 use super::*;
10571 #[derive(Clone, Debug, PartialEq)]
10572 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10573}
10574
10575impl RealtimeUpdatesMode {
10576 /// Gets the enum value.
10577 ///
10578 /// Returns `None` if the enum contains an unknown value deserialized from
10579 /// the string representation of enums.
10580 pub fn value(&self) -> std::option::Option<i32> {
10581 match self {
10582 Self::Unspecified => std::option::Option::Some(0),
10583 Self::Enabled => std::option::Option::Some(1),
10584 Self::Disabled => std::option::Option::Some(2),
10585 Self::UnknownValue(u) => u.0.value(),
10586 }
10587 }
10588
10589 /// Gets the enum value as a string.
10590 ///
10591 /// Returns `None` if the enum contains an unknown value deserialized from
10592 /// the integer representation of enums.
10593 pub fn name(&self) -> std::option::Option<&str> {
10594 match self {
10595 Self::Unspecified => std::option::Option::Some("REALTIME_UPDATES_MODE_UNSPECIFIED"),
10596 Self::Enabled => std::option::Option::Some("REALTIME_UPDATES_MODE_ENABLED"),
10597 Self::Disabled => std::option::Option::Some("REALTIME_UPDATES_MODE_DISABLED"),
10598 Self::UnknownValue(u) => u.0.name(),
10599 }
10600 }
10601}
10602
10603impl std::default::Default for RealtimeUpdatesMode {
10604 fn default() -> Self {
10605 use std::convert::From;
10606 Self::from(0)
10607 }
10608}
10609
10610impl std::fmt::Display for RealtimeUpdatesMode {
10611 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10612 wkt::internal::display_enum(f, self.name(), self.value())
10613 }
10614}
10615
10616impl std::convert::From<i32> for RealtimeUpdatesMode {
10617 fn from(value: i32) -> Self {
10618 match value {
10619 0 => Self::Unspecified,
10620 1 => Self::Enabled,
10621 2 => Self::Disabled,
10622 _ => Self::UnknownValue(realtime_updates_mode::UnknownValue(
10623 wkt::internal::UnknownEnumValue::Integer(value),
10624 )),
10625 }
10626 }
10627}
10628
10629impl std::convert::From<&str> for RealtimeUpdatesMode {
10630 fn from(value: &str) -> Self {
10631 use std::string::ToString;
10632 match value {
10633 "REALTIME_UPDATES_MODE_UNSPECIFIED" => Self::Unspecified,
10634 "REALTIME_UPDATES_MODE_ENABLED" => Self::Enabled,
10635 "REALTIME_UPDATES_MODE_DISABLED" => Self::Disabled,
10636 _ => Self::UnknownValue(realtime_updates_mode::UnknownValue(
10637 wkt::internal::UnknownEnumValue::String(value.to_string()),
10638 )),
10639 }
10640 }
10641}
10642
10643impl serde::ser::Serialize for RealtimeUpdatesMode {
10644 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10645 where
10646 S: serde::Serializer,
10647 {
10648 match self {
10649 Self::Unspecified => serializer.serialize_i32(0),
10650 Self::Enabled => serializer.serialize_i32(1),
10651 Self::Disabled => serializer.serialize_i32(2),
10652 Self::UnknownValue(u) => u.0.serialize(serializer),
10653 }
10654 }
10655}
10656
10657impl<'de> serde::de::Deserialize<'de> for RealtimeUpdatesMode {
10658 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10659 where
10660 D: serde::Deserializer<'de>,
10661 {
10662 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RealtimeUpdatesMode>::new(
10663 ".google.firestore.admin.v1.RealtimeUpdatesMode",
10664 ))
10665 }
10666}