google_cloud_datacatalog_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_longrunning;
26extern crate google_cloud_lro;
27extern crate google_cloud_rpc;
28extern crate lazy_static;
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/// Specification for the BigQuery connection.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct BigQueryConnectionSpec {
44 /// The type of the BigQuery connection.
45 pub connection_type: crate::model::big_query_connection_spec::ConnectionType,
46
47 /// True if there are credentials attached to the BigQuery connection; false
48 /// otherwise.
49 pub has_credential: bool,
50
51 pub connection_spec:
52 std::option::Option<crate::model::big_query_connection_spec::ConnectionSpec>,
53
54 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
55}
56
57impl BigQueryConnectionSpec {
58 pub fn new() -> Self {
59 std::default::Default::default()
60 }
61
62 /// Sets the value of [connection_type][crate::model::BigQueryConnectionSpec::connection_type].
63 ///
64 /// # Example
65 /// ```ignore,no_run
66 /// # use google_cloud_datacatalog_v1::model::BigQueryConnectionSpec;
67 /// use google_cloud_datacatalog_v1::model::big_query_connection_spec::ConnectionType;
68 /// let x0 = BigQueryConnectionSpec::new().set_connection_type(ConnectionType::CloudSql);
69 /// ```
70 pub fn set_connection_type<
71 T: std::convert::Into<crate::model::big_query_connection_spec::ConnectionType>,
72 >(
73 mut self,
74 v: T,
75 ) -> Self {
76 self.connection_type = v.into();
77 self
78 }
79
80 /// Sets the value of [has_credential][crate::model::BigQueryConnectionSpec::has_credential].
81 ///
82 /// # Example
83 /// ```ignore,no_run
84 /// # use google_cloud_datacatalog_v1::model::BigQueryConnectionSpec;
85 /// let x = BigQueryConnectionSpec::new().set_has_credential(true);
86 /// ```
87 pub fn set_has_credential<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
88 self.has_credential = v.into();
89 self
90 }
91
92 /// Sets the value of [connection_spec][crate::model::BigQueryConnectionSpec::connection_spec].
93 ///
94 /// Note that all the setters affecting `connection_spec` are mutually
95 /// exclusive.
96 ///
97 /// # Example
98 /// ```ignore,no_run
99 /// # use google_cloud_datacatalog_v1::model::BigQueryConnectionSpec;
100 /// use google_cloud_datacatalog_v1::model::CloudSqlBigQueryConnectionSpec;
101 /// let x = BigQueryConnectionSpec::new().set_connection_spec(Some(
102 /// google_cloud_datacatalog_v1::model::big_query_connection_spec::ConnectionSpec::CloudSql(CloudSqlBigQueryConnectionSpec::default().into())));
103 /// ```
104 pub fn set_connection_spec<
105 T: std::convert::Into<
106 std::option::Option<crate::model::big_query_connection_spec::ConnectionSpec>,
107 >,
108 >(
109 mut self,
110 v: T,
111 ) -> Self {
112 self.connection_spec = v.into();
113 self
114 }
115
116 /// The value of [connection_spec][crate::model::BigQueryConnectionSpec::connection_spec]
117 /// if it holds a `CloudSql`, `None` if the field is not set or
118 /// holds a different branch.
119 pub fn cloud_sql(
120 &self,
121 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudSqlBigQueryConnectionSpec>> {
122 #[allow(unreachable_patterns)]
123 self.connection_spec.as_ref().and_then(|v| match v {
124 crate::model::big_query_connection_spec::ConnectionSpec::CloudSql(v) => {
125 std::option::Option::Some(v)
126 }
127 _ => std::option::Option::None,
128 })
129 }
130
131 /// Sets the value of [connection_spec][crate::model::BigQueryConnectionSpec::connection_spec]
132 /// to hold a `CloudSql`.
133 ///
134 /// Note that all the setters affecting `connection_spec` are
135 /// mutually exclusive.
136 ///
137 /// # Example
138 /// ```ignore,no_run
139 /// # use google_cloud_datacatalog_v1::model::BigQueryConnectionSpec;
140 /// use google_cloud_datacatalog_v1::model::CloudSqlBigQueryConnectionSpec;
141 /// let x = BigQueryConnectionSpec::new().set_cloud_sql(CloudSqlBigQueryConnectionSpec::default()/* use setters */);
142 /// assert!(x.cloud_sql().is_some());
143 /// ```
144 pub fn set_cloud_sql<
145 T: std::convert::Into<std::boxed::Box<crate::model::CloudSqlBigQueryConnectionSpec>>,
146 >(
147 mut self,
148 v: T,
149 ) -> Self {
150 self.connection_spec = std::option::Option::Some(
151 crate::model::big_query_connection_spec::ConnectionSpec::CloudSql(v.into()),
152 );
153 self
154 }
155}
156
157impl wkt::message::Message for BigQueryConnectionSpec {
158 fn typename() -> &'static str {
159 "type.googleapis.com/google.cloud.datacatalog.v1.BigQueryConnectionSpec"
160 }
161}
162
163/// Defines additional types related to [BigQueryConnectionSpec].
164pub mod big_query_connection_spec {
165 #[allow(unused_imports)]
166 use super::*;
167
168 /// The type of the BigQuery connection.
169 ///
170 /// # Working with unknown values
171 ///
172 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
173 /// additional enum variants at any time. Adding new variants is not considered
174 /// a breaking change. Applications should write their code in anticipation of:
175 ///
176 /// - New values appearing in future releases of the client library, **and**
177 /// - New values received dynamically, without application changes.
178 ///
179 /// Please consult the [Working with enums] section in the user guide for some
180 /// guidelines.
181 ///
182 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
183 #[derive(Clone, Debug, PartialEq)]
184 #[non_exhaustive]
185 pub enum ConnectionType {
186 /// Unspecified type.
187 Unspecified,
188 /// Cloud SQL connection.
189 CloudSql,
190 /// If set, the enum was initialized with an unknown value.
191 ///
192 /// Applications can examine the value using [ConnectionType::value] or
193 /// [ConnectionType::name].
194 UnknownValue(connection_type::UnknownValue),
195 }
196
197 #[doc(hidden)]
198 pub mod connection_type {
199 #[allow(unused_imports)]
200 use super::*;
201 #[derive(Clone, Debug, PartialEq)]
202 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
203 }
204
205 impl ConnectionType {
206 /// Gets the enum value.
207 ///
208 /// Returns `None` if the enum contains an unknown value deserialized from
209 /// the string representation of enums.
210 pub fn value(&self) -> std::option::Option<i32> {
211 match self {
212 Self::Unspecified => std::option::Option::Some(0),
213 Self::CloudSql => std::option::Option::Some(1),
214 Self::UnknownValue(u) => u.0.value(),
215 }
216 }
217
218 /// Gets the enum value as a string.
219 ///
220 /// Returns `None` if the enum contains an unknown value deserialized from
221 /// the integer representation of enums.
222 pub fn name(&self) -> std::option::Option<&str> {
223 match self {
224 Self::Unspecified => std::option::Option::Some("CONNECTION_TYPE_UNSPECIFIED"),
225 Self::CloudSql => std::option::Option::Some("CLOUD_SQL"),
226 Self::UnknownValue(u) => u.0.name(),
227 }
228 }
229 }
230
231 impl std::default::Default for ConnectionType {
232 fn default() -> Self {
233 use std::convert::From;
234 Self::from(0)
235 }
236 }
237
238 impl std::fmt::Display for ConnectionType {
239 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
240 wkt::internal::display_enum(f, self.name(), self.value())
241 }
242 }
243
244 impl std::convert::From<i32> for ConnectionType {
245 fn from(value: i32) -> Self {
246 match value {
247 0 => Self::Unspecified,
248 1 => Self::CloudSql,
249 _ => Self::UnknownValue(connection_type::UnknownValue(
250 wkt::internal::UnknownEnumValue::Integer(value),
251 )),
252 }
253 }
254 }
255
256 impl std::convert::From<&str> for ConnectionType {
257 fn from(value: &str) -> Self {
258 use std::string::ToString;
259 match value {
260 "CONNECTION_TYPE_UNSPECIFIED" => Self::Unspecified,
261 "CLOUD_SQL" => Self::CloudSql,
262 _ => Self::UnknownValue(connection_type::UnknownValue(
263 wkt::internal::UnknownEnumValue::String(value.to_string()),
264 )),
265 }
266 }
267 }
268
269 impl serde::ser::Serialize for ConnectionType {
270 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
271 where
272 S: serde::Serializer,
273 {
274 match self {
275 Self::Unspecified => serializer.serialize_i32(0),
276 Self::CloudSql => serializer.serialize_i32(1),
277 Self::UnknownValue(u) => u.0.serialize(serializer),
278 }
279 }
280 }
281
282 impl<'de> serde::de::Deserialize<'de> for ConnectionType {
283 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
284 where
285 D: serde::Deserializer<'de>,
286 {
287 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionType>::new(
288 ".google.cloud.datacatalog.v1.BigQueryConnectionSpec.ConnectionType",
289 ))
290 }
291 }
292
293 #[derive(Clone, Debug, PartialEq)]
294 #[non_exhaustive]
295 pub enum ConnectionSpec {
296 /// Specification for the BigQuery connection to a Cloud SQL instance.
297 CloudSql(std::boxed::Box<crate::model::CloudSqlBigQueryConnectionSpec>),
298 }
299}
300
301/// Specification for the BigQuery connection to a Cloud SQL instance.
302#[derive(Clone, Default, PartialEq)]
303#[non_exhaustive]
304pub struct CloudSqlBigQueryConnectionSpec {
305 /// Cloud SQL instance ID in the format of `project:location:instance`.
306 pub instance_id: std::string::String,
307
308 /// Database name.
309 pub database: std::string::String,
310
311 /// Type of the Cloud SQL database.
312 pub r#type: crate::model::cloud_sql_big_query_connection_spec::DatabaseType,
313
314 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
315}
316
317impl CloudSqlBigQueryConnectionSpec {
318 pub fn new() -> Self {
319 std::default::Default::default()
320 }
321
322 /// Sets the value of [instance_id][crate::model::CloudSqlBigQueryConnectionSpec::instance_id].
323 ///
324 /// # Example
325 /// ```ignore,no_run
326 /// # use google_cloud_datacatalog_v1::model::CloudSqlBigQueryConnectionSpec;
327 /// let x = CloudSqlBigQueryConnectionSpec::new().set_instance_id("example");
328 /// ```
329 pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
330 self.instance_id = v.into();
331 self
332 }
333
334 /// Sets the value of [database][crate::model::CloudSqlBigQueryConnectionSpec::database].
335 ///
336 /// # Example
337 /// ```ignore,no_run
338 /// # use google_cloud_datacatalog_v1::model::CloudSqlBigQueryConnectionSpec;
339 /// let x = CloudSqlBigQueryConnectionSpec::new().set_database("example");
340 /// ```
341 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
342 self.database = v.into();
343 self
344 }
345
346 /// Sets the value of [r#type][crate::model::CloudSqlBigQueryConnectionSpec::type].
347 ///
348 /// # Example
349 /// ```ignore,no_run
350 /// # use google_cloud_datacatalog_v1::model::CloudSqlBigQueryConnectionSpec;
351 /// use google_cloud_datacatalog_v1::model::cloud_sql_big_query_connection_spec::DatabaseType;
352 /// let x0 = CloudSqlBigQueryConnectionSpec::new().set_type(DatabaseType::Postgres);
353 /// let x1 = CloudSqlBigQueryConnectionSpec::new().set_type(DatabaseType::Mysql);
354 /// ```
355 pub fn set_type<
356 T: std::convert::Into<crate::model::cloud_sql_big_query_connection_spec::DatabaseType>,
357 >(
358 mut self,
359 v: T,
360 ) -> Self {
361 self.r#type = v.into();
362 self
363 }
364}
365
366impl wkt::message::Message for CloudSqlBigQueryConnectionSpec {
367 fn typename() -> &'static str {
368 "type.googleapis.com/google.cloud.datacatalog.v1.CloudSqlBigQueryConnectionSpec"
369 }
370}
371
372/// Defines additional types related to [CloudSqlBigQueryConnectionSpec].
373pub mod cloud_sql_big_query_connection_spec {
374 #[allow(unused_imports)]
375 use super::*;
376
377 /// Supported Cloud SQL database types.
378 ///
379 /// # Working with unknown values
380 ///
381 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
382 /// additional enum variants at any time. Adding new variants is not considered
383 /// a breaking change. Applications should write their code in anticipation of:
384 ///
385 /// - New values appearing in future releases of the client library, **and**
386 /// - New values received dynamically, without application changes.
387 ///
388 /// Please consult the [Working with enums] section in the user guide for some
389 /// guidelines.
390 ///
391 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
392 #[derive(Clone, Debug, PartialEq)]
393 #[non_exhaustive]
394 pub enum DatabaseType {
395 /// Unspecified database type.
396 Unspecified,
397 /// Cloud SQL for PostgreSQL.
398 Postgres,
399 /// Cloud SQL for MySQL.
400 Mysql,
401 /// If set, the enum was initialized with an unknown value.
402 ///
403 /// Applications can examine the value using [DatabaseType::value] or
404 /// [DatabaseType::name].
405 UnknownValue(database_type::UnknownValue),
406 }
407
408 #[doc(hidden)]
409 pub mod database_type {
410 #[allow(unused_imports)]
411 use super::*;
412 #[derive(Clone, Debug, PartialEq)]
413 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
414 }
415
416 impl DatabaseType {
417 /// Gets the enum value.
418 ///
419 /// Returns `None` if the enum contains an unknown value deserialized from
420 /// the string representation of enums.
421 pub fn value(&self) -> std::option::Option<i32> {
422 match self {
423 Self::Unspecified => std::option::Option::Some(0),
424 Self::Postgres => std::option::Option::Some(1),
425 Self::Mysql => std::option::Option::Some(2),
426 Self::UnknownValue(u) => u.0.value(),
427 }
428 }
429
430 /// Gets the enum value as a string.
431 ///
432 /// Returns `None` if the enum contains an unknown value deserialized from
433 /// the integer representation of enums.
434 pub fn name(&self) -> std::option::Option<&str> {
435 match self {
436 Self::Unspecified => std::option::Option::Some("DATABASE_TYPE_UNSPECIFIED"),
437 Self::Postgres => std::option::Option::Some("POSTGRES"),
438 Self::Mysql => std::option::Option::Some("MYSQL"),
439 Self::UnknownValue(u) => u.0.name(),
440 }
441 }
442 }
443
444 impl std::default::Default for DatabaseType {
445 fn default() -> Self {
446 use std::convert::From;
447 Self::from(0)
448 }
449 }
450
451 impl std::fmt::Display for DatabaseType {
452 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
453 wkt::internal::display_enum(f, self.name(), self.value())
454 }
455 }
456
457 impl std::convert::From<i32> for DatabaseType {
458 fn from(value: i32) -> Self {
459 match value {
460 0 => Self::Unspecified,
461 1 => Self::Postgres,
462 2 => Self::Mysql,
463 _ => Self::UnknownValue(database_type::UnknownValue(
464 wkt::internal::UnknownEnumValue::Integer(value),
465 )),
466 }
467 }
468 }
469
470 impl std::convert::From<&str> for DatabaseType {
471 fn from(value: &str) -> Self {
472 use std::string::ToString;
473 match value {
474 "DATABASE_TYPE_UNSPECIFIED" => Self::Unspecified,
475 "POSTGRES" => Self::Postgres,
476 "MYSQL" => Self::Mysql,
477 _ => Self::UnknownValue(database_type::UnknownValue(
478 wkt::internal::UnknownEnumValue::String(value.to_string()),
479 )),
480 }
481 }
482 }
483
484 impl serde::ser::Serialize for DatabaseType {
485 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
486 where
487 S: serde::Serializer,
488 {
489 match self {
490 Self::Unspecified => serializer.serialize_i32(0),
491 Self::Postgres => serializer.serialize_i32(1),
492 Self::Mysql => serializer.serialize_i32(2),
493 Self::UnknownValue(u) => u.0.serialize(serializer),
494 }
495 }
496 }
497
498 impl<'de> serde::de::Deserialize<'de> for DatabaseType {
499 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
500 where
501 D: serde::Deserializer<'de>,
502 {
503 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseType>::new(
504 ".google.cloud.datacatalog.v1.CloudSqlBigQueryConnectionSpec.DatabaseType",
505 ))
506 }
507 }
508}
509
510/// Fields specific for BigQuery routines.
511#[derive(Clone, Default, PartialEq)]
512#[non_exhaustive]
513pub struct BigQueryRoutineSpec {
514 /// Paths of the imported libraries.
515 pub imported_libraries: std::vec::Vec<std::string::String>,
516
517 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
518}
519
520impl BigQueryRoutineSpec {
521 pub fn new() -> Self {
522 std::default::Default::default()
523 }
524
525 /// Sets the value of [imported_libraries][crate::model::BigQueryRoutineSpec::imported_libraries].
526 ///
527 /// # Example
528 /// ```ignore,no_run
529 /// # use google_cloud_datacatalog_v1::model::BigQueryRoutineSpec;
530 /// let x = BigQueryRoutineSpec::new().set_imported_libraries(["a", "b", "c"]);
531 /// ```
532 pub fn set_imported_libraries<T, V>(mut self, v: T) -> Self
533 where
534 T: std::iter::IntoIterator<Item = V>,
535 V: std::convert::Into<std::string::String>,
536 {
537 use std::iter::Iterator;
538 self.imported_libraries = v.into_iter().map(|i| i.into()).collect();
539 self
540 }
541}
542
543impl wkt::message::Message for BigQueryRoutineSpec {
544 fn typename() -> &'static str {
545 "type.googleapis.com/google.cloud.datacatalog.v1.BigQueryRoutineSpec"
546 }
547}
548
549/// Entry metadata relevant only to the user and private to them.
550#[derive(Clone, Default, PartialEq)]
551#[non_exhaustive]
552pub struct PersonalDetails {
553 /// True if the entry is starred by the user; false otherwise.
554 pub starred: bool,
555
556 /// Set if the entry is starred; unset otherwise.
557 pub star_time: std::option::Option<wkt::Timestamp>,
558
559 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
560}
561
562impl PersonalDetails {
563 pub fn new() -> Self {
564 std::default::Default::default()
565 }
566
567 /// Sets the value of [starred][crate::model::PersonalDetails::starred].
568 ///
569 /// # Example
570 /// ```ignore,no_run
571 /// # use google_cloud_datacatalog_v1::model::PersonalDetails;
572 /// let x = PersonalDetails::new().set_starred(true);
573 /// ```
574 pub fn set_starred<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
575 self.starred = v.into();
576 self
577 }
578
579 /// Sets the value of [star_time][crate::model::PersonalDetails::star_time].
580 ///
581 /// # Example
582 /// ```ignore,no_run
583 /// # use google_cloud_datacatalog_v1::model::PersonalDetails;
584 /// use wkt::Timestamp;
585 /// let x = PersonalDetails::new().set_star_time(Timestamp::default()/* use setters */);
586 /// ```
587 pub fn set_star_time<T>(mut self, v: T) -> Self
588 where
589 T: std::convert::Into<wkt::Timestamp>,
590 {
591 self.star_time = std::option::Option::Some(v.into());
592 self
593 }
594
595 /// Sets or clears the value of [star_time][crate::model::PersonalDetails::star_time].
596 ///
597 /// # Example
598 /// ```ignore,no_run
599 /// # use google_cloud_datacatalog_v1::model::PersonalDetails;
600 /// use wkt::Timestamp;
601 /// let x = PersonalDetails::new().set_or_clear_star_time(Some(Timestamp::default()/* use setters */));
602 /// let x = PersonalDetails::new().set_or_clear_star_time(None::<Timestamp>);
603 /// ```
604 pub fn set_or_clear_star_time<T>(mut self, v: std::option::Option<T>) -> Self
605 where
606 T: std::convert::Into<wkt::Timestamp>,
607 {
608 self.star_time = v.map(|x| x.into());
609 self
610 }
611}
612
613impl wkt::message::Message for PersonalDetails {
614 fn typename() -> &'static str {
615 "type.googleapis.com/google.cloud.datacatalog.v1.PersonalDetails"
616 }
617}
618
619/// Physical location of an entry.
620#[derive(Clone, Default, PartialEq)]
621#[non_exhaustive]
622pub struct DataSource {
623 /// Service that physically stores the data.
624 pub service: crate::model::data_source::Service,
625
626 /// Full name of a resource as defined by the service. For example:
627 ///
628 /// `//bigquery.googleapis.com/projects/{PROJECT_ID}/locations/{LOCATION}/datasets/{DATASET_ID}/tables/{TABLE_ID}`
629 pub resource: std::string::String,
630
631 /// Output only. Data Catalog entry name, if applicable.
632 pub source_entry: std::string::String,
633
634 pub properties: std::option::Option<crate::model::data_source::Properties>,
635
636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
637}
638
639impl DataSource {
640 pub fn new() -> Self {
641 std::default::Default::default()
642 }
643
644 /// Sets the value of [service][crate::model::DataSource::service].
645 ///
646 /// # Example
647 /// ```ignore,no_run
648 /// # use google_cloud_datacatalog_v1::model::DataSource;
649 /// use google_cloud_datacatalog_v1::model::data_source::Service;
650 /// let x0 = DataSource::new().set_service(Service::CloudStorage);
651 /// let x1 = DataSource::new().set_service(Service::Bigquery);
652 /// ```
653 pub fn set_service<T: std::convert::Into<crate::model::data_source::Service>>(
654 mut self,
655 v: T,
656 ) -> Self {
657 self.service = v.into();
658 self
659 }
660
661 /// Sets the value of [resource][crate::model::DataSource::resource].
662 ///
663 /// # Example
664 /// ```ignore,no_run
665 /// # use google_cloud_datacatalog_v1::model::DataSource;
666 /// let x = DataSource::new().set_resource("example");
667 /// ```
668 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
669 self.resource = v.into();
670 self
671 }
672
673 /// Sets the value of [source_entry][crate::model::DataSource::source_entry].
674 ///
675 /// # Example
676 /// ```ignore,no_run
677 /// # use google_cloud_datacatalog_v1::model::DataSource;
678 /// let x = DataSource::new().set_source_entry("example");
679 /// ```
680 pub fn set_source_entry<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
681 self.source_entry = v.into();
682 self
683 }
684
685 /// Sets the value of [properties][crate::model::DataSource::properties].
686 ///
687 /// Note that all the setters affecting `properties` are mutually
688 /// exclusive.
689 ///
690 /// # Example
691 /// ```ignore,no_run
692 /// # use google_cloud_datacatalog_v1::model::DataSource;
693 /// use google_cloud_datacatalog_v1::model::StorageProperties;
694 /// let x = DataSource::new().set_properties(Some(
695 /// google_cloud_datacatalog_v1::model::data_source::Properties::StorageProperties(StorageProperties::default().into())));
696 /// ```
697 pub fn set_properties<
698 T: std::convert::Into<std::option::Option<crate::model::data_source::Properties>>,
699 >(
700 mut self,
701 v: T,
702 ) -> Self {
703 self.properties = v.into();
704 self
705 }
706
707 /// The value of [properties][crate::model::DataSource::properties]
708 /// if it holds a `StorageProperties`, `None` if the field is not set or
709 /// holds a different branch.
710 pub fn storage_properties(
711 &self,
712 ) -> std::option::Option<&std::boxed::Box<crate::model::StorageProperties>> {
713 #[allow(unreachable_patterns)]
714 self.properties.as_ref().and_then(|v| match v {
715 crate::model::data_source::Properties::StorageProperties(v) => {
716 std::option::Option::Some(v)
717 }
718 _ => std::option::Option::None,
719 })
720 }
721
722 /// Sets the value of [properties][crate::model::DataSource::properties]
723 /// to hold a `StorageProperties`.
724 ///
725 /// Note that all the setters affecting `properties` are
726 /// mutually exclusive.
727 ///
728 /// # Example
729 /// ```ignore,no_run
730 /// # use google_cloud_datacatalog_v1::model::DataSource;
731 /// use google_cloud_datacatalog_v1::model::StorageProperties;
732 /// let x = DataSource::new().set_storage_properties(StorageProperties::default()/* use setters */);
733 /// assert!(x.storage_properties().is_some());
734 /// ```
735 pub fn set_storage_properties<
736 T: std::convert::Into<std::boxed::Box<crate::model::StorageProperties>>,
737 >(
738 mut self,
739 v: T,
740 ) -> Self {
741 self.properties = std::option::Option::Some(
742 crate::model::data_source::Properties::StorageProperties(v.into()),
743 );
744 self
745 }
746}
747
748impl wkt::message::Message for DataSource {
749 fn typename() -> &'static str {
750 "type.googleapis.com/google.cloud.datacatalog.v1.DataSource"
751 }
752}
753
754/// Defines additional types related to [DataSource].
755pub mod data_source {
756 #[allow(unused_imports)]
757 use super::*;
758
759 /// Name of a service that stores the data.
760 ///
761 /// # Working with unknown values
762 ///
763 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
764 /// additional enum variants at any time. Adding new variants is not considered
765 /// a breaking change. Applications should write their code in anticipation of:
766 ///
767 /// - New values appearing in future releases of the client library, **and**
768 /// - New values received dynamically, without application changes.
769 ///
770 /// Please consult the [Working with enums] section in the user guide for some
771 /// guidelines.
772 ///
773 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
774 #[derive(Clone, Debug, PartialEq)]
775 #[non_exhaustive]
776 pub enum Service {
777 /// Default unknown service.
778 Unspecified,
779 /// Google Cloud Storage service.
780 CloudStorage,
781 /// BigQuery service.
782 Bigquery,
783 /// If set, the enum was initialized with an unknown value.
784 ///
785 /// Applications can examine the value using [Service::value] or
786 /// [Service::name].
787 UnknownValue(service::UnknownValue),
788 }
789
790 #[doc(hidden)]
791 pub mod service {
792 #[allow(unused_imports)]
793 use super::*;
794 #[derive(Clone, Debug, PartialEq)]
795 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
796 }
797
798 impl Service {
799 /// Gets the enum value.
800 ///
801 /// Returns `None` if the enum contains an unknown value deserialized from
802 /// the string representation of enums.
803 pub fn value(&self) -> std::option::Option<i32> {
804 match self {
805 Self::Unspecified => std::option::Option::Some(0),
806 Self::CloudStorage => std::option::Option::Some(1),
807 Self::Bigquery => std::option::Option::Some(2),
808 Self::UnknownValue(u) => u.0.value(),
809 }
810 }
811
812 /// Gets the enum value as a string.
813 ///
814 /// Returns `None` if the enum contains an unknown value deserialized from
815 /// the integer representation of enums.
816 pub fn name(&self) -> std::option::Option<&str> {
817 match self {
818 Self::Unspecified => std::option::Option::Some("SERVICE_UNSPECIFIED"),
819 Self::CloudStorage => std::option::Option::Some("CLOUD_STORAGE"),
820 Self::Bigquery => std::option::Option::Some("BIGQUERY"),
821 Self::UnknownValue(u) => u.0.name(),
822 }
823 }
824 }
825
826 impl std::default::Default for Service {
827 fn default() -> Self {
828 use std::convert::From;
829 Self::from(0)
830 }
831 }
832
833 impl std::fmt::Display for Service {
834 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
835 wkt::internal::display_enum(f, self.name(), self.value())
836 }
837 }
838
839 impl std::convert::From<i32> for Service {
840 fn from(value: i32) -> Self {
841 match value {
842 0 => Self::Unspecified,
843 1 => Self::CloudStorage,
844 2 => Self::Bigquery,
845 _ => Self::UnknownValue(service::UnknownValue(
846 wkt::internal::UnknownEnumValue::Integer(value),
847 )),
848 }
849 }
850 }
851
852 impl std::convert::From<&str> for Service {
853 fn from(value: &str) -> Self {
854 use std::string::ToString;
855 match value {
856 "SERVICE_UNSPECIFIED" => Self::Unspecified,
857 "CLOUD_STORAGE" => Self::CloudStorage,
858 "BIGQUERY" => Self::Bigquery,
859 _ => Self::UnknownValue(service::UnknownValue(
860 wkt::internal::UnknownEnumValue::String(value.to_string()),
861 )),
862 }
863 }
864 }
865
866 impl serde::ser::Serialize for Service {
867 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
868 where
869 S: serde::Serializer,
870 {
871 match self {
872 Self::Unspecified => serializer.serialize_i32(0),
873 Self::CloudStorage => serializer.serialize_i32(1),
874 Self::Bigquery => serializer.serialize_i32(2),
875 Self::UnknownValue(u) => u.0.serialize(serializer),
876 }
877 }
878 }
879
880 impl<'de> serde::de::Deserialize<'de> for Service {
881 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
882 where
883 D: serde::Deserializer<'de>,
884 {
885 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Service>::new(
886 ".google.cloud.datacatalog.v1.DataSource.Service",
887 ))
888 }
889 }
890
891 #[derive(Clone, Debug, PartialEq)]
892 #[non_exhaustive]
893 pub enum Properties {
894 /// Detailed properties of the underlying storage.
895 StorageProperties(std::boxed::Box<crate::model::StorageProperties>),
896 }
897}
898
899/// Details the properties of the underlying storage.
900#[derive(Clone, Default, PartialEq)]
901#[non_exhaustive]
902pub struct StorageProperties {
903 /// Patterns to identify a set of files for this fileset.
904 ///
905 /// Examples of a valid `file_pattern`:
906 ///
907 /// * `gs://bucket_name/dir/*`: matches all files in the `bucket_name/dir`
908 /// directory
909 /// * `gs://bucket_name/dir/**`: matches all files in the `bucket_name/dir`
910 /// and all subdirectories recursively
911 /// * `gs://bucket_name/file*`: matches files prefixed by `file` in
912 /// `bucket_name`
913 /// * `gs://bucket_name/??.txt`: matches files with two characters followed by
914 /// `.txt` in `bucket_name`
915 /// * `gs://bucket_name/[aeiou].txt`: matches files that contain a single
916 /// vowel character followed by `.txt` in
917 /// `bucket_name`
918 /// * `gs://bucket_name/[a-m].txt`: matches files that contain `a`, `b`, ...
919 /// or `m` followed by `.txt` in `bucket_name`
920 /// * `gs://bucket_name/a/*/b`: matches all files in `bucket_name` that match
921 /// the `a/*/b` pattern, such as `a/c/b`, `a/d/b`
922 /// * `gs://another_bucket/a.txt`: matches `gs://another_bucket/a.txt`
923 pub file_pattern: std::vec::Vec<std::string::String>,
924
925 /// File type in MIME format, for example, `text/plain`.
926 pub file_type: std::string::String,
927
928 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
929}
930
931impl StorageProperties {
932 pub fn new() -> Self {
933 std::default::Default::default()
934 }
935
936 /// Sets the value of [file_pattern][crate::model::StorageProperties::file_pattern].
937 ///
938 /// # Example
939 /// ```ignore,no_run
940 /// # use google_cloud_datacatalog_v1::model::StorageProperties;
941 /// let x = StorageProperties::new().set_file_pattern(["a", "b", "c"]);
942 /// ```
943 pub fn set_file_pattern<T, V>(mut self, v: T) -> Self
944 where
945 T: std::iter::IntoIterator<Item = V>,
946 V: std::convert::Into<std::string::String>,
947 {
948 use std::iter::Iterator;
949 self.file_pattern = v.into_iter().map(|i| i.into()).collect();
950 self
951 }
952
953 /// Sets the value of [file_type][crate::model::StorageProperties::file_type].
954 ///
955 /// # Example
956 /// ```ignore,no_run
957 /// # use google_cloud_datacatalog_v1::model::StorageProperties;
958 /// let x = StorageProperties::new().set_file_type("example");
959 /// ```
960 pub fn set_file_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
961 self.file_type = v.into();
962 self
963 }
964}
965
966impl wkt::message::Message for StorageProperties {
967 fn typename() -> &'static str {
968 "type.googleapis.com/google.cloud.datacatalog.v1.StorageProperties"
969 }
970}
971
972/// Request message for
973/// [SearchCatalog][google.cloud.datacatalog.v1.DataCatalog.SearchCatalog].
974///
975/// [google.cloud.datacatalog.v1.DataCatalog.SearchCatalog]: crate::client::DataCatalog::search_catalog
976#[derive(Clone, Default, PartialEq)]
977#[non_exhaustive]
978pub struct SearchCatalogRequest {
979 /// Required. The scope of this search request.
980 ///
981 /// The `scope` is invalid if `include_org_ids`, `include_project_ids` are
982 /// empty AND `include_gcp_public_datasets` is set to `false`. In this case,
983 /// the request returns an error.
984 pub scope: std::option::Option<crate::model::search_catalog_request::Scope>,
985
986 /// Optional. The query string with a minimum of 3 characters and specific
987 /// syntax. For more information, see [Data Catalog search
988 /// syntax](https://cloud.google.com/data-catalog/docs/how-to/search-reference).
989 ///
990 /// An empty query string returns all data assets (in the specified scope)
991 /// that you have access to.
992 ///
993 /// A query string can be a simple `xyz` or qualified by predicates:
994 ///
995 /// * `name:x`
996 /// * `column:y`
997 /// * `description:z`
998 pub query: std::string::String,
999
1000 /// Upper bound on the number of results you can get in a single response.
1001 ///
1002 /// Can't be negative or 0, defaults to 10 in this case.
1003 /// The maximum number is 1000. If exceeded, throws an "invalid argument"
1004 /// exception.
1005 pub page_size: i32,
1006
1007 /// Optional. Pagination token that, if specified, returns the next page of
1008 /// search results. If empty, returns the first page.
1009 ///
1010 /// This token is returned in the
1011 /// [SearchCatalogResponse.next_page_token][google.cloud.datacatalog.v1.SearchCatalogResponse.next_page_token]
1012 /// field of the response to a previous
1013 /// [SearchCatalogRequest][google.cloud.datacatalog.v1.DataCatalog.SearchCatalog]
1014 /// call.
1015 ///
1016 /// [google.cloud.datacatalog.v1.DataCatalog.SearchCatalog]: crate::client::DataCatalog::search_catalog
1017 /// [google.cloud.datacatalog.v1.SearchCatalogResponse.next_page_token]: crate::model::SearchCatalogResponse::next_page_token
1018 pub page_token: std::string::String,
1019
1020 /// Specifies the order of results.
1021 ///
1022 /// Currently supported case-sensitive values are:
1023 ///
1024 /// * `relevance` that can only be descending
1025 /// * `last_modified_timestamp [asc|desc]` with descending (`desc`) as default
1026 /// * `default` that can only be descending
1027 ///
1028 /// Search queries don't guarantee full recall. Results that match your query
1029 /// might not be returned, even in subsequent result pages. Additionally,
1030 /// returned (and not returned) results can vary if you repeat search queries.
1031 /// If you are experiencing recall issues and you don't have to fetch the
1032 /// results in any specific order, consider setting this parameter to
1033 /// `default`.
1034 ///
1035 /// If this parameter is omitted, it defaults to the descending `relevance`.
1036 pub order_by: std::string::String,
1037
1038 /// Optional. If set, use searchAll permission granted on organizations from
1039 /// `include_org_ids` and projects from `include_project_ids` instead of the
1040 /// fine grained per resource permissions when filtering the search results.
1041 /// The only allowed `order_by` criteria for admin_search mode is `default`.
1042 /// Using this flags guarantees a full recall of the search results.
1043 pub admin_search: bool,
1044
1045 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1046}
1047
1048impl SearchCatalogRequest {
1049 pub fn new() -> Self {
1050 std::default::Default::default()
1051 }
1052
1053 /// Sets the value of [scope][crate::model::SearchCatalogRequest::scope].
1054 ///
1055 /// # Example
1056 /// ```ignore,no_run
1057 /// # use google_cloud_datacatalog_v1::model::SearchCatalogRequest;
1058 /// use google_cloud_datacatalog_v1::model::search_catalog_request::Scope;
1059 /// let x = SearchCatalogRequest::new().set_scope(Scope::default()/* use setters */);
1060 /// ```
1061 pub fn set_scope<T>(mut self, v: T) -> Self
1062 where
1063 T: std::convert::Into<crate::model::search_catalog_request::Scope>,
1064 {
1065 self.scope = std::option::Option::Some(v.into());
1066 self
1067 }
1068
1069 /// Sets or clears the value of [scope][crate::model::SearchCatalogRequest::scope].
1070 ///
1071 /// # Example
1072 /// ```ignore,no_run
1073 /// # use google_cloud_datacatalog_v1::model::SearchCatalogRequest;
1074 /// use google_cloud_datacatalog_v1::model::search_catalog_request::Scope;
1075 /// let x = SearchCatalogRequest::new().set_or_clear_scope(Some(Scope::default()/* use setters */));
1076 /// let x = SearchCatalogRequest::new().set_or_clear_scope(None::<Scope>);
1077 /// ```
1078 pub fn set_or_clear_scope<T>(mut self, v: std::option::Option<T>) -> Self
1079 where
1080 T: std::convert::Into<crate::model::search_catalog_request::Scope>,
1081 {
1082 self.scope = v.map(|x| x.into());
1083 self
1084 }
1085
1086 /// Sets the value of [query][crate::model::SearchCatalogRequest::query].
1087 ///
1088 /// # Example
1089 /// ```ignore,no_run
1090 /// # use google_cloud_datacatalog_v1::model::SearchCatalogRequest;
1091 /// let x = SearchCatalogRequest::new().set_query("example");
1092 /// ```
1093 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1094 self.query = v.into();
1095 self
1096 }
1097
1098 /// Sets the value of [page_size][crate::model::SearchCatalogRequest::page_size].
1099 ///
1100 /// # Example
1101 /// ```ignore,no_run
1102 /// # use google_cloud_datacatalog_v1::model::SearchCatalogRequest;
1103 /// let x = SearchCatalogRequest::new().set_page_size(42);
1104 /// ```
1105 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1106 self.page_size = v.into();
1107 self
1108 }
1109
1110 /// Sets the value of [page_token][crate::model::SearchCatalogRequest::page_token].
1111 ///
1112 /// # Example
1113 /// ```ignore,no_run
1114 /// # use google_cloud_datacatalog_v1::model::SearchCatalogRequest;
1115 /// let x = SearchCatalogRequest::new().set_page_token("example");
1116 /// ```
1117 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1118 self.page_token = v.into();
1119 self
1120 }
1121
1122 /// Sets the value of [order_by][crate::model::SearchCatalogRequest::order_by].
1123 ///
1124 /// # Example
1125 /// ```ignore,no_run
1126 /// # use google_cloud_datacatalog_v1::model::SearchCatalogRequest;
1127 /// let x = SearchCatalogRequest::new().set_order_by("example");
1128 /// ```
1129 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1130 self.order_by = v.into();
1131 self
1132 }
1133
1134 /// Sets the value of [admin_search][crate::model::SearchCatalogRequest::admin_search].
1135 ///
1136 /// # Example
1137 /// ```ignore,no_run
1138 /// # use google_cloud_datacatalog_v1::model::SearchCatalogRequest;
1139 /// let x = SearchCatalogRequest::new().set_admin_search(true);
1140 /// ```
1141 pub fn set_admin_search<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1142 self.admin_search = v.into();
1143 self
1144 }
1145}
1146
1147impl wkt::message::Message for SearchCatalogRequest {
1148 fn typename() -> &'static str {
1149 "type.googleapis.com/google.cloud.datacatalog.v1.SearchCatalogRequest"
1150 }
1151}
1152
1153/// Defines additional types related to [SearchCatalogRequest].
1154pub mod search_catalog_request {
1155 #[allow(unused_imports)]
1156 use super::*;
1157
1158 /// The criteria that select the subspace used for query matching.
1159 #[derive(Clone, Default, PartialEq)]
1160 #[non_exhaustive]
1161 pub struct Scope {
1162 /// The list of organization IDs to search within.
1163 ///
1164 /// To find your organization ID, follow the steps from
1165 /// [Creating and managing organizations]
1166 /// (/resource-manager/docs/creating-managing-organization).
1167 pub include_org_ids: std::vec::Vec<std::string::String>,
1168
1169 /// The list of project IDs to search within.
1170 ///
1171 /// For more information on the distinction between project names, IDs, and
1172 /// numbers, see [Projects](/docs/overview/#projects).
1173 pub include_project_ids: std::vec::Vec<std::string::String>,
1174
1175 /// If `true`, include Google Cloud public datasets in
1176 /// search results. By default, they are excluded.
1177 ///
1178 /// See [Google Cloud Public Datasets](/public-datasets) for more
1179 /// information.
1180 pub include_gcp_public_datasets: bool,
1181
1182 /// Optional. The list of locations to search within. If empty, all locations
1183 /// are searched.
1184 ///
1185 /// Returns an error if any location in the list isn't one of the [Supported
1186 /// regions](https://cloud.google.com/data-catalog/docs/concepts/regions#supported_regions).
1187 ///
1188 /// If a location is unreachable, its name is returned in the
1189 /// `SearchCatalogResponse.unreachable` field. To get additional information
1190 /// on the error, repeat the search request and set the location name as the
1191 /// value of this parameter.
1192 pub restricted_locations: std::vec::Vec<std::string::String>,
1193
1194 /// Optional. If `true`, search only among starred entries.
1195 ///
1196 /// By default, all results are returned, starred or not.
1197 pub starred_only: bool,
1198
1199 /// Optional. This field is deprecated. The search mechanism for public and
1200 /// private tag templates is the same.
1201 #[deprecated]
1202 pub include_public_tag_templates: bool,
1203
1204 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1205 }
1206
1207 impl Scope {
1208 pub fn new() -> Self {
1209 std::default::Default::default()
1210 }
1211
1212 /// Sets the value of [include_org_ids][crate::model::search_catalog_request::Scope::include_org_ids].
1213 ///
1214 /// # Example
1215 /// ```ignore,no_run
1216 /// # use google_cloud_datacatalog_v1::model::search_catalog_request::Scope;
1217 /// let x = Scope::new().set_include_org_ids(["a", "b", "c"]);
1218 /// ```
1219 pub fn set_include_org_ids<T, V>(mut self, v: T) -> Self
1220 where
1221 T: std::iter::IntoIterator<Item = V>,
1222 V: std::convert::Into<std::string::String>,
1223 {
1224 use std::iter::Iterator;
1225 self.include_org_ids = v.into_iter().map(|i| i.into()).collect();
1226 self
1227 }
1228
1229 /// Sets the value of [include_project_ids][crate::model::search_catalog_request::Scope::include_project_ids].
1230 ///
1231 /// # Example
1232 /// ```ignore,no_run
1233 /// # use google_cloud_datacatalog_v1::model::search_catalog_request::Scope;
1234 /// let x = Scope::new().set_include_project_ids(["a", "b", "c"]);
1235 /// ```
1236 pub fn set_include_project_ids<T, V>(mut self, v: T) -> Self
1237 where
1238 T: std::iter::IntoIterator<Item = V>,
1239 V: std::convert::Into<std::string::String>,
1240 {
1241 use std::iter::Iterator;
1242 self.include_project_ids = v.into_iter().map(|i| i.into()).collect();
1243 self
1244 }
1245
1246 /// Sets the value of [include_gcp_public_datasets][crate::model::search_catalog_request::Scope::include_gcp_public_datasets].
1247 ///
1248 /// # Example
1249 /// ```ignore,no_run
1250 /// # use google_cloud_datacatalog_v1::model::search_catalog_request::Scope;
1251 /// let x = Scope::new().set_include_gcp_public_datasets(true);
1252 /// ```
1253 pub fn set_include_gcp_public_datasets<T: std::convert::Into<bool>>(
1254 mut self,
1255 v: T,
1256 ) -> Self {
1257 self.include_gcp_public_datasets = v.into();
1258 self
1259 }
1260
1261 /// Sets the value of [restricted_locations][crate::model::search_catalog_request::Scope::restricted_locations].
1262 ///
1263 /// # Example
1264 /// ```ignore,no_run
1265 /// # use google_cloud_datacatalog_v1::model::search_catalog_request::Scope;
1266 /// let x = Scope::new().set_restricted_locations(["a", "b", "c"]);
1267 /// ```
1268 pub fn set_restricted_locations<T, V>(mut self, v: T) -> Self
1269 where
1270 T: std::iter::IntoIterator<Item = V>,
1271 V: std::convert::Into<std::string::String>,
1272 {
1273 use std::iter::Iterator;
1274 self.restricted_locations = v.into_iter().map(|i| i.into()).collect();
1275 self
1276 }
1277
1278 /// Sets the value of [starred_only][crate::model::search_catalog_request::Scope::starred_only].
1279 ///
1280 /// # Example
1281 /// ```ignore,no_run
1282 /// # use google_cloud_datacatalog_v1::model::search_catalog_request::Scope;
1283 /// let x = Scope::new().set_starred_only(true);
1284 /// ```
1285 pub fn set_starred_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1286 self.starred_only = v.into();
1287 self
1288 }
1289
1290 /// Sets the value of [include_public_tag_templates][crate::model::search_catalog_request::Scope::include_public_tag_templates].
1291 ///
1292 /// # Example
1293 /// ```ignore,no_run
1294 /// # use google_cloud_datacatalog_v1::model::search_catalog_request::Scope;
1295 /// let x = Scope::new().set_include_public_tag_templates(true);
1296 /// ```
1297 #[deprecated]
1298 pub fn set_include_public_tag_templates<T: std::convert::Into<bool>>(
1299 mut self,
1300 v: T,
1301 ) -> Self {
1302 self.include_public_tag_templates = v.into();
1303 self
1304 }
1305 }
1306
1307 impl wkt::message::Message for Scope {
1308 fn typename() -> &'static str {
1309 "type.googleapis.com/google.cloud.datacatalog.v1.SearchCatalogRequest.Scope"
1310 }
1311 }
1312}
1313
1314/// Response message for
1315/// [SearchCatalog][google.cloud.datacatalog.v1.DataCatalog.SearchCatalog].
1316///
1317/// [google.cloud.datacatalog.v1.DataCatalog.SearchCatalog]: crate::client::DataCatalog::search_catalog
1318#[derive(Clone, Default, PartialEq)]
1319#[non_exhaustive]
1320pub struct SearchCatalogResponse {
1321 /// Search results.
1322 pub results: std::vec::Vec<crate::model::SearchCatalogResult>,
1323
1324 /// The approximate total number of entries matched by the query.
1325 pub total_size: i32,
1326
1327 /// Pagination token that can be used in subsequent calls to retrieve the next
1328 /// page of results.
1329 pub next_page_token: std::string::String,
1330
1331 /// Unreachable locations. Search results don't include data from those
1332 /// locations.
1333 ///
1334 /// To get additional information on an error, repeat the search request and
1335 /// restrict it to specific locations by setting the
1336 /// `SearchCatalogRequest.scope.restricted_locations` parameter.
1337 pub unreachable: std::vec::Vec<std::string::String>,
1338
1339 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1340}
1341
1342impl SearchCatalogResponse {
1343 pub fn new() -> Self {
1344 std::default::Default::default()
1345 }
1346
1347 /// Sets the value of [results][crate::model::SearchCatalogResponse::results].
1348 ///
1349 /// # Example
1350 /// ```ignore,no_run
1351 /// # use google_cloud_datacatalog_v1::model::SearchCatalogResponse;
1352 /// use google_cloud_datacatalog_v1::model::SearchCatalogResult;
1353 /// let x = SearchCatalogResponse::new()
1354 /// .set_results([
1355 /// SearchCatalogResult::default()/* use setters */,
1356 /// SearchCatalogResult::default()/* use (different) setters */,
1357 /// ]);
1358 /// ```
1359 pub fn set_results<T, V>(mut self, v: T) -> Self
1360 where
1361 T: std::iter::IntoIterator<Item = V>,
1362 V: std::convert::Into<crate::model::SearchCatalogResult>,
1363 {
1364 use std::iter::Iterator;
1365 self.results = v.into_iter().map(|i| i.into()).collect();
1366 self
1367 }
1368
1369 /// Sets the value of [total_size][crate::model::SearchCatalogResponse::total_size].
1370 ///
1371 /// # Example
1372 /// ```ignore,no_run
1373 /// # use google_cloud_datacatalog_v1::model::SearchCatalogResponse;
1374 /// let x = SearchCatalogResponse::new().set_total_size(42);
1375 /// ```
1376 pub fn set_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1377 self.total_size = v.into();
1378 self
1379 }
1380
1381 /// Sets the value of [next_page_token][crate::model::SearchCatalogResponse::next_page_token].
1382 ///
1383 /// # Example
1384 /// ```ignore,no_run
1385 /// # use google_cloud_datacatalog_v1::model::SearchCatalogResponse;
1386 /// let x = SearchCatalogResponse::new().set_next_page_token("example");
1387 /// ```
1388 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1389 self.next_page_token = v.into();
1390 self
1391 }
1392
1393 /// Sets the value of [unreachable][crate::model::SearchCatalogResponse::unreachable].
1394 ///
1395 /// # Example
1396 /// ```ignore,no_run
1397 /// # use google_cloud_datacatalog_v1::model::SearchCatalogResponse;
1398 /// let x = SearchCatalogResponse::new().set_unreachable(["a", "b", "c"]);
1399 /// ```
1400 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1401 where
1402 T: std::iter::IntoIterator<Item = V>,
1403 V: std::convert::Into<std::string::String>,
1404 {
1405 use std::iter::Iterator;
1406 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1407 self
1408 }
1409}
1410
1411impl wkt::message::Message for SearchCatalogResponse {
1412 fn typename() -> &'static str {
1413 "type.googleapis.com/google.cloud.datacatalog.v1.SearchCatalogResponse"
1414 }
1415}
1416
1417#[doc(hidden)]
1418impl google_cloud_gax::paginator::internal::PageableResponse for SearchCatalogResponse {
1419 type PageItem = crate::model::SearchCatalogResult;
1420
1421 fn items(self) -> std::vec::Vec<Self::PageItem> {
1422 self.results
1423 }
1424
1425 fn next_page_token(&self) -> std::string::String {
1426 use std::clone::Clone;
1427 self.next_page_token.clone()
1428 }
1429}
1430
1431/// Request message for
1432/// [CreateEntryGroup][google.cloud.datacatalog.v1.DataCatalog.CreateEntryGroup].
1433///
1434/// [google.cloud.datacatalog.v1.DataCatalog.CreateEntryGroup]: crate::client::DataCatalog::create_entry_group
1435#[derive(Clone, Default, PartialEq)]
1436#[non_exhaustive]
1437pub struct CreateEntryGroupRequest {
1438 /// Required. The names of the project and location that the new entry group
1439 /// belongs to.
1440 ///
1441 /// Note: The entry group itself and its child resources might not be
1442 /// stored in the location specified in its name.
1443 pub parent: std::string::String,
1444
1445 /// Required. The ID of the entry group to create.
1446 ///
1447 /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
1448 /// underscores (_), and must start with a letter or underscore.
1449 /// The maximum size is 64 bytes when encoded in UTF-8.
1450 pub entry_group_id: std::string::String,
1451
1452 /// The entry group to create. Defaults to empty.
1453 pub entry_group: std::option::Option<crate::model::EntryGroup>,
1454
1455 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1456}
1457
1458impl CreateEntryGroupRequest {
1459 pub fn new() -> Self {
1460 std::default::Default::default()
1461 }
1462
1463 /// Sets the value of [parent][crate::model::CreateEntryGroupRequest::parent].
1464 ///
1465 /// # Example
1466 /// ```ignore,no_run
1467 /// # use google_cloud_datacatalog_v1::model::CreateEntryGroupRequest;
1468 /// let x = CreateEntryGroupRequest::new().set_parent("example");
1469 /// ```
1470 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1471 self.parent = v.into();
1472 self
1473 }
1474
1475 /// Sets the value of [entry_group_id][crate::model::CreateEntryGroupRequest::entry_group_id].
1476 ///
1477 /// # Example
1478 /// ```ignore,no_run
1479 /// # use google_cloud_datacatalog_v1::model::CreateEntryGroupRequest;
1480 /// let x = CreateEntryGroupRequest::new().set_entry_group_id("example");
1481 /// ```
1482 pub fn set_entry_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1483 self.entry_group_id = v.into();
1484 self
1485 }
1486
1487 /// Sets the value of [entry_group][crate::model::CreateEntryGroupRequest::entry_group].
1488 ///
1489 /// # Example
1490 /// ```ignore,no_run
1491 /// # use google_cloud_datacatalog_v1::model::CreateEntryGroupRequest;
1492 /// use google_cloud_datacatalog_v1::model::EntryGroup;
1493 /// let x = CreateEntryGroupRequest::new().set_entry_group(EntryGroup::default()/* use setters */);
1494 /// ```
1495 pub fn set_entry_group<T>(mut self, v: T) -> Self
1496 where
1497 T: std::convert::Into<crate::model::EntryGroup>,
1498 {
1499 self.entry_group = std::option::Option::Some(v.into());
1500 self
1501 }
1502
1503 /// Sets or clears the value of [entry_group][crate::model::CreateEntryGroupRequest::entry_group].
1504 ///
1505 /// # Example
1506 /// ```ignore,no_run
1507 /// # use google_cloud_datacatalog_v1::model::CreateEntryGroupRequest;
1508 /// use google_cloud_datacatalog_v1::model::EntryGroup;
1509 /// let x = CreateEntryGroupRequest::new().set_or_clear_entry_group(Some(EntryGroup::default()/* use setters */));
1510 /// let x = CreateEntryGroupRequest::new().set_or_clear_entry_group(None::<EntryGroup>);
1511 /// ```
1512 pub fn set_or_clear_entry_group<T>(mut self, v: std::option::Option<T>) -> Self
1513 where
1514 T: std::convert::Into<crate::model::EntryGroup>,
1515 {
1516 self.entry_group = v.map(|x| x.into());
1517 self
1518 }
1519}
1520
1521impl wkt::message::Message for CreateEntryGroupRequest {
1522 fn typename() -> &'static str {
1523 "type.googleapis.com/google.cloud.datacatalog.v1.CreateEntryGroupRequest"
1524 }
1525}
1526
1527/// Request message for
1528/// [UpdateEntryGroup][google.cloud.datacatalog.v1.DataCatalog.UpdateEntryGroup].
1529///
1530/// [google.cloud.datacatalog.v1.DataCatalog.UpdateEntryGroup]: crate::client::DataCatalog::update_entry_group
1531#[derive(Clone, Default, PartialEq)]
1532#[non_exhaustive]
1533pub struct UpdateEntryGroupRequest {
1534 /// Required. Updates for the entry group. The `name` field must be set.
1535 pub entry_group: std::option::Option<crate::model::EntryGroup>,
1536
1537 /// Names of fields whose values to overwrite on an entry group.
1538 ///
1539 /// If this parameter is absent or empty, all modifiable fields
1540 /// are overwritten. If such fields are non-required and omitted in the
1541 /// request body, their values are emptied.
1542 pub update_mask: std::option::Option<wkt::FieldMask>,
1543
1544 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1545}
1546
1547impl UpdateEntryGroupRequest {
1548 pub fn new() -> Self {
1549 std::default::Default::default()
1550 }
1551
1552 /// Sets the value of [entry_group][crate::model::UpdateEntryGroupRequest::entry_group].
1553 ///
1554 /// # Example
1555 /// ```ignore,no_run
1556 /// # use google_cloud_datacatalog_v1::model::UpdateEntryGroupRequest;
1557 /// use google_cloud_datacatalog_v1::model::EntryGroup;
1558 /// let x = UpdateEntryGroupRequest::new().set_entry_group(EntryGroup::default()/* use setters */);
1559 /// ```
1560 pub fn set_entry_group<T>(mut self, v: T) -> Self
1561 where
1562 T: std::convert::Into<crate::model::EntryGroup>,
1563 {
1564 self.entry_group = std::option::Option::Some(v.into());
1565 self
1566 }
1567
1568 /// Sets or clears the value of [entry_group][crate::model::UpdateEntryGroupRequest::entry_group].
1569 ///
1570 /// # Example
1571 /// ```ignore,no_run
1572 /// # use google_cloud_datacatalog_v1::model::UpdateEntryGroupRequest;
1573 /// use google_cloud_datacatalog_v1::model::EntryGroup;
1574 /// let x = UpdateEntryGroupRequest::new().set_or_clear_entry_group(Some(EntryGroup::default()/* use setters */));
1575 /// let x = UpdateEntryGroupRequest::new().set_or_clear_entry_group(None::<EntryGroup>);
1576 /// ```
1577 pub fn set_or_clear_entry_group<T>(mut self, v: std::option::Option<T>) -> Self
1578 where
1579 T: std::convert::Into<crate::model::EntryGroup>,
1580 {
1581 self.entry_group = v.map(|x| x.into());
1582 self
1583 }
1584
1585 /// Sets the value of [update_mask][crate::model::UpdateEntryGroupRequest::update_mask].
1586 ///
1587 /// # Example
1588 /// ```ignore,no_run
1589 /// # use google_cloud_datacatalog_v1::model::UpdateEntryGroupRequest;
1590 /// use wkt::FieldMask;
1591 /// let x = UpdateEntryGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1592 /// ```
1593 pub fn set_update_mask<T>(mut self, v: T) -> Self
1594 where
1595 T: std::convert::Into<wkt::FieldMask>,
1596 {
1597 self.update_mask = std::option::Option::Some(v.into());
1598 self
1599 }
1600
1601 /// Sets or clears the value of [update_mask][crate::model::UpdateEntryGroupRequest::update_mask].
1602 ///
1603 /// # Example
1604 /// ```ignore,no_run
1605 /// # use google_cloud_datacatalog_v1::model::UpdateEntryGroupRequest;
1606 /// use wkt::FieldMask;
1607 /// let x = UpdateEntryGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1608 /// let x = UpdateEntryGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1609 /// ```
1610 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1611 where
1612 T: std::convert::Into<wkt::FieldMask>,
1613 {
1614 self.update_mask = v.map(|x| x.into());
1615 self
1616 }
1617}
1618
1619impl wkt::message::Message for UpdateEntryGroupRequest {
1620 fn typename() -> &'static str {
1621 "type.googleapis.com/google.cloud.datacatalog.v1.UpdateEntryGroupRequest"
1622 }
1623}
1624
1625/// Request message for
1626/// [GetEntryGroup][google.cloud.datacatalog.v1.DataCatalog.GetEntryGroup].
1627///
1628/// [google.cloud.datacatalog.v1.DataCatalog.GetEntryGroup]: crate::client::DataCatalog::get_entry_group
1629#[derive(Clone, Default, PartialEq)]
1630#[non_exhaustive]
1631pub struct GetEntryGroupRequest {
1632 /// Required. The name of the entry group to get.
1633 pub name: std::string::String,
1634
1635 /// The fields to return. If empty or omitted, all fields are returned.
1636 pub read_mask: std::option::Option<wkt::FieldMask>,
1637
1638 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1639}
1640
1641impl GetEntryGroupRequest {
1642 pub fn new() -> Self {
1643 std::default::Default::default()
1644 }
1645
1646 /// Sets the value of [name][crate::model::GetEntryGroupRequest::name].
1647 ///
1648 /// # Example
1649 /// ```ignore,no_run
1650 /// # use google_cloud_datacatalog_v1::model::GetEntryGroupRequest;
1651 /// let x = GetEntryGroupRequest::new().set_name("example");
1652 /// ```
1653 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1654 self.name = v.into();
1655 self
1656 }
1657
1658 /// Sets the value of [read_mask][crate::model::GetEntryGroupRequest::read_mask].
1659 ///
1660 /// # Example
1661 /// ```ignore,no_run
1662 /// # use google_cloud_datacatalog_v1::model::GetEntryGroupRequest;
1663 /// use wkt::FieldMask;
1664 /// let x = GetEntryGroupRequest::new().set_read_mask(FieldMask::default()/* use setters */);
1665 /// ```
1666 pub fn set_read_mask<T>(mut self, v: T) -> Self
1667 where
1668 T: std::convert::Into<wkt::FieldMask>,
1669 {
1670 self.read_mask = std::option::Option::Some(v.into());
1671 self
1672 }
1673
1674 /// Sets or clears the value of [read_mask][crate::model::GetEntryGroupRequest::read_mask].
1675 ///
1676 /// # Example
1677 /// ```ignore,no_run
1678 /// # use google_cloud_datacatalog_v1::model::GetEntryGroupRequest;
1679 /// use wkt::FieldMask;
1680 /// let x = GetEntryGroupRequest::new().set_or_clear_read_mask(Some(FieldMask::default()/* use setters */));
1681 /// let x = GetEntryGroupRequest::new().set_or_clear_read_mask(None::<FieldMask>);
1682 /// ```
1683 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1684 where
1685 T: std::convert::Into<wkt::FieldMask>,
1686 {
1687 self.read_mask = v.map(|x| x.into());
1688 self
1689 }
1690}
1691
1692impl wkt::message::Message for GetEntryGroupRequest {
1693 fn typename() -> &'static str {
1694 "type.googleapis.com/google.cloud.datacatalog.v1.GetEntryGroupRequest"
1695 }
1696}
1697
1698/// Request message for
1699/// [DeleteEntryGroup][google.cloud.datacatalog.v1.DataCatalog.DeleteEntryGroup].
1700///
1701/// [google.cloud.datacatalog.v1.DataCatalog.DeleteEntryGroup]: crate::client::DataCatalog::delete_entry_group
1702#[derive(Clone, Default, PartialEq)]
1703#[non_exhaustive]
1704pub struct DeleteEntryGroupRequest {
1705 /// Required. The name of the entry group to delete.
1706 pub name: std::string::String,
1707
1708 /// Optional. If true, deletes all entries in the entry group.
1709 pub force: bool,
1710
1711 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1712}
1713
1714impl DeleteEntryGroupRequest {
1715 pub fn new() -> Self {
1716 std::default::Default::default()
1717 }
1718
1719 /// Sets the value of [name][crate::model::DeleteEntryGroupRequest::name].
1720 ///
1721 /// # Example
1722 /// ```ignore,no_run
1723 /// # use google_cloud_datacatalog_v1::model::DeleteEntryGroupRequest;
1724 /// let x = DeleteEntryGroupRequest::new().set_name("example");
1725 /// ```
1726 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1727 self.name = v.into();
1728 self
1729 }
1730
1731 /// Sets the value of [force][crate::model::DeleteEntryGroupRequest::force].
1732 ///
1733 /// # Example
1734 /// ```ignore,no_run
1735 /// # use google_cloud_datacatalog_v1::model::DeleteEntryGroupRequest;
1736 /// let x = DeleteEntryGroupRequest::new().set_force(true);
1737 /// ```
1738 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1739 self.force = v.into();
1740 self
1741 }
1742}
1743
1744impl wkt::message::Message for DeleteEntryGroupRequest {
1745 fn typename() -> &'static str {
1746 "type.googleapis.com/google.cloud.datacatalog.v1.DeleteEntryGroupRequest"
1747 }
1748}
1749
1750/// Request message for
1751/// [ListEntryGroups][google.cloud.datacatalog.v1.DataCatalog.ListEntryGroups].
1752///
1753/// [google.cloud.datacatalog.v1.DataCatalog.ListEntryGroups]: crate::client::DataCatalog::list_entry_groups
1754#[derive(Clone, Default, PartialEq)]
1755#[non_exhaustive]
1756pub struct ListEntryGroupsRequest {
1757 /// Required. The name of the location that contains the entry groups to list.
1758 ///
1759 /// Can be provided as a URL.
1760 pub parent: std::string::String,
1761
1762 /// Optional. The maximum number of items to return.
1763 ///
1764 /// Default is 10. Maximum limit is 1000.
1765 /// Throws an invalid argument if `page_size` is greater than 1000.
1766 pub page_size: i32,
1767
1768 /// Optional. Pagination token that specifies the next page to return.
1769 /// If empty, returns the first page.
1770 pub page_token: std::string::String,
1771
1772 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1773}
1774
1775impl ListEntryGroupsRequest {
1776 pub fn new() -> Self {
1777 std::default::Default::default()
1778 }
1779
1780 /// Sets the value of [parent][crate::model::ListEntryGroupsRequest::parent].
1781 ///
1782 /// # Example
1783 /// ```ignore,no_run
1784 /// # use google_cloud_datacatalog_v1::model::ListEntryGroupsRequest;
1785 /// let x = ListEntryGroupsRequest::new().set_parent("example");
1786 /// ```
1787 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1788 self.parent = v.into();
1789 self
1790 }
1791
1792 /// Sets the value of [page_size][crate::model::ListEntryGroupsRequest::page_size].
1793 ///
1794 /// # Example
1795 /// ```ignore,no_run
1796 /// # use google_cloud_datacatalog_v1::model::ListEntryGroupsRequest;
1797 /// let x = ListEntryGroupsRequest::new().set_page_size(42);
1798 /// ```
1799 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1800 self.page_size = v.into();
1801 self
1802 }
1803
1804 /// Sets the value of [page_token][crate::model::ListEntryGroupsRequest::page_token].
1805 ///
1806 /// # Example
1807 /// ```ignore,no_run
1808 /// # use google_cloud_datacatalog_v1::model::ListEntryGroupsRequest;
1809 /// let x = ListEntryGroupsRequest::new().set_page_token("example");
1810 /// ```
1811 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1812 self.page_token = v.into();
1813 self
1814 }
1815}
1816
1817impl wkt::message::Message for ListEntryGroupsRequest {
1818 fn typename() -> &'static str {
1819 "type.googleapis.com/google.cloud.datacatalog.v1.ListEntryGroupsRequest"
1820 }
1821}
1822
1823/// Response message for
1824/// [ListEntryGroups][google.cloud.datacatalog.v1.DataCatalog.ListEntryGroups].
1825///
1826/// [google.cloud.datacatalog.v1.DataCatalog.ListEntryGroups]: crate::client::DataCatalog::list_entry_groups
1827#[derive(Clone, Default, PartialEq)]
1828#[non_exhaustive]
1829pub struct ListEntryGroupsResponse {
1830 /// Entry group details.
1831 pub entry_groups: std::vec::Vec<crate::model::EntryGroup>,
1832
1833 /// Pagination token to specify in the next call to retrieve the next page of
1834 /// results. Empty if there are no more items.
1835 pub next_page_token: std::string::String,
1836
1837 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1838}
1839
1840impl ListEntryGroupsResponse {
1841 pub fn new() -> Self {
1842 std::default::Default::default()
1843 }
1844
1845 /// Sets the value of [entry_groups][crate::model::ListEntryGroupsResponse::entry_groups].
1846 ///
1847 /// # Example
1848 /// ```ignore,no_run
1849 /// # use google_cloud_datacatalog_v1::model::ListEntryGroupsResponse;
1850 /// use google_cloud_datacatalog_v1::model::EntryGroup;
1851 /// let x = ListEntryGroupsResponse::new()
1852 /// .set_entry_groups([
1853 /// EntryGroup::default()/* use setters */,
1854 /// EntryGroup::default()/* use (different) setters */,
1855 /// ]);
1856 /// ```
1857 pub fn set_entry_groups<T, V>(mut self, v: T) -> Self
1858 where
1859 T: std::iter::IntoIterator<Item = V>,
1860 V: std::convert::Into<crate::model::EntryGroup>,
1861 {
1862 use std::iter::Iterator;
1863 self.entry_groups = v.into_iter().map(|i| i.into()).collect();
1864 self
1865 }
1866
1867 /// Sets the value of [next_page_token][crate::model::ListEntryGroupsResponse::next_page_token].
1868 ///
1869 /// # Example
1870 /// ```ignore,no_run
1871 /// # use google_cloud_datacatalog_v1::model::ListEntryGroupsResponse;
1872 /// let x = ListEntryGroupsResponse::new().set_next_page_token("example");
1873 /// ```
1874 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1875 self.next_page_token = v.into();
1876 self
1877 }
1878}
1879
1880impl wkt::message::Message for ListEntryGroupsResponse {
1881 fn typename() -> &'static str {
1882 "type.googleapis.com/google.cloud.datacatalog.v1.ListEntryGroupsResponse"
1883 }
1884}
1885
1886#[doc(hidden)]
1887impl google_cloud_gax::paginator::internal::PageableResponse for ListEntryGroupsResponse {
1888 type PageItem = crate::model::EntryGroup;
1889
1890 fn items(self) -> std::vec::Vec<Self::PageItem> {
1891 self.entry_groups
1892 }
1893
1894 fn next_page_token(&self) -> std::string::String {
1895 use std::clone::Clone;
1896 self.next_page_token.clone()
1897 }
1898}
1899
1900/// Request message for
1901/// [CreateEntry][google.cloud.datacatalog.v1.DataCatalog.CreateEntry].
1902///
1903/// [google.cloud.datacatalog.v1.DataCatalog.CreateEntry]: crate::client::DataCatalog::create_entry
1904#[derive(Clone, Default, PartialEq)]
1905#[non_exhaustive]
1906pub struct CreateEntryRequest {
1907 /// Required. The name of the entry group this entry belongs to.
1908 ///
1909 /// Note: The entry itself and its child resources might not be stored in
1910 /// the location specified in its name.
1911 pub parent: std::string::String,
1912
1913 /// Required. The ID of the entry to create.
1914 ///
1915 /// The ID must contain only letters (a-z, A-Z), numbers (0-9),
1916 /// and underscores (_).
1917 /// The maximum size is 64 bytes when encoded in UTF-8.
1918 pub entry_id: std::string::String,
1919
1920 /// Required. The entry to create.
1921 pub entry: std::option::Option<crate::model::Entry>,
1922
1923 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1924}
1925
1926impl CreateEntryRequest {
1927 pub fn new() -> Self {
1928 std::default::Default::default()
1929 }
1930
1931 /// Sets the value of [parent][crate::model::CreateEntryRequest::parent].
1932 ///
1933 /// # Example
1934 /// ```ignore,no_run
1935 /// # use google_cloud_datacatalog_v1::model::CreateEntryRequest;
1936 /// let x = CreateEntryRequest::new().set_parent("example");
1937 /// ```
1938 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1939 self.parent = v.into();
1940 self
1941 }
1942
1943 /// Sets the value of [entry_id][crate::model::CreateEntryRequest::entry_id].
1944 ///
1945 /// # Example
1946 /// ```ignore,no_run
1947 /// # use google_cloud_datacatalog_v1::model::CreateEntryRequest;
1948 /// let x = CreateEntryRequest::new().set_entry_id("example");
1949 /// ```
1950 pub fn set_entry_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1951 self.entry_id = v.into();
1952 self
1953 }
1954
1955 /// Sets the value of [entry][crate::model::CreateEntryRequest::entry].
1956 ///
1957 /// # Example
1958 /// ```ignore,no_run
1959 /// # use google_cloud_datacatalog_v1::model::CreateEntryRequest;
1960 /// use google_cloud_datacatalog_v1::model::Entry;
1961 /// let x = CreateEntryRequest::new().set_entry(Entry::default()/* use setters */);
1962 /// ```
1963 pub fn set_entry<T>(mut self, v: T) -> Self
1964 where
1965 T: std::convert::Into<crate::model::Entry>,
1966 {
1967 self.entry = std::option::Option::Some(v.into());
1968 self
1969 }
1970
1971 /// Sets or clears the value of [entry][crate::model::CreateEntryRequest::entry].
1972 ///
1973 /// # Example
1974 /// ```ignore,no_run
1975 /// # use google_cloud_datacatalog_v1::model::CreateEntryRequest;
1976 /// use google_cloud_datacatalog_v1::model::Entry;
1977 /// let x = CreateEntryRequest::new().set_or_clear_entry(Some(Entry::default()/* use setters */));
1978 /// let x = CreateEntryRequest::new().set_or_clear_entry(None::<Entry>);
1979 /// ```
1980 pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
1981 where
1982 T: std::convert::Into<crate::model::Entry>,
1983 {
1984 self.entry = v.map(|x| x.into());
1985 self
1986 }
1987}
1988
1989impl wkt::message::Message for CreateEntryRequest {
1990 fn typename() -> &'static str {
1991 "type.googleapis.com/google.cloud.datacatalog.v1.CreateEntryRequest"
1992 }
1993}
1994
1995/// Request message for
1996/// [UpdateEntry][google.cloud.datacatalog.v1.DataCatalog.UpdateEntry].
1997///
1998/// [google.cloud.datacatalog.v1.DataCatalog.UpdateEntry]: crate::client::DataCatalog::update_entry
1999#[derive(Clone, Default, PartialEq)]
2000#[non_exhaustive]
2001pub struct UpdateEntryRequest {
2002 /// Required. Updates for the entry. The `name` field must be set.
2003 pub entry: std::option::Option<crate::model::Entry>,
2004
2005 /// Names of fields whose values to overwrite on an entry.
2006 ///
2007 /// If this parameter is absent or empty, all modifiable fields
2008 /// are overwritten. If such fields are non-required and omitted in the
2009 /// request body, their values are emptied.
2010 ///
2011 /// You can modify only the fields listed below.
2012 ///
2013 /// For entries with type `DATA_STREAM`:
2014 ///
2015 /// * `schema`
2016 ///
2017 /// For entries with type `FILESET`:
2018 ///
2019 /// * `schema`
2020 /// * `display_name`
2021 /// * `description`
2022 /// * `gcs_fileset_spec`
2023 /// * `gcs_fileset_spec.file_patterns`
2024 ///
2025 /// For entries with `user_specified_type`:
2026 ///
2027 /// * `schema`
2028 /// * `display_name`
2029 /// * `description`
2030 /// * `user_specified_type`
2031 /// * `user_specified_system`
2032 /// * `linked_resource`
2033 /// * `source_system_timestamps`
2034 pub update_mask: std::option::Option<wkt::FieldMask>,
2035
2036 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2037}
2038
2039impl UpdateEntryRequest {
2040 pub fn new() -> Self {
2041 std::default::Default::default()
2042 }
2043
2044 /// Sets the value of [entry][crate::model::UpdateEntryRequest::entry].
2045 ///
2046 /// # Example
2047 /// ```ignore,no_run
2048 /// # use google_cloud_datacatalog_v1::model::UpdateEntryRequest;
2049 /// use google_cloud_datacatalog_v1::model::Entry;
2050 /// let x = UpdateEntryRequest::new().set_entry(Entry::default()/* use setters */);
2051 /// ```
2052 pub fn set_entry<T>(mut self, v: T) -> Self
2053 where
2054 T: std::convert::Into<crate::model::Entry>,
2055 {
2056 self.entry = std::option::Option::Some(v.into());
2057 self
2058 }
2059
2060 /// Sets or clears the value of [entry][crate::model::UpdateEntryRequest::entry].
2061 ///
2062 /// # Example
2063 /// ```ignore,no_run
2064 /// # use google_cloud_datacatalog_v1::model::UpdateEntryRequest;
2065 /// use google_cloud_datacatalog_v1::model::Entry;
2066 /// let x = UpdateEntryRequest::new().set_or_clear_entry(Some(Entry::default()/* use setters */));
2067 /// let x = UpdateEntryRequest::new().set_or_clear_entry(None::<Entry>);
2068 /// ```
2069 pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
2070 where
2071 T: std::convert::Into<crate::model::Entry>,
2072 {
2073 self.entry = v.map(|x| x.into());
2074 self
2075 }
2076
2077 /// Sets the value of [update_mask][crate::model::UpdateEntryRequest::update_mask].
2078 ///
2079 /// # Example
2080 /// ```ignore,no_run
2081 /// # use google_cloud_datacatalog_v1::model::UpdateEntryRequest;
2082 /// use wkt::FieldMask;
2083 /// let x = UpdateEntryRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2084 /// ```
2085 pub fn set_update_mask<T>(mut self, v: T) -> Self
2086 where
2087 T: std::convert::Into<wkt::FieldMask>,
2088 {
2089 self.update_mask = std::option::Option::Some(v.into());
2090 self
2091 }
2092
2093 /// Sets or clears the value of [update_mask][crate::model::UpdateEntryRequest::update_mask].
2094 ///
2095 /// # Example
2096 /// ```ignore,no_run
2097 /// # use google_cloud_datacatalog_v1::model::UpdateEntryRequest;
2098 /// use wkt::FieldMask;
2099 /// let x = UpdateEntryRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2100 /// let x = UpdateEntryRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2101 /// ```
2102 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2103 where
2104 T: std::convert::Into<wkt::FieldMask>,
2105 {
2106 self.update_mask = v.map(|x| x.into());
2107 self
2108 }
2109}
2110
2111impl wkt::message::Message for UpdateEntryRequest {
2112 fn typename() -> &'static str {
2113 "type.googleapis.com/google.cloud.datacatalog.v1.UpdateEntryRequest"
2114 }
2115}
2116
2117/// Request message for
2118/// [DeleteEntry][google.cloud.datacatalog.v1.DataCatalog.DeleteEntry].
2119///
2120/// [google.cloud.datacatalog.v1.DataCatalog.DeleteEntry]: crate::client::DataCatalog::delete_entry
2121#[derive(Clone, Default, PartialEq)]
2122#[non_exhaustive]
2123pub struct DeleteEntryRequest {
2124 /// Required. The name of the entry to delete.
2125 pub name: std::string::String,
2126
2127 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2128}
2129
2130impl DeleteEntryRequest {
2131 pub fn new() -> Self {
2132 std::default::Default::default()
2133 }
2134
2135 /// Sets the value of [name][crate::model::DeleteEntryRequest::name].
2136 ///
2137 /// # Example
2138 /// ```ignore,no_run
2139 /// # use google_cloud_datacatalog_v1::model::DeleteEntryRequest;
2140 /// let x = DeleteEntryRequest::new().set_name("example");
2141 /// ```
2142 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2143 self.name = v.into();
2144 self
2145 }
2146}
2147
2148impl wkt::message::Message for DeleteEntryRequest {
2149 fn typename() -> &'static str {
2150 "type.googleapis.com/google.cloud.datacatalog.v1.DeleteEntryRequest"
2151 }
2152}
2153
2154/// Request message for
2155/// [GetEntry][google.cloud.datacatalog.v1.DataCatalog.GetEntry].
2156///
2157/// [google.cloud.datacatalog.v1.DataCatalog.GetEntry]: crate::client::DataCatalog::get_entry
2158#[derive(Clone, Default, PartialEq)]
2159#[non_exhaustive]
2160pub struct GetEntryRequest {
2161 /// Required. The name of the entry to get.
2162 pub name: std::string::String,
2163
2164 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2165}
2166
2167impl GetEntryRequest {
2168 pub fn new() -> Self {
2169 std::default::Default::default()
2170 }
2171
2172 /// Sets the value of [name][crate::model::GetEntryRequest::name].
2173 ///
2174 /// # Example
2175 /// ```ignore,no_run
2176 /// # use google_cloud_datacatalog_v1::model::GetEntryRequest;
2177 /// let x = GetEntryRequest::new().set_name("example");
2178 /// ```
2179 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2180 self.name = v.into();
2181 self
2182 }
2183}
2184
2185impl wkt::message::Message for GetEntryRequest {
2186 fn typename() -> &'static str {
2187 "type.googleapis.com/google.cloud.datacatalog.v1.GetEntryRequest"
2188 }
2189}
2190
2191/// Request message for
2192/// [LookupEntry][google.cloud.datacatalog.v1.DataCatalog.LookupEntry].
2193///
2194/// [google.cloud.datacatalog.v1.DataCatalog.LookupEntry]: crate::client::DataCatalog::lookup_entry
2195#[derive(Clone, Default, PartialEq)]
2196#[non_exhaustive]
2197pub struct LookupEntryRequest {
2198 /// Project where the lookup should be performed. Required to lookup
2199 /// entry that is not a part of `DPMS` or `DATAPLEX` `integrated_system`
2200 /// using its `fully_qualified_name`. Ignored in other cases.
2201 pub project: std::string::String,
2202
2203 /// Location where the lookup should be performed. Required to lookup
2204 /// entry that is not a part of `DPMS` or `DATAPLEX` `integrated_system`
2205 /// using its `fully_qualified_name`. Ignored in other cases.
2206 pub location: std::string::String,
2207
2208 /// Required. A full name, SQL name, or a fully qualified name of a
2209 /// Google Cloud Platform resource.
2210 pub target_name: std::option::Option<crate::model::lookup_entry_request::TargetName>,
2211
2212 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2213}
2214
2215impl LookupEntryRequest {
2216 pub fn new() -> Self {
2217 std::default::Default::default()
2218 }
2219
2220 /// Sets the value of [project][crate::model::LookupEntryRequest::project].
2221 ///
2222 /// # Example
2223 /// ```ignore,no_run
2224 /// # use google_cloud_datacatalog_v1::model::LookupEntryRequest;
2225 /// let x = LookupEntryRequest::new().set_project("example");
2226 /// ```
2227 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2228 self.project = v.into();
2229 self
2230 }
2231
2232 /// Sets the value of [location][crate::model::LookupEntryRequest::location].
2233 ///
2234 /// # Example
2235 /// ```ignore,no_run
2236 /// # use google_cloud_datacatalog_v1::model::LookupEntryRequest;
2237 /// let x = LookupEntryRequest::new().set_location("example");
2238 /// ```
2239 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2240 self.location = v.into();
2241 self
2242 }
2243
2244 /// Sets the value of [target_name][crate::model::LookupEntryRequest::target_name].
2245 ///
2246 /// Note that all the setters affecting `target_name` are mutually
2247 /// exclusive.
2248 ///
2249 /// # Example
2250 /// ```ignore,no_run
2251 /// # use google_cloud_datacatalog_v1::model::LookupEntryRequest;
2252 /// use google_cloud_datacatalog_v1::model::lookup_entry_request::TargetName;
2253 /// let x = LookupEntryRequest::new().set_target_name(Some(TargetName::LinkedResource("example".to_string())));
2254 /// ```
2255 pub fn set_target_name<
2256 T: std::convert::Into<std::option::Option<crate::model::lookup_entry_request::TargetName>>,
2257 >(
2258 mut self,
2259 v: T,
2260 ) -> Self {
2261 self.target_name = v.into();
2262 self
2263 }
2264
2265 /// The value of [target_name][crate::model::LookupEntryRequest::target_name]
2266 /// if it holds a `LinkedResource`, `None` if the field is not set or
2267 /// holds a different branch.
2268 pub fn linked_resource(&self) -> std::option::Option<&std::string::String> {
2269 #[allow(unreachable_patterns)]
2270 self.target_name.as_ref().and_then(|v| match v {
2271 crate::model::lookup_entry_request::TargetName::LinkedResource(v) => {
2272 std::option::Option::Some(v)
2273 }
2274 _ => std::option::Option::None,
2275 })
2276 }
2277
2278 /// Sets the value of [target_name][crate::model::LookupEntryRequest::target_name]
2279 /// to hold a `LinkedResource`.
2280 ///
2281 /// Note that all the setters affecting `target_name` are
2282 /// mutually exclusive.
2283 ///
2284 /// # Example
2285 /// ```ignore,no_run
2286 /// # use google_cloud_datacatalog_v1::model::LookupEntryRequest;
2287 /// let x = LookupEntryRequest::new().set_linked_resource("example");
2288 /// assert!(x.linked_resource().is_some());
2289 /// assert!(x.sql_resource().is_none());
2290 /// assert!(x.fully_qualified_name().is_none());
2291 /// ```
2292 pub fn set_linked_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2293 self.target_name = std::option::Option::Some(
2294 crate::model::lookup_entry_request::TargetName::LinkedResource(v.into()),
2295 );
2296 self
2297 }
2298
2299 /// The value of [target_name][crate::model::LookupEntryRequest::target_name]
2300 /// if it holds a `SqlResource`, `None` if the field is not set or
2301 /// holds a different branch.
2302 pub fn sql_resource(&self) -> std::option::Option<&std::string::String> {
2303 #[allow(unreachable_patterns)]
2304 self.target_name.as_ref().and_then(|v| match v {
2305 crate::model::lookup_entry_request::TargetName::SqlResource(v) => {
2306 std::option::Option::Some(v)
2307 }
2308 _ => std::option::Option::None,
2309 })
2310 }
2311
2312 /// Sets the value of [target_name][crate::model::LookupEntryRequest::target_name]
2313 /// to hold a `SqlResource`.
2314 ///
2315 /// Note that all the setters affecting `target_name` are
2316 /// mutually exclusive.
2317 ///
2318 /// # Example
2319 /// ```ignore,no_run
2320 /// # use google_cloud_datacatalog_v1::model::LookupEntryRequest;
2321 /// let x = LookupEntryRequest::new().set_sql_resource("example");
2322 /// assert!(x.sql_resource().is_some());
2323 /// assert!(x.linked_resource().is_none());
2324 /// assert!(x.fully_qualified_name().is_none());
2325 /// ```
2326 pub fn set_sql_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2327 self.target_name = std::option::Option::Some(
2328 crate::model::lookup_entry_request::TargetName::SqlResource(v.into()),
2329 );
2330 self
2331 }
2332
2333 /// The value of [target_name][crate::model::LookupEntryRequest::target_name]
2334 /// if it holds a `FullyQualifiedName`, `None` if the field is not set or
2335 /// holds a different branch.
2336 pub fn fully_qualified_name(&self) -> std::option::Option<&std::string::String> {
2337 #[allow(unreachable_patterns)]
2338 self.target_name.as_ref().and_then(|v| match v {
2339 crate::model::lookup_entry_request::TargetName::FullyQualifiedName(v) => {
2340 std::option::Option::Some(v)
2341 }
2342 _ => std::option::Option::None,
2343 })
2344 }
2345
2346 /// Sets the value of [target_name][crate::model::LookupEntryRequest::target_name]
2347 /// to hold a `FullyQualifiedName`.
2348 ///
2349 /// Note that all the setters affecting `target_name` are
2350 /// mutually exclusive.
2351 ///
2352 /// # Example
2353 /// ```ignore,no_run
2354 /// # use google_cloud_datacatalog_v1::model::LookupEntryRequest;
2355 /// let x = LookupEntryRequest::new().set_fully_qualified_name("example");
2356 /// assert!(x.fully_qualified_name().is_some());
2357 /// assert!(x.linked_resource().is_none());
2358 /// assert!(x.sql_resource().is_none());
2359 /// ```
2360 pub fn set_fully_qualified_name<T: std::convert::Into<std::string::String>>(
2361 mut self,
2362 v: T,
2363 ) -> Self {
2364 self.target_name = std::option::Option::Some(
2365 crate::model::lookup_entry_request::TargetName::FullyQualifiedName(v.into()),
2366 );
2367 self
2368 }
2369}
2370
2371impl wkt::message::Message for LookupEntryRequest {
2372 fn typename() -> &'static str {
2373 "type.googleapis.com/google.cloud.datacatalog.v1.LookupEntryRequest"
2374 }
2375}
2376
2377/// Defines additional types related to [LookupEntryRequest].
2378pub mod lookup_entry_request {
2379 #[allow(unused_imports)]
2380 use super::*;
2381
2382 /// Required. A full name, SQL name, or a fully qualified name of a
2383 /// Google Cloud Platform resource.
2384 #[derive(Clone, Debug, PartialEq)]
2385 #[non_exhaustive]
2386 pub enum TargetName {
2387 /// The full name of the Google Cloud Platform resource the Data Catalog
2388 /// entry represents. For more information, see [Full Resource Name]
2389 /// (<https://cloud.google.com/apis/design/resource_names#full_resource_name>).
2390 ///
2391 /// Full names are case-sensitive. For example:
2392 ///
2393 /// * `//bigquery.googleapis.com/projects/{PROJECT_ID}/datasets/{DATASET_ID}/tables/{TABLE_ID}`
2394 /// * `//pubsub.googleapis.com/projects/{PROJECT_ID}/topics/{TOPIC_ID}`
2395 LinkedResource(std::string::String),
2396 /// The SQL name of the entry. SQL names are case-sensitive.
2397 ///
2398 /// Examples:
2399 ///
2400 /// * `pubsub.topic.{PROJECT_ID}.{TOPIC_ID}`
2401 /// * `pubsub.topic.{PROJECT_ID}.`\``{TOPIC.ID.SEPARATED.WITH.DOTS}`\`
2402 /// * `bigquery.table.{PROJECT_ID}.{DATASET_ID}.{TABLE_ID}`
2403 /// * `bigquery.dataset.{PROJECT_ID}.{DATASET_ID}`
2404 /// * `datacatalog.entry.{PROJECT_ID}.{LOCATION_ID}.{ENTRY_GROUP_ID}.{ENTRY_ID}`
2405 ///
2406 /// Identifiers (`*_ID`) should comply with the
2407 /// [Lexical structure in GoogleSQL]
2408 /// (<https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical>).
2409 SqlResource(std::string::String),
2410 /// [Fully Qualified Name
2411 /// (FQN)](https://cloud.google.com//data-catalog/docs/fully-qualified-names)
2412 /// of the resource.
2413 ///
2414 /// FQNs take two forms:
2415 ///
2416 /// * For non-regionalized resources:
2417 ///
2418 /// `{SYSTEM}:{PROJECT}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}`
2419 ///
2420 /// * For regionalized resources:
2421 ///
2422 /// `{SYSTEM}:{PROJECT}.{LOCATION_ID}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}`
2423 ///
2424 ///
2425 /// Example for a DPMS table:
2426 ///
2427 /// `dataproc_metastore:{PROJECT_ID}.{LOCATION_ID}.{INSTANCE_ID}.{DATABASE_ID}.{TABLE_ID}`
2428 FullyQualifiedName(std::string::String),
2429 }
2430}
2431
2432/// Entry metadata.
2433/// A Data Catalog entry represents another resource in Google
2434/// Cloud Platform (such as a BigQuery dataset or a Pub/Sub topic) or
2435/// outside of it. You can use the `linked_resource` field
2436/// in the entry resource to refer to the original resource ID of the source
2437/// system.
2438///
2439/// An entry resource contains resource details, for example, its schema.
2440/// Additionally, you can attach flexible metadata to an entry in the form of a
2441/// [Tag][google.cloud.datacatalog.v1.Tag].
2442///
2443/// [google.cloud.datacatalog.v1.Tag]: crate::model::Tag
2444#[derive(Clone, Default, PartialEq)]
2445#[non_exhaustive]
2446pub struct Entry {
2447 /// Output only. Identifier. The resource name of an entry in URL format.
2448 ///
2449 /// Note: The entry itself and its child resources might not be
2450 /// stored in the location specified in its name.
2451 pub name: std::string::String,
2452
2453 /// The resource this metadata entry refers to.
2454 ///
2455 /// For Google Cloud Platform resources, `linked_resource` is the
2456 /// [Full Resource Name]
2457 /// (<https://cloud.google.com/apis/design/resource_names#full_resource_name>).
2458 /// For example, the `linked_resource` for a table resource from BigQuery is:
2459 ///
2460 /// `//bigquery.googleapis.com/projects/{PROJECT_ID}/datasets/{DATASET_ID}/tables/{TABLE_ID}`
2461 ///
2462 /// Output only when the entry is one of the types in the `EntryType` enum.
2463 ///
2464 /// For entries with a `user_specified_type`, this field is optional and
2465 /// defaults to an empty string.
2466 ///
2467 /// The resource string must contain only letters (a-z, A-Z), numbers (0-9),
2468 /// underscores (_), periods (.), colons (:), slashes (/), dashes (-),
2469 /// and hashes (#).
2470 /// The maximum size is 200 bytes when encoded in UTF-8.
2471 pub linked_resource: std::string::String,
2472
2473 /// [Fully Qualified Name
2474 /// (FQN)](https://cloud.google.com//data-catalog/docs/fully-qualified-names)
2475 /// of the resource. Set automatically for entries representing resources from
2476 /// synced systems. Settable only during creation, and read-only later. Can
2477 /// be used for search and lookup of the entries.
2478 pub fully_qualified_name: std::string::String,
2479
2480 /// Display name of an entry.
2481 ///
2482 /// The maximum size is 500 bytes when encoded in UTF-8.
2483 /// Default value is an empty string.
2484 pub display_name: std::string::String,
2485
2486 /// Entry description that can consist of several sentences or paragraphs
2487 /// that describe entry contents.
2488 ///
2489 /// The description must not contain Unicode non-characters as well as C0
2490 /// and C1 control codes except tabs (HT), new lines (LF), carriage returns
2491 /// (CR), and page breaks (FF).
2492 /// The maximum size is 2000 bytes when encoded in UTF-8.
2493 /// Default value is an empty string.
2494 pub description: std::string::String,
2495
2496 /// Business Context of the entry. Not supported for BigQuery datasets
2497 pub business_context: std::option::Option<crate::model::BusinessContext>,
2498
2499 /// Schema of the entry. An entry might not have any schema attached to it.
2500 pub schema: std::option::Option<crate::model::Schema>,
2501
2502 /// Timestamps from the underlying resource, not from the Data Catalog
2503 /// entry.
2504 ///
2505 /// Output only when the entry has a system listed in the `IntegratedSystem`
2506 /// enum. For entries with `user_specified_system`, this field is optional
2507 /// and defaults to an empty timestamp.
2508 pub source_system_timestamps: std::option::Option<crate::model::SystemTimestamps>,
2509
2510 /// Resource usage statistics.
2511 pub usage_signal: std::option::Option<crate::model::UsageSignal>,
2512
2513 /// Cloud labels attached to the entry.
2514 ///
2515 /// In Data Catalog, you can create and modify labels attached only to custom
2516 /// entries. Synced entries have unmodifiable labels that come from the source
2517 /// system.
2518 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2519
2520 /// Output only. Physical location of the entry.
2521 pub data_source: std::option::Option<crate::model::DataSource>,
2522
2523 /// Output only. Additional information related to the entry. Private to the
2524 /// current user.
2525 pub personal_details: std::option::Option<crate::model::PersonalDetails>,
2526
2527 /// Required. Entry type.
2528 pub entry_type: std::option::Option<crate::model::entry::EntryType>,
2529
2530 /// The source system of the entry.
2531 pub system: std::option::Option<crate::model::entry::System>,
2532
2533 /// System specification.
2534 /// Can be used as a complement for `spec`, when some metadata is relevant for
2535 /// all entries existing within given system
2536 pub system_spec: std::option::Option<crate::model::entry::SystemSpec>,
2537
2538 /// Type specification.
2539 pub type_spec: std::option::Option<crate::model::entry::TypeSpec>,
2540
2541 /// Type- and system-specific information. Specifications for types contain
2542 /// fields common to all entries of a given type, and sub-specifications with
2543 /// fields specific to a given source system.
2544 ///
2545 /// When extending the API with new types and systems, use this field instead
2546 /// of the legacy `type_spec`.
2547 pub spec: std::option::Option<crate::model::entry::Spec>,
2548
2549 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2550}
2551
2552impl Entry {
2553 pub fn new() -> Self {
2554 std::default::Default::default()
2555 }
2556
2557 /// Sets the value of [name][crate::model::Entry::name].
2558 ///
2559 /// # Example
2560 /// ```ignore,no_run
2561 /// # use google_cloud_datacatalog_v1::model::Entry;
2562 /// let x = Entry::new().set_name("example");
2563 /// ```
2564 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2565 self.name = v.into();
2566 self
2567 }
2568
2569 /// Sets the value of [linked_resource][crate::model::Entry::linked_resource].
2570 ///
2571 /// # Example
2572 /// ```ignore,no_run
2573 /// # use google_cloud_datacatalog_v1::model::Entry;
2574 /// let x = Entry::new().set_linked_resource("example");
2575 /// ```
2576 pub fn set_linked_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2577 self.linked_resource = v.into();
2578 self
2579 }
2580
2581 /// Sets the value of [fully_qualified_name][crate::model::Entry::fully_qualified_name].
2582 ///
2583 /// # Example
2584 /// ```ignore,no_run
2585 /// # use google_cloud_datacatalog_v1::model::Entry;
2586 /// let x = Entry::new().set_fully_qualified_name("example");
2587 /// ```
2588 pub fn set_fully_qualified_name<T: std::convert::Into<std::string::String>>(
2589 mut self,
2590 v: T,
2591 ) -> Self {
2592 self.fully_qualified_name = v.into();
2593 self
2594 }
2595
2596 /// Sets the value of [display_name][crate::model::Entry::display_name].
2597 ///
2598 /// # Example
2599 /// ```ignore,no_run
2600 /// # use google_cloud_datacatalog_v1::model::Entry;
2601 /// let x = Entry::new().set_display_name("example");
2602 /// ```
2603 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2604 self.display_name = v.into();
2605 self
2606 }
2607
2608 /// Sets the value of [description][crate::model::Entry::description].
2609 ///
2610 /// # Example
2611 /// ```ignore,no_run
2612 /// # use google_cloud_datacatalog_v1::model::Entry;
2613 /// let x = Entry::new().set_description("example");
2614 /// ```
2615 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2616 self.description = v.into();
2617 self
2618 }
2619
2620 /// Sets the value of [business_context][crate::model::Entry::business_context].
2621 ///
2622 /// # Example
2623 /// ```ignore,no_run
2624 /// # use google_cloud_datacatalog_v1::model::Entry;
2625 /// use google_cloud_datacatalog_v1::model::BusinessContext;
2626 /// let x = Entry::new().set_business_context(BusinessContext::default()/* use setters */);
2627 /// ```
2628 pub fn set_business_context<T>(mut self, v: T) -> Self
2629 where
2630 T: std::convert::Into<crate::model::BusinessContext>,
2631 {
2632 self.business_context = std::option::Option::Some(v.into());
2633 self
2634 }
2635
2636 /// Sets or clears the value of [business_context][crate::model::Entry::business_context].
2637 ///
2638 /// # Example
2639 /// ```ignore,no_run
2640 /// # use google_cloud_datacatalog_v1::model::Entry;
2641 /// use google_cloud_datacatalog_v1::model::BusinessContext;
2642 /// let x = Entry::new().set_or_clear_business_context(Some(BusinessContext::default()/* use setters */));
2643 /// let x = Entry::new().set_or_clear_business_context(None::<BusinessContext>);
2644 /// ```
2645 pub fn set_or_clear_business_context<T>(mut self, v: std::option::Option<T>) -> Self
2646 where
2647 T: std::convert::Into<crate::model::BusinessContext>,
2648 {
2649 self.business_context = v.map(|x| x.into());
2650 self
2651 }
2652
2653 /// Sets the value of [schema][crate::model::Entry::schema].
2654 ///
2655 /// # Example
2656 /// ```ignore,no_run
2657 /// # use google_cloud_datacatalog_v1::model::Entry;
2658 /// use google_cloud_datacatalog_v1::model::Schema;
2659 /// let x = Entry::new().set_schema(Schema::default()/* use setters */);
2660 /// ```
2661 pub fn set_schema<T>(mut self, v: T) -> Self
2662 where
2663 T: std::convert::Into<crate::model::Schema>,
2664 {
2665 self.schema = std::option::Option::Some(v.into());
2666 self
2667 }
2668
2669 /// Sets or clears the value of [schema][crate::model::Entry::schema].
2670 ///
2671 /// # Example
2672 /// ```ignore,no_run
2673 /// # use google_cloud_datacatalog_v1::model::Entry;
2674 /// use google_cloud_datacatalog_v1::model::Schema;
2675 /// let x = Entry::new().set_or_clear_schema(Some(Schema::default()/* use setters */));
2676 /// let x = Entry::new().set_or_clear_schema(None::<Schema>);
2677 /// ```
2678 pub fn set_or_clear_schema<T>(mut self, v: std::option::Option<T>) -> Self
2679 where
2680 T: std::convert::Into<crate::model::Schema>,
2681 {
2682 self.schema = v.map(|x| x.into());
2683 self
2684 }
2685
2686 /// Sets the value of [source_system_timestamps][crate::model::Entry::source_system_timestamps].
2687 ///
2688 /// # Example
2689 /// ```ignore,no_run
2690 /// # use google_cloud_datacatalog_v1::model::Entry;
2691 /// use google_cloud_datacatalog_v1::model::SystemTimestamps;
2692 /// let x = Entry::new().set_source_system_timestamps(SystemTimestamps::default()/* use setters */);
2693 /// ```
2694 pub fn set_source_system_timestamps<T>(mut self, v: T) -> Self
2695 where
2696 T: std::convert::Into<crate::model::SystemTimestamps>,
2697 {
2698 self.source_system_timestamps = std::option::Option::Some(v.into());
2699 self
2700 }
2701
2702 /// Sets or clears the value of [source_system_timestamps][crate::model::Entry::source_system_timestamps].
2703 ///
2704 /// # Example
2705 /// ```ignore,no_run
2706 /// # use google_cloud_datacatalog_v1::model::Entry;
2707 /// use google_cloud_datacatalog_v1::model::SystemTimestamps;
2708 /// let x = Entry::new().set_or_clear_source_system_timestamps(Some(SystemTimestamps::default()/* use setters */));
2709 /// let x = Entry::new().set_or_clear_source_system_timestamps(None::<SystemTimestamps>);
2710 /// ```
2711 pub fn set_or_clear_source_system_timestamps<T>(mut self, v: std::option::Option<T>) -> Self
2712 where
2713 T: std::convert::Into<crate::model::SystemTimestamps>,
2714 {
2715 self.source_system_timestamps = v.map(|x| x.into());
2716 self
2717 }
2718
2719 /// Sets the value of [usage_signal][crate::model::Entry::usage_signal].
2720 ///
2721 /// # Example
2722 /// ```ignore,no_run
2723 /// # use google_cloud_datacatalog_v1::model::Entry;
2724 /// use google_cloud_datacatalog_v1::model::UsageSignal;
2725 /// let x = Entry::new().set_usage_signal(UsageSignal::default()/* use setters */);
2726 /// ```
2727 pub fn set_usage_signal<T>(mut self, v: T) -> Self
2728 where
2729 T: std::convert::Into<crate::model::UsageSignal>,
2730 {
2731 self.usage_signal = std::option::Option::Some(v.into());
2732 self
2733 }
2734
2735 /// Sets or clears the value of [usage_signal][crate::model::Entry::usage_signal].
2736 ///
2737 /// # Example
2738 /// ```ignore,no_run
2739 /// # use google_cloud_datacatalog_v1::model::Entry;
2740 /// use google_cloud_datacatalog_v1::model::UsageSignal;
2741 /// let x = Entry::new().set_or_clear_usage_signal(Some(UsageSignal::default()/* use setters */));
2742 /// let x = Entry::new().set_or_clear_usage_signal(None::<UsageSignal>);
2743 /// ```
2744 pub fn set_or_clear_usage_signal<T>(mut self, v: std::option::Option<T>) -> Self
2745 where
2746 T: std::convert::Into<crate::model::UsageSignal>,
2747 {
2748 self.usage_signal = v.map(|x| x.into());
2749 self
2750 }
2751
2752 /// Sets the value of [labels][crate::model::Entry::labels].
2753 ///
2754 /// # Example
2755 /// ```ignore,no_run
2756 /// # use google_cloud_datacatalog_v1::model::Entry;
2757 /// let x = Entry::new().set_labels([
2758 /// ("key0", "abc"),
2759 /// ("key1", "xyz"),
2760 /// ]);
2761 /// ```
2762 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2763 where
2764 T: std::iter::IntoIterator<Item = (K, V)>,
2765 K: std::convert::Into<std::string::String>,
2766 V: std::convert::Into<std::string::String>,
2767 {
2768 use std::iter::Iterator;
2769 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2770 self
2771 }
2772
2773 /// Sets the value of [data_source][crate::model::Entry::data_source].
2774 ///
2775 /// # Example
2776 /// ```ignore,no_run
2777 /// # use google_cloud_datacatalog_v1::model::Entry;
2778 /// use google_cloud_datacatalog_v1::model::DataSource;
2779 /// let x = Entry::new().set_data_source(DataSource::default()/* use setters */);
2780 /// ```
2781 pub fn set_data_source<T>(mut self, v: T) -> Self
2782 where
2783 T: std::convert::Into<crate::model::DataSource>,
2784 {
2785 self.data_source = std::option::Option::Some(v.into());
2786 self
2787 }
2788
2789 /// Sets or clears the value of [data_source][crate::model::Entry::data_source].
2790 ///
2791 /// # Example
2792 /// ```ignore,no_run
2793 /// # use google_cloud_datacatalog_v1::model::Entry;
2794 /// use google_cloud_datacatalog_v1::model::DataSource;
2795 /// let x = Entry::new().set_or_clear_data_source(Some(DataSource::default()/* use setters */));
2796 /// let x = Entry::new().set_or_clear_data_source(None::<DataSource>);
2797 /// ```
2798 pub fn set_or_clear_data_source<T>(mut self, v: std::option::Option<T>) -> Self
2799 where
2800 T: std::convert::Into<crate::model::DataSource>,
2801 {
2802 self.data_source = v.map(|x| x.into());
2803 self
2804 }
2805
2806 /// Sets the value of [personal_details][crate::model::Entry::personal_details].
2807 ///
2808 /// # Example
2809 /// ```ignore,no_run
2810 /// # use google_cloud_datacatalog_v1::model::Entry;
2811 /// use google_cloud_datacatalog_v1::model::PersonalDetails;
2812 /// let x = Entry::new().set_personal_details(PersonalDetails::default()/* use setters */);
2813 /// ```
2814 pub fn set_personal_details<T>(mut self, v: T) -> Self
2815 where
2816 T: std::convert::Into<crate::model::PersonalDetails>,
2817 {
2818 self.personal_details = std::option::Option::Some(v.into());
2819 self
2820 }
2821
2822 /// Sets or clears the value of [personal_details][crate::model::Entry::personal_details].
2823 ///
2824 /// # Example
2825 /// ```ignore,no_run
2826 /// # use google_cloud_datacatalog_v1::model::Entry;
2827 /// use google_cloud_datacatalog_v1::model::PersonalDetails;
2828 /// let x = Entry::new().set_or_clear_personal_details(Some(PersonalDetails::default()/* use setters */));
2829 /// let x = Entry::new().set_or_clear_personal_details(None::<PersonalDetails>);
2830 /// ```
2831 pub fn set_or_clear_personal_details<T>(mut self, v: std::option::Option<T>) -> Self
2832 where
2833 T: std::convert::Into<crate::model::PersonalDetails>,
2834 {
2835 self.personal_details = v.map(|x| x.into());
2836 self
2837 }
2838
2839 /// Sets the value of [entry_type][crate::model::Entry::entry_type].
2840 ///
2841 /// Note that all the setters affecting `entry_type` are mutually
2842 /// exclusive.
2843 ///
2844 /// # Example
2845 /// ```ignore,no_run
2846 /// # use google_cloud_datacatalog_v1::model::Entry;
2847 /// use google_cloud_datacatalog_v1::model::EntryType;
2848 /// let x0 = Entry::new().set_entry_type(Some(
2849 /// google_cloud_datacatalog_v1::model::entry::EntryType::Type(EntryType::Table)));
2850 /// let x1 = Entry::new().set_entry_type(Some(
2851 /// google_cloud_datacatalog_v1::model::entry::EntryType::Type(EntryType::Model)));
2852 /// let x2 = Entry::new().set_entry_type(Some(
2853 /// google_cloud_datacatalog_v1::model::entry::EntryType::Type(EntryType::DataStream)));
2854 /// ```
2855 pub fn set_entry_type<
2856 T: std::convert::Into<std::option::Option<crate::model::entry::EntryType>>,
2857 >(
2858 mut self,
2859 v: T,
2860 ) -> Self {
2861 self.entry_type = v.into();
2862 self
2863 }
2864
2865 /// The value of [entry_type][crate::model::Entry::entry_type]
2866 /// if it holds a `Type`, `None` if the field is not set or
2867 /// holds a different branch.
2868 pub fn r#type(&self) -> std::option::Option<&crate::model::EntryType> {
2869 #[allow(unreachable_patterns)]
2870 self.entry_type.as_ref().and_then(|v| match v {
2871 crate::model::entry::EntryType::Type(v) => std::option::Option::Some(v),
2872 _ => std::option::Option::None,
2873 })
2874 }
2875
2876 /// Sets the value of [entry_type][crate::model::Entry::entry_type]
2877 /// to hold a `Type`.
2878 ///
2879 /// Note that all the setters affecting `entry_type` are
2880 /// mutually exclusive.
2881 ///
2882 /// # Example
2883 /// ```ignore,no_run
2884 /// # use google_cloud_datacatalog_v1::model::Entry;
2885 /// use google_cloud_datacatalog_v1::model::EntryType;
2886 /// let x0 = Entry::new().set_type(EntryType::Table);
2887 /// let x1 = Entry::new().set_type(EntryType::Model);
2888 /// let x2 = Entry::new().set_type(EntryType::DataStream);
2889 /// assert!(x0.r#type().is_some());
2890 /// assert!(x0.user_specified_type().is_none());
2891 /// assert!(x1.r#type().is_some());
2892 /// assert!(x1.user_specified_type().is_none());
2893 /// assert!(x2.r#type().is_some());
2894 /// assert!(x2.user_specified_type().is_none());
2895 /// ```
2896 pub fn set_type<T: std::convert::Into<crate::model::EntryType>>(mut self, v: T) -> Self {
2897 self.entry_type = std::option::Option::Some(crate::model::entry::EntryType::Type(v.into()));
2898 self
2899 }
2900
2901 /// The value of [entry_type][crate::model::Entry::entry_type]
2902 /// if it holds a `UserSpecifiedType`, `None` if the field is not set or
2903 /// holds a different branch.
2904 pub fn user_specified_type(&self) -> std::option::Option<&std::string::String> {
2905 #[allow(unreachable_patterns)]
2906 self.entry_type.as_ref().and_then(|v| match v {
2907 crate::model::entry::EntryType::UserSpecifiedType(v) => std::option::Option::Some(v),
2908 _ => std::option::Option::None,
2909 })
2910 }
2911
2912 /// Sets the value of [entry_type][crate::model::Entry::entry_type]
2913 /// to hold a `UserSpecifiedType`.
2914 ///
2915 /// Note that all the setters affecting `entry_type` are
2916 /// mutually exclusive.
2917 ///
2918 /// # Example
2919 /// ```ignore,no_run
2920 /// # use google_cloud_datacatalog_v1::model::Entry;
2921 /// let x = Entry::new().set_user_specified_type("example");
2922 /// assert!(x.user_specified_type().is_some());
2923 /// assert!(x.r#type().is_none());
2924 /// ```
2925 pub fn set_user_specified_type<T: std::convert::Into<std::string::String>>(
2926 mut self,
2927 v: T,
2928 ) -> Self {
2929 self.entry_type =
2930 std::option::Option::Some(crate::model::entry::EntryType::UserSpecifiedType(v.into()));
2931 self
2932 }
2933
2934 /// Sets the value of [system][crate::model::Entry::system].
2935 ///
2936 /// Note that all the setters affecting `system` are mutually
2937 /// exclusive.
2938 ///
2939 /// # Example
2940 /// ```ignore,no_run
2941 /// # use google_cloud_datacatalog_v1::model::Entry;
2942 /// use google_cloud_datacatalog_v1::model::IntegratedSystem;
2943 /// let x0 = Entry::new().set_system(Some(
2944 /// google_cloud_datacatalog_v1::model::entry::System::IntegratedSystem(IntegratedSystem::Bigquery)));
2945 /// let x1 = Entry::new().set_system(Some(
2946 /// google_cloud_datacatalog_v1::model::entry::System::IntegratedSystem(IntegratedSystem::CloudPubsub)));
2947 /// let x2 = Entry::new().set_system(Some(
2948 /// google_cloud_datacatalog_v1::model::entry::System::IntegratedSystem(IntegratedSystem::DataprocMetastore)));
2949 /// ```
2950 pub fn set_system<T: std::convert::Into<std::option::Option<crate::model::entry::System>>>(
2951 mut self,
2952 v: T,
2953 ) -> Self {
2954 self.system = v.into();
2955 self
2956 }
2957
2958 /// The value of [system][crate::model::Entry::system]
2959 /// if it holds a `IntegratedSystem`, `None` if the field is not set or
2960 /// holds a different branch.
2961 pub fn integrated_system(&self) -> std::option::Option<&crate::model::IntegratedSystem> {
2962 #[allow(unreachable_patterns)]
2963 self.system.as_ref().and_then(|v| match v {
2964 crate::model::entry::System::IntegratedSystem(v) => std::option::Option::Some(v),
2965 _ => std::option::Option::None,
2966 })
2967 }
2968
2969 /// Sets the value of [system][crate::model::Entry::system]
2970 /// to hold a `IntegratedSystem`.
2971 ///
2972 /// Note that all the setters affecting `system` are
2973 /// mutually exclusive.
2974 ///
2975 /// # Example
2976 /// ```ignore,no_run
2977 /// # use google_cloud_datacatalog_v1::model::Entry;
2978 /// use google_cloud_datacatalog_v1::model::IntegratedSystem;
2979 /// let x0 = Entry::new().set_integrated_system(IntegratedSystem::Bigquery);
2980 /// let x1 = Entry::new().set_integrated_system(IntegratedSystem::CloudPubsub);
2981 /// let x2 = Entry::new().set_integrated_system(IntegratedSystem::DataprocMetastore);
2982 /// assert!(x0.integrated_system().is_some());
2983 /// assert!(x0.user_specified_system().is_none());
2984 /// assert!(x1.integrated_system().is_some());
2985 /// assert!(x1.user_specified_system().is_none());
2986 /// assert!(x2.integrated_system().is_some());
2987 /// assert!(x2.user_specified_system().is_none());
2988 /// ```
2989 pub fn set_integrated_system<T: std::convert::Into<crate::model::IntegratedSystem>>(
2990 mut self,
2991 v: T,
2992 ) -> Self {
2993 self.system =
2994 std::option::Option::Some(crate::model::entry::System::IntegratedSystem(v.into()));
2995 self
2996 }
2997
2998 /// The value of [system][crate::model::Entry::system]
2999 /// if it holds a `UserSpecifiedSystem`, `None` if the field is not set or
3000 /// holds a different branch.
3001 pub fn user_specified_system(&self) -> std::option::Option<&std::string::String> {
3002 #[allow(unreachable_patterns)]
3003 self.system.as_ref().and_then(|v| match v {
3004 crate::model::entry::System::UserSpecifiedSystem(v) => std::option::Option::Some(v),
3005 _ => std::option::Option::None,
3006 })
3007 }
3008
3009 /// Sets the value of [system][crate::model::Entry::system]
3010 /// to hold a `UserSpecifiedSystem`.
3011 ///
3012 /// Note that all the setters affecting `system` are
3013 /// mutually exclusive.
3014 ///
3015 /// # Example
3016 /// ```ignore,no_run
3017 /// # use google_cloud_datacatalog_v1::model::Entry;
3018 /// let x = Entry::new().set_user_specified_system("example");
3019 /// assert!(x.user_specified_system().is_some());
3020 /// assert!(x.integrated_system().is_none());
3021 /// ```
3022 pub fn set_user_specified_system<T: std::convert::Into<std::string::String>>(
3023 mut self,
3024 v: T,
3025 ) -> Self {
3026 self.system =
3027 std::option::Option::Some(crate::model::entry::System::UserSpecifiedSystem(v.into()));
3028 self
3029 }
3030
3031 /// Sets the value of [system_spec][crate::model::Entry::system_spec].
3032 ///
3033 /// Note that all the setters affecting `system_spec` are mutually
3034 /// exclusive.
3035 ///
3036 /// # Example
3037 /// ```ignore,no_run
3038 /// # use google_cloud_datacatalog_v1::model::Entry;
3039 /// use google_cloud_datacatalog_v1::model::SqlDatabaseSystemSpec;
3040 /// let x = Entry::new().set_system_spec(Some(
3041 /// google_cloud_datacatalog_v1::model::entry::SystemSpec::SqlDatabaseSystemSpec(SqlDatabaseSystemSpec::default().into())));
3042 /// ```
3043 pub fn set_system_spec<
3044 T: std::convert::Into<std::option::Option<crate::model::entry::SystemSpec>>,
3045 >(
3046 mut self,
3047 v: T,
3048 ) -> Self {
3049 self.system_spec = v.into();
3050 self
3051 }
3052
3053 /// The value of [system_spec][crate::model::Entry::system_spec]
3054 /// if it holds a `SqlDatabaseSystemSpec`, `None` if the field is not set or
3055 /// holds a different branch.
3056 pub fn sql_database_system_spec(
3057 &self,
3058 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlDatabaseSystemSpec>> {
3059 #[allow(unreachable_patterns)]
3060 self.system_spec.as_ref().and_then(|v| match v {
3061 crate::model::entry::SystemSpec::SqlDatabaseSystemSpec(v) => {
3062 std::option::Option::Some(v)
3063 }
3064 _ => std::option::Option::None,
3065 })
3066 }
3067
3068 /// Sets the value of [system_spec][crate::model::Entry::system_spec]
3069 /// to hold a `SqlDatabaseSystemSpec`.
3070 ///
3071 /// Note that all the setters affecting `system_spec` are
3072 /// mutually exclusive.
3073 ///
3074 /// # Example
3075 /// ```ignore,no_run
3076 /// # use google_cloud_datacatalog_v1::model::Entry;
3077 /// use google_cloud_datacatalog_v1::model::SqlDatabaseSystemSpec;
3078 /// let x = Entry::new().set_sql_database_system_spec(SqlDatabaseSystemSpec::default()/* use setters */);
3079 /// assert!(x.sql_database_system_spec().is_some());
3080 /// assert!(x.looker_system_spec().is_none());
3081 /// assert!(x.cloud_bigtable_system_spec().is_none());
3082 /// ```
3083 pub fn set_sql_database_system_spec<
3084 T: std::convert::Into<std::boxed::Box<crate::model::SqlDatabaseSystemSpec>>,
3085 >(
3086 mut self,
3087 v: T,
3088 ) -> Self {
3089 self.system_spec = std::option::Option::Some(
3090 crate::model::entry::SystemSpec::SqlDatabaseSystemSpec(v.into()),
3091 );
3092 self
3093 }
3094
3095 /// The value of [system_spec][crate::model::Entry::system_spec]
3096 /// if it holds a `LookerSystemSpec`, `None` if the field is not set or
3097 /// holds a different branch.
3098 pub fn looker_system_spec(
3099 &self,
3100 ) -> std::option::Option<&std::boxed::Box<crate::model::LookerSystemSpec>> {
3101 #[allow(unreachable_patterns)]
3102 self.system_spec.as_ref().and_then(|v| match v {
3103 crate::model::entry::SystemSpec::LookerSystemSpec(v) => std::option::Option::Some(v),
3104 _ => std::option::Option::None,
3105 })
3106 }
3107
3108 /// Sets the value of [system_spec][crate::model::Entry::system_spec]
3109 /// to hold a `LookerSystemSpec`.
3110 ///
3111 /// Note that all the setters affecting `system_spec` are
3112 /// mutually exclusive.
3113 ///
3114 /// # Example
3115 /// ```ignore,no_run
3116 /// # use google_cloud_datacatalog_v1::model::Entry;
3117 /// use google_cloud_datacatalog_v1::model::LookerSystemSpec;
3118 /// let x = Entry::new().set_looker_system_spec(LookerSystemSpec::default()/* use setters */);
3119 /// assert!(x.looker_system_spec().is_some());
3120 /// assert!(x.sql_database_system_spec().is_none());
3121 /// assert!(x.cloud_bigtable_system_spec().is_none());
3122 /// ```
3123 pub fn set_looker_system_spec<
3124 T: std::convert::Into<std::boxed::Box<crate::model::LookerSystemSpec>>,
3125 >(
3126 mut self,
3127 v: T,
3128 ) -> Self {
3129 self.system_spec =
3130 std::option::Option::Some(crate::model::entry::SystemSpec::LookerSystemSpec(v.into()));
3131 self
3132 }
3133
3134 /// The value of [system_spec][crate::model::Entry::system_spec]
3135 /// if it holds a `CloudBigtableSystemSpec`, `None` if the field is not set or
3136 /// holds a different branch.
3137 pub fn cloud_bigtable_system_spec(
3138 &self,
3139 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudBigtableSystemSpec>> {
3140 #[allow(unreachable_patterns)]
3141 self.system_spec.as_ref().and_then(|v| match v {
3142 crate::model::entry::SystemSpec::CloudBigtableSystemSpec(v) => {
3143 std::option::Option::Some(v)
3144 }
3145 _ => std::option::Option::None,
3146 })
3147 }
3148
3149 /// Sets the value of [system_spec][crate::model::Entry::system_spec]
3150 /// to hold a `CloudBigtableSystemSpec`.
3151 ///
3152 /// Note that all the setters affecting `system_spec` are
3153 /// mutually exclusive.
3154 ///
3155 /// # Example
3156 /// ```ignore,no_run
3157 /// # use google_cloud_datacatalog_v1::model::Entry;
3158 /// use google_cloud_datacatalog_v1::model::CloudBigtableSystemSpec;
3159 /// let x = Entry::new().set_cloud_bigtable_system_spec(CloudBigtableSystemSpec::default()/* use setters */);
3160 /// assert!(x.cloud_bigtable_system_spec().is_some());
3161 /// assert!(x.sql_database_system_spec().is_none());
3162 /// assert!(x.looker_system_spec().is_none());
3163 /// ```
3164 pub fn set_cloud_bigtable_system_spec<
3165 T: std::convert::Into<std::boxed::Box<crate::model::CloudBigtableSystemSpec>>,
3166 >(
3167 mut self,
3168 v: T,
3169 ) -> Self {
3170 self.system_spec = std::option::Option::Some(
3171 crate::model::entry::SystemSpec::CloudBigtableSystemSpec(v.into()),
3172 );
3173 self
3174 }
3175
3176 /// Sets the value of [type_spec][crate::model::Entry::type_spec].
3177 ///
3178 /// Note that all the setters affecting `type_spec` are mutually
3179 /// exclusive.
3180 ///
3181 /// # Example
3182 /// ```ignore,no_run
3183 /// # use google_cloud_datacatalog_v1::model::Entry;
3184 /// use google_cloud_datacatalog_v1::model::GcsFilesetSpec;
3185 /// let x = Entry::new().set_type_spec(Some(
3186 /// google_cloud_datacatalog_v1::model::entry::TypeSpec::GcsFilesetSpec(GcsFilesetSpec::default().into())));
3187 /// ```
3188 pub fn set_type_spec<
3189 T: std::convert::Into<std::option::Option<crate::model::entry::TypeSpec>>,
3190 >(
3191 mut self,
3192 v: T,
3193 ) -> Self {
3194 self.type_spec = v.into();
3195 self
3196 }
3197
3198 /// The value of [type_spec][crate::model::Entry::type_spec]
3199 /// if it holds a `GcsFilesetSpec`, `None` if the field is not set or
3200 /// holds a different branch.
3201 pub fn gcs_fileset_spec(
3202 &self,
3203 ) -> std::option::Option<&std::boxed::Box<crate::model::GcsFilesetSpec>> {
3204 #[allow(unreachable_patterns)]
3205 self.type_spec.as_ref().and_then(|v| match v {
3206 crate::model::entry::TypeSpec::GcsFilesetSpec(v) => std::option::Option::Some(v),
3207 _ => std::option::Option::None,
3208 })
3209 }
3210
3211 /// Sets the value of [type_spec][crate::model::Entry::type_spec]
3212 /// to hold a `GcsFilesetSpec`.
3213 ///
3214 /// Note that all the setters affecting `type_spec` are
3215 /// mutually exclusive.
3216 ///
3217 /// # Example
3218 /// ```ignore,no_run
3219 /// # use google_cloud_datacatalog_v1::model::Entry;
3220 /// use google_cloud_datacatalog_v1::model::GcsFilesetSpec;
3221 /// let x = Entry::new().set_gcs_fileset_spec(GcsFilesetSpec::default()/* use setters */);
3222 /// assert!(x.gcs_fileset_spec().is_some());
3223 /// assert!(x.bigquery_table_spec().is_none());
3224 /// assert!(x.bigquery_date_sharded_spec().is_none());
3225 /// ```
3226 pub fn set_gcs_fileset_spec<
3227 T: std::convert::Into<std::boxed::Box<crate::model::GcsFilesetSpec>>,
3228 >(
3229 mut self,
3230 v: T,
3231 ) -> Self {
3232 self.type_spec =
3233 std::option::Option::Some(crate::model::entry::TypeSpec::GcsFilesetSpec(v.into()));
3234 self
3235 }
3236
3237 /// The value of [type_spec][crate::model::Entry::type_spec]
3238 /// if it holds a `BigqueryTableSpec`, `None` if the field is not set or
3239 /// holds a different branch.
3240 pub fn bigquery_table_spec(
3241 &self,
3242 ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryTableSpec>> {
3243 #[allow(unreachable_patterns)]
3244 self.type_spec.as_ref().and_then(|v| match v {
3245 crate::model::entry::TypeSpec::BigqueryTableSpec(v) => std::option::Option::Some(v),
3246 _ => std::option::Option::None,
3247 })
3248 }
3249
3250 /// Sets the value of [type_spec][crate::model::Entry::type_spec]
3251 /// to hold a `BigqueryTableSpec`.
3252 ///
3253 /// Note that all the setters affecting `type_spec` are
3254 /// mutually exclusive.
3255 ///
3256 /// # Example
3257 /// ```ignore,no_run
3258 /// # use google_cloud_datacatalog_v1::model::Entry;
3259 /// use google_cloud_datacatalog_v1::model::BigQueryTableSpec;
3260 /// let x = Entry::new().set_bigquery_table_spec(BigQueryTableSpec::default()/* use setters */);
3261 /// assert!(x.bigquery_table_spec().is_some());
3262 /// assert!(x.gcs_fileset_spec().is_none());
3263 /// assert!(x.bigquery_date_sharded_spec().is_none());
3264 /// ```
3265 pub fn set_bigquery_table_spec<
3266 T: std::convert::Into<std::boxed::Box<crate::model::BigQueryTableSpec>>,
3267 >(
3268 mut self,
3269 v: T,
3270 ) -> Self {
3271 self.type_spec =
3272 std::option::Option::Some(crate::model::entry::TypeSpec::BigqueryTableSpec(v.into()));
3273 self
3274 }
3275
3276 /// The value of [type_spec][crate::model::Entry::type_spec]
3277 /// if it holds a `BigqueryDateShardedSpec`, `None` if the field is not set or
3278 /// holds a different branch.
3279 pub fn bigquery_date_sharded_spec(
3280 &self,
3281 ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryDateShardedSpec>> {
3282 #[allow(unreachable_patterns)]
3283 self.type_spec.as_ref().and_then(|v| match v {
3284 crate::model::entry::TypeSpec::BigqueryDateShardedSpec(v) => {
3285 std::option::Option::Some(v)
3286 }
3287 _ => std::option::Option::None,
3288 })
3289 }
3290
3291 /// Sets the value of [type_spec][crate::model::Entry::type_spec]
3292 /// to hold a `BigqueryDateShardedSpec`.
3293 ///
3294 /// Note that all the setters affecting `type_spec` are
3295 /// mutually exclusive.
3296 ///
3297 /// # Example
3298 /// ```ignore,no_run
3299 /// # use google_cloud_datacatalog_v1::model::Entry;
3300 /// use google_cloud_datacatalog_v1::model::BigQueryDateShardedSpec;
3301 /// let x = Entry::new().set_bigquery_date_sharded_spec(BigQueryDateShardedSpec::default()/* use setters */);
3302 /// assert!(x.bigquery_date_sharded_spec().is_some());
3303 /// assert!(x.gcs_fileset_spec().is_none());
3304 /// assert!(x.bigquery_table_spec().is_none());
3305 /// ```
3306 pub fn set_bigquery_date_sharded_spec<
3307 T: std::convert::Into<std::boxed::Box<crate::model::BigQueryDateShardedSpec>>,
3308 >(
3309 mut self,
3310 v: T,
3311 ) -> Self {
3312 self.type_spec = std::option::Option::Some(
3313 crate::model::entry::TypeSpec::BigqueryDateShardedSpec(v.into()),
3314 );
3315 self
3316 }
3317
3318 /// Sets the value of [spec][crate::model::Entry::spec].
3319 ///
3320 /// Note that all the setters affecting `spec` are mutually
3321 /// exclusive.
3322 ///
3323 /// # Example
3324 /// ```ignore,no_run
3325 /// # use google_cloud_datacatalog_v1::model::Entry;
3326 /// use google_cloud_datacatalog_v1::model::DatabaseTableSpec;
3327 /// let x = Entry::new().set_spec(Some(
3328 /// google_cloud_datacatalog_v1::model::entry::Spec::DatabaseTableSpec(DatabaseTableSpec::default().into())));
3329 /// ```
3330 pub fn set_spec<T: std::convert::Into<std::option::Option<crate::model::entry::Spec>>>(
3331 mut self,
3332 v: T,
3333 ) -> Self {
3334 self.spec = v.into();
3335 self
3336 }
3337
3338 /// The value of [spec][crate::model::Entry::spec]
3339 /// if it holds a `DatabaseTableSpec`, `None` if the field is not set or
3340 /// holds a different branch.
3341 pub fn database_table_spec(
3342 &self,
3343 ) -> std::option::Option<&std::boxed::Box<crate::model::DatabaseTableSpec>> {
3344 #[allow(unreachable_patterns)]
3345 self.spec.as_ref().and_then(|v| match v {
3346 crate::model::entry::Spec::DatabaseTableSpec(v) => std::option::Option::Some(v),
3347 _ => std::option::Option::None,
3348 })
3349 }
3350
3351 /// Sets the value of [spec][crate::model::Entry::spec]
3352 /// to hold a `DatabaseTableSpec`.
3353 ///
3354 /// Note that all the setters affecting `spec` are
3355 /// mutually exclusive.
3356 ///
3357 /// # Example
3358 /// ```ignore,no_run
3359 /// # use google_cloud_datacatalog_v1::model::Entry;
3360 /// use google_cloud_datacatalog_v1::model::DatabaseTableSpec;
3361 /// let x = Entry::new().set_database_table_spec(DatabaseTableSpec::default()/* use setters */);
3362 /// assert!(x.database_table_spec().is_some());
3363 /// assert!(x.data_source_connection_spec().is_none());
3364 /// assert!(x.routine_spec().is_none());
3365 /// assert!(x.dataset_spec().is_none());
3366 /// assert!(x.fileset_spec().is_none());
3367 /// assert!(x.service_spec().is_none());
3368 /// assert!(x.model_spec().is_none());
3369 /// assert!(x.feature_online_store_spec().is_none());
3370 /// ```
3371 pub fn set_database_table_spec<
3372 T: std::convert::Into<std::boxed::Box<crate::model::DatabaseTableSpec>>,
3373 >(
3374 mut self,
3375 v: T,
3376 ) -> Self {
3377 self.spec =
3378 std::option::Option::Some(crate::model::entry::Spec::DatabaseTableSpec(v.into()));
3379 self
3380 }
3381
3382 /// The value of [spec][crate::model::Entry::spec]
3383 /// if it holds a `DataSourceConnectionSpec`, `None` if the field is not set or
3384 /// holds a different branch.
3385 pub fn data_source_connection_spec(
3386 &self,
3387 ) -> std::option::Option<&std::boxed::Box<crate::model::DataSourceConnectionSpec>> {
3388 #[allow(unreachable_patterns)]
3389 self.spec.as_ref().and_then(|v| match v {
3390 crate::model::entry::Spec::DataSourceConnectionSpec(v) => std::option::Option::Some(v),
3391 _ => std::option::Option::None,
3392 })
3393 }
3394
3395 /// Sets the value of [spec][crate::model::Entry::spec]
3396 /// to hold a `DataSourceConnectionSpec`.
3397 ///
3398 /// Note that all the setters affecting `spec` are
3399 /// mutually exclusive.
3400 ///
3401 /// # Example
3402 /// ```ignore,no_run
3403 /// # use google_cloud_datacatalog_v1::model::Entry;
3404 /// use google_cloud_datacatalog_v1::model::DataSourceConnectionSpec;
3405 /// let x = Entry::new().set_data_source_connection_spec(DataSourceConnectionSpec::default()/* use setters */);
3406 /// assert!(x.data_source_connection_spec().is_some());
3407 /// assert!(x.database_table_spec().is_none());
3408 /// assert!(x.routine_spec().is_none());
3409 /// assert!(x.dataset_spec().is_none());
3410 /// assert!(x.fileset_spec().is_none());
3411 /// assert!(x.service_spec().is_none());
3412 /// assert!(x.model_spec().is_none());
3413 /// assert!(x.feature_online_store_spec().is_none());
3414 /// ```
3415 pub fn set_data_source_connection_spec<
3416 T: std::convert::Into<std::boxed::Box<crate::model::DataSourceConnectionSpec>>,
3417 >(
3418 mut self,
3419 v: T,
3420 ) -> Self {
3421 self.spec = std::option::Option::Some(crate::model::entry::Spec::DataSourceConnectionSpec(
3422 v.into(),
3423 ));
3424 self
3425 }
3426
3427 /// The value of [spec][crate::model::Entry::spec]
3428 /// if it holds a `RoutineSpec`, `None` if the field is not set or
3429 /// holds a different branch.
3430 pub fn routine_spec(&self) -> std::option::Option<&std::boxed::Box<crate::model::RoutineSpec>> {
3431 #[allow(unreachable_patterns)]
3432 self.spec.as_ref().and_then(|v| match v {
3433 crate::model::entry::Spec::RoutineSpec(v) => std::option::Option::Some(v),
3434 _ => std::option::Option::None,
3435 })
3436 }
3437
3438 /// Sets the value of [spec][crate::model::Entry::spec]
3439 /// to hold a `RoutineSpec`.
3440 ///
3441 /// Note that all the setters affecting `spec` are
3442 /// mutually exclusive.
3443 ///
3444 /// # Example
3445 /// ```ignore,no_run
3446 /// # use google_cloud_datacatalog_v1::model::Entry;
3447 /// use google_cloud_datacatalog_v1::model::RoutineSpec;
3448 /// let x = Entry::new().set_routine_spec(RoutineSpec::default()/* use setters */);
3449 /// assert!(x.routine_spec().is_some());
3450 /// assert!(x.database_table_spec().is_none());
3451 /// assert!(x.data_source_connection_spec().is_none());
3452 /// assert!(x.dataset_spec().is_none());
3453 /// assert!(x.fileset_spec().is_none());
3454 /// assert!(x.service_spec().is_none());
3455 /// assert!(x.model_spec().is_none());
3456 /// assert!(x.feature_online_store_spec().is_none());
3457 /// ```
3458 pub fn set_routine_spec<T: std::convert::Into<std::boxed::Box<crate::model::RoutineSpec>>>(
3459 mut self,
3460 v: T,
3461 ) -> Self {
3462 self.spec = std::option::Option::Some(crate::model::entry::Spec::RoutineSpec(v.into()));
3463 self
3464 }
3465
3466 /// The value of [spec][crate::model::Entry::spec]
3467 /// if it holds a `DatasetSpec`, `None` if the field is not set or
3468 /// holds a different branch.
3469 pub fn dataset_spec(&self) -> std::option::Option<&std::boxed::Box<crate::model::DatasetSpec>> {
3470 #[allow(unreachable_patterns)]
3471 self.spec.as_ref().and_then(|v| match v {
3472 crate::model::entry::Spec::DatasetSpec(v) => std::option::Option::Some(v),
3473 _ => std::option::Option::None,
3474 })
3475 }
3476
3477 /// Sets the value of [spec][crate::model::Entry::spec]
3478 /// to hold a `DatasetSpec`.
3479 ///
3480 /// Note that all the setters affecting `spec` are
3481 /// mutually exclusive.
3482 ///
3483 /// # Example
3484 /// ```ignore,no_run
3485 /// # use google_cloud_datacatalog_v1::model::Entry;
3486 /// use google_cloud_datacatalog_v1::model::DatasetSpec;
3487 /// let x = Entry::new().set_dataset_spec(DatasetSpec::default()/* use setters */);
3488 /// assert!(x.dataset_spec().is_some());
3489 /// assert!(x.database_table_spec().is_none());
3490 /// assert!(x.data_source_connection_spec().is_none());
3491 /// assert!(x.routine_spec().is_none());
3492 /// assert!(x.fileset_spec().is_none());
3493 /// assert!(x.service_spec().is_none());
3494 /// assert!(x.model_spec().is_none());
3495 /// assert!(x.feature_online_store_spec().is_none());
3496 /// ```
3497 pub fn set_dataset_spec<T: std::convert::Into<std::boxed::Box<crate::model::DatasetSpec>>>(
3498 mut self,
3499 v: T,
3500 ) -> Self {
3501 self.spec = std::option::Option::Some(crate::model::entry::Spec::DatasetSpec(v.into()));
3502 self
3503 }
3504
3505 /// The value of [spec][crate::model::Entry::spec]
3506 /// if it holds a `FilesetSpec`, `None` if the field is not set or
3507 /// holds a different branch.
3508 pub fn fileset_spec(&self) -> std::option::Option<&std::boxed::Box<crate::model::FilesetSpec>> {
3509 #[allow(unreachable_patterns)]
3510 self.spec.as_ref().and_then(|v| match v {
3511 crate::model::entry::Spec::FilesetSpec(v) => std::option::Option::Some(v),
3512 _ => std::option::Option::None,
3513 })
3514 }
3515
3516 /// Sets the value of [spec][crate::model::Entry::spec]
3517 /// to hold a `FilesetSpec`.
3518 ///
3519 /// Note that all the setters affecting `spec` are
3520 /// mutually exclusive.
3521 ///
3522 /// # Example
3523 /// ```ignore,no_run
3524 /// # use google_cloud_datacatalog_v1::model::Entry;
3525 /// use google_cloud_datacatalog_v1::model::FilesetSpec;
3526 /// let x = Entry::new().set_fileset_spec(FilesetSpec::default()/* use setters */);
3527 /// assert!(x.fileset_spec().is_some());
3528 /// assert!(x.database_table_spec().is_none());
3529 /// assert!(x.data_source_connection_spec().is_none());
3530 /// assert!(x.routine_spec().is_none());
3531 /// assert!(x.dataset_spec().is_none());
3532 /// assert!(x.service_spec().is_none());
3533 /// assert!(x.model_spec().is_none());
3534 /// assert!(x.feature_online_store_spec().is_none());
3535 /// ```
3536 pub fn set_fileset_spec<T: std::convert::Into<std::boxed::Box<crate::model::FilesetSpec>>>(
3537 mut self,
3538 v: T,
3539 ) -> Self {
3540 self.spec = std::option::Option::Some(crate::model::entry::Spec::FilesetSpec(v.into()));
3541 self
3542 }
3543
3544 /// The value of [spec][crate::model::Entry::spec]
3545 /// if it holds a `ServiceSpec`, `None` if the field is not set or
3546 /// holds a different branch.
3547 pub fn service_spec(&self) -> std::option::Option<&std::boxed::Box<crate::model::ServiceSpec>> {
3548 #[allow(unreachable_patterns)]
3549 self.spec.as_ref().and_then(|v| match v {
3550 crate::model::entry::Spec::ServiceSpec(v) => std::option::Option::Some(v),
3551 _ => std::option::Option::None,
3552 })
3553 }
3554
3555 /// Sets the value of [spec][crate::model::Entry::spec]
3556 /// to hold a `ServiceSpec`.
3557 ///
3558 /// Note that all the setters affecting `spec` are
3559 /// mutually exclusive.
3560 ///
3561 /// # Example
3562 /// ```ignore,no_run
3563 /// # use google_cloud_datacatalog_v1::model::Entry;
3564 /// use google_cloud_datacatalog_v1::model::ServiceSpec;
3565 /// let x = Entry::new().set_service_spec(ServiceSpec::default()/* use setters */);
3566 /// assert!(x.service_spec().is_some());
3567 /// assert!(x.database_table_spec().is_none());
3568 /// assert!(x.data_source_connection_spec().is_none());
3569 /// assert!(x.routine_spec().is_none());
3570 /// assert!(x.dataset_spec().is_none());
3571 /// assert!(x.fileset_spec().is_none());
3572 /// assert!(x.model_spec().is_none());
3573 /// assert!(x.feature_online_store_spec().is_none());
3574 /// ```
3575 pub fn set_service_spec<T: std::convert::Into<std::boxed::Box<crate::model::ServiceSpec>>>(
3576 mut self,
3577 v: T,
3578 ) -> Self {
3579 self.spec = std::option::Option::Some(crate::model::entry::Spec::ServiceSpec(v.into()));
3580 self
3581 }
3582
3583 /// The value of [spec][crate::model::Entry::spec]
3584 /// if it holds a `ModelSpec`, `None` if the field is not set or
3585 /// holds a different branch.
3586 pub fn model_spec(&self) -> std::option::Option<&std::boxed::Box<crate::model::ModelSpec>> {
3587 #[allow(unreachable_patterns)]
3588 self.spec.as_ref().and_then(|v| match v {
3589 crate::model::entry::Spec::ModelSpec(v) => std::option::Option::Some(v),
3590 _ => std::option::Option::None,
3591 })
3592 }
3593
3594 /// Sets the value of [spec][crate::model::Entry::spec]
3595 /// to hold a `ModelSpec`.
3596 ///
3597 /// Note that all the setters affecting `spec` are
3598 /// mutually exclusive.
3599 ///
3600 /// # Example
3601 /// ```ignore,no_run
3602 /// # use google_cloud_datacatalog_v1::model::Entry;
3603 /// use google_cloud_datacatalog_v1::model::ModelSpec;
3604 /// let x = Entry::new().set_model_spec(ModelSpec::default()/* use setters */);
3605 /// assert!(x.model_spec().is_some());
3606 /// assert!(x.database_table_spec().is_none());
3607 /// assert!(x.data_source_connection_spec().is_none());
3608 /// assert!(x.routine_spec().is_none());
3609 /// assert!(x.dataset_spec().is_none());
3610 /// assert!(x.fileset_spec().is_none());
3611 /// assert!(x.service_spec().is_none());
3612 /// assert!(x.feature_online_store_spec().is_none());
3613 /// ```
3614 pub fn set_model_spec<T: std::convert::Into<std::boxed::Box<crate::model::ModelSpec>>>(
3615 mut self,
3616 v: T,
3617 ) -> Self {
3618 self.spec = std::option::Option::Some(crate::model::entry::Spec::ModelSpec(v.into()));
3619 self
3620 }
3621
3622 /// The value of [spec][crate::model::Entry::spec]
3623 /// if it holds a `FeatureOnlineStoreSpec`, `None` if the field is not set or
3624 /// holds a different branch.
3625 pub fn feature_online_store_spec(
3626 &self,
3627 ) -> std::option::Option<&std::boxed::Box<crate::model::FeatureOnlineStoreSpec>> {
3628 #[allow(unreachable_patterns)]
3629 self.spec.as_ref().and_then(|v| match v {
3630 crate::model::entry::Spec::FeatureOnlineStoreSpec(v) => std::option::Option::Some(v),
3631 _ => std::option::Option::None,
3632 })
3633 }
3634
3635 /// Sets the value of [spec][crate::model::Entry::spec]
3636 /// to hold a `FeatureOnlineStoreSpec`.
3637 ///
3638 /// Note that all the setters affecting `spec` are
3639 /// mutually exclusive.
3640 ///
3641 /// # Example
3642 /// ```ignore,no_run
3643 /// # use google_cloud_datacatalog_v1::model::Entry;
3644 /// use google_cloud_datacatalog_v1::model::FeatureOnlineStoreSpec;
3645 /// let x = Entry::new().set_feature_online_store_spec(FeatureOnlineStoreSpec::default()/* use setters */);
3646 /// assert!(x.feature_online_store_spec().is_some());
3647 /// assert!(x.database_table_spec().is_none());
3648 /// assert!(x.data_source_connection_spec().is_none());
3649 /// assert!(x.routine_spec().is_none());
3650 /// assert!(x.dataset_spec().is_none());
3651 /// assert!(x.fileset_spec().is_none());
3652 /// assert!(x.service_spec().is_none());
3653 /// assert!(x.model_spec().is_none());
3654 /// ```
3655 pub fn set_feature_online_store_spec<
3656 T: std::convert::Into<std::boxed::Box<crate::model::FeatureOnlineStoreSpec>>,
3657 >(
3658 mut self,
3659 v: T,
3660 ) -> Self {
3661 self.spec =
3662 std::option::Option::Some(crate::model::entry::Spec::FeatureOnlineStoreSpec(v.into()));
3663 self
3664 }
3665}
3666
3667impl wkt::message::Message for Entry {
3668 fn typename() -> &'static str {
3669 "type.googleapis.com/google.cloud.datacatalog.v1.Entry"
3670 }
3671}
3672
3673/// Defines additional types related to [Entry].
3674pub mod entry {
3675 #[allow(unused_imports)]
3676 use super::*;
3677
3678 /// Required. Entry type.
3679 #[derive(Clone, Debug, PartialEq)]
3680 #[non_exhaustive]
3681 pub enum EntryType {
3682 /// The type of the entry.
3683 ///
3684 /// For details, see [`EntryType`](#entrytype).
3685 Type(crate::model::EntryType),
3686 /// Custom entry type that doesn't match any of the values allowed for input
3687 /// and listed in the `EntryType` enum.
3688 ///
3689 /// When creating an entry, first check the type values in the enum.
3690 /// If there are no appropriate types for the new entry,
3691 /// provide a custom value, for example, `my_special_type`.
3692 ///
3693 /// The `user_specified_type` string has the following limitations:
3694 ///
3695 /// * Is case insensitive.
3696 /// * Must begin with a letter or underscore.
3697 /// * Can only contain letters, numbers, and underscores.
3698 /// * Must be at least 1 character and at most 64 characters long.
3699 UserSpecifiedType(std::string::String),
3700 }
3701
3702 /// The source system of the entry.
3703 #[derive(Clone, Debug, PartialEq)]
3704 #[non_exhaustive]
3705 pub enum System {
3706 /// Output only. Indicates the entry's source system that Data Catalog
3707 /// integrates with, such as BigQuery, Pub/Sub, or Dataproc Metastore.
3708 IntegratedSystem(crate::model::IntegratedSystem),
3709 /// Indicates the entry's source system that Data Catalog doesn't
3710 /// automatically integrate with.
3711 ///
3712 /// The `user_specified_system` string has the following limitations:
3713 ///
3714 /// * Is case insensitive.
3715 /// * Must begin with a letter or underscore.
3716 /// * Can only contain letters, numbers, and underscores.
3717 /// * Must be at least 1 character and at most 64 characters long.
3718 UserSpecifiedSystem(std::string::String),
3719 }
3720
3721 /// System specification.
3722 /// Can be used as a complement for `spec`, when some metadata is relevant for
3723 /// all entries existing within given system
3724 #[derive(Clone, Debug, PartialEq)]
3725 #[non_exhaustive]
3726 pub enum SystemSpec {
3727 /// Specification that applies to a relational database system. Only settable
3728 /// when `user_specified_system` is equal to `SQL_DATABASE`
3729 SqlDatabaseSystemSpec(std::boxed::Box<crate::model::SqlDatabaseSystemSpec>),
3730 /// Specification that applies to Looker sysstem. Only settable when
3731 /// `user_specified_system` is equal to `LOOKER`
3732 LookerSystemSpec(std::boxed::Box<crate::model::LookerSystemSpec>),
3733 /// Specification that applies to Cloud Bigtable system. Only settable when
3734 /// `integrated_system` is equal to `CLOUD_BIGTABLE`
3735 CloudBigtableSystemSpec(std::boxed::Box<crate::model::CloudBigtableSystemSpec>),
3736 }
3737
3738 /// Type specification.
3739 #[derive(Clone, Debug, PartialEq)]
3740 #[non_exhaustive]
3741 pub enum TypeSpec {
3742 /// Specification that applies to a Cloud Storage fileset. Valid only
3743 /// for entries with the `FILESET` type.
3744 GcsFilesetSpec(std::boxed::Box<crate::model::GcsFilesetSpec>),
3745 /// Output only. Specification that applies to a BigQuery table. Valid only
3746 /// for entries with the `TABLE` type.
3747 BigqueryTableSpec(std::boxed::Box<crate::model::BigQueryTableSpec>),
3748 /// Output only. Specification for a group of BigQuery tables with
3749 /// the `[prefix]YYYYMMDD` name pattern.
3750 ///
3751 /// For more information, see [Introduction to partitioned tables]
3752 /// (<https://cloud.google.com/bigquery/docs/partitioned-tables#partitioning_versus_sharding>).
3753 BigqueryDateShardedSpec(std::boxed::Box<crate::model::BigQueryDateShardedSpec>),
3754 }
3755
3756 /// Type- and system-specific information. Specifications for types contain
3757 /// fields common to all entries of a given type, and sub-specifications with
3758 /// fields specific to a given source system.
3759 ///
3760 /// When extending the API with new types and systems, use this field instead
3761 /// of the legacy `type_spec`.
3762 #[derive(Clone, Debug, PartialEq)]
3763 #[non_exhaustive]
3764 pub enum Spec {
3765 /// Specification that applies to a table resource. Valid only
3766 /// for entries with the `TABLE` or `EXPLORE` type.
3767 DatabaseTableSpec(std::boxed::Box<crate::model::DatabaseTableSpec>),
3768 /// Specification that applies to a data source connection. Valid only
3769 /// for entries with the `DATA_SOURCE_CONNECTION` type.
3770 DataSourceConnectionSpec(std::boxed::Box<crate::model::DataSourceConnectionSpec>),
3771 /// Specification that applies to a user-defined function or procedure. Valid
3772 /// only for entries with the `ROUTINE` type.
3773 RoutineSpec(std::boxed::Box<crate::model::RoutineSpec>),
3774 /// Specification that applies to a dataset.
3775 DatasetSpec(std::boxed::Box<crate::model::DatasetSpec>),
3776 /// Specification that applies to a fileset resource. Valid only
3777 /// for entries with the `FILESET` type.
3778 FilesetSpec(std::boxed::Box<crate::model::FilesetSpec>),
3779 /// Specification that applies to a Service resource.
3780 ServiceSpec(std::boxed::Box<crate::model::ServiceSpec>),
3781 /// Model specification.
3782 ModelSpec(std::boxed::Box<crate::model::ModelSpec>),
3783 /// FeatureonlineStore spec for Vertex AI Feature Store.
3784 FeatureOnlineStoreSpec(std::boxed::Box<crate::model::FeatureOnlineStoreSpec>),
3785 }
3786}
3787
3788/// Specification that applies to a table resource. Valid only
3789/// for entries with the `TABLE` type.
3790#[derive(Clone, Default, PartialEq)]
3791#[non_exhaustive]
3792pub struct DatabaseTableSpec {
3793 /// Type of this table.
3794 pub r#type: crate::model::database_table_spec::TableType,
3795
3796 /// Output only. Fields specific to a Dataplex table and present only in the
3797 /// Dataplex table entries.
3798 pub dataplex_table: std::option::Option<crate::model::DataplexTableSpec>,
3799
3800 /// Spec what applies to tables that are actually views.
3801 /// Not set for "real" tables.
3802 pub database_view_spec:
3803 std::option::Option<crate::model::database_table_spec::DatabaseViewSpec>,
3804
3805 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3806}
3807
3808impl DatabaseTableSpec {
3809 pub fn new() -> Self {
3810 std::default::Default::default()
3811 }
3812
3813 /// Sets the value of [r#type][crate::model::DatabaseTableSpec::type].
3814 ///
3815 /// # Example
3816 /// ```ignore,no_run
3817 /// # use google_cloud_datacatalog_v1::model::DatabaseTableSpec;
3818 /// use google_cloud_datacatalog_v1::model::database_table_spec::TableType;
3819 /// let x0 = DatabaseTableSpec::new().set_type(TableType::Native);
3820 /// let x1 = DatabaseTableSpec::new().set_type(TableType::External);
3821 /// ```
3822 pub fn set_type<T: std::convert::Into<crate::model::database_table_spec::TableType>>(
3823 mut self,
3824 v: T,
3825 ) -> Self {
3826 self.r#type = v.into();
3827 self
3828 }
3829
3830 /// Sets the value of [dataplex_table][crate::model::DatabaseTableSpec::dataplex_table].
3831 ///
3832 /// # Example
3833 /// ```ignore,no_run
3834 /// # use google_cloud_datacatalog_v1::model::DatabaseTableSpec;
3835 /// use google_cloud_datacatalog_v1::model::DataplexTableSpec;
3836 /// let x = DatabaseTableSpec::new().set_dataplex_table(DataplexTableSpec::default()/* use setters */);
3837 /// ```
3838 pub fn set_dataplex_table<T>(mut self, v: T) -> Self
3839 where
3840 T: std::convert::Into<crate::model::DataplexTableSpec>,
3841 {
3842 self.dataplex_table = std::option::Option::Some(v.into());
3843 self
3844 }
3845
3846 /// Sets or clears the value of [dataplex_table][crate::model::DatabaseTableSpec::dataplex_table].
3847 ///
3848 /// # Example
3849 /// ```ignore,no_run
3850 /// # use google_cloud_datacatalog_v1::model::DatabaseTableSpec;
3851 /// use google_cloud_datacatalog_v1::model::DataplexTableSpec;
3852 /// let x = DatabaseTableSpec::new().set_or_clear_dataplex_table(Some(DataplexTableSpec::default()/* use setters */));
3853 /// let x = DatabaseTableSpec::new().set_or_clear_dataplex_table(None::<DataplexTableSpec>);
3854 /// ```
3855 pub fn set_or_clear_dataplex_table<T>(mut self, v: std::option::Option<T>) -> Self
3856 where
3857 T: std::convert::Into<crate::model::DataplexTableSpec>,
3858 {
3859 self.dataplex_table = v.map(|x| x.into());
3860 self
3861 }
3862
3863 /// Sets the value of [database_view_spec][crate::model::DatabaseTableSpec::database_view_spec].
3864 ///
3865 /// # Example
3866 /// ```ignore,no_run
3867 /// # use google_cloud_datacatalog_v1::model::DatabaseTableSpec;
3868 /// use google_cloud_datacatalog_v1::model::database_table_spec::DatabaseViewSpec;
3869 /// let x = DatabaseTableSpec::new().set_database_view_spec(DatabaseViewSpec::default()/* use setters */);
3870 /// ```
3871 pub fn set_database_view_spec<T>(mut self, v: T) -> Self
3872 where
3873 T: std::convert::Into<crate::model::database_table_spec::DatabaseViewSpec>,
3874 {
3875 self.database_view_spec = std::option::Option::Some(v.into());
3876 self
3877 }
3878
3879 /// Sets or clears the value of [database_view_spec][crate::model::DatabaseTableSpec::database_view_spec].
3880 ///
3881 /// # Example
3882 /// ```ignore,no_run
3883 /// # use google_cloud_datacatalog_v1::model::DatabaseTableSpec;
3884 /// use google_cloud_datacatalog_v1::model::database_table_spec::DatabaseViewSpec;
3885 /// let x = DatabaseTableSpec::new().set_or_clear_database_view_spec(Some(DatabaseViewSpec::default()/* use setters */));
3886 /// let x = DatabaseTableSpec::new().set_or_clear_database_view_spec(None::<DatabaseViewSpec>);
3887 /// ```
3888 pub fn set_or_clear_database_view_spec<T>(mut self, v: std::option::Option<T>) -> Self
3889 where
3890 T: std::convert::Into<crate::model::database_table_spec::DatabaseViewSpec>,
3891 {
3892 self.database_view_spec = v.map(|x| x.into());
3893 self
3894 }
3895}
3896
3897impl wkt::message::Message for DatabaseTableSpec {
3898 fn typename() -> &'static str {
3899 "type.googleapis.com/google.cloud.datacatalog.v1.DatabaseTableSpec"
3900 }
3901}
3902
3903/// Defines additional types related to [DatabaseTableSpec].
3904pub mod database_table_spec {
3905 #[allow(unused_imports)]
3906 use super::*;
3907
3908 /// Specification that applies to database view.
3909 #[derive(Clone, Default, PartialEq)]
3910 #[non_exhaustive]
3911 pub struct DatabaseViewSpec {
3912 /// Type of this view.
3913 pub view_type: crate::model::database_table_spec::database_view_spec::ViewType,
3914
3915 /// Definition of the view.
3916 pub source_definition: std::option::Option<
3917 crate::model::database_table_spec::database_view_spec::SourceDefinition,
3918 >,
3919
3920 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3921 }
3922
3923 impl DatabaseViewSpec {
3924 pub fn new() -> Self {
3925 std::default::Default::default()
3926 }
3927
3928 /// Sets the value of [view_type][crate::model::database_table_spec::DatabaseViewSpec::view_type].
3929 ///
3930 /// # Example
3931 /// ```ignore,no_run
3932 /// # use google_cloud_datacatalog_v1::model::database_table_spec::DatabaseViewSpec;
3933 /// use google_cloud_datacatalog_v1::model::database_table_spec::database_view_spec::ViewType;
3934 /// let x0 = DatabaseViewSpec::new().set_view_type(ViewType::StandardView);
3935 /// let x1 = DatabaseViewSpec::new().set_view_type(ViewType::MaterializedView);
3936 /// ```
3937 pub fn set_view_type<
3938 T: std::convert::Into<crate::model::database_table_spec::database_view_spec::ViewType>,
3939 >(
3940 mut self,
3941 v: T,
3942 ) -> Self {
3943 self.view_type = v.into();
3944 self
3945 }
3946
3947 /// Sets the value of [source_definition][crate::model::database_table_spec::DatabaseViewSpec::source_definition].
3948 ///
3949 /// Note that all the setters affecting `source_definition` are mutually
3950 /// exclusive.
3951 ///
3952 /// # Example
3953 /// ```ignore,no_run
3954 /// # use google_cloud_datacatalog_v1::model::database_table_spec::DatabaseViewSpec;
3955 /// use google_cloud_datacatalog_v1::model::database_table_spec::database_view_spec::SourceDefinition;
3956 /// let x = DatabaseViewSpec::new().set_source_definition(Some(SourceDefinition::BaseTable("example".to_string())));
3957 /// ```
3958 pub fn set_source_definition<
3959 T: std::convert::Into<
3960 std::option::Option<
3961 crate::model::database_table_spec::database_view_spec::SourceDefinition,
3962 >,
3963 >,
3964 >(
3965 mut self,
3966 v: T,
3967 ) -> Self {
3968 self.source_definition = v.into();
3969 self
3970 }
3971
3972 /// The value of [source_definition][crate::model::database_table_spec::DatabaseViewSpec::source_definition]
3973 /// if it holds a `BaseTable`, `None` if the field is not set or
3974 /// holds a different branch.
3975 pub fn base_table(&self) -> std::option::Option<&std::string::String> {
3976 #[allow(unreachable_patterns)]
3977 self.source_definition.as_ref().and_then(|v| match v {
3978 crate::model::database_table_spec::database_view_spec::SourceDefinition::BaseTable(v) => std::option::Option::Some(v),
3979 _ => std::option::Option::None,
3980 })
3981 }
3982
3983 /// Sets the value of [source_definition][crate::model::database_table_spec::DatabaseViewSpec::source_definition]
3984 /// to hold a `BaseTable`.
3985 ///
3986 /// Note that all the setters affecting `source_definition` are
3987 /// mutually exclusive.
3988 ///
3989 /// # Example
3990 /// ```ignore,no_run
3991 /// # use google_cloud_datacatalog_v1::model::database_table_spec::DatabaseViewSpec;
3992 /// let x = DatabaseViewSpec::new().set_base_table("example");
3993 /// assert!(x.base_table().is_some());
3994 /// assert!(x.sql_query().is_none());
3995 /// ```
3996 pub fn set_base_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3997 self.source_definition = std::option::Option::Some(
3998 crate::model::database_table_spec::database_view_spec::SourceDefinition::BaseTable(
3999 v.into(),
4000 ),
4001 );
4002 self
4003 }
4004
4005 /// The value of [source_definition][crate::model::database_table_spec::DatabaseViewSpec::source_definition]
4006 /// if it holds a `SqlQuery`, `None` if the field is not set or
4007 /// holds a different branch.
4008 pub fn sql_query(&self) -> std::option::Option<&std::string::String> {
4009 #[allow(unreachable_patterns)]
4010 self.source_definition.as_ref().and_then(|v| match v {
4011 crate::model::database_table_spec::database_view_spec::SourceDefinition::SqlQuery(v) => std::option::Option::Some(v),
4012 _ => std::option::Option::None,
4013 })
4014 }
4015
4016 /// Sets the value of [source_definition][crate::model::database_table_spec::DatabaseViewSpec::source_definition]
4017 /// to hold a `SqlQuery`.
4018 ///
4019 /// Note that all the setters affecting `source_definition` are
4020 /// mutually exclusive.
4021 ///
4022 /// # Example
4023 /// ```ignore,no_run
4024 /// # use google_cloud_datacatalog_v1::model::database_table_spec::DatabaseViewSpec;
4025 /// let x = DatabaseViewSpec::new().set_sql_query("example");
4026 /// assert!(x.sql_query().is_some());
4027 /// assert!(x.base_table().is_none());
4028 /// ```
4029 pub fn set_sql_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4030 self.source_definition = std::option::Option::Some(
4031 crate::model::database_table_spec::database_view_spec::SourceDefinition::SqlQuery(
4032 v.into(),
4033 ),
4034 );
4035 self
4036 }
4037 }
4038
4039 impl wkt::message::Message for DatabaseViewSpec {
4040 fn typename() -> &'static str {
4041 "type.googleapis.com/google.cloud.datacatalog.v1.DatabaseTableSpec.DatabaseViewSpec"
4042 }
4043 }
4044
4045 /// Defines additional types related to [DatabaseViewSpec].
4046 pub mod database_view_spec {
4047 #[allow(unused_imports)]
4048 use super::*;
4049
4050 /// Concrete type of the view.
4051 ///
4052 /// # Working with unknown values
4053 ///
4054 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4055 /// additional enum variants at any time. Adding new variants is not considered
4056 /// a breaking change. Applications should write their code in anticipation of:
4057 ///
4058 /// - New values appearing in future releases of the client library, **and**
4059 /// - New values received dynamically, without application changes.
4060 ///
4061 /// Please consult the [Working with enums] section in the user guide for some
4062 /// guidelines.
4063 ///
4064 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4065 #[derive(Clone, Debug, PartialEq)]
4066 #[non_exhaustive]
4067 pub enum ViewType {
4068 /// Default unknown view type.
4069 Unspecified,
4070 /// Standard view.
4071 StandardView,
4072 /// Materialized view.
4073 MaterializedView,
4074 /// If set, the enum was initialized with an unknown value.
4075 ///
4076 /// Applications can examine the value using [ViewType::value] or
4077 /// [ViewType::name].
4078 UnknownValue(view_type::UnknownValue),
4079 }
4080
4081 #[doc(hidden)]
4082 pub mod view_type {
4083 #[allow(unused_imports)]
4084 use super::*;
4085 #[derive(Clone, Debug, PartialEq)]
4086 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4087 }
4088
4089 impl ViewType {
4090 /// Gets the enum value.
4091 ///
4092 /// Returns `None` if the enum contains an unknown value deserialized from
4093 /// the string representation of enums.
4094 pub fn value(&self) -> std::option::Option<i32> {
4095 match self {
4096 Self::Unspecified => std::option::Option::Some(0),
4097 Self::StandardView => std::option::Option::Some(1),
4098 Self::MaterializedView => std::option::Option::Some(2),
4099 Self::UnknownValue(u) => u.0.value(),
4100 }
4101 }
4102
4103 /// Gets the enum value as a string.
4104 ///
4105 /// Returns `None` if the enum contains an unknown value deserialized from
4106 /// the integer representation of enums.
4107 pub fn name(&self) -> std::option::Option<&str> {
4108 match self {
4109 Self::Unspecified => std::option::Option::Some("VIEW_TYPE_UNSPECIFIED"),
4110 Self::StandardView => std::option::Option::Some("STANDARD_VIEW"),
4111 Self::MaterializedView => std::option::Option::Some("MATERIALIZED_VIEW"),
4112 Self::UnknownValue(u) => u.0.name(),
4113 }
4114 }
4115 }
4116
4117 impl std::default::Default for ViewType {
4118 fn default() -> Self {
4119 use std::convert::From;
4120 Self::from(0)
4121 }
4122 }
4123
4124 impl std::fmt::Display for ViewType {
4125 fn fmt(
4126 &self,
4127 f: &mut std::fmt::Formatter<'_>,
4128 ) -> std::result::Result<(), std::fmt::Error> {
4129 wkt::internal::display_enum(f, self.name(), self.value())
4130 }
4131 }
4132
4133 impl std::convert::From<i32> for ViewType {
4134 fn from(value: i32) -> Self {
4135 match value {
4136 0 => Self::Unspecified,
4137 1 => Self::StandardView,
4138 2 => Self::MaterializedView,
4139 _ => Self::UnknownValue(view_type::UnknownValue(
4140 wkt::internal::UnknownEnumValue::Integer(value),
4141 )),
4142 }
4143 }
4144 }
4145
4146 impl std::convert::From<&str> for ViewType {
4147 fn from(value: &str) -> Self {
4148 use std::string::ToString;
4149 match value {
4150 "VIEW_TYPE_UNSPECIFIED" => Self::Unspecified,
4151 "STANDARD_VIEW" => Self::StandardView,
4152 "MATERIALIZED_VIEW" => Self::MaterializedView,
4153 _ => Self::UnknownValue(view_type::UnknownValue(
4154 wkt::internal::UnknownEnumValue::String(value.to_string()),
4155 )),
4156 }
4157 }
4158 }
4159
4160 impl serde::ser::Serialize for ViewType {
4161 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4162 where
4163 S: serde::Serializer,
4164 {
4165 match self {
4166 Self::Unspecified => serializer.serialize_i32(0),
4167 Self::StandardView => serializer.serialize_i32(1),
4168 Self::MaterializedView => serializer.serialize_i32(2),
4169 Self::UnknownValue(u) => u.0.serialize(serializer),
4170 }
4171 }
4172 }
4173
4174 impl<'de> serde::de::Deserialize<'de> for ViewType {
4175 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4176 where
4177 D: serde::Deserializer<'de>,
4178 {
4179 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ViewType>::new(
4180 ".google.cloud.datacatalog.v1.DatabaseTableSpec.DatabaseViewSpec.ViewType",
4181 ))
4182 }
4183 }
4184
4185 /// Definition of the view.
4186 #[derive(Clone, Debug, PartialEq)]
4187 #[non_exhaustive]
4188 pub enum SourceDefinition {
4189 /// Name of a singular table this view reflects one to one.
4190 BaseTable(std::string::String),
4191 /// SQL query used to generate this view.
4192 SqlQuery(std::string::String),
4193 }
4194 }
4195
4196 /// Type of the table.
4197 ///
4198 /// # Working with unknown values
4199 ///
4200 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4201 /// additional enum variants at any time. Adding new variants is not considered
4202 /// a breaking change. Applications should write their code in anticipation of:
4203 ///
4204 /// - New values appearing in future releases of the client library, **and**
4205 /// - New values received dynamically, without application changes.
4206 ///
4207 /// Please consult the [Working with enums] section in the user guide for some
4208 /// guidelines.
4209 ///
4210 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4211 #[derive(Clone, Debug, PartialEq)]
4212 #[non_exhaustive]
4213 pub enum TableType {
4214 /// Default unknown table type.
4215 Unspecified,
4216 /// Native table.
4217 Native,
4218 /// External table.
4219 External,
4220 /// If set, the enum was initialized with an unknown value.
4221 ///
4222 /// Applications can examine the value using [TableType::value] or
4223 /// [TableType::name].
4224 UnknownValue(table_type::UnknownValue),
4225 }
4226
4227 #[doc(hidden)]
4228 pub mod table_type {
4229 #[allow(unused_imports)]
4230 use super::*;
4231 #[derive(Clone, Debug, PartialEq)]
4232 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4233 }
4234
4235 impl TableType {
4236 /// Gets the enum value.
4237 ///
4238 /// Returns `None` if the enum contains an unknown value deserialized from
4239 /// the string representation of enums.
4240 pub fn value(&self) -> std::option::Option<i32> {
4241 match self {
4242 Self::Unspecified => std::option::Option::Some(0),
4243 Self::Native => std::option::Option::Some(1),
4244 Self::External => std::option::Option::Some(2),
4245 Self::UnknownValue(u) => u.0.value(),
4246 }
4247 }
4248
4249 /// Gets the enum value as a string.
4250 ///
4251 /// Returns `None` if the enum contains an unknown value deserialized from
4252 /// the integer representation of enums.
4253 pub fn name(&self) -> std::option::Option<&str> {
4254 match self {
4255 Self::Unspecified => std::option::Option::Some("TABLE_TYPE_UNSPECIFIED"),
4256 Self::Native => std::option::Option::Some("NATIVE"),
4257 Self::External => std::option::Option::Some("EXTERNAL"),
4258 Self::UnknownValue(u) => u.0.name(),
4259 }
4260 }
4261 }
4262
4263 impl std::default::Default for TableType {
4264 fn default() -> Self {
4265 use std::convert::From;
4266 Self::from(0)
4267 }
4268 }
4269
4270 impl std::fmt::Display for TableType {
4271 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4272 wkt::internal::display_enum(f, self.name(), self.value())
4273 }
4274 }
4275
4276 impl std::convert::From<i32> for TableType {
4277 fn from(value: i32) -> Self {
4278 match value {
4279 0 => Self::Unspecified,
4280 1 => Self::Native,
4281 2 => Self::External,
4282 _ => Self::UnknownValue(table_type::UnknownValue(
4283 wkt::internal::UnknownEnumValue::Integer(value),
4284 )),
4285 }
4286 }
4287 }
4288
4289 impl std::convert::From<&str> for TableType {
4290 fn from(value: &str) -> Self {
4291 use std::string::ToString;
4292 match value {
4293 "TABLE_TYPE_UNSPECIFIED" => Self::Unspecified,
4294 "NATIVE" => Self::Native,
4295 "EXTERNAL" => Self::External,
4296 _ => Self::UnknownValue(table_type::UnknownValue(
4297 wkt::internal::UnknownEnumValue::String(value.to_string()),
4298 )),
4299 }
4300 }
4301 }
4302
4303 impl serde::ser::Serialize for TableType {
4304 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4305 where
4306 S: serde::Serializer,
4307 {
4308 match self {
4309 Self::Unspecified => serializer.serialize_i32(0),
4310 Self::Native => serializer.serialize_i32(1),
4311 Self::External => serializer.serialize_i32(2),
4312 Self::UnknownValue(u) => u.0.serialize(serializer),
4313 }
4314 }
4315 }
4316
4317 impl<'de> serde::de::Deserialize<'de> for TableType {
4318 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4319 where
4320 D: serde::Deserializer<'de>,
4321 {
4322 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TableType>::new(
4323 ".google.cloud.datacatalog.v1.DatabaseTableSpec.TableType",
4324 ))
4325 }
4326 }
4327}
4328
4329/// Specification that applies to a fileset. Valid only for entries with the
4330/// 'FILESET' type.
4331#[derive(Clone, Default, PartialEq)]
4332#[non_exhaustive]
4333pub struct FilesetSpec {
4334 /// Fields specific to a Dataplex fileset and present only in the Dataplex
4335 /// fileset entries.
4336 pub dataplex_fileset: std::option::Option<crate::model::DataplexFilesetSpec>,
4337
4338 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4339}
4340
4341impl FilesetSpec {
4342 pub fn new() -> Self {
4343 std::default::Default::default()
4344 }
4345
4346 /// Sets the value of [dataplex_fileset][crate::model::FilesetSpec::dataplex_fileset].
4347 ///
4348 /// # Example
4349 /// ```ignore,no_run
4350 /// # use google_cloud_datacatalog_v1::model::FilesetSpec;
4351 /// use google_cloud_datacatalog_v1::model::DataplexFilesetSpec;
4352 /// let x = FilesetSpec::new().set_dataplex_fileset(DataplexFilesetSpec::default()/* use setters */);
4353 /// ```
4354 pub fn set_dataplex_fileset<T>(mut self, v: T) -> Self
4355 where
4356 T: std::convert::Into<crate::model::DataplexFilesetSpec>,
4357 {
4358 self.dataplex_fileset = std::option::Option::Some(v.into());
4359 self
4360 }
4361
4362 /// Sets or clears the value of [dataplex_fileset][crate::model::FilesetSpec::dataplex_fileset].
4363 ///
4364 /// # Example
4365 /// ```ignore,no_run
4366 /// # use google_cloud_datacatalog_v1::model::FilesetSpec;
4367 /// use google_cloud_datacatalog_v1::model::DataplexFilesetSpec;
4368 /// let x = FilesetSpec::new().set_or_clear_dataplex_fileset(Some(DataplexFilesetSpec::default()/* use setters */));
4369 /// let x = FilesetSpec::new().set_or_clear_dataplex_fileset(None::<DataplexFilesetSpec>);
4370 /// ```
4371 pub fn set_or_clear_dataplex_fileset<T>(mut self, v: std::option::Option<T>) -> Self
4372 where
4373 T: std::convert::Into<crate::model::DataplexFilesetSpec>,
4374 {
4375 self.dataplex_fileset = v.map(|x| x.into());
4376 self
4377 }
4378}
4379
4380impl wkt::message::Message for FilesetSpec {
4381 fn typename() -> &'static str {
4382 "type.googleapis.com/google.cloud.datacatalog.v1.FilesetSpec"
4383 }
4384}
4385
4386/// Specification that applies to a data source connection. Valid only for
4387/// entries with the `DATA_SOURCE_CONNECTION` type.
4388/// Only one of internal specs can be set at the time, and cannot
4389/// be changed later.
4390#[derive(Clone, Default, PartialEq)]
4391#[non_exhaustive]
4392pub struct DataSourceConnectionSpec {
4393 /// Output only. Fields specific to BigQuery connections.
4394 pub bigquery_connection_spec: std::option::Option<crate::model::BigQueryConnectionSpec>,
4395
4396 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4397}
4398
4399impl DataSourceConnectionSpec {
4400 pub fn new() -> Self {
4401 std::default::Default::default()
4402 }
4403
4404 /// Sets the value of [bigquery_connection_spec][crate::model::DataSourceConnectionSpec::bigquery_connection_spec].
4405 ///
4406 /// # Example
4407 /// ```ignore,no_run
4408 /// # use google_cloud_datacatalog_v1::model::DataSourceConnectionSpec;
4409 /// use google_cloud_datacatalog_v1::model::BigQueryConnectionSpec;
4410 /// let x = DataSourceConnectionSpec::new().set_bigquery_connection_spec(BigQueryConnectionSpec::default()/* use setters */);
4411 /// ```
4412 pub fn set_bigquery_connection_spec<T>(mut self, v: T) -> Self
4413 where
4414 T: std::convert::Into<crate::model::BigQueryConnectionSpec>,
4415 {
4416 self.bigquery_connection_spec = std::option::Option::Some(v.into());
4417 self
4418 }
4419
4420 /// Sets or clears the value of [bigquery_connection_spec][crate::model::DataSourceConnectionSpec::bigquery_connection_spec].
4421 ///
4422 /// # Example
4423 /// ```ignore,no_run
4424 /// # use google_cloud_datacatalog_v1::model::DataSourceConnectionSpec;
4425 /// use google_cloud_datacatalog_v1::model::BigQueryConnectionSpec;
4426 /// let x = DataSourceConnectionSpec::new().set_or_clear_bigquery_connection_spec(Some(BigQueryConnectionSpec::default()/* use setters */));
4427 /// let x = DataSourceConnectionSpec::new().set_or_clear_bigquery_connection_spec(None::<BigQueryConnectionSpec>);
4428 /// ```
4429 pub fn set_or_clear_bigquery_connection_spec<T>(mut self, v: std::option::Option<T>) -> Self
4430 where
4431 T: std::convert::Into<crate::model::BigQueryConnectionSpec>,
4432 {
4433 self.bigquery_connection_spec = v.map(|x| x.into());
4434 self
4435 }
4436}
4437
4438impl wkt::message::Message for DataSourceConnectionSpec {
4439 fn typename() -> &'static str {
4440 "type.googleapis.com/google.cloud.datacatalog.v1.DataSourceConnectionSpec"
4441 }
4442}
4443
4444/// Specification that applies to a routine. Valid only for
4445/// entries with the `ROUTINE` type.
4446#[derive(Clone, Default, PartialEq)]
4447#[non_exhaustive]
4448pub struct RoutineSpec {
4449 /// The type of the routine.
4450 pub routine_type: crate::model::routine_spec::RoutineType,
4451
4452 /// The language the routine is written in. The exact value depends on the
4453 /// source system. For BigQuery routines, possible values are:
4454 ///
4455 /// * `SQL`
4456 /// * `JAVASCRIPT`
4457 pub language: std::string::String,
4458
4459 /// Arguments of the routine.
4460 pub routine_arguments: std::vec::Vec<crate::model::routine_spec::Argument>,
4461
4462 /// Return type of the argument. The exact value depends on the source system
4463 /// and the language.
4464 pub return_type: std::string::String,
4465
4466 /// The body of the routine.
4467 pub definition_body: std::string::String,
4468
4469 /// Contains fields specific to the source system.
4470 pub system_spec: std::option::Option<crate::model::routine_spec::SystemSpec>,
4471
4472 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4473}
4474
4475impl RoutineSpec {
4476 pub fn new() -> Self {
4477 std::default::Default::default()
4478 }
4479
4480 /// Sets the value of [routine_type][crate::model::RoutineSpec::routine_type].
4481 ///
4482 /// # Example
4483 /// ```ignore,no_run
4484 /// # use google_cloud_datacatalog_v1::model::RoutineSpec;
4485 /// use google_cloud_datacatalog_v1::model::routine_spec::RoutineType;
4486 /// let x0 = RoutineSpec::new().set_routine_type(RoutineType::ScalarFunction);
4487 /// let x1 = RoutineSpec::new().set_routine_type(RoutineType::Procedure);
4488 /// ```
4489 pub fn set_routine_type<T: std::convert::Into<crate::model::routine_spec::RoutineType>>(
4490 mut self,
4491 v: T,
4492 ) -> Self {
4493 self.routine_type = v.into();
4494 self
4495 }
4496
4497 /// Sets the value of [language][crate::model::RoutineSpec::language].
4498 ///
4499 /// # Example
4500 /// ```ignore,no_run
4501 /// # use google_cloud_datacatalog_v1::model::RoutineSpec;
4502 /// let x = RoutineSpec::new().set_language("example");
4503 /// ```
4504 pub fn set_language<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4505 self.language = v.into();
4506 self
4507 }
4508
4509 /// Sets the value of [routine_arguments][crate::model::RoutineSpec::routine_arguments].
4510 ///
4511 /// # Example
4512 /// ```ignore,no_run
4513 /// # use google_cloud_datacatalog_v1::model::RoutineSpec;
4514 /// use google_cloud_datacatalog_v1::model::routine_spec::Argument;
4515 /// let x = RoutineSpec::new()
4516 /// .set_routine_arguments([
4517 /// Argument::default()/* use setters */,
4518 /// Argument::default()/* use (different) setters */,
4519 /// ]);
4520 /// ```
4521 pub fn set_routine_arguments<T, V>(mut self, v: T) -> Self
4522 where
4523 T: std::iter::IntoIterator<Item = V>,
4524 V: std::convert::Into<crate::model::routine_spec::Argument>,
4525 {
4526 use std::iter::Iterator;
4527 self.routine_arguments = v.into_iter().map(|i| i.into()).collect();
4528 self
4529 }
4530
4531 /// Sets the value of [return_type][crate::model::RoutineSpec::return_type].
4532 ///
4533 /// # Example
4534 /// ```ignore,no_run
4535 /// # use google_cloud_datacatalog_v1::model::RoutineSpec;
4536 /// let x = RoutineSpec::new().set_return_type("example");
4537 /// ```
4538 pub fn set_return_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4539 self.return_type = v.into();
4540 self
4541 }
4542
4543 /// Sets the value of [definition_body][crate::model::RoutineSpec::definition_body].
4544 ///
4545 /// # Example
4546 /// ```ignore,no_run
4547 /// # use google_cloud_datacatalog_v1::model::RoutineSpec;
4548 /// let x = RoutineSpec::new().set_definition_body("example");
4549 /// ```
4550 pub fn set_definition_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4551 self.definition_body = v.into();
4552 self
4553 }
4554
4555 /// Sets the value of [system_spec][crate::model::RoutineSpec::system_spec].
4556 ///
4557 /// Note that all the setters affecting `system_spec` are mutually
4558 /// exclusive.
4559 ///
4560 /// # Example
4561 /// ```ignore,no_run
4562 /// # use google_cloud_datacatalog_v1::model::RoutineSpec;
4563 /// use google_cloud_datacatalog_v1::model::BigQueryRoutineSpec;
4564 /// let x = RoutineSpec::new().set_system_spec(Some(
4565 /// google_cloud_datacatalog_v1::model::routine_spec::SystemSpec::BigqueryRoutineSpec(BigQueryRoutineSpec::default().into())));
4566 /// ```
4567 pub fn set_system_spec<
4568 T: std::convert::Into<std::option::Option<crate::model::routine_spec::SystemSpec>>,
4569 >(
4570 mut self,
4571 v: T,
4572 ) -> Self {
4573 self.system_spec = v.into();
4574 self
4575 }
4576
4577 /// The value of [system_spec][crate::model::RoutineSpec::system_spec]
4578 /// if it holds a `BigqueryRoutineSpec`, `None` if the field is not set or
4579 /// holds a different branch.
4580 pub fn bigquery_routine_spec(
4581 &self,
4582 ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryRoutineSpec>> {
4583 #[allow(unreachable_patterns)]
4584 self.system_spec.as_ref().and_then(|v| match v {
4585 crate::model::routine_spec::SystemSpec::BigqueryRoutineSpec(v) => {
4586 std::option::Option::Some(v)
4587 }
4588 _ => std::option::Option::None,
4589 })
4590 }
4591
4592 /// Sets the value of [system_spec][crate::model::RoutineSpec::system_spec]
4593 /// to hold a `BigqueryRoutineSpec`.
4594 ///
4595 /// Note that all the setters affecting `system_spec` are
4596 /// mutually exclusive.
4597 ///
4598 /// # Example
4599 /// ```ignore,no_run
4600 /// # use google_cloud_datacatalog_v1::model::RoutineSpec;
4601 /// use google_cloud_datacatalog_v1::model::BigQueryRoutineSpec;
4602 /// let x = RoutineSpec::new().set_bigquery_routine_spec(BigQueryRoutineSpec::default()/* use setters */);
4603 /// assert!(x.bigquery_routine_spec().is_some());
4604 /// ```
4605 pub fn set_bigquery_routine_spec<
4606 T: std::convert::Into<std::boxed::Box<crate::model::BigQueryRoutineSpec>>,
4607 >(
4608 mut self,
4609 v: T,
4610 ) -> Self {
4611 self.system_spec = std::option::Option::Some(
4612 crate::model::routine_spec::SystemSpec::BigqueryRoutineSpec(v.into()),
4613 );
4614 self
4615 }
4616}
4617
4618impl wkt::message::Message for RoutineSpec {
4619 fn typename() -> &'static str {
4620 "type.googleapis.com/google.cloud.datacatalog.v1.RoutineSpec"
4621 }
4622}
4623
4624/// Defines additional types related to [RoutineSpec].
4625pub mod routine_spec {
4626 #[allow(unused_imports)]
4627 use super::*;
4628
4629 /// Input or output argument of a function or stored procedure.
4630 #[derive(Clone, Default, PartialEq)]
4631 #[non_exhaustive]
4632 pub struct Argument {
4633 /// The name of the argument. A return argument of a function might not have
4634 /// a name.
4635 pub name: std::string::String,
4636
4637 /// Specifies whether the argument is input or output.
4638 pub mode: crate::model::routine_spec::argument::Mode,
4639
4640 /// Type of the argument. The exact value depends on the source system and
4641 /// the language.
4642 pub r#type: std::string::String,
4643
4644 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4645 }
4646
4647 impl Argument {
4648 pub fn new() -> Self {
4649 std::default::Default::default()
4650 }
4651
4652 /// Sets the value of [name][crate::model::routine_spec::Argument::name].
4653 ///
4654 /// # Example
4655 /// ```ignore,no_run
4656 /// # use google_cloud_datacatalog_v1::model::routine_spec::Argument;
4657 /// let x = Argument::new().set_name("example");
4658 /// ```
4659 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4660 self.name = v.into();
4661 self
4662 }
4663
4664 /// Sets the value of [mode][crate::model::routine_spec::Argument::mode].
4665 ///
4666 /// # Example
4667 /// ```ignore,no_run
4668 /// # use google_cloud_datacatalog_v1::model::routine_spec::Argument;
4669 /// use google_cloud_datacatalog_v1::model::routine_spec::argument::Mode;
4670 /// let x0 = Argument::new().set_mode(Mode::In);
4671 /// let x1 = Argument::new().set_mode(Mode::Out);
4672 /// let x2 = Argument::new().set_mode(Mode::Inout);
4673 /// ```
4674 pub fn set_mode<T: std::convert::Into<crate::model::routine_spec::argument::Mode>>(
4675 mut self,
4676 v: T,
4677 ) -> Self {
4678 self.mode = v.into();
4679 self
4680 }
4681
4682 /// Sets the value of [r#type][crate::model::routine_spec::Argument::type].
4683 ///
4684 /// # Example
4685 /// ```ignore,no_run
4686 /// # use google_cloud_datacatalog_v1::model::routine_spec::Argument;
4687 /// let x = Argument::new().set_type("example");
4688 /// ```
4689 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4690 self.r#type = v.into();
4691 self
4692 }
4693 }
4694
4695 impl wkt::message::Message for Argument {
4696 fn typename() -> &'static str {
4697 "type.googleapis.com/google.cloud.datacatalog.v1.RoutineSpec.Argument"
4698 }
4699 }
4700
4701 /// Defines additional types related to [Argument].
4702 pub mod argument {
4703 #[allow(unused_imports)]
4704 use super::*;
4705
4706 /// The input or output mode of the argument.
4707 ///
4708 /// # Working with unknown values
4709 ///
4710 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4711 /// additional enum variants at any time. Adding new variants is not considered
4712 /// a breaking change. Applications should write their code in anticipation of:
4713 ///
4714 /// - New values appearing in future releases of the client library, **and**
4715 /// - New values received dynamically, without application changes.
4716 ///
4717 /// Please consult the [Working with enums] section in the user guide for some
4718 /// guidelines.
4719 ///
4720 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4721 #[derive(Clone, Debug, PartialEq)]
4722 #[non_exhaustive]
4723 pub enum Mode {
4724 /// Unspecified mode.
4725 Unspecified,
4726 /// The argument is input-only.
4727 In,
4728 /// The argument is output-only.
4729 Out,
4730 /// The argument is both an input and an output.
4731 Inout,
4732 /// If set, the enum was initialized with an unknown value.
4733 ///
4734 /// Applications can examine the value using [Mode::value] or
4735 /// [Mode::name].
4736 UnknownValue(mode::UnknownValue),
4737 }
4738
4739 #[doc(hidden)]
4740 pub mod mode {
4741 #[allow(unused_imports)]
4742 use super::*;
4743 #[derive(Clone, Debug, PartialEq)]
4744 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4745 }
4746
4747 impl Mode {
4748 /// Gets the enum value.
4749 ///
4750 /// Returns `None` if the enum contains an unknown value deserialized from
4751 /// the string representation of enums.
4752 pub fn value(&self) -> std::option::Option<i32> {
4753 match self {
4754 Self::Unspecified => std::option::Option::Some(0),
4755 Self::In => std::option::Option::Some(1),
4756 Self::Out => std::option::Option::Some(2),
4757 Self::Inout => std::option::Option::Some(3),
4758 Self::UnknownValue(u) => u.0.value(),
4759 }
4760 }
4761
4762 /// Gets the enum value as a string.
4763 ///
4764 /// Returns `None` if the enum contains an unknown value deserialized from
4765 /// the integer representation of enums.
4766 pub fn name(&self) -> std::option::Option<&str> {
4767 match self {
4768 Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
4769 Self::In => std::option::Option::Some("IN"),
4770 Self::Out => std::option::Option::Some("OUT"),
4771 Self::Inout => std::option::Option::Some("INOUT"),
4772 Self::UnknownValue(u) => u.0.name(),
4773 }
4774 }
4775 }
4776
4777 impl std::default::Default for Mode {
4778 fn default() -> Self {
4779 use std::convert::From;
4780 Self::from(0)
4781 }
4782 }
4783
4784 impl std::fmt::Display for Mode {
4785 fn fmt(
4786 &self,
4787 f: &mut std::fmt::Formatter<'_>,
4788 ) -> std::result::Result<(), std::fmt::Error> {
4789 wkt::internal::display_enum(f, self.name(), self.value())
4790 }
4791 }
4792
4793 impl std::convert::From<i32> for Mode {
4794 fn from(value: i32) -> Self {
4795 match value {
4796 0 => Self::Unspecified,
4797 1 => Self::In,
4798 2 => Self::Out,
4799 3 => Self::Inout,
4800 _ => Self::UnknownValue(mode::UnknownValue(
4801 wkt::internal::UnknownEnumValue::Integer(value),
4802 )),
4803 }
4804 }
4805 }
4806
4807 impl std::convert::From<&str> for Mode {
4808 fn from(value: &str) -> Self {
4809 use std::string::ToString;
4810 match value {
4811 "MODE_UNSPECIFIED" => Self::Unspecified,
4812 "IN" => Self::In,
4813 "OUT" => Self::Out,
4814 "INOUT" => Self::Inout,
4815 _ => Self::UnknownValue(mode::UnknownValue(
4816 wkt::internal::UnknownEnumValue::String(value.to_string()),
4817 )),
4818 }
4819 }
4820 }
4821
4822 impl serde::ser::Serialize for Mode {
4823 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4824 where
4825 S: serde::Serializer,
4826 {
4827 match self {
4828 Self::Unspecified => serializer.serialize_i32(0),
4829 Self::In => serializer.serialize_i32(1),
4830 Self::Out => serializer.serialize_i32(2),
4831 Self::Inout => serializer.serialize_i32(3),
4832 Self::UnknownValue(u) => u.0.serialize(serializer),
4833 }
4834 }
4835 }
4836
4837 impl<'de> serde::de::Deserialize<'de> for Mode {
4838 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4839 where
4840 D: serde::Deserializer<'de>,
4841 {
4842 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
4843 ".google.cloud.datacatalog.v1.RoutineSpec.Argument.Mode",
4844 ))
4845 }
4846 }
4847 }
4848
4849 /// The fine-grained type of the routine.
4850 ///
4851 /// # Working with unknown values
4852 ///
4853 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4854 /// additional enum variants at any time. Adding new variants is not considered
4855 /// a breaking change. Applications should write their code in anticipation of:
4856 ///
4857 /// - New values appearing in future releases of the client library, **and**
4858 /// - New values received dynamically, without application changes.
4859 ///
4860 /// Please consult the [Working with enums] section in the user guide for some
4861 /// guidelines.
4862 ///
4863 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4864 #[derive(Clone, Debug, PartialEq)]
4865 #[non_exhaustive]
4866 pub enum RoutineType {
4867 /// Unspecified type.
4868 Unspecified,
4869 /// Non-builtin permanent scalar function.
4870 ScalarFunction,
4871 /// Stored procedure.
4872 Procedure,
4873 /// If set, the enum was initialized with an unknown value.
4874 ///
4875 /// Applications can examine the value using [RoutineType::value] or
4876 /// [RoutineType::name].
4877 UnknownValue(routine_type::UnknownValue),
4878 }
4879
4880 #[doc(hidden)]
4881 pub mod routine_type {
4882 #[allow(unused_imports)]
4883 use super::*;
4884 #[derive(Clone, Debug, PartialEq)]
4885 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4886 }
4887
4888 impl RoutineType {
4889 /// Gets the enum value.
4890 ///
4891 /// Returns `None` if the enum contains an unknown value deserialized from
4892 /// the string representation of enums.
4893 pub fn value(&self) -> std::option::Option<i32> {
4894 match self {
4895 Self::Unspecified => std::option::Option::Some(0),
4896 Self::ScalarFunction => std::option::Option::Some(1),
4897 Self::Procedure => std::option::Option::Some(2),
4898 Self::UnknownValue(u) => u.0.value(),
4899 }
4900 }
4901
4902 /// Gets the enum value as a string.
4903 ///
4904 /// Returns `None` if the enum contains an unknown value deserialized from
4905 /// the integer representation of enums.
4906 pub fn name(&self) -> std::option::Option<&str> {
4907 match self {
4908 Self::Unspecified => std::option::Option::Some("ROUTINE_TYPE_UNSPECIFIED"),
4909 Self::ScalarFunction => std::option::Option::Some("SCALAR_FUNCTION"),
4910 Self::Procedure => std::option::Option::Some("PROCEDURE"),
4911 Self::UnknownValue(u) => u.0.name(),
4912 }
4913 }
4914 }
4915
4916 impl std::default::Default for RoutineType {
4917 fn default() -> Self {
4918 use std::convert::From;
4919 Self::from(0)
4920 }
4921 }
4922
4923 impl std::fmt::Display for RoutineType {
4924 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4925 wkt::internal::display_enum(f, self.name(), self.value())
4926 }
4927 }
4928
4929 impl std::convert::From<i32> for RoutineType {
4930 fn from(value: i32) -> Self {
4931 match value {
4932 0 => Self::Unspecified,
4933 1 => Self::ScalarFunction,
4934 2 => Self::Procedure,
4935 _ => Self::UnknownValue(routine_type::UnknownValue(
4936 wkt::internal::UnknownEnumValue::Integer(value),
4937 )),
4938 }
4939 }
4940 }
4941
4942 impl std::convert::From<&str> for RoutineType {
4943 fn from(value: &str) -> Self {
4944 use std::string::ToString;
4945 match value {
4946 "ROUTINE_TYPE_UNSPECIFIED" => Self::Unspecified,
4947 "SCALAR_FUNCTION" => Self::ScalarFunction,
4948 "PROCEDURE" => Self::Procedure,
4949 _ => Self::UnknownValue(routine_type::UnknownValue(
4950 wkt::internal::UnknownEnumValue::String(value.to_string()),
4951 )),
4952 }
4953 }
4954 }
4955
4956 impl serde::ser::Serialize for RoutineType {
4957 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4958 where
4959 S: serde::Serializer,
4960 {
4961 match self {
4962 Self::Unspecified => serializer.serialize_i32(0),
4963 Self::ScalarFunction => serializer.serialize_i32(1),
4964 Self::Procedure => serializer.serialize_i32(2),
4965 Self::UnknownValue(u) => u.0.serialize(serializer),
4966 }
4967 }
4968 }
4969
4970 impl<'de> serde::de::Deserialize<'de> for RoutineType {
4971 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4972 where
4973 D: serde::Deserializer<'de>,
4974 {
4975 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutineType>::new(
4976 ".google.cloud.datacatalog.v1.RoutineSpec.RoutineType",
4977 ))
4978 }
4979 }
4980
4981 /// Contains fields specific to the source system.
4982 #[derive(Clone, Debug, PartialEq)]
4983 #[non_exhaustive]
4984 pub enum SystemSpec {
4985 /// Fields specific for BigQuery routines.
4986 BigqueryRoutineSpec(std::boxed::Box<crate::model::BigQueryRoutineSpec>),
4987 }
4988}
4989
4990/// Specification that applies to a dataset. Valid only for
4991/// entries with the `DATASET` type.
4992#[derive(Clone, Default, PartialEq)]
4993#[non_exhaustive]
4994pub struct DatasetSpec {
4995 /// Fields specific to the source system.
4996 pub system_spec: std::option::Option<crate::model::dataset_spec::SystemSpec>,
4997
4998 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4999}
5000
5001impl DatasetSpec {
5002 pub fn new() -> Self {
5003 std::default::Default::default()
5004 }
5005
5006 /// Sets the value of [system_spec][crate::model::DatasetSpec::system_spec].
5007 ///
5008 /// Note that all the setters affecting `system_spec` are mutually
5009 /// exclusive.
5010 ///
5011 /// # Example
5012 /// ```ignore,no_run
5013 /// # use google_cloud_datacatalog_v1::model::DatasetSpec;
5014 /// use google_cloud_datacatalog_v1::model::VertexDatasetSpec;
5015 /// let x = DatasetSpec::new().set_system_spec(Some(
5016 /// google_cloud_datacatalog_v1::model::dataset_spec::SystemSpec::VertexDatasetSpec(VertexDatasetSpec::default().into())));
5017 /// ```
5018 pub fn set_system_spec<
5019 T: std::convert::Into<std::option::Option<crate::model::dataset_spec::SystemSpec>>,
5020 >(
5021 mut self,
5022 v: T,
5023 ) -> Self {
5024 self.system_spec = v.into();
5025 self
5026 }
5027
5028 /// The value of [system_spec][crate::model::DatasetSpec::system_spec]
5029 /// if it holds a `VertexDatasetSpec`, `None` if the field is not set or
5030 /// holds a different branch.
5031 pub fn vertex_dataset_spec(
5032 &self,
5033 ) -> std::option::Option<&std::boxed::Box<crate::model::VertexDatasetSpec>> {
5034 #[allow(unreachable_patterns)]
5035 self.system_spec.as_ref().and_then(|v| match v {
5036 crate::model::dataset_spec::SystemSpec::VertexDatasetSpec(v) => {
5037 std::option::Option::Some(v)
5038 }
5039 _ => std::option::Option::None,
5040 })
5041 }
5042
5043 /// Sets the value of [system_spec][crate::model::DatasetSpec::system_spec]
5044 /// to hold a `VertexDatasetSpec`.
5045 ///
5046 /// Note that all the setters affecting `system_spec` are
5047 /// mutually exclusive.
5048 ///
5049 /// # Example
5050 /// ```ignore,no_run
5051 /// # use google_cloud_datacatalog_v1::model::DatasetSpec;
5052 /// use google_cloud_datacatalog_v1::model::VertexDatasetSpec;
5053 /// let x = DatasetSpec::new().set_vertex_dataset_spec(VertexDatasetSpec::default()/* use setters */);
5054 /// assert!(x.vertex_dataset_spec().is_some());
5055 /// ```
5056 pub fn set_vertex_dataset_spec<
5057 T: std::convert::Into<std::boxed::Box<crate::model::VertexDatasetSpec>>,
5058 >(
5059 mut self,
5060 v: T,
5061 ) -> Self {
5062 self.system_spec = std::option::Option::Some(
5063 crate::model::dataset_spec::SystemSpec::VertexDatasetSpec(v.into()),
5064 );
5065 self
5066 }
5067}
5068
5069impl wkt::message::Message for DatasetSpec {
5070 fn typename() -> &'static str {
5071 "type.googleapis.com/google.cloud.datacatalog.v1.DatasetSpec"
5072 }
5073}
5074
5075/// Defines additional types related to [DatasetSpec].
5076pub mod dataset_spec {
5077 #[allow(unused_imports)]
5078 use super::*;
5079
5080 /// Fields specific to the source system.
5081 #[derive(Clone, Debug, PartialEq)]
5082 #[non_exhaustive]
5083 pub enum SystemSpec {
5084 /// Vertex AI Dataset specific fields
5085 VertexDatasetSpec(std::boxed::Box<crate::model::VertexDatasetSpec>),
5086 }
5087}
5088
5089/// Specification that applies to
5090/// entries that are part `SQL_DATABASE` system
5091/// (user_specified_type)
5092#[derive(Clone, Default, PartialEq)]
5093#[non_exhaustive]
5094pub struct SqlDatabaseSystemSpec {
5095 /// SQL Database Engine.
5096 /// enum SqlEngine {
5097 /// UNDEFINED = 0;
5098 /// MY_SQL = 1;
5099 /// POSTGRE_SQL = 2;
5100 /// SQL_SERVER = 3;
5101 /// }
5102 /// Engine of the enclosing database instance.
5103 pub sql_engine: std::string::String,
5104
5105 /// Version of the database engine.
5106 pub database_version: std::string::String,
5107
5108 /// Host of the SQL database
5109 /// enum InstanceHost {
5110 /// UNDEFINED = 0;
5111 /// SELF_HOSTED = 1;
5112 /// CLOUD_SQL = 2;
5113 /// AMAZON_RDS = 3;
5114 /// AZURE_SQL = 4;
5115 /// }
5116 /// Host of the enclousing database instance.
5117 pub instance_host: std::string::String,
5118
5119 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5120}
5121
5122impl SqlDatabaseSystemSpec {
5123 pub fn new() -> Self {
5124 std::default::Default::default()
5125 }
5126
5127 /// Sets the value of [sql_engine][crate::model::SqlDatabaseSystemSpec::sql_engine].
5128 ///
5129 /// # Example
5130 /// ```ignore,no_run
5131 /// # use google_cloud_datacatalog_v1::model::SqlDatabaseSystemSpec;
5132 /// let x = SqlDatabaseSystemSpec::new().set_sql_engine("example");
5133 /// ```
5134 pub fn set_sql_engine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5135 self.sql_engine = v.into();
5136 self
5137 }
5138
5139 /// Sets the value of [database_version][crate::model::SqlDatabaseSystemSpec::database_version].
5140 ///
5141 /// # Example
5142 /// ```ignore,no_run
5143 /// # use google_cloud_datacatalog_v1::model::SqlDatabaseSystemSpec;
5144 /// let x = SqlDatabaseSystemSpec::new().set_database_version("example");
5145 /// ```
5146 pub fn set_database_version<T: std::convert::Into<std::string::String>>(
5147 mut self,
5148 v: T,
5149 ) -> Self {
5150 self.database_version = v.into();
5151 self
5152 }
5153
5154 /// Sets the value of [instance_host][crate::model::SqlDatabaseSystemSpec::instance_host].
5155 ///
5156 /// # Example
5157 /// ```ignore,no_run
5158 /// # use google_cloud_datacatalog_v1::model::SqlDatabaseSystemSpec;
5159 /// let x = SqlDatabaseSystemSpec::new().set_instance_host("example");
5160 /// ```
5161 pub fn set_instance_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5162 self.instance_host = v.into();
5163 self
5164 }
5165}
5166
5167impl wkt::message::Message for SqlDatabaseSystemSpec {
5168 fn typename() -> &'static str {
5169 "type.googleapis.com/google.cloud.datacatalog.v1.SqlDatabaseSystemSpec"
5170 }
5171}
5172
5173/// Specification that applies to
5174/// entries that are part `LOOKER` system
5175/// (user_specified_type)
5176#[derive(Clone, Default, PartialEq)]
5177#[non_exhaustive]
5178pub struct LookerSystemSpec {
5179 /// ID of the parent Looker Instance. Empty if it does not exist.
5180 /// Example value: `someinstance.looker.com`
5181 pub parent_instance_id: std::string::String,
5182
5183 /// Name of the parent Looker Instance. Empty if it does not exist.
5184 pub parent_instance_display_name: std::string::String,
5185
5186 /// ID of the parent Model. Empty if it does not exist.
5187 pub parent_model_id: std::string::String,
5188
5189 /// Name of the parent Model. Empty if it does not exist.
5190 pub parent_model_display_name: std::string::String,
5191
5192 /// ID of the parent View. Empty if it does not exist.
5193 pub parent_view_id: std::string::String,
5194
5195 /// Name of the parent View. Empty if it does not exist.
5196 pub parent_view_display_name: std::string::String,
5197
5198 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5199}
5200
5201impl LookerSystemSpec {
5202 pub fn new() -> Self {
5203 std::default::Default::default()
5204 }
5205
5206 /// Sets the value of [parent_instance_id][crate::model::LookerSystemSpec::parent_instance_id].
5207 ///
5208 /// # Example
5209 /// ```ignore,no_run
5210 /// # use google_cloud_datacatalog_v1::model::LookerSystemSpec;
5211 /// let x = LookerSystemSpec::new().set_parent_instance_id("example");
5212 /// ```
5213 pub fn set_parent_instance_id<T: std::convert::Into<std::string::String>>(
5214 mut self,
5215 v: T,
5216 ) -> Self {
5217 self.parent_instance_id = v.into();
5218 self
5219 }
5220
5221 /// Sets the value of [parent_instance_display_name][crate::model::LookerSystemSpec::parent_instance_display_name].
5222 ///
5223 /// # Example
5224 /// ```ignore,no_run
5225 /// # use google_cloud_datacatalog_v1::model::LookerSystemSpec;
5226 /// let x = LookerSystemSpec::new().set_parent_instance_display_name("example");
5227 /// ```
5228 pub fn set_parent_instance_display_name<T: std::convert::Into<std::string::String>>(
5229 mut self,
5230 v: T,
5231 ) -> Self {
5232 self.parent_instance_display_name = v.into();
5233 self
5234 }
5235
5236 /// Sets the value of [parent_model_id][crate::model::LookerSystemSpec::parent_model_id].
5237 ///
5238 /// # Example
5239 /// ```ignore,no_run
5240 /// # use google_cloud_datacatalog_v1::model::LookerSystemSpec;
5241 /// let x = LookerSystemSpec::new().set_parent_model_id("example");
5242 /// ```
5243 pub fn set_parent_model_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5244 self.parent_model_id = v.into();
5245 self
5246 }
5247
5248 /// Sets the value of [parent_model_display_name][crate::model::LookerSystemSpec::parent_model_display_name].
5249 ///
5250 /// # Example
5251 /// ```ignore,no_run
5252 /// # use google_cloud_datacatalog_v1::model::LookerSystemSpec;
5253 /// let x = LookerSystemSpec::new().set_parent_model_display_name("example");
5254 /// ```
5255 pub fn set_parent_model_display_name<T: std::convert::Into<std::string::String>>(
5256 mut self,
5257 v: T,
5258 ) -> Self {
5259 self.parent_model_display_name = v.into();
5260 self
5261 }
5262
5263 /// Sets the value of [parent_view_id][crate::model::LookerSystemSpec::parent_view_id].
5264 ///
5265 /// # Example
5266 /// ```ignore,no_run
5267 /// # use google_cloud_datacatalog_v1::model::LookerSystemSpec;
5268 /// let x = LookerSystemSpec::new().set_parent_view_id("example");
5269 /// ```
5270 pub fn set_parent_view_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5271 self.parent_view_id = v.into();
5272 self
5273 }
5274
5275 /// Sets the value of [parent_view_display_name][crate::model::LookerSystemSpec::parent_view_display_name].
5276 ///
5277 /// # Example
5278 /// ```ignore,no_run
5279 /// # use google_cloud_datacatalog_v1::model::LookerSystemSpec;
5280 /// let x = LookerSystemSpec::new().set_parent_view_display_name("example");
5281 /// ```
5282 pub fn set_parent_view_display_name<T: std::convert::Into<std::string::String>>(
5283 mut self,
5284 v: T,
5285 ) -> Self {
5286 self.parent_view_display_name = v.into();
5287 self
5288 }
5289}
5290
5291impl wkt::message::Message for LookerSystemSpec {
5292 fn typename() -> &'static str {
5293 "type.googleapis.com/google.cloud.datacatalog.v1.LookerSystemSpec"
5294 }
5295}
5296
5297/// Specification that applies to
5298/// all entries that are part of `CLOUD_BIGTABLE` system
5299/// (user_specified_type)
5300#[derive(Clone, Default, PartialEq)]
5301#[non_exhaustive]
5302pub struct CloudBigtableSystemSpec {
5303 /// Display name of the Instance. This is user specified and different from
5304 /// the resource name.
5305 pub instance_display_name: std::string::String,
5306
5307 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5308}
5309
5310impl CloudBigtableSystemSpec {
5311 pub fn new() -> Self {
5312 std::default::Default::default()
5313 }
5314
5315 /// Sets the value of [instance_display_name][crate::model::CloudBigtableSystemSpec::instance_display_name].
5316 ///
5317 /// # Example
5318 /// ```ignore,no_run
5319 /// # use google_cloud_datacatalog_v1::model::CloudBigtableSystemSpec;
5320 /// let x = CloudBigtableSystemSpec::new().set_instance_display_name("example");
5321 /// ```
5322 pub fn set_instance_display_name<T: std::convert::Into<std::string::String>>(
5323 mut self,
5324 v: T,
5325 ) -> Self {
5326 self.instance_display_name = v.into();
5327 self
5328 }
5329}
5330
5331impl wkt::message::Message for CloudBigtableSystemSpec {
5332 fn typename() -> &'static str {
5333 "type.googleapis.com/google.cloud.datacatalog.v1.CloudBigtableSystemSpec"
5334 }
5335}
5336
5337/// Specification that applies to Instance
5338/// entries that are part of `CLOUD_BIGTABLE` system.
5339/// (user_specified_type)
5340#[derive(Clone, Default, PartialEq)]
5341#[non_exhaustive]
5342pub struct CloudBigtableInstanceSpec {
5343 /// The list of clusters for the Instance.
5344 pub cloud_bigtable_cluster_specs:
5345 std::vec::Vec<crate::model::cloud_bigtable_instance_spec::CloudBigtableClusterSpec>,
5346
5347 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5348}
5349
5350impl CloudBigtableInstanceSpec {
5351 pub fn new() -> Self {
5352 std::default::Default::default()
5353 }
5354
5355 /// Sets the value of [cloud_bigtable_cluster_specs][crate::model::CloudBigtableInstanceSpec::cloud_bigtable_cluster_specs].
5356 ///
5357 /// # Example
5358 /// ```ignore,no_run
5359 /// # use google_cloud_datacatalog_v1::model::CloudBigtableInstanceSpec;
5360 /// use google_cloud_datacatalog_v1::model::cloud_bigtable_instance_spec::CloudBigtableClusterSpec;
5361 /// let x = CloudBigtableInstanceSpec::new()
5362 /// .set_cloud_bigtable_cluster_specs([
5363 /// CloudBigtableClusterSpec::default()/* use setters */,
5364 /// CloudBigtableClusterSpec::default()/* use (different) setters */,
5365 /// ]);
5366 /// ```
5367 pub fn set_cloud_bigtable_cluster_specs<T, V>(mut self, v: T) -> Self
5368 where
5369 T: std::iter::IntoIterator<Item = V>,
5370 V: std::convert::Into<crate::model::cloud_bigtable_instance_spec::CloudBigtableClusterSpec>,
5371 {
5372 use std::iter::Iterator;
5373 self.cloud_bigtable_cluster_specs = v.into_iter().map(|i| i.into()).collect();
5374 self
5375 }
5376}
5377
5378impl wkt::message::Message for CloudBigtableInstanceSpec {
5379 fn typename() -> &'static str {
5380 "type.googleapis.com/google.cloud.datacatalog.v1.CloudBigtableInstanceSpec"
5381 }
5382}
5383
5384/// Defines additional types related to [CloudBigtableInstanceSpec].
5385pub mod cloud_bigtable_instance_spec {
5386 #[allow(unused_imports)]
5387 use super::*;
5388
5389 /// Spec that applies to clusters of an Instance of Cloud Bigtable.
5390 #[derive(Clone, Default, PartialEq)]
5391 #[non_exhaustive]
5392 pub struct CloudBigtableClusterSpec {
5393 /// Name of the cluster.
5394 pub display_name: std::string::String,
5395
5396 /// Location of the cluster, typically a Cloud zone.
5397 pub location: std::string::String,
5398
5399 /// Type of the resource. For a cluster this would be "CLUSTER".
5400 pub r#type: std::string::String,
5401
5402 /// A link back to the parent resource, in this case Instance.
5403 pub linked_resource: std::string::String,
5404
5405 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5406 }
5407
5408 impl CloudBigtableClusterSpec {
5409 pub fn new() -> Self {
5410 std::default::Default::default()
5411 }
5412
5413 /// Sets the value of [display_name][crate::model::cloud_bigtable_instance_spec::CloudBigtableClusterSpec::display_name].
5414 ///
5415 /// # Example
5416 /// ```ignore,no_run
5417 /// # use google_cloud_datacatalog_v1::model::cloud_bigtable_instance_spec::CloudBigtableClusterSpec;
5418 /// let x = CloudBigtableClusterSpec::new().set_display_name("example");
5419 /// ```
5420 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
5421 mut self,
5422 v: T,
5423 ) -> Self {
5424 self.display_name = v.into();
5425 self
5426 }
5427
5428 /// Sets the value of [location][crate::model::cloud_bigtable_instance_spec::CloudBigtableClusterSpec::location].
5429 ///
5430 /// # Example
5431 /// ```ignore,no_run
5432 /// # use google_cloud_datacatalog_v1::model::cloud_bigtable_instance_spec::CloudBigtableClusterSpec;
5433 /// let x = CloudBigtableClusterSpec::new().set_location("example");
5434 /// ```
5435 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5436 self.location = v.into();
5437 self
5438 }
5439
5440 /// Sets the value of [r#type][crate::model::cloud_bigtable_instance_spec::CloudBigtableClusterSpec::type].
5441 ///
5442 /// # Example
5443 /// ```ignore,no_run
5444 /// # use google_cloud_datacatalog_v1::model::cloud_bigtable_instance_spec::CloudBigtableClusterSpec;
5445 /// let x = CloudBigtableClusterSpec::new().set_type("example");
5446 /// ```
5447 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5448 self.r#type = v.into();
5449 self
5450 }
5451
5452 /// Sets the value of [linked_resource][crate::model::cloud_bigtable_instance_spec::CloudBigtableClusterSpec::linked_resource].
5453 ///
5454 /// # Example
5455 /// ```ignore,no_run
5456 /// # use google_cloud_datacatalog_v1::model::cloud_bigtable_instance_spec::CloudBigtableClusterSpec;
5457 /// let x = CloudBigtableClusterSpec::new().set_linked_resource("example");
5458 /// ```
5459 pub fn set_linked_resource<T: std::convert::Into<std::string::String>>(
5460 mut self,
5461 v: T,
5462 ) -> Self {
5463 self.linked_resource = v.into();
5464 self
5465 }
5466 }
5467
5468 impl wkt::message::Message for CloudBigtableClusterSpec {
5469 fn typename() -> &'static str {
5470 "type.googleapis.com/google.cloud.datacatalog.v1.CloudBigtableInstanceSpec.CloudBigtableClusterSpec"
5471 }
5472 }
5473}
5474
5475/// Specification that applies to a Service resource. Valid only
5476/// for entries with the `SERVICE` type.
5477#[derive(Clone, Default, PartialEq)]
5478#[non_exhaustive]
5479pub struct ServiceSpec {
5480 /// System spec
5481 pub system_spec: std::option::Option<crate::model::service_spec::SystemSpec>,
5482
5483 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5484}
5485
5486impl ServiceSpec {
5487 pub fn new() -> Self {
5488 std::default::Default::default()
5489 }
5490
5491 /// Sets the value of [system_spec][crate::model::ServiceSpec::system_spec].
5492 ///
5493 /// Note that all the setters affecting `system_spec` are mutually
5494 /// exclusive.
5495 ///
5496 /// # Example
5497 /// ```ignore,no_run
5498 /// # use google_cloud_datacatalog_v1::model::ServiceSpec;
5499 /// use google_cloud_datacatalog_v1::model::CloudBigtableInstanceSpec;
5500 /// let x = ServiceSpec::new().set_system_spec(Some(
5501 /// google_cloud_datacatalog_v1::model::service_spec::SystemSpec::CloudBigtableInstanceSpec(CloudBigtableInstanceSpec::default().into())));
5502 /// ```
5503 pub fn set_system_spec<
5504 T: std::convert::Into<std::option::Option<crate::model::service_spec::SystemSpec>>,
5505 >(
5506 mut self,
5507 v: T,
5508 ) -> Self {
5509 self.system_spec = v.into();
5510 self
5511 }
5512
5513 /// The value of [system_spec][crate::model::ServiceSpec::system_spec]
5514 /// if it holds a `CloudBigtableInstanceSpec`, `None` if the field is not set or
5515 /// holds a different branch.
5516 pub fn cloud_bigtable_instance_spec(
5517 &self,
5518 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudBigtableInstanceSpec>> {
5519 #[allow(unreachable_patterns)]
5520 self.system_spec.as_ref().and_then(|v| match v {
5521 crate::model::service_spec::SystemSpec::CloudBigtableInstanceSpec(v) => {
5522 std::option::Option::Some(v)
5523 }
5524 _ => std::option::Option::None,
5525 })
5526 }
5527
5528 /// Sets the value of [system_spec][crate::model::ServiceSpec::system_spec]
5529 /// to hold a `CloudBigtableInstanceSpec`.
5530 ///
5531 /// Note that all the setters affecting `system_spec` are
5532 /// mutually exclusive.
5533 ///
5534 /// # Example
5535 /// ```ignore,no_run
5536 /// # use google_cloud_datacatalog_v1::model::ServiceSpec;
5537 /// use google_cloud_datacatalog_v1::model::CloudBigtableInstanceSpec;
5538 /// let x = ServiceSpec::new().set_cloud_bigtable_instance_spec(CloudBigtableInstanceSpec::default()/* use setters */);
5539 /// assert!(x.cloud_bigtable_instance_spec().is_some());
5540 /// ```
5541 pub fn set_cloud_bigtable_instance_spec<
5542 T: std::convert::Into<std::boxed::Box<crate::model::CloudBigtableInstanceSpec>>,
5543 >(
5544 mut self,
5545 v: T,
5546 ) -> Self {
5547 self.system_spec = std::option::Option::Some(
5548 crate::model::service_spec::SystemSpec::CloudBigtableInstanceSpec(v.into()),
5549 );
5550 self
5551 }
5552}
5553
5554impl wkt::message::Message for ServiceSpec {
5555 fn typename() -> &'static str {
5556 "type.googleapis.com/google.cloud.datacatalog.v1.ServiceSpec"
5557 }
5558}
5559
5560/// Defines additional types related to [ServiceSpec].
5561pub mod service_spec {
5562 #[allow(unused_imports)]
5563 use super::*;
5564
5565 /// System spec
5566 #[derive(Clone, Debug, PartialEq)]
5567 #[non_exhaustive]
5568 pub enum SystemSpec {
5569 /// Specification that applies to Instance entries of `CLOUD_BIGTABLE`
5570 /// system.
5571 CloudBigtableInstanceSpec(std::boxed::Box<crate::model::CloudBigtableInstanceSpec>),
5572 }
5573}
5574
5575/// Detail description of the source information of a Vertex model.
5576#[derive(Clone, Default, PartialEq)]
5577#[non_exhaustive]
5578pub struct VertexModelSourceInfo {
5579 /// Type of the model source.
5580 pub source_type: crate::model::vertex_model_source_info::ModelSourceType,
5581
5582 /// If this Model is copy of another Model. If true then
5583 /// [source_type][google.cloud.datacatalog.v1.VertexModelSourceInfo.source_type]
5584 /// pertains to the original.
5585 ///
5586 /// [google.cloud.datacatalog.v1.VertexModelSourceInfo.source_type]: crate::model::VertexModelSourceInfo::source_type
5587 pub copy: bool,
5588
5589 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5590}
5591
5592impl VertexModelSourceInfo {
5593 pub fn new() -> Self {
5594 std::default::Default::default()
5595 }
5596
5597 /// Sets the value of [source_type][crate::model::VertexModelSourceInfo::source_type].
5598 ///
5599 /// # Example
5600 /// ```ignore,no_run
5601 /// # use google_cloud_datacatalog_v1::model::VertexModelSourceInfo;
5602 /// use google_cloud_datacatalog_v1::model::vertex_model_source_info::ModelSourceType;
5603 /// let x0 = VertexModelSourceInfo::new().set_source_type(ModelSourceType::Automl);
5604 /// let x1 = VertexModelSourceInfo::new().set_source_type(ModelSourceType::Custom);
5605 /// let x2 = VertexModelSourceInfo::new().set_source_type(ModelSourceType::Bqml);
5606 /// ```
5607 pub fn set_source_type<
5608 T: std::convert::Into<crate::model::vertex_model_source_info::ModelSourceType>,
5609 >(
5610 mut self,
5611 v: T,
5612 ) -> Self {
5613 self.source_type = v.into();
5614 self
5615 }
5616
5617 /// Sets the value of [copy][crate::model::VertexModelSourceInfo::copy].
5618 ///
5619 /// # Example
5620 /// ```ignore,no_run
5621 /// # use google_cloud_datacatalog_v1::model::VertexModelSourceInfo;
5622 /// let x = VertexModelSourceInfo::new().set_copy(true);
5623 /// ```
5624 pub fn set_copy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5625 self.copy = v.into();
5626 self
5627 }
5628}
5629
5630impl wkt::message::Message for VertexModelSourceInfo {
5631 fn typename() -> &'static str {
5632 "type.googleapis.com/google.cloud.datacatalog.v1.VertexModelSourceInfo"
5633 }
5634}
5635
5636/// Defines additional types related to [VertexModelSourceInfo].
5637pub mod vertex_model_source_info {
5638 #[allow(unused_imports)]
5639 use super::*;
5640
5641 /// Source of the model.
5642 ///
5643 /// # Working with unknown values
5644 ///
5645 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5646 /// additional enum variants at any time. Adding new variants is not considered
5647 /// a breaking change. Applications should write their code in anticipation of:
5648 ///
5649 /// - New values appearing in future releases of the client library, **and**
5650 /// - New values received dynamically, without application changes.
5651 ///
5652 /// Please consult the [Working with enums] section in the user guide for some
5653 /// guidelines.
5654 ///
5655 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5656 #[derive(Clone, Debug, PartialEq)]
5657 #[non_exhaustive]
5658 pub enum ModelSourceType {
5659 /// Should not be used.
5660 Unspecified,
5661 /// The Model is uploaded by automl training pipeline.
5662 Automl,
5663 /// The Model is uploaded by user or custom training pipeline.
5664 Custom,
5665 /// The Model is registered and sync'ed from BigQuery ML.
5666 Bqml,
5667 /// The Model is saved or tuned from Model Garden.
5668 ModelGarden,
5669 /// The Model is saved or tuned from Genie.
5670 Genie,
5671 /// The Model is uploaded by text embedding finetuning pipeline.
5672 CustomTextEmbedding,
5673 /// The Model is saved or tuned from Marketplace.
5674 Marketplace,
5675 /// If set, the enum was initialized with an unknown value.
5676 ///
5677 /// Applications can examine the value using [ModelSourceType::value] or
5678 /// [ModelSourceType::name].
5679 UnknownValue(model_source_type::UnknownValue),
5680 }
5681
5682 #[doc(hidden)]
5683 pub mod model_source_type {
5684 #[allow(unused_imports)]
5685 use super::*;
5686 #[derive(Clone, Debug, PartialEq)]
5687 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5688 }
5689
5690 impl ModelSourceType {
5691 /// Gets the enum value.
5692 ///
5693 /// Returns `None` if the enum contains an unknown value deserialized from
5694 /// the string representation of enums.
5695 pub fn value(&self) -> std::option::Option<i32> {
5696 match self {
5697 Self::Unspecified => std::option::Option::Some(0),
5698 Self::Automl => std::option::Option::Some(1),
5699 Self::Custom => std::option::Option::Some(2),
5700 Self::Bqml => std::option::Option::Some(3),
5701 Self::ModelGarden => std::option::Option::Some(4),
5702 Self::Genie => std::option::Option::Some(5),
5703 Self::CustomTextEmbedding => std::option::Option::Some(6),
5704 Self::Marketplace => std::option::Option::Some(7),
5705 Self::UnknownValue(u) => u.0.value(),
5706 }
5707 }
5708
5709 /// Gets the enum value as a string.
5710 ///
5711 /// Returns `None` if the enum contains an unknown value deserialized from
5712 /// the integer representation of enums.
5713 pub fn name(&self) -> std::option::Option<&str> {
5714 match self {
5715 Self::Unspecified => std::option::Option::Some("MODEL_SOURCE_TYPE_UNSPECIFIED"),
5716 Self::Automl => std::option::Option::Some("AUTOML"),
5717 Self::Custom => std::option::Option::Some("CUSTOM"),
5718 Self::Bqml => std::option::Option::Some("BQML"),
5719 Self::ModelGarden => std::option::Option::Some("MODEL_GARDEN"),
5720 Self::Genie => std::option::Option::Some("GENIE"),
5721 Self::CustomTextEmbedding => std::option::Option::Some("CUSTOM_TEXT_EMBEDDING"),
5722 Self::Marketplace => std::option::Option::Some("MARKETPLACE"),
5723 Self::UnknownValue(u) => u.0.name(),
5724 }
5725 }
5726 }
5727
5728 impl std::default::Default for ModelSourceType {
5729 fn default() -> Self {
5730 use std::convert::From;
5731 Self::from(0)
5732 }
5733 }
5734
5735 impl std::fmt::Display for ModelSourceType {
5736 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5737 wkt::internal::display_enum(f, self.name(), self.value())
5738 }
5739 }
5740
5741 impl std::convert::From<i32> for ModelSourceType {
5742 fn from(value: i32) -> Self {
5743 match value {
5744 0 => Self::Unspecified,
5745 1 => Self::Automl,
5746 2 => Self::Custom,
5747 3 => Self::Bqml,
5748 4 => Self::ModelGarden,
5749 5 => Self::Genie,
5750 6 => Self::CustomTextEmbedding,
5751 7 => Self::Marketplace,
5752 _ => Self::UnknownValue(model_source_type::UnknownValue(
5753 wkt::internal::UnknownEnumValue::Integer(value),
5754 )),
5755 }
5756 }
5757 }
5758
5759 impl std::convert::From<&str> for ModelSourceType {
5760 fn from(value: &str) -> Self {
5761 use std::string::ToString;
5762 match value {
5763 "MODEL_SOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
5764 "AUTOML" => Self::Automl,
5765 "CUSTOM" => Self::Custom,
5766 "BQML" => Self::Bqml,
5767 "MODEL_GARDEN" => Self::ModelGarden,
5768 "GENIE" => Self::Genie,
5769 "CUSTOM_TEXT_EMBEDDING" => Self::CustomTextEmbedding,
5770 "MARKETPLACE" => Self::Marketplace,
5771 _ => Self::UnknownValue(model_source_type::UnknownValue(
5772 wkt::internal::UnknownEnumValue::String(value.to_string()),
5773 )),
5774 }
5775 }
5776 }
5777
5778 impl serde::ser::Serialize for ModelSourceType {
5779 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5780 where
5781 S: serde::Serializer,
5782 {
5783 match self {
5784 Self::Unspecified => serializer.serialize_i32(0),
5785 Self::Automl => serializer.serialize_i32(1),
5786 Self::Custom => serializer.serialize_i32(2),
5787 Self::Bqml => serializer.serialize_i32(3),
5788 Self::ModelGarden => serializer.serialize_i32(4),
5789 Self::Genie => serializer.serialize_i32(5),
5790 Self::CustomTextEmbedding => serializer.serialize_i32(6),
5791 Self::Marketplace => serializer.serialize_i32(7),
5792 Self::UnknownValue(u) => u.0.serialize(serializer),
5793 }
5794 }
5795 }
5796
5797 impl<'de> serde::de::Deserialize<'de> for ModelSourceType {
5798 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5799 where
5800 D: serde::Deserializer<'de>,
5801 {
5802 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ModelSourceType>::new(
5803 ".google.cloud.datacatalog.v1.VertexModelSourceInfo.ModelSourceType",
5804 ))
5805 }
5806 }
5807}
5808
5809/// Specification for vertex model resources.
5810#[derive(Clone, Default, PartialEq)]
5811#[non_exhaustive]
5812pub struct VertexModelSpec {
5813 /// The version ID of the model.
5814 pub version_id: std::string::String,
5815
5816 /// User provided version aliases so that a model version can be referenced via
5817 /// alias
5818 pub version_aliases: std::vec::Vec<std::string::String>,
5819
5820 /// The description of this version.
5821 pub version_description: std::string::String,
5822
5823 /// Source of a Vertex model.
5824 pub vertex_model_source_info: std::option::Option<crate::model::VertexModelSourceInfo>,
5825
5826 /// URI of the Docker image to be used as the custom container for serving
5827 /// predictions.
5828 pub container_image_uri: std::string::String,
5829
5830 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5831}
5832
5833impl VertexModelSpec {
5834 pub fn new() -> Self {
5835 std::default::Default::default()
5836 }
5837
5838 /// Sets the value of [version_id][crate::model::VertexModelSpec::version_id].
5839 ///
5840 /// # Example
5841 /// ```ignore,no_run
5842 /// # use google_cloud_datacatalog_v1::model::VertexModelSpec;
5843 /// let x = VertexModelSpec::new().set_version_id("example");
5844 /// ```
5845 pub fn set_version_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5846 self.version_id = v.into();
5847 self
5848 }
5849
5850 /// Sets the value of [version_aliases][crate::model::VertexModelSpec::version_aliases].
5851 ///
5852 /// # Example
5853 /// ```ignore,no_run
5854 /// # use google_cloud_datacatalog_v1::model::VertexModelSpec;
5855 /// let x = VertexModelSpec::new().set_version_aliases(["a", "b", "c"]);
5856 /// ```
5857 pub fn set_version_aliases<T, V>(mut self, v: T) -> Self
5858 where
5859 T: std::iter::IntoIterator<Item = V>,
5860 V: std::convert::Into<std::string::String>,
5861 {
5862 use std::iter::Iterator;
5863 self.version_aliases = v.into_iter().map(|i| i.into()).collect();
5864 self
5865 }
5866
5867 /// Sets the value of [version_description][crate::model::VertexModelSpec::version_description].
5868 ///
5869 /// # Example
5870 /// ```ignore,no_run
5871 /// # use google_cloud_datacatalog_v1::model::VertexModelSpec;
5872 /// let x = VertexModelSpec::new().set_version_description("example");
5873 /// ```
5874 pub fn set_version_description<T: std::convert::Into<std::string::String>>(
5875 mut self,
5876 v: T,
5877 ) -> Self {
5878 self.version_description = v.into();
5879 self
5880 }
5881
5882 /// Sets the value of [vertex_model_source_info][crate::model::VertexModelSpec::vertex_model_source_info].
5883 ///
5884 /// # Example
5885 /// ```ignore,no_run
5886 /// # use google_cloud_datacatalog_v1::model::VertexModelSpec;
5887 /// use google_cloud_datacatalog_v1::model::VertexModelSourceInfo;
5888 /// let x = VertexModelSpec::new().set_vertex_model_source_info(VertexModelSourceInfo::default()/* use setters */);
5889 /// ```
5890 pub fn set_vertex_model_source_info<T>(mut self, v: T) -> Self
5891 where
5892 T: std::convert::Into<crate::model::VertexModelSourceInfo>,
5893 {
5894 self.vertex_model_source_info = std::option::Option::Some(v.into());
5895 self
5896 }
5897
5898 /// Sets or clears the value of [vertex_model_source_info][crate::model::VertexModelSpec::vertex_model_source_info].
5899 ///
5900 /// # Example
5901 /// ```ignore,no_run
5902 /// # use google_cloud_datacatalog_v1::model::VertexModelSpec;
5903 /// use google_cloud_datacatalog_v1::model::VertexModelSourceInfo;
5904 /// let x = VertexModelSpec::new().set_or_clear_vertex_model_source_info(Some(VertexModelSourceInfo::default()/* use setters */));
5905 /// let x = VertexModelSpec::new().set_or_clear_vertex_model_source_info(None::<VertexModelSourceInfo>);
5906 /// ```
5907 pub fn set_or_clear_vertex_model_source_info<T>(mut self, v: std::option::Option<T>) -> Self
5908 where
5909 T: std::convert::Into<crate::model::VertexModelSourceInfo>,
5910 {
5911 self.vertex_model_source_info = v.map(|x| x.into());
5912 self
5913 }
5914
5915 /// Sets the value of [container_image_uri][crate::model::VertexModelSpec::container_image_uri].
5916 ///
5917 /// # Example
5918 /// ```ignore,no_run
5919 /// # use google_cloud_datacatalog_v1::model::VertexModelSpec;
5920 /// let x = VertexModelSpec::new().set_container_image_uri("example");
5921 /// ```
5922 pub fn set_container_image_uri<T: std::convert::Into<std::string::String>>(
5923 mut self,
5924 v: T,
5925 ) -> Self {
5926 self.container_image_uri = v.into();
5927 self
5928 }
5929}
5930
5931impl wkt::message::Message for VertexModelSpec {
5932 fn typename() -> &'static str {
5933 "type.googleapis.com/google.cloud.datacatalog.v1.VertexModelSpec"
5934 }
5935}
5936
5937/// Specification for vertex dataset resources.
5938#[derive(Clone, Default, PartialEq)]
5939#[non_exhaustive]
5940pub struct VertexDatasetSpec {
5941 /// The number of DataItems in this Dataset. Only apply for non-structured
5942 /// Dataset.
5943 pub data_item_count: i64,
5944
5945 /// Type of the dataset.
5946 pub data_type: crate::model::vertex_dataset_spec::DataType,
5947
5948 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5949}
5950
5951impl VertexDatasetSpec {
5952 pub fn new() -> Self {
5953 std::default::Default::default()
5954 }
5955
5956 /// Sets the value of [data_item_count][crate::model::VertexDatasetSpec::data_item_count].
5957 ///
5958 /// # Example
5959 /// ```ignore,no_run
5960 /// # use google_cloud_datacatalog_v1::model::VertexDatasetSpec;
5961 /// let x = VertexDatasetSpec::new().set_data_item_count(42);
5962 /// ```
5963 pub fn set_data_item_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5964 self.data_item_count = v.into();
5965 self
5966 }
5967
5968 /// Sets the value of [data_type][crate::model::VertexDatasetSpec::data_type].
5969 ///
5970 /// # Example
5971 /// ```ignore,no_run
5972 /// # use google_cloud_datacatalog_v1::model::VertexDatasetSpec;
5973 /// use google_cloud_datacatalog_v1::model::vertex_dataset_spec::DataType;
5974 /// let x0 = VertexDatasetSpec::new().set_data_type(DataType::Table);
5975 /// let x1 = VertexDatasetSpec::new().set_data_type(DataType::Image);
5976 /// let x2 = VertexDatasetSpec::new().set_data_type(DataType::Text);
5977 /// ```
5978 pub fn set_data_type<T: std::convert::Into<crate::model::vertex_dataset_spec::DataType>>(
5979 mut self,
5980 v: T,
5981 ) -> Self {
5982 self.data_type = v.into();
5983 self
5984 }
5985}
5986
5987impl wkt::message::Message for VertexDatasetSpec {
5988 fn typename() -> &'static str {
5989 "type.googleapis.com/google.cloud.datacatalog.v1.VertexDatasetSpec"
5990 }
5991}
5992
5993/// Defines additional types related to [VertexDatasetSpec].
5994pub mod vertex_dataset_spec {
5995 #[allow(unused_imports)]
5996 use super::*;
5997
5998 /// Type of data stored in the dataset.
5999 ///
6000 /// # Working with unknown values
6001 ///
6002 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6003 /// additional enum variants at any time. Adding new variants is not considered
6004 /// a breaking change. Applications should write their code in anticipation of:
6005 ///
6006 /// - New values appearing in future releases of the client library, **and**
6007 /// - New values received dynamically, without application changes.
6008 ///
6009 /// Please consult the [Working with enums] section in the user guide for some
6010 /// guidelines.
6011 ///
6012 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6013 #[derive(Clone, Debug, PartialEq)]
6014 #[non_exhaustive]
6015 pub enum DataType {
6016 /// Should not be used.
6017 Unspecified,
6018 /// Structured data dataset.
6019 Table,
6020 /// Image dataset which supports ImageClassification, ImageObjectDetection
6021 /// and ImageSegmentation problems.
6022 Image,
6023 /// Document dataset which supports TextClassification, TextExtraction and
6024 /// TextSentiment problems.
6025 Text,
6026 /// Video dataset which supports VideoClassification, VideoObjectTracking and
6027 /// VideoActionRecognition problems.
6028 Video,
6029 /// Conversation dataset which supports conversation problems.
6030 Conversation,
6031 /// TimeSeries dataset.
6032 TimeSeries,
6033 /// Document dataset which supports DocumentAnnotation problems.
6034 Document,
6035 /// TextToSpeech dataset which supports TextToSpeech problems.
6036 TextToSpeech,
6037 /// Translation dataset which supports Translation problems.
6038 Translation,
6039 /// Store Vision dataset which is used for HITL integration.
6040 StoreVision,
6041 /// Enterprise Knowledge Graph dataset which is used for HITL labeling
6042 /// integration.
6043 EnterpriseKnowledgeGraph,
6044 /// Text prompt dataset which supports Large Language Models.
6045 TextPrompt,
6046 /// If set, the enum was initialized with an unknown value.
6047 ///
6048 /// Applications can examine the value using [DataType::value] or
6049 /// [DataType::name].
6050 UnknownValue(data_type::UnknownValue),
6051 }
6052
6053 #[doc(hidden)]
6054 pub mod data_type {
6055 #[allow(unused_imports)]
6056 use super::*;
6057 #[derive(Clone, Debug, PartialEq)]
6058 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6059 }
6060
6061 impl DataType {
6062 /// Gets the enum value.
6063 ///
6064 /// Returns `None` if the enum contains an unknown value deserialized from
6065 /// the string representation of enums.
6066 pub fn value(&self) -> std::option::Option<i32> {
6067 match self {
6068 Self::Unspecified => std::option::Option::Some(0),
6069 Self::Table => std::option::Option::Some(1),
6070 Self::Image => std::option::Option::Some(2),
6071 Self::Text => std::option::Option::Some(3),
6072 Self::Video => std::option::Option::Some(4),
6073 Self::Conversation => std::option::Option::Some(5),
6074 Self::TimeSeries => std::option::Option::Some(6),
6075 Self::Document => std::option::Option::Some(7),
6076 Self::TextToSpeech => std::option::Option::Some(8),
6077 Self::Translation => std::option::Option::Some(9),
6078 Self::StoreVision => std::option::Option::Some(10),
6079 Self::EnterpriseKnowledgeGraph => std::option::Option::Some(11),
6080 Self::TextPrompt => std::option::Option::Some(12),
6081 Self::UnknownValue(u) => u.0.value(),
6082 }
6083 }
6084
6085 /// Gets the enum value as a string.
6086 ///
6087 /// Returns `None` if the enum contains an unknown value deserialized from
6088 /// the integer representation of enums.
6089 pub fn name(&self) -> std::option::Option<&str> {
6090 match self {
6091 Self::Unspecified => std::option::Option::Some("DATA_TYPE_UNSPECIFIED"),
6092 Self::Table => std::option::Option::Some("TABLE"),
6093 Self::Image => std::option::Option::Some("IMAGE"),
6094 Self::Text => std::option::Option::Some("TEXT"),
6095 Self::Video => std::option::Option::Some("VIDEO"),
6096 Self::Conversation => std::option::Option::Some("CONVERSATION"),
6097 Self::TimeSeries => std::option::Option::Some("TIME_SERIES"),
6098 Self::Document => std::option::Option::Some("DOCUMENT"),
6099 Self::TextToSpeech => std::option::Option::Some("TEXT_TO_SPEECH"),
6100 Self::Translation => std::option::Option::Some("TRANSLATION"),
6101 Self::StoreVision => std::option::Option::Some("STORE_VISION"),
6102 Self::EnterpriseKnowledgeGraph => {
6103 std::option::Option::Some("ENTERPRISE_KNOWLEDGE_GRAPH")
6104 }
6105 Self::TextPrompt => std::option::Option::Some("TEXT_PROMPT"),
6106 Self::UnknownValue(u) => u.0.name(),
6107 }
6108 }
6109 }
6110
6111 impl std::default::Default for DataType {
6112 fn default() -> Self {
6113 use std::convert::From;
6114 Self::from(0)
6115 }
6116 }
6117
6118 impl std::fmt::Display for DataType {
6119 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6120 wkt::internal::display_enum(f, self.name(), self.value())
6121 }
6122 }
6123
6124 impl std::convert::From<i32> for DataType {
6125 fn from(value: i32) -> Self {
6126 match value {
6127 0 => Self::Unspecified,
6128 1 => Self::Table,
6129 2 => Self::Image,
6130 3 => Self::Text,
6131 4 => Self::Video,
6132 5 => Self::Conversation,
6133 6 => Self::TimeSeries,
6134 7 => Self::Document,
6135 8 => Self::TextToSpeech,
6136 9 => Self::Translation,
6137 10 => Self::StoreVision,
6138 11 => Self::EnterpriseKnowledgeGraph,
6139 12 => Self::TextPrompt,
6140 _ => Self::UnknownValue(data_type::UnknownValue(
6141 wkt::internal::UnknownEnumValue::Integer(value),
6142 )),
6143 }
6144 }
6145 }
6146
6147 impl std::convert::From<&str> for DataType {
6148 fn from(value: &str) -> Self {
6149 use std::string::ToString;
6150 match value {
6151 "DATA_TYPE_UNSPECIFIED" => Self::Unspecified,
6152 "TABLE" => Self::Table,
6153 "IMAGE" => Self::Image,
6154 "TEXT" => Self::Text,
6155 "VIDEO" => Self::Video,
6156 "CONVERSATION" => Self::Conversation,
6157 "TIME_SERIES" => Self::TimeSeries,
6158 "DOCUMENT" => Self::Document,
6159 "TEXT_TO_SPEECH" => Self::TextToSpeech,
6160 "TRANSLATION" => Self::Translation,
6161 "STORE_VISION" => Self::StoreVision,
6162 "ENTERPRISE_KNOWLEDGE_GRAPH" => Self::EnterpriseKnowledgeGraph,
6163 "TEXT_PROMPT" => Self::TextPrompt,
6164 _ => Self::UnknownValue(data_type::UnknownValue(
6165 wkt::internal::UnknownEnumValue::String(value.to_string()),
6166 )),
6167 }
6168 }
6169 }
6170
6171 impl serde::ser::Serialize for DataType {
6172 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6173 where
6174 S: serde::Serializer,
6175 {
6176 match self {
6177 Self::Unspecified => serializer.serialize_i32(0),
6178 Self::Table => serializer.serialize_i32(1),
6179 Self::Image => serializer.serialize_i32(2),
6180 Self::Text => serializer.serialize_i32(3),
6181 Self::Video => serializer.serialize_i32(4),
6182 Self::Conversation => serializer.serialize_i32(5),
6183 Self::TimeSeries => serializer.serialize_i32(6),
6184 Self::Document => serializer.serialize_i32(7),
6185 Self::TextToSpeech => serializer.serialize_i32(8),
6186 Self::Translation => serializer.serialize_i32(9),
6187 Self::StoreVision => serializer.serialize_i32(10),
6188 Self::EnterpriseKnowledgeGraph => serializer.serialize_i32(11),
6189 Self::TextPrompt => serializer.serialize_i32(12),
6190 Self::UnknownValue(u) => u.0.serialize(serializer),
6191 }
6192 }
6193 }
6194
6195 impl<'de> serde::de::Deserialize<'de> for DataType {
6196 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6197 where
6198 D: serde::Deserializer<'de>,
6199 {
6200 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataType>::new(
6201 ".google.cloud.datacatalog.v1.VertexDatasetSpec.DataType",
6202 ))
6203 }
6204 }
6205}
6206
6207/// Specification that applies to a model. Valid only for
6208/// entries with the `MODEL` type.
6209#[derive(Clone, Default, PartialEq)]
6210#[non_exhaustive]
6211pub struct ModelSpec {
6212 /// System spec
6213 pub system_spec: std::option::Option<crate::model::model_spec::SystemSpec>,
6214
6215 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6216}
6217
6218impl ModelSpec {
6219 pub fn new() -> Self {
6220 std::default::Default::default()
6221 }
6222
6223 /// Sets the value of [system_spec][crate::model::ModelSpec::system_spec].
6224 ///
6225 /// Note that all the setters affecting `system_spec` are mutually
6226 /// exclusive.
6227 ///
6228 /// # Example
6229 /// ```ignore,no_run
6230 /// # use google_cloud_datacatalog_v1::model::ModelSpec;
6231 /// use google_cloud_datacatalog_v1::model::VertexModelSpec;
6232 /// let x = ModelSpec::new().set_system_spec(Some(
6233 /// google_cloud_datacatalog_v1::model::model_spec::SystemSpec::VertexModelSpec(VertexModelSpec::default().into())));
6234 /// ```
6235 pub fn set_system_spec<
6236 T: std::convert::Into<std::option::Option<crate::model::model_spec::SystemSpec>>,
6237 >(
6238 mut self,
6239 v: T,
6240 ) -> Self {
6241 self.system_spec = v.into();
6242 self
6243 }
6244
6245 /// The value of [system_spec][crate::model::ModelSpec::system_spec]
6246 /// if it holds a `VertexModelSpec`, `None` if the field is not set or
6247 /// holds a different branch.
6248 pub fn vertex_model_spec(
6249 &self,
6250 ) -> std::option::Option<&std::boxed::Box<crate::model::VertexModelSpec>> {
6251 #[allow(unreachable_patterns)]
6252 self.system_spec.as_ref().and_then(|v| match v {
6253 crate::model::model_spec::SystemSpec::VertexModelSpec(v) => {
6254 std::option::Option::Some(v)
6255 }
6256 _ => std::option::Option::None,
6257 })
6258 }
6259
6260 /// Sets the value of [system_spec][crate::model::ModelSpec::system_spec]
6261 /// to hold a `VertexModelSpec`.
6262 ///
6263 /// Note that all the setters affecting `system_spec` are
6264 /// mutually exclusive.
6265 ///
6266 /// # Example
6267 /// ```ignore,no_run
6268 /// # use google_cloud_datacatalog_v1::model::ModelSpec;
6269 /// use google_cloud_datacatalog_v1::model::VertexModelSpec;
6270 /// let x = ModelSpec::new().set_vertex_model_spec(VertexModelSpec::default()/* use setters */);
6271 /// assert!(x.vertex_model_spec().is_some());
6272 /// ```
6273 pub fn set_vertex_model_spec<
6274 T: std::convert::Into<std::boxed::Box<crate::model::VertexModelSpec>>,
6275 >(
6276 mut self,
6277 v: T,
6278 ) -> Self {
6279 self.system_spec = std::option::Option::Some(
6280 crate::model::model_spec::SystemSpec::VertexModelSpec(v.into()),
6281 );
6282 self
6283 }
6284}
6285
6286impl wkt::message::Message for ModelSpec {
6287 fn typename() -> &'static str {
6288 "type.googleapis.com/google.cloud.datacatalog.v1.ModelSpec"
6289 }
6290}
6291
6292/// Defines additional types related to [ModelSpec].
6293pub mod model_spec {
6294 #[allow(unused_imports)]
6295 use super::*;
6296
6297 /// System spec
6298 #[derive(Clone, Debug, PartialEq)]
6299 #[non_exhaustive]
6300 pub enum SystemSpec {
6301 /// Specification for vertex model resources.
6302 VertexModelSpec(std::boxed::Box<crate::model::VertexModelSpec>),
6303 }
6304}
6305
6306/// Detail description of the source information of a Vertex Feature Online
6307/// Store.
6308#[derive(Clone, Default, PartialEq)]
6309#[non_exhaustive]
6310pub struct FeatureOnlineStoreSpec {
6311 /// Output only. Type of underlying storage for the FeatureOnlineStore.
6312 pub storage_type: crate::model::feature_online_store_spec::StorageType,
6313
6314 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6315}
6316
6317impl FeatureOnlineStoreSpec {
6318 pub fn new() -> Self {
6319 std::default::Default::default()
6320 }
6321
6322 /// Sets the value of [storage_type][crate::model::FeatureOnlineStoreSpec::storage_type].
6323 ///
6324 /// # Example
6325 /// ```ignore,no_run
6326 /// # use google_cloud_datacatalog_v1::model::FeatureOnlineStoreSpec;
6327 /// use google_cloud_datacatalog_v1::model::feature_online_store_spec::StorageType;
6328 /// let x0 = FeatureOnlineStoreSpec::new().set_storage_type(StorageType::Bigtable);
6329 /// let x1 = FeatureOnlineStoreSpec::new().set_storage_type(StorageType::Optimized);
6330 /// ```
6331 pub fn set_storage_type<
6332 T: std::convert::Into<crate::model::feature_online_store_spec::StorageType>,
6333 >(
6334 mut self,
6335 v: T,
6336 ) -> Self {
6337 self.storage_type = v.into();
6338 self
6339 }
6340}
6341
6342impl wkt::message::Message for FeatureOnlineStoreSpec {
6343 fn typename() -> &'static str {
6344 "type.googleapis.com/google.cloud.datacatalog.v1.FeatureOnlineStoreSpec"
6345 }
6346}
6347
6348/// Defines additional types related to [FeatureOnlineStoreSpec].
6349pub mod feature_online_store_spec {
6350 #[allow(unused_imports)]
6351 use super::*;
6352
6353 /// Type of underlying storage type.
6354 ///
6355 /// # Working with unknown values
6356 ///
6357 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6358 /// additional enum variants at any time. Adding new variants is not considered
6359 /// a breaking change. Applications should write their code in anticipation of:
6360 ///
6361 /// - New values appearing in future releases of the client library, **and**
6362 /// - New values received dynamically, without application changes.
6363 ///
6364 /// Please consult the [Working with enums] section in the user guide for some
6365 /// guidelines.
6366 ///
6367 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6368 #[derive(Clone, Debug, PartialEq)]
6369 #[non_exhaustive]
6370 pub enum StorageType {
6371 /// Should not be used.
6372 Unspecified,
6373 /// Underlsying storgae is Bigtable.
6374 Bigtable,
6375 /// Underlying is optimized online server (Lightning).
6376 Optimized,
6377 /// If set, the enum was initialized with an unknown value.
6378 ///
6379 /// Applications can examine the value using [StorageType::value] or
6380 /// [StorageType::name].
6381 UnknownValue(storage_type::UnknownValue),
6382 }
6383
6384 #[doc(hidden)]
6385 pub mod storage_type {
6386 #[allow(unused_imports)]
6387 use super::*;
6388 #[derive(Clone, Debug, PartialEq)]
6389 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6390 }
6391
6392 impl StorageType {
6393 /// Gets the enum value.
6394 ///
6395 /// Returns `None` if the enum contains an unknown value deserialized from
6396 /// the string representation of enums.
6397 pub fn value(&self) -> std::option::Option<i32> {
6398 match self {
6399 Self::Unspecified => std::option::Option::Some(0),
6400 Self::Bigtable => std::option::Option::Some(1),
6401 Self::Optimized => std::option::Option::Some(2),
6402 Self::UnknownValue(u) => u.0.value(),
6403 }
6404 }
6405
6406 /// Gets the enum value as a string.
6407 ///
6408 /// Returns `None` if the enum contains an unknown value deserialized from
6409 /// the integer representation of enums.
6410 pub fn name(&self) -> std::option::Option<&str> {
6411 match self {
6412 Self::Unspecified => std::option::Option::Some("STORAGE_TYPE_UNSPECIFIED"),
6413 Self::Bigtable => std::option::Option::Some("BIGTABLE"),
6414 Self::Optimized => std::option::Option::Some("OPTIMIZED"),
6415 Self::UnknownValue(u) => u.0.name(),
6416 }
6417 }
6418 }
6419
6420 impl std::default::Default for StorageType {
6421 fn default() -> Self {
6422 use std::convert::From;
6423 Self::from(0)
6424 }
6425 }
6426
6427 impl std::fmt::Display for StorageType {
6428 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6429 wkt::internal::display_enum(f, self.name(), self.value())
6430 }
6431 }
6432
6433 impl std::convert::From<i32> for StorageType {
6434 fn from(value: i32) -> Self {
6435 match value {
6436 0 => Self::Unspecified,
6437 1 => Self::Bigtable,
6438 2 => Self::Optimized,
6439 _ => Self::UnknownValue(storage_type::UnknownValue(
6440 wkt::internal::UnknownEnumValue::Integer(value),
6441 )),
6442 }
6443 }
6444 }
6445
6446 impl std::convert::From<&str> for StorageType {
6447 fn from(value: &str) -> Self {
6448 use std::string::ToString;
6449 match value {
6450 "STORAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
6451 "BIGTABLE" => Self::Bigtable,
6452 "OPTIMIZED" => Self::Optimized,
6453 _ => Self::UnknownValue(storage_type::UnknownValue(
6454 wkt::internal::UnknownEnumValue::String(value.to_string()),
6455 )),
6456 }
6457 }
6458 }
6459
6460 impl serde::ser::Serialize for StorageType {
6461 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6462 where
6463 S: serde::Serializer,
6464 {
6465 match self {
6466 Self::Unspecified => serializer.serialize_i32(0),
6467 Self::Bigtable => serializer.serialize_i32(1),
6468 Self::Optimized => serializer.serialize_i32(2),
6469 Self::UnknownValue(u) => u.0.serialize(serializer),
6470 }
6471 }
6472 }
6473
6474 impl<'de> serde::de::Deserialize<'de> for StorageType {
6475 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6476 where
6477 D: serde::Deserializer<'de>,
6478 {
6479 deserializer.deserialize_any(wkt::internal::EnumVisitor::<StorageType>::new(
6480 ".google.cloud.datacatalog.v1.FeatureOnlineStoreSpec.StorageType",
6481 ))
6482 }
6483 }
6484}
6485
6486/// Business Context of the entry.
6487#[derive(Clone, Default, PartialEq)]
6488#[non_exhaustive]
6489pub struct BusinessContext {
6490 /// Entry overview fields for rich text descriptions of entries.
6491 pub entry_overview: std::option::Option<crate::model::EntryOverview>,
6492
6493 /// Contact people for the entry.
6494 pub contacts: std::option::Option<crate::model::Contacts>,
6495
6496 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6497}
6498
6499impl BusinessContext {
6500 pub fn new() -> Self {
6501 std::default::Default::default()
6502 }
6503
6504 /// Sets the value of [entry_overview][crate::model::BusinessContext::entry_overview].
6505 ///
6506 /// # Example
6507 /// ```ignore,no_run
6508 /// # use google_cloud_datacatalog_v1::model::BusinessContext;
6509 /// use google_cloud_datacatalog_v1::model::EntryOverview;
6510 /// let x = BusinessContext::new().set_entry_overview(EntryOverview::default()/* use setters */);
6511 /// ```
6512 pub fn set_entry_overview<T>(mut self, v: T) -> Self
6513 where
6514 T: std::convert::Into<crate::model::EntryOverview>,
6515 {
6516 self.entry_overview = std::option::Option::Some(v.into());
6517 self
6518 }
6519
6520 /// Sets or clears the value of [entry_overview][crate::model::BusinessContext::entry_overview].
6521 ///
6522 /// # Example
6523 /// ```ignore,no_run
6524 /// # use google_cloud_datacatalog_v1::model::BusinessContext;
6525 /// use google_cloud_datacatalog_v1::model::EntryOverview;
6526 /// let x = BusinessContext::new().set_or_clear_entry_overview(Some(EntryOverview::default()/* use setters */));
6527 /// let x = BusinessContext::new().set_or_clear_entry_overview(None::<EntryOverview>);
6528 /// ```
6529 pub fn set_or_clear_entry_overview<T>(mut self, v: std::option::Option<T>) -> Self
6530 where
6531 T: std::convert::Into<crate::model::EntryOverview>,
6532 {
6533 self.entry_overview = v.map(|x| x.into());
6534 self
6535 }
6536
6537 /// Sets the value of [contacts][crate::model::BusinessContext::contacts].
6538 ///
6539 /// # Example
6540 /// ```ignore,no_run
6541 /// # use google_cloud_datacatalog_v1::model::BusinessContext;
6542 /// use google_cloud_datacatalog_v1::model::Contacts;
6543 /// let x = BusinessContext::new().set_contacts(Contacts::default()/* use setters */);
6544 /// ```
6545 pub fn set_contacts<T>(mut self, v: T) -> Self
6546 where
6547 T: std::convert::Into<crate::model::Contacts>,
6548 {
6549 self.contacts = std::option::Option::Some(v.into());
6550 self
6551 }
6552
6553 /// Sets or clears the value of [contacts][crate::model::BusinessContext::contacts].
6554 ///
6555 /// # Example
6556 /// ```ignore,no_run
6557 /// # use google_cloud_datacatalog_v1::model::BusinessContext;
6558 /// use google_cloud_datacatalog_v1::model::Contacts;
6559 /// let x = BusinessContext::new().set_or_clear_contacts(Some(Contacts::default()/* use setters */));
6560 /// let x = BusinessContext::new().set_or_clear_contacts(None::<Contacts>);
6561 /// ```
6562 pub fn set_or_clear_contacts<T>(mut self, v: std::option::Option<T>) -> Self
6563 where
6564 T: std::convert::Into<crate::model::Contacts>,
6565 {
6566 self.contacts = v.map(|x| x.into());
6567 self
6568 }
6569}
6570
6571impl wkt::message::Message for BusinessContext {
6572 fn typename() -> &'static str {
6573 "type.googleapis.com/google.cloud.datacatalog.v1.BusinessContext"
6574 }
6575}
6576
6577/// Entry overview fields for rich text descriptions of entries.
6578#[derive(Clone, Default, PartialEq)]
6579#[non_exhaustive]
6580pub struct EntryOverview {
6581 /// Entry overview with support for rich text.
6582 ///
6583 /// The overview must only contain Unicode characters, and should be
6584 /// formatted using HTML.
6585 /// The maximum length is 10 MiB as this value holds HTML descriptions
6586 /// including encoded images. The maximum length of the text without images
6587 /// is 100 KiB.
6588 pub overview: std::string::String,
6589
6590 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6591}
6592
6593impl EntryOverview {
6594 pub fn new() -> Self {
6595 std::default::Default::default()
6596 }
6597
6598 /// Sets the value of [overview][crate::model::EntryOverview::overview].
6599 ///
6600 /// # Example
6601 /// ```ignore,no_run
6602 /// # use google_cloud_datacatalog_v1::model::EntryOverview;
6603 /// let x = EntryOverview::new().set_overview("example");
6604 /// ```
6605 pub fn set_overview<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6606 self.overview = v.into();
6607 self
6608 }
6609}
6610
6611impl wkt::message::Message for EntryOverview {
6612 fn typename() -> &'static str {
6613 "type.googleapis.com/google.cloud.datacatalog.v1.EntryOverview"
6614 }
6615}
6616
6617/// Contact people for the entry.
6618#[derive(Clone, Default, PartialEq)]
6619#[non_exhaustive]
6620pub struct Contacts {
6621 /// The list of contact people for the entry.
6622 pub people: std::vec::Vec<crate::model::contacts::Person>,
6623
6624 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6625}
6626
6627impl Contacts {
6628 pub fn new() -> Self {
6629 std::default::Default::default()
6630 }
6631
6632 /// Sets the value of [people][crate::model::Contacts::people].
6633 ///
6634 /// # Example
6635 /// ```ignore,no_run
6636 /// # use google_cloud_datacatalog_v1::model::Contacts;
6637 /// use google_cloud_datacatalog_v1::model::contacts::Person;
6638 /// let x = Contacts::new()
6639 /// .set_people([
6640 /// Person::default()/* use setters */,
6641 /// Person::default()/* use (different) setters */,
6642 /// ]);
6643 /// ```
6644 pub fn set_people<T, V>(mut self, v: T) -> Self
6645 where
6646 T: std::iter::IntoIterator<Item = V>,
6647 V: std::convert::Into<crate::model::contacts::Person>,
6648 {
6649 use std::iter::Iterator;
6650 self.people = v.into_iter().map(|i| i.into()).collect();
6651 self
6652 }
6653}
6654
6655impl wkt::message::Message for Contacts {
6656 fn typename() -> &'static str {
6657 "type.googleapis.com/google.cloud.datacatalog.v1.Contacts"
6658 }
6659}
6660
6661/// Defines additional types related to [Contacts].
6662pub mod contacts {
6663 #[allow(unused_imports)]
6664 use super::*;
6665
6666 /// A contact person for the entry.
6667 #[derive(Clone, Default, PartialEq)]
6668 #[non_exhaustive]
6669 pub struct Person {
6670 /// Designation of the person, for example, Data Steward.
6671 pub designation: std::string::String,
6672
6673 /// Email of the person in the format of `john.doe@xyz`,
6674 /// `<john.doe@xyz>`, or `John Doe<john.doe@xyz>`.
6675 pub email: std::string::String,
6676
6677 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6678 }
6679
6680 impl Person {
6681 pub fn new() -> Self {
6682 std::default::Default::default()
6683 }
6684
6685 /// Sets the value of [designation][crate::model::contacts::Person::designation].
6686 ///
6687 /// # Example
6688 /// ```ignore,no_run
6689 /// # use google_cloud_datacatalog_v1::model::contacts::Person;
6690 /// let x = Person::new().set_designation("example");
6691 /// ```
6692 pub fn set_designation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6693 self.designation = v.into();
6694 self
6695 }
6696
6697 /// Sets the value of [email][crate::model::contacts::Person::email].
6698 ///
6699 /// # Example
6700 /// ```ignore,no_run
6701 /// # use google_cloud_datacatalog_v1::model::contacts::Person;
6702 /// let x = Person::new().set_email("example");
6703 /// ```
6704 pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6705 self.email = v.into();
6706 self
6707 }
6708 }
6709
6710 impl wkt::message::Message for Person {
6711 fn typename() -> &'static str {
6712 "type.googleapis.com/google.cloud.datacatalog.v1.Contacts.Person"
6713 }
6714 }
6715}
6716
6717/// Entry group metadata.
6718///
6719/// An `EntryGroup` resource represents a logical grouping of zero or more
6720/// Data Catalog [Entry][google.cloud.datacatalog.v1.Entry] resources.
6721///
6722/// [google.cloud.datacatalog.v1.Entry]: crate::model::Entry
6723#[derive(Clone, Default, PartialEq)]
6724#[non_exhaustive]
6725pub struct EntryGroup {
6726 /// Identifier. The resource name of the entry group in URL format.
6727 ///
6728 /// Note: The entry group itself and its child resources might not be
6729 /// stored in the location specified in its name.
6730 pub name: std::string::String,
6731
6732 /// A short name to identify the entry group, for example,
6733 /// "analytics data - jan 2011". Default value is an empty string.
6734 pub display_name: std::string::String,
6735
6736 /// Entry group description. Can consist of several sentences or
6737 /// paragraphs that describe the entry group contents.
6738 /// Default value is an empty string.
6739 pub description: std::string::String,
6740
6741 /// Output only. Timestamps of the entry group. Default value is empty.
6742 pub data_catalog_timestamps: std::option::Option<crate::model::SystemTimestamps>,
6743
6744 /// Optional. When set to [true], it means DataCatalog EntryGroup was
6745 /// transferred to Dataplex Catalog Service. It makes EntryGroup and its
6746 /// Entries to be read-only in DataCatalog. However, new Tags on EntryGroup and
6747 /// its Entries can be created. After setting the flag to [true] it cannot be
6748 /// unset.
6749 pub transferred_to_dataplex: bool,
6750
6751 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6752}
6753
6754impl EntryGroup {
6755 pub fn new() -> Self {
6756 std::default::Default::default()
6757 }
6758
6759 /// Sets the value of [name][crate::model::EntryGroup::name].
6760 ///
6761 /// # Example
6762 /// ```ignore,no_run
6763 /// # use google_cloud_datacatalog_v1::model::EntryGroup;
6764 /// let x = EntryGroup::new().set_name("example");
6765 /// ```
6766 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6767 self.name = v.into();
6768 self
6769 }
6770
6771 /// Sets the value of [display_name][crate::model::EntryGroup::display_name].
6772 ///
6773 /// # Example
6774 /// ```ignore,no_run
6775 /// # use google_cloud_datacatalog_v1::model::EntryGroup;
6776 /// let x = EntryGroup::new().set_display_name("example");
6777 /// ```
6778 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6779 self.display_name = v.into();
6780 self
6781 }
6782
6783 /// Sets the value of [description][crate::model::EntryGroup::description].
6784 ///
6785 /// # Example
6786 /// ```ignore,no_run
6787 /// # use google_cloud_datacatalog_v1::model::EntryGroup;
6788 /// let x = EntryGroup::new().set_description("example");
6789 /// ```
6790 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6791 self.description = v.into();
6792 self
6793 }
6794
6795 /// Sets the value of [data_catalog_timestamps][crate::model::EntryGroup::data_catalog_timestamps].
6796 ///
6797 /// # Example
6798 /// ```ignore,no_run
6799 /// # use google_cloud_datacatalog_v1::model::EntryGroup;
6800 /// use google_cloud_datacatalog_v1::model::SystemTimestamps;
6801 /// let x = EntryGroup::new().set_data_catalog_timestamps(SystemTimestamps::default()/* use setters */);
6802 /// ```
6803 pub fn set_data_catalog_timestamps<T>(mut self, v: T) -> Self
6804 where
6805 T: std::convert::Into<crate::model::SystemTimestamps>,
6806 {
6807 self.data_catalog_timestamps = std::option::Option::Some(v.into());
6808 self
6809 }
6810
6811 /// Sets or clears the value of [data_catalog_timestamps][crate::model::EntryGroup::data_catalog_timestamps].
6812 ///
6813 /// # Example
6814 /// ```ignore,no_run
6815 /// # use google_cloud_datacatalog_v1::model::EntryGroup;
6816 /// use google_cloud_datacatalog_v1::model::SystemTimestamps;
6817 /// let x = EntryGroup::new().set_or_clear_data_catalog_timestamps(Some(SystemTimestamps::default()/* use setters */));
6818 /// let x = EntryGroup::new().set_or_clear_data_catalog_timestamps(None::<SystemTimestamps>);
6819 /// ```
6820 pub fn set_or_clear_data_catalog_timestamps<T>(mut self, v: std::option::Option<T>) -> Self
6821 where
6822 T: std::convert::Into<crate::model::SystemTimestamps>,
6823 {
6824 self.data_catalog_timestamps = v.map(|x| x.into());
6825 self
6826 }
6827
6828 /// Sets the value of [transferred_to_dataplex][crate::model::EntryGroup::transferred_to_dataplex].
6829 ///
6830 /// # Example
6831 /// ```ignore,no_run
6832 /// # use google_cloud_datacatalog_v1::model::EntryGroup;
6833 /// let x = EntryGroup::new().set_transferred_to_dataplex(true);
6834 /// ```
6835 pub fn set_transferred_to_dataplex<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6836 self.transferred_to_dataplex = v.into();
6837 self
6838 }
6839}
6840
6841impl wkt::message::Message for EntryGroup {
6842 fn typename() -> &'static str {
6843 "type.googleapis.com/google.cloud.datacatalog.v1.EntryGroup"
6844 }
6845}
6846
6847/// Request message for
6848/// [CreateTagTemplate][google.cloud.datacatalog.v1.DataCatalog.CreateTagTemplate].
6849///
6850/// [google.cloud.datacatalog.v1.DataCatalog.CreateTagTemplate]: crate::client::DataCatalog::create_tag_template
6851#[derive(Clone, Default, PartialEq)]
6852#[non_exhaustive]
6853pub struct CreateTagTemplateRequest {
6854 /// Required. The name of the project and the template location
6855 /// [region](https://cloud.google.com/data-catalog/docs/concepts/regions).
6856 pub parent: std::string::String,
6857
6858 /// Required. The ID of the tag template to create.
6859 ///
6860 /// The ID must contain only lowercase letters (a-z), numbers (0-9),
6861 /// or underscores (_), and must start with a letter or underscore.
6862 /// The maximum size is 64 bytes when encoded in UTF-8.
6863 pub tag_template_id: std::string::String,
6864
6865 /// Required. The tag template to create.
6866 pub tag_template: std::option::Option<crate::model::TagTemplate>,
6867
6868 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6869}
6870
6871impl CreateTagTemplateRequest {
6872 pub fn new() -> Self {
6873 std::default::Default::default()
6874 }
6875
6876 /// Sets the value of [parent][crate::model::CreateTagTemplateRequest::parent].
6877 ///
6878 /// # Example
6879 /// ```ignore,no_run
6880 /// # use google_cloud_datacatalog_v1::model::CreateTagTemplateRequest;
6881 /// let x = CreateTagTemplateRequest::new().set_parent("example");
6882 /// ```
6883 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6884 self.parent = v.into();
6885 self
6886 }
6887
6888 /// Sets the value of [tag_template_id][crate::model::CreateTagTemplateRequest::tag_template_id].
6889 ///
6890 /// # Example
6891 /// ```ignore,no_run
6892 /// # use google_cloud_datacatalog_v1::model::CreateTagTemplateRequest;
6893 /// let x = CreateTagTemplateRequest::new().set_tag_template_id("example");
6894 /// ```
6895 pub fn set_tag_template_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6896 self.tag_template_id = v.into();
6897 self
6898 }
6899
6900 /// Sets the value of [tag_template][crate::model::CreateTagTemplateRequest::tag_template].
6901 ///
6902 /// # Example
6903 /// ```ignore,no_run
6904 /// # use google_cloud_datacatalog_v1::model::CreateTagTemplateRequest;
6905 /// use google_cloud_datacatalog_v1::model::TagTemplate;
6906 /// let x = CreateTagTemplateRequest::new().set_tag_template(TagTemplate::default()/* use setters */);
6907 /// ```
6908 pub fn set_tag_template<T>(mut self, v: T) -> Self
6909 where
6910 T: std::convert::Into<crate::model::TagTemplate>,
6911 {
6912 self.tag_template = std::option::Option::Some(v.into());
6913 self
6914 }
6915
6916 /// Sets or clears the value of [tag_template][crate::model::CreateTagTemplateRequest::tag_template].
6917 ///
6918 /// # Example
6919 /// ```ignore,no_run
6920 /// # use google_cloud_datacatalog_v1::model::CreateTagTemplateRequest;
6921 /// use google_cloud_datacatalog_v1::model::TagTemplate;
6922 /// let x = CreateTagTemplateRequest::new().set_or_clear_tag_template(Some(TagTemplate::default()/* use setters */));
6923 /// let x = CreateTagTemplateRequest::new().set_or_clear_tag_template(None::<TagTemplate>);
6924 /// ```
6925 pub fn set_or_clear_tag_template<T>(mut self, v: std::option::Option<T>) -> Self
6926 where
6927 T: std::convert::Into<crate::model::TagTemplate>,
6928 {
6929 self.tag_template = v.map(|x| x.into());
6930 self
6931 }
6932}
6933
6934impl wkt::message::Message for CreateTagTemplateRequest {
6935 fn typename() -> &'static str {
6936 "type.googleapis.com/google.cloud.datacatalog.v1.CreateTagTemplateRequest"
6937 }
6938}
6939
6940/// Request message for
6941/// [GetTagTemplate][google.cloud.datacatalog.v1.DataCatalog.GetTagTemplate].
6942///
6943/// [google.cloud.datacatalog.v1.DataCatalog.GetTagTemplate]: crate::client::DataCatalog::get_tag_template
6944#[derive(Clone, Default, PartialEq)]
6945#[non_exhaustive]
6946pub struct GetTagTemplateRequest {
6947 /// Required. The name of the tag template to get.
6948 pub name: std::string::String,
6949
6950 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6951}
6952
6953impl GetTagTemplateRequest {
6954 pub fn new() -> Self {
6955 std::default::Default::default()
6956 }
6957
6958 /// Sets the value of [name][crate::model::GetTagTemplateRequest::name].
6959 ///
6960 /// # Example
6961 /// ```ignore,no_run
6962 /// # use google_cloud_datacatalog_v1::model::GetTagTemplateRequest;
6963 /// let x = GetTagTemplateRequest::new().set_name("example");
6964 /// ```
6965 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6966 self.name = v.into();
6967 self
6968 }
6969}
6970
6971impl wkt::message::Message for GetTagTemplateRequest {
6972 fn typename() -> &'static str {
6973 "type.googleapis.com/google.cloud.datacatalog.v1.GetTagTemplateRequest"
6974 }
6975}
6976
6977/// Request message for
6978/// [UpdateTagTemplate][google.cloud.datacatalog.v1.DataCatalog.UpdateTagTemplate].
6979///
6980/// [google.cloud.datacatalog.v1.DataCatalog.UpdateTagTemplate]: crate::client::DataCatalog::update_tag_template
6981#[derive(Clone, Default, PartialEq)]
6982#[non_exhaustive]
6983pub struct UpdateTagTemplateRequest {
6984 /// Required. The template to update. The `name` field must be set.
6985 pub tag_template: std::option::Option<crate::model::TagTemplate>,
6986
6987 /// Names of fields whose values to overwrite on a tag template. Currently,
6988 /// only `display_name` and `is_publicly_readable` can be overwritten.
6989 ///
6990 /// If this parameter is absent or empty, all modifiable fields
6991 /// are overwritten. If such fields are non-required and omitted in the
6992 /// request body, their values are emptied.
6993 ///
6994 /// Note: Updating the `is_publicly_readable` field may require up to 12
6995 /// hours to take effect in search results.
6996 pub update_mask: std::option::Option<wkt::FieldMask>,
6997
6998 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6999}
7000
7001impl UpdateTagTemplateRequest {
7002 pub fn new() -> Self {
7003 std::default::Default::default()
7004 }
7005
7006 /// Sets the value of [tag_template][crate::model::UpdateTagTemplateRequest::tag_template].
7007 ///
7008 /// # Example
7009 /// ```ignore,no_run
7010 /// # use google_cloud_datacatalog_v1::model::UpdateTagTemplateRequest;
7011 /// use google_cloud_datacatalog_v1::model::TagTemplate;
7012 /// let x = UpdateTagTemplateRequest::new().set_tag_template(TagTemplate::default()/* use setters */);
7013 /// ```
7014 pub fn set_tag_template<T>(mut self, v: T) -> Self
7015 where
7016 T: std::convert::Into<crate::model::TagTemplate>,
7017 {
7018 self.tag_template = std::option::Option::Some(v.into());
7019 self
7020 }
7021
7022 /// Sets or clears the value of [tag_template][crate::model::UpdateTagTemplateRequest::tag_template].
7023 ///
7024 /// # Example
7025 /// ```ignore,no_run
7026 /// # use google_cloud_datacatalog_v1::model::UpdateTagTemplateRequest;
7027 /// use google_cloud_datacatalog_v1::model::TagTemplate;
7028 /// let x = UpdateTagTemplateRequest::new().set_or_clear_tag_template(Some(TagTemplate::default()/* use setters */));
7029 /// let x = UpdateTagTemplateRequest::new().set_or_clear_tag_template(None::<TagTemplate>);
7030 /// ```
7031 pub fn set_or_clear_tag_template<T>(mut self, v: std::option::Option<T>) -> Self
7032 where
7033 T: std::convert::Into<crate::model::TagTemplate>,
7034 {
7035 self.tag_template = v.map(|x| x.into());
7036 self
7037 }
7038
7039 /// Sets the value of [update_mask][crate::model::UpdateTagTemplateRequest::update_mask].
7040 ///
7041 /// # Example
7042 /// ```ignore,no_run
7043 /// # use google_cloud_datacatalog_v1::model::UpdateTagTemplateRequest;
7044 /// use wkt::FieldMask;
7045 /// let x = UpdateTagTemplateRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7046 /// ```
7047 pub fn set_update_mask<T>(mut self, v: T) -> Self
7048 where
7049 T: std::convert::Into<wkt::FieldMask>,
7050 {
7051 self.update_mask = std::option::Option::Some(v.into());
7052 self
7053 }
7054
7055 /// Sets or clears the value of [update_mask][crate::model::UpdateTagTemplateRequest::update_mask].
7056 ///
7057 /// # Example
7058 /// ```ignore,no_run
7059 /// # use google_cloud_datacatalog_v1::model::UpdateTagTemplateRequest;
7060 /// use wkt::FieldMask;
7061 /// let x = UpdateTagTemplateRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7062 /// let x = UpdateTagTemplateRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7063 /// ```
7064 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7065 where
7066 T: std::convert::Into<wkt::FieldMask>,
7067 {
7068 self.update_mask = v.map(|x| x.into());
7069 self
7070 }
7071}
7072
7073impl wkt::message::Message for UpdateTagTemplateRequest {
7074 fn typename() -> &'static str {
7075 "type.googleapis.com/google.cloud.datacatalog.v1.UpdateTagTemplateRequest"
7076 }
7077}
7078
7079/// Request message for
7080/// [DeleteTagTemplate][google.cloud.datacatalog.v1.DataCatalog.DeleteTagTemplate].
7081///
7082/// [google.cloud.datacatalog.v1.DataCatalog.DeleteTagTemplate]: crate::client::DataCatalog::delete_tag_template
7083#[derive(Clone, Default, PartialEq)]
7084#[non_exhaustive]
7085pub struct DeleteTagTemplateRequest {
7086 /// Required. The name of the tag template to delete.
7087 pub name: std::string::String,
7088
7089 /// Required. If true, deletes all tags that use this template.
7090 ///
7091 /// Currently, `true` is the only supported value.
7092 pub force: bool,
7093
7094 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7095}
7096
7097impl DeleteTagTemplateRequest {
7098 pub fn new() -> Self {
7099 std::default::Default::default()
7100 }
7101
7102 /// Sets the value of [name][crate::model::DeleteTagTemplateRequest::name].
7103 ///
7104 /// # Example
7105 /// ```ignore,no_run
7106 /// # use google_cloud_datacatalog_v1::model::DeleteTagTemplateRequest;
7107 /// let x = DeleteTagTemplateRequest::new().set_name("example");
7108 /// ```
7109 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7110 self.name = v.into();
7111 self
7112 }
7113
7114 /// Sets the value of [force][crate::model::DeleteTagTemplateRequest::force].
7115 ///
7116 /// # Example
7117 /// ```ignore,no_run
7118 /// # use google_cloud_datacatalog_v1::model::DeleteTagTemplateRequest;
7119 /// let x = DeleteTagTemplateRequest::new().set_force(true);
7120 /// ```
7121 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7122 self.force = v.into();
7123 self
7124 }
7125}
7126
7127impl wkt::message::Message for DeleteTagTemplateRequest {
7128 fn typename() -> &'static str {
7129 "type.googleapis.com/google.cloud.datacatalog.v1.DeleteTagTemplateRequest"
7130 }
7131}
7132
7133/// Request message for
7134/// [CreateTag][google.cloud.datacatalog.v1.DataCatalog.CreateTag].
7135///
7136/// [google.cloud.datacatalog.v1.DataCatalog.CreateTag]: crate::client::DataCatalog::create_tag
7137#[derive(Clone, Default, PartialEq)]
7138#[non_exhaustive]
7139pub struct CreateTagRequest {
7140 /// Required. The name of the resource to attach this tag to.
7141 ///
7142 /// Tags can be attached to entries or entry groups. An entry can have up to
7143 /// 1000 attached tags.
7144 ///
7145 /// Note: The tag and its child resources might not be stored in
7146 /// the location specified in its name.
7147 pub parent: std::string::String,
7148
7149 /// Required. The tag to create.
7150 pub tag: std::option::Option<crate::model::Tag>,
7151
7152 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7153}
7154
7155impl CreateTagRequest {
7156 pub fn new() -> Self {
7157 std::default::Default::default()
7158 }
7159
7160 /// Sets the value of [parent][crate::model::CreateTagRequest::parent].
7161 ///
7162 /// # Example
7163 /// ```ignore,no_run
7164 /// # use google_cloud_datacatalog_v1::model::CreateTagRequest;
7165 /// let x = CreateTagRequest::new().set_parent("example");
7166 /// ```
7167 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7168 self.parent = v.into();
7169 self
7170 }
7171
7172 /// Sets the value of [tag][crate::model::CreateTagRequest::tag].
7173 ///
7174 /// # Example
7175 /// ```ignore,no_run
7176 /// # use google_cloud_datacatalog_v1::model::CreateTagRequest;
7177 /// use google_cloud_datacatalog_v1::model::Tag;
7178 /// let x = CreateTagRequest::new().set_tag(Tag::default()/* use setters */);
7179 /// ```
7180 pub fn set_tag<T>(mut self, v: T) -> Self
7181 where
7182 T: std::convert::Into<crate::model::Tag>,
7183 {
7184 self.tag = std::option::Option::Some(v.into());
7185 self
7186 }
7187
7188 /// Sets or clears the value of [tag][crate::model::CreateTagRequest::tag].
7189 ///
7190 /// # Example
7191 /// ```ignore,no_run
7192 /// # use google_cloud_datacatalog_v1::model::CreateTagRequest;
7193 /// use google_cloud_datacatalog_v1::model::Tag;
7194 /// let x = CreateTagRequest::new().set_or_clear_tag(Some(Tag::default()/* use setters */));
7195 /// let x = CreateTagRequest::new().set_or_clear_tag(None::<Tag>);
7196 /// ```
7197 pub fn set_or_clear_tag<T>(mut self, v: std::option::Option<T>) -> Self
7198 where
7199 T: std::convert::Into<crate::model::Tag>,
7200 {
7201 self.tag = v.map(|x| x.into());
7202 self
7203 }
7204}
7205
7206impl wkt::message::Message for CreateTagRequest {
7207 fn typename() -> &'static str {
7208 "type.googleapis.com/google.cloud.datacatalog.v1.CreateTagRequest"
7209 }
7210}
7211
7212/// Request message for
7213/// [UpdateTag][google.cloud.datacatalog.v1.DataCatalog.UpdateTag].
7214///
7215/// [google.cloud.datacatalog.v1.DataCatalog.UpdateTag]: crate::client::DataCatalog::update_tag
7216#[derive(Clone, Default, PartialEq)]
7217#[non_exhaustive]
7218pub struct UpdateTagRequest {
7219 /// Required. The updated tag. The "name" field must be set.
7220 pub tag: std::option::Option<crate::model::Tag>,
7221
7222 /// Names of fields whose values to overwrite on a tag. Currently, a tag has
7223 /// the only modifiable field with the name `fields`.
7224 ///
7225 /// In general, if this parameter is absent or empty, all modifiable fields
7226 /// are overwritten. If such fields are non-required and omitted in the
7227 /// request body, their values are emptied.
7228 pub update_mask: std::option::Option<wkt::FieldMask>,
7229
7230 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7231}
7232
7233impl UpdateTagRequest {
7234 pub fn new() -> Self {
7235 std::default::Default::default()
7236 }
7237
7238 /// Sets the value of [tag][crate::model::UpdateTagRequest::tag].
7239 ///
7240 /// # Example
7241 /// ```ignore,no_run
7242 /// # use google_cloud_datacatalog_v1::model::UpdateTagRequest;
7243 /// use google_cloud_datacatalog_v1::model::Tag;
7244 /// let x = UpdateTagRequest::new().set_tag(Tag::default()/* use setters */);
7245 /// ```
7246 pub fn set_tag<T>(mut self, v: T) -> Self
7247 where
7248 T: std::convert::Into<crate::model::Tag>,
7249 {
7250 self.tag = std::option::Option::Some(v.into());
7251 self
7252 }
7253
7254 /// Sets or clears the value of [tag][crate::model::UpdateTagRequest::tag].
7255 ///
7256 /// # Example
7257 /// ```ignore,no_run
7258 /// # use google_cloud_datacatalog_v1::model::UpdateTagRequest;
7259 /// use google_cloud_datacatalog_v1::model::Tag;
7260 /// let x = UpdateTagRequest::new().set_or_clear_tag(Some(Tag::default()/* use setters */));
7261 /// let x = UpdateTagRequest::new().set_or_clear_tag(None::<Tag>);
7262 /// ```
7263 pub fn set_or_clear_tag<T>(mut self, v: std::option::Option<T>) -> Self
7264 where
7265 T: std::convert::Into<crate::model::Tag>,
7266 {
7267 self.tag = v.map(|x| x.into());
7268 self
7269 }
7270
7271 /// Sets the value of [update_mask][crate::model::UpdateTagRequest::update_mask].
7272 ///
7273 /// # Example
7274 /// ```ignore,no_run
7275 /// # use google_cloud_datacatalog_v1::model::UpdateTagRequest;
7276 /// use wkt::FieldMask;
7277 /// let x = UpdateTagRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7278 /// ```
7279 pub fn set_update_mask<T>(mut self, v: T) -> Self
7280 where
7281 T: std::convert::Into<wkt::FieldMask>,
7282 {
7283 self.update_mask = std::option::Option::Some(v.into());
7284 self
7285 }
7286
7287 /// Sets or clears the value of [update_mask][crate::model::UpdateTagRequest::update_mask].
7288 ///
7289 /// # Example
7290 /// ```ignore,no_run
7291 /// # use google_cloud_datacatalog_v1::model::UpdateTagRequest;
7292 /// use wkt::FieldMask;
7293 /// let x = UpdateTagRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7294 /// let x = UpdateTagRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7295 /// ```
7296 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7297 where
7298 T: std::convert::Into<wkt::FieldMask>,
7299 {
7300 self.update_mask = v.map(|x| x.into());
7301 self
7302 }
7303}
7304
7305impl wkt::message::Message for UpdateTagRequest {
7306 fn typename() -> &'static str {
7307 "type.googleapis.com/google.cloud.datacatalog.v1.UpdateTagRequest"
7308 }
7309}
7310
7311/// Request message for
7312/// [DeleteTag][google.cloud.datacatalog.v1.DataCatalog.DeleteTag].
7313///
7314/// [google.cloud.datacatalog.v1.DataCatalog.DeleteTag]: crate::client::DataCatalog::delete_tag
7315#[derive(Clone, Default, PartialEq)]
7316#[non_exhaustive]
7317pub struct DeleteTagRequest {
7318 /// Required. The name of the tag to delete.
7319 pub name: std::string::String,
7320
7321 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7322}
7323
7324impl DeleteTagRequest {
7325 pub fn new() -> Self {
7326 std::default::Default::default()
7327 }
7328
7329 /// Sets the value of [name][crate::model::DeleteTagRequest::name].
7330 ///
7331 /// # Example
7332 /// ```ignore,no_run
7333 /// # use google_cloud_datacatalog_v1::model::DeleteTagRequest;
7334 /// let x = DeleteTagRequest::new().set_name("example");
7335 /// ```
7336 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7337 self.name = v.into();
7338 self
7339 }
7340}
7341
7342impl wkt::message::Message for DeleteTagRequest {
7343 fn typename() -> &'static str {
7344 "type.googleapis.com/google.cloud.datacatalog.v1.DeleteTagRequest"
7345 }
7346}
7347
7348/// Request message for
7349/// [CreateTagTemplateField][google.cloud.datacatalog.v1.DataCatalog.CreateTagTemplateField].
7350///
7351/// [google.cloud.datacatalog.v1.DataCatalog.CreateTagTemplateField]: crate::client::DataCatalog::create_tag_template_field
7352#[derive(Clone, Default, PartialEq)]
7353#[non_exhaustive]
7354pub struct CreateTagTemplateFieldRequest {
7355 /// Required. The name of the project and the template location
7356 /// [region](https://cloud.google.com/data-catalog/docs/concepts/regions).
7357 pub parent: std::string::String,
7358
7359 /// Required. The ID of the tag template field to create.
7360 ///
7361 /// Note: Adding a required field to an existing template is *not* allowed.
7362 ///
7363 /// Field IDs can contain letters (both uppercase and lowercase), numbers
7364 /// (0-9), underscores (_) and dashes (-). Field IDs must be at least 1
7365 /// character long and at most 128 characters long. Field IDs must also be
7366 /// unique within their template.
7367 pub tag_template_field_id: std::string::String,
7368
7369 /// Required. The tag template field to create.
7370 pub tag_template_field: std::option::Option<crate::model::TagTemplateField>,
7371
7372 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7373}
7374
7375impl CreateTagTemplateFieldRequest {
7376 pub fn new() -> Self {
7377 std::default::Default::default()
7378 }
7379
7380 /// Sets the value of [parent][crate::model::CreateTagTemplateFieldRequest::parent].
7381 ///
7382 /// # Example
7383 /// ```ignore,no_run
7384 /// # use google_cloud_datacatalog_v1::model::CreateTagTemplateFieldRequest;
7385 /// let x = CreateTagTemplateFieldRequest::new().set_parent("example");
7386 /// ```
7387 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7388 self.parent = v.into();
7389 self
7390 }
7391
7392 /// Sets the value of [tag_template_field_id][crate::model::CreateTagTemplateFieldRequest::tag_template_field_id].
7393 ///
7394 /// # Example
7395 /// ```ignore,no_run
7396 /// # use google_cloud_datacatalog_v1::model::CreateTagTemplateFieldRequest;
7397 /// let x = CreateTagTemplateFieldRequest::new().set_tag_template_field_id("example");
7398 /// ```
7399 pub fn set_tag_template_field_id<T: std::convert::Into<std::string::String>>(
7400 mut self,
7401 v: T,
7402 ) -> Self {
7403 self.tag_template_field_id = v.into();
7404 self
7405 }
7406
7407 /// Sets the value of [tag_template_field][crate::model::CreateTagTemplateFieldRequest::tag_template_field].
7408 ///
7409 /// # Example
7410 /// ```ignore,no_run
7411 /// # use google_cloud_datacatalog_v1::model::CreateTagTemplateFieldRequest;
7412 /// use google_cloud_datacatalog_v1::model::TagTemplateField;
7413 /// let x = CreateTagTemplateFieldRequest::new().set_tag_template_field(TagTemplateField::default()/* use setters */);
7414 /// ```
7415 pub fn set_tag_template_field<T>(mut self, v: T) -> Self
7416 where
7417 T: std::convert::Into<crate::model::TagTemplateField>,
7418 {
7419 self.tag_template_field = std::option::Option::Some(v.into());
7420 self
7421 }
7422
7423 /// Sets or clears the value of [tag_template_field][crate::model::CreateTagTemplateFieldRequest::tag_template_field].
7424 ///
7425 /// # Example
7426 /// ```ignore,no_run
7427 /// # use google_cloud_datacatalog_v1::model::CreateTagTemplateFieldRequest;
7428 /// use google_cloud_datacatalog_v1::model::TagTemplateField;
7429 /// let x = CreateTagTemplateFieldRequest::new().set_or_clear_tag_template_field(Some(TagTemplateField::default()/* use setters */));
7430 /// let x = CreateTagTemplateFieldRequest::new().set_or_clear_tag_template_field(None::<TagTemplateField>);
7431 /// ```
7432 pub fn set_or_clear_tag_template_field<T>(mut self, v: std::option::Option<T>) -> Self
7433 where
7434 T: std::convert::Into<crate::model::TagTemplateField>,
7435 {
7436 self.tag_template_field = v.map(|x| x.into());
7437 self
7438 }
7439}
7440
7441impl wkt::message::Message for CreateTagTemplateFieldRequest {
7442 fn typename() -> &'static str {
7443 "type.googleapis.com/google.cloud.datacatalog.v1.CreateTagTemplateFieldRequest"
7444 }
7445}
7446
7447/// Request message for
7448/// [UpdateTagTemplateField][google.cloud.datacatalog.v1.DataCatalog.UpdateTagTemplateField].
7449///
7450/// [google.cloud.datacatalog.v1.DataCatalog.UpdateTagTemplateField]: crate::client::DataCatalog::update_tag_template_field
7451#[derive(Clone, Default, PartialEq)]
7452#[non_exhaustive]
7453pub struct UpdateTagTemplateFieldRequest {
7454 /// Required. The name of the tag template field.
7455 pub name: std::string::String,
7456
7457 /// Required. The template to update.
7458 pub tag_template_field: std::option::Option<crate::model::TagTemplateField>,
7459
7460 /// Optional. Names of fields whose values to overwrite on an individual field
7461 /// of a tag template. The following fields are modifiable:
7462 ///
7463 /// * `display_name`
7464 /// * `type.enum_type`
7465 /// * `is_required`
7466 ///
7467 /// If this parameter is absent or empty, all modifiable fields
7468 /// are overwritten. If such fields are non-required and omitted in the request
7469 /// body, their values are emptied with one exception: when updating an enum
7470 /// type, the provided values are merged with the existing values. Therefore,
7471 /// enum values can only be added, existing enum values cannot be deleted or
7472 /// renamed.
7473 ///
7474 /// Additionally, updating a template field from optional to required is
7475 /// *not* allowed.
7476 pub update_mask: std::option::Option<wkt::FieldMask>,
7477
7478 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7479}
7480
7481impl UpdateTagTemplateFieldRequest {
7482 pub fn new() -> Self {
7483 std::default::Default::default()
7484 }
7485
7486 /// Sets the value of [name][crate::model::UpdateTagTemplateFieldRequest::name].
7487 ///
7488 /// # Example
7489 /// ```ignore,no_run
7490 /// # use google_cloud_datacatalog_v1::model::UpdateTagTemplateFieldRequest;
7491 /// let x = UpdateTagTemplateFieldRequest::new().set_name("example");
7492 /// ```
7493 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7494 self.name = v.into();
7495 self
7496 }
7497
7498 /// Sets the value of [tag_template_field][crate::model::UpdateTagTemplateFieldRequest::tag_template_field].
7499 ///
7500 /// # Example
7501 /// ```ignore,no_run
7502 /// # use google_cloud_datacatalog_v1::model::UpdateTagTemplateFieldRequest;
7503 /// use google_cloud_datacatalog_v1::model::TagTemplateField;
7504 /// let x = UpdateTagTemplateFieldRequest::new().set_tag_template_field(TagTemplateField::default()/* use setters */);
7505 /// ```
7506 pub fn set_tag_template_field<T>(mut self, v: T) -> Self
7507 where
7508 T: std::convert::Into<crate::model::TagTemplateField>,
7509 {
7510 self.tag_template_field = std::option::Option::Some(v.into());
7511 self
7512 }
7513
7514 /// Sets or clears the value of [tag_template_field][crate::model::UpdateTagTemplateFieldRequest::tag_template_field].
7515 ///
7516 /// # Example
7517 /// ```ignore,no_run
7518 /// # use google_cloud_datacatalog_v1::model::UpdateTagTemplateFieldRequest;
7519 /// use google_cloud_datacatalog_v1::model::TagTemplateField;
7520 /// let x = UpdateTagTemplateFieldRequest::new().set_or_clear_tag_template_field(Some(TagTemplateField::default()/* use setters */));
7521 /// let x = UpdateTagTemplateFieldRequest::new().set_or_clear_tag_template_field(None::<TagTemplateField>);
7522 /// ```
7523 pub fn set_or_clear_tag_template_field<T>(mut self, v: std::option::Option<T>) -> Self
7524 where
7525 T: std::convert::Into<crate::model::TagTemplateField>,
7526 {
7527 self.tag_template_field = v.map(|x| x.into());
7528 self
7529 }
7530
7531 /// Sets the value of [update_mask][crate::model::UpdateTagTemplateFieldRequest::update_mask].
7532 ///
7533 /// # Example
7534 /// ```ignore,no_run
7535 /// # use google_cloud_datacatalog_v1::model::UpdateTagTemplateFieldRequest;
7536 /// use wkt::FieldMask;
7537 /// let x = UpdateTagTemplateFieldRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7538 /// ```
7539 pub fn set_update_mask<T>(mut self, v: T) -> Self
7540 where
7541 T: std::convert::Into<wkt::FieldMask>,
7542 {
7543 self.update_mask = std::option::Option::Some(v.into());
7544 self
7545 }
7546
7547 /// Sets or clears the value of [update_mask][crate::model::UpdateTagTemplateFieldRequest::update_mask].
7548 ///
7549 /// # Example
7550 /// ```ignore,no_run
7551 /// # use google_cloud_datacatalog_v1::model::UpdateTagTemplateFieldRequest;
7552 /// use wkt::FieldMask;
7553 /// let x = UpdateTagTemplateFieldRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7554 /// let x = UpdateTagTemplateFieldRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7555 /// ```
7556 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7557 where
7558 T: std::convert::Into<wkt::FieldMask>,
7559 {
7560 self.update_mask = v.map(|x| x.into());
7561 self
7562 }
7563}
7564
7565impl wkt::message::Message for UpdateTagTemplateFieldRequest {
7566 fn typename() -> &'static str {
7567 "type.googleapis.com/google.cloud.datacatalog.v1.UpdateTagTemplateFieldRequest"
7568 }
7569}
7570
7571/// Request message for
7572/// [RenameTagTemplateField][google.cloud.datacatalog.v1.DataCatalog.RenameTagTemplateField].
7573///
7574/// [google.cloud.datacatalog.v1.DataCatalog.RenameTagTemplateField]: crate::client::DataCatalog::rename_tag_template_field
7575#[derive(Clone, Default, PartialEq)]
7576#[non_exhaustive]
7577pub struct RenameTagTemplateFieldRequest {
7578 /// Required. The name of the tag template field.
7579 pub name: std::string::String,
7580
7581 /// Required. The new ID of this tag template field. For example,
7582 /// `my_new_field`.
7583 pub new_tag_template_field_id: std::string::String,
7584
7585 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7586}
7587
7588impl RenameTagTemplateFieldRequest {
7589 pub fn new() -> Self {
7590 std::default::Default::default()
7591 }
7592
7593 /// Sets the value of [name][crate::model::RenameTagTemplateFieldRequest::name].
7594 ///
7595 /// # Example
7596 /// ```ignore,no_run
7597 /// # use google_cloud_datacatalog_v1::model::RenameTagTemplateFieldRequest;
7598 /// let x = RenameTagTemplateFieldRequest::new().set_name("example");
7599 /// ```
7600 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7601 self.name = v.into();
7602 self
7603 }
7604
7605 /// Sets the value of [new_tag_template_field_id][crate::model::RenameTagTemplateFieldRequest::new_tag_template_field_id].
7606 ///
7607 /// # Example
7608 /// ```ignore,no_run
7609 /// # use google_cloud_datacatalog_v1::model::RenameTagTemplateFieldRequest;
7610 /// let x = RenameTagTemplateFieldRequest::new().set_new_tag_template_field_id("example");
7611 /// ```
7612 pub fn set_new_tag_template_field_id<T: std::convert::Into<std::string::String>>(
7613 mut self,
7614 v: T,
7615 ) -> Self {
7616 self.new_tag_template_field_id = v.into();
7617 self
7618 }
7619}
7620
7621impl wkt::message::Message for RenameTagTemplateFieldRequest {
7622 fn typename() -> &'static str {
7623 "type.googleapis.com/google.cloud.datacatalog.v1.RenameTagTemplateFieldRequest"
7624 }
7625}
7626
7627/// Request message for
7628/// [RenameTagTemplateFieldEnumValue][google.cloud.datacatalog.v1.DataCatalog.RenameTagTemplateFieldEnumValue].
7629///
7630/// [google.cloud.datacatalog.v1.DataCatalog.RenameTagTemplateFieldEnumValue]: crate::client::DataCatalog::rename_tag_template_field_enum_value
7631#[derive(Clone, Default, PartialEq)]
7632#[non_exhaustive]
7633pub struct RenameTagTemplateFieldEnumValueRequest {
7634 /// Required. The name of the enum field value.
7635 pub name: std::string::String,
7636
7637 /// Required. The new display name of the enum value. For example,
7638 /// `my_new_enum_value`.
7639 pub new_enum_value_display_name: std::string::String,
7640
7641 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7642}
7643
7644impl RenameTagTemplateFieldEnumValueRequest {
7645 pub fn new() -> Self {
7646 std::default::Default::default()
7647 }
7648
7649 /// Sets the value of [name][crate::model::RenameTagTemplateFieldEnumValueRequest::name].
7650 ///
7651 /// # Example
7652 /// ```ignore,no_run
7653 /// # use google_cloud_datacatalog_v1::model::RenameTagTemplateFieldEnumValueRequest;
7654 /// let x = RenameTagTemplateFieldEnumValueRequest::new().set_name("example");
7655 /// ```
7656 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7657 self.name = v.into();
7658 self
7659 }
7660
7661 /// Sets the value of [new_enum_value_display_name][crate::model::RenameTagTemplateFieldEnumValueRequest::new_enum_value_display_name].
7662 ///
7663 /// # Example
7664 /// ```ignore,no_run
7665 /// # use google_cloud_datacatalog_v1::model::RenameTagTemplateFieldEnumValueRequest;
7666 /// let x = RenameTagTemplateFieldEnumValueRequest::new().set_new_enum_value_display_name("example");
7667 /// ```
7668 pub fn set_new_enum_value_display_name<T: std::convert::Into<std::string::String>>(
7669 mut self,
7670 v: T,
7671 ) -> Self {
7672 self.new_enum_value_display_name = v.into();
7673 self
7674 }
7675}
7676
7677impl wkt::message::Message for RenameTagTemplateFieldEnumValueRequest {
7678 fn typename() -> &'static str {
7679 "type.googleapis.com/google.cloud.datacatalog.v1.RenameTagTemplateFieldEnumValueRequest"
7680 }
7681}
7682
7683/// Request message for
7684/// [DeleteTagTemplateField][google.cloud.datacatalog.v1.DataCatalog.DeleteTagTemplateField].
7685///
7686/// [google.cloud.datacatalog.v1.DataCatalog.DeleteTagTemplateField]: crate::client::DataCatalog::delete_tag_template_field
7687#[derive(Clone, Default, PartialEq)]
7688#[non_exhaustive]
7689pub struct DeleteTagTemplateFieldRequest {
7690 /// Required. The name of the tag template field to delete.
7691 pub name: std::string::String,
7692
7693 /// Required. If true, deletes this field from any tags that use it.
7694 ///
7695 /// Currently, `true` is the only supported value.
7696 pub force: bool,
7697
7698 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7699}
7700
7701impl DeleteTagTemplateFieldRequest {
7702 pub fn new() -> Self {
7703 std::default::Default::default()
7704 }
7705
7706 /// Sets the value of [name][crate::model::DeleteTagTemplateFieldRequest::name].
7707 ///
7708 /// # Example
7709 /// ```ignore,no_run
7710 /// # use google_cloud_datacatalog_v1::model::DeleteTagTemplateFieldRequest;
7711 /// let x = DeleteTagTemplateFieldRequest::new().set_name("example");
7712 /// ```
7713 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7714 self.name = v.into();
7715 self
7716 }
7717
7718 /// Sets the value of [force][crate::model::DeleteTagTemplateFieldRequest::force].
7719 ///
7720 /// # Example
7721 /// ```ignore,no_run
7722 /// # use google_cloud_datacatalog_v1::model::DeleteTagTemplateFieldRequest;
7723 /// let x = DeleteTagTemplateFieldRequest::new().set_force(true);
7724 /// ```
7725 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7726 self.force = v.into();
7727 self
7728 }
7729}
7730
7731impl wkt::message::Message for DeleteTagTemplateFieldRequest {
7732 fn typename() -> &'static str {
7733 "type.googleapis.com/google.cloud.datacatalog.v1.DeleteTagTemplateFieldRequest"
7734 }
7735}
7736
7737/// Request message for
7738/// [ListTags][google.cloud.datacatalog.v1.DataCatalog.ListTags].
7739///
7740/// [google.cloud.datacatalog.v1.DataCatalog.ListTags]: crate::client::DataCatalog::list_tags
7741#[derive(Clone, Default, PartialEq)]
7742#[non_exhaustive]
7743pub struct ListTagsRequest {
7744 /// Required. The name of the Data Catalog resource to list the tags of.
7745 ///
7746 /// The resource can be an [Entry][google.cloud.datacatalog.v1.Entry]
7747 /// or an [EntryGroup][google.cloud.datacatalog.v1.EntryGroup]
7748 /// (without `/entries/{entries}` at the end).
7749 ///
7750 /// [google.cloud.datacatalog.v1.Entry]: crate::model::Entry
7751 /// [google.cloud.datacatalog.v1.EntryGroup]: crate::model::EntryGroup
7752 pub parent: std::string::String,
7753
7754 /// The maximum number of tags to return. Default is 10. Maximum limit is 1000.
7755 pub page_size: i32,
7756
7757 /// Pagination token that specifies the next page to return. If empty, the
7758 /// first page is returned.
7759 pub page_token: std::string::String,
7760
7761 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7762}
7763
7764impl ListTagsRequest {
7765 pub fn new() -> Self {
7766 std::default::Default::default()
7767 }
7768
7769 /// Sets the value of [parent][crate::model::ListTagsRequest::parent].
7770 ///
7771 /// # Example
7772 /// ```ignore,no_run
7773 /// # use google_cloud_datacatalog_v1::model::ListTagsRequest;
7774 /// let x = ListTagsRequest::new().set_parent("example");
7775 /// ```
7776 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7777 self.parent = v.into();
7778 self
7779 }
7780
7781 /// Sets the value of [page_size][crate::model::ListTagsRequest::page_size].
7782 ///
7783 /// # Example
7784 /// ```ignore,no_run
7785 /// # use google_cloud_datacatalog_v1::model::ListTagsRequest;
7786 /// let x = ListTagsRequest::new().set_page_size(42);
7787 /// ```
7788 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7789 self.page_size = v.into();
7790 self
7791 }
7792
7793 /// Sets the value of [page_token][crate::model::ListTagsRequest::page_token].
7794 ///
7795 /// # Example
7796 /// ```ignore,no_run
7797 /// # use google_cloud_datacatalog_v1::model::ListTagsRequest;
7798 /// let x = ListTagsRequest::new().set_page_token("example");
7799 /// ```
7800 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7801 self.page_token = v.into();
7802 self
7803 }
7804}
7805
7806impl wkt::message::Message for ListTagsRequest {
7807 fn typename() -> &'static str {
7808 "type.googleapis.com/google.cloud.datacatalog.v1.ListTagsRequest"
7809 }
7810}
7811
7812/// Response message for
7813/// [ListTags][google.cloud.datacatalog.v1.DataCatalog.ListTags].
7814///
7815/// [google.cloud.datacatalog.v1.DataCatalog.ListTags]: crate::client::DataCatalog::list_tags
7816#[derive(Clone, Default, PartialEq)]
7817#[non_exhaustive]
7818pub struct ListTagsResponse {
7819 /// [Tag][google.cloud.datacatalog.v1.Tag] details.
7820 ///
7821 /// [google.cloud.datacatalog.v1.Tag]: crate::model::Tag
7822 pub tags: std::vec::Vec<crate::model::Tag>,
7823
7824 /// Pagination token of the next results page. Empty if there are
7825 /// no more items in results.
7826 pub next_page_token: std::string::String,
7827
7828 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7829}
7830
7831impl ListTagsResponse {
7832 pub fn new() -> Self {
7833 std::default::Default::default()
7834 }
7835
7836 /// Sets the value of [tags][crate::model::ListTagsResponse::tags].
7837 ///
7838 /// # Example
7839 /// ```ignore,no_run
7840 /// # use google_cloud_datacatalog_v1::model::ListTagsResponse;
7841 /// use google_cloud_datacatalog_v1::model::Tag;
7842 /// let x = ListTagsResponse::new()
7843 /// .set_tags([
7844 /// Tag::default()/* use setters */,
7845 /// Tag::default()/* use (different) setters */,
7846 /// ]);
7847 /// ```
7848 pub fn set_tags<T, V>(mut self, v: T) -> Self
7849 where
7850 T: std::iter::IntoIterator<Item = V>,
7851 V: std::convert::Into<crate::model::Tag>,
7852 {
7853 use std::iter::Iterator;
7854 self.tags = v.into_iter().map(|i| i.into()).collect();
7855 self
7856 }
7857
7858 /// Sets the value of [next_page_token][crate::model::ListTagsResponse::next_page_token].
7859 ///
7860 /// # Example
7861 /// ```ignore,no_run
7862 /// # use google_cloud_datacatalog_v1::model::ListTagsResponse;
7863 /// let x = ListTagsResponse::new().set_next_page_token("example");
7864 /// ```
7865 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7866 self.next_page_token = v.into();
7867 self
7868 }
7869}
7870
7871impl wkt::message::Message for ListTagsResponse {
7872 fn typename() -> &'static str {
7873 "type.googleapis.com/google.cloud.datacatalog.v1.ListTagsResponse"
7874 }
7875}
7876
7877#[doc(hidden)]
7878impl google_cloud_gax::paginator::internal::PageableResponse for ListTagsResponse {
7879 type PageItem = crate::model::Tag;
7880
7881 fn items(self) -> std::vec::Vec<Self::PageItem> {
7882 self.tags
7883 }
7884
7885 fn next_page_token(&self) -> std::string::String {
7886 use std::clone::Clone;
7887 self.next_page_token.clone()
7888 }
7889}
7890
7891/// Request message for
7892/// [ReconcileTags][google.cloud.datacatalog.v1.DataCatalog.ReconcileTags].
7893///
7894/// [google.cloud.datacatalog.v1.DataCatalog.ReconcileTags]: crate::client::DataCatalog::reconcile_tags
7895#[derive(Clone, Default, PartialEq)]
7896#[non_exhaustive]
7897pub struct ReconcileTagsRequest {
7898 /// Required. Name of [Entry][google.cloud.datacatalog.v1.Entry] to be tagged.
7899 ///
7900 /// [google.cloud.datacatalog.v1.Entry]: crate::model::Entry
7901 pub parent: std::string::String,
7902
7903 /// Required. The name of the tag template, which is used for reconciliation.
7904 pub tag_template: std::string::String,
7905
7906 /// If set to `true`, deletes entry tags related to a tag template
7907 /// not listed in the tags source from an entry. If set to `false`,
7908 /// unlisted tags are retained.
7909 pub force_delete_missing: bool,
7910
7911 /// A list of tags to apply to an entry. A tag can specify a
7912 /// tag template, which must be the template specified in the
7913 /// `ReconcileTagsRequest`.
7914 /// The sole entry and each of its columns must be mentioned at most once.
7915 pub tags: std::vec::Vec<crate::model::Tag>,
7916
7917 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7918}
7919
7920impl ReconcileTagsRequest {
7921 pub fn new() -> Self {
7922 std::default::Default::default()
7923 }
7924
7925 /// Sets the value of [parent][crate::model::ReconcileTagsRequest::parent].
7926 ///
7927 /// # Example
7928 /// ```ignore,no_run
7929 /// # use google_cloud_datacatalog_v1::model::ReconcileTagsRequest;
7930 /// let x = ReconcileTagsRequest::new().set_parent("example");
7931 /// ```
7932 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7933 self.parent = v.into();
7934 self
7935 }
7936
7937 /// Sets the value of [tag_template][crate::model::ReconcileTagsRequest::tag_template].
7938 ///
7939 /// # Example
7940 /// ```ignore,no_run
7941 /// # use google_cloud_datacatalog_v1::model::ReconcileTagsRequest;
7942 /// let x = ReconcileTagsRequest::new().set_tag_template("example");
7943 /// ```
7944 pub fn set_tag_template<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7945 self.tag_template = v.into();
7946 self
7947 }
7948
7949 /// Sets the value of [force_delete_missing][crate::model::ReconcileTagsRequest::force_delete_missing].
7950 ///
7951 /// # Example
7952 /// ```ignore,no_run
7953 /// # use google_cloud_datacatalog_v1::model::ReconcileTagsRequest;
7954 /// let x = ReconcileTagsRequest::new().set_force_delete_missing(true);
7955 /// ```
7956 pub fn set_force_delete_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7957 self.force_delete_missing = v.into();
7958 self
7959 }
7960
7961 /// Sets the value of [tags][crate::model::ReconcileTagsRequest::tags].
7962 ///
7963 /// # Example
7964 /// ```ignore,no_run
7965 /// # use google_cloud_datacatalog_v1::model::ReconcileTagsRequest;
7966 /// use google_cloud_datacatalog_v1::model::Tag;
7967 /// let x = ReconcileTagsRequest::new()
7968 /// .set_tags([
7969 /// Tag::default()/* use setters */,
7970 /// Tag::default()/* use (different) setters */,
7971 /// ]);
7972 /// ```
7973 pub fn set_tags<T, V>(mut self, v: T) -> Self
7974 where
7975 T: std::iter::IntoIterator<Item = V>,
7976 V: std::convert::Into<crate::model::Tag>,
7977 {
7978 use std::iter::Iterator;
7979 self.tags = v.into_iter().map(|i| i.into()).collect();
7980 self
7981 }
7982}
7983
7984impl wkt::message::Message for ReconcileTagsRequest {
7985 fn typename() -> &'static str {
7986 "type.googleapis.com/google.cloud.datacatalog.v1.ReconcileTagsRequest"
7987 }
7988}
7989
7990/// [Long-running operation][google.longrunning.Operation]
7991/// response message returned by
7992/// [ReconcileTags][google.cloud.datacatalog.v1.DataCatalog.ReconcileTags].
7993///
7994/// [google.cloud.datacatalog.v1.DataCatalog.ReconcileTags]: crate::client::DataCatalog::reconcile_tags
7995/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
7996#[derive(Clone, Default, PartialEq)]
7997#[non_exhaustive]
7998pub struct ReconcileTagsResponse {
7999 /// Number of tags created in the request.
8000 pub created_tags_count: i64,
8001
8002 /// Number of tags updated in the request.
8003 pub updated_tags_count: i64,
8004
8005 /// Number of tags deleted in the request.
8006 pub deleted_tags_count: i64,
8007
8008 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8009}
8010
8011impl ReconcileTagsResponse {
8012 pub fn new() -> Self {
8013 std::default::Default::default()
8014 }
8015
8016 /// Sets the value of [created_tags_count][crate::model::ReconcileTagsResponse::created_tags_count].
8017 ///
8018 /// # Example
8019 /// ```ignore,no_run
8020 /// # use google_cloud_datacatalog_v1::model::ReconcileTagsResponse;
8021 /// let x = ReconcileTagsResponse::new().set_created_tags_count(42);
8022 /// ```
8023 pub fn set_created_tags_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8024 self.created_tags_count = v.into();
8025 self
8026 }
8027
8028 /// Sets the value of [updated_tags_count][crate::model::ReconcileTagsResponse::updated_tags_count].
8029 ///
8030 /// # Example
8031 /// ```ignore,no_run
8032 /// # use google_cloud_datacatalog_v1::model::ReconcileTagsResponse;
8033 /// let x = ReconcileTagsResponse::new().set_updated_tags_count(42);
8034 /// ```
8035 pub fn set_updated_tags_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8036 self.updated_tags_count = v.into();
8037 self
8038 }
8039
8040 /// Sets the value of [deleted_tags_count][crate::model::ReconcileTagsResponse::deleted_tags_count].
8041 ///
8042 /// # Example
8043 /// ```ignore,no_run
8044 /// # use google_cloud_datacatalog_v1::model::ReconcileTagsResponse;
8045 /// let x = ReconcileTagsResponse::new().set_deleted_tags_count(42);
8046 /// ```
8047 pub fn set_deleted_tags_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8048 self.deleted_tags_count = v.into();
8049 self
8050 }
8051}
8052
8053impl wkt::message::Message for ReconcileTagsResponse {
8054 fn typename() -> &'static str {
8055 "type.googleapis.com/google.cloud.datacatalog.v1.ReconcileTagsResponse"
8056 }
8057}
8058
8059/// [Long-running operation][google.longrunning.Operation]
8060/// metadata message returned by the
8061/// [ReconcileTags][google.cloud.datacatalog.v1.DataCatalog.ReconcileTags].
8062///
8063/// [google.cloud.datacatalog.v1.DataCatalog.ReconcileTags]: crate::client::DataCatalog::reconcile_tags
8064/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8065#[derive(Clone, Default, PartialEq)]
8066#[non_exhaustive]
8067pub struct ReconcileTagsMetadata {
8068 /// State of the reconciliation operation.
8069 pub state: crate::model::reconcile_tags_metadata::ReconciliationState,
8070
8071 /// Maps the name of each tagged column (or empty string for a
8072 /// sole entry) to tagging operation [status][google.rpc.Status].
8073 ///
8074 /// [google.rpc.Status]: google_cloud_rpc::model::Status
8075 pub errors: std::collections::HashMap<std::string::String, google_cloud_rpc::model::Status>,
8076
8077 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8078}
8079
8080impl ReconcileTagsMetadata {
8081 pub fn new() -> Self {
8082 std::default::Default::default()
8083 }
8084
8085 /// Sets the value of [state][crate::model::ReconcileTagsMetadata::state].
8086 ///
8087 /// # Example
8088 /// ```ignore,no_run
8089 /// # use google_cloud_datacatalog_v1::model::ReconcileTagsMetadata;
8090 /// use google_cloud_datacatalog_v1::model::reconcile_tags_metadata::ReconciliationState;
8091 /// let x0 = ReconcileTagsMetadata::new().set_state(ReconciliationState::ReconciliationQueued);
8092 /// let x1 = ReconcileTagsMetadata::new().set_state(ReconciliationState::ReconciliationInProgress);
8093 /// let x2 = ReconcileTagsMetadata::new().set_state(ReconciliationState::ReconciliationDone);
8094 /// ```
8095 pub fn set_state<
8096 T: std::convert::Into<crate::model::reconcile_tags_metadata::ReconciliationState>,
8097 >(
8098 mut self,
8099 v: T,
8100 ) -> Self {
8101 self.state = v.into();
8102 self
8103 }
8104
8105 /// Sets the value of [errors][crate::model::ReconcileTagsMetadata::errors].
8106 ///
8107 /// # Example
8108 /// ```ignore,no_run
8109 /// # use google_cloud_datacatalog_v1::model::ReconcileTagsMetadata;
8110 /// use google_cloud_rpc::model::Status;
8111 /// let x = ReconcileTagsMetadata::new().set_errors([
8112 /// ("key0", Status::default()/* use setters */),
8113 /// ("key1", Status::default()/* use (different) setters */),
8114 /// ]);
8115 /// ```
8116 pub fn set_errors<T, K, V>(mut self, v: T) -> Self
8117 where
8118 T: std::iter::IntoIterator<Item = (K, V)>,
8119 K: std::convert::Into<std::string::String>,
8120 V: std::convert::Into<google_cloud_rpc::model::Status>,
8121 {
8122 use std::iter::Iterator;
8123 self.errors = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8124 self
8125 }
8126}
8127
8128impl wkt::message::Message for ReconcileTagsMetadata {
8129 fn typename() -> &'static str {
8130 "type.googleapis.com/google.cloud.datacatalog.v1.ReconcileTagsMetadata"
8131 }
8132}
8133
8134/// Defines additional types related to [ReconcileTagsMetadata].
8135pub mod reconcile_tags_metadata {
8136 #[allow(unused_imports)]
8137 use super::*;
8138
8139 /// Enum holding possible states of the reconciliation operation.
8140 ///
8141 /// # Working with unknown values
8142 ///
8143 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8144 /// additional enum variants at any time. Adding new variants is not considered
8145 /// a breaking change. Applications should write their code in anticipation of:
8146 ///
8147 /// - New values appearing in future releases of the client library, **and**
8148 /// - New values received dynamically, without application changes.
8149 ///
8150 /// Please consult the [Working with enums] section in the user guide for some
8151 /// guidelines.
8152 ///
8153 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8154 #[derive(Clone, Debug, PartialEq)]
8155 #[non_exhaustive]
8156 pub enum ReconciliationState {
8157 /// Default value. This value is unused.
8158 Unspecified,
8159 /// The reconciliation has been queued and awaits for execution.
8160 ReconciliationQueued,
8161 /// The reconciliation is in progress.
8162 ReconciliationInProgress,
8163 /// The reconciliation has been finished.
8164 ReconciliationDone,
8165 /// If set, the enum was initialized with an unknown value.
8166 ///
8167 /// Applications can examine the value using [ReconciliationState::value] or
8168 /// [ReconciliationState::name].
8169 UnknownValue(reconciliation_state::UnknownValue),
8170 }
8171
8172 #[doc(hidden)]
8173 pub mod reconciliation_state {
8174 #[allow(unused_imports)]
8175 use super::*;
8176 #[derive(Clone, Debug, PartialEq)]
8177 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8178 }
8179
8180 impl ReconciliationState {
8181 /// Gets the enum value.
8182 ///
8183 /// Returns `None` if the enum contains an unknown value deserialized from
8184 /// the string representation of enums.
8185 pub fn value(&self) -> std::option::Option<i32> {
8186 match self {
8187 Self::Unspecified => std::option::Option::Some(0),
8188 Self::ReconciliationQueued => std::option::Option::Some(1),
8189 Self::ReconciliationInProgress => std::option::Option::Some(2),
8190 Self::ReconciliationDone => std::option::Option::Some(3),
8191 Self::UnknownValue(u) => u.0.value(),
8192 }
8193 }
8194
8195 /// Gets the enum value as a string.
8196 ///
8197 /// Returns `None` if the enum contains an unknown value deserialized from
8198 /// the integer representation of enums.
8199 pub fn name(&self) -> std::option::Option<&str> {
8200 match self {
8201 Self::Unspecified => std::option::Option::Some("RECONCILIATION_STATE_UNSPECIFIED"),
8202 Self::ReconciliationQueued => std::option::Option::Some("RECONCILIATION_QUEUED"),
8203 Self::ReconciliationInProgress => {
8204 std::option::Option::Some("RECONCILIATION_IN_PROGRESS")
8205 }
8206 Self::ReconciliationDone => std::option::Option::Some("RECONCILIATION_DONE"),
8207 Self::UnknownValue(u) => u.0.name(),
8208 }
8209 }
8210 }
8211
8212 impl std::default::Default for ReconciliationState {
8213 fn default() -> Self {
8214 use std::convert::From;
8215 Self::from(0)
8216 }
8217 }
8218
8219 impl std::fmt::Display for ReconciliationState {
8220 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8221 wkt::internal::display_enum(f, self.name(), self.value())
8222 }
8223 }
8224
8225 impl std::convert::From<i32> for ReconciliationState {
8226 fn from(value: i32) -> Self {
8227 match value {
8228 0 => Self::Unspecified,
8229 1 => Self::ReconciliationQueued,
8230 2 => Self::ReconciliationInProgress,
8231 3 => Self::ReconciliationDone,
8232 _ => Self::UnknownValue(reconciliation_state::UnknownValue(
8233 wkt::internal::UnknownEnumValue::Integer(value),
8234 )),
8235 }
8236 }
8237 }
8238
8239 impl std::convert::From<&str> for ReconciliationState {
8240 fn from(value: &str) -> Self {
8241 use std::string::ToString;
8242 match value {
8243 "RECONCILIATION_STATE_UNSPECIFIED" => Self::Unspecified,
8244 "RECONCILIATION_QUEUED" => Self::ReconciliationQueued,
8245 "RECONCILIATION_IN_PROGRESS" => Self::ReconciliationInProgress,
8246 "RECONCILIATION_DONE" => Self::ReconciliationDone,
8247 _ => Self::UnknownValue(reconciliation_state::UnknownValue(
8248 wkt::internal::UnknownEnumValue::String(value.to_string()),
8249 )),
8250 }
8251 }
8252 }
8253
8254 impl serde::ser::Serialize for ReconciliationState {
8255 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8256 where
8257 S: serde::Serializer,
8258 {
8259 match self {
8260 Self::Unspecified => serializer.serialize_i32(0),
8261 Self::ReconciliationQueued => serializer.serialize_i32(1),
8262 Self::ReconciliationInProgress => serializer.serialize_i32(2),
8263 Self::ReconciliationDone => serializer.serialize_i32(3),
8264 Self::UnknownValue(u) => u.0.serialize(serializer),
8265 }
8266 }
8267 }
8268
8269 impl<'de> serde::de::Deserialize<'de> for ReconciliationState {
8270 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8271 where
8272 D: serde::Deserializer<'de>,
8273 {
8274 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReconciliationState>::new(
8275 ".google.cloud.datacatalog.v1.ReconcileTagsMetadata.ReconciliationState",
8276 ))
8277 }
8278 }
8279}
8280
8281/// Request message for
8282/// [ListEntries][google.cloud.datacatalog.v1.DataCatalog.ListEntries].
8283///
8284/// [google.cloud.datacatalog.v1.DataCatalog.ListEntries]: crate::client::DataCatalog::list_entries
8285#[derive(Clone, Default, PartialEq)]
8286#[non_exhaustive]
8287pub struct ListEntriesRequest {
8288 /// Required. The name of the entry group that contains the entries to list.
8289 ///
8290 /// Can be provided in URL format.
8291 pub parent: std::string::String,
8292
8293 /// The maximum number of items to return. Default is 10. Maximum limit is
8294 /// 1000. Throws an invalid argument if `page_size` is more than 1000.
8295 pub page_size: i32,
8296
8297 /// Pagination token that specifies the next page to return. If empty, the
8298 /// first page is returned.
8299 pub page_token: std::string::String,
8300
8301 /// The fields to return for each entry. If empty or omitted, all
8302 /// fields are returned.
8303 ///
8304 /// For example, to return a list of entries with only the `name` field,
8305 /// set `read_mask` to only one path with the `name` value.
8306 pub read_mask: std::option::Option<wkt::FieldMask>,
8307
8308 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8309}
8310
8311impl ListEntriesRequest {
8312 pub fn new() -> Self {
8313 std::default::Default::default()
8314 }
8315
8316 /// Sets the value of [parent][crate::model::ListEntriesRequest::parent].
8317 ///
8318 /// # Example
8319 /// ```ignore,no_run
8320 /// # use google_cloud_datacatalog_v1::model::ListEntriesRequest;
8321 /// let x = ListEntriesRequest::new().set_parent("example");
8322 /// ```
8323 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8324 self.parent = v.into();
8325 self
8326 }
8327
8328 /// Sets the value of [page_size][crate::model::ListEntriesRequest::page_size].
8329 ///
8330 /// # Example
8331 /// ```ignore,no_run
8332 /// # use google_cloud_datacatalog_v1::model::ListEntriesRequest;
8333 /// let x = ListEntriesRequest::new().set_page_size(42);
8334 /// ```
8335 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8336 self.page_size = v.into();
8337 self
8338 }
8339
8340 /// Sets the value of [page_token][crate::model::ListEntriesRequest::page_token].
8341 ///
8342 /// # Example
8343 /// ```ignore,no_run
8344 /// # use google_cloud_datacatalog_v1::model::ListEntriesRequest;
8345 /// let x = ListEntriesRequest::new().set_page_token("example");
8346 /// ```
8347 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8348 self.page_token = v.into();
8349 self
8350 }
8351
8352 /// Sets the value of [read_mask][crate::model::ListEntriesRequest::read_mask].
8353 ///
8354 /// # Example
8355 /// ```ignore,no_run
8356 /// # use google_cloud_datacatalog_v1::model::ListEntriesRequest;
8357 /// use wkt::FieldMask;
8358 /// let x = ListEntriesRequest::new().set_read_mask(FieldMask::default()/* use setters */);
8359 /// ```
8360 pub fn set_read_mask<T>(mut self, v: T) -> Self
8361 where
8362 T: std::convert::Into<wkt::FieldMask>,
8363 {
8364 self.read_mask = std::option::Option::Some(v.into());
8365 self
8366 }
8367
8368 /// Sets or clears the value of [read_mask][crate::model::ListEntriesRequest::read_mask].
8369 ///
8370 /// # Example
8371 /// ```ignore,no_run
8372 /// # use google_cloud_datacatalog_v1::model::ListEntriesRequest;
8373 /// use wkt::FieldMask;
8374 /// let x = ListEntriesRequest::new().set_or_clear_read_mask(Some(FieldMask::default()/* use setters */));
8375 /// let x = ListEntriesRequest::new().set_or_clear_read_mask(None::<FieldMask>);
8376 /// ```
8377 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
8378 where
8379 T: std::convert::Into<wkt::FieldMask>,
8380 {
8381 self.read_mask = v.map(|x| x.into());
8382 self
8383 }
8384}
8385
8386impl wkt::message::Message for ListEntriesRequest {
8387 fn typename() -> &'static str {
8388 "type.googleapis.com/google.cloud.datacatalog.v1.ListEntriesRequest"
8389 }
8390}
8391
8392/// Response message for
8393/// [ListEntries][google.cloud.datacatalog.v1.DataCatalog.ListEntries].
8394///
8395/// [google.cloud.datacatalog.v1.DataCatalog.ListEntries]: crate::client::DataCatalog::list_entries
8396#[derive(Clone, Default, PartialEq)]
8397#[non_exhaustive]
8398pub struct ListEntriesResponse {
8399 /// Entry details.
8400 pub entries: std::vec::Vec<crate::model::Entry>,
8401
8402 /// Pagination token of the next results page. Empty if there are no more items
8403 /// in results.
8404 pub next_page_token: std::string::String,
8405
8406 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8407}
8408
8409impl ListEntriesResponse {
8410 pub fn new() -> Self {
8411 std::default::Default::default()
8412 }
8413
8414 /// Sets the value of [entries][crate::model::ListEntriesResponse::entries].
8415 ///
8416 /// # Example
8417 /// ```ignore,no_run
8418 /// # use google_cloud_datacatalog_v1::model::ListEntriesResponse;
8419 /// use google_cloud_datacatalog_v1::model::Entry;
8420 /// let x = ListEntriesResponse::new()
8421 /// .set_entries([
8422 /// Entry::default()/* use setters */,
8423 /// Entry::default()/* use (different) setters */,
8424 /// ]);
8425 /// ```
8426 pub fn set_entries<T, V>(mut self, v: T) -> Self
8427 where
8428 T: std::iter::IntoIterator<Item = V>,
8429 V: std::convert::Into<crate::model::Entry>,
8430 {
8431 use std::iter::Iterator;
8432 self.entries = v.into_iter().map(|i| i.into()).collect();
8433 self
8434 }
8435
8436 /// Sets the value of [next_page_token][crate::model::ListEntriesResponse::next_page_token].
8437 ///
8438 /// # Example
8439 /// ```ignore,no_run
8440 /// # use google_cloud_datacatalog_v1::model::ListEntriesResponse;
8441 /// let x = ListEntriesResponse::new().set_next_page_token("example");
8442 /// ```
8443 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8444 self.next_page_token = v.into();
8445 self
8446 }
8447}
8448
8449impl wkt::message::Message for ListEntriesResponse {
8450 fn typename() -> &'static str {
8451 "type.googleapis.com/google.cloud.datacatalog.v1.ListEntriesResponse"
8452 }
8453}
8454
8455#[doc(hidden)]
8456impl google_cloud_gax::paginator::internal::PageableResponse for ListEntriesResponse {
8457 type PageItem = crate::model::Entry;
8458
8459 fn items(self) -> std::vec::Vec<Self::PageItem> {
8460 self.entries
8461 }
8462
8463 fn next_page_token(&self) -> std::string::String {
8464 use std::clone::Clone;
8465 self.next_page_token.clone()
8466 }
8467}
8468
8469/// Request message for
8470/// [StarEntry][google.cloud.datacatalog.v1.DataCatalog.StarEntry].
8471///
8472/// [google.cloud.datacatalog.v1.DataCatalog.StarEntry]: crate::client::DataCatalog::star_entry
8473#[derive(Clone, Default, PartialEq)]
8474#[non_exhaustive]
8475pub struct StarEntryRequest {
8476 /// Required. The name of the entry to mark as starred.
8477 pub name: std::string::String,
8478
8479 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8480}
8481
8482impl StarEntryRequest {
8483 pub fn new() -> Self {
8484 std::default::Default::default()
8485 }
8486
8487 /// Sets the value of [name][crate::model::StarEntryRequest::name].
8488 ///
8489 /// # Example
8490 /// ```ignore,no_run
8491 /// # use google_cloud_datacatalog_v1::model::StarEntryRequest;
8492 /// let x = StarEntryRequest::new().set_name("example");
8493 /// ```
8494 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8495 self.name = v.into();
8496 self
8497 }
8498}
8499
8500impl wkt::message::Message for StarEntryRequest {
8501 fn typename() -> &'static str {
8502 "type.googleapis.com/google.cloud.datacatalog.v1.StarEntryRequest"
8503 }
8504}
8505
8506/// Response message for
8507/// [StarEntry][google.cloud.datacatalog.v1.DataCatalog.StarEntry].
8508/// Empty for now
8509///
8510/// [google.cloud.datacatalog.v1.DataCatalog.StarEntry]: crate::client::DataCatalog::star_entry
8511#[derive(Clone, Default, PartialEq)]
8512#[non_exhaustive]
8513pub struct StarEntryResponse {
8514 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8515}
8516
8517impl StarEntryResponse {
8518 pub fn new() -> Self {
8519 std::default::Default::default()
8520 }
8521}
8522
8523impl wkt::message::Message for StarEntryResponse {
8524 fn typename() -> &'static str {
8525 "type.googleapis.com/google.cloud.datacatalog.v1.StarEntryResponse"
8526 }
8527}
8528
8529/// Request message for
8530/// [UnstarEntry][google.cloud.datacatalog.v1.DataCatalog.UnstarEntry].
8531///
8532/// [google.cloud.datacatalog.v1.DataCatalog.UnstarEntry]: crate::client::DataCatalog::unstar_entry
8533#[derive(Clone, Default, PartialEq)]
8534#[non_exhaustive]
8535pub struct UnstarEntryRequest {
8536 /// Required. The name of the entry to mark as **not** starred.
8537 pub name: std::string::String,
8538
8539 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8540}
8541
8542impl UnstarEntryRequest {
8543 pub fn new() -> Self {
8544 std::default::Default::default()
8545 }
8546
8547 /// Sets the value of [name][crate::model::UnstarEntryRequest::name].
8548 ///
8549 /// # Example
8550 /// ```ignore,no_run
8551 /// # use google_cloud_datacatalog_v1::model::UnstarEntryRequest;
8552 /// let x = UnstarEntryRequest::new().set_name("example");
8553 /// ```
8554 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8555 self.name = v.into();
8556 self
8557 }
8558}
8559
8560impl wkt::message::Message for UnstarEntryRequest {
8561 fn typename() -> &'static str {
8562 "type.googleapis.com/google.cloud.datacatalog.v1.UnstarEntryRequest"
8563 }
8564}
8565
8566/// Response message for
8567/// [UnstarEntry][google.cloud.datacatalog.v1.DataCatalog.UnstarEntry].
8568/// Empty for now
8569///
8570/// [google.cloud.datacatalog.v1.DataCatalog.UnstarEntry]: crate::client::DataCatalog::unstar_entry
8571#[derive(Clone, Default, PartialEq)]
8572#[non_exhaustive]
8573pub struct UnstarEntryResponse {
8574 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8575}
8576
8577impl UnstarEntryResponse {
8578 pub fn new() -> Self {
8579 std::default::Default::default()
8580 }
8581}
8582
8583impl wkt::message::Message for UnstarEntryResponse {
8584 fn typename() -> &'static str {
8585 "type.googleapis.com/google.cloud.datacatalog.v1.UnstarEntryResponse"
8586 }
8587}
8588
8589/// Request message for
8590/// [ImportEntries][google.cloud.datacatalog.v1.DataCatalog.ImportEntries]
8591/// method.
8592///
8593/// [google.cloud.datacatalog.v1.DataCatalog.ImportEntries]: crate::client::DataCatalog::import_entries
8594#[derive(Clone, Default, PartialEq)]
8595#[non_exhaustive]
8596pub struct ImportEntriesRequest {
8597 /// Required. Target entry group for ingested entries.
8598 pub parent: std::string::String,
8599
8600 /// Optional. (Optional) Dataplex task job id, if specified will be used as
8601 /// part of ImportEntries LRO ID
8602 pub job_id: std::string::String,
8603
8604 /// Source of imported entries, e.g. dump stored in a Cloud Storage
8605 pub source: std::option::Option<crate::model::import_entries_request::Source>,
8606
8607 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8608}
8609
8610impl ImportEntriesRequest {
8611 pub fn new() -> Self {
8612 std::default::Default::default()
8613 }
8614
8615 /// Sets the value of [parent][crate::model::ImportEntriesRequest::parent].
8616 ///
8617 /// # Example
8618 /// ```ignore,no_run
8619 /// # use google_cloud_datacatalog_v1::model::ImportEntriesRequest;
8620 /// let x = ImportEntriesRequest::new().set_parent("example");
8621 /// ```
8622 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8623 self.parent = v.into();
8624 self
8625 }
8626
8627 /// Sets the value of [job_id][crate::model::ImportEntriesRequest::job_id].
8628 ///
8629 /// # Example
8630 /// ```ignore,no_run
8631 /// # use google_cloud_datacatalog_v1::model::ImportEntriesRequest;
8632 /// let x = ImportEntriesRequest::new().set_job_id("example");
8633 /// ```
8634 pub fn set_job_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8635 self.job_id = v.into();
8636 self
8637 }
8638
8639 /// Sets the value of [source][crate::model::ImportEntriesRequest::source].
8640 ///
8641 /// Note that all the setters affecting `source` are mutually
8642 /// exclusive.
8643 ///
8644 /// # Example
8645 /// ```ignore,no_run
8646 /// # use google_cloud_datacatalog_v1::model::ImportEntriesRequest;
8647 /// use google_cloud_datacatalog_v1::model::import_entries_request::Source;
8648 /// let x = ImportEntriesRequest::new().set_source(Some(Source::GcsBucketPath("example".to_string())));
8649 /// ```
8650 pub fn set_source<
8651 T: std::convert::Into<std::option::Option<crate::model::import_entries_request::Source>>,
8652 >(
8653 mut self,
8654 v: T,
8655 ) -> Self {
8656 self.source = v.into();
8657 self
8658 }
8659
8660 /// The value of [source][crate::model::ImportEntriesRequest::source]
8661 /// if it holds a `GcsBucketPath`, `None` if the field is not set or
8662 /// holds a different branch.
8663 pub fn gcs_bucket_path(&self) -> std::option::Option<&std::string::String> {
8664 #[allow(unreachable_patterns)]
8665 self.source.as_ref().and_then(|v| match v {
8666 crate::model::import_entries_request::Source::GcsBucketPath(v) => {
8667 std::option::Option::Some(v)
8668 }
8669 _ => std::option::Option::None,
8670 })
8671 }
8672
8673 /// Sets the value of [source][crate::model::ImportEntriesRequest::source]
8674 /// to hold a `GcsBucketPath`.
8675 ///
8676 /// Note that all the setters affecting `source` are
8677 /// mutually exclusive.
8678 ///
8679 /// # Example
8680 /// ```ignore,no_run
8681 /// # use google_cloud_datacatalog_v1::model::ImportEntriesRequest;
8682 /// let x = ImportEntriesRequest::new().set_gcs_bucket_path("example");
8683 /// assert!(x.gcs_bucket_path().is_some());
8684 /// ```
8685 pub fn set_gcs_bucket_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8686 self.source = std::option::Option::Some(
8687 crate::model::import_entries_request::Source::GcsBucketPath(v.into()),
8688 );
8689 self
8690 }
8691}
8692
8693impl wkt::message::Message for ImportEntriesRequest {
8694 fn typename() -> &'static str {
8695 "type.googleapis.com/google.cloud.datacatalog.v1.ImportEntriesRequest"
8696 }
8697}
8698
8699/// Defines additional types related to [ImportEntriesRequest].
8700pub mod import_entries_request {
8701 #[allow(unused_imports)]
8702 use super::*;
8703
8704 /// Source of imported entries, e.g. dump stored in a Cloud Storage
8705 #[derive(Clone, Debug, PartialEq)]
8706 #[non_exhaustive]
8707 pub enum Source {
8708 /// Path to a Cloud Storage bucket that contains a dump ready for ingestion.
8709 GcsBucketPath(std::string::String),
8710 }
8711}
8712
8713/// Response message for [long-running operation][google.longrunning.Operation]
8714/// returned by the
8715/// [ImportEntries][google.cloud.datacatalog.v1.DataCatalog.ImportEntries].
8716///
8717/// [google.cloud.datacatalog.v1.DataCatalog.ImportEntries]: crate::client::DataCatalog::import_entries
8718/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8719#[derive(Clone, Default, PartialEq)]
8720#[non_exhaustive]
8721pub struct ImportEntriesResponse {
8722 /// Cumulative number of entries created and entries updated as a result of
8723 /// import operation.
8724 pub upserted_entries_count: std::option::Option<i64>,
8725
8726 /// Number of entries deleted as a result of import operation.
8727 pub deleted_entries_count: std::option::Option<i64>,
8728
8729 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8730}
8731
8732impl ImportEntriesResponse {
8733 pub fn new() -> Self {
8734 std::default::Default::default()
8735 }
8736
8737 /// Sets the value of [upserted_entries_count][crate::model::ImportEntriesResponse::upserted_entries_count].
8738 ///
8739 /// # Example
8740 /// ```ignore,no_run
8741 /// # use google_cloud_datacatalog_v1::model::ImportEntriesResponse;
8742 /// let x = ImportEntriesResponse::new().set_upserted_entries_count(42);
8743 /// ```
8744 pub fn set_upserted_entries_count<T>(mut self, v: T) -> Self
8745 where
8746 T: std::convert::Into<i64>,
8747 {
8748 self.upserted_entries_count = std::option::Option::Some(v.into());
8749 self
8750 }
8751
8752 /// Sets or clears the value of [upserted_entries_count][crate::model::ImportEntriesResponse::upserted_entries_count].
8753 ///
8754 /// # Example
8755 /// ```ignore,no_run
8756 /// # use google_cloud_datacatalog_v1::model::ImportEntriesResponse;
8757 /// let x = ImportEntriesResponse::new().set_or_clear_upserted_entries_count(Some(42));
8758 /// let x = ImportEntriesResponse::new().set_or_clear_upserted_entries_count(None::<i32>);
8759 /// ```
8760 pub fn set_or_clear_upserted_entries_count<T>(mut self, v: std::option::Option<T>) -> Self
8761 where
8762 T: std::convert::Into<i64>,
8763 {
8764 self.upserted_entries_count = v.map(|x| x.into());
8765 self
8766 }
8767
8768 /// Sets the value of [deleted_entries_count][crate::model::ImportEntriesResponse::deleted_entries_count].
8769 ///
8770 /// # Example
8771 /// ```ignore,no_run
8772 /// # use google_cloud_datacatalog_v1::model::ImportEntriesResponse;
8773 /// let x = ImportEntriesResponse::new().set_deleted_entries_count(42);
8774 /// ```
8775 pub fn set_deleted_entries_count<T>(mut self, v: T) -> Self
8776 where
8777 T: std::convert::Into<i64>,
8778 {
8779 self.deleted_entries_count = std::option::Option::Some(v.into());
8780 self
8781 }
8782
8783 /// Sets or clears the value of [deleted_entries_count][crate::model::ImportEntriesResponse::deleted_entries_count].
8784 ///
8785 /// # Example
8786 /// ```ignore,no_run
8787 /// # use google_cloud_datacatalog_v1::model::ImportEntriesResponse;
8788 /// let x = ImportEntriesResponse::new().set_or_clear_deleted_entries_count(Some(42));
8789 /// let x = ImportEntriesResponse::new().set_or_clear_deleted_entries_count(None::<i32>);
8790 /// ```
8791 pub fn set_or_clear_deleted_entries_count<T>(mut self, v: std::option::Option<T>) -> Self
8792 where
8793 T: std::convert::Into<i64>,
8794 {
8795 self.deleted_entries_count = v.map(|x| x.into());
8796 self
8797 }
8798}
8799
8800impl wkt::message::Message for ImportEntriesResponse {
8801 fn typename() -> &'static str {
8802 "type.googleapis.com/google.cloud.datacatalog.v1.ImportEntriesResponse"
8803 }
8804}
8805
8806/// Metadata message for [long-running operation][google.longrunning.Operation]
8807/// returned by the
8808/// [ImportEntries][google.cloud.datacatalog.v1.DataCatalog.ImportEntries].
8809///
8810/// [google.cloud.datacatalog.v1.DataCatalog.ImportEntries]: crate::client::DataCatalog::import_entries
8811/// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
8812#[derive(Clone, Default, PartialEq)]
8813#[non_exhaustive]
8814pub struct ImportEntriesMetadata {
8815 /// State of the import operation.
8816 pub state: crate::model::import_entries_metadata::ImportState,
8817
8818 /// Partial errors that are encountered during the ImportEntries operation.
8819 /// There is no guarantee that all the encountered errors are reported.
8820 /// However, if no errors are reported, it means that no errors were
8821 /// encountered.
8822 pub errors: std::vec::Vec<google_cloud_rpc::model::Status>,
8823
8824 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8825}
8826
8827impl ImportEntriesMetadata {
8828 pub fn new() -> Self {
8829 std::default::Default::default()
8830 }
8831
8832 /// Sets the value of [state][crate::model::ImportEntriesMetadata::state].
8833 ///
8834 /// # Example
8835 /// ```ignore,no_run
8836 /// # use google_cloud_datacatalog_v1::model::ImportEntriesMetadata;
8837 /// use google_cloud_datacatalog_v1::model::import_entries_metadata::ImportState;
8838 /// let x0 = ImportEntriesMetadata::new().set_state(ImportState::ImportQueued);
8839 /// let x1 = ImportEntriesMetadata::new().set_state(ImportState::ImportInProgress);
8840 /// let x2 = ImportEntriesMetadata::new().set_state(ImportState::ImportDone);
8841 /// ```
8842 pub fn set_state<T: std::convert::Into<crate::model::import_entries_metadata::ImportState>>(
8843 mut self,
8844 v: T,
8845 ) -> Self {
8846 self.state = v.into();
8847 self
8848 }
8849
8850 /// Sets the value of [errors][crate::model::ImportEntriesMetadata::errors].
8851 ///
8852 /// # Example
8853 /// ```ignore,no_run
8854 /// # use google_cloud_datacatalog_v1::model::ImportEntriesMetadata;
8855 /// use google_cloud_rpc::model::Status;
8856 /// let x = ImportEntriesMetadata::new()
8857 /// .set_errors([
8858 /// Status::default()/* use setters */,
8859 /// Status::default()/* use (different) setters */,
8860 /// ]);
8861 /// ```
8862 pub fn set_errors<T, V>(mut self, v: T) -> Self
8863 where
8864 T: std::iter::IntoIterator<Item = V>,
8865 V: std::convert::Into<google_cloud_rpc::model::Status>,
8866 {
8867 use std::iter::Iterator;
8868 self.errors = v.into_iter().map(|i| i.into()).collect();
8869 self
8870 }
8871}
8872
8873impl wkt::message::Message for ImportEntriesMetadata {
8874 fn typename() -> &'static str {
8875 "type.googleapis.com/google.cloud.datacatalog.v1.ImportEntriesMetadata"
8876 }
8877}
8878
8879/// Defines additional types related to [ImportEntriesMetadata].
8880pub mod import_entries_metadata {
8881 #[allow(unused_imports)]
8882 use super::*;
8883
8884 /// Enum holding possible states of the import operation.
8885 ///
8886 /// # Working with unknown values
8887 ///
8888 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8889 /// additional enum variants at any time. Adding new variants is not considered
8890 /// a breaking change. Applications should write their code in anticipation of:
8891 ///
8892 /// - New values appearing in future releases of the client library, **and**
8893 /// - New values received dynamically, without application changes.
8894 ///
8895 /// Please consult the [Working with enums] section in the user guide for some
8896 /// guidelines.
8897 ///
8898 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8899 #[derive(Clone, Debug, PartialEq)]
8900 #[non_exhaustive]
8901 pub enum ImportState {
8902 /// Default value. This value is unused.
8903 Unspecified,
8904 /// The dump with entries has been queued for import.
8905 ImportQueued,
8906 /// The import of entries is in progress.
8907 ImportInProgress,
8908 /// The import of entries has been finished.
8909 ImportDone,
8910 /// The import of entries has been abandoned in favor of a newer request.
8911 ImportObsolete,
8912 /// If set, the enum was initialized with an unknown value.
8913 ///
8914 /// Applications can examine the value using [ImportState::value] or
8915 /// [ImportState::name].
8916 UnknownValue(import_state::UnknownValue),
8917 }
8918
8919 #[doc(hidden)]
8920 pub mod import_state {
8921 #[allow(unused_imports)]
8922 use super::*;
8923 #[derive(Clone, Debug, PartialEq)]
8924 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8925 }
8926
8927 impl ImportState {
8928 /// Gets the enum value.
8929 ///
8930 /// Returns `None` if the enum contains an unknown value deserialized from
8931 /// the string representation of enums.
8932 pub fn value(&self) -> std::option::Option<i32> {
8933 match self {
8934 Self::Unspecified => std::option::Option::Some(0),
8935 Self::ImportQueued => std::option::Option::Some(1),
8936 Self::ImportInProgress => std::option::Option::Some(2),
8937 Self::ImportDone => std::option::Option::Some(3),
8938 Self::ImportObsolete => std::option::Option::Some(4),
8939 Self::UnknownValue(u) => u.0.value(),
8940 }
8941 }
8942
8943 /// Gets the enum value as a string.
8944 ///
8945 /// Returns `None` if the enum contains an unknown value deserialized from
8946 /// the integer representation of enums.
8947 pub fn name(&self) -> std::option::Option<&str> {
8948 match self {
8949 Self::Unspecified => std::option::Option::Some("IMPORT_STATE_UNSPECIFIED"),
8950 Self::ImportQueued => std::option::Option::Some("IMPORT_QUEUED"),
8951 Self::ImportInProgress => std::option::Option::Some("IMPORT_IN_PROGRESS"),
8952 Self::ImportDone => std::option::Option::Some("IMPORT_DONE"),
8953 Self::ImportObsolete => std::option::Option::Some("IMPORT_OBSOLETE"),
8954 Self::UnknownValue(u) => u.0.name(),
8955 }
8956 }
8957 }
8958
8959 impl std::default::Default for ImportState {
8960 fn default() -> Self {
8961 use std::convert::From;
8962 Self::from(0)
8963 }
8964 }
8965
8966 impl std::fmt::Display for ImportState {
8967 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8968 wkt::internal::display_enum(f, self.name(), self.value())
8969 }
8970 }
8971
8972 impl std::convert::From<i32> for ImportState {
8973 fn from(value: i32) -> Self {
8974 match value {
8975 0 => Self::Unspecified,
8976 1 => Self::ImportQueued,
8977 2 => Self::ImportInProgress,
8978 3 => Self::ImportDone,
8979 4 => Self::ImportObsolete,
8980 _ => Self::UnknownValue(import_state::UnknownValue(
8981 wkt::internal::UnknownEnumValue::Integer(value),
8982 )),
8983 }
8984 }
8985 }
8986
8987 impl std::convert::From<&str> for ImportState {
8988 fn from(value: &str) -> Self {
8989 use std::string::ToString;
8990 match value {
8991 "IMPORT_STATE_UNSPECIFIED" => Self::Unspecified,
8992 "IMPORT_QUEUED" => Self::ImportQueued,
8993 "IMPORT_IN_PROGRESS" => Self::ImportInProgress,
8994 "IMPORT_DONE" => Self::ImportDone,
8995 "IMPORT_OBSOLETE" => Self::ImportObsolete,
8996 _ => Self::UnknownValue(import_state::UnknownValue(
8997 wkt::internal::UnknownEnumValue::String(value.to_string()),
8998 )),
8999 }
9000 }
9001 }
9002
9003 impl serde::ser::Serialize for ImportState {
9004 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9005 where
9006 S: serde::Serializer,
9007 {
9008 match self {
9009 Self::Unspecified => serializer.serialize_i32(0),
9010 Self::ImportQueued => serializer.serialize_i32(1),
9011 Self::ImportInProgress => serializer.serialize_i32(2),
9012 Self::ImportDone => serializer.serialize_i32(3),
9013 Self::ImportObsolete => serializer.serialize_i32(4),
9014 Self::UnknownValue(u) => u.0.serialize(serializer),
9015 }
9016 }
9017 }
9018
9019 impl<'de> serde::de::Deserialize<'de> for ImportState {
9020 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9021 where
9022 D: serde::Deserializer<'de>,
9023 {
9024 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ImportState>::new(
9025 ".google.cloud.datacatalog.v1.ImportEntriesMetadata.ImportState",
9026 ))
9027 }
9028 }
9029}
9030
9031/// Request message for
9032/// [ModifyEntryOverview][google.cloud.datacatalog.v1.DataCatalog.ModifyEntryOverview].
9033///
9034/// [google.cloud.datacatalog.v1.DataCatalog.ModifyEntryOverview]: crate::client::DataCatalog::modify_entry_overview
9035#[derive(Clone, Default, PartialEq)]
9036#[non_exhaustive]
9037pub struct ModifyEntryOverviewRequest {
9038 /// Required. The full resource name of the entry.
9039 pub name: std::string::String,
9040
9041 /// Required. The new value for the Entry Overview.
9042 pub entry_overview: std::option::Option<crate::model::EntryOverview>,
9043
9044 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9045}
9046
9047impl ModifyEntryOverviewRequest {
9048 pub fn new() -> Self {
9049 std::default::Default::default()
9050 }
9051
9052 /// Sets the value of [name][crate::model::ModifyEntryOverviewRequest::name].
9053 ///
9054 /// # Example
9055 /// ```ignore,no_run
9056 /// # use google_cloud_datacatalog_v1::model::ModifyEntryOverviewRequest;
9057 /// let x = ModifyEntryOverviewRequest::new().set_name("example");
9058 /// ```
9059 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9060 self.name = v.into();
9061 self
9062 }
9063
9064 /// Sets the value of [entry_overview][crate::model::ModifyEntryOverviewRequest::entry_overview].
9065 ///
9066 /// # Example
9067 /// ```ignore,no_run
9068 /// # use google_cloud_datacatalog_v1::model::ModifyEntryOverviewRequest;
9069 /// use google_cloud_datacatalog_v1::model::EntryOverview;
9070 /// let x = ModifyEntryOverviewRequest::new().set_entry_overview(EntryOverview::default()/* use setters */);
9071 /// ```
9072 pub fn set_entry_overview<T>(mut self, v: T) -> Self
9073 where
9074 T: std::convert::Into<crate::model::EntryOverview>,
9075 {
9076 self.entry_overview = std::option::Option::Some(v.into());
9077 self
9078 }
9079
9080 /// Sets or clears the value of [entry_overview][crate::model::ModifyEntryOverviewRequest::entry_overview].
9081 ///
9082 /// # Example
9083 /// ```ignore,no_run
9084 /// # use google_cloud_datacatalog_v1::model::ModifyEntryOverviewRequest;
9085 /// use google_cloud_datacatalog_v1::model::EntryOverview;
9086 /// let x = ModifyEntryOverviewRequest::new().set_or_clear_entry_overview(Some(EntryOverview::default()/* use setters */));
9087 /// let x = ModifyEntryOverviewRequest::new().set_or_clear_entry_overview(None::<EntryOverview>);
9088 /// ```
9089 pub fn set_or_clear_entry_overview<T>(mut self, v: std::option::Option<T>) -> Self
9090 where
9091 T: std::convert::Into<crate::model::EntryOverview>,
9092 {
9093 self.entry_overview = v.map(|x| x.into());
9094 self
9095 }
9096}
9097
9098impl wkt::message::Message for ModifyEntryOverviewRequest {
9099 fn typename() -> &'static str {
9100 "type.googleapis.com/google.cloud.datacatalog.v1.ModifyEntryOverviewRequest"
9101 }
9102}
9103
9104/// Request message for
9105/// [ModifyEntryContacts][google.cloud.datacatalog.v1.DataCatalog.ModifyEntryContacts].
9106///
9107/// [google.cloud.datacatalog.v1.DataCatalog.ModifyEntryContacts]: crate::client::DataCatalog::modify_entry_contacts
9108#[derive(Clone, Default, PartialEq)]
9109#[non_exhaustive]
9110pub struct ModifyEntryContactsRequest {
9111 /// Required. The full resource name of the entry.
9112 pub name: std::string::String,
9113
9114 /// Required. The new value for the Contacts.
9115 pub contacts: std::option::Option<crate::model::Contacts>,
9116
9117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9118}
9119
9120impl ModifyEntryContactsRequest {
9121 pub fn new() -> Self {
9122 std::default::Default::default()
9123 }
9124
9125 /// Sets the value of [name][crate::model::ModifyEntryContactsRequest::name].
9126 ///
9127 /// # Example
9128 /// ```ignore,no_run
9129 /// # use google_cloud_datacatalog_v1::model::ModifyEntryContactsRequest;
9130 /// let x = ModifyEntryContactsRequest::new().set_name("example");
9131 /// ```
9132 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9133 self.name = v.into();
9134 self
9135 }
9136
9137 /// Sets the value of [contacts][crate::model::ModifyEntryContactsRequest::contacts].
9138 ///
9139 /// # Example
9140 /// ```ignore,no_run
9141 /// # use google_cloud_datacatalog_v1::model::ModifyEntryContactsRequest;
9142 /// use google_cloud_datacatalog_v1::model::Contacts;
9143 /// let x = ModifyEntryContactsRequest::new().set_contacts(Contacts::default()/* use setters */);
9144 /// ```
9145 pub fn set_contacts<T>(mut self, v: T) -> Self
9146 where
9147 T: std::convert::Into<crate::model::Contacts>,
9148 {
9149 self.contacts = std::option::Option::Some(v.into());
9150 self
9151 }
9152
9153 /// Sets or clears the value of [contacts][crate::model::ModifyEntryContactsRequest::contacts].
9154 ///
9155 /// # Example
9156 /// ```ignore,no_run
9157 /// # use google_cloud_datacatalog_v1::model::ModifyEntryContactsRequest;
9158 /// use google_cloud_datacatalog_v1::model::Contacts;
9159 /// let x = ModifyEntryContactsRequest::new().set_or_clear_contacts(Some(Contacts::default()/* use setters */));
9160 /// let x = ModifyEntryContactsRequest::new().set_or_clear_contacts(None::<Contacts>);
9161 /// ```
9162 pub fn set_or_clear_contacts<T>(mut self, v: std::option::Option<T>) -> Self
9163 where
9164 T: std::convert::Into<crate::model::Contacts>,
9165 {
9166 self.contacts = v.map(|x| x.into());
9167 self
9168 }
9169}
9170
9171impl wkt::message::Message for ModifyEntryContactsRequest {
9172 fn typename() -> &'static str {
9173 "type.googleapis.com/google.cloud.datacatalog.v1.ModifyEntryContactsRequest"
9174 }
9175}
9176
9177/// Request message for
9178/// [SetConfig][google.cloud.datacatalog.v1.DataCatalog.SetConfig].
9179///
9180/// [google.cloud.datacatalog.v1.DataCatalog.SetConfig]: crate::client::DataCatalog::set_config
9181#[derive(Clone, Default, PartialEq)]
9182#[non_exhaustive]
9183pub struct SetConfigRequest {
9184 /// Required. The organization or project whose config is being specified.
9185 pub name: std::string::String,
9186
9187 /// The configuration field to set.
9188 pub configuration: std::option::Option<crate::model::set_config_request::Configuration>,
9189
9190 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9191}
9192
9193impl SetConfigRequest {
9194 pub fn new() -> Self {
9195 std::default::Default::default()
9196 }
9197
9198 /// Sets the value of [name][crate::model::SetConfigRequest::name].
9199 ///
9200 /// # Example
9201 /// ```ignore,no_run
9202 /// # use google_cloud_datacatalog_v1::model::SetConfigRequest;
9203 /// let x = SetConfigRequest::new().set_name("example");
9204 /// ```
9205 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9206 self.name = v.into();
9207 self
9208 }
9209
9210 /// Sets the value of [configuration][crate::model::SetConfigRequest::configuration].
9211 ///
9212 /// Note that all the setters affecting `configuration` are mutually
9213 /// exclusive.
9214 ///
9215 /// # Example
9216 /// ```ignore,no_run
9217 /// # use google_cloud_datacatalog_v1::model::SetConfigRequest;
9218 /// use google_cloud_datacatalog_v1::model::TagTemplateMigration;
9219 /// let x0 = SetConfigRequest::new().set_configuration(Some(
9220 /// google_cloud_datacatalog_v1::model::set_config_request::Configuration::TagTemplateMigration(TagTemplateMigration::Enabled)));
9221 /// let x1 = SetConfigRequest::new().set_configuration(Some(
9222 /// google_cloud_datacatalog_v1::model::set_config_request::Configuration::TagTemplateMigration(TagTemplateMigration::Disabled)));
9223 /// ```
9224 pub fn set_configuration<
9225 T: std::convert::Into<std::option::Option<crate::model::set_config_request::Configuration>>,
9226 >(
9227 mut self,
9228 v: T,
9229 ) -> Self {
9230 self.configuration = v.into();
9231 self
9232 }
9233
9234 /// The value of [configuration][crate::model::SetConfigRequest::configuration]
9235 /// if it holds a `TagTemplateMigration`, `None` if the field is not set or
9236 /// holds a different branch.
9237 pub fn tag_template_migration(
9238 &self,
9239 ) -> std::option::Option<&crate::model::TagTemplateMigration> {
9240 #[allow(unreachable_patterns)]
9241 self.configuration.as_ref().and_then(|v| match v {
9242 crate::model::set_config_request::Configuration::TagTemplateMigration(v) => {
9243 std::option::Option::Some(v)
9244 }
9245 _ => std::option::Option::None,
9246 })
9247 }
9248
9249 /// Sets the value of [configuration][crate::model::SetConfigRequest::configuration]
9250 /// to hold a `TagTemplateMigration`.
9251 ///
9252 /// Note that all the setters affecting `configuration` are
9253 /// mutually exclusive.
9254 ///
9255 /// # Example
9256 /// ```ignore,no_run
9257 /// # use google_cloud_datacatalog_v1::model::SetConfigRequest;
9258 /// use google_cloud_datacatalog_v1::model::TagTemplateMigration;
9259 /// let x0 = SetConfigRequest::new().set_tag_template_migration(TagTemplateMigration::Enabled);
9260 /// let x1 = SetConfigRequest::new().set_tag_template_migration(TagTemplateMigration::Disabled);
9261 /// assert!(x0.tag_template_migration().is_some());
9262 /// assert!(x0.catalog_ui_experience().is_none());
9263 /// assert!(x1.tag_template_migration().is_some());
9264 /// assert!(x1.catalog_ui_experience().is_none());
9265 /// ```
9266 pub fn set_tag_template_migration<T: std::convert::Into<crate::model::TagTemplateMigration>>(
9267 mut self,
9268 v: T,
9269 ) -> Self {
9270 self.configuration = std::option::Option::Some(
9271 crate::model::set_config_request::Configuration::TagTemplateMigration(v.into()),
9272 );
9273 self
9274 }
9275
9276 /// The value of [configuration][crate::model::SetConfigRequest::configuration]
9277 /// if it holds a `CatalogUiExperience`, `None` if the field is not set or
9278 /// holds a different branch.
9279 pub fn catalog_ui_experience(&self) -> std::option::Option<&crate::model::CatalogUIExperience> {
9280 #[allow(unreachable_patterns)]
9281 self.configuration.as_ref().and_then(|v| match v {
9282 crate::model::set_config_request::Configuration::CatalogUiExperience(v) => {
9283 std::option::Option::Some(v)
9284 }
9285 _ => std::option::Option::None,
9286 })
9287 }
9288
9289 /// Sets the value of [configuration][crate::model::SetConfigRequest::configuration]
9290 /// to hold a `CatalogUiExperience`.
9291 ///
9292 /// Note that all the setters affecting `configuration` are
9293 /// mutually exclusive.
9294 ///
9295 /// # Example
9296 /// ```ignore,no_run
9297 /// # use google_cloud_datacatalog_v1::model::SetConfigRequest;
9298 /// use google_cloud_datacatalog_v1::model::CatalogUIExperience;
9299 /// let x0 = SetConfigRequest::new().set_catalog_ui_experience(CatalogUIExperience::Enabled);
9300 /// let x1 = SetConfigRequest::new().set_catalog_ui_experience(CatalogUIExperience::Disabled);
9301 /// assert!(x0.catalog_ui_experience().is_some());
9302 /// assert!(x0.tag_template_migration().is_none());
9303 /// assert!(x1.catalog_ui_experience().is_some());
9304 /// assert!(x1.tag_template_migration().is_none());
9305 /// ```
9306 pub fn set_catalog_ui_experience<T: std::convert::Into<crate::model::CatalogUIExperience>>(
9307 mut self,
9308 v: T,
9309 ) -> Self {
9310 self.configuration = std::option::Option::Some(
9311 crate::model::set_config_request::Configuration::CatalogUiExperience(v.into()),
9312 );
9313 self
9314 }
9315}
9316
9317impl wkt::message::Message for SetConfigRequest {
9318 fn typename() -> &'static str {
9319 "type.googleapis.com/google.cloud.datacatalog.v1.SetConfigRequest"
9320 }
9321}
9322
9323/// Defines additional types related to [SetConfigRequest].
9324pub mod set_config_request {
9325 #[allow(unused_imports)]
9326 use super::*;
9327
9328 /// The configuration field to set.
9329 #[derive(Clone, Debug, PartialEq)]
9330 #[non_exhaustive]
9331 pub enum Configuration {
9332 /// Opt-in status for the migration of Tag Templates to Dataplex.
9333 TagTemplateMigration(crate::model::TagTemplateMigration),
9334 /// Opt-in status for the UI switch to Dataplex.
9335 CatalogUiExperience(crate::model::CatalogUIExperience),
9336 }
9337}
9338
9339/// Request message for
9340/// [RetrieveConfig][google.cloud.datacatalog.v1.DataCatalog.RetrieveConfig].
9341///
9342/// [google.cloud.datacatalog.v1.DataCatalog.RetrieveConfig]: crate::client::DataCatalog::retrieve_config
9343#[derive(Clone, Default, PartialEq)]
9344#[non_exhaustive]
9345pub struct RetrieveConfigRequest {
9346 /// Required. The organization whose config is being retrieved.
9347 pub name: std::string::String,
9348
9349 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9350}
9351
9352impl RetrieveConfigRequest {
9353 pub fn new() -> Self {
9354 std::default::Default::default()
9355 }
9356
9357 /// Sets the value of [name][crate::model::RetrieveConfigRequest::name].
9358 ///
9359 /// # Example
9360 /// ```ignore,no_run
9361 /// # use google_cloud_datacatalog_v1::model::RetrieveConfigRequest;
9362 /// let x = RetrieveConfigRequest::new().set_name("example");
9363 /// ```
9364 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9365 self.name = v.into();
9366 self
9367 }
9368}
9369
9370impl wkt::message::Message for RetrieveConfigRequest {
9371 fn typename() -> &'static str {
9372 "type.googleapis.com/google.cloud.datacatalog.v1.RetrieveConfigRequest"
9373 }
9374}
9375
9376/// Request message for
9377/// [RetrieveEffectiveConfig][google.cloud.datacatalog.v1.DataCatalog.RetrieveEffectiveConfig].
9378///
9379/// [google.cloud.datacatalog.v1.DataCatalog.RetrieveEffectiveConfig]: crate::client::DataCatalog::retrieve_effective_config
9380#[derive(Clone, Default, PartialEq)]
9381#[non_exhaustive]
9382pub struct RetrieveEffectiveConfigRequest {
9383 /// Required. The resource whose effective config is being retrieved.
9384 pub name: std::string::String,
9385
9386 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9387}
9388
9389impl RetrieveEffectiveConfigRequest {
9390 pub fn new() -> Self {
9391 std::default::Default::default()
9392 }
9393
9394 /// Sets the value of [name][crate::model::RetrieveEffectiveConfigRequest::name].
9395 ///
9396 /// # Example
9397 /// ```ignore,no_run
9398 /// # use google_cloud_datacatalog_v1::model::RetrieveEffectiveConfigRequest;
9399 /// let x = RetrieveEffectiveConfigRequest::new().set_name("example");
9400 /// ```
9401 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9402 self.name = v.into();
9403 self
9404 }
9405}
9406
9407impl wkt::message::Message for RetrieveEffectiveConfigRequest {
9408 fn typename() -> &'static str {
9409 "type.googleapis.com/google.cloud.datacatalog.v1.RetrieveEffectiveConfigRequest"
9410 }
9411}
9412
9413/// The configuration related to the migration from Data Catalog to Dataplex that
9414/// has been applied to an organization and any projects under it. It is the
9415/// response message for
9416/// [RetrieveConfig][google.cloud.datacatalog.v1.DataCatalog.RetrieveConfig].
9417///
9418/// [google.cloud.datacatalog.v1.DataCatalog.RetrieveConfig]: crate::client::DataCatalog::retrieve_config
9419#[derive(Clone, Default, PartialEq)]
9420#[non_exhaustive]
9421pub struct OrganizationConfig {
9422 /// Map of organizations and project resource names and their configuration.
9423 /// The format for the map keys is `organizations/{organizationId}` or
9424 /// `projects/{projectId}`.
9425 pub config: std::collections::HashMap<std::string::String, crate::model::MigrationConfig>,
9426
9427 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9428}
9429
9430impl OrganizationConfig {
9431 pub fn new() -> Self {
9432 std::default::Default::default()
9433 }
9434
9435 /// Sets the value of [config][crate::model::OrganizationConfig::config].
9436 ///
9437 /// # Example
9438 /// ```ignore,no_run
9439 /// # use google_cloud_datacatalog_v1::model::OrganizationConfig;
9440 /// use google_cloud_datacatalog_v1::model::MigrationConfig;
9441 /// let x = OrganizationConfig::new().set_config([
9442 /// ("key0", MigrationConfig::default()/* use setters */),
9443 /// ("key1", MigrationConfig::default()/* use (different) setters */),
9444 /// ]);
9445 /// ```
9446 pub fn set_config<T, K, V>(mut self, v: T) -> Self
9447 where
9448 T: std::iter::IntoIterator<Item = (K, V)>,
9449 K: std::convert::Into<std::string::String>,
9450 V: std::convert::Into<crate::model::MigrationConfig>,
9451 {
9452 use std::iter::Iterator;
9453 self.config = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9454 self
9455 }
9456}
9457
9458impl wkt::message::Message for OrganizationConfig {
9459 fn typename() -> &'static str {
9460 "type.googleapis.com/google.cloud.datacatalog.v1.OrganizationConfig"
9461 }
9462}
9463
9464/// The configuration related to the migration to Dataplex applied to an
9465/// organization or project.
9466/// It is the response message for
9467/// [SetConfig][google.cloud.datacatalog.v1.DataCatalog.SetConfig] and
9468/// [RetrieveEffectiveConfig][google.cloud.datacatalog.v1.DataCatalog.RetrieveEffectiveConfig].
9469///
9470/// [google.cloud.datacatalog.v1.DataCatalog.RetrieveEffectiveConfig]: crate::client::DataCatalog::retrieve_effective_config
9471/// [google.cloud.datacatalog.v1.DataCatalog.SetConfig]: crate::client::DataCatalog::set_config
9472#[derive(Clone, Default, PartialEq)]
9473#[non_exhaustive]
9474pub struct MigrationConfig {
9475 /// Opt-in status for the migration of Tag Templates to Dataplex.
9476 pub tag_template_migration: crate::model::TagTemplateMigration,
9477
9478 /// Opt-in status for the UI switch to Dataplex.
9479 pub catalog_ui_experience: crate::model::CatalogUIExperience,
9480
9481 /// The time when the Tag Template migration was enabled.
9482 /// If the Tag Template migration is not enabled, this field is not set.
9483 pub template_migration_enabled_time: std::option::Option<wkt::Timestamp>,
9484
9485 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9486}
9487
9488impl MigrationConfig {
9489 pub fn new() -> Self {
9490 std::default::Default::default()
9491 }
9492
9493 /// Sets the value of [tag_template_migration][crate::model::MigrationConfig::tag_template_migration].
9494 ///
9495 /// # Example
9496 /// ```ignore,no_run
9497 /// # use google_cloud_datacatalog_v1::model::MigrationConfig;
9498 /// use google_cloud_datacatalog_v1::model::TagTemplateMigration;
9499 /// let x0 = MigrationConfig::new().set_tag_template_migration(TagTemplateMigration::Enabled);
9500 /// let x1 = MigrationConfig::new().set_tag_template_migration(TagTemplateMigration::Disabled);
9501 /// ```
9502 pub fn set_tag_template_migration<T: std::convert::Into<crate::model::TagTemplateMigration>>(
9503 mut self,
9504 v: T,
9505 ) -> Self {
9506 self.tag_template_migration = v.into();
9507 self
9508 }
9509
9510 /// Sets the value of [catalog_ui_experience][crate::model::MigrationConfig::catalog_ui_experience].
9511 ///
9512 /// # Example
9513 /// ```ignore,no_run
9514 /// # use google_cloud_datacatalog_v1::model::MigrationConfig;
9515 /// use google_cloud_datacatalog_v1::model::CatalogUIExperience;
9516 /// let x0 = MigrationConfig::new().set_catalog_ui_experience(CatalogUIExperience::Enabled);
9517 /// let x1 = MigrationConfig::new().set_catalog_ui_experience(CatalogUIExperience::Disabled);
9518 /// ```
9519 pub fn set_catalog_ui_experience<T: std::convert::Into<crate::model::CatalogUIExperience>>(
9520 mut self,
9521 v: T,
9522 ) -> Self {
9523 self.catalog_ui_experience = v.into();
9524 self
9525 }
9526
9527 /// Sets the value of [template_migration_enabled_time][crate::model::MigrationConfig::template_migration_enabled_time].
9528 ///
9529 /// # Example
9530 /// ```ignore,no_run
9531 /// # use google_cloud_datacatalog_v1::model::MigrationConfig;
9532 /// use wkt::Timestamp;
9533 /// let x = MigrationConfig::new().set_template_migration_enabled_time(Timestamp::default()/* use setters */);
9534 /// ```
9535 pub fn set_template_migration_enabled_time<T>(mut self, v: T) -> Self
9536 where
9537 T: std::convert::Into<wkt::Timestamp>,
9538 {
9539 self.template_migration_enabled_time = std::option::Option::Some(v.into());
9540 self
9541 }
9542
9543 /// Sets or clears the value of [template_migration_enabled_time][crate::model::MigrationConfig::template_migration_enabled_time].
9544 ///
9545 /// # Example
9546 /// ```ignore,no_run
9547 /// # use google_cloud_datacatalog_v1::model::MigrationConfig;
9548 /// use wkt::Timestamp;
9549 /// let x = MigrationConfig::new().set_or_clear_template_migration_enabled_time(Some(Timestamp::default()/* use setters */));
9550 /// let x = MigrationConfig::new().set_or_clear_template_migration_enabled_time(None::<Timestamp>);
9551 /// ```
9552 pub fn set_or_clear_template_migration_enabled_time<T>(
9553 mut self,
9554 v: std::option::Option<T>,
9555 ) -> Self
9556 where
9557 T: std::convert::Into<wkt::Timestamp>,
9558 {
9559 self.template_migration_enabled_time = v.map(|x| x.into());
9560 self
9561 }
9562}
9563
9564impl wkt::message::Message for MigrationConfig {
9565 fn typename() -> &'static str {
9566 "type.googleapis.com/google.cloud.datacatalog.v1.MigrationConfig"
9567 }
9568}
9569
9570/// Common Dataplex fields.
9571#[derive(Clone, Default, PartialEq)]
9572#[non_exhaustive]
9573pub struct DataplexSpec {
9574 /// Fully qualified resource name of an asset in Dataplex, to which the
9575 /// underlying data source (Cloud Storage bucket or BigQuery dataset) of the
9576 /// entity is attached.
9577 pub asset: std::string::String,
9578
9579 /// Format of the data.
9580 pub data_format: std::option::Option<crate::model::PhysicalSchema>,
9581
9582 /// Compression format of the data, e.g., zip, gzip etc.
9583 pub compression_format: std::string::String,
9584
9585 /// Project ID of the underlying Cloud Storage or BigQuery data. Note that
9586 /// this may not be the same project as the correspondingly Dataplex lake /
9587 /// zone / asset.
9588 pub project_id: std::string::String,
9589
9590 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9591}
9592
9593impl DataplexSpec {
9594 pub fn new() -> Self {
9595 std::default::Default::default()
9596 }
9597
9598 /// Sets the value of [asset][crate::model::DataplexSpec::asset].
9599 ///
9600 /// # Example
9601 /// ```ignore,no_run
9602 /// # use google_cloud_datacatalog_v1::model::DataplexSpec;
9603 /// let x = DataplexSpec::new().set_asset("example");
9604 /// ```
9605 pub fn set_asset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9606 self.asset = v.into();
9607 self
9608 }
9609
9610 /// Sets the value of [data_format][crate::model::DataplexSpec::data_format].
9611 ///
9612 /// # Example
9613 /// ```ignore,no_run
9614 /// # use google_cloud_datacatalog_v1::model::DataplexSpec;
9615 /// use google_cloud_datacatalog_v1::model::PhysicalSchema;
9616 /// let x = DataplexSpec::new().set_data_format(PhysicalSchema::default()/* use setters */);
9617 /// ```
9618 pub fn set_data_format<T>(mut self, v: T) -> Self
9619 where
9620 T: std::convert::Into<crate::model::PhysicalSchema>,
9621 {
9622 self.data_format = std::option::Option::Some(v.into());
9623 self
9624 }
9625
9626 /// Sets or clears the value of [data_format][crate::model::DataplexSpec::data_format].
9627 ///
9628 /// # Example
9629 /// ```ignore,no_run
9630 /// # use google_cloud_datacatalog_v1::model::DataplexSpec;
9631 /// use google_cloud_datacatalog_v1::model::PhysicalSchema;
9632 /// let x = DataplexSpec::new().set_or_clear_data_format(Some(PhysicalSchema::default()/* use setters */));
9633 /// let x = DataplexSpec::new().set_or_clear_data_format(None::<PhysicalSchema>);
9634 /// ```
9635 pub fn set_or_clear_data_format<T>(mut self, v: std::option::Option<T>) -> Self
9636 where
9637 T: std::convert::Into<crate::model::PhysicalSchema>,
9638 {
9639 self.data_format = v.map(|x| x.into());
9640 self
9641 }
9642
9643 /// Sets the value of [compression_format][crate::model::DataplexSpec::compression_format].
9644 ///
9645 /// # Example
9646 /// ```ignore,no_run
9647 /// # use google_cloud_datacatalog_v1::model::DataplexSpec;
9648 /// let x = DataplexSpec::new().set_compression_format("example");
9649 /// ```
9650 pub fn set_compression_format<T: std::convert::Into<std::string::String>>(
9651 mut self,
9652 v: T,
9653 ) -> Self {
9654 self.compression_format = v.into();
9655 self
9656 }
9657
9658 /// Sets the value of [project_id][crate::model::DataplexSpec::project_id].
9659 ///
9660 /// # Example
9661 /// ```ignore,no_run
9662 /// # use google_cloud_datacatalog_v1::model::DataplexSpec;
9663 /// let x = DataplexSpec::new().set_project_id("example");
9664 /// ```
9665 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9666 self.project_id = v.into();
9667 self
9668 }
9669}
9670
9671impl wkt::message::Message for DataplexSpec {
9672 fn typename() -> &'static str {
9673 "type.googleapis.com/google.cloud.datacatalog.v1.DataplexSpec"
9674 }
9675}
9676
9677/// Entry specyfication for a Dataplex fileset.
9678#[derive(Clone, Default, PartialEq)]
9679#[non_exhaustive]
9680pub struct DataplexFilesetSpec {
9681 /// Common Dataplex fields.
9682 pub dataplex_spec: std::option::Option<crate::model::DataplexSpec>,
9683
9684 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9685}
9686
9687impl DataplexFilesetSpec {
9688 pub fn new() -> Self {
9689 std::default::Default::default()
9690 }
9691
9692 /// Sets the value of [dataplex_spec][crate::model::DataplexFilesetSpec::dataplex_spec].
9693 ///
9694 /// # Example
9695 /// ```ignore,no_run
9696 /// # use google_cloud_datacatalog_v1::model::DataplexFilesetSpec;
9697 /// use google_cloud_datacatalog_v1::model::DataplexSpec;
9698 /// let x = DataplexFilesetSpec::new().set_dataplex_spec(DataplexSpec::default()/* use setters */);
9699 /// ```
9700 pub fn set_dataplex_spec<T>(mut self, v: T) -> Self
9701 where
9702 T: std::convert::Into<crate::model::DataplexSpec>,
9703 {
9704 self.dataplex_spec = std::option::Option::Some(v.into());
9705 self
9706 }
9707
9708 /// Sets or clears the value of [dataplex_spec][crate::model::DataplexFilesetSpec::dataplex_spec].
9709 ///
9710 /// # Example
9711 /// ```ignore,no_run
9712 /// # use google_cloud_datacatalog_v1::model::DataplexFilesetSpec;
9713 /// use google_cloud_datacatalog_v1::model::DataplexSpec;
9714 /// let x = DataplexFilesetSpec::new().set_or_clear_dataplex_spec(Some(DataplexSpec::default()/* use setters */));
9715 /// let x = DataplexFilesetSpec::new().set_or_clear_dataplex_spec(None::<DataplexSpec>);
9716 /// ```
9717 pub fn set_or_clear_dataplex_spec<T>(mut self, v: std::option::Option<T>) -> Self
9718 where
9719 T: std::convert::Into<crate::model::DataplexSpec>,
9720 {
9721 self.dataplex_spec = v.map(|x| x.into());
9722 self
9723 }
9724}
9725
9726impl wkt::message::Message for DataplexFilesetSpec {
9727 fn typename() -> &'static str {
9728 "type.googleapis.com/google.cloud.datacatalog.v1.DataplexFilesetSpec"
9729 }
9730}
9731
9732/// Entry specification for a Dataplex table.
9733#[derive(Clone, Default, PartialEq)]
9734#[non_exhaustive]
9735pub struct DataplexTableSpec {
9736 /// List of external tables registered by Dataplex in other systems based on
9737 /// the same underlying data.
9738 ///
9739 /// External tables allow to query this data in those systems.
9740 pub external_tables: std::vec::Vec<crate::model::DataplexExternalTable>,
9741
9742 /// Common Dataplex fields.
9743 pub dataplex_spec: std::option::Option<crate::model::DataplexSpec>,
9744
9745 /// Indicates if the table schema is managed by the user or not.
9746 pub user_managed: bool,
9747
9748 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9749}
9750
9751impl DataplexTableSpec {
9752 pub fn new() -> Self {
9753 std::default::Default::default()
9754 }
9755
9756 /// Sets the value of [external_tables][crate::model::DataplexTableSpec::external_tables].
9757 ///
9758 /// # Example
9759 /// ```ignore,no_run
9760 /// # use google_cloud_datacatalog_v1::model::DataplexTableSpec;
9761 /// use google_cloud_datacatalog_v1::model::DataplexExternalTable;
9762 /// let x = DataplexTableSpec::new()
9763 /// .set_external_tables([
9764 /// DataplexExternalTable::default()/* use setters */,
9765 /// DataplexExternalTable::default()/* use (different) setters */,
9766 /// ]);
9767 /// ```
9768 pub fn set_external_tables<T, V>(mut self, v: T) -> Self
9769 where
9770 T: std::iter::IntoIterator<Item = V>,
9771 V: std::convert::Into<crate::model::DataplexExternalTable>,
9772 {
9773 use std::iter::Iterator;
9774 self.external_tables = v.into_iter().map(|i| i.into()).collect();
9775 self
9776 }
9777
9778 /// Sets the value of [dataplex_spec][crate::model::DataplexTableSpec::dataplex_spec].
9779 ///
9780 /// # Example
9781 /// ```ignore,no_run
9782 /// # use google_cloud_datacatalog_v1::model::DataplexTableSpec;
9783 /// use google_cloud_datacatalog_v1::model::DataplexSpec;
9784 /// let x = DataplexTableSpec::new().set_dataplex_spec(DataplexSpec::default()/* use setters */);
9785 /// ```
9786 pub fn set_dataplex_spec<T>(mut self, v: T) -> Self
9787 where
9788 T: std::convert::Into<crate::model::DataplexSpec>,
9789 {
9790 self.dataplex_spec = std::option::Option::Some(v.into());
9791 self
9792 }
9793
9794 /// Sets or clears the value of [dataplex_spec][crate::model::DataplexTableSpec::dataplex_spec].
9795 ///
9796 /// # Example
9797 /// ```ignore,no_run
9798 /// # use google_cloud_datacatalog_v1::model::DataplexTableSpec;
9799 /// use google_cloud_datacatalog_v1::model::DataplexSpec;
9800 /// let x = DataplexTableSpec::new().set_or_clear_dataplex_spec(Some(DataplexSpec::default()/* use setters */));
9801 /// let x = DataplexTableSpec::new().set_or_clear_dataplex_spec(None::<DataplexSpec>);
9802 /// ```
9803 pub fn set_or_clear_dataplex_spec<T>(mut self, v: std::option::Option<T>) -> Self
9804 where
9805 T: std::convert::Into<crate::model::DataplexSpec>,
9806 {
9807 self.dataplex_spec = v.map(|x| x.into());
9808 self
9809 }
9810
9811 /// Sets the value of [user_managed][crate::model::DataplexTableSpec::user_managed].
9812 ///
9813 /// # Example
9814 /// ```ignore,no_run
9815 /// # use google_cloud_datacatalog_v1::model::DataplexTableSpec;
9816 /// let x = DataplexTableSpec::new().set_user_managed(true);
9817 /// ```
9818 pub fn set_user_managed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9819 self.user_managed = v.into();
9820 self
9821 }
9822}
9823
9824impl wkt::message::Message for DataplexTableSpec {
9825 fn typename() -> &'static str {
9826 "type.googleapis.com/google.cloud.datacatalog.v1.DataplexTableSpec"
9827 }
9828}
9829
9830/// External table registered by Dataplex.
9831/// Dataplex publishes data discovered from an asset into multiple other systems
9832/// (BigQuery, DPMS) in form of tables. We call them "external tables". External
9833/// tables are also synced into the Data Catalog.
9834/// This message contains pointers to
9835/// those external tables (fully qualified name, resource name et cetera) within
9836/// the Data Catalog.
9837#[derive(Clone, Default, PartialEq)]
9838#[non_exhaustive]
9839pub struct DataplexExternalTable {
9840 /// Service in which the external table is registered.
9841 pub system: crate::model::IntegratedSystem,
9842
9843 /// Fully qualified name (FQN) of the external table.
9844 pub fully_qualified_name: std::string::String,
9845
9846 /// Google Cloud resource name of the external table.
9847 pub google_cloud_resource: std::string::String,
9848
9849 /// Name of the Data Catalog entry representing the external table.
9850 pub data_catalog_entry: std::string::String,
9851
9852 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9853}
9854
9855impl DataplexExternalTable {
9856 pub fn new() -> Self {
9857 std::default::Default::default()
9858 }
9859
9860 /// Sets the value of [system][crate::model::DataplexExternalTable::system].
9861 ///
9862 /// # Example
9863 /// ```ignore,no_run
9864 /// # use google_cloud_datacatalog_v1::model::DataplexExternalTable;
9865 /// use google_cloud_datacatalog_v1::model::IntegratedSystem;
9866 /// let x0 = DataplexExternalTable::new().set_system(IntegratedSystem::Bigquery);
9867 /// let x1 = DataplexExternalTable::new().set_system(IntegratedSystem::CloudPubsub);
9868 /// let x2 = DataplexExternalTable::new().set_system(IntegratedSystem::DataprocMetastore);
9869 /// ```
9870 pub fn set_system<T: std::convert::Into<crate::model::IntegratedSystem>>(
9871 mut self,
9872 v: T,
9873 ) -> Self {
9874 self.system = v.into();
9875 self
9876 }
9877
9878 /// Sets the value of [fully_qualified_name][crate::model::DataplexExternalTable::fully_qualified_name].
9879 ///
9880 /// # Example
9881 /// ```ignore,no_run
9882 /// # use google_cloud_datacatalog_v1::model::DataplexExternalTable;
9883 /// let x = DataplexExternalTable::new().set_fully_qualified_name("example");
9884 /// ```
9885 pub fn set_fully_qualified_name<T: std::convert::Into<std::string::String>>(
9886 mut self,
9887 v: T,
9888 ) -> Self {
9889 self.fully_qualified_name = v.into();
9890 self
9891 }
9892
9893 /// Sets the value of [google_cloud_resource][crate::model::DataplexExternalTable::google_cloud_resource].
9894 ///
9895 /// # Example
9896 /// ```ignore,no_run
9897 /// # use google_cloud_datacatalog_v1::model::DataplexExternalTable;
9898 /// let x = DataplexExternalTable::new().set_google_cloud_resource("example");
9899 /// ```
9900 pub fn set_google_cloud_resource<T: std::convert::Into<std::string::String>>(
9901 mut self,
9902 v: T,
9903 ) -> Self {
9904 self.google_cloud_resource = v.into();
9905 self
9906 }
9907
9908 /// Sets the value of [data_catalog_entry][crate::model::DataplexExternalTable::data_catalog_entry].
9909 ///
9910 /// # Example
9911 /// ```ignore,no_run
9912 /// # use google_cloud_datacatalog_v1::model::DataplexExternalTable;
9913 /// let x = DataplexExternalTable::new().set_data_catalog_entry("example");
9914 /// ```
9915 pub fn set_data_catalog_entry<T: std::convert::Into<std::string::String>>(
9916 mut self,
9917 v: T,
9918 ) -> Self {
9919 self.data_catalog_entry = v.into();
9920 self
9921 }
9922}
9923
9924impl wkt::message::Message for DataplexExternalTable {
9925 fn typename() -> &'static str {
9926 "type.googleapis.com/google.cloud.datacatalog.v1.DataplexExternalTable"
9927 }
9928}
9929
9930/// Wrapper containing Entry and information about Tags
9931/// that should and should not be attached to it.
9932#[derive(Clone, Default, PartialEq)]
9933#[non_exhaustive]
9934pub struct TaggedEntry {
9935 /// Optional. Tags that should be ingested into the Data Catalog.
9936 /// Caller should populate template name, column and fields.
9937 pub present_tags: std::vec::Vec<crate::model::Tag>,
9938
9939 /// Optional. Tags that should be deleted from the Data Catalog.
9940 /// Caller should populate template name and column only.
9941 pub absent_tags: std::vec::Vec<crate::model::Tag>,
9942
9943 /// Required. Entry to be ingested.
9944 pub entry: std::option::Option<crate::model::tagged_entry::Entry>,
9945
9946 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9947}
9948
9949impl TaggedEntry {
9950 pub fn new() -> Self {
9951 std::default::Default::default()
9952 }
9953
9954 /// Sets the value of [present_tags][crate::model::TaggedEntry::present_tags].
9955 ///
9956 /// # Example
9957 /// ```ignore,no_run
9958 /// # use google_cloud_datacatalog_v1::model::TaggedEntry;
9959 /// use google_cloud_datacatalog_v1::model::Tag;
9960 /// let x = TaggedEntry::new()
9961 /// .set_present_tags([
9962 /// Tag::default()/* use setters */,
9963 /// Tag::default()/* use (different) setters */,
9964 /// ]);
9965 /// ```
9966 pub fn set_present_tags<T, V>(mut self, v: T) -> Self
9967 where
9968 T: std::iter::IntoIterator<Item = V>,
9969 V: std::convert::Into<crate::model::Tag>,
9970 {
9971 use std::iter::Iterator;
9972 self.present_tags = v.into_iter().map(|i| i.into()).collect();
9973 self
9974 }
9975
9976 /// Sets the value of [absent_tags][crate::model::TaggedEntry::absent_tags].
9977 ///
9978 /// # Example
9979 /// ```ignore,no_run
9980 /// # use google_cloud_datacatalog_v1::model::TaggedEntry;
9981 /// use google_cloud_datacatalog_v1::model::Tag;
9982 /// let x = TaggedEntry::new()
9983 /// .set_absent_tags([
9984 /// Tag::default()/* use setters */,
9985 /// Tag::default()/* use (different) setters */,
9986 /// ]);
9987 /// ```
9988 pub fn set_absent_tags<T, V>(mut self, v: T) -> Self
9989 where
9990 T: std::iter::IntoIterator<Item = V>,
9991 V: std::convert::Into<crate::model::Tag>,
9992 {
9993 use std::iter::Iterator;
9994 self.absent_tags = v.into_iter().map(|i| i.into()).collect();
9995 self
9996 }
9997
9998 /// Sets the value of [entry][crate::model::TaggedEntry::entry].
9999 ///
10000 /// Note that all the setters affecting `entry` are mutually
10001 /// exclusive.
10002 ///
10003 /// # Example
10004 /// ```ignore,no_run
10005 /// # use google_cloud_datacatalog_v1::model::TaggedEntry;
10006 /// use google_cloud_datacatalog_v1::model::Entry;
10007 /// let x = TaggedEntry::new().set_entry(Some(
10008 /// google_cloud_datacatalog_v1::model::tagged_entry::Entry::V1Entry(Entry::default().into())));
10009 /// ```
10010 pub fn set_entry<
10011 T: std::convert::Into<std::option::Option<crate::model::tagged_entry::Entry>>,
10012 >(
10013 mut self,
10014 v: T,
10015 ) -> Self {
10016 self.entry = v.into();
10017 self
10018 }
10019
10020 /// The value of [entry][crate::model::TaggedEntry::entry]
10021 /// if it holds a `V1Entry`, `None` if the field is not set or
10022 /// holds a different branch.
10023 pub fn v1_entry(&self) -> std::option::Option<&std::boxed::Box<crate::model::Entry>> {
10024 #[allow(unreachable_patterns)]
10025 self.entry.as_ref().and_then(|v| match v {
10026 crate::model::tagged_entry::Entry::V1Entry(v) => std::option::Option::Some(v),
10027 _ => std::option::Option::None,
10028 })
10029 }
10030
10031 /// Sets the value of [entry][crate::model::TaggedEntry::entry]
10032 /// to hold a `V1Entry`.
10033 ///
10034 /// Note that all the setters affecting `entry` are
10035 /// mutually exclusive.
10036 ///
10037 /// # Example
10038 /// ```ignore,no_run
10039 /// # use google_cloud_datacatalog_v1::model::TaggedEntry;
10040 /// use google_cloud_datacatalog_v1::model::Entry;
10041 /// let x = TaggedEntry::new().set_v1_entry(Entry::default()/* use setters */);
10042 /// assert!(x.v1_entry().is_some());
10043 /// ```
10044 pub fn set_v1_entry<T: std::convert::Into<std::boxed::Box<crate::model::Entry>>>(
10045 mut self,
10046 v: T,
10047 ) -> Self {
10048 self.entry =
10049 std::option::Option::Some(crate::model::tagged_entry::Entry::V1Entry(v.into()));
10050 self
10051 }
10052}
10053
10054impl wkt::message::Message for TaggedEntry {
10055 fn typename() -> &'static str {
10056 "type.googleapis.com/google.cloud.datacatalog.v1.TaggedEntry"
10057 }
10058}
10059
10060/// Defines additional types related to [TaggedEntry].
10061pub mod tagged_entry {
10062 #[allow(unused_imports)]
10063 use super::*;
10064
10065 /// Required. Entry to be ingested.
10066 #[derive(Clone, Debug, PartialEq)]
10067 #[non_exhaustive]
10068 pub enum Entry {
10069 /// Non-encrypted Data Catalog v1 Entry.
10070 V1Entry(std::boxed::Box<crate::model::Entry>),
10071 }
10072}
10073
10074/// Wrapper for any item that can be contained in the dump.
10075#[derive(Clone, Default, PartialEq)]
10076#[non_exhaustive]
10077pub struct DumpItem {
10078 pub item: std::option::Option<crate::model::dump_item::Item>,
10079
10080 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10081}
10082
10083impl DumpItem {
10084 pub fn new() -> Self {
10085 std::default::Default::default()
10086 }
10087
10088 /// Sets the value of [item][crate::model::DumpItem::item].
10089 ///
10090 /// Note that all the setters affecting `item` are mutually
10091 /// exclusive.
10092 ///
10093 /// # Example
10094 /// ```ignore,no_run
10095 /// # use google_cloud_datacatalog_v1::model::DumpItem;
10096 /// use google_cloud_datacatalog_v1::model::TaggedEntry;
10097 /// let x = DumpItem::new().set_item(Some(
10098 /// google_cloud_datacatalog_v1::model::dump_item::Item::TaggedEntry(TaggedEntry::default().into())));
10099 /// ```
10100 pub fn set_item<T: std::convert::Into<std::option::Option<crate::model::dump_item::Item>>>(
10101 mut self,
10102 v: T,
10103 ) -> Self {
10104 self.item = v.into();
10105 self
10106 }
10107
10108 /// The value of [item][crate::model::DumpItem::item]
10109 /// if it holds a `TaggedEntry`, `None` if the field is not set or
10110 /// holds a different branch.
10111 pub fn tagged_entry(&self) -> std::option::Option<&std::boxed::Box<crate::model::TaggedEntry>> {
10112 #[allow(unreachable_patterns)]
10113 self.item.as_ref().and_then(|v| match v {
10114 crate::model::dump_item::Item::TaggedEntry(v) => std::option::Option::Some(v),
10115 _ => std::option::Option::None,
10116 })
10117 }
10118
10119 /// Sets the value of [item][crate::model::DumpItem::item]
10120 /// to hold a `TaggedEntry`.
10121 ///
10122 /// Note that all the setters affecting `item` are
10123 /// mutually exclusive.
10124 ///
10125 /// # Example
10126 /// ```ignore,no_run
10127 /// # use google_cloud_datacatalog_v1::model::DumpItem;
10128 /// use google_cloud_datacatalog_v1::model::TaggedEntry;
10129 /// let x = DumpItem::new().set_tagged_entry(TaggedEntry::default()/* use setters */);
10130 /// assert!(x.tagged_entry().is_some());
10131 /// ```
10132 pub fn set_tagged_entry<T: std::convert::Into<std::boxed::Box<crate::model::TaggedEntry>>>(
10133 mut self,
10134 v: T,
10135 ) -> Self {
10136 self.item = std::option::Option::Some(crate::model::dump_item::Item::TaggedEntry(v.into()));
10137 self
10138 }
10139}
10140
10141impl wkt::message::Message for DumpItem {
10142 fn typename() -> &'static str {
10143 "type.googleapis.com/google.cloud.datacatalog.v1.DumpItem"
10144 }
10145}
10146
10147/// Defines additional types related to [DumpItem].
10148pub mod dump_item {
10149 #[allow(unused_imports)]
10150 use super::*;
10151
10152 #[derive(Clone, Debug, PartialEq)]
10153 #[non_exhaustive]
10154 pub enum Item {
10155 /// Entry and its tags.
10156 TaggedEntry(std::boxed::Box<crate::model::TaggedEntry>),
10157 }
10158}
10159
10160/// Describes a Cloud Storage fileset entry.
10161#[derive(Clone, Default, PartialEq)]
10162#[non_exhaustive]
10163pub struct GcsFilesetSpec {
10164 /// Required. Patterns to identify a set of files in Google Cloud Storage.
10165 ///
10166 /// For more information, see [Wildcard Names]
10167 /// (<https://cloud.google.com/storage/docs/wildcards>).
10168 ///
10169 /// Note: Currently, bucket wildcards are not supported.
10170 ///
10171 /// Examples of valid `file_patterns`:
10172 ///
10173 /// * `gs://bucket_name/dir/*`: matches all files in `bucket_name/dir`
10174 /// directory
10175 /// * `gs://bucket_name/dir/**`: matches all files in `bucket_name/dir`
10176 /// and all subdirectories
10177 /// * `gs://bucket_name/file*`: matches files prefixed by `file` in
10178 /// `bucket_name`
10179 /// * `gs://bucket_name/??.txt`: matches files with two characters followed by
10180 /// `.txt` in `bucket_name`
10181 /// * `gs://bucket_name/[aeiou].txt`: matches files that contain a single
10182 /// vowel character followed by `.txt` in
10183 /// `bucket_name`
10184 /// * `gs://bucket_name/[a-m].txt`: matches files that contain `a`, `b`, ...
10185 /// or `m` followed by `.txt` in `bucket_name`
10186 /// * `gs://bucket_name/a/*/b`: matches all files in `bucket_name` that match
10187 /// the `a/*/b` pattern, such as `a/c/b`, `a/d/b`
10188 /// * `gs://another_bucket/a.txt`: matches `gs://another_bucket/a.txt`
10189 ///
10190 /// You can combine wildcards to match complex sets of files, for example:
10191 ///
10192 /// `gs://bucket_name/[a-m]??.j*g`
10193 pub file_patterns: std::vec::Vec<std::string::String>,
10194
10195 /// Output only. Sample files contained in this fileset, not all files
10196 /// contained in this fileset are represented here.
10197 pub sample_gcs_file_specs: std::vec::Vec<crate::model::GcsFileSpec>,
10198
10199 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10200}
10201
10202impl GcsFilesetSpec {
10203 pub fn new() -> Self {
10204 std::default::Default::default()
10205 }
10206
10207 /// Sets the value of [file_patterns][crate::model::GcsFilesetSpec::file_patterns].
10208 ///
10209 /// # Example
10210 /// ```ignore,no_run
10211 /// # use google_cloud_datacatalog_v1::model::GcsFilesetSpec;
10212 /// let x = GcsFilesetSpec::new().set_file_patterns(["a", "b", "c"]);
10213 /// ```
10214 pub fn set_file_patterns<T, V>(mut self, v: T) -> Self
10215 where
10216 T: std::iter::IntoIterator<Item = V>,
10217 V: std::convert::Into<std::string::String>,
10218 {
10219 use std::iter::Iterator;
10220 self.file_patterns = v.into_iter().map(|i| i.into()).collect();
10221 self
10222 }
10223
10224 /// Sets the value of [sample_gcs_file_specs][crate::model::GcsFilesetSpec::sample_gcs_file_specs].
10225 ///
10226 /// # Example
10227 /// ```ignore,no_run
10228 /// # use google_cloud_datacatalog_v1::model::GcsFilesetSpec;
10229 /// use google_cloud_datacatalog_v1::model::GcsFileSpec;
10230 /// let x = GcsFilesetSpec::new()
10231 /// .set_sample_gcs_file_specs([
10232 /// GcsFileSpec::default()/* use setters */,
10233 /// GcsFileSpec::default()/* use (different) setters */,
10234 /// ]);
10235 /// ```
10236 pub fn set_sample_gcs_file_specs<T, V>(mut self, v: T) -> Self
10237 where
10238 T: std::iter::IntoIterator<Item = V>,
10239 V: std::convert::Into<crate::model::GcsFileSpec>,
10240 {
10241 use std::iter::Iterator;
10242 self.sample_gcs_file_specs = v.into_iter().map(|i| i.into()).collect();
10243 self
10244 }
10245}
10246
10247impl wkt::message::Message for GcsFilesetSpec {
10248 fn typename() -> &'static str {
10249 "type.googleapis.com/google.cloud.datacatalog.v1.GcsFilesetSpec"
10250 }
10251}
10252
10253/// Specification of a single file in Cloud Storage.
10254#[derive(Clone, Default, PartialEq)]
10255#[non_exhaustive]
10256pub struct GcsFileSpec {
10257 /// Required. Full file path. Example: `gs://bucket_name/a/b.txt`.
10258 pub file_path: std::string::String,
10259
10260 /// Output only. Creation, modification, and expiration timestamps of a Cloud
10261 /// Storage file.
10262 pub gcs_timestamps: std::option::Option<crate::model::SystemTimestamps>,
10263
10264 /// Output only. File size in bytes.
10265 pub size_bytes: i64,
10266
10267 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10268}
10269
10270impl GcsFileSpec {
10271 pub fn new() -> Self {
10272 std::default::Default::default()
10273 }
10274
10275 /// Sets the value of [file_path][crate::model::GcsFileSpec::file_path].
10276 ///
10277 /// # Example
10278 /// ```ignore,no_run
10279 /// # use google_cloud_datacatalog_v1::model::GcsFileSpec;
10280 /// let x = GcsFileSpec::new().set_file_path("example");
10281 /// ```
10282 pub fn set_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10283 self.file_path = v.into();
10284 self
10285 }
10286
10287 /// Sets the value of [gcs_timestamps][crate::model::GcsFileSpec::gcs_timestamps].
10288 ///
10289 /// # Example
10290 /// ```ignore,no_run
10291 /// # use google_cloud_datacatalog_v1::model::GcsFileSpec;
10292 /// use google_cloud_datacatalog_v1::model::SystemTimestamps;
10293 /// let x = GcsFileSpec::new().set_gcs_timestamps(SystemTimestamps::default()/* use setters */);
10294 /// ```
10295 pub fn set_gcs_timestamps<T>(mut self, v: T) -> Self
10296 where
10297 T: std::convert::Into<crate::model::SystemTimestamps>,
10298 {
10299 self.gcs_timestamps = std::option::Option::Some(v.into());
10300 self
10301 }
10302
10303 /// Sets or clears the value of [gcs_timestamps][crate::model::GcsFileSpec::gcs_timestamps].
10304 ///
10305 /// # Example
10306 /// ```ignore,no_run
10307 /// # use google_cloud_datacatalog_v1::model::GcsFileSpec;
10308 /// use google_cloud_datacatalog_v1::model::SystemTimestamps;
10309 /// let x = GcsFileSpec::new().set_or_clear_gcs_timestamps(Some(SystemTimestamps::default()/* use setters */));
10310 /// let x = GcsFileSpec::new().set_or_clear_gcs_timestamps(None::<SystemTimestamps>);
10311 /// ```
10312 pub fn set_or_clear_gcs_timestamps<T>(mut self, v: std::option::Option<T>) -> Self
10313 where
10314 T: std::convert::Into<crate::model::SystemTimestamps>,
10315 {
10316 self.gcs_timestamps = v.map(|x| x.into());
10317 self
10318 }
10319
10320 /// Sets the value of [size_bytes][crate::model::GcsFileSpec::size_bytes].
10321 ///
10322 /// # Example
10323 /// ```ignore,no_run
10324 /// # use google_cloud_datacatalog_v1::model::GcsFileSpec;
10325 /// let x = GcsFileSpec::new().set_size_bytes(42);
10326 /// ```
10327 pub fn set_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10328 self.size_bytes = v.into();
10329 self
10330 }
10331}
10332
10333impl wkt::message::Message for GcsFileSpec {
10334 fn typename() -> &'static str {
10335 "type.googleapis.com/google.cloud.datacatalog.v1.GcsFileSpec"
10336 }
10337}
10338
10339/// Native schema used by a resource represented as an entry. Used by query
10340/// engines for deserializing and parsing source data.
10341#[derive(Clone, Default, PartialEq)]
10342#[non_exhaustive]
10343pub struct PhysicalSchema {
10344 pub schema: std::option::Option<crate::model::physical_schema::Schema>,
10345
10346 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10347}
10348
10349impl PhysicalSchema {
10350 pub fn new() -> Self {
10351 std::default::Default::default()
10352 }
10353
10354 /// Sets the value of [schema][crate::model::PhysicalSchema::schema].
10355 ///
10356 /// Note that all the setters affecting `schema` are mutually
10357 /// exclusive.
10358 ///
10359 /// # Example
10360 /// ```ignore,no_run
10361 /// # use google_cloud_datacatalog_v1::model::PhysicalSchema;
10362 /// use google_cloud_datacatalog_v1::model::physical_schema::AvroSchema;
10363 /// let x = PhysicalSchema::new().set_schema(Some(
10364 /// google_cloud_datacatalog_v1::model::physical_schema::Schema::Avro(AvroSchema::default().into())));
10365 /// ```
10366 pub fn set_schema<
10367 T: std::convert::Into<std::option::Option<crate::model::physical_schema::Schema>>,
10368 >(
10369 mut self,
10370 v: T,
10371 ) -> Self {
10372 self.schema = v.into();
10373 self
10374 }
10375
10376 /// The value of [schema][crate::model::PhysicalSchema::schema]
10377 /// if it holds a `Avro`, `None` if the field is not set or
10378 /// holds a different branch.
10379 pub fn avro(
10380 &self,
10381 ) -> std::option::Option<&std::boxed::Box<crate::model::physical_schema::AvroSchema>> {
10382 #[allow(unreachable_patterns)]
10383 self.schema.as_ref().and_then(|v| match v {
10384 crate::model::physical_schema::Schema::Avro(v) => std::option::Option::Some(v),
10385 _ => std::option::Option::None,
10386 })
10387 }
10388
10389 /// Sets the value of [schema][crate::model::PhysicalSchema::schema]
10390 /// to hold a `Avro`.
10391 ///
10392 /// Note that all the setters affecting `schema` are
10393 /// mutually exclusive.
10394 ///
10395 /// # Example
10396 /// ```ignore,no_run
10397 /// # use google_cloud_datacatalog_v1::model::PhysicalSchema;
10398 /// use google_cloud_datacatalog_v1::model::physical_schema::AvroSchema;
10399 /// let x = PhysicalSchema::new().set_avro(AvroSchema::default()/* use setters */);
10400 /// assert!(x.avro().is_some());
10401 /// assert!(x.thrift().is_none());
10402 /// assert!(x.protobuf().is_none());
10403 /// assert!(x.parquet().is_none());
10404 /// assert!(x.orc().is_none());
10405 /// assert!(x.csv().is_none());
10406 /// ```
10407 pub fn set_avro<
10408 T: std::convert::Into<std::boxed::Box<crate::model::physical_schema::AvroSchema>>,
10409 >(
10410 mut self,
10411 v: T,
10412 ) -> Self {
10413 self.schema =
10414 std::option::Option::Some(crate::model::physical_schema::Schema::Avro(v.into()));
10415 self
10416 }
10417
10418 /// The value of [schema][crate::model::PhysicalSchema::schema]
10419 /// if it holds a `Thrift`, `None` if the field is not set or
10420 /// holds a different branch.
10421 pub fn thrift(
10422 &self,
10423 ) -> std::option::Option<&std::boxed::Box<crate::model::physical_schema::ThriftSchema>> {
10424 #[allow(unreachable_patterns)]
10425 self.schema.as_ref().and_then(|v| match v {
10426 crate::model::physical_schema::Schema::Thrift(v) => std::option::Option::Some(v),
10427 _ => std::option::Option::None,
10428 })
10429 }
10430
10431 /// Sets the value of [schema][crate::model::PhysicalSchema::schema]
10432 /// to hold a `Thrift`.
10433 ///
10434 /// Note that all the setters affecting `schema` are
10435 /// mutually exclusive.
10436 ///
10437 /// # Example
10438 /// ```ignore,no_run
10439 /// # use google_cloud_datacatalog_v1::model::PhysicalSchema;
10440 /// use google_cloud_datacatalog_v1::model::physical_schema::ThriftSchema;
10441 /// let x = PhysicalSchema::new().set_thrift(ThriftSchema::default()/* use setters */);
10442 /// assert!(x.thrift().is_some());
10443 /// assert!(x.avro().is_none());
10444 /// assert!(x.protobuf().is_none());
10445 /// assert!(x.parquet().is_none());
10446 /// assert!(x.orc().is_none());
10447 /// assert!(x.csv().is_none());
10448 /// ```
10449 pub fn set_thrift<
10450 T: std::convert::Into<std::boxed::Box<crate::model::physical_schema::ThriftSchema>>,
10451 >(
10452 mut self,
10453 v: T,
10454 ) -> Self {
10455 self.schema =
10456 std::option::Option::Some(crate::model::physical_schema::Schema::Thrift(v.into()));
10457 self
10458 }
10459
10460 /// The value of [schema][crate::model::PhysicalSchema::schema]
10461 /// if it holds a `Protobuf`, `None` if the field is not set or
10462 /// holds a different branch.
10463 pub fn protobuf(
10464 &self,
10465 ) -> std::option::Option<&std::boxed::Box<crate::model::physical_schema::ProtobufSchema>> {
10466 #[allow(unreachable_patterns)]
10467 self.schema.as_ref().and_then(|v| match v {
10468 crate::model::physical_schema::Schema::Protobuf(v) => std::option::Option::Some(v),
10469 _ => std::option::Option::None,
10470 })
10471 }
10472
10473 /// Sets the value of [schema][crate::model::PhysicalSchema::schema]
10474 /// to hold a `Protobuf`.
10475 ///
10476 /// Note that all the setters affecting `schema` are
10477 /// mutually exclusive.
10478 ///
10479 /// # Example
10480 /// ```ignore,no_run
10481 /// # use google_cloud_datacatalog_v1::model::PhysicalSchema;
10482 /// use google_cloud_datacatalog_v1::model::physical_schema::ProtobufSchema;
10483 /// let x = PhysicalSchema::new().set_protobuf(ProtobufSchema::default()/* use setters */);
10484 /// assert!(x.protobuf().is_some());
10485 /// assert!(x.avro().is_none());
10486 /// assert!(x.thrift().is_none());
10487 /// assert!(x.parquet().is_none());
10488 /// assert!(x.orc().is_none());
10489 /// assert!(x.csv().is_none());
10490 /// ```
10491 pub fn set_protobuf<
10492 T: std::convert::Into<std::boxed::Box<crate::model::physical_schema::ProtobufSchema>>,
10493 >(
10494 mut self,
10495 v: T,
10496 ) -> Self {
10497 self.schema =
10498 std::option::Option::Some(crate::model::physical_schema::Schema::Protobuf(v.into()));
10499 self
10500 }
10501
10502 /// The value of [schema][crate::model::PhysicalSchema::schema]
10503 /// if it holds a `Parquet`, `None` if the field is not set or
10504 /// holds a different branch.
10505 pub fn parquet(
10506 &self,
10507 ) -> std::option::Option<&std::boxed::Box<crate::model::physical_schema::ParquetSchema>> {
10508 #[allow(unreachable_patterns)]
10509 self.schema.as_ref().and_then(|v| match v {
10510 crate::model::physical_schema::Schema::Parquet(v) => std::option::Option::Some(v),
10511 _ => std::option::Option::None,
10512 })
10513 }
10514
10515 /// Sets the value of [schema][crate::model::PhysicalSchema::schema]
10516 /// to hold a `Parquet`.
10517 ///
10518 /// Note that all the setters affecting `schema` are
10519 /// mutually exclusive.
10520 ///
10521 /// # Example
10522 /// ```ignore,no_run
10523 /// # use google_cloud_datacatalog_v1::model::PhysicalSchema;
10524 /// use google_cloud_datacatalog_v1::model::physical_schema::ParquetSchema;
10525 /// let x = PhysicalSchema::new().set_parquet(ParquetSchema::default()/* use setters */);
10526 /// assert!(x.parquet().is_some());
10527 /// assert!(x.avro().is_none());
10528 /// assert!(x.thrift().is_none());
10529 /// assert!(x.protobuf().is_none());
10530 /// assert!(x.orc().is_none());
10531 /// assert!(x.csv().is_none());
10532 /// ```
10533 pub fn set_parquet<
10534 T: std::convert::Into<std::boxed::Box<crate::model::physical_schema::ParquetSchema>>,
10535 >(
10536 mut self,
10537 v: T,
10538 ) -> Self {
10539 self.schema =
10540 std::option::Option::Some(crate::model::physical_schema::Schema::Parquet(v.into()));
10541 self
10542 }
10543
10544 /// The value of [schema][crate::model::PhysicalSchema::schema]
10545 /// if it holds a `Orc`, `None` if the field is not set or
10546 /// holds a different branch.
10547 pub fn orc(
10548 &self,
10549 ) -> std::option::Option<&std::boxed::Box<crate::model::physical_schema::OrcSchema>> {
10550 #[allow(unreachable_patterns)]
10551 self.schema.as_ref().and_then(|v| match v {
10552 crate::model::physical_schema::Schema::Orc(v) => std::option::Option::Some(v),
10553 _ => std::option::Option::None,
10554 })
10555 }
10556
10557 /// Sets the value of [schema][crate::model::PhysicalSchema::schema]
10558 /// to hold a `Orc`.
10559 ///
10560 /// Note that all the setters affecting `schema` are
10561 /// mutually exclusive.
10562 ///
10563 /// # Example
10564 /// ```ignore,no_run
10565 /// # use google_cloud_datacatalog_v1::model::PhysicalSchema;
10566 /// use google_cloud_datacatalog_v1::model::physical_schema::OrcSchema;
10567 /// let x = PhysicalSchema::new().set_orc(OrcSchema::default()/* use setters */);
10568 /// assert!(x.orc().is_some());
10569 /// assert!(x.avro().is_none());
10570 /// assert!(x.thrift().is_none());
10571 /// assert!(x.protobuf().is_none());
10572 /// assert!(x.parquet().is_none());
10573 /// assert!(x.csv().is_none());
10574 /// ```
10575 pub fn set_orc<
10576 T: std::convert::Into<std::boxed::Box<crate::model::physical_schema::OrcSchema>>,
10577 >(
10578 mut self,
10579 v: T,
10580 ) -> Self {
10581 self.schema =
10582 std::option::Option::Some(crate::model::physical_schema::Schema::Orc(v.into()));
10583 self
10584 }
10585
10586 /// The value of [schema][crate::model::PhysicalSchema::schema]
10587 /// if it holds a `Csv`, `None` if the field is not set or
10588 /// holds a different branch.
10589 pub fn csv(
10590 &self,
10591 ) -> std::option::Option<&std::boxed::Box<crate::model::physical_schema::CsvSchema>> {
10592 #[allow(unreachable_patterns)]
10593 self.schema.as_ref().and_then(|v| match v {
10594 crate::model::physical_schema::Schema::Csv(v) => std::option::Option::Some(v),
10595 _ => std::option::Option::None,
10596 })
10597 }
10598
10599 /// Sets the value of [schema][crate::model::PhysicalSchema::schema]
10600 /// to hold a `Csv`.
10601 ///
10602 /// Note that all the setters affecting `schema` are
10603 /// mutually exclusive.
10604 ///
10605 /// # Example
10606 /// ```ignore,no_run
10607 /// # use google_cloud_datacatalog_v1::model::PhysicalSchema;
10608 /// use google_cloud_datacatalog_v1::model::physical_schema::CsvSchema;
10609 /// let x = PhysicalSchema::new().set_csv(CsvSchema::default()/* use setters */);
10610 /// assert!(x.csv().is_some());
10611 /// assert!(x.avro().is_none());
10612 /// assert!(x.thrift().is_none());
10613 /// assert!(x.protobuf().is_none());
10614 /// assert!(x.parquet().is_none());
10615 /// assert!(x.orc().is_none());
10616 /// ```
10617 pub fn set_csv<
10618 T: std::convert::Into<std::boxed::Box<crate::model::physical_schema::CsvSchema>>,
10619 >(
10620 mut self,
10621 v: T,
10622 ) -> Self {
10623 self.schema =
10624 std::option::Option::Some(crate::model::physical_schema::Schema::Csv(v.into()));
10625 self
10626 }
10627}
10628
10629impl wkt::message::Message for PhysicalSchema {
10630 fn typename() -> &'static str {
10631 "type.googleapis.com/google.cloud.datacatalog.v1.PhysicalSchema"
10632 }
10633}
10634
10635/// Defines additional types related to [PhysicalSchema].
10636pub mod physical_schema {
10637 #[allow(unused_imports)]
10638 use super::*;
10639
10640 /// Schema in Avro JSON format.
10641 #[derive(Clone, Default, PartialEq)]
10642 #[non_exhaustive]
10643 pub struct AvroSchema {
10644 /// JSON source of the Avro schema.
10645 pub text: std::string::String,
10646
10647 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10648 }
10649
10650 impl AvroSchema {
10651 pub fn new() -> Self {
10652 std::default::Default::default()
10653 }
10654
10655 /// Sets the value of [text][crate::model::physical_schema::AvroSchema::text].
10656 ///
10657 /// # Example
10658 /// ```ignore,no_run
10659 /// # use google_cloud_datacatalog_v1::model::physical_schema::AvroSchema;
10660 /// let x = AvroSchema::new().set_text("example");
10661 /// ```
10662 pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10663 self.text = v.into();
10664 self
10665 }
10666 }
10667
10668 impl wkt::message::Message for AvroSchema {
10669 fn typename() -> &'static str {
10670 "type.googleapis.com/google.cloud.datacatalog.v1.PhysicalSchema.AvroSchema"
10671 }
10672 }
10673
10674 /// Schema in Thrift format.
10675 #[derive(Clone, Default, PartialEq)]
10676 #[non_exhaustive]
10677 pub struct ThriftSchema {
10678 /// Thrift IDL source of the schema.
10679 pub text: std::string::String,
10680
10681 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10682 }
10683
10684 impl ThriftSchema {
10685 pub fn new() -> Self {
10686 std::default::Default::default()
10687 }
10688
10689 /// Sets the value of [text][crate::model::physical_schema::ThriftSchema::text].
10690 ///
10691 /// # Example
10692 /// ```ignore,no_run
10693 /// # use google_cloud_datacatalog_v1::model::physical_schema::ThriftSchema;
10694 /// let x = ThriftSchema::new().set_text("example");
10695 /// ```
10696 pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10697 self.text = v.into();
10698 self
10699 }
10700 }
10701
10702 impl wkt::message::Message for ThriftSchema {
10703 fn typename() -> &'static str {
10704 "type.googleapis.com/google.cloud.datacatalog.v1.PhysicalSchema.ThriftSchema"
10705 }
10706 }
10707
10708 /// Schema in protocol buffer format.
10709 #[derive(Clone, Default, PartialEq)]
10710 #[non_exhaustive]
10711 pub struct ProtobufSchema {
10712 /// Protocol buffer source of the schema.
10713 pub text: std::string::String,
10714
10715 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10716 }
10717
10718 impl ProtobufSchema {
10719 pub fn new() -> Self {
10720 std::default::Default::default()
10721 }
10722
10723 /// Sets the value of [text][crate::model::physical_schema::ProtobufSchema::text].
10724 ///
10725 /// # Example
10726 /// ```ignore,no_run
10727 /// # use google_cloud_datacatalog_v1::model::physical_schema::ProtobufSchema;
10728 /// let x = ProtobufSchema::new().set_text("example");
10729 /// ```
10730 pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10731 self.text = v.into();
10732 self
10733 }
10734 }
10735
10736 impl wkt::message::Message for ProtobufSchema {
10737 fn typename() -> &'static str {
10738 "type.googleapis.com/google.cloud.datacatalog.v1.PhysicalSchema.ProtobufSchema"
10739 }
10740 }
10741
10742 /// Marks a Parquet-encoded data source.
10743 #[derive(Clone, Default, PartialEq)]
10744 #[non_exhaustive]
10745 pub struct ParquetSchema {
10746 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10747 }
10748
10749 impl ParquetSchema {
10750 pub fn new() -> Self {
10751 std::default::Default::default()
10752 }
10753 }
10754
10755 impl wkt::message::Message for ParquetSchema {
10756 fn typename() -> &'static str {
10757 "type.googleapis.com/google.cloud.datacatalog.v1.PhysicalSchema.ParquetSchema"
10758 }
10759 }
10760
10761 /// Marks an ORC-encoded data source.
10762 #[derive(Clone, Default, PartialEq)]
10763 #[non_exhaustive]
10764 pub struct OrcSchema {
10765 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10766 }
10767
10768 impl OrcSchema {
10769 pub fn new() -> Self {
10770 std::default::Default::default()
10771 }
10772 }
10773
10774 impl wkt::message::Message for OrcSchema {
10775 fn typename() -> &'static str {
10776 "type.googleapis.com/google.cloud.datacatalog.v1.PhysicalSchema.OrcSchema"
10777 }
10778 }
10779
10780 /// Marks a CSV-encoded data source.
10781 #[derive(Clone, Default, PartialEq)]
10782 #[non_exhaustive]
10783 pub struct CsvSchema {
10784 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10785 }
10786
10787 impl CsvSchema {
10788 pub fn new() -> Self {
10789 std::default::Default::default()
10790 }
10791 }
10792
10793 impl wkt::message::Message for CsvSchema {
10794 fn typename() -> &'static str {
10795 "type.googleapis.com/google.cloud.datacatalog.v1.PhysicalSchema.CsvSchema"
10796 }
10797 }
10798
10799 #[derive(Clone, Debug, PartialEq)]
10800 #[non_exhaustive]
10801 pub enum Schema {
10802 /// Schema in Avro JSON format.
10803 Avro(std::boxed::Box<crate::model::physical_schema::AvroSchema>),
10804 /// Schema in Thrift format.
10805 Thrift(std::boxed::Box<crate::model::physical_schema::ThriftSchema>),
10806 /// Schema in protocol buffer format.
10807 Protobuf(std::boxed::Box<crate::model::physical_schema::ProtobufSchema>),
10808 /// Marks a Parquet-encoded data source.
10809 Parquet(std::boxed::Box<crate::model::physical_schema::ParquetSchema>),
10810 /// Marks an ORC-encoded data source.
10811 Orc(std::boxed::Box<crate::model::physical_schema::OrcSchema>),
10812 /// Marks a CSV-encoded data source.
10813 Csv(std::boxed::Box<crate::model::physical_schema::CsvSchema>),
10814 }
10815}
10816
10817/// A taxonomy is a collection of hierarchical policy tags that classify data
10818/// along a common axis.
10819///
10820/// For example, a "data sensitivity" taxonomy might contain the following policy
10821/// tags:
10822///
10823/// ```norust
10824/// + PII
10825/// + Account number
10826/// + Age
10827/// + SSN
10828/// + Zipcode
10829/// + Financials
10830/// + Revenue
10831/// ```
10832///
10833/// A "data origin" taxonomy might contain the following policy tags:
10834///
10835/// ```norust
10836/// + User data
10837/// + Employee data
10838/// + Partner data
10839/// + Public data
10840/// ```
10841#[derive(Clone, Default, PartialEq)]
10842#[non_exhaustive]
10843pub struct Taxonomy {
10844 /// Identifier. Resource name of this taxonomy in URL format.
10845 ///
10846 /// Note: Policy tag manager generates unique taxonomy IDs.
10847 pub name: std::string::String,
10848
10849 /// Required. User-defined name of this taxonomy.
10850 ///
10851 /// The name can't start or end with spaces, must contain only Unicode letters,
10852 /// numbers, underscores, dashes, and spaces, and be at most 200 bytes long
10853 /// when encoded in UTF-8.
10854 ///
10855 /// The taxonomy display name must be unique within an organization.
10856 pub display_name: std::string::String,
10857
10858 /// Optional. Description of this taxonomy. If not set, defaults to empty.
10859 ///
10860 /// The description must contain only Unicode characters, tabs, newlines,
10861 /// carriage returns, and page breaks, and be at most 2000 bytes long when
10862 /// encoded in UTF-8.
10863 pub description: std::string::String,
10864
10865 /// Output only. Number of policy tags in this taxonomy.
10866 pub policy_tag_count: i32,
10867
10868 /// Output only. Creation and modification timestamps of this taxonomy.
10869 pub taxonomy_timestamps: std::option::Option<crate::model::SystemTimestamps>,
10870
10871 /// Optional. A list of policy types that are activated for this taxonomy. If
10872 /// not set, defaults to an empty list.
10873 pub activated_policy_types: std::vec::Vec<crate::model::taxonomy::PolicyType>,
10874
10875 /// Output only. Identity of the service which owns the Taxonomy. This field is
10876 /// only populated when the taxonomy is created by a Google Cloud service.
10877 /// Currently only 'DATAPLEX' is supported.
10878 pub service: std::option::Option<crate::model::taxonomy::Service>,
10879
10880 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10881}
10882
10883impl Taxonomy {
10884 pub fn new() -> Self {
10885 std::default::Default::default()
10886 }
10887
10888 /// Sets the value of [name][crate::model::Taxonomy::name].
10889 ///
10890 /// # Example
10891 /// ```ignore,no_run
10892 /// # use google_cloud_datacatalog_v1::model::Taxonomy;
10893 /// let x = Taxonomy::new().set_name("example");
10894 /// ```
10895 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10896 self.name = v.into();
10897 self
10898 }
10899
10900 /// Sets the value of [display_name][crate::model::Taxonomy::display_name].
10901 ///
10902 /// # Example
10903 /// ```ignore,no_run
10904 /// # use google_cloud_datacatalog_v1::model::Taxonomy;
10905 /// let x = Taxonomy::new().set_display_name("example");
10906 /// ```
10907 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10908 self.display_name = v.into();
10909 self
10910 }
10911
10912 /// Sets the value of [description][crate::model::Taxonomy::description].
10913 ///
10914 /// # Example
10915 /// ```ignore,no_run
10916 /// # use google_cloud_datacatalog_v1::model::Taxonomy;
10917 /// let x = Taxonomy::new().set_description("example");
10918 /// ```
10919 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10920 self.description = v.into();
10921 self
10922 }
10923
10924 /// Sets the value of [policy_tag_count][crate::model::Taxonomy::policy_tag_count].
10925 ///
10926 /// # Example
10927 /// ```ignore,no_run
10928 /// # use google_cloud_datacatalog_v1::model::Taxonomy;
10929 /// let x = Taxonomy::new().set_policy_tag_count(42);
10930 /// ```
10931 pub fn set_policy_tag_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10932 self.policy_tag_count = v.into();
10933 self
10934 }
10935
10936 /// Sets the value of [taxonomy_timestamps][crate::model::Taxonomy::taxonomy_timestamps].
10937 ///
10938 /// # Example
10939 /// ```ignore,no_run
10940 /// # use google_cloud_datacatalog_v1::model::Taxonomy;
10941 /// use google_cloud_datacatalog_v1::model::SystemTimestamps;
10942 /// let x = Taxonomy::new().set_taxonomy_timestamps(SystemTimestamps::default()/* use setters */);
10943 /// ```
10944 pub fn set_taxonomy_timestamps<T>(mut self, v: T) -> Self
10945 where
10946 T: std::convert::Into<crate::model::SystemTimestamps>,
10947 {
10948 self.taxonomy_timestamps = std::option::Option::Some(v.into());
10949 self
10950 }
10951
10952 /// Sets or clears the value of [taxonomy_timestamps][crate::model::Taxonomy::taxonomy_timestamps].
10953 ///
10954 /// # Example
10955 /// ```ignore,no_run
10956 /// # use google_cloud_datacatalog_v1::model::Taxonomy;
10957 /// use google_cloud_datacatalog_v1::model::SystemTimestamps;
10958 /// let x = Taxonomy::new().set_or_clear_taxonomy_timestamps(Some(SystemTimestamps::default()/* use setters */));
10959 /// let x = Taxonomy::new().set_or_clear_taxonomy_timestamps(None::<SystemTimestamps>);
10960 /// ```
10961 pub fn set_or_clear_taxonomy_timestamps<T>(mut self, v: std::option::Option<T>) -> Self
10962 where
10963 T: std::convert::Into<crate::model::SystemTimestamps>,
10964 {
10965 self.taxonomy_timestamps = v.map(|x| x.into());
10966 self
10967 }
10968
10969 /// Sets the value of [activated_policy_types][crate::model::Taxonomy::activated_policy_types].
10970 ///
10971 /// # Example
10972 /// ```ignore,no_run
10973 /// # use google_cloud_datacatalog_v1::model::Taxonomy;
10974 /// use google_cloud_datacatalog_v1::model::taxonomy::PolicyType;
10975 /// let x = Taxonomy::new().set_activated_policy_types([
10976 /// PolicyType::FineGrainedAccessControl,
10977 /// ]);
10978 /// ```
10979 pub fn set_activated_policy_types<T, V>(mut self, v: T) -> Self
10980 where
10981 T: std::iter::IntoIterator<Item = V>,
10982 V: std::convert::Into<crate::model::taxonomy::PolicyType>,
10983 {
10984 use std::iter::Iterator;
10985 self.activated_policy_types = v.into_iter().map(|i| i.into()).collect();
10986 self
10987 }
10988
10989 /// Sets the value of [service][crate::model::Taxonomy::service].
10990 ///
10991 /// # Example
10992 /// ```ignore,no_run
10993 /// # use google_cloud_datacatalog_v1::model::Taxonomy;
10994 /// use google_cloud_datacatalog_v1::model::taxonomy::Service;
10995 /// let x = Taxonomy::new().set_service(Service::default()/* use setters */);
10996 /// ```
10997 pub fn set_service<T>(mut self, v: T) -> Self
10998 where
10999 T: std::convert::Into<crate::model::taxonomy::Service>,
11000 {
11001 self.service = std::option::Option::Some(v.into());
11002 self
11003 }
11004
11005 /// Sets or clears the value of [service][crate::model::Taxonomy::service].
11006 ///
11007 /// # Example
11008 /// ```ignore,no_run
11009 /// # use google_cloud_datacatalog_v1::model::Taxonomy;
11010 /// use google_cloud_datacatalog_v1::model::taxonomy::Service;
11011 /// let x = Taxonomy::new().set_or_clear_service(Some(Service::default()/* use setters */));
11012 /// let x = Taxonomy::new().set_or_clear_service(None::<Service>);
11013 /// ```
11014 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
11015 where
11016 T: std::convert::Into<crate::model::taxonomy::Service>,
11017 {
11018 self.service = v.map(|x| x.into());
11019 self
11020 }
11021}
11022
11023impl wkt::message::Message for Taxonomy {
11024 fn typename() -> &'static str {
11025 "type.googleapis.com/google.cloud.datacatalog.v1.Taxonomy"
11026 }
11027}
11028
11029/// Defines additional types related to [Taxonomy].
11030pub mod taxonomy {
11031 #[allow(unused_imports)]
11032 use super::*;
11033
11034 /// The source system of the Taxonomy.
11035 #[derive(Clone, Default, PartialEq)]
11036 #[non_exhaustive]
11037 pub struct Service {
11038 /// The Google Cloud service name.
11039 pub name: crate::model::ManagingSystem,
11040
11041 /// The service agent for the service.
11042 pub identity: std::string::String,
11043
11044 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11045 }
11046
11047 impl Service {
11048 pub fn new() -> Self {
11049 std::default::Default::default()
11050 }
11051
11052 /// Sets the value of [name][crate::model::taxonomy::Service::name].
11053 ///
11054 /// # Example
11055 /// ```ignore,no_run
11056 /// # use google_cloud_datacatalog_v1::model::taxonomy::Service;
11057 /// use google_cloud_datacatalog_v1::model::ManagingSystem;
11058 /// let x0 = Service::new().set_name(ManagingSystem::Dataplex);
11059 /// let x1 = Service::new().set_name(ManagingSystem::Other);
11060 /// ```
11061 pub fn set_name<T: std::convert::Into<crate::model::ManagingSystem>>(
11062 mut self,
11063 v: T,
11064 ) -> Self {
11065 self.name = v.into();
11066 self
11067 }
11068
11069 /// Sets the value of [identity][crate::model::taxonomy::Service::identity].
11070 ///
11071 /// # Example
11072 /// ```ignore,no_run
11073 /// # use google_cloud_datacatalog_v1::model::taxonomy::Service;
11074 /// let x = Service::new().set_identity("example");
11075 /// ```
11076 pub fn set_identity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11077 self.identity = v.into();
11078 self
11079 }
11080 }
11081
11082 impl wkt::message::Message for Service {
11083 fn typename() -> &'static str {
11084 "type.googleapis.com/google.cloud.datacatalog.v1.Taxonomy.Service"
11085 }
11086 }
11087
11088 /// Defines policy types where the policy tags can be used for.
11089 ///
11090 /// # Working with unknown values
11091 ///
11092 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11093 /// additional enum variants at any time. Adding new variants is not considered
11094 /// a breaking change. Applications should write their code in anticipation of:
11095 ///
11096 /// - New values appearing in future releases of the client library, **and**
11097 /// - New values received dynamically, without application changes.
11098 ///
11099 /// Please consult the [Working with enums] section in the user guide for some
11100 /// guidelines.
11101 ///
11102 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11103 #[derive(Clone, Debug, PartialEq)]
11104 #[non_exhaustive]
11105 pub enum PolicyType {
11106 /// Unspecified policy type.
11107 Unspecified,
11108 /// Fine-grained access control policy that enables access control on
11109 /// tagged sub-resources.
11110 FineGrainedAccessControl,
11111 /// If set, the enum was initialized with an unknown value.
11112 ///
11113 /// Applications can examine the value using [PolicyType::value] or
11114 /// [PolicyType::name].
11115 UnknownValue(policy_type::UnknownValue),
11116 }
11117
11118 #[doc(hidden)]
11119 pub mod policy_type {
11120 #[allow(unused_imports)]
11121 use super::*;
11122 #[derive(Clone, Debug, PartialEq)]
11123 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11124 }
11125
11126 impl PolicyType {
11127 /// Gets the enum value.
11128 ///
11129 /// Returns `None` if the enum contains an unknown value deserialized from
11130 /// the string representation of enums.
11131 pub fn value(&self) -> std::option::Option<i32> {
11132 match self {
11133 Self::Unspecified => std::option::Option::Some(0),
11134 Self::FineGrainedAccessControl => std::option::Option::Some(1),
11135 Self::UnknownValue(u) => u.0.value(),
11136 }
11137 }
11138
11139 /// Gets the enum value as a string.
11140 ///
11141 /// Returns `None` if the enum contains an unknown value deserialized from
11142 /// the integer representation of enums.
11143 pub fn name(&self) -> std::option::Option<&str> {
11144 match self {
11145 Self::Unspecified => std::option::Option::Some("POLICY_TYPE_UNSPECIFIED"),
11146 Self::FineGrainedAccessControl => {
11147 std::option::Option::Some("FINE_GRAINED_ACCESS_CONTROL")
11148 }
11149 Self::UnknownValue(u) => u.0.name(),
11150 }
11151 }
11152 }
11153
11154 impl std::default::Default for PolicyType {
11155 fn default() -> Self {
11156 use std::convert::From;
11157 Self::from(0)
11158 }
11159 }
11160
11161 impl std::fmt::Display for PolicyType {
11162 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11163 wkt::internal::display_enum(f, self.name(), self.value())
11164 }
11165 }
11166
11167 impl std::convert::From<i32> for PolicyType {
11168 fn from(value: i32) -> Self {
11169 match value {
11170 0 => Self::Unspecified,
11171 1 => Self::FineGrainedAccessControl,
11172 _ => Self::UnknownValue(policy_type::UnknownValue(
11173 wkt::internal::UnknownEnumValue::Integer(value),
11174 )),
11175 }
11176 }
11177 }
11178
11179 impl std::convert::From<&str> for PolicyType {
11180 fn from(value: &str) -> Self {
11181 use std::string::ToString;
11182 match value {
11183 "POLICY_TYPE_UNSPECIFIED" => Self::Unspecified,
11184 "FINE_GRAINED_ACCESS_CONTROL" => Self::FineGrainedAccessControl,
11185 _ => Self::UnknownValue(policy_type::UnknownValue(
11186 wkt::internal::UnknownEnumValue::String(value.to_string()),
11187 )),
11188 }
11189 }
11190 }
11191
11192 impl serde::ser::Serialize for PolicyType {
11193 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11194 where
11195 S: serde::Serializer,
11196 {
11197 match self {
11198 Self::Unspecified => serializer.serialize_i32(0),
11199 Self::FineGrainedAccessControl => serializer.serialize_i32(1),
11200 Self::UnknownValue(u) => u.0.serialize(serializer),
11201 }
11202 }
11203 }
11204
11205 impl<'de> serde::de::Deserialize<'de> for PolicyType {
11206 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11207 where
11208 D: serde::Deserializer<'de>,
11209 {
11210 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyType>::new(
11211 ".google.cloud.datacatalog.v1.Taxonomy.PolicyType",
11212 ))
11213 }
11214 }
11215}
11216
11217/// Denotes one policy tag in a taxonomy, for example, SSN.
11218///
11219/// Policy tags can be defined in a hierarchy. For example:
11220///
11221/// ```norust
11222/// + Geolocation
11223/// + LatLong
11224/// + City
11225/// + ZipCode
11226/// ```
11227///
11228/// Where the "Geolocation" policy tag contains three children.
11229#[derive(Clone, Default, PartialEq)]
11230#[non_exhaustive]
11231pub struct PolicyTag {
11232 /// Identifier. Resource name of this policy tag in the URL format.
11233 ///
11234 /// The policy tag manager generates unique taxonomy IDs and policy tag IDs.
11235 pub name: std::string::String,
11236
11237 /// Required. User-defined name of this policy tag.
11238 ///
11239 /// The name can't start or end with spaces and must be unique within the
11240 /// parent taxonomy, contain only Unicode letters, numbers, underscores, dashes
11241 /// and spaces, and be at most 200 bytes long when encoded in UTF-8.
11242 pub display_name: std::string::String,
11243
11244 /// Description of this policy tag. If not set, defaults to empty.
11245 ///
11246 /// The description must contain only Unicode characters,
11247 /// tabs, newlines, carriage returns and page breaks, and be at most 2000 bytes
11248 /// long when encoded in UTF-8.
11249 pub description: std::string::String,
11250
11251 /// Resource name of this policy tag's parent policy tag. If empty, this is a
11252 /// top level tag. If not set, defaults to an empty string.
11253 ///
11254 /// For example, for the "LatLong" policy tag in the example above, this field
11255 /// contains the resource name of the "Geolocation" policy tag, and, for
11256 /// "Geolocation", this field is empty.
11257 pub parent_policy_tag: std::string::String,
11258
11259 /// Output only. Resource names of child policy tags of this policy tag.
11260 pub child_policy_tags: std::vec::Vec<std::string::String>,
11261
11262 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11263}
11264
11265impl PolicyTag {
11266 pub fn new() -> Self {
11267 std::default::Default::default()
11268 }
11269
11270 /// Sets the value of [name][crate::model::PolicyTag::name].
11271 ///
11272 /// # Example
11273 /// ```ignore,no_run
11274 /// # use google_cloud_datacatalog_v1::model::PolicyTag;
11275 /// let x = PolicyTag::new().set_name("example");
11276 /// ```
11277 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11278 self.name = v.into();
11279 self
11280 }
11281
11282 /// Sets the value of [display_name][crate::model::PolicyTag::display_name].
11283 ///
11284 /// # Example
11285 /// ```ignore,no_run
11286 /// # use google_cloud_datacatalog_v1::model::PolicyTag;
11287 /// let x = PolicyTag::new().set_display_name("example");
11288 /// ```
11289 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11290 self.display_name = v.into();
11291 self
11292 }
11293
11294 /// Sets the value of [description][crate::model::PolicyTag::description].
11295 ///
11296 /// # Example
11297 /// ```ignore,no_run
11298 /// # use google_cloud_datacatalog_v1::model::PolicyTag;
11299 /// let x = PolicyTag::new().set_description("example");
11300 /// ```
11301 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11302 self.description = v.into();
11303 self
11304 }
11305
11306 /// Sets the value of [parent_policy_tag][crate::model::PolicyTag::parent_policy_tag].
11307 ///
11308 /// # Example
11309 /// ```ignore,no_run
11310 /// # use google_cloud_datacatalog_v1::model::PolicyTag;
11311 /// let x = PolicyTag::new().set_parent_policy_tag("example");
11312 /// ```
11313 pub fn set_parent_policy_tag<T: std::convert::Into<std::string::String>>(
11314 mut self,
11315 v: T,
11316 ) -> Self {
11317 self.parent_policy_tag = v.into();
11318 self
11319 }
11320
11321 /// Sets the value of [child_policy_tags][crate::model::PolicyTag::child_policy_tags].
11322 ///
11323 /// # Example
11324 /// ```ignore,no_run
11325 /// # use google_cloud_datacatalog_v1::model::PolicyTag;
11326 /// let x = PolicyTag::new().set_child_policy_tags(["a", "b", "c"]);
11327 /// ```
11328 pub fn set_child_policy_tags<T, V>(mut self, v: T) -> Self
11329 where
11330 T: std::iter::IntoIterator<Item = V>,
11331 V: std::convert::Into<std::string::String>,
11332 {
11333 use std::iter::Iterator;
11334 self.child_policy_tags = v.into_iter().map(|i| i.into()).collect();
11335 self
11336 }
11337}
11338
11339impl wkt::message::Message for PolicyTag {
11340 fn typename() -> &'static str {
11341 "type.googleapis.com/google.cloud.datacatalog.v1.PolicyTag"
11342 }
11343}
11344
11345/// Request message for
11346/// [CreateTaxonomy][google.cloud.datacatalog.v1.PolicyTagManager.CreateTaxonomy].
11347///
11348/// [google.cloud.datacatalog.v1.PolicyTagManager.CreateTaxonomy]: crate::client::PolicyTagManager::create_taxonomy
11349#[derive(Clone, Default, PartialEq)]
11350#[non_exhaustive]
11351pub struct CreateTaxonomyRequest {
11352 /// Required. Resource name of the project that the taxonomy will belong to.
11353 pub parent: std::string::String,
11354
11355 /// The taxonomy to create.
11356 pub taxonomy: std::option::Option<crate::model::Taxonomy>,
11357
11358 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11359}
11360
11361impl CreateTaxonomyRequest {
11362 pub fn new() -> Self {
11363 std::default::Default::default()
11364 }
11365
11366 /// Sets the value of [parent][crate::model::CreateTaxonomyRequest::parent].
11367 ///
11368 /// # Example
11369 /// ```ignore,no_run
11370 /// # use google_cloud_datacatalog_v1::model::CreateTaxonomyRequest;
11371 /// let x = CreateTaxonomyRequest::new().set_parent("example");
11372 /// ```
11373 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11374 self.parent = v.into();
11375 self
11376 }
11377
11378 /// Sets the value of [taxonomy][crate::model::CreateTaxonomyRequest::taxonomy].
11379 ///
11380 /// # Example
11381 /// ```ignore,no_run
11382 /// # use google_cloud_datacatalog_v1::model::CreateTaxonomyRequest;
11383 /// use google_cloud_datacatalog_v1::model::Taxonomy;
11384 /// let x = CreateTaxonomyRequest::new().set_taxonomy(Taxonomy::default()/* use setters */);
11385 /// ```
11386 pub fn set_taxonomy<T>(mut self, v: T) -> Self
11387 where
11388 T: std::convert::Into<crate::model::Taxonomy>,
11389 {
11390 self.taxonomy = std::option::Option::Some(v.into());
11391 self
11392 }
11393
11394 /// Sets or clears the value of [taxonomy][crate::model::CreateTaxonomyRequest::taxonomy].
11395 ///
11396 /// # Example
11397 /// ```ignore,no_run
11398 /// # use google_cloud_datacatalog_v1::model::CreateTaxonomyRequest;
11399 /// use google_cloud_datacatalog_v1::model::Taxonomy;
11400 /// let x = CreateTaxonomyRequest::new().set_or_clear_taxonomy(Some(Taxonomy::default()/* use setters */));
11401 /// let x = CreateTaxonomyRequest::new().set_or_clear_taxonomy(None::<Taxonomy>);
11402 /// ```
11403 pub fn set_or_clear_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
11404 where
11405 T: std::convert::Into<crate::model::Taxonomy>,
11406 {
11407 self.taxonomy = v.map(|x| x.into());
11408 self
11409 }
11410}
11411
11412impl wkt::message::Message for CreateTaxonomyRequest {
11413 fn typename() -> &'static str {
11414 "type.googleapis.com/google.cloud.datacatalog.v1.CreateTaxonomyRequest"
11415 }
11416}
11417
11418/// Request message for
11419/// [DeleteTaxonomy][google.cloud.datacatalog.v1.PolicyTagManager.DeleteTaxonomy].
11420///
11421/// [google.cloud.datacatalog.v1.PolicyTagManager.DeleteTaxonomy]: crate::client::PolicyTagManager::delete_taxonomy
11422#[derive(Clone, Default, PartialEq)]
11423#[non_exhaustive]
11424pub struct DeleteTaxonomyRequest {
11425 /// Required. Resource name of the taxonomy to delete.
11426 ///
11427 /// Note: All policy tags in this taxonomy are also deleted.
11428 pub name: std::string::String,
11429
11430 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11431}
11432
11433impl DeleteTaxonomyRequest {
11434 pub fn new() -> Self {
11435 std::default::Default::default()
11436 }
11437
11438 /// Sets the value of [name][crate::model::DeleteTaxonomyRequest::name].
11439 ///
11440 /// # Example
11441 /// ```ignore,no_run
11442 /// # use google_cloud_datacatalog_v1::model::DeleteTaxonomyRequest;
11443 /// let x = DeleteTaxonomyRequest::new().set_name("example");
11444 /// ```
11445 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11446 self.name = v.into();
11447 self
11448 }
11449}
11450
11451impl wkt::message::Message for DeleteTaxonomyRequest {
11452 fn typename() -> &'static str {
11453 "type.googleapis.com/google.cloud.datacatalog.v1.DeleteTaxonomyRequest"
11454 }
11455}
11456
11457/// Request message for
11458/// [UpdateTaxonomy][google.cloud.datacatalog.v1.PolicyTagManager.UpdateTaxonomy].
11459///
11460/// [google.cloud.datacatalog.v1.PolicyTagManager.UpdateTaxonomy]: crate::client::PolicyTagManager::update_taxonomy
11461#[derive(Clone, Default, PartialEq)]
11462#[non_exhaustive]
11463pub struct UpdateTaxonomyRequest {
11464 /// The taxonomy to update. You can update only its description, display name,
11465 /// and activated policy types.
11466 pub taxonomy: std::option::Option<crate::model::Taxonomy>,
11467
11468 /// Specifies fields to update. If not set, defaults to all fields you can
11469 /// update.
11470 ///
11471 /// For more information, see [FieldMask]
11472 /// (<https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask>).
11473 pub update_mask: std::option::Option<wkt::FieldMask>,
11474
11475 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11476}
11477
11478impl UpdateTaxonomyRequest {
11479 pub fn new() -> Self {
11480 std::default::Default::default()
11481 }
11482
11483 /// Sets the value of [taxonomy][crate::model::UpdateTaxonomyRequest::taxonomy].
11484 ///
11485 /// # Example
11486 /// ```ignore,no_run
11487 /// # use google_cloud_datacatalog_v1::model::UpdateTaxonomyRequest;
11488 /// use google_cloud_datacatalog_v1::model::Taxonomy;
11489 /// let x = UpdateTaxonomyRequest::new().set_taxonomy(Taxonomy::default()/* use setters */);
11490 /// ```
11491 pub fn set_taxonomy<T>(mut self, v: T) -> Self
11492 where
11493 T: std::convert::Into<crate::model::Taxonomy>,
11494 {
11495 self.taxonomy = std::option::Option::Some(v.into());
11496 self
11497 }
11498
11499 /// Sets or clears the value of [taxonomy][crate::model::UpdateTaxonomyRequest::taxonomy].
11500 ///
11501 /// # Example
11502 /// ```ignore,no_run
11503 /// # use google_cloud_datacatalog_v1::model::UpdateTaxonomyRequest;
11504 /// use google_cloud_datacatalog_v1::model::Taxonomy;
11505 /// let x = UpdateTaxonomyRequest::new().set_or_clear_taxonomy(Some(Taxonomy::default()/* use setters */));
11506 /// let x = UpdateTaxonomyRequest::new().set_or_clear_taxonomy(None::<Taxonomy>);
11507 /// ```
11508 pub fn set_or_clear_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
11509 where
11510 T: std::convert::Into<crate::model::Taxonomy>,
11511 {
11512 self.taxonomy = v.map(|x| x.into());
11513 self
11514 }
11515
11516 /// Sets the value of [update_mask][crate::model::UpdateTaxonomyRequest::update_mask].
11517 ///
11518 /// # Example
11519 /// ```ignore,no_run
11520 /// # use google_cloud_datacatalog_v1::model::UpdateTaxonomyRequest;
11521 /// use wkt::FieldMask;
11522 /// let x = UpdateTaxonomyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11523 /// ```
11524 pub fn set_update_mask<T>(mut self, v: T) -> Self
11525 where
11526 T: std::convert::Into<wkt::FieldMask>,
11527 {
11528 self.update_mask = std::option::Option::Some(v.into());
11529 self
11530 }
11531
11532 /// Sets or clears the value of [update_mask][crate::model::UpdateTaxonomyRequest::update_mask].
11533 ///
11534 /// # Example
11535 /// ```ignore,no_run
11536 /// # use google_cloud_datacatalog_v1::model::UpdateTaxonomyRequest;
11537 /// use wkt::FieldMask;
11538 /// let x = UpdateTaxonomyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11539 /// let x = UpdateTaxonomyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11540 /// ```
11541 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11542 where
11543 T: std::convert::Into<wkt::FieldMask>,
11544 {
11545 self.update_mask = v.map(|x| x.into());
11546 self
11547 }
11548}
11549
11550impl wkt::message::Message for UpdateTaxonomyRequest {
11551 fn typename() -> &'static str {
11552 "type.googleapis.com/google.cloud.datacatalog.v1.UpdateTaxonomyRequest"
11553 }
11554}
11555
11556/// Request message for
11557/// [ListTaxonomies][google.cloud.datacatalog.v1.PolicyTagManager.ListTaxonomies].
11558///
11559/// [google.cloud.datacatalog.v1.PolicyTagManager.ListTaxonomies]: crate::client::PolicyTagManager::list_taxonomies
11560#[derive(Clone, Default, PartialEq)]
11561#[non_exhaustive]
11562pub struct ListTaxonomiesRequest {
11563 /// Required. Resource name of the project to list the taxonomies of.
11564 pub parent: std::string::String,
11565
11566 /// The maximum number of items to return. Must be a value between 1 and 1000
11567 /// inclusively. If not set, defaults to 50.
11568 pub page_size: i32,
11569
11570 /// The pagination token of the next results page. If not set,
11571 /// the first page is returned.
11572 ///
11573 /// The token is returned in the response to a previous list request.
11574 pub page_token: std::string::String,
11575
11576 /// Supported field for filter is 'service' and value is 'dataplex'.
11577 /// Eg: service=dataplex.
11578 pub filter: std::string::String,
11579
11580 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11581}
11582
11583impl ListTaxonomiesRequest {
11584 pub fn new() -> Self {
11585 std::default::Default::default()
11586 }
11587
11588 /// Sets the value of [parent][crate::model::ListTaxonomiesRequest::parent].
11589 ///
11590 /// # Example
11591 /// ```ignore,no_run
11592 /// # use google_cloud_datacatalog_v1::model::ListTaxonomiesRequest;
11593 /// let x = ListTaxonomiesRequest::new().set_parent("example");
11594 /// ```
11595 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11596 self.parent = v.into();
11597 self
11598 }
11599
11600 /// Sets the value of [page_size][crate::model::ListTaxonomiesRequest::page_size].
11601 ///
11602 /// # Example
11603 /// ```ignore,no_run
11604 /// # use google_cloud_datacatalog_v1::model::ListTaxonomiesRequest;
11605 /// let x = ListTaxonomiesRequest::new().set_page_size(42);
11606 /// ```
11607 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11608 self.page_size = v.into();
11609 self
11610 }
11611
11612 /// Sets the value of [page_token][crate::model::ListTaxonomiesRequest::page_token].
11613 ///
11614 /// # Example
11615 /// ```ignore,no_run
11616 /// # use google_cloud_datacatalog_v1::model::ListTaxonomiesRequest;
11617 /// let x = ListTaxonomiesRequest::new().set_page_token("example");
11618 /// ```
11619 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11620 self.page_token = v.into();
11621 self
11622 }
11623
11624 /// Sets the value of [filter][crate::model::ListTaxonomiesRequest::filter].
11625 ///
11626 /// # Example
11627 /// ```ignore,no_run
11628 /// # use google_cloud_datacatalog_v1::model::ListTaxonomiesRequest;
11629 /// let x = ListTaxonomiesRequest::new().set_filter("example");
11630 /// ```
11631 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11632 self.filter = v.into();
11633 self
11634 }
11635}
11636
11637impl wkt::message::Message for ListTaxonomiesRequest {
11638 fn typename() -> &'static str {
11639 "type.googleapis.com/google.cloud.datacatalog.v1.ListTaxonomiesRequest"
11640 }
11641}
11642
11643/// Response message for
11644/// [ListTaxonomies][google.cloud.datacatalog.v1.PolicyTagManager.ListTaxonomies].
11645///
11646/// [google.cloud.datacatalog.v1.PolicyTagManager.ListTaxonomies]: crate::client::PolicyTagManager::list_taxonomies
11647#[derive(Clone, Default, PartialEq)]
11648#[non_exhaustive]
11649pub struct ListTaxonomiesResponse {
11650 /// Taxonomies that the project contains.
11651 pub taxonomies: std::vec::Vec<crate::model::Taxonomy>,
11652
11653 /// Pagination token of the next results page. Empty if there are no
11654 /// more results in the list.
11655 pub next_page_token: std::string::String,
11656
11657 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11658}
11659
11660impl ListTaxonomiesResponse {
11661 pub fn new() -> Self {
11662 std::default::Default::default()
11663 }
11664
11665 /// Sets the value of [taxonomies][crate::model::ListTaxonomiesResponse::taxonomies].
11666 ///
11667 /// # Example
11668 /// ```ignore,no_run
11669 /// # use google_cloud_datacatalog_v1::model::ListTaxonomiesResponse;
11670 /// use google_cloud_datacatalog_v1::model::Taxonomy;
11671 /// let x = ListTaxonomiesResponse::new()
11672 /// .set_taxonomies([
11673 /// Taxonomy::default()/* use setters */,
11674 /// Taxonomy::default()/* use (different) setters */,
11675 /// ]);
11676 /// ```
11677 pub fn set_taxonomies<T, V>(mut self, v: T) -> Self
11678 where
11679 T: std::iter::IntoIterator<Item = V>,
11680 V: std::convert::Into<crate::model::Taxonomy>,
11681 {
11682 use std::iter::Iterator;
11683 self.taxonomies = v.into_iter().map(|i| i.into()).collect();
11684 self
11685 }
11686
11687 /// Sets the value of [next_page_token][crate::model::ListTaxonomiesResponse::next_page_token].
11688 ///
11689 /// # Example
11690 /// ```ignore,no_run
11691 /// # use google_cloud_datacatalog_v1::model::ListTaxonomiesResponse;
11692 /// let x = ListTaxonomiesResponse::new().set_next_page_token("example");
11693 /// ```
11694 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11695 self.next_page_token = v.into();
11696 self
11697 }
11698}
11699
11700impl wkt::message::Message for ListTaxonomiesResponse {
11701 fn typename() -> &'static str {
11702 "type.googleapis.com/google.cloud.datacatalog.v1.ListTaxonomiesResponse"
11703 }
11704}
11705
11706#[doc(hidden)]
11707impl google_cloud_gax::paginator::internal::PageableResponse for ListTaxonomiesResponse {
11708 type PageItem = crate::model::Taxonomy;
11709
11710 fn items(self) -> std::vec::Vec<Self::PageItem> {
11711 self.taxonomies
11712 }
11713
11714 fn next_page_token(&self) -> std::string::String {
11715 use std::clone::Clone;
11716 self.next_page_token.clone()
11717 }
11718}
11719
11720/// Request message for
11721/// [GetTaxonomy][google.cloud.datacatalog.v1.PolicyTagManager.GetTaxonomy].
11722///
11723/// [google.cloud.datacatalog.v1.PolicyTagManager.GetTaxonomy]: crate::client::PolicyTagManager::get_taxonomy
11724#[derive(Clone, Default, PartialEq)]
11725#[non_exhaustive]
11726pub struct GetTaxonomyRequest {
11727 /// Required. Resource name of the taxonomy to get.
11728 pub name: std::string::String,
11729
11730 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11731}
11732
11733impl GetTaxonomyRequest {
11734 pub fn new() -> Self {
11735 std::default::Default::default()
11736 }
11737
11738 /// Sets the value of [name][crate::model::GetTaxonomyRequest::name].
11739 ///
11740 /// # Example
11741 /// ```ignore,no_run
11742 /// # use google_cloud_datacatalog_v1::model::GetTaxonomyRequest;
11743 /// let x = GetTaxonomyRequest::new().set_name("example");
11744 /// ```
11745 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11746 self.name = v.into();
11747 self
11748 }
11749}
11750
11751impl wkt::message::Message for GetTaxonomyRequest {
11752 fn typename() -> &'static str {
11753 "type.googleapis.com/google.cloud.datacatalog.v1.GetTaxonomyRequest"
11754 }
11755}
11756
11757/// Request message for
11758/// [CreatePolicyTag][google.cloud.datacatalog.v1.PolicyTagManager.CreatePolicyTag].
11759///
11760/// [google.cloud.datacatalog.v1.PolicyTagManager.CreatePolicyTag]: crate::client::PolicyTagManager::create_policy_tag
11761#[derive(Clone, Default, PartialEq)]
11762#[non_exhaustive]
11763pub struct CreatePolicyTagRequest {
11764 /// Required. Resource name of the taxonomy that the policy tag will belong to.
11765 pub parent: std::string::String,
11766
11767 /// The policy tag to create.
11768 pub policy_tag: std::option::Option<crate::model::PolicyTag>,
11769
11770 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11771}
11772
11773impl CreatePolicyTagRequest {
11774 pub fn new() -> Self {
11775 std::default::Default::default()
11776 }
11777
11778 /// Sets the value of [parent][crate::model::CreatePolicyTagRequest::parent].
11779 ///
11780 /// # Example
11781 /// ```ignore,no_run
11782 /// # use google_cloud_datacatalog_v1::model::CreatePolicyTagRequest;
11783 /// let x = CreatePolicyTagRequest::new().set_parent("example");
11784 /// ```
11785 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11786 self.parent = v.into();
11787 self
11788 }
11789
11790 /// Sets the value of [policy_tag][crate::model::CreatePolicyTagRequest::policy_tag].
11791 ///
11792 /// # Example
11793 /// ```ignore,no_run
11794 /// # use google_cloud_datacatalog_v1::model::CreatePolicyTagRequest;
11795 /// use google_cloud_datacatalog_v1::model::PolicyTag;
11796 /// let x = CreatePolicyTagRequest::new().set_policy_tag(PolicyTag::default()/* use setters */);
11797 /// ```
11798 pub fn set_policy_tag<T>(mut self, v: T) -> Self
11799 where
11800 T: std::convert::Into<crate::model::PolicyTag>,
11801 {
11802 self.policy_tag = std::option::Option::Some(v.into());
11803 self
11804 }
11805
11806 /// Sets or clears the value of [policy_tag][crate::model::CreatePolicyTagRequest::policy_tag].
11807 ///
11808 /// # Example
11809 /// ```ignore,no_run
11810 /// # use google_cloud_datacatalog_v1::model::CreatePolicyTagRequest;
11811 /// use google_cloud_datacatalog_v1::model::PolicyTag;
11812 /// let x = CreatePolicyTagRequest::new().set_or_clear_policy_tag(Some(PolicyTag::default()/* use setters */));
11813 /// let x = CreatePolicyTagRequest::new().set_or_clear_policy_tag(None::<PolicyTag>);
11814 /// ```
11815 pub fn set_or_clear_policy_tag<T>(mut self, v: std::option::Option<T>) -> Self
11816 where
11817 T: std::convert::Into<crate::model::PolicyTag>,
11818 {
11819 self.policy_tag = v.map(|x| x.into());
11820 self
11821 }
11822}
11823
11824impl wkt::message::Message for CreatePolicyTagRequest {
11825 fn typename() -> &'static str {
11826 "type.googleapis.com/google.cloud.datacatalog.v1.CreatePolicyTagRequest"
11827 }
11828}
11829
11830/// Request message for
11831/// [DeletePolicyTag][google.cloud.datacatalog.v1.PolicyTagManager.DeletePolicyTag].
11832///
11833/// [google.cloud.datacatalog.v1.PolicyTagManager.DeletePolicyTag]: crate::client::PolicyTagManager::delete_policy_tag
11834#[derive(Clone, Default, PartialEq)]
11835#[non_exhaustive]
11836pub struct DeletePolicyTagRequest {
11837 /// Required. Resource name of the policy tag to delete.
11838 ///
11839 /// Note: All of its descendant policy tags are also deleted.
11840 pub name: std::string::String,
11841
11842 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11843}
11844
11845impl DeletePolicyTagRequest {
11846 pub fn new() -> Self {
11847 std::default::Default::default()
11848 }
11849
11850 /// Sets the value of [name][crate::model::DeletePolicyTagRequest::name].
11851 ///
11852 /// # Example
11853 /// ```ignore,no_run
11854 /// # use google_cloud_datacatalog_v1::model::DeletePolicyTagRequest;
11855 /// let x = DeletePolicyTagRequest::new().set_name("example");
11856 /// ```
11857 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11858 self.name = v.into();
11859 self
11860 }
11861}
11862
11863impl wkt::message::Message for DeletePolicyTagRequest {
11864 fn typename() -> &'static str {
11865 "type.googleapis.com/google.cloud.datacatalog.v1.DeletePolicyTagRequest"
11866 }
11867}
11868
11869/// Request message for
11870/// [UpdatePolicyTag][google.cloud.datacatalog.v1.PolicyTagManager.UpdatePolicyTag].
11871///
11872/// [google.cloud.datacatalog.v1.PolicyTagManager.UpdatePolicyTag]: crate::client::PolicyTagManager::update_policy_tag
11873#[derive(Clone, Default, PartialEq)]
11874#[non_exhaustive]
11875pub struct UpdatePolicyTagRequest {
11876 /// The policy tag to update. You can update only its description, display
11877 /// name, and parent policy tag fields.
11878 pub policy_tag: std::option::Option<crate::model::PolicyTag>,
11879
11880 /// Specifies the fields to update.
11881 ///
11882 /// You can update only display name, description, and parent policy tag.
11883 /// If not set, defaults to all updatable fields.
11884 /// For more information, see [FieldMask]
11885 /// (<https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask>).
11886 pub update_mask: std::option::Option<wkt::FieldMask>,
11887
11888 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11889}
11890
11891impl UpdatePolicyTagRequest {
11892 pub fn new() -> Self {
11893 std::default::Default::default()
11894 }
11895
11896 /// Sets the value of [policy_tag][crate::model::UpdatePolicyTagRequest::policy_tag].
11897 ///
11898 /// # Example
11899 /// ```ignore,no_run
11900 /// # use google_cloud_datacatalog_v1::model::UpdatePolicyTagRequest;
11901 /// use google_cloud_datacatalog_v1::model::PolicyTag;
11902 /// let x = UpdatePolicyTagRequest::new().set_policy_tag(PolicyTag::default()/* use setters */);
11903 /// ```
11904 pub fn set_policy_tag<T>(mut self, v: T) -> Self
11905 where
11906 T: std::convert::Into<crate::model::PolicyTag>,
11907 {
11908 self.policy_tag = std::option::Option::Some(v.into());
11909 self
11910 }
11911
11912 /// Sets or clears the value of [policy_tag][crate::model::UpdatePolicyTagRequest::policy_tag].
11913 ///
11914 /// # Example
11915 /// ```ignore,no_run
11916 /// # use google_cloud_datacatalog_v1::model::UpdatePolicyTagRequest;
11917 /// use google_cloud_datacatalog_v1::model::PolicyTag;
11918 /// let x = UpdatePolicyTagRequest::new().set_or_clear_policy_tag(Some(PolicyTag::default()/* use setters */));
11919 /// let x = UpdatePolicyTagRequest::new().set_or_clear_policy_tag(None::<PolicyTag>);
11920 /// ```
11921 pub fn set_or_clear_policy_tag<T>(mut self, v: std::option::Option<T>) -> Self
11922 where
11923 T: std::convert::Into<crate::model::PolicyTag>,
11924 {
11925 self.policy_tag = v.map(|x| x.into());
11926 self
11927 }
11928
11929 /// Sets the value of [update_mask][crate::model::UpdatePolicyTagRequest::update_mask].
11930 ///
11931 /// # Example
11932 /// ```ignore,no_run
11933 /// # use google_cloud_datacatalog_v1::model::UpdatePolicyTagRequest;
11934 /// use wkt::FieldMask;
11935 /// let x = UpdatePolicyTagRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11936 /// ```
11937 pub fn set_update_mask<T>(mut self, v: T) -> Self
11938 where
11939 T: std::convert::Into<wkt::FieldMask>,
11940 {
11941 self.update_mask = std::option::Option::Some(v.into());
11942 self
11943 }
11944
11945 /// Sets or clears the value of [update_mask][crate::model::UpdatePolicyTagRequest::update_mask].
11946 ///
11947 /// # Example
11948 /// ```ignore,no_run
11949 /// # use google_cloud_datacatalog_v1::model::UpdatePolicyTagRequest;
11950 /// use wkt::FieldMask;
11951 /// let x = UpdatePolicyTagRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11952 /// let x = UpdatePolicyTagRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11953 /// ```
11954 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11955 where
11956 T: std::convert::Into<wkt::FieldMask>,
11957 {
11958 self.update_mask = v.map(|x| x.into());
11959 self
11960 }
11961}
11962
11963impl wkt::message::Message for UpdatePolicyTagRequest {
11964 fn typename() -> &'static str {
11965 "type.googleapis.com/google.cloud.datacatalog.v1.UpdatePolicyTagRequest"
11966 }
11967}
11968
11969/// Request message for
11970/// [ListPolicyTags][google.cloud.datacatalog.v1.PolicyTagManager.ListPolicyTags].
11971///
11972/// [google.cloud.datacatalog.v1.PolicyTagManager.ListPolicyTags]: crate::client::PolicyTagManager::list_policy_tags
11973#[derive(Clone, Default, PartialEq)]
11974#[non_exhaustive]
11975pub struct ListPolicyTagsRequest {
11976 /// Required. Resource name of the taxonomy to list the policy tags of.
11977 pub parent: std::string::String,
11978
11979 /// The maximum number of items to return. Must be a value between 1 and 1000
11980 /// inclusively.
11981 /// If not set, defaults to 50.
11982 pub page_size: i32,
11983
11984 /// The pagination token of the next results page. If not set, returns the
11985 /// first page.
11986 ///
11987 /// The token is returned in the response to a previous list request.
11988 pub page_token: std::string::String,
11989
11990 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11991}
11992
11993impl ListPolicyTagsRequest {
11994 pub fn new() -> Self {
11995 std::default::Default::default()
11996 }
11997
11998 /// Sets the value of [parent][crate::model::ListPolicyTagsRequest::parent].
11999 ///
12000 /// # Example
12001 /// ```ignore,no_run
12002 /// # use google_cloud_datacatalog_v1::model::ListPolicyTagsRequest;
12003 /// let x = ListPolicyTagsRequest::new().set_parent("example");
12004 /// ```
12005 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12006 self.parent = v.into();
12007 self
12008 }
12009
12010 /// Sets the value of [page_size][crate::model::ListPolicyTagsRequest::page_size].
12011 ///
12012 /// # Example
12013 /// ```ignore,no_run
12014 /// # use google_cloud_datacatalog_v1::model::ListPolicyTagsRequest;
12015 /// let x = ListPolicyTagsRequest::new().set_page_size(42);
12016 /// ```
12017 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12018 self.page_size = v.into();
12019 self
12020 }
12021
12022 /// Sets the value of [page_token][crate::model::ListPolicyTagsRequest::page_token].
12023 ///
12024 /// # Example
12025 /// ```ignore,no_run
12026 /// # use google_cloud_datacatalog_v1::model::ListPolicyTagsRequest;
12027 /// let x = ListPolicyTagsRequest::new().set_page_token("example");
12028 /// ```
12029 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12030 self.page_token = v.into();
12031 self
12032 }
12033}
12034
12035impl wkt::message::Message for ListPolicyTagsRequest {
12036 fn typename() -> &'static str {
12037 "type.googleapis.com/google.cloud.datacatalog.v1.ListPolicyTagsRequest"
12038 }
12039}
12040
12041/// Response message for
12042/// [ListPolicyTags][google.cloud.datacatalog.v1.PolicyTagManager.ListPolicyTags].
12043///
12044/// [google.cloud.datacatalog.v1.PolicyTagManager.ListPolicyTags]: crate::client::PolicyTagManager::list_policy_tags
12045#[derive(Clone, Default, PartialEq)]
12046#[non_exhaustive]
12047pub struct ListPolicyTagsResponse {
12048 /// The policy tags that belong to the taxonomy.
12049 pub policy_tags: std::vec::Vec<crate::model::PolicyTag>,
12050
12051 /// Pagination token of the next results page. Empty if there are no
12052 /// more results in the list.
12053 pub next_page_token: std::string::String,
12054
12055 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12056}
12057
12058impl ListPolicyTagsResponse {
12059 pub fn new() -> Self {
12060 std::default::Default::default()
12061 }
12062
12063 /// Sets the value of [policy_tags][crate::model::ListPolicyTagsResponse::policy_tags].
12064 ///
12065 /// # Example
12066 /// ```ignore,no_run
12067 /// # use google_cloud_datacatalog_v1::model::ListPolicyTagsResponse;
12068 /// use google_cloud_datacatalog_v1::model::PolicyTag;
12069 /// let x = ListPolicyTagsResponse::new()
12070 /// .set_policy_tags([
12071 /// PolicyTag::default()/* use setters */,
12072 /// PolicyTag::default()/* use (different) setters */,
12073 /// ]);
12074 /// ```
12075 pub fn set_policy_tags<T, V>(mut self, v: T) -> Self
12076 where
12077 T: std::iter::IntoIterator<Item = V>,
12078 V: std::convert::Into<crate::model::PolicyTag>,
12079 {
12080 use std::iter::Iterator;
12081 self.policy_tags = v.into_iter().map(|i| i.into()).collect();
12082 self
12083 }
12084
12085 /// Sets the value of [next_page_token][crate::model::ListPolicyTagsResponse::next_page_token].
12086 ///
12087 /// # Example
12088 /// ```ignore,no_run
12089 /// # use google_cloud_datacatalog_v1::model::ListPolicyTagsResponse;
12090 /// let x = ListPolicyTagsResponse::new().set_next_page_token("example");
12091 /// ```
12092 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12093 self.next_page_token = v.into();
12094 self
12095 }
12096}
12097
12098impl wkt::message::Message for ListPolicyTagsResponse {
12099 fn typename() -> &'static str {
12100 "type.googleapis.com/google.cloud.datacatalog.v1.ListPolicyTagsResponse"
12101 }
12102}
12103
12104#[doc(hidden)]
12105impl google_cloud_gax::paginator::internal::PageableResponse for ListPolicyTagsResponse {
12106 type PageItem = crate::model::PolicyTag;
12107
12108 fn items(self) -> std::vec::Vec<Self::PageItem> {
12109 self.policy_tags
12110 }
12111
12112 fn next_page_token(&self) -> std::string::String {
12113 use std::clone::Clone;
12114 self.next_page_token.clone()
12115 }
12116}
12117
12118/// Request message for
12119/// [GetPolicyTag][google.cloud.datacatalog.v1.PolicyTagManager.GetPolicyTag].
12120///
12121/// [google.cloud.datacatalog.v1.PolicyTagManager.GetPolicyTag]: crate::client::PolicyTagManager::get_policy_tag
12122#[derive(Clone, Default, PartialEq)]
12123#[non_exhaustive]
12124pub struct GetPolicyTagRequest {
12125 /// Required. Resource name of the policy tag.
12126 pub name: std::string::String,
12127
12128 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12129}
12130
12131impl GetPolicyTagRequest {
12132 pub fn new() -> Self {
12133 std::default::Default::default()
12134 }
12135
12136 /// Sets the value of [name][crate::model::GetPolicyTagRequest::name].
12137 ///
12138 /// # Example
12139 /// ```ignore,no_run
12140 /// # use google_cloud_datacatalog_v1::model::GetPolicyTagRequest;
12141 /// let x = GetPolicyTagRequest::new().set_name("example");
12142 /// ```
12143 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12144 self.name = v.into();
12145 self
12146 }
12147}
12148
12149impl wkt::message::Message for GetPolicyTagRequest {
12150 fn typename() -> &'static str {
12151 "type.googleapis.com/google.cloud.datacatalog.v1.GetPolicyTagRequest"
12152 }
12153}
12154
12155/// A nested protocol buffer that represents a taxonomy and the hierarchy of its
12156/// policy tags. Used for taxonomy replacement, import, and
12157/// export.
12158#[derive(Clone, Default, PartialEq)]
12159#[non_exhaustive]
12160pub struct SerializedTaxonomy {
12161 /// Required. Display name of the taxonomy. At most 200 bytes when encoded in
12162 /// UTF-8.
12163 pub display_name: std::string::String,
12164
12165 /// Description of the serialized taxonomy. At most 2000 bytes when
12166 /// encoded in UTF-8. If not set, defaults to an empty description.
12167 pub description: std::string::String,
12168
12169 /// Top level policy tags associated with the taxonomy, if any.
12170 pub policy_tags: std::vec::Vec<crate::model::SerializedPolicyTag>,
12171
12172 /// A list of policy types that are activated per taxonomy.
12173 pub activated_policy_types: std::vec::Vec<crate::model::taxonomy::PolicyType>,
12174
12175 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12176}
12177
12178impl SerializedTaxonomy {
12179 pub fn new() -> Self {
12180 std::default::Default::default()
12181 }
12182
12183 /// Sets the value of [display_name][crate::model::SerializedTaxonomy::display_name].
12184 ///
12185 /// # Example
12186 /// ```ignore,no_run
12187 /// # use google_cloud_datacatalog_v1::model::SerializedTaxonomy;
12188 /// let x = SerializedTaxonomy::new().set_display_name("example");
12189 /// ```
12190 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12191 self.display_name = v.into();
12192 self
12193 }
12194
12195 /// Sets the value of [description][crate::model::SerializedTaxonomy::description].
12196 ///
12197 /// # Example
12198 /// ```ignore,no_run
12199 /// # use google_cloud_datacatalog_v1::model::SerializedTaxonomy;
12200 /// let x = SerializedTaxonomy::new().set_description("example");
12201 /// ```
12202 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12203 self.description = v.into();
12204 self
12205 }
12206
12207 /// Sets the value of [policy_tags][crate::model::SerializedTaxonomy::policy_tags].
12208 ///
12209 /// # Example
12210 /// ```ignore,no_run
12211 /// # use google_cloud_datacatalog_v1::model::SerializedTaxonomy;
12212 /// use google_cloud_datacatalog_v1::model::SerializedPolicyTag;
12213 /// let x = SerializedTaxonomy::new()
12214 /// .set_policy_tags([
12215 /// SerializedPolicyTag::default()/* use setters */,
12216 /// SerializedPolicyTag::default()/* use (different) setters */,
12217 /// ]);
12218 /// ```
12219 pub fn set_policy_tags<T, V>(mut self, v: T) -> Self
12220 where
12221 T: std::iter::IntoIterator<Item = V>,
12222 V: std::convert::Into<crate::model::SerializedPolicyTag>,
12223 {
12224 use std::iter::Iterator;
12225 self.policy_tags = v.into_iter().map(|i| i.into()).collect();
12226 self
12227 }
12228
12229 /// Sets the value of [activated_policy_types][crate::model::SerializedTaxonomy::activated_policy_types].
12230 ///
12231 /// # Example
12232 /// ```ignore,no_run
12233 /// # use google_cloud_datacatalog_v1::model::SerializedTaxonomy;
12234 /// use google_cloud_datacatalog_v1::model::taxonomy::PolicyType;
12235 /// let x = SerializedTaxonomy::new().set_activated_policy_types([
12236 /// PolicyType::FineGrainedAccessControl,
12237 /// ]);
12238 /// ```
12239 pub fn set_activated_policy_types<T, V>(mut self, v: T) -> Self
12240 where
12241 T: std::iter::IntoIterator<Item = V>,
12242 V: std::convert::Into<crate::model::taxonomy::PolicyType>,
12243 {
12244 use std::iter::Iterator;
12245 self.activated_policy_types = v.into_iter().map(|i| i.into()).collect();
12246 self
12247 }
12248}
12249
12250impl wkt::message::Message for SerializedTaxonomy {
12251 fn typename() -> &'static str {
12252 "type.googleapis.com/google.cloud.datacatalog.v1.SerializedTaxonomy"
12253 }
12254}
12255
12256/// A nested protocol buffer that represents a policy tag and all its
12257/// descendants.
12258#[derive(Clone, Default, PartialEq)]
12259#[non_exhaustive]
12260pub struct SerializedPolicyTag {
12261 /// Resource name of the policy tag.
12262 ///
12263 /// This field is ignored when calling `ImportTaxonomies`.
12264 pub policy_tag: std::string::String,
12265
12266 /// Required. Display name of the policy tag. At most 200 bytes when encoded
12267 /// in UTF-8.
12268 pub display_name: std::string::String,
12269
12270 /// Description of the serialized policy tag. At most
12271 /// 2000 bytes when encoded in UTF-8. If not set, defaults to an
12272 /// empty description.
12273 pub description: std::string::String,
12274
12275 /// Children of the policy tag, if any.
12276 pub child_policy_tags: std::vec::Vec<crate::model::SerializedPolicyTag>,
12277
12278 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12279}
12280
12281impl SerializedPolicyTag {
12282 pub fn new() -> Self {
12283 std::default::Default::default()
12284 }
12285
12286 /// Sets the value of [policy_tag][crate::model::SerializedPolicyTag::policy_tag].
12287 ///
12288 /// # Example
12289 /// ```ignore,no_run
12290 /// # use google_cloud_datacatalog_v1::model::SerializedPolicyTag;
12291 /// let x = SerializedPolicyTag::new().set_policy_tag("example");
12292 /// ```
12293 pub fn set_policy_tag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12294 self.policy_tag = v.into();
12295 self
12296 }
12297
12298 /// Sets the value of [display_name][crate::model::SerializedPolicyTag::display_name].
12299 ///
12300 /// # Example
12301 /// ```ignore,no_run
12302 /// # use google_cloud_datacatalog_v1::model::SerializedPolicyTag;
12303 /// let x = SerializedPolicyTag::new().set_display_name("example");
12304 /// ```
12305 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12306 self.display_name = v.into();
12307 self
12308 }
12309
12310 /// Sets the value of [description][crate::model::SerializedPolicyTag::description].
12311 ///
12312 /// # Example
12313 /// ```ignore,no_run
12314 /// # use google_cloud_datacatalog_v1::model::SerializedPolicyTag;
12315 /// let x = SerializedPolicyTag::new().set_description("example");
12316 /// ```
12317 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12318 self.description = v.into();
12319 self
12320 }
12321
12322 /// Sets the value of [child_policy_tags][crate::model::SerializedPolicyTag::child_policy_tags].
12323 ///
12324 /// # Example
12325 /// ```ignore,no_run
12326 /// # use google_cloud_datacatalog_v1::model::SerializedPolicyTag;
12327 /// let x = SerializedPolicyTag::new()
12328 /// .set_child_policy_tags([
12329 /// SerializedPolicyTag::default()/* use setters */,
12330 /// SerializedPolicyTag::default()/* use (different) setters */,
12331 /// ]);
12332 /// ```
12333 pub fn set_child_policy_tags<T, V>(mut self, v: T) -> Self
12334 where
12335 T: std::iter::IntoIterator<Item = V>,
12336 V: std::convert::Into<crate::model::SerializedPolicyTag>,
12337 {
12338 use std::iter::Iterator;
12339 self.child_policy_tags = v.into_iter().map(|i| i.into()).collect();
12340 self
12341 }
12342}
12343
12344impl wkt::message::Message for SerializedPolicyTag {
12345 fn typename() -> &'static str {
12346 "type.googleapis.com/google.cloud.datacatalog.v1.SerializedPolicyTag"
12347 }
12348}
12349
12350/// Request message for
12351/// [ReplaceTaxonomy][google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ReplaceTaxonomy].
12352///
12353/// [google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ReplaceTaxonomy]: crate::client::PolicyTagManagerSerialization::replace_taxonomy
12354#[derive(Clone, Default, PartialEq)]
12355#[non_exhaustive]
12356pub struct ReplaceTaxonomyRequest {
12357 /// Required. Resource name of the taxonomy to update.
12358 pub name: std::string::String,
12359
12360 /// Required. Taxonomy to update along with its child policy tags.
12361 pub serialized_taxonomy: std::option::Option<crate::model::SerializedTaxonomy>,
12362
12363 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12364}
12365
12366impl ReplaceTaxonomyRequest {
12367 pub fn new() -> Self {
12368 std::default::Default::default()
12369 }
12370
12371 /// Sets the value of [name][crate::model::ReplaceTaxonomyRequest::name].
12372 ///
12373 /// # Example
12374 /// ```ignore,no_run
12375 /// # use google_cloud_datacatalog_v1::model::ReplaceTaxonomyRequest;
12376 /// let x = ReplaceTaxonomyRequest::new().set_name("example");
12377 /// ```
12378 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12379 self.name = v.into();
12380 self
12381 }
12382
12383 /// Sets the value of [serialized_taxonomy][crate::model::ReplaceTaxonomyRequest::serialized_taxonomy].
12384 ///
12385 /// # Example
12386 /// ```ignore,no_run
12387 /// # use google_cloud_datacatalog_v1::model::ReplaceTaxonomyRequest;
12388 /// use google_cloud_datacatalog_v1::model::SerializedTaxonomy;
12389 /// let x = ReplaceTaxonomyRequest::new().set_serialized_taxonomy(SerializedTaxonomy::default()/* use setters */);
12390 /// ```
12391 pub fn set_serialized_taxonomy<T>(mut self, v: T) -> Self
12392 where
12393 T: std::convert::Into<crate::model::SerializedTaxonomy>,
12394 {
12395 self.serialized_taxonomy = std::option::Option::Some(v.into());
12396 self
12397 }
12398
12399 /// Sets or clears the value of [serialized_taxonomy][crate::model::ReplaceTaxonomyRequest::serialized_taxonomy].
12400 ///
12401 /// # Example
12402 /// ```ignore,no_run
12403 /// # use google_cloud_datacatalog_v1::model::ReplaceTaxonomyRequest;
12404 /// use google_cloud_datacatalog_v1::model::SerializedTaxonomy;
12405 /// let x = ReplaceTaxonomyRequest::new().set_or_clear_serialized_taxonomy(Some(SerializedTaxonomy::default()/* use setters */));
12406 /// let x = ReplaceTaxonomyRequest::new().set_or_clear_serialized_taxonomy(None::<SerializedTaxonomy>);
12407 /// ```
12408 pub fn set_or_clear_serialized_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
12409 where
12410 T: std::convert::Into<crate::model::SerializedTaxonomy>,
12411 {
12412 self.serialized_taxonomy = v.map(|x| x.into());
12413 self
12414 }
12415}
12416
12417impl wkt::message::Message for ReplaceTaxonomyRequest {
12418 fn typename() -> &'static str {
12419 "type.googleapis.com/google.cloud.datacatalog.v1.ReplaceTaxonomyRequest"
12420 }
12421}
12422
12423/// Request message for
12424/// [ImportTaxonomies][google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ImportTaxonomies].
12425///
12426/// [google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ImportTaxonomies]: crate::client::PolicyTagManagerSerialization::import_taxonomies
12427#[derive(Clone, Default, PartialEq)]
12428#[non_exhaustive]
12429pub struct ImportTaxonomiesRequest {
12430 /// Required. Resource name of project that the imported taxonomies will belong
12431 /// to.
12432 pub parent: std::string::String,
12433
12434 /// Source taxonomies to import.
12435 pub source: std::option::Option<crate::model::import_taxonomies_request::Source>,
12436
12437 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12438}
12439
12440impl ImportTaxonomiesRequest {
12441 pub fn new() -> Self {
12442 std::default::Default::default()
12443 }
12444
12445 /// Sets the value of [parent][crate::model::ImportTaxonomiesRequest::parent].
12446 ///
12447 /// # Example
12448 /// ```ignore,no_run
12449 /// # use google_cloud_datacatalog_v1::model::ImportTaxonomiesRequest;
12450 /// let x = ImportTaxonomiesRequest::new().set_parent("example");
12451 /// ```
12452 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12453 self.parent = v.into();
12454 self
12455 }
12456
12457 /// Sets the value of [source][crate::model::ImportTaxonomiesRequest::source].
12458 ///
12459 /// Note that all the setters affecting `source` are mutually
12460 /// exclusive.
12461 ///
12462 /// # Example
12463 /// ```ignore,no_run
12464 /// # use google_cloud_datacatalog_v1::model::ImportTaxonomiesRequest;
12465 /// use google_cloud_datacatalog_v1::model::InlineSource;
12466 /// let x = ImportTaxonomiesRequest::new().set_source(Some(
12467 /// google_cloud_datacatalog_v1::model::import_taxonomies_request::Source::InlineSource(InlineSource::default().into())));
12468 /// ```
12469 pub fn set_source<
12470 T: std::convert::Into<std::option::Option<crate::model::import_taxonomies_request::Source>>,
12471 >(
12472 mut self,
12473 v: T,
12474 ) -> Self {
12475 self.source = v.into();
12476 self
12477 }
12478
12479 /// The value of [source][crate::model::ImportTaxonomiesRequest::source]
12480 /// if it holds a `InlineSource`, `None` if the field is not set or
12481 /// holds a different branch.
12482 pub fn inline_source(
12483 &self,
12484 ) -> std::option::Option<&std::boxed::Box<crate::model::InlineSource>> {
12485 #[allow(unreachable_patterns)]
12486 self.source.as_ref().and_then(|v| match v {
12487 crate::model::import_taxonomies_request::Source::InlineSource(v) => {
12488 std::option::Option::Some(v)
12489 }
12490 _ => std::option::Option::None,
12491 })
12492 }
12493
12494 /// Sets the value of [source][crate::model::ImportTaxonomiesRequest::source]
12495 /// to hold a `InlineSource`.
12496 ///
12497 /// Note that all the setters affecting `source` are
12498 /// mutually exclusive.
12499 ///
12500 /// # Example
12501 /// ```ignore,no_run
12502 /// # use google_cloud_datacatalog_v1::model::ImportTaxonomiesRequest;
12503 /// use google_cloud_datacatalog_v1::model::InlineSource;
12504 /// let x = ImportTaxonomiesRequest::new().set_inline_source(InlineSource::default()/* use setters */);
12505 /// assert!(x.inline_source().is_some());
12506 /// assert!(x.cross_regional_source().is_none());
12507 /// ```
12508 pub fn set_inline_source<T: std::convert::Into<std::boxed::Box<crate::model::InlineSource>>>(
12509 mut self,
12510 v: T,
12511 ) -> Self {
12512 self.source = std::option::Option::Some(
12513 crate::model::import_taxonomies_request::Source::InlineSource(v.into()),
12514 );
12515 self
12516 }
12517
12518 /// The value of [source][crate::model::ImportTaxonomiesRequest::source]
12519 /// if it holds a `CrossRegionalSource`, `None` if the field is not set or
12520 /// holds a different branch.
12521 pub fn cross_regional_source(
12522 &self,
12523 ) -> std::option::Option<&std::boxed::Box<crate::model::CrossRegionalSource>> {
12524 #[allow(unreachable_patterns)]
12525 self.source.as_ref().and_then(|v| match v {
12526 crate::model::import_taxonomies_request::Source::CrossRegionalSource(v) => {
12527 std::option::Option::Some(v)
12528 }
12529 _ => std::option::Option::None,
12530 })
12531 }
12532
12533 /// Sets the value of [source][crate::model::ImportTaxonomiesRequest::source]
12534 /// to hold a `CrossRegionalSource`.
12535 ///
12536 /// Note that all the setters affecting `source` are
12537 /// mutually exclusive.
12538 ///
12539 /// # Example
12540 /// ```ignore,no_run
12541 /// # use google_cloud_datacatalog_v1::model::ImportTaxonomiesRequest;
12542 /// use google_cloud_datacatalog_v1::model::CrossRegionalSource;
12543 /// let x = ImportTaxonomiesRequest::new().set_cross_regional_source(CrossRegionalSource::default()/* use setters */);
12544 /// assert!(x.cross_regional_source().is_some());
12545 /// assert!(x.inline_source().is_none());
12546 /// ```
12547 pub fn set_cross_regional_source<
12548 T: std::convert::Into<std::boxed::Box<crate::model::CrossRegionalSource>>,
12549 >(
12550 mut self,
12551 v: T,
12552 ) -> Self {
12553 self.source = std::option::Option::Some(
12554 crate::model::import_taxonomies_request::Source::CrossRegionalSource(v.into()),
12555 );
12556 self
12557 }
12558}
12559
12560impl wkt::message::Message for ImportTaxonomiesRequest {
12561 fn typename() -> &'static str {
12562 "type.googleapis.com/google.cloud.datacatalog.v1.ImportTaxonomiesRequest"
12563 }
12564}
12565
12566/// Defines additional types related to [ImportTaxonomiesRequest].
12567pub mod import_taxonomies_request {
12568 #[allow(unused_imports)]
12569 use super::*;
12570
12571 /// Source taxonomies to import.
12572 #[derive(Clone, Debug, PartialEq)]
12573 #[non_exhaustive]
12574 pub enum Source {
12575 /// Inline source taxonomy to import.
12576 InlineSource(std::boxed::Box<crate::model::InlineSource>),
12577 /// Cross-regional source taxonomy to import.
12578 CrossRegionalSource(std::boxed::Box<crate::model::CrossRegionalSource>),
12579 }
12580}
12581
12582/// Inline source containing taxonomies to import.
12583#[derive(Clone, Default, PartialEq)]
12584#[non_exhaustive]
12585pub struct InlineSource {
12586 /// Required. Taxonomies to import.
12587 pub taxonomies: std::vec::Vec<crate::model::SerializedTaxonomy>,
12588
12589 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12590}
12591
12592impl InlineSource {
12593 pub fn new() -> Self {
12594 std::default::Default::default()
12595 }
12596
12597 /// Sets the value of [taxonomies][crate::model::InlineSource::taxonomies].
12598 ///
12599 /// # Example
12600 /// ```ignore,no_run
12601 /// # use google_cloud_datacatalog_v1::model::InlineSource;
12602 /// use google_cloud_datacatalog_v1::model::SerializedTaxonomy;
12603 /// let x = InlineSource::new()
12604 /// .set_taxonomies([
12605 /// SerializedTaxonomy::default()/* use setters */,
12606 /// SerializedTaxonomy::default()/* use (different) setters */,
12607 /// ]);
12608 /// ```
12609 pub fn set_taxonomies<T, V>(mut self, v: T) -> Self
12610 where
12611 T: std::iter::IntoIterator<Item = V>,
12612 V: std::convert::Into<crate::model::SerializedTaxonomy>,
12613 {
12614 use std::iter::Iterator;
12615 self.taxonomies = v.into_iter().map(|i| i.into()).collect();
12616 self
12617 }
12618}
12619
12620impl wkt::message::Message for InlineSource {
12621 fn typename() -> &'static str {
12622 "type.googleapis.com/google.cloud.datacatalog.v1.InlineSource"
12623 }
12624}
12625
12626/// Cross-regional source used to import an existing taxonomy into a different
12627/// region.
12628#[derive(Clone, Default, PartialEq)]
12629#[non_exhaustive]
12630pub struct CrossRegionalSource {
12631 /// Required. The resource name of the source taxonomy to import.
12632 pub taxonomy: std::string::String,
12633
12634 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12635}
12636
12637impl CrossRegionalSource {
12638 pub fn new() -> Self {
12639 std::default::Default::default()
12640 }
12641
12642 /// Sets the value of [taxonomy][crate::model::CrossRegionalSource::taxonomy].
12643 ///
12644 /// # Example
12645 /// ```ignore,no_run
12646 /// # use google_cloud_datacatalog_v1::model::CrossRegionalSource;
12647 /// let x = CrossRegionalSource::new().set_taxonomy("example");
12648 /// ```
12649 pub fn set_taxonomy<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12650 self.taxonomy = v.into();
12651 self
12652 }
12653}
12654
12655impl wkt::message::Message for CrossRegionalSource {
12656 fn typename() -> &'static str {
12657 "type.googleapis.com/google.cloud.datacatalog.v1.CrossRegionalSource"
12658 }
12659}
12660
12661/// Response message for
12662/// [ImportTaxonomies][google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ImportTaxonomies].
12663///
12664/// [google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ImportTaxonomies]: crate::client::PolicyTagManagerSerialization::import_taxonomies
12665#[derive(Clone, Default, PartialEq)]
12666#[non_exhaustive]
12667pub struct ImportTaxonomiesResponse {
12668 /// Imported taxonomies.
12669 pub taxonomies: std::vec::Vec<crate::model::Taxonomy>,
12670
12671 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12672}
12673
12674impl ImportTaxonomiesResponse {
12675 pub fn new() -> Self {
12676 std::default::Default::default()
12677 }
12678
12679 /// Sets the value of [taxonomies][crate::model::ImportTaxonomiesResponse::taxonomies].
12680 ///
12681 /// # Example
12682 /// ```ignore,no_run
12683 /// # use google_cloud_datacatalog_v1::model::ImportTaxonomiesResponse;
12684 /// use google_cloud_datacatalog_v1::model::Taxonomy;
12685 /// let x = ImportTaxonomiesResponse::new()
12686 /// .set_taxonomies([
12687 /// Taxonomy::default()/* use setters */,
12688 /// Taxonomy::default()/* use (different) setters */,
12689 /// ]);
12690 /// ```
12691 pub fn set_taxonomies<T, V>(mut self, v: T) -> Self
12692 where
12693 T: std::iter::IntoIterator<Item = V>,
12694 V: std::convert::Into<crate::model::Taxonomy>,
12695 {
12696 use std::iter::Iterator;
12697 self.taxonomies = v.into_iter().map(|i| i.into()).collect();
12698 self
12699 }
12700}
12701
12702impl wkt::message::Message for ImportTaxonomiesResponse {
12703 fn typename() -> &'static str {
12704 "type.googleapis.com/google.cloud.datacatalog.v1.ImportTaxonomiesResponse"
12705 }
12706}
12707
12708/// Request message for
12709/// [ExportTaxonomies][google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ExportTaxonomies].
12710///
12711/// [google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ExportTaxonomies]: crate::client::PolicyTagManagerSerialization::export_taxonomies
12712#[derive(Clone, Default, PartialEq)]
12713#[non_exhaustive]
12714pub struct ExportTaxonomiesRequest {
12715 /// Required. Resource name of the project that the exported taxonomies belong
12716 /// to.
12717 pub parent: std::string::String,
12718
12719 /// Required. Resource names of the taxonomies to export.
12720 pub taxonomies: std::vec::Vec<std::string::String>,
12721
12722 /// Required. Export destination for taxonomies.
12723 pub destination: std::option::Option<crate::model::export_taxonomies_request::Destination>,
12724
12725 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12726}
12727
12728impl ExportTaxonomiesRequest {
12729 pub fn new() -> Self {
12730 std::default::Default::default()
12731 }
12732
12733 /// Sets the value of [parent][crate::model::ExportTaxonomiesRequest::parent].
12734 ///
12735 /// # Example
12736 /// ```ignore,no_run
12737 /// # use google_cloud_datacatalog_v1::model::ExportTaxonomiesRequest;
12738 /// let x = ExportTaxonomiesRequest::new().set_parent("example");
12739 /// ```
12740 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12741 self.parent = v.into();
12742 self
12743 }
12744
12745 /// Sets the value of [taxonomies][crate::model::ExportTaxonomiesRequest::taxonomies].
12746 ///
12747 /// # Example
12748 /// ```ignore,no_run
12749 /// # use google_cloud_datacatalog_v1::model::ExportTaxonomiesRequest;
12750 /// let x = ExportTaxonomiesRequest::new().set_taxonomies(["a", "b", "c"]);
12751 /// ```
12752 pub fn set_taxonomies<T, V>(mut self, v: T) -> Self
12753 where
12754 T: std::iter::IntoIterator<Item = V>,
12755 V: std::convert::Into<std::string::String>,
12756 {
12757 use std::iter::Iterator;
12758 self.taxonomies = v.into_iter().map(|i| i.into()).collect();
12759 self
12760 }
12761
12762 /// Sets the value of [destination][crate::model::ExportTaxonomiesRequest::destination].
12763 ///
12764 /// Note that all the setters affecting `destination` are mutually
12765 /// exclusive.
12766 ///
12767 /// # Example
12768 /// ```ignore,no_run
12769 /// # use google_cloud_datacatalog_v1::model::ExportTaxonomiesRequest;
12770 /// use google_cloud_datacatalog_v1::model::export_taxonomies_request::Destination;
12771 /// let x = ExportTaxonomiesRequest::new().set_destination(Some(Destination::SerializedTaxonomies(true)));
12772 /// ```
12773 pub fn set_destination<
12774 T: std::convert::Into<
12775 std::option::Option<crate::model::export_taxonomies_request::Destination>,
12776 >,
12777 >(
12778 mut self,
12779 v: T,
12780 ) -> Self {
12781 self.destination = v.into();
12782 self
12783 }
12784
12785 /// The value of [destination][crate::model::ExportTaxonomiesRequest::destination]
12786 /// if it holds a `SerializedTaxonomies`, `None` if the field is not set or
12787 /// holds a different branch.
12788 pub fn serialized_taxonomies(&self) -> std::option::Option<&bool> {
12789 #[allow(unreachable_patterns)]
12790 self.destination.as_ref().and_then(|v| match v {
12791 crate::model::export_taxonomies_request::Destination::SerializedTaxonomies(v) => {
12792 std::option::Option::Some(v)
12793 }
12794 _ => std::option::Option::None,
12795 })
12796 }
12797
12798 /// Sets the value of [destination][crate::model::ExportTaxonomiesRequest::destination]
12799 /// to hold a `SerializedTaxonomies`.
12800 ///
12801 /// Note that all the setters affecting `destination` are
12802 /// mutually exclusive.
12803 ///
12804 /// # Example
12805 /// ```ignore,no_run
12806 /// # use google_cloud_datacatalog_v1::model::ExportTaxonomiesRequest;
12807 /// let x = ExportTaxonomiesRequest::new().set_serialized_taxonomies(true);
12808 /// assert!(x.serialized_taxonomies().is_some());
12809 /// ```
12810 pub fn set_serialized_taxonomies<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12811 self.destination = std::option::Option::Some(
12812 crate::model::export_taxonomies_request::Destination::SerializedTaxonomies(v.into()),
12813 );
12814 self
12815 }
12816}
12817
12818impl wkt::message::Message for ExportTaxonomiesRequest {
12819 fn typename() -> &'static str {
12820 "type.googleapis.com/google.cloud.datacatalog.v1.ExportTaxonomiesRequest"
12821 }
12822}
12823
12824/// Defines additional types related to [ExportTaxonomiesRequest].
12825pub mod export_taxonomies_request {
12826 #[allow(unused_imports)]
12827 use super::*;
12828
12829 /// Required. Export destination for taxonomies.
12830 #[derive(Clone, Debug, PartialEq)]
12831 #[non_exhaustive]
12832 pub enum Destination {
12833 /// Serialized export taxonomies that contain all the policy
12834 /// tags as nested protocol buffers.
12835 SerializedTaxonomies(bool),
12836 }
12837}
12838
12839/// Response message for
12840/// [ExportTaxonomies][google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ExportTaxonomies].
12841///
12842/// [google.cloud.datacatalog.v1.PolicyTagManagerSerialization.ExportTaxonomies]: crate::client::PolicyTagManagerSerialization::export_taxonomies
12843#[derive(Clone, Default, PartialEq)]
12844#[non_exhaustive]
12845pub struct ExportTaxonomiesResponse {
12846 /// List of taxonomies and policy tags as nested protocol buffers.
12847 pub taxonomies: std::vec::Vec<crate::model::SerializedTaxonomy>,
12848
12849 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12850}
12851
12852impl ExportTaxonomiesResponse {
12853 pub fn new() -> Self {
12854 std::default::Default::default()
12855 }
12856
12857 /// Sets the value of [taxonomies][crate::model::ExportTaxonomiesResponse::taxonomies].
12858 ///
12859 /// # Example
12860 /// ```ignore,no_run
12861 /// # use google_cloud_datacatalog_v1::model::ExportTaxonomiesResponse;
12862 /// use google_cloud_datacatalog_v1::model::SerializedTaxonomy;
12863 /// let x = ExportTaxonomiesResponse::new()
12864 /// .set_taxonomies([
12865 /// SerializedTaxonomy::default()/* use setters */,
12866 /// SerializedTaxonomy::default()/* use (different) setters */,
12867 /// ]);
12868 /// ```
12869 pub fn set_taxonomies<T, V>(mut self, v: T) -> Self
12870 where
12871 T: std::iter::IntoIterator<Item = V>,
12872 V: std::convert::Into<crate::model::SerializedTaxonomy>,
12873 {
12874 use std::iter::Iterator;
12875 self.taxonomies = v.into_iter().map(|i| i.into()).collect();
12876 self
12877 }
12878}
12879
12880impl wkt::message::Message for ExportTaxonomiesResponse {
12881 fn typename() -> &'static str {
12882 "type.googleapis.com/google.cloud.datacatalog.v1.ExportTaxonomiesResponse"
12883 }
12884}
12885
12886/// Represents a schema, for example, a BigQuery, GoogleSQL, or Avro schema.
12887#[derive(Clone, Default, PartialEq)]
12888#[non_exhaustive]
12889pub struct Schema {
12890 /// The unified GoogleSQL-like schema of columns.
12891 ///
12892 /// The overall maximum number of columns and nested columns is 10,000.
12893 /// The maximum nested depth is 15 levels.
12894 pub columns: std::vec::Vec<crate::model::ColumnSchema>,
12895
12896 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12897}
12898
12899impl Schema {
12900 pub fn new() -> Self {
12901 std::default::Default::default()
12902 }
12903
12904 /// Sets the value of [columns][crate::model::Schema::columns].
12905 ///
12906 /// # Example
12907 /// ```ignore,no_run
12908 /// # use google_cloud_datacatalog_v1::model::Schema;
12909 /// use google_cloud_datacatalog_v1::model::ColumnSchema;
12910 /// let x = Schema::new()
12911 /// .set_columns([
12912 /// ColumnSchema::default()/* use setters */,
12913 /// ColumnSchema::default()/* use (different) setters */,
12914 /// ]);
12915 /// ```
12916 pub fn set_columns<T, V>(mut self, v: T) -> Self
12917 where
12918 T: std::iter::IntoIterator<Item = V>,
12919 V: std::convert::Into<crate::model::ColumnSchema>,
12920 {
12921 use std::iter::Iterator;
12922 self.columns = v.into_iter().map(|i| i.into()).collect();
12923 self
12924 }
12925}
12926
12927impl wkt::message::Message for Schema {
12928 fn typename() -> &'static str {
12929 "type.googleapis.com/google.cloud.datacatalog.v1.Schema"
12930 }
12931}
12932
12933/// A column within a schema. Columns can be nested inside
12934/// other columns.
12935#[derive(Clone, Default, PartialEq)]
12936#[non_exhaustive]
12937pub struct ColumnSchema {
12938 /// Required. Name of the column.
12939 ///
12940 /// Must be a UTF-8 string without dots (.).
12941 /// The maximum size is 64 bytes.
12942 pub column: std::string::String,
12943
12944 /// Required. Type of the column.
12945 ///
12946 /// Must be a UTF-8 string with the maximum size of 128 bytes.
12947 pub r#type: std::string::String,
12948
12949 /// Optional. Description of the column. Default value is an empty string.
12950 ///
12951 /// The description must be a UTF-8 string with the maximum size of 2000
12952 /// bytes.
12953 pub description: std::string::String,
12954
12955 /// Optional. A column's mode indicates whether values in this column are
12956 /// required, nullable, or repeated.
12957 ///
12958 /// Only `NULLABLE`, `REQUIRED`, and `REPEATED` values are supported.
12959 /// Default mode is `NULLABLE`.
12960 pub mode: std::string::String,
12961
12962 /// Optional. Default value for the column.
12963 pub default_value: std::string::String,
12964
12965 /// Optional. Ordinal position
12966 pub ordinal_position: i32,
12967
12968 /// Optional. Most important inclusion of this column.
12969 pub highest_indexing_type: crate::model::column_schema::IndexingType,
12970
12971 /// Optional. Schema of sub-columns. A column can have zero or more
12972 /// sub-columns.
12973 pub subcolumns: std::vec::Vec<crate::model::ColumnSchema>,
12974
12975 /// Optional. The subtype of the RANGE, if the type of this field is RANGE. If
12976 /// the type is RANGE, this field is required. Possible values for the field
12977 /// element type of a RANGE include:
12978 ///
12979 /// * DATE
12980 /// * DATETIME
12981 /// * TIMESTAMP
12982 pub range_element_type: std::option::Option<crate::model::column_schema::FieldElementType>,
12983
12984 /// Optional. Garbage collection policy for the column or column family.
12985 /// Applies to systems like Cloud Bigtable.
12986 pub gc_rule: std::string::String,
12987
12988 /// Information only applying for columns in Entries from a specific system.
12989 pub system_spec: std::option::Option<crate::model::column_schema::SystemSpec>,
12990
12991 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12992}
12993
12994impl ColumnSchema {
12995 pub fn new() -> Self {
12996 std::default::Default::default()
12997 }
12998
12999 /// Sets the value of [column][crate::model::ColumnSchema::column].
13000 ///
13001 /// # Example
13002 /// ```ignore,no_run
13003 /// # use google_cloud_datacatalog_v1::model::ColumnSchema;
13004 /// let x = ColumnSchema::new().set_column("example");
13005 /// ```
13006 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13007 self.column = v.into();
13008 self
13009 }
13010
13011 /// Sets the value of [r#type][crate::model::ColumnSchema::type].
13012 ///
13013 /// # Example
13014 /// ```ignore,no_run
13015 /// # use google_cloud_datacatalog_v1::model::ColumnSchema;
13016 /// let x = ColumnSchema::new().set_type("example");
13017 /// ```
13018 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13019 self.r#type = v.into();
13020 self
13021 }
13022
13023 /// Sets the value of [description][crate::model::ColumnSchema::description].
13024 ///
13025 /// # Example
13026 /// ```ignore,no_run
13027 /// # use google_cloud_datacatalog_v1::model::ColumnSchema;
13028 /// let x = ColumnSchema::new().set_description("example");
13029 /// ```
13030 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13031 self.description = v.into();
13032 self
13033 }
13034
13035 /// Sets the value of [mode][crate::model::ColumnSchema::mode].
13036 ///
13037 /// # Example
13038 /// ```ignore,no_run
13039 /// # use google_cloud_datacatalog_v1::model::ColumnSchema;
13040 /// let x = ColumnSchema::new().set_mode("example");
13041 /// ```
13042 pub fn set_mode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13043 self.mode = v.into();
13044 self
13045 }
13046
13047 /// Sets the value of [default_value][crate::model::ColumnSchema::default_value].
13048 ///
13049 /// # Example
13050 /// ```ignore,no_run
13051 /// # use google_cloud_datacatalog_v1::model::ColumnSchema;
13052 /// let x = ColumnSchema::new().set_default_value("example");
13053 /// ```
13054 pub fn set_default_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13055 self.default_value = v.into();
13056 self
13057 }
13058
13059 /// Sets the value of [ordinal_position][crate::model::ColumnSchema::ordinal_position].
13060 ///
13061 /// # Example
13062 /// ```ignore,no_run
13063 /// # use google_cloud_datacatalog_v1::model::ColumnSchema;
13064 /// let x = ColumnSchema::new().set_ordinal_position(42);
13065 /// ```
13066 pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13067 self.ordinal_position = v.into();
13068 self
13069 }
13070
13071 /// Sets the value of [highest_indexing_type][crate::model::ColumnSchema::highest_indexing_type].
13072 ///
13073 /// # Example
13074 /// ```ignore,no_run
13075 /// # use google_cloud_datacatalog_v1::model::ColumnSchema;
13076 /// use google_cloud_datacatalog_v1::model::column_schema::IndexingType;
13077 /// let x0 = ColumnSchema::new().set_highest_indexing_type(IndexingType::None);
13078 /// let x1 = ColumnSchema::new().set_highest_indexing_type(IndexingType::NonUnique);
13079 /// let x2 = ColumnSchema::new().set_highest_indexing_type(IndexingType::Unique);
13080 /// ```
13081 pub fn set_highest_indexing_type<
13082 T: std::convert::Into<crate::model::column_schema::IndexingType>,
13083 >(
13084 mut self,
13085 v: T,
13086 ) -> Self {
13087 self.highest_indexing_type = v.into();
13088 self
13089 }
13090
13091 /// Sets the value of [subcolumns][crate::model::ColumnSchema::subcolumns].
13092 ///
13093 /// # Example
13094 /// ```ignore,no_run
13095 /// # use google_cloud_datacatalog_v1::model::ColumnSchema;
13096 /// let x = ColumnSchema::new()
13097 /// .set_subcolumns([
13098 /// ColumnSchema::default()/* use setters */,
13099 /// ColumnSchema::default()/* use (different) setters */,
13100 /// ]);
13101 /// ```
13102 pub fn set_subcolumns<T, V>(mut self, v: T) -> Self
13103 where
13104 T: std::iter::IntoIterator<Item = V>,
13105 V: std::convert::Into<crate::model::ColumnSchema>,
13106 {
13107 use std::iter::Iterator;
13108 self.subcolumns = v.into_iter().map(|i| i.into()).collect();
13109 self
13110 }
13111
13112 /// Sets the value of [range_element_type][crate::model::ColumnSchema::range_element_type].
13113 ///
13114 /// # Example
13115 /// ```ignore,no_run
13116 /// # use google_cloud_datacatalog_v1::model::ColumnSchema;
13117 /// use google_cloud_datacatalog_v1::model::column_schema::FieldElementType;
13118 /// let x = ColumnSchema::new().set_range_element_type(FieldElementType::default()/* use setters */);
13119 /// ```
13120 pub fn set_range_element_type<T>(mut self, v: T) -> Self
13121 where
13122 T: std::convert::Into<crate::model::column_schema::FieldElementType>,
13123 {
13124 self.range_element_type = std::option::Option::Some(v.into());
13125 self
13126 }
13127
13128 /// Sets or clears the value of [range_element_type][crate::model::ColumnSchema::range_element_type].
13129 ///
13130 /// # Example
13131 /// ```ignore,no_run
13132 /// # use google_cloud_datacatalog_v1::model::ColumnSchema;
13133 /// use google_cloud_datacatalog_v1::model::column_schema::FieldElementType;
13134 /// let x = ColumnSchema::new().set_or_clear_range_element_type(Some(FieldElementType::default()/* use setters */));
13135 /// let x = ColumnSchema::new().set_or_clear_range_element_type(None::<FieldElementType>);
13136 /// ```
13137 pub fn set_or_clear_range_element_type<T>(mut self, v: std::option::Option<T>) -> Self
13138 where
13139 T: std::convert::Into<crate::model::column_schema::FieldElementType>,
13140 {
13141 self.range_element_type = v.map(|x| x.into());
13142 self
13143 }
13144
13145 /// Sets the value of [gc_rule][crate::model::ColumnSchema::gc_rule].
13146 ///
13147 /// # Example
13148 /// ```ignore,no_run
13149 /// # use google_cloud_datacatalog_v1::model::ColumnSchema;
13150 /// let x = ColumnSchema::new().set_gc_rule("example");
13151 /// ```
13152 pub fn set_gc_rule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13153 self.gc_rule = v.into();
13154 self
13155 }
13156
13157 /// Sets the value of [system_spec][crate::model::ColumnSchema::system_spec].
13158 ///
13159 /// Note that all the setters affecting `system_spec` are mutually
13160 /// exclusive.
13161 ///
13162 /// # Example
13163 /// ```ignore,no_run
13164 /// # use google_cloud_datacatalog_v1::model::ColumnSchema;
13165 /// use google_cloud_datacatalog_v1::model::column_schema::LookerColumnSpec;
13166 /// let x = ColumnSchema::new().set_system_spec(Some(
13167 /// google_cloud_datacatalog_v1::model::column_schema::SystemSpec::LookerColumnSpec(LookerColumnSpec::default().into())));
13168 /// ```
13169 pub fn set_system_spec<
13170 T: std::convert::Into<std::option::Option<crate::model::column_schema::SystemSpec>>,
13171 >(
13172 mut self,
13173 v: T,
13174 ) -> Self {
13175 self.system_spec = v.into();
13176 self
13177 }
13178
13179 /// The value of [system_spec][crate::model::ColumnSchema::system_spec]
13180 /// if it holds a `LookerColumnSpec`, `None` if the field is not set or
13181 /// holds a different branch.
13182 pub fn looker_column_spec(
13183 &self,
13184 ) -> std::option::Option<&std::boxed::Box<crate::model::column_schema::LookerColumnSpec>> {
13185 #[allow(unreachable_patterns)]
13186 self.system_spec.as_ref().and_then(|v| match v {
13187 crate::model::column_schema::SystemSpec::LookerColumnSpec(v) => {
13188 std::option::Option::Some(v)
13189 }
13190 _ => std::option::Option::None,
13191 })
13192 }
13193
13194 /// Sets the value of [system_spec][crate::model::ColumnSchema::system_spec]
13195 /// to hold a `LookerColumnSpec`.
13196 ///
13197 /// Note that all the setters affecting `system_spec` are
13198 /// mutually exclusive.
13199 ///
13200 /// # Example
13201 /// ```ignore,no_run
13202 /// # use google_cloud_datacatalog_v1::model::ColumnSchema;
13203 /// use google_cloud_datacatalog_v1::model::column_schema::LookerColumnSpec;
13204 /// let x = ColumnSchema::new().set_looker_column_spec(LookerColumnSpec::default()/* use setters */);
13205 /// assert!(x.looker_column_spec().is_some());
13206 /// ```
13207 pub fn set_looker_column_spec<
13208 T: std::convert::Into<std::boxed::Box<crate::model::column_schema::LookerColumnSpec>>,
13209 >(
13210 mut self,
13211 v: T,
13212 ) -> Self {
13213 self.system_spec = std::option::Option::Some(
13214 crate::model::column_schema::SystemSpec::LookerColumnSpec(v.into()),
13215 );
13216 self
13217 }
13218}
13219
13220impl wkt::message::Message for ColumnSchema {
13221 fn typename() -> &'static str {
13222 "type.googleapis.com/google.cloud.datacatalog.v1.ColumnSchema"
13223 }
13224}
13225
13226/// Defines additional types related to [ColumnSchema].
13227pub mod column_schema {
13228 #[allow(unused_imports)]
13229 use super::*;
13230
13231 /// Column info specific to Looker System.
13232 #[derive(Clone, Default, PartialEq)]
13233 #[non_exhaustive]
13234 pub struct LookerColumnSpec {
13235 /// Looker specific column type of this column.
13236 pub r#type: crate::model::column_schema::looker_column_spec::LookerColumnType,
13237
13238 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13239 }
13240
13241 impl LookerColumnSpec {
13242 pub fn new() -> Self {
13243 std::default::Default::default()
13244 }
13245
13246 /// Sets the value of [r#type][crate::model::column_schema::LookerColumnSpec::type].
13247 ///
13248 /// # Example
13249 /// ```ignore,no_run
13250 /// # use google_cloud_datacatalog_v1::model::column_schema::LookerColumnSpec;
13251 /// use google_cloud_datacatalog_v1::model::column_schema::looker_column_spec::LookerColumnType;
13252 /// let x0 = LookerColumnSpec::new().set_type(LookerColumnType::Dimension);
13253 /// let x1 = LookerColumnSpec::new().set_type(LookerColumnType::DimensionGroup);
13254 /// let x2 = LookerColumnSpec::new().set_type(LookerColumnType::Filter);
13255 /// ```
13256 pub fn set_type<
13257 T: std::convert::Into<crate::model::column_schema::looker_column_spec::LookerColumnType>,
13258 >(
13259 mut self,
13260 v: T,
13261 ) -> Self {
13262 self.r#type = v.into();
13263 self
13264 }
13265 }
13266
13267 impl wkt::message::Message for LookerColumnSpec {
13268 fn typename() -> &'static str {
13269 "type.googleapis.com/google.cloud.datacatalog.v1.ColumnSchema.LookerColumnSpec"
13270 }
13271 }
13272
13273 /// Defines additional types related to [LookerColumnSpec].
13274 pub mod looker_column_spec {
13275 #[allow(unused_imports)]
13276 use super::*;
13277
13278 /// Column type in Looker.
13279 ///
13280 /// # Working with unknown values
13281 ///
13282 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13283 /// additional enum variants at any time. Adding new variants is not considered
13284 /// a breaking change. Applications should write their code in anticipation of:
13285 ///
13286 /// - New values appearing in future releases of the client library, **and**
13287 /// - New values received dynamically, without application changes.
13288 ///
13289 /// Please consult the [Working with enums] section in the user guide for some
13290 /// guidelines.
13291 ///
13292 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13293 #[derive(Clone, Debug, PartialEq)]
13294 #[non_exhaustive]
13295 pub enum LookerColumnType {
13296 /// Unspecified.
13297 Unspecified,
13298 /// Dimension.
13299 Dimension,
13300 /// Dimension group - parent for Dimension.
13301 DimensionGroup,
13302 /// Filter.
13303 Filter,
13304 /// Measure.
13305 Measure,
13306 /// Parameter.
13307 Parameter,
13308 /// If set, the enum was initialized with an unknown value.
13309 ///
13310 /// Applications can examine the value using [LookerColumnType::value] or
13311 /// [LookerColumnType::name].
13312 UnknownValue(looker_column_type::UnknownValue),
13313 }
13314
13315 #[doc(hidden)]
13316 pub mod looker_column_type {
13317 #[allow(unused_imports)]
13318 use super::*;
13319 #[derive(Clone, Debug, PartialEq)]
13320 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13321 }
13322
13323 impl LookerColumnType {
13324 /// Gets the enum value.
13325 ///
13326 /// Returns `None` if the enum contains an unknown value deserialized from
13327 /// the string representation of enums.
13328 pub fn value(&self) -> std::option::Option<i32> {
13329 match self {
13330 Self::Unspecified => std::option::Option::Some(0),
13331 Self::Dimension => std::option::Option::Some(1),
13332 Self::DimensionGroup => std::option::Option::Some(2),
13333 Self::Filter => std::option::Option::Some(3),
13334 Self::Measure => std::option::Option::Some(4),
13335 Self::Parameter => std::option::Option::Some(5),
13336 Self::UnknownValue(u) => u.0.value(),
13337 }
13338 }
13339
13340 /// Gets the enum value as a string.
13341 ///
13342 /// Returns `None` if the enum contains an unknown value deserialized from
13343 /// the integer representation of enums.
13344 pub fn name(&self) -> std::option::Option<&str> {
13345 match self {
13346 Self::Unspecified => {
13347 std::option::Option::Some("LOOKER_COLUMN_TYPE_UNSPECIFIED")
13348 }
13349 Self::Dimension => std::option::Option::Some("DIMENSION"),
13350 Self::DimensionGroup => std::option::Option::Some("DIMENSION_GROUP"),
13351 Self::Filter => std::option::Option::Some("FILTER"),
13352 Self::Measure => std::option::Option::Some("MEASURE"),
13353 Self::Parameter => std::option::Option::Some("PARAMETER"),
13354 Self::UnknownValue(u) => u.0.name(),
13355 }
13356 }
13357 }
13358
13359 impl std::default::Default for LookerColumnType {
13360 fn default() -> Self {
13361 use std::convert::From;
13362 Self::from(0)
13363 }
13364 }
13365
13366 impl std::fmt::Display for LookerColumnType {
13367 fn fmt(
13368 &self,
13369 f: &mut std::fmt::Formatter<'_>,
13370 ) -> std::result::Result<(), std::fmt::Error> {
13371 wkt::internal::display_enum(f, self.name(), self.value())
13372 }
13373 }
13374
13375 impl std::convert::From<i32> for LookerColumnType {
13376 fn from(value: i32) -> Self {
13377 match value {
13378 0 => Self::Unspecified,
13379 1 => Self::Dimension,
13380 2 => Self::DimensionGroup,
13381 3 => Self::Filter,
13382 4 => Self::Measure,
13383 5 => Self::Parameter,
13384 _ => Self::UnknownValue(looker_column_type::UnknownValue(
13385 wkt::internal::UnknownEnumValue::Integer(value),
13386 )),
13387 }
13388 }
13389 }
13390
13391 impl std::convert::From<&str> for LookerColumnType {
13392 fn from(value: &str) -> Self {
13393 use std::string::ToString;
13394 match value {
13395 "LOOKER_COLUMN_TYPE_UNSPECIFIED" => Self::Unspecified,
13396 "DIMENSION" => Self::Dimension,
13397 "DIMENSION_GROUP" => Self::DimensionGroup,
13398 "FILTER" => Self::Filter,
13399 "MEASURE" => Self::Measure,
13400 "PARAMETER" => Self::Parameter,
13401 _ => Self::UnknownValue(looker_column_type::UnknownValue(
13402 wkt::internal::UnknownEnumValue::String(value.to_string()),
13403 )),
13404 }
13405 }
13406 }
13407
13408 impl serde::ser::Serialize for LookerColumnType {
13409 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13410 where
13411 S: serde::Serializer,
13412 {
13413 match self {
13414 Self::Unspecified => serializer.serialize_i32(0),
13415 Self::Dimension => serializer.serialize_i32(1),
13416 Self::DimensionGroup => serializer.serialize_i32(2),
13417 Self::Filter => serializer.serialize_i32(3),
13418 Self::Measure => serializer.serialize_i32(4),
13419 Self::Parameter => serializer.serialize_i32(5),
13420 Self::UnknownValue(u) => u.0.serialize(serializer),
13421 }
13422 }
13423 }
13424
13425 impl<'de> serde::de::Deserialize<'de> for LookerColumnType {
13426 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13427 where
13428 D: serde::Deserializer<'de>,
13429 {
13430 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LookerColumnType>::new(
13431 ".google.cloud.datacatalog.v1.ColumnSchema.LookerColumnSpec.LookerColumnType",
13432 ))
13433 }
13434 }
13435 }
13436
13437 /// Represents the type of a field element.
13438 #[derive(Clone, Default, PartialEq)]
13439 #[non_exhaustive]
13440 pub struct FieldElementType {
13441 /// Required. The type of a field element. See
13442 /// [ColumnSchema.type][google.cloud.datacatalog.v1.ColumnSchema.type].
13443 ///
13444 /// [google.cloud.datacatalog.v1.ColumnSchema.type]: crate::model::ColumnSchema::type
13445 pub r#type: std::string::String,
13446
13447 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13448 }
13449
13450 impl FieldElementType {
13451 pub fn new() -> Self {
13452 std::default::Default::default()
13453 }
13454
13455 /// Sets the value of [r#type][crate::model::column_schema::FieldElementType::type].
13456 ///
13457 /// # Example
13458 /// ```ignore,no_run
13459 /// # use google_cloud_datacatalog_v1::model::column_schema::FieldElementType;
13460 /// let x = FieldElementType::new().set_type("example");
13461 /// ```
13462 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13463 self.r#type = v.into();
13464 self
13465 }
13466 }
13467
13468 impl wkt::message::Message for FieldElementType {
13469 fn typename() -> &'static str {
13470 "type.googleapis.com/google.cloud.datacatalog.v1.ColumnSchema.FieldElementType"
13471 }
13472 }
13473
13474 /// Specifies inclusion of the column in an index
13475 ///
13476 /// # Working with unknown values
13477 ///
13478 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13479 /// additional enum variants at any time. Adding new variants is not considered
13480 /// a breaking change. Applications should write their code in anticipation of:
13481 ///
13482 /// - New values appearing in future releases of the client library, **and**
13483 /// - New values received dynamically, without application changes.
13484 ///
13485 /// Please consult the [Working with enums] section in the user guide for some
13486 /// guidelines.
13487 ///
13488 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13489 #[derive(Clone, Debug, PartialEq)]
13490 #[non_exhaustive]
13491 pub enum IndexingType {
13492 /// Unspecified.
13493 Unspecified,
13494 /// Column not a part of an index.
13495 None,
13496 /// Column Part of non unique index.
13497 NonUnique,
13498 /// Column part of unique index.
13499 Unique,
13500 /// Column part of the primary key.
13501 PrimaryKey,
13502 /// If set, the enum was initialized with an unknown value.
13503 ///
13504 /// Applications can examine the value using [IndexingType::value] or
13505 /// [IndexingType::name].
13506 UnknownValue(indexing_type::UnknownValue),
13507 }
13508
13509 #[doc(hidden)]
13510 pub mod indexing_type {
13511 #[allow(unused_imports)]
13512 use super::*;
13513 #[derive(Clone, Debug, PartialEq)]
13514 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13515 }
13516
13517 impl IndexingType {
13518 /// Gets the enum value.
13519 ///
13520 /// Returns `None` if the enum contains an unknown value deserialized from
13521 /// the string representation of enums.
13522 pub fn value(&self) -> std::option::Option<i32> {
13523 match self {
13524 Self::Unspecified => std::option::Option::Some(0),
13525 Self::None => std::option::Option::Some(1),
13526 Self::NonUnique => std::option::Option::Some(2),
13527 Self::Unique => std::option::Option::Some(3),
13528 Self::PrimaryKey => std::option::Option::Some(4),
13529 Self::UnknownValue(u) => u.0.value(),
13530 }
13531 }
13532
13533 /// Gets the enum value as a string.
13534 ///
13535 /// Returns `None` if the enum contains an unknown value deserialized from
13536 /// the integer representation of enums.
13537 pub fn name(&self) -> std::option::Option<&str> {
13538 match self {
13539 Self::Unspecified => std::option::Option::Some("INDEXING_TYPE_UNSPECIFIED"),
13540 Self::None => std::option::Option::Some("INDEXING_TYPE_NONE"),
13541 Self::NonUnique => std::option::Option::Some("INDEXING_TYPE_NON_UNIQUE"),
13542 Self::Unique => std::option::Option::Some("INDEXING_TYPE_UNIQUE"),
13543 Self::PrimaryKey => std::option::Option::Some("INDEXING_TYPE_PRIMARY_KEY"),
13544 Self::UnknownValue(u) => u.0.name(),
13545 }
13546 }
13547 }
13548
13549 impl std::default::Default for IndexingType {
13550 fn default() -> Self {
13551 use std::convert::From;
13552 Self::from(0)
13553 }
13554 }
13555
13556 impl std::fmt::Display for IndexingType {
13557 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13558 wkt::internal::display_enum(f, self.name(), self.value())
13559 }
13560 }
13561
13562 impl std::convert::From<i32> for IndexingType {
13563 fn from(value: i32) -> Self {
13564 match value {
13565 0 => Self::Unspecified,
13566 1 => Self::None,
13567 2 => Self::NonUnique,
13568 3 => Self::Unique,
13569 4 => Self::PrimaryKey,
13570 _ => Self::UnknownValue(indexing_type::UnknownValue(
13571 wkt::internal::UnknownEnumValue::Integer(value),
13572 )),
13573 }
13574 }
13575 }
13576
13577 impl std::convert::From<&str> for IndexingType {
13578 fn from(value: &str) -> Self {
13579 use std::string::ToString;
13580 match value {
13581 "INDEXING_TYPE_UNSPECIFIED" => Self::Unspecified,
13582 "INDEXING_TYPE_NONE" => Self::None,
13583 "INDEXING_TYPE_NON_UNIQUE" => Self::NonUnique,
13584 "INDEXING_TYPE_UNIQUE" => Self::Unique,
13585 "INDEXING_TYPE_PRIMARY_KEY" => Self::PrimaryKey,
13586 _ => Self::UnknownValue(indexing_type::UnknownValue(
13587 wkt::internal::UnknownEnumValue::String(value.to_string()),
13588 )),
13589 }
13590 }
13591 }
13592
13593 impl serde::ser::Serialize for IndexingType {
13594 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13595 where
13596 S: serde::Serializer,
13597 {
13598 match self {
13599 Self::Unspecified => serializer.serialize_i32(0),
13600 Self::None => serializer.serialize_i32(1),
13601 Self::NonUnique => serializer.serialize_i32(2),
13602 Self::Unique => serializer.serialize_i32(3),
13603 Self::PrimaryKey => serializer.serialize_i32(4),
13604 Self::UnknownValue(u) => u.0.serialize(serializer),
13605 }
13606 }
13607 }
13608
13609 impl<'de> serde::de::Deserialize<'de> for IndexingType {
13610 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13611 where
13612 D: serde::Deserializer<'de>,
13613 {
13614 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IndexingType>::new(
13615 ".google.cloud.datacatalog.v1.ColumnSchema.IndexingType",
13616 ))
13617 }
13618 }
13619
13620 /// Information only applying for columns in Entries from a specific system.
13621 #[derive(Clone, Debug, PartialEq)]
13622 #[non_exhaustive]
13623 pub enum SystemSpec {
13624 /// Looker specific column info of this column.
13625 LookerColumnSpec(std::boxed::Box<crate::model::column_schema::LookerColumnSpec>),
13626 }
13627}
13628
13629/// Result in the response to a search request.
13630///
13631/// Each result captures details of one entry that matches the search.
13632#[derive(Clone, Default, PartialEq)]
13633#[non_exhaustive]
13634pub struct SearchCatalogResult {
13635 /// Type of the search result.
13636 ///
13637 /// You can use this field to determine which get method to call to fetch the
13638 /// full resource.
13639 pub search_result_type: crate::model::SearchResultType,
13640
13641 /// Sub-type of the search result.
13642 ///
13643 /// A dot-delimited full type of the resource. The same type you
13644 /// specify in the `type` search predicate.
13645 ///
13646 /// Examples: `entry.table`, `entry.dataStream`, `tagTemplate`.
13647 pub search_result_subtype: std::string::String,
13648
13649 /// The relative name of the resource in URL format.
13650 ///
13651 /// Examples:
13652 ///
13653 /// * `projects/{PROJECT_ID}/locations/{LOCATION_ID}/entryGroups/{ENTRY_GROUP_ID}/entries/{ENTRY_ID}`
13654 /// * `projects/{PROJECT_ID}/tagTemplates/{TAG_TEMPLATE_ID}`
13655 pub relative_resource_name: std::string::String,
13656
13657 /// The full name of the Google Cloud resource the entry belongs to.
13658 ///
13659 /// For more information, see [Full Resource Name]
13660 /// (/apis/design/resource_names#full_resource_name).
13661 ///
13662 /// Example:
13663 ///
13664 /// `//bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID/tables/TABLE_ID`
13665 pub linked_resource: std::string::String,
13666
13667 /// The last modification timestamp of the entry in the source system.
13668 pub modify_time: std::option::Option<wkt::Timestamp>,
13669
13670 /// Fully qualified name (FQN) of the resource.
13671 ///
13672 /// FQNs take two forms:
13673 ///
13674 /// * For non-regionalized resources:
13675 ///
13676 /// `{SYSTEM}:{PROJECT}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}`
13677 ///
13678 /// * For regionalized resources:
13679 ///
13680 /// `{SYSTEM}:{PROJECT}.{LOCATION_ID}.{PATH_TO_RESOURCE_SEPARATED_WITH_DOTS}`
13681 ///
13682 ///
13683 /// Example for a DPMS table:
13684 ///
13685 /// `dataproc_metastore:PROJECT_ID.LOCATION_ID.INSTANCE_ID.DATABASE_ID.TABLE_ID`
13686 pub fully_qualified_name: std::string::String,
13687
13688 /// The display name of the result.
13689 pub display_name: std::string::String,
13690
13691 /// Entry description that can consist of several sentences or paragraphs that
13692 /// describe entry contents.
13693 pub description: std::string::String,
13694
13695 /// The source system of the entry. Applicable only when the
13696 /// `search_result_type` is `ENTRY`.
13697 pub system: std::option::Option<crate::model::search_catalog_result::System>,
13698
13699 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13700}
13701
13702impl SearchCatalogResult {
13703 pub fn new() -> Self {
13704 std::default::Default::default()
13705 }
13706
13707 /// Sets the value of [search_result_type][crate::model::SearchCatalogResult::search_result_type].
13708 ///
13709 /// # Example
13710 /// ```ignore,no_run
13711 /// # use google_cloud_datacatalog_v1::model::SearchCatalogResult;
13712 /// use google_cloud_datacatalog_v1::model::SearchResultType;
13713 /// let x0 = SearchCatalogResult::new().set_search_result_type(SearchResultType::Entry);
13714 /// let x1 = SearchCatalogResult::new().set_search_result_type(SearchResultType::TagTemplate);
13715 /// let x2 = SearchCatalogResult::new().set_search_result_type(SearchResultType::EntryGroup);
13716 /// ```
13717 pub fn set_search_result_type<T: std::convert::Into<crate::model::SearchResultType>>(
13718 mut self,
13719 v: T,
13720 ) -> Self {
13721 self.search_result_type = v.into();
13722 self
13723 }
13724
13725 /// Sets the value of [search_result_subtype][crate::model::SearchCatalogResult::search_result_subtype].
13726 ///
13727 /// # Example
13728 /// ```ignore,no_run
13729 /// # use google_cloud_datacatalog_v1::model::SearchCatalogResult;
13730 /// let x = SearchCatalogResult::new().set_search_result_subtype("example");
13731 /// ```
13732 pub fn set_search_result_subtype<T: std::convert::Into<std::string::String>>(
13733 mut self,
13734 v: T,
13735 ) -> Self {
13736 self.search_result_subtype = v.into();
13737 self
13738 }
13739
13740 /// Sets the value of [relative_resource_name][crate::model::SearchCatalogResult::relative_resource_name].
13741 ///
13742 /// # Example
13743 /// ```ignore,no_run
13744 /// # use google_cloud_datacatalog_v1::model::SearchCatalogResult;
13745 /// let x = SearchCatalogResult::new().set_relative_resource_name("example");
13746 /// ```
13747 pub fn set_relative_resource_name<T: std::convert::Into<std::string::String>>(
13748 mut self,
13749 v: T,
13750 ) -> Self {
13751 self.relative_resource_name = v.into();
13752 self
13753 }
13754
13755 /// Sets the value of [linked_resource][crate::model::SearchCatalogResult::linked_resource].
13756 ///
13757 /// # Example
13758 /// ```ignore,no_run
13759 /// # use google_cloud_datacatalog_v1::model::SearchCatalogResult;
13760 /// let x = SearchCatalogResult::new().set_linked_resource("example");
13761 /// ```
13762 pub fn set_linked_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13763 self.linked_resource = v.into();
13764 self
13765 }
13766
13767 /// Sets the value of [modify_time][crate::model::SearchCatalogResult::modify_time].
13768 ///
13769 /// # Example
13770 /// ```ignore,no_run
13771 /// # use google_cloud_datacatalog_v1::model::SearchCatalogResult;
13772 /// use wkt::Timestamp;
13773 /// let x = SearchCatalogResult::new().set_modify_time(Timestamp::default()/* use setters */);
13774 /// ```
13775 pub fn set_modify_time<T>(mut self, v: T) -> Self
13776 where
13777 T: std::convert::Into<wkt::Timestamp>,
13778 {
13779 self.modify_time = std::option::Option::Some(v.into());
13780 self
13781 }
13782
13783 /// Sets or clears the value of [modify_time][crate::model::SearchCatalogResult::modify_time].
13784 ///
13785 /// # Example
13786 /// ```ignore,no_run
13787 /// # use google_cloud_datacatalog_v1::model::SearchCatalogResult;
13788 /// use wkt::Timestamp;
13789 /// let x = SearchCatalogResult::new().set_or_clear_modify_time(Some(Timestamp::default()/* use setters */));
13790 /// let x = SearchCatalogResult::new().set_or_clear_modify_time(None::<Timestamp>);
13791 /// ```
13792 pub fn set_or_clear_modify_time<T>(mut self, v: std::option::Option<T>) -> Self
13793 where
13794 T: std::convert::Into<wkt::Timestamp>,
13795 {
13796 self.modify_time = v.map(|x| x.into());
13797 self
13798 }
13799
13800 /// Sets the value of [fully_qualified_name][crate::model::SearchCatalogResult::fully_qualified_name].
13801 ///
13802 /// # Example
13803 /// ```ignore,no_run
13804 /// # use google_cloud_datacatalog_v1::model::SearchCatalogResult;
13805 /// let x = SearchCatalogResult::new().set_fully_qualified_name("example");
13806 /// ```
13807 pub fn set_fully_qualified_name<T: std::convert::Into<std::string::String>>(
13808 mut self,
13809 v: T,
13810 ) -> Self {
13811 self.fully_qualified_name = v.into();
13812 self
13813 }
13814
13815 /// Sets the value of [display_name][crate::model::SearchCatalogResult::display_name].
13816 ///
13817 /// # Example
13818 /// ```ignore,no_run
13819 /// # use google_cloud_datacatalog_v1::model::SearchCatalogResult;
13820 /// let x = SearchCatalogResult::new().set_display_name("example");
13821 /// ```
13822 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13823 self.display_name = v.into();
13824 self
13825 }
13826
13827 /// Sets the value of [description][crate::model::SearchCatalogResult::description].
13828 ///
13829 /// # Example
13830 /// ```ignore,no_run
13831 /// # use google_cloud_datacatalog_v1::model::SearchCatalogResult;
13832 /// let x = SearchCatalogResult::new().set_description("example");
13833 /// ```
13834 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13835 self.description = v.into();
13836 self
13837 }
13838
13839 /// Sets the value of [system][crate::model::SearchCatalogResult::system].
13840 ///
13841 /// Note that all the setters affecting `system` are mutually
13842 /// exclusive.
13843 ///
13844 /// # Example
13845 /// ```ignore,no_run
13846 /// # use google_cloud_datacatalog_v1::model::SearchCatalogResult;
13847 /// use google_cloud_datacatalog_v1::model::IntegratedSystem;
13848 /// let x0 = SearchCatalogResult::new().set_system(Some(
13849 /// google_cloud_datacatalog_v1::model::search_catalog_result::System::IntegratedSystem(IntegratedSystem::Bigquery)));
13850 /// let x1 = SearchCatalogResult::new().set_system(Some(
13851 /// google_cloud_datacatalog_v1::model::search_catalog_result::System::IntegratedSystem(IntegratedSystem::CloudPubsub)));
13852 /// let x2 = SearchCatalogResult::new().set_system(Some(
13853 /// google_cloud_datacatalog_v1::model::search_catalog_result::System::IntegratedSystem(IntegratedSystem::DataprocMetastore)));
13854 /// ```
13855 pub fn set_system<
13856 T: std::convert::Into<std::option::Option<crate::model::search_catalog_result::System>>,
13857 >(
13858 mut self,
13859 v: T,
13860 ) -> Self {
13861 self.system = v.into();
13862 self
13863 }
13864
13865 /// The value of [system][crate::model::SearchCatalogResult::system]
13866 /// if it holds a `IntegratedSystem`, `None` if the field is not set or
13867 /// holds a different branch.
13868 pub fn integrated_system(&self) -> std::option::Option<&crate::model::IntegratedSystem> {
13869 #[allow(unreachable_patterns)]
13870 self.system.as_ref().and_then(|v| match v {
13871 crate::model::search_catalog_result::System::IntegratedSystem(v) => {
13872 std::option::Option::Some(v)
13873 }
13874 _ => std::option::Option::None,
13875 })
13876 }
13877
13878 /// Sets the value of [system][crate::model::SearchCatalogResult::system]
13879 /// to hold a `IntegratedSystem`.
13880 ///
13881 /// Note that all the setters affecting `system` are
13882 /// mutually exclusive.
13883 ///
13884 /// # Example
13885 /// ```ignore,no_run
13886 /// # use google_cloud_datacatalog_v1::model::SearchCatalogResult;
13887 /// use google_cloud_datacatalog_v1::model::IntegratedSystem;
13888 /// let x0 = SearchCatalogResult::new().set_integrated_system(IntegratedSystem::Bigquery);
13889 /// let x1 = SearchCatalogResult::new().set_integrated_system(IntegratedSystem::CloudPubsub);
13890 /// let x2 = SearchCatalogResult::new().set_integrated_system(IntegratedSystem::DataprocMetastore);
13891 /// assert!(x0.integrated_system().is_some());
13892 /// assert!(x0.user_specified_system().is_none());
13893 /// assert!(x1.integrated_system().is_some());
13894 /// assert!(x1.user_specified_system().is_none());
13895 /// assert!(x2.integrated_system().is_some());
13896 /// assert!(x2.user_specified_system().is_none());
13897 /// ```
13898 pub fn set_integrated_system<T: std::convert::Into<crate::model::IntegratedSystem>>(
13899 mut self,
13900 v: T,
13901 ) -> Self {
13902 self.system = std::option::Option::Some(
13903 crate::model::search_catalog_result::System::IntegratedSystem(v.into()),
13904 );
13905 self
13906 }
13907
13908 /// The value of [system][crate::model::SearchCatalogResult::system]
13909 /// if it holds a `UserSpecifiedSystem`, `None` if the field is not set or
13910 /// holds a different branch.
13911 pub fn user_specified_system(&self) -> std::option::Option<&std::string::String> {
13912 #[allow(unreachable_patterns)]
13913 self.system.as_ref().and_then(|v| match v {
13914 crate::model::search_catalog_result::System::UserSpecifiedSystem(v) => {
13915 std::option::Option::Some(v)
13916 }
13917 _ => std::option::Option::None,
13918 })
13919 }
13920
13921 /// Sets the value of [system][crate::model::SearchCatalogResult::system]
13922 /// to hold a `UserSpecifiedSystem`.
13923 ///
13924 /// Note that all the setters affecting `system` are
13925 /// mutually exclusive.
13926 ///
13927 /// # Example
13928 /// ```ignore,no_run
13929 /// # use google_cloud_datacatalog_v1::model::SearchCatalogResult;
13930 /// let x = SearchCatalogResult::new().set_user_specified_system("example");
13931 /// assert!(x.user_specified_system().is_some());
13932 /// assert!(x.integrated_system().is_none());
13933 /// ```
13934 pub fn set_user_specified_system<T: std::convert::Into<std::string::String>>(
13935 mut self,
13936 v: T,
13937 ) -> Self {
13938 self.system = std::option::Option::Some(
13939 crate::model::search_catalog_result::System::UserSpecifiedSystem(v.into()),
13940 );
13941 self
13942 }
13943}
13944
13945impl wkt::message::Message for SearchCatalogResult {
13946 fn typename() -> &'static str {
13947 "type.googleapis.com/google.cloud.datacatalog.v1.SearchCatalogResult"
13948 }
13949}
13950
13951/// Defines additional types related to [SearchCatalogResult].
13952pub mod search_catalog_result {
13953 #[allow(unused_imports)]
13954 use super::*;
13955
13956 /// The source system of the entry. Applicable only when the
13957 /// `search_result_type` is `ENTRY`.
13958 #[derive(Clone, Debug, PartialEq)]
13959 #[non_exhaustive]
13960 pub enum System {
13961 /// Output only. The source system that Data Catalog automatically integrates
13962 /// with, such as BigQuery, Cloud Pub/Sub, or Dataproc Metastore.
13963 IntegratedSystem(crate::model::IntegratedSystem),
13964 /// Custom source system that you can manually integrate Data Catalog with.
13965 UserSpecifiedSystem(std::string::String),
13966 }
13967}
13968
13969/// Describes a BigQuery table.
13970#[derive(Clone, Default, PartialEq)]
13971#[non_exhaustive]
13972pub struct BigQueryTableSpec {
13973 /// Output only. The table source type.
13974 pub table_source_type: crate::model::TableSourceType,
13975
13976 /// Output only.
13977 pub type_spec: std::option::Option<crate::model::big_query_table_spec::TypeSpec>,
13978
13979 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13980}
13981
13982impl BigQueryTableSpec {
13983 pub fn new() -> Self {
13984 std::default::Default::default()
13985 }
13986
13987 /// Sets the value of [table_source_type][crate::model::BigQueryTableSpec::table_source_type].
13988 ///
13989 /// # Example
13990 /// ```ignore,no_run
13991 /// # use google_cloud_datacatalog_v1::model::BigQueryTableSpec;
13992 /// use google_cloud_datacatalog_v1::model::TableSourceType;
13993 /// let x0 = BigQueryTableSpec::new().set_table_source_type(TableSourceType::BigqueryView);
13994 /// let x1 = BigQueryTableSpec::new().set_table_source_type(TableSourceType::BigqueryTable);
13995 /// let x2 = BigQueryTableSpec::new().set_table_source_type(TableSourceType::BigqueryMaterializedView);
13996 /// ```
13997 pub fn set_table_source_type<T: std::convert::Into<crate::model::TableSourceType>>(
13998 mut self,
13999 v: T,
14000 ) -> Self {
14001 self.table_source_type = v.into();
14002 self
14003 }
14004
14005 /// Sets the value of [type_spec][crate::model::BigQueryTableSpec::type_spec].
14006 ///
14007 /// Note that all the setters affecting `type_spec` are mutually
14008 /// exclusive.
14009 ///
14010 /// # Example
14011 /// ```ignore,no_run
14012 /// # use google_cloud_datacatalog_v1::model::BigQueryTableSpec;
14013 /// use google_cloud_datacatalog_v1::model::ViewSpec;
14014 /// let x = BigQueryTableSpec::new().set_type_spec(Some(
14015 /// google_cloud_datacatalog_v1::model::big_query_table_spec::TypeSpec::ViewSpec(ViewSpec::default().into())));
14016 /// ```
14017 pub fn set_type_spec<
14018 T: std::convert::Into<std::option::Option<crate::model::big_query_table_spec::TypeSpec>>,
14019 >(
14020 mut self,
14021 v: T,
14022 ) -> Self {
14023 self.type_spec = v.into();
14024 self
14025 }
14026
14027 /// The value of [type_spec][crate::model::BigQueryTableSpec::type_spec]
14028 /// if it holds a `ViewSpec`, `None` if the field is not set or
14029 /// holds a different branch.
14030 pub fn view_spec(&self) -> std::option::Option<&std::boxed::Box<crate::model::ViewSpec>> {
14031 #[allow(unreachable_patterns)]
14032 self.type_spec.as_ref().and_then(|v| match v {
14033 crate::model::big_query_table_spec::TypeSpec::ViewSpec(v) => {
14034 std::option::Option::Some(v)
14035 }
14036 _ => std::option::Option::None,
14037 })
14038 }
14039
14040 /// Sets the value of [type_spec][crate::model::BigQueryTableSpec::type_spec]
14041 /// to hold a `ViewSpec`.
14042 ///
14043 /// Note that all the setters affecting `type_spec` are
14044 /// mutually exclusive.
14045 ///
14046 /// # Example
14047 /// ```ignore,no_run
14048 /// # use google_cloud_datacatalog_v1::model::BigQueryTableSpec;
14049 /// use google_cloud_datacatalog_v1::model::ViewSpec;
14050 /// let x = BigQueryTableSpec::new().set_view_spec(ViewSpec::default()/* use setters */);
14051 /// assert!(x.view_spec().is_some());
14052 /// assert!(x.table_spec().is_none());
14053 /// ```
14054 pub fn set_view_spec<T: std::convert::Into<std::boxed::Box<crate::model::ViewSpec>>>(
14055 mut self,
14056 v: T,
14057 ) -> Self {
14058 self.type_spec = std::option::Option::Some(
14059 crate::model::big_query_table_spec::TypeSpec::ViewSpec(v.into()),
14060 );
14061 self
14062 }
14063
14064 /// The value of [type_spec][crate::model::BigQueryTableSpec::type_spec]
14065 /// if it holds a `TableSpec`, `None` if the field is not set or
14066 /// holds a different branch.
14067 pub fn table_spec(&self) -> std::option::Option<&std::boxed::Box<crate::model::TableSpec>> {
14068 #[allow(unreachable_patterns)]
14069 self.type_spec.as_ref().and_then(|v| match v {
14070 crate::model::big_query_table_spec::TypeSpec::TableSpec(v) => {
14071 std::option::Option::Some(v)
14072 }
14073 _ => std::option::Option::None,
14074 })
14075 }
14076
14077 /// Sets the value of [type_spec][crate::model::BigQueryTableSpec::type_spec]
14078 /// to hold a `TableSpec`.
14079 ///
14080 /// Note that all the setters affecting `type_spec` are
14081 /// mutually exclusive.
14082 ///
14083 /// # Example
14084 /// ```ignore,no_run
14085 /// # use google_cloud_datacatalog_v1::model::BigQueryTableSpec;
14086 /// use google_cloud_datacatalog_v1::model::TableSpec;
14087 /// let x = BigQueryTableSpec::new().set_table_spec(TableSpec::default()/* use setters */);
14088 /// assert!(x.table_spec().is_some());
14089 /// assert!(x.view_spec().is_none());
14090 /// ```
14091 pub fn set_table_spec<T: std::convert::Into<std::boxed::Box<crate::model::TableSpec>>>(
14092 mut self,
14093 v: T,
14094 ) -> Self {
14095 self.type_spec = std::option::Option::Some(
14096 crate::model::big_query_table_spec::TypeSpec::TableSpec(v.into()),
14097 );
14098 self
14099 }
14100}
14101
14102impl wkt::message::Message for BigQueryTableSpec {
14103 fn typename() -> &'static str {
14104 "type.googleapis.com/google.cloud.datacatalog.v1.BigQueryTableSpec"
14105 }
14106}
14107
14108/// Defines additional types related to [BigQueryTableSpec].
14109pub mod big_query_table_spec {
14110 #[allow(unused_imports)]
14111 use super::*;
14112
14113 /// Output only.
14114 #[derive(Clone, Debug, PartialEq)]
14115 #[non_exhaustive]
14116 pub enum TypeSpec {
14117 /// Table view specification. Populated only if
14118 /// the `table_source_type` is `BIGQUERY_VIEW`.
14119 ViewSpec(std::boxed::Box<crate::model::ViewSpec>),
14120 /// Specification of a BigQuery table. Populated only if
14121 /// the `table_source_type` is `BIGQUERY_TABLE`.
14122 TableSpec(std::boxed::Box<crate::model::TableSpec>),
14123 }
14124}
14125
14126/// Table view specification.
14127#[derive(Clone, Default, PartialEq)]
14128#[non_exhaustive]
14129pub struct ViewSpec {
14130 /// Output only. The query that defines the table view.
14131 pub view_query: std::string::String,
14132
14133 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14134}
14135
14136impl ViewSpec {
14137 pub fn new() -> Self {
14138 std::default::Default::default()
14139 }
14140
14141 /// Sets the value of [view_query][crate::model::ViewSpec::view_query].
14142 ///
14143 /// # Example
14144 /// ```ignore,no_run
14145 /// # use google_cloud_datacatalog_v1::model::ViewSpec;
14146 /// let x = ViewSpec::new().set_view_query("example");
14147 /// ```
14148 pub fn set_view_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14149 self.view_query = v.into();
14150 self
14151 }
14152}
14153
14154impl wkt::message::Message for ViewSpec {
14155 fn typename() -> &'static str {
14156 "type.googleapis.com/google.cloud.datacatalog.v1.ViewSpec"
14157 }
14158}
14159
14160/// Normal BigQuery table specification.
14161#[derive(Clone, Default, PartialEq)]
14162#[non_exhaustive]
14163pub struct TableSpec {
14164 /// Output only. If the table is date-sharded, that is, it matches the
14165 /// `[prefix]YYYYMMDD` name pattern, this field is the Data Catalog resource
14166 /// name of the date-sharded grouped entry. For example:
14167 ///
14168 /// `projects/{PROJECT_ID}/locations/{LOCATION}/entrygroups/{ENTRY_GROUP_ID}/entries/{ENTRY_ID}`.
14169 ///
14170 /// Otherwise, `grouped_entry` is empty.
14171 pub grouped_entry: std::string::String,
14172
14173 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14174}
14175
14176impl TableSpec {
14177 pub fn new() -> Self {
14178 std::default::Default::default()
14179 }
14180
14181 /// Sets the value of [grouped_entry][crate::model::TableSpec::grouped_entry].
14182 ///
14183 /// # Example
14184 /// ```ignore,no_run
14185 /// # use google_cloud_datacatalog_v1::model::TableSpec;
14186 /// let x = TableSpec::new().set_grouped_entry("example");
14187 /// ```
14188 pub fn set_grouped_entry<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14189 self.grouped_entry = v.into();
14190 self
14191 }
14192}
14193
14194impl wkt::message::Message for TableSpec {
14195 fn typename() -> &'static str {
14196 "type.googleapis.com/google.cloud.datacatalog.v1.TableSpec"
14197 }
14198}
14199
14200/// Specification for a group of BigQuery tables with the `[prefix]YYYYMMDD` name
14201/// pattern.
14202///
14203/// For more information, see [Introduction to partitioned tables]
14204/// (<https://cloud.google.com/bigquery/docs/partitioned-tables#partitioning_versus_sharding>).
14205#[derive(Clone, Default, PartialEq)]
14206#[non_exhaustive]
14207pub struct BigQueryDateShardedSpec {
14208 /// Output only. The Data Catalog resource name of the dataset entry the
14209 /// current table belongs to. For example:
14210 ///
14211 /// `projects/{PROJECT_ID}/locations/{LOCATION}/entrygroups/{ENTRY_GROUP_ID}/entries/{ENTRY_ID}`.
14212 pub dataset: std::string::String,
14213
14214 /// Output only. The table name prefix of the shards.
14215 ///
14216 /// The name of any given shard is `[table_prefix]YYYYMMDD`.
14217 /// For example, for the `MyTable20180101` shard, the
14218 /// `table_prefix` is `MyTable`.
14219 pub table_prefix: std::string::String,
14220
14221 /// Output only. Total number of shards.
14222 pub shard_count: i64,
14223
14224 /// Output only. BigQuery resource name of the latest shard.
14225 pub latest_shard_resource: std::string::String,
14226
14227 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14228}
14229
14230impl BigQueryDateShardedSpec {
14231 pub fn new() -> Self {
14232 std::default::Default::default()
14233 }
14234
14235 /// Sets the value of [dataset][crate::model::BigQueryDateShardedSpec::dataset].
14236 ///
14237 /// # Example
14238 /// ```ignore,no_run
14239 /// # use google_cloud_datacatalog_v1::model::BigQueryDateShardedSpec;
14240 /// let x = BigQueryDateShardedSpec::new().set_dataset("example");
14241 /// ```
14242 pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14243 self.dataset = v.into();
14244 self
14245 }
14246
14247 /// Sets the value of [table_prefix][crate::model::BigQueryDateShardedSpec::table_prefix].
14248 ///
14249 /// # Example
14250 /// ```ignore,no_run
14251 /// # use google_cloud_datacatalog_v1::model::BigQueryDateShardedSpec;
14252 /// let x = BigQueryDateShardedSpec::new().set_table_prefix("example");
14253 /// ```
14254 pub fn set_table_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14255 self.table_prefix = v.into();
14256 self
14257 }
14258
14259 /// Sets the value of [shard_count][crate::model::BigQueryDateShardedSpec::shard_count].
14260 ///
14261 /// # Example
14262 /// ```ignore,no_run
14263 /// # use google_cloud_datacatalog_v1::model::BigQueryDateShardedSpec;
14264 /// let x = BigQueryDateShardedSpec::new().set_shard_count(42);
14265 /// ```
14266 pub fn set_shard_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14267 self.shard_count = v.into();
14268 self
14269 }
14270
14271 /// Sets the value of [latest_shard_resource][crate::model::BigQueryDateShardedSpec::latest_shard_resource].
14272 ///
14273 /// # Example
14274 /// ```ignore,no_run
14275 /// # use google_cloud_datacatalog_v1::model::BigQueryDateShardedSpec;
14276 /// let x = BigQueryDateShardedSpec::new().set_latest_shard_resource("example");
14277 /// ```
14278 pub fn set_latest_shard_resource<T: std::convert::Into<std::string::String>>(
14279 mut self,
14280 v: T,
14281 ) -> Self {
14282 self.latest_shard_resource = v.into();
14283 self
14284 }
14285}
14286
14287impl wkt::message::Message for BigQueryDateShardedSpec {
14288 fn typename() -> &'static str {
14289 "type.googleapis.com/google.cloud.datacatalog.v1.BigQueryDateShardedSpec"
14290 }
14291}
14292
14293/// Tags contain custom metadata and are attached to Data Catalog resources. Tags
14294/// conform with the specification of their tag template.
14295///
14296/// See [Data Catalog
14297/// IAM](https://cloud.google.com/data-catalog/docs/concepts/iam) for information
14298/// on the permissions needed to create or view tags.
14299#[derive(Clone, Default, PartialEq)]
14300#[non_exhaustive]
14301pub struct Tag {
14302 /// Identifier. The resource name of the tag in URL format where tag ID is a
14303 /// system-generated identifier.
14304 ///
14305 /// Note: The tag itself might not be stored in the location specified in its
14306 /// name.
14307 pub name: std::string::String,
14308
14309 /// Required. The resource name of the tag template this tag uses. Example:
14310 ///
14311 /// `projects/{PROJECT_ID}/locations/{LOCATION}/tagTemplates/{TAG_TEMPLATE_ID}`
14312 ///
14313 /// This field cannot be modified after creation.
14314 pub template: std::string::String,
14315
14316 /// Output only. The display name of the tag template.
14317 pub template_display_name: std::string::String,
14318
14319 /// Required. Maps the ID of a tag field to its value and additional
14320 /// information about that field.
14321 ///
14322 /// Tag template defines valid field IDs. A tag
14323 /// must have at least 1 field and at most 500 fields.
14324 pub fields: std::collections::HashMap<std::string::String, crate::model::TagField>,
14325
14326 /// Output only. Denotes the transfer status of the Tag Template.
14327 pub dataplex_transfer_status: crate::model::tag_template::DataplexTransferStatus,
14328
14329 /// The scope within the parent resource that this tag is attached to. If not
14330 /// provided, the tag is attached to the parent resource itself.
14331 ///
14332 /// Deleting the scope from the parent resource deletes all tags attached
14333 /// to that scope.
14334 ///
14335 /// These fields cannot be updated after creation.
14336 pub scope: std::option::Option<crate::model::tag::Scope>,
14337
14338 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14339}
14340
14341impl Tag {
14342 pub fn new() -> Self {
14343 std::default::Default::default()
14344 }
14345
14346 /// Sets the value of [name][crate::model::Tag::name].
14347 ///
14348 /// # Example
14349 /// ```ignore,no_run
14350 /// # use google_cloud_datacatalog_v1::model::Tag;
14351 /// let x = Tag::new().set_name("example");
14352 /// ```
14353 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14354 self.name = v.into();
14355 self
14356 }
14357
14358 /// Sets the value of [template][crate::model::Tag::template].
14359 ///
14360 /// # Example
14361 /// ```ignore,no_run
14362 /// # use google_cloud_datacatalog_v1::model::Tag;
14363 /// let x = Tag::new().set_template("example");
14364 /// ```
14365 pub fn set_template<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14366 self.template = v.into();
14367 self
14368 }
14369
14370 /// Sets the value of [template_display_name][crate::model::Tag::template_display_name].
14371 ///
14372 /// # Example
14373 /// ```ignore,no_run
14374 /// # use google_cloud_datacatalog_v1::model::Tag;
14375 /// let x = Tag::new().set_template_display_name("example");
14376 /// ```
14377 pub fn set_template_display_name<T: std::convert::Into<std::string::String>>(
14378 mut self,
14379 v: T,
14380 ) -> Self {
14381 self.template_display_name = v.into();
14382 self
14383 }
14384
14385 /// Sets the value of [fields][crate::model::Tag::fields].
14386 ///
14387 /// # Example
14388 /// ```ignore,no_run
14389 /// # use google_cloud_datacatalog_v1::model::Tag;
14390 /// use google_cloud_datacatalog_v1::model::TagField;
14391 /// let x = Tag::new().set_fields([
14392 /// ("key0", TagField::default()/* use setters */),
14393 /// ("key1", TagField::default()/* use (different) setters */),
14394 /// ]);
14395 /// ```
14396 pub fn set_fields<T, K, V>(mut self, v: T) -> Self
14397 where
14398 T: std::iter::IntoIterator<Item = (K, V)>,
14399 K: std::convert::Into<std::string::String>,
14400 V: std::convert::Into<crate::model::TagField>,
14401 {
14402 use std::iter::Iterator;
14403 self.fields = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14404 self
14405 }
14406
14407 /// Sets the value of [dataplex_transfer_status][crate::model::Tag::dataplex_transfer_status].
14408 ///
14409 /// # Example
14410 /// ```ignore,no_run
14411 /// # use google_cloud_datacatalog_v1::model::Tag;
14412 /// use google_cloud_datacatalog_v1::model::tag_template::DataplexTransferStatus;
14413 /// let x0 = Tag::new().set_dataplex_transfer_status(DataplexTransferStatus::Transferred);
14414 /// ```
14415 pub fn set_dataplex_transfer_status<
14416 T: std::convert::Into<crate::model::tag_template::DataplexTransferStatus>,
14417 >(
14418 mut self,
14419 v: T,
14420 ) -> Self {
14421 self.dataplex_transfer_status = v.into();
14422 self
14423 }
14424
14425 /// Sets the value of [scope][crate::model::Tag::scope].
14426 ///
14427 /// Note that all the setters affecting `scope` are mutually
14428 /// exclusive.
14429 ///
14430 /// # Example
14431 /// ```ignore,no_run
14432 /// # use google_cloud_datacatalog_v1::model::Tag;
14433 /// use google_cloud_datacatalog_v1::model::tag::Scope;
14434 /// let x = Tag::new().set_scope(Some(Scope::Column("example".to_string())));
14435 /// ```
14436 pub fn set_scope<T: std::convert::Into<std::option::Option<crate::model::tag::Scope>>>(
14437 mut self,
14438 v: T,
14439 ) -> Self {
14440 self.scope = v.into();
14441 self
14442 }
14443
14444 /// The value of [scope][crate::model::Tag::scope]
14445 /// if it holds a `Column`, `None` if the field is not set or
14446 /// holds a different branch.
14447 pub fn column(&self) -> std::option::Option<&std::string::String> {
14448 #[allow(unreachable_patterns)]
14449 self.scope.as_ref().and_then(|v| match v {
14450 crate::model::tag::Scope::Column(v) => std::option::Option::Some(v),
14451 _ => std::option::Option::None,
14452 })
14453 }
14454
14455 /// Sets the value of [scope][crate::model::Tag::scope]
14456 /// to hold a `Column`.
14457 ///
14458 /// Note that all the setters affecting `scope` are
14459 /// mutually exclusive.
14460 ///
14461 /// # Example
14462 /// ```ignore,no_run
14463 /// # use google_cloud_datacatalog_v1::model::Tag;
14464 /// let x = Tag::new().set_column("example");
14465 /// assert!(x.column().is_some());
14466 /// ```
14467 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14468 self.scope = std::option::Option::Some(crate::model::tag::Scope::Column(v.into()));
14469 self
14470 }
14471}
14472
14473impl wkt::message::Message for Tag {
14474 fn typename() -> &'static str {
14475 "type.googleapis.com/google.cloud.datacatalog.v1.Tag"
14476 }
14477}
14478
14479/// Defines additional types related to [Tag].
14480pub mod tag {
14481 #[allow(unused_imports)]
14482 use super::*;
14483
14484 /// The scope within the parent resource that this tag is attached to. If not
14485 /// provided, the tag is attached to the parent resource itself.
14486 ///
14487 /// Deleting the scope from the parent resource deletes all tags attached
14488 /// to that scope.
14489 ///
14490 /// These fields cannot be updated after creation.
14491 #[derive(Clone, Debug, PartialEq)]
14492 #[non_exhaustive]
14493 pub enum Scope {
14494 /// Resources like entry can have schemas associated with them. This scope
14495 /// allows you to attach tags to an individual column based on that schema.
14496 ///
14497 /// To attach a tag to a nested column, separate column names with a dot
14498 /// (`.`). Example: `column.nested_column`.
14499 Column(std::string::String),
14500 }
14501}
14502
14503/// Contains the value and additional information on a field within
14504/// a [Tag][google.cloud.datacatalog.v1.Tag].
14505///
14506/// [google.cloud.datacatalog.v1.Tag]: crate::model::Tag
14507#[derive(Clone, Default, PartialEq)]
14508#[non_exhaustive]
14509pub struct TagField {
14510 /// Output only. The display name of this field.
14511 pub display_name: std::string::String,
14512
14513 /// Output only. The order of this field with respect to other fields in this
14514 /// tag. Can be set by
14515 /// [Tag][google.cloud.datacatalog.v1.TagTemplateField.order].
14516 ///
14517 /// For example, a higher value can indicate a more important field.
14518 /// The value can be negative. Multiple fields can have the same order, and
14519 /// field orders within a tag don't have to be sequential.
14520 ///
14521 /// [google.cloud.datacatalog.v1.TagTemplateField.order]: crate::model::TagTemplateField::order
14522 pub order: i32,
14523
14524 /// Required. The value of this field.
14525 pub kind: std::option::Option<crate::model::tag_field::Kind>,
14526
14527 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14528}
14529
14530impl TagField {
14531 pub fn new() -> Self {
14532 std::default::Default::default()
14533 }
14534
14535 /// Sets the value of [display_name][crate::model::TagField::display_name].
14536 ///
14537 /// # Example
14538 /// ```ignore,no_run
14539 /// # use google_cloud_datacatalog_v1::model::TagField;
14540 /// let x = TagField::new().set_display_name("example");
14541 /// ```
14542 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14543 self.display_name = v.into();
14544 self
14545 }
14546
14547 /// Sets the value of [order][crate::model::TagField::order].
14548 ///
14549 /// # Example
14550 /// ```ignore,no_run
14551 /// # use google_cloud_datacatalog_v1::model::TagField;
14552 /// let x = TagField::new().set_order(42);
14553 /// ```
14554 pub fn set_order<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14555 self.order = v.into();
14556 self
14557 }
14558
14559 /// Sets the value of [kind][crate::model::TagField::kind].
14560 ///
14561 /// Note that all the setters affecting `kind` are mutually
14562 /// exclusive.
14563 ///
14564 /// # Example
14565 /// ```ignore,no_run
14566 /// # use google_cloud_datacatalog_v1::model::TagField;
14567 /// use google_cloud_datacatalog_v1::model::tag_field::Kind;
14568 /// let x = TagField::new().set_kind(Some(Kind::DoubleValue(42.0)));
14569 /// ```
14570 pub fn set_kind<T: std::convert::Into<std::option::Option<crate::model::tag_field::Kind>>>(
14571 mut self,
14572 v: T,
14573 ) -> Self {
14574 self.kind = v.into();
14575 self
14576 }
14577
14578 /// The value of [kind][crate::model::TagField::kind]
14579 /// if it holds a `DoubleValue`, `None` if the field is not set or
14580 /// holds a different branch.
14581 pub fn double_value(&self) -> std::option::Option<&f64> {
14582 #[allow(unreachable_patterns)]
14583 self.kind.as_ref().and_then(|v| match v {
14584 crate::model::tag_field::Kind::DoubleValue(v) => std::option::Option::Some(v),
14585 _ => std::option::Option::None,
14586 })
14587 }
14588
14589 /// Sets the value of [kind][crate::model::TagField::kind]
14590 /// to hold a `DoubleValue`.
14591 ///
14592 /// Note that all the setters affecting `kind` are
14593 /// mutually exclusive.
14594 ///
14595 /// # Example
14596 /// ```ignore,no_run
14597 /// # use google_cloud_datacatalog_v1::model::TagField;
14598 /// let x = TagField::new().set_double_value(42.0);
14599 /// assert!(x.double_value().is_some());
14600 /// assert!(x.string_value().is_none());
14601 /// assert!(x.bool_value().is_none());
14602 /// assert!(x.timestamp_value().is_none());
14603 /// assert!(x.enum_value().is_none());
14604 /// assert!(x.richtext_value().is_none());
14605 /// ```
14606 pub fn set_double_value<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
14607 self.kind = std::option::Option::Some(crate::model::tag_field::Kind::DoubleValue(v.into()));
14608 self
14609 }
14610
14611 /// The value of [kind][crate::model::TagField::kind]
14612 /// if it holds a `StringValue`, `None` if the field is not set or
14613 /// holds a different branch.
14614 pub fn string_value(&self) -> std::option::Option<&std::string::String> {
14615 #[allow(unreachable_patterns)]
14616 self.kind.as_ref().and_then(|v| match v {
14617 crate::model::tag_field::Kind::StringValue(v) => std::option::Option::Some(v),
14618 _ => std::option::Option::None,
14619 })
14620 }
14621
14622 /// Sets the value of [kind][crate::model::TagField::kind]
14623 /// to hold a `StringValue`.
14624 ///
14625 /// Note that all the setters affecting `kind` are
14626 /// mutually exclusive.
14627 ///
14628 /// # Example
14629 /// ```ignore,no_run
14630 /// # use google_cloud_datacatalog_v1::model::TagField;
14631 /// let x = TagField::new().set_string_value("example");
14632 /// assert!(x.string_value().is_some());
14633 /// assert!(x.double_value().is_none());
14634 /// assert!(x.bool_value().is_none());
14635 /// assert!(x.timestamp_value().is_none());
14636 /// assert!(x.enum_value().is_none());
14637 /// assert!(x.richtext_value().is_none());
14638 /// ```
14639 pub fn set_string_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14640 self.kind = std::option::Option::Some(crate::model::tag_field::Kind::StringValue(v.into()));
14641 self
14642 }
14643
14644 /// The value of [kind][crate::model::TagField::kind]
14645 /// if it holds a `BoolValue`, `None` if the field is not set or
14646 /// holds a different branch.
14647 pub fn bool_value(&self) -> std::option::Option<&bool> {
14648 #[allow(unreachable_patterns)]
14649 self.kind.as_ref().and_then(|v| match v {
14650 crate::model::tag_field::Kind::BoolValue(v) => std::option::Option::Some(v),
14651 _ => std::option::Option::None,
14652 })
14653 }
14654
14655 /// Sets the value of [kind][crate::model::TagField::kind]
14656 /// to hold a `BoolValue`.
14657 ///
14658 /// Note that all the setters affecting `kind` are
14659 /// mutually exclusive.
14660 ///
14661 /// # Example
14662 /// ```ignore,no_run
14663 /// # use google_cloud_datacatalog_v1::model::TagField;
14664 /// let x = TagField::new().set_bool_value(true);
14665 /// assert!(x.bool_value().is_some());
14666 /// assert!(x.double_value().is_none());
14667 /// assert!(x.string_value().is_none());
14668 /// assert!(x.timestamp_value().is_none());
14669 /// assert!(x.enum_value().is_none());
14670 /// assert!(x.richtext_value().is_none());
14671 /// ```
14672 pub fn set_bool_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14673 self.kind = std::option::Option::Some(crate::model::tag_field::Kind::BoolValue(v.into()));
14674 self
14675 }
14676
14677 /// The value of [kind][crate::model::TagField::kind]
14678 /// if it holds a `TimestampValue`, `None` if the field is not set or
14679 /// holds a different branch.
14680 pub fn timestamp_value(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
14681 #[allow(unreachable_patterns)]
14682 self.kind.as_ref().and_then(|v| match v {
14683 crate::model::tag_field::Kind::TimestampValue(v) => std::option::Option::Some(v),
14684 _ => std::option::Option::None,
14685 })
14686 }
14687
14688 /// Sets the value of [kind][crate::model::TagField::kind]
14689 /// to hold a `TimestampValue`.
14690 ///
14691 /// Note that all the setters affecting `kind` are
14692 /// mutually exclusive.
14693 ///
14694 /// # Example
14695 /// ```ignore,no_run
14696 /// # use google_cloud_datacatalog_v1::model::TagField;
14697 /// use wkt::Timestamp;
14698 /// let x = TagField::new().set_timestamp_value(Timestamp::default()/* use setters */);
14699 /// assert!(x.timestamp_value().is_some());
14700 /// assert!(x.double_value().is_none());
14701 /// assert!(x.string_value().is_none());
14702 /// assert!(x.bool_value().is_none());
14703 /// assert!(x.enum_value().is_none());
14704 /// assert!(x.richtext_value().is_none());
14705 /// ```
14706 pub fn set_timestamp_value<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
14707 mut self,
14708 v: T,
14709 ) -> Self {
14710 self.kind =
14711 std::option::Option::Some(crate::model::tag_field::Kind::TimestampValue(v.into()));
14712 self
14713 }
14714
14715 /// The value of [kind][crate::model::TagField::kind]
14716 /// if it holds a `EnumValue`, `None` if the field is not set or
14717 /// holds a different branch.
14718 pub fn enum_value(
14719 &self,
14720 ) -> std::option::Option<&std::boxed::Box<crate::model::tag_field::EnumValue>> {
14721 #[allow(unreachable_patterns)]
14722 self.kind.as_ref().and_then(|v| match v {
14723 crate::model::tag_field::Kind::EnumValue(v) => std::option::Option::Some(v),
14724 _ => std::option::Option::None,
14725 })
14726 }
14727
14728 /// Sets the value of [kind][crate::model::TagField::kind]
14729 /// to hold a `EnumValue`.
14730 ///
14731 /// Note that all the setters affecting `kind` are
14732 /// mutually exclusive.
14733 ///
14734 /// # Example
14735 /// ```ignore,no_run
14736 /// # use google_cloud_datacatalog_v1::model::TagField;
14737 /// use google_cloud_datacatalog_v1::model::tag_field::EnumValue;
14738 /// let x = TagField::new().set_enum_value(EnumValue::default()/* use setters */);
14739 /// assert!(x.enum_value().is_some());
14740 /// assert!(x.double_value().is_none());
14741 /// assert!(x.string_value().is_none());
14742 /// assert!(x.bool_value().is_none());
14743 /// assert!(x.timestamp_value().is_none());
14744 /// assert!(x.richtext_value().is_none());
14745 /// ```
14746 pub fn set_enum_value<
14747 T: std::convert::Into<std::boxed::Box<crate::model::tag_field::EnumValue>>,
14748 >(
14749 mut self,
14750 v: T,
14751 ) -> Self {
14752 self.kind = std::option::Option::Some(crate::model::tag_field::Kind::EnumValue(v.into()));
14753 self
14754 }
14755
14756 /// The value of [kind][crate::model::TagField::kind]
14757 /// if it holds a `RichtextValue`, `None` if the field is not set or
14758 /// holds a different branch.
14759 pub fn richtext_value(&self) -> std::option::Option<&std::string::String> {
14760 #[allow(unreachable_patterns)]
14761 self.kind.as_ref().and_then(|v| match v {
14762 crate::model::tag_field::Kind::RichtextValue(v) => std::option::Option::Some(v),
14763 _ => std::option::Option::None,
14764 })
14765 }
14766
14767 /// Sets the value of [kind][crate::model::TagField::kind]
14768 /// to hold a `RichtextValue`.
14769 ///
14770 /// Note that all the setters affecting `kind` are
14771 /// mutually exclusive.
14772 ///
14773 /// # Example
14774 /// ```ignore,no_run
14775 /// # use google_cloud_datacatalog_v1::model::TagField;
14776 /// let x = TagField::new().set_richtext_value("example");
14777 /// assert!(x.richtext_value().is_some());
14778 /// assert!(x.double_value().is_none());
14779 /// assert!(x.string_value().is_none());
14780 /// assert!(x.bool_value().is_none());
14781 /// assert!(x.timestamp_value().is_none());
14782 /// assert!(x.enum_value().is_none());
14783 /// ```
14784 pub fn set_richtext_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14785 self.kind =
14786 std::option::Option::Some(crate::model::tag_field::Kind::RichtextValue(v.into()));
14787 self
14788 }
14789}
14790
14791impl wkt::message::Message for TagField {
14792 fn typename() -> &'static str {
14793 "type.googleapis.com/google.cloud.datacatalog.v1.TagField"
14794 }
14795}
14796
14797/// Defines additional types related to [TagField].
14798pub mod tag_field {
14799 #[allow(unused_imports)]
14800 use super::*;
14801
14802 /// An enum value.
14803 #[derive(Clone, Default, PartialEq)]
14804 #[non_exhaustive]
14805 pub struct EnumValue {
14806 /// The display name of the enum value.
14807 pub display_name: std::string::String,
14808
14809 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14810 }
14811
14812 impl EnumValue {
14813 pub fn new() -> Self {
14814 std::default::Default::default()
14815 }
14816
14817 /// Sets the value of [display_name][crate::model::tag_field::EnumValue::display_name].
14818 ///
14819 /// # Example
14820 /// ```ignore,no_run
14821 /// # use google_cloud_datacatalog_v1::model::tag_field::EnumValue;
14822 /// let x = EnumValue::new().set_display_name("example");
14823 /// ```
14824 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
14825 mut self,
14826 v: T,
14827 ) -> Self {
14828 self.display_name = v.into();
14829 self
14830 }
14831 }
14832
14833 impl wkt::message::Message for EnumValue {
14834 fn typename() -> &'static str {
14835 "type.googleapis.com/google.cloud.datacatalog.v1.TagField.EnumValue"
14836 }
14837 }
14838
14839 /// Required. The value of this field.
14840 #[derive(Clone, Debug, PartialEq)]
14841 #[non_exhaustive]
14842 pub enum Kind {
14843 /// The value of a tag field with a double type.
14844 DoubleValue(f64),
14845 /// The value of a tag field with a string type.
14846 ///
14847 /// The maximum length is 2000 UTF-8 characters.
14848 StringValue(std::string::String),
14849 /// The value of a tag field with a boolean type.
14850 BoolValue(bool),
14851 /// The value of a tag field with a timestamp type.
14852 TimestampValue(std::boxed::Box<wkt::Timestamp>),
14853 /// The value of a tag field with an enum type.
14854 ///
14855 /// This value must be one of the allowed values listed in this enum.
14856 EnumValue(std::boxed::Box<crate::model::tag_field::EnumValue>),
14857 /// The value of a tag field with a rich text type.
14858 ///
14859 /// The maximum length is 10 MiB as this value holds HTML descriptions
14860 /// including encoded images. The maximum length of the text without images
14861 /// is 100 KiB.
14862 RichtextValue(std::string::String),
14863 }
14864}
14865
14866/// A tag template defines a tag that can have one or more typed fields.
14867///
14868/// The template is used to create tags that are attached to Google Cloud
14869/// resources. [Tag template roles]
14870/// (<https://cloud.google.com/iam/docs/understanding-roles#data-catalog-roles>)
14871/// provide permissions to create, edit, and use the template. For example,
14872/// see the [TagTemplate User]
14873/// (<https://cloud.google.com/data-catalog/docs/how-to/template-user>) role
14874/// that includes a permission to use the tag template to tag resources.
14875#[derive(Clone, Default, PartialEq)]
14876#[non_exhaustive]
14877pub struct TagTemplate {
14878 /// Identifier. The resource name of the tag template in URL format.
14879 ///
14880 /// Note: The tag template itself and its child resources might not be
14881 /// stored in the location specified in its name.
14882 pub name: std::string::String,
14883
14884 /// Display name for this template. Defaults to an empty string.
14885 ///
14886 /// The name must contain only Unicode letters, numbers (0-9), underscores (_),
14887 /// dashes (-), spaces ( ), and can't start or end with spaces.
14888 /// The maximum length is 200 characters.
14889 pub display_name: std::string::String,
14890
14891 /// Indicates whether tags created with this template are public. Public tags
14892 /// do not require tag template access to appear in
14893 /// [ListTags][google.cloud.datacatalog.v1.DataCatalog.ListTags] API response.
14894 ///
14895 /// Additionally, you can search for a public tag by value with a
14896 /// simple search query in addition to using a ``tag:`` predicate.
14897 ///
14898 /// [google.cloud.datacatalog.v1.DataCatalog.ListTags]: crate::client::DataCatalog::list_tags
14899 pub is_publicly_readable: bool,
14900
14901 /// Required. Map of tag template field IDs to the settings for the field.
14902 /// This map is an exhaustive list of the allowed fields. The map must contain
14903 /// at least one field and at most 500 fields.
14904 ///
14905 /// The keys to this map are tag template field IDs. The IDs have the
14906 /// following limitations:
14907 ///
14908 /// * Can contain uppercase and lowercase letters, numbers (0-9) and
14909 /// underscores (_).
14910 /// * Must be at least 1 character and at most 64 characters long.
14911 /// * Must start with a letter or underscore.
14912 pub fields: std::collections::HashMap<std::string::String, crate::model::TagTemplateField>,
14913
14914 /// Optional. Transfer status of the TagTemplate
14915 pub dataplex_transfer_status: crate::model::tag_template::DataplexTransferStatus,
14916
14917 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14918}
14919
14920impl TagTemplate {
14921 pub fn new() -> Self {
14922 std::default::Default::default()
14923 }
14924
14925 /// Sets the value of [name][crate::model::TagTemplate::name].
14926 ///
14927 /// # Example
14928 /// ```ignore,no_run
14929 /// # use google_cloud_datacatalog_v1::model::TagTemplate;
14930 /// let x = TagTemplate::new().set_name("example");
14931 /// ```
14932 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14933 self.name = v.into();
14934 self
14935 }
14936
14937 /// Sets the value of [display_name][crate::model::TagTemplate::display_name].
14938 ///
14939 /// # Example
14940 /// ```ignore,no_run
14941 /// # use google_cloud_datacatalog_v1::model::TagTemplate;
14942 /// let x = TagTemplate::new().set_display_name("example");
14943 /// ```
14944 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14945 self.display_name = v.into();
14946 self
14947 }
14948
14949 /// Sets the value of [is_publicly_readable][crate::model::TagTemplate::is_publicly_readable].
14950 ///
14951 /// # Example
14952 /// ```ignore,no_run
14953 /// # use google_cloud_datacatalog_v1::model::TagTemplate;
14954 /// let x = TagTemplate::new().set_is_publicly_readable(true);
14955 /// ```
14956 pub fn set_is_publicly_readable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14957 self.is_publicly_readable = v.into();
14958 self
14959 }
14960
14961 /// Sets the value of [fields][crate::model::TagTemplate::fields].
14962 ///
14963 /// # Example
14964 /// ```ignore,no_run
14965 /// # use google_cloud_datacatalog_v1::model::TagTemplate;
14966 /// use google_cloud_datacatalog_v1::model::TagTemplateField;
14967 /// let x = TagTemplate::new().set_fields([
14968 /// ("key0", TagTemplateField::default()/* use setters */),
14969 /// ("key1", TagTemplateField::default()/* use (different) setters */),
14970 /// ]);
14971 /// ```
14972 pub fn set_fields<T, K, V>(mut self, v: T) -> Self
14973 where
14974 T: std::iter::IntoIterator<Item = (K, V)>,
14975 K: std::convert::Into<std::string::String>,
14976 V: std::convert::Into<crate::model::TagTemplateField>,
14977 {
14978 use std::iter::Iterator;
14979 self.fields = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14980 self
14981 }
14982
14983 /// Sets the value of [dataplex_transfer_status][crate::model::TagTemplate::dataplex_transfer_status].
14984 ///
14985 /// # Example
14986 /// ```ignore,no_run
14987 /// # use google_cloud_datacatalog_v1::model::TagTemplate;
14988 /// use google_cloud_datacatalog_v1::model::tag_template::DataplexTransferStatus;
14989 /// let x0 = TagTemplate::new().set_dataplex_transfer_status(DataplexTransferStatus::Transferred);
14990 /// ```
14991 pub fn set_dataplex_transfer_status<
14992 T: std::convert::Into<crate::model::tag_template::DataplexTransferStatus>,
14993 >(
14994 mut self,
14995 v: T,
14996 ) -> Self {
14997 self.dataplex_transfer_status = v.into();
14998 self
14999 }
15000}
15001
15002impl wkt::message::Message for TagTemplate {
15003 fn typename() -> &'static str {
15004 "type.googleapis.com/google.cloud.datacatalog.v1.TagTemplate"
15005 }
15006}
15007
15008/// Defines additional types related to [TagTemplate].
15009pub mod tag_template {
15010 #[allow(unused_imports)]
15011 use super::*;
15012
15013 /// This enum describes TagTemplate transfer status to Dataplex service.
15014 ///
15015 /// # Working with unknown values
15016 ///
15017 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15018 /// additional enum variants at any time. Adding new variants is not considered
15019 /// a breaking change. Applications should write their code in anticipation of:
15020 ///
15021 /// - New values appearing in future releases of the client library, **and**
15022 /// - New values received dynamically, without application changes.
15023 ///
15024 /// Please consult the [Working with enums] section in the user guide for some
15025 /// guidelines.
15026 ///
15027 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15028 #[derive(Clone, Debug, PartialEq)]
15029 #[non_exhaustive]
15030 pub enum DataplexTransferStatus {
15031 /// Default value. TagTemplate and its tags are only visible and editable in
15032 /// DataCatalog.
15033 Unspecified,
15034 /// TagTemplate and its tags are auto-copied to Dataplex service.
15035 /// Visible in both services. Editable in DataCatalog, read-only in Dataplex.
15036 /// Deprecated: Individual TagTemplate migration is deprecated in favor of
15037 /// organization or project wide TagTemplate migration opt-in.
15038 #[deprecated]
15039 Migrated,
15040 /// TagTemplate and its tags are auto-copied to Dataplex service.
15041 /// Visible in both services. Editable in Dataplex, read-only in DataCatalog.
15042 Transferred,
15043 /// If set, the enum was initialized with an unknown value.
15044 ///
15045 /// Applications can examine the value using [DataplexTransferStatus::value] or
15046 /// [DataplexTransferStatus::name].
15047 UnknownValue(dataplex_transfer_status::UnknownValue),
15048 }
15049
15050 #[doc(hidden)]
15051 pub mod dataplex_transfer_status {
15052 #[allow(unused_imports)]
15053 use super::*;
15054 #[derive(Clone, Debug, PartialEq)]
15055 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15056 }
15057
15058 impl DataplexTransferStatus {
15059 /// Gets the enum value.
15060 ///
15061 /// Returns `None` if the enum contains an unknown value deserialized from
15062 /// the string representation of enums.
15063 pub fn value(&self) -> std::option::Option<i32> {
15064 match self {
15065 Self::Unspecified => std::option::Option::Some(0),
15066 Self::Migrated => std::option::Option::Some(1),
15067 Self::Transferred => std::option::Option::Some(2),
15068 Self::UnknownValue(u) => u.0.value(),
15069 }
15070 }
15071
15072 /// Gets the enum value as a string.
15073 ///
15074 /// Returns `None` if the enum contains an unknown value deserialized from
15075 /// the integer representation of enums.
15076 pub fn name(&self) -> std::option::Option<&str> {
15077 match self {
15078 Self::Unspecified => {
15079 std::option::Option::Some("DATAPLEX_TRANSFER_STATUS_UNSPECIFIED")
15080 }
15081 Self::Migrated => std::option::Option::Some("MIGRATED"),
15082 Self::Transferred => std::option::Option::Some("TRANSFERRED"),
15083 Self::UnknownValue(u) => u.0.name(),
15084 }
15085 }
15086 }
15087
15088 impl std::default::Default for DataplexTransferStatus {
15089 fn default() -> Self {
15090 use std::convert::From;
15091 Self::from(0)
15092 }
15093 }
15094
15095 impl std::fmt::Display for DataplexTransferStatus {
15096 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15097 wkt::internal::display_enum(f, self.name(), self.value())
15098 }
15099 }
15100
15101 impl std::convert::From<i32> for DataplexTransferStatus {
15102 fn from(value: i32) -> Self {
15103 match value {
15104 0 => Self::Unspecified,
15105 1 => Self::Migrated,
15106 2 => Self::Transferred,
15107 _ => Self::UnknownValue(dataplex_transfer_status::UnknownValue(
15108 wkt::internal::UnknownEnumValue::Integer(value),
15109 )),
15110 }
15111 }
15112 }
15113
15114 impl std::convert::From<&str> for DataplexTransferStatus {
15115 fn from(value: &str) -> Self {
15116 use std::string::ToString;
15117 match value {
15118 "DATAPLEX_TRANSFER_STATUS_UNSPECIFIED" => Self::Unspecified,
15119 "MIGRATED" => Self::Migrated,
15120 "TRANSFERRED" => Self::Transferred,
15121 _ => Self::UnknownValue(dataplex_transfer_status::UnknownValue(
15122 wkt::internal::UnknownEnumValue::String(value.to_string()),
15123 )),
15124 }
15125 }
15126 }
15127
15128 impl serde::ser::Serialize for DataplexTransferStatus {
15129 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15130 where
15131 S: serde::Serializer,
15132 {
15133 match self {
15134 Self::Unspecified => serializer.serialize_i32(0),
15135 Self::Migrated => serializer.serialize_i32(1),
15136 Self::Transferred => serializer.serialize_i32(2),
15137 Self::UnknownValue(u) => u.0.serialize(serializer),
15138 }
15139 }
15140 }
15141
15142 impl<'de> serde::de::Deserialize<'de> for DataplexTransferStatus {
15143 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15144 where
15145 D: serde::Deserializer<'de>,
15146 {
15147 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataplexTransferStatus>::new(
15148 ".google.cloud.datacatalog.v1.TagTemplate.DataplexTransferStatus",
15149 ))
15150 }
15151 }
15152}
15153
15154/// The template for an individual field within a tag template.
15155#[derive(Clone, Default, PartialEq)]
15156#[non_exhaustive]
15157pub struct TagTemplateField {
15158 /// Identifier. The resource name of the tag template field in URL format.
15159 /// Example:
15160 ///
15161 /// `projects/{PROJECT_ID}/locations/{LOCATION}/tagTemplates/{TAG_TEMPLATE}/fields/{FIELD}`
15162 ///
15163 /// Note: The tag template field itself might not be stored in the location
15164 /// specified in its name.
15165 ///
15166 /// The name must contain only letters (a-z, A-Z), numbers (0-9),
15167 /// or underscores (_), and must start with a letter or underscore.
15168 /// The maximum length is 64 characters.
15169 pub name: std::string::String,
15170
15171 /// The display name for this field. Defaults to an empty string.
15172 ///
15173 /// The name must contain only Unicode letters, numbers (0-9), underscores (_),
15174 /// dashes (-), spaces ( ), and can't start or end with spaces.
15175 /// The maximum length is 200 characters.
15176 pub display_name: std::string::String,
15177
15178 /// Required. The type of value this tag field can contain.
15179 pub r#type: std::option::Option<crate::model::FieldType>,
15180
15181 /// If true, this field is required. Defaults to false.
15182 pub is_required: bool,
15183
15184 /// The description for this field. Defaults to an empty string.
15185 pub description: std::string::String,
15186
15187 /// The order of this field with respect to other fields in this tag
15188 /// template.
15189 ///
15190 /// For example, a higher value can indicate a more important field.
15191 /// The value can be negative. Multiple fields can have the same order and
15192 /// field orders within a tag don't have to be sequential.
15193 pub order: i32,
15194
15195 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15196}
15197
15198impl TagTemplateField {
15199 pub fn new() -> Self {
15200 std::default::Default::default()
15201 }
15202
15203 /// Sets the value of [name][crate::model::TagTemplateField::name].
15204 ///
15205 /// # Example
15206 /// ```ignore,no_run
15207 /// # use google_cloud_datacatalog_v1::model::TagTemplateField;
15208 /// let x = TagTemplateField::new().set_name("example");
15209 /// ```
15210 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15211 self.name = v.into();
15212 self
15213 }
15214
15215 /// Sets the value of [display_name][crate::model::TagTemplateField::display_name].
15216 ///
15217 /// # Example
15218 /// ```ignore,no_run
15219 /// # use google_cloud_datacatalog_v1::model::TagTemplateField;
15220 /// let x = TagTemplateField::new().set_display_name("example");
15221 /// ```
15222 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15223 self.display_name = v.into();
15224 self
15225 }
15226
15227 /// Sets the value of [r#type][crate::model::TagTemplateField::type].
15228 ///
15229 /// # Example
15230 /// ```ignore,no_run
15231 /// # use google_cloud_datacatalog_v1::model::TagTemplateField;
15232 /// use google_cloud_datacatalog_v1::model::FieldType;
15233 /// let x = TagTemplateField::new().set_type(FieldType::default()/* use setters */);
15234 /// ```
15235 pub fn set_type<T>(mut self, v: T) -> Self
15236 where
15237 T: std::convert::Into<crate::model::FieldType>,
15238 {
15239 self.r#type = std::option::Option::Some(v.into());
15240 self
15241 }
15242
15243 /// Sets or clears the value of [r#type][crate::model::TagTemplateField::type].
15244 ///
15245 /// # Example
15246 /// ```ignore,no_run
15247 /// # use google_cloud_datacatalog_v1::model::TagTemplateField;
15248 /// use google_cloud_datacatalog_v1::model::FieldType;
15249 /// let x = TagTemplateField::new().set_or_clear_type(Some(FieldType::default()/* use setters */));
15250 /// let x = TagTemplateField::new().set_or_clear_type(None::<FieldType>);
15251 /// ```
15252 pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
15253 where
15254 T: std::convert::Into<crate::model::FieldType>,
15255 {
15256 self.r#type = v.map(|x| x.into());
15257 self
15258 }
15259
15260 /// Sets the value of [is_required][crate::model::TagTemplateField::is_required].
15261 ///
15262 /// # Example
15263 /// ```ignore,no_run
15264 /// # use google_cloud_datacatalog_v1::model::TagTemplateField;
15265 /// let x = TagTemplateField::new().set_is_required(true);
15266 /// ```
15267 pub fn set_is_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15268 self.is_required = v.into();
15269 self
15270 }
15271
15272 /// Sets the value of [description][crate::model::TagTemplateField::description].
15273 ///
15274 /// # Example
15275 /// ```ignore,no_run
15276 /// # use google_cloud_datacatalog_v1::model::TagTemplateField;
15277 /// let x = TagTemplateField::new().set_description("example");
15278 /// ```
15279 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15280 self.description = v.into();
15281 self
15282 }
15283
15284 /// Sets the value of [order][crate::model::TagTemplateField::order].
15285 ///
15286 /// # Example
15287 /// ```ignore,no_run
15288 /// # use google_cloud_datacatalog_v1::model::TagTemplateField;
15289 /// let x = TagTemplateField::new().set_order(42);
15290 /// ```
15291 pub fn set_order<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
15292 self.order = v.into();
15293 self
15294 }
15295}
15296
15297impl wkt::message::Message for TagTemplateField {
15298 fn typename() -> &'static str {
15299 "type.googleapis.com/google.cloud.datacatalog.v1.TagTemplateField"
15300 }
15301}
15302
15303#[derive(Clone, Default, PartialEq)]
15304#[non_exhaustive]
15305pub struct FieldType {
15306 /// Required.
15307 pub type_decl: std::option::Option<crate::model::field_type::TypeDecl>,
15308
15309 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15310}
15311
15312impl FieldType {
15313 pub fn new() -> Self {
15314 std::default::Default::default()
15315 }
15316
15317 /// Sets the value of [type_decl][crate::model::FieldType::type_decl].
15318 ///
15319 /// Note that all the setters affecting `type_decl` are mutually
15320 /// exclusive.
15321 ///
15322 /// # Example
15323 /// ```ignore,no_run
15324 /// # use google_cloud_datacatalog_v1::model::FieldType;
15325 /// use google_cloud_datacatalog_v1::model::field_type::PrimitiveType;
15326 /// let x0 = FieldType::new().set_type_decl(Some(
15327 /// google_cloud_datacatalog_v1::model::field_type::TypeDecl::PrimitiveType(PrimitiveType::Double)));
15328 /// let x1 = FieldType::new().set_type_decl(Some(
15329 /// google_cloud_datacatalog_v1::model::field_type::TypeDecl::PrimitiveType(PrimitiveType::String)));
15330 /// let x2 = FieldType::new().set_type_decl(Some(
15331 /// google_cloud_datacatalog_v1::model::field_type::TypeDecl::PrimitiveType(PrimitiveType::Bool)));
15332 /// ```
15333 pub fn set_type_decl<
15334 T: std::convert::Into<std::option::Option<crate::model::field_type::TypeDecl>>,
15335 >(
15336 mut self,
15337 v: T,
15338 ) -> Self {
15339 self.type_decl = v.into();
15340 self
15341 }
15342
15343 /// The value of [type_decl][crate::model::FieldType::type_decl]
15344 /// if it holds a `PrimitiveType`, `None` if the field is not set or
15345 /// holds a different branch.
15346 pub fn primitive_type(&self) -> std::option::Option<&crate::model::field_type::PrimitiveType> {
15347 #[allow(unreachable_patterns)]
15348 self.type_decl.as_ref().and_then(|v| match v {
15349 crate::model::field_type::TypeDecl::PrimitiveType(v) => std::option::Option::Some(v),
15350 _ => std::option::Option::None,
15351 })
15352 }
15353
15354 /// Sets the value of [type_decl][crate::model::FieldType::type_decl]
15355 /// to hold a `PrimitiveType`.
15356 ///
15357 /// Note that all the setters affecting `type_decl` are
15358 /// mutually exclusive.
15359 ///
15360 /// # Example
15361 /// ```ignore,no_run
15362 /// # use google_cloud_datacatalog_v1::model::FieldType;
15363 /// use google_cloud_datacatalog_v1::model::field_type::PrimitiveType;
15364 /// let x0 = FieldType::new().set_primitive_type(PrimitiveType::Double);
15365 /// let x1 = FieldType::new().set_primitive_type(PrimitiveType::String);
15366 /// let x2 = FieldType::new().set_primitive_type(PrimitiveType::Bool);
15367 /// assert!(x0.primitive_type().is_some());
15368 /// assert!(x0.enum_type().is_none());
15369 /// assert!(x1.primitive_type().is_some());
15370 /// assert!(x1.enum_type().is_none());
15371 /// assert!(x2.primitive_type().is_some());
15372 /// assert!(x2.enum_type().is_none());
15373 /// ```
15374 pub fn set_primitive_type<T: std::convert::Into<crate::model::field_type::PrimitiveType>>(
15375 mut self,
15376 v: T,
15377 ) -> Self {
15378 self.type_decl =
15379 std::option::Option::Some(crate::model::field_type::TypeDecl::PrimitiveType(v.into()));
15380 self
15381 }
15382
15383 /// The value of [type_decl][crate::model::FieldType::type_decl]
15384 /// if it holds a `EnumType`, `None` if the field is not set or
15385 /// holds a different branch.
15386 pub fn enum_type(
15387 &self,
15388 ) -> std::option::Option<&std::boxed::Box<crate::model::field_type::EnumType>> {
15389 #[allow(unreachable_patterns)]
15390 self.type_decl.as_ref().and_then(|v| match v {
15391 crate::model::field_type::TypeDecl::EnumType(v) => std::option::Option::Some(v),
15392 _ => std::option::Option::None,
15393 })
15394 }
15395
15396 /// Sets the value of [type_decl][crate::model::FieldType::type_decl]
15397 /// to hold a `EnumType`.
15398 ///
15399 /// Note that all the setters affecting `type_decl` are
15400 /// mutually exclusive.
15401 ///
15402 /// # Example
15403 /// ```ignore,no_run
15404 /// # use google_cloud_datacatalog_v1::model::FieldType;
15405 /// use google_cloud_datacatalog_v1::model::field_type::EnumType;
15406 /// let x = FieldType::new().set_enum_type(EnumType::default()/* use setters */);
15407 /// assert!(x.enum_type().is_some());
15408 /// assert!(x.primitive_type().is_none());
15409 /// ```
15410 pub fn set_enum_type<
15411 T: std::convert::Into<std::boxed::Box<crate::model::field_type::EnumType>>,
15412 >(
15413 mut self,
15414 v: T,
15415 ) -> Self {
15416 self.type_decl =
15417 std::option::Option::Some(crate::model::field_type::TypeDecl::EnumType(v.into()));
15418 self
15419 }
15420}
15421
15422impl wkt::message::Message for FieldType {
15423 fn typename() -> &'static str {
15424 "type.googleapis.com/google.cloud.datacatalog.v1.FieldType"
15425 }
15426}
15427
15428/// Defines additional types related to [FieldType].
15429pub mod field_type {
15430 #[allow(unused_imports)]
15431 use super::*;
15432
15433 #[derive(Clone, Default, PartialEq)]
15434 #[non_exhaustive]
15435 pub struct EnumType {
15436 /// The set of allowed values for this enum.
15437 ///
15438 /// This set must not be empty and can include up to 100 allowed values.
15439 /// The display names of the values in this set must not be empty and must
15440 /// be case-insensitively unique within this set.
15441 ///
15442 /// The order of items in this set is preserved. This field can be used to
15443 /// create, remove, and reorder enum values. To rename enum values, use the
15444 /// `RenameTagTemplateFieldEnumValue` method.
15445 pub allowed_values: std::vec::Vec<crate::model::field_type::enum_type::EnumValue>,
15446
15447 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15448 }
15449
15450 impl EnumType {
15451 pub fn new() -> Self {
15452 std::default::Default::default()
15453 }
15454
15455 /// Sets the value of [allowed_values][crate::model::field_type::EnumType::allowed_values].
15456 ///
15457 /// # Example
15458 /// ```ignore,no_run
15459 /// # use google_cloud_datacatalog_v1::model::field_type::EnumType;
15460 /// use google_cloud_datacatalog_v1::model::field_type::enum_type::EnumValue;
15461 /// let x = EnumType::new()
15462 /// .set_allowed_values([
15463 /// EnumValue::default()/* use setters */,
15464 /// EnumValue::default()/* use (different) setters */,
15465 /// ]);
15466 /// ```
15467 pub fn set_allowed_values<T, V>(mut self, v: T) -> Self
15468 where
15469 T: std::iter::IntoIterator<Item = V>,
15470 V: std::convert::Into<crate::model::field_type::enum_type::EnumValue>,
15471 {
15472 use std::iter::Iterator;
15473 self.allowed_values = v.into_iter().map(|i| i.into()).collect();
15474 self
15475 }
15476 }
15477
15478 impl wkt::message::Message for EnumType {
15479 fn typename() -> &'static str {
15480 "type.googleapis.com/google.cloud.datacatalog.v1.FieldType.EnumType"
15481 }
15482 }
15483
15484 /// Defines additional types related to [EnumType].
15485 pub mod enum_type {
15486 #[allow(unused_imports)]
15487 use super::*;
15488
15489 #[derive(Clone, Default, PartialEq)]
15490 #[non_exhaustive]
15491 pub struct EnumValue {
15492 /// Required. The display name of the enum value. Must not be an empty
15493 /// string.
15494 ///
15495 /// The name must contain only Unicode letters, numbers (0-9), underscores
15496 /// (_), dashes (-), spaces ( ), and can't start or end with spaces. The
15497 /// maximum length is 200 characters.
15498 pub display_name: std::string::String,
15499
15500 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15501 }
15502
15503 impl EnumValue {
15504 pub fn new() -> Self {
15505 std::default::Default::default()
15506 }
15507
15508 /// Sets the value of [display_name][crate::model::field_type::enum_type::EnumValue::display_name].
15509 ///
15510 /// # Example
15511 /// ```ignore,no_run
15512 /// # use google_cloud_datacatalog_v1::model::field_type::enum_type::EnumValue;
15513 /// let x = EnumValue::new().set_display_name("example");
15514 /// ```
15515 pub fn set_display_name<T: std::convert::Into<std::string::String>>(
15516 mut self,
15517 v: T,
15518 ) -> Self {
15519 self.display_name = v.into();
15520 self
15521 }
15522 }
15523
15524 impl wkt::message::Message for EnumValue {
15525 fn typename() -> &'static str {
15526 "type.googleapis.com/google.cloud.datacatalog.v1.FieldType.EnumType.EnumValue"
15527 }
15528 }
15529 }
15530
15531 ///
15532 /// # Working with unknown values
15533 ///
15534 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15535 /// additional enum variants at any time. Adding new variants is not considered
15536 /// a breaking change. Applications should write their code in anticipation of:
15537 ///
15538 /// - New values appearing in future releases of the client library, **and**
15539 /// - New values received dynamically, without application changes.
15540 ///
15541 /// Please consult the [Working with enums] section in the user guide for some
15542 /// guidelines.
15543 ///
15544 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15545 #[derive(Clone, Debug, PartialEq)]
15546 #[non_exhaustive]
15547 pub enum PrimitiveType {
15548 /// The default invalid value for a type.
15549 Unspecified,
15550 /// A double precision number.
15551 Double,
15552 /// An UTF-8 string.
15553 String,
15554 /// A boolean value.
15555 Bool,
15556 /// A timestamp.
15557 Timestamp,
15558 /// A Richtext description.
15559 Richtext,
15560 /// If set, the enum was initialized with an unknown value.
15561 ///
15562 /// Applications can examine the value using [PrimitiveType::value] or
15563 /// [PrimitiveType::name].
15564 UnknownValue(primitive_type::UnknownValue),
15565 }
15566
15567 #[doc(hidden)]
15568 pub mod primitive_type {
15569 #[allow(unused_imports)]
15570 use super::*;
15571 #[derive(Clone, Debug, PartialEq)]
15572 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15573 }
15574
15575 impl PrimitiveType {
15576 /// Gets the enum value.
15577 ///
15578 /// Returns `None` if the enum contains an unknown value deserialized from
15579 /// the string representation of enums.
15580 pub fn value(&self) -> std::option::Option<i32> {
15581 match self {
15582 Self::Unspecified => std::option::Option::Some(0),
15583 Self::Double => std::option::Option::Some(1),
15584 Self::String => std::option::Option::Some(2),
15585 Self::Bool => std::option::Option::Some(3),
15586 Self::Timestamp => std::option::Option::Some(4),
15587 Self::Richtext => std::option::Option::Some(5),
15588 Self::UnknownValue(u) => u.0.value(),
15589 }
15590 }
15591
15592 /// Gets the enum value as a string.
15593 ///
15594 /// Returns `None` if the enum contains an unknown value deserialized from
15595 /// the integer representation of enums.
15596 pub fn name(&self) -> std::option::Option<&str> {
15597 match self {
15598 Self::Unspecified => std::option::Option::Some("PRIMITIVE_TYPE_UNSPECIFIED"),
15599 Self::Double => std::option::Option::Some("DOUBLE"),
15600 Self::String => std::option::Option::Some("STRING"),
15601 Self::Bool => std::option::Option::Some("BOOL"),
15602 Self::Timestamp => std::option::Option::Some("TIMESTAMP"),
15603 Self::Richtext => std::option::Option::Some("RICHTEXT"),
15604 Self::UnknownValue(u) => u.0.name(),
15605 }
15606 }
15607 }
15608
15609 impl std::default::Default for PrimitiveType {
15610 fn default() -> Self {
15611 use std::convert::From;
15612 Self::from(0)
15613 }
15614 }
15615
15616 impl std::fmt::Display for PrimitiveType {
15617 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15618 wkt::internal::display_enum(f, self.name(), self.value())
15619 }
15620 }
15621
15622 impl std::convert::From<i32> for PrimitiveType {
15623 fn from(value: i32) -> Self {
15624 match value {
15625 0 => Self::Unspecified,
15626 1 => Self::Double,
15627 2 => Self::String,
15628 3 => Self::Bool,
15629 4 => Self::Timestamp,
15630 5 => Self::Richtext,
15631 _ => Self::UnknownValue(primitive_type::UnknownValue(
15632 wkt::internal::UnknownEnumValue::Integer(value),
15633 )),
15634 }
15635 }
15636 }
15637
15638 impl std::convert::From<&str> for PrimitiveType {
15639 fn from(value: &str) -> Self {
15640 use std::string::ToString;
15641 match value {
15642 "PRIMITIVE_TYPE_UNSPECIFIED" => Self::Unspecified,
15643 "DOUBLE" => Self::Double,
15644 "STRING" => Self::String,
15645 "BOOL" => Self::Bool,
15646 "TIMESTAMP" => Self::Timestamp,
15647 "RICHTEXT" => Self::Richtext,
15648 _ => Self::UnknownValue(primitive_type::UnknownValue(
15649 wkt::internal::UnknownEnumValue::String(value.to_string()),
15650 )),
15651 }
15652 }
15653 }
15654
15655 impl serde::ser::Serialize for PrimitiveType {
15656 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15657 where
15658 S: serde::Serializer,
15659 {
15660 match self {
15661 Self::Unspecified => serializer.serialize_i32(0),
15662 Self::Double => serializer.serialize_i32(1),
15663 Self::String => serializer.serialize_i32(2),
15664 Self::Bool => serializer.serialize_i32(3),
15665 Self::Timestamp => serializer.serialize_i32(4),
15666 Self::Richtext => serializer.serialize_i32(5),
15667 Self::UnknownValue(u) => u.0.serialize(serializer),
15668 }
15669 }
15670 }
15671
15672 impl<'de> serde::de::Deserialize<'de> for PrimitiveType {
15673 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15674 where
15675 D: serde::Deserializer<'de>,
15676 {
15677 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PrimitiveType>::new(
15678 ".google.cloud.datacatalog.v1.FieldType.PrimitiveType",
15679 ))
15680 }
15681 }
15682
15683 /// Required.
15684 #[derive(Clone, Debug, PartialEq)]
15685 #[non_exhaustive]
15686 pub enum TypeDecl {
15687 /// Primitive types, such as string, boolean, etc.
15688 PrimitiveType(crate::model::field_type::PrimitiveType),
15689 /// An enum type.
15690 EnumType(std::boxed::Box<crate::model::field_type::EnumType>),
15691 }
15692}
15693
15694/// Timestamps associated with this resource in a particular system.
15695#[derive(Clone, Default, PartialEq)]
15696#[non_exhaustive]
15697pub struct SystemTimestamps {
15698 /// Creation timestamp of the resource within the given system.
15699 pub create_time: std::option::Option<wkt::Timestamp>,
15700
15701 /// Timestamp of the last modification of the resource or its metadata within
15702 /// a given system.
15703 ///
15704 /// Note: Depending on the source system, not every modification updates this
15705 /// timestamp.
15706 /// For example, BigQuery timestamps every metadata modification but not data
15707 /// or permission changes.
15708 pub update_time: std::option::Option<wkt::Timestamp>,
15709
15710 /// Output only. Expiration timestamp of the resource within the given system.
15711 ///
15712 /// Currently only applicable to BigQuery resources.
15713 pub expire_time: std::option::Option<wkt::Timestamp>,
15714
15715 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15716}
15717
15718impl SystemTimestamps {
15719 pub fn new() -> Self {
15720 std::default::Default::default()
15721 }
15722
15723 /// Sets the value of [create_time][crate::model::SystemTimestamps::create_time].
15724 ///
15725 /// # Example
15726 /// ```ignore,no_run
15727 /// # use google_cloud_datacatalog_v1::model::SystemTimestamps;
15728 /// use wkt::Timestamp;
15729 /// let x = SystemTimestamps::new().set_create_time(Timestamp::default()/* use setters */);
15730 /// ```
15731 pub fn set_create_time<T>(mut self, v: T) -> Self
15732 where
15733 T: std::convert::Into<wkt::Timestamp>,
15734 {
15735 self.create_time = std::option::Option::Some(v.into());
15736 self
15737 }
15738
15739 /// Sets or clears the value of [create_time][crate::model::SystemTimestamps::create_time].
15740 ///
15741 /// # Example
15742 /// ```ignore,no_run
15743 /// # use google_cloud_datacatalog_v1::model::SystemTimestamps;
15744 /// use wkt::Timestamp;
15745 /// let x = SystemTimestamps::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
15746 /// let x = SystemTimestamps::new().set_or_clear_create_time(None::<Timestamp>);
15747 /// ```
15748 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
15749 where
15750 T: std::convert::Into<wkt::Timestamp>,
15751 {
15752 self.create_time = v.map(|x| x.into());
15753 self
15754 }
15755
15756 /// Sets the value of [update_time][crate::model::SystemTimestamps::update_time].
15757 ///
15758 /// # Example
15759 /// ```ignore,no_run
15760 /// # use google_cloud_datacatalog_v1::model::SystemTimestamps;
15761 /// use wkt::Timestamp;
15762 /// let x = SystemTimestamps::new().set_update_time(Timestamp::default()/* use setters */);
15763 /// ```
15764 pub fn set_update_time<T>(mut self, v: T) -> Self
15765 where
15766 T: std::convert::Into<wkt::Timestamp>,
15767 {
15768 self.update_time = std::option::Option::Some(v.into());
15769 self
15770 }
15771
15772 /// Sets or clears the value of [update_time][crate::model::SystemTimestamps::update_time].
15773 ///
15774 /// # Example
15775 /// ```ignore,no_run
15776 /// # use google_cloud_datacatalog_v1::model::SystemTimestamps;
15777 /// use wkt::Timestamp;
15778 /// let x = SystemTimestamps::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
15779 /// let x = SystemTimestamps::new().set_or_clear_update_time(None::<Timestamp>);
15780 /// ```
15781 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
15782 where
15783 T: std::convert::Into<wkt::Timestamp>,
15784 {
15785 self.update_time = v.map(|x| x.into());
15786 self
15787 }
15788
15789 /// Sets the value of [expire_time][crate::model::SystemTimestamps::expire_time].
15790 ///
15791 /// # Example
15792 /// ```ignore,no_run
15793 /// # use google_cloud_datacatalog_v1::model::SystemTimestamps;
15794 /// use wkt::Timestamp;
15795 /// let x = SystemTimestamps::new().set_expire_time(Timestamp::default()/* use setters */);
15796 /// ```
15797 pub fn set_expire_time<T>(mut self, v: T) -> Self
15798 where
15799 T: std::convert::Into<wkt::Timestamp>,
15800 {
15801 self.expire_time = std::option::Option::Some(v.into());
15802 self
15803 }
15804
15805 /// Sets or clears the value of [expire_time][crate::model::SystemTimestamps::expire_time].
15806 ///
15807 /// # Example
15808 /// ```ignore,no_run
15809 /// # use google_cloud_datacatalog_v1::model::SystemTimestamps;
15810 /// use wkt::Timestamp;
15811 /// let x = SystemTimestamps::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
15812 /// let x = SystemTimestamps::new().set_or_clear_expire_time(None::<Timestamp>);
15813 /// ```
15814 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
15815 where
15816 T: std::convert::Into<wkt::Timestamp>,
15817 {
15818 self.expire_time = v.map(|x| x.into());
15819 self
15820 }
15821}
15822
15823impl wkt::message::Message for SystemTimestamps {
15824 fn typename() -> &'static str {
15825 "type.googleapis.com/google.cloud.datacatalog.v1.SystemTimestamps"
15826 }
15827}
15828
15829/// Detailed statistics on the entry's usage.
15830///
15831/// Usage statistics have the following limitations:
15832///
15833/// - Only BigQuery tables have them.
15834/// - They only include BigQuery query jobs.
15835/// - They might be underestimated because wildcard table references
15836/// are not yet counted. For more information, see
15837/// [Querying multiple tables using a wildcard table]
15838/// (<https://cloud.google.com/bigquery/docs/querying-wildcard-tables>)
15839#[derive(Clone, Default, PartialEq)]
15840#[non_exhaustive]
15841pub struct UsageStats {
15842 /// The number of successful uses of the underlying entry.
15843 pub total_completions: f32,
15844
15845 /// The number of failed attempts to use the underlying entry.
15846 pub total_failures: f32,
15847
15848 /// The number of cancelled attempts to use the underlying entry.
15849 pub total_cancellations: f32,
15850
15851 /// Total time spent only on successful uses, in milliseconds.
15852 pub total_execution_time_for_completions_millis: f32,
15853
15854 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15855}
15856
15857impl UsageStats {
15858 pub fn new() -> Self {
15859 std::default::Default::default()
15860 }
15861
15862 /// Sets the value of [total_completions][crate::model::UsageStats::total_completions].
15863 ///
15864 /// # Example
15865 /// ```ignore,no_run
15866 /// # use google_cloud_datacatalog_v1::model::UsageStats;
15867 /// let x = UsageStats::new().set_total_completions(42.0);
15868 /// ```
15869 pub fn set_total_completions<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
15870 self.total_completions = v.into();
15871 self
15872 }
15873
15874 /// Sets the value of [total_failures][crate::model::UsageStats::total_failures].
15875 ///
15876 /// # Example
15877 /// ```ignore,no_run
15878 /// # use google_cloud_datacatalog_v1::model::UsageStats;
15879 /// let x = UsageStats::new().set_total_failures(42.0);
15880 /// ```
15881 pub fn set_total_failures<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
15882 self.total_failures = v.into();
15883 self
15884 }
15885
15886 /// Sets the value of [total_cancellations][crate::model::UsageStats::total_cancellations].
15887 ///
15888 /// # Example
15889 /// ```ignore,no_run
15890 /// # use google_cloud_datacatalog_v1::model::UsageStats;
15891 /// let x = UsageStats::new().set_total_cancellations(42.0);
15892 /// ```
15893 pub fn set_total_cancellations<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
15894 self.total_cancellations = v.into();
15895 self
15896 }
15897
15898 /// Sets the value of [total_execution_time_for_completions_millis][crate::model::UsageStats::total_execution_time_for_completions_millis].
15899 ///
15900 /// # Example
15901 /// ```ignore,no_run
15902 /// # use google_cloud_datacatalog_v1::model::UsageStats;
15903 /// let x = UsageStats::new().set_total_execution_time_for_completions_millis(42.0);
15904 /// ```
15905 pub fn set_total_execution_time_for_completions_millis<T: std::convert::Into<f32>>(
15906 mut self,
15907 v: T,
15908 ) -> Self {
15909 self.total_execution_time_for_completions_millis = v.into();
15910 self
15911 }
15912}
15913
15914impl wkt::message::Message for UsageStats {
15915 fn typename() -> &'static str {
15916 "type.googleapis.com/google.cloud.datacatalog.v1.UsageStats"
15917 }
15918}
15919
15920/// Common statistics on the entry's usage.
15921///
15922/// They can be set on any system.
15923#[derive(Clone, Default, PartialEq)]
15924#[non_exhaustive]
15925pub struct CommonUsageStats {
15926 /// View count in source system.
15927 pub view_count: std::option::Option<i64>,
15928
15929 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15930}
15931
15932impl CommonUsageStats {
15933 pub fn new() -> Self {
15934 std::default::Default::default()
15935 }
15936
15937 /// Sets the value of [view_count][crate::model::CommonUsageStats::view_count].
15938 ///
15939 /// # Example
15940 /// ```ignore,no_run
15941 /// # use google_cloud_datacatalog_v1::model::CommonUsageStats;
15942 /// let x = CommonUsageStats::new().set_view_count(42);
15943 /// ```
15944 pub fn set_view_count<T>(mut self, v: T) -> Self
15945 where
15946 T: std::convert::Into<i64>,
15947 {
15948 self.view_count = std::option::Option::Some(v.into());
15949 self
15950 }
15951
15952 /// Sets or clears the value of [view_count][crate::model::CommonUsageStats::view_count].
15953 ///
15954 /// # Example
15955 /// ```ignore,no_run
15956 /// # use google_cloud_datacatalog_v1::model::CommonUsageStats;
15957 /// let x = CommonUsageStats::new().set_or_clear_view_count(Some(42));
15958 /// let x = CommonUsageStats::new().set_or_clear_view_count(None::<i32>);
15959 /// ```
15960 pub fn set_or_clear_view_count<T>(mut self, v: std::option::Option<T>) -> Self
15961 where
15962 T: std::convert::Into<i64>,
15963 {
15964 self.view_count = v.map(|x| x.into());
15965 self
15966 }
15967}
15968
15969impl wkt::message::Message for CommonUsageStats {
15970 fn typename() -> &'static str {
15971 "type.googleapis.com/google.cloud.datacatalog.v1.CommonUsageStats"
15972 }
15973}
15974
15975/// The set of all usage signals that Data Catalog stores.
15976///
15977/// Note: Usually, these signals are updated daily. In rare cases, an update may
15978/// fail but will be performed again on the next day.
15979#[derive(Clone, Default, PartialEq)]
15980#[non_exhaustive]
15981pub struct UsageSignal {
15982 /// The end timestamp of the duration of usage statistics.
15983 pub update_time: std::option::Option<wkt::Timestamp>,
15984
15985 /// Output only. BigQuery usage statistics over each of the predefined time
15986 /// ranges.
15987 ///
15988 /// Supported time ranges are `{"24H", "7D", "30D"}`.
15989 pub usage_within_time_range:
15990 std::collections::HashMap<std::string::String, crate::model::UsageStats>,
15991
15992 /// Common usage statistics over each of the predefined time ranges.
15993 ///
15994 /// Supported time ranges are `{"24H", "7D", "30D", "Lifetime"}`.
15995 pub common_usage_within_time_range:
15996 std::collections::HashMap<std::string::String, crate::model::CommonUsageStats>,
15997
15998 /// Favorite count in the source system.
15999 pub favorite_count: std::option::Option<i64>,
16000
16001 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16002}
16003
16004impl UsageSignal {
16005 pub fn new() -> Self {
16006 std::default::Default::default()
16007 }
16008
16009 /// Sets the value of [update_time][crate::model::UsageSignal::update_time].
16010 ///
16011 /// # Example
16012 /// ```ignore,no_run
16013 /// # use google_cloud_datacatalog_v1::model::UsageSignal;
16014 /// use wkt::Timestamp;
16015 /// let x = UsageSignal::new().set_update_time(Timestamp::default()/* use setters */);
16016 /// ```
16017 pub fn set_update_time<T>(mut self, v: T) -> Self
16018 where
16019 T: std::convert::Into<wkt::Timestamp>,
16020 {
16021 self.update_time = std::option::Option::Some(v.into());
16022 self
16023 }
16024
16025 /// Sets or clears the value of [update_time][crate::model::UsageSignal::update_time].
16026 ///
16027 /// # Example
16028 /// ```ignore,no_run
16029 /// # use google_cloud_datacatalog_v1::model::UsageSignal;
16030 /// use wkt::Timestamp;
16031 /// let x = UsageSignal::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
16032 /// let x = UsageSignal::new().set_or_clear_update_time(None::<Timestamp>);
16033 /// ```
16034 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
16035 where
16036 T: std::convert::Into<wkt::Timestamp>,
16037 {
16038 self.update_time = v.map(|x| x.into());
16039 self
16040 }
16041
16042 /// Sets the value of [usage_within_time_range][crate::model::UsageSignal::usage_within_time_range].
16043 ///
16044 /// # Example
16045 /// ```ignore,no_run
16046 /// # use google_cloud_datacatalog_v1::model::UsageSignal;
16047 /// use google_cloud_datacatalog_v1::model::UsageStats;
16048 /// let x = UsageSignal::new().set_usage_within_time_range([
16049 /// ("key0", UsageStats::default()/* use setters */),
16050 /// ("key1", UsageStats::default()/* use (different) setters */),
16051 /// ]);
16052 /// ```
16053 pub fn set_usage_within_time_range<T, K, V>(mut self, v: T) -> Self
16054 where
16055 T: std::iter::IntoIterator<Item = (K, V)>,
16056 K: std::convert::Into<std::string::String>,
16057 V: std::convert::Into<crate::model::UsageStats>,
16058 {
16059 use std::iter::Iterator;
16060 self.usage_within_time_range = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16061 self
16062 }
16063
16064 /// Sets the value of [common_usage_within_time_range][crate::model::UsageSignal::common_usage_within_time_range].
16065 ///
16066 /// # Example
16067 /// ```ignore,no_run
16068 /// # use google_cloud_datacatalog_v1::model::UsageSignal;
16069 /// use google_cloud_datacatalog_v1::model::CommonUsageStats;
16070 /// let x = UsageSignal::new().set_common_usage_within_time_range([
16071 /// ("key0", CommonUsageStats::default()/* use setters */),
16072 /// ("key1", CommonUsageStats::default()/* use (different) setters */),
16073 /// ]);
16074 /// ```
16075 pub fn set_common_usage_within_time_range<T, K, V>(mut self, v: T) -> Self
16076 where
16077 T: std::iter::IntoIterator<Item = (K, V)>,
16078 K: std::convert::Into<std::string::String>,
16079 V: std::convert::Into<crate::model::CommonUsageStats>,
16080 {
16081 use std::iter::Iterator;
16082 self.common_usage_within_time_range =
16083 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16084 self
16085 }
16086
16087 /// Sets the value of [favorite_count][crate::model::UsageSignal::favorite_count].
16088 ///
16089 /// # Example
16090 /// ```ignore,no_run
16091 /// # use google_cloud_datacatalog_v1::model::UsageSignal;
16092 /// let x = UsageSignal::new().set_favorite_count(42);
16093 /// ```
16094 pub fn set_favorite_count<T>(mut self, v: T) -> Self
16095 where
16096 T: std::convert::Into<i64>,
16097 {
16098 self.favorite_count = std::option::Option::Some(v.into());
16099 self
16100 }
16101
16102 /// Sets or clears the value of [favorite_count][crate::model::UsageSignal::favorite_count].
16103 ///
16104 /// # Example
16105 /// ```ignore,no_run
16106 /// # use google_cloud_datacatalog_v1::model::UsageSignal;
16107 /// let x = UsageSignal::new().set_or_clear_favorite_count(Some(42));
16108 /// let x = UsageSignal::new().set_or_clear_favorite_count(None::<i32>);
16109 /// ```
16110 pub fn set_or_clear_favorite_count<T>(mut self, v: std::option::Option<T>) -> Self
16111 where
16112 T: std::convert::Into<i64>,
16113 {
16114 self.favorite_count = v.map(|x| x.into());
16115 self
16116 }
16117}
16118
16119impl wkt::message::Message for UsageSignal {
16120 fn typename() -> &'static str {
16121 "type.googleapis.com/google.cloud.datacatalog.v1.UsageSignal"
16122 }
16123}
16124
16125/// This enum lists all the systems that Data Catalog integrates with.
16126///
16127/// # Working with unknown values
16128///
16129/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16130/// additional enum variants at any time. Adding new variants is not considered
16131/// a breaking change. Applications should write their code in anticipation of:
16132///
16133/// - New values appearing in future releases of the client library, **and**
16134/// - New values received dynamically, without application changes.
16135///
16136/// Please consult the [Working with enums] section in the user guide for some
16137/// guidelines.
16138///
16139/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16140#[derive(Clone, Debug, PartialEq)]
16141#[non_exhaustive]
16142pub enum IntegratedSystem {
16143 /// Default unknown system.
16144 Unspecified,
16145 /// BigQuery.
16146 Bigquery,
16147 /// Cloud Pub/Sub.
16148 CloudPubsub,
16149 /// Dataproc Metastore.
16150 DataprocMetastore,
16151 /// Dataplex.
16152 Dataplex,
16153 /// Cloud Spanner
16154 CloudSpanner,
16155 /// Cloud Bigtable
16156 CloudBigtable,
16157 /// Cloud Sql
16158 CloudSql,
16159 /// Looker
16160 Looker,
16161 /// Vertex AI
16162 VertexAi,
16163 /// If set, the enum was initialized with an unknown value.
16164 ///
16165 /// Applications can examine the value using [IntegratedSystem::value] or
16166 /// [IntegratedSystem::name].
16167 UnknownValue(integrated_system::UnknownValue),
16168}
16169
16170#[doc(hidden)]
16171pub mod integrated_system {
16172 #[allow(unused_imports)]
16173 use super::*;
16174 #[derive(Clone, Debug, PartialEq)]
16175 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16176}
16177
16178impl IntegratedSystem {
16179 /// Gets the enum value.
16180 ///
16181 /// Returns `None` if the enum contains an unknown value deserialized from
16182 /// the string representation of enums.
16183 pub fn value(&self) -> std::option::Option<i32> {
16184 match self {
16185 Self::Unspecified => std::option::Option::Some(0),
16186 Self::Bigquery => std::option::Option::Some(1),
16187 Self::CloudPubsub => std::option::Option::Some(2),
16188 Self::DataprocMetastore => std::option::Option::Some(3),
16189 Self::Dataplex => std::option::Option::Some(4),
16190 Self::CloudSpanner => std::option::Option::Some(6),
16191 Self::CloudBigtable => std::option::Option::Some(7),
16192 Self::CloudSql => std::option::Option::Some(8),
16193 Self::Looker => std::option::Option::Some(9),
16194 Self::VertexAi => std::option::Option::Some(10),
16195 Self::UnknownValue(u) => u.0.value(),
16196 }
16197 }
16198
16199 /// Gets the enum value as a string.
16200 ///
16201 /// Returns `None` if the enum contains an unknown value deserialized from
16202 /// the integer representation of enums.
16203 pub fn name(&self) -> std::option::Option<&str> {
16204 match self {
16205 Self::Unspecified => std::option::Option::Some("INTEGRATED_SYSTEM_UNSPECIFIED"),
16206 Self::Bigquery => std::option::Option::Some("BIGQUERY"),
16207 Self::CloudPubsub => std::option::Option::Some("CLOUD_PUBSUB"),
16208 Self::DataprocMetastore => std::option::Option::Some("DATAPROC_METASTORE"),
16209 Self::Dataplex => std::option::Option::Some("DATAPLEX"),
16210 Self::CloudSpanner => std::option::Option::Some("CLOUD_SPANNER"),
16211 Self::CloudBigtable => std::option::Option::Some("CLOUD_BIGTABLE"),
16212 Self::CloudSql => std::option::Option::Some("CLOUD_SQL"),
16213 Self::Looker => std::option::Option::Some("LOOKER"),
16214 Self::VertexAi => std::option::Option::Some("VERTEX_AI"),
16215 Self::UnknownValue(u) => u.0.name(),
16216 }
16217 }
16218}
16219
16220impl std::default::Default for IntegratedSystem {
16221 fn default() -> Self {
16222 use std::convert::From;
16223 Self::from(0)
16224 }
16225}
16226
16227impl std::fmt::Display for IntegratedSystem {
16228 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16229 wkt::internal::display_enum(f, self.name(), self.value())
16230 }
16231}
16232
16233impl std::convert::From<i32> for IntegratedSystem {
16234 fn from(value: i32) -> Self {
16235 match value {
16236 0 => Self::Unspecified,
16237 1 => Self::Bigquery,
16238 2 => Self::CloudPubsub,
16239 3 => Self::DataprocMetastore,
16240 4 => Self::Dataplex,
16241 6 => Self::CloudSpanner,
16242 7 => Self::CloudBigtable,
16243 8 => Self::CloudSql,
16244 9 => Self::Looker,
16245 10 => Self::VertexAi,
16246 _ => Self::UnknownValue(integrated_system::UnknownValue(
16247 wkt::internal::UnknownEnumValue::Integer(value),
16248 )),
16249 }
16250 }
16251}
16252
16253impl std::convert::From<&str> for IntegratedSystem {
16254 fn from(value: &str) -> Self {
16255 use std::string::ToString;
16256 match value {
16257 "INTEGRATED_SYSTEM_UNSPECIFIED" => Self::Unspecified,
16258 "BIGQUERY" => Self::Bigquery,
16259 "CLOUD_PUBSUB" => Self::CloudPubsub,
16260 "DATAPROC_METASTORE" => Self::DataprocMetastore,
16261 "DATAPLEX" => Self::Dataplex,
16262 "CLOUD_SPANNER" => Self::CloudSpanner,
16263 "CLOUD_BIGTABLE" => Self::CloudBigtable,
16264 "CLOUD_SQL" => Self::CloudSql,
16265 "LOOKER" => Self::Looker,
16266 "VERTEX_AI" => Self::VertexAi,
16267 _ => Self::UnknownValue(integrated_system::UnknownValue(
16268 wkt::internal::UnknownEnumValue::String(value.to_string()),
16269 )),
16270 }
16271 }
16272}
16273
16274impl serde::ser::Serialize for IntegratedSystem {
16275 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16276 where
16277 S: serde::Serializer,
16278 {
16279 match self {
16280 Self::Unspecified => serializer.serialize_i32(0),
16281 Self::Bigquery => serializer.serialize_i32(1),
16282 Self::CloudPubsub => serializer.serialize_i32(2),
16283 Self::DataprocMetastore => serializer.serialize_i32(3),
16284 Self::Dataplex => serializer.serialize_i32(4),
16285 Self::CloudSpanner => serializer.serialize_i32(6),
16286 Self::CloudBigtable => serializer.serialize_i32(7),
16287 Self::CloudSql => serializer.serialize_i32(8),
16288 Self::Looker => serializer.serialize_i32(9),
16289 Self::VertexAi => serializer.serialize_i32(10),
16290 Self::UnknownValue(u) => u.0.serialize(serializer),
16291 }
16292 }
16293}
16294
16295impl<'de> serde::de::Deserialize<'de> for IntegratedSystem {
16296 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16297 where
16298 D: serde::Deserializer<'de>,
16299 {
16300 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IntegratedSystem>::new(
16301 ".google.cloud.datacatalog.v1.IntegratedSystem",
16302 ))
16303 }
16304}
16305
16306/// This enum describes all the systems that manage
16307/// Taxonomy and PolicyTag resources in DataCatalog.
16308///
16309/// # Working with unknown values
16310///
16311/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16312/// additional enum variants at any time. Adding new variants is not considered
16313/// a breaking change. Applications should write their code in anticipation of:
16314///
16315/// - New values appearing in future releases of the client library, **and**
16316/// - New values received dynamically, without application changes.
16317///
16318/// Please consult the [Working with enums] section in the user guide for some
16319/// guidelines.
16320///
16321/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16322#[derive(Clone, Debug, PartialEq)]
16323#[non_exhaustive]
16324pub enum ManagingSystem {
16325 /// Default value
16326 Unspecified,
16327 /// Dataplex.
16328 Dataplex,
16329 /// Other
16330 Other,
16331 /// If set, the enum was initialized with an unknown value.
16332 ///
16333 /// Applications can examine the value using [ManagingSystem::value] or
16334 /// [ManagingSystem::name].
16335 UnknownValue(managing_system::UnknownValue),
16336}
16337
16338#[doc(hidden)]
16339pub mod managing_system {
16340 #[allow(unused_imports)]
16341 use super::*;
16342 #[derive(Clone, Debug, PartialEq)]
16343 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16344}
16345
16346impl ManagingSystem {
16347 /// Gets the enum value.
16348 ///
16349 /// Returns `None` if the enum contains an unknown value deserialized from
16350 /// the string representation of enums.
16351 pub fn value(&self) -> std::option::Option<i32> {
16352 match self {
16353 Self::Unspecified => std::option::Option::Some(0),
16354 Self::Dataplex => std::option::Option::Some(1),
16355 Self::Other => std::option::Option::Some(2),
16356 Self::UnknownValue(u) => u.0.value(),
16357 }
16358 }
16359
16360 /// Gets the enum value as a string.
16361 ///
16362 /// Returns `None` if the enum contains an unknown value deserialized from
16363 /// the integer representation of enums.
16364 pub fn name(&self) -> std::option::Option<&str> {
16365 match self {
16366 Self::Unspecified => std::option::Option::Some("MANAGING_SYSTEM_UNSPECIFIED"),
16367 Self::Dataplex => std::option::Option::Some("MANAGING_SYSTEM_DATAPLEX"),
16368 Self::Other => std::option::Option::Some("MANAGING_SYSTEM_OTHER"),
16369 Self::UnknownValue(u) => u.0.name(),
16370 }
16371 }
16372}
16373
16374impl std::default::Default for ManagingSystem {
16375 fn default() -> Self {
16376 use std::convert::From;
16377 Self::from(0)
16378 }
16379}
16380
16381impl std::fmt::Display for ManagingSystem {
16382 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16383 wkt::internal::display_enum(f, self.name(), self.value())
16384 }
16385}
16386
16387impl std::convert::From<i32> for ManagingSystem {
16388 fn from(value: i32) -> Self {
16389 match value {
16390 0 => Self::Unspecified,
16391 1 => Self::Dataplex,
16392 2 => Self::Other,
16393 _ => Self::UnknownValue(managing_system::UnknownValue(
16394 wkt::internal::UnknownEnumValue::Integer(value),
16395 )),
16396 }
16397 }
16398}
16399
16400impl std::convert::From<&str> for ManagingSystem {
16401 fn from(value: &str) -> Self {
16402 use std::string::ToString;
16403 match value {
16404 "MANAGING_SYSTEM_UNSPECIFIED" => Self::Unspecified,
16405 "MANAGING_SYSTEM_DATAPLEX" => Self::Dataplex,
16406 "MANAGING_SYSTEM_OTHER" => Self::Other,
16407 _ => Self::UnknownValue(managing_system::UnknownValue(
16408 wkt::internal::UnknownEnumValue::String(value.to_string()),
16409 )),
16410 }
16411 }
16412}
16413
16414impl serde::ser::Serialize for ManagingSystem {
16415 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16416 where
16417 S: serde::Serializer,
16418 {
16419 match self {
16420 Self::Unspecified => serializer.serialize_i32(0),
16421 Self::Dataplex => serializer.serialize_i32(1),
16422 Self::Other => serializer.serialize_i32(2),
16423 Self::UnknownValue(u) => u.0.serialize(serializer),
16424 }
16425 }
16426}
16427
16428impl<'de> serde::de::Deserialize<'de> for ManagingSystem {
16429 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16430 where
16431 D: serde::Deserializer<'de>,
16432 {
16433 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ManagingSystem>::new(
16434 ".google.cloud.datacatalog.v1.ManagingSystem",
16435 ))
16436 }
16437}
16438
16439/// Metadata automatically ingested from Google Cloud resources like BigQuery
16440/// tables or Pub/Sub topics always uses enum values from `EntryType` as the type
16441/// of entry.
16442///
16443/// Other sources of metadata like Hive or Oracle databases can identify the type
16444/// by either using one of the enum values from `EntryType` (for example,
16445/// `FILESET` for a Cloud Storage fileset) or specifying a custom value using
16446/// the [`Entry`](#resource:-entry) field `user_specified_type`. For more
16447/// information, see
16448/// [Surface files from Cloud Storage with fileset
16449/// entries](/data-catalog/docs/how-to/filesets) or [Create custom entries for
16450/// your data sources](/data-catalog/docs/how-to/custom-entries).
16451///
16452/// # Working with unknown values
16453///
16454/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16455/// additional enum variants at any time. Adding new variants is not considered
16456/// a breaking change. Applications should write their code in anticipation of:
16457///
16458/// - New values appearing in future releases of the client library, **and**
16459/// - New values received dynamically, without application changes.
16460///
16461/// Please consult the [Working with enums] section in the user guide for some
16462/// guidelines.
16463///
16464/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16465#[derive(Clone, Debug, PartialEq)]
16466#[non_exhaustive]
16467pub enum EntryType {
16468 /// Default unknown type.
16469 Unspecified,
16470 /// The entry type that has a GoogleSQL schema, including
16471 /// logical views.
16472 Table,
16473 /// The type of models.
16474 ///
16475 /// For more information, see [Supported models in BigQuery
16476 /// ML](/bigquery/docs/bqml-introduction#supported_models).
16477 Model,
16478 /// An entry type for streaming entries. For example, a Pub/Sub topic.
16479 DataStream,
16480 /// An entry type for a set of files or objects. For example, a
16481 /// Cloud Storage fileset.
16482 Fileset,
16483 /// A group of servers that work together. For example, a Kafka cluster.
16484 Cluster,
16485 /// A database.
16486 Database,
16487 /// Connection to a data source. For example, a BigQuery
16488 /// connection.
16489 DataSourceConnection,
16490 /// Routine, for example, a BigQuery routine.
16491 Routine,
16492 /// A Dataplex lake.
16493 Lake,
16494 /// A Dataplex zone.
16495 Zone,
16496 /// A service, for example, a Dataproc Metastore service.
16497 Service,
16498 /// Schema within a relational database.
16499 DatabaseSchema,
16500 /// A Dashboard, for example from Looker.
16501 Dashboard,
16502 /// A Looker Explore.
16503 ///
16504 /// For more information, see [Looker Explore API]
16505 /// (<https://developers.looker.com/api/explorer/4.0/methods/LookmlModel/lookml_model_explore>).
16506 Explore,
16507 /// A Looker Look.
16508 ///
16509 /// For more information, see [Looker Look API]
16510 /// (<https://developers.looker.com/api/explorer/4.0/methods/Look>).
16511 Look,
16512 /// Feature Online Store resource in Vertex AI Feature Store.
16513 FeatureOnlineStore,
16514 /// Feature View resource in Vertex AI Feature Store.
16515 FeatureView,
16516 /// Feature Group resource in Vertex AI Feature Store.
16517 FeatureGroup,
16518 /// If set, the enum was initialized with an unknown value.
16519 ///
16520 /// Applications can examine the value using [EntryType::value] or
16521 /// [EntryType::name].
16522 UnknownValue(entry_type::UnknownValue),
16523}
16524
16525#[doc(hidden)]
16526pub mod entry_type {
16527 #[allow(unused_imports)]
16528 use super::*;
16529 #[derive(Clone, Debug, PartialEq)]
16530 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16531}
16532
16533impl EntryType {
16534 /// Gets the enum value.
16535 ///
16536 /// Returns `None` if the enum contains an unknown value deserialized from
16537 /// the string representation of enums.
16538 pub fn value(&self) -> std::option::Option<i32> {
16539 match self {
16540 Self::Unspecified => std::option::Option::Some(0),
16541 Self::Table => std::option::Option::Some(2),
16542 Self::Model => std::option::Option::Some(5),
16543 Self::DataStream => std::option::Option::Some(3),
16544 Self::Fileset => std::option::Option::Some(4),
16545 Self::Cluster => std::option::Option::Some(6),
16546 Self::Database => std::option::Option::Some(7),
16547 Self::DataSourceConnection => std::option::Option::Some(8),
16548 Self::Routine => std::option::Option::Some(9),
16549 Self::Lake => std::option::Option::Some(10),
16550 Self::Zone => std::option::Option::Some(11),
16551 Self::Service => std::option::Option::Some(14),
16552 Self::DatabaseSchema => std::option::Option::Some(15),
16553 Self::Dashboard => std::option::Option::Some(16),
16554 Self::Explore => std::option::Option::Some(17),
16555 Self::Look => std::option::Option::Some(18),
16556 Self::FeatureOnlineStore => std::option::Option::Some(19),
16557 Self::FeatureView => std::option::Option::Some(20),
16558 Self::FeatureGroup => std::option::Option::Some(21),
16559 Self::UnknownValue(u) => u.0.value(),
16560 }
16561 }
16562
16563 /// Gets the enum value as a string.
16564 ///
16565 /// Returns `None` if the enum contains an unknown value deserialized from
16566 /// the integer representation of enums.
16567 pub fn name(&self) -> std::option::Option<&str> {
16568 match self {
16569 Self::Unspecified => std::option::Option::Some("ENTRY_TYPE_UNSPECIFIED"),
16570 Self::Table => std::option::Option::Some("TABLE"),
16571 Self::Model => std::option::Option::Some("MODEL"),
16572 Self::DataStream => std::option::Option::Some("DATA_STREAM"),
16573 Self::Fileset => std::option::Option::Some("FILESET"),
16574 Self::Cluster => std::option::Option::Some("CLUSTER"),
16575 Self::Database => std::option::Option::Some("DATABASE"),
16576 Self::DataSourceConnection => std::option::Option::Some("DATA_SOURCE_CONNECTION"),
16577 Self::Routine => std::option::Option::Some("ROUTINE"),
16578 Self::Lake => std::option::Option::Some("LAKE"),
16579 Self::Zone => std::option::Option::Some("ZONE"),
16580 Self::Service => std::option::Option::Some("SERVICE"),
16581 Self::DatabaseSchema => std::option::Option::Some("DATABASE_SCHEMA"),
16582 Self::Dashboard => std::option::Option::Some("DASHBOARD"),
16583 Self::Explore => std::option::Option::Some("EXPLORE"),
16584 Self::Look => std::option::Option::Some("LOOK"),
16585 Self::FeatureOnlineStore => std::option::Option::Some("FEATURE_ONLINE_STORE"),
16586 Self::FeatureView => std::option::Option::Some("FEATURE_VIEW"),
16587 Self::FeatureGroup => std::option::Option::Some("FEATURE_GROUP"),
16588 Self::UnknownValue(u) => u.0.name(),
16589 }
16590 }
16591}
16592
16593impl std::default::Default for EntryType {
16594 fn default() -> Self {
16595 use std::convert::From;
16596 Self::from(0)
16597 }
16598}
16599
16600impl std::fmt::Display for EntryType {
16601 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16602 wkt::internal::display_enum(f, self.name(), self.value())
16603 }
16604}
16605
16606impl std::convert::From<i32> for EntryType {
16607 fn from(value: i32) -> Self {
16608 match value {
16609 0 => Self::Unspecified,
16610 2 => Self::Table,
16611 3 => Self::DataStream,
16612 4 => Self::Fileset,
16613 5 => Self::Model,
16614 6 => Self::Cluster,
16615 7 => Self::Database,
16616 8 => Self::DataSourceConnection,
16617 9 => Self::Routine,
16618 10 => Self::Lake,
16619 11 => Self::Zone,
16620 14 => Self::Service,
16621 15 => Self::DatabaseSchema,
16622 16 => Self::Dashboard,
16623 17 => Self::Explore,
16624 18 => Self::Look,
16625 19 => Self::FeatureOnlineStore,
16626 20 => Self::FeatureView,
16627 21 => Self::FeatureGroup,
16628 _ => Self::UnknownValue(entry_type::UnknownValue(
16629 wkt::internal::UnknownEnumValue::Integer(value),
16630 )),
16631 }
16632 }
16633}
16634
16635impl std::convert::From<&str> for EntryType {
16636 fn from(value: &str) -> Self {
16637 use std::string::ToString;
16638 match value {
16639 "ENTRY_TYPE_UNSPECIFIED" => Self::Unspecified,
16640 "TABLE" => Self::Table,
16641 "MODEL" => Self::Model,
16642 "DATA_STREAM" => Self::DataStream,
16643 "FILESET" => Self::Fileset,
16644 "CLUSTER" => Self::Cluster,
16645 "DATABASE" => Self::Database,
16646 "DATA_SOURCE_CONNECTION" => Self::DataSourceConnection,
16647 "ROUTINE" => Self::Routine,
16648 "LAKE" => Self::Lake,
16649 "ZONE" => Self::Zone,
16650 "SERVICE" => Self::Service,
16651 "DATABASE_SCHEMA" => Self::DatabaseSchema,
16652 "DASHBOARD" => Self::Dashboard,
16653 "EXPLORE" => Self::Explore,
16654 "LOOK" => Self::Look,
16655 "FEATURE_ONLINE_STORE" => Self::FeatureOnlineStore,
16656 "FEATURE_VIEW" => Self::FeatureView,
16657 "FEATURE_GROUP" => Self::FeatureGroup,
16658 _ => Self::UnknownValue(entry_type::UnknownValue(
16659 wkt::internal::UnknownEnumValue::String(value.to_string()),
16660 )),
16661 }
16662 }
16663}
16664
16665impl serde::ser::Serialize for EntryType {
16666 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16667 where
16668 S: serde::Serializer,
16669 {
16670 match self {
16671 Self::Unspecified => serializer.serialize_i32(0),
16672 Self::Table => serializer.serialize_i32(2),
16673 Self::Model => serializer.serialize_i32(5),
16674 Self::DataStream => serializer.serialize_i32(3),
16675 Self::Fileset => serializer.serialize_i32(4),
16676 Self::Cluster => serializer.serialize_i32(6),
16677 Self::Database => serializer.serialize_i32(7),
16678 Self::DataSourceConnection => serializer.serialize_i32(8),
16679 Self::Routine => serializer.serialize_i32(9),
16680 Self::Lake => serializer.serialize_i32(10),
16681 Self::Zone => serializer.serialize_i32(11),
16682 Self::Service => serializer.serialize_i32(14),
16683 Self::DatabaseSchema => serializer.serialize_i32(15),
16684 Self::Dashboard => serializer.serialize_i32(16),
16685 Self::Explore => serializer.serialize_i32(17),
16686 Self::Look => serializer.serialize_i32(18),
16687 Self::FeatureOnlineStore => serializer.serialize_i32(19),
16688 Self::FeatureView => serializer.serialize_i32(20),
16689 Self::FeatureGroup => serializer.serialize_i32(21),
16690 Self::UnknownValue(u) => u.0.serialize(serializer),
16691 }
16692 }
16693}
16694
16695impl<'de> serde::de::Deserialize<'de> for EntryType {
16696 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16697 where
16698 D: serde::Deserializer<'de>,
16699 {
16700 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EntryType>::new(
16701 ".google.cloud.datacatalog.v1.EntryType",
16702 ))
16703 }
16704}
16705
16706/// Configuration related to the opt-in status for the migration of TagTemplates
16707/// to Dataplex.
16708///
16709/// # Working with unknown values
16710///
16711/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16712/// additional enum variants at any time. Adding new variants is not considered
16713/// a breaking change. Applications should write their code in anticipation of:
16714///
16715/// - New values appearing in future releases of the client library, **and**
16716/// - New values received dynamically, without application changes.
16717///
16718/// Please consult the [Working with enums] section in the user guide for some
16719/// guidelines.
16720///
16721/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16722#[derive(Clone, Debug, PartialEq)]
16723#[non_exhaustive]
16724pub enum TagTemplateMigration {
16725 /// Default value. Migration of Tag Templates from Data Catalog to Dataplex is
16726 /// not performed.
16727 Unspecified,
16728 /// Migration of Tag Templates from Data Catalog to Dataplex is enabled.
16729 Enabled,
16730 /// Migration of Tag Templates from Data Catalog to Dataplex is disabled.
16731 Disabled,
16732 /// If set, the enum was initialized with an unknown value.
16733 ///
16734 /// Applications can examine the value using [TagTemplateMigration::value] or
16735 /// [TagTemplateMigration::name].
16736 UnknownValue(tag_template_migration::UnknownValue),
16737}
16738
16739#[doc(hidden)]
16740pub mod tag_template_migration {
16741 #[allow(unused_imports)]
16742 use super::*;
16743 #[derive(Clone, Debug, PartialEq)]
16744 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16745}
16746
16747impl TagTemplateMigration {
16748 /// Gets the enum value.
16749 ///
16750 /// Returns `None` if the enum contains an unknown value deserialized from
16751 /// the string representation of enums.
16752 pub fn value(&self) -> std::option::Option<i32> {
16753 match self {
16754 Self::Unspecified => std::option::Option::Some(0),
16755 Self::Enabled => std::option::Option::Some(1),
16756 Self::Disabled => std::option::Option::Some(2),
16757 Self::UnknownValue(u) => u.0.value(),
16758 }
16759 }
16760
16761 /// Gets the enum value as a string.
16762 ///
16763 /// Returns `None` if the enum contains an unknown value deserialized from
16764 /// the integer representation of enums.
16765 pub fn name(&self) -> std::option::Option<&str> {
16766 match self {
16767 Self::Unspecified => std::option::Option::Some("TAG_TEMPLATE_MIGRATION_UNSPECIFIED"),
16768 Self::Enabled => std::option::Option::Some("TAG_TEMPLATE_MIGRATION_ENABLED"),
16769 Self::Disabled => std::option::Option::Some("TAG_TEMPLATE_MIGRATION_DISABLED"),
16770 Self::UnknownValue(u) => u.0.name(),
16771 }
16772 }
16773}
16774
16775impl std::default::Default for TagTemplateMigration {
16776 fn default() -> Self {
16777 use std::convert::From;
16778 Self::from(0)
16779 }
16780}
16781
16782impl std::fmt::Display for TagTemplateMigration {
16783 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16784 wkt::internal::display_enum(f, self.name(), self.value())
16785 }
16786}
16787
16788impl std::convert::From<i32> for TagTemplateMigration {
16789 fn from(value: i32) -> Self {
16790 match value {
16791 0 => Self::Unspecified,
16792 1 => Self::Enabled,
16793 2 => Self::Disabled,
16794 _ => Self::UnknownValue(tag_template_migration::UnknownValue(
16795 wkt::internal::UnknownEnumValue::Integer(value),
16796 )),
16797 }
16798 }
16799}
16800
16801impl std::convert::From<&str> for TagTemplateMigration {
16802 fn from(value: &str) -> Self {
16803 use std::string::ToString;
16804 match value {
16805 "TAG_TEMPLATE_MIGRATION_UNSPECIFIED" => Self::Unspecified,
16806 "TAG_TEMPLATE_MIGRATION_ENABLED" => Self::Enabled,
16807 "TAG_TEMPLATE_MIGRATION_DISABLED" => Self::Disabled,
16808 _ => Self::UnknownValue(tag_template_migration::UnknownValue(
16809 wkt::internal::UnknownEnumValue::String(value.to_string()),
16810 )),
16811 }
16812 }
16813}
16814
16815impl serde::ser::Serialize for TagTemplateMigration {
16816 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16817 where
16818 S: serde::Serializer,
16819 {
16820 match self {
16821 Self::Unspecified => serializer.serialize_i32(0),
16822 Self::Enabled => serializer.serialize_i32(1),
16823 Self::Disabled => serializer.serialize_i32(2),
16824 Self::UnknownValue(u) => u.0.serialize(serializer),
16825 }
16826 }
16827}
16828
16829impl<'de> serde::de::Deserialize<'de> for TagTemplateMigration {
16830 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16831 where
16832 D: serde::Deserializer<'de>,
16833 {
16834 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TagTemplateMigration>::new(
16835 ".google.cloud.datacatalog.v1.TagTemplateMigration",
16836 ))
16837 }
16838}
16839
16840/// Configuration related to the opt-in status for the UI switch to Dataplex.
16841///
16842/// # Working with unknown values
16843///
16844/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16845/// additional enum variants at any time. Adding new variants is not considered
16846/// a breaking change. Applications should write their code in anticipation of:
16847///
16848/// - New values appearing in future releases of the client library, **and**
16849/// - New values received dynamically, without application changes.
16850///
16851/// Please consult the [Working with enums] section in the user guide for some
16852/// guidelines.
16853///
16854/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16855#[derive(Clone, Debug, PartialEq)]
16856#[non_exhaustive]
16857pub enum CatalogUIExperience {
16858 /// Default value. The default UI is Dataplex.
16859 Unspecified,
16860 /// The UI is Dataplex.
16861 Enabled,
16862 /// The UI is Data Catalog.
16863 Disabled,
16864 /// If set, the enum was initialized with an unknown value.
16865 ///
16866 /// Applications can examine the value using [CatalogUIExperience::value] or
16867 /// [CatalogUIExperience::name].
16868 UnknownValue(catalog_ui_experience::UnknownValue),
16869}
16870
16871#[doc(hidden)]
16872pub mod catalog_ui_experience {
16873 #[allow(unused_imports)]
16874 use super::*;
16875 #[derive(Clone, Debug, PartialEq)]
16876 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16877}
16878
16879impl CatalogUIExperience {
16880 /// Gets the enum value.
16881 ///
16882 /// Returns `None` if the enum contains an unknown value deserialized from
16883 /// the string representation of enums.
16884 pub fn value(&self) -> std::option::Option<i32> {
16885 match self {
16886 Self::Unspecified => std::option::Option::Some(0),
16887 Self::Enabled => std::option::Option::Some(1),
16888 Self::Disabled => std::option::Option::Some(2),
16889 Self::UnknownValue(u) => u.0.value(),
16890 }
16891 }
16892
16893 /// Gets the enum value as a string.
16894 ///
16895 /// Returns `None` if the enum contains an unknown value deserialized from
16896 /// the integer representation of enums.
16897 pub fn name(&self) -> std::option::Option<&str> {
16898 match self {
16899 Self::Unspecified => std::option::Option::Some("CATALOG_UI_EXPERIENCE_UNSPECIFIED"),
16900 Self::Enabled => std::option::Option::Some("CATALOG_UI_EXPERIENCE_ENABLED"),
16901 Self::Disabled => std::option::Option::Some("CATALOG_UI_EXPERIENCE_DISABLED"),
16902 Self::UnknownValue(u) => u.0.name(),
16903 }
16904 }
16905}
16906
16907impl std::default::Default for CatalogUIExperience {
16908 fn default() -> Self {
16909 use std::convert::From;
16910 Self::from(0)
16911 }
16912}
16913
16914impl std::fmt::Display for CatalogUIExperience {
16915 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16916 wkt::internal::display_enum(f, self.name(), self.value())
16917 }
16918}
16919
16920impl std::convert::From<i32> for CatalogUIExperience {
16921 fn from(value: i32) -> Self {
16922 match value {
16923 0 => Self::Unspecified,
16924 1 => Self::Enabled,
16925 2 => Self::Disabled,
16926 _ => Self::UnknownValue(catalog_ui_experience::UnknownValue(
16927 wkt::internal::UnknownEnumValue::Integer(value),
16928 )),
16929 }
16930 }
16931}
16932
16933impl std::convert::From<&str> for CatalogUIExperience {
16934 fn from(value: &str) -> Self {
16935 use std::string::ToString;
16936 match value {
16937 "CATALOG_UI_EXPERIENCE_UNSPECIFIED" => Self::Unspecified,
16938 "CATALOG_UI_EXPERIENCE_ENABLED" => Self::Enabled,
16939 "CATALOG_UI_EXPERIENCE_DISABLED" => Self::Disabled,
16940 _ => Self::UnknownValue(catalog_ui_experience::UnknownValue(
16941 wkt::internal::UnknownEnumValue::String(value.to_string()),
16942 )),
16943 }
16944 }
16945}
16946
16947impl serde::ser::Serialize for CatalogUIExperience {
16948 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16949 where
16950 S: serde::Serializer,
16951 {
16952 match self {
16953 Self::Unspecified => serializer.serialize_i32(0),
16954 Self::Enabled => serializer.serialize_i32(1),
16955 Self::Disabled => serializer.serialize_i32(2),
16956 Self::UnknownValue(u) => u.0.serialize(serializer),
16957 }
16958 }
16959}
16960
16961impl<'de> serde::de::Deserialize<'de> for CatalogUIExperience {
16962 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16963 where
16964 D: serde::Deserializer<'de>,
16965 {
16966 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CatalogUIExperience>::new(
16967 ".google.cloud.datacatalog.v1.CatalogUIExperience",
16968 ))
16969 }
16970}
16971
16972/// The resource types that can be returned in search results.
16973///
16974/// # Working with unknown values
16975///
16976/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16977/// additional enum variants at any time. Adding new variants is not considered
16978/// a breaking change. Applications should write their code in anticipation of:
16979///
16980/// - New values appearing in future releases of the client library, **and**
16981/// - New values received dynamically, without application changes.
16982///
16983/// Please consult the [Working with enums] section in the user guide for some
16984/// guidelines.
16985///
16986/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16987#[derive(Clone, Debug, PartialEq)]
16988#[non_exhaustive]
16989pub enum SearchResultType {
16990 /// Default unknown type.
16991 Unspecified,
16992 /// An [Entry][google.cloud.datacatalog.v1.Entry].
16993 ///
16994 /// [google.cloud.datacatalog.v1.Entry]: crate::model::Entry
16995 Entry,
16996 /// A [TagTemplate][google.cloud.datacatalog.v1.TagTemplate].
16997 ///
16998 /// [google.cloud.datacatalog.v1.TagTemplate]: crate::model::TagTemplate
16999 TagTemplate,
17000 /// An [EntryGroup][google.cloud.datacatalog.v1.EntryGroup].
17001 ///
17002 /// [google.cloud.datacatalog.v1.EntryGroup]: crate::model::EntryGroup
17003 EntryGroup,
17004 /// If set, the enum was initialized with an unknown value.
17005 ///
17006 /// Applications can examine the value using [SearchResultType::value] or
17007 /// [SearchResultType::name].
17008 UnknownValue(search_result_type::UnknownValue),
17009}
17010
17011#[doc(hidden)]
17012pub mod search_result_type {
17013 #[allow(unused_imports)]
17014 use super::*;
17015 #[derive(Clone, Debug, PartialEq)]
17016 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17017}
17018
17019impl SearchResultType {
17020 /// Gets the enum value.
17021 ///
17022 /// Returns `None` if the enum contains an unknown value deserialized from
17023 /// the string representation of enums.
17024 pub fn value(&self) -> std::option::Option<i32> {
17025 match self {
17026 Self::Unspecified => std::option::Option::Some(0),
17027 Self::Entry => std::option::Option::Some(1),
17028 Self::TagTemplate => std::option::Option::Some(2),
17029 Self::EntryGroup => std::option::Option::Some(3),
17030 Self::UnknownValue(u) => u.0.value(),
17031 }
17032 }
17033
17034 /// Gets the enum value as a string.
17035 ///
17036 /// Returns `None` if the enum contains an unknown value deserialized from
17037 /// the integer representation of enums.
17038 pub fn name(&self) -> std::option::Option<&str> {
17039 match self {
17040 Self::Unspecified => std::option::Option::Some("SEARCH_RESULT_TYPE_UNSPECIFIED"),
17041 Self::Entry => std::option::Option::Some("ENTRY"),
17042 Self::TagTemplate => std::option::Option::Some("TAG_TEMPLATE"),
17043 Self::EntryGroup => std::option::Option::Some("ENTRY_GROUP"),
17044 Self::UnknownValue(u) => u.0.name(),
17045 }
17046 }
17047}
17048
17049impl std::default::Default for SearchResultType {
17050 fn default() -> Self {
17051 use std::convert::From;
17052 Self::from(0)
17053 }
17054}
17055
17056impl std::fmt::Display for SearchResultType {
17057 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17058 wkt::internal::display_enum(f, self.name(), self.value())
17059 }
17060}
17061
17062impl std::convert::From<i32> for SearchResultType {
17063 fn from(value: i32) -> Self {
17064 match value {
17065 0 => Self::Unspecified,
17066 1 => Self::Entry,
17067 2 => Self::TagTemplate,
17068 3 => Self::EntryGroup,
17069 _ => Self::UnknownValue(search_result_type::UnknownValue(
17070 wkt::internal::UnknownEnumValue::Integer(value),
17071 )),
17072 }
17073 }
17074}
17075
17076impl std::convert::From<&str> for SearchResultType {
17077 fn from(value: &str) -> Self {
17078 use std::string::ToString;
17079 match value {
17080 "SEARCH_RESULT_TYPE_UNSPECIFIED" => Self::Unspecified,
17081 "ENTRY" => Self::Entry,
17082 "TAG_TEMPLATE" => Self::TagTemplate,
17083 "ENTRY_GROUP" => Self::EntryGroup,
17084 _ => Self::UnknownValue(search_result_type::UnknownValue(
17085 wkt::internal::UnknownEnumValue::String(value.to_string()),
17086 )),
17087 }
17088 }
17089}
17090
17091impl serde::ser::Serialize for SearchResultType {
17092 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17093 where
17094 S: serde::Serializer,
17095 {
17096 match self {
17097 Self::Unspecified => serializer.serialize_i32(0),
17098 Self::Entry => serializer.serialize_i32(1),
17099 Self::TagTemplate => serializer.serialize_i32(2),
17100 Self::EntryGroup => serializer.serialize_i32(3),
17101 Self::UnknownValue(u) => u.0.serialize(serializer),
17102 }
17103 }
17104}
17105
17106impl<'de> serde::de::Deserialize<'de> for SearchResultType {
17107 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17108 where
17109 D: serde::Deserializer<'de>,
17110 {
17111 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SearchResultType>::new(
17112 ".google.cloud.datacatalog.v1.SearchResultType",
17113 ))
17114 }
17115}
17116
17117/// Table source type.
17118///
17119/// # Working with unknown values
17120///
17121/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17122/// additional enum variants at any time. Adding new variants is not considered
17123/// a breaking change. Applications should write their code in anticipation of:
17124///
17125/// - New values appearing in future releases of the client library, **and**
17126/// - New values received dynamically, without application changes.
17127///
17128/// Please consult the [Working with enums] section in the user guide for some
17129/// guidelines.
17130///
17131/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17132#[derive(Clone, Debug, PartialEq)]
17133#[non_exhaustive]
17134pub enum TableSourceType {
17135 /// Default unknown type.
17136 Unspecified,
17137 /// Table view.
17138 BigqueryView,
17139 /// BigQuery native table.
17140 BigqueryTable,
17141 /// BigQuery materialized view.
17142 BigqueryMaterializedView,
17143 /// If set, the enum was initialized with an unknown value.
17144 ///
17145 /// Applications can examine the value using [TableSourceType::value] or
17146 /// [TableSourceType::name].
17147 UnknownValue(table_source_type::UnknownValue),
17148}
17149
17150#[doc(hidden)]
17151pub mod table_source_type {
17152 #[allow(unused_imports)]
17153 use super::*;
17154 #[derive(Clone, Debug, PartialEq)]
17155 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17156}
17157
17158impl TableSourceType {
17159 /// Gets the enum value.
17160 ///
17161 /// Returns `None` if the enum contains an unknown value deserialized from
17162 /// the string representation of enums.
17163 pub fn value(&self) -> std::option::Option<i32> {
17164 match self {
17165 Self::Unspecified => std::option::Option::Some(0),
17166 Self::BigqueryView => std::option::Option::Some(2),
17167 Self::BigqueryTable => std::option::Option::Some(5),
17168 Self::BigqueryMaterializedView => std::option::Option::Some(7),
17169 Self::UnknownValue(u) => u.0.value(),
17170 }
17171 }
17172
17173 /// Gets the enum value as a string.
17174 ///
17175 /// Returns `None` if the enum contains an unknown value deserialized from
17176 /// the integer representation of enums.
17177 pub fn name(&self) -> std::option::Option<&str> {
17178 match self {
17179 Self::Unspecified => std::option::Option::Some("TABLE_SOURCE_TYPE_UNSPECIFIED"),
17180 Self::BigqueryView => std::option::Option::Some("BIGQUERY_VIEW"),
17181 Self::BigqueryTable => std::option::Option::Some("BIGQUERY_TABLE"),
17182 Self::BigqueryMaterializedView => {
17183 std::option::Option::Some("BIGQUERY_MATERIALIZED_VIEW")
17184 }
17185 Self::UnknownValue(u) => u.0.name(),
17186 }
17187 }
17188}
17189
17190impl std::default::Default for TableSourceType {
17191 fn default() -> Self {
17192 use std::convert::From;
17193 Self::from(0)
17194 }
17195}
17196
17197impl std::fmt::Display for TableSourceType {
17198 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17199 wkt::internal::display_enum(f, self.name(), self.value())
17200 }
17201}
17202
17203impl std::convert::From<i32> for TableSourceType {
17204 fn from(value: i32) -> Self {
17205 match value {
17206 0 => Self::Unspecified,
17207 2 => Self::BigqueryView,
17208 5 => Self::BigqueryTable,
17209 7 => Self::BigqueryMaterializedView,
17210 _ => Self::UnknownValue(table_source_type::UnknownValue(
17211 wkt::internal::UnknownEnumValue::Integer(value),
17212 )),
17213 }
17214 }
17215}
17216
17217impl std::convert::From<&str> for TableSourceType {
17218 fn from(value: &str) -> Self {
17219 use std::string::ToString;
17220 match value {
17221 "TABLE_SOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
17222 "BIGQUERY_VIEW" => Self::BigqueryView,
17223 "BIGQUERY_TABLE" => Self::BigqueryTable,
17224 "BIGQUERY_MATERIALIZED_VIEW" => Self::BigqueryMaterializedView,
17225 _ => Self::UnknownValue(table_source_type::UnknownValue(
17226 wkt::internal::UnknownEnumValue::String(value.to_string()),
17227 )),
17228 }
17229 }
17230}
17231
17232impl serde::ser::Serialize for TableSourceType {
17233 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17234 where
17235 S: serde::Serializer,
17236 {
17237 match self {
17238 Self::Unspecified => serializer.serialize_i32(0),
17239 Self::BigqueryView => serializer.serialize_i32(2),
17240 Self::BigqueryTable => serializer.serialize_i32(5),
17241 Self::BigqueryMaterializedView => serializer.serialize_i32(7),
17242 Self::UnknownValue(u) => u.0.serialize(serializer),
17243 }
17244 }
17245}
17246
17247impl<'de> serde::de::Deserialize<'de> for TableSourceType {
17248 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17249 where
17250 D: serde::Deserializer<'de>,
17251 {
17252 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TableSourceType>::new(
17253 ".google.cloud.datacatalog.v1.TableSourceType",
17254 ))
17255 }
17256}