google_cloud_metastore_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_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate google_cloud_type;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// A managed metastore service that serves metadata queries.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct Service {
44 /// Immutable. The relative resource name of the metastore service, in the
45 /// following format:
46 ///
47 /// `projects/{project_number}/locations/{location_id}/services/{service_id}`.
48 pub name: std::string::String,
49
50 /// Output only. The time when the metastore service was created.
51 pub create_time: std::option::Option<wkt::Timestamp>,
52
53 /// Output only. The time when the metastore service was last updated.
54 pub update_time: std::option::Option<wkt::Timestamp>,
55
56 /// User-defined labels for the metastore service.
57 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
58
59 /// Immutable. The relative resource name of the VPC network on which the
60 /// instance can be accessed. It is specified in the following form:
61 ///
62 /// `projects/{project_number}/global/networks/{network_id}`.
63 pub network: std::string::String,
64
65 /// Output only. The URI of the endpoint used to access the metastore service.
66 pub endpoint_uri: std::string::String,
67
68 /// The TCP port at which the metastore service is reached. Default: 9083.
69 pub port: i32,
70
71 /// Output only. The current state of the metastore service.
72 pub state: crate::model::service::State,
73
74 /// Output only. Additional information about the current state of the
75 /// metastore service, if available.
76 pub state_message: std::string::String,
77
78 /// Output only. A Cloud Storage URI (starting with `gs://`) that specifies
79 /// where artifacts related to the metastore service are stored.
80 pub artifact_gcs_uri: std::string::String,
81
82 /// The tier of the service.
83 pub tier: crate::model::service::Tier,
84
85 /// The one hour maintenance window of the metastore service. This specifies
86 /// when the service can be restarted for maintenance purposes in UTC time.
87 /// Maintenance window is not needed for services with the SPANNER
88 /// database type.
89 pub maintenance_window: std::option::Option<crate::model::MaintenanceWindow>,
90
91 /// Output only. The globally unique resource identifier of the metastore
92 /// service.
93 pub uid: std::string::String,
94
95 /// Output only. The metadata management activities of the metastore service.
96 pub metadata_management_activity: std::option::Option<crate::model::MetadataManagementActivity>,
97
98 /// Immutable. The release channel of the service.
99 /// If unspecified, defaults to `STABLE`.
100 pub release_channel: crate::model::service::ReleaseChannel,
101
102 /// Immutable. Information used to configure the Dataproc Metastore service to
103 /// encrypt customer data at rest. Cannot be updated.
104 pub encryption_config: std::option::Option<crate::model::EncryptionConfig>,
105
106 /// The configuration specifying the network settings for the
107 /// Dataproc Metastore service.
108 pub network_config: std::option::Option<crate::model::NetworkConfig>,
109
110 /// Immutable. The database type that the Metastore service stores its data.
111 pub database_type: crate::model::service::DatabaseType,
112
113 /// The configuration specifying telemetry settings for the Dataproc Metastore
114 /// service. If unspecified defaults to `JSON`.
115 pub telemetry_config: std::option::Option<crate::model::TelemetryConfig>,
116
117 /// Scaling configuration of the metastore service.
118 pub scaling_config: std::option::Option<crate::model::ScalingConfig>,
119
120 /// Configuration properties specific to the underlying metastore service
121 /// technology (the software that serves metastore queries).
122 pub metastore_config: std::option::Option<crate::model::service::MetastoreConfig>,
123
124 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
125}
126
127impl Service {
128 /// Creates a new default instance.
129 pub fn new() -> Self {
130 std::default::Default::default()
131 }
132
133 /// Sets the value of [name][crate::model::Service::name].
134 ///
135 /// # Example
136 /// ```ignore,no_run
137 /// # use google_cloud_metastore_v1::model::Service;
138 /// # let project_id = "project_id";
139 /// # let location_id = "location_id";
140 /// # let service_id = "service_id";
141 /// let x = Service::new().set_name(format!("projects/{project_id}/locations/{location_id}/services/{service_id}"));
142 /// ```
143 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
144 self.name = v.into();
145 self
146 }
147
148 /// Sets the value of [create_time][crate::model::Service::create_time].
149 ///
150 /// # Example
151 /// ```ignore,no_run
152 /// # use google_cloud_metastore_v1::model::Service;
153 /// use wkt::Timestamp;
154 /// let x = Service::new().set_create_time(Timestamp::default()/* use setters */);
155 /// ```
156 pub fn set_create_time<T>(mut self, v: T) -> Self
157 where
158 T: std::convert::Into<wkt::Timestamp>,
159 {
160 self.create_time = std::option::Option::Some(v.into());
161 self
162 }
163
164 /// Sets or clears the value of [create_time][crate::model::Service::create_time].
165 ///
166 /// # Example
167 /// ```ignore,no_run
168 /// # use google_cloud_metastore_v1::model::Service;
169 /// use wkt::Timestamp;
170 /// let x = Service::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
171 /// let x = Service::new().set_or_clear_create_time(None::<Timestamp>);
172 /// ```
173 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
174 where
175 T: std::convert::Into<wkt::Timestamp>,
176 {
177 self.create_time = v.map(|x| x.into());
178 self
179 }
180
181 /// Sets the value of [update_time][crate::model::Service::update_time].
182 ///
183 /// # Example
184 /// ```ignore,no_run
185 /// # use google_cloud_metastore_v1::model::Service;
186 /// use wkt::Timestamp;
187 /// let x = Service::new().set_update_time(Timestamp::default()/* use setters */);
188 /// ```
189 pub fn set_update_time<T>(mut self, v: T) -> Self
190 where
191 T: std::convert::Into<wkt::Timestamp>,
192 {
193 self.update_time = std::option::Option::Some(v.into());
194 self
195 }
196
197 /// Sets or clears the value of [update_time][crate::model::Service::update_time].
198 ///
199 /// # Example
200 /// ```ignore,no_run
201 /// # use google_cloud_metastore_v1::model::Service;
202 /// use wkt::Timestamp;
203 /// let x = Service::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
204 /// let x = Service::new().set_or_clear_update_time(None::<Timestamp>);
205 /// ```
206 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
207 where
208 T: std::convert::Into<wkt::Timestamp>,
209 {
210 self.update_time = v.map(|x| x.into());
211 self
212 }
213
214 /// Sets the value of [labels][crate::model::Service::labels].
215 ///
216 /// # Example
217 /// ```ignore,no_run
218 /// # use google_cloud_metastore_v1::model::Service;
219 /// let x = Service::new().set_labels([
220 /// ("key0", "abc"),
221 /// ("key1", "xyz"),
222 /// ]);
223 /// ```
224 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
225 where
226 T: std::iter::IntoIterator<Item = (K, V)>,
227 K: std::convert::Into<std::string::String>,
228 V: std::convert::Into<std::string::String>,
229 {
230 use std::iter::Iterator;
231 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
232 self
233 }
234
235 /// Sets the value of [network][crate::model::Service::network].
236 ///
237 /// # Example
238 /// ```ignore,no_run
239 /// # use google_cloud_metastore_v1::model::Service;
240 /// let x = Service::new().set_network("example");
241 /// ```
242 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
243 self.network = v.into();
244 self
245 }
246
247 /// Sets the value of [endpoint_uri][crate::model::Service::endpoint_uri].
248 ///
249 /// # Example
250 /// ```ignore,no_run
251 /// # use google_cloud_metastore_v1::model::Service;
252 /// let x = Service::new().set_endpoint_uri("example");
253 /// ```
254 pub fn set_endpoint_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
255 self.endpoint_uri = v.into();
256 self
257 }
258
259 /// Sets the value of [port][crate::model::Service::port].
260 ///
261 /// # Example
262 /// ```ignore,no_run
263 /// # use google_cloud_metastore_v1::model::Service;
264 /// let x = Service::new().set_port(42);
265 /// ```
266 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
267 self.port = v.into();
268 self
269 }
270
271 /// Sets the value of [state][crate::model::Service::state].
272 ///
273 /// # Example
274 /// ```ignore,no_run
275 /// # use google_cloud_metastore_v1::model::Service;
276 /// use google_cloud_metastore_v1::model::service::State;
277 /// let x0 = Service::new().set_state(State::Creating);
278 /// let x1 = Service::new().set_state(State::Active);
279 /// let x2 = Service::new().set_state(State::Suspending);
280 /// ```
281 pub fn set_state<T: std::convert::Into<crate::model::service::State>>(mut self, v: T) -> Self {
282 self.state = v.into();
283 self
284 }
285
286 /// Sets the value of [state_message][crate::model::Service::state_message].
287 ///
288 /// # Example
289 /// ```ignore,no_run
290 /// # use google_cloud_metastore_v1::model::Service;
291 /// let x = Service::new().set_state_message("example");
292 /// ```
293 pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
294 self.state_message = v.into();
295 self
296 }
297
298 /// Sets the value of [artifact_gcs_uri][crate::model::Service::artifact_gcs_uri].
299 ///
300 /// # Example
301 /// ```ignore,no_run
302 /// # use google_cloud_metastore_v1::model::Service;
303 /// let x = Service::new().set_artifact_gcs_uri("example");
304 /// ```
305 pub fn set_artifact_gcs_uri<T: std::convert::Into<std::string::String>>(
306 mut self,
307 v: T,
308 ) -> Self {
309 self.artifact_gcs_uri = v.into();
310 self
311 }
312
313 /// Sets the value of [tier][crate::model::Service::tier].
314 ///
315 /// # Example
316 /// ```ignore,no_run
317 /// # use google_cloud_metastore_v1::model::Service;
318 /// use google_cloud_metastore_v1::model::service::Tier;
319 /// let x0 = Service::new().set_tier(Tier::Developer);
320 /// let x1 = Service::new().set_tier(Tier::Enterprise);
321 /// ```
322 pub fn set_tier<T: std::convert::Into<crate::model::service::Tier>>(mut self, v: T) -> Self {
323 self.tier = v.into();
324 self
325 }
326
327 /// Sets the value of [maintenance_window][crate::model::Service::maintenance_window].
328 ///
329 /// # Example
330 /// ```ignore,no_run
331 /// # use google_cloud_metastore_v1::model::Service;
332 /// use google_cloud_metastore_v1::model::MaintenanceWindow;
333 /// let x = Service::new().set_maintenance_window(MaintenanceWindow::default()/* use setters */);
334 /// ```
335 pub fn set_maintenance_window<T>(mut self, v: T) -> Self
336 where
337 T: std::convert::Into<crate::model::MaintenanceWindow>,
338 {
339 self.maintenance_window = std::option::Option::Some(v.into());
340 self
341 }
342
343 /// Sets or clears the value of [maintenance_window][crate::model::Service::maintenance_window].
344 ///
345 /// # Example
346 /// ```ignore,no_run
347 /// # use google_cloud_metastore_v1::model::Service;
348 /// use google_cloud_metastore_v1::model::MaintenanceWindow;
349 /// let x = Service::new().set_or_clear_maintenance_window(Some(MaintenanceWindow::default()/* use setters */));
350 /// let x = Service::new().set_or_clear_maintenance_window(None::<MaintenanceWindow>);
351 /// ```
352 pub fn set_or_clear_maintenance_window<T>(mut self, v: std::option::Option<T>) -> Self
353 where
354 T: std::convert::Into<crate::model::MaintenanceWindow>,
355 {
356 self.maintenance_window = v.map(|x| x.into());
357 self
358 }
359
360 /// Sets the value of [uid][crate::model::Service::uid].
361 ///
362 /// # Example
363 /// ```ignore,no_run
364 /// # use google_cloud_metastore_v1::model::Service;
365 /// let x = Service::new().set_uid("example");
366 /// ```
367 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
368 self.uid = v.into();
369 self
370 }
371
372 /// Sets the value of [metadata_management_activity][crate::model::Service::metadata_management_activity].
373 ///
374 /// # Example
375 /// ```ignore,no_run
376 /// # use google_cloud_metastore_v1::model::Service;
377 /// use google_cloud_metastore_v1::model::MetadataManagementActivity;
378 /// let x = Service::new().set_metadata_management_activity(MetadataManagementActivity::default()/* use setters */);
379 /// ```
380 pub fn set_metadata_management_activity<T>(mut self, v: T) -> Self
381 where
382 T: std::convert::Into<crate::model::MetadataManagementActivity>,
383 {
384 self.metadata_management_activity = std::option::Option::Some(v.into());
385 self
386 }
387
388 /// Sets or clears the value of [metadata_management_activity][crate::model::Service::metadata_management_activity].
389 ///
390 /// # Example
391 /// ```ignore,no_run
392 /// # use google_cloud_metastore_v1::model::Service;
393 /// use google_cloud_metastore_v1::model::MetadataManagementActivity;
394 /// let x = Service::new().set_or_clear_metadata_management_activity(Some(MetadataManagementActivity::default()/* use setters */));
395 /// let x = Service::new().set_or_clear_metadata_management_activity(None::<MetadataManagementActivity>);
396 /// ```
397 pub fn set_or_clear_metadata_management_activity<T>(mut self, v: std::option::Option<T>) -> Self
398 where
399 T: std::convert::Into<crate::model::MetadataManagementActivity>,
400 {
401 self.metadata_management_activity = v.map(|x| x.into());
402 self
403 }
404
405 /// Sets the value of [release_channel][crate::model::Service::release_channel].
406 ///
407 /// # Example
408 /// ```ignore,no_run
409 /// # use google_cloud_metastore_v1::model::Service;
410 /// use google_cloud_metastore_v1::model::service::ReleaseChannel;
411 /// let x0 = Service::new().set_release_channel(ReleaseChannel::Canary);
412 /// let x1 = Service::new().set_release_channel(ReleaseChannel::Stable);
413 /// ```
414 pub fn set_release_channel<T: std::convert::Into<crate::model::service::ReleaseChannel>>(
415 mut self,
416 v: T,
417 ) -> Self {
418 self.release_channel = v.into();
419 self
420 }
421
422 /// Sets the value of [encryption_config][crate::model::Service::encryption_config].
423 ///
424 /// # Example
425 /// ```ignore,no_run
426 /// # use google_cloud_metastore_v1::model::Service;
427 /// use google_cloud_metastore_v1::model::EncryptionConfig;
428 /// let x = Service::new().set_encryption_config(EncryptionConfig::default()/* use setters */);
429 /// ```
430 pub fn set_encryption_config<T>(mut self, v: T) -> Self
431 where
432 T: std::convert::Into<crate::model::EncryptionConfig>,
433 {
434 self.encryption_config = std::option::Option::Some(v.into());
435 self
436 }
437
438 /// Sets or clears the value of [encryption_config][crate::model::Service::encryption_config].
439 ///
440 /// # Example
441 /// ```ignore,no_run
442 /// # use google_cloud_metastore_v1::model::Service;
443 /// use google_cloud_metastore_v1::model::EncryptionConfig;
444 /// let x = Service::new().set_or_clear_encryption_config(Some(EncryptionConfig::default()/* use setters */));
445 /// let x = Service::new().set_or_clear_encryption_config(None::<EncryptionConfig>);
446 /// ```
447 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
448 where
449 T: std::convert::Into<crate::model::EncryptionConfig>,
450 {
451 self.encryption_config = v.map(|x| x.into());
452 self
453 }
454
455 /// Sets the value of [network_config][crate::model::Service::network_config].
456 ///
457 /// # Example
458 /// ```ignore,no_run
459 /// # use google_cloud_metastore_v1::model::Service;
460 /// use google_cloud_metastore_v1::model::NetworkConfig;
461 /// let x = Service::new().set_network_config(NetworkConfig::default()/* use setters */);
462 /// ```
463 pub fn set_network_config<T>(mut self, v: T) -> Self
464 where
465 T: std::convert::Into<crate::model::NetworkConfig>,
466 {
467 self.network_config = std::option::Option::Some(v.into());
468 self
469 }
470
471 /// Sets or clears the value of [network_config][crate::model::Service::network_config].
472 ///
473 /// # Example
474 /// ```ignore,no_run
475 /// # use google_cloud_metastore_v1::model::Service;
476 /// use google_cloud_metastore_v1::model::NetworkConfig;
477 /// let x = Service::new().set_or_clear_network_config(Some(NetworkConfig::default()/* use setters */));
478 /// let x = Service::new().set_or_clear_network_config(None::<NetworkConfig>);
479 /// ```
480 pub fn set_or_clear_network_config<T>(mut self, v: std::option::Option<T>) -> Self
481 where
482 T: std::convert::Into<crate::model::NetworkConfig>,
483 {
484 self.network_config = v.map(|x| x.into());
485 self
486 }
487
488 /// Sets the value of [database_type][crate::model::Service::database_type].
489 ///
490 /// # Example
491 /// ```ignore,no_run
492 /// # use google_cloud_metastore_v1::model::Service;
493 /// use google_cloud_metastore_v1::model::service::DatabaseType;
494 /// let x0 = Service::new().set_database_type(DatabaseType::Mysql);
495 /// let x1 = Service::new().set_database_type(DatabaseType::Spanner);
496 /// ```
497 pub fn set_database_type<T: std::convert::Into<crate::model::service::DatabaseType>>(
498 mut self,
499 v: T,
500 ) -> Self {
501 self.database_type = v.into();
502 self
503 }
504
505 /// Sets the value of [telemetry_config][crate::model::Service::telemetry_config].
506 ///
507 /// # Example
508 /// ```ignore,no_run
509 /// # use google_cloud_metastore_v1::model::Service;
510 /// use google_cloud_metastore_v1::model::TelemetryConfig;
511 /// let x = Service::new().set_telemetry_config(TelemetryConfig::default()/* use setters */);
512 /// ```
513 pub fn set_telemetry_config<T>(mut self, v: T) -> Self
514 where
515 T: std::convert::Into<crate::model::TelemetryConfig>,
516 {
517 self.telemetry_config = std::option::Option::Some(v.into());
518 self
519 }
520
521 /// Sets or clears the value of [telemetry_config][crate::model::Service::telemetry_config].
522 ///
523 /// # Example
524 /// ```ignore,no_run
525 /// # use google_cloud_metastore_v1::model::Service;
526 /// use google_cloud_metastore_v1::model::TelemetryConfig;
527 /// let x = Service::new().set_or_clear_telemetry_config(Some(TelemetryConfig::default()/* use setters */));
528 /// let x = Service::new().set_or_clear_telemetry_config(None::<TelemetryConfig>);
529 /// ```
530 pub fn set_or_clear_telemetry_config<T>(mut self, v: std::option::Option<T>) -> Self
531 where
532 T: std::convert::Into<crate::model::TelemetryConfig>,
533 {
534 self.telemetry_config = v.map(|x| x.into());
535 self
536 }
537
538 /// Sets the value of [scaling_config][crate::model::Service::scaling_config].
539 ///
540 /// # Example
541 /// ```ignore,no_run
542 /// # use google_cloud_metastore_v1::model::Service;
543 /// use google_cloud_metastore_v1::model::ScalingConfig;
544 /// let x = Service::new().set_scaling_config(ScalingConfig::default()/* use setters */);
545 /// ```
546 pub fn set_scaling_config<T>(mut self, v: T) -> Self
547 where
548 T: std::convert::Into<crate::model::ScalingConfig>,
549 {
550 self.scaling_config = std::option::Option::Some(v.into());
551 self
552 }
553
554 /// Sets or clears the value of [scaling_config][crate::model::Service::scaling_config].
555 ///
556 /// # Example
557 /// ```ignore,no_run
558 /// # use google_cloud_metastore_v1::model::Service;
559 /// use google_cloud_metastore_v1::model::ScalingConfig;
560 /// let x = Service::new().set_or_clear_scaling_config(Some(ScalingConfig::default()/* use setters */));
561 /// let x = Service::new().set_or_clear_scaling_config(None::<ScalingConfig>);
562 /// ```
563 pub fn set_or_clear_scaling_config<T>(mut self, v: std::option::Option<T>) -> Self
564 where
565 T: std::convert::Into<crate::model::ScalingConfig>,
566 {
567 self.scaling_config = v.map(|x| x.into());
568 self
569 }
570
571 /// Sets the value of [metastore_config][crate::model::Service::metastore_config].
572 ///
573 /// Note that all the setters affecting `metastore_config` are mutually
574 /// exclusive.
575 ///
576 /// # Example
577 /// ```ignore,no_run
578 /// # use google_cloud_metastore_v1::model::Service;
579 /// use google_cloud_metastore_v1::model::HiveMetastoreConfig;
580 /// let x = Service::new().set_metastore_config(Some(
581 /// google_cloud_metastore_v1::model::service::MetastoreConfig::HiveMetastoreConfig(HiveMetastoreConfig::default().into())));
582 /// ```
583 pub fn set_metastore_config<
584 T: std::convert::Into<std::option::Option<crate::model::service::MetastoreConfig>>,
585 >(
586 mut self,
587 v: T,
588 ) -> Self {
589 self.metastore_config = v.into();
590 self
591 }
592
593 /// The value of [metastore_config][crate::model::Service::metastore_config]
594 /// if it holds a `HiveMetastoreConfig`, `None` if the field is not set or
595 /// holds a different branch.
596 pub fn hive_metastore_config(
597 &self,
598 ) -> std::option::Option<&std::boxed::Box<crate::model::HiveMetastoreConfig>> {
599 #[allow(unreachable_patterns)]
600 self.metastore_config.as_ref().and_then(|v| match v {
601 crate::model::service::MetastoreConfig::HiveMetastoreConfig(v) => {
602 std::option::Option::Some(v)
603 }
604 _ => std::option::Option::None,
605 })
606 }
607
608 /// Sets the value of [metastore_config][crate::model::Service::metastore_config]
609 /// to hold a `HiveMetastoreConfig`.
610 ///
611 /// Note that all the setters affecting `metastore_config` are
612 /// mutually exclusive.
613 ///
614 /// # Example
615 /// ```ignore,no_run
616 /// # use google_cloud_metastore_v1::model::Service;
617 /// use google_cloud_metastore_v1::model::HiveMetastoreConfig;
618 /// let x = Service::new().set_hive_metastore_config(HiveMetastoreConfig::default()/* use setters */);
619 /// assert!(x.hive_metastore_config().is_some());
620 /// ```
621 pub fn set_hive_metastore_config<
622 T: std::convert::Into<std::boxed::Box<crate::model::HiveMetastoreConfig>>,
623 >(
624 mut self,
625 v: T,
626 ) -> Self {
627 self.metastore_config = std::option::Option::Some(
628 crate::model::service::MetastoreConfig::HiveMetastoreConfig(v.into()),
629 );
630 self
631 }
632}
633
634impl wkt::message::Message for Service {
635 fn typename() -> &'static str {
636 "type.googleapis.com/google.cloud.metastore.v1.Service"
637 }
638}
639
640/// Defines additional types related to [Service].
641pub mod service {
642 #[allow(unused_imports)]
643 use super::*;
644
645 /// The current state of the metastore service.
646 ///
647 /// # Working with unknown values
648 ///
649 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
650 /// additional enum variants at any time. Adding new variants is not considered
651 /// a breaking change. Applications should write their code in anticipation of:
652 ///
653 /// - New values appearing in future releases of the client library, **and**
654 /// - New values received dynamically, without application changes.
655 ///
656 /// Please consult the [Working with enums] section in the user guide for some
657 /// guidelines.
658 ///
659 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
660 #[derive(Clone, Debug, PartialEq)]
661 #[non_exhaustive]
662 pub enum State {
663 /// The state of the metastore service is unknown.
664 Unspecified,
665 /// The metastore service is in the process of being created.
666 Creating,
667 /// The metastore service is running and ready to serve queries.
668 Active,
669 /// The metastore service is entering suspension. Its query-serving
670 /// availability may cease unexpectedly.
671 Suspending,
672 /// The metastore service is suspended and unable to serve queries.
673 Suspended,
674 /// The metastore service is being updated. It remains usable but cannot
675 /// accept additional update requests or be deleted at this time.
676 Updating,
677 /// The metastore service is undergoing deletion. It cannot be used.
678 Deleting,
679 /// The metastore service has encountered an error and cannot be used. The
680 /// metastore service should be deleted.
681 Error,
682 /// If set, the enum was initialized with an unknown value.
683 ///
684 /// Applications can examine the value using [State::value] or
685 /// [State::name].
686 UnknownValue(state::UnknownValue),
687 }
688
689 #[doc(hidden)]
690 pub mod state {
691 #[allow(unused_imports)]
692 use super::*;
693 #[derive(Clone, Debug, PartialEq)]
694 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
695 }
696
697 impl State {
698 /// Gets the enum value.
699 ///
700 /// Returns `None` if the enum contains an unknown value deserialized from
701 /// the string representation of enums.
702 pub fn value(&self) -> std::option::Option<i32> {
703 match self {
704 Self::Unspecified => std::option::Option::Some(0),
705 Self::Creating => std::option::Option::Some(1),
706 Self::Active => std::option::Option::Some(2),
707 Self::Suspending => std::option::Option::Some(3),
708 Self::Suspended => std::option::Option::Some(4),
709 Self::Updating => std::option::Option::Some(5),
710 Self::Deleting => std::option::Option::Some(6),
711 Self::Error => std::option::Option::Some(7),
712 Self::UnknownValue(u) => u.0.value(),
713 }
714 }
715
716 /// Gets the enum value as a string.
717 ///
718 /// Returns `None` if the enum contains an unknown value deserialized from
719 /// the integer representation of enums.
720 pub fn name(&self) -> std::option::Option<&str> {
721 match self {
722 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
723 Self::Creating => std::option::Option::Some("CREATING"),
724 Self::Active => std::option::Option::Some("ACTIVE"),
725 Self::Suspending => std::option::Option::Some("SUSPENDING"),
726 Self::Suspended => std::option::Option::Some("SUSPENDED"),
727 Self::Updating => std::option::Option::Some("UPDATING"),
728 Self::Deleting => std::option::Option::Some("DELETING"),
729 Self::Error => std::option::Option::Some("ERROR"),
730 Self::UnknownValue(u) => u.0.name(),
731 }
732 }
733 }
734
735 impl std::default::Default for State {
736 fn default() -> Self {
737 use std::convert::From;
738 Self::from(0)
739 }
740 }
741
742 impl std::fmt::Display for State {
743 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
744 wkt::internal::display_enum(f, self.name(), self.value())
745 }
746 }
747
748 impl std::convert::From<i32> for State {
749 fn from(value: i32) -> Self {
750 match value {
751 0 => Self::Unspecified,
752 1 => Self::Creating,
753 2 => Self::Active,
754 3 => Self::Suspending,
755 4 => Self::Suspended,
756 5 => Self::Updating,
757 6 => Self::Deleting,
758 7 => Self::Error,
759 _ => Self::UnknownValue(state::UnknownValue(
760 wkt::internal::UnknownEnumValue::Integer(value),
761 )),
762 }
763 }
764 }
765
766 impl std::convert::From<&str> for State {
767 fn from(value: &str) -> Self {
768 use std::string::ToString;
769 match value {
770 "STATE_UNSPECIFIED" => Self::Unspecified,
771 "CREATING" => Self::Creating,
772 "ACTIVE" => Self::Active,
773 "SUSPENDING" => Self::Suspending,
774 "SUSPENDED" => Self::Suspended,
775 "UPDATING" => Self::Updating,
776 "DELETING" => Self::Deleting,
777 "ERROR" => Self::Error,
778 _ => Self::UnknownValue(state::UnknownValue(
779 wkt::internal::UnknownEnumValue::String(value.to_string()),
780 )),
781 }
782 }
783 }
784
785 impl serde::ser::Serialize for State {
786 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
787 where
788 S: serde::Serializer,
789 {
790 match self {
791 Self::Unspecified => serializer.serialize_i32(0),
792 Self::Creating => serializer.serialize_i32(1),
793 Self::Active => serializer.serialize_i32(2),
794 Self::Suspending => serializer.serialize_i32(3),
795 Self::Suspended => serializer.serialize_i32(4),
796 Self::Updating => serializer.serialize_i32(5),
797 Self::Deleting => serializer.serialize_i32(6),
798 Self::Error => serializer.serialize_i32(7),
799 Self::UnknownValue(u) => u.0.serialize(serializer),
800 }
801 }
802 }
803
804 impl<'de> serde::de::Deserialize<'de> for State {
805 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
806 where
807 D: serde::Deserializer<'de>,
808 {
809 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
810 ".google.cloud.metastore.v1.Service.State",
811 ))
812 }
813 }
814
815 /// Available service tiers.
816 ///
817 /// # Working with unknown values
818 ///
819 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
820 /// additional enum variants at any time. Adding new variants is not considered
821 /// a breaking change. Applications should write their code in anticipation of:
822 ///
823 /// - New values appearing in future releases of the client library, **and**
824 /// - New values received dynamically, without application changes.
825 ///
826 /// Please consult the [Working with enums] section in the user guide for some
827 /// guidelines.
828 ///
829 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
830 #[derive(Clone, Debug, PartialEq)]
831 #[non_exhaustive]
832 pub enum Tier {
833 /// The tier is not set.
834 Unspecified,
835 /// The developer tier provides limited scalability and no fault tolerance.
836 /// Good for low-cost proof-of-concept.
837 Developer,
838 /// The enterprise tier provides multi-zone high availability, and sufficient
839 /// scalability for enterprise-level Dataproc Metastore workloads.
840 Enterprise,
841 /// If set, the enum was initialized with an unknown value.
842 ///
843 /// Applications can examine the value using [Tier::value] or
844 /// [Tier::name].
845 UnknownValue(tier::UnknownValue),
846 }
847
848 #[doc(hidden)]
849 pub mod tier {
850 #[allow(unused_imports)]
851 use super::*;
852 #[derive(Clone, Debug, PartialEq)]
853 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
854 }
855
856 impl Tier {
857 /// Gets the enum value.
858 ///
859 /// Returns `None` if the enum contains an unknown value deserialized from
860 /// the string representation of enums.
861 pub fn value(&self) -> std::option::Option<i32> {
862 match self {
863 Self::Unspecified => std::option::Option::Some(0),
864 Self::Developer => std::option::Option::Some(1),
865 Self::Enterprise => std::option::Option::Some(3),
866 Self::UnknownValue(u) => u.0.value(),
867 }
868 }
869
870 /// Gets the enum value as a string.
871 ///
872 /// Returns `None` if the enum contains an unknown value deserialized from
873 /// the integer representation of enums.
874 pub fn name(&self) -> std::option::Option<&str> {
875 match self {
876 Self::Unspecified => std::option::Option::Some("TIER_UNSPECIFIED"),
877 Self::Developer => std::option::Option::Some("DEVELOPER"),
878 Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
879 Self::UnknownValue(u) => u.0.name(),
880 }
881 }
882 }
883
884 impl std::default::Default for Tier {
885 fn default() -> Self {
886 use std::convert::From;
887 Self::from(0)
888 }
889 }
890
891 impl std::fmt::Display for Tier {
892 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
893 wkt::internal::display_enum(f, self.name(), self.value())
894 }
895 }
896
897 impl std::convert::From<i32> for Tier {
898 fn from(value: i32) -> Self {
899 match value {
900 0 => Self::Unspecified,
901 1 => Self::Developer,
902 3 => Self::Enterprise,
903 _ => Self::UnknownValue(tier::UnknownValue(
904 wkt::internal::UnknownEnumValue::Integer(value),
905 )),
906 }
907 }
908 }
909
910 impl std::convert::From<&str> for Tier {
911 fn from(value: &str) -> Self {
912 use std::string::ToString;
913 match value {
914 "TIER_UNSPECIFIED" => Self::Unspecified,
915 "DEVELOPER" => Self::Developer,
916 "ENTERPRISE" => Self::Enterprise,
917 _ => Self::UnknownValue(tier::UnknownValue(
918 wkt::internal::UnknownEnumValue::String(value.to_string()),
919 )),
920 }
921 }
922 }
923
924 impl serde::ser::Serialize for Tier {
925 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
926 where
927 S: serde::Serializer,
928 {
929 match self {
930 Self::Unspecified => serializer.serialize_i32(0),
931 Self::Developer => serializer.serialize_i32(1),
932 Self::Enterprise => serializer.serialize_i32(3),
933 Self::UnknownValue(u) => u.0.serialize(serializer),
934 }
935 }
936 }
937
938 impl<'de> serde::de::Deserialize<'de> for Tier {
939 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
940 where
941 D: serde::Deserializer<'de>,
942 {
943 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Tier>::new(
944 ".google.cloud.metastore.v1.Service.Tier",
945 ))
946 }
947 }
948
949 /// Release channels bundle features of varying levels of stability. Newer
950 /// features may be introduced initially into less stable release channels and
951 /// can be automatically promoted into more stable release channels.
952 ///
953 /// # Working with unknown values
954 ///
955 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
956 /// additional enum variants at any time. Adding new variants is not considered
957 /// a breaking change. Applications should write their code in anticipation of:
958 ///
959 /// - New values appearing in future releases of the client library, **and**
960 /// - New values received dynamically, without application changes.
961 ///
962 /// Please consult the [Working with enums] section in the user guide for some
963 /// guidelines.
964 ///
965 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
966 #[derive(Clone, Debug, PartialEq)]
967 #[non_exhaustive]
968 pub enum ReleaseChannel {
969 /// Release channel is not specified.
970 Unspecified,
971 /// The `CANARY` release channel contains the newest features, which may be
972 /// unstable and subject to unresolved issues with no known workarounds.
973 /// Services using the `CANARY` release channel are not subject to any SLAs.
974 Canary,
975 /// The `STABLE` release channel contains features that are considered stable
976 /// and have been validated for production use.
977 Stable,
978 /// If set, the enum was initialized with an unknown value.
979 ///
980 /// Applications can examine the value using [ReleaseChannel::value] or
981 /// [ReleaseChannel::name].
982 UnknownValue(release_channel::UnknownValue),
983 }
984
985 #[doc(hidden)]
986 pub mod release_channel {
987 #[allow(unused_imports)]
988 use super::*;
989 #[derive(Clone, Debug, PartialEq)]
990 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
991 }
992
993 impl ReleaseChannel {
994 /// Gets the enum value.
995 ///
996 /// Returns `None` if the enum contains an unknown value deserialized from
997 /// the string representation of enums.
998 pub fn value(&self) -> std::option::Option<i32> {
999 match self {
1000 Self::Unspecified => std::option::Option::Some(0),
1001 Self::Canary => std::option::Option::Some(1),
1002 Self::Stable => std::option::Option::Some(2),
1003 Self::UnknownValue(u) => u.0.value(),
1004 }
1005 }
1006
1007 /// Gets the enum value as a string.
1008 ///
1009 /// Returns `None` if the enum contains an unknown value deserialized from
1010 /// the integer representation of enums.
1011 pub fn name(&self) -> std::option::Option<&str> {
1012 match self {
1013 Self::Unspecified => std::option::Option::Some("RELEASE_CHANNEL_UNSPECIFIED"),
1014 Self::Canary => std::option::Option::Some("CANARY"),
1015 Self::Stable => std::option::Option::Some("STABLE"),
1016 Self::UnknownValue(u) => u.0.name(),
1017 }
1018 }
1019 }
1020
1021 impl std::default::Default for ReleaseChannel {
1022 fn default() -> Self {
1023 use std::convert::From;
1024 Self::from(0)
1025 }
1026 }
1027
1028 impl std::fmt::Display for ReleaseChannel {
1029 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1030 wkt::internal::display_enum(f, self.name(), self.value())
1031 }
1032 }
1033
1034 impl std::convert::From<i32> for ReleaseChannel {
1035 fn from(value: i32) -> Self {
1036 match value {
1037 0 => Self::Unspecified,
1038 1 => Self::Canary,
1039 2 => Self::Stable,
1040 _ => Self::UnknownValue(release_channel::UnknownValue(
1041 wkt::internal::UnknownEnumValue::Integer(value),
1042 )),
1043 }
1044 }
1045 }
1046
1047 impl std::convert::From<&str> for ReleaseChannel {
1048 fn from(value: &str) -> Self {
1049 use std::string::ToString;
1050 match value {
1051 "RELEASE_CHANNEL_UNSPECIFIED" => Self::Unspecified,
1052 "CANARY" => Self::Canary,
1053 "STABLE" => Self::Stable,
1054 _ => Self::UnknownValue(release_channel::UnknownValue(
1055 wkt::internal::UnknownEnumValue::String(value.to_string()),
1056 )),
1057 }
1058 }
1059 }
1060
1061 impl serde::ser::Serialize for ReleaseChannel {
1062 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1063 where
1064 S: serde::Serializer,
1065 {
1066 match self {
1067 Self::Unspecified => serializer.serialize_i32(0),
1068 Self::Canary => serializer.serialize_i32(1),
1069 Self::Stable => serializer.serialize_i32(2),
1070 Self::UnknownValue(u) => u.0.serialize(serializer),
1071 }
1072 }
1073 }
1074
1075 impl<'de> serde::de::Deserialize<'de> for ReleaseChannel {
1076 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1077 where
1078 D: serde::Deserializer<'de>,
1079 {
1080 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReleaseChannel>::new(
1081 ".google.cloud.metastore.v1.Service.ReleaseChannel",
1082 ))
1083 }
1084 }
1085
1086 /// The backend database type for the metastore service.
1087 ///
1088 /// # Working with unknown values
1089 ///
1090 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1091 /// additional enum variants at any time. Adding new variants is not considered
1092 /// a breaking change. Applications should write their code in anticipation of:
1093 ///
1094 /// - New values appearing in future releases of the client library, **and**
1095 /// - New values received dynamically, without application changes.
1096 ///
1097 /// Please consult the [Working with enums] section in the user guide for some
1098 /// guidelines.
1099 ///
1100 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1101 #[derive(Clone, Debug, PartialEq)]
1102 #[non_exhaustive]
1103 pub enum DatabaseType {
1104 /// The DATABASE_TYPE is not set.
1105 Unspecified,
1106 /// MySQL is used to persist the metastore data.
1107 Mysql,
1108 /// Spanner is used to persist the metastore data.
1109 Spanner,
1110 /// If set, the enum was initialized with an unknown value.
1111 ///
1112 /// Applications can examine the value using [DatabaseType::value] or
1113 /// [DatabaseType::name].
1114 UnknownValue(database_type::UnknownValue),
1115 }
1116
1117 #[doc(hidden)]
1118 pub mod database_type {
1119 #[allow(unused_imports)]
1120 use super::*;
1121 #[derive(Clone, Debug, PartialEq)]
1122 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1123 }
1124
1125 impl DatabaseType {
1126 /// Gets the enum value.
1127 ///
1128 /// Returns `None` if the enum contains an unknown value deserialized from
1129 /// the string representation of enums.
1130 pub fn value(&self) -> std::option::Option<i32> {
1131 match self {
1132 Self::Unspecified => std::option::Option::Some(0),
1133 Self::Mysql => std::option::Option::Some(1),
1134 Self::Spanner => std::option::Option::Some(2),
1135 Self::UnknownValue(u) => u.0.value(),
1136 }
1137 }
1138
1139 /// Gets the enum value as a string.
1140 ///
1141 /// Returns `None` if the enum contains an unknown value deserialized from
1142 /// the integer representation of enums.
1143 pub fn name(&self) -> std::option::Option<&str> {
1144 match self {
1145 Self::Unspecified => std::option::Option::Some("DATABASE_TYPE_UNSPECIFIED"),
1146 Self::Mysql => std::option::Option::Some("MYSQL"),
1147 Self::Spanner => std::option::Option::Some("SPANNER"),
1148 Self::UnknownValue(u) => u.0.name(),
1149 }
1150 }
1151 }
1152
1153 impl std::default::Default for DatabaseType {
1154 fn default() -> Self {
1155 use std::convert::From;
1156 Self::from(0)
1157 }
1158 }
1159
1160 impl std::fmt::Display for DatabaseType {
1161 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1162 wkt::internal::display_enum(f, self.name(), self.value())
1163 }
1164 }
1165
1166 impl std::convert::From<i32> for DatabaseType {
1167 fn from(value: i32) -> Self {
1168 match value {
1169 0 => Self::Unspecified,
1170 1 => Self::Mysql,
1171 2 => Self::Spanner,
1172 _ => Self::UnknownValue(database_type::UnknownValue(
1173 wkt::internal::UnknownEnumValue::Integer(value),
1174 )),
1175 }
1176 }
1177 }
1178
1179 impl std::convert::From<&str> for DatabaseType {
1180 fn from(value: &str) -> Self {
1181 use std::string::ToString;
1182 match value {
1183 "DATABASE_TYPE_UNSPECIFIED" => Self::Unspecified,
1184 "MYSQL" => Self::Mysql,
1185 "SPANNER" => Self::Spanner,
1186 _ => Self::UnknownValue(database_type::UnknownValue(
1187 wkt::internal::UnknownEnumValue::String(value.to_string()),
1188 )),
1189 }
1190 }
1191 }
1192
1193 impl serde::ser::Serialize for DatabaseType {
1194 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1195 where
1196 S: serde::Serializer,
1197 {
1198 match self {
1199 Self::Unspecified => serializer.serialize_i32(0),
1200 Self::Mysql => serializer.serialize_i32(1),
1201 Self::Spanner => serializer.serialize_i32(2),
1202 Self::UnknownValue(u) => u.0.serialize(serializer),
1203 }
1204 }
1205 }
1206
1207 impl<'de> serde::de::Deserialize<'de> for DatabaseType {
1208 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1209 where
1210 D: serde::Deserializer<'de>,
1211 {
1212 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseType>::new(
1213 ".google.cloud.metastore.v1.Service.DatabaseType",
1214 ))
1215 }
1216 }
1217
1218 /// Configuration properties specific to the underlying metastore service
1219 /// technology (the software that serves metastore queries).
1220 #[derive(Clone, Debug, PartialEq)]
1221 #[non_exhaustive]
1222 pub enum MetastoreConfig {
1223 /// Configuration information specific to running Hive metastore
1224 /// software as the metastore service.
1225 HiveMetastoreConfig(std::boxed::Box<crate::model::HiveMetastoreConfig>),
1226 }
1227}
1228
1229/// Maintenance window. This specifies when Dataproc Metastore
1230/// may perform system maintenance operation to the service.
1231#[derive(Clone, Default, PartialEq)]
1232#[non_exhaustive]
1233pub struct MaintenanceWindow {
1234 /// The hour of day (0-23) when the window starts.
1235 pub hour_of_day: std::option::Option<wkt::Int32Value>,
1236
1237 /// The day of week, when the window starts.
1238 pub day_of_week: google_cloud_type::model::DayOfWeek,
1239
1240 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1241}
1242
1243impl MaintenanceWindow {
1244 /// Creates a new default instance.
1245 pub fn new() -> Self {
1246 std::default::Default::default()
1247 }
1248
1249 /// Sets the value of [hour_of_day][crate::model::MaintenanceWindow::hour_of_day].
1250 ///
1251 /// # Example
1252 /// ```ignore,no_run
1253 /// # use google_cloud_metastore_v1::model::MaintenanceWindow;
1254 /// use wkt::Int32Value;
1255 /// let x = MaintenanceWindow::new().set_hour_of_day(Int32Value::default()/* use setters */);
1256 /// ```
1257 pub fn set_hour_of_day<T>(mut self, v: T) -> Self
1258 where
1259 T: std::convert::Into<wkt::Int32Value>,
1260 {
1261 self.hour_of_day = std::option::Option::Some(v.into());
1262 self
1263 }
1264
1265 /// Sets or clears the value of [hour_of_day][crate::model::MaintenanceWindow::hour_of_day].
1266 ///
1267 /// # Example
1268 /// ```ignore,no_run
1269 /// # use google_cloud_metastore_v1::model::MaintenanceWindow;
1270 /// use wkt::Int32Value;
1271 /// let x = MaintenanceWindow::new().set_or_clear_hour_of_day(Some(Int32Value::default()/* use setters */));
1272 /// let x = MaintenanceWindow::new().set_or_clear_hour_of_day(None::<Int32Value>);
1273 /// ```
1274 pub fn set_or_clear_hour_of_day<T>(mut self, v: std::option::Option<T>) -> Self
1275 where
1276 T: std::convert::Into<wkt::Int32Value>,
1277 {
1278 self.hour_of_day = v.map(|x| x.into());
1279 self
1280 }
1281
1282 /// Sets the value of [day_of_week][crate::model::MaintenanceWindow::day_of_week].
1283 ///
1284 /// # Example
1285 /// ```ignore,no_run
1286 /// # use google_cloud_metastore_v1::model::MaintenanceWindow;
1287 /// use google_cloud_type::model::DayOfWeek;
1288 /// let x0 = MaintenanceWindow::new().set_day_of_week(DayOfWeek::Monday);
1289 /// let x1 = MaintenanceWindow::new().set_day_of_week(DayOfWeek::Tuesday);
1290 /// let x2 = MaintenanceWindow::new().set_day_of_week(DayOfWeek::Wednesday);
1291 /// ```
1292 pub fn set_day_of_week<T: std::convert::Into<google_cloud_type::model::DayOfWeek>>(
1293 mut self,
1294 v: T,
1295 ) -> Self {
1296 self.day_of_week = v.into();
1297 self
1298 }
1299}
1300
1301impl wkt::message::Message for MaintenanceWindow {
1302 fn typename() -> &'static str {
1303 "type.googleapis.com/google.cloud.metastore.v1.MaintenanceWindow"
1304 }
1305}
1306
1307/// Specifies configuration information specific to running Hive metastore
1308/// software as the metastore service.
1309#[derive(Clone, Default, PartialEq)]
1310#[non_exhaustive]
1311pub struct HiveMetastoreConfig {
1312 /// Immutable. The Hive metastore schema version.
1313 pub version: std::string::String,
1314
1315 /// A mapping of Hive metastore configuration key-value pairs to apply to the
1316 /// Hive metastore (configured in `hive-site.xml`). The mappings
1317 /// override system defaults (some keys cannot be overridden). These
1318 /// overrides are also applied to auxiliary versions and can be further
1319 /// customized in the auxiliary version's `AuxiliaryVersionConfig`.
1320 pub config_overrides: std::collections::HashMap<std::string::String, std::string::String>,
1321
1322 /// Information used to configure the Hive metastore service as a service
1323 /// principal in a Kerberos realm. To disable Kerberos, use the `UpdateService`
1324 /// method and specify this field's path
1325 /// (`hive_metastore_config.kerberos_config`) in the request's `update_mask`
1326 /// while omitting this field from the request's `service`.
1327 pub kerberos_config: std::option::Option<crate::model::KerberosConfig>,
1328
1329 /// The protocol to use for the metastore service endpoint. If unspecified,
1330 /// defaults to `THRIFT`.
1331 pub endpoint_protocol: crate::model::hive_metastore_config::EndpointProtocol,
1332
1333 /// A mapping of Hive metastore version to the auxiliary version
1334 /// configuration. When specified, a secondary Hive metastore service is
1335 /// created along with the primary service. All auxiliary versions must be less
1336 /// than the service's primary version. The key is the auxiliary service name
1337 /// and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This
1338 /// means that the first character must be a lowercase letter, and all the
1339 /// following characters must be hyphens, lowercase letters, or digits, except
1340 /// the last character, which cannot be a hyphen.
1341 pub auxiliary_versions:
1342 std::collections::HashMap<std::string::String, crate::model::AuxiliaryVersionConfig>,
1343
1344 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1345}
1346
1347impl HiveMetastoreConfig {
1348 /// Creates a new default instance.
1349 pub fn new() -> Self {
1350 std::default::Default::default()
1351 }
1352
1353 /// Sets the value of [version][crate::model::HiveMetastoreConfig::version].
1354 ///
1355 /// # Example
1356 /// ```ignore,no_run
1357 /// # use google_cloud_metastore_v1::model::HiveMetastoreConfig;
1358 /// let x = HiveMetastoreConfig::new().set_version("example");
1359 /// ```
1360 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1361 self.version = v.into();
1362 self
1363 }
1364
1365 /// Sets the value of [config_overrides][crate::model::HiveMetastoreConfig::config_overrides].
1366 ///
1367 /// # Example
1368 /// ```ignore,no_run
1369 /// # use google_cloud_metastore_v1::model::HiveMetastoreConfig;
1370 /// let x = HiveMetastoreConfig::new().set_config_overrides([
1371 /// ("key0", "abc"),
1372 /// ("key1", "xyz"),
1373 /// ]);
1374 /// ```
1375 pub fn set_config_overrides<T, K, V>(mut self, v: T) -> Self
1376 where
1377 T: std::iter::IntoIterator<Item = (K, V)>,
1378 K: std::convert::Into<std::string::String>,
1379 V: std::convert::Into<std::string::String>,
1380 {
1381 use std::iter::Iterator;
1382 self.config_overrides = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1383 self
1384 }
1385
1386 /// Sets the value of [kerberos_config][crate::model::HiveMetastoreConfig::kerberos_config].
1387 ///
1388 /// # Example
1389 /// ```ignore,no_run
1390 /// # use google_cloud_metastore_v1::model::HiveMetastoreConfig;
1391 /// use google_cloud_metastore_v1::model::KerberosConfig;
1392 /// let x = HiveMetastoreConfig::new().set_kerberos_config(KerberosConfig::default()/* use setters */);
1393 /// ```
1394 pub fn set_kerberos_config<T>(mut self, v: T) -> Self
1395 where
1396 T: std::convert::Into<crate::model::KerberosConfig>,
1397 {
1398 self.kerberos_config = std::option::Option::Some(v.into());
1399 self
1400 }
1401
1402 /// Sets or clears the value of [kerberos_config][crate::model::HiveMetastoreConfig::kerberos_config].
1403 ///
1404 /// # Example
1405 /// ```ignore,no_run
1406 /// # use google_cloud_metastore_v1::model::HiveMetastoreConfig;
1407 /// use google_cloud_metastore_v1::model::KerberosConfig;
1408 /// let x = HiveMetastoreConfig::new().set_or_clear_kerberos_config(Some(KerberosConfig::default()/* use setters */));
1409 /// let x = HiveMetastoreConfig::new().set_or_clear_kerberos_config(None::<KerberosConfig>);
1410 /// ```
1411 pub fn set_or_clear_kerberos_config<T>(mut self, v: std::option::Option<T>) -> Self
1412 where
1413 T: std::convert::Into<crate::model::KerberosConfig>,
1414 {
1415 self.kerberos_config = v.map(|x| x.into());
1416 self
1417 }
1418
1419 /// Sets the value of [endpoint_protocol][crate::model::HiveMetastoreConfig::endpoint_protocol].
1420 ///
1421 /// # Example
1422 /// ```ignore,no_run
1423 /// # use google_cloud_metastore_v1::model::HiveMetastoreConfig;
1424 /// use google_cloud_metastore_v1::model::hive_metastore_config::EndpointProtocol;
1425 /// let x0 = HiveMetastoreConfig::new().set_endpoint_protocol(EndpointProtocol::Thrift);
1426 /// let x1 = HiveMetastoreConfig::new().set_endpoint_protocol(EndpointProtocol::Grpc);
1427 /// ```
1428 pub fn set_endpoint_protocol<
1429 T: std::convert::Into<crate::model::hive_metastore_config::EndpointProtocol>,
1430 >(
1431 mut self,
1432 v: T,
1433 ) -> Self {
1434 self.endpoint_protocol = v.into();
1435 self
1436 }
1437
1438 /// Sets the value of [auxiliary_versions][crate::model::HiveMetastoreConfig::auxiliary_versions].
1439 ///
1440 /// # Example
1441 /// ```ignore,no_run
1442 /// # use google_cloud_metastore_v1::model::HiveMetastoreConfig;
1443 /// use google_cloud_metastore_v1::model::AuxiliaryVersionConfig;
1444 /// let x = HiveMetastoreConfig::new().set_auxiliary_versions([
1445 /// ("key0", AuxiliaryVersionConfig::default()/* use setters */),
1446 /// ("key1", AuxiliaryVersionConfig::default()/* use (different) setters */),
1447 /// ]);
1448 /// ```
1449 pub fn set_auxiliary_versions<T, K, V>(mut self, v: T) -> Self
1450 where
1451 T: std::iter::IntoIterator<Item = (K, V)>,
1452 K: std::convert::Into<std::string::String>,
1453 V: std::convert::Into<crate::model::AuxiliaryVersionConfig>,
1454 {
1455 use std::iter::Iterator;
1456 self.auxiliary_versions = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1457 self
1458 }
1459}
1460
1461impl wkt::message::Message for HiveMetastoreConfig {
1462 fn typename() -> &'static str {
1463 "type.googleapis.com/google.cloud.metastore.v1.HiveMetastoreConfig"
1464 }
1465}
1466
1467/// Defines additional types related to [HiveMetastoreConfig].
1468pub mod hive_metastore_config {
1469 #[allow(unused_imports)]
1470 use super::*;
1471
1472 /// Protocols available for serving the metastore service endpoint.
1473 ///
1474 /// # Working with unknown values
1475 ///
1476 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1477 /// additional enum variants at any time. Adding new variants is not considered
1478 /// a breaking change. Applications should write their code in anticipation of:
1479 ///
1480 /// - New values appearing in future releases of the client library, **and**
1481 /// - New values received dynamically, without application changes.
1482 ///
1483 /// Please consult the [Working with enums] section in the user guide for some
1484 /// guidelines.
1485 ///
1486 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1487 #[derive(Clone, Debug, PartialEq)]
1488 #[non_exhaustive]
1489 pub enum EndpointProtocol {
1490 /// The protocol is not set.
1491 Unspecified,
1492 /// Use the legacy Apache Thrift protocol for the metastore service endpoint.
1493 Thrift,
1494 /// Use the modernized gRPC protocol for the metastore service endpoint.
1495 Grpc,
1496 /// If set, the enum was initialized with an unknown value.
1497 ///
1498 /// Applications can examine the value using [EndpointProtocol::value] or
1499 /// [EndpointProtocol::name].
1500 UnknownValue(endpoint_protocol::UnknownValue),
1501 }
1502
1503 #[doc(hidden)]
1504 pub mod endpoint_protocol {
1505 #[allow(unused_imports)]
1506 use super::*;
1507 #[derive(Clone, Debug, PartialEq)]
1508 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1509 }
1510
1511 impl EndpointProtocol {
1512 /// Gets the enum value.
1513 ///
1514 /// Returns `None` if the enum contains an unknown value deserialized from
1515 /// the string representation of enums.
1516 pub fn value(&self) -> std::option::Option<i32> {
1517 match self {
1518 Self::Unspecified => std::option::Option::Some(0),
1519 Self::Thrift => std::option::Option::Some(1),
1520 Self::Grpc => std::option::Option::Some(2),
1521 Self::UnknownValue(u) => u.0.value(),
1522 }
1523 }
1524
1525 /// Gets the enum value as a string.
1526 ///
1527 /// Returns `None` if the enum contains an unknown value deserialized from
1528 /// the integer representation of enums.
1529 pub fn name(&self) -> std::option::Option<&str> {
1530 match self {
1531 Self::Unspecified => std::option::Option::Some("ENDPOINT_PROTOCOL_UNSPECIFIED"),
1532 Self::Thrift => std::option::Option::Some("THRIFT"),
1533 Self::Grpc => std::option::Option::Some("GRPC"),
1534 Self::UnknownValue(u) => u.0.name(),
1535 }
1536 }
1537 }
1538
1539 impl std::default::Default for EndpointProtocol {
1540 fn default() -> Self {
1541 use std::convert::From;
1542 Self::from(0)
1543 }
1544 }
1545
1546 impl std::fmt::Display for EndpointProtocol {
1547 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1548 wkt::internal::display_enum(f, self.name(), self.value())
1549 }
1550 }
1551
1552 impl std::convert::From<i32> for EndpointProtocol {
1553 fn from(value: i32) -> Self {
1554 match value {
1555 0 => Self::Unspecified,
1556 1 => Self::Thrift,
1557 2 => Self::Grpc,
1558 _ => Self::UnknownValue(endpoint_protocol::UnknownValue(
1559 wkt::internal::UnknownEnumValue::Integer(value),
1560 )),
1561 }
1562 }
1563 }
1564
1565 impl std::convert::From<&str> for EndpointProtocol {
1566 fn from(value: &str) -> Self {
1567 use std::string::ToString;
1568 match value {
1569 "ENDPOINT_PROTOCOL_UNSPECIFIED" => Self::Unspecified,
1570 "THRIFT" => Self::Thrift,
1571 "GRPC" => Self::Grpc,
1572 _ => Self::UnknownValue(endpoint_protocol::UnknownValue(
1573 wkt::internal::UnknownEnumValue::String(value.to_string()),
1574 )),
1575 }
1576 }
1577 }
1578
1579 impl serde::ser::Serialize for EndpointProtocol {
1580 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1581 where
1582 S: serde::Serializer,
1583 {
1584 match self {
1585 Self::Unspecified => serializer.serialize_i32(0),
1586 Self::Thrift => serializer.serialize_i32(1),
1587 Self::Grpc => serializer.serialize_i32(2),
1588 Self::UnknownValue(u) => u.0.serialize(serializer),
1589 }
1590 }
1591 }
1592
1593 impl<'de> serde::de::Deserialize<'de> for EndpointProtocol {
1594 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1595 where
1596 D: serde::Deserializer<'de>,
1597 {
1598 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EndpointProtocol>::new(
1599 ".google.cloud.metastore.v1.HiveMetastoreConfig.EndpointProtocol",
1600 ))
1601 }
1602 }
1603}
1604
1605/// Configuration information for a Kerberos principal.
1606#[derive(Clone, Default, PartialEq)]
1607#[non_exhaustive]
1608pub struct KerberosConfig {
1609 /// A Kerberos keytab file that can be used to authenticate a service principal
1610 /// with a Kerberos Key Distribution Center (KDC).
1611 pub keytab: std::option::Option<crate::model::Secret>,
1612
1613 /// A Kerberos principal that exists in the both the keytab the KDC
1614 /// to authenticate as. A typical principal is of the form
1615 /// `primary/instance@REALM`, but there is no exact format.
1616 pub principal: std::string::String,
1617
1618 /// A Cloud Storage URI that specifies the path to a
1619 /// krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`,
1620 /// although the file does not need to be named krb5.conf explicitly.
1621 pub krb5_config_gcs_uri: std::string::String,
1622
1623 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1624}
1625
1626impl KerberosConfig {
1627 /// Creates a new default instance.
1628 pub fn new() -> Self {
1629 std::default::Default::default()
1630 }
1631
1632 /// Sets the value of [keytab][crate::model::KerberosConfig::keytab].
1633 ///
1634 /// # Example
1635 /// ```ignore,no_run
1636 /// # use google_cloud_metastore_v1::model::KerberosConfig;
1637 /// use google_cloud_metastore_v1::model::Secret;
1638 /// let x = KerberosConfig::new().set_keytab(Secret::default()/* use setters */);
1639 /// ```
1640 pub fn set_keytab<T>(mut self, v: T) -> Self
1641 where
1642 T: std::convert::Into<crate::model::Secret>,
1643 {
1644 self.keytab = std::option::Option::Some(v.into());
1645 self
1646 }
1647
1648 /// Sets or clears the value of [keytab][crate::model::KerberosConfig::keytab].
1649 ///
1650 /// # Example
1651 /// ```ignore,no_run
1652 /// # use google_cloud_metastore_v1::model::KerberosConfig;
1653 /// use google_cloud_metastore_v1::model::Secret;
1654 /// let x = KerberosConfig::new().set_or_clear_keytab(Some(Secret::default()/* use setters */));
1655 /// let x = KerberosConfig::new().set_or_clear_keytab(None::<Secret>);
1656 /// ```
1657 pub fn set_or_clear_keytab<T>(mut self, v: std::option::Option<T>) -> Self
1658 where
1659 T: std::convert::Into<crate::model::Secret>,
1660 {
1661 self.keytab = v.map(|x| x.into());
1662 self
1663 }
1664
1665 /// Sets the value of [principal][crate::model::KerberosConfig::principal].
1666 ///
1667 /// # Example
1668 /// ```ignore,no_run
1669 /// # use google_cloud_metastore_v1::model::KerberosConfig;
1670 /// let x = KerberosConfig::new().set_principal("example");
1671 /// ```
1672 pub fn set_principal<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1673 self.principal = v.into();
1674 self
1675 }
1676
1677 /// Sets the value of [krb5_config_gcs_uri][crate::model::KerberosConfig::krb5_config_gcs_uri].
1678 ///
1679 /// # Example
1680 /// ```ignore,no_run
1681 /// # use google_cloud_metastore_v1::model::KerberosConfig;
1682 /// let x = KerberosConfig::new().set_krb5_config_gcs_uri("example");
1683 /// ```
1684 pub fn set_krb5_config_gcs_uri<T: std::convert::Into<std::string::String>>(
1685 mut self,
1686 v: T,
1687 ) -> Self {
1688 self.krb5_config_gcs_uri = v.into();
1689 self
1690 }
1691}
1692
1693impl wkt::message::Message for KerberosConfig {
1694 fn typename() -> &'static str {
1695 "type.googleapis.com/google.cloud.metastore.v1.KerberosConfig"
1696 }
1697}
1698
1699/// A securely stored value.
1700#[derive(Clone, Default, PartialEq)]
1701#[non_exhaustive]
1702pub struct Secret {
1703 #[allow(missing_docs)]
1704 pub value: std::option::Option<crate::model::secret::Value>,
1705
1706 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1707}
1708
1709impl Secret {
1710 /// Creates a new default instance.
1711 pub fn new() -> Self {
1712 std::default::Default::default()
1713 }
1714
1715 /// Sets the value of [value][crate::model::Secret::value].
1716 ///
1717 /// Note that all the setters affecting `value` are mutually
1718 /// exclusive.
1719 ///
1720 /// # Example
1721 /// ```ignore,no_run
1722 /// # use google_cloud_metastore_v1::model::Secret;
1723 /// use google_cloud_metastore_v1::model::secret::Value;
1724 /// let x = Secret::new().set_value(Some(Value::CloudSecret("example".to_string())));
1725 /// ```
1726 pub fn set_value<T: std::convert::Into<std::option::Option<crate::model::secret::Value>>>(
1727 mut self,
1728 v: T,
1729 ) -> Self {
1730 self.value = v.into();
1731 self
1732 }
1733
1734 /// The value of [value][crate::model::Secret::value]
1735 /// if it holds a `CloudSecret`, `None` if the field is not set or
1736 /// holds a different branch.
1737 pub fn cloud_secret(&self) -> std::option::Option<&std::string::String> {
1738 #[allow(unreachable_patterns)]
1739 self.value.as_ref().and_then(|v| match v {
1740 crate::model::secret::Value::CloudSecret(v) => std::option::Option::Some(v),
1741 _ => std::option::Option::None,
1742 })
1743 }
1744
1745 /// Sets the value of [value][crate::model::Secret::value]
1746 /// to hold a `CloudSecret`.
1747 ///
1748 /// Note that all the setters affecting `value` are
1749 /// mutually exclusive.
1750 ///
1751 /// # Example
1752 /// ```ignore,no_run
1753 /// # use google_cloud_metastore_v1::model::Secret;
1754 /// let x = Secret::new().set_cloud_secret("example");
1755 /// assert!(x.cloud_secret().is_some());
1756 /// ```
1757 pub fn set_cloud_secret<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1758 self.value = std::option::Option::Some(crate::model::secret::Value::CloudSecret(v.into()));
1759 self
1760 }
1761}
1762
1763impl wkt::message::Message for Secret {
1764 fn typename() -> &'static str {
1765 "type.googleapis.com/google.cloud.metastore.v1.Secret"
1766 }
1767}
1768
1769/// Defines additional types related to [Secret].
1770pub mod secret {
1771 #[allow(unused_imports)]
1772 use super::*;
1773
1774 #[allow(missing_docs)]
1775 #[derive(Clone, Debug, PartialEq)]
1776 #[non_exhaustive]
1777 pub enum Value {
1778 /// The relative resource name of a Secret Manager secret version, in the
1779 /// following form:
1780 ///
1781 /// `projects/{project_number}/secrets/{secret_id}/versions/{version_id}`.
1782 CloudSecret(std::string::String),
1783 }
1784}
1785
1786/// Encryption settings for the service.
1787#[derive(Clone, Default, PartialEq)]
1788#[non_exhaustive]
1789pub struct EncryptionConfig {
1790 /// The fully qualified customer provided Cloud KMS key name to use for
1791 /// customer data encryption, in the following form:
1792 ///
1793 /// `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`.
1794 pub kms_key: std::string::String,
1795
1796 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1797}
1798
1799impl EncryptionConfig {
1800 /// Creates a new default instance.
1801 pub fn new() -> Self {
1802 std::default::Default::default()
1803 }
1804
1805 /// Sets the value of [kms_key][crate::model::EncryptionConfig::kms_key].
1806 ///
1807 /// # Example
1808 /// ```ignore,no_run
1809 /// # use google_cloud_metastore_v1::model::EncryptionConfig;
1810 /// let x = EncryptionConfig::new().set_kms_key("example");
1811 /// ```
1812 pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1813 self.kms_key = v.into();
1814 self
1815 }
1816}
1817
1818impl wkt::message::Message for EncryptionConfig {
1819 fn typename() -> &'static str {
1820 "type.googleapis.com/google.cloud.metastore.v1.EncryptionConfig"
1821 }
1822}
1823
1824/// Configuration information for the auxiliary service versions.
1825#[derive(Clone, Default, PartialEq)]
1826#[non_exhaustive]
1827pub struct AuxiliaryVersionConfig {
1828 /// The Hive metastore version of the auxiliary service. It must be less
1829 /// than the primary Hive metastore service's version.
1830 pub version: std::string::String,
1831
1832 /// A mapping of Hive metastore configuration key-value pairs to apply to the
1833 /// auxiliary Hive metastore (configured in `hive-site.xml`) in addition to
1834 /// the primary version's overrides. If keys are present in both the auxiliary
1835 /// version's overrides and the primary version's overrides, the value from
1836 /// the auxiliary version's overrides takes precedence.
1837 pub config_overrides: std::collections::HashMap<std::string::String, std::string::String>,
1838
1839 /// Output only. The network configuration contains the endpoint URI(s) of the
1840 /// auxiliary Hive metastore service.
1841 pub network_config: std::option::Option<crate::model::NetworkConfig>,
1842
1843 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1844}
1845
1846impl AuxiliaryVersionConfig {
1847 /// Creates a new default instance.
1848 pub fn new() -> Self {
1849 std::default::Default::default()
1850 }
1851
1852 /// Sets the value of [version][crate::model::AuxiliaryVersionConfig::version].
1853 ///
1854 /// # Example
1855 /// ```ignore,no_run
1856 /// # use google_cloud_metastore_v1::model::AuxiliaryVersionConfig;
1857 /// let x = AuxiliaryVersionConfig::new().set_version("example");
1858 /// ```
1859 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1860 self.version = v.into();
1861 self
1862 }
1863
1864 /// Sets the value of [config_overrides][crate::model::AuxiliaryVersionConfig::config_overrides].
1865 ///
1866 /// # Example
1867 /// ```ignore,no_run
1868 /// # use google_cloud_metastore_v1::model::AuxiliaryVersionConfig;
1869 /// let x = AuxiliaryVersionConfig::new().set_config_overrides([
1870 /// ("key0", "abc"),
1871 /// ("key1", "xyz"),
1872 /// ]);
1873 /// ```
1874 pub fn set_config_overrides<T, K, V>(mut self, v: T) -> Self
1875 where
1876 T: std::iter::IntoIterator<Item = (K, V)>,
1877 K: std::convert::Into<std::string::String>,
1878 V: std::convert::Into<std::string::String>,
1879 {
1880 use std::iter::Iterator;
1881 self.config_overrides = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1882 self
1883 }
1884
1885 /// Sets the value of [network_config][crate::model::AuxiliaryVersionConfig::network_config].
1886 ///
1887 /// # Example
1888 /// ```ignore,no_run
1889 /// # use google_cloud_metastore_v1::model::AuxiliaryVersionConfig;
1890 /// use google_cloud_metastore_v1::model::NetworkConfig;
1891 /// let x = AuxiliaryVersionConfig::new().set_network_config(NetworkConfig::default()/* use setters */);
1892 /// ```
1893 pub fn set_network_config<T>(mut self, v: T) -> Self
1894 where
1895 T: std::convert::Into<crate::model::NetworkConfig>,
1896 {
1897 self.network_config = std::option::Option::Some(v.into());
1898 self
1899 }
1900
1901 /// Sets or clears the value of [network_config][crate::model::AuxiliaryVersionConfig::network_config].
1902 ///
1903 /// # Example
1904 /// ```ignore,no_run
1905 /// # use google_cloud_metastore_v1::model::AuxiliaryVersionConfig;
1906 /// use google_cloud_metastore_v1::model::NetworkConfig;
1907 /// let x = AuxiliaryVersionConfig::new().set_or_clear_network_config(Some(NetworkConfig::default()/* use setters */));
1908 /// let x = AuxiliaryVersionConfig::new().set_or_clear_network_config(None::<NetworkConfig>);
1909 /// ```
1910 pub fn set_or_clear_network_config<T>(mut self, v: std::option::Option<T>) -> Self
1911 where
1912 T: std::convert::Into<crate::model::NetworkConfig>,
1913 {
1914 self.network_config = v.map(|x| x.into());
1915 self
1916 }
1917}
1918
1919impl wkt::message::Message for AuxiliaryVersionConfig {
1920 fn typename() -> &'static str {
1921 "type.googleapis.com/google.cloud.metastore.v1.AuxiliaryVersionConfig"
1922 }
1923}
1924
1925/// Network configuration for the Dataproc Metastore service.
1926///
1927/// Next available ID: 4
1928#[derive(Clone, Default, PartialEq)]
1929#[non_exhaustive]
1930pub struct NetworkConfig {
1931 /// Immutable. The consumer-side network configuration for the Dataproc
1932 /// Metastore instance.
1933 pub consumers: std::vec::Vec<crate::model::network_config::Consumer>,
1934
1935 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1936}
1937
1938impl NetworkConfig {
1939 /// Creates a new default instance.
1940 pub fn new() -> Self {
1941 std::default::Default::default()
1942 }
1943
1944 /// Sets the value of [consumers][crate::model::NetworkConfig::consumers].
1945 ///
1946 /// # Example
1947 /// ```ignore,no_run
1948 /// # use google_cloud_metastore_v1::model::NetworkConfig;
1949 /// use google_cloud_metastore_v1::model::network_config::Consumer;
1950 /// let x = NetworkConfig::new()
1951 /// .set_consumers([
1952 /// Consumer::default()/* use setters */,
1953 /// Consumer::default()/* use (different) setters */,
1954 /// ]);
1955 /// ```
1956 pub fn set_consumers<T, V>(mut self, v: T) -> Self
1957 where
1958 T: std::iter::IntoIterator<Item = V>,
1959 V: std::convert::Into<crate::model::network_config::Consumer>,
1960 {
1961 use std::iter::Iterator;
1962 self.consumers = v.into_iter().map(|i| i.into()).collect();
1963 self
1964 }
1965}
1966
1967impl wkt::message::Message for NetworkConfig {
1968 fn typename() -> &'static str {
1969 "type.googleapis.com/google.cloud.metastore.v1.NetworkConfig"
1970 }
1971}
1972
1973/// Defines additional types related to [NetworkConfig].
1974pub mod network_config {
1975 #[allow(unused_imports)]
1976 use super::*;
1977
1978 /// Contains information of the customer's network configurations.
1979 ///
1980 /// Next available ID: 5
1981 #[derive(Clone, Default, PartialEq)]
1982 #[non_exhaustive]
1983 pub struct Consumer {
1984 /// Output only. The URI of the endpoint used to access the metastore
1985 /// service.
1986 pub endpoint_uri: std::string::String,
1987
1988 /// Output only. The location of the endpoint URI. Format:
1989 /// `projects/{project}/locations/{location}`.
1990 pub endpoint_location: std::string::String,
1991
1992 #[allow(missing_docs)]
1993 pub vpc_resource: std::option::Option<crate::model::network_config::consumer::VpcResource>,
1994
1995 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1996 }
1997
1998 impl Consumer {
1999 /// Creates a new default instance.
2000 pub fn new() -> Self {
2001 std::default::Default::default()
2002 }
2003
2004 /// Sets the value of [endpoint_uri][crate::model::network_config::Consumer::endpoint_uri].
2005 ///
2006 /// # Example
2007 /// ```ignore,no_run
2008 /// # use google_cloud_metastore_v1::model::network_config::Consumer;
2009 /// let x = Consumer::new().set_endpoint_uri("example");
2010 /// ```
2011 pub fn set_endpoint_uri<T: std::convert::Into<std::string::String>>(
2012 mut self,
2013 v: T,
2014 ) -> Self {
2015 self.endpoint_uri = v.into();
2016 self
2017 }
2018
2019 /// Sets the value of [endpoint_location][crate::model::network_config::Consumer::endpoint_location].
2020 ///
2021 /// # Example
2022 /// ```ignore,no_run
2023 /// # use google_cloud_metastore_v1::model::network_config::Consumer;
2024 /// let x = Consumer::new().set_endpoint_location("example");
2025 /// ```
2026 pub fn set_endpoint_location<T: std::convert::Into<std::string::String>>(
2027 mut self,
2028 v: T,
2029 ) -> Self {
2030 self.endpoint_location = v.into();
2031 self
2032 }
2033
2034 /// Sets the value of [vpc_resource][crate::model::network_config::Consumer::vpc_resource].
2035 ///
2036 /// Note that all the setters affecting `vpc_resource` are mutually
2037 /// exclusive.
2038 ///
2039 /// # Example
2040 /// ```ignore,no_run
2041 /// # use google_cloud_metastore_v1::model::network_config::Consumer;
2042 /// use google_cloud_metastore_v1::model::network_config::consumer::VpcResource;
2043 /// let x = Consumer::new().set_vpc_resource(Some(VpcResource::Subnetwork("example".to_string())));
2044 /// ```
2045 pub fn set_vpc_resource<
2046 T: std::convert::Into<
2047 std::option::Option<crate::model::network_config::consumer::VpcResource>,
2048 >,
2049 >(
2050 mut self,
2051 v: T,
2052 ) -> Self {
2053 self.vpc_resource = v.into();
2054 self
2055 }
2056
2057 /// The value of [vpc_resource][crate::model::network_config::Consumer::vpc_resource]
2058 /// if it holds a `Subnetwork`, `None` if the field is not set or
2059 /// holds a different branch.
2060 pub fn subnetwork(&self) -> std::option::Option<&std::string::String> {
2061 #[allow(unreachable_patterns)]
2062 self.vpc_resource.as_ref().and_then(|v| match v {
2063 crate::model::network_config::consumer::VpcResource::Subnetwork(v) => {
2064 std::option::Option::Some(v)
2065 }
2066 _ => std::option::Option::None,
2067 })
2068 }
2069
2070 /// Sets the value of [vpc_resource][crate::model::network_config::Consumer::vpc_resource]
2071 /// to hold a `Subnetwork`.
2072 ///
2073 /// Note that all the setters affecting `vpc_resource` are
2074 /// mutually exclusive.
2075 ///
2076 /// # Example
2077 /// ```ignore,no_run
2078 /// # use google_cloud_metastore_v1::model::network_config::Consumer;
2079 /// let x = Consumer::new().set_subnetwork("example");
2080 /// assert!(x.subnetwork().is_some());
2081 /// ```
2082 pub fn set_subnetwork<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2083 self.vpc_resource = std::option::Option::Some(
2084 crate::model::network_config::consumer::VpcResource::Subnetwork(v.into()),
2085 );
2086 self
2087 }
2088 }
2089
2090 impl wkt::message::Message for Consumer {
2091 fn typename() -> &'static str {
2092 "type.googleapis.com/google.cloud.metastore.v1.NetworkConfig.Consumer"
2093 }
2094 }
2095
2096 /// Defines additional types related to [Consumer].
2097 pub mod consumer {
2098 #[allow(unused_imports)]
2099 use super::*;
2100
2101 #[allow(missing_docs)]
2102 #[derive(Clone, Debug, PartialEq)]
2103 #[non_exhaustive]
2104 pub enum VpcResource {
2105 /// Immutable. The subnetwork of the customer project from which an IP
2106 /// address is reserved and used as the Dataproc Metastore service's
2107 /// endpoint. It is accessible to hosts in the subnet and to all
2108 /// hosts in a subnet in the same region and same network. There must
2109 /// be at least one IP address available in the subnet's primary range. The
2110 /// subnet is specified in the following form:
2111 ///
2112 /// `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id}`
2113 Subnetwork(std::string::String),
2114 }
2115 }
2116}
2117
2118/// Telemetry Configuration for the Dataproc Metastore service.
2119#[derive(Clone, Default, PartialEq)]
2120#[non_exhaustive]
2121pub struct TelemetryConfig {
2122 /// The output format of the Dataproc Metastore service's logs.
2123 pub log_format: crate::model::telemetry_config::LogFormat,
2124
2125 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2126}
2127
2128impl TelemetryConfig {
2129 /// Creates a new default instance.
2130 pub fn new() -> Self {
2131 std::default::Default::default()
2132 }
2133
2134 /// Sets the value of [log_format][crate::model::TelemetryConfig::log_format].
2135 ///
2136 /// # Example
2137 /// ```ignore,no_run
2138 /// # use google_cloud_metastore_v1::model::TelemetryConfig;
2139 /// use google_cloud_metastore_v1::model::telemetry_config::LogFormat;
2140 /// let x0 = TelemetryConfig::new().set_log_format(LogFormat::Legacy);
2141 /// let x1 = TelemetryConfig::new().set_log_format(LogFormat::Json);
2142 /// ```
2143 pub fn set_log_format<T: std::convert::Into<crate::model::telemetry_config::LogFormat>>(
2144 mut self,
2145 v: T,
2146 ) -> Self {
2147 self.log_format = v.into();
2148 self
2149 }
2150}
2151
2152impl wkt::message::Message for TelemetryConfig {
2153 fn typename() -> &'static str {
2154 "type.googleapis.com/google.cloud.metastore.v1.TelemetryConfig"
2155 }
2156}
2157
2158/// Defines additional types related to [TelemetryConfig].
2159pub mod telemetry_config {
2160 #[allow(unused_imports)]
2161 use super::*;
2162
2163 /// Enum for [LogFormat].
2164 ///
2165 /// # Working with unknown values
2166 ///
2167 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2168 /// additional enum variants at any time. Adding new variants is not considered
2169 /// a breaking change. Applications should write their code in anticipation of:
2170 ///
2171 /// - New values appearing in future releases of the client library, **and**
2172 /// - New values received dynamically, without application changes.
2173 ///
2174 /// Please consult the [Working with enums] section in the user guide for some
2175 /// guidelines.
2176 ///
2177 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2178 #[derive(Clone, Debug, PartialEq)]
2179 #[non_exhaustive]
2180 pub enum LogFormat {
2181 /// The LOG_FORMAT is not set.
2182 Unspecified,
2183 /// Logging output uses the legacy `textPayload` format.
2184 Legacy,
2185 /// Logging output uses the `jsonPayload` format.
2186 Json,
2187 /// If set, the enum was initialized with an unknown value.
2188 ///
2189 /// Applications can examine the value using [LogFormat::value] or
2190 /// [LogFormat::name].
2191 UnknownValue(log_format::UnknownValue),
2192 }
2193
2194 #[doc(hidden)]
2195 pub mod log_format {
2196 #[allow(unused_imports)]
2197 use super::*;
2198 #[derive(Clone, Debug, PartialEq)]
2199 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2200 }
2201
2202 impl LogFormat {
2203 /// Gets the enum value.
2204 ///
2205 /// Returns `None` if the enum contains an unknown value deserialized from
2206 /// the string representation of enums.
2207 pub fn value(&self) -> std::option::Option<i32> {
2208 match self {
2209 Self::Unspecified => std::option::Option::Some(0),
2210 Self::Legacy => std::option::Option::Some(1),
2211 Self::Json => std::option::Option::Some(2),
2212 Self::UnknownValue(u) => u.0.value(),
2213 }
2214 }
2215
2216 /// Gets the enum value as a string.
2217 ///
2218 /// Returns `None` if the enum contains an unknown value deserialized from
2219 /// the integer representation of enums.
2220 pub fn name(&self) -> std::option::Option<&str> {
2221 match self {
2222 Self::Unspecified => std::option::Option::Some("LOG_FORMAT_UNSPECIFIED"),
2223 Self::Legacy => std::option::Option::Some("LEGACY"),
2224 Self::Json => std::option::Option::Some("JSON"),
2225 Self::UnknownValue(u) => u.0.name(),
2226 }
2227 }
2228 }
2229
2230 impl std::default::Default for LogFormat {
2231 fn default() -> Self {
2232 use std::convert::From;
2233 Self::from(0)
2234 }
2235 }
2236
2237 impl std::fmt::Display for LogFormat {
2238 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2239 wkt::internal::display_enum(f, self.name(), self.value())
2240 }
2241 }
2242
2243 impl std::convert::From<i32> for LogFormat {
2244 fn from(value: i32) -> Self {
2245 match value {
2246 0 => Self::Unspecified,
2247 1 => Self::Legacy,
2248 2 => Self::Json,
2249 _ => Self::UnknownValue(log_format::UnknownValue(
2250 wkt::internal::UnknownEnumValue::Integer(value),
2251 )),
2252 }
2253 }
2254 }
2255
2256 impl std::convert::From<&str> for LogFormat {
2257 fn from(value: &str) -> Self {
2258 use std::string::ToString;
2259 match value {
2260 "LOG_FORMAT_UNSPECIFIED" => Self::Unspecified,
2261 "LEGACY" => Self::Legacy,
2262 "JSON" => Self::Json,
2263 _ => Self::UnknownValue(log_format::UnknownValue(
2264 wkt::internal::UnknownEnumValue::String(value.to_string()),
2265 )),
2266 }
2267 }
2268 }
2269
2270 impl serde::ser::Serialize for LogFormat {
2271 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2272 where
2273 S: serde::Serializer,
2274 {
2275 match self {
2276 Self::Unspecified => serializer.serialize_i32(0),
2277 Self::Legacy => serializer.serialize_i32(1),
2278 Self::Json => serializer.serialize_i32(2),
2279 Self::UnknownValue(u) => u.0.serialize(serializer),
2280 }
2281 }
2282 }
2283
2284 impl<'de> serde::de::Deserialize<'de> for LogFormat {
2285 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2286 where
2287 D: serde::Deserializer<'de>,
2288 {
2289 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LogFormat>::new(
2290 ".google.cloud.metastore.v1.TelemetryConfig.LogFormat",
2291 ))
2292 }
2293 }
2294}
2295
2296/// The metadata management activities of the metastore service.
2297#[derive(Clone, Default, PartialEq)]
2298#[non_exhaustive]
2299pub struct MetadataManagementActivity {
2300 /// Output only. The latest metadata exports of the metastore service.
2301 pub metadata_exports: std::vec::Vec<crate::model::MetadataExport>,
2302
2303 /// Output only. The latest restores of the metastore service.
2304 pub restores: std::vec::Vec<crate::model::Restore>,
2305
2306 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2307}
2308
2309impl MetadataManagementActivity {
2310 /// Creates a new default instance.
2311 pub fn new() -> Self {
2312 std::default::Default::default()
2313 }
2314
2315 /// Sets the value of [metadata_exports][crate::model::MetadataManagementActivity::metadata_exports].
2316 ///
2317 /// # Example
2318 /// ```ignore,no_run
2319 /// # use google_cloud_metastore_v1::model::MetadataManagementActivity;
2320 /// use google_cloud_metastore_v1::model::MetadataExport;
2321 /// let x = MetadataManagementActivity::new()
2322 /// .set_metadata_exports([
2323 /// MetadataExport::default()/* use setters */,
2324 /// MetadataExport::default()/* use (different) setters */,
2325 /// ]);
2326 /// ```
2327 pub fn set_metadata_exports<T, V>(mut self, v: T) -> Self
2328 where
2329 T: std::iter::IntoIterator<Item = V>,
2330 V: std::convert::Into<crate::model::MetadataExport>,
2331 {
2332 use std::iter::Iterator;
2333 self.metadata_exports = v.into_iter().map(|i| i.into()).collect();
2334 self
2335 }
2336
2337 /// Sets the value of [restores][crate::model::MetadataManagementActivity::restores].
2338 ///
2339 /// # Example
2340 /// ```ignore,no_run
2341 /// # use google_cloud_metastore_v1::model::MetadataManagementActivity;
2342 /// use google_cloud_metastore_v1::model::Restore;
2343 /// let x = MetadataManagementActivity::new()
2344 /// .set_restores([
2345 /// Restore::default()/* use setters */,
2346 /// Restore::default()/* use (different) setters */,
2347 /// ]);
2348 /// ```
2349 pub fn set_restores<T, V>(mut self, v: T) -> Self
2350 where
2351 T: std::iter::IntoIterator<Item = V>,
2352 V: std::convert::Into<crate::model::Restore>,
2353 {
2354 use std::iter::Iterator;
2355 self.restores = v.into_iter().map(|i| i.into()).collect();
2356 self
2357 }
2358}
2359
2360impl wkt::message::Message for MetadataManagementActivity {
2361 fn typename() -> &'static str {
2362 "type.googleapis.com/google.cloud.metastore.v1.MetadataManagementActivity"
2363 }
2364}
2365
2366/// A metastore resource that imports metadata.
2367#[derive(Clone, Default, PartialEq)]
2368#[non_exhaustive]
2369pub struct MetadataImport {
2370 /// Immutable. The relative resource name of the metadata import, of the form:
2371 ///
2372 /// `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}`.
2373 pub name: std::string::String,
2374
2375 /// The description of the metadata import.
2376 pub description: std::string::String,
2377
2378 /// Output only. The time when the metadata import was started.
2379 pub create_time: std::option::Option<wkt::Timestamp>,
2380
2381 /// Output only. The time when the metadata import was last updated.
2382 pub update_time: std::option::Option<wkt::Timestamp>,
2383
2384 /// Output only. The time when the metadata import finished.
2385 pub end_time: std::option::Option<wkt::Timestamp>,
2386
2387 /// Output only. The current state of the metadata import.
2388 pub state: crate::model::metadata_import::State,
2389
2390 /// The metadata to be imported.
2391 pub metadata: std::option::Option<crate::model::metadata_import::Metadata>,
2392
2393 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2394}
2395
2396impl MetadataImport {
2397 /// Creates a new default instance.
2398 pub fn new() -> Self {
2399 std::default::Default::default()
2400 }
2401
2402 /// Sets the value of [name][crate::model::MetadataImport::name].
2403 ///
2404 /// # Example
2405 /// ```ignore,no_run
2406 /// # use google_cloud_metastore_v1::model::MetadataImport;
2407 /// # let project_id = "project_id";
2408 /// # let location_id = "location_id";
2409 /// # let service_id = "service_id";
2410 /// # let metadata_import_id = "metadata_import_id";
2411 /// let x = MetadataImport::new().set_name(format!("projects/{project_id}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}"));
2412 /// ```
2413 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2414 self.name = v.into();
2415 self
2416 }
2417
2418 /// Sets the value of [description][crate::model::MetadataImport::description].
2419 ///
2420 /// # Example
2421 /// ```ignore,no_run
2422 /// # use google_cloud_metastore_v1::model::MetadataImport;
2423 /// let x = MetadataImport::new().set_description("example");
2424 /// ```
2425 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2426 self.description = v.into();
2427 self
2428 }
2429
2430 /// Sets the value of [create_time][crate::model::MetadataImport::create_time].
2431 ///
2432 /// # Example
2433 /// ```ignore,no_run
2434 /// # use google_cloud_metastore_v1::model::MetadataImport;
2435 /// use wkt::Timestamp;
2436 /// let x = MetadataImport::new().set_create_time(Timestamp::default()/* use setters */);
2437 /// ```
2438 pub fn set_create_time<T>(mut self, v: T) -> Self
2439 where
2440 T: std::convert::Into<wkt::Timestamp>,
2441 {
2442 self.create_time = std::option::Option::Some(v.into());
2443 self
2444 }
2445
2446 /// Sets or clears the value of [create_time][crate::model::MetadataImport::create_time].
2447 ///
2448 /// # Example
2449 /// ```ignore,no_run
2450 /// # use google_cloud_metastore_v1::model::MetadataImport;
2451 /// use wkt::Timestamp;
2452 /// let x = MetadataImport::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2453 /// let x = MetadataImport::new().set_or_clear_create_time(None::<Timestamp>);
2454 /// ```
2455 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2456 where
2457 T: std::convert::Into<wkt::Timestamp>,
2458 {
2459 self.create_time = v.map(|x| x.into());
2460 self
2461 }
2462
2463 /// Sets the value of [update_time][crate::model::MetadataImport::update_time].
2464 ///
2465 /// # Example
2466 /// ```ignore,no_run
2467 /// # use google_cloud_metastore_v1::model::MetadataImport;
2468 /// use wkt::Timestamp;
2469 /// let x = MetadataImport::new().set_update_time(Timestamp::default()/* use setters */);
2470 /// ```
2471 pub fn set_update_time<T>(mut self, v: T) -> Self
2472 where
2473 T: std::convert::Into<wkt::Timestamp>,
2474 {
2475 self.update_time = std::option::Option::Some(v.into());
2476 self
2477 }
2478
2479 /// Sets or clears the value of [update_time][crate::model::MetadataImport::update_time].
2480 ///
2481 /// # Example
2482 /// ```ignore,no_run
2483 /// # use google_cloud_metastore_v1::model::MetadataImport;
2484 /// use wkt::Timestamp;
2485 /// let x = MetadataImport::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2486 /// let x = MetadataImport::new().set_or_clear_update_time(None::<Timestamp>);
2487 /// ```
2488 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2489 where
2490 T: std::convert::Into<wkt::Timestamp>,
2491 {
2492 self.update_time = v.map(|x| x.into());
2493 self
2494 }
2495
2496 /// Sets the value of [end_time][crate::model::MetadataImport::end_time].
2497 ///
2498 /// # Example
2499 /// ```ignore,no_run
2500 /// # use google_cloud_metastore_v1::model::MetadataImport;
2501 /// use wkt::Timestamp;
2502 /// let x = MetadataImport::new().set_end_time(Timestamp::default()/* use setters */);
2503 /// ```
2504 pub fn set_end_time<T>(mut self, v: T) -> Self
2505 where
2506 T: std::convert::Into<wkt::Timestamp>,
2507 {
2508 self.end_time = std::option::Option::Some(v.into());
2509 self
2510 }
2511
2512 /// Sets or clears the value of [end_time][crate::model::MetadataImport::end_time].
2513 ///
2514 /// # Example
2515 /// ```ignore,no_run
2516 /// # use google_cloud_metastore_v1::model::MetadataImport;
2517 /// use wkt::Timestamp;
2518 /// let x = MetadataImport::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2519 /// let x = MetadataImport::new().set_or_clear_end_time(None::<Timestamp>);
2520 /// ```
2521 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2522 where
2523 T: std::convert::Into<wkt::Timestamp>,
2524 {
2525 self.end_time = v.map(|x| x.into());
2526 self
2527 }
2528
2529 /// Sets the value of [state][crate::model::MetadataImport::state].
2530 ///
2531 /// # Example
2532 /// ```ignore,no_run
2533 /// # use google_cloud_metastore_v1::model::MetadataImport;
2534 /// use google_cloud_metastore_v1::model::metadata_import::State;
2535 /// let x0 = MetadataImport::new().set_state(State::Running);
2536 /// let x1 = MetadataImport::new().set_state(State::Succeeded);
2537 /// let x2 = MetadataImport::new().set_state(State::Updating);
2538 /// ```
2539 pub fn set_state<T: std::convert::Into<crate::model::metadata_import::State>>(
2540 mut self,
2541 v: T,
2542 ) -> Self {
2543 self.state = v.into();
2544 self
2545 }
2546
2547 /// Sets the value of [metadata][crate::model::MetadataImport::metadata].
2548 ///
2549 /// Note that all the setters affecting `metadata` are mutually
2550 /// exclusive.
2551 ///
2552 /// # Example
2553 /// ```ignore,no_run
2554 /// # use google_cloud_metastore_v1::model::MetadataImport;
2555 /// use google_cloud_metastore_v1::model::metadata_import::DatabaseDump;
2556 /// let x = MetadataImport::new().set_metadata(Some(
2557 /// google_cloud_metastore_v1::model::metadata_import::Metadata::DatabaseDump(DatabaseDump::default().into())));
2558 /// ```
2559 pub fn set_metadata<
2560 T: std::convert::Into<std::option::Option<crate::model::metadata_import::Metadata>>,
2561 >(
2562 mut self,
2563 v: T,
2564 ) -> Self {
2565 self.metadata = v.into();
2566 self
2567 }
2568
2569 /// The value of [metadata][crate::model::MetadataImport::metadata]
2570 /// if it holds a `DatabaseDump`, `None` if the field is not set or
2571 /// holds a different branch.
2572 pub fn database_dump(
2573 &self,
2574 ) -> std::option::Option<&std::boxed::Box<crate::model::metadata_import::DatabaseDump>> {
2575 #[allow(unreachable_patterns)]
2576 self.metadata.as_ref().and_then(|v| match v {
2577 crate::model::metadata_import::Metadata::DatabaseDump(v) => {
2578 std::option::Option::Some(v)
2579 }
2580 _ => std::option::Option::None,
2581 })
2582 }
2583
2584 /// Sets the value of [metadata][crate::model::MetadataImport::metadata]
2585 /// to hold a `DatabaseDump`.
2586 ///
2587 /// Note that all the setters affecting `metadata` are
2588 /// mutually exclusive.
2589 ///
2590 /// # Example
2591 /// ```ignore,no_run
2592 /// # use google_cloud_metastore_v1::model::MetadataImport;
2593 /// use google_cloud_metastore_v1::model::metadata_import::DatabaseDump;
2594 /// let x = MetadataImport::new().set_database_dump(DatabaseDump::default()/* use setters */);
2595 /// assert!(x.database_dump().is_some());
2596 /// ```
2597 pub fn set_database_dump<
2598 T: std::convert::Into<std::boxed::Box<crate::model::metadata_import::DatabaseDump>>,
2599 >(
2600 mut self,
2601 v: T,
2602 ) -> Self {
2603 self.metadata = std::option::Option::Some(
2604 crate::model::metadata_import::Metadata::DatabaseDump(v.into()),
2605 );
2606 self
2607 }
2608}
2609
2610impl wkt::message::Message for MetadataImport {
2611 fn typename() -> &'static str {
2612 "type.googleapis.com/google.cloud.metastore.v1.MetadataImport"
2613 }
2614}
2615
2616/// Defines additional types related to [MetadataImport].
2617pub mod metadata_import {
2618 #[allow(unused_imports)]
2619 use super::*;
2620
2621 /// A specification of the location of and metadata about a database dump from
2622 /// a relational database management system.
2623 #[derive(Clone, Default, PartialEq)]
2624 #[non_exhaustive]
2625 pub struct DatabaseDump {
2626 /// The type of the database.
2627 #[deprecated]
2628 pub database_type: crate::model::metadata_import::database_dump::DatabaseType,
2629
2630 /// A Cloud Storage object or folder URI that specifies the source from which
2631 /// to import metadata. It must begin with `gs://`.
2632 pub gcs_uri: std::string::String,
2633
2634 /// The name of the source database.
2635 #[deprecated]
2636 pub source_database: std::string::String,
2637
2638 /// Optional. The type of the database dump. If unspecified, defaults to
2639 /// `MYSQL`.
2640 pub r#type: crate::model::database_dump_spec::Type,
2641
2642 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2643 }
2644
2645 impl DatabaseDump {
2646 /// Creates a new default instance.
2647 pub fn new() -> Self {
2648 std::default::Default::default()
2649 }
2650
2651 /// Sets the value of [database_type][crate::model::metadata_import::DatabaseDump::database_type].
2652 ///
2653 /// # Example
2654 /// ```ignore,no_run
2655 /// # use google_cloud_metastore_v1::model::metadata_import::DatabaseDump;
2656 /// use google_cloud_metastore_v1::model::metadata_import::database_dump::DatabaseType;
2657 /// let x0 = DatabaseDump::new().set_database_type(DatabaseType::Mysql);
2658 /// ```
2659 #[deprecated]
2660 pub fn set_database_type<
2661 T: std::convert::Into<crate::model::metadata_import::database_dump::DatabaseType>,
2662 >(
2663 mut self,
2664 v: T,
2665 ) -> Self {
2666 self.database_type = v.into();
2667 self
2668 }
2669
2670 /// Sets the value of [gcs_uri][crate::model::metadata_import::DatabaseDump::gcs_uri].
2671 ///
2672 /// # Example
2673 /// ```ignore,no_run
2674 /// # use google_cloud_metastore_v1::model::metadata_import::DatabaseDump;
2675 /// let x = DatabaseDump::new().set_gcs_uri("example");
2676 /// ```
2677 pub fn set_gcs_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2678 self.gcs_uri = v.into();
2679 self
2680 }
2681
2682 /// Sets the value of [source_database][crate::model::metadata_import::DatabaseDump::source_database].
2683 ///
2684 /// # Example
2685 /// ```ignore,no_run
2686 /// # use google_cloud_metastore_v1::model::metadata_import::DatabaseDump;
2687 /// let x = DatabaseDump::new().set_source_database("example");
2688 /// ```
2689 #[deprecated]
2690 pub fn set_source_database<T: std::convert::Into<std::string::String>>(
2691 mut self,
2692 v: T,
2693 ) -> Self {
2694 self.source_database = v.into();
2695 self
2696 }
2697
2698 /// Sets the value of [r#type][crate::model::metadata_import::DatabaseDump::type].
2699 ///
2700 /// # Example
2701 /// ```ignore,no_run
2702 /// # use google_cloud_metastore_v1::model::metadata_import::DatabaseDump;
2703 /// use google_cloud_metastore_v1::model::database_dump_spec::Type;
2704 /// let x0 = DatabaseDump::new().set_type(Type::Mysql);
2705 /// let x1 = DatabaseDump::new().set_type(Type::Avro);
2706 /// ```
2707 pub fn set_type<T: std::convert::Into<crate::model::database_dump_spec::Type>>(
2708 mut self,
2709 v: T,
2710 ) -> Self {
2711 self.r#type = v.into();
2712 self
2713 }
2714 }
2715
2716 impl wkt::message::Message for DatabaseDump {
2717 fn typename() -> &'static str {
2718 "type.googleapis.com/google.cloud.metastore.v1.MetadataImport.DatabaseDump"
2719 }
2720 }
2721
2722 /// Defines additional types related to [DatabaseDump].
2723 pub mod database_dump {
2724 #[allow(unused_imports)]
2725 use super::*;
2726
2727 /// The type of the database.
2728 ///
2729 /// # Working with unknown values
2730 ///
2731 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2732 /// additional enum variants at any time. Adding new variants is not considered
2733 /// a breaking change. Applications should write their code in anticipation of:
2734 ///
2735 /// - New values appearing in future releases of the client library, **and**
2736 /// - New values received dynamically, without application changes.
2737 ///
2738 /// Please consult the [Working with enums] section in the user guide for some
2739 /// guidelines.
2740 ///
2741 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2742 #[derive(Clone, Debug, PartialEq)]
2743 #[non_exhaustive]
2744 pub enum DatabaseType {
2745 /// The type of the source database is unknown.
2746 Unspecified,
2747 /// The type of the source database is MySQL.
2748 Mysql,
2749 /// If set, the enum was initialized with an unknown value.
2750 ///
2751 /// Applications can examine the value using [DatabaseType::value] or
2752 /// [DatabaseType::name].
2753 UnknownValue(database_type::UnknownValue),
2754 }
2755
2756 #[doc(hidden)]
2757 pub mod database_type {
2758 #[allow(unused_imports)]
2759 use super::*;
2760 #[derive(Clone, Debug, PartialEq)]
2761 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2762 }
2763
2764 impl DatabaseType {
2765 /// Gets the enum value.
2766 ///
2767 /// Returns `None` if the enum contains an unknown value deserialized from
2768 /// the string representation of enums.
2769 pub fn value(&self) -> std::option::Option<i32> {
2770 match self {
2771 Self::Unspecified => std::option::Option::Some(0),
2772 Self::Mysql => std::option::Option::Some(1),
2773 Self::UnknownValue(u) => u.0.value(),
2774 }
2775 }
2776
2777 /// Gets the enum value as a string.
2778 ///
2779 /// Returns `None` if the enum contains an unknown value deserialized from
2780 /// the integer representation of enums.
2781 pub fn name(&self) -> std::option::Option<&str> {
2782 match self {
2783 Self::Unspecified => std::option::Option::Some("DATABASE_TYPE_UNSPECIFIED"),
2784 Self::Mysql => std::option::Option::Some("MYSQL"),
2785 Self::UnknownValue(u) => u.0.name(),
2786 }
2787 }
2788 }
2789
2790 impl std::default::Default for DatabaseType {
2791 fn default() -> Self {
2792 use std::convert::From;
2793 Self::from(0)
2794 }
2795 }
2796
2797 impl std::fmt::Display for DatabaseType {
2798 fn fmt(
2799 &self,
2800 f: &mut std::fmt::Formatter<'_>,
2801 ) -> std::result::Result<(), std::fmt::Error> {
2802 wkt::internal::display_enum(f, self.name(), self.value())
2803 }
2804 }
2805
2806 impl std::convert::From<i32> for DatabaseType {
2807 fn from(value: i32) -> Self {
2808 match value {
2809 0 => Self::Unspecified,
2810 1 => Self::Mysql,
2811 _ => Self::UnknownValue(database_type::UnknownValue(
2812 wkt::internal::UnknownEnumValue::Integer(value),
2813 )),
2814 }
2815 }
2816 }
2817
2818 impl std::convert::From<&str> for DatabaseType {
2819 fn from(value: &str) -> Self {
2820 use std::string::ToString;
2821 match value {
2822 "DATABASE_TYPE_UNSPECIFIED" => Self::Unspecified,
2823 "MYSQL" => Self::Mysql,
2824 _ => Self::UnknownValue(database_type::UnknownValue(
2825 wkt::internal::UnknownEnumValue::String(value.to_string()),
2826 )),
2827 }
2828 }
2829 }
2830
2831 impl serde::ser::Serialize for DatabaseType {
2832 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2833 where
2834 S: serde::Serializer,
2835 {
2836 match self {
2837 Self::Unspecified => serializer.serialize_i32(0),
2838 Self::Mysql => serializer.serialize_i32(1),
2839 Self::UnknownValue(u) => u.0.serialize(serializer),
2840 }
2841 }
2842 }
2843
2844 impl<'de> serde::de::Deserialize<'de> for DatabaseType {
2845 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2846 where
2847 D: serde::Deserializer<'de>,
2848 {
2849 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseType>::new(
2850 ".google.cloud.metastore.v1.MetadataImport.DatabaseDump.DatabaseType",
2851 ))
2852 }
2853 }
2854 }
2855
2856 /// The current state of the metadata import.
2857 ///
2858 /// # Working with unknown values
2859 ///
2860 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2861 /// additional enum variants at any time. Adding new variants is not considered
2862 /// a breaking change. Applications should write their code in anticipation of:
2863 ///
2864 /// - New values appearing in future releases of the client library, **and**
2865 /// - New values received dynamically, without application changes.
2866 ///
2867 /// Please consult the [Working with enums] section in the user guide for some
2868 /// guidelines.
2869 ///
2870 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2871 #[derive(Clone, Debug, PartialEq)]
2872 #[non_exhaustive]
2873 pub enum State {
2874 /// The state of the metadata import is unknown.
2875 Unspecified,
2876 /// The metadata import is running.
2877 Running,
2878 /// The metadata import completed successfully.
2879 Succeeded,
2880 /// The metadata import is being updated.
2881 Updating,
2882 /// The metadata import failed, and attempted metadata changes were rolled
2883 /// back.
2884 Failed,
2885 /// If set, the enum was initialized with an unknown value.
2886 ///
2887 /// Applications can examine the value using [State::value] or
2888 /// [State::name].
2889 UnknownValue(state::UnknownValue),
2890 }
2891
2892 #[doc(hidden)]
2893 pub mod state {
2894 #[allow(unused_imports)]
2895 use super::*;
2896 #[derive(Clone, Debug, PartialEq)]
2897 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2898 }
2899
2900 impl State {
2901 /// Gets the enum value.
2902 ///
2903 /// Returns `None` if the enum contains an unknown value deserialized from
2904 /// the string representation of enums.
2905 pub fn value(&self) -> std::option::Option<i32> {
2906 match self {
2907 Self::Unspecified => std::option::Option::Some(0),
2908 Self::Running => std::option::Option::Some(1),
2909 Self::Succeeded => std::option::Option::Some(2),
2910 Self::Updating => std::option::Option::Some(3),
2911 Self::Failed => std::option::Option::Some(4),
2912 Self::UnknownValue(u) => u.0.value(),
2913 }
2914 }
2915
2916 /// Gets the enum value as a string.
2917 ///
2918 /// Returns `None` if the enum contains an unknown value deserialized from
2919 /// the integer representation of enums.
2920 pub fn name(&self) -> std::option::Option<&str> {
2921 match self {
2922 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2923 Self::Running => std::option::Option::Some("RUNNING"),
2924 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
2925 Self::Updating => std::option::Option::Some("UPDATING"),
2926 Self::Failed => std::option::Option::Some("FAILED"),
2927 Self::UnknownValue(u) => u.0.name(),
2928 }
2929 }
2930 }
2931
2932 impl std::default::Default for State {
2933 fn default() -> Self {
2934 use std::convert::From;
2935 Self::from(0)
2936 }
2937 }
2938
2939 impl std::fmt::Display for State {
2940 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2941 wkt::internal::display_enum(f, self.name(), self.value())
2942 }
2943 }
2944
2945 impl std::convert::From<i32> for State {
2946 fn from(value: i32) -> Self {
2947 match value {
2948 0 => Self::Unspecified,
2949 1 => Self::Running,
2950 2 => Self::Succeeded,
2951 3 => Self::Updating,
2952 4 => Self::Failed,
2953 _ => Self::UnknownValue(state::UnknownValue(
2954 wkt::internal::UnknownEnumValue::Integer(value),
2955 )),
2956 }
2957 }
2958 }
2959
2960 impl std::convert::From<&str> for State {
2961 fn from(value: &str) -> Self {
2962 use std::string::ToString;
2963 match value {
2964 "STATE_UNSPECIFIED" => Self::Unspecified,
2965 "RUNNING" => Self::Running,
2966 "SUCCEEDED" => Self::Succeeded,
2967 "UPDATING" => Self::Updating,
2968 "FAILED" => Self::Failed,
2969 _ => Self::UnknownValue(state::UnknownValue(
2970 wkt::internal::UnknownEnumValue::String(value.to_string()),
2971 )),
2972 }
2973 }
2974 }
2975
2976 impl serde::ser::Serialize for State {
2977 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2978 where
2979 S: serde::Serializer,
2980 {
2981 match self {
2982 Self::Unspecified => serializer.serialize_i32(0),
2983 Self::Running => serializer.serialize_i32(1),
2984 Self::Succeeded => serializer.serialize_i32(2),
2985 Self::Updating => serializer.serialize_i32(3),
2986 Self::Failed => serializer.serialize_i32(4),
2987 Self::UnknownValue(u) => u.0.serialize(serializer),
2988 }
2989 }
2990 }
2991
2992 impl<'de> serde::de::Deserialize<'de> for State {
2993 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2994 where
2995 D: serde::Deserializer<'de>,
2996 {
2997 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2998 ".google.cloud.metastore.v1.MetadataImport.State",
2999 ))
3000 }
3001 }
3002
3003 /// The metadata to be imported.
3004 #[derive(Clone, Debug, PartialEq)]
3005 #[non_exhaustive]
3006 pub enum Metadata {
3007 /// Immutable. A database dump from a pre-existing metastore's database.
3008 DatabaseDump(std::boxed::Box<crate::model::metadata_import::DatabaseDump>),
3009 }
3010}
3011
3012/// The details of a metadata export operation.
3013#[derive(Clone, Default, PartialEq)]
3014#[non_exhaustive]
3015pub struct MetadataExport {
3016 /// Output only. The time when the export started.
3017 pub start_time: std::option::Option<wkt::Timestamp>,
3018
3019 /// Output only. The time when the export ended.
3020 pub end_time: std::option::Option<wkt::Timestamp>,
3021
3022 /// Output only. The current state of the export.
3023 pub state: crate::model::metadata_export::State,
3024
3025 /// Output only. The type of the database dump.
3026 pub database_dump_type: crate::model::database_dump_spec::Type,
3027
3028 #[allow(missing_docs)]
3029 pub destination: std::option::Option<crate::model::metadata_export::Destination>,
3030
3031 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3032}
3033
3034impl MetadataExport {
3035 /// Creates a new default instance.
3036 pub fn new() -> Self {
3037 std::default::Default::default()
3038 }
3039
3040 /// Sets the value of [start_time][crate::model::MetadataExport::start_time].
3041 ///
3042 /// # Example
3043 /// ```ignore,no_run
3044 /// # use google_cloud_metastore_v1::model::MetadataExport;
3045 /// use wkt::Timestamp;
3046 /// let x = MetadataExport::new().set_start_time(Timestamp::default()/* use setters */);
3047 /// ```
3048 pub fn set_start_time<T>(mut self, v: T) -> Self
3049 where
3050 T: std::convert::Into<wkt::Timestamp>,
3051 {
3052 self.start_time = std::option::Option::Some(v.into());
3053 self
3054 }
3055
3056 /// Sets or clears the value of [start_time][crate::model::MetadataExport::start_time].
3057 ///
3058 /// # Example
3059 /// ```ignore,no_run
3060 /// # use google_cloud_metastore_v1::model::MetadataExport;
3061 /// use wkt::Timestamp;
3062 /// let x = MetadataExport::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
3063 /// let x = MetadataExport::new().set_or_clear_start_time(None::<Timestamp>);
3064 /// ```
3065 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
3066 where
3067 T: std::convert::Into<wkt::Timestamp>,
3068 {
3069 self.start_time = v.map(|x| x.into());
3070 self
3071 }
3072
3073 /// Sets the value of [end_time][crate::model::MetadataExport::end_time].
3074 ///
3075 /// # Example
3076 /// ```ignore,no_run
3077 /// # use google_cloud_metastore_v1::model::MetadataExport;
3078 /// use wkt::Timestamp;
3079 /// let x = MetadataExport::new().set_end_time(Timestamp::default()/* use setters */);
3080 /// ```
3081 pub fn set_end_time<T>(mut self, v: T) -> Self
3082 where
3083 T: std::convert::Into<wkt::Timestamp>,
3084 {
3085 self.end_time = std::option::Option::Some(v.into());
3086 self
3087 }
3088
3089 /// Sets or clears the value of [end_time][crate::model::MetadataExport::end_time].
3090 ///
3091 /// # Example
3092 /// ```ignore,no_run
3093 /// # use google_cloud_metastore_v1::model::MetadataExport;
3094 /// use wkt::Timestamp;
3095 /// let x = MetadataExport::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3096 /// let x = MetadataExport::new().set_or_clear_end_time(None::<Timestamp>);
3097 /// ```
3098 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3099 where
3100 T: std::convert::Into<wkt::Timestamp>,
3101 {
3102 self.end_time = v.map(|x| x.into());
3103 self
3104 }
3105
3106 /// Sets the value of [state][crate::model::MetadataExport::state].
3107 ///
3108 /// # Example
3109 /// ```ignore,no_run
3110 /// # use google_cloud_metastore_v1::model::MetadataExport;
3111 /// use google_cloud_metastore_v1::model::metadata_export::State;
3112 /// let x0 = MetadataExport::new().set_state(State::Running);
3113 /// let x1 = MetadataExport::new().set_state(State::Succeeded);
3114 /// let x2 = MetadataExport::new().set_state(State::Failed);
3115 /// ```
3116 pub fn set_state<T: std::convert::Into<crate::model::metadata_export::State>>(
3117 mut self,
3118 v: T,
3119 ) -> Self {
3120 self.state = v.into();
3121 self
3122 }
3123
3124 /// Sets the value of [database_dump_type][crate::model::MetadataExport::database_dump_type].
3125 ///
3126 /// # Example
3127 /// ```ignore,no_run
3128 /// # use google_cloud_metastore_v1::model::MetadataExport;
3129 /// use google_cloud_metastore_v1::model::database_dump_spec::Type;
3130 /// let x0 = MetadataExport::new().set_database_dump_type(Type::Mysql);
3131 /// let x1 = MetadataExport::new().set_database_dump_type(Type::Avro);
3132 /// ```
3133 pub fn set_database_dump_type<T: std::convert::Into<crate::model::database_dump_spec::Type>>(
3134 mut self,
3135 v: T,
3136 ) -> Self {
3137 self.database_dump_type = v.into();
3138 self
3139 }
3140
3141 /// Sets the value of [destination][crate::model::MetadataExport::destination].
3142 ///
3143 /// Note that all the setters affecting `destination` are mutually
3144 /// exclusive.
3145 ///
3146 /// # Example
3147 /// ```ignore,no_run
3148 /// # use google_cloud_metastore_v1::model::MetadataExport;
3149 /// use google_cloud_metastore_v1::model::metadata_export::Destination;
3150 /// let x = MetadataExport::new().set_destination(Some(Destination::DestinationGcsUri("example".to_string())));
3151 /// ```
3152 pub fn set_destination<
3153 T: std::convert::Into<std::option::Option<crate::model::metadata_export::Destination>>,
3154 >(
3155 mut self,
3156 v: T,
3157 ) -> Self {
3158 self.destination = v.into();
3159 self
3160 }
3161
3162 /// The value of [destination][crate::model::MetadataExport::destination]
3163 /// if it holds a `DestinationGcsUri`, `None` if the field is not set or
3164 /// holds a different branch.
3165 pub fn destination_gcs_uri(&self) -> std::option::Option<&std::string::String> {
3166 #[allow(unreachable_patterns)]
3167 self.destination.as_ref().and_then(|v| match v {
3168 crate::model::metadata_export::Destination::DestinationGcsUri(v) => {
3169 std::option::Option::Some(v)
3170 }
3171 _ => std::option::Option::None,
3172 })
3173 }
3174
3175 /// Sets the value of [destination][crate::model::MetadataExport::destination]
3176 /// to hold a `DestinationGcsUri`.
3177 ///
3178 /// Note that all the setters affecting `destination` are
3179 /// mutually exclusive.
3180 ///
3181 /// # Example
3182 /// ```ignore,no_run
3183 /// # use google_cloud_metastore_v1::model::MetadataExport;
3184 /// let x = MetadataExport::new().set_destination_gcs_uri("example");
3185 /// assert!(x.destination_gcs_uri().is_some());
3186 /// ```
3187 pub fn set_destination_gcs_uri<T: std::convert::Into<std::string::String>>(
3188 mut self,
3189 v: T,
3190 ) -> Self {
3191 self.destination = std::option::Option::Some(
3192 crate::model::metadata_export::Destination::DestinationGcsUri(v.into()),
3193 );
3194 self
3195 }
3196}
3197
3198impl wkt::message::Message for MetadataExport {
3199 fn typename() -> &'static str {
3200 "type.googleapis.com/google.cloud.metastore.v1.MetadataExport"
3201 }
3202}
3203
3204/// Defines additional types related to [MetadataExport].
3205pub mod metadata_export {
3206 #[allow(unused_imports)]
3207 use super::*;
3208
3209 /// The current state of the metadata export.
3210 ///
3211 /// # Working with unknown values
3212 ///
3213 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3214 /// additional enum variants at any time. Adding new variants is not considered
3215 /// a breaking change. Applications should write their code in anticipation of:
3216 ///
3217 /// - New values appearing in future releases of the client library, **and**
3218 /// - New values received dynamically, without application changes.
3219 ///
3220 /// Please consult the [Working with enums] section in the user guide for some
3221 /// guidelines.
3222 ///
3223 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3224 #[derive(Clone, Debug, PartialEq)]
3225 #[non_exhaustive]
3226 pub enum State {
3227 /// The state of the metadata export is unknown.
3228 Unspecified,
3229 /// The metadata export is running.
3230 Running,
3231 /// The metadata export completed successfully.
3232 Succeeded,
3233 /// The metadata export failed.
3234 Failed,
3235 /// The metadata export is cancelled.
3236 Cancelled,
3237 /// If set, the enum was initialized with an unknown value.
3238 ///
3239 /// Applications can examine the value using [State::value] or
3240 /// [State::name].
3241 UnknownValue(state::UnknownValue),
3242 }
3243
3244 #[doc(hidden)]
3245 pub mod state {
3246 #[allow(unused_imports)]
3247 use super::*;
3248 #[derive(Clone, Debug, PartialEq)]
3249 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3250 }
3251
3252 impl State {
3253 /// Gets the enum value.
3254 ///
3255 /// Returns `None` if the enum contains an unknown value deserialized from
3256 /// the string representation of enums.
3257 pub fn value(&self) -> std::option::Option<i32> {
3258 match self {
3259 Self::Unspecified => std::option::Option::Some(0),
3260 Self::Running => std::option::Option::Some(1),
3261 Self::Succeeded => std::option::Option::Some(2),
3262 Self::Failed => std::option::Option::Some(3),
3263 Self::Cancelled => std::option::Option::Some(4),
3264 Self::UnknownValue(u) => u.0.value(),
3265 }
3266 }
3267
3268 /// Gets the enum value as a string.
3269 ///
3270 /// Returns `None` if the enum contains an unknown value deserialized from
3271 /// the integer representation of enums.
3272 pub fn name(&self) -> std::option::Option<&str> {
3273 match self {
3274 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3275 Self::Running => std::option::Option::Some("RUNNING"),
3276 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
3277 Self::Failed => std::option::Option::Some("FAILED"),
3278 Self::Cancelled => std::option::Option::Some("CANCELLED"),
3279 Self::UnknownValue(u) => u.0.name(),
3280 }
3281 }
3282 }
3283
3284 impl std::default::Default for State {
3285 fn default() -> Self {
3286 use std::convert::From;
3287 Self::from(0)
3288 }
3289 }
3290
3291 impl std::fmt::Display for State {
3292 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3293 wkt::internal::display_enum(f, self.name(), self.value())
3294 }
3295 }
3296
3297 impl std::convert::From<i32> for State {
3298 fn from(value: i32) -> Self {
3299 match value {
3300 0 => Self::Unspecified,
3301 1 => Self::Running,
3302 2 => Self::Succeeded,
3303 3 => Self::Failed,
3304 4 => Self::Cancelled,
3305 _ => Self::UnknownValue(state::UnknownValue(
3306 wkt::internal::UnknownEnumValue::Integer(value),
3307 )),
3308 }
3309 }
3310 }
3311
3312 impl std::convert::From<&str> for State {
3313 fn from(value: &str) -> Self {
3314 use std::string::ToString;
3315 match value {
3316 "STATE_UNSPECIFIED" => Self::Unspecified,
3317 "RUNNING" => Self::Running,
3318 "SUCCEEDED" => Self::Succeeded,
3319 "FAILED" => Self::Failed,
3320 "CANCELLED" => Self::Cancelled,
3321 _ => Self::UnknownValue(state::UnknownValue(
3322 wkt::internal::UnknownEnumValue::String(value.to_string()),
3323 )),
3324 }
3325 }
3326 }
3327
3328 impl serde::ser::Serialize for State {
3329 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3330 where
3331 S: serde::Serializer,
3332 {
3333 match self {
3334 Self::Unspecified => serializer.serialize_i32(0),
3335 Self::Running => serializer.serialize_i32(1),
3336 Self::Succeeded => serializer.serialize_i32(2),
3337 Self::Failed => serializer.serialize_i32(3),
3338 Self::Cancelled => serializer.serialize_i32(4),
3339 Self::UnknownValue(u) => u.0.serialize(serializer),
3340 }
3341 }
3342 }
3343
3344 impl<'de> serde::de::Deserialize<'de> for State {
3345 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3346 where
3347 D: serde::Deserializer<'de>,
3348 {
3349 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3350 ".google.cloud.metastore.v1.MetadataExport.State",
3351 ))
3352 }
3353 }
3354
3355 #[allow(missing_docs)]
3356 #[derive(Clone, Debug, PartialEq)]
3357 #[non_exhaustive]
3358 pub enum Destination {
3359 /// Output only. A Cloud Storage URI of a folder that metadata are exported
3360 /// to, in the form of
3361 /// `gs://<bucket_name>/<path_inside_bucket>/<export_folder>`, where
3362 /// `<export_folder>` is automatically generated.
3363 DestinationGcsUri(std::string::String),
3364 }
3365}
3366
3367/// The details of a backup resource.
3368#[derive(Clone, Default, PartialEq)]
3369#[non_exhaustive]
3370pub struct Backup {
3371 /// Immutable. The relative resource name of the backup, in the following form:
3372 ///
3373 /// `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`
3374 pub name: std::string::String,
3375
3376 /// Output only. The time when the backup was started.
3377 pub create_time: std::option::Option<wkt::Timestamp>,
3378
3379 /// Output only. The time when the backup finished creating.
3380 pub end_time: std::option::Option<wkt::Timestamp>,
3381
3382 /// Output only. The current state of the backup.
3383 pub state: crate::model::backup::State,
3384
3385 /// Output only. The revision of the service at the time of backup.
3386 pub service_revision: std::option::Option<crate::model::Service>,
3387
3388 /// The description of the backup.
3389 pub description: std::string::String,
3390
3391 /// Output only. Services that are restoring from the backup.
3392 pub restoring_services: std::vec::Vec<std::string::String>,
3393
3394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3395}
3396
3397impl Backup {
3398 /// Creates a new default instance.
3399 pub fn new() -> Self {
3400 std::default::Default::default()
3401 }
3402
3403 /// Sets the value of [name][crate::model::Backup::name].
3404 ///
3405 /// # Example
3406 /// ```ignore,no_run
3407 /// # use google_cloud_metastore_v1::model::Backup;
3408 /// # let project_id = "project_id";
3409 /// # let location_id = "location_id";
3410 /// # let service_id = "service_id";
3411 /// # let backup_id = "backup_id";
3412 /// let x = Backup::new().set_name(format!("projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}"));
3413 /// ```
3414 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3415 self.name = v.into();
3416 self
3417 }
3418
3419 /// Sets the value of [create_time][crate::model::Backup::create_time].
3420 ///
3421 /// # Example
3422 /// ```ignore,no_run
3423 /// # use google_cloud_metastore_v1::model::Backup;
3424 /// use wkt::Timestamp;
3425 /// let x = Backup::new().set_create_time(Timestamp::default()/* use setters */);
3426 /// ```
3427 pub fn set_create_time<T>(mut self, v: T) -> Self
3428 where
3429 T: std::convert::Into<wkt::Timestamp>,
3430 {
3431 self.create_time = std::option::Option::Some(v.into());
3432 self
3433 }
3434
3435 /// Sets or clears the value of [create_time][crate::model::Backup::create_time].
3436 ///
3437 /// # Example
3438 /// ```ignore,no_run
3439 /// # use google_cloud_metastore_v1::model::Backup;
3440 /// use wkt::Timestamp;
3441 /// let x = Backup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3442 /// let x = Backup::new().set_or_clear_create_time(None::<Timestamp>);
3443 /// ```
3444 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3445 where
3446 T: std::convert::Into<wkt::Timestamp>,
3447 {
3448 self.create_time = v.map(|x| x.into());
3449 self
3450 }
3451
3452 /// Sets the value of [end_time][crate::model::Backup::end_time].
3453 ///
3454 /// # Example
3455 /// ```ignore,no_run
3456 /// # use google_cloud_metastore_v1::model::Backup;
3457 /// use wkt::Timestamp;
3458 /// let x = Backup::new().set_end_time(Timestamp::default()/* use setters */);
3459 /// ```
3460 pub fn set_end_time<T>(mut self, v: T) -> Self
3461 where
3462 T: std::convert::Into<wkt::Timestamp>,
3463 {
3464 self.end_time = std::option::Option::Some(v.into());
3465 self
3466 }
3467
3468 /// Sets or clears the value of [end_time][crate::model::Backup::end_time].
3469 ///
3470 /// # Example
3471 /// ```ignore,no_run
3472 /// # use google_cloud_metastore_v1::model::Backup;
3473 /// use wkt::Timestamp;
3474 /// let x = Backup::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3475 /// let x = Backup::new().set_or_clear_end_time(None::<Timestamp>);
3476 /// ```
3477 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3478 where
3479 T: std::convert::Into<wkt::Timestamp>,
3480 {
3481 self.end_time = v.map(|x| x.into());
3482 self
3483 }
3484
3485 /// Sets the value of [state][crate::model::Backup::state].
3486 ///
3487 /// # Example
3488 /// ```ignore,no_run
3489 /// # use google_cloud_metastore_v1::model::Backup;
3490 /// use google_cloud_metastore_v1::model::backup::State;
3491 /// let x0 = Backup::new().set_state(State::Creating);
3492 /// let x1 = Backup::new().set_state(State::Deleting);
3493 /// let x2 = Backup::new().set_state(State::Active);
3494 /// ```
3495 pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
3496 self.state = v.into();
3497 self
3498 }
3499
3500 /// Sets the value of [service_revision][crate::model::Backup::service_revision].
3501 ///
3502 /// # Example
3503 /// ```ignore,no_run
3504 /// # use google_cloud_metastore_v1::model::Backup;
3505 /// use google_cloud_metastore_v1::model::Service;
3506 /// let x = Backup::new().set_service_revision(Service::default()/* use setters */);
3507 /// ```
3508 pub fn set_service_revision<T>(mut self, v: T) -> Self
3509 where
3510 T: std::convert::Into<crate::model::Service>,
3511 {
3512 self.service_revision = std::option::Option::Some(v.into());
3513 self
3514 }
3515
3516 /// Sets or clears the value of [service_revision][crate::model::Backup::service_revision].
3517 ///
3518 /// # Example
3519 /// ```ignore,no_run
3520 /// # use google_cloud_metastore_v1::model::Backup;
3521 /// use google_cloud_metastore_v1::model::Service;
3522 /// let x = Backup::new().set_or_clear_service_revision(Some(Service::default()/* use setters */));
3523 /// let x = Backup::new().set_or_clear_service_revision(None::<Service>);
3524 /// ```
3525 pub fn set_or_clear_service_revision<T>(mut self, v: std::option::Option<T>) -> Self
3526 where
3527 T: std::convert::Into<crate::model::Service>,
3528 {
3529 self.service_revision = v.map(|x| x.into());
3530 self
3531 }
3532
3533 /// Sets the value of [description][crate::model::Backup::description].
3534 ///
3535 /// # Example
3536 /// ```ignore,no_run
3537 /// # use google_cloud_metastore_v1::model::Backup;
3538 /// let x = Backup::new().set_description("example");
3539 /// ```
3540 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3541 self.description = v.into();
3542 self
3543 }
3544
3545 /// Sets the value of [restoring_services][crate::model::Backup::restoring_services].
3546 ///
3547 /// # Example
3548 /// ```ignore,no_run
3549 /// # use google_cloud_metastore_v1::model::Backup;
3550 /// let x = Backup::new().set_restoring_services(["a", "b", "c"]);
3551 /// ```
3552 pub fn set_restoring_services<T, V>(mut self, v: T) -> Self
3553 where
3554 T: std::iter::IntoIterator<Item = V>,
3555 V: std::convert::Into<std::string::String>,
3556 {
3557 use std::iter::Iterator;
3558 self.restoring_services = v.into_iter().map(|i| i.into()).collect();
3559 self
3560 }
3561}
3562
3563impl wkt::message::Message for Backup {
3564 fn typename() -> &'static str {
3565 "type.googleapis.com/google.cloud.metastore.v1.Backup"
3566 }
3567}
3568
3569/// Defines additional types related to [Backup].
3570pub mod backup {
3571 #[allow(unused_imports)]
3572 use super::*;
3573
3574 /// The current state of the backup.
3575 ///
3576 /// # Working with unknown values
3577 ///
3578 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3579 /// additional enum variants at any time. Adding new variants is not considered
3580 /// a breaking change. Applications should write their code in anticipation of:
3581 ///
3582 /// - New values appearing in future releases of the client library, **and**
3583 /// - New values received dynamically, without application changes.
3584 ///
3585 /// Please consult the [Working with enums] section in the user guide for some
3586 /// guidelines.
3587 ///
3588 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3589 #[derive(Clone, Debug, PartialEq)]
3590 #[non_exhaustive]
3591 pub enum State {
3592 /// The state of the backup is unknown.
3593 Unspecified,
3594 /// The backup is being created.
3595 Creating,
3596 /// The backup is being deleted.
3597 Deleting,
3598 /// The backup is active and ready to use.
3599 Active,
3600 /// The backup failed.
3601 Failed,
3602 /// The backup is being restored.
3603 Restoring,
3604 /// If set, the enum was initialized with an unknown value.
3605 ///
3606 /// Applications can examine the value using [State::value] or
3607 /// [State::name].
3608 UnknownValue(state::UnknownValue),
3609 }
3610
3611 #[doc(hidden)]
3612 pub mod state {
3613 #[allow(unused_imports)]
3614 use super::*;
3615 #[derive(Clone, Debug, PartialEq)]
3616 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3617 }
3618
3619 impl State {
3620 /// Gets the enum value.
3621 ///
3622 /// Returns `None` if the enum contains an unknown value deserialized from
3623 /// the string representation of enums.
3624 pub fn value(&self) -> std::option::Option<i32> {
3625 match self {
3626 Self::Unspecified => std::option::Option::Some(0),
3627 Self::Creating => std::option::Option::Some(1),
3628 Self::Deleting => std::option::Option::Some(2),
3629 Self::Active => std::option::Option::Some(3),
3630 Self::Failed => std::option::Option::Some(4),
3631 Self::Restoring => std::option::Option::Some(5),
3632 Self::UnknownValue(u) => u.0.value(),
3633 }
3634 }
3635
3636 /// Gets the enum value as a string.
3637 ///
3638 /// Returns `None` if the enum contains an unknown value deserialized from
3639 /// the integer representation of enums.
3640 pub fn name(&self) -> std::option::Option<&str> {
3641 match self {
3642 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3643 Self::Creating => std::option::Option::Some("CREATING"),
3644 Self::Deleting => std::option::Option::Some("DELETING"),
3645 Self::Active => std::option::Option::Some("ACTIVE"),
3646 Self::Failed => std::option::Option::Some("FAILED"),
3647 Self::Restoring => std::option::Option::Some("RESTORING"),
3648 Self::UnknownValue(u) => u.0.name(),
3649 }
3650 }
3651 }
3652
3653 impl std::default::Default for State {
3654 fn default() -> Self {
3655 use std::convert::From;
3656 Self::from(0)
3657 }
3658 }
3659
3660 impl std::fmt::Display for State {
3661 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3662 wkt::internal::display_enum(f, self.name(), self.value())
3663 }
3664 }
3665
3666 impl std::convert::From<i32> for State {
3667 fn from(value: i32) -> Self {
3668 match value {
3669 0 => Self::Unspecified,
3670 1 => Self::Creating,
3671 2 => Self::Deleting,
3672 3 => Self::Active,
3673 4 => Self::Failed,
3674 5 => Self::Restoring,
3675 _ => Self::UnknownValue(state::UnknownValue(
3676 wkt::internal::UnknownEnumValue::Integer(value),
3677 )),
3678 }
3679 }
3680 }
3681
3682 impl std::convert::From<&str> for State {
3683 fn from(value: &str) -> Self {
3684 use std::string::ToString;
3685 match value {
3686 "STATE_UNSPECIFIED" => Self::Unspecified,
3687 "CREATING" => Self::Creating,
3688 "DELETING" => Self::Deleting,
3689 "ACTIVE" => Self::Active,
3690 "FAILED" => Self::Failed,
3691 "RESTORING" => Self::Restoring,
3692 _ => Self::UnknownValue(state::UnknownValue(
3693 wkt::internal::UnknownEnumValue::String(value.to_string()),
3694 )),
3695 }
3696 }
3697 }
3698
3699 impl serde::ser::Serialize for State {
3700 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3701 where
3702 S: serde::Serializer,
3703 {
3704 match self {
3705 Self::Unspecified => serializer.serialize_i32(0),
3706 Self::Creating => serializer.serialize_i32(1),
3707 Self::Deleting => serializer.serialize_i32(2),
3708 Self::Active => serializer.serialize_i32(3),
3709 Self::Failed => serializer.serialize_i32(4),
3710 Self::Restoring => serializer.serialize_i32(5),
3711 Self::UnknownValue(u) => u.0.serialize(serializer),
3712 }
3713 }
3714 }
3715
3716 impl<'de> serde::de::Deserialize<'de> for State {
3717 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3718 where
3719 D: serde::Deserializer<'de>,
3720 {
3721 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3722 ".google.cloud.metastore.v1.Backup.State",
3723 ))
3724 }
3725 }
3726}
3727
3728/// The details of a metadata restore operation.
3729#[derive(Clone, Default, PartialEq)]
3730#[non_exhaustive]
3731pub struct Restore {
3732 /// Output only. The time when the restore started.
3733 pub start_time: std::option::Option<wkt::Timestamp>,
3734
3735 /// Output only. The time when the restore ended.
3736 pub end_time: std::option::Option<wkt::Timestamp>,
3737
3738 /// Output only. The current state of the restore.
3739 pub state: crate::model::restore::State,
3740
3741 /// Output only. The relative resource name of the metastore service backup to
3742 /// restore from, in the following form:
3743 ///
3744 /// `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
3745 pub backup: std::string::String,
3746
3747 /// Output only. The type of restore.
3748 pub r#type: crate::model::restore::RestoreType,
3749
3750 /// Output only. The restore details containing the revision of the service to
3751 /// be restored to, in format of JSON.
3752 pub details: std::string::String,
3753
3754 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3755}
3756
3757impl Restore {
3758 /// Creates a new default instance.
3759 pub fn new() -> Self {
3760 std::default::Default::default()
3761 }
3762
3763 /// Sets the value of [start_time][crate::model::Restore::start_time].
3764 ///
3765 /// # Example
3766 /// ```ignore,no_run
3767 /// # use google_cloud_metastore_v1::model::Restore;
3768 /// use wkt::Timestamp;
3769 /// let x = Restore::new().set_start_time(Timestamp::default()/* use setters */);
3770 /// ```
3771 pub fn set_start_time<T>(mut self, v: T) -> Self
3772 where
3773 T: std::convert::Into<wkt::Timestamp>,
3774 {
3775 self.start_time = std::option::Option::Some(v.into());
3776 self
3777 }
3778
3779 /// Sets or clears the value of [start_time][crate::model::Restore::start_time].
3780 ///
3781 /// # Example
3782 /// ```ignore,no_run
3783 /// # use google_cloud_metastore_v1::model::Restore;
3784 /// use wkt::Timestamp;
3785 /// let x = Restore::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
3786 /// let x = Restore::new().set_or_clear_start_time(None::<Timestamp>);
3787 /// ```
3788 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
3789 where
3790 T: std::convert::Into<wkt::Timestamp>,
3791 {
3792 self.start_time = v.map(|x| x.into());
3793 self
3794 }
3795
3796 /// Sets the value of [end_time][crate::model::Restore::end_time].
3797 ///
3798 /// # Example
3799 /// ```ignore,no_run
3800 /// # use google_cloud_metastore_v1::model::Restore;
3801 /// use wkt::Timestamp;
3802 /// let x = Restore::new().set_end_time(Timestamp::default()/* use setters */);
3803 /// ```
3804 pub fn set_end_time<T>(mut self, v: T) -> Self
3805 where
3806 T: std::convert::Into<wkt::Timestamp>,
3807 {
3808 self.end_time = std::option::Option::Some(v.into());
3809 self
3810 }
3811
3812 /// Sets or clears the value of [end_time][crate::model::Restore::end_time].
3813 ///
3814 /// # Example
3815 /// ```ignore,no_run
3816 /// # use google_cloud_metastore_v1::model::Restore;
3817 /// use wkt::Timestamp;
3818 /// let x = Restore::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
3819 /// let x = Restore::new().set_or_clear_end_time(None::<Timestamp>);
3820 /// ```
3821 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
3822 where
3823 T: std::convert::Into<wkt::Timestamp>,
3824 {
3825 self.end_time = v.map(|x| x.into());
3826 self
3827 }
3828
3829 /// Sets the value of [state][crate::model::Restore::state].
3830 ///
3831 /// # Example
3832 /// ```ignore,no_run
3833 /// # use google_cloud_metastore_v1::model::Restore;
3834 /// use google_cloud_metastore_v1::model::restore::State;
3835 /// let x0 = Restore::new().set_state(State::Running);
3836 /// let x1 = Restore::new().set_state(State::Succeeded);
3837 /// let x2 = Restore::new().set_state(State::Failed);
3838 /// ```
3839 pub fn set_state<T: std::convert::Into<crate::model::restore::State>>(mut self, v: T) -> Self {
3840 self.state = v.into();
3841 self
3842 }
3843
3844 /// Sets the value of [backup][crate::model::Restore::backup].
3845 ///
3846 /// # Example
3847 /// ```ignore,no_run
3848 /// # use google_cloud_metastore_v1::model::Restore;
3849 /// # let project_id = "project_id";
3850 /// # let location_id = "location_id";
3851 /// # let service_id = "service_id";
3852 /// # let backup_id = "backup_id";
3853 /// let x = Restore::new().set_backup(format!("projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}"));
3854 /// ```
3855 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3856 self.backup = v.into();
3857 self
3858 }
3859
3860 /// Sets the value of [r#type][crate::model::Restore::type].
3861 ///
3862 /// # Example
3863 /// ```ignore,no_run
3864 /// # use google_cloud_metastore_v1::model::Restore;
3865 /// use google_cloud_metastore_v1::model::restore::RestoreType;
3866 /// let x0 = Restore::new().set_type(RestoreType::Full);
3867 /// let x1 = Restore::new().set_type(RestoreType::MetadataOnly);
3868 /// ```
3869 pub fn set_type<T: std::convert::Into<crate::model::restore::RestoreType>>(
3870 mut self,
3871 v: T,
3872 ) -> Self {
3873 self.r#type = v.into();
3874 self
3875 }
3876
3877 /// Sets the value of [details][crate::model::Restore::details].
3878 ///
3879 /// # Example
3880 /// ```ignore,no_run
3881 /// # use google_cloud_metastore_v1::model::Restore;
3882 /// let x = Restore::new().set_details("example");
3883 /// ```
3884 pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3885 self.details = v.into();
3886 self
3887 }
3888}
3889
3890impl wkt::message::Message for Restore {
3891 fn typename() -> &'static str {
3892 "type.googleapis.com/google.cloud.metastore.v1.Restore"
3893 }
3894}
3895
3896/// Defines additional types related to [Restore].
3897pub mod restore {
3898 #[allow(unused_imports)]
3899 use super::*;
3900
3901 /// The current state of the restore.
3902 ///
3903 /// # Working with unknown values
3904 ///
3905 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3906 /// additional enum variants at any time. Adding new variants is not considered
3907 /// a breaking change. Applications should write their code in anticipation of:
3908 ///
3909 /// - New values appearing in future releases of the client library, **and**
3910 /// - New values received dynamically, without application changes.
3911 ///
3912 /// Please consult the [Working with enums] section in the user guide for some
3913 /// guidelines.
3914 ///
3915 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3916 #[derive(Clone, Debug, PartialEq)]
3917 #[non_exhaustive]
3918 pub enum State {
3919 /// The state of the metadata restore is unknown.
3920 Unspecified,
3921 /// The metadata restore is running.
3922 Running,
3923 /// The metadata restore completed successfully.
3924 Succeeded,
3925 /// The metadata restore failed.
3926 Failed,
3927 /// The metadata restore is cancelled.
3928 Cancelled,
3929 /// If set, the enum was initialized with an unknown value.
3930 ///
3931 /// Applications can examine the value using [State::value] or
3932 /// [State::name].
3933 UnknownValue(state::UnknownValue),
3934 }
3935
3936 #[doc(hidden)]
3937 pub mod state {
3938 #[allow(unused_imports)]
3939 use super::*;
3940 #[derive(Clone, Debug, PartialEq)]
3941 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3942 }
3943
3944 impl State {
3945 /// Gets the enum value.
3946 ///
3947 /// Returns `None` if the enum contains an unknown value deserialized from
3948 /// the string representation of enums.
3949 pub fn value(&self) -> std::option::Option<i32> {
3950 match self {
3951 Self::Unspecified => std::option::Option::Some(0),
3952 Self::Running => std::option::Option::Some(1),
3953 Self::Succeeded => std::option::Option::Some(2),
3954 Self::Failed => std::option::Option::Some(3),
3955 Self::Cancelled => std::option::Option::Some(4),
3956 Self::UnknownValue(u) => u.0.value(),
3957 }
3958 }
3959
3960 /// Gets the enum value as a string.
3961 ///
3962 /// Returns `None` if the enum contains an unknown value deserialized from
3963 /// the integer representation of enums.
3964 pub fn name(&self) -> std::option::Option<&str> {
3965 match self {
3966 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3967 Self::Running => std::option::Option::Some("RUNNING"),
3968 Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
3969 Self::Failed => std::option::Option::Some("FAILED"),
3970 Self::Cancelled => std::option::Option::Some("CANCELLED"),
3971 Self::UnknownValue(u) => u.0.name(),
3972 }
3973 }
3974 }
3975
3976 impl std::default::Default for State {
3977 fn default() -> Self {
3978 use std::convert::From;
3979 Self::from(0)
3980 }
3981 }
3982
3983 impl std::fmt::Display for State {
3984 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3985 wkt::internal::display_enum(f, self.name(), self.value())
3986 }
3987 }
3988
3989 impl std::convert::From<i32> for State {
3990 fn from(value: i32) -> Self {
3991 match value {
3992 0 => Self::Unspecified,
3993 1 => Self::Running,
3994 2 => Self::Succeeded,
3995 3 => Self::Failed,
3996 4 => Self::Cancelled,
3997 _ => Self::UnknownValue(state::UnknownValue(
3998 wkt::internal::UnknownEnumValue::Integer(value),
3999 )),
4000 }
4001 }
4002 }
4003
4004 impl std::convert::From<&str> for State {
4005 fn from(value: &str) -> Self {
4006 use std::string::ToString;
4007 match value {
4008 "STATE_UNSPECIFIED" => Self::Unspecified,
4009 "RUNNING" => Self::Running,
4010 "SUCCEEDED" => Self::Succeeded,
4011 "FAILED" => Self::Failed,
4012 "CANCELLED" => Self::Cancelled,
4013 _ => Self::UnknownValue(state::UnknownValue(
4014 wkt::internal::UnknownEnumValue::String(value.to_string()),
4015 )),
4016 }
4017 }
4018 }
4019
4020 impl serde::ser::Serialize for State {
4021 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4022 where
4023 S: serde::Serializer,
4024 {
4025 match self {
4026 Self::Unspecified => serializer.serialize_i32(0),
4027 Self::Running => serializer.serialize_i32(1),
4028 Self::Succeeded => serializer.serialize_i32(2),
4029 Self::Failed => serializer.serialize_i32(3),
4030 Self::Cancelled => serializer.serialize_i32(4),
4031 Self::UnknownValue(u) => u.0.serialize(serializer),
4032 }
4033 }
4034 }
4035
4036 impl<'de> serde::de::Deserialize<'de> for State {
4037 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4038 where
4039 D: serde::Deserializer<'de>,
4040 {
4041 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4042 ".google.cloud.metastore.v1.Restore.State",
4043 ))
4044 }
4045 }
4046
4047 /// The type of restore. If unspecified, defaults to `METADATA_ONLY`.
4048 ///
4049 /// # Working with unknown values
4050 ///
4051 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4052 /// additional enum variants at any time. Adding new variants is not considered
4053 /// a breaking change. Applications should write their code in anticipation of:
4054 ///
4055 /// - New values appearing in future releases of the client library, **and**
4056 /// - New values received dynamically, without application changes.
4057 ///
4058 /// Please consult the [Working with enums] section in the user guide for some
4059 /// guidelines.
4060 ///
4061 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4062 #[derive(Clone, Debug, PartialEq)]
4063 #[non_exhaustive]
4064 pub enum RestoreType {
4065 /// The restore type is unknown.
4066 Unspecified,
4067 /// The service's metadata and configuration are restored.
4068 Full,
4069 /// Only the service's metadata is restored.
4070 MetadataOnly,
4071 /// If set, the enum was initialized with an unknown value.
4072 ///
4073 /// Applications can examine the value using [RestoreType::value] or
4074 /// [RestoreType::name].
4075 UnknownValue(restore_type::UnknownValue),
4076 }
4077
4078 #[doc(hidden)]
4079 pub mod restore_type {
4080 #[allow(unused_imports)]
4081 use super::*;
4082 #[derive(Clone, Debug, PartialEq)]
4083 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4084 }
4085
4086 impl RestoreType {
4087 /// Gets the enum value.
4088 ///
4089 /// Returns `None` if the enum contains an unknown value deserialized from
4090 /// the string representation of enums.
4091 pub fn value(&self) -> std::option::Option<i32> {
4092 match self {
4093 Self::Unspecified => std::option::Option::Some(0),
4094 Self::Full => std::option::Option::Some(1),
4095 Self::MetadataOnly => std::option::Option::Some(2),
4096 Self::UnknownValue(u) => u.0.value(),
4097 }
4098 }
4099
4100 /// Gets the enum value as a string.
4101 ///
4102 /// Returns `None` if the enum contains an unknown value deserialized from
4103 /// the integer representation of enums.
4104 pub fn name(&self) -> std::option::Option<&str> {
4105 match self {
4106 Self::Unspecified => std::option::Option::Some("RESTORE_TYPE_UNSPECIFIED"),
4107 Self::Full => std::option::Option::Some("FULL"),
4108 Self::MetadataOnly => std::option::Option::Some("METADATA_ONLY"),
4109 Self::UnknownValue(u) => u.0.name(),
4110 }
4111 }
4112 }
4113
4114 impl std::default::Default for RestoreType {
4115 fn default() -> Self {
4116 use std::convert::From;
4117 Self::from(0)
4118 }
4119 }
4120
4121 impl std::fmt::Display for RestoreType {
4122 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4123 wkt::internal::display_enum(f, self.name(), self.value())
4124 }
4125 }
4126
4127 impl std::convert::From<i32> for RestoreType {
4128 fn from(value: i32) -> Self {
4129 match value {
4130 0 => Self::Unspecified,
4131 1 => Self::Full,
4132 2 => Self::MetadataOnly,
4133 _ => Self::UnknownValue(restore_type::UnknownValue(
4134 wkt::internal::UnknownEnumValue::Integer(value),
4135 )),
4136 }
4137 }
4138 }
4139
4140 impl std::convert::From<&str> for RestoreType {
4141 fn from(value: &str) -> Self {
4142 use std::string::ToString;
4143 match value {
4144 "RESTORE_TYPE_UNSPECIFIED" => Self::Unspecified,
4145 "FULL" => Self::Full,
4146 "METADATA_ONLY" => Self::MetadataOnly,
4147 _ => Self::UnknownValue(restore_type::UnknownValue(
4148 wkt::internal::UnknownEnumValue::String(value.to_string()),
4149 )),
4150 }
4151 }
4152 }
4153
4154 impl serde::ser::Serialize for RestoreType {
4155 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4156 where
4157 S: serde::Serializer,
4158 {
4159 match self {
4160 Self::Unspecified => serializer.serialize_i32(0),
4161 Self::Full => serializer.serialize_i32(1),
4162 Self::MetadataOnly => serializer.serialize_i32(2),
4163 Self::UnknownValue(u) => u.0.serialize(serializer),
4164 }
4165 }
4166 }
4167
4168 impl<'de> serde::de::Deserialize<'de> for RestoreType {
4169 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4170 where
4171 D: serde::Deserializer<'de>,
4172 {
4173 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RestoreType>::new(
4174 ".google.cloud.metastore.v1.Restore.RestoreType",
4175 ))
4176 }
4177 }
4178}
4179
4180/// Represents the scaling configuration of a metastore service.
4181#[derive(Clone, Default, PartialEq)]
4182#[non_exhaustive]
4183pub struct ScalingConfig {
4184 /// Represents either a predetermined instance size or a numeric
4185 /// scaling factor.
4186 pub scaling_model: std::option::Option<crate::model::scaling_config::ScalingModel>,
4187
4188 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4189}
4190
4191impl ScalingConfig {
4192 /// Creates a new default instance.
4193 pub fn new() -> Self {
4194 std::default::Default::default()
4195 }
4196
4197 /// Sets the value of [scaling_model][crate::model::ScalingConfig::scaling_model].
4198 ///
4199 /// Note that all the setters affecting `scaling_model` are mutually
4200 /// exclusive.
4201 ///
4202 /// # Example
4203 /// ```ignore,no_run
4204 /// # use google_cloud_metastore_v1::model::ScalingConfig;
4205 /// use google_cloud_metastore_v1::model::scaling_config::InstanceSize;
4206 /// let x0 = ScalingConfig::new().set_scaling_model(Some(
4207 /// google_cloud_metastore_v1::model::scaling_config::ScalingModel::InstanceSize(InstanceSize::ExtraSmall)));
4208 /// let x1 = ScalingConfig::new().set_scaling_model(Some(
4209 /// google_cloud_metastore_v1::model::scaling_config::ScalingModel::InstanceSize(InstanceSize::Small)));
4210 /// let x2 = ScalingConfig::new().set_scaling_model(Some(
4211 /// google_cloud_metastore_v1::model::scaling_config::ScalingModel::InstanceSize(InstanceSize::Medium)));
4212 /// ```
4213 pub fn set_scaling_model<
4214 T: std::convert::Into<std::option::Option<crate::model::scaling_config::ScalingModel>>,
4215 >(
4216 mut self,
4217 v: T,
4218 ) -> Self {
4219 self.scaling_model = v.into();
4220 self
4221 }
4222
4223 /// The value of [scaling_model][crate::model::ScalingConfig::scaling_model]
4224 /// if it holds a `InstanceSize`, `None` if the field is not set or
4225 /// holds a different branch.
4226 pub fn instance_size(
4227 &self,
4228 ) -> std::option::Option<&crate::model::scaling_config::InstanceSize> {
4229 #[allow(unreachable_patterns)]
4230 self.scaling_model.as_ref().and_then(|v| match v {
4231 crate::model::scaling_config::ScalingModel::InstanceSize(v) => {
4232 std::option::Option::Some(v)
4233 }
4234 _ => std::option::Option::None,
4235 })
4236 }
4237
4238 /// Sets the value of [scaling_model][crate::model::ScalingConfig::scaling_model]
4239 /// to hold a `InstanceSize`.
4240 ///
4241 /// Note that all the setters affecting `scaling_model` are
4242 /// mutually exclusive.
4243 ///
4244 /// # Example
4245 /// ```ignore,no_run
4246 /// # use google_cloud_metastore_v1::model::ScalingConfig;
4247 /// use google_cloud_metastore_v1::model::scaling_config::InstanceSize;
4248 /// let x0 = ScalingConfig::new().set_instance_size(InstanceSize::ExtraSmall);
4249 /// let x1 = ScalingConfig::new().set_instance_size(InstanceSize::Small);
4250 /// let x2 = ScalingConfig::new().set_instance_size(InstanceSize::Medium);
4251 /// assert!(x0.instance_size().is_some());
4252 /// assert!(x0.scaling_factor().is_none());
4253 /// assert!(x1.instance_size().is_some());
4254 /// assert!(x1.scaling_factor().is_none());
4255 /// assert!(x2.instance_size().is_some());
4256 /// assert!(x2.scaling_factor().is_none());
4257 /// ```
4258 pub fn set_instance_size<T: std::convert::Into<crate::model::scaling_config::InstanceSize>>(
4259 mut self,
4260 v: T,
4261 ) -> Self {
4262 self.scaling_model = std::option::Option::Some(
4263 crate::model::scaling_config::ScalingModel::InstanceSize(v.into()),
4264 );
4265 self
4266 }
4267
4268 /// The value of [scaling_model][crate::model::ScalingConfig::scaling_model]
4269 /// if it holds a `ScalingFactor`, `None` if the field is not set or
4270 /// holds a different branch.
4271 pub fn scaling_factor(&self) -> std::option::Option<&f32> {
4272 #[allow(unreachable_patterns)]
4273 self.scaling_model.as_ref().and_then(|v| match v {
4274 crate::model::scaling_config::ScalingModel::ScalingFactor(v) => {
4275 std::option::Option::Some(v)
4276 }
4277 _ => std::option::Option::None,
4278 })
4279 }
4280
4281 /// Sets the value of [scaling_model][crate::model::ScalingConfig::scaling_model]
4282 /// to hold a `ScalingFactor`.
4283 ///
4284 /// Note that all the setters affecting `scaling_model` are
4285 /// mutually exclusive.
4286 ///
4287 /// # Example
4288 /// ```ignore,no_run
4289 /// # use google_cloud_metastore_v1::model::ScalingConfig;
4290 /// let x = ScalingConfig::new().set_scaling_factor(42.0);
4291 /// assert!(x.scaling_factor().is_some());
4292 /// assert!(x.instance_size().is_none());
4293 /// ```
4294 pub fn set_scaling_factor<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
4295 self.scaling_model = std::option::Option::Some(
4296 crate::model::scaling_config::ScalingModel::ScalingFactor(v.into()),
4297 );
4298 self
4299 }
4300}
4301
4302impl wkt::message::Message for ScalingConfig {
4303 fn typename() -> &'static str {
4304 "type.googleapis.com/google.cloud.metastore.v1.ScalingConfig"
4305 }
4306}
4307
4308/// Defines additional types related to [ScalingConfig].
4309pub mod scaling_config {
4310 #[allow(unused_imports)]
4311 use super::*;
4312
4313 /// Metastore instance sizes.
4314 ///
4315 /// # Working with unknown values
4316 ///
4317 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4318 /// additional enum variants at any time. Adding new variants is not considered
4319 /// a breaking change. Applications should write their code in anticipation of:
4320 ///
4321 /// - New values appearing in future releases of the client library, **and**
4322 /// - New values received dynamically, without application changes.
4323 ///
4324 /// Please consult the [Working with enums] section in the user guide for some
4325 /// guidelines.
4326 ///
4327 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4328 #[derive(Clone, Debug, PartialEq)]
4329 #[non_exhaustive]
4330 pub enum InstanceSize {
4331 /// Unspecified instance size
4332 Unspecified,
4333 /// Extra small instance size, maps to a scaling factor of 0.1.
4334 ExtraSmall,
4335 /// Small instance size, maps to a scaling factor of 0.5.
4336 Small,
4337 /// Medium instance size, maps to a scaling factor of 1.0.
4338 Medium,
4339 /// Large instance size, maps to a scaling factor of 3.0.
4340 Large,
4341 /// Extra large instance size, maps to a scaling factor of 6.0.
4342 ExtraLarge,
4343 /// If set, the enum was initialized with an unknown value.
4344 ///
4345 /// Applications can examine the value using [InstanceSize::value] or
4346 /// [InstanceSize::name].
4347 UnknownValue(instance_size::UnknownValue),
4348 }
4349
4350 #[doc(hidden)]
4351 pub mod instance_size {
4352 #[allow(unused_imports)]
4353 use super::*;
4354 #[derive(Clone, Debug, PartialEq)]
4355 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4356 }
4357
4358 impl InstanceSize {
4359 /// Gets the enum value.
4360 ///
4361 /// Returns `None` if the enum contains an unknown value deserialized from
4362 /// the string representation of enums.
4363 pub fn value(&self) -> std::option::Option<i32> {
4364 match self {
4365 Self::Unspecified => std::option::Option::Some(0),
4366 Self::ExtraSmall => std::option::Option::Some(1),
4367 Self::Small => std::option::Option::Some(2),
4368 Self::Medium => std::option::Option::Some(3),
4369 Self::Large => std::option::Option::Some(4),
4370 Self::ExtraLarge => std::option::Option::Some(5),
4371 Self::UnknownValue(u) => u.0.value(),
4372 }
4373 }
4374
4375 /// Gets the enum value as a string.
4376 ///
4377 /// Returns `None` if the enum contains an unknown value deserialized from
4378 /// the integer representation of enums.
4379 pub fn name(&self) -> std::option::Option<&str> {
4380 match self {
4381 Self::Unspecified => std::option::Option::Some("INSTANCE_SIZE_UNSPECIFIED"),
4382 Self::ExtraSmall => std::option::Option::Some("EXTRA_SMALL"),
4383 Self::Small => std::option::Option::Some("SMALL"),
4384 Self::Medium => std::option::Option::Some("MEDIUM"),
4385 Self::Large => std::option::Option::Some("LARGE"),
4386 Self::ExtraLarge => std::option::Option::Some("EXTRA_LARGE"),
4387 Self::UnknownValue(u) => u.0.name(),
4388 }
4389 }
4390 }
4391
4392 impl std::default::Default for InstanceSize {
4393 fn default() -> Self {
4394 use std::convert::From;
4395 Self::from(0)
4396 }
4397 }
4398
4399 impl std::fmt::Display for InstanceSize {
4400 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4401 wkt::internal::display_enum(f, self.name(), self.value())
4402 }
4403 }
4404
4405 impl std::convert::From<i32> for InstanceSize {
4406 fn from(value: i32) -> Self {
4407 match value {
4408 0 => Self::Unspecified,
4409 1 => Self::ExtraSmall,
4410 2 => Self::Small,
4411 3 => Self::Medium,
4412 4 => Self::Large,
4413 5 => Self::ExtraLarge,
4414 _ => Self::UnknownValue(instance_size::UnknownValue(
4415 wkt::internal::UnknownEnumValue::Integer(value),
4416 )),
4417 }
4418 }
4419 }
4420
4421 impl std::convert::From<&str> for InstanceSize {
4422 fn from(value: &str) -> Self {
4423 use std::string::ToString;
4424 match value {
4425 "INSTANCE_SIZE_UNSPECIFIED" => Self::Unspecified,
4426 "EXTRA_SMALL" => Self::ExtraSmall,
4427 "SMALL" => Self::Small,
4428 "MEDIUM" => Self::Medium,
4429 "LARGE" => Self::Large,
4430 "EXTRA_LARGE" => Self::ExtraLarge,
4431 _ => Self::UnknownValue(instance_size::UnknownValue(
4432 wkt::internal::UnknownEnumValue::String(value.to_string()),
4433 )),
4434 }
4435 }
4436 }
4437
4438 impl serde::ser::Serialize for InstanceSize {
4439 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4440 where
4441 S: serde::Serializer,
4442 {
4443 match self {
4444 Self::Unspecified => serializer.serialize_i32(0),
4445 Self::ExtraSmall => serializer.serialize_i32(1),
4446 Self::Small => serializer.serialize_i32(2),
4447 Self::Medium => serializer.serialize_i32(3),
4448 Self::Large => serializer.serialize_i32(4),
4449 Self::ExtraLarge => serializer.serialize_i32(5),
4450 Self::UnknownValue(u) => u.0.serialize(serializer),
4451 }
4452 }
4453 }
4454
4455 impl<'de> serde::de::Deserialize<'de> for InstanceSize {
4456 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4457 where
4458 D: serde::Deserializer<'de>,
4459 {
4460 deserializer.deserialize_any(wkt::internal::EnumVisitor::<InstanceSize>::new(
4461 ".google.cloud.metastore.v1.ScalingConfig.InstanceSize",
4462 ))
4463 }
4464 }
4465
4466 /// Represents either a predetermined instance size or a numeric
4467 /// scaling factor.
4468 #[derive(Clone, Debug, PartialEq)]
4469 #[non_exhaustive]
4470 pub enum ScalingModel {
4471 /// An enum of readable instance sizes, with each instance size mapping to a
4472 /// float value (e.g. InstanceSize.EXTRA_SMALL = scaling_factor(0.1))
4473 InstanceSize(crate::model::scaling_config::InstanceSize),
4474 /// Scaling factor, increments of 0.1 for values less than 1.0, and
4475 /// increments of 1.0 for values greater than 1.0.
4476 ScalingFactor(f32),
4477 }
4478}
4479
4480/// Request message for
4481/// [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices].
4482///
4483/// [google.cloud.metastore.v1.DataprocMetastore.ListServices]: crate::client::DataprocMetastore::list_services
4484#[derive(Clone, Default, PartialEq)]
4485#[non_exhaustive]
4486pub struct ListServicesRequest {
4487 /// Required. The relative resource name of the location of metastore services
4488 /// to list, in the following form:
4489 ///
4490 /// `projects/{project_number}/locations/{location_id}`.
4491 pub parent: std::string::String,
4492
4493 /// Optional. The maximum number of services to return. The response may
4494 /// contain less than the maximum number. If unspecified, no more than 500
4495 /// services are returned. The maximum value is 1000; values above 1000 are
4496 /// changed to 1000.
4497 pub page_size: i32,
4498
4499 /// Optional. A page token, received from a previous
4500 /// [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices]
4501 /// call. Provide this token to retrieve the subsequent page.
4502 ///
4503 /// To retrieve the first page, supply an empty page token.
4504 ///
4505 /// When paginating, other parameters provided to
4506 /// [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices]
4507 /// must match the call that provided the page token.
4508 ///
4509 /// [google.cloud.metastore.v1.DataprocMetastore.ListServices]: crate::client::DataprocMetastore::list_services
4510 pub page_token: std::string::String,
4511
4512 /// Optional. The filter to apply to list results.
4513 pub filter: std::string::String,
4514
4515 /// Optional. Specify the ordering of results as described in [Sorting
4516 /// Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
4517 /// If not specified, the results will be sorted in the default order.
4518 pub order_by: std::string::String,
4519
4520 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4521}
4522
4523impl ListServicesRequest {
4524 /// Creates a new default instance.
4525 pub fn new() -> Self {
4526 std::default::Default::default()
4527 }
4528
4529 /// Sets the value of [parent][crate::model::ListServicesRequest::parent].
4530 ///
4531 /// # Example
4532 /// ```ignore,no_run
4533 /// # use google_cloud_metastore_v1::model::ListServicesRequest;
4534 /// # let project_id = "project_id";
4535 /// # let location_id = "location_id";
4536 /// let x = ListServicesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
4537 /// ```
4538 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4539 self.parent = v.into();
4540 self
4541 }
4542
4543 /// Sets the value of [page_size][crate::model::ListServicesRequest::page_size].
4544 ///
4545 /// # Example
4546 /// ```ignore,no_run
4547 /// # use google_cloud_metastore_v1::model::ListServicesRequest;
4548 /// let x = ListServicesRequest::new().set_page_size(42);
4549 /// ```
4550 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4551 self.page_size = v.into();
4552 self
4553 }
4554
4555 /// Sets the value of [page_token][crate::model::ListServicesRequest::page_token].
4556 ///
4557 /// # Example
4558 /// ```ignore,no_run
4559 /// # use google_cloud_metastore_v1::model::ListServicesRequest;
4560 /// let x = ListServicesRequest::new().set_page_token("example");
4561 /// ```
4562 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4563 self.page_token = v.into();
4564 self
4565 }
4566
4567 /// Sets the value of [filter][crate::model::ListServicesRequest::filter].
4568 ///
4569 /// # Example
4570 /// ```ignore,no_run
4571 /// # use google_cloud_metastore_v1::model::ListServicesRequest;
4572 /// let x = ListServicesRequest::new().set_filter("example");
4573 /// ```
4574 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4575 self.filter = v.into();
4576 self
4577 }
4578
4579 /// Sets the value of [order_by][crate::model::ListServicesRequest::order_by].
4580 ///
4581 /// # Example
4582 /// ```ignore,no_run
4583 /// # use google_cloud_metastore_v1::model::ListServicesRequest;
4584 /// let x = ListServicesRequest::new().set_order_by("example");
4585 /// ```
4586 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4587 self.order_by = v.into();
4588 self
4589 }
4590}
4591
4592impl wkt::message::Message for ListServicesRequest {
4593 fn typename() -> &'static str {
4594 "type.googleapis.com/google.cloud.metastore.v1.ListServicesRequest"
4595 }
4596}
4597
4598/// Response message for
4599/// [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices].
4600///
4601/// [google.cloud.metastore.v1.DataprocMetastore.ListServices]: crate::client::DataprocMetastore::list_services
4602#[derive(Clone, Default, PartialEq)]
4603#[non_exhaustive]
4604pub struct ListServicesResponse {
4605 /// The services in the specified location.
4606 pub services: std::vec::Vec<crate::model::Service>,
4607
4608 /// A token that can be sent as `page_token` to retrieve the next page. If this
4609 /// field is omitted, there are no subsequent pages.
4610 pub next_page_token: std::string::String,
4611
4612 /// Locations that could not be reached.
4613 pub unreachable: std::vec::Vec<std::string::String>,
4614
4615 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4616}
4617
4618impl ListServicesResponse {
4619 /// Creates a new default instance.
4620 pub fn new() -> Self {
4621 std::default::Default::default()
4622 }
4623
4624 /// Sets the value of [services][crate::model::ListServicesResponse::services].
4625 ///
4626 /// # Example
4627 /// ```ignore,no_run
4628 /// # use google_cloud_metastore_v1::model::ListServicesResponse;
4629 /// use google_cloud_metastore_v1::model::Service;
4630 /// let x = ListServicesResponse::new()
4631 /// .set_services([
4632 /// Service::default()/* use setters */,
4633 /// Service::default()/* use (different) setters */,
4634 /// ]);
4635 /// ```
4636 pub fn set_services<T, V>(mut self, v: T) -> Self
4637 where
4638 T: std::iter::IntoIterator<Item = V>,
4639 V: std::convert::Into<crate::model::Service>,
4640 {
4641 use std::iter::Iterator;
4642 self.services = v.into_iter().map(|i| i.into()).collect();
4643 self
4644 }
4645
4646 /// Sets the value of [next_page_token][crate::model::ListServicesResponse::next_page_token].
4647 ///
4648 /// # Example
4649 /// ```ignore,no_run
4650 /// # use google_cloud_metastore_v1::model::ListServicesResponse;
4651 /// let x = ListServicesResponse::new().set_next_page_token("example");
4652 /// ```
4653 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4654 self.next_page_token = v.into();
4655 self
4656 }
4657
4658 /// Sets the value of [unreachable][crate::model::ListServicesResponse::unreachable].
4659 ///
4660 /// # Example
4661 /// ```ignore,no_run
4662 /// # use google_cloud_metastore_v1::model::ListServicesResponse;
4663 /// let x = ListServicesResponse::new().set_unreachable(["a", "b", "c"]);
4664 /// ```
4665 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4666 where
4667 T: std::iter::IntoIterator<Item = V>,
4668 V: std::convert::Into<std::string::String>,
4669 {
4670 use std::iter::Iterator;
4671 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4672 self
4673 }
4674}
4675
4676impl wkt::message::Message for ListServicesResponse {
4677 fn typename() -> &'static str {
4678 "type.googleapis.com/google.cloud.metastore.v1.ListServicesResponse"
4679 }
4680}
4681
4682#[doc(hidden)]
4683impl google_cloud_gax::paginator::internal::PageableResponse for ListServicesResponse {
4684 type PageItem = crate::model::Service;
4685
4686 fn items(self) -> std::vec::Vec<Self::PageItem> {
4687 self.services
4688 }
4689
4690 fn next_page_token(&self) -> std::string::String {
4691 use std::clone::Clone;
4692 self.next_page_token.clone()
4693 }
4694}
4695
4696/// Request message for
4697/// [DataprocMetastore.GetService][google.cloud.metastore.v1.DataprocMetastore.GetService].
4698///
4699/// [google.cloud.metastore.v1.DataprocMetastore.GetService]: crate::client::DataprocMetastore::get_service
4700#[derive(Clone, Default, PartialEq)]
4701#[non_exhaustive]
4702pub struct GetServiceRequest {
4703 /// Required. The relative resource name of the metastore service to retrieve,
4704 /// in the following form:
4705 ///
4706 /// `projects/{project_number}/locations/{location_id}/services/{service_id}`.
4707 pub name: std::string::String,
4708
4709 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4710}
4711
4712impl GetServiceRequest {
4713 /// Creates a new default instance.
4714 pub fn new() -> Self {
4715 std::default::Default::default()
4716 }
4717
4718 /// Sets the value of [name][crate::model::GetServiceRequest::name].
4719 ///
4720 /// # Example
4721 /// ```ignore,no_run
4722 /// # use google_cloud_metastore_v1::model::GetServiceRequest;
4723 /// # let project_id = "project_id";
4724 /// # let location_id = "location_id";
4725 /// # let service_id = "service_id";
4726 /// let x = GetServiceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/services/{service_id}"));
4727 /// ```
4728 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4729 self.name = v.into();
4730 self
4731 }
4732}
4733
4734impl wkt::message::Message for GetServiceRequest {
4735 fn typename() -> &'static str {
4736 "type.googleapis.com/google.cloud.metastore.v1.GetServiceRequest"
4737 }
4738}
4739
4740/// Request message for
4741/// [DataprocMetastore.CreateService][google.cloud.metastore.v1.DataprocMetastore.CreateService].
4742///
4743/// [google.cloud.metastore.v1.DataprocMetastore.CreateService]: crate::client::DataprocMetastore::create_service
4744#[derive(Clone, Default, PartialEq)]
4745#[non_exhaustive]
4746pub struct CreateServiceRequest {
4747 /// Required. The relative resource name of the location in which to create a
4748 /// metastore service, in the following form:
4749 ///
4750 /// `projects/{project_number}/locations/{location_id}`.
4751 pub parent: std::string::String,
4752
4753 /// Required. The ID of the metastore service, which is used as the final
4754 /// component of the metastore service's name.
4755 ///
4756 /// This value must be between 2 and 63 characters long inclusive, begin with a
4757 /// letter, end with a letter or number, and consist of alpha-numeric
4758 /// ASCII characters or hyphens.
4759 pub service_id: std::string::String,
4760
4761 /// Required. The Metastore service to create. The `name` field is
4762 /// ignored. The ID of the created metastore service must be provided in
4763 /// the request's `service_id` field.
4764 pub service: std::option::Option<crate::model::Service>,
4765
4766 /// Optional. A request ID. Specify a unique request ID to allow the server to
4767 /// ignore the request if it has completed. The server will ignore subsequent
4768 /// requests that provide a duplicate request ID for at least 60 minutes after
4769 /// the first request.
4770 ///
4771 /// For example, if an initial request times out, followed by another request
4772 /// with the same request ID, the server ignores the second request to prevent
4773 /// the creation of duplicate commitments.
4774 ///
4775 /// The request ID must be a valid
4776 /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
4777 /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
4778 pub request_id: std::string::String,
4779
4780 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4781}
4782
4783impl CreateServiceRequest {
4784 /// Creates a new default instance.
4785 pub fn new() -> Self {
4786 std::default::Default::default()
4787 }
4788
4789 /// Sets the value of [parent][crate::model::CreateServiceRequest::parent].
4790 ///
4791 /// # Example
4792 /// ```ignore,no_run
4793 /// # use google_cloud_metastore_v1::model::CreateServiceRequest;
4794 /// # let project_id = "project_id";
4795 /// # let location_id = "location_id";
4796 /// let x = CreateServiceRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
4797 /// ```
4798 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4799 self.parent = v.into();
4800 self
4801 }
4802
4803 /// Sets the value of [service_id][crate::model::CreateServiceRequest::service_id].
4804 ///
4805 /// # Example
4806 /// ```ignore,no_run
4807 /// # use google_cloud_metastore_v1::model::CreateServiceRequest;
4808 /// let x = CreateServiceRequest::new().set_service_id("example");
4809 /// ```
4810 pub fn set_service_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4811 self.service_id = v.into();
4812 self
4813 }
4814
4815 /// Sets the value of [service][crate::model::CreateServiceRequest::service].
4816 ///
4817 /// # Example
4818 /// ```ignore,no_run
4819 /// # use google_cloud_metastore_v1::model::CreateServiceRequest;
4820 /// use google_cloud_metastore_v1::model::Service;
4821 /// let x = CreateServiceRequest::new().set_service(Service::default()/* use setters */);
4822 /// ```
4823 pub fn set_service<T>(mut self, v: T) -> Self
4824 where
4825 T: std::convert::Into<crate::model::Service>,
4826 {
4827 self.service = std::option::Option::Some(v.into());
4828 self
4829 }
4830
4831 /// Sets or clears the value of [service][crate::model::CreateServiceRequest::service].
4832 ///
4833 /// # Example
4834 /// ```ignore,no_run
4835 /// # use google_cloud_metastore_v1::model::CreateServiceRequest;
4836 /// use google_cloud_metastore_v1::model::Service;
4837 /// let x = CreateServiceRequest::new().set_or_clear_service(Some(Service::default()/* use setters */));
4838 /// let x = CreateServiceRequest::new().set_or_clear_service(None::<Service>);
4839 /// ```
4840 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
4841 where
4842 T: std::convert::Into<crate::model::Service>,
4843 {
4844 self.service = v.map(|x| x.into());
4845 self
4846 }
4847
4848 /// Sets the value of [request_id][crate::model::CreateServiceRequest::request_id].
4849 ///
4850 /// # Example
4851 /// ```ignore,no_run
4852 /// # use google_cloud_metastore_v1::model::CreateServiceRequest;
4853 /// let x = CreateServiceRequest::new().set_request_id("example");
4854 /// ```
4855 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4856 self.request_id = v.into();
4857 self
4858 }
4859}
4860
4861impl wkt::message::Message for CreateServiceRequest {
4862 fn typename() -> &'static str {
4863 "type.googleapis.com/google.cloud.metastore.v1.CreateServiceRequest"
4864 }
4865}
4866
4867/// Request message for
4868/// [DataprocMetastore.UpdateService][google.cloud.metastore.v1.DataprocMetastore.UpdateService].
4869///
4870/// [google.cloud.metastore.v1.DataprocMetastore.UpdateService]: crate::client::DataprocMetastore::update_service
4871#[derive(Clone, Default, PartialEq)]
4872#[non_exhaustive]
4873pub struct UpdateServiceRequest {
4874 /// Required. A field mask used to specify the fields to be overwritten in the
4875 /// metastore service resource by the update.
4876 /// Fields specified in the `update_mask` are relative to the resource (not
4877 /// to the full request). A field is overwritten if it is in the mask.
4878 pub update_mask: std::option::Option<wkt::FieldMask>,
4879
4880 /// Required. The metastore service to update. The server only merges fields
4881 /// in the service if they are specified in `update_mask`.
4882 ///
4883 /// The metastore service's `name` field is used to identify the metastore
4884 /// service to be updated.
4885 pub service: std::option::Option<crate::model::Service>,
4886
4887 /// Optional. A request ID. Specify a unique request ID to allow the server to
4888 /// ignore the request if it has completed. The server will ignore subsequent
4889 /// requests that provide a duplicate request ID for at least 60 minutes after
4890 /// the first request.
4891 ///
4892 /// For example, if an initial request times out, followed by another request
4893 /// with the same request ID, the server ignores the second request to prevent
4894 /// the creation of duplicate commitments.
4895 ///
4896 /// The request ID must be a valid
4897 /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
4898 /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
4899 pub request_id: std::string::String,
4900
4901 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4902}
4903
4904impl UpdateServiceRequest {
4905 /// Creates a new default instance.
4906 pub fn new() -> Self {
4907 std::default::Default::default()
4908 }
4909
4910 /// Sets the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
4911 ///
4912 /// # Example
4913 /// ```ignore,no_run
4914 /// # use google_cloud_metastore_v1::model::UpdateServiceRequest;
4915 /// use wkt::FieldMask;
4916 /// let x = UpdateServiceRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4917 /// ```
4918 pub fn set_update_mask<T>(mut self, v: T) -> Self
4919 where
4920 T: std::convert::Into<wkt::FieldMask>,
4921 {
4922 self.update_mask = std::option::Option::Some(v.into());
4923 self
4924 }
4925
4926 /// Sets or clears the value of [update_mask][crate::model::UpdateServiceRequest::update_mask].
4927 ///
4928 /// # Example
4929 /// ```ignore,no_run
4930 /// # use google_cloud_metastore_v1::model::UpdateServiceRequest;
4931 /// use wkt::FieldMask;
4932 /// let x = UpdateServiceRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4933 /// let x = UpdateServiceRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4934 /// ```
4935 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4936 where
4937 T: std::convert::Into<wkt::FieldMask>,
4938 {
4939 self.update_mask = v.map(|x| x.into());
4940 self
4941 }
4942
4943 /// Sets the value of [service][crate::model::UpdateServiceRequest::service].
4944 ///
4945 /// # Example
4946 /// ```ignore,no_run
4947 /// # use google_cloud_metastore_v1::model::UpdateServiceRequest;
4948 /// use google_cloud_metastore_v1::model::Service;
4949 /// let x = UpdateServiceRequest::new().set_service(Service::default()/* use setters */);
4950 /// ```
4951 pub fn set_service<T>(mut self, v: T) -> Self
4952 where
4953 T: std::convert::Into<crate::model::Service>,
4954 {
4955 self.service = std::option::Option::Some(v.into());
4956 self
4957 }
4958
4959 /// Sets or clears the value of [service][crate::model::UpdateServiceRequest::service].
4960 ///
4961 /// # Example
4962 /// ```ignore,no_run
4963 /// # use google_cloud_metastore_v1::model::UpdateServiceRequest;
4964 /// use google_cloud_metastore_v1::model::Service;
4965 /// let x = UpdateServiceRequest::new().set_or_clear_service(Some(Service::default()/* use setters */));
4966 /// let x = UpdateServiceRequest::new().set_or_clear_service(None::<Service>);
4967 /// ```
4968 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
4969 where
4970 T: std::convert::Into<crate::model::Service>,
4971 {
4972 self.service = v.map(|x| x.into());
4973 self
4974 }
4975
4976 /// Sets the value of [request_id][crate::model::UpdateServiceRequest::request_id].
4977 ///
4978 /// # Example
4979 /// ```ignore,no_run
4980 /// # use google_cloud_metastore_v1::model::UpdateServiceRequest;
4981 /// let x = UpdateServiceRequest::new().set_request_id("example");
4982 /// ```
4983 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4984 self.request_id = v.into();
4985 self
4986 }
4987}
4988
4989impl wkt::message::Message for UpdateServiceRequest {
4990 fn typename() -> &'static str {
4991 "type.googleapis.com/google.cloud.metastore.v1.UpdateServiceRequest"
4992 }
4993}
4994
4995/// Request message for
4996/// [DataprocMetastore.DeleteService][google.cloud.metastore.v1.DataprocMetastore.DeleteService].
4997///
4998/// [google.cloud.metastore.v1.DataprocMetastore.DeleteService]: crate::client::DataprocMetastore::delete_service
4999#[derive(Clone, Default, PartialEq)]
5000#[non_exhaustive]
5001pub struct DeleteServiceRequest {
5002 /// Required. The relative resource name of the metastore service to delete, in
5003 /// the following form:
5004 ///
5005 /// `projects/{project_number}/locations/{location_id}/services/{service_id}`.
5006 pub name: std::string::String,
5007
5008 /// Optional. A request ID. Specify a unique request ID to allow the server to
5009 /// ignore the request if it has completed. The server will ignore subsequent
5010 /// requests that provide a duplicate request ID for at least 60 minutes after
5011 /// the first request.
5012 ///
5013 /// For example, if an initial request times out, followed by another request
5014 /// with the same request ID, the server ignores the second request to prevent
5015 /// the creation of duplicate commitments.
5016 ///
5017 /// The request ID must be a valid
5018 /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
5019 /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
5020 pub request_id: std::string::String,
5021
5022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5023}
5024
5025impl DeleteServiceRequest {
5026 /// Creates a new default instance.
5027 pub fn new() -> Self {
5028 std::default::Default::default()
5029 }
5030
5031 /// Sets the value of [name][crate::model::DeleteServiceRequest::name].
5032 ///
5033 /// # Example
5034 /// ```ignore,no_run
5035 /// # use google_cloud_metastore_v1::model::DeleteServiceRequest;
5036 /// # let project_id = "project_id";
5037 /// # let location_id = "location_id";
5038 /// # let service_id = "service_id";
5039 /// let x = DeleteServiceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/services/{service_id}"));
5040 /// ```
5041 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5042 self.name = v.into();
5043 self
5044 }
5045
5046 /// Sets the value of [request_id][crate::model::DeleteServiceRequest::request_id].
5047 ///
5048 /// # Example
5049 /// ```ignore,no_run
5050 /// # use google_cloud_metastore_v1::model::DeleteServiceRequest;
5051 /// let x = DeleteServiceRequest::new().set_request_id("example");
5052 /// ```
5053 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5054 self.request_id = v.into();
5055 self
5056 }
5057}
5058
5059impl wkt::message::Message for DeleteServiceRequest {
5060 fn typename() -> &'static str {
5061 "type.googleapis.com/google.cloud.metastore.v1.DeleteServiceRequest"
5062 }
5063}
5064
5065/// Request message for
5066/// [DataprocMetastore.ListMetadataImports][google.cloud.metastore.v1.DataprocMetastore.ListMetadataImports].
5067///
5068/// [google.cloud.metastore.v1.DataprocMetastore.ListMetadataImports]: crate::client::DataprocMetastore::list_metadata_imports
5069#[derive(Clone, Default, PartialEq)]
5070#[non_exhaustive]
5071pub struct ListMetadataImportsRequest {
5072 /// Required. The relative resource name of the service whose metadata imports
5073 /// to list, in the following form:
5074 ///
5075 /// `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`.
5076 pub parent: std::string::String,
5077
5078 /// Optional. The maximum number of imports to return. The response may contain
5079 /// less than the maximum number. If unspecified, no more than 500 imports are
5080 /// returned. The maximum value is 1000; values above 1000 are changed to 1000.
5081 pub page_size: i32,
5082
5083 /// Optional. A page token, received from a previous
5084 /// [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices]
5085 /// call. Provide this token to retrieve the subsequent page.
5086 ///
5087 /// To retrieve the first page, supply an empty page token.
5088 ///
5089 /// When paginating, other parameters provided to
5090 /// [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices]
5091 /// must match the call that provided the page token.
5092 ///
5093 /// [google.cloud.metastore.v1.DataprocMetastore.ListServices]: crate::client::DataprocMetastore::list_services
5094 pub page_token: std::string::String,
5095
5096 /// Optional. The filter to apply to list results.
5097 pub filter: std::string::String,
5098
5099 /// Optional. Specify the ordering of results as described in [Sorting
5100 /// Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
5101 /// If not specified, the results will be sorted in the default order.
5102 pub order_by: std::string::String,
5103
5104 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5105}
5106
5107impl ListMetadataImportsRequest {
5108 /// Creates a new default instance.
5109 pub fn new() -> Self {
5110 std::default::Default::default()
5111 }
5112
5113 /// Sets the value of [parent][crate::model::ListMetadataImportsRequest::parent].
5114 ///
5115 /// # Example
5116 /// ```ignore,no_run
5117 /// # use google_cloud_metastore_v1::model::ListMetadataImportsRequest;
5118 /// # let project_id = "project_id";
5119 /// # let location_id = "location_id";
5120 /// # let service_id = "service_id";
5121 /// let x = ListMetadataImportsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/services/{service_id}"));
5122 /// ```
5123 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5124 self.parent = v.into();
5125 self
5126 }
5127
5128 /// Sets the value of [page_size][crate::model::ListMetadataImportsRequest::page_size].
5129 ///
5130 /// # Example
5131 /// ```ignore,no_run
5132 /// # use google_cloud_metastore_v1::model::ListMetadataImportsRequest;
5133 /// let x = ListMetadataImportsRequest::new().set_page_size(42);
5134 /// ```
5135 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5136 self.page_size = v.into();
5137 self
5138 }
5139
5140 /// Sets the value of [page_token][crate::model::ListMetadataImportsRequest::page_token].
5141 ///
5142 /// # Example
5143 /// ```ignore,no_run
5144 /// # use google_cloud_metastore_v1::model::ListMetadataImportsRequest;
5145 /// let x = ListMetadataImportsRequest::new().set_page_token("example");
5146 /// ```
5147 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5148 self.page_token = v.into();
5149 self
5150 }
5151
5152 /// Sets the value of [filter][crate::model::ListMetadataImportsRequest::filter].
5153 ///
5154 /// # Example
5155 /// ```ignore,no_run
5156 /// # use google_cloud_metastore_v1::model::ListMetadataImportsRequest;
5157 /// let x = ListMetadataImportsRequest::new().set_filter("example");
5158 /// ```
5159 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5160 self.filter = v.into();
5161 self
5162 }
5163
5164 /// Sets the value of [order_by][crate::model::ListMetadataImportsRequest::order_by].
5165 ///
5166 /// # Example
5167 /// ```ignore,no_run
5168 /// # use google_cloud_metastore_v1::model::ListMetadataImportsRequest;
5169 /// let x = ListMetadataImportsRequest::new().set_order_by("example");
5170 /// ```
5171 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5172 self.order_by = v.into();
5173 self
5174 }
5175}
5176
5177impl wkt::message::Message for ListMetadataImportsRequest {
5178 fn typename() -> &'static str {
5179 "type.googleapis.com/google.cloud.metastore.v1.ListMetadataImportsRequest"
5180 }
5181}
5182
5183/// Response message for
5184/// [DataprocMetastore.ListMetadataImports][google.cloud.metastore.v1.DataprocMetastore.ListMetadataImports].
5185///
5186/// [google.cloud.metastore.v1.DataprocMetastore.ListMetadataImports]: crate::client::DataprocMetastore::list_metadata_imports
5187#[derive(Clone, Default, PartialEq)]
5188#[non_exhaustive]
5189pub struct ListMetadataImportsResponse {
5190 /// The imports in the specified service.
5191 pub metadata_imports: std::vec::Vec<crate::model::MetadataImport>,
5192
5193 /// A token that can be sent as `page_token` to retrieve the next page. If this
5194 /// field is omitted, there are no subsequent pages.
5195 pub next_page_token: std::string::String,
5196
5197 /// Locations that could not be reached.
5198 pub unreachable: std::vec::Vec<std::string::String>,
5199
5200 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5201}
5202
5203impl ListMetadataImportsResponse {
5204 /// Creates a new default instance.
5205 pub fn new() -> Self {
5206 std::default::Default::default()
5207 }
5208
5209 /// Sets the value of [metadata_imports][crate::model::ListMetadataImportsResponse::metadata_imports].
5210 ///
5211 /// # Example
5212 /// ```ignore,no_run
5213 /// # use google_cloud_metastore_v1::model::ListMetadataImportsResponse;
5214 /// use google_cloud_metastore_v1::model::MetadataImport;
5215 /// let x = ListMetadataImportsResponse::new()
5216 /// .set_metadata_imports([
5217 /// MetadataImport::default()/* use setters */,
5218 /// MetadataImport::default()/* use (different) setters */,
5219 /// ]);
5220 /// ```
5221 pub fn set_metadata_imports<T, V>(mut self, v: T) -> Self
5222 where
5223 T: std::iter::IntoIterator<Item = V>,
5224 V: std::convert::Into<crate::model::MetadataImport>,
5225 {
5226 use std::iter::Iterator;
5227 self.metadata_imports = v.into_iter().map(|i| i.into()).collect();
5228 self
5229 }
5230
5231 /// Sets the value of [next_page_token][crate::model::ListMetadataImportsResponse::next_page_token].
5232 ///
5233 /// # Example
5234 /// ```ignore,no_run
5235 /// # use google_cloud_metastore_v1::model::ListMetadataImportsResponse;
5236 /// let x = ListMetadataImportsResponse::new().set_next_page_token("example");
5237 /// ```
5238 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5239 self.next_page_token = v.into();
5240 self
5241 }
5242
5243 /// Sets the value of [unreachable][crate::model::ListMetadataImportsResponse::unreachable].
5244 ///
5245 /// # Example
5246 /// ```ignore,no_run
5247 /// # use google_cloud_metastore_v1::model::ListMetadataImportsResponse;
5248 /// let x = ListMetadataImportsResponse::new().set_unreachable(["a", "b", "c"]);
5249 /// ```
5250 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5251 where
5252 T: std::iter::IntoIterator<Item = V>,
5253 V: std::convert::Into<std::string::String>,
5254 {
5255 use std::iter::Iterator;
5256 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5257 self
5258 }
5259}
5260
5261impl wkt::message::Message for ListMetadataImportsResponse {
5262 fn typename() -> &'static str {
5263 "type.googleapis.com/google.cloud.metastore.v1.ListMetadataImportsResponse"
5264 }
5265}
5266
5267#[doc(hidden)]
5268impl google_cloud_gax::paginator::internal::PageableResponse for ListMetadataImportsResponse {
5269 type PageItem = crate::model::MetadataImport;
5270
5271 fn items(self) -> std::vec::Vec<Self::PageItem> {
5272 self.metadata_imports
5273 }
5274
5275 fn next_page_token(&self) -> std::string::String {
5276 use std::clone::Clone;
5277 self.next_page_token.clone()
5278 }
5279}
5280
5281/// Request message for
5282/// [DataprocMetastore.GetMetadataImport][google.cloud.metastore.v1.DataprocMetastore.GetMetadataImport].
5283///
5284/// [google.cloud.metastore.v1.DataprocMetastore.GetMetadataImport]: crate::client::DataprocMetastore::get_metadata_import
5285#[derive(Clone, Default, PartialEq)]
5286#[non_exhaustive]
5287pub struct GetMetadataImportRequest {
5288 /// Required. The relative resource name of the metadata import to retrieve, in
5289 /// the following form:
5290 ///
5291 /// `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`.
5292 pub name: std::string::String,
5293
5294 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5295}
5296
5297impl GetMetadataImportRequest {
5298 /// Creates a new default instance.
5299 pub fn new() -> Self {
5300 std::default::Default::default()
5301 }
5302
5303 /// Sets the value of [name][crate::model::GetMetadataImportRequest::name].
5304 ///
5305 /// # Example
5306 /// ```ignore,no_run
5307 /// # use google_cloud_metastore_v1::model::GetMetadataImportRequest;
5308 /// # let project_id = "project_id";
5309 /// # let location_id = "location_id";
5310 /// # let service_id = "service_id";
5311 /// # let metadata_import_id = "metadata_import_id";
5312 /// let x = GetMetadataImportRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}"));
5313 /// ```
5314 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5315 self.name = v.into();
5316 self
5317 }
5318}
5319
5320impl wkt::message::Message for GetMetadataImportRequest {
5321 fn typename() -> &'static str {
5322 "type.googleapis.com/google.cloud.metastore.v1.GetMetadataImportRequest"
5323 }
5324}
5325
5326/// Request message for
5327/// [DataprocMetastore.CreateMetadataImport][google.cloud.metastore.v1.DataprocMetastore.CreateMetadataImport].
5328///
5329/// [google.cloud.metastore.v1.DataprocMetastore.CreateMetadataImport]: crate::client::DataprocMetastore::create_metadata_import
5330#[derive(Clone, Default, PartialEq)]
5331#[non_exhaustive]
5332pub struct CreateMetadataImportRequest {
5333 /// Required. The relative resource name of the service in which to create a
5334 /// metastore import, in the following form:
5335 ///
5336 /// `projects/{project_number}/locations/{location_id}/services/{service_id}`.
5337 pub parent: std::string::String,
5338
5339 /// Required. The ID of the metadata import, which is used as the final
5340 /// component of the metadata import's name.
5341 ///
5342 /// This value must be between 1 and 64 characters long, begin with a letter,
5343 /// end with a letter or number, and consist of alpha-numeric ASCII characters
5344 /// or hyphens.
5345 pub metadata_import_id: std::string::String,
5346
5347 /// Required. The metadata import to create. The `name` field is ignored. The
5348 /// ID of the created metadata import must be provided in the request's
5349 /// `metadata_import_id` field.
5350 pub metadata_import: std::option::Option<crate::model::MetadataImport>,
5351
5352 /// Optional. A request ID. Specify a unique request ID to allow the server to
5353 /// ignore the request if it has completed. The server will ignore subsequent
5354 /// requests that provide a duplicate request ID for at least 60 minutes after
5355 /// the first request.
5356 ///
5357 /// For example, if an initial request times out, followed by another request
5358 /// with the same request ID, the server ignores the second request to prevent
5359 /// the creation of duplicate commitments.
5360 ///
5361 /// The request ID must be a valid
5362 /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
5363 /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
5364 pub request_id: std::string::String,
5365
5366 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5367}
5368
5369impl CreateMetadataImportRequest {
5370 /// Creates a new default instance.
5371 pub fn new() -> Self {
5372 std::default::Default::default()
5373 }
5374
5375 /// Sets the value of [parent][crate::model::CreateMetadataImportRequest::parent].
5376 ///
5377 /// # Example
5378 /// ```ignore,no_run
5379 /// # use google_cloud_metastore_v1::model::CreateMetadataImportRequest;
5380 /// # let project_id = "project_id";
5381 /// # let location_id = "location_id";
5382 /// # let service_id = "service_id";
5383 /// let x = CreateMetadataImportRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/services/{service_id}"));
5384 /// ```
5385 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5386 self.parent = v.into();
5387 self
5388 }
5389
5390 /// Sets the value of [metadata_import_id][crate::model::CreateMetadataImportRequest::metadata_import_id].
5391 ///
5392 /// # Example
5393 /// ```ignore,no_run
5394 /// # use google_cloud_metastore_v1::model::CreateMetadataImportRequest;
5395 /// let x = CreateMetadataImportRequest::new().set_metadata_import_id("example");
5396 /// ```
5397 pub fn set_metadata_import_id<T: std::convert::Into<std::string::String>>(
5398 mut self,
5399 v: T,
5400 ) -> Self {
5401 self.metadata_import_id = v.into();
5402 self
5403 }
5404
5405 /// Sets the value of [metadata_import][crate::model::CreateMetadataImportRequest::metadata_import].
5406 ///
5407 /// # Example
5408 /// ```ignore,no_run
5409 /// # use google_cloud_metastore_v1::model::CreateMetadataImportRequest;
5410 /// use google_cloud_metastore_v1::model::MetadataImport;
5411 /// let x = CreateMetadataImportRequest::new().set_metadata_import(MetadataImport::default()/* use setters */);
5412 /// ```
5413 pub fn set_metadata_import<T>(mut self, v: T) -> Self
5414 where
5415 T: std::convert::Into<crate::model::MetadataImport>,
5416 {
5417 self.metadata_import = std::option::Option::Some(v.into());
5418 self
5419 }
5420
5421 /// Sets or clears the value of [metadata_import][crate::model::CreateMetadataImportRequest::metadata_import].
5422 ///
5423 /// # Example
5424 /// ```ignore,no_run
5425 /// # use google_cloud_metastore_v1::model::CreateMetadataImportRequest;
5426 /// use google_cloud_metastore_v1::model::MetadataImport;
5427 /// let x = CreateMetadataImportRequest::new().set_or_clear_metadata_import(Some(MetadataImport::default()/* use setters */));
5428 /// let x = CreateMetadataImportRequest::new().set_or_clear_metadata_import(None::<MetadataImport>);
5429 /// ```
5430 pub fn set_or_clear_metadata_import<T>(mut self, v: std::option::Option<T>) -> Self
5431 where
5432 T: std::convert::Into<crate::model::MetadataImport>,
5433 {
5434 self.metadata_import = v.map(|x| x.into());
5435 self
5436 }
5437
5438 /// Sets the value of [request_id][crate::model::CreateMetadataImportRequest::request_id].
5439 ///
5440 /// # Example
5441 /// ```ignore,no_run
5442 /// # use google_cloud_metastore_v1::model::CreateMetadataImportRequest;
5443 /// let x = CreateMetadataImportRequest::new().set_request_id("example");
5444 /// ```
5445 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5446 self.request_id = v.into();
5447 self
5448 }
5449}
5450
5451impl wkt::message::Message for CreateMetadataImportRequest {
5452 fn typename() -> &'static str {
5453 "type.googleapis.com/google.cloud.metastore.v1.CreateMetadataImportRequest"
5454 }
5455}
5456
5457/// Request message for
5458/// [DataprocMetastore.UpdateMetadataImport][google.cloud.metastore.v1.DataprocMetastore.UpdateMetadataImport].
5459///
5460/// [google.cloud.metastore.v1.DataprocMetastore.UpdateMetadataImport]: crate::client::DataprocMetastore::update_metadata_import
5461#[derive(Clone, Default, PartialEq)]
5462#[non_exhaustive]
5463pub struct UpdateMetadataImportRequest {
5464 /// Required. A field mask used to specify the fields to be overwritten in the
5465 /// metadata import resource by the update.
5466 /// Fields specified in the `update_mask` are relative to the resource (not
5467 /// to the full request). A field is overwritten if it is in the mask.
5468 pub update_mask: std::option::Option<wkt::FieldMask>,
5469
5470 /// Required. The metadata import to update. The server only merges fields
5471 /// in the import if they are specified in `update_mask`.
5472 ///
5473 /// The metadata import's `name` field is used to identify the metastore
5474 /// import to be updated.
5475 pub metadata_import: std::option::Option<crate::model::MetadataImport>,
5476
5477 /// Optional. A request ID. Specify a unique request ID to allow the server to
5478 /// ignore the request if it has completed. The server will ignore subsequent
5479 /// requests that provide a duplicate request ID for at least 60 minutes after
5480 /// the first request.
5481 ///
5482 /// For example, if an initial request times out, followed by another request
5483 /// with the same request ID, the server ignores the second request to prevent
5484 /// the creation of duplicate commitments.
5485 ///
5486 /// The request ID must be a valid
5487 /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
5488 /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
5489 pub request_id: std::string::String,
5490
5491 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5492}
5493
5494impl UpdateMetadataImportRequest {
5495 /// Creates a new default instance.
5496 pub fn new() -> Self {
5497 std::default::Default::default()
5498 }
5499
5500 /// Sets the value of [update_mask][crate::model::UpdateMetadataImportRequest::update_mask].
5501 ///
5502 /// # Example
5503 /// ```ignore,no_run
5504 /// # use google_cloud_metastore_v1::model::UpdateMetadataImportRequest;
5505 /// use wkt::FieldMask;
5506 /// let x = UpdateMetadataImportRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5507 /// ```
5508 pub fn set_update_mask<T>(mut self, v: T) -> Self
5509 where
5510 T: std::convert::Into<wkt::FieldMask>,
5511 {
5512 self.update_mask = std::option::Option::Some(v.into());
5513 self
5514 }
5515
5516 /// Sets or clears the value of [update_mask][crate::model::UpdateMetadataImportRequest::update_mask].
5517 ///
5518 /// # Example
5519 /// ```ignore,no_run
5520 /// # use google_cloud_metastore_v1::model::UpdateMetadataImportRequest;
5521 /// use wkt::FieldMask;
5522 /// let x = UpdateMetadataImportRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5523 /// let x = UpdateMetadataImportRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5524 /// ```
5525 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5526 where
5527 T: std::convert::Into<wkt::FieldMask>,
5528 {
5529 self.update_mask = v.map(|x| x.into());
5530 self
5531 }
5532
5533 /// Sets the value of [metadata_import][crate::model::UpdateMetadataImportRequest::metadata_import].
5534 ///
5535 /// # Example
5536 /// ```ignore,no_run
5537 /// # use google_cloud_metastore_v1::model::UpdateMetadataImportRequest;
5538 /// use google_cloud_metastore_v1::model::MetadataImport;
5539 /// let x = UpdateMetadataImportRequest::new().set_metadata_import(MetadataImport::default()/* use setters */);
5540 /// ```
5541 pub fn set_metadata_import<T>(mut self, v: T) -> Self
5542 where
5543 T: std::convert::Into<crate::model::MetadataImport>,
5544 {
5545 self.metadata_import = std::option::Option::Some(v.into());
5546 self
5547 }
5548
5549 /// Sets or clears the value of [metadata_import][crate::model::UpdateMetadataImportRequest::metadata_import].
5550 ///
5551 /// # Example
5552 /// ```ignore,no_run
5553 /// # use google_cloud_metastore_v1::model::UpdateMetadataImportRequest;
5554 /// use google_cloud_metastore_v1::model::MetadataImport;
5555 /// let x = UpdateMetadataImportRequest::new().set_or_clear_metadata_import(Some(MetadataImport::default()/* use setters */));
5556 /// let x = UpdateMetadataImportRequest::new().set_or_clear_metadata_import(None::<MetadataImport>);
5557 /// ```
5558 pub fn set_or_clear_metadata_import<T>(mut self, v: std::option::Option<T>) -> Self
5559 where
5560 T: std::convert::Into<crate::model::MetadataImport>,
5561 {
5562 self.metadata_import = v.map(|x| x.into());
5563 self
5564 }
5565
5566 /// Sets the value of [request_id][crate::model::UpdateMetadataImportRequest::request_id].
5567 ///
5568 /// # Example
5569 /// ```ignore,no_run
5570 /// # use google_cloud_metastore_v1::model::UpdateMetadataImportRequest;
5571 /// let x = UpdateMetadataImportRequest::new().set_request_id("example");
5572 /// ```
5573 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5574 self.request_id = v.into();
5575 self
5576 }
5577}
5578
5579impl wkt::message::Message for UpdateMetadataImportRequest {
5580 fn typename() -> &'static str {
5581 "type.googleapis.com/google.cloud.metastore.v1.UpdateMetadataImportRequest"
5582 }
5583}
5584
5585/// Request message for
5586/// [DataprocMetastore.ListBackups][google.cloud.metastore.v1.DataprocMetastore.ListBackups].
5587///
5588/// [google.cloud.metastore.v1.DataprocMetastore.ListBackups]: crate::client::DataprocMetastore::list_backups
5589#[derive(Clone, Default, PartialEq)]
5590#[non_exhaustive]
5591pub struct ListBackupsRequest {
5592 /// Required. The relative resource name of the service whose backups to
5593 /// list, in the following form:
5594 ///
5595 /// `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`.
5596 pub parent: std::string::String,
5597
5598 /// Optional. The maximum number of backups to return. The response may contain
5599 /// less than the maximum number. If unspecified, no more than 500 backups are
5600 /// returned. The maximum value is 1000; values above 1000 are changed to 1000.
5601 pub page_size: i32,
5602
5603 /// Optional. A page token, received from a previous
5604 /// [DataprocMetastore.ListBackups][google.cloud.metastore.v1.DataprocMetastore.ListBackups]
5605 /// call. Provide this token to retrieve the subsequent page.
5606 ///
5607 /// To retrieve the first page, supply an empty page token.
5608 ///
5609 /// When paginating, other parameters provided to
5610 /// [DataprocMetastore.ListBackups][google.cloud.metastore.v1.DataprocMetastore.ListBackups]
5611 /// must match the call that provided the page token.
5612 ///
5613 /// [google.cloud.metastore.v1.DataprocMetastore.ListBackups]: crate::client::DataprocMetastore::list_backups
5614 pub page_token: std::string::String,
5615
5616 /// Optional. The filter to apply to list results.
5617 pub filter: std::string::String,
5618
5619 /// Optional. Specify the ordering of results as described in [Sorting
5620 /// Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
5621 /// If not specified, the results will be sorted in the default order.
5622 pub order_by: std::string::String,
5623
5624 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5625}
5626
5627impl ListBackupsRequest {
5628 /// Creates a new default instance.
5629 pub fn new() -> Self {
5630 std::default::Default::default()
5631 }
5632
5633 /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
5634 ///
5635 /// # Example
5636 /// ```ignore,no_run
5637 /// # use google_cloud_metastore_v1::model::ListBackupsRequest;
5638 /// # let project_id = "project_id";
5639 /// # let location_id = "location_id";
5640 /// # let service_id = "service_id";
5641 /// let x = ListBackupsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/services/{service_id}"));
5642 /// ```
5643 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5644 self.parent = v.into();
5645 self
5646 }
5647
5648 /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
5649 ///
5650 /// # Example
5651 /// ```ignore,no_run
5652 /// # use google_cloud_metastore_v1::model::ListBackupsRequest;
5653 /// let x = ListBackupsRequest::new().set_page_size(42);
5654 /// ```
5655 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5656 self.page_size = v.into();
5657 self
5658 }
5659
5660 /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
5661 ///
5662 /// # Example
5663 /// ```ignore,no_run
5664 /// # use google_cloud_metastore_v1::model::ListBackupsRequest;
5665 /// let x = ListBackupsRequest::new().set_page_token("example");
5666 /// ```
5667 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5668 self.page_token = v.into();
5669 self
5670 }
5671
5672 /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
5673 ///
5674 /// # Example
5675 /// ```ignore,no_run
5676 /// # use google_cloud_metastore_v1::model::ListBackupsRequest;
5677 /// let x = ListBackupsRequest::new().set_filter("example");
5678 /// ```
5679 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5680 self.filter = v.into();
5681 self
5682 }
5683
5684 /// Sets the value of [order_by][crate::model::ListBackupsRequest::order_by].
5685 ///
5686 /// # Example
5687 /// ```ignore,no_run
5688 /// # use google_cloud_metastore_v1::model::ListBackupsRequest;
5689 /// let x = ListBackupsRequest::new().set_order_by("example");
5690 /// ```
5691 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5692 self.order_by = v.into();
5693 self
5694 }
5695}
5696
5697impl wkt::message::Message for ListBackupsRequest {
5698 fn typename() -> &'static str {
5699 "type.googleapis.com/google.cloud.metastore.v1.ListBackupsRequest"
5700 }
5701}
5702
5703/// Response message for
5704/// [DataprocMetastore.ListBackups][google.cloud.metastore.v1.DataprocMetastore.ListBackups].
5705///
5706/// [google.cloud.metastore.v1.DataprocMetastore.ListBackups]: crate::client::DataprocMetastore::list_backups
5707#[derive(Clone, Default, PartialEq)]
5708#[non_exhaustive]
5709pub struct ListBackupsResponse {
5710 /// The backups of the specified service.
5711 pub backups: std::vec::Vec<crate::model::Backup>,
5712
5713 /// A token that can be sent as `page_token` to retrieve the next page. If this
5714 /// field is omitted, there are no subsequent pages.
5715 pub next_page_token: std::string::String,
5716
5717 /// Locations that could not be reached.
5718 pub unreachable: std::vec::Vec<std::string::String>,
5719
5720 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5721}
5722
5723impl ListBackupsResponse {
5724 /// Creates a new default instance.
5725 pub fn new() -> Self {
5726 std::default::Default::default()
5727 }
5728
5729 /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
5730 ///
5731 /// # Example
5732 /// ```ignore,no_run
5733 /// # use google_cloud_metastore_v1::model::ListBackupsResponse;
5734 /// use google_cloud_metastore_v1::model::Backup;
5735 /// let x = ListBackupsResponse::new()
5736 /// .set_backups([
5737 /// Backup::default()/* use setters */,
5738 /// Backup::default()/* use (different) setters */,
5739 /// ]);
5740 /// ```
5741 pub fn set_backups<T, V>(mut self, v: T) -> Self
5742 where
5743 T: std::iter::IntoIterator<Item = V>,
5744 V: std::convert::Into<crate::model::Backup>,
5745 {
5746 use std::iter::Iterator;
5747 self.backups = v.into_iter().map(|i| i.into()).collect();
5748 self
5749 }
5750
5751 /// Sets the value of [next_page_token][crate::model::ListBackupsResponse::next_page_token].
5752 ///
5753 /// # Example
5754 /// ```ignore,no_run
5755 /// # use google_cloud_metastore_v1::model::ListBackupsResponse;
5756 /// let x = ListBackupsResponse::new().set_next_page_token("example");
5757 /// ```
5758 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5759 self.next_page_token = v.into();
5760 self
5761 }
5762
5763 /// Sets the value of [unreachable][crate::model::ListBackupsResponse::unreachable].
5764 ///
5765 /// # Example
5766 /// ```ignore,no_run
5767 /// # use google_cloud_metastore_v1::model::ListBackupsResponse;
5768 /// let x = ListBackupsResponse::new().set_unreachable(["a", "b", "c"]);
5769 /// ```
5770 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5771 where
5772 T: std::iter::IntoIterator<Item = V>,
5773 V: std::convert::Into<std::string::String>,
5774 {
5775 use std::iter::Iterator;
5776 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5777 self
5778 }
5779}
5780
5781impl wkt::message::Message for ListBackupsResponse {
5782 fn typename() -> &'static str {
5783 "type.googleapis.com/google.cloud.metastore.v1.ListBackupsResponse"
5784 }
5785}
5786
5787#[doc(hidden)]
5788impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupsResponse {
5789 type PageItem = crate::model::Backup;
5790
5791 fn items(self) -> std::vec::Vec<Self::PageItem> {
5792 self.backups
5793 }
5794
5795 fn next_page_token(&self) -> std::string::String {
5796 use std::clone::Clone;
5797 self.next_page_token.clone()
5798 }
5799}
5800
5801/// Request message for
5802/// [DataprocMetastore.GetBackup][google.cloud.metastore.v1.DataprocMetastore.GetBackup].
5803///
5804/// [google.cloud.metastore.v1.DataprocMetastore.GetBackup]: crate::client::DataprocMetastore::get_backup
5805#[derive(Clone, Default, PartialEq)]
5806#[non_exhaustive]
5807pub struct GetBackupRequest {
5808 /// Required. The relative resource name of the backup to retrieve, in the
5809 /// following form:
5810 ///
5811 /// `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
5812 pub name: std::string::String,
5813
5814 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5815}
5816
5817impl GetBackupRequest {
5818 /// Creates a new default instance.
5819 pub fn new() -> Self {
5820 std::default::Default::default()
5821 }
5822
5823 /// Sets the value of [name][crate::model::GetBackupRequest::name].
5824 ///
5825 /// # Example
5826 /// ```ignore,no_run
5827 /// # use google_cloud_metastore_v1::model::GetBackupRequest;
5828 /// # let project_id = "project_id";
5829 /// # let location_id = "location_id";
5830 /// # let service_id = "service_id";
5831 /// # let backup_id = "backup_id";
5832 /// let x = GetBackupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}"));
5833 /// ```
5834 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5835 self.name = v.into();
5836 self
5837 }
5838}
5839
5840impl wkt::message::Message for GetBackupRequest {
5841 fn typename() -> &'static str {
5842 "type.googleapis.com/google.cloud.metastore.v1.GetBackupRequest"
5843 }
5844}
5845
5846/// Request message for
5847/// [DataprocMetastore.CreateBackup][google.cloud.metastore.v1.DataprocMetastore.CreateBackup].
5848///
5849/// [google.cloud.metastore.v1.DataprocMetastore.CreateBackup]: crate::client::DataprocMetastore::create_backup
5850#[derive(Clone, Default, PartialEq)]
5851#[non_exhaustive]
5852pub struct CreateBackupRequest {
5853 /// Required. The relative resource name of the service in which to create a
5854 /// backup of the following form:
5855 ///
5856 /// `projects/{project_number}/locations/{location_id}/services/{service_id}`.
5857 pub parent: std::string::String,
5858
5859 /// Required. The ID of the backup, which is used as the final component of the
5860 /// backup's name.
5861 ///
5862 /// This value must be between 1 and 64 characters long, begin with a letter,
5863 /// end with a letter or number, and consist of alpha-numeric ASCII characters
5864 /// or hyphens.
5865 pub backup_id: std::string::String,
5866
5867 /// Required. The backup to create. The `name` field is ignored. The ID of the
5868 /// created backup must be provided in the request's `backup_id` field.
5869 pub backup: std::option::Option<crate::model::Backup>,
5870
5871 /// Optional. A request ID. Specify a unique request ID to allow the server to
5872 /// ignore the request if it has completed. The server will ignore subsequent
5873 /// requests that provide a duplicate request ID for at least 60 minutes after
5874 /// the first request.
5875 ///
5876 /// For example, if an initial request times out, followed by another request
5877 /// with the same request ID, the server ignores the second request to prevent
5878 /// the creation of duplicate commitments.
5879 ///
5880 /// The request ID must be a valid
5881 /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
5882 /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
5883 pub request_id: std::string::String,
5884
5885 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5886}
5887
5888impl CreateBackupRequest {
5889 /// Creates a new default instance.
5890 pub fn new() -> Self {
5891 std::default::Default::default()
5892 }
5893
5894 /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
5895 ///
5896 /// # Example
5897 /// ```ignore,no_run
5898 /// # use google_cloud_metastore_v1::model::CreateBackupRequest;
5899 /// # let project_id = "project_id";
5900 /// # let location_id = "location_id";
5901 /// # let service_id = "service_id";
5902 /// let x = CreateBackupRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/services/{service_id}"));
5903 /// ```
5904 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5905 self.parent = v.into();
5906 self
5907 }
5908
5909 /// Sets the value of [backup_id][crate::model::CreateBackupRequest::backup_id].
5910 ///
5911 /// # Example
5912 /// ```ignore,no_run
5913 /// # use google_cloud_metastore_v1::model::CreateBackupRequest;
5914 /// let x = CreateBackupRequest::new().set_backup_id("example");
5915 /// ```
5916 pub fn set_backup_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5917 self.backup_id = v.into();
5918 self
5919 }
5920
5921 /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
5922 ///
5923 /// # Example
5924 /// ```ignore,no_run
5925 /// # use google_cloud_metastore_v1::model::CreateBackupRequest;
5926 /// use google_cloud_metastore_v1::model::Backup;
5927 /// let x = CreateBackupRequest::new().set_backup(Backup::default()/* use setters */);
5928 /// ```
5929 pub fn set_backup<T>(mut self, v: T) -> Self
5930 where
5931 T: std::convert::Into<crate::model::Backup>,
5932 {
5933 self.backup = std::option::Option::Some(v.into());
5934 self
5935 }
5936
5937 /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
5938 ///
5939 /// # Example
5940 /// ```ignore,no_run
5941 /// # use google_cloud_metastore_v1::model::CreateBackupRequest;
5942 /// use google_cloud_metastore_v1::model::Backup;
5943 /// let x = CreateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
5944 /// let x = CreateBackupRequest::new().set_or_clear_backup(None::<Backup>);
5945 /// ```
5946 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
5947 where
5948 T: std::convert::Into<crate::model::Backup>,
5949 {
5950 self.backup = v.map(|x| x.into());
5951 self
5952 }
5953
5954 /// Sets the value of [request_id][crate::model::CreateBackupRequest::request_id].
5955 ///
5956 /// # Example
5957 /// ```ignore,no_run
5958 /// # use google_cloud_metastore_v1::model::CreateBackupRequest;
5959 /// let x = CreateBackupRequest::new().set_request_id("example");
5960 /// ```
5961 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5962 self.request_id = v.into();
5963 self
5964 }
5965}
5966
5967impl wkt::message::Message for CreateBackupRequest {
5968 fn typename() -> &'static str {
5969 "type.googleapis.com/google.cloud.metastore.v1.CreateBackupRequest"
5970 }
5971}
5972
5973/// Request message for
5974/// [DataprocMetastore.DeleteBackup][google.cloud.metastore.v1.DataprocMetastore.DeleteBackup].
5975///
5976/// [google.cloud.metastore.v1.DataprocMetastore.DeleteBackup]: crate::client::DataprocMetastore::delete_backup
5977#[derive(Clone, Default, PartialEq)]
5978#[non_exhaustive]
5979pub struct DeleteBackupRequest {
5980 /// Required. The relative resource name of the backup to delete, in the
5981 /// following form:
5982 ///
5983 /// `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
5984 pub name: std::string::String,
5985
5986 /// Optional. A request ID. Specify a unique request ID to allow the server to
5987 /// ignore the request if it has completed. The server will ignore subsequent
5988 /// requests that provide a duplicate request ID for at least 60 minutes after
5989 /// the first request.
5990 ///
5991 /// For example, if an initial request times out, followed by another request
5992 /// with the same request ID, the server ignores the second request to prevent
5993 /// the creation of duplicate commitments.
5994 ///
5995 /// The request ID must be a valid
5996 /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
5997 /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
5998 pub request_id: std::string::String,
5999
6000 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6001}
6002
6003impl DeleteBackupRequest {
6004 /// Creates a new default instance.
6005 pub fn new() -> Self {
6006 std::default::Default::default()
6007 }
6008
6009 /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
6010 ///
6011 /// # Example
6012 /// ```ignore,no_run
6013 /// # use google_cloud_metastore_v1::model::DeleteBackupRequest;
6014 /// # let project_id = "project_id";
6015 /// # let location_id = "location_id";
6016 /// # let service_id = "service_id";
6017 /// # let backup_id = "backup_id";
6018 /// let x = DeleteBackupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}"));
6019 /// ```
6020 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6021 self.name = v.into();
6022 self
6023 }
6024
6025 /// Sets the value of [request_id][crate::model::DeleteBackupRequest::request_id].
6026 ///
6027 /// # Example
6028 /// ```ignore,no_run
6029 /// # use google_cloud_metastore_v1::model::DeleteBackupRequest;
6030 /// let x = DeleteBackupRequest::new().set_request_id("example");
6031 /// ```
6032 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6033 self.request_id = v.into();
6034 self
6035 }
6036}
6037
6038impl wkt::message::Message for DeleteBackupRequest {
6039 fn typename() -> &'static str {
6040 "type.googleapis.com/google.cloud.metastore.v1.DeleteBackupRequest"
6041 }
6042}
6043
6044/// Request message for
6045/// [DataprocMetastore.ExportMetadata][google.cloud.metastore.v1.DataprocMetastore.ExportMetadata].
6046///
6047/// [google.cloud.metastore.v1.DataprocMetastore.ExportMetadata]: crate::client::DataprocMetastore::export_metadata
6048#[derive(Clone, Default, PartialEq)]
6049#[non_exhaustive]
6050pub struct ExportMetadataRequest {
6051 /// Required. The relative resource name of the metastore service to run
6052 /// export, in the following form:
6053 ///
6054 /// `projects/{project_id}/locations/{location_id}/services/{service_id}`.
6055 pub service: std::string::String,
6056
6057 /// Optional. A request ID. Specify a unique request ID to allow the server to
6058 /// ignore the request if it has completed. The server will ignore subsequent
6059 /// requests that provide a duplicate request ID for at least 60 minutes after
6060 /// the first request.
6061 ///
6062 /// For example, if an initial request times out, followed by another request
6063 /// with the same request ID, the server ignores the second request to prevent
6064 /// the creation of duplicate commitments.
6065 ///
6066 /// The request ID must be a valid
6067 /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format).
6068 /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
6069 pub request_id: std::string::String,
6070
6071 /// Optional. The type of the database dump. If unspecified, defaults to
6072 /// `MYSQL`.
6073 pub database_dump_type: crate::model::database_dump_spec::Type,
6074
6075 /// Required. Destination that metadata is exported to.
6076 pub destination: std::option::Option<crate::model::export_metadata_request::Destination>,
6077
6078 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6079}
6080
6081impl ExportMetadataRequest {
6082 /// Creates a new default instance.
6083 pub fn new() -> Self {
6084 std::default::Default::default()
6085 }
6086
6087 /// Sets the value of [service][crate::model::ExportMetadataRequest::service].
6088 ///
6089 /// # Example
6090 /// ```ignore,no_run
6091 /// # use google_cloud_metastore_v1::model::ExportMetadataRequest;
6092 /// # let project_id = "project_id";
6093 /// # let location_id = "location_id";
6094 /// # let service_id = "service_id";
6095 /// let x = ExportMetadataRequest::new().set_service(format!("projects/{project_id}/locations/{location_id}/services/{service_id}"));
6096 /// ```
6097 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6098 self.service = v.into();
6099 self
6100 }
6101
6102 /// Sets the value of [request_id][crate::model::ExportMetadataRequest::request_id].
6103 ///
6104 /// # Example
6105 /// ```ignore,no_run
6106 /// # use google_cloud_metastore_v1::model::ExportMetadataRequest;
6107 /// let x = ExportMetadataRequest::new().set_request_id("example");
6108 /// ```
6109 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6110 self.request_id = v.into();
6111 self
6112 }
6113
6114 /// Sets the value of [database_dump_type][crate::model::ExportMetadataRequest::database_dump_type].
6115 ///
6116 /// # Example
6117 /// ```ignore,no_run
6118 /// # use google_cloud_metastore_v1::model::ExportMetadataRequest;
6119 /// use google_cloud_metastore_v1::model::database_dump_spec::Type;
6120 /// let x0 = ExportMetadataRequest::new().set_database_dump_type(Type::Mysql);
6121 /// let x1 = ExportMetadataRequest::new().set_database_dump_type(Type::Avro);
6122 /// ```
6123 pub fn set_database_dump_type<T: std::convert::Into<crate::model::database_dump_spec::Type>>(
6124 mut self,
6125 v: T,
6126 ) -> Self {
6127 self.database_dump_type = v.into();
6128 self
6129 }
6130
6131 /// Sets the value of [destination][crate::model::ExportMetadataRequest::destination].
6132 ///
6133 /// Note that all the setters affecting `destination` are mutually
6134 /// exclusive.
6135 ///
6136 /// # Example
6137 /// ```ignore,no_run
6138 /// # use google_cloud_metastore_v1::model::ExportMetadataRequest;
6139 /// use google_cloud_metastore_v1::model::export_metadata_request::Destination;
6140 /// let x = ExportMetadataRequest::new().set_destination(Some(Destination::DestinationGcsFolder("example".to_string())));
6141 /// ```
6142 pub fn set_destination<
6143 T: std::convert::Into<std::option::Option<crate::model::export_metadata_request::Destination>>,
6144 >(
6145 mut self,
6146 v: T,
6147 ) -> Self {
6148 self.destination = v.into();
6149 self
6150 }
6151
6152 /// The value of [destination][crate::model::ExportMetadataRequest::destination]
6153 /// if it holds a `DestinationGcsFolder`, `None` if the field is not set or
6154 /// holds a different branch.
6155 pub fn destination_gcs_folder(&self) -> std::option::Option<&std::string::String> {
6156 #[allow(unreachable_patterns)]
6157 self.destination.as_ref().and_then(|v| match v {
6158 crate::model::export_metadata_request::Destination::DestinationGcsFolder(v) => {
6159 std::option::Option::Some(v)
6160 }
6161 _ => std::option::Option::None,
6162 })
6163 }
6164
6165 /// Sets the value of [destination][crate::model::ExportMetadataRequest::destination]
6166 /// to hold a `DestinationGcsFolder`.
6167 ///
6168 /// Note that all the setters affecting `destination` are
6169 /// mutually exclusive.
6170 ///
6171 /// # Example
6172 /// ```ignore,no_run
6173 /// # use google_cloud_metastore_v1::model::ExportMetadataRequest;
6174 /// let x = ExportMetadataRequest::new().set_destination_gcs_folder("example");
6175 /// assert!(x.destination_gcs_folder().is_some());
6176 /// ```
6177 pub fn set_destination_gcs_folder<T: std::convert::Into<std::string::String>>(
6178 mut self,
6179 v: T,
6180 ) -> Self {
6181 self.destination = std::option::Option::Some(
6182 crate::model::export_metadata_request::Destination::DestinationGcsFolder(v.into()),
6183 );
6184 self
6185 }
6186}
6187
6188impl wkt::message::Message for ExportMetadataRequest {
6189 fn typename() -> &'static str {
6190 "type.googleapis.com/google.cloud.metastore.v1.ExportMetadataRequest"
6191 }
6192}
6193
6194/// Defines additional types related to [ExportMetadataRequest].
6195pub mod export_metadata_request {
6196 #[allow(unused_imports)]
6197 use super::*;
6198
6199 /// Required. Destination that metadata is exported to.
6200 #[derive(Clone, Debug, PartialEq)]
6201 #[non_exhaustive]
6202 pub enum Destination {
6203 /// A Cloud Storage URI of a folder, in the format
6204 /// `gs://<bucket_name>/<path_inside_bucket>`. A sub-folder
6205 /// `<export_folder>` containing exported files will be created below it.
6206 DestinationGcsFolder(std::string::String),
6207 }
6208}
6209
6210/// Request message for [DataprocMetastore.Restore][].
6211#[derive(Clone, Default, PartialEq)]
6212#[non_exhaustive]
6213pub struct RestoreServiceRequest {
6214 /// Required. The relative resource name of the metastore service to run
6215 /// restore, in the following form:
6216 ///
6217 /// `projects/{project_id}/locations/{location_id}/services/{service_id}`.
6218 pub service: std::string::String,
6219
6220 /// Required. The relative resource name of the metastore service backup to
6221 /// restore from, in the following form:
6222 ///
6223 /// `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
6224 pub backup: std::string::String,
6225
6226 /// Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`.
6227 pub restore_type: crate::model::restore::RestoreType,
6228
6229 /// Optional. A request ID. Specify a unique request ID to allow the server to
6230 /// ignore the request if it has completed. The server will ignore subsequent
6231 /// requests that provide a duplicate request ID for at least 60 minutes after
6232 /// the first request.
6233 ///
6234 /// For example, if an initial request times out, followed by another request
6235 /// with the same request ID, the server ignores the second request to prevent
6236 /// the creation of duplicate commitments.
6237 ///
6238 /// The request ID must be a valid
6239 /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format).
6240 /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
6241 pub request_id: std::string::String,
6242
6243 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6244}
6245
6246impl RestoreServiceRequest {
6247 /// Creates a new default instance.
6248 pub fn new() -> Self {
6249 std::default::Default::default()
6250 }
6251
6252 /// Sets the value of [service][crate::model::RestoreServiceRequest::service].
6253 ///
6254 /// # Example
6255 /// ```ignore,no_run
6256 /// # use google_cloud_metastore_v1::model::RestoreServiceRequest;
6257 /// # let project_id = "project_id";
6258 /// # let location_id = "location_id";
6259 /// # let service_id = "service_id";
6260 /// let x = RestoreServiceRequest::new().set_service(format!("projects/{project_id}/locations/{location_id}/services/{service_id}"));
6261 /// ```
6262 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6263 self.service = v.into();
6264 self
6265 }
6266
6267 /// Sets the value of [backup][crate::model::RestoreServiceRequest::backup].
6268 ///
6269 /// # Example
6270 /// ```ignore,no_run
6271 /// # use google_cloud_metastore_v1::model::RestoreServiceRequest;
6272 /// # let project_id = "project_id";
6273 /// # let location_id = "location_id";
6274 /// # let service_id = "service_id";
6275 /// # let backup_id = "backup_id";
6276 /// let x = RestoreServiceRequest::new().set_backup(format!("projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}"));
6277 /// ```
6278 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6279 self.backup = v.into();
6280 self
6281 }
6282
6283 /// Sets the value of [restore_type][crate::model::RestoreServiceRequest::restore_type].
6284 ///
6285 /// # Example
6286 /// ```ignore,no_run
6287 /// # use google_cloud_metastore_v1::model::RestoreServiceRequest;
6288 /// use google_cloud_metastore_v1::model::restore::RestoreType;
6289 /// let x0 = RestoreServiceRequest::new().set_restore_type(RestoreType::Full);
6290 /// let x1 = RestoreServiceRequest::new().set_restore_type(RestoreType::MetadataOnly);
6291 /// ```
6292 pub fn set_restore_type<T: std::convert::Into<crate::model::restore::RestoreType>>(
6293 mut self,
6294 v: T,
6295 ) -> Self {
6296 self.restore_type = v.into();
6297 self
6298 }
6299
6300 /// Sets the value of [request_id][crate::model::RestoreServiceRequest::request_id].
6301 ///
6302 /// # Example
6303 /// ```ignore,no_run
6304 /// # use google_cloud_metastore_v1::model::RestoreServiceRequest;
6305 /// let x = RestoreServiceRequest::new().set_request_id("example");
6306 /// ```
6307 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6308 self.request_id = v.into();
6309 self
6310 }
6311}
6312
6313impl wkt::message::Message for RestoreServiceRequest {
6314 fn typename() -> &'static str {
6315 "type.googleapis.com/google.cloud.metastore.v1.RestoreServiceRequest"
6316 }
6317}
6318
6319/// Represents the metadata of a long-running operation.
6320#[derive(Clone, Default, PartialEq)]
6321#[non_exhaustive]
6322pub struct OperationMetadata {
6323 /// Output only. The time the operation was created.
6324 pub create_time: std::option::Option<wkt::Timestamp>,
6325
6326 /// Output only. The time the operation finished running.
6327 pub end_time: std::option::Option<wkt::Timestamp>,
6328
6329 /// Output only. Server-defined resource path for the target of the operation.
6330 pub target: std::string::String,
6331
6332 /// Output only. Name of the verb executed by the operation.
6333 pub verb: std::string::String,
6334
6335 /// Output only. Human-readable status of the operation, if any.
6336 pub status_message: std::string::String,
6337
6338 /// Output only. Identifies whether the caller has requested cancellation
6339 /// of the operation. Operations that have successfully been cancelled
6340 /// have [Operation.error][] value with a
6341 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
6342 /// `Code.CANCELLED`.
6343 pub requested_cancellation: bool,
6344
6345 /// Output only. API version used to start the operation.
6346 pub api_version: std::string::String,
6347
6348 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6349}
6350
6351impl OperationMetadata {
6352 /// Creates a new default instance.
6353 pub fn new() -> Self {
6354 std::default::Default::default()
6355 }
6356
6357 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
6358 ///
6359 /// # Example
6360 /// ```ignore,no_run
6361 /// # use google_cloud_metastore_v1::model::OperationMetadata;
6362 /// use wkt::Timestamp;
6363 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
6364 /// ```
6365 pub fn set_create_time<T>(mut self, v: T) -> Self
6366 where
6367 T: std::convert::Into<wkt::Timestamp>,
6368 {
6369 self.create_time = std::option::Option::Some(v.into());
6370 self
6371 }
6372
6373 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
6374 ///
6375 /// # Example
6376 /// ```ignore,no_run
6377 /// # use google_cloud_metastore_v1::model::OperationMetadata;
6378 /// use wkt::Timestamp;
6379 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6380 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
6381 /// ```
6382 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6383 where
6384 T: std::convert::Into<wkt::Timestamp>,
6385 {
6386 self.create_time = v.map(|x| x.into());
6387 self
6388 }
6389
6390 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
6391 ///
6392 /// # Example
6393 /// ```ignore,no_run
6394 /// # use google_cloud_metastore_v1::model::OperationMetadata;
6395 /// use wkt::Timestamp;
6396 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
6397 /// ```
6398 pub fn set_end_time<T>(mut self, v: T) -> Self
6399 where
6400 T: std::convert::Into<wkt::Timestamp>,
6401 {
6402 self.end_time = std::option::Option::Some(v.into());
6403 self
6404 }
6405
6406 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
6407 ///
6408 /// # Example
6409 /// ```ignore,no_run
6410 /// # use google_cloud_metastore_v1::model::OperationMetadata;
6411 /// use wkt::Timestamp;
6412 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
6413 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
6414 /// ```
6415 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
6416 where
6417 T: std::convert::Into<wkt::Timestamp>,
6418 {
6419 self.end_time = v.map(|x| x.into());
6420 self
6421 }
6422
6423 /// Sets the value of [target][crate::model::OperationMetadata::target].
6424 ///
6425 /// # Example
6426 /// ```ignore,no_run
6427 /// # use google_cloud_metastore_v1::model::OperationMetadata;
6428 /// let x = OperationMetadata::new().set_target("example");
6429 /// ```
6430 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6431 self.target = v.into();
6432 self
6433 }
6434
6435 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
6436 ///
6437 /// # Example
6438 /// ```ignore,no_run
6439 /// # use google_cloud_metastore_v1::model::OperationMetadata;
6440 /// let x = OperationMetadata::new().set_verb("example");
6441 /// ```
6442 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6443 self.verb = v.into();
6444 self
6445 }
6446
6447 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
6448 ///
6449 /// # Example
6450 /// ```ignore,no_run
6451 /// # use google_cloud_metastore_v1::model::OperationMetadata;
6452 /// let x = OperationMetadata::new().set_status_message("example");
6453 /// ```
6454 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6455 self.status_message = v.into();
6456 self
6457 }
6458
6459 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
6460 ///
6461 /// # Example
6462 /// ```ignore,no_run
6463 /// # use google_cloud_metastore_v1::model::OperationMetadata;
6464 /// let x = OperationMetadata::new().set_requested_cancellation(true);
6465 /// ```
6466 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6467 self.requested_cancellation = v.into();
6468 self
6469 }
6470
6471 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
6472 ///
6473 /// # Example
6474 /// ```ignore,no_run
6475 /// # use google_cloud_metastore_v1::model::OperationMetadata;
6476 /// let x = OperationMetadata::new().set_api_version("example");
6477 /// ```
6478 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6479 self.api_version = v.into();
6480 self
6481 }
6482}
6483
6484impl wkt::message::Message for OperationMetadata {
6485 fn typename() -> &'static str {
6486 "type.googleapis.com/google.cloud.metastore.v1.OperationMetadata"
6487 }
6488}
6489
6490/// Metadata about the service in a location.
6491#[derive(Clone, Default, PartialEq)]
6492#[non_exhaustive]
6493pub struct LocationMetadata {
6494 /// The versions of Hive Metastore that can be used when creating a new
6495 /// metastore service in this location. The server guarantees that exactly one
6496 /// `HiveMetastoreVersion` in the list will set `is_default`.
6497 pub supported_hive_metastore_versions:
6498 std::vec::Vec<crate::model::location_metadata::HiveMetastoreVersion>,
6499
6500 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6501}
6502
6503impl LocationMetadata {
6504 /// Creates a new default instance.
6505 pub fn new() -> Self {
6506 std::default::Default::default()
6507 }
6508
6509 /// Sets the value of [supported_hive_metastore_versions][crate::model::LocationMetadata::supported_hive_metastore_versions].
6510 ///
6511 /// # Example
6512 /// ```ignore,no_run
6513 /// # use google_cloud_metastore_v1::model::LocationMetadata;
6514 /// use google_cloud_metastore_v1::model::location_metadata::HiveMetastoreVersion;
6515 /// let x = LocationMetadata::new()
6516 /// .set_supported_hive_metastore_versions([
6517 /// HiveMetastoreVersion::default()/* use setters */,
6518 /// HiveMetastoreVersion::default()/* use (different) setters */,
6519 /// ]);
6520 /// ```
6521 pub fn set_supported_hive_metastore_versions<T, V>(mut self, v: T) -> Self
6522 where
6523 T: std::iter::IntoIterator<Item = V>,
6524 V: std::convert::Into<crate::model::location_metadata::HiveMetastoreVersion>,
6525 {
6526 use std::iter::Iterator;
6527 self.supported_hive_metastore_versions = v.into_iter().map(|i| i.into()).collect();
6528 self
6529 }
6530}
6531
6532impl wkt::message::Message for LocationMetadata {
6533 fn typename() -> &'static str {
6534 "type.googleapis.com/google.cloud.metastore.v1.LocationMetadata"
6535 }
6536}
6537
6538/// Defines additional types related to [LocationMetadata].
6539pub mod location_metadata {
6540 #[allow(unused_imports)]
6541 use super::*;
6542
6543 /// A specification of a supported version of the Hive Metastore software.
6544 #[derive(Clone, Default, PartialEq)]
6545 #[non_exhaustive]
6546 pub struct HiveMetastoreVersion {
6547 /// The semantic version of the Hive Metastore software.
6548 pub version: std::string::String,
6549
6550 /// Whether `version` will be chosen by the server if a metastore service is
6551 /// created with a `HiveMetastoreConfig` that omits the `version`.
6552 pub is_default: bool,
6553
6554 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6555 }
6556
6557 impl HiveMetastoreVersion {
6558 /// Creates a new default instance.
6559 pub fn new() -> Self {
6560 std::default::Default::default()
6561 }
6562
6563 /// Sets the value of [version][crate::model::location_metadata::HiveMetastoreVersion::version].
6564 ///
6565 /// # Example
6566 /// ```ignore,no_run
6567 /// # use google_cloud_metastore_v1::model::location_metadata::HiveMetastoreVersion;
6568 /// let x = HiveMetastoreVersion::new().set_version("example");
6569 /// ```
6570 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6571 self.version = v.into();
6572 self
6573 }
6574
6575 /// Sets the value of [is_default][crate::model::location_metadata::HiveMetastoreVersion::is_default].
6576 ///
6577 /// # Example
6578 /// ```ignore,no_run
6579 /// # use google_cloud_metastore_v1::model::location_metadata::HiveMetastoreVersion;
6580 /// let x = HiveMetastoreVersion::new().set_is_default(true);
6581 /// ```
6582 pub fn set_is_default<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6583 self.is_default = v.into();
6584 self
6585 }
6586 }
6587
6588 impl wkt::message::Message for HiveMetastoreVersion {
6589 fn typename() -> &'static str {
6590 "type.googleapis.com/google.cloud.metastore.v1.LocationMetadata.HiveMetastoreVersion"
6591 }
6592 }
6593}
6594
6595/// The specification of database dump to import from or export to.
6596#[derive(Clone, Default, PartialEq)]
6597#[non_exhaustive]
6598pub struct DatabaseDumpSpec {
6599 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6600}
6601
6602impl DatabaseDumpSpec {
6603 /// Creates a new default instance.
6604 pub fn new() -> Self {
6605 std::default::Default::default()
6606 }
6607}
6608
6609impl wkt::message::Message for DatabaseDumpSpec {
6610 fn typename() -> &'static str {
6611 "type.googleapis.com/google.cloud.metastore.v1.DatabaseDumpSpec"
6612 }
6613}
6614
6615/// Defines additional types related to [DatabaseDumpSpec].
6616pub mod database_dump_spec {
6617 #[allow(unused_imports)]
6618 use super::*;
6619
6620 /// The type of the database dump.
6621 ///
6622 /// # Working with unknown values
6623 ///
6624 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6625 /// additional enum variants at any time. Adding new variants is not considered
6626 /// a breaking change. Applications should write their code in anticipation of:
6627 ///
6628 /// - New values appearing in future releases of the client library, **and**
6629 /// - New values received dynamically, without application changes.
6630 ///
6631 /// Please consult the [Working with enums] section in the user guide for some
6632 /// guidelines.
6633 ///
6634 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6635 #[derive(Clone, Debug, PartialEq)]
6636 #[non_exhaustive]
6637 pub enum Type {
6638 /// The type of the database dump is unknown.
6639 Unspecified,
6640 /// Database dump is a MySQL dump file.
6641 Mysql,
6642 /// Database dump contains Avro files.
6643 Avro,
6644 /// If set, the enum was initialized with an unknown value.
6645 ///
6646 /// Applications can examine the value using [Type::value] or
6647 /// [Type::name].
6648 UnknownValue(r#type::UnknownValue),
6649 }
6650
6651 #[doc(hidden)]
6652 pub mod r#type {
6653 #[allow(unused_imports)]
6654 use super::*;
6655 #[derive(Clone, Debug, PartialEq)]
6656 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6657 }
6658
6659 impl Type {
6660 /// Gets the enum value.
6661 ///
6662 /// Returns `None` if the enum contains an unknown value deserialized from
6663 /// the string representation of enums.
6664 pub fn value(&self) -> std::option::Option<i32> {
6665 match self {
6666 Self::Unspecified => std::option::Option::Some(0),
6667 Self::Mysql => std::option::Option::Some(1),
6668 Self::Avro => std::option::Option::Some(2),
6669 Self::UnknownValue(u) => u.0.value(),
6670 }
6671 }
6672
6673 /// Gets the enum value as a string.
6674 ///
6675 /// Returns `None` if the enum contains an unknown value deserialized from
6676 /// the integer representation of enums.
6677 pub fn name(&self) -> std::option::Option<&str> {
6678 match self {
6679 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
6680 Self::Mysql => std::option::Option::Some("MYSQL"),
6681 Self::Avro => std::option::Option::Some("AVRO"),
6682 Self::UnknownValue(u) => u.0.name(),
6683 }
6684 }
6685 }
6686
6687 impl std::default::Default for Type {
6688 fn default() -> Self {
6689 use std::convert::From;
6690 Self::from(0)
6691 }
6692 }
6693
6694 impl std::fmt::Display for Type {
6695 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6696 wkt::internal::display_enum(f, self.name(), self.value())
6697 }
6698 }
6699
6700 impl std::convert::From<i32> for Type {
6701 fn from(value: i32) -> Self {
6702 match value {
6703 0 => Self::Unspecified,
6704 1 => Self::Mysql,
6705 2 => Self::Avro,
6706 _ => Self::UnknownValue(r#type::UnknownValue(
6707 wkt::internal::UnknownEnumValue::Integer(value),
6708 )),
6709 }
6710 }
6711 }
6712
6713 impl std::convert::From<&str> for Type {
6714 fn from(value: &str) -> Self {
6715 use std::string::ToString;
6716 match value {
6717 "TYPE_UNSPECIFIED" => Self::Unspecified,
6718 "MYSQL" => Self::Mysql,
6719 "AVRO" => Self::Avro,
6720 _ => Self::UnknownValue(r#type::UnknownValue(
6721 wkt::internal::UnknownEnumValue::String(value.to_string()),
6722 )),
6723 }
6724 }
6725 }
6726
6727 impl serde::ser::Serialize for Type {
6728 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6729 where
6730 S: serde::Serializer,
6731 {
6732 match self {
6733 Self::Unspecified => serializer.serialize_i32(0),
6734 Self::Mysql => serializer.serialize_i32(1),
6735 Self::Avro => serializer.serialize_i32(2),
6736 Self::UnknownValue(u) => u.0.serialize(serializer),
6737 }
6738 }
6739 }
6740
6741 impl<'de> serde::de::Deserialize<'de> for Type {
6742 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6743 where
6744 D: serde::Deserializer<'de>,
6745 {
6746 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
6747 ".google.cloud.metastore.v1.DatabaseDumpSpec.Type",
6748 ))
6749 }
6750 }
6751}
6752
6753/// Request message for
6754/// [DataprocMetastore.QueryMetadata][google.cloud.metastore.v1.DataprocMetastore.QueryMetadata].
6755///
6756/// [google.cloud.metastore.v1.DataprocMetastore.QueryMetadata]: crate::client::DataprocMetastore::query_metadata
6757#[derive(Clone, Default, PartialEq)]
6758#[non_exhaustive]
6759pub struct QueryMetadataRequest {
6760 /// Required. The relative resource name of the metastore service to query
6761 /// metadata, in the following format:
6762 ///
6763 /// `projects/{project_id}/locations/{location_id}/services/{service_id}`.
6764 pub service: std::string::String,
6765
6766 /// Required. A read-only SQL query to execute against the metadata database.
6767 /// The query cannot change or mutate the data.
6768 pub query: std::string::String,
6769
6770 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6771}
6772
6773impl QueryMetadataRequest {
6774 /// Creates a new default instance.
6775 pub fn new() -> Self {
6776 std::default::Default::default()
6777 }
6778
6779 /// Sets the value of [service][crate::model::QueryMetadataRequest::service].
6780 ///
6781 /// # Example
6782 /// ```ignore,no_run
6783 /// # use google_cloud_metastore_v1::model::QueryMetadataRequest;
6784 /// # let project_id = "project_id";
6785 /// # let location_id = "location_id";
6786 /// # let service_id = "service_id";
6787 /// let x = QueryMetadataRequest::new().set_service(format!("projects/{project_id}/locations/{location_id}/services/{service_id}"));
6788 /// ```
6789 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6790 self.service = v.into();
6791 self
6792 }
6793
6794 /// Sets the value of [query][crate::model::QueryMetadataRequest::query].
6795 ///
6796 /// # Example
6797 /// ```ignore,no_run
6798 /// # use google_cloud_metastore_v1::model::QueryMetadataRequest;
6799 /// let x = QueryMetadataRequest::new().set_query("example");
6800 /// ```
6801 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6802 self.query = v.into();
6803 self
6804 }
6805}
6806
6807impl wkt::message::Message for QueryMetadataRequest {
6808 fn typename() -> &'static str {
6809 "type.googleapis.com/google.cloud.metastore.v1.QueryMetadataRequest"
6810 }
6811}
6812
6813/// Response message for
6814/// [DataprocMetastore.QueryMetadata][google.cloud.metastore.v1.DataprocMetastore.QueryMetadata].
6815///
6816/// [google.cloud.metastore.v1.DataprocMetastore.QueryMetadata]: crate::client::DataprocMetastore::query_metadata
6817#[derive(Clone, Default, PartialEq)]
6818#[non_exhaustive]
6819pub struct QueryMetadataResponse {
6820 /// The manifest URI is link to a JSON instance in Cloud Storage.
6821 /// This instance manifests immediately along with QueryMetadataResponse. The
6822 /// content of the URI is not retriable until the long-running operation query
6823 /// against the metadata finishes.
6824 pub result_manifest_uri: std::string::String,
6825
6826 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6827}
6828
6829impl QueryMetadataResponse {
6830 /// Creates a new default instance.
6831 pub fn new() -> Self {
6832 std::default::Default::default()
6833 }
6834
6835 /// Sets the value of [result_manifest_uri][crate::model::QueryMetadataResponse::result_manifest_uri].
6836 ///
6837 /// # Example
6838 /// ```ignore,no_run
6839 /// # use google_cloud_metastore_v1::model::QueryMetadataResponse;
6840 /// let x = QueryMetadataResponse::new().set_result_manifest_uri("example");
6841 /// ```
6842 pub fn set_result_manifest_uri<T: std::convert::Into<std::string::String>>(
6843 mut self,
6844 v: T,
6845 ) -> Self {
6846 self.result_manifest_uri = v.into();
6847 self
6848 }
6849}
6850
6851impl wkt::message::Message for QueryMetadataResponse {
6852 fn typename() -> &'static str {
6853 "type.googleapis.com/google.cloud.metastore.v1.QueryMetadataResponse"
6854 }
6855}
6856
6857/// Error details in public error message for
6858/// [DataprocMetastore.QueryMetadata][google.cloud.metastore.v1.DataprocMetastore.QueryMetadata].
6859///
6860/// [google.cloud.metastore.v1.DataprocMetastore.QueryMetadata]: crate::client::DataprocMetastore::query_metadata
6861#[derive(Clone, Default, PartialEq)]
6862#[non_exhaustive]
6863pub struct ErrorDetails {
6864 /// Additional structured details about this error.
6865 ///
6866 /// Keys define the failure items.
6867 /// Value describes the exception or details of the item.
6868 pub details: std::collections::HashMap<std::string::String, std::string::String>,
6869
6870 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6871}
6872
6873impl ErrorDetails {
6874 /// Creates a new default instance.
6875 pub fn new() -> Self {
6876 std::default::Default::default()
6877 }
6878
6879 /// Sets the value of [details][crate::model::ErrorDetails::details].
6880 ///
6881 /// # Example
6882 /// ```ignore,no_run
6883 /// # use google_cloud_metastore_v1::model::ErrorDetails;
6884 /// let x = ErrorDetails::new().set_details([
6885 /// ("key0", "abc"),
6886 /// ("key1", "xyz"),
6887 /// ]);
6888 /// ```
6889 pub fn set_details<T, K, V>(mut self, v: T) -> Self
6890 where
6891 T: std::iter::IntoIterator<Item = (K, V)>,
6892 K: std::convert::Into<std::string::String>,
6893 V: std::convert::Into<std::string::String>,
6894 {
6895 use std::iter::Iterator;
6896 self.details = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6897 self
6898 }
6899}
6900
6901impl wkt::message::Message for ErrorDetails {
6902 fn typename() -> &'static str {
6903 "type.googleapis.com/google.cloud.metastore.v1.ErrorDetails"
6904 }
6905}
6906
6907/// Request message for
6908/// [DataprocMetastore.MoveTableToDatabase][google.cloud.metastore.v1.DataprocMetastore.MoveTableToDatabase].
6909///
6910/// [google.cloud.metastore.v1.DataprocMetastore.MoveTableToDatabase]: crate::client::DataprocMetastore::move_table_to_database
6911#[derive(Clone, Default, PartialEq)]
6912#[non_exhaustive]
6913pub struct MoveTableToDatabaseRequest {
6914 /// Required. The relative resource name of the metastore service to mutate
6915 /// metadata, in the following format:
6916 ///
6917 /// `projects/{project_id}/locations/{location_id}/services/{service_id}`.
6918 pub service: std::string::String,
6919
6920 /// Required. The name of the table to be moved.
6921 pub table_name: std::string::String,
6922
6923 /// Required. The name of the database where the table resides.
6924 pub db_name: std::string::String,
6925
6926 /// Required. The name of the database where the table should be moved.
6927 pub destination_db_name: std::string::String,
6928
6929 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6930}
6931
6932impl MoveTableToDatabaseRequest {
6933 /// Creates a new default instance.
6934 pub fn new() -> Self {
6935 std::default::Default::default()
6936 }
6937
6938 /// Sets the value of [service][crate::model::MoveTableToDatabaseRequest::service].
6939 ///
6940 /// # Example
6941 /// ```ignore,no_run
6942 /// # use google_cloud_metastore_v1::model::MoveTableToDatabaseRequest;
6943 /// # let project_id = "project_id";
6944 /// # let location_id = "location_id";
6945 /// # let service_id = "service_id";
6946 /// let x = MoveTableToDatabaseRequest::new().set_service(format!("projects/{project_id}/locations/{location_id}/services/{service_id}"));
6947 /// ```
6948 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6949 self.service = v.into();
6950 self
6951 }
6952
6953 /// Sets the value of [table_name][crate::model::MoveTableToDatabaseRequest::table_name].
6954 ///
6955 /// # Example
6956 /// ```ignore,no_run
6957 /// # use google_cloud_metastore_v1::model::MoveTableToDatabaseRequest;
6958 /// let x = MoveTableToDatabaseRequest::new().set_table_name("example");
6959 /// ```
6960 pub fn set_table_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6961 self.table_name = v.into();
6962 self
6963 }
6964
6965 /// Sets the value of [db_name][crate::model::MoveTableToDatabaseRequest::db_name].
6966 ///
6967 /// # Example
6968 /// ```ignore,no_run
6969 /// # use google_cloud_metastore_v1::model::MoveTableToDatabaseRequest;
6970 /// let x = MoveTableToDatabaseRequest::new().set_db_name("example");
6971 /// ```
6972 pub fn set_db_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6973 self.db_name = v.into();
6974 self
6975 }
6976
6977 /// Sets the value of [destination_db_name][crate::model::MoveTableToDatabaseRequest::destination_db_name].
6978 ///
6979 /// # Example
6980 /// ```ignore,no_run
6981 /// # use google_cloud_metastore_v1::model::MoveTableToDatabaseRequest;
6982 /// let x = MoveTableToDatabaseRequest::new().set_destination_db_name("example");
6983 /// ```
6984 pub fn set_destination_db_name<T: std::convert::Into<std::string::String>>(
6985 mut self,
6986 v: T,
6987 ) -> Self {
6988 self.destination_db_name = v.into();
6989 self
6990 }
6991}
6992
6993impl wkt::message::Message for MoveTableToDatabaseRequest {
6994 fn typename() -> &'static str {
6995 "type.googleapis.com/google.cloud.metastore.v1.MoveTableToDatabaseRequest"
6996 }
6997}
6998
6999/// Response message for
7000/// [DataprocMetastore.MoveTableToDatabase][google.cloud.metastore.v1.DataprocMetastore.MoveTableToDatabase].
7001///
7002/// [google.cloud.metastore.v1.DataprocMetastore.MoveTableToDatabase]: crate::client::DataprocMetastore::move_table_to_database
7003#[derive(Clone, Default, PartialEq)]
7004#[non_exhaustive]
7005pub struct MoveTableToDatabaseResponse {
7006 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7007}
7008
7009impl MoveTableToDatabaseResponse {
7010 /// Creates a new default instance.
7011 pub fn new() -> Self {
7012 std::default::Default::default()
7013 }
7014}
7015
7016impl wkt::message::Message for MoveTableToDatabaseResponse {
7017 fn typename() -> &'static str {
7018 "type.googleapis.com/google.cloud.metastore.v1.MoveTableToDatabaseResponse"
7019 }
7020}
7021
7022/// Request message for
7023/// [DataprocMetastore.AlterMetadataResourceLocation][google.cloud.metastore.v1.DataprocMetastore.AlterMetadataResourceLocation].
7024///
7025/// [google.cloud.metastore.v1.DataprocMetastore.AlterMetadataResourceLocation]: crate::client::DataprocMetastore::alter_metadata_resource_location
7026#[derive(Clone, Default, PartialEq)]
7027#[non_exhaustive]
7028pub struct AlterMetadataResourceLocationRequest {
7029 /// Required. The relative resource name of the metastore service to mutate
7030 /// metadata, in the following format:
7031 ///
7032 /// `projects/{project_id}/locations/{location_id}/services/{service_id}`.
7033 pub service: std::string::String,
7034
7035 /// Required. The relative metadata resource name in the following format.
7036 ///
7037 /// `databases/{database_id}`
7038 /// or
7039 /// `databases/{database_id}/tables/{table_id}`
7040 /// or
7041 /// `databases/{database_id}/tables/{table_id}/partitions/{partition_id}`
7042 pub resource_name: std::string::String,
7043
7044 /// Required. The new location URI for the metadata resource.
7045 pub location_uri: std::string::String,
7046
7047 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7048}
7049
7050impl AlterMetadataResourceLocationRequest {
7051 /// Creates a new default instance.
7052 pub fn new() -> Self {
7053 std::default::Default::default()
7054 }
7055
7056 /// Sets the value of [service][crate::model::AlterMetadataResourceLocationRequest::service].
7057 ///
7058 /// # Example
7059 /// ```ignore,no_run
7060 /// # use google_cloud_metastore_v1::model::AlterMetadataResourceLocationRequest;
7061 /// # let project_id = "project_id";
7062 /// # let location_id = "location_id";
7063 /// # let service_id = "service_id";
7064 /// let x = AlterMetadataResourceLocationRequest::new().set_service(format!("projects/{project_id}/locations/{location_id}/services/{service_id}"));
7065 /// ```
7066 pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7067 self.service = v.into();
7068 self
7069 }
7070
7071 /// Sets the value of [resource_name][crate::model::AlterMetadataResourceLocationRequest::resource_name].
7072 ///
7073 /// # Example
7074 /// ```ignore,no_run
7075 /// # use google_cloud_metastore_v1::model::AlterMetadataResourceLocationRequest;
7076 /// let x = AlterMetadataResourceLocationRequest::new().set_resource_name("example");
7077 /// ```
7078 pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7079 self.resource_name = v.into();
7080 self
7081 }
7082
7083 /// Sets the value of [location_uri][crate::model::AlterMetadataResourceLocationRequest::location_uri].
7084 ///
7085 /// # Example
7086 /// ```ignore,no_run
7087 /// # use google_cloud_metastore_v1::model::AlterMetadataResourceLocationRequest;
7088 /// let x = AlterMetadataResourceLocationRequest::new().set_location_uri("example");
7089 /// ```
7090 pub fn set_location_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7091 self.location_uri = v.into();
7092 self
7093 }
7094}
7095
7096impl wkt::message::Message for AlterMetadataResourceLocationRequest {
7097 fn typename() -> &'static str {
7098 "type.googleapis.com/google.cloud.metastore.v1.AlterMetadataResourceLocationRequest"
7099 }
7100}
7101
7102/// Response message for
7103/// [DataprocMetastore.AlterMetadataResourceLocation][google.cloud.metastore.v1.DataprocMetastore.AlterMetadataResourceLocation].
7104///
7105/// [google.cloud.metastore.v1.DataprocMetastore.AlterMetadataResourceLocation]: crate::client::DataprocMetastore::alter_metadata_resource_location
7106#[derive(Clone, Default, PartialEq)]
7107#[non_exhaustive]
7108pub struct AlterMetadataResourceLocationResponse {
7109 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7110}
7111
7112impl AlterMetadataResourceLocationResponse {
7113 /// Creates a new default instance.
7114 pub fn new() -> Self {
7115 std::default::Default::default()
7116 }
7117}
7118
7119impl wkt::message::Message for AlterMetadataResourceLocationResponse {
7120 fn typename() -> &'static str {
7121 "type.googleapis.com/google.cloud.metastore.v1.AlterMetadataResourceLocationResponse"
7122 }
7123}
7124
7125/// Represents a federation of multiple backend metastores.
7126#[derive(Clone, Default, PartialEq)]
7127#[non_exhaustive]
7128pub struct Federation {
7129 /// Immutable. The relative resource name of the federation, of the
7130 /// form:
7131 /// projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
7132 pub name: std::string::String,
7133
7134 /// Output only. The time when the metastore federation was created.
7135 pub create_time: std::option::Option<wkt::Timestamp>,
7136
7137 /// Output only. The time when the metastore federation was last updated.
7138 pub update_time: std::option::Option<wkt::Timestamp>,
7139
7140 /// User-defined labels for the metastore federation.
7141 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7142
7143 /// Immutable. The Apache Hive metastore version of the federation. All backend
7144 /// metastore versions must be compatible with the federation version.
7145 pub version: std::string::String,
7146
7147 /// A map from `BackendMetastore` rank to `BackendMetastore`s from which the
7148 /// federation service serves metadata at query time. The map key represents
7149 /// the order in which `BackendMetastore`s should be evaluated to resolve
7150 /// database names at query time and should be greater than or equal to zero. A
7151 /// `BackendMetastore` with a lower number will be evaluated before a
7152 /// `BackendMetastore` with a higher number.
7153 pub backend_metastores: std::collections::HashMap<i32, crate::model::BackendMetastore>,
7154
7155 /// Output only. The federation endpoint.
7156 pub endpoint_uri: std::string::String,
7157
7158 /// Output only. The current state of the federation.
7159 pub state: crate::model::federation::State,
7160
7161 /// Output only. Additional information about the current state of the
7162 /// metastore federation, if available.
7163 pub state_message: std::string::String,
7164
7165 /// Output only. The globally unique resource identifier of the metastore
7166 /// federation.
7167 pub uid: std::string::String,
7168
7169 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7170}
7171
7172impl Federation {
7173 /// Creates a new default instance.
7174 pub fn new() -> Self {
7175 std::default::Default::default()
7176 }
7177
7178 /// Sets the value of [name][crate::model::Federation::name].
7179 ///
7180 /// # Example
7181 /// ```ignore,no_run
7182 /// # use google_cloud_metastore_v1::model::Federation;
7183 /// # let project_id = "project_id";
7184 /// # let location_id = "location_id";
7185 /// # let federation_id = "federation_id";
7186 /// let x = Federation::new().set_name(format!("projects/{project_id}/locations/{location_id}/federations/{federation_id}"));
7187 /// ```
7188 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7189 self.name = v.into();
7190 self
7191 }
7192
7193 /// Sets the value of [create_time][crate::model::Federation::create_time].
7194 ///
7195 /// # Example
7196 /// ```ignore,no_run
7197 /// # use google_cloud_metastore_v1::model::Federation;
7198 /// use wkt::Timestamp;
7199 /// let x = Federation::new().set_create_time(Timestamp::default()/* use setters */);
7200 /// ```
7201 pub fn set_create_time<T>(mut self, v: T) -> Self
7202 where
7203 T: std::convert::Into<wkt::Timestamp>,
7204 {
7205 self.create_time = std::option::Option::Some(v.into());
7206 self
7207 }
7208
7209 /// Sets or clears the value of [create_time][crate::model::Federation::create_time].
7210 ///
7211 /// # Example
7212 /// ```ignore,no_run
7213 /// # use google_cloud_metastore_v1::model::Federation;
7214 /// use wkt::Timestamp;
7215 /// let x = Federation::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7216 /// let x = Federation::new().set_or_clear_create_time(None::<Timestamp>);
7217 /// ```
7218 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7219 where
7220 T: std::convert::Into<wkt::Timestamp>,
7221 {
7222 self.create_time = v.map(|x| x.into());
7223 self
7224 }
7225
7226 /// Sets the value of [update_time][crate::model::Federation::update_time].
7227 ///
7228 /// # Example
7229 /// ```ignore,no_run
7230 /// # use google_cloud_metastore_v1::model::Federation;
7231 /// use wkt::Timestamp;
7232 /// let x = Federation::new().set_update_time(Timestamp::default()/* use setters */);
7233 /// ```
7234 pub fn set_update_time<T>(mut self, v: T) -> Self
7235 where
7236 T: std::convert::Into<wkt::Timestamp>,
7237 {
7238 self.update_time = std::option::Option::Some(v.into());
7239 self
7240 }
7241
7242 /// Sets or clears the value of [update_time][crate::model::Federation::update_time].
7243 ///
7244 /// # Example
7245 /// ```ignore,no_run
7246 /// # use google_cloud_metastore_v1::model::Federation;
7247 /// use wkt::Timestamp;
7248 /// let x = Federation::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7249 /// let x = Federation::new().set_or_clear_update_time(None::<Timestamp>);
7250 /// ```
7251 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7252 where
7253 T: std::convert::Into<wkt::Timestamp>,
7254 {
7255 self.update_time = v.map(|x| x.into());
7256 self
7257 }
7258
7259 /// Sets the value of [labels][crate::model::Federation::labels].
7260 ///
7261 /// # Example
7262 /// ```ignore,no_run
7263 /// # use google_cloud_metastore_v1::model::Federation;
7264 /// let x = Federation::new().set_labels([
7265 /// ("key0", "abc"),
7266 /// ("key1", "xyz"),
7267 /// ]);
7268 /// ```
7269 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7270 where
7271 T: std::iter::IntoIterator<Item = (K, V)>,
7272 K: std::convert::Into<std::string::String>,
7273 V: std::convert::Into<std::string::String>,
7274 {
7275 use std::iter::Iterator;
7276 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7277 self
7278 }
7279
7280 /// Sets the value of [version][crate::model::Federation::version].
7281 ///
7282 /// # Example
7283 /// ```ignore,no_run
7284 /// # use google_cloud_metastore_v1::model::Federation;
7285 /// let x = Federation::new().set_version("example");
7286 /// ```
7287 pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7288 self.version = v.into();
7289 self
7290 }
7291
7292 /// Sets the value of [backend_metastores][crate::model::Federation::backend_metastores].
7293 ///
7294 /// # Example
7295 /// ```ignore,no_run
7296 /// # use google_cloud_metastore_v1::model::Federation;
7297 /// use google_cloud_metastore_v1::model::BackendMetastore;
7298 /// let x = Federation::new().set_backend_metastores([
7299 /// (0, BackendMetastore::default()/* use setters */),
7300 /// (1, BackendMetastore::default()/* use (different) setters */),
7301 /// ]);
7302 /// ```
7303 pub fn set_backend_metastores<T, K, V>(mut self, v: T) -> Self
7304 where
7305 T: std::iter::IntoIterator<Item = (K, V)>,
7306 K: std::convert::Into<i32>,
7307 V: std::convert::Into<crate::model::BackendMetastore>,
7308 {
7309 use std::iter::Iterator;
7310 self.backend_metastores = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7311 self
7312 }
7313
7314 /// Sets the value of [endpoint_uri][crate::model::Federation::endpoint_uri].
7315 ///
7316 /// # Example
7317 /// ```ignore,no_run
7318 /// # use google_cloud_metastore_v1::model::Federation;
7319 /// let x = Federation::new().set_endpoint_uri("example");
7320 /// ```
7321 pub fn set_endpoint_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7322 self.endpoint_uri = v.into();
7323 self
7324 }
7325
7326 /// Sets the value of [state][crate::model::Federation::state].
7327 ///
7328 /// # Example
7329 /// ```ignore,no_run
7330 /// # use google_cloud_metastore_v1::model::Federation;
7331 /// use google_cloud_metastore_v1::model::federation::State;
7332 /// let x0 = Federation::new().set_state(State::Creating);
7333 /// let x1 = Federation::new().set_state(State::Active);
7334 /// let x2 = Federation::new().set_state(State::Updating);
7335 /// ```
7336 pub fn set_state<T: std::convert::Into<crate::model::federation::State>>(
7337 mut self,
7338 v: T,
7339 ) -> Self {
7340 self.state = v.into();
7341 self
7342 }
7343
7344 /// Sets the value of [state_message][crate::model::Federation::state_message].
7345 ///
7346 /// # Example
7347 /// ```ignore,no_run
7348 /// # use google_cloud_metastore_v1::model::Federation;
7349 /// let x = Federation::new().set_state_message("example");
7350 /// ```
7351 pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7352 self.state_message = v.into();
7353 self
7354 }
7355
7356 /// Sets the value of [uid][crate::model::Federation::uid].
7357 ///
7358 /// # Example
7359 /// ```ignore,no_run
7360 /// # use google_cloud_metastore_v1::model::Federation;
7361 /// let x = Federation::new().set_uid("example");
7362 /// ```
7363 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7364 self.uid = v.into();
7365 self
7366 }
7367}
7368
7369impl wkt::message::Message for Federation {
7370 fn typename() -> &'static str {
7371 "type.googleapis.com/google.cloud.metastore.v1.Federation"
7372 }
7373}
7374
7375/// Defines additional types related to [Federation].
7376pub mod federation {
7377 #[allow(unused_imports)]
7378 use super::*;
7379
7380 /// The current state of the federation.
7381 ///
7382 /// # Working with unknown values
7383 ///
7384 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7385 /// additional enum variants at any time. Adding new variants is not considered
7386 /// a breaking change. Applications should write their code in anticipation of:
7387 ///
7388 /// - New values appearing in future releases of the client library, **and**
7389 /// - New values received dynamically, without application changes.
7390 ///
7391 /// Please consult the [Working with enums] section in the user guide for some
7392 /// guidelines.
7393 ///
7394 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7395 #[derive(Clone, Debug, PartialEq)]
7396 #[non_exhaustive]
7397 pub enum State {
7398 /// The state of the metastore federation is unknown.
7399 Unspecified,
7400 /// The metastore federation is in the process of being created.
7401 Creating,
7402 /// The metastore federation is running and ready to serve queries.
7403 Active,
7404 /// The metastore federation is being updated. It remains usable but cannot
7405 /// accept additional update requests or be deleted at this time.
7406 Updating,
7407 /// The metastore federation is undergoing deletion. It cannot be used.
7408 Deleting,
7409 /// The metastore federation has encountered an error and cannot be used. The
7410 /// metastore federation should be deleted.
7411 Error,
7412 /// If set, the enum was initialized with an unknown value.
7413 ///
7414 /// Applications can examine the value using [State::value] or
7415 /// [State::name].
7416 UnknownValue(state::UnknownValue),
7417 }
7418
7419 #[doc(hidden)]
7420 pub mod state {
7421 #[allow(unused_imports)]
7422 use super::*;
7423 #[derive(Clone, Debug, PartialEq)]
7424 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7425 }
7426
7427 impl State {
7428 /// Gets the enum value.
7429 ///
7430 /// Returns `None` if the enum contains an unknown value deserialized from
7431 /// the string representation of enums.
7432 pub fn value(&self) -> std::option::Option<i32> {
7433 match self {
7434 Self::Unspecified => std::option::Option::Some(0),
7435 Self::Creating => std::option::Option::Some(1),
7436 Self::Active => std::option::Option::Some(2),
7437 Self::Updating => std::option::Option::Some(3),
7438 Self::Deleting => std::option::Option::Some(4),
7439 Self::Error => std::option::Option::Some(5),
7440 Self::UnknownValue(u) => u.0.value(),
7441 }
7442 }
7443
7444 /// Gets the enum value as a string.
7445 ///
7446 /// Returns `None` if the enum contains an unknown value deserialized from
7447 /// the integer representation of enums.
7448 pub fn name(&self) -> std::option::Option<&str> {
7449 match self {
7450 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7451 Self::Creating => std::option::Option::Some("CREATING"),
7452 Self::Active => std::option::Option::Some("ACTIVE"),
7453 Self::Updating => std::option::Option::Some("UPDATING"),
7454 Self::Deleting => std::option::Option::Some("DELETING"),
7455 Self::Error => std::option::Option::Some("ERROR"),
7456 Self::UnknownValue(u) => u.0.name(),
7457 }
7458 }
7459 }
7460
7461 impl std::default::Default for State {
7462 fn default() -> Self {
7463 use std::convert::From;
7464 Self::from(0)
7465 }
7466 }
7467
7468 impl std::fmt::Display for State {
7469 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7470 wkt::internal::display_enum(f, self.name(), self.value())
7471 }
7472 }
7473
7474 impl std::convert::From<i32> for State {
7475 fn from(value: i32) -> Self {
7476 match value {
7477 0 => Self::Unspecified,
7478 1 => Self::Creating,
7479 2 => Self::Active,
7480 3 => Self::Updating,
7481 4 => Self::Deleting,
7482 5 => Self::Error,
7483 _ => Self::UnknownValue(state::UnknownValue(
7484 wkt::internal::UnknownEnumValue::Integer(value),
7485 )),
7486 }
7487 }
7488 }
7489
7490 impl std::convert::From<&str> for State {
7491 fn from(value: &str) -> Self {
7492 use std::string::ToString;
7493 match value {
7494 "STATE_UNSPECIFIED" => Self::Unspecified,
7495 "CREATING" => Self::Creating,
7496 "ACTIVE" => Self::Active,
7497 "UPDATING" => Self::Updating,
7498 "DELETING" => Self::Deleting,
7499 "ERROR" => Self::Error,
7500 _ => Self::UnknownValue(state::UnknownValue(
7501 wkt::internal::UnknownEnumValue::String(value.to_string()),
7502 )),
7503 }
7504 }
7505 }
7506
7507 impl serde::ser::Serialize for State {
7508 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7509 where
7510 S: serde::Serializer,
7511 {
7512 match self {
7513 Self::Unspecified => serializer.serialize_i32(0),
7514 Self::Creating => serializer.serialize_i32(1),
7515 Self::Active => serializer.serialize_i32(2),
7516 Self::Updating => serializer.serialize_i32(3),
7517 Self::Deleting => serializer.serialize_i32(4),
7518 Self::Error => serializer.serialize_i32(5),
7519 Self::UnknownValue(u) => u.0.serialize(serializer),
7520 }
7521 }
7522 }
7523
7524 impl<'de> serde::de::Deserialize<'de> for State {
7525 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7526 where
7527 D: serde::Deserializer<'de>,
7528 {
7529 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7530 ".google.cloud.metastore.v1.Federation.State",
7531 ))
7532 }
7533 }
7534}
7535
7536/// Represents a backend metastore for the federation.
7537#[derive(Clone, Default, PartialEq)]
7538#[non_exhaustive]
7539pub struct BackendMetastore {
7540 /// The relative resource name of the metastore that is being federated.
7541 /// The formats of the relative resource names for the currently supported
7542 /// metastores are listed below:
7543 ///
7544 /// * BigQuery
7545 /// * `projects/{project_id}`
7546 /// * Dataproc Metastore
7547 /// * `projects/{project_id}/locations/{location}/services/{service_id}`
7548 pub name: std::string::String,
7549
7550 /// The type of the backend metastore.
7551 pub metastore_type: crate::model::backend_metastore::MetastoreType,
7552
7553 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7554}
7555
7556impl BackendMetastore {
7557 /// Creates a new default instance.
7558 pub fn new() -> Self {
7559 std::default::Default::default()
7560 }
7561
7562 /// Sets the value of [name][crate::model::BackendMetastore::name].
7563 ///
7564 /// # Example
7565 /// ```ignore,no_run
7566 /// # use google_cloud_metastore_v1::model::BackendMetastore;
7567 /// let x = BackendMetastore::new().set_name("example");
7568 /// ```
7569 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7570 self.name = v.into();
7571 self
7572 }
7573
7574 /// Sets the value of [metastore_type][crate::model::BackendMetastore::metastore_type].
7575 ///
7576 /// # Example
7577 /// ```ignore,no_run
7578 /// # use google_cloud_metastore_v1::model::BackendMetastore;
7579 /// use google_cloud_metastore_v1::model::backend_metastore::MetastoreType;
7580 /// let x0 = BackendMetastore::new().set_metastore_type(MetastoreType::Bigquery);
7581 /// let x1 = BackendMetastore::new().set_metastore_type(MetastoreType::DataprocMetastore);
7582 /// ```
7583 pub fn set_metastore_type<
7584 T: std::convert::Into<crate::model::backend_metastore::MetastoreType>,
7585 >(
7586 mut self,
7587 v: T,
7588 ) -> Self {
7589 self.metastore_type = v.into();
7590 self
7591 }
7592}
7593
7594impl wkt::message::Message for BackendMetastore {
7595 fn typename() -> &'static str {
7596 "type.googleapis.com/google.cloud.metastore.v1.BackendMetastore"
7597 }
7598}
7599
7600/// Defines additional types related to [BackendMetastore].
7601pub mod backend_metastore {
7602 #[allow(unused_imports)]
7603 use super::*;
7604
7605 /// The type of the backend metastore.
7606 ///
7607 /// # Working with unknown values
7608 ///
7609 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7610 /// additional enum variants at any time. Adding new variants is not considered
7611 /// a breaking change. Applications should write their code in anticipation of:
7612 ///
7613 /// - New values appearing in future releases of the client library, **and**
7614 /// - New values received dynamically, without application changes.
7615 ///
7616 /// Please consult the [Working with enums] section in the user guide for some
7617 /// guidelines.
7618 ///
7619 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7620 #[derive(Clone, Debug, PartialEq)]
7621 #[non_exhaustive]
7622 pub enum MetastoreType {
7623 /// The metastore type is not set.
7624 Unspecified,
7625 /// The backend metastore is BigQuery.
7626 Bigquery,
7627 /// The backend metastore is Dataproc Metastore.
7628 DataprocMetastore,
7629 /// If set, the enum was initialized with an unknown value.
7630 ///
7631 /// Applications can examine the value using [MetastoreType::value] or
7632 /// [MetastoreType::name].
7633 UnknownValue(metastore_type::UnknownValue),
7634 }
7635
7636 #[doc(hidden)]
7637 pub mod metastore_type {
7638 #[allow(unused_imports)]
7639 use super::*;
7640 #[derive(Clone, Debug, PartialEq)]
7641 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7642 }
7643
7644 impl MetastoreType {
7645 /// Gets the enum value.
7646 ///
7647 /// Returns `None` if the enum contains an unknown value deserialized from
7648 /// the string representation of enums.
7649 pub fn value(&self) -> std::option::Option<i32> {
7650 match self {
7651 Self::Unspecified => std::option::Option::Some(0),
7652 Self::Bigquery => std::option::Option::Some(2),
7653 Self::DataprocMetastore => std::option::Option::Some(3),
7654 Self::UnknownValue(u) => u.0.value(),
7655 }
7656 }
7657
7658 /// Gets the enum value as a string.
7659 ///
7660 /// Returns `None` if the enum contains an unknown value deserialized from
7661 /// the integer representation of enums.
7662 pub fn name(&self) -> std::option::Option<&str> {
7663 match self {
7664 Self::Unspecified => std::option::Option::Some("METASTORE_TYPE_UNSPECIFIED"),
7665 Self::Bigquery => std::option::Option::Some("BIGQUERY"),
7666 Self::DataprocMetastore => std::option::Option::Some("DATAPROC_METASTORE"),
7667 Self::UnknownValue(u) => u.0.name(),
7668 }
7669 }
7670 }
7671
7672 impl std::default::Default for MetastoreType {
7673 fn default() -> Self {
7674 use std::convert::From;
7675 Self::from(0)
7676 }
7677 }
7678
7679 impl std::fmt::Display for MetastoreType {
7680 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7681 wkt::internal::display_enum(f, self.name(), self.value())
7682 }
7683 }
7684
7685 impl std::convert::From<i32> for MetastoreType {
7686 fn from(value: i32) -> Self {
7687 match value {
7688 0 => Self::Unspecified,
7689 2 => Self::Bigquery,
7690 3 => Self::DataprocMetastore,
7691 _ => Self::UnknownValue(metastore_type::UnknownValue(
7692 wkt::internal::UnknownEnumValue::Integer(value),
7693 )),
7694 }
7695 }
7696 }
7697
7698 impl std::convert::From<&str> for MetastoreType {
7699 fn from(value: &str) -> Self {
7700 use std::string::ToString;
7701 match value {
7702 "METASTORE_TYPE_UNSPECIFIED" => Self::Unspecified,
7703 "BIGQUERY" => Self::Bigquery,
7704 "DATAPROC_METASTORE" => Self::DataprocMetastore,
7705 _ => Self::UnknownValue(metastore_type::UnknownValue(
7706 wkt::internal::UnknownEnumValue::String(value.to_string()),
7707 )),
7708 }
7709 }
7710 }
7711
7712 impl serde::ser::Serialize for MetastoreType {
7713 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7714 where
7715 S: serde::Serializer,
7716 {
7717 match self {
7718 Self::Unspecified => serializer.serialize_i32(0),
7719 Self::Bigquery => serializer.serialize_i32(2),
7720 Self::DataprocMetastore => serializer.serialize_i32(3),
7721 Self::UnknownValue(u) => u.0.serialize(serializer),
7722 }
7723 }
7724 }
7725
7726 impl<'de> serde::de::Deserialize<'de> for MetastoreType {
7727 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7728 where
7729 D: serde::Deserializer<'de>,
7730 {
7731 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MetastoreType>::new(
7732 ".google.cloud.metastore.v1.BackendMetastore.MetastoreType",
7733 ))
7734 }
7735 }
7736}
7737
7738/// Request message for ListFederations.
7739#[derive(Clone, Default, PartialEq)]
7740#[non_exhaustive]
7741pub struct ListFederationsRequest {
7742 /// Required. The relative resource name of the location of metastore
7743 /// federations to list, in the following form:
7744 /// `projects/{project_number}/locations/{location_id}`.
7745 pub parent: std::string::String,
7746
7747 /// Optional. The maximum number of federations to return. The response may
7748 /// contain less than the maximum number. If unspecified, no more than 500
7749 /// services are returned. The maximum value is 1000; values above 1000 are
7750 /// changed to 1000.
7751 pub page_size: i32,
7752
7753 /// Optional. A page token, received from a previous ListFederationServices
7754 /// call. Provide this token to retrieve the subsequent page.
7755 ///
7756 /// To retrieve the first page, supply an empty page token.
7757 ///
7758 /// When paginating, other parameters provided to
7759 /// ListFederationServices must match the call that provided the
7760 /// page token.
7761 pub page_token: std::string::String,
7762
7763 /// Optional. The filter to apply to list results.
7764 pub filter: std::string::String,
7765
7766 /// Optional. Specify the ordering of results as described in [Sorting
7767 /// Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
7768 /// If not specified, the results will be sorted in the default order.
7769 pub order_by: std::string::String,
7770
7771 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7772}
7773
7774impl ListFederationsRequest {
7775 /// Creates a new default instance.
7776 pub fn new() -> Self {
7777 std::default::Default::default()
7778 }
7779
7780 /// Sets the value of [parent][crate::model::ListFederationsRequest::parent].
7781 ///
7782 /// # Example
7783 /// ```ignore,no_run
7784 /// # use google_cloud_metastore_v1::model::ListFederationsRequest;
7785 /// # let project_id = "project_id";
7786 /// # let location_id = "location_id";
7787 /// let x = ListFederationsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
7788 /// ```
7789 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7790 self.parent = v.into();
7791 self
7792 }
7793
7794 /// Sets the value of [page_size][crate::model::ListFederationsRequest::page_size].
7795 ///
7796 /// # Example
7797 /// ```ignore,no_run
7798 /// # use google_cloud_metastore_v1::model::ListFederationsRequest;
7799 /// let x = ListFederationsRequest::new().set_page_size(42);
7800 /// ```
7801 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7802 self.page_size = v.into();
7803 self
7804 }
7805
7806 /// Sets the value of [page_token][crate::model::ListFederationsRequest::page_token].
7807 ///
7808 /// # Example
7809 /// ```ignore,no_run
7810 /// # use google_cloud_metastore_v1::model::ListFederationsRequest;
7811 /// let x = ListFederationsRequest::new().set_page_token("example");
7812 /// ```
7813 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7814 self.page_token = v.into();
7815 self
7816 }
7817
7818 /// Sets the value of [filter][crate::model::ListFederationsRequest::filter].
7819 ///
7820 /// # Example
7821 /// ```ignore,no_run
7822 /// # use google_cloud_metastore_v1::model::ListFederationsRequest;
7823 /// let x = ListFederationsRequest::new().set_filter("example");
7824 /// ```
7825 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7826 self.filter = v.into();
7827 self
7828 }
7829
7830 /// Sets the value of [order_by][crate::model::ListFederationsRequest::order_by].
7831 ///
7832 /// # Example
7833 /// ```ignore,no_run
7834 /// # use google_cloud_metastore_v1::model::ListFederationsRequest;
7835 /// let x = ListFederationsRequest::new().set_order_by("example");
7836 /// ```
7837 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7838 self.order_by = v.into();
7839 self
7840 }
7841}
7842
7843impl wkt::message::Message for ListFederationsRequest {
7844 fn typename() -> &'static str {
7845 "type.googleapis.com/google.cloud.metastore.v1.ListFederationsRequest"
7846 }
7847}
7848
7849/// Response message for ListFederations
7850#[derive(Clone, Default, PartialEq)]
7851#[non_exhaustive]
7852pub struct ListFederationsResponse {
7853 /// The services in the specified location.
7854 pub federations: std::vec::Vec<crate::model::Federation>,
7855
7856 /// A token that can be sent as `page_token` to retrieve the next page. If this
7857 /// field is omitted, there are no subsequent pages.
7858 pub next_page_token: std::string::String,
7859
7860 /// Locations that could not be reached.
7861 pub unreachable: std::vec::Vec<std::string::String>,
7862
7863 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7864}
7865
7866impl ListFederationsResponse {
7867 /// Creates a new default instance.
7868 pub fn new() -> Self {
7869 std::default::Default::default()
7870 }
7871
7872 /// Sets the value of [federations][crate::model::ListFederationsResponse::federations].
7873 ///
7874 /// # Example
7875 /// ```ignore,no_run
7876 /// # use google_cloud_metastore_v1::model::ListFederationsResponse;
7877 /// use google_cloud_metastore_v1::model::Federation;
7878 /// let x = ListFederationsResponse::new()
7879 /// .set_federations([
7880 /// Federation::default()/* use setters */,
7881 /// Federation::default()/* use (different) setters */,
7882 /// ]);
7883 /// ```
7884 pub fn set_federations<T, V>(mut self, v: T) -> Self
7885 where
7886 T: std::iter::IntoIterator<Item = V>,
7887 V: std::convert::Into<crate::model::Federation>,
7888 {
7889 use std::iter::Iterator;
7890 self.federations = v.into_iter().map(|i| i.into()).collect();
7891 self
7892 }
7893
7894 /// Sets the value of [next_page_token][crate::model::ListFederationsResponse::next_page_token].
7895 ///
7896 /// # Example
7897 /// ```ignore,no_run
7898 /// # use google_cloud_metastore_v1::model::ListFederationsResponse;
7899 /// let x = ListFederationsResponse::new().set_next_page_token("example");
7900 /// ```
7901 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7902 self.next_page_token = v.into();
7903 self
7904 }
7905
7906 /// Sets the value of [unreachable][crate::model::ListFederationsResponse::unreachable].
7907 ///
7908 /// # Example
7909 /// ```ignore,no_run
7910 /// # use google_cloud_metastore_v1::model::ListFederationsResponse;
7911 /// let x = ListFederationsResponse::new().set_unreachable(["a", "b", "c"]);
7912 /// ```
7913 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7914 where
7915 T: std::iter::IntoIterator<Item = V>,
7916 V: std::convert::Into<std::string::String>,
7917 {
7918 use std::iter::Iterator;
7919 self.unreachable = v.into_iter().map(|i| i.into()).collect();
7920 self
7921 }
7922}
7923
7924impl wkt::message::Message for ListFederationsResponse {
7925 fn typename() -> &'static str {
7926 "type.googleapis.com/google.cloud.metastore.v1.ListFederationsResponse"
7927 }
7928}
7929
7930#[doc(hidden)]
7931impl google_cloud_gax::paginator::internal::PageableResponse for ListFederationsResponse {
7932 type PageItem = crate::model::Federation;
7933
7934 fn items(self) -> std::vec::Vec<Self::PageItem> {
7935 self.federations
7936 }
7937
7938 fn next_page_token(&self) -> std::string::String {
7939 use std::clone::Clone;
7940 self.next_page_token.clone()
7941 }
7942}
7943
7944/// Request message for GetFederation.
7945#[derive(Clone, Default, PartialEq)]
7946#[non_exhaustive]
7947pub struct GetFederationRequest {
7948 /// Required. The relative resource name of the metastore federation to
7949 /// retrieve, in the following form:
7950 ///
7951 /// `projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
7952 pub name: std::string::String,
7953
7954 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7955}
7956
7957impl GetFederationRequest {
7958 /// Creates a new default instance.
7959 pub fn new() -> Self {
7960 std::default::Default::default()
7961 }
7962
7963 /// Sets the value of [name][crate::model::GetFederationRequest::name].
7964 ///
7965 /// # Example
7966 /// ```ignore,no_run
7967 /// # use google_cloud_metastore_v1::model::GetFederationRequest;
7968 /// # let project_id = "project_id";
7969 /// # let location_id = "location_id";
7970 /// # let federation_id = "federation_id";
7971 /// let x = GetFederationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/federations/{federation_id}"));
7972 /// ```
7973 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7974 self.name = v.into();
7975 self
7976 }
7977}
7978
7979impl wkt::message::Message for GetFederationRequest {
7980 fn typename() -> &'static str {
7981 "type.googleapis.com/google.cloud.metastore.v1.GetFederationRequest"
7982 }
7983}
7984
7985/// Request message for CreateFederation.
7986#[derive(Clone, Default, PartialEq)]
7987#[non_exhaustive]
7988pub struct CreateFederationRequest {
7989 /// Required. The relative resource name of the location in which to create a
7990 /// federation service, in the following form:
7991 ///
7992 /// `projects/{project_number}/locations/{location_id}`.
7993 pub parent: std::string::String,
7994
7995 /// Required. The ID of the metastore federation, which is used as the final
7996 /// component of the metastore federation's name.
7997 ///
7998 /// This value must be between 2 and 63 characters long inclusive, begin with a
7999 /// letter, end with a letter or number, and consist of alpha-numeric
8000 /// ASCII characters or hyphens.
8001 pub federation_id: std::string::String,
8002
8003 /// Required. The Metastore Federation to create. The `name` field is
8004 /// ignored. The ID of the created metastore federation must be
8005 /// provided in the request's `federation_id` field.
8006 pub federation: std::option::Option<crate::model::Federation>,
8007
8008 /// Optional. A request ID. Specify a unique request ID to allow the server to
8009 /// ignore the request if it has completed. The server will ignore subsequent
8010 /// requests that provide a duplicate request ID for at least 60 minutes after
8011 /// the first request.
8012 ///
8013 /// For example, if an initial request times out, followed by another request
8014 /// with the same request ID, the server ignores the second request to prevent
8015 /// the creation of duplicate commitments.
8016 ///
8017 /// The request ID must be a valid
8018 /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
8019 /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
8020 pub request_id: std::string::String,
8021
8022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8023}
8024
8025impl CreateFederationRequest {
8026 /// Creates a new default instance.
8027 pub fn new() -> Self {
8028 std::default::Default::default()
8029 }
8030
8031 /// Sets the value of [parent][crate::model::CreateFederationRequest::parent].
8032 ///
8033 /// # Example
8034 /// ```ignore,no_run
8035 /// # use google_cloud_metastore_v1::model::CreateFederationRequest;
8036 /// # let project_id = "project_id";
8037 /// # let location_id = "location_id";
8038 /// let x = CreateFederationRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
8039 /// ```
8040 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8041 self.parent = v.into();
8042 self
8043 }
8044
8045 /// Sets the value of [federation_id][crate::model::CreateFederationRequest::federation_id].
8046 ///
8047 /// # Example
8048 /// ```ignore,no_run
8049 /// # use google_cloud_metastore_v1::model::CreateFederationRequest;
8050 /// let x = CreateFederationRequest::new().set_federation_id("example");
8051 /// ```
8052 pub fn set_federation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8053 self.federation_id = v.into();
8054 self
8055 }
8056
8057 /// Sets the value of [federation][crate::model::CreateFederationRequest::federation].
8058 ///
8059 /// # Example
8060 /// ```ignore,no_run
8061 /// # use google_cloud_metastore_v1::model::CreateFederationRequest;
8062 /// use google_cloud_metastore_v1::model::Federation;
8063 /// let x = CreateFederationRequest::new().set_federation(Federation::default()/* use setters */);
8064 /// ```
8065 pub fn set_federation<T>(mut self, v: T) -> Self
8066 where
8067 T: std::convert::Into<crate::model::Federation>,
8068 {
8069 self.federation = std::option::Option::Some(v.into());
8070 self
8071 }
8072
8073 /// Sets or clears the value of [federation][crate::model::CreateFederationRequest::federation].
8074 ///
8075 /// # Example
8076 /// ```ignore,no_run
8077 /// # use google_cloud_metastore_v1::model::CreateFederationRequest;
8078 /// use google_cloud_metastore_v1::model::Federation;
8079 /// let x = CreateFederationRequest::new().set_or_clear_federation(Some(Federation::default()/* use setters */));
8080 /// let x = CreateFederationRequest::new().set_or_clear_federation(None::<Federation>);
8081 /// ```
8082 pub fn set_or_clear_federation<T>(mut self, v: std::option::Option<T>) -> Self
8083 where
8084 T: std::convert::Into<crate::model::Federation>,
8085 {
8086 self.federation = v.map(|x| x.into());
8087 self
8088 }
8089
8090 /// Sets the value of [request_id][crate::model::CreateFederationRequest::request_id].
8091 ///
8092 /// # Example
8093 /// ```ignore,no_run
8094 /// # use google_cloud_metastore_v1::model::CreateFederationRequest;
8095 /// let x = CreateFederationRequest::new().set_request_id("example");
8096 /// ```
8097 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8098 self.request_id = v.into();
8099 self
8100 }
8101}
8102
8103impl wkt::message::Message for CreateFederationRequest {
8104 fn typename() -> &'static str {
8105 "type.googleapis.com/google.cloud.metastore.v1.CreateFederationRequest"
8106 }
8107}
8108
8109/// Request message for UpdateFederation.
8110#[derive(Clone, Default, PartialEq)]
8111#[non_exhaustive]
8112pub struct UpdateFederationRequest {
8113 /// Required. A field mask used to specify the fields to be overwritten in the
8114 /// metastore federation resource by the update.
8115 /// Fields specified in the `update_mask` are relative to the resource (not
8116 /// to the full request). A field is overwritten if it is in the mask.
8117 pub update_mask: std::option::Option<wkt::FieldMask>,
8118
8119 /// Required. The metastore federation to update. The server only merges fields
8120 /// in the service if they are specified in `update_mask`.
8121 ///
8122 /// The metastore federation's `name` field is used to identify the
8123 /// metastore service to be updated.
8124 pub federation: std::option::Option<crate::model::Federation>,
8125
8126 /// Optional. A request ID. Specify a unique request ID to allow the server to
8127 /// ignore the request if it has completed. The server will ignore subsequent
8128 /// requests that provide a duplicate request ID for at least 60 minutes after
8129 /// the first request.
8130 ///
8131 /// For example, if an initial request times out, followed by another request
8132 /// with the same request ID, the server ignores the second request to prevent
8133 /// the creation of duplicate commitments.
8134 ///
8135 /// The request ID must be a valid
8136 /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
8137 /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
8138 pub request_id: std::string::String,
8139
8140 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8141}
8142
8143impl UpdateFederationRequest {
8144 /// Creates a new default instance.
8145 pub fn new() -> Self {
8146 std::default::Default::default()
8147 }
8148
8149 /// Sets the value of [update_mask][crate::model::UpdateFederationRequest::update_mask].
8150 ///
8151 /// # Example
8152 /// ```ignore,no_run
8153 /// # use google_cloud_metastore_v1::model::UpdateFederationRequest;
8154 /// use wkt::FieldMask;
8155 /// let x = UpdateFederationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
8156 /// ```
8157 pub fn set_update_mask<T>(mut self, v: T) -> Self
8158 where
8159 T: std::convert::Into<wkt::FieldMask>,
8160 {
8161 self.update_mask = std::option::Option::Some(v.into());
8162 self
8163 }
8164
8165 /// Sets or clears the value of [update_mask][crate::model::UpdateFederationRequest::update_mask].
8166 ///
8167 /// # Example
8168 /// ```ignore,no_run
8169 /// # use google_cloud_metastore_v1::model::UpdateFederationRequest;
8170 /// use wkt::FieldMask;
8171 /// let x = UpdateFederationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
8172 /// let x = UpdateFederationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
8173 /// ```
8174 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8175 where
8176 T: std::convert::Into<wkt::FieldMask>,
8177 {
8178 self.update_mask = v.map(|x| x.into());
8179 self
8180 }
8181
8182 /// Sets the value of [federation][crate::model::UpdateFederationRequest::federation].
8183 ///
8184 /// # Example
8185 /// ```ignore,no_run
8186 /// # use google_cloud_metastore_v1::model::UpdateFederationRequest;
8187 /// use google_cloud_metastore_v1::model::Federation;
8188 /// let x = UpdateFederationRequest::new().set_federation(Federation::default()/* use setters */);
8189 /// ```
8190 pub fn set_federation<T>(mut self, v: T) -> Self
8191 where
8192 T: std::convert::Into<crate::model::Federation>,
8193 {
8194 self.federation = std::option::Option::Some(v.into());
8195 self
8196 }
8197
8198 /// Sets or clears the value of [federation][crate::model::UpdateFederationRequest::federation].
8199 ///
8200 /// # Example
8201 /// ```ignore,no_run
8202 /// # use google_cloud_metastore_v1::model::UpdateFederationRequest;
8203 /// use google_cloud_metastore_v1::model::Federation;
8204 /// let x = UpdateFederationRequest::new().set_or_clear_federation(Some(Federation::default()/* use setters */));
8205 /// let x = UpdateFederationRequest::new().set_or_clear_federation(None::<Federation>);
8206 /// ```
8207 pub fn set_or_clear_federation<T>(mut self, v: std::option::Option<T>) -> Self
8208 where
8209 T: std::convert::Into<crate::model::Federation>,
8210 {
8211 self.federation = v.map(|x| x.into());
8212 self
8213 }
8214
8215 /// Sets the value of [request_id][crate::model::UpdateFederationRequest::request_id].
8216 ///
8217 /// # Example
8218 /// ```ignore,no_run
8219 /// # use google_cloud_metastore_v1::model::UpdateFederationRequest;
8220 /// let x = UpdateFederationRequest::new().set_request_id("example");
8221 /// ```
8222 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8223 self.request_id = v.into();
8224 self
8225 }
8226}
8227
8228impl wkt::message::Message for UpdateFederationRequest {
8229 fn typename() -> &'static str {
8230 "type.googleapis.com/google.cloud.metastore.v1.UpdateFederationRequest"
8231 }
8232}
8233
8234/// Request message for DeleteFederation.
8235#[derive(Clone, Default, PartialEq)]
8236#[non_exhaustive]
8237pub struct DeleteFederationRequest {
8238 /// Required. The relative resource name of the metastore federation to delete,
8239 /// in the following form:
8240 ///
8241 /// `projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
8242 pub name: std::string::String,
8243
8244 /// Optional. A request ID. Specify a unique request ID to allow the server to
8245 /// ignore the request if it has completed. The server will ignore subsequent
8246 /// requests that provide a duplicate request ID for at least 60 minutes after
8247 /// the first request.
8248 ///
8249 /// For example, if an initial request times out, followed by another request
8250 /// with the same request ID, the server ignores the second request to prevent
8251 /// the creation of duplicate commitments.
8252 ///
8253 /// The request ID must be a valid
8254 /// [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
8255 /// A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
8256 pub request_id: std::string::String,
8257
8258 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8259}
8260
8261impl DeleteFederationRequest {
8262 /// Creates a new default instance.
8263 pub fn new() -> Self {
8264 std::default::Default::default()
8265 }
8266
8267 /// Sets the value of [name][crate::model::DeleteFederationRequest::name].
8268 ///
8269 /// # Example
8270 /// ```ignore,no_run
8271 /// # use google_cloud_metastore_v1::model::DeleteFederationRequest;
8272 /// # let project_id = "project_id";
8273 /// # let location_id = "location_id";
8274 /// # let federation_id = "federation_id";
8275 /// let x = DeleteFederationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/federations/{federation_id}"));
8276 /// ```
8277 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8278 self.name = v.into();
8279 self
8280 }
8281
8282 /// Sets the value of [request_id][crate::model::DeleteFederationRequest::request_id].
8283 ///
8284 /// # Example
8285 /// ```ignore,no_run
8286 /// # use google_cloud_metastore_v1::model::DeleteFederationRequest;
8287 /// let x = DeleteFederationRequest::new().set_request_id("example");
8288 /// ```
8289 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8290 self.request_id = v.into();
8291 self
8292 }
8293}
8294
8295impl wkt::message::Message for DeleteFederationRequest {
8296 fn typename() -> &'static str {
8297 "type.googleapis.com/google.cloud.metastore.v1.DeleteFederationRequest"
8298 }
8299}