google_cloud_bigquery_analyticshub_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate iam_v1;
25extern crate lazy_static;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// A data exchange is a container that lets you share data. Along with the
41/// descriptive information about the data exchange, it contains listings that
42/// reference shared datasets.
43#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct DataExchange {
46    /// Output only. The resource name of the data exchange.
47    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
48    pub name: std::string::String,
49
50    /// Required. Human-readable display name of the data exchange. The display
51    /// name must contain only Unicode letters, numbers (0-9), underscores (_),
52    /// dashes (-), spaces ( ), ampersands (&) and must not start or end with
53    /// spaces. Default value is an empty string. Max length: 63 bytes.
54    pub display_name: std::string::String,
55
56    /// Optional. Description of the data exchange. The description must not
57    /// contain Unicode non-characters as well as C0 and C1 control codes except
58    /// tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF).
59    /// Default value is an empty string.
60    /// Max length: 2000 bytes.
61    pub description: std::string::String,
62
63    /// Optional. Email or URL of the primary point of contact of the data
64    /// exchange. Max Length: 1000 bytes.
65    pub primary_contact: std::string::String,
66
67    /// Optional. Documentation describing the data exchange.
68    pub documentation: std::string::String,
69
70    /// Output only. Number of listings contained in the data exchange.
71    pub listing_count: i32,
72
73    /// Optional. Base64 encoded image representing the data exchange. Max
74    /// Size: 3.0MiB Expected image dimensions are 512x512 pixels, however the API
75    /// only performs validation on size of the encoded data. Note: For byte
76    /// fields, the content of the fields are base64-encoded (which increases the
77    /// size of the data by 33-36%) when using JSON on the wire.
78    pub icon: ::bytes::Bytes,
79
80    /// Optional. Configurable data sharing environment option for a data exchange.
81    pub sharing_environment_config: std::option::Option<crate::model::SharingEnvironmentConfig>,
82
83    /// Optional. Type of discovery on the discovery page for all the listings
84    /// under this exchange. Updating this field also updates (overwrites) the
85    /// discovery_type field for all the listings under this exchange.
86    pub discovery_type: std::option::Option<crate::model::DiscoveryType>,
87
88    /// Optional. By default, false.
89    /// If true, the DataExchange has an email sharing mandate enabled.
90    pub log_linked_dataset_query_user_email: std::option::Option<bool>,
91
92    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
93}
94
95impl DataExchange {
96    pub fn new() -> Self {
97        std::default::Default::default()
98    }
99
100    /// Sets the value of [name][crate::model::DataExchange::name].
101    ///
102    /// # Example
103    /// ```ignore,no_run
104    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
105    /// let x = DataExchange::new().set_name("example");
106    /// ```
107    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
108        self.name = v.into();
109        self
110    }
111
112    /// Sets the value of [display_name][crate::model::DataExchange::display_name].
113    ///
114    /// # Example
115    /// ```ignore,no_run
116    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
117    /// let x = DataExchange::new().set_display_name("example");
118    /// ```
119    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
120        self.display_name = v.into();
121        self
122    }
123
124    /// Sets the value of [description][crate::model::DataExchange::description].
125    ///
126    /// # Example
127    /// ```ignore,no_run
128    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
129    /// let x = DataExchange::new().set_description("example");
130    /// ```
131    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
132        self.description = v.into();
133        self
134    }
135
136    /// Sets the value of [primary_contact][crate::model::DataExchange::primary_contact].
137    ///
138    /// # Example
139    /// ```ignore,no_run
140    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
141    /// let x = DataExchange::new().set_primary_contact("example");
142    /// ```
143    pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
144        self.primary_contact = v.into();
145        self
146    }
147
148    /// Sets the value of [documentation][crate::model::DataExchange::documentation].
149    ///
150    /// # Example
151    /// ```ignore,no_run
152    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
153    /// let x = DataExchange::new().set_documentation("example");
154    /// ```
155    pub fn set_documentation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
156        self.documentation = v.into();
157        self
158    }
159
160    /// Sets the value of [listing_count][crate::model::DataExchange::listing_count].
161    ///
162    /// # Example
163    /// ```ignore,no_run
164    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
165    /// let x = DataExchange::new().set_listing_count(42);
166    /// ```
167    pub fn set_listing_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
168        self.listing_count = v.into();
169        self
170    }
171
172    /// Sets the value of [icon][crate::model::DataExchange::icon].
173    ///
174    /// # Example
175    /// ```ignore,no_run
176    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
177    /// let x = DataExchange::new().set_icon(bytes::Bytes::from_static(b"example"));
178    /// ```
179    pub fn set_icon<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
180        self.icon = v.into();
181        self
182    }
183
184    /// Sets the value of [sharing_environment_config][crate::model::DataExchange::sharing_environment_config].
185    ///
186    /// # Example
187    /// ```ignore,no_run
188    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
189    /// use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
190    /// let x = DataExchange::new().set_sharing_environment_config(SharingEnvironmentConfig::default()/* use setters */);
191    /// ```
192    pub fn set_sharing_environment_config<T>(mut self, v: T) -> Self
193    where
194        T: std::convert::Into<crate::model::SharingEnvironmentConfig>,
195    {
196        self.sharing_environment_config = std::option::Option::Some(v.into());
197        self
198    }
199
200    /// Sets or clears the value of [sharing_environment_config][crate::model::DataExchange::sharing_environment_config].
201    ///
202    /// # Example
203    /// ```ignore,no_run
204    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
205    /// use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
206    /// let x = DataExchange::new().set_or_clear_sharing_environment_config(Some(SharingEnvironmentConfig::default()/* use setters */));
207    /// let x = DataExchange::new().set_or_clear_sharing_environment_config(None::<SharingEnvironmentConfig>);
208    /// ```
209    pub fn set_or_clear_sharing_environment_config<T>(mut self, v: std::option::Option<T>) -> Self
210    where
211        T: std::convert::Into<crate::model::SharingEnvironmentConfig>,
212    {
213        self.sharing_environment_config = v.map(|x| x.into());
214        self
215    }
216
217    /// Sets the value of [discovery_type][crate::model::DataExchange::discovery_type].
218    ///
219    /// # Example
220    /// ```ignore,no_run
221    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
222    /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
223    /// let x0 = DataExchange::new().set_discovery_type(DiscoveryType::Private);
224    /// let x1 = DataExchange::new().set_discovery_type(DiscoveryType::Public);
225    /// ```
226    pub fn set_discovery_type<T>(mut self, v: T) -> Self
227    where
228        T: std::convert::Into<crate::model::DiscoveryType>,
229    {
230        self.discovery_type = std::option::Option::Some(v.into());
231        self
232    }
233
234    /// Sets or clears the value of [discovery_type][crate::model::DataExchange::discovery_type].
235    ///
236    /// # Example
237    /// ```ignore,no_run
238    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
239    /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
240    /// let x0 = DataExchange::new().set_or_clear_discovery_type(Some(DiscoveryType::Private));
241    /// let x1 = DataExchange::new().set_or_clear_discovery_type(Some(DiscoveryType::Public));
242    /// let x_none = DataExchange::new().set_or_clear_discovery_type(None::<DiscoveryType>);
243    /// ```
244    pub fn set_or_clear_discovery_type<T>(mut self, v: std::option::Option<T>) -> Self
245    where
246        T: std::convert::Into<crate::model::DiscoveryType>,
247    {
248        self.discovery_type = v.map(|x| x.into());
249        self
250    }
251
252    /// Sets the value of [log_linked_dataset_query_user_email][crate::model::DataExchange::log_linked_dataset_query_user_email].
253    ///
254    /// # Example
255    /// ```ignore,no_run
256    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
257    /// let x = DataExchange::new().set_log_linked_dataset_query_user_email(true);
258    /// ```
259    pub fn set_log_linked_dataset_query_user_email<T>(mut self, v: T) -> Self
260    where
261        T: std::convert::Into<bool>,
262    {
263        self.log_linked_dataset_query_user_email = std::option::Option::Some(v.into());
264        self
265    }
266
267    /// Sets or clears the value of [log_linked_dataset_query_user_email][crate::model::DataExchange::log_linked_dataset_query_user_email].
268    ///
269    /// # Example
270    /// ```ignore,no_run
271    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
272    /// let x = DataExchange::new().set_or_clear_log_linked_dataset_query_user_email(Some(false));
273    /// let x = DataExchange::new().set_or_clear_log_linked_dataset_query_user_email(None::<bool>);
274    /// ```
275    pub fn set_or_clear_log_linked_dataset_query_user_email<T>(
276        mut self,
277        v: std::option::Option<T>,
278    ) -> Self
279    where
280        T: std::convert::Into<bool>,
281    {
282        self.log_linked_dataset_query_user_email = v.map(|x| x.into());
283        self
284    }
285}
286
287impl wkt::message::Message for DataExchange {
288    fn typename() -> &'static str {
289        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DataExchange"
290    }
291}
292
293/// A query template is a container for sharing table-valued functions defined by
294/// contributors in a data clean room.
295#[derive(Clone, Default, PartialEq)]
296#[non_exhaustive]
297pub struct QueryTemplate {
298    /// Output only. The resource name of the QueryTemplate.
299    /// e.g. `projects/myproject/locations/us/dataExchanges/123/queryTemplates/456`
300    pub name: std::string::String,
301
302    /// Required. Human-readable display name of the QueryTemplate. The display
303    /// name must contain only Unicode letters, numbers (0-9), underscores (_),
304    /// dashes (-), spaces ( ), ampersands (&) and can't start or end with spaces.
305    /// Default value is an empty string. Max length: 63 bytes.
306    pub display_name: std::string::String,
307
308    /// Optional. Short description of the QueryTemplate. The description must not
309    /// contain Unicode non-characters and C0 and C1 control codes except tabs
310    /// (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default
311    /// value is an empty string. Max length: 2000 bytes.
312    pub description: std::string::String,
313
314    /// Optional. Will be deprecated.
315    /// Email or URL of the primary point of contact of the QueryTemplate.
316    /// Max Length: 1000 bytes.
317    pub proposer: std::string::String,
318
319    /// Optional. Email or URL of the primary point of contact of the
320    /// QueryTemplate. Max Length: 1000 bytes.
321    pub primary_contact: std::string::String,
322
323    /// Optional. Documentation describing the QueryTemplate.
324    pub documentation: std::string::String,
325
326    /// Output only. The QueryTemplate lifecycle state.
327    pub state: crate::model::query_template::State,
328
329    /// Optional. The routine associated with the QueryTemplate.
330    pub routine: std::option::Option<crate::model::Routine>,
331
332    /// Output only. Timestamp when the QueryTemplate was created.
333    pub create_time: std::option::Option<wkt::Timestamp>,
334
335    /// Output only. Timestamp when the QueryTemplate was last modified.
336    pub update_time: std::option::Option<wkt::Timestamp>,
337
338    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
339}
340
341impl QueryTemplate {
342    pub fn new() -> Self {
343        std::default::Default::default()
344    }
345
346    /// Sets the value of [name][crate::model::QueryTemplate::name].
347    ///
348    /// # Example
349    /// ```ignore,no_run
350    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
351    /// let x = QueryTemplate::new().set_name("example");
352    /// ```
353    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
354        self.name = v.into();
355        self
356    }
357
358    /// Sets the value of [display_name][crate::model::QueryTemplate::display_name].
359    ///
360    /// # Example
361    /// ```ignore,no_run
362    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
363    /// let x = QueryTemplate::new().set_display_name("example");
364    /// ```
365    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
366        self.display_name = v.into();
367        self
368    }
369
370    /// Sets the value of [description][crate::model::QueryTemplate::description].
371    ///
372    /// # Example
373    /// ```ignore,no_run
374    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
375    /// let x = QueryTemplate::new().set_description("example");
376    /// ```
377    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
378        self.description = v.into();
379        self
380    }
381
382    /// Sets the value of [proposer][crate::model::QueryTemplate::proposer].
383    ///
384    /// # Example
385    /// ```ignore,no_run
386    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
387    /// let x = QueryTemplate::new().set_proposer("example");
388    /// ```
389    pub fn set_proposer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
390        self.proposer = v.into();
391        self
392    }
393
394    /// Sets the value of [primary_contact][crate::model::QueryTemplate::primary_contact].
395    ///
396    /// # Example
397    /// ```ignore,no_run
398    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
399    /// let x = QueryTemplate::new().set_primary_contact("example");
400    /// ```
401    pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
402        self.primary_contact = v.into();
403        self
404    }
405
406    /// Sets the value of [documentation][crate::model::QueryTemplate::documentation].
407    ///
408    /// # Example
409    /// ```ignore,no_run
410    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
411    /// let x = QueryTemplate::new().set_documentation("example");
412    /// ```
413    pub fn set_documentation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
414        self.documentation = v.into();
415        self
416    }
417
418    /// Sets the value of [state][crate::model::QueryTemplate::state].
419    ///
420    /// # Example
421    /// ```ignore,no_run
422    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
423    /// use google_cloud_bigquery_analyticshub_v1::model::query_template::State;
424    /// let x0 = QueryTemplate::new().set_state(State::Drafted);
425    /// let x1 = QueryTemplate::new().set_state(State::Pending);
426    /// let x2 = QueryTemplate::new().set_state(State::Deleted);
427    /// ```
428    pub fn set_state<T: std::convert::Into<crate::model::query_template::State>>(
429        mut self,
430        v: T,
431    ) -> Self {
432        self.state = v.into();
433        self
434    }
435
436    /// Sets the value of [routine][crate::model::QueryTemplate::routine].
437    ///
438    /// # Example
439    /// ```ignore,no_run
440    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
441    /// use google_cloud_bigquery_analyticshub_v1::model::Routine;
442    /// let x = QueryTemplate::new().set_routine(Routine::default()/* use setters */);
443    /// ```
444    pub fn set_routine<T>(mut self, v: T) -> Self
445    where
446        T: std::convert::Into<crate::model::Routine>,
447    {
448        self.routine = std::option::Option::Some(v.into());
449        self
450    }
451
452    /// Sets or clears the value of [routine][crate::model::QueryTemplate::routine].
453    ///
454    /// # Example
455    /// ```ignore,no_run
456    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
457    /// use google_cloud_bigquery_analyticshub_v1::model::Routine;
458    /// let x = QueryTemplate::new().set_or_clear_routine(Some(Routine::default()/* use setters */));
459    /// let x = QueryTemplate::new().set_or_clear_routine(None::<Routine>);
460    /// ```
461    pub fn set_or_clear_routine<T>(mut self, v: std::option::Option<T>) -> Self
462    where
463        T: std::convert::Into<crate::model::Routine>,
464    {
465        self.routine = v.map(|x| x.into());
466        self
467    }
468
469    /// Sets the value of [create_time][crate::model::QueryTemplate::create_time].
470    ///
471    /// # Example
472    /// ```ignore,no_run
473    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
474    /// use wkt::Timestamp;
475    /// let x = QueryTemplate::new().set_create_time(Timestamp::default()/* use setters */);
476    /// ```
477    pub fn set_create_time<T>(mut self, v: T) -> Self
478    where
479        T: std::convert::Into<wkt::Timestamp>,
480    {
481        self.create_time = std::option::Option::Some(v.into());
482        self
483    }
484
485    /// Sets or clears the value of [create_time][crate::model::QueryTemplate::create_time].
486    ///
487    /// # Example
488    /// ```ignore,no_run
489    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
490    /// use wkt::Timestamp;
491    /// let x = QueryTemplate::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
492    /// let x = QueryTemplate::new().set_or_clear_create_time(None::<Timestamp>);
493    /// ```
494    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
495    where
496        T: std::convert::Into<wkt::Timestamp>,
497    {
498        self.create_time = v.map(|x| x.into());
499        self
500    }
501
502    /// Sets the value of [update_time][crate::model::QueryTemplate::update_time].
503    ///
504    /// # Example
505    /// ```ignore,no_run
506    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
507    /// use wkt::Timestamp;
508    /// let x = QueryTemplate::new().set_update_time(Timestamp::default()/* use setters */);
509    /// ```
510    pub fn set_update_time<T>(mut self, v: T) -> Self
511    where
512        T: std::convert::Into<wkt::Timestamp>,
513    {
514        self.update_time = std::option::Option::Some(v.into());
515        self
516    }
517
518    /// Sets or clears the value of [update_time][crate::model::QueryTemplate::update_time].
519    ///
520    /// # Example
521    /// ```ignore,no_run
522    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
523    /// use wkt::Timestamp;
524    /// let x = QueryTemplate::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
525    /// let x = QueryTemplate::new().set_or_clear_update_time(None::<Timestamp>);
526    /// ```
527    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
528    where
529        T: std::convert::Into<wkt::Timestamp>,
530    {
531        self.update_time = v.map(|x| x.into());
532        self
533    }
534}
535
536impl wkt::message::Message for QueryTemplate {
537    fn typename() -> &'static str {
538        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.QueryTemplate"
539    }
540}
541
542/// Defines additional types related to [QueryTemplate].
543pub mod query_template {
544    #[allow(unused_imports)]
545    use super::*;
546
547    /// The QueryTemplate lifecycle state.
548    ///
549    /// # Working with unknown values
550    ///
551    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
552    /// additional enum variants at any time. Adding new variants is not considered
553    /// a breaking change. Applications should write their code in anticipation of:
554    ///
555    /// - New values appearing in future releases of the client library, **and**
556    /// - New values received dynamically, without application changes.
557    ///
558    /// Please consult the [Working with enums] section in the user guide for some
559    /// guidelines.
560    ///
561    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
562    #[derive(Clone, Debug, PartialEq)]
563    #[non_exhaustive]
564    pub enum State {
565        /// Default value. This value is unused.
566        Unspecified,
567        /// The QueryTemplate is in draft state.
568        Drafted,
569        /// The QueryTemplate is in pending state.
570        Pending,
571        /// The QueryTemplate is in deleted state.
572        Deleted,
573        /// The QueryTemplate is in approved state.
574        Approved,
575        /// If set, the enum was initialized with an unknown value.
576        ///
577        /// Applications can examine the value using [State::value] or
578        /// [State::name].
579        UnknownValue(state::UnknownValue),
580    }
581
582    #[doc(hidden)]
583    pub mod state {
584        #[allow(unused_imports)]
585        use super::*;
586        #[derive(Clone, Debug, PartialEq)]
587        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
588    }
589
590    impl State {
591        /// Gets the enum value.
592        ///
593        /// Returns `None` if the enum contains an unknown value deserialized from
594        /// the string representation of enums.
595        pub fn value(&self) -> std::option::Option<i32> {
596            match self {
597                Self::Unspecified => std::option::Option::Some(0),
598                Self::Drafted => std::option::Option::Some(1),
599                Self::Pending => std::option::Option::Some(2),
600                Self::Deleted => std::option::Option::Some(3),
601                Self::Approved => std::option::Option::Some(4),
602                Self::UnknownValue(u) => u.0.value(),
603            }
604        }
605
606        /// Gets the enum value as a string.
607        ///
608        /// Returns `None` if the enum contains an unknown value deserialized from
609        /// the integer representation of enums.
610        pub fn name(&self) -> std::option::Option<&str> {
611            match self {
612                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
613                Self::Drafted => std::option::Option::Some("DRAFTED"),
614                Self::Pending => std::option::Option::Some("PENDING"),
615                Self::Deleted => std::option::Option::Some("DELETED"),
616                Self::Approved => std::option::Option::Some("APPROVED"),
617                Self::UnknownValue(u) => u.0.name(),
618            }
619        }
620    }
621
622    impl std::default::Default for State {
623        fn default() -> Self {
624            use std::convert::From;
625            Self::from(0)
626        }
627    }
628
629    impl std::fmt::Display for State {
630        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
631            wkt::internal::display_enum(f, self.name(), self.value())
632        }
633    }
634
635    impl std::convert::From<i32> for State {
636        fn from(value: i32) -> Self {
637            match value {
638                0 => Self::Unspecified,
639                1 => Self::Drafted,
640                2 => Self::Pending,
641                3 => Self::Deleted,
642                4 => Self::Approved,
643                _ => Self::UnknownValue(state::UnknownValue(
644                    wkt::internal::UnknownEnumValue::Integer(value),
645                )),
646            }
647        }
648    }
649
650    impl std::convert::From<&str> for State {
651        fn from(value: &str) -> Self {
652            use std::string::ToString;
653            match value {
654                "STATE_UNSPECIFIED" => Self::Unspecified,
655                "DRAFTED" => Self::Drafted,
656                "PENDING" => Self::Pending,
657                "DELETED" => Self::Deleted,
658                "APPROVED" => Self::Approved,
659                _ => Self::UnknownValue(state::UnknownValue(
660                    wkt::internal::UnknownEnumValue::String(value.to_string()),
661                )),
662            }
663        }
664    }
665
666    impl serde::ser::Serialize for State {
667        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
668        where
669            S: serde::Serializer,
670        {
671            match self {
672                Self::Unspecified => serializer.serialize_i32(0),
673                Self::Drafted => serializer.serialize_i32(1),
674                Self::Pending => serializer.serialize_i32(2),
675                Self::Deleted => serializer.serialize_i32(3),
676                Self::Approved => serializer.serialize_i32(4),
677                Self::UnknownValue(u) => u.0.serialize(serializer),
678            }
679        }
680    }
681
682    impl<'de> serde::de::Deserialize<'de> for State {
683        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
684        where
685            D: serde::Deserializer<'de>,
686        {
687            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
688                ".google.cloud.bigquery.analyticshub.v1.QueryTemplate.State",
689            ))
690        }
691    }
692}
693
694/// Represents a bigquery routine.
695#[derive(Clone, Default, PartialEq)]
696#[non_exhaustive]
697pub struct Routine {
698    /// Required. The type of routine.
699    pub routine_type: crate::model::routine::RoutineType,
700
701    /// Optional. The definition body of the routine.
702    pub definition_body: std::string::String,
703
704    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
705}
706
707impl Routine {
708    pub fn new() -> Self {
709        std::default::Default::default()
710    }
711
712    /// Sets the value of [routine_type][crate::model::Routine::routine_type].
713    ///
714    /// # Example
715    /// ```ignore,no_run
716    /// # use google_cloud_bigquery_analyticshub_v1::model::Routine;
717    /// use google_cloud_bigquery_analyticshub_v1::model::routine::RoutineType;
718    /// let x0 = Routine::new().set_routine_type(RoutineType::TableValuedFunction);
719    /// ```
720    pub fn set_routine_type<T: std::convert::Into<crate::model::routine::RoutineType>>(
721        mut self,
722        v: T,
723    ) -> Self {
724        self.routine_type = v.into();
725        self
726    }
727
728    /// Sets the value of [definition_body][crate::model::Routine::definition_body].
729    ///
730    /// # Example
731    /// ```ignore,no_run
732    /// # use google_cloud_bigquery_analyticshub_v1::model::Routine;
733    /// let x = Routine::new().set_definition_body("example");
734    /// ```
735    pub fn set_definition_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
736        self.definition_body = v.into();
737        self
738    }
739}
740
741impl wkt::message::Message for Routine {
742    fn typename() -> &'static str {
743        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Routine"
744    }
745}
746
747/// Defines additional types related to [Routine].
748pub mod routine {
749    #[allow(unused_imports)]
750    use super::*;
751
752    /// Represents the type of a given routine.
753    ///
754    /// # Working with unknown values
755    ///
756    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
757    /// additional enum variants at any time. Adding new variants is not considered
758    /// a breaking change. Applications should write their code in anticipation of:
759    ///
760    /// - New values appearing in future releases of the client library, **and**
761    /// - New values received dynamically, without application changes.
762    ///
763    /// Please consult the [Working with enums] section in the user guide for some
764    /// guidelines.
765    ///
766    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
767    #[derive(Clone, Debug, PartialEq)]
768    #[non_exhaustive]
769    pub enum RoutineType {
770        /// Default value.
771        Unspecified,
772        /// Non-built-in persistent TVF.
773        TableValuedFunction,
774        /// If set, the enum was initialized with an unknown value.
775        ///
776        /// Applications can examine the value using [RoutineType::value] or
777        /// [RoutineType::name].
778        UnknownValue(routine_type::UnknownValue),
779    }
780
781    #[doc(hidden)]
782    pub mod routine_type {
783        #[allow(unused_imports)]
784        use super::*;
785        #[derive(Clone, Debug, PartialEq)]
786        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
787    }
788
789    impl RoutineType {
790        /// Gets the enum value.
791        ///
792        /// Returns `None` if the enum contains an unknown value deserialized from
793        /// the string representation of enums.
794        pub fn value(&self) -> std::option::Option<i32> {
795            match self {
796                Self::Unspecified => std::option::Option::Some(0),
797                Self::TableValuedFunction => std::option::Option::Some(1),
798                Self::UnknownValue(u) => u.0.value(),
799            }
800        }
801
802        /// Gets the enum value as a string.
803        ///
804        /// Returns `None` if the enum contains an unknown value deserialized from
805        /// the integer representation of enums.
806        pub fn name(&self) -> std::option::Option<&str> {
807            match self {
808                Self::Unspecified => std::option::Option::Some("ROUTINE_TYPE_UNSPECIFIED"),
809                Self::TableValuedFunction => std::option::Option::Some("TABLE_VALUED_FUNCTION"),
810                Self::UnknownValue(u) => u.0.name(),
811            }
812        }
813    }
814
815    impl std::default::Default for RoutineType {
816        fn default() -> Self {
817            use std::convert::From;
818            Self::from(0)
819        }
820    }
821
822    impl std::fmt::Display for RoutineType {
823        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
824            wkt::internal::display_enum(f, self.name(), self.value())
825        }
826    }
827
828    impl std::convert::From<i32> for RoutineType {
829        fn from(value: i32) -> Self {
830            match value {
831                0 => Self::Unspecified,
832                1 => Self::TableValuedFunction,
833                _ => Self::UnknownValue(routine_type::UnknownValue(
834                    wkt::internal::UnknownEnumValue::Integer(value),
835                )),
836            }
837        }
838    }
839
840    impl std::convert::From<&str> for RoutineType {
841        fn from(value: &str) -> Self {
842            use std::string::ToString;
843            match value {
844                "ROUTINE_TYPE_UNSPECIFIED" => Self::Unspecified,
845                "TABLE_VALUED_FUNCTION" => Self::TableValuedFunction,
846                _ => Self::UnknownValue(routine_type::UnknownValue(
847                    wkt::internal::UnknownEnumValue::String(value.to_string()),
848                )),
849            }
850        }
851    }
852
853    impl serde::ser::Serialize for RoutineType {
854        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
855        where
856            S: serde::Serializer,
857        {
858            match self {
859                Self::Unspecified => serializer.serialize_i32(0),
860                Self::TableValuedFunction => serializer.serialize_i32(1),
861                Self::UnknownValue(u) => u.0.serialize(serializer),
862            }
863        }
864    }
865
866    impl<'de> serde::de::Deserialize<'de> for RoutineType {
867        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
868        where
869            D: serde::Deserializer<'de>,
870        {
871            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutineType>::new(
872                ".google.cloud.bigquery.analyticshub.v1.Routine.RoutineType",
873            ))
874        }
875    }
876}
877
878/// Message for creating a QueryTemplate.
879#[derive(Clone, Default, PartialEq)]
880#[non_exhaustive]
881pub struct CreateQueryTemplateRequest {
882    /// Required. The parent resource path of the QueryTemplate.
883    /// e.g.
884    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myQueryTemplate`.
885    pub parent: std::string::String,
886
887    /// Required. The ID of the QueryTemplate to create.
888    /// Must contain only Unicode letters, numbers (0-9), underscores (_).
889    /// Max length: 100 bytes.
890    pub query_template_id: std::string::String,
891
892    /// Required. The QueryTemplate to create.
893    pub query_template: std::option::Option<crate::model::QueryTemplate>,
894
895    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
896}
897
898impl CreateQueryTemplateRequest {
899    pub fn new() -> Self {
900        std::default::Default::default()
901    }
902
903    /// Sets the value of [parent][crate::model::CreateQueryTemplateRequest::parent].
904    ///
905    /// # Example
906    /// ```ignore,no_run
907    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateQueryTemplateRequest;
908    /// let x = CreateQueryTemplateRequest::new().set_parent("example");
909    /// ```
910    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
911        self.parent = v.into();
912        self
913    }
914
915    /// Sets the value of [query_template_id][crate::model::CreateQueryTemplateRequest::query_template_id].
916    ///
917    /// # Example
918    /// ```ignore,no_run
919    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateQueryTemplateRequest;
920    /// let x = CreateQueryTemplateRequest::new().set_query_template_id("example");
921    /// ```
922    pub fn set_query_template_id<T: std::convert::Into<std::string::String>>(
923        mut self,
924        v: T,
925    ) -> Self {
926        self.query_template_id = v.into();
927        self
928    }
929
930    /// Sets the value of [query_template][crate::model::CreateQueryTemplateRequest::query_template].
931    ///
932    /// # Example
933    /// ```ignore,no_run
934    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateQueryTemplateRequest;
935    /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
936    /// let x = CreateQueryTemplateRequest::new().set_query_template(QueryTemplate::default()/* use setters */);
937    /// ```
938    pub fn set_query_template<T>(mut self, v: T) -> Self
939    where
940        T: std::convert::Into<crate::model::QueryTemplate>,
941    {
942        self.query_template = std::option::Option::Some(v.into());
943        self
944    }
945
946    /// Sets or clears the value of [query_template][crate::model::CreateQueryTemplateRequest::query_template].
947    ///
948    /// # Example
949    /// ```ignore,no_run
950    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateQueryTemplateRequest;
951    /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
952    /// let x = CreateQueryTemplateRequest::new().set_or_clear_query_template(Some(QueryTemplate::default()/* use setters */));
953    /// let x = CreateQueryTemplateRequest::new().set_or_clear_query_template(None::<QueryTemplate>);
954    /// ```
955    pub fn set_or_clear_query_template<T>(mut self, v: std::option::Option<T>) -> Self
956    where
957        T: std::convert::Into<crate::model::QueryTemplate>,
958    {
959        self.query_template = v.map(|x| x.into());
960        self
961    }
962}
963
964impl wkt::message::Message for CreateQueryTemplateRequest {
965    fn typename() -> &'static str {
966        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CreateQueryTemplateRequest"
967    }
968}
969
970/// Message for creating a QueryTemplate.
971#[derive(Clone, Default, PartialEq)]
972#[non_exhaustive]
973pub struct GetQueryTemplateRequest {
974    /// Required. The parent resource path of the QueryTemplate.
975    /// e.g.
976    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
977    pub name: std::string::String,
978
979    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
980}
981
982impl GetQueryTemplateRequest {
983    pub fn new() -> Self {
984        std::default::Default::default()
985    }
986
987    /// Sets the value of [name][crate::model::GetQueryTemplateRequest::name].
988    ///
989    /// # Example
990    /// ```ignore,no_run
991    /// # use google_cloud_bigquery_analyticshub_v1::model::GetQueryTemplateRequest;
992    /// let x = GetQueryTemplateRequest::new().set_name("example");
993    /// ```
994    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
995        self.name = v.into();
996        self
997    }
998}
999
1000impl wkt::message::Message for GetQueryTemplateRequest {
1001    fn typename() -> &'static str {
1002        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetQueryTemplateRequest"
1003    }
1004}
1005
1006/// Message for requesting the list of QueryTemplates.
1007#[derive(Clone, Default, PartialEq)]
1008#[non_exhaustive]
1009pub struct ListQueryTemplatesRequest {
1010    /// Required. The parent resource path of the QueryTemplates.
1011    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
1012    pub parent: std::string::String,
1013
1014    /// Optional. The maximum number of results to return in a single response
1015    /// page. Leverage the page tokens to iterate through the entire collection.
1016    pub page_size: i32,
1017
1018    /// Optional. Page token, returned by a previous call, to request the next page
1019    /// of results.
1020    pub page_token: std::string::String,
1021
1022    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1023}
1024
1025impl ListQueryTemplatesRequest {
1026    pub fn new() -> Self {
1027        std::default::Default::default()
1028    }
1029
1030    /// Sets the value of [parent][crate::model::ListQueryTemplatesRequest::parent].
1031    ///
1032    /// # Example
1033    /// ```ignore,no_run
1034    /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesRequest;
1035    /// let x = ListQueryTemplatesRequest::new().set_parent("example");
1036    /// ```
1037    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1038        self.parent = v.into();
1039        self
1040    }
1041
1042    /// Sets the value of [page_size][crate::model::ListQueryTemplatesRequest::page_size].
1043    ///
1044    /// # Example
1045    /// ```ignore,no_run
1046    /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesRequest;
1047    /// let x = ListQueryTemplatesRequest::new().set_page_size(42);
1048    /// ```
1049    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1050        self.page_size = v.into();
1051        self
1052    }
1053
1054    /// Sets the value of [page_token][crate::model::ListQueryTemplatesRequest::page_token].
1055    ///
1056    /// # Example
1057    /// ```ignore,no_run
1058    /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesRequest;
1059    /// let x = ListQueryTemplatesRequest::new().set_page_token("example");
1060    /// ```
1061    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1062        self.page_token = v.into();
1063        self
1064    }
1065}
1066
1067impl wkt::message::Message for ListQueryTemplatesRequest {
1068    fn typename() -> &'static str {
1069        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListQueryTemplatesRequest"
1070    }
1071}
1072
1073/// Message for response to the list of QueryTemplates.
1074#[derive(Clone, Default, PartialEq)]
1075#[non_exhaustive]
1076pub struct ListQueryTemplatesResponse {
1077    /// The list of QueryTemplates.
1078    pub query_templates: std::vec::Vec<crate::model::QueryTemplate>,
1079
1080    /// A token to request the next page of results.
1081    pub next_page_token: std::string::String,
1082
1083    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1084}
1085
1086impl ListQueryTemplatesResponse {
1087    pub fn new() -> Self {
1088        std::default::Default::default()
1089    }
1090
1091    /// Sets the value of [query_templates][crate::model::ListQueryTemplatesResponse::query_templates].
1092    ///
1093    /// # Example
1094    /// ```ignore,no_run
1095    /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesResponse;
1096    /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
1097    /// let x = ListQueryTemplatesResponse::new()
1098    ///     .set_query_templates([
1099    ///         QueryTemplate::default()/* use setters */,
1100    ///         QueryTemplate::default()/* use (different) setters */,
1101    ///     ]);
1102    /// ```
1103    pub fn set_query_templates<T, V>(mut self, v: T) -> Self
1104    where
1105        T: std::iter::IntoIterator<Item = V>,
1106        V: std::convert::Into<crate::model::QueryTemplate>,
1107    {
1108        use std::iter::Iterator;
1109        self.query_templates = v.into_iter().map(|i| i.into()).collect();
1110        self
1111    }
1112
1113    /// Sets the value of [next_page_token][crate::model::ListQueryTemplatesResponse::next_page_token].
1114    ///
1115    /// # Example
1116    /// ```ignore,no_run
1117    /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesResponse;
1118    /// let x = ListQueryTemplatesResponse::new().set_next_page_token("example");
1119    /// ```
1120    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1121        self.next_page_token = v.into();
1122        self
1123    }
1124}
1125
1126impl wkt::message::Message for ListQueryTemplatesResponse {
1127    fn typename() -> &'static str {
1128        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListQueryTemplatesResponse"
1129    }
1130}
1131
1132#[doc(hidden)]
1133impl gax::paginator::internal::PageableResponse for ListQueryTemplatesResponse {
1134    type PageItem = crate::model::QueryTemplate;
1135
1136    fn items(self) -> std::vec::Vec<Self::PageItem> {
1137        self.query_templates
1138    }
1139
1140    fn next_page_token(&self) -> std::string::String {
1141        use std::clone::Clone;
1142        self.next_page_token.clone()
1143    }
1144}
1145
1146/// Message for updating a QueryTemplate.
1147#[derive(Clone, Default, PartialEq)]
1148#[non_exhaustive]
1149pub struct UpdateQueryTemplateRequest {
1150    /// Optional. Field mask specifies the fields to update in the query template
1151    /// resource. The fields specified in the `updateMask` are relative to the
1152    /// resource and are not a full request.
1153    pub update_mask: std::option::Option<wkt::FieldMask>,
1154
1155    /// Required. The QueryTemplate to update.
1156    pub query_template: std::option::Option<crate::model::QueryTemplate>,
1157
1158    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1159}
1160
1161impl UpdateQueryTemplateRequest {
1162    pub fn new() -> Self {
1163        std::default::Default::default()
1164    }
1165
1166    /// Sets the value of [update_mask][crate::model::UpdateQueryTemplateRequest::update_mask].
1167    ///
1168    /// # Example
1169    /// ```ignore,no_run
1170    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1171    /// use wkt::FieldMask;
1172    /// let x = UpdateQueryTemplateRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1173    /// ```
1174    pub fn set_update_mask<T>(mut self, v: T) -> Self
1175    where
1176        T: std::convert::Into<wkt::FieldMask>,
1177    {
1178        self.update_mask = std::option::Option::Some(v.into());
1179        self
1180    }
1181
1182    /// Sets or clears the value of [update_mask][crate::model::UpdateQueryTemplateRequest::update_mask].
1183    ///
1184    /// # Example
1185    /// ```ignore,no_run
1186    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1187    /// use wkt::FieldMask;
1188    /// let x = UpdateQueryTemplateRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1189    /// let x = UpdateQueryTemplateRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1190    /// ```
1191    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1192    where
1193        T: std::convert::Into<wkt::FieldMask>,
1194    {
1195        self.update_mask = v.map(|x| x.into());
1196        self
1197    }
1198
1199    /// Sets the value of [query_template][crate::model::UpdateQueryTemplateRequest::query_template].
1200    ///
1201    /// # Example
1202    /// ```ignore,no_run
1203    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1204    /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
1205    /// let x = UpdateQueryTemplateRequest::new().set_query_template(QueryTemplate::default()/* use setters */);
1206    /// ```
1207    pub fn set_query_template<T>(mut self, v: T) -> Self
1208    where
1209        T: std::convert::Into<crate::model::QueryTemplate>,
1210    {
1211        self.query_template = std::option::Option::Some(v.into());
1212        self
1213    }
1214
1215    /// Sets or clears the value of [query_template][crate::model::UpdateQueryTemplateRequest::query_template].
1216    ///
1217    /// # Example
1218    /// ```ignore,no_run
1219    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1220    /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
1221    /// let x = UpdateQueryTemplateRequest::new().set_or_clear_query_template(Some(QueryTemplate::default()/* use setters */));
1222    /// let x = UpdateQueryTemplateRequest::new().set_or_clear_query_template(None::<QueryTemplate>);
1223    /// ```
1224    pub fn set_or_clear_query_template<T>(mut self, v: std::option::Option<T>) -> Self
1225    where
1226        T: std::convert::Into<crate::model::QueryTemplate>,
1227    {
1228        self.query_template = v.map(|x| x.into());
1229        self
1230    }
1231}
1232
1233impl wkt::message::Message for UpdateQueryTemplateRequest {
1234    fn typename() -> &'static str {
1235        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.UpdateQueryTemplateRequest"
1236    }
1237}
1238
1239/// Message for deleting a QueryTemplate.
1240#[derive(Clone, Default, PartialEq)]
1241#[non_exhaustive]
1242pub struct DeleteQueryTemplateRequest {
1243    /// Required. The resource path of the QueryTemplate.
1244    /// e.g.
1245    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
1246    pub name: std::string::String,
1247
1248    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1249}
1250
1251impl DeleteQueryTemplateRequest {
1252    pub fn new() -> Self {
1253        std::default::Default::default()
1254    }
1255
1256    /// Sets the value of [name][crate::model::DeleteQueryTemplateRequest::name].
1257    ///
1258    /// # Example
1259    /// ```ignore,no_run
1260    /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteQueryTemplateRequest;
1261    /// let x = DeleteQueryTemplateRequest::new().set_name("example");
1262    /// ```
1263    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1264        self.name = v.into();
1265        self
1266    }
1267}
1268
1269impl wkt::message::Message for DeleteQueryTemplateRequest {
1270    fn typename() -> &'static str {
1271        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteQueryTemplateRequest"
1272    }
1273}
1274
1275/// Message for submitting a QueryTemplate.
1276#[derive(Clone, Default, PartialEq)]
1277#[non_exhaustive]
1278pub struct SubmitQueryTemplateRequest {
1279    /// Required. The resource path of the QueryTemplate.
1280    /// e.g.
1281    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
1282    pub name: std::string::String,
1283
1284    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1285}
1286
1287impl SubmitQueryTemplateRequest {
1288    pub fn new() -> Self {
1289        std::default::Default::default()
1290    }
1291
1292    /// Sets the value of [name][crate::model::SubmitQueryTemplateRequest::name].
1293    ///
1294    /// # Example
1295    /// ```ignore,no_run
1296    /// # use google_cloud_bigquery_analyticshub_v1::model::SubmitQueryTemplateRequest;
1297    /// let x = SubmitQueryTemplateRequest::new().set_name("example");
1298    /// ```
1299    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1300        self.name = v.into();
1301        self
1302    }
1303}
1304
1305impl wkt::message::Message for SubmitQueryTemplateRequest {
1306    fn typename() -> &'static str {
1307        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubmitQueryTemplateRequest"
1308    }
1309}
1310
1311/// Message for approving a QueryTemplate.
1312#[derive(Clone, Default, PartialEq)]
1313#[non_exhaustive]
1314pub struct ApproveQueryTemplateRequest {
1315    /// Required. The resource path of the QueryTemplate.
1316    /// e.g.
1317    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
1318    pub name: std::string::String,
1319
1320    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1321}
1322
1323impl ApproveQueryTemplateRequest {
1324    pub fn new() -> Self {
1325        std::default::Default::default()
1326    }
1327
1328    /// Sets the value of [name][crate::model::ApproveQueryTemplateRequest::name].
1329    ///
1330    /// # Example
1331    /// ```ignore,no_run
1332    /// # use google_cloud_bigquery_analyticshub_v1::model::ApproveQueryTemplateRequest;
1333    /// let x = ApproveQueryTemplateRequest::new().set_name("example");
1334    /// ```
1335    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1336        self.name = v.into();
1337        self
1338    }
1339}
1340
1341impl wkt::message::Message for ApproveQueryTemplateRequest {
1342    fn typename() -> &'static str {
1343        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ApproveQueryTemplateRequest"
1344    }
1345}
1346
1347/// Sharing environment is a behavior model for sharing data within a
1348/// data exchange. This option is configurable for a data exchange.
1349#[derive(Clone, Default, PartialEq)]
1350#[non_exhaustive]
1351pub struct SharingEnvironmentConfig {
1352    pub environment: std::option::Option<crate::model::sharing_environment_config::Environment>,
1353
1354    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1355}
1356
1357impl SharingEnvironmentConfig {
1358    pub fn new() -> Self {
1359        std::default::Default::default()
1360    }
1361
1362    /// Sets the value of [environment][crate::model::SharingEnvironmentConfig::environment].
1363    ///
1364    /// Note that all the setters affecting `environment` are mutually
1365    /// exclusive.
1366    ///
1367    /// # Example
1368    /// ```ignore,no_run
1369    /// # use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
1370    /// use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DefaultExchangeConfig;
1371    /// let x = SharingEnvironmentConfig::new().set_environment(Some(
1372    ///     google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::Environment::DefaultExchangeConfig(DefaultExchangeConfig::default().into())));
1373    /// ```
1374    pub fn set_environment<
1375        T: std::convert::Into<
1376                std::option::Option<crate::model::sharing_environment_config::Environment>,
1377            >,
1378    >(
1379        mut self,
1380        v: T,
1381    ) -> Self {
1382        self.environment = v.into();
1383        self
1384    }
1385
1386    /// The value of [environment][crate::model::SharingEnvironmentConfig::environment]
1387    /// if it holds a `DefaultExchangeConfig`, `None` if the field is not set or
1388    /// holds a different branch.
1389    pub fn default_exchange_config(
1390        &self,
1391    ) -> std::option::Option<
1392        &std::boxed::Box<crate::model::sharing_environment_config::DefaultExchangeConfig>,
1393    > {
1394        #[allow(unreachable_patterns)]
1395        self.environment.as_ref().and_then(|v| match v {
1396            crate::model::sharing_environment_config::Environment::DefaultExchangeConfig(v) => {
1397                std::option::Option::Some(v)
1398            }
1399            _ => std::option::Option::None,
1400        })
1401    }
1402
1403    /// Sets the value of [environment][crate::model::SharingEnvironmentConfig::environment]
1404    /// to hold a `DefaultExchangeConfig`.
1405    ///
1406    /// Note that all the setters affecting `environment` are
1407    /// mutually exclusive.
1408    ///
1409    /// # Example
1410    /// ```ignore,no_run
1411    /// # use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
1412    /// use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DefaultExchangeConfig;
1413    /// let x = SharingEnvironmentConfig::new().set_default_exchange_config(DefaultExchangeConfig::default()/* use setters */);
1414    /// assert!(x.default_exchange_config().is_some());
1415    /// assert!(x.dcr_exchange_config().is_none());
1416    /// ```
1417    pub fn set_default_exchange_config<
1418        T: std::convert::Into<
1419                std::boxed::Box<crate::model::sharing_environment_config::DefaultExchangeConfig>,
1420            >,
1421    >(
1422        mut self,
1423        v: T,
1424    ) -> Self {
1425        self.environment = std::option::Option::Some(
1426            crate::model::sharing_environment_config::Environment::DefaultExchangeConfig(v.into()),
1427        );
1428        self
1429    }
1430
1431    /// The value of [environment][crate::model::SharingEnvironmentConfig::environment]
1432    /// if it holds a `DcrExchangeConfig`, `None` if the field is not set or
1433    /// holds a different branch.
1434    pub fn dcr_exchange_config(
1435        &self,
1436    ) -> std::option::Option<
1437        &std::boxed::Box<crate::model::sharing_environment_config::DcrExchangeConfig>,
1438    > {
1439        #[allow(unreachable_patterns)]
1440        self.environment.as_ref().and_then(|v| match v {
1441            crate::model::sharing_environment_config::Environment::DcrExchangeConfig(v) => {
1442                std::option::Option::Some(v)
1443            }
1444            _ => std::option::Option::None,
1445        })
1446    }
1447
1448    /// Sets the value of [environment][crate::model::SharingEnvironmentConfig::environment]
1449    /// to hold a `DcrExchangeConfig`.
1450    ///
1451    /// Note that all the setters affecting `environment` are
1452    /// mutually exclusive.
1453    ///
1454    /// # Example
1455    /// ```ignore,no_run
1456    /// # use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
1457    /// use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1458    /// let x = SharingEnvironmentConfig::new().set_dcr_exchange_config(DcrExchangeConfig::default()/* use setters */);
1459    /// assert!(x.dcr_exchange_config().is_some());
1460    /// assert!(x.default_exchange_config().is_none());
1461    /// ```
1462    pub fn set_dcr_exchange_config<
1463        T: std::convert::Into<
1464                std::boxed::Box<crate::model::sharing_environment_config::DcrExchangeConfig>,
1465            >,
1466    >(
1467        mut self,
1468        v: T,
1469    ) -> Self {
1470        self.environment = std::option::Option::Some(
1471            crate::model::sharing_environment_config::Environment::DcrExchangeConfig(v.into()),
1472        );
1473        self
1474    }
1475}
1476
1477impl wkt::message::Message for SharingEnvironmentConfig {
1478    fn typename() -> &'static str {
1479        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig"
1480    }
1481}
1482
1483/// Defines additional types related to [SharingEnvironmentConfig].
1484pub mod sharing_environment_config {
1485    #[allow(unused_imports)]
1486    use super::*;
1487
1488    /// Default Analytics Hub data exchange, used for secured data sharing.
1489    #[derive(Clone, Default, PartialEq)]
1490    #[non_exhaustive]
1491    pub struct DefaultExchangeConfig {
1492        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1493    }
1494
1495    impl DefaultExchangeConfig {
1496        pub fn new() -> Self {
1497            std::default::Default::default()
1498        }
1499    }
1500
1501    impl wkt::message::Message for DefaultExchangeConfig {
1502        fn typename() -> &'static str {
1503            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig.DefaultExchangeConfig"
1504        }
1505    }
1506
1507    /// Data Clean Room (DCR), used for privacy-safe and secured data sharing.
1508    #[derive(Clone, Default, PartialEq)]
1509    #[non_exhaustive]
1510    pub struct DcrExchangeConfig {
1511        /// Output only. If True, this DCR restricts the contributors to sharing
1512        /// only a single resource in a Listing. And no two resources should have the
1513        /// same IDs. So if a contributor adds a view with a conflicting name, the
1514        /// CreateListing API will reject the request. if False, the data contributor
1515        /// can publish an entire dataset (as before). This is not configurable, and
1516        /// by default, all new DCRs will have the restriction set to True.
1517        pub single_selected_resource_sharing_restriction: std::option::Option<bool>,
1518
1519        /// Output only. If True, when subscribing to this DCR, it will create only
1520        /// one linked dataset containing all resources shared within the
1521        /// cleanroom. If False, when subscribing to this DCR, it will
1522        /// create 1 linked dataset per listing. This is not configurable, and by
1523        /// default, all new DCRs will have the restriction set to True.
1524        pub single_linked_dataset_per_cleanroom: std::option::Option<bool>,
1525
1526        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1527    }
1528
1529    impl DcrExchangeConfig {
1530        pub fn new() -> Self {
1531            std::default::Default::default()
1532        }
1533
1534        /// Sets the value of [single_selected_resource_sharing_restriction][crate::model::sharing_environment_config::DcrExchangeConfig::single_selected_resource_sharing_restriction].
1535        ///
1536        /// # Example
1537        /// ```ignore,no_run
1538        /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1539        /// let x = DcrExchangeConfig::new().set_single_selected_resource_sharing_restriction(true);
1540        /// ```
1541        pub fn set_single_selected_resource_sharing_restriction<T>(mut self, v: T) -> Self
1542        where
1543            T: std::convert::Into<bool>,
1544        {
1545            self.single_selected_resource_sharing_restriction = std::option::Option::Some(v.into());
1546            self
1547        }
1548
1549        /// Sets or clears the value of [single_selected_resource_sharing_restriction][crate::model::sharing_environment_config::DcrExchangeConfig::single_selected_resource_sharing_restriction].
1550        ///
1551        /// # Example
1552        /// ```ignore,no_run
1553        /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1554        /// let x = DcrExchangeConfig::new().set_or_clear_single_selected_resource_sharing_restriction(Some(false));
1555        /// let x = DcrExchangeConfig::new().set_or_clear_single_selected_resource_sharing_restriction(None::<bool>);
1556        /// ```
1557        pub fn set_or_clear_single_selected_resource_sharing_restriction<T>(
1558            mut self,
1559            v: std::option::Option<T>,
1560        ) -> Self
1561        where
1562            T: std::convert::Into<bool>,
1563        {
1564            self.single_selected_resource_sharing_restriction = v.map(|x| x.into());
1565            self
1566        }
1567
1568        /// Sets the value of [single_linked_dataset_per_cleanroom][crate::model::sharing_environment_config::DcrExchangeConfig::single_linked_dataset_per_cleanroom].
1569        ///
1570        /// # Example
1571        /// ```ignore,no_run
1572        /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1573        /// let x = DcrExchangeConfig::new().set_single_linked_dataset_per_cleanroom(true);
1574        /// ```
1575        pub fn set_single_linked_dataset_per_cleanroom<T>(mut self, v: T) -> Self
1576        where
1577            T: std::convert::Into<bool>,
1578        {
1579            self.single_linked_dataset_per_cleanroom = std::option::Option::Some(v.into());
1580            self
1581        }
1582
1583        /// Sets or clears the value of [single_linked_dataset_per_cleanroom][crate::model::sharing_environment_config::DcrExchangeConfig::single_linked_dataset_per_cleanroom].
1584        ///
1585        /// # Example
1586        /// ```ignore,no_run
1587        /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1588        /// let x = DcrExchangeConfig::new().set_or_clear_single_linked_dataset_per_cleanroom(Some(false));
1589        /// let x = DcrExchangeConfig::new().set_or_clear_single_linked_dataset_per_cleanroom(None::<bool>);
1590        /// ```
1591        pub fn set_or_clear_single_linked_dataset_per_cleanroom<T>(
1592            mut self,
1593            v: std::option::Option<T>,
1594        ) -> Self
1595        where
1596            T: std::convert::Into<bool>,
1597        {
1598            self.single_linked_dataset_per_cleanroom = v.map(|x| x.into());
1599            self
1600        }
1601    }
1602
1603    impl wkt::message::Message for DcrExchangeConfig {
1604        fn typename() -> &'static str {
1605            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig.DcrExchangeConfig"
1606        }
1607    }
1608
1609    #[derive(Clone, Debug, PartialEq)]
1610    #[non_exhaustive]
1611    pub enum Environment {
1612        /// Default Analytics Hub data exchange, used for secured data sharing.
1613        DefaultExchangeConfig(
1614            std::boxed::Box<crate::model::sharing_environment_config::DefaultExchangeConfig>,
1615        ),
1616        /// Data Clean Room (DCR), used for privacy-safe and secured data sharing.
1617        DcrExchangeConfig(
1618            std::boxed::Box<crate::model::sharing_environment_config::DcrExchangeConfig>,
1619        ),
1620    }
1621}
1622
1623/// Contains details of the data provider.
1624#[derive(Clone, Default, PartialEq)]
1625#[non_exhaustive]
1626pub struct DataProvider {
1627    /// Optional. Name of the data provider.
1628    pub name: std::string::String,
1629
1630    /// Optional. Email or URL of the data provider.
1631    /// Max Length: 1000 bytes.
1632    pub primary_contact: std::string::String,
1633
1634    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1635}
1636
1637impl DataProvider {
1638    pub fn new() -> Self {
1639        std::default::Default::default()
1640    }
1641
1642    /// Sets the value of [name][crate::model::DataProvider::name].
1643    ///
1644    /// # Example
1645    /// ```ignore,no_run
1646    /// # use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
1647    /// let x = DataProvider::new().set_name("example");
1648    /// ```
1649    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1650        self.name = v.into();
1651        self
1652    }
1653
1654    /// Sets the value of [primary_contact][crate::model::DataProvider::primary_contact].
1655    ///
1656    /// # Example
1657    /// ```ignore,no_run
1658    /// # use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
1659    /// let x = DataProvider::new().set_primary_contact("example");
1660    /// ```
1661    pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1662        self.primary_contact = v.into();
1663        self
1664    }
1665}
1666
1667impl wkt::message::Message for DataProvider {
1668    fn typename() -> &'static str {
1669        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DataProvider"
1670    }
1671}
1672
1673/// Contains details of the listing publisher.
1674#[derive(Clone, Default, PartialEq)]
1675#[non_exhaustive]
1676pub struct Publisher {
1677    /// Optional. Name of the listing publisher.
1678    pub name: std::string::String,
1679
1680    /// Optional. Email or URL of the listing publisher.
1681    /// Max Length: 1000 bytes.
1682    pub primary_contact: std::string::String,
1683
1684    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1685}
1686
1687impl Publisher {
1688    pub fn new() -> Self {
1689        std::default::Default::default()
1690    }
1691
1692    /// Sets the value of [name][crate::model::Publisher::name].
1693    ///
1694    /// # Example
1695    /// ```ignore,no_run
1696    /// # use google_cloud_bigquery_analyticshub_v1::model::Publisher;
1697    /// let x = Publisher::new().set_name("example");
1698    /// ```
1699    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1700        self.name = v.into();
1701        self
1702    }
1703
1704    /// Sets the value of [primary_contact][crate::model::Publisher::primary_contact].
1705    ///
1706    /// # Example
1707    /// ```ignore,no_run
1708    /// # use google_cloud_bigquery_analyticshub_v1::model::Publisher;
1709    /// let x = Publisher::new().set_primary_contact("example");
1710    /// ```
1711    pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1712        self.primary_contact = v.into();
1713        self
1714    }
1715}
1716
1717impl wkt::message::Message for Publisher {
1718    fn typename() -> &'static str {
1719        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Publisher"
1720    }
1721}
1722
1723#[derive(Clone, Default, PartialEq)]
1724#[non_exhaustive]
1725pub struct DestinationDatasetReference {
1726    /// Required. A unique ID for this dataset, without the project name. The ID
1727    /// must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_).
1728    /// The maximum length is 1,024 characters.
1729    pub dataset_id: std::string::String,
1730
1731    /// Required. The ID of the project containing this dataset.
1732    pub project_id: std::string::String,
1733
1734    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1735}
1736
1737impl DestinationDatasetReference {
1738    pub fn new() -> Self {
1739        std::default::Default::default()
1740    }
1741
1742    /// Sets the value of [dataset_id][crate::model::DestinationDatasetReference::dataset_id].
1743    ///
1744    /// # Example
1745    /// ```ignore,no_run
1746    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1747    /// let x = DestinationDatasetReference::new().set_dataset_id("example");
1748    /// ```
1749    pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1750        self.dataset_id = v.into();
1751        self
1752    }
1753
1754    /// Sets the value of [project_id][crate::model::DestinationDatasetReference::project_id].
1755    ///
1756    /// # Example
1757    /// ```ignore,no_run
1758    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1759    /// let x = DestinationDatasetReference::new().set_project_id("example");
1760    /// ```
1761    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1762        self.project_id = v.into();
1763        self
1764    }
1765}
1766
1767impl wkt::message::Message for DestinationDatasetReference {
1768    fn typename() -> &'static str {
1769        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference"
1770    }
1771}
1772
1773/// Defines the destination bigquery dataset.
1774#[derive(Clone, Default, PartialEq)]
1775#[non_exhaustive]
1776pub struct DestinationDataset {
1777    /// Required. A reference that identifies the destination dataset.
1778    pub dataset_reference: std::option::Option<crate::model::DestinationDatasetReference>,
1779
1780    /// Optional. A descriptive name for the dataset.
1781    pub friendly_name: std::option::Option<wkt::StringValue>,
1782
1783    /// Optional. A user-friendly description of the dataset.
1784    pub description: std::option::Option<wkt::StringValue>,
1785
1786    /// Optional. The labels associated with this dataset. You can use these
1787    /// to organize and group your datasets.
1788    /// You can set this property when inserting or updating a dataset.
1789    /// See <https://cloud.google.com/resource-manager/docs/creating-managing-labels>
1790    /// for more information.
1791    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1792
1793    /// Required. The geographic location where the dataset should reside. See
1794    /// <https://cloud.google.com/bigquery/docs/locations> for supported
1795    /// locations.
1796    pub location: std::string::String,
1797
1798    /// Optional. The geographic locations where the dataset should be replicated.
1799    /// See [BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
1800    /// for supported locations.
1801    pub replica_locations: std::vec::Vec<std::string::String>,
1802
1803    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1804}
1805
1806impl DestinationDataset {
1807    pub fn new() -> Self {
1808        std::default::Default::default()
1809    }
1810
1811    /// Sets the value of [dataset_reference][crate::model::DestinationDataset::dataset_reference].
1812    ///
1813    /// # Example
1814    /// ```ignore,no_run
1815    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1816    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1817    /// let x = DestinationDataset::new().set_dataset_reference(DestinationDatasetReference::default()/* use setters */);
1818    /// ```
1819    pub fn set_dataset_reference<T>(mut self, v: T) -> Self
1820    where
1821        T: std::convert::Into<crate::model::DestinationDatasetReference>,
1822    {
1823        self.dataset_reference = std::option::Option::Some(v.into());
1824        self
1825    }
1826
1827    /// Sets or clears the value of [dataset_reference][crate::model::DestinationDataset::dataset_reference].
1828    ///
1829    /// # Example
1830    /// ```ignore,no_run
1831    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1832    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1833    /// let x = DestinationDataset::new().set_or_clear_dataset_reference(Some(DestinationDatasetReference::default()/* use setters */));
1834    /// let x = DestinationDataset::new().set_or_clear_dataset_reference(None::<DestinationDatasetReference>);
1835    /// ```
1836    pub fn set_or_clear_dataset_reference<T>(mut self, v: std::option::Option<T>) -> Self
1837    where
1838        T: std::convert::Into<crate::model::DestinationDatasetReference>,
1839    {
1840        self.dataset_reference = v.map(|x| x.into());
1841        self
1842    }
1843
1844    /// Sets the value of [friendly_name][crate::model::DestinationDataset::friendly_name].
1845    ///
1846    /// # Example
1847    /// ```ignore,no_run
1848    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1849    /// use wkt::StringValue;
1850    /// let x = DestinationDataset::new().set_friendly_name(StringValue::default()/* use setters */);
1851    /// ```
1852    pub fn set_friendly_name<T>(mut self, v: T) -> Self
1853    where
1854        T: std::convert::Into<wkt::StringValue>,
1855    {
1856        self.friendly_name = std::option::Option::Some(v.into());
1857        self
1858    }
1859
1860    /// Sets or clears the value of [friendly_name][crate::model::DestinationDataset::friendly_name].
1861    ///
1862    /// # Example
1863    /// ```ignore,no_run
1864    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1865    /// use wkt::StringValue;
1866    /// let x = DestinationDataset::new().set_or_clear_friendly_name(Some(StringValue::default()/* use setters */));
1867    /// let x = DestinationDataset::new().set_or_clear_friendly_name(None::<StringValue>);
1868    /// ```
1869    pub fn set_or_clear_friendly_name<T>(mut self, v: std::option::Option<T>) -> Self
1870    where
1871        T: std::convert::Into<wkt::StringValue>,
1872    {
1873        self.friendly_name = v.map(|x| x.into());
1874        self
1875    }
1876
1877    /// Sets the value of [description][crate::model::DestinationDataset::description].
1878    ///
1879    /// # Example
1880    /// ```ignore,no_run
1881    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1882    /// use wkt::StringValue;
1883    /// let x = DestinationDataset::new().set_description(StringValue::default()/* use setters */);
1884    /// ```
1885    pub fn set_description<T>(mut self, v: T) -> Self
1886    where
1887        T: std::convert::Into<wkt::StringValue>,
1888    {
1889        self.description = std::option::Option::Some(v.into());
1890        self
1891    }
1892
1893    /// Sets or clears the value of [description][crate::model::DestinationDataset::description].
1894    ///
1895    /// # Example
1896    /// ```ignore,no_run
1897    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1898    /// use wkt::StringValue;
1899    /// let x = DestinationDataset::new().set_or_clear_description(Some(StringValue::default()/* use setters */));
1900    /// let x = DestinationDataset::new().set_or_clear_description(None::<StringValue>);
1901    /// ```
1902    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
1903    where
1904        T: std::convert::Into<wkt::StringValue>,
1905    {
1906        self.description = v.map(|x| x.into());
1907        self
1908    }
1909
1910    /// Sets the value of [labels][crate::model::DestinationDataset::labels].
1911    ///
1912    /// # Example
1913    /// ```ignore,no_run
1914    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1915    /// let x = DestinationDataset::new().set_labels([
1916    ///     ("key0", "abc"),
1917    ///     ("key1", "xyz"),
1918    /// ]);
1919    /// ```
1920    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1921    where
1922        T: std::iter::IntoIterator<Item = (K, V)>,
1923        K: std::convert::Into<std::string::String>,
1924        V: std::convert::Into<std::string::String>,
1925    {
1926        use std::iter::Iterator;
1927        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1928        self
1929    }
1930
1931    /// Sets the value of [location][crate::model::DestinationDataset::location].
1932    ///
1933    /// # Example
1934    /// ```ignore,no_run
1935    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1936    /// let x = DestinationDataset::new().set_location("example");
1937    /// ```
1938    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1939        self.location = v.into();
1940        self
1941    }
1942
1943    /// Sets the value of [replica_locations][crate::model::DestinationDataset::replica_locations].
1944    ///
1945    /// # Example
1946    /// ```ignore,no_run
1947    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1948    /// let x = DestinationDataset::new().set_replica_locations(["a", "b", "c"]);
1949    /// ```
1950    pub fn set_replica_locations<T, V>(mut self, v: T) -> Self
1951    where
1952        T: std::iter::IntoIterator<Item = V>,
1953        V: std::convert::Into<std::string::String>,
1954    {
1955        use std::iter::Iterator;
1956        self.replica_locations = v.into_iter().map(|i| i.into()).collect();
1957        self
1958    }
1959}
1960
1961impl wkt::message::Message for DestinationDataset {
1962    fn typename() -> &'static str {
1963        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DestinationDataset"
1964    }
1965}
1966
1967/// Defines the destination Pub/Sub subscription.
1968#[derive(Clone, Default, PartialEq)]
1969#[non_exhaustive]
1970pub struct DestinationPubSubSubscription {
1971    /// Required. Destination Pub/Sub subscription resource.
1972    pub pubsub_subscription: std::option::Option<crate::model::PubSubSubscription>,
1973
1974    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1975}
1976
1977impl DestinationPubSubSubscription {
1978    pub fn new() -> Self {
1979        std::default::Default::default()
1980    }
1981
1982    /// Sets the value of [pubsub_subscription][crate::model::DestinationPubSubSubscription::pubsub_subscription].
1983    ///
1984    /// # Example
1985    /// ```ignore,no_run
1986    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationPubSubSubscription;
1987    /// use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
1988    /// let x = DestinationPubSubSubscription::new().set_pubsub_subscription(PubSubSubscription::default()/* use setters */);
1989    /// ```
1990    pub fn set_pubsub_subscription<T>(mut self, v: T) -> Self
1991    where
1992        T: std::convert::Into<crate::model::PubSubSubscription>,
1993    {
1994        self.pubsub_subscription = std::option::Option::Some(v.into());
1995        self
1996    }
1997
1998    /// Sets or clears the value of [pubsub_subscription][crate::model::DestinationPubSubSubscription::pubsub_subscription].
1999    ///
2000    /// # Example
2001    /// ```ignore,no_run
2002    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationPubSubSubscription;
2003    /// use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
2004    /// let x = DestinationPubSubSubscription::new().set_or_clear_pubsub_subscription(Some(PubSubSubscription::default()/* use setters */));
2005    /// let x = DestinationPubSubSubscription::new().set_or_clear_pubsub_subscription(None::<PubSubSubscription>);
2006    /// ```
2007    pub fn set_or_clear_pubsub_subscription<T>(mut self, v: std::option::Option<T>) -> Self
2008    where
2009        T: std::convert::Into<crate::model::PubSubSubscription>,
2010    {
2011        self.pubsub_subscription = v.map(|x| x.into());
2012        self
2013    }
2014}
2015
2016impl wkt::message::Message for DestinationPubSubSubscription {
2017    fn typename() -> &'static str {
2018        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DestinationPubSubSubscription"
2019    }
2020}
2021
2022/// A listing is what gets published into a data exchange that a subscriber can
2023/// subscribe to. It contains a reference to the data source along with
2024/// descriptive information that will help subscribers find and subscribe the
2025/// data.
2026#[derive(Clone, Default, PartialEq)]
2027#[non_exhaustive]
2028pub struct Listing {
2029    /// Output only. The resource name of the listing.
2030    /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`
2031    pub name: std::string::String,
2032
2033    /// Required. Human-readable display name of the listing. The display name must
2034    /// contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
2035    /// spaces ( ), ampersands (&) and can't start or end with spaces. Default
2036    /// value is an empty string. Max length: 63 bytes.
2037    pub display_name: std::string::String,
2038
2039    /// Optional. Short description of the listing. The description must not
2040    /// contain Unicode non-characters and C0 and C1 control codes except tabs
2041    /// (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default
2042    /// value is an empty string. Max length: 2000 bytes.
2043    pub description: std::string::String,
2044
2045    /// Optional. Email or URL of the primary point of contact of the listing.
2046    /// Max Length: 1000 bytes.
2047    pub primary_contact: std::string::String,
2048
2049    /// Optional. Documentation describing the listing.
2050    pub documentation: std::string::String,
2051
2052    /// Output only. Current state of the listing.
2053    pub state: crate::model::listing::State,
2054
2055    /// Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB
2056    /// Expected image dimensions are 512x512 pixels, however the API only
2057    /// performs validation on size of the encoded data.
2058    /// Note: For byte fields, the contents of the field are base64-encoded (which
2059    /// increases the size of the data by 33-36%) when using JSON on the wire.
2060    pub icon: ::bytes::Bytes,
2061
2062    /// Optional. Details of the data provider who owns the source data.
2063    pub data_provider: std::option::Option<crate::model::DataProvider>,
2064
2065    /// Optional. Categories of the listing. Up to five categories are allowed.
2066    pub categories: std::vec::Vec<crate::model::listing::Category>,
2067
2068    /// Optional. Details of the publisher who owns the listing and who can share
2069    /// the source data.
2070    pub publisher: std::option::Option<crate::model::Publisher>,
2071
2072    /// Optional. Email or URL of the request access of the listing.
2073    /// Subscribers can use this reference to request access.
2074    /// Max Length: 1000 bytes.
2075    pub request_access: std::string::String,
2076
2077    /// Optional. If set, restricted export configuration will be propagated and
2078    /// enforced on the linked dataset.
2079    pub restricted_export_config:
2080        std::option::Option<crate::model::listing::RestrictedExportConfig>,
2081
2082    /// Optional. If set, stored procedure configuration will be propagated and
2083    /// enforced on the linked dataset.
2084    pub stored_procedure_config: std::option::Option<crate::model::StoredProcedureConfig>,
2085
2086    /// Optional. Type of discovery of the listing on the discovery page.
2087    pub discovery_type: std::option::Option<crate::model::DiscoveryType>,
2088
2089    /// Output only. Listing shared asset type.
2090    pub resource_type: crate::model::SharedResourceType,
2091
2092    /// Output only. Commercial info contains the information about the commercial
2093    /// data products associated with the listing.
2094    pub commercial_info: std::option::Option<crate::model::listing::CommercialInfo>,
2095
2096    /// Optional. By default, false.
2097    /// If true, the Listing has an email sharing mandate enabled.
2098    pub log_linked_dataset_query_user_email: std::option::Option<bool>,
2099
2100    /// Optional. If true, the listing is only available to get the resource
2101    /// metadata. Listing is non subscribable.
2102    pub allow_only_metadata_sharing: std::option::Option<bool>,
2103
2104    /// Listing source.
2105    pub source: std::option::Option<crate::model::listing::Source>,
2106
2107    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2108}
2109
2110impl Listing {
2111    pub fn new() -> Self {
2112        std::default::Default::default()
2113    }
2114
2115    /// Sets the value of [name][crate::model::Listing::name].
2116    ///
2117    /// # Example
2118    /// ```ignore,no_run
2119    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2120    /// let x = Listing::new().set_name("example");
2121    /// ```
2122    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2123        self.name = v.into();
2124        self
2125    }
2126
2127    /// Sets the value of [display_name][crate::model::Listing::display_name].
2128    ///
2129    /// # Example
2130    /// ```ignore,no_run
2131    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2132    /// let x = Listing::new().set_display_name("example");
2133    /// ```
2134    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2135        self.display_name = v.into();
2136        self
2137    }
2138
2139    /// Sets the value of [description][crate::model::Listing::description].
2140    ///
2141    /// # Example
2142    /// ```ignore,no_run
2143    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2144    /// let x = Listing::new().set_description("example");
2145    /// ```
2146    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2147        self.description = v.into();
2148        self
2149    }
2150
2151    /// Sets the value of [primary_contact][crate::model::Listing::primary_contact].
2152    ///
2153    /// # Example
2154    /// ```ignore,no_run
2155    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2156    /// let x = Listing::new().set_primary_contact("example");
2157    /// ```
2158    pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2159        self.primary_contact = v.into();
2160        self
2161    }
2162
2163    /// Sets the value of [documentation][crate::model::Listing::documentation].
2164    ///
2165    /// # Example
2166    /// ```ignore,no_run
2167    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2168    /// let x = Listing::new().set_documentation("example");
2169    /// ```
2170    pub fn set_documentation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2171        self.documentation = v.into();
2172        self
2173    }
2174
2175    /// Sets the value of [state][crate::model::Listing::state].
2176    ///
2177    /// # Example
2178    /// ```ignore,no_run
2179    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2180    /// use google_cloud_bigquery_analyticshub_v1::model::listing::State;
2181    /// let x0 = Listing::new().set_state(State::Active);
2182    /// ```
2183    pub fn set_state<T: std::convert::Into<crate::model::listing::State>>(mut self, v: T) -> Self {
2184        self.state = v.into();
2185        self
2186    }
2187
2188    /// Sets the value of [icon][crate::model::Listing::icon].
2189    ///
2190    /// # Example
2191    /// ```ignore,no_run
2192    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2193    /// let x = Listing::new().set_icon(bytes::Bytes::from_static(b"example"));
2194    /// ```
2195    pub fn set_icon<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2196        self.icon = v.into();
2197        self
2198    }
2199
2200    /// Sets the value of [data_provider][crate::model::Listing::data_provider].
2201    ///
2202    /// # Example
2203    /// ```ignore,no_run
2204    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2205    /// use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
2206    /// let x = Listing::new().set_data_provider(DataProvider::default()/* use setters */);
2207    /// ```
2208    pub fn set_data_provider<T>(mut self, v: T) -> Self
2209    where
2210        T: std::convert::Into<crate::model::DataProvider>,
2211    {
2212        self.data_provider = std::option::Option::Some(v.into());
2213        self
2214    }
2215
2216    /// Sets or clears the value of [data_provider][crate::model::Listing::data_provider].
2217    ///
2218    /// # Example
2219    /// ```ignore,no_run
2220    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2221    /// use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
2222    /// let x = Listing::new().set_or_clear_data_provider(Some(DataProvider::default()/* use setters */));
2223    /// let x = Listing::new().set_or_clear_data_provider(None::<DataProvider>);
2224    /// ```
2225    pub fn set_or_clear_data_provider<T>(mut self, v: std::option::Option<T>) -> Self
2226    where
2227        T: std::convert::Into<crate::model::DataProvider>,
2228    {
2229        self.data_provider = v.map(|x| x.into());
2230        self
2231    }
2232
2233    /// Sets the value of [categories][crate::model::Listing::categories].
2234    ///
2235    /// # Example
2236    /// ```ignore,no_run
2237    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2238    /// use google_cloud_bigquery_analyticshub_v1::model::listing::Category;
2239    /// let x = Listing::new().set_categories([
2240    ///     Category::Others,
2241    ///     Category::AdvertisingAndMarketing,
2242    ///     Category::Commerce,
2243    /// ]);
2244    /// ```
2245    pub fn set_categories<T, V>(mut self, v: T) -> Self
2246    where
2247        T: std::iter::IntoIterator<Item = V>,
2248        V: std::convert::Into<crate::model::listing::Category>,
2249    {
2250        use std::iter::Iterator;
2251        self.categories = v.into_iter().map(|i| i.into()).collect();
2252        self
2253    }
2254
2255    /// Sets the value of [publisher][crate::model::Listing::publisher].
2256    ///
2257    /// # Example
2258    /// ```ignore,no_run
2259    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2260    /// use google_cloud_bigquery_analyticshub_v1::model::Publisher;
2261    /// let x = Listing::new().set_publisher(Publisher::default()/* use setters */);
2262    /// ```
2263    pub fn set_publisher<T>(mut self, v: T) -> Self
2264    where
2265        T: std::convert::Into<crate::model::Publisher>,
2266    {
2267        self.publisher = std::option::Option::Some(v.into());
2268        self
2269    }
2270
2271    /// Sets or clears the value of [publisher][crate::model::Listing::publisher].
2272    ///
2273    /// # Example
2274    /// ```ignore,no_run
2275    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2276    /// use google_cloud_bigquery_analyticshub_v1::model::Publisher;
2277    /// let x = Listing::new().set_or_clear_publisher(Some(Publisher::default()/* use setters */));
2278    /// let x = Listing::new().set_or_clear_publisher(None::<Publisher>);
2279    /// ```
2280    pub fn set_or_clear_publisher<T>(mut self, v: std::option::Option<T>) -> Self
2281    where
2282        T: std::convert::Into<crate::model::Publisher>,
2283    {
2284        self.publisher = v.map(|x| x.into());
2285        self
2286    }
2287
2288    /// Sets the value of [request_access][crate::model::Listing::request_access].
2289    ///
2290    /// # Example
2291    /// ```ignore,no_run
2292    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2293    /// let x = Listing::new().set_request_access("example");
2294    /// ```
2295    pub fn set_request_access<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2296        self.request_access = v.into();
2297        self
2298    }
2299
2300    /// Sets the value of [restricted_export_config][crate::model::Listing::restricted_export_config].
2301    ///
2302    /// # Example
2303    /// ```ignore,no_run
2304    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2305    /// use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
2306    /// let x = Listing::new().set_restricted_export_config(RestrictedExportConfig::default()/* use setters */);
2307    /// ```
2308    pub fn set_restricted_export_config<T>(mut self, v: T) -> Self
2309    where
2310        T: std::convert::Into<crate::model::listing::RestrictedExportConfig>,
2311    {
2312        self.restricted_export_config = std::option::Option::Some(v.into());
2313        self
2314    }
2315
2316    /// Sets or clears the value of [restricted_export_config][crate::model::Listing::restricted_export_config].
2317    ///
2318    /// # Example
2319    /// ```ignore,no_run
2320    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2321    /// use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
2322    /// let x = Listing::new().set_or_clear_restricted_export_config(Some(RestrictedExportConfig::default()/* use setters */));
2323    /// let x = Listing::new().set_or_clear_restricted_export_config(None::<RestrictedExportConfig>);
2324    /// ```
2325    pub fn set_or_clear_restricted_export_config<T>(mut self, v: std::option::Option<T>) -> Self
2326    where
2327        T: std::convert::Into<crate::model::listing::RestrictedExportConfig>,
2328    {
2329        self.restricted_export_config = v.map(|x| x.into());
2330        self
2331    }
2332
2333    /// Sets the value of [stored_procedure_config][crate::model::Listing::stored_procedure_config].
2334    ///
2335    /// # Example
2336    /// ```ignore,no_run
2337    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2338    /// use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
2339    /// let x = Listing::new().set_stored_procedure_config(StoredProcedureConfig::default()/* use setters */);
2340    /// ```
2341    pub fn set_stored_procedure_config<T>(mut self, v: T) -> Self
2342    where
2343        T: std::convert::Into<crate::model::StoredProcedureConfig>,
2344    {
2345        self.stored_procedure_config = std::option::Option::Some(v.into());
2346        self
2347    }
2348
2349    /// Sets or clears the value of [stored_procedure_config][crate::model::Listing::stored_procedure_config].
2350    ///
2351    /// # Example
2352    /// ```ignore,no_run
2353    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2354    /// use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
2355    /// let x = Listing::new().set_or_clear_stored_procedure_config(Some(StoredProcedureConfig::default()/* use setters */));
2356    /// let x = Listing::new().set_or_clear_stored_procedure_config(None::<StoredProcedureConfig>);
2357    /// ```
2358    pub fn set_or_clear_stored_procedure_config<T>(mut self, v: std::option::Option<T>) -> Self
2359    where
2360        T: std::convert::Into<crate::model::StoredProcedureConfig>,
2361    {
2362        self.stored_procedure_config = v.map(|x| x.into());
2363        self
2364    }
2365
2366    /// Sets the value of [discovery_type][crate::model::Listing::discovery_type].
2367    ///
2368    /// # Example
2369    /// ```ignore,no_run
2370    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2371    /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
2372    /// let x0 = Listing::new().set_discovery_type(DiscoveryType::Private);
2373    /// let x1 = Listing::new().set_discovery_type(DiscoveryType::Public);
2374    /// ```
2375    pub fn set_discovery_type<T>(mut self, v: T) -> Self
2376    where
2377        T: std::convert::Into<crate::model::DiscoveryType>,
2378    {
2379        self.discovery_type = std::option::Option::Some(v.into());
2380        self
2381    }
2382
2383    /// Sets or clears the value of [discovery_type][crate::model::Listing::discovery_type].
2384    ///
2385    /// # Example
2386    /// ```ignore,no_run
2387    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2388    /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
2389    /// let x0 = Listing::new().set_or_clear_discovery_type(Some(DiscoveryType::Private));
2390    /// let x1 = Listing::new().set_or_clear_discovery_type(Some(DiscoveryType::Public));
2391    /// let x_none = Listing::new().set_or_clear_discovery_type(None::<DiscoveryType>);
2392    /// ```
2393    pub fn set_or_clear_discovery_type<T>(mut self, v: std::option::Option<T>) -> Self
2394    where
2395        T: std::convert::Into<crate::model::DiscoveryType>,
2396    {
2397        self.discovery_type = v.map(|x| x.into());
2398        self
2399    }
2400
2401    /// Sets the value of [resource_type][crate::model::Listing::resource_type].
2402    ///
2403    /// # Example
2404    /// ```ignore,no_run
2405    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2406    /// use google_cloud_bigquery_analyticshub_v1::model::SharedResourceType;
2407    /// let x0 = Listing::new().set_resource_type(SharedResourceType::BigqueryDataset);
2408    /// let x1 = Listing::new().set_resource_type(SharedResourceType::PubsubTopic);
2409    /// ```
2410    pub fn set_resource_type<T: std::convert::Into<crate::model::SharedResourceType>>(
2411        mut self,
2412        v: T,
2413    ) -> Self {
2414        self.resource_type = v.into();
2415        self
2416    }
2417
2418    /// Sets the value of [commercial_info][crate::model::Listing::commercial_info].
2419    ///
2420    /// # Example
2421    /// ```ignore,no_run
2422    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2423    /// use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
2424    /// let x = Listing::new().set_commercial_info(CommercialInfo::default()/* use setters */);
2425    /// ```
2426    pub fn set_commercial_info<T>(mut self, v: T) -> Self
2427    where
2428        T: std::convert::Into<crate::model::listing::CommercialInfo>,
2429    {
2430        self.commercial_info = std::option::Option::Some(v.into());
2431        self
2432    }
2433
2434    /// Sets or clears the value of [commercial_info][crate::model::Listing::commercial_info].
2435    ///
2436    /// # Example
2437    /// ```ignore,no_run
2438    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2439    /// use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
2440    /// let x = Listing::new().set_or_clear_commercial_info(Some(CommercialInfo::default()/* use setters */));
2441    /// let x = Listing::new().set_or_clear_commercial_info(None::<CommercialInfo>);
2442    /// ```
2443    pub fn set_or_clear_commercial_info<T>(mut self, v: std::option::Option<T>) -> Self
2444    where
2445        T: std::convert::Into<crate::model::listing::CommercialInfo>,
2446    {
2447        self.commercial_info = v.map(|x| x.into());
2448        self
2449    }
2450
2451    /// Sets the value of [log_linked_dataset_query_user_email][crate::model::Listing::log_linked_dataset_query_user_email].
2452    ///
2453    /// # Example
2454    /// ```ignore,no_run
2455    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2456    /// let x = Listing::new().set_log_linked_dataset_query_user_email(true);
2457    /// ```
2458    pub fn set_log_linked_dataset_query_user_email<T>(mut self, v: T) -> Self
2459    where
2460        T: std::convert::Into<bool>,
2461    {
2462        self.log_linked_dataset_query_user_email = std::option::Option::Some(v.into());
2463        self
2464    }
2465
2466    /// Sets or clears the value of [log_linked_dataset_query_user_email][crate::model::Listing::log_linked_dataset_query_user_email].
2467    ///
2468    /// # Example
2469    /// ```ignore,no_run
2470    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2471    /// let x = Listing::new().set_or_clear_log_linked_dataset_query_user_email(Some(false));
2472    /// let x = Listing::new().set_or_clear_log_linked_dataset_query_user_email(None::<bool>);
2473    /// ```
2474    pub fn set_or_clear_log_linked_dataset_query_user_email<T>(
2475        mut self,
2476        v: std::option::Option<T>,
2477    ) -> Self
2478    where
2479        T: std::convert::Into<bool>,
2480    {
2481        self.log_linked_dataset_query_user_email = v.map(|x| x.into());
2482        self
2483    }
2484
2485    /// Sets the value of [allow_only_metadata_sharing][crate::model::Listing::allow_only_metadata_sharing].
2486    ///
2487    /// # Example
2488    /// ```ignore,no_run
2489    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2490    /// let x = Listing::new().set_allow_only_metadata_sharing(true);
2491    /// ```
2492    pub fn set_allow_only_metadata_sharing<T>(mut self, v: T) -> Self
2493    where
2494        T: std::convert::Into<bool>,
2495    {
2496        self.allow_only_metadata_sharing = std::option::Option::Some(v.into());
2497        self
2498    }
2499
2500    /// Sets or clears the value of [allow_only_metadata_sharing][crate::model::Listing::allow_only_metadata_sharing].
2501    ///
2502    /// # Example
2503    /// ```ignore,no_run
2504    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2505    /// let x = Listing::new().set_or_clear_allow_only_metadata_sharing(Some(false));
2506    /// let x = Listing::new().set_or_clear_allow_only_metadata_sharing(None::<bool>);
2507    /// ```
2508    pub fn set_or_clear_allow_only_metadata_sharing<T>(mut self, v: std::option::Option<T>) -> Self
2509    where
2510        T: std::convert::Into<bool>,
2511    {
2512        self.allow_only_metadata_sharing = v.map(|x| x.into());
2513        self
2514    }
2515
2516    /// Sets the value of [source][crate::model::Listing::source].
2517    ///
2518    /// Note that all the setters affecting `source` are mutually
2519    /// exclusive.
2520    ///
2521    /// # Example
2522    /// ```ignore,no_run
2523    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2524    /// use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2525    /// let x = Listing::new().set_source(Some(
2526    ///     google_cloud_bigquery_analyticshub_v1::model::listing::Source::BigqueryDataset(BigQueryDatasetSource::default().into())));
2527    /// ```
2528    pub fn set_source<T: std::convert::Into<std::option::Option<crate::model::listing::Source>>>(
2529        mut self,
2530        v: T,
2531    ) -> Self {
2532        self.source = v.into();
2533        self
2534    }
2535
2536    /// The value of [source][crate::model::Listing::source]
2537    /// if it holds a `BigqueryDataset`, `None` if the field is not set or
2538    /// holds a different branch.
2539    pub fn bigquery_dataset(
2540        &self,
2541    ) -> std::option::Option<&std::boxed::Box<crate::model::listing::BigQueryDatasetSource>> {
2542        #[allow(unreachable_patterns)]
2543        self.source.as_ref().and_then(|v| match v {
2544            crate::model::listing::Source::BigqueryDataset(v) => std::option::Option::Some(v),
2545            _ => std::option::Option::None,
2546        })
2547    }
2548
2549    /// Sets the value of [source][crate::model::Listing::source]
2550    /// to hold a `BigqueryDataset`.
2551    ///
2552    /// Note that all the setters affecting `source` are
2553    /// mutually exclusive.
2554    ///
2555    /// # Example
2556    /// ```ignore,no_run
2557    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2558    /// use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2559    /// let x = Listing::new().set_bigquery_dataset(BigQueryDatasetSource::default()/* use setters */);
2560    /// assert!(x.bigquery_dataset().is_some());
2561    /// assert!(x.pubsub_topic().is_none());
2562    /// ```
2563    pub fn set_bigquery_dataset<
2564        T: std::convert::Into<std::boxed::Box<crate::model::listing::BigQueryDatasetSource>>,
2565    >(
2566        mut self,
2567        v: T,
2568    ) -> Self {
2569        self.source =
2570            std::option::Option::Some(crate::model::listing::Source::BigqueryDataset(v.into()));
2571        self
2572    }
2573
2574    /// The value of [source][crate::model::Listing::source]
2575    /// if it holds a `PubsubTopic`, `None` if the field is not set or
2576    /// holds a different branch.
2577    pub fn pubsub_topic(
2578        &self,
2579    ) -> std::option::Option<&std::boxed::Box<crate::model::listing::PubSubTopicSource>> {
2580        #[allow(unreachable_patterns)]
2581        self.source.as_ref().and_then(|v| match v {
2582            crate::model::listing::Source::PubsubTopic(v) => std::option::Option::Some(v),
2583            _ => std::option::Option::None,
2584        })
2585    }
2586
2587    /// Sets the value of [source][crate::model::Listing::source]
2588    /// to hold a `PubsubTopic`.
2589    ///
2590    /// Note that all the setters affecting `source` are
2591    /// mutually exclusive.
2592    ///
2593    /// # Example
2594    /// ```ignore,no_run
2595    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2596    /// use google_cloud_bigquery_analyticshub_v1::model::listing::PubSubTopicSource;
2597    /// let x = Listing::new().set_pubsub_topic(PubSubTopicSource::default()/* use setters */);
2598    /// assert!(x.pubsub_topic().is_some());
2599    /// assert!(x.bigquery_dataset().is_none());
2600    /// ```
2601    pub fn set_pubsub_topic<
2602        T: std::convert::Into<std::boxed::Box<crate::model::listing::PubSubTopicSource>>,
2603    >(
2604        mut self,
2605        v: T,
2606    ) -> Self {
2607        self.source =
2608            std::option::Option::Some(crate::model::listing::Source::PubsubTopic(v.into()));
2609        self
2610    }
2611}
2612
2613impl wkt::message::Message for Listing {
2614    fn typename() -> &'static str {
2615        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing"
2616    }
2617}
2618
2619/// Defines additional types related to [Listing].
2620pub mod listing {
2621    #[allow(unused_imports)]
2622    use super::*;
2623
2624    /// A reference to a shared dataset. It is an existing BigQuery dataset with a
2625    /// collection of objects such as tables and views that you want to share
2626    /// with subscribers.
2627    /// When subscriber's subscribe to a listing, Analytics Hub creates a linked
2628    /// dataset in
2629    /// the subscriber's project. A Linked dataset is an opaque, read-only BigQuery
2630    /// dataset that serves as a _symbolic link_ to a shared dataset.
2631    #[derive(Clone, Default, PartialEq)]
2632    #[non_exhaustive]
2633    pub struct BigQueryDatasetSource {
2634        /// Optional. Resource name of the dataset source for this listing.
2635        /// e.g. `projects/myproject/datasets/123`
2636        pub dataset: std::string::String,
2637
2638        /// Optional. Resource in this dataset that is selectively shared.
2639        /// This field is required for data clean room exchanges.
2640        pub selected_resources:
2641            std::vec::Vec<crate::model::listing::big_query_dataset_source::SelectedResource>,
2642
2643        /// Optional. If set, restricted export policy will be propagated and
2644        /// enforced on the linked dataset.
2645        pub restricted_export_policy: std::option::Option<
2646            crate::model::listing::big_query_dataset_source::RestrictedExportPolicy,
2647        >,
2648
2649        /// Optional. A list of regions where the publisher has created shared
2650        /// dataset replicas.
2651        pub replica_locations: std::vec::Vec<std::string::String>,
2652
2653        /// Output only. Server-owned effective state of replicas.
2654        /// Contains both primary and secondary replicas.
2655        /// Each replica includes a system-computed (output-only) state and primary
2656        /// designation.
2657        pub effective_replicas:
2658            std::vec::Vec<crate::model::listing::big_query_dataset_source::Replica>,
2659
2660        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2661    }
2662
2663    impl BigQueryDatasetSource {
2664        pub fn new() -> Self {
2665            std::default::Default::default()
2666        }
2667
2668        /// Sets the value of [dataset][crate::model::listing::BigQueryDatasetSource::dataset].
2669        ///
2670        /// # Example
2671        /// ```ignore,no_run
2672        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2673        /// let x = BigQueryDatasetSource::new().set_dataset("example");
2674        /// ```
2675        pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2676            self.dataset = v.into();
2677            self
2678        }
2679
2680        /// Sets the value of [selected_resources][crate::model::listing::BigQueryDatasetSource::selected_resources].
2681        ///
2682        /// # Example
2683        /// ```ignore,no_run
2684        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2685        /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2686        /// let x = BigQueryDatasetSource::new()
2687        ///     .set_selected_resources([
2688        ///         SelectedResource::default()/* use setters */,
2689        ///         SelectedResource::default()/* use (different) setters */,
2690        ///     ]);
2691        /// ```
2692        pub fn set_selected_resources<T, V>(mut self, v: T) -> Self
2693        where
2694            T: std::iter::IntoIterator<Item = V>,
2695            V: std::convert::Into<
2696                    crate::model::listing::big_query_dataset_source::SelectedResource,
2697                >,
2698        {
2699            use std::iter::Iterator;
2700            self.selected_resources = v.into_iter().map(|i| i.into()).collect();
2701            self
2702        }
2703
2704        /// Sets the value of [restricted_export_policy][crate::model::listing::BigQueryDatasetSource::restricted_export_policy].
2705        ///
2706        /// # Example
2707        /// ```ignore,no_run
2708        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2709        /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2710        /// let x = BigQueryDatasetSource::new().set_restricted_export_policy(RestrictedExportPolicy::default()/* use setters */);
2711        /// ```
2712        pub fn set_restricted_export_policy<T>(mut self, v: T) -> Self
2713        where
2714            T: std::convert::Into<
2715                    crate::model::listing::big_query_dataset_source::RestrictedExportPolicy,
2716                >,
2717        {
2718            self.restricted_export_policy = std::option::Option::Some(v.into());
2719            self
2720        }
2721
2722        /// Sets or clears the value of [restricted_export_policy][crate::model::listing::BigQueryDatasetSource::restricted_export_policy].
2723        ///
2724        /// # Example
2725        /// ```ignore,no_run
2726        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2727        /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2728        /// let x = BigQueryDatasetSource::new().set_or_clear_restricted_export_policy(Some(RestrictedExportPolicy::default()/* use setters */));
2729        /// let x = BigQueryDatasetSource::new().set_or_clear_restricted_export_policy(None::<RestrictedExportPolicy>);
2730        /// ```
2731        pub fn set_or_clear_restricted_export_policy<T>(mut self, v: std::option::Option<T>) -> Self
2732        where
2733            T: std::convert::Into<
2734                    crate::model::listing::big_query_dataset_source::RestrictedExportPolicy,
2735                >,
2736        {
2737            self.restricted_export_policy = v.map(|x| x.into());
2738            self
2739        }
2740
2741        /// Sets the value of [replica_locations][crate::model::listing::BigQueryDatasetSource::replica_locations].
2742        ///
2743        /// # Example
2744        /// ```ignore,no_run
2745        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2746        /// let x = BigQueryDatasetSource::new().set_replica_locations(["a", "b", "c"]);
2747        /// ```
2748        pub fn set_replica_locations<T, V>(mut self, v: T) -> Self
2749        where
2750            T: std::iter::IntoIterator<Item = V>,
2751            V: std::convert::Into<std::string::String>,
2752        {
2753            use std::iter::Iterator;
2754            self.replica_locations = v.into_iter().map(|i| i.into()).collect();
2755            self
2756        }
2757
2758        /// Sets the value of [effective_replicas][crate::model::listing::BigQueryDatasetSource::effective_replicas].
2759        ///
2760        /// # Example
2761        /// ```ignore,no_run
2762        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2763        /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
2764        /// let x = BigQueryDatasetSource::new()
2765        ///     .set_effective_replicas([
2766        ///         Replica::default()/* use setters */,
2767        ///         Replica::default()/* use (different) setters */,
2768        ///     ]);
2769        /// ```
2770        pub fn set_effective_replicas<T, V>(mut self, v: T) -> Self
2771        where
2772            T: std::iter::IntoIterator<Item = V>,
2773            V: std::convert::Into<crate::model::listing::big_query_dataset_source::Replica>,
2774        {
2775            use std::iter::Iterator;
2776            self.effective_replicas = v.into_iter().map(|i| i.into()).collect();
2777            self
2778        }
2779    }
2780
2781    impl wkt::message::Message for BigQueryDatasetSource {
2782        fn typename() -> &'static str {
2783            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource"
2784        }
2785    }
2786
2787    /// Defines additional types related to [BigQueryDatasetSource].
2788    pub mod big_query_dataset_source {
2789        #[allow(unused_imports)]
2790        use super::*;
2791
2792        /// Resource in this dataset that is selectively shared.
2793        #[derive(Clone, Default, PartialEq)]
2794        #[non_exhaustive]
2795        pub struct SelectedResource {
2796            pub resource: std::option::Option<
2797                crate::model::listing::big_query_dataset_source::selected_resource::Resource,
2798            >,
2799
2800            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2801        }
2802
2803        impl SelectedResource {
2804            pub fn new() -> Self {
2805                std::default::Default::default()
2806            }
2807
2808            /// Sets the value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource].
2809            ///
2810            /// Note that all the setters affecting `resource` are mutually
2811            /// exclusive.
2812            ///
2813            /// # Example
2814            /// ```ignore,no_run
2815            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2816            /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::selected_resource::Resource;
2817            /// let x = SelectedResource::new().set_resource(Some(Resource::Table("example".to_string())));
2818            /// ```
2819            pub fn set_resource<T: std::convert::Into<std::option::Option<crate::model::listing::big_query_dataset_source::selected_resource::Resource>>>(mut self, v: T) -> Self
2820            {
2821                self.resource = v.into();
2822                self
2823            }
2824
2825            /// The value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2826            /// if it holds a `Table`, `None` if the field is not set or
2827            /// holds a different branch.
2828            pub fn table(&self) -> std::option::Option<&std::string::String> {
2829                #[allow(unreachable_patterns)]
2830                self.resource.as_ref().and_then(|v| match v {
2831                    crate::model::listing::big_query_dataset_source::selected_resource::Resource::Table(v) => std::option::Option::Some(v),
2832                    _ => std::option::Option::None,
2833                })
2834            }
2835
2836            /// Sets the value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2837            /// to hold a `Table`.
2838            ///
2839            /// Note that all the setters affecting `resource` are
2840            /// mutually exclusive.
2841            ///
2842            /// # Example
2843            /// ```ignore,no_run
2844            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2845            /// let x = SelectedResource::new().set_table("example");
2846            /// assert!(x.table().is_some());
2847            /// assert!(x.routine().is_none());
2848            /// ```
2849            pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2850                self.resource = std::option::Option::Some(
2851                    crate::model::listing::big_query_dataset_source::selected_resource::Resource::Table(
2852                        v.into()
2853                    )
2854                );
2855                self
2856            }
2857
2858            /// The value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2859            /// if it holds a `Routine`, `None` if the field is not set or
2860            /// holds a different branch.
2861            pub fn routine(&self) -> std::option::Option<&std::string::String> {
2862                #[allow(unreachable_patterns)]
2863                self.resource.as_ref().and_then(|v| match v {
2864                    crate::model::listing::big_query_dataset_source::selected_resource::Resource::Routine(v) => std::option::Option::Some(v),
2865                    _ => std::option::Option::None,
2866                })
2867            }
2868
2869            /// Sets the value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2870            /// to hold a `Routine`.
2871            ///
2872            /// Note that all the setters affecting `resource` are
2873            /// mutually exclusive.
2874            ///
2875            /// # Example
2876            /// ```ignore,no_run
2877            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2878            /// let x = SelectedResource::new().set_routine("example");
2879            /// assert!(x.routine().is_some());
2880            /// assert!(x.table().is_none());
2881            /// ```
2882            pub fn set_routine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2883                self.resource = std::option::Option::Some(
2884                    crate::model::listing::big_query_dataset_source::selected_resource::Resource::Routine(
2885                        v.into()
2886                    )
2887                );
2888                self
2889            }
2890        }
2891
2892        impl wkt::message::Message for SelectedResource {
2893            fn typename() -> &'static str {
2894                "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.SelectedResource"
2895            }
2896        }
2897
2898        /// Defines additional types related to [SelectedResource].
2899        pub mod selected_resource {
2900            #[allow(unused_imports)]
2901            use super::*;
2902
2903            #[derive(Clone, Debug, PartialEq)]
2904            #[non_exhaustive]
2905            pub enum Resource {
2906                /// Optional. Format:
2907                /// For table:
2908                /// `projects/{projectId}/datasets/{datasetId}/tables/{tableId}`
2909                /// Example:"projects/test_project/datasets/test_dataset/tables/test_table"
2910                Table(std::string::String),
2911                /// Optional. Format:
2912                /// For routine:
2913                /// `projects/{projectId}/datasets/{datasetId}/routines/{routineId}`
2914                /// Example:"projects/test_project/datasets/test_dataset/routines/test_routine"
2915                Routine(std::string::String),
2916            }
2917        }
2918
2919        /// Restricted export policy used to configure restricted export on linked
2920        /// dataset.
2921        #[derive(Clone, Default, PartialEq)]
2922        #[non_exhaustive]
2923        pub struct RestrictedExportPolicy {
2924            /// Optional. If true, enable restricted export.
2925            pub enabled: std::option::Option<wkt::BoolValue>,
2926
2927            /// Optional. If true, restrict direct table access (read
2928            /// api/tabledata.list) on linked table.
2929            pub restrict_direct_table_access: std::option::Option<wkt::BoolValue>,
2930
2931            /// Optional. If true, restrict export of query result derived from
2932            /// restricted linked dataset table.
2933            pub restrict_query_result: std::option::Option<wkt::BoolValue>,
2934
2935            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2936        }
2937
2938        impl RestrictedExportPolicy {
2939            pub fn new() -> Self {
2940                std::default::Default::default()
2941            }
2942
2943            /// Sets the value of [enabled][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::enabled].
2944            ///
2945            /// # Example
2946            /// ```ignore,no_run
2947            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2948            /// use wkt::BoolValue;
2949            /// let x = RestrictedExportPolicy::new().set_enabled(BoolValue::default()/* use setters */);
2950            /// ```
2951            pub fn set_enabled<T>(mut self, v: T) -> Self
2952            where
2953                T: std::convert::Into<wkt::BoolValue>,
2954            {
2955                self.enabled = std::option::Option::Some(v.into());
2956                self
2957            }
2958
2959            /// Sets or clears the value of [enabled][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::enabled].
2960            ///
2961            /// # Example
2962            /// ```ignore,no_run
2963            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2964            /// use wkt::BoolValue;
2965            /// let x = RestrictedExportPolicy::new().set_or_clear_enabled(Some(BoolValue::default()/* use setters */));
2966            /// let x = RestrictedExportPolicy::new().set_or_clear_enabled(None::<BoolValue>);
2967            /// ```
2968            pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
2969            where
2970                T: std::convert::Into<wkt::BoolValue>,
2971            {
2972                self.enabled = v.map(|x| x.into());
2973                self
2974            }
2975
2976            /// Sets the value of [restrict_direct_table_access][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_direct_table_access].
2977            ///
2978            /// # Example
2979            /// ```ignore,no_run
2980            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2981            /// use wkt::BoolValue;
2982            /// let x = RestrictedExportPolicy::new().set_restrict_direct_table_access(BoolValue::default()/* use setters */);
2983            /// ```
2984            pub fn set_restrict_direct_table_access<T>(mut self, v: T) -> Self
2985            where
2986                T: std::convert::Into<wkt::BoolValue>,
2987            {
2988                self.restrict_direct_table_access = std::option::Option::Some(v.into());
2989                self
2990            }
2991
2992            /// Sets or clears the value of [restrict_direct_table_access][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_direct_table_access].
2993            ///
2994            /// # Example
2995            /// ```ignore,no_run
2996            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2997            /// use wkt::BoolValue;
2998            /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_direct_table_access(Some(BoolValue::default()/* use setters */));
2999            /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_direct_table_access(None::<BoolValue>);
3000            /// ```
3001            pub fn set_or_clear_restrict_direct_table_access<T>(
3002                mut self,
3003                v: std::option::Option<T>,
3004            ) -> Self
3005            where
3006                T: std::convert::Into<wkt::BoolValue>,
3007            {
3008                self.restrict_direct_table_access = v.map(|x| x.into());
3009                self
3010            }
3011
3012            /// Sets the value of [restrict_query_result][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_query_result].
3013            ///
3014            /// # Example
3015            /// ```ignore,no_run
3016            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
3017            /// use wkt::BoolValue;
3018            /// let x = RestrictedExportPolicy::new().set_restrict_query_result(BoolValue::default()/* use setters */);
3019            /// ```
3020            pub fn set_restrict_query_result<T>(mut self, v: T) -> Self
3021            where
3022                T: std::convert::Into<wkt::BoolValue>,
3023            {
3024                self.restrict_query_result = std::option::Option::Some(v.into());
3025                self
3026            }
3027
3028            /// Sets or clears the value of [restrict_query_result][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_query_result].
3029            ///
3030            /// # Example
3031            /// ```ignore,no_run
3032            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
3033            /// use wkt::BoolValue;
3034            /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_query_result(Some(BoolValue::default()/* use setters */));
3035            /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_query_result(None::<BoolValue>);
3036            /// ```
3037            pub fn set_or_clear_restrict_query_result<T>(
3038                mut self,
3039                v: std::option::Option<T>,
3040            ) -> Self
3041            where
3042                T: std::convert::Into<wkt::BoolValue>,
3043            {
3044                self.restrict_query_result = v.map(|x| x.into());
3045                self
3046            }
3047        }
3048
3049        impl wkt::message::Message for RestrictedExportPolicy {
3050            fn typename() -> &'static str {
3051                "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.RestrictedExportPolicy"
3052            }
3053        }
3054
3055        /// Represents the state of a replica of a shared dataset.
3056        /// It includes the geographic location of the replica and
3057        /// system-computed, output-only fields indicating its replication state and
3058        /// whether it is the primary replica.
3059        #[derive(Clone, Default, PartialEq)]
3060        #[non_exhaustive]
3061        pub struct Replica {
3062            /// Output only. The geographic location where the replica resides. See
3063            /// [BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
3064            /// for supported locations. Eg. "us-central1".
3065            pub location: std::string::String,
3066
3067            /// Output only. Assigned by Analytics Hub based on real BigQuery
3068            /// replication state.
3069            pub replica_state:
3070                crate::model::listing::big_query_dataset_source::replica::ReplicaState,
3071
3072            /// Output only. Indicates that this replica is the primary replica.
3073            pub primary_state: std::option::Option<
3074                crate::model::listing::big_query_dataset_source::replica::PrimaryState,
3075            >,
3076
3077            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3078        }
3079
3080        impl Replica {
3081            pub fn new() -> Self {
3082                std::default::Default::default()
3083            }
3084
3085            /// Sets the value of [location][crate::model::listing::big_query_dataset_source::Replica::location].
3086            ///
3087            /// # Example
3088            /// ```ignore,no_run
3089            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3090            /// let x = Replica::new().set_location("example");
3091            /// ```
3092            pub fn set_location<T: std::convert::Into<std::string::String>>(
3093                mut self,
3094                v: T,
3095            ) -> Self {
3096                self.location = v.into();
3097                self
3098            }
3099
3100            /// Sets the value of [replica_state][crate::model::listing::big_query_dataset_source::Replica::replica_state].
3101            ///
3102            /// # Example
3103            /// ```ignore,no_run
3104            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3105            /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::replica::ReplicaState;
3106            /// let x0 = Replica::new().set_replica_state(ReplicaState::ReadyToUse);
3107            /// let x1 = Replica::new().set_replica_state(ReplicaState::Unavailable);
3108            /// ```
3109            pub fn set_replica_state<
3110                T: std::convert::Into<
3111                        crate::model::listing::big_query_dataset_source::replica::ReplicaState,
3112                    >,
3113            >(
3114                mut self,
3115                v: T,
3116            ) -> Self {
3117                self.replica_state = v.into();
3118                self
3119            }
3120
3121            /// Sets the value of [primary_state][crate::model::listing::big_query_dataset_source::Replica::primary_state].
3122            ///
3123            /// # Example
3124            /// ```ignore,no_run
3125            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3126            /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::replica::PrimaryState;
3127            /// let x0 = Replica::new().set_primary_state(PrimaryState::PrimaryReplica);
3128            /// ```
3129            pub fn set_primary_state<T>(mut self, v: T) -> Self
3130            where
3131                T: std::convert::Into<
3132                        crate::model::listing::big_query_dataset_source::replica::PrimaryState,
3133                    >,
3134            {
3135                self.primary_state = std::option::Option::Some(v.into());
3136                self
3137            }
3138
3139            /// Sets or clears the value of [primary_state][crate::model::listing::big_query_dataset_source::Replica::primary_state].
3140            ///
3141            /// # Example
3142            /// ```ignore,no_run
3143            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3144            /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::replica::PrimaryState;
3145            /// let x0 = Replica::new().set_or_clear_primary_state(Some(PrimaryState::PrimaryReplica));
3146            /// let x_none = Replica::new().set_or_clear_primary_state(None::<PrimaryState>);
3147            /// ```
3148            pub fn set_or_clear_primary_state<T>(mut self, v: std::option::Option<T>) -> Self
3149            where
3150                T: std::convert::Into<
3151                        crate::model::listing::big_query_dataset_source::replica::PrimaryState,
3152                    >,
3153            {
3154                self.primary_state = v.map(|x| x.into());
3155                self
3156            }
3157        }
3158
3159        impl wkt::message::Message for Replica {
3160            fn typename() -> &'static str {
3161                "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica"
3162            }
3163        }
3164
3165        /// Defines additional types related to [Replica].
3166        pub mod replica {
3167            #[allow(unused_imports)]
3168            use super::*;
3169
3170            /// Replica state of the shared dataset.
3171            ///
3172            /// # Working with unknown values
3173            ///
3174            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3175            /// additional enum variants at any time. Adding new variants is not considered
3176            /// a breaking change. Applications should write their code in anticipation of:
3177            ///
3178            /// - New values appearing in future releases of the client library, **and**
3179            /// - New values received dynamically, without application changes.
3180            ///
3181            /// Please consult the [Working with enums] section in the user guide for some
3182            /// guidelines.
3183            ///
3184            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3185            #[derive(Clone, Debug, PartialEq)]
3186            #[non_exhaustive]
3187            pub enum ReplicaState {
3188                /// Default value. This value is unused.
3189                Unspecified,
3190                /// The replica is backfilled and ready to use.
3191                ReadyToUse,
3192                /// The replica is unavailable, does not exist, or has not been
3193                /// backfilled yet.
3194                Unavailable,
3195                /// If set, the enum was initialized with an unknown value.
3196                ///
3197                /// Applications can examine the value using [ReplicaState::value] or
3198                /// [ReplicaState::name].
3199                UnknownValue(replica_state::UnknownValue),
3200            }
3201
3202            #[doc(hidden)]
3203            pub mod replica_state {
3204                #[allow(unused_imports)]
3205                use super::*;
3206                #[derive(Clone, Debug, PartialEq)]
3207                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3208            }
3209
3210            impl ReplicaState {
3211                /// Gets the enum value.
3212                ///
3213                /// Returns `None` if the enum contains an unknown value deserialized from
3214                /// the string representation of enums.
3215                pub fn value(&self) -> std::option::Option<i32> {
3216                    match self {
3217                        Self::Unspecified => std::option::Option::Some(0),
3218                        Self::ReadyToUse => std::option::Option::Some(1),
3219                        Self::Unavailable => std::option::Option::Some(2),
3220                        Self::UnknownValue(u) => u.0.value(),
3221                    }
3222                }
3223
3224                /// Gets the enum value as a string.
3225                ///
3226                /// Returns `None` if the enum contains an unknown value deserialized from
3227                /// the integer representation of enums.
3228                pub fn name(&self) -> std::option::Option<&str> {
3229                    match self {
3230                        Self::Unspecified => std::option::Option::Some("REPLICA_STATE_UNSPECIFIED"),
3231                        Self::ReadyToUse => std::option::Option::Some("READY_TO_USE"),
3232                        Self::Unavailable => std::option::Option::Some("UNAVAILABLE"),
3233                        Self::UnknownValue(u) => u.0.name(),
3234                    }
3235                }
3236            }
3237
3238            impl std::default::Default for ReplicaState {
3239                fn default() -> Self {
3240                    use std::convert::From;
3241                    Self::from(0)
3242                }
3243            }
3244
3245            impl std::fmt::Display for ReplicaState {
3246                fn fmt(
3247                    &self,
3248                    f: &mut std::fmt::Formatter<'_>,
3249                ) -> std::result::Result<(), std::fmt::Error> {
3250                    wkt::internal::display_enum(f, self.name(), self.value())
3251                }
3252            }
3253
3254            impl std::convert::From<i32> for ReplicaState {
3255                fn from(value: i32) -> Self {
3256                    match value {
3257                        0 => Self::Unspecified,
3258                        1 => Self::ReadyToUse,
3259                        2 => Self::Unavailable,
3260                        _ => Self::UnknownValue(replica_state::UnknownValue(
3261                            wkt::internal::UnknownEnumValue::Integer(value),
3262                        )),
3263                    }
3264                }
3265            }
3266
3267            impl std::convert::From<&str> for ReplicaState {
3268                fn from(value: &str) -> Self {
3269                    use std::string::ToString;
3270                    match value {
3271                        "REPLICA_STATE_UNSPECIFIED" => Self::Unspecified,
3272                        "READY_TO_USE" => Self::ReadyToUse,
3273                        "UNAVAILABLE" => Self::Unavailable,
3274                        _ => Self::UnknownValue(replica_state::UnknownValue(
3275                            wkt::internal::UnknownEnumValue::String(value.to_string()),
3276                        )),
3277                    }
3278                }
3279            }
3280
3281            impl serde::ser::Serialize for ReplicaState {
3282                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3283                where
3284                    S: serde::Serializer,
3285                {
3286                    match self {
3287                        Self::Unspecified => serializer.serialize_i32(0),
3288                        Self::ReadyToUse => serializer.serialize_i32(1),
3289                        Self::Unavailable => serializer.serialize_i32(2),
3290                        Self::UnknownValue(u) => u.0.serialize(serializer),
3291                    }
3292                }
3293            }
3294
3295            impl<'de> serde::de::Deserialize<'de> for ReplicaState {
3296                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3297                where
3298                    D: serde::Deserializer<'de>,
3299                {
3300                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicaState>::new(
3301                        ".google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.ReplicaState"))
3302                }
3303            }
3304
3305            /// Primary state of the replica. Set only for the primary replica.
3306            ///
3307            /// # Working with unknown values
3308            ///
3309            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3310            /// additional enum variants at any time. Adding new variants is not considered
3311            /// a breaking change. Applications should write their code in anticipation of:
3312            ///
3313            /// - New values appearing in future releases of the client library, **and**
3314            /// - New values received dynamically, without application changes.
3315            ///
3316            /// Please consult the [Working with enums] section in the user guide for some
3317            /// guidelines.
3318            ///
3319            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3320            #[derive(Clone, Debug, PartialEq)]
3321            #[non_exhaustive]
3322            pub enum PrimaryState {
3323                /// Default value. This value is unused.
3324                Unspecified,
3325                /// The replica is the primary replica.
3326                PrimaryReplica,
3327                /// If set, the enum was initialized with an unknown value.
3328                ///
3329                /// Applications can examine the value using [PrimaryState::value] or
3330                /// [PrimaryState::name].
3331                UnknownValue(primary_state::UnknownValue),
3332            }
3333
3334            #[doc(hidden)]
3335            pub mod primary_state {
3336                #[allow(unused_imports)]
3337                use super::*;
3338                #[derive(Clone, Debug, PartialEq)]
3339                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3340            }
3341
3342            impl PrimaryState {
3343                /// Gets the enum value.
3344                ///
3345                /// Returns `None` if the enum contains an unknown value deserialized from
3346                /// the string representation of enums.
3347                pub fn value(&self) -> std::option::Option<i32> {
3348                    match self {
3349                        Self::Unspecified => std::option::Option::Some(0),
3350                        Self::PrimaryReplica => std::option::Option::Some(1),
3351                        Self::UnknownValue(u) => u.0.value(),
3352                    }
3353                }
3354
3355                /// Gets the enum value as a string.
3356                ///
3357                /// Returns `None` if the enum contains an unknown value deserialized from
3358                /// the integer representation of enums.
3359                pub fn name(&self) -> std::option::Option<&str> {
3360                    match self {
3361                        Self::Unspecified => std::option::Option::Some("PRIMARY_STATE_UNSPECIFIED"),
3362                        Self::PrimaryReplica => std::option::Option::Some("PRIMARY_REPLICA"),
3363                        Self::UnknownValue(u) => u.0.name(),
3364                    }
3365                }
3366            }
3367
3368            impl std::default::Default for PrimaryState {
3369                fn default() -> Self {
3370                    use std::convert::From;
3371                    Self::from(0)
3372                }
3373            }
3374
3375            impl std::fmt::Display for PrimaryState {
3376                fn fmt(
3377                    &self,
3378                    f: &mut std::fmt::Formatter<'_>,
3379                ) -> std::result::Result<(), std::fmt::Error> {
3380                    wkt::internal::display_enum(f, self.name(), self.value())
3381                }
3382            }
3383
3384            impl std::convert::From<i32> for PrimaryState {
3385                fn from(value: i32) -> Self {
3386                    match value {
3387                        0 => Self::Unspecified,
3388                        1 => Self::PrimaryReplica,
3389                        _ => Self::UnknownValue(primary_state::UnknownValue(
3390                            wkt::internal::UnknownEnumValue::Integer(value),
3391                        )),
3392                    }
3393                }
3394            }
3395
3396            impl std::convert::From<&str> for PrimaryState {
3397                fn from(value: &str) -> Self {
3398                    use std::string::ToString;
3399                    match value {
3400                        "PRIMARY_STATE_UNSPECIFIED" => Self::Unspecified,
3401                        "PRIMARY_REPLICA" => Self::PrimaryReplica,
3402                        _ => Self::UnknownValue(primary_state::UnknownValue(
3403                            wkt::internal::UnknownEnumValue::String(value.to_string()),
3404                        )),
3405                    }
3406                }
3407            }
3408
3409            impl serde::ser::Serialize for PrimaryState {
3410                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3411                where
3412                    S: serde::Serializer,
3413                {
3414                    match self {
3415                        Self::Unspecified => serializer.serialize_i32(0),
3416                        Self::PrimaryReplica => serializer.serialize_i32(1),
3417                        Self::UnknownValue(u) => u.0.serialize(serializer),
3418                    }
3419                }
3420            }
3421
3422            impl<'de> serde::de::Deserialize<'de> for PrimaryState {
3423                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3424                where
3425                    D: serde::Deserializer<'de>,
3426                {
3427                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<PrimaryState>::new(
3428                        ".google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.PrimaryState"))
3429                }
3430            }
3431        }
3432    }
3433
3434    /// Pub/Sub topic source.
3435    #[derive(Clone, Default, PartialEq)]
3436    #[non_exhaustive]
3437    pub struct PubSubTopicSource {
3438        /// Required. Resource name of the Pub/Sub topic source for this listing.
3439        /// e.g. projects/myproject/topics/topicId
3440        pub topic: std::string::String,
3441
3442        /// Optional. Region hint on where the data might be published. Data affinity
3443        /// regions are modifiable. See <https://cloud.google.com/about/locations> for
3444        /// full listing of possible Cloud regions.
3445        pub data_affinity_regions: std::vec::Vec<std::string::String>,
3446
3447        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3448    }
3449
3450    impl PubSubTopicSource {
3451        pub fn new() -> Self {
3452            std::default::Default::default()
3453        }
3454
3455        /// Sets the value of [topic][crate::model::listing::PubSubTopicSource::topic].
3456        ///
3457        /// # Example
3458        /// ```ignore,no_run
3459        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::PubSubTopicSource;
3460        /// let x = PubSubTopicSource::new().set_topic("example");
3461        /// ```
3462        pub fn set_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3463            self.topic = v.into();
3464            self
3465        }
3466
3467        /// Sets the value of [data_affinity_regions][crate::model::listing::PubSubTopicSource::data_affinity_regions].
3468        ///
3469        /// # Example
3470        /// ```ignore,no_run
3471        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::PubSubTopicSource;
3472        /// let x = PubSubTopicSource::new().set_data_affinity_regions(["a", "b", "c"]);
3473        /// ```
3474        pub fn set_data_affinity_regions<T, V>(mut self, v: T) -> Self
3475        where
3476            T: std::iter::IntoIterator<Item = V>,
3477            V: std::convert::Into<std::string::String>,
3478        {
3479            use std::iter::Iterator;
3480            self.data_affinity_regions = v.into_iter().map(|i| i.into()).collect();
3481            self
3482        }
3483    }
3484
3485    impl wkt::message::Message for PubSubTopicSource {
3486        fn typename() -> &'static str {
3487            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.PubSubTopicSource"
3488        }
3489    }
3490
3491    /// Restricted export config, used to configure restricted export on linked
3492    /// dataset.
3493    #[derive(Clone, Default, PartialEq)]
3494    #[non_exhaustive]
3495    pub struct RestrictedExportConfig {
3496        /// Optional. If true, enable restricted export.
3497        pub enabled: bool,
3498
3499        /// Output only. If true, restrict direct table access(read
3500        /// api/tabledata.list) on linked table.
3501        pub restrict_direct_table_access: bool,
3502
3503        /// Optional. If true, restrict export of query result derived from
3504        /// restricted linked dataset table.
3505        pub restrict_query_result: bool,
3506
3507        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3508    }
3509
3510    impl RestrictedExportConfig {
3511        pub fn new() -> Self {
3512            std::default::Default::default()
3513        }
3514
3515        /// Sets the value of [enabled][crate::model::listing::RestrictedExportConfig::enabled].
3516        ///
3517        /// # Example
3518        /// ```ignore,no_run
3519        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
3520        /// let x = RestrictedExportConfig::new().set_enabled(true);
3521        /// ```
3522        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3523            self.enabled = v.into();
3524            self
3525        }
3526
3527        /// Sets the value of [restrict_direct_table_access][crate::model::listing::RestrictedExportConfig::restrict_direct_table_access].
3528        ///
3529        /// # Example
3530        /// ```ignore,no_run
3531        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
3532        /// let x = RestrictedExportConfig::new().set_restrict_direct_table_access(true);
3533        /// ```
3534        pub fn set_restrict_direct_table_access<T: std::convert::Into<bool>>(
3535            mut self,
3536            v: T,
3537        ) -> Self {
3538            self.restrict_direct_table_access = v.into();
3539            self
3540        }
3541
3542        /// Sets the value of [restrict_query_result][crate::model::listing::RestrictedExportConfig::restrict_query_result].
3543        ///
3544        /// # Example
3545        /// ```ignore,no_run
3546        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
3547        /// let x = RestrictedExportConfig::new().set_restrict_query_result(true);
3548        /// ```
3549        pub fn set_restrict_query_result<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3550            self.restrict_query_result = v.into();
3551            self
3552        }
3553    }
3554
3555    impl wkt::message::Message for RestrictedExportConfig {
3556        fn typename() -> &'static str {
3557            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.RestrictedExportConfig"
3558        }
3559    }
3560
3561    /// Commercial info contains the information about the commercial data products
3562    /// associated with the listing.
3563    #[derive(Clone, Default, PartialEq)]
3564    #[non_exhaustive]
3565    pub struct CommercialInfo {
3566        /// Output only. Details of the Marketplace Data Product associated with the
3567        /// Listing.
3568        pub cloud_marketplace:
3569            std::option::Option<crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo>,
3570
3571        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3572    }
3573
3574    impl CommercialInfo {
3575        pub fn new() -> Self {
3576            std::default::Default::default()
3577        }
3578
3579        /// Sets the value of [cloud_marketplace][crate::model::listing::CommercialInfo::cloud_marketplace].
3580        ///
3581        /// # Example
3582        /// ```ignore,no_run
3583        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
3584        /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3585        /// let x = CommercialInfo::new().set_cloud_marketplace(GoogleCloudMarketplaceInfo::default()/* use setters */);
3586        /// ```
3587        pub fn set_cloud_marketplace<T>(mut self, v: T) -> Self
3588        where
3589            T: std::convert::Into<
3590                    crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo,
3591                >,
3592        {
3593            self.cloud_marketplace = std::option::Option::Some(v.into());
3594            self
3595        }
3596
3597        /// Sets or clears the value of [cloud_marketplace][crate::model::listing::CommercialInfo::cloud_marketplace].
3598        ///
3599        /// # Example
3600        /// ```ignore,no_run
3601        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
3602        /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3603        /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(Some(GoogleCloudMarketplaceInfo::default()/* use setters */));
3604        /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(None::<GoogleCloudMarketplaceInfo>);
3605        /// ```
3606        pub fn set_or_clear_cloud_marketplace<T>(mut self, v: std::option::Option<T>) -> Self
3607        where
3608            T: std::convert::Into<
3609                    crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo,
3610                >,
3611        {
3612            self.cloud_marketplace = v.map(|x| x.into());
3613            self
3614        }
3615    }
3616
3617    impl wkt::message::Message for CommercialInfo {
3618        fn typename() -> &'static str {
3619            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.CommercialInfo"
3620        }
3621    }
3622
3623    /// Defines additional types related to [CommercialInfo].
3624    pub mod commercial_info {
3625        #[allow(unused_imports)]
3626        use super::*;
3627
3628        /// Specifies the details of the Marketplace Data Product associated with the
3629        /// Listing.
3630        #[derive(Clone, Default, PartialEq)]
3631        #[non_exhaustive]
3632        pub struct GoogleCloudMarketplaceInfo {
3633
3634            /// Output only. Resource name of the commercial service associated with
3635            /// the Marketplace Data Product. e.g. example.com
3636            pub service: std::option::Option<std::string::String>,
3637
3638            /// Output only. Commercial state of the Marketplace Data Product.
3639            pub commercial_state: std::option::Option<crate::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState>,
3640
3641            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3642        }
3643
3644        impl GoogleCloudMarketplaceInfo {
3645            pub fn new() -> Self {
3646                std::default::Default::default()
3647            }
3648
3649            /// Sets the value of [service][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::service].
3650            ///
3651            /// # Example
3652            /// ```ignore,no_run
3653            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3654            /// let x = GoogleCloudMarketplaceInfo::new().set_service("example");
3655            /// ```
3656            pub fn set_service<T>(mut self, v: T) -> Self
3657            where
3658                T: std::convert::Into<std::string::String>,
3659            {
3660                self.service = std::option::Option::Some(v.into());
3661                self
3662            }
3663
3664            /// Sets or clears the value of [service][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::service].
3665            ///
3666            /// # Example
3667            /// ```ignore,no_run
3668            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3669            /// let x = GoogleCloudMarketplaceInfo::new().set_or_clear_service(Some("example"));
3670            /// let x = GoogleCloudMarketplaceInfo::new().set_or_clear_service(None::<String>);
3671            /// ```
3672            pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
3673            where
3674                T: std::convert::Into<std::string::String>,
3675            {
3676                self.service = v.map(|x| x.into());
3677                self
3678            }
3679
3680            /// Sets the value of [commercial_state][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::commercial_state].
3681            ///
3682            /// # Example
3683            /// ```ignore,no_run
3684            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3685            /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState;
3686            /// let x0 = GoogleCloudMarketplaceInfo::new().set_commercial_state(CommercialState::Onboarding);
3687            /// let x1 = GoogleCloudMarketplaceInfo::new().set_commercial_state(CommercialState::Active);
3688            /// ```
3689            pub fn set_commercial_state<T>(mut self, v: T) -> Self
3690            where T: std::convert::Into<crate::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState>
3691            {
3692                self.commercial_state = std::option::Option::Some(v.into());
3693                self
3694            }
3695
3696            /// Sets or clears the value of [commercial_state][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::commercial_state].
3697            ///
3698            /// # Example
3699            /// ```ignore,no_run
3700            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3701            /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState;
3702            /// let x0 = GoogleCloudMarketplaceInfo::new().set_or_clear_commercial_state(Some(CommercialState::Onboarding));
3703            /// let x1 = GoogleCloudMarketplaceInfo::new().set_or_clear_commercial_state(Some(CommercialState::Active));
3704            /// let x_none = GoogleCloudMarketplaceInfo::new().set_or_clear_commercial_state(None::<CommercialState>);
3705            /// ```
3706            pub fn set_or_clear_commercial_state<T>(mut self, v: std::option::Option<T>) -> Self
3707            where T: std::convert::Into<crate::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState>
3708            {
3709                self.commercial_state = v.map(|x| x.into());
3710                self
3711            }
3712        }
3713
3714        impl wkt::message::Message for GoogleCloudMarketplaceInfo {
3715            fn typename() -> &'static str {
3716                "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.CommercialInfo.GoogleCloudMarketplaceInfo"
3717            }
3718        }
3719
3720        /// Defines additional types related to [GoogleCloudMarketplaceInfo].
3721        pub mod google_cloud_marketplace_info {
3722            #[allow(unused_imports)]
3723            use super::*;
3724
3725            /// Indicates whether this commercial access is currently active.
3726            ///
3727            /// # Working with unknown values
3728            ///
3729            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3730            /// additional enum variants at any time. Adding new variants is not considered
3731            /// a breaking change. Applications should write their code in anticipation of:
3732            ///
3733            /// - New values appearing in future releases of the client library, **and**
3734            /// - New values received dynamically, without application changes.
3735            ///
3736            /// Please consult the [Working with enums] section in the user guide for some
3737            /// guidelines.
3738            ///
3739            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3740            #[derive(Clone, Debug, PartialEq)]
3741            #[non_exhaustive]
3742            pub enum CommercialState {
3743                /// Commercialization is incomplete and cannot be used.
3744                Unspecified,
3745                /// Commercialization has been initialized.
3746                Onboarding,
3747                /// Commercialization is complete and available for use.
3748                Active,
3749                /// If set, the enum was initialized with an unknown value.
3750                ///
3751                /// Applications can examine the value using [CommercialState::value] or
3752                /// [CommercialState::name].
3753                UnknownValue(commercial_state::UnknownValue),
3754            }
3755
3756            #[doc(hidden)]
3757            pub mod commercial_state {
3758                #[allow(unused_imports)]
3759                use super::*;
3760                #[derive(Clone, Debug, PartialEq)]
3761                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3762            }
3763
3764            impl CommercialState {
3765                /// Gets the enum value.
3766                ///
3767                /// Returns `None` if the enum contains an unknown value deserialized from
3768                /// the string representation of enums.
3769                pub fn value(&self) -> std::option::Option<i32> {
3770                    match self {
3771                        Self::Unspecified => std::option::Option::Some(0),
3772                        Self::Onboarding => std::option::Option::Some(1),
3773                        Self::Active => std::option::Option::Some(2),
3774                        Self::UnknownValue(u) => u.0.value(),
3775                    }
3776                }
3777
3778                /// Gets the enum value as a string.
3779                ///
3780                /// Returns `None` if the enum contains an unknown value deserialized from
3781                /// the integer representation of enums.
3782                pub fn name(&self) -> std::option::Option<&str> {
3783                    match self {
3784                        Self::Unspecified => {
3785                            std::option::Option::Some("COMMERCIAL_STATE_UNSPECIFIED")
3786                        }
3787                        Self::Onboarding => std::option::Option::Some("ONBOARDING"),
3788                        Self::Active => std::option::Option::Some("ACTIVE"),
3789                        Self::UnknownValue(u) => u.0.name(),
3790                    }
3791                }
3792            }
3793
3794            impl std::default::Default for CommercialState {
3795                fn default() -> Self {
3796                    use std::convert::From;
3797                    Self::from(0)
3798                }
3799            }
3800
3801            impl std::fmt::Display for CommercialState {
3802                fn fmt(
3803                    &self,
3804                    f: &mut std::fmt::Formatter<'_>,
3805                ) -> std::result::Result<(), std::fmt::Error> {
3806                    wkt::internal::display_enum(f, self.name(), self.value())
3807                }
3808            }
3809
3810            impl std::convert::From<i32> for CommercialState {
3811                fn from(value: i32) -> Self {
3812                    match value {
3813                        0 => Self::Unspecified,
3814                        1 => Self::Onboarding,
3815                        2 => Self::Active,
3816                        _ => Self::UnknownValue(commercial_state::UnknownValue(
3817                            wkt::internal::UnknownEnumValue::Integer(value),
3818                        )),
3819                    }
3820                }
3821            }
3822
3823            impl std::convert::From<&str> for CommercialState {
3824                fn from(value: &str) -> Self {
3825                    use std::string::ToString;
3826                    match value {
3827                        "COMMERCIAL_STATE_UNSPECIFIED" => Self::Unspecified,
3828                        "ONBOARDING" => Self::Onboarding,
3829                        "ACTIVE" => Self::Active,
3830                        _ => Self::UnknownValue(commercial_state::UnknownValue(
3831                            wkt::internal::UnknownEnumValue::String(value.to_string()),
3832                        )),
3833                    }
3834                }
3835            }
3836
3837            impl serde::ser::Serialize for CommercialState {
3838                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3839                where
3840                    S: serde::Serializer,
3841                {
3842                    match self {
3843                        Self::Unspecified => serializer.serialize_i32(0),
3844                        Self::Onboarding => serializer.serialize_i32(1),
3845                        Self::Active => serializer.serialize_i32(2),
3846                        Self::UnknownValue(u) => u.0.serialize(serializer),
3847                    }
3848                }
3849            }
3850
3851            impl<'de> serde::de::Deserialize<'de> for CommercialState {
3852                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3853                where
3854                    D: serde::Deserializer<'de>,
3855                {
3856                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<CommercialState>::new(
3857                        ".google.cloud.bigquery.analyticshub.v1.Listing.CommercialInfo.GoogleCloudMarketplaceInfo.CommercialState"))
3858                }
3859            }
3860        }
3861    }
3862
3863    /// State of the listing.
3864    ///
3865    /// # Working with unknown values
3866    ///
3867    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3868    /// additional enum variants at any time. Adding new variants is not considered
3869    /// a breaking change. Applications should write their code in anticipation of:
3870    ///
3871    /// - New values appearing in future releases of the client library, **and**
3872    /// - New values received dynamically, without application changes.
3873    ///
3874    /// Please consult the [Working with enums] section in the user guide for some
3875    /// guidelines.
3876    ///
3877    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3878    #[derive(Clone, Debug, PartialEq)]
3879    #[non_exhaustive]
3880    pub enum State {
3881        /// Default value. This value is unused.
3882        Unspecified,
3883        /// Subscribable state. Users with dataexchange.listings.subscribe permission
3884        /// can subscribe to this listing.
3885        Active,
3886        /// If set, the enum was initialized with an unknown value.
3887        ///
3888        /// Applications can examine the value using [State::value] or
3889        /// [State::name].
3890        UnknownValue(state::UnknownValue),
3891    }
3892
3893    #[doc(hidden)]
3894    pub mod state {
3895        #[allow(unused_imports)]
3896        use super::*;
3897        #[derive(Clone, Debug, PartialEq)]
3898        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3899    }
3900
3901    impl State {
3902        /// Gets the enum value.
3903        ///
3904        /// Returns `None` if the enum contains an unknown value deserialized from
3905        /// the string representation of enums.
3906        pub fn value(&self) -> std::option::Option<i32> {
3907            match self {
3908                Self::Unspecified => std::option::Option::Some(0),
3909                Self::Active => std::option::Option::Some(1),
3910                Self::UnknownValue(u) => u.0.value(),
3911            }
3912        }
3913
3914        /// Gets the enum value as a string.
3915        ///
3916        /// Returns `None` if the enum contains an unknown value deserialized from
3917        /// the integer representation of enums.
3918        pub fn name(&self) -> std::option::Option<&str> {
3919            match self {
3920                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3921                Self::Active => std::option::Option::Some("ACTIVE"),
3922                Self::UnknownValue(u) => u.0.name(),
3923            }
3924        }
3925    }
3926
3927    impl std::default::Default for State {
3928        fn default() -> Self {
3929            use std::convert::From;
3930            Self::from(0)
3931        }
3932    }
3933
3934    impl std::fmt::Display for State {
3935        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3936            wkt::internal::display_enum(f, self.name(), self.value())
3937        }
3938    }
3939
3940    impl std::convert::From<i32> for State {
3941        fn from(value: i32) -> Self {
3942            match value {
3943                0 => Self::Unspecified,
3944                1 => Self::Active,
3945                _ => Self::UnknownValue(state::UnknownValue(
3946                    wkt::internal::UnknownEnumValue::Integer(value),
3947                )),
3948            }
3949        }
3950    }
3951
3952    impl std::convert::From<&str> for State {
3953        fn from(value: &str) -> Self {
3954            use std::string::ToString;
3955            match value {
3956                "STATE_UNSPECIFIED" => Self::Unspecified,
3957                "ACTIVE" => Self::Active,
3958                _ => Self::UnknownValue(state::UnknownValue(
3959                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3960                )),
3961            }
3962        }
3963    }
3964
3965    impl serde::ser::Serialize for State {
3966        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3967        where
3968            S: serde::Serializer,
3969        {
3970            match self {
3971                Self::Unspecified => serializer.serialize_i32(0),
3972                Self::Active => serializer.serialize_i32(1),
3973                Self::UnknownValue(u) => u.0.serialize(serializer),
3974            }
3975        }
3976    }
3977
3978    impl<'de> serde::de::Deserialize<'de> for State {
3979        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3980        where
3981            D: serde::Deserializer<'de>,
3982        {
3983            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3984                ".google.cloud.bigquery.analyticshub.v1.Listing.State",
3985            ))
3986        }
3987    }
3988
3989    /// Listing categories.
3990    ///
3991    /// # Working with unknown values
3992    ///
3993    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3994    /// additional enum variants at any time. Adding new variants is not considered
3995    /// a breaking change. Applications should write their code in anticipation of:
3996    ///
3997    /// - New values appearing in future releases of the client library, **and**
3998    /// - New values received dynamically, without application changes.
3999    ///
4000    /// Please consult the [Working with enums] section in the user guide for some
4001    /// guidelines.
4002    ///
4003    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4004    #[derive(Clone, Debug, PartialEq)]
4005    #[non_exhaustive]
4006    pub enum Category {
4007        Unspecified,
4008        Others,
4009        AdvertisingAndMarketing,
4010        Commerce,
4011        ClimateAndEnvironment,
4012        Demographics,
4013        Economics,
4014        Education,
4015        Energy,
4016        Financial,
4017        Gaming,
4018        Geospatial,
4019        HealthcareAndLifeScience,
4020        Media,
4021        PublicSector,
4022        Retail,
4023        Sports,
4024        ScienceAndResearch,
4025        TransportationAndLogistics,
4026        TravelAndTourism,
4027        GoogleEarthEngine,
4028        /// If set, the enum was initialized with an unknown value.
4029        ///
4030        /// Applications can examine the value using [Category::value] or
4031        /// [Category::name].
4032        UnknownValue(category::UnknownValue),
4033    }
4034
4035    #[doc(hidden)]
4036    pub mod category {
4037        #[allow(unused_imports)]
4038        use super::*;
4039        #[derive(Clone, Debug, PartialEq)]
4040        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4041    }
4042
4043    impl Category {
4044        /// Gets the enum value.
4045        ///
4046        /// Returns `None` if the enum contains an unknown value deserialized from
4047        /// the string representation of enums.
4048        pub fn value(&self) -> std::option::Option<i32> {
4049            match self {
4050                Self::Unspecified => std::option::Option::Some(0),
4051                Self::Others => std::option::Option::Some(1),
4052                Self::AdvertisingAndMarketing => std::option::Option::Some(2),
4053                Self::Commerce => std::option::Option::Some(3),
4054                Self::ClimateAndEnvironment => std::option::Option::Some(4),
4055                Self::Demographics => std::option::Option::Some(5),
4056                Self::Economics => std::option::Option::Some(6),
4057                Self::Education => std::option::Option::Some(7),
4058                Self::Energy => std::option::Option::Some(8),
4059                Self::Financial => std::option::Option::Some(9),
4060                Self::Gaming => std::option::Option::Some(10),
4061                Self::Geospatial => std::option::Option::Some(11),
4062                Self::HealthcareAndLifeScience => std::option::Option::Some(12),
4063                Self::Media => std::option::Option::Some(13),
4064                Self::PublicSector => std::option::Option::Some(14),
4065                Self::Retail => std::option::Option::Some(15),
4066                Self::Sports => std::option::Option::Some(16),
4067                Self::ScienceAndResearch => std::option::Option::Some(17),
4068                Self::TransportationAndLogistics => std::option::Option::Some(18),
4069                Self::TravelAndTourism => std::option::Option::Some(19),
4070                Self::GoogleEarthEngine => std::option::Option::Some(20),
4071                Self::UnknownValue(u) => u.0.value(),
4072            }
4073        }
4074
4075        /// Gets the enum value as a string.
4076        ///
4077        /// Returns `None` if the enum contains an unknown value deserialized from
4078        /// the integer representation of enums.
4079        pub fn name(&self) -> std::option::Option<&str> {
4080            match self {
4081                Self::Unspecified => std::option::Option::Some("CATEGORY_UNSPECIFIED"),
4082                Self::Others => std::option::Option::Some("CATEGORY_OTHERS"),
4083                Self::AdvertisingAndMarketing => {
4084                    std::option::Option::Some("CATEGORY_ADVERTISING_AND_MARKETING")
4085                }
4086                Self::Commerce => std::option::Option::Some("CATEGORY_COMMERCE"),
4087                Self::ClimateAndEnvironment => {
4088                    std::option::Option::Some("CATEGORY_CLIMATE_AND_ENVIRONMENT")
4089                }
4090                Self::Demographics => std::option::Option::Some("CATEGORY_DEMOGRAPHICS"),
4091                Self::Economics => std::option::Option::Some("CATEGORY_ECONOMICS"),
4092                Self::Education => std::option::Option::Some("CATEGORY_EDUCATION"),
4093                Self::Energy => std::option::Option::Some("CATEGORY_ENERGY"),
4094                Self::Financial => std::option::Option::Some("CATEGORY_FINANCIAL"),
4095                Self::Gaming => std::option::Option::Some("CATEGORY_GAMING"),
4096                Self::Geospatial => std::option::Option::Some("CATEGORY_GEOSPATIAL"),
4097                Self::HealthcareAndLifeScience => {
4098                    std::option::Option::Some("CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE")
4099                }
4100                Self::Media => std::option::Option::Some("CATEGORY_MEDIA"),
4101                Self::PublicSector => std::option::Option::Some("CATEGORY_PUBLIC_SECTOR"),
4102                Self::Retail => std::option::Option::Some("CATEGORY_RETAIL"),
4103                Self::Sports => std::option::Option::Some("CATEGORY_SPORTS"),
4104                Self::ScienceAndResearch => {
4105                    std::option::Option::Some("CATEGORY_SCIENCE_AND_RESEARCH")
4106                }
4107                Self::TransportationAndLogistics => {
4108                    std::option::Option::Some("CATEGORY_TRANSPORTATION_AND_LOGISTICS")
4109                }
4110                Self::TravelAndTourism => std::option::Option::Some("CATEGORY_TRAVEL_AND_TOURISM"),
4111                Self::GoogleEarthEngine => {
4112                    std::option::Option::Some("CATEGORY_GOOGLE_EARTH_ENGINE")
4113                }
4114                Self::UnknownValue(u) => u.0.name(),
4115            }
4116        }
4117    }
4118
4119    impl std::default::Default for Category {
4120        fn default() -> Self {
4121            use std::convert::From;
4122            Self::from(0)
4123        }
4124    }
4125
4126    impl std::fmt::Display for Category {
4127        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4128            wkt::internal::display_enum(f, self.name(), self.value())
4129        }
4130    }
4131
4132    impl std::convert::From<i32> for Category {
4133        fn from(value: i32) -> Self {
4134            match value {
4135                0 => Self::Unspecified,
4136                1 => Self::Others,
4137                2 => Self::AdvertisingAndMarketing,
4138                3 => Self::Commerce,
4139                4 => Self::ClimateAndEnvironment,
4140                5 => Self::Demographics,
4141                6 => Self::Economics,
4142                7 => Self::Education,
4143                8 => Self::Energy,
4144                9 => Self::Financial,
4145                10 => Self::Gaming,
4146                11 => Self::Geospatial,
4147                12 => Self::HealthcareAndLifeScience,
4148                13 => Self::Media,
4149                14 => Self::PublicSector,
4150                15 => Self::Retail,
4151                16 => Self::Sports,
4152                17 => Self::ScienceAndResearch,
4153                18 => Self::TransportationAndLogistics,
4154                19 => Self::TravelAndTourism,
4155                20 => Self::GoogleEarthEngine,
4156                _ => Self::UnknownValue(category::UnknownValue(
4157                    wkt::internal::UnknownEnumValue::Integer(value),
4158                )),
4159            }
4160        }
4161    }
4162
4163    impl std::convert::From<&str> for Category {
4164        fn from(value: &str) -> Self {
4165            use std::string::ToString;
4166            match value {
4167                "CATEGORY_UNSPECIFIED" => Self::Unspecified,
4168                "CATEGORY_OTHERS" => Self::Others,
4169                "CATEGORY_ADVERTISING_AND_MARKETING" => Self::AdvertisingAndMarketing,
4170                "CATEGORY_COMMERCE" => Self::Commerce,
4171                "CATEGORY_CLIMATE_AND_ENVIRONMENT" => Self::ClimateAndEnvironment,
4172                "CATEGORY_DEMOGRAPHICS" => Self::Demographics,
4173                "CATEGORY_ECONOMICS" => Self::Economics,
4174                "CATEGORY_EDUCATION" => Self::Education,
4175                "CATEGORY_ENERGY" => Self::Energy,
4176                "CATEGORY_FINANCIAL" => Self::Financial,
4177                "CATEGORY_GAMING" => Self::Gaming,
4178                "CATEGORY_GEOSPATIAL" => Self::Geospatial,
4179                "CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE" => Self::HealthcareAndLifeScience,
4180                "CATEGORY_MEDIA" => Self::Media,
4181                "CATEGORY_PUBLIC_SECTOR" => Self::PublicSector,
4182                "CATEGORY_RETAIL" => Self::Retail,
4183                "CATEGORY_SPORTS" => Self::Sports,
4184                "CATEGORY_SCIENCE_AND_RESEARCH" => Self::ScienceAndResearch,
4185                "CATEGORY_TRANSPORTATION_AND_LOGISTICS" => Self::TransportationAndLogistics,
4186                "CATEGORY_TRAVEL_AND_TOURISM" => Self::TravelAndTourism,
4187                "CATEGORY_GOOGLE_EARTH_ENGINE" => Self::GoogleEarthEngine,
4188                _ => Self::UnknownValue(category::UnknownValue(
4189                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4190                )),
4191            }
4192        }
4193    }
4194
4195    impl serde::ser::Serialize for Category {
4196        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4197        where
4198            S: serde::Serializer,
4199        {
4200            match self {
4201                Self::Unspecified => serializer.serialize_i32(0),
4202                Self::Others => serializer.serialize_i32(1),
4203                Self::AdvertisingAndMarketing => serializer.serialize_i32(2),
4204                Self::Commerce => serializer.serialize_i32(3),
4205                Self::ClimateAndEnvironment => serializer.serialize_i32(4),
4206                Self::Demographics => serializer.serialize_i32(5),
4207                Self::Economics => serializer.serialize_i32(6),
4208                Self::Education => serializer.serialize_i32(7),
4209                Self::Energy => serializer.serialize_i32(8),
4210                Self::Financial => serializer.serialize_i32(9),
4211                Self::Gaming => serializer.serialize_i32(10),
4212                Self::Geospatial => serializer.serialize_i32(11),
4213                Self::HealthcareAndLifeScience => serializer.serialize_i32(12),
4214                Self::Media => serializer.serialize_i32(13),
4215                Self::PublicSector => serializer.serialize_i32(14),
4216                Self::Retail => serializer.serialize_i32(15),
4217                Self::Sports => serializer.serialize_i32(16),
4218                Self::ScienceAndResearch => serializer.serialize_i32(17),
4219                Self::TransportationAndLogistics => serializer.serialize_i32(18),
4220                Self::TravelAndTourism => serializer.serialize_i32(19),
4221                Self::GoogleEarthEngine => serializer.serialize_i32(20),
4222                Self::UnknownValue(u) => u.0.serialize(serializer),
4223            }
4224        }
4225    }
4226
4227    impl<'de> serde::de::Deserialize<'de> for Category {
4228        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4229        where
4230            D: serde::Deserializer<'de>,
4231        {
4232            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Category>::new(
4233                ".google.cloud.bigquery.analyticshub.v1.Listing.Category",
4234            ))
4235        }
4236    }
4237
4238    /// Listing source.
4239    #[derive(Clone, Debug, PartialEq)]
4240    #[non_exhaustive]
4241    pub enum Source {
4242        /// Shared dataset i.e. BigQuery dataset source.
4243        BigqueryDataset(std::boxed::Box<crate::model::listing::BigQueryDatasetSource>),
4244        /// Pub/Sub topic source.
4245        PubsubTopic(std::boxed::Box<crate::model::listing::PubSubTopicSource>),
4246    }
4247}
4248
4249/// Stored procedure configuration, used to configure stored procedure sharing
4250/// on linked dataset.
4251#[derive(Clone, Default, PartialEq)]
4252#[non_exhaustive]
4253pub struct StoredProcedureConfig {
4254    /// Optional. If true, enable sharing of stored procedure.
4255    pub enabled: bool,
4256
4257    /// Output only. Types of stored procedure supported to share.
4258    pub allowed_stored_procedure_types:
4259        std::vec::Vec<crate::model::stored_procedure_config::StoredProcedureType>,
4260
4261    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4262}
4263
4264impl StoredProcedureConfig {
4265    pub fn new() -> Self {
4266        std::default::Default::default()
4267    }
4268
4269    /// Sets the value of [enabled][crate::model::StoredProcedureConfig::enabled].
4270    ///
4271    /// # Example
4272    /// ```ignore,no_run
4273    /// # use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
4274    /// let x = StoredProcedureConfig::new().set_enabled(true);
4275    /// ```
4276    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4277        self.enabled = v.into();
4278        self
4279    }
4280
4281    /// Sets the value of [allowed_stored_procedure_types][crate::model::StoredProcedureConfig::allowed_stored_procedure_types].
4282    ///
4283    /// # Example
4284    /// ```ignore,no_run
4285    /// # use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
4286    /// use google_cloud_bigquery_analyticshub_v1::model::stored_procedure_config::StoredProcedureType;
4287    /// let x = StoredProcedureConfig::new().set_allowed_stored_procedure_types([
4288    ///     StoredProcedureType::SqlProcedure,
4289    /// ]);
4290    /// ```
4291    pub fn set_allowed_stored_procedure_types<T, V>(mut self, v: T) -> Self
4292    where
4293        T: std::iter::IntoIterator<Item = V>,
4294        V: std::convert::Into<crate::model::stored_procedure_config::StoredProcedureType>,
4295    {
4296        use std::iter::Iterator;
4297        self.allowed_stored_procedure_types = v.into_iter().map(|i| i.into()).collect();
4298        self
4299    }
4300}
4301
4302impl wkt::message::Message for StoredProcedureConfig {
4303    fn typename() -> &'static str {
4304        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.StoredProcedureConfig"
4305    }
4306}
4307
4308/// Defines additional types related to [StoredProcedureConfig].
4309pub mod stored_procedure_config {
4310    #[allow(unused_imports)]
4311    use super::*;
4312
4313    /// Enum to specify the type of stored procedure to share.
4314    ///
4315    /// # Working with unknown values
4316    ///
4317    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4318    /// additional enum variants at any time. Adding new variants is not considered
4319    /// a breaking change. Applications should write their code in anticipation of:
4320    ///
4321    /// - New values appearing in future releases of the client library, **and**
4322    /// - New values received dynamically, without application changes.
4323    ///
4324    /// Please consult the [Working with enums] section in the user guide for some
4325    /// guidelines.
4326    ///
4327    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4328    #[derive(Clone, Debug, PartialEq)]
4329    #[non_exhaustive]
4330    pub enum StoredProcedureType {
4331        /// Default value. This value is unused.
4332        Unspecified,
4333        /// SQL stored procedure.
4334        SqlProcedure,
4335        /// If set, the enum was initialized with an unknown value.
4336        ///
4337        /// Applications can examine the value using [StoredProcedureType::value] or
4338        /// [StoredProcedureType::name].
4339        UnknownValue(stored_procedure_type::UnknownValue),
4340    }
4341
4342    #[doc(hidden)]
4343    pub mod stored_procedure_type {
4344        #[allow(unused_imports)]
4345        use super::*;
4346        #[derive(Clone, Debug, PartialEq)]
4347        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4348    }
4349
4350    impl StoredProcedureType {
4351        /// Gets the enum value.
4352        ///
4353        /// Returns `None` if the enum contains an unknown value deserialized from
4354        /// the string representation of enums.
4355        pub fn value(&self) -> std::option::Option<i32> {
4356            match self {
4357                Self::Unspecified => std::option::Option::Some(0),
4358                Self::SqlProcedure => std::option::Option::Some(1),
4359                Self::UnknownValue(u) => u.0.value(),
4360            }
4361        }
4362
4363        /// Gets the enum value as a string.
4364        ///
4365        /// Returns `None` if the enum contains an unknown value deserialized from
4366        /// the integer representation of enums.
4367        pub fn name(&self) -> std::option::Option<&str> {
4368            match self {
4369                Self::Unspecified => std::option::Option::Some("STORED_PROCEDURE_TYPE_UNSPECIFIED"),
4370                Self::SqlProcedure => std::option::Option::Some("SQL_PROCEDURE"),
4371                Self::UnknownValue(u) => u.0.name(),
4372            }
4373        }
4374    }
4375
4376    impl std::default::Default for StoredProcedureType {
4377        fn default() -> Self {
4378            use std::convert::From;
4379            Self::from(0)
4380        }
4381    }
4382
4383    impl std::fmt::Display for StoredProcedureType {
4384        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4385            wkt::internal::display_enum(f, self.name(), self.value())
4386        }
4387    }
4388
4389    impl std::convert::From<i32> for StoredProcedureType {
4390        fn from(value: i32) -> Self {
4391            match value {
4392                0 => Self::Unspecified,
4393                1 => Self::SqlProcedure,
4394                _ => Self::UnknownValue(stored_procedure_type::UnknownValue(
4395                    wkt::internal::UnknownEnumValue::Integer(value),
4396                )),
4397            }
4398        }
4399    }
4400
4401    impl std::convert::From<&str> for StoredProcedureType {
4402        fn from(value: &str) -> Self {
4403            use std::string::ToString;
4404            match value {
4405                "STORED_PROCEDURE_TYPE_UNSPECIFIED" => Self::Unspecified,
4406                "SQL_PROCEDURE" => Self::SqlProcedure,
4407                _ => Self::UnknownValue(stored_procedure_type::UnknownValue(
4408                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4409                )),
4410            }
4411        }
4412    }
4413
4414    impl serde::ser::Serialize for StoredProcedureType {
4415        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4416        where
4417            S: serde::Serializer,
4418        {
4419            match self {
4420                Self::Unspecified => serializer.serialize_i32(0),
4421                Self::SqlProcedure => serializer.serialize_i32(1),
4422                Self::UnknownValue(u) => u.0.serialize(serializer),
4423            }
4424        }
4425    }
4426
4427    impl<'de> serde::de::Deserialize<'de> for StoredProcedureType {
4428        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4429        where
4430            D: serde::Deserializer<'de>,
4431        {
4432            deserializer.deserialize_any(wkt::internal::EnumVisitor::<StoredProcedureType>::new(
4433                ".google.cloud.bigquery.analyticshub.v1.StoredProcedureConfig.StoredProcedureType",
4434            ))
4435        }
4436    }
4437}
4438
4439/// A subscription represents a subscribers' access to a particular set of
4440/// published data. It contains references to associated listings,
4441/// data exchanges, and linked datasets.
4442#[derive(Clone, Default, PartialEq)]
4443#[non_exhaustive]
4444pub struct Subscription {
4445    /// Output only. The resource name of the subscription.
4446    /// e.g. `projects/myproject/locations/us/subscriptions/123`.
4447    pub name: std::string::String,
4448
4449    /// Output only. Timestamp when the subscription was created.
4450    pub creation_time: std::option::Option<wkt::Timestamp>,
4451
4452    /// Output only. Timestamp when the subscription was last modified.
4453    pub last_modify_time: std::option::Option<wkt::Timestamp>,
4454
4455    /// Output only. Organization of the project this subscription belongs to.
4456    pub organization_id: std::string::String,
4457
4458    /// Output only. Display name of the project of this subscription.
4459    pub organization_display_name: std::string::String,
4460
4461    /// Output only. Current state of the subscription.
4462    pub state: crate::model::subscription::State,
4463
4464    /// Output only. Map of listing resource names to associated linked resource,
4465    /// e.g. projects/123/locations/us/dataExchanges/456/listings/789
4466    /// ->
4467    /// projects/123/datasets/my_dataset
4468    ///
4469    /// For listing-level subscriptions, this is a map of size 1.
4470    /// Only contains values if state == STATE_ACTIVE.
4471    pub linked_dataset_map:
4472        std::collections::HashMap<std::string::String, crate::model::subscription::LinkedResource>,
4473
4474    /// Output only. Email of the subscriber.
4475    pub subscriber_contact: std::string::String,
4476
4477    /// Output only. Linked resources created in the subscription. Only contains
4478    /// values if state = STATE_ACTIVE.
4479    pub linked_resources: std::vec::Vec<crate::model::subscription::LinkedResource>,
4480
4481    /// Output only. Listing shared asset type.
4482    pub resource_type: crate::model::SharedResourceType,
4483
4484    /// Output only. This is set if this is a commercial subscription i.e. if this
4485    /// subscription was created from subscribing to a commercial listing.
4486    pub commercial_info: std::option::Option<crate::model::subscription::CommercialInfo>,
4487
4488    /// Output only. By default, false.
4489    /// If true, the Subscriber agreed to the email sharing mandate
4490    /// that is enabled for DataExchange/Listing.
4491    pub log_linked_dataset_query_user_email: std::option::Option<bool>,
4492
4493    /// Optional. BigQuery destination dataset to create for the subscriber.
4494    pub destination_dataset: std::option::Option<crate::model::DestinationDataset>,
4495
4496    pub resource_name: std::option::Option<crate::model::subscription::ResourceName>,
4497
4498    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4499}
4500
4501impl Subscription {
4502    pub fn new() -> Self {
4503        std::default::Default::default()
4504    }
4505
4506    /// Sets the value of [name][crate::model::Subscription::name].
4507    ///
4508    /// # Example
4509    /// ```ignore,no_run
4510    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4511    /// let x = Subscription::new().set_name("example");
4512    /// ```
4513    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4514        self.name = v.into();
4515        self
4516    }
4517
4518    /// Sets the value of [creation_time][crate::model::Subscription::creation_time].
4519    ///
4520    /// # Example
4521    /// ```ignore,no_run
4522    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4523    /// use wkt::Timestamp;
4524    /// let x = Subscription::new().set_creation_time(Timestamp::default()/* use setters */);
4525    /// ```
4526    pub fn set_creation_time<T>(mut self, v: T) -> Self
4527    where
4528        T: std::convert::Into<wkt::Timestamp>,
4529    {
4530        self.creation_time = std::option::Option::Some(v.into());
4531        self
4532    }
4533
4534    /// Sets or clears the value of [creation_time][crate::model::Subscription::creation_time].
4535    ///
4536    /// # Example
4537    /// ```ignore,no_run
4538    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4539    /// use wkt::Timestamp;
4540    /// let x = Subscription::new().set_or_clear_creation_time(Some(Timestamp::default()/* use setters */));
4541    /// let x = Subscription::new().set_or_clear_creation_time(None::<Timestamp>);
4542    /// ```
4543    pub fn set_or_clear_creation_time<T>(mut self, v: std::option::Option<T>) -> Self
4544    where
4545        T: std::convert::Into<wkt::Timestamp>,
4546    {
4547        self.creation_time = v.map(|x| x.into());
4548        self
4549    }
4550
4551    /// Sets the value of [last_modify_time][crate::model::Subscription::last_modify_time].
4552    ///
4553    /// # Example
4554    /// ```ignore,no_run
4555    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4556    /// use wkt::Timestamp;
4557    /// let x = Subscription::new().set_last_modify_time(Timestamp::default()/* use setters */);
4558    /// ```
4559    pub fn set_last_modify_time<T>(mut self, v: T) -> Self
4560    where
4561        T: std::convert::Into<wkt::Timestamp>,
4562    {
4563        self.last_modify_time = std::option::Option::Some(v.into());
4564        self
4565    }
4566
4567    /// Sets or clears the value of [last_modify_time][crate::model::Subscription::last_modify_time].
4568    ///
4569    /// # Example
4570    /// ```ignore,no_run
4571    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4572    /// use wkt::Timestamp;
4573    /// let x = Subscription::new().set_or_clear_last_modify_time(Some(Timestamp::default()/* use setters */));
4574    /// let x = Subscription::new().set_or_clear_last_modify_time(None::<Timestamp>);
4575    /// ```
4576    pub fn set_or_clear_last_modify_time<T>(mut self, v: std::option::Option<T>) -> Self
4577    where
4578        T: std::convert::Into<wkt::Timestamp>,
4579    {
4580        self.last_modify_time = v.map(|x| x.into());
4581        self
4582    }
4583
4584    /// Sets the value of [organization_id][crate::model::Subscription::organization_id].
4585    ///
4586    /// # Example
4587    /// ```ignore,no_run
4588    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4589    /// let x = Subscription::new().set_organization_id("example");
4590    /// ```
4591    pub fn set_organization_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4592        self.organization_id = v.into();
4593        self
4594    }
4595
4596    /// Sets the value of [organization_display_name][crate::model::Subscription::organization_display_name].
4597    ///
4598    /// # Example
4599    /// ```ignore,no_run
4600    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4601    /// let x = Subscription::new().set_organization_display_name("example");
4602    /// ```
4603    pub fn set_organization_display_name<T: std::convert::Into<std::string::String>>(
4604        mut self,
4605        v: T,
4606    ) -> Self {
4607        self.organization_display_name = v.into();
4608        self
4609    }
4610
4611    /// Sets the value of [state][crate::model::Subscription::state].
4612    ///
4613    /// # Example
4614    /// ```ignore,no_run
4615    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4616    /// use google_cloud_bigquery_analyticshub_v1::model::subscription::State;
4617    /// let x0 = Subscription::new().set_state(State::Active);
4618    /// let x1 = Subscription::new().set_state(State::Stale);
4619    /// let x2 = Subscription::new().set_state(State::Inactive);
4620    /// ```
4621    pub fn set_state<T: std::convert::Into<crate::model::subscription::State>>(
4622        mut self,
4623        v: T,
4624    ) -> Self {
4625        self.state = v.into();
4626        self
4627    }
4628
4629    /// Sets the value of [linked_dataset_map][crate::model::Subscription::linked_dataset_map].
4630    ///
4631    /// # Example
4632    /// ```ignore,no_run
4633    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4634    /// use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
4635    /// let x = Subscription::new().set_linked_dataset_map([
4636    ///     ("key0", LinkedResource::default()/* use setters */),
4637    ///     ("key1", LinkedResource::default()/* use (different) setters */),
4638    /// ]);
4639    /// ```
4640    pub fn set_linked_dataset_map<T, K, V>(mut self, v: T) -> Self
4641    where
4642        T: std::iter::IntoIterator<Item = (K, V)>,
4643        K: std::convert::Into<std::string::String>,
4644        V: std::convert::Into<crate::model::subscription::LinkedResource>,
4645    {
4646        use std::iter::Iterator;
4647        self.linked_dataset_map = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4648        self
4649    }
4650
4651    /// Sets the value of [subscriber_contact][crate::model::Subscription::subscriber_contact].
4652    ///
4653    /// # Example
4654    /// ```ignore,no_run
4655    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4656    /// let x = Subscription::new().set_subscriber_contact("example");
4657    /// ```
4658    pub fn set_subscriber_contact<T: std::convert::Into<std::string::String>>(
4659        mut self,
4660        v: T,
4661    ) -> Self {
4662        self.subscriber_contact = v.into();
4663        self
4664    }
4665
4666    /// Sets the value of [linked_resources][crate::model::Subscription::linked_resources].
4667    ///
4668    /// # Example
4669    /// ```ignore,no_run
4670    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4671    /// use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
4672    /// let x = Subscription::new()
4673    ///     .set_linked_resources([
4674    ///         LinkedResource::default()/* use setters */,
4675    ///         LinkedResource::default()/* use (different) setters */,
4676    ///     ]);
4677    /// ```
4678    pub fn set_linked_resources<T, V>(mut self, v: T) -> Self
4679    where
4680        T: std::iter::IntoIterator<Item = V>,
4681        V: std::convert::Into<crate::model::subscription::LinkedResource>,
4682    {
4683        use std::iter::Iterator;
4684        self.linked_resources = v.into_iter().map(|i| i.into()).collect();
4685        self
4686    }
4687
4688    /// Sets the value of [resource_type][crate::model::Subscription::resource_type].
4689    ///
4690    /// # Example
4691    /// ```ignore,no_run
4692    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4693    /// use google_cloud_bigquery_analyticshub_v1::model::SharedResourceType;
4694    /// let x0 = Subscription::new().set_resource_type(SharedResourceType::BigqueryDataset);
4695    /// let x1 = Subscription::new().set_resource_type(SharedResourceType::PubsubTopic);
4696    /// ```
4697    pub fn set_resource_type<T: std::convert::Into<crate::model::SharedResourceType>>(
4698        mut self,
4699        v: T,
4700    ) -> Self {
4701        self.resource_type = v.into();
4702        self
4703    }
4704
4705    /// Sets the value of [commercial_info][crate::model::Subscription::commercial_info].
4706    ///
4707    /// # Example
4708    /// ```ignore,no_run
4709    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4710    /// use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
4711    /// let x = Subscription::new().set_commercial_info(CommercialInfo::default()/* use setters */);
4712    /// ```
4713    pub fn set_commercial_info<T>(mut self, v: T) -> Self
4714    where
4715        T: std::convert::Into<crate::model::subscription::CommercialInfo>,
4716    {
4717        self.commercial_info = std::option::Option::Some(v.into());
4718        self
4719    }
4720
4721    /// Sets or clears the value of [commercial_info][crate::model::Subscription::commercial_info].
4722    ///
4723    /// # Example
4724    /// ```ignore,no_run
4725    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4726    /// use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
4727    /// let x = Subscription::new().set_or_clear_commercial_info(Some(CommercialInfo::default()/* use setters */));
4728    /// let x = Subscription::new().set_or_clear_commercial_info(None::<CommercialInfo>);
4729    /// ```
4730    pub fn set_or_clear_commercial_info<T>(mut self, v: std::option::Option<T>) -> Self
4731    where
4732        T: std::convert::Into<crate::model::subscription::CommercialInfo>,
4733    {
4734        self.commercial_info = v.map(|x| x.into());
4735        self
4736    }
4737
4738    /// Sets the value of [log_linked_dataset_query_user_email][crate::model::Subscription::log_linked_dataset_query_user_email].
4739    ///
4740    /// # Example
4741    /// ```ignore,no_run
4742    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4743    /// let x = Subscription::new().set_log_linked_dataset_query_user_email(true);
4744    /// ```
4745    pub fn set_log_linked_dataset_query_user_email<T>(mut self, v: T) -> Self
4746    where
4747        T: std::convert::Into<bool>,
4748    {
4749        self.log_linked_dataset_query_user_email = std::option::Option::Some(v.into());
4750        self
4751    }
4752
4753    /// Sets or clears the value of [log_linked_dataset_query_user_email][crate::model::Subscription::log_linked_dataset_query_user_email].
4754    ///
4755    /// # Example
4756    /// ```ignore,no_run
4757    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4758    /// let x = Subscription::new().set_or_clear_log_linked_dataset_query_user_email(Some(false));
4759    /// let x = Subscription::new().set_or_clear_log_linked_dataset_query_user_email(None::<bool>);
4760    /// ```
4761    pub fn set_or_clear_log_linked_dataset_query_user_email<T>(
4762        mut self,
4763        v: std::option::Option<T>,
4764    ) -> Self
4765    where
4766        T: std::convert::Into<bool>,
4767    {
4768        self.log_linked_dataset_query_user_email = v.map(|x| x.into());
4769        self
4770    }
4771
4772    /// Sets the value of [destination_dataset][crate::model::Subscription::destination_dataset].
4773    ///
4774    /// # Example
4775    /// ```ignore,no_run
4776    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4777    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
4778    /// let x = Subscription::new().set_destination_dataset(DestinationDataset::default()/* use setters */);
4779    /// ```
4780    pub fn set_destination_dataset<T>(mut self, v: T) -> Self
4781    where
4782        T: std::convert::Into<crate::model::DestinationDataset>,
4783    {
4784        self.destination_dataset = std::option::Option::Some(v.into());
4785        self
4786    }
4787
4788    /// Sets or clears the value of [destination_dataset][crate::model::Subscription::destination_dataset].
4789    ///
4790    /// # Example
4791    /// ```ignore,no_run
4792    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4793    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
4794    /// let x = Subscription::new().set_or_clear_destination_dataset(Some(DestinationDataset::default()/* use setters */));
4795    /// let x = Subscription::new().set_or_clear_destination_dataset(None::<DestinationDataset>);
4796    /// ```
4797    pub fn set_or_clear_destination_dataset<T>(mut self, v: std::option::Option<T>) -> Self
4798    where
4799        T: std::convert::Into<crate::model::DestinationDataset>,
4800    {
4801        self.destination_dataset = v.map(|x| x.into());
4802        self
4803    }
4804
4805    /// Sets the value of [resource_name][crate::model::Subscription::resource_name].
4806    ///
4807    /// Note that all the setters affecting `resource_name` are mutually
4808    /// exclusive.
4809    ///
4810    /// # Example
4811    /// ```ignore,no_run
4812    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4813    /// use google_cloud_bigquery_analyticshub_v1::model::subscription::ResourceName;
4814    /// let x = Subscription::new().set_resource_name(Some(ResourceName::Listing("example".to_string())));
4815    /// ```
4816    pub fn set_resource_name<
4817        T: std::convert::Into<std::option::Option<crate::model::subscription::ResourceName>>,
4818    >(
4819        mut self,
4820        v: T,
4821    ) -> Self {
4822        self.resource_name = v.into();
4823        self
4824    }
4825
4826    /// The value of [resource_name][crate::model::Subscription::resource_name]
4827    /// if it holds a `Listing`, `None` if the field is not set or
4828    /// holds a different branch.
4829    pub fn listing(&self) -> std::option::Option<&std::string::String> {
4830        #[allow(unreachable_patterns)]
4831        self.resource_name.as_ref().and_then(|v| match v {
4832            crate::model::subscription::ResourceName::Listing(v) => std::option::Option::Some(v),
4833            _ => std::option::Option::None,
4834        })
4835    }
4836
4837    /// Sets the value of [resource_name][crate::model::Subscription::resource_name]
4838    /// to hold a `Listing`.
4839    ///
4840    /// Note that all the setters affecting `resource_name` are
4841    /// mutually exclusive.
4842    ///
4843    /// # Example
4844    /// ```ignore,no_run
4845    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4846    /// let x = Subscription::new().set_listing("example");
4847    /// assert!(x.listing().is_some());
4848    /// assert!(x.data_exchange().is_none());
4849    /// ```
4850    pub fn set_listing<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4851        self.resource_name =
4852            std::option::Option::Some(crate::model::subscription::ResourceName::Listing(v.into()));
4853        self
4854    }
4855
4856    /// The value of [resource_name][crate::model::Subscription::resource_name]
4857    /// if it holds a `DataExchange`, `None` if the field is not set or
4858    /// holds a different branch.
4859    pub fn data_exchange(&self) -> std::option::Option<&std::string::String> {
4860        #[allow(unreachable_patterns)]
4861        self.resource_name.as_ref().and_then(|v| match v {
4862            crate::model::subscription::ResourceName::DataExchange(v) => {
4863                std::option::Option::Some(v)
4864            }
4865            _ => std::option::Option::None,
4866        })
4867    }
4868
4869    /// Sets the value of [resource_name][crate::model::Subscription::resource_name]
4870    /// to hold a `DataExchange`.
4871    ///
4872    /// Note that all the setters affecting `resource_name` are
4873    /// mutually exclusive.
4874    ///
4875    /// # Example
4876    /// ```ignore,no_run
4877    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4878    /// let x = Subscription::new().set_data_exchange("example");
4879    /// assert!(x.data_exchange().is_some());
4880    /// assert!(x.listing().is_none());
4881    /// ```
4882    pub fn set_data_exchange<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4883        self.resource_name = std::option::Option::Some(
4884            crate::model::subscription::ResourceName::DataExchange(v.into()),
4885        );
4886        self
4887    }
4888}
4889
4890impl wkt::message::Message for Subscription {
4891    fn typename() -> &'static str {
4892        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription"
4893    }
4894}
4895
4896/// Defines additional types related to [Subscription].
4897pub mod subscription {
4898    #[allow(unused_imports)]
4899    use super::*;
4900
4901    /// Reference to a linked resource tracked by this Subscription.
4902    #[derive(Clone, Default, PartialEq)]
4903    #[non_exhaustive]
4904    pub struct LinkedResource {
4905        /// Output only. Listing for which linked resource is created.
4906        pub listing: std::string::String,
4907
4908        pub reference: std::option::Option<crate::model::subscription::linked_resource::Reference>,
4909
4910        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4911    }
4912
4913    impl LinkedResource {
4914        pub fn new() -> Self {
4915            std::default::Default::default()
4916        }
4917
4918        /// Sets the value of [listing][crate::model::subscription::LinkedResource::listing].
4919        ///
4920        /// # Example
4921        /// ```ignore,no_run
4922        /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
4923        /// let x = LinkedResource::new().set_listing("example");
4924        /// ```
4925        pub fn set_listing<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4926            self.listing = v.into();
4927            self
4928        }
4929
4930        /// Sets the value of [reference][crate::model::subscription::LinkedResource::reference].
4931        ///
4932        /// Note that all the setters affecting `reference` are mutually
4933        /// exclusive.
4934        ///
4935        /// # Example
4936        /// ```ignore,no_run
4937        /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
4938        /// use google_cloud_bigquery_analyticshub_v1::model::subscription::linked_resource::Reference;
4939        /// let x = LinkedResource::new().set_reference(Some(Reference::LinkedDataset("example".to_string())));
4940        /// ```
4941        pub fn set_reference<
4942            T: std::convert::Into<
4943                    std::option::Option<crate::model::subscription::linked_resource::Reference>,
4944                >,
4945        >(
4946            mut self,
4947            v: T,
4948        ) -> Self {
4949            self.reference = v.into();
4950            self
4951        }
4952
4953        /// The value of [reference][crate::model::subscription::LinkedResource::reference]
4954        /// if it holds a `LinkedDataset`, `None` if the field is not set or
4955        /// holds a different branch.
4956        pub fn linked_dataset(&self) -> std::option::Option<&std::string::String> {
4957            #[allow(unreachable_patterns)]
4958            self.reference.as_ref().and_then(|v| match v {
4959                crate::model::subscription::linked_resource::Reference::LinkedDataset(v) => {
4960                    std::option::Option::Some(v)
4961                }
4962                _ => std::option::Option::None,
4963            })
4964        }
4965
4966        /// Sets the value of [reference][crate::model::subscription::LinkedResource::reference]
4967        /// to hold a `LinkedDataset`.
4968        ///
4969        /// Note that all the setters affecting `reference` are
4970        /// mutually exclusive.
4971        ///
4972        /// # Example
4973        /// ```ignore,no_run
4974        /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
4975        /// let x = LinkedResource::new().set_linked_dataset("example");
4976        /// assert!(x.linked_dataset().is_some());
4977        /// assert!(x.linked_pubsub_subscription().is_none());
4978        /// ```
4979        pub fn set_linked_dataset<T: std::convert::Into<std::string::String>>(
4980            mut self,
4981            v: T,
4982        ) -> Self {
4983            self.reference = std::option::Option::Some(
4984                crate::model::subscription::linked_resource::Reference::LinkedDataset(v.into()),
4985            );
4986            self
4987        }
4988
4989        /// The value of [reference][crate::model::subscription::LinkedResource::reference]
4990        /// if it holds a `LinkedPubsubSubscription`, `None` if the field is not set or
4991        /// holds a different branch.
4992        pub fn linked_pubsub_subscription(&self) -> std::option::Option<&std::string::String> {
4993            #[allow(unreachable_patterns)]
4994            self.reference.as_ref().and_then(|v| match v {
4995                crate::model::subscription::linked_resource::Reference::LinkedPubsubSubscription(v) => std::option::Option::Some(v),
4996                _ => std::option::Option::None,
4997            })
4998        }
4999
5000        /// Sets the value of [reference][crate::model::subscription::LinkedResource::reference]
5001        /// to hold a `LinkedPubsubSubscription`.
5002        ///
5003        /// Note that all the setters affecting `reference` are
5004        /// mutually exclusive.
5005        ///
5006        /// # Example
5007        /// ```ignore,no_run
5008        /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
5009        /// let x = LinkedResource::new().set_linked_pubsub_subscription("example");
5010        /// assert!(x.linked_pubsub_subscription().is_some());
5011        /// assert!(x.linked_dataset().is_none());
5012        /// ```
5013        pub fn set_linked_pubsub_subscription<T: std::convert::Into<std::string::String>>(
5014            mut self,
5015            v: T,
5016        ) -> Self {
5017            self.reference = std::option::Option::Some(
5018                crate::model::subscription::linked_resource::Reference::LinkedPubsubSubscription(
5019                    v.into(),
5020                ),
5021            );
5022            self
5023        }
5024    }
5025
5026    impl wkt::message::Message for LinkedResource {
5027        fn typename() -> &'static str {
5028            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription.LinkedResource"
5029        }
5030    }
5031
5032    /// Defines additional types related to [LinkedResource].
5033    pub mod linked_resource {
5034        #[allow(unused_imports)]
5035        use super::*;
5036
5037        #[derive(Clone, Debug, PartialEq)]
5038        #[non_exhaustive]
5039        pub enum Reference {
5040            /// Output only. Name of the linked dataset, e.g.
5041            /// projects/subscriberproject/datasets/linked_dataset
5042            LinkedDataset(std::string::String),
5043            /// Output only. Name of the Pub/Sub subscription, e.g.
5044            /// projects/subscriberproject/subscriptions/subscriptions/sub_id
5045            LinkedPubsubSubscription(std::string::String),
5046        }
5047    }
5048
5049    /// Commercial info metadata for this subscription.
5050    #[derive(Clone, Default, PartialEq)]
5051    #[non_exhaustive]
5052    pub struct CommercialInfo {
5053        /// Output only. This is set when the subscription is commercialised via
5054        /// Cloud Marketplace.
5055        pub cloud_marketplace: std::option::Option<
5056            crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo,
5057        >,
5058
5059        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5060    }
5061
5062    impl CommercialInfo {
5063        pub fn new() -> Self {
5064            std::default::Default::default()
5065        }
5066
5067        /// Sets the value of [cloud_marketplace][crate::model::subscription::CommercialInfo::cloud_marketplace].
5068        ///
5069        /// # Example
5070        /// ```ignore,no_run
5071        /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
5072        /// use google_cloud_bigquery_analyticshub_v1::model::subscription::commercial_info::GoogleCloudMarketplaceInfo;
5073        /// let x = CommercialInfo::new().set_cloud_marketplace(GoogleCloudMarketplaceInfo::default()/* use setters */);
5074        /// ```
5075        pub fn set_cloud_marketplace<T>(mut self, v: T) -> Self
5076        where
5077            T: std::convert::Into<
5078                    crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo,
5079                >,
5080        {
5081            self.cloud_marketplace = std::option::Option::Some(v.into());
5082            self
5083        }
5084
5085        /// Sets or clears the value of [cloud_marketplace][crate::model::subscription::CommercialInfo::cloud_marketplace].
5086        ///
5087        /// # Example
5088        /// ```ignore,no_run
5089        /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
5090        /// use google_cloud_bigquery_analyticshub_v1::model::subscription::commercial_info::GoogleCloudMarketplaceInfo;
5091        /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(Some(GoogleCloudMarketplaceInfo::default()/* use setters */));
5092        /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(None::<GoogleCloudMarketplaceInfo>);
5093        /// ```
5094        pub fn set_or_clear_cloud_marketplace<T>(mut self, v: std::option::Option<T>) -> Self
5095        where
5096            T: std::convert::Into<
5097                    crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo,
5098                >,
5099        {
5100            self.cloud_marketplace = v.map(|x| x.into());
5101            self
5102        }
5103    }
5104
5105    impl wkt::message::Message for CommercialInfo {
5106        fn typename() -> &'static str {
5107            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription.CommercialInfo"
5108        }
5109    }
5110
5111    /// Defines additional types related to [CommercialInfo].
5112    pub mod commercial_info {
5113        #[allow(unused_imports)]
5114        use super::*;
5115
5116        /// Cloud Marketplace commercial metadata for this subscription.
5117        #[derive(Clone, Default, PartialEq)]
5118        #[non_exhaustive]
5119        pub struct GoogleCloudMarketplaceInfo {
5120            /// Resource name of the Marketplace Order.
5121            pub order: std::string::String,
5122
5123            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5124        }
5125
5126        impl GoogleCloudMarketplaceInfo {
5127            pub fn new() -> Self {
5128                std::default::Default::default()
5129            }
5130
5131            /// Sets the value of [order][crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo::order].
5132            ///
5133            /// # Example
5134            /// ```ignore,no_run
5135            /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::commercial_info::GoogleCloudMarketplaceInfo;
5136            /// let x = GoogleCloudMarketplaceInfo::new().set_order("example");
5137            /// ```
5138            pub fn set_order<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5139                self.order = v.into();
5140                self
5141            }
5142        }
5143
5144        impl wkt::message::Message for GoogleCloudMarketplaceInfo {
5145            fn typename() -> &'static str {
5146                "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription.CommercialInfo.GoogleCloudMarketplaceInfo"
5147            }
5148        }
5149    }
5150
5151    /// State of the subscription.
5152    ///
5153    /// # Working with unknown values
5154    ///
5155    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5156    /// additional enum variants at any time. Adding new variants is not considered
5157    /// a breaking change. Applications should write their code in anticipation of:
5158    ///
5159    /// - New values appearing in future releases of the client library, **and**
5160    /// - New values received dynamically, without application changes.
5161    ///
5162    /// Please consult the [Working with enums] section in the user guide for some
5163    /// guidelines.
5164    ///
5165    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5166    #[derive(Clone, Debug, PartialEq)]
5167    #[non_exhaustive]
5168    pub enum State {
5169        /// Default value. This value is unused.
5170        Unspecified,
5171        /// This subscription is active and the data is accessible.
5172        Active,
5173        /// The data referenced by this subscription is out of date and should be
5174        /// refreshed. This can happen when a data provider adds or removes datasets.
5175        Stale,
5176        /// This subscription has been cancelled or revoked and the data is no longer
5177        /// accessible.
5178        Inactive,
5179        /// If set, the enum was initialized with an unknown value.
5180        ///
5181        /// Applications can examine the value using [State::value] or
5182        /// [State::name].
5183        UnknownValue(state::UnknownValue),
5184    }
5185
5186    #[doc(hidden)]
5187    pub mod state {
5188        #[allow(unused_imports)]
5189        use super::*;
5190        #[derive(Clone, Debug, PartialEq)]
5191        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5192    }
5193
5194    impl State {
5195        /// Gets the enum value.
5196        ///
5197        /// Returns `None` if the enum contains an unknown value deserialized from
5198        /// the string representation of enums.
5199        pub fn value(&self) -> std::option::Option<i32> {
5200            match self {
5201                Self::Unspecified => std::option::Option::Some(0),
5202                Self::Active => std::option::Option::Some(1),
5203                Self::Stale => std::option::Option::Some(2),
5204                Self::Inactive => std::option::Option::Some(3),
5205                Self::UnknownValue(u) => u.0.value(),
5206            }
5207        }
5208
5209        /// Gets the enum value as a string.
5210        ///
5211        /// Returns `None` if the enum contains an unknown value deserialized from
5212        /// the integer representation of enums.
5213        pub fn name(&self) -> std::option::Option<&str> {
5214            match self {
5215                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5216                Self::Active => std::option::Option::Some("STATE_ACTIVE"),
5217                Self::Stale => std::option::Option::Some("STATE_STALE"),
5218                Self::Inactive => std::option::Option::Some("STATE_INACTIVE"),
5219                Self::UnknownValue(u) => u.0.name(),
5220            }
5221        }
5222    }
5223
5224    impl std::default::Default for State {
5225        fn default() -> Self {
5226            use std::convert::From;
5227            Self::from(0)
5228        }
5229    }
5230
5231    impl std::fmt::Display for State {
5232        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5233            wkt::internal::display_enum(f, self.name(), self.value())
5234        }
5235    }
5236
5237    impl std::convert::From<i32> for State {
5238        fn from(value: i32) -> Self {
5239            match value {
5240                0 => Self::Unspecified,
5241                1 => Self::Active,
5242                2 => Self::Stale,
5243                3 => Self::Inactive,
5244                _ => Self::UnknownValue(state::UnknownValue(
5245                    wkt::internal::UnknownEnumValue::Integer(value),
5246                )),
5247            }
5248        }
5249    }
5250
5251    impl std::convert::From<&str> for State {
5252        fn from(value: &str) -> Self {
5253            use std::string::ToString;
5254            match value {
5255                "STATE_UNSPECIFIED" => Self::Unspecified,
5256                "STATE_ACTIVE" => Self::Active,
5257                "STATE_STALE" => Self::Stale,
5258                "STATE_INACTIVE" => Self::Inactive,
5259                _ => Self::UnknownValue(state::UnknownValue(
5260                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5261                )),
5262            }
5263        }
5264    }
5265
5266    impl serde::ser::Serialize for State {
5267        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5268        where
5269            S: serde::Serializer,
5270        {
5271            match self {
5272                Self::Unspecified => serializer.serialize_i32(0),
5273                Self::Active => serializer.serialize_i32(1),
5274                Self::Stale => serializer.serialize_i32(2),
5275                Self::Inactive => serializer.serialize_i32(3),
5276                Self::UnknownValue(u) => u.0.serialize(serializer),
5277            }
5278        }
5279    }
5280
5281    impl<'de> serde::de::Deserialize<'de> for State {
5282        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5283        where
5284            D: serde::Deserializer<'de>,
5285        {
5286            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5287                ".google.cloud.bigquery.analyticshub.v1.Subscription.State",
5288            ))
5289        }
5290    }
5291
5292    #[derive(Clone, Debug, PartialEq)]
5293    #[non_exhaustive]
5294    pub enum ResourceName {
5295        /// Output only. Resource name of the source Listing.
5296        /// e.g. projects/123/locations/us/dataExchanges/456/listings/789
5297        Listing(std::string::String),
5298        /// Output only. Resource name of the source Data Exchange.
5299        /// e.g. projects/123/locations/us/dataExchanges/456
5300        DataExchange(std::string::String),
5301    }
5302}
5303
5304/// Message for requesting the list of data exchanges.
5305#[derive(Clone, Default, PartialEq)]
5306#[non_exhaustive]
5307pub struct ListDataExchangesRequest {
5308    /// Required. The parent resource path of the data exchanges.
5309    /// e.g. `projects/myproject/locations/us`.
5310    pub parent: std::string::String,
5311
5312    /// The maximum number of results to return in a single response page. Leverage
5313    /// the page tokens to iterate through the entire collection.
5314    pub page_size: i32,
5315
5316    /// Page token, returned by a previous call, to request the next page of
5317    /// results.
5318    pub page_token: std::string::String,
5319
5320    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5321}
5322
5323impl ListDataExchangesRequest {
5324    pub fn new() -> Self {
5325        std::default::Default::default()
5326    }
5327
5328    /// Sets the value of [parent][crate::model::ListDataExchangesRequest::parent].
5329    ///
5330    /// # Example
5331    /// ```ignore,no_run
5332    /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesRequest;
5333    /// let x = ListDataExchangesRequest::new().set_parent("example");
5334    /// ```
5335    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5336        self.parent = v.into();
5337        self
5338    }
5339
5340    /// Sets the value of [page_size][crate::model::ListDataExchangesRequest::page_size].
5341    ///
5342    /// # Example
5343    /// ```ignore,no_run
5344    /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesRequest;
5345    /// let x = ListDataExchangesRequest::new().set_page_size(42);
5346    /// ```
5347    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5348        self.page_size = v.into();
5349        self
5350    }
5351
5352    /// Sets the value of [page_token][crate::model::ListDataExchangesRequest::page_token].
5353    ///
5354    /// # Example
5355    /// ```ignore,no_run
5356    /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesRequest;
5357    /// let x = ListDataExchangesRequest::new().set_page_token("example");
5358    /// ```
5359    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5360        self.page_token = v.into();
5361        self
5362    }
5363}
5364
5365impl wkt::message::Message for ListDataExchangesRequest {
5366    fn typename() -> &'static str {
5367        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest"
5368    }
5369}
5370
5371/// Message for response to the list of data exchanges.
5372#[derive(Clone, Default, PartialEq)]
5373#[non_exhaustive]
5374pub struct ListDataExchangesResponse {
5375    /// The list of data exchanges.
5376    pub data_exchanges: std::vec::Vec<crate::model::DataExchange>,
5377
5378    /// A token to request the next page of results.
5379    pub next_page_token: std::string::String,
5380
5381    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5382}
5383
5384impl ListDataExchangesResponse {
5385    pub fn new() -> Self {
5386        std::default::Default::default()
5387    }
5388
5389    /// Sets the value of [data_exchanges][crate::model::ListDataExchangesResponse::data_exchanges].
5390    ///
5391    /// # Example
5392    /// ```ignore,no_run
5393    /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesResponse;
5394    /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5395    /// let x = ListDataExchangesResponse::new()
5396    ///     .set_data_exchanges([
5397    ///         DataExchange::default()/* use setters */,
5398    ///         DataExchange::default()/* use (different) setters */,
5399    ///     ]);
5400    /// ```
5401    pub fn set_data_exchanges<T, V>(mut self, v: T) -> Self
5402    where
5403        T: std::iter::IntoIterator<Item = V>,
5404        V: std::convert::Into<crate::model::DataExchange>,
5405    {
5406        use std::iter::Iterator;
5407        self.data_exchanges = v.into_iter().map(|i| i.into()).collect();
5408        self
5409    }
5410
5411    /// Sets the value of [next_page_token][crate::model::ListDataExchangesResponse::next_page_token].
5412    ///
5413    /// # Example
5414    /// ```ignore,no_run
5415    /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesResponse;
5416    /// let x = ListDataExchangesResponse::new().set_next_page_token("example");
5417    /// ```
5418    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5419        self.next_page_token = v.into();
5420        self
5421    }
5422}
5423
5424impl wkt::message::Message for ListDataExchangesResponse {
5425    fn typename() -> &'static str {
5426        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse"
5427    }
5428}
5429
5430#[doc(hidden)]
5431impl gax::paginator::internal::PageableResponse for ListDataExchangesResponse {
5432    type PageItem = crate::model::DataExchange;
5433
5434    fn items(self) -> std::vec::Vec<Self::PageItem> {
5435        self.data_exchanges
5436    }
5437
5438    fn next_page_token(&self) -> std::string::String {
5439        use std::clone::Clone;
5440        self.next_page_token.clone()
5441    }
5442}
5443
5444/// Message for requesting the list of data exchanges from projects in an
5445/// organization and location.
5446#[derive(Clone, Default, PartialEq)]
5447#[non_exhaustive]
5448pub struct ListOrgDataExchangesRequest {
5449    /// Required. The organization resource path of the projects containing
5450    /// DataExchanges. e.g. `organizations/myorg/locations/us`.
5451    pub organization: std::string::String,
5452
5453    /// The maximum number of results to return in a single response page. Leverage
5454    /// the page tokens to iterate through the entire collection.
5455    pub page_size: i32,
5456
5457    /// Page token, returned by a previous call, to request the next page of
5458    /// results.
5459    pub page_token: std::string::String,
5460
5461    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5462}
5463
5464impl ListOrgDataExchangesRequest {
5465    pub fn new() -> Self {
5466        std::default::Default::default()
5467    }
5468
5469    /// Sets the value of [organization][crate::model::ListOrgDataExchangesRequest::organization].
5470    ///
5471    /// # Example
5472    /// ```ignore,no_run
5473    /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesRequest;
5474    /// let x = ListOrgDataExchangesRequest::new().set_organization("example");
5475    /// ```
5476    pub fn set_organization<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5477        self.organization = v.into();
5478        self
5479    }
5480
5481    /// Sets the value of [page_size][crate::model::ListOrgDataExchangesRequest::page_size].
5482    ///
5483    /// # Example
5484    /// ```ignore,no_run
5485    /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesRequest;
5486    /// let x = ListOrgDataExchangesRequest::new().set_page_size(42);
5487    /// ```
5488    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5489        self.page_size = v.into();
5490        self
5491    }
5492
5493    /// Sets the value of [page_token][crate::model::ListOrgDataExchangesRequest::page_token].
5494    ///
5495    /// # Example
5496    /// ```ignore,no_run
5497    /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesRequest;
5498    /// let x = ListOrgDataExchangesRequest::new().set_page_token("example");
5499    /// ```
5500    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5501        self.page_token = v.into();
5502        self
5503    }
5504}
5505
5506impl wkt::message::Message for ListOrgDataExchangesRequest {
5507    fn typename() -> &'static str {
5508        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest"
5509    }
5510}
5511
5512/// Message for response to listing data exchanges in an organization and
5513/// location.
5514#[derive(Clone, Default, PartialEq)]
5515#[non_exhaustive]
5516pub struct ListOrgDataExchangesResponse {
5517    /// The list of data exchanges.
5518    pub data_exchanges: std::vec::Vec<crate::model::DataExchange>,
5519
5520    /// A token to request the next page of results.
5521    pub next_page_token: std::string::String,
5522
5523    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5524}
5525
5526impl ListOrgDataExchangesResponse {
5527    pub fn new() -> Self {
5528        std::default::Default::default()
5529    }
5530
5531    /// Sets the value of [data_exchanges][crate::model::ListOrgDataExchangesResponse::data_exchanges].
5532    ///
5533    /// # Example
5534    /// ```ignore,no_run
5535    /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesResponse;
5536    /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5537    /// let x = ListOrgDataExchangesResponse::new()
5538    ///     .set_data_exchanges([
5539    ///         DataExchange::default()/* use setters */,
5540    ///         DataExchange::default()/* use (different) setters */,
5541    ///     ]);
5542    /// ```
5543    pub fn set_data_exchanges<T, V>(mut self, v: T) -> Self
5544    where
5545        T: std::iter::IntoIterator<Item = V>,
5546        V: std::convert::Into<crate::model::DataExchange>,
5547    {
5548        use std::iter::Iterator;
5549        self.data_exchanges = v.into_iter().map(|i| i.into()).collect();
5550        self
5551    }
5552
5553    /// Sets the value of [next_page_token][crate::model::ListOrgDataExchangesResponse::next_page_token].
5554    ///
5555    /// # Example
5556    /// ```ignore,no_run
5557    /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesResponse;
5558    /// let x = ListOrgDataExchangesResponse::new().set_next_page_token("example");
5559    /// ```
5560    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5561        self.next_page_token = v.into();
5562        self
5563    }
5564}
5565
5566impl wkt::message::Message for ListOrgDataExchangesResponse {
5567    fn typename() -> &'static str {
5568        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse"
5569    }
5570}
5571
5572#[doc(hidden)]
5573impl gax::paginator::internal::PageableResponse for ListOrgDataExchangesResponse {
5574    type PageItem = crate::model::DataExchange;
5575
5576    fn items(self) -> std::vec::Vec<Self::PageItem> {
5577        self.data_exchanges
5578    }
5579
5580    fn next_page_token(&self) -> std::string::String {
5581        use std::clone::Clone;
5582        self.next_page_token.clone()
5583    }
5584}
5585
5586/// Message for getting a data exchange.
5587#[derive(Clone, Default, PartialEq)]
5588#[non_exhaustive]
5589pub struct GetDataExchangeRequest {
5590    /// Required. The resource name of the data exchange.
5591    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
5592    pub name: std::string::String,
5593
5594    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5595}
5596
5597impl GetDataExchangeRequest {
5598    pub fn new() -> Self {
5599        std::default::Default::default()
5600    }
5601
5602    /// Sets the value of [name][crate::model::GetDataExchangeRequest::name].
5603    ///
5604    /// # Example
5605    /// ```ignore,no_run
5606    /// # use google_cloud_bigquery_analyticshub_v1::model::GetDataExchangeRequest;
5607    /// let x = GetDataExchangeRequest::new().set_name("example");
5608    /// ```
5609    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5610        self.name = v.into();
5611        self
5612    }
5613}
5614
5615impl wkt::message::Message for GetDataExchangeRequest {
5616    fn typename() -> &'static str {
5617        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest"
5618    }
5619}
5620
5621/// Message for creating a data exchange.
5622#[derive(Clone, Default, PartialEq)]
5623#[non_exhaustive]
5624pub struct CreateDataExchangeRequest {
5625    /// Required. The parent resource path of the data exchange.
5626    /// e.g. `projects/myproject/locations/us`.
5627    pub parent: std::string::String,
5628
5629    /// Required. The ID of the data exchange.
5630    /// Must contain only Unicode letters, numbers (0-9), underscores (_).
5631    /// Max length: 100 bytes.
5632    pub data_exchange_id: std::string::String,
5633
5634    /// Required. The data exchange to create.
5635    pub data_exchange: std::option::Option<crate::model::DataExchange>,
5636
5637    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5638}
5639
5640impl CreateDataExchangeRequest {
5641    pub fn new() -> Self {
5642        std::default::Default::default()
5643    }
5644
5645    /// Sets the value of [parent][crate::model::CreateDataExchangeRequest::parent].
5646    ///
5647    /// # Example
5648    /// ```ignore,no_run
5649    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5650    /// let x = CreateDataExchangeRequest::new().set_parent("example");
5651    /// ```
5652    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5653        self.parent = v.into();
5654        self
5655    }
5656
5657    /// Sets the value of [data_exchange_id][crate::model::CreateDataExchangeRequest::data_exchange_id].
5658    ///
5659    /// # Example
5660    /// ```ignore,no_run
5661    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5662    /// let x = CreateDataExchangeRequest::new().set_data_exchange_id("example");
5663    /// ```
5664    pub fn set_data_exchange_id<T: std::convert::Into<std::string::String>>(
5665        mut self,
5666        v: T,
5667    ) -> Self {
5668        self.data_exchange_id = v.into();
5669        self
5670    }
5671
5672    /// Sets the value of [data_exchange][crate::model::CreateDataExchangeRequest::data_exchange].
5673    ///
5674    /// # Example
5675    /// ```ignore,no_run
5676    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5677    /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5678    /// let x = CreateDataExchangeRequest::new().set_data_exchange(DataExchange::default()/* use setters */);
5679    /// ```
5680    pub fn set_data_exchange<T>(mut self, v: T) -> Self
5681    where
5682        T: std::convert::Into<crate::model::DataExchange>,
5683    {
5684        self.data_exchange = std::option::Option::Some(v.into());
5685        self
5686    }
5687
5688    /// Sets or clears the value of [data_exchange][crate::model::CreateDataExchangeRequest::data_exchange].
5689    ///
5690    /// # Example
5691    /// ```ignore,no_run
5692    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5693    /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5694    /// let x = CreateDataExchangeRequest::new().set_or_clear_data_exchange(Some(DataExchange::default()/* use setters */));
5695    /// let x = CreateDataExchangeRequest::new().set_or_clear_data_exchange(None::<DataExchange>);
5696    /// ```
5697    pub fn set_or_clear_data_exchange<T>(mut self, v: std::option::Option<T>) -> Self
5698    where
5699        T: std::convert::Into<crate::model::DataExchange>,
5700    {
5701        self.data_exchange = v.map(|x| x.into());
5702        self
5703    }
5704}
5705
5706impl wkt::message::Message for CreateDataExchangeRequest {
5707    fn typename() -> &'static str {
5708        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest"
5709    }
5710}
5711
5712/// Message for updating a data exchange.
5713#[derive(Clone, Default, PartialEq)]
5714#[non_exhaustive]
5715pub struct UpdateDataExchangeRequest {
5716    /// Required. Field mask specifies the fields to update in the data exchange
5717    /// resource. The fields specified in the
5718    /// `updateMask` are relative to the resource and are not a full request.
5719    pub update_mask: std::option::Option<wkt::FieldMask>,
5720
5721    /// Required. The data exchange to update.
5722    pub data_exchange: std::option::Option<crate::model::DataExchange>,
5723
5724    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5725}
5726
5727impl UpdateDataExchangeRequest {
5728    pub fn new() -> Self {
5729        std::default::Default::default()
5730    }
5731
5732    /// Sets the value of [update_mask][crate::model::UpdateDataExchangeRequest::update_mask].
5733    ///
5734    /// # Example
5735    /// ```ignore,no_run
5736    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5737    /// use wkt::FieldMask;
5738    /// let x = UpdateDataExchangeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5739    /// ```
5740    pub fn set_update_mask<T>(mut self, v: T) -> Self
5741    where
5742        T: std::convert::Into<wkt::FieldMask>,
5743    {
5744        self.update_mask = std::option::Option::Some(v.into());
5745        self
5746    }
5747
5748    /// Sets or clears the value of [update_mask][crate::model::UpdateDataExchangeRequest::update_mask].
5749    ///
5750    /// # Example
5751    /// ```ignore,no_run
5752    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5753    /// use wkt::FieldMask;
5754    /// let x = UpdateDataExchangeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5755    /// let x = UpdateDataExchangeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5756    /// ```
5757    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5758    where
5759        T: std::convert::Into<wkt::FieldMask>,
5760    {
5761        self.update_mask = v.map(|x| x.into());
5762        self
5763    }
5764
5765    /// Sets the value of [data_exchange][crate::model::UpdateDataExchangeRequest::data_exchange].
5766    ///
5767    /// # Example
5768    /// ```ignore,no_run
5769    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5770    /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5771    /// let x = UpdateDataExchangeRequest::new().set_data_exchange(DataExchange::default()/* use setters */);
5772    /// ```
5773    pub fn set_data_exchange<T>(mut self, v: T) -> Self
5774    where
5775        T: std::convert::Into<crate::model::DataExchange>,
5776    {
5777        self.data_exchange = std::option::Option::Some(v.into());
5778        self
5779    }
5780
5781    /// Sets or clears the value of [data_exchange][crate::model::UpdateDataExchangeRequest::data_exchange].
5782    ///
5783    /// # Example
5784    /// ```ignore,no_run
5785    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5786    /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5787    /// let x = UpdateDataExchangeRequest::new().set_or_clear_data_exchange(Some(DataExchange::default()/* use setters */));
5788    /// let x = UpdateDataExchangeRequest::new().set_or_clear_data_exchange(None::<DataExchange>);
5789    /// ```
5790    pub fn set_or_clear_data_exchange<T>(mut self, v: std::option::Option<T>) -> Self
5791    where
5792        T: std::convert::Into<crate::model::DataExchange>,
5793    {
5794        self.data_exchange = v.map(|x| x.into());
5795        self
5796    }
5797}
5798
5799impl wkt::message::Message for UpdateDataExchangeRequest {
5800    fn typename() -> &'static str {
5801        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest"
5802    }
5803}
5804
5805/// Message for deleting a data exchange.
5806#[derive(Clone, Default, PartialEq)]
5807#[non_exhaustive]
5808pub struct DeleteDataExchangeRequest {
5809    /// Required. The full name of the data exchange resource that you want to
5810    /// delete. For example, `projects/myproject/locations/us/dataExchanges/123`.
5811    pub name: std::string::String,
5812
5813    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5814}
5815
5816impl DeleteDataExchangeRequest {
5817    pub fn new() -> Self {
5818        std::default::Default::default()
5819    }
5820
5821    /// Sets the value of [name][crate::model::DeleteDataExchangeRequest::name].
5822    ///
5823    /// # Example
5824    /// ```ignore,no_run
5825    /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteDataExchangeRequest;
5826    /// let x = DeleteDataExchangeRequest::new().set_name("example");
5827    /// ```
5828    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5829        self.name = v.into();
5830        self
5831    }
5832}
5833
5834impl wkt::message::Message for DeleteDataExchangeRequest {
5835    fn typename() -> &'static str {
5836        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest"
5837    }
5838}
5839
5840/// Message for requesting the list of listings.
5841#[derive(Clone, Default, PartialEq)]
5842#[non_exhaustive]
5843pub struct ListListingsRequest {
5844    /// Required. The parent resource path of the listing.
5845    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
5846    pub parent: std::string::String,
5847
5848    /// The maximum number of results to return in a single response page. Leverage
5849    /// the page tokens to iterate through the entire collection.
5850    pub page_size: i32,
5851
5852    /// Page token, returned by a previous call, to request the next page of
5853    /// results.
5854    pub page_token: std::string::String,
5855
5856    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5857}
5858
5859impl ListListingsRequest {
5860    pub fn new() -> Self {
5861        std::default::Default::default()
5862    }
5863
5864    /// Sets the value of [parent][crate::model::ListListingsRequest::parent].
5865    ///
5866    /// # Example
5867    /// ```ignore,no_run
5868    /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsRequest;
5869    /// let x = ListListingsRequest::new().set_parent("example");
5870    /// ```
5871    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5872        self.parent = v.into();
5873        self
5874    }
5875
5876    /// Sets the value of [page_size][crate::model::ListListingsRequest::page_size].
5877    ///
5878    /// # Example
5879    /// ```ignore,no_run
5880    /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsRequest;
5881    /// let x = ListListingsRequest::new().set_page_size(42);
5882    /// ```
5883    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5884        self.page_size = v.into();
5885        self
5886    }
5887
5888    /// Sets the value of [page_token][crate::model::ListListingsRequest::page_token].
5889    ///
5890    /// # Example
5891    /// ```ignore,no_run
5892    /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsRequest;
5893    /// let x = ListListingsRequest::new().set_page_token("example");
5894    /// ```
5895    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5896        self.page_token = v.into();
5897        self
5898    }
5899}
5900
5901impl wkt::message::Message for ListListingsRequest {
5902    fn typename() -> &'static str {
5903        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListListingsRequest"
5904    }
5905}
5906
5907/// Message for response to the list of Listings.
5908#[derive(Clone, Default, PartialEq)]
5909#[non_exhaustive]
5910pub struct ListListingsResponse {
5911    /// The list of Listing.
5912    pub listings: std::vec::Vec<crate::model::Listing>,
5913
5914    /// A token to request the next page of results.
5915    pub next_page_token: std::string::String,
5916
5917    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5918}
5919
5920impl ListListingsResponse {
5921    pub fn new() -> Self {
5922        std::default::Default::default()
5923    }
5924
5925    /// Sets the value of [listings][crate::model::ListListingsResponse::listings].
5926    ///
5927    /// # Example
5928    /// ```ignore,no_run
5929    /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsResponse;
5930    /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
5931    /// let x = ListListingsResponse::new()
5932    ///     .set_listings([
5933    ///         Listing::default()/* use setters */,
5934    ///         Listing::default()/* use (different) setters */,
5935    ///     ]);
5936    /// ```
5937    pub fn set_listings<T, V>(mut self, v: T) -> Self
5938    where
5939        T: std::iter::IntoIterator<Item = V>,
5940        V: std::convert::Into<crate::model::Listing>,
5941    {
5942        use std::iter::Iterator;
5943        self.listings = v.into_iter().map(|i| i.into()).collect();
5944        self
5945    }
5946
5947    /// Sets the value of [next_page_token][crate::model::ListListingsResponse::next_page_token].
5948    ///
5949    /// # Example
5950    /// ```ignore,no_run
5951    /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsResponse;
5952    /// let x = ListListingsResponse::new().set_next_page_token("example");
5953    /// ```
5954    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5955        self.next_page_token = v.into();
5956        self
5957    }
5958}
5959
5960impl wkt::message::Message for ListListingsResponse {
5961    fn typename() -> &'static str {
5962        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListListingsResponse"
5963    }
5964}
5965
5966#[doc(hidden)]
5967impl gax::paginator::internal::PageableResponse for ListListingsResponse {
5968    type PageItem = crate::model::Listing;
5969
5970    fn items(self) -> std::vec::Vec<Self::PageItem> {
5971        self.listings
5972    }
5973
5974    fn next_page_token(&self) -> std::string::String {
5975        use std::clone::Clone;
5976        self.next_page_token.clone()
5977    }
5978}
5979
5980/// Message for getting a listing.
5981#[derive(Clone, Default, PartialEq)]
5982#[non_exhaustive]
5983pub struct GetListingRequest {
5984    /// Required. The resource name of the listing.
5985    /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`.
5986    pub name: std::string::String,
5987
5988    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5989}
5990
5991impl GetListingRequest {
5992    pub fn new() -> Self {
5993        std::default::Default::default()
5994    }
5995
5996    /// Sets the value of [name][crate::model::GetListingRequest::name].
5997    ///
5998    /// # Example
5999    /// ```ignore,no_run
6000    /// # use google_cloud_bigquery_analyticshub_v1::model::GetListingRequest;
6001    /// let x = GetListingRequest::new().set_name("example");
6002    /// ```
6003    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6004        self.name = v.into();
6005        self
6006    }
6007}
6008
6009impl wkt::message::Message for GetListingRequest {
6010    fn typename() -> &'static str {
6011        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetListingRequest"
6012    }
6013}
6014
6015/// Message for creating a listing.
6016#[derive(Clone, Default, PartialEq)]
6017#[non_exhaustive]
6018pub struct CreateListingRequest {
6019    /// Required. The parent resource path of the listing.
6020    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
6021    pub parent: std::string::String,
6022
6023    /// Required. The ID of the listing to create.
6024    /// Must contain only Unicode letters, numbers (0-9), underscores (_).
6025    /// Max length: 100 bytes.
6026    pub listing_id: std::string::String,
6027
6028    /// Required. The listing to create.
6029    pub listing: std::option::Option<crate::model::Listing>,
6030
6031    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6032}
6033
6034impl CreateListingRequest {
6035    pub fn new() -> Self {
6036        std::default::Default::default()
6037    }
6038
6039    /// Sets the value of [parent][crate::model::CreateListingRequest::parent].
6040    ///
6041    /// # Example
6042    /// ```ignore,no_run
6043    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6044    /// let x = CreateListingRequest::new().set_parent("example");
6045    /// ```
6046    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6047        self.parent = v.into();
6048        self
6049    }
6050
6051    /// Sets the value of [listing_id][crate::model::CreateListingRequest::listing_id].
6052    ///
6053    /// # Example
6054    /// ```ignore,no_run
6055    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6056    /// let x = CreateListingRequest::new().set_listing_id("example");
6057    /// ```
6058    pub fn set_listing_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6059        self.listing_id = v.into();
6060        self
6061    }
6062
6063    /// Sets the value of [listing][crate::model::CreateListingRequest::listing].
6064    ///
6065    /// # Example
6066    /// ```ignore,no_run
6067    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6068    /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6069    /// let x = CreateListingRequest::new().set_listing(Listing::default()/* use setters */);
6070    /// ```
6071    pub fn set_listing<T>(mut self, v: T) -> Self
6072    where
6073        T: std::convert::Into<crate::model::Listing>,
6074    {
6075        self.listing = std::option::Option::Some(v.into());
6076        self
6077    }
6078
6079    /// Sets or clears the value of [listing][crate::model::CreateListingRequest::listing].
6080    ///
6081    /// # Example
6082    /// ```ignore,no_run
6083    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6084    /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6085    /// let x = CreateListingRequest::new().set_or_clear_listing(Some(Listing::default()/* use setters */));
6086    /// let x = CreateListingRequest::new().set_or_clear_listing(None::<Listing>);
6087    /// ```
6088    pub fn set_or_clear_listing<T>(mut self, v: std::option::Option<T>) -> Self
6089    where
6090        T: std::convert::Into<crate::model::Listing>,
6091    {
6092        self.listing = v.map(|x| x.into());
6093        self
6094    }
6095}
6096
6097impl wkt::message::Message for CreateListingRequest {
6098    fn typename() -> &'static str {
6099        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CreateListingRequest"
6100    }
6101}
6102
6103/// Message for updating a Listing.
6104#[derive(Clone, Default, PartialEq)]
6105#[non_exhaustive]
6106pub struct UpdateListingRequest {
6107    /// Required. Field mask specifies the fields to update in the listing
6108    /// resource. The fields specified in the `updateMask` are relative to the
6109    /// resource and are not a full request.
6110    pub update_mask: std::option::Option<wkt::FieldMask>,
6111
6112    /// Required. The listing to update.
6113    pub listing: std::option::Option<crate::model::Listing>,
6114
6115    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6116}
6117
6118impl UpdateListingRequest {
6119    pub fn new() -> Self {
6120        std::default::Default::default()
6121    }
6122
6123    /// Sets the value of [update_mask][crate::model::UpdateListingRequest::update_mask].
6124    ///
6125    /// # Example
6126    /// ```ignore,no_run
6127    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6128    /// use wkt::FieldMask;
6129    /// let x = UpdateListingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6130    /// ```
6131    pub fn set_update_mask<T>(mut self, v: T) -> Self
6132    where
6133        T: std::convert::Into<wkt::FieldMask>,
6134    {
6135        self.update_mask = std::option::Option::Some(v.into());
6136        self
6137    }
6138
6139    /// Sets or clears the value of [update_mask][crate::model::UpdateListingRequest::update_mask].
6140    ///
6141    /// # Example
6142    /// ```ignore,no_run
6143    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6144    /// use wkt::FieldMask;
6145    /// let x = UpdateListingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6146    /// let x = UpdateListingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6147    /// ```
6148    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6149    where
6150        T: std::convert::Into<wkt::FieldMask>,
6151    {
6152        self.update_mask = v.map(|x| x.into());
6153        self
6154    }
6155
6156    /// Sets the value of [listing][crate::model::UpdateListingRequest::listing].
6157    ///
6158    /// # Example
6159    /// ```ignore,no_run
6160    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6161    /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6162    /// let x = UpdateListingRequest::new().set_listing(Listing::default()/* use setters */);
6163    /// ```
6164    pub fn set_listing<T>(mut self, v: T) -> Self
6165    where
6166        T: std::convert::Into<crate::model::Listing>,
6167    {
6168        self.listing = std::option::Option::Some(v.into());
6169        self
6170    }
6171
6172    /// Sets or clears the value of [listing][crate::model::UpdateListingRequest::listing].
6173    ///
6174    /// # Example
6175    /// ```ignore,no_run
6176    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6177    /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6178    /// let x = UpdateListingRequest::new().set_or_clear_listing(Some(Listing::default()/* use setters */));
6179    /// let x = UpdateListingRequest::new().set_or_clear_listing(None::<Listing>);
6180    /// ```
6181    pub fn set_or_clear_listing<T>(mut self, v: std::option::Option<T>) -> Self
6182    where
6183        T: std::convert::Into<crate::model::Listing>,
6184    {
6185        self.listing = v.map(|x| x.into());
6186        self
6187    }
6188}
6189
6190impl wkt::message::Message for UpdateListingRequest {
6191    fn typename() -> &'static str {
6192        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.UpdateListingRequest"
6193    }
6194}
6195
6196/// Message for deleting a listing.
6197#[derive(Clone, Default, PartialEq)]
6198#[non_exhaustive]
6199pub struct DeleteListingRequest {
6200    /// Required. Resource name of the listing to delete.
6201    /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`.
6202    pub name: std::string::String,
6203
6204    /// Optional. If the listing is commercial then this field must be set to true,
6205    /// otherwise a failure is thrown. This acts as a safety guard to avoid
6206    /// deleting commercial listings accidentally.
6207    pub delete_commercial: bool,
6208
6209    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6210}
6211
6212impl DeleteListingRequest {
6213    pub fn new() -> Self {
6214        std::default::Default::default()
6215    }
6216
6217    /// Sets the value of [name][crate::model::DeleteListingRequest::name].
6218    ///
6219    /// # Example
6220    /// ```ignore,no_run
6221    /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteListingRequest;
6222    /// let x = DeleteListingRequest::new().set_name("example");
6223    /// ```
6224    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6225        self.name = v.into();
6226        self
6227    }
6228
6229    /// Sets the value of [delete_commercial][crate::model::DeleteListingRequest::delete_commercial].
6230    ///
6231    /// # Example
6232    /// ```ignore,no_run
6233    /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteListingRequest;
6234    /// let x = DeleteListingRequest::new().set_delete_commercial(true);
6235    /// ```
6236    pub fn set_delete_commercial<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6237        self.delete_commercial = v.into();
6238        self
6239    }
6240}
6241
6242impl wkt::message::Message for DeleteListingRequest {
6243    fn typename() -> &'static str {
6244        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteListingRequest"
6245    }
6246}
6247
6248/// Message for subscribing to a listing.
6249#[derive(Clone, Default, PartialEq)]
6250#[non_exhaustive]
6251pub struct SubscribeListingRequest {
6252    /// Required. Resource name of the listing that you want to subscribe to.
6253    /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`.
6254    pub name: std::string::String,
6255
6256    /// Resulting destination of the listing that you subscribed to.
6257    pub destination: std::option::Option<crate::model::subscribe_listing_request::Destination>,
6258
6259    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6260}
6261
6262impl SubscribeListingRequest {
6263    pub fn new() -> Self {
6264        std::default::Default::default()
6265    }
6266
6267    /// Sets the value of [name][crate::model::SubscribeListingRequest::name].
6268    ///
6269    /// # Example
6270    /// ```ignore,no_run
6271    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6272    /// let x = SubscribeListingRequest::new().set_name("example");
6273    /// ```
6274    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6275        self.name = v.into();
6276        self
6277    }
6278
6279    /// Sets the value of [destination][crate::model::SubscribeListingRequest::destination].
6280    ///
6281    /// Note that all the setters affecting `destination` are mutually
6282    /// exclusive.
6283    ///
6284    /// # Example
6285    /// ```ignore,no_run
6286    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6287    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6288    /// let x = SubscribeListingRequest::new().set_destination(Some(
6289    ///     google_cloud_bigquery_analyticshub_v1::model::subscribe_listing_request::Destination::DestinationDataset(DestinationDataset::default().into())));
6290    /// ```
6291    pub fn set_destination<
6292        T: std::convert::Into<
6293                std::option::Option<crate::model::subscribe_listing_request::Destination>,
6294            >,
6295    >(
6296        mut self,
6297        v: T,
6298    ) -> Self {
6299        self.destination = v.into();
6300        self
6301    }
6302
6303    /// The value of [destination][crate::model::SubscribeListingRequest::destination]
6304    /// if it holds a `DestinationDataset`, `None` if the field is not set or
6305    /// holds a different branch.
6306    pub fn destination_dataset(
6307        &self,
6308    ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationDataset>> {
6309        #[allow(unreachable_patterns)]
6310        self.destination.as_ref().and_then(|v| match v {
6311            crate::model::subscribe_listing_request::Destination::DestinationDataset(v) => {
6312                std::option::Option::Some(v)
6313            }
6314            _ => std::option::Option::None,
6315        })
6316    }
6317
6318    /// Sets the value of [destination][crate::model::SubscribeListingRequest::destination]
6319    /// to hold a `DestinationDataset`.
6320    ///
6321    /// Note that all the setters affecting `destination` are
6322    /// mutually exclusive.
6323    ///
6324    /// # Example
6325    /// ```ignore,no_run
6326    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6327    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6328    /// let x = SubscribeListingRequest::new().set_destination_dataset(DestinationDataset::default()/* use setters */);
6329    /// assert!(x.destination_dataset().is_some());
6330    /// assert!(x.destination_pubsub_subscription().is_none());
6331    /// ```
6332    pub fn set_destination_dataset<
6333        T: std::convert::Into<std::boxed::Box<crate::model::DestinationDataset>>,
6334    >(
6335        mut self,
6336        v: T,
6337    ) -> Self {
6338        self.destination = std::option::Option::Some(
6339            crate::model::subscribe_listing_request::Destination::DestinationDataset(v.into()),
6340        );
6341        self
6342    }
6343
6344    /// The value of [destination][crate::model::SubscribeListingRequest::destination]
6345    /// if it holds a `DestinationPubsubSubscription`, `None` if the field is not set or
6346    /// holds a different branch.
6347    pub fn destination_pubsub_subscription(
6348        &self,
6349    ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationPubSubSubscription>> {
6350        #[allow(unreachable_patterns)]
6351        self.destination.as_ref().and_then(|v| match v {
6352            crate::model::subscribe_listing_request::Destination::DestinationPubsubSubscription(
6353                v,
6354            ) => std::option::Option::Some(v),
6355            _ => std::option::Option::None,
6356        })
6357    }
6358
6359    /// Sets the value of [destination][crate::model::SubscribeListingRequest::destination]
6360    /// to hold a `DestinationPubsubSubscription`.
6361    ///
6362    /// Note that all the setters affecting `destination` are
6363    /// mutually exclusive.
6364    ///
6365    /// # Example
6366    /// ```ignore,no_run
6367    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6368    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationPubSubSubscription;
6369    /// let x = SubscribeListingRequest::new().set_destination_pubsub_subscription(DestinationPubSubSubscription::default()/* use setters */);
6370    /// assert!(x.destination_pubsub_subscription().is_some());
6371    /// assert!(x.destination_dataset().is_none());
6372    /// ```
6373    pub fn set_destination_pubsub_subscription<
6374        T: std::convert::Into<std::boxed::Box<crate::model::DestinationPubSubSubscription>>,
6375    >(
6376        mut self,
6377        v: T,
6378    ) -> Self {
6379        self.destination = std::option::Option::Some(
6380            crate::model::subscribe_listing_request::Destination::DestinationPubsubSubscription(
6381                v.into(),
6382            ),
6383        );
6384        self
6385    }
6386}
6387
6388impl wkt::message::Message for SubscribeListingRequest {
6389    fn typename() -> &'static str {
6390        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest"
6391    }
6392}
6393
6394/// Defines additional types related to [SubscribeListingRequest].
6395pub mod subscribe_listing_request {
6396    #[allow(unused_imports)]
6397    use super::*;
6398
6399    /// Resulting destination of the listing that you subscribed to.
6400    #[derive(Clone, Debug, PartialEq)]
6401    #[non_exhaustive]
6402    pub enum Destination {
6403        /// Input only. BigQuery destination dataset to create for the subscriber.
6404        DestinationDataset(std::boxed::Box<crate::model::DestinationDataset>),
6405        /// Input only. Destination Pub/Sub subscription to create for the
6406        /// subscriber.
6407        DestinationPubsubSubscription(std::boxed::Box<crate::model::DestinationPubSubSubscription>),
6408    }
6409}
6410
6411/// Message for response when you subscribe to a listing.
6412#[derive(Clone, Default, PartialEq)]
6413#[non_exhaustive]
6414pub struct SubscribeListingResponse {
6415    /// Subscription object created from this subscribe action.
6416    pub subscription: std::option::Option<crate::model::Subscription>,
6417
6418    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6419}
6420
6421impl SubscribeListingResponse {
6422    pub fn new() -> Self {
6423        std::default::Default::default()
6424    }
6425
6426    /// Sets the value of [subscription][crate::model::SubscribeListingResponse::subscription].
6427    ///
6428    /// # Example
6429    /// ```ignore,no_run
6430    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingResponse;
6431    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6432    /// let x = SubscribeListingResponse::new().set_subscription(Subscription::default()/* use setters */);
6433    /// ```
6434    pub fn set_subscription<T>(mut self, v: T) -> Self
6435    where
6436        T: std::convert::Into<crate::model::Subscription>,
6437    {
6438        self.subscription = std::option::Option::Some(v.into());
6439        self
6440    }
6441
6442    /// Sets or clears the value of [subscription][crate::model::SubscribeListingResponse::subscription].
6443    ///
6444    /// # Example
6445    /// ```ignore,no_run
6446    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingResponse;
6447    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6448    /// let x = SubscribeListingResponse::new().set_or_clear_subscription(Some(Subscription::default()/* use setters */));
6449    /// let x = SubscribeListingResponse::new().set_or_clear_subscription(None::<Subscription>);
6450    /// ```
6451    pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
6452    where
6453        T: std::convert::Into<crate::model::Subscription>,
6454    {
6455        self.subscription = v.map(|x| x.into());
6456        self
6457    }
6458}
6459
6460impl wkt::message::Message for SubscribeListingResponse {
6461    fn typename() -> &'static str {
6462        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse"
6463    }
6464}
6465
6466/// Message for subscribing to a Data Exchange.
6467#[derive(Clone, Default, PartialEq)]
6468#[non_exhaustive]
6469pub struct SubscribeDataExchangeRequest {
6470    /// Required. Resource name of the Data Exchange.
6471    /// e.g. `projects/publisherproject/locations/us/dataExchanges/123`
6472    pub name: std::string::String,
6473
6474    /// Required. The parent resource path of the Subscription.
6475    /// e.g. `projects/subscriberproject/locations/us`
6476    pub destination: std::string::String,
6477
6478    /// Optional. BigQuery destination dataset to create for the subscriber.
6479    pub destination_dataset: std::option::Option<crate::model::DestinationDataset>,
6480
6481    /// Required. Name of the subscription to create.
6482    /// e.g. `subscription1`
6483    pub subscription: std::string::String,
6484
6485    /// Email of the subscriber.
6486    pub subscriber_contact: std::string::String,
6487
6488    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6489}
6490
6491impl SubscribeDataExchangeRequest {
6492    pub fn new() -> Self {
6493        std::default::Default::default()
6494    }
6495
6496    /// Sets the value of [name][crate::model::SubscribeDataExchangeRequest::name].
6497    ///
6498    /// # Example
6499    /// ```ignore,no_run
6500    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6501    /// let x = SubscribeDataExchangeRequest::new().set_name("example");
6502    /// ```
6503    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6504        self.name = v.into();
6505        self
6506    }
6507
6508    /// Sets the value of [destination][crate::model::SubscribeDataExchangeRequest::destination].
6509    ///
6510    /// # Example
6511    /// ```ignore,no_run
6512    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6513    /// let x = SubscribeDataExchangeRequest::new().set_destination("example");
6514    /// ```
6515    pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6516        self.destination = v.into();
6517        self
6518    }
6519
6520    /// Sets the value of [destination_dataset][crate::model::SubscribeDataExchangeRequest::destination_dataset].
6521    ///
6522    /// # Example
6523    /// ```ignore,no_run
6524    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6525    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6526    /// let x = SubscribeDataExchangeRequest::new().set_destination_dataset(DestinationDataset::default()/* use setters */);
6527    /// ```
6528    pub fn set_destination_dataset<T>(mut self, v: T) -> Self
6529    where
6530        T: std::convert::Into<crate::model::DestinationDataset>,
6531    {
6532        self.destination_dataset = std::option::Option::Some(v.into());
6533        self
6534    }
6535
6536    /// Sets or clears the value of [destination_dataset][crate::model::SubscribeDataExchangeRequest::destination_dataset].
6537    ///
6538    /// # Example
6539    /// ```ignore,no_run
6540    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6541    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6542    /// let x = SubscribeDataExchangeRequest::new().set_or_clear_destination_dataset(Some(DestinationDataset::default()/* use setters */));
6543    /// let x = SubscribeDataExchangeRequest::new().set_or_clear_destination_dataset(None::<DestinationDataset>);
6544    /// ```
6545    pub fn set_or_clear_destination_dataset<T>(mut self, v: std::option::Option<T>) -> Self
6546    where
6547        T: std::convert::Into<crate::model::DestinationDataset>,
6548    {
6549        self.destination_dataset = v.map(|x| x.into());
6550        self
6551    }
6552
6553    /// Sets the value of [subscription][crate::model::SubscribeDataExchangeRequest::subscription].
6554    ///
6555    /// # Example
6556    /// ```ignore,no_run
6557    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6558    /// let x = SubscribeDataExchangeRequest::new().set_subscription("example");
6559    /// ```
6560    pub fn set_subscription<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6561        self.subscription = v.into();
6562        self
6563    }
6564
6565    /// Sets the value of [subscriber_contact][crate::model::SubscribeDataExchangeRequest::subscriber_contact].
6566    ///
6567    /// # Example
6568    /// ```ignore,no_run
6569    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6570    /// let x = SubscribeDataExchangeRequest::new().set_subscriber_contact("example");
6571    /// ```
6572    pub fn set_subscriber_contact<T: std::convert::Into<std::string::String>>(
6573        mut self,
6574        v: T,
6575    ) -> Self {
6576        self.subscriber_contact = v.into();
6577        self
6578    }
6579}
6580
6581impl wkt::message::Message for SubscribeDataExchangeRequest {
6582    fn typename() -> &'static str {
6583        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeDataExchangeRequest"
6584    }
6585}
6586
6587/// Message for response when you subscribe to a Data Exchange.
6588#[derive(Clone, Default, PartialEq)]
6589#[non_exhaustive]
6590pub struct SubscribeDataExchangeResponse {
6591    /// Subscription object created from this subscribe action.
6592    pub subscription: std::option::Option<crate::model::Subscription>,
6593
6594    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6595}
6596
6597impl SubscribeDataExchangeResponse {
6598    pub fn new() -> Self {
6599        std::default::Default::default()
6600    }
6601
6602    /// Sets the value of [subscription][crate::model::SubscribeDataExchangeResponse::subscription].
6603    ///
6604    /// # Example
6605    /// ```ignore,no_run
6606    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeResponse;
6607    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6608    /// let x = SubscribeDataExchangeResponse::new().set_subscription(Subscription::default()/* use setters */);
6609    /// ```
6610    pub fn set_subscription<T>(mut self, v: T) -> Self
6611    where
6612        T: std::convert::Into<crate::model::Subscription>,
6613    {
6614        self.subscription = std::option::Option::Some(v.into());
6615        self
6616    }
6617
6618    /// Sets or clears the value of [subscription][crate::model::SubscribeDataExchangeResponse::subscription].
6619    ///
6620    /// # Example
6621    /// ```ignore,no_run
6622    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeResponse;
6623    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6624    /// let x = SubscribeDataExchangeResponse::new().set_or_clear_subscription(Some(Subscription::default()/* use setters */));
6625    /// let x = SubscribeDataExchangeResponse::new().set_or_clear_subscription(None::<Subscription>);
6626    /// ```
6627    pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
6628    where
6629        T: std::convert::Into<crate::model::Subscription>,
6630    {
6631        self.subscription = v.map(|x| x.into());
6632        self
6633    }
6634}
6635
6636impl wkt::message::Message for SubscribeDataExchangeResponse {
6637    fn typename() -> &'static str {
6638        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeDataExchangeResponse"
6639    }
6640}
6641
6642/// Message for refreshing a subscription.
6643#[derive(Clone, Default, PartialEq)]
6644#[non_exhaustive]
6645pub struct RefreshSubscriptionRequest {
6646    /// Required. Resource name of the Subscription to refresh.
6647    /// e.g. `projects/subscriberproject/locations/us/subscriptions/123`
6648    pub name: std::string::String,
6649
6650    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6651}
6652
6653impl RefreshSubscriptionRequest {
6654    pub fn new() -> Self {
6655        std::default::Default::default()
6656    }
6657
6658    /// Sets the value of [name][crate::model::RefreshSubscriptionRequest::name].
6659    ///
6660    /// # Example
6661    /// ```ignore,no_run
6662    /// # use google_cloud_bigquery_analyticshub_v1::model::RefreshSubscriptionRequest;
6663    /// let x = RefreshSubscriptionRequest::new().set_name("example");
6664    /// ```
6665    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6666        self.name = v.into();
6667        self
6668    }
6669}
6670
6671impl wkt::message::Message for RefreshSubscriptionRequest {
6672    fn typename() -> &'static str {
6673        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RefreshSubscriptionRequest"
6674    }
6675}
6676
6677/// Message for response when you refresh a subscription.
6678#[derive(Clone, Default, PartialEq)]
6679#[non_exhaustive]
6680pub struct RefreshSubscriptionResponse {
6681    /// The refreshed subscription resource.
6682    pub subscription: std::option::Option<crate::model::Subscription>,
6683
6684    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6685}
6686
6687impl RefreshSubscriptionResponse {
6688    pub fn new() -> Self {
6689        std::default::Default::default()
6690    }
6691
6692    /// Sets the value of [subscription][crate::model::RefreshSubscriptionResponse::subscription].
6693    ///
6694    /// # Example
6695    /// ```ignore,no_run
6696    /// # use google_cloud_bigquery_analyticshub_v1::model::RefreshSubscriptionResponse;
6697    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6698    /// let x = RefreshSubscriptionResponse::new().set_subscription(Subscription::default()/* use setters */);
6699    /// ```
6700    pub fn set_subscription<T>(mut self, v: T) -> Self
6701    where
6702        T: std::convert::Into<crate::model::Subscription>,
6703    {
6704        self.subscription = std::option::Option::Some(v.into());
6705        self
6706    }
6707
6708    /// Sets or clears the value of [subscription][crate::model::RefreshSubscriptionResponse::subscription].
6709    ///
6710    /// # Example
6711    /// ```ignore,no_run
6712    /// # use google_cloud_bigquery_analyticshub_v1::model::RefreshSubscriptionResponse;
6713    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6714    /// let x = RefreshSubscriptionResponse::new().set_or_clear_subscription(Some(Subscription::default()/* use setters */));
6715    /// let x = RefreshSubscriptionResponse::new().set_or_clear_subscription(None::<Subscription>);
6716    /// ```
6717    pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
6718    where
6719        T: std::convert::Into<crate::model::Subscription>,
6720    {
6721        self.subscription = v.map(|x| x.into());
6722        self
6723    }
6724}
6725
6726impl wkt::message::Message for RefreshSubscriptionResponse {
6727    fn typename() -> &'static str {
6728        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RefreshSubscriptionResponse"
6729    }
6730}
6731
6732/// Message for getting a subscription.
6733#[derive(Clone, Default, PartialEq)]
6734#[non_exhaustive]
6735pub struct GetSubscriptionRequest {
6736    /// Required. Resource name of the subscription.
6737    /// e.g. projects/123/locations/us/subscriptions/456
6738    pub name: std::string::String,
6739
6740    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6741}
6742
6743impl GetSubscriptionRequest {
6744    pub fn new() -> Self {
6745        std::default::Default::default()
6746    }
6747
6748    /// Sets the value of [name][crate::model::GetSubscriptionRequest::name].
6749    ///
6750    /// # Example
6751    /// ```ignore,no_run
6752    /// # use google_cloud_bigquery_analyticshub_v1::model::GetSubscriptionRequest;
6753    /// let x = GetSubscriptionRequest::new().set_name("example");
6754    /// ```
6755    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6756        self.name = v.into();
6757        self
6758    }
6759}
6760
6761impl wkt::message::Message for GetSubscriptionRequest {
6762    fn typename() -> &'static str {
6763        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetSubscriptionRequest"
6764    }
6765}
6766
6767/// Message for listing subscriptions.
6768#[derive(Clone, Default, PartialEq)]
6769#[non_exhaustive]
6770pub struct ListSubscriptionsRequest {
6771    /// Required. The parent resource path of the subscription.
6772    /// e.g. projects/myproject/locations/us
6773    pub parent: std::string::String,
6774
6775    /// An expression for filtering the results of the request. Eligible
6776    /// fields for filtering are:
6777    ///
6778    /// + `listing`
6779    /// + `data_exchange`
6780    ///
6781    /// Alternatively, a literal wrapped in double quotes may be provided.
6782    /// This will be checked for an exact match against both fields above.
6783    ///
6784    /// In all cases, the full Data Exchange or Listing resource name must
6785    /// be provided. Some example of using filters:
6786    ///
6787    /// + data_exchange="projects/myproject/locations/us/dataExchanges/123"
6788    /// + listing="projects/123/locations/us/dataExchanges/456/listings/789"
6789    /// + "projects/myproject/locations/us/dataExchanges/123"
6790    pub filter: std::string::String,
6791
6792    /// The maximum number of results to return in a single response page.
6793    pub page_size: i32,
6794
6795    /// Page token, returned by a previous call.
6796    pub page_token: std::string::String,
6797
6798    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6799}
6800
6801impl ListSubscriptionsRequest {
6802    pub fn new() -> Self {
6803        std::default::Default::default()
6804    }
6805
6806    /// Sets the value of [parent][crate::model::ListSubscriptionsRequest::parent].
6807    ///
6808    /// # Example
6809    /// ```ignore,no_run
6810    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
6811    /// let x = ListSubscriptionsRequest::new().set_parent("example");
6812    /// ```
6813    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6814        self.parent = v.into();
6815        self
6816    }
6817
6818    /// Sets the value of [filter][crate::model::ListSubscriptionsRequest::filter].
6819    ///
6820    /// # Example
6821    /// ```ignore,no_run
6822    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
6823    /// let x = ListSubscriptionsRequest::new().set_filter("example");
6824    /// ```
6825    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6826        self.filter = v.into();
6827        self
6828    }
6829
6830    /// Sets the value of [page_size][crate::model::ListSubscriptionsRequest::page_size].
6831    ///
6832    /// # Example
6833    /// ```ignore,no_run
6834    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
6835    /// let x = ListSubscriptionsRequest::new().set_page_size(42);
6836    /// ```
6837    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6838        self.page_size = v.into();
6839        self
6840    }
6841
6842    /// Sets the value of [page_token][crate::model::ListSubscriptionsRequest::page_token].
6843    ///
6844    /// # Example
6845    /// ```ignore,no_run
6846    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
6847    /// let x = ListSubscriptionsRequest::new().set_page_token("example");
6848    /// ```
6849    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6850        self.page_token = v.into();
6851        self
6852    }
6853}
6854
6855impl wkt::message::Message for ListSubscriptionsRequest {
6856    fn typename() -> &'static str {
6857        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSubscriptionsRequest"
6858    }
6859}
6860
6861/// Message for response to the listing of subscriptions.
6862#[derive(Clone, Default, PartialEq)]
6863#[non_exhaustive]
6864pub struct ListSubscriptionsResponse {
6865    /// The list of subscriptions.
6866    pub subscriptions: std::vec::Vec<crate::model::Subscription>,
6867
6868    /// Next page token.
6869    pub next_page_token: std::string::String,
6870
6871    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6872}
6873
6874impl ListSubscriptionsResponse {
6875    pub fn new() -> Self {
6876        std::default::Default::default()
6877    }
6878
6879    /// Sets the value of [subscriptions][crate::model::ListSubscriptionsResponse::subscriptions].
6880    ///
6881    /// # Example
6882    /// ```ignore,no_run
6883    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsResponse;
6884    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6885    /// let x = ListSubscriptionsResponse::new()
6886    ///     .set_subscriptions([
6887    ///         Subscription::default()/* use setters */,
6888    ///         Subscription::default()/* use (different) setters */,
6889    ///     ]);
6890    /// ```
6891    pub fn set_subscriptions<T, V>(mut self, v: T) -> Self
6892    where
6893        T: std::iter::IntoIterator<Item = V>,
6894        V: std::convert::Into<crate::model::Subscription>,
6895    {
6896        use std::iter::Iterator;
6897        self.subscriptions = v.into_iter().map(|i| i.into()).collect();
6898        self
6899    }
6900
6901    /// Sets the value of [next_page_token][crate::model::ListSubscriptionsResponse::next_page_token].
6902    ///
6903    /// # Example
6904    /// ```ignore,no_run
6905    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsResponse;
6906    /// let x = ListSubscriptionsResponse::new().set_next_page_token("example");
6907    /// ```
6908    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6909        self.next_page_token = v.into();
6910        self
6911    }
6912}
6913
6914impl wkt::message::Message for ListSubscriptionsResponse {
6915    fn typename() -> &'static str {
6916        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSubscriptionsResponse"
6917    }
6918}
6919
6920#[doc(hidden)]
6921impl gax::paginator::internal::PageableResponse for ListSubscriptionsResponse {
6922    type PageItem = crate::model::Subscription;
6923
6924    fn items(self) -> std::vec::Vec<Self::PageItem> {
6925        self.subscriptions
6926    }
6927
6928    fn next_page_token(&self) -> std::string::String {
6929        use std::clone::Clone;
6930        self.next_page_token.clone()
6931    }
6932}
6933
6934/// Message for listing subscriptions of a shared resource.
6935#[derive(Clone, Default, PartialEq)]
6936#[non_exhaustive]
6937pub struct ListSharedResourceSubscriptionsRequest {
6938    /// Required. Resource name of the requested target. This resource may be
6939    /// either a Listing or a DataExchange. e.g.
6940    /// projects/123/locations/us/dataExchanges/456 OR e.g.
6941    /// projects/123/locations/us/dataExchanges/456/listings/789
6942    pub resource: std::string::String,
6943
6944    /// If selected, includes deleted subscriptions in the response
6945    /// (up to 63 days after deletion).
6946    pub include_deleted_subscriptions: bool,
6947
6948    /// The maximum number of results to return in a single response page.
6949    pub page_size: i32,
6950
6951    /// Page token, returned by a previous call.
6952    pub page_token: std::string::String,
6953
6954    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6955}
6956
6957impl ListSharedResourceSubscriptionsRequest {
6958    pub fn new() -> Self {
6959        std::default::Default::default()
6960    }
6961
6962    /// Sets the value of [resource][crate::model::ListSharedResourceSubscriptionsRequest::resource].
6963    ///
6964    /// # Example
6965    /// ```ignore,no_run
6966    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
6967    /// let x = ListSharedResourceSubscriptionsRequest::new().set_resource("example");
6968    /// ```
6969    pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6970        self.resource = v.into();
6971        self
6972    }
6973
6974    /// Sets the value of [include_deleted_subscriptions][crate::model::ListSharedResourceSubscriptionsRequest::include_deleted_subscriptions].
6975    ///
6976    /// # Example
6977    /// ```ignore,no_run
6978    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
6979    /// let x = ListSharedResourceSubscriptionsRequest::new().set_include_deleted_subscriptions(true);
6980    /// ```
6981    pub fn set_include_deleted_subscriptions<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6982        self.include_deleted_subscriptions = v.into();
6983        self
6984    }
6985
6986    /// Sets the value of [page_size][crate::model::ListSharedResourceSubscriptionsRequest::page_size].
6987    ///
6988    /// # Example
6989    /// ```ignore,no_run
6990    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
6991    /// let x = ListSharedResourceSubscriptionsRequest::new().set_page_size(42);
6992    /// ```
6993    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6994        self.page_size = v.into();
6995        self
6996    }
6997
6998    /// Sets the value of [page_token][crate::model::ListSharedResourceSubscriptionsRequest::page_token].
6999    ///
7000    /// # Example
7001    /// ```ignore,no_run
7002    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
7003    /// let x = ListSharedResourceSubscriptionsRequest::new().set_page_token("example");
7004    /// ```
7005    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7006        self.page_token = v.into();
7007        self
7008    }
7009}
7010
7011impl wkt::message::Message for ListSharedResourceSubscriptionsRequest {
7012    fn typename() -> &'static str {
7013        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSharedResourceSubscriptionsRequest"
7014    }
7015}
7016
7017/// Message for response to the listing of shared resource subscriptions.
7018#[derive(Clone, Default, PartialEq)]
7019#[non_exhaustive]
7020pub struct ListSharedResourceSubscriptionsResponse {
7021    /// The list of subscriptions.
7022    pub shared_resource_subscriptions: std::vec::Vec<crate::model::Subscription>,
7023
7024    /// Next page token.
7025    pub next_page_token: std::string::String,
7026
7027    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7028}
7029
7030impl ListSharedResourceSubscriptionsResponse {
7031    pub fn new() -> Self {
7032        std::default::Default::default()
7033    }
7034
7035    /// Sets the value of [shared_resource_subscriptions][crate::model::ListSharedResourceSubscriptionsResponse::shared_resource_subscriptions].
7036    ///
7037    /// # Example
7038    /// ```ignore,no_run
7039    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsResponse;
7040    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
7041    /// let x = ListSharedResourceSubscriptionsResponse::new()
7042    ///     .set_shared_resource_subscriptions([
7043    ///         Subscription::default()/* use setters */,
7044    ///         Subscription::default()/* use (different) setters */,
7045    ///     ]);
7046    /// ```
7047    pub fn set_shared_resource_subscriptions<T, V>(mut self, v: T) -> Self
7048    where
7049        T: std::iter::IntoIterator<Item = V>,
7050        V: std::convert::Into<crate::model::Subscription>,
7051    {
7052        use std::iter::Iterator;
7053        self.shared_resource_subscriptions = v.into_iter().map(|i| i.into()).collect();
7054        self
7055    }
7056
7057    /// Sets the value of [next_page_token][crate::model::ListSharedResourceSubscriptionsResponse::next_page_token].
7058    ///
7059    /// # Example
7060    /// ```ignore,no_run
7061    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsResponse;
7062    /// let x = ListSharedResourceSubscriptionsResponse::new().set_next_page_token("example");
7063    /// ```
7064    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7065        self.next_page_token = v.into();
7066        self
7067    }
7068}
7069
7070impl wkt::message::Message for ListSharedResourceSubscriptionsResponse {
7071    fn typename() -> &'static str {
7072        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSharedResourceSubscriptionsResponse"
7073    }
7074}
7075
7076#[doc(hidden)]
7077impl gax::paginator::internal::PageableResponse for ListSharedResourceSubscriptionsResponse {
7078    type PageItem = crate::model::Subscription;
7079
7080    fn items(self) -> std::vec::Vec<Self::PageItem> {
7081        self.shared_resource_subscriptions
7082    }
7083
7084    fn next_page_token(&self) -> std::string::String {
7085        use std::clone::Clone;
7086        self.next_page_token.clone()
7087    }
7088}
7089
7090/// Message for revoking a subscription.
7091#[derive(Clone, Default, PartialEq)]
7092#[non_exhaustive]
7093pub struct RevokeSubscriptionRequest {
7094    /// Required. Resource name of the subscription to revoke.
7095    /// e.g. projects/123/locations/us/subscriptions/456
7096    pub name: std::string::String,
7097
7098    /// Optional. If the subscription is commercial then this field must be set to
7099    /// true, otherwise a failure is thrown. This acts as a safety guard to avoid
7100    /// revoking commercial subscriptions accidentally.
7101    pub revoke_commercial: bool,
7102
7103    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7104}
7105
7106impl RevokeSubscriptionRequest {
7107    pub fn new() -> Self {
7108        std::default::Default::default()
7109    }
7110
7111    /// Sets the value of [name][crate::model::RevokeSubscriptionRequest::name].
7112    ///
7113    /// # Example
7114    /// ```ignore,no_run
7115    /// # use google_cloud_bigquery_analyticshub_v1::model::RevokeSubscriptionRequest;
7116    /// let x = RevokeSubscriptionRequest::new().set_name("example");
7117    /// ```
7118    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7119        self.name = v.into();
7120        self
7121    }
7122
7123    /// Sets the value of [revoke_commercial][crate::model::RevokeSubscriptionRequest::revoke_commercial].
7124    ///
7125    /// # Example
7126    /// ```ignore,no_run
7127    /// # use google_cloud_bigquery_analyticshub_v1::model::RevokeSubscriptionRequest;
7128    /// let x = RevokeSubscriptionRequest::new().set_revoke_commercial(true);
7129    /// ```
7130    pub fn set_revoke_commercial<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7131        self.revoke_commercial = v.into();
7132        self
7133    }
7134}
7135
7136impl wkt::message::Message for RevokeSubscriptionRequest {
7137    fn typename() -> &'static str {
7138        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RevokeSubscriptionRequest"
7139    }
7140}
7141
7142/// Message for response when you revoke a subscription.
7143/// Empty for now.
7144#[derive(Clone, Default, PartialEq)]
7145#[non_exhaustive]
7146pub struct RevokeSubscriptionResponse {
7147    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7148}
7149
7150impl RevokeSubscriptionResponse {
7151    pub fn new() -> Self {
7152        std::default::Default::default()
7153    }
7154}
7155
7156impl wkt::message::Message for RevokeSubscriptionResponse {
7157    fn typename() -> &'static str {
7158        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RevokeSubscriptionResponse"
7159    }
7160}
7161
7162/// Message for deleting a subscription.
7163#[derive(Clone, Default, PartialEq)]
7164#[non_exhaustive]
7165pub struct DeleteSubscriptionRequest {
7166    /// Required. Resource name of the subscription to delete.
7167    /// e.g. projects/123/locations/us/subscriptions/456
7168    pub name: std::string::String,
7169
7170    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7171}
7172
7173impl DeleteSubscriptionRequest {
7174    pub fn new() -> Self {
7175        std::default::Default::default()
7176    }
7177
7178    /// Sets the value of [name][crate::model::DeleteSubscriptionRequest::name].
7179    ///
7180    /// # Example
7181    /// ```ignore,no_run
7182    /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteSubscriptionRequest;
7183    /// let x = DeleteSubscriptionRequest::new().set_name("example");
7184    /// ```
7185    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7186        self.name = v.into();
7187        self
7188    }
7189}
7190
7191impl wkt::message::Message for DeleteSubscriptionRequest {
7192    fn typename() -> &'static str {
7193        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteSubscriptionRequest"
7194    }
7195}
7196
7197/// Represents the metadata of a long-running operation in Analytics Hub.
7198#[derive(Clone, Default, PartialEq)]
7199#[non_exhaustive]
7200pub struct OperationMetadata {
7201    /// Output only. The time the operation was created.
7202    pub create_time: std::option::Option<wkt::Timestamp>,
7203
7204    /// Output only. The time the operation finished running.
7205    pub end_time: std::option::Option<wkt::Timestamp>,
7206
7207    /// Output only. Server-defined resource path for the target of the operation.
7208    pub target: std::string::String,
7209
7210    /// Output only. Name of the verb executed by the operation.
7211    pub verb: std::string::String,
7212
7213    /// Output only. Human-readable status of the operation, if any.
7214    pub status_message: std::string::String,
7215
7216    /// Output only. Identifies whether the user has requested cancellation
7217    /// of the operation. Operations that have successfully been cancelled
7218    /// have [Operation.error][] value with a
7219    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
7220    /// `Code.CANCELLED`.
7221    ///
7222    /// [google.rpc.Status.code]: rpc::model::Status::code
7223    pub requested_cancellation: bool,
7224
7225    /// Output only. API version used to start the operation.
7226    pub api_version: std::string::String,
7227
7228    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7229}
7230
7231impl OperationMetadata {
7232    pub fn new() -> Self {
7233        std::default::Default::default()
7234    }
7235
7236    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
7237    ///
7238    /// # Example
7239    /// ```ignore,no_run
7240    /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7241    /// use wkt::Timestamp;
7242    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
7243    /// ```
7244    pub fn set_create_time<T>(mut self, v: T) -> Self
7245    where
7246        T: std::convert::Into<wkt::Timestamp>,
7247    {
7248        self.create_time = std::option::Option::Some(v.into());
7249        self
7250    }
7251
7252    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
7253    ///
7254    /// # Example
7255    /// ```ignore,no_run
7256    /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7257    /// use wkt::Timestamp;
7258    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7259    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
7260    /// ```
7261    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7262    where
7263        T: std::convert::Into<wkt::Timestamp>,
7264    {
7265        self.create_time = v.map(|x| x.into());
7266        self
7267    }
7268
7269    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
7270    ///
7271    /// # Example
7272    /// ```ignore,no_run
7273    /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7274    /// use wkt::Timestamp;
7275    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
7276    /// ```
7277    pub fn set_end_time<T>(mut self, v: T) -> Self
7278    where
7279        T: std::convert::Into<wkt::Timestamp>,
7280    {
7281        self.end_time = std::option::Option::Some(v.into());
7282        self
7283    }
7284
7285    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
7286    ///
7287    /// # Example
7288    /// ```ignore,no_run
7289    /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7290    /// use wkt::Timestamp;
7291    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
7292    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
7293    /// ```
7294    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7295    where
7296        T: std::convert::Into<wkt::Timestamp>,
7297    {
7298        self.end_time = v.map(|x| x.into());
7299        self
7300    }
7301
7302    /// Sets the value of [target][crate::model::OperationMetadata::target].
7303    ///
7304    /// # Example
7305    /// ```ignore,no_run
7306    /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7307    /// let x = OperationMetadata::new().set_target("example");
7308    /// ```
7309    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7310        self.target = v.into();
7311        self
7312    }
7313
7314    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
7315    ///
7316    /// # Example
7317    /// ```ignore,no_run
7318    /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7319    /// let x = OperationMetadata::new().set_verb("example");
7320    /// ```
7321    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7322        self.verb = v.into();
7323        self
7324    }
7325
7326    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
7327    ///
7328    /// # Example
7329    /// ```ignore,no_run
7330    /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7331    /// let x = OperationMetadata::new().set_status_message("example");
7332    /// ```
7333    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7334        self.status_message = v.into();
7335        self
7336    }
7337
7338    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
7339    ///
7340    /// # Example
7341    /// ```ignore,no_run
7342    /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7343    /// let x = OperationMetadata::new().set_requested_cancellation(true);
7344    /// ```
7345    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7346        self.requested_cancellation = v.into();
7347        self
7348    }
7349
7350    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
7351    ///
7352    /// # Example
7353    /// ```ignore,no_run
7354    /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7355    /// let x = OperationMetadata::new().set_api_version("example");
7356    /// ```
7357    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7358        self.api_version = v.into();
7359        self
7360    }
7361}
7362
7363impl wkt::message::Message for OperationMetadata {
7364    fn typename() -> &'static str {
7365        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.OperationMetadata"
7366    }
7367}
7368
7369/// Defines the destination Pub/Sub subscription.
7370/// If none of `push_config`, `bigquery_config`, `cloud_storage_config`,
7371/// `pubsub_export_config`, or `pubsublite_export_config`
7372/// is set, then the subscriber will pull and ack messages using API methods. At
7373/// most one of these fields may be set.
7374#[derive(Clone, Default, PartialEq)]
7375#[non_exhaustive]
7376pub struct PubSubSubscription {
7377    /// Required. Name of the subscription.
7378    /// Format is `projects/{project}/subscriptions/{sub}`.
7379    pub name: std::string::String,
7380
7381    /// Optional. If push delivery is used with this subscription, this field is
7382    /// used to configure it.
7383    pub push_config: std::option::Option<crate::model::PushConfig>,
7384
7385    /// Optional. If delivery to BigQuery is used with this subscription, this
7386    /// field is used to configure it.
7387    pub bigquery_config: std::option::Option<crate::model::BigQueryConfig>,
7388
7389    /// Optional. If delivery to Google Cloud Storage is used with this
7390    /// subscription, this field is used to configure it.
7391    pub cloud_storage_config: std::option::Option<crate::model::CloudStorageConfig>,
7392
7393    /// Optional. The approximate amount of time (on a best-effort basis) Pub/Sub
7394    /// waits for the subscriber to acknowledge receipt before resending the
7395    /// message. In the interval after the message is delivered and before it is
7396    /// acknowledged, it is considered to be _outstanding_. During that time
7397    /// period, the message will not be redelivered (on a best-effort basis).
7398    ///
7399    /// For pull subscriptions, this value is used as the initial value for the ack
7400    /// deadline. To override this value for a given message, call
7401    /// `ModifyAckDeadline` with the corresponding `ack_id` if using
7402    /// non-streaming pull or send the `ack_id` in a
7403    /// `StreamingModifyAckDeadlineRequest` if using streaming pull.
7404    /// The minimum custom deadline you can specify is 10 seconds.
7405    /// The maximum custom deadline you can specify is 600 seconds (10 minutes).
7406    /// If this parameter is 0, a default value of 10 seconds is used.
7407    ///
7408    /// For push delivery, this value is also used to set the request timeout for
7409    /// the call to the push endpoint.
7410    ///
7411    /// If the subscriber never acknowledges the message, the Pub/Sub
7412    /// system will eventually redeliver the message.
7413    pub ack_deadline_seconds: i32,
7414
7415    /// Optional. Indicates whether to retain acknowledged messages. If true, then
7416    /// messages are not expunged from the subscription's backlog, even if they are
7417    /// acknowledged, until they fall out of the `message_retention_duration`
7418    /// window. This must be true if you would like to [`Seek` to a timestamp]
7419    /// (<https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time>) in
7420    /// the past to replay previously-acknowledged messages.
7421    pub retain_acked_messages: bool,
7422
7423    /// Optional. How long to retain unacknowledged messages in the subscription's
7424    /// backlog, from the moment a message is published. If `retain_acked_messages`
7425    /// is true, then this also configures the retention of acknowledged messages,
7426    /// and thus configures how far back in time a `Seek` can be done. Defaults to
7427    /// 7 days. Cannot be more than 31 days or less than 10 minutes.
7428    pub message_retention_duration: std::option::Option<wkt::Duration>,
7429
7430    /// Optional. See [Creating and managing
7431    /// labels](https://cloud.google.com/pubsub/docs/labels).
7432    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7433
7434    /// Optional. If true, messages published with the same `ordering_key` in
7435    /// `PubsubMessage` will be delivered to the subscribers in the order in which
7436    /// they are received by the Pub/Sub system. Otherwise, they may be delivered
7437    /// in any order.
7438    pub enable_message_ordering: bool,
7439
7440    /// Optional. A policy that specifies the conditions for this subscription's
7441    /// expiration. A subscription is considered active as long as any connected
7442    /// subscriber is successfully consuming messages from the subscription or is
7443    /// issuing operations on the subscription. If `expiration_policy` is not set,
7444    /// a *default policy* with `ttl` of 31 days will be used. The minimum allowed
7445    /// value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
7446    /// but `expiration_policy.ttl` is not set, the subscription never expires.
7447    pub expiration_policy: std::option::Option<crate::model::ExpirationPolicy>,
7448
7449    /// Optional. An expression written in the Pub/Sub [filter
7450    /// language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
7451    /// then only `PubsubMessage`s whose `attributes` field matches the filter are
7452    /// delivered on this subscription. If empty, then no messages are filtered
7453    /// out.
7454    pub filter: std::string::String,
7455
7456    /// Optional. A policy that specifies the conditions for dead lettering
7457    /// messages in this subscription. If dead_letter_policy is not set, dead
7458    /// lettering is disabled.
7459    ///
7460    /// The Pub/Sub service account associated with this subscriptions's
7461    /// parent project (i.e.,
7462    /// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
7463    /// permission to Acknowledge() messages on this subscription.
7464    pub dead_letter_policy: std::option::Option<crate::model::DeadLetterPolicy>,
7465
7466    /// Optional. A policy that specifies how Pub/Sub retries message delivery for
7467    /// this subscription.
7468    ///
7469    /// If not set, the default retry policy is applied. This generally implies
7470    /// that messages will be retried as soon as possible for healthy subscribers.
7471    /// RetryPolicy will be triggered on NACKs or acknowledgement deadline
7472    /// exceeded events for a given message.
7473    pub retry_policy: std::option::Option<crate::model::RetryPolicy>,
7474
7475    /// Optional. Indicates whether the subscription is detached from its topic.
7476    /// Detached subscriptions don't receive messages from their topic and don't
7477    /// retain any backlog. `Pull` and `StreamingPull` requests will return
7478    /// FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
7479    /// the endpoint will not be made.
7480    pub detached: bool,
7481
7482    /// Optional. If true, Pub/Sub provides the following guarantees for the
7483    /// delivery of a message with a given value of `message_id` on this
7484    /// subscription:
7485    ///
7486    /// * The message sent to a subscriber is guaranteed not to be resent
7487    ///   before the message's acknowledgement deadline expires.
7488    /// * An acknowledged message will not be resent to a subscriber.
7489    ///
7490    /// Note that subscribers may still receive multiple copies of a message
7491    /// when `enable_exactly_once_delivery` is true if the message was published
7492    /// multiple times by a publisher client. These copies are  considered distinct
7493    /// by Pub/Sub and have distinct `message_id` values.
7494    pub enable_exactly_once_delivery: bool,
7495
7496    /// Optional. Transforms to be applied to messages before they are delivered to
7497    /// subscribers. Transforms are applied in the order specified.
7498    pub message_transforms: std::vec::Vec<crate::model::MessageTransform>,
7499
7500    /// Optional. Input only. Immutable. Tag keys/values directly bound to this
7501    /// resource. For example:
7502    /// "123/environment": "production",
7503    /// "123/costCenter": "marketing"
7504    pub tags: std::collections::HashMap<std::string::String, std::string::String>,
7505
7506    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7507}
7508
7509impl PubSubSubscription {
7510    pub fn new() -> Self {
7511        std::default::Default::default()
7512    }
7513
7514    /// Sets the value of [name][crate::model::PubSubSubscription::name].
7515    ///
7516    /// # Example
7517    /// ```ignore,no_run
7518    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7519    /// let x = PubSubSubscription::new().set_name("example");
7520    /// ```
7521    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7522        self.name = v.into();
7523        self
7524    }
7525
7526    /// Sets the value of [push_config][crate::model::PubSubSubscription::push_config].
7527    ///
7528    /// # Example
7529    /// ```ignore,no_run
7530    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7531    /// use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
7532    /// let x = PubSubSubscription::new().set_push_config(PushConfig::default()/* use setters */);
7533    /// ```
7534    pub fn set_push_config<T>(mut self, v: T) -> Self
7535    where
7536        T: std::convert::Into<crate::model::PushConfig>,
7537    {
7538        self.push_config = std::option::Option::Some(v.into());
7539        self
7540    }
7541
7542    /// Sets or clears the value of [push_config][crate::model::PubSubSubscription::push_config].
7543    ///
7544    /// # Example
7545    /// ```ignore,no_run
7546    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7547    /// use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
7548    /// let x = PubSubSubscription::new().set_or_clear_push_config(Some(PushConfig::default()/* use setters */));
7549    /// let x = PubSubSubscription::new().set_or_clear_push_config(None::<PushConfig>);
7550    /// ```
7551    pub fn set_or_clear_push_config<T>(mut self, v: std::option::Option<T>) -> Self
7552    where
7553        T: std::convert::Into<crate::model::PushConfig>,
7554    {
7555        self.push_config = v.map(|x| x.into());
7556        self
7557    }
7558
7559    /// Sets the value of [bigquery_config][crate::model::PubSubSubscription::bigquery_config].
7560    ///
7561    /// # Example
7562    /// ```ignore,no_run
7563    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7564    /// use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
7565    /// let x = PubSubSubscription::new().set_bigquery_config(BigQueryConfig::default()/* use setters */);
7566    /// ```
7567    pub fn set_bigquery_config<T>(mut self, v: T) -> Self
7568    where
7569        T: std::convert::Into<crate::model::BigQueryConfig>,
7570    {
7571        self.bigquery_config = std::option::Option::Some(v.into());
7572        self
7573    }
7574
7575    /// Sets or clears the value of [bigquery_config][crate::model::PubSubSubscription::bigquery_config].
7576    ///
7577    /// # Example
7578    /// ```ignore,no_run
7579    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7580    /// use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
7581    /// let x = PubSubSubscription::new().set_or_clear_bigquery_config(Some(BigQueryConfig::default()/* use setters */));
7582    /// let x = PubSubSubscription::new().set_or_clear_bigquery_config(None::<BigQueryConfig>);
7583    /// ```
7584    pub fn set_or_clear_bigquery_config<T>(mut self, v: std::option::Option<T>) -> Self
7585    where
7586        T: std::convert::Into<crate::model::BigQueryConfig>,
7587    {
7588        self.bigquery_config = v.map(|x| x.into());
7589        self
7590    }
7591
7592    /// Sets the value of [cloud_storage_config][crate::model::PubSubSubscription::cloud_storage_config].
7593    ///
7594    /// # Example
7595    /// ```ignore,no_run
7596    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7597    /// use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
7598    /// let x = PubSubSubscription::new().set_cloud_storage_config(CloudStorageConfig::default()/* use setters */);
7599    /// ```
7600    pub fn set_cloud_storage_config<T>(mut self, v: T) -> Self
7601    where
7602        T: std::convert::Into<crate::model::CloudStorageConfig>,
7603    {
7604        self.cloud_storage_config = std::option::Option::Some(v.into());
7605        self
7606    }
7607
7608    /// Sets or clears the value of [cloud_storage_config][crate::model::PubSubSubscription::cloud_storage_config].
7609    ///
7610    /// # Example
7611    /// ```ignore,no_run
7612    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7613    /// use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
7614    /// let x = PubSubSubscription::new().set_or_clear_cloud_storage_config(Some(CloudStorageConfig::default()/* use setters */));
7615    /// let x = PubSubSubscription::new().set_or_clear_cloud_storage_config(None::<CloudStorageConfig>);
7616    /// ```
7617    pub fn set_or_clear_cloud_storage_config<T>(mut self, v: std::option::Option<T>) -> Self
7618    where
7619        T: std::convert::Into<crate::model::CloudStorageConfig>,
7620    {
7621        self.cloud_storage_config = v.map(|x| x.into());
7622        self
7623    }
7624
7625    /// Sets the value of [ack_deadline_seconds][crate::model::PubSubSubscription::ack_deadline_seconds].
7626    ///
7627    /// # Example
7628    /// ```ignore,no_run
7629    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7630    /// let x = PubSubSubscription::new().set_ack_deadline_seconds(42);
7631    /// ```
7632    pub fn set_ack_deadline_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7633        self.ack_deadline_seconds = v.into();
7634        self
7635    }
7636
7637    /// Sets the value of [retain_acked_messages][crate::model::PubSubSubscription::retain_acked_messages].
7638    ///
7639    /// # Example
7640    /// ```ignore,no_run
7641    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7642    /// let x = PubSubSubscription::new().set_retain_acked_messages(true);
7643    /// ```
7644    pub fn set_retain_acked_messages<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7645        self.retain_acked_messages = v.into();
7646        self
7647    }
7648
7649    /// Sets the value of [message_retention_duration][crate::model::PubSubSubscription::message_retention_duration].
7650    ///
7651    /// # Example
7652    /// ```ignore,no_run
7653    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7654    /// use wkt::Duration;
7655    /// let x = PubSubSubscription::new().set_message_retention_duration(Duration::default()/* use setters */);
7656    /// ```
7657    pub fn set_message_retention_duration<T>(mut self, v: T) -> Self
7658    where
7659        T: std::convert::Into<wkt::Duration>,
7660    {
7661        self.message_retention_duration = std::option::Option::Some(v.into());
7662        self
7663    }
7664
7665    /// Sets or clears the value of [message_retention_duration][crate::model::PubSubSubscription::message_retention_duration].
7666    ///
7667    /// # Example
7668    /// ```ignore,no_run
7669    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7670    /// use wkt::Duration;
7671    /// let x = PubSubSubscription::new().set_or_clear_message_retention_duration(Some(Duration::default()/* use setters */));
7672    /// let x = PubSubSubscription::new().set_or_clear_message_retention_duration(None::<Duration>);
7673    /// ```
7674    pub fn set_or_clear_message_retention_duration<T>(mut self, v: std::option::Option<T>) -> Self
7675    where
7676        T: std::convert::Into<wkt::Duration>,
7677    {
7678        self.message_retention_duration = v.map(|x| x.into());
7679        self
7680    }
7681
7682    /// Sets the value of [labels][crate::model::PubSubSubscription::labels].
7683    ///
7684    /// # Example
7685    /// ```ignore,no_run
7686    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7687    /// let x = PubSubSubscription::new().set_labels([
7688    ///     ("key0", "abc"),
7689    ///     ("key1", "xyz"),
7690    /// ]);
7691    /// ```
7692    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7693    where
7694        T: std::iter::IntoIterator<Item = (K, V)>,
7695        K: std::convert::Into<std::string::String>,
7696        V: std::convert::Into<std::string::String>,
7697    {
7698        use std::iter::Iterator;
7699        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7700        self
7701    }
7702
7703    /// Sets the value of [enable_message_ordering][crate::model::PubSubSubscription::enable_message_ordering].
7704    ///
7705    /// # Example
7706    /// ```ignore,no_run
7707    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7708    /// let x = PubSubSubscription::new().set_enable_message_ordering(true);
7709    /// ```
7710    pub fn set_enable_message_ordering<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7711        self.enable_message_ordering = v.into();
7712        self
7713    }
7714
7715    /// Sets the value of [expiration_policy][crate::model::PubSubSubscription::expiration_policy].
7716    ///
7717    /// # Example
7718    /// ```ignore,no_run
7719    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7720    /// use google_cloud_bigquery_analyticshub_v1::model::ExpirationPolicy;
7721    /// let x = PubSubSubscription::new().set_expiration_policy(ExpirationPolicy::default()/* use setters */);
7722    /// ```
7723    pub fn set_expiration_policy<T>(mut self, v: T) -> Self
7724    where
7725        T: std::convert::Into<crate::model::ExpirationPolicy>,
7726    {
7727        self.expiration_policy = std::option::Option::Some(v.into());
7728        self
7729    }
7730
7731    /// Sets or clears the value of [expiration_policy][crate::model::PubSubSubscription::expiration_policy].
7732    ///
7733    /// # Example
7734    /// ```ignore,no_run
7735    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7736    /// use google_cloud_bigquery_analyticshub_v1::model::ExpirationPolicy;
7737    /// let x = PubSubSubscription::new().set_or_clear_expiration_policy(Some(ExpirationPolicy::default()/* use setters */));
7738    /// let x = PubSubSubscription::new().set_or_clear_expiration_policy(None::<ExpirationPolicy>);
7739    /// ```
7740    pub fn set_or_clear_expiration_policy<T>(mut self, v: std::option::Option<T>) -> Self
7741    where
7742        T: std::convert::Into<crate::model::ExpirationPolicy>,
7743    {
7744        self.expiration_policy = v.map(|x| x.into());
7745        self
7746    }
7747
7748    /// Sets the value of [filter][crate::model::PubSubSubscription::filter].
7749    ///
7750    /// # Example
7751    /// ```ignore,no_run
7752    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7753    /// let x = PubSubSubscription::new().set_filter("example");
7754    /// ```
7755    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7756        self.filter = v.into();
7757        self
7758    }
7759
7760    /// Sets the value of [dead_letter_policy][crate::model::PubSubSubscription::dead_letter_policy].
7761    ///
7762    /// # Example
7763    /// ```ignore,no_run
7764    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7765    /// use google_cloud_bigquery_analyticshub_v1::model::DeadLetterPolicy;
7766    /// let x = PubSubSubscription::new().set_dead_letter_policy(DeadLetterPolicy::default()/* use setters */);
7767    /// ```
7768    pub fn set_dead_letter_policy<T>(mut self, v: T) -> Self
7769    where
7770        T: std::convert::Into<crate::model::DeadLetterPolicy>,
7771    {
7772        self.dead_letter_policy = std::option::Option::Some(v.into());
7773        self
7774    }
7775
7776    /// Sets or clears the value of [dead_letter_policy][crate::model::PubSubSubscription::dead_letter_policy].
7777    ///
7778    /// # Example
7779    /// ```ignore,no_run
7780    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7781    /// use google_cloud_bigquery_analyticshub_v1::model::DeadLetterPolicy;
7782    /// let x = PubSubSubscription::new().set_or_clear_dead_letter_policy(Some(DeadLetterPolicy::default()/* use setters */));
7783    /// let x = PubSubSubscription::new().set_or_clear_dead_letter_policy(None::<DeadLetterPolicy>);
7784    /// ```
7785    pub fn set_or_clear_dead_letter_policy<T>(mut self, v: std::option::Option<T>) -> Self
7786    where
7787        T: std::convert::Into<crate::model::DeadLetterPolicy>,
7788    {
7789        self.dead_letter_policy = v.map(|x| x.into());
7790        self
7791    }
7792
7793    /// Sets the value of [retry_policy][crate::model::PubSubSubscription::retry_policy].
7794    ///
7795    /// # Example
7796    /// ```ignore,no_run
7797    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7798    /// use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
7799    /// let x = PubSubSubscription::new().set_retry_policy(RetryPolicy::default()/* use setters */);
7800    /// ```
7801    pub fn set_retry_policy<T>(mut self, v: T) -> Self
7802    where
7803        T: std::convert::Into<crate::model::RetryPolicy>,
7804    {
7805        self.retry_policy = std::option::Option::Some(v.into());
7806        self
7807    }
7808
7809    /// Sets or clears the value of [retry_policy][crate::model::PubSubSubscription::retry_policy].
7810    ///
7811    /// # Example
7812    /// ```ignore,no_run
7813    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7814    /// use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
7815    /// let x = PubSubSubscription::new().set_or_clear_retry_policy(Some(RetryPolicy::default()/* use setters */));
7816    /// let x = PubSubSubscription::new().set_or_clear_retry_policy(None::<RetryPolicy>);
7817    /// ```
7818    pub fn set_or_clear_retry_policy<T>(mut self, v: std::option::Option<T>) -> Self
7819    where
7820        T: std::convert::Into<crate::model::RetryPolicy>,
7821    {
7822        self.retry_policy = v.map(|x| x.into());
7823        self
7824    }
7825
7826    /// Sets the value of [detached][crate::model::PubSubSubscription::detached].
7827    ///
7828    /// # Example
7829    /// ```ignore,no_run
7830    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7831    /// let x = PubSubSubscription::new().set_detached(true);
7832    /// ```
7833    pub fn set_detached<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7834        self.detached = v.into();
7835        self
7836    }
7837
7838    /// Sets the value of [enable_exactly_once_delivery][crate::model::PubSubSubscription::enable_exactly_once_delivery].
7839    ///
7840    /// # Example
7841    /// ```ignore,no_run
7842    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7843    /// let x = PubSubSubscription::new().set_enable_exactly_once_delivery(true);
7844    /// ```
7845    pub fn set_enable_exactly_once_delivery<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7846        self.enable_exactly_once_delivery = v.into();
7847        self
7848    }
7849
7850    /// Sets the value of [message_transforms][crate::model::PubSubSubscription::message_transforms].
7851    ///
7852    /// # Example
7853    /// ```ignore,no_run
7854    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7855    /// use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
7856    /// let x = PubSubSubscription::new()
7857    ///     .set_message_transforms([
7858    ///         MessageTransform::default()/* use setters */,
7859    ///         MessageTransform::default()/* use (different) setters */,
7860    ///     ]);
7861    /// ```
7862    pub fn set_message_transforms<T, V>(mut self, v: T) -> Self
7863    where
7864        T: std::iter::IntoIterator<Item = V>,
7865        V: std::convert::Into<crate::model::MessageTransform>,
7866    {
7867        use std::iter::Iterator;
7868        self.message_transforms = v.into_iter().map(|i| i.into()).collect();
7869        self
7870    }
7871
7872    /// Sets the value of [tags][crate::model::PubSubSubscription::tags].
7873    ///
7874    /// # Example
7875    /// ```ignore,no_run
7876    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7877    /// let x = PubSubSubscription::new().set_tags([
7878    ///     ("key0", "abc"),
7879    ///     ("key1", "xyz"),
7880    /// ]);
7881    /// ```
7882    pub fn set_tags<T, K, V>(mut self, v: T) -> Self
7883    where
7884        T: std::iter::IntoIterator<Item = (K, V)>,
7885        K: std::convert::Into<std::string::String>,
7886        V: std::convert::Into<std::string::String>,
7887    {
7888        use std::iter::Iterator;
7889        self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7890        self
7891    }
7892}
7893
7894impl wkt::message::Message for PubSubSubscription {
7895    fn typename() -> &'static str {
7896        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PubSubSubscription"
7897    }
7898}
7899
7900/// A policy that specifies how Pub/Sub retries message delivery.
7901///
7902/// Retry delay will be exponential based on provided minimum and maximum
7903/// backoffs. <https://en.wikipedia.org/wiki/Exponential_backoff>.
7904///
7905/// RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded
7906/// events for a given message.
7907///
7908/// Retry Policy is implemented on a best effort basis. At times, the delay
7909/// between consecutive deliveries may not match the configuration. That is,
7910/// delay can be more or less than configured backoff.
7911#[derive(Clone, Default, PartialEq)]
7912#[non_exhaustive]
7913pub struct RetryPolicy {
7914    /// Optional. The minimum delay between consecutive deliveries of a given
7915    /// message. Value should be between 0 and 600 seconds. Defaults to 10 seconds.
7916    pub minimum_backoff: std::option::Option<wkt::Duration>,
7917
7918    /// Optional. The maximum delay between consecutive deliveries of a given
7919    /// message. Value should be between 0 and 600 seconds. Defaults to 600
7920    /// seconds.
7921    pub maximum_backoff: std::option::Option<wkt::Duration>,
7922
7923    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7924}
7925
7926impl RetryPolicy {
7927    pub fn new() -> Self {
7928        std::default::Default::default()
7929    }
7930
7931    /// Sets the value of [minimum_backoff][crate::model::RetryPolicy::minimum_backoff].
7932    ///
7933    /// # Example
7934    /// ```ignore,no_run
7935    /// # use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
7936    /// use wkt::Duration;
7937    /// let x = RetryPolicy::new().set_minimum_backoff(Duration::default()/* use setters */);
7938    /// ```
7939    pub fn set_minimum_backoff<T>(mut self, v: T) -> Self
7940    where
7941        T: std::convert::Into<wkt::Duration>,
7942    {
7943        self.minimum_backoff = std::option::Option::Some(v.into());
7944        self
7945    }
7946
7947    /// Sets or clears the value of [minimum_backoff][crate::model::RetryPolicy::minimum_backoff].
7948    ///
7949    /// # Example
7950    /// ```ignore,no_run
7951    /// # use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
7952    /// use wkt::Duration;
7953    /// let x = RetryPolicy::new().set_or_clear_minimum_backoff(Some(Duration::default()/* use setters */));
7954    /// let x = RetryPolicy::new().set_or_clear_minimum_backoff(None::<Duration>);
7955    /// ```
7956    pub fn set_or_clear_minimum_backoff<T>(mut self, v: std::option::Option<T>) -> Self
7957    where
7958        T: std::convert::Into<wkt::Duration>,
7959    {
7960        self.minimum_backoff = v.map(|x| x.into());
7961        self
7962    }
7963
7964    /// Sets the value of [maximum_backoff][crate::model::RetryPolicy::maximum_backoff].
7965    ///
7966    /// # Example
7967    /// ```ignore,no_run
7968    /// # use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
7969    /// use wkt::Duration;
7970    /// let x = RetryPolicy::new().set_maximum_backoff(Duration::default()/* use setters */);
7971    /// ```
7972    pub fn set_maximum_backoff<T>(mut self, v: T) -> Self
7973    where
7974        T: std::convert::Into<wkt::Duration>,
7975    {
7976        self.maximum_backoff = std::option::Option::Some(v.into());
7977        self
7978    }
7979
7980    /// Sets or clears the value of [maximum_backoff][crate::model::RetryPolicy::maximum_backoff].
7981    ///
7982    /// # Example
7983    /// ```ignore,no_run
7984    /// # use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
7985    /// use wkt::Duration;
7986    /// let x = RetryPolicy::new().set_or_clear_maximum_backoff(Some(Duration::default()/* use setters */));
7987    /// let x = RetryPolicy::new().set_or_clear_maximum_backoff(None::<Duration>);
7988    /// ```
7989    pub fn set_or_clear_maximum_backoff<T>(mut self, v: std::option::Option<T>) -> Self
7990    where
7991        T: std::convert::Into<wkt::Duration>,
7992    {
7993        self.maximum_backoff = v.map(|x| x.into());
7994        self
7995    }
7996}
7997
7998impl wkt::message::Message for RetryPolicy {
7999    fn typename() -> &'static str {
8000        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RetryPolicy"
8001    }
8002}
8003
8004/// Dead lettering is done on a best effort basis. The same message might be
8005/// dead lettered multiple times.
8006///
8007/// If validation on any of the fields fails at subscription creation/updation,
8008/// the create/update subscription request will fail.
8009#[derive(Clone, Default, PartialEq)]
8010#[non_exhaustive]
8011pub struct DeadLetterPolicy {
8012    /// Optional. The name of the topic to which dead letter messages should be
8013    /// published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub
8014    /// service account associated with the enclosing subscription's parent project
8015    /// (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must
8016    /// have permission to Publish() to this topic.
8017    ///
8018    /// The operation will fail if the topic does not exist.
8019    /// Users should ensure that there is a subscription attached to this topic
8020    /// since messages published to a topic with no subscriptions are lost.
8021    pub dead_letter_topic: std::string::String,
8022
8023    /// Optional. The maximum number of delivery attempts for any message. The
8024    /// value must be between 5 and 100.
8025    ///
8026    /// The number of delivery attempts is defined as 1 + (the sum of number of
8027    /// NACKs and number of times the acknowledgement deadline has been exceeded
8028    /// for the message).
8029    ///
8030    /// A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
8031    /// client libraries may automatically extend ack_deadlines.
8032    ///
8033    /// This field will be honored on a best effort basis.
8034    ///
8035    /// If this parameter is 0, a default value of 5 is used.
8036    pub max_delivery_attempts: i32,
8037
8038    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8039}
8040
8041impl DeadLetterPolicy {
8042    pub fn new() -> Self {
8043        std::default::Default::default()
8044    }
8045
8046    /// Sets the value of [dead_letter_topic][crate::model::DeadLetterPolicy::dead_letter_topic].
8047    ///
8048    /// # Example
8049    /// ```ignore,no_run
8050    /// # use google_cloud_bigquery_analyticshub_v1::model::DeadLetterPolicy;
8051    /// let x = DeadLetterPolicy::new().set_dead_letter_topic("example");
8052    /// ```
8053    pub fn set_dead_letter_topic<T: std::convert::Into<std::string::String>>(
8054        mut self,
8055        v: T,
8056    ) -> Self {
8057        self.dead_letter_topic = v.into();
8058        self
8059    }
8060
8061    /// Sets the value of [max_delivery_attempts][crate::model::DeadLetterPolicy::max_delivery_attempts].
8062    ///
8063    /// # Example
8064    /// ```ignore,no_run
8065    /// # use google_cloud_bigquery_analyticshub_v1::model::DeadLetterPolicy;
8066    /// let x = DeadLetterPolicy::new().set_max_delivery_attempts(42);
8067    /// ```
8068    pub fn set_max_delivery_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8069        self.max_delivery_attempts = v.into();
8070        self
8071    }
8072}
8073
8074impl wkt::message::Message for DeadLetterPolicy {
8075    fn typename() -> &'static str {
8076        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeadLetterPolicy"
8077    }
8078}
8079
8080/// A policy that specifies the conditions for resource expiration (i.e.,
8081/// automatic resource deletion).
8082#[derive(Clone, Default, PartialEq)]
8083#[non_exhaustive]
8084pub struct ExpirationPolicy {
8085    /// Optional. Specifies the "time-to-live" duration for an associated resource.
8086    /// The resource expires if it is not active for a period of `ttl`. The
8087    /// definition of "activity" depends on the type of the associated resource.
8088    /// The minimum and maximum allowed values for `ttl` depend on the type of the
8089    /// associated resource, as well. If `ttl` is not set, the associated resource
8090    /// never expires.
8091    pub ttl: std::option::Option<wkt::Duration>,
8092
8093    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8094}
8095
8096impl ExpirationPolicy {
8097    pub fn new() -> Self {
8098        std::default::Default::default()
8099    }
8100
8101    /// Sets the value of [ttl][crate::model::ExpirationPolicy::ttl].
8102    ///
8103    /// # Example
8104    /// ```ignore,no_run
8105    /// # use google_cloud_bigquery_analyticshub_v1::model::ExpirationPolicy;
8106    /// use wkt::Duration;
8107    /// let x = ExpirationPolicy::new().set_ttl(Duration::default()/* use setters */);
8108    /// ```
8109    pub fn set_ttl<T>(mut self, v: T) -> Self
8110    where
8111        T: std::convert::Into<wkt::Duration>,
8112    {
8113        self.ttl = std::option::Option::Some(v.into());
8114        self
8115    }
8116
8117    /// Sets or clears the value of [ttl][crate::model::ExpirationPolicy::ttl].
8118    ///
8119    /// # Example
8120    /// ```ignore,no_run
8121    /// # use google_cloud_bigquery_analyticshub_v1::model::ExpirationPolicy;
8122    /// use wkt::Duration;
8123    /// let x = ExpirationPolicy::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
8124    /// let x = ExpirationPolicy::new().set_or_clear_ttl(None::<Duration>);
8125    /// ```
8126    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
8127    where
8128        T: std::convert::Into<wkt::Duration>,
8129    {
8130        self.ttl = v.map(|x| x.into());
8131        self
8132    }
8133}
8134
8135impl wkt::message::Message for ExpirationPolicy {
8136    fn typename() -> &'static str {
8137        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ExpirationPolicy"
8138    }
8139}
8140
8141/// Configuration for a push delivery endpoint.
8142#[derive(Clone, Default, PartialEq)]
8143#[non_exhaustive]
8144pub struct PushConfig {
8145    /// Optional. A URL locating the endpoint to which messages should be pushed.
8146    /// For example, a Webhook endpoint might use `<https://example.com/push>`.
8147    pub push_endpoint: std::string::String,
8148
8149    /// Optional. Endpoint configuration attributes that can be used to control
8150    /// different aspects of the message delivery.
8151    ///
8152    /// The only currently supported attribute is `x-goog-version`, which you can
8153    /// use to change the format of the pushed message. This attribute
8154    /// indicates the version of the data expected by the endpoint. This
8155    /// controls the shape of the pushed message (i.e., its fields and metadata).
8156    ///
8157    /// If not present during the `CreateSubscription` call, it will default to
8158    /// the version of the Pub/Sub API used to make such call. If not present in a
8159    /// `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
8160    /// calls will always return a valid version, even if the subscription was
8161    /// created without this attribute.
8162    ///
8163    /// The only supported values for the `x-goog-version` attribute are:
8164    ///
8165    /// * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
8166    /// * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
8167    ///
8168    /// For example:
8169    /// `attributes { "x-goog-version": "v1" }`
8170    pub attributes: std::collections::HashMap<std::string::String, std::string::String>,
8171
8172    /// An authentication method used by push endpoints to verify the source of
8173    /// push requests. This can be used with push endpoints that are private by
8174    /// default to allow requests only from the Pub/Sub system, for example.
8175    /// This field is optional and should be set only by users interested in
8176    /// authenticated push.
8177    pub authentication_method: std::option::Option<crate::model::push_config::AuthenticationMethod>,
8178
8179    /// The format of the delivered message to the push endpoint is defined by
8180    /// the chosen wrapper. When unset, `PubsubWrapper` is used.
8181    pub wrapper: std::option::Option<crate::model::push_config::Wrapper>,
8182
8183    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8184}
8185
8186impl PushConfig {
8187    pub fn new() -> Self {
8188        std::default::Default::default()
8189    }
8190
8191    /// Sets the value of [push_endpoint][crate::model::PushConfig::push_endpoint].
8192    ///
8193    /// # Example
8194    /// ```ignore,no_run
8195    /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8196    /// let x = PushConfig::new().set_push_endpoint("example");
8197    /// ```
8198    pub fn set_push_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8199        self.push_endpoint = v.into();
8200        self
8201    }
8202
8203    /// Sets the value of [attributes][crate::model::PushConfig::attributes].
8204    ///
8205    /// # Example
8206    /// ```ignore,no_run
8207    /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8208    /// let x = PushConfig::new().set_attributes([
8209    ///     ("key0", "abc"),
8210    ///     ("key1", "xyz"),
8211    /// ]);
8212    /// ```
8213    pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
8214    where
8215        T: std::iter::IntoIterator<Item = (K, V)>,
8216        K: std::convert::Into<std::string::String>,
8217        V: std::convert::Into<std::string::String>,
8218    {
8219        use std::iter::Iterator;
8220        self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8221        self
8222    }
8223
8224    /// Sets the value of [authentication_method][crate::model::PushConfig::authentication_method].
8225    ///
8226    /// Note that all the setters affecting `authentication_method` are mutually
8227    /// exclusive.
8228    ///
8229    /// # Example
8230    /// ```ignore,no_run
8231    /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8232    /// use google_cloud_bigquery_analyticshub_v1::model::push_config::OidcToken;
8233    /// let x = PushConfig::new().set_authentication_method(Some(
8234    ///     google_cloud_bigquery_analyticshub_v1::model::push_config::AuthenticationMethod::OidcToken(OidcToken::default().into())));
8235    /// ```
8236    pub fn set_authentication_method<
8237        T: std::convert::Into<std::option::Option<crate::model::push_config::AuthenticationMethod>>,
8238    >(
8239        mut self,
8240        v: T,
8241    ) -> Self {
8242        self.authentication_method = v.into();
8243        self
8244    }
8245
8246    /// The value of [authentication_method][crate::model::PushConfig::authentication_method]
8247    /// if it holds a `OidcToken`, `None` if the field is not set or
8248    /// holds a different branch.
8249    pub fn oidc_token(
8250        &self,
8251    ) -> std::option::Option<&std::boxed::Box<crate::model::push_config::OidcToken>> {
8252        #[allow(unreachable_patterns)]
8253        self.authentication_method.as_ref().and_then(|v| match v {
8254            crate::model::push_config::AuthenticationMethod::OidcToken(v) => {
8255                std::option::Option::Some(v)
8256            }
8257            _ => std::option::Option::None,
8258        })
8259    }
8260
8261    /// Sets the value of [authentication_method][crate::model::PushConfig::authentication_method]
8262    /// to hold a `OidcToken`.
8263    ///
8264    /// Note that all the setters affecting `authentication_method` are
8265    /// mutually exclusive.
8266    ///
8267    /// # Example
8268    /// ```ignore,no_run
8269    /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8270    /// use google_cloud_bigquery_analyticshub_v1::model::push_config::OidcToken;
8271    /// let x = PushConfig::new().set_oidc_token(OidcToken::default()/* use setters */);
8272    /// assert!(x.oidc_token().is_some());
8273    /// ```
8274    pub fn set_oidc_token<
8275        T: std::convert::Into<std::boxed::Box<crate::model::push_config::OidcToken>>,
8276    >(
8277        mut self,
8278        v: T,
8279    ) -> Self {
8280        self.authentication_method = std::option::Option::Some(
8281            crate::model::push_config::AuthenticationMethod::OidcToken(v.into()),
8282        );
8283        self
8284    }
8285
8286    /// Sets the value of [wrapper][crate::model::PushConfig::wrapper].
8287    ///
8288    /// Note that all the setters affecting `wrapper` are mutually
8289    /// exclusive.
8290    ///
8291    /// # Example
8292    /// ```ignore,no_run
8293    /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8294    /// use google_cloud_bigquery_analyticshub_v1::model::push_config::PubsubWrapper;
8295    /// let x = PushConfig::new().set_wrapper(Some(
8296    ///     google_cloud_bigquery_analyticshub_v1::model::push_config::Wrapper::PubsubWrapper(PubsubWrapper::default().into())));
8297    /// ```
8298    pub fn set_wrapper<
8299        T: std::convert::Into<std::option::Option<crate::model::push_config::Wrapper>>,
8300    >(
8301        mut self,
8302        v: T,
8303    ) -> Self {
8304        self.wrapper = v.into();
8305        self
8306    }
8307
8308    /// The value of [wrapper][crate::model::PushConfig::wrapper]
8309    /// if it holds a `PubsubWrapper`, `None` if the field is not set or
8310    /// holds a different branch.
8311    pub fn pubsub_wrapper(
8312        &self,
8313    ) -> std::option::Option<&std::boxed::Box<crate::model::push_config::PubsubWrapper>> {
8314        #[allow(unreachable_patterns)]
8315        self.wrapper.as_ref().and_then(|v| match v {
8316            crate::model::push_config::Wrapper::PubsubWrapper(v) => std::option::Option::Some(v),
8317            _ => std::option::Option::None,
8318        })
8319    }
8320
8321    /// Sets the value of [wrapper][crate::model::PushConfig::wrapper]
8322    /// to hold a `PubsubWrapper`.
8323    ///
8324    /// Note that all the setters affecting `wrapper` are
8325    /// mutually exclusive.
8326    ///
8327    /// # Example
8328    /// ```ignore,no_run
8329    /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8330    /// use google_cloud_bigquery_analyticshub_v1::model::push_config::PubsubWrapper;
8331    /// let x = PushConfig::new().set_pubsub_wrapper(PubsubWrapper::default()/* use setters */);
8332    /// assert!(x.pubsub_wrapper().is_some());
8333    /// assert!(x.no_wrapper().is_none());
8334    /// ```
8335    pub fn set_pubsub_wrapper<
8336        T: std::convert::Into<std::boxed::Box<crate::model::push_config::PubsubWrapper>>,
8337    >(
8338        mut self,
8339        v: T,
8340    ) -> Self {
8341        self.wrapper =
8342            std::option::Option::Some(crate::model::push_config::Wrapper::PubsubWrapper(v.into()));
8343        self
8344    }
8345
8346    /// The value of [wrapper][crate::model::PushConfig::wrapper]
8347    /// if it holds a `NoWrapper`, `None` if the field is not set or
8348    /// holds a different branch.
8349    pub fn no_wrapper(
8350        &self,
8351    ) -> std::option::Option<&std::boxed::Box<crate::model::push_config::NoWrapper>> {
8352        #[allow(unreachable_patterns)]
8353        self.wrapper.as_ref().and_then(|v| match v {
8354            crate::model::push_config::Wrapper::NoWrapper(v) => std::option::Option::Some(v),
8355            _ => std::option::Option::None,
8356        })
8357    }
8358
8359    /// Sets the value of [wrapper][crate::model::PushConfig::wrapper]
8360    /// to hold a `NoWrapper`.
8361    ///
8362    /// Note that all the setters affecting `wrapper` are
8363    /// mutually exclusive.
8364    ///
8365    /// # Example
8366    /// ```ignore,no_run
8367    /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8368    /// use google_cloud_bigquery_analyticshub_v1::model::push_config::NoWrapper;
8369    /// let x = PushConfig::new().set_no_wrapper(NoWrapper::default()/* use setters */);
8370    /// assert!(x.no_wrapper().is_some());
8371    /// assert!(x.pubsub_wrapper().is_none());
8372    /// ```
8373    pub fn set_no_wrapper<
8374        T: std::convert::Into<std::boxed::Box<crate::model::push_config::NoWrapper>>,
8375    >(
8376        mut self,
8377        v: T,
8378    ) -> Self {
8379        self.wrapper =
8380            std::option::Option::Some(crate::model::push_config::Wrapper::NoWrapper(v.into()));
8381        self
8382    }
8383}
8384
8385impl wkt::message::Message for PushConfig {
8386    fn typename() -> &'static str {
8387        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig"
8388    }
8389}
8390
8391/// Defines additional types related to [PushConfig].
8392pub mod push_config {
8393    #[allow(unused_imports)]
8394    use super::*;
8395
8396    /// Contains information needed for generating an
8397    /// [OpenID Connect
8398    /// token](https://developers.google.com/identity/protocols/OpenIDConnect).
8399    #[derive(Clone, Default, PartialEq)]
8400    #[non_exhaustive]
8401    pub struct OidcToken {
8402        /// Optional. [Service account
8403        /// email](https://cloud.google.com/iam/docs/service-accounts)
8404        /// used for generating the OIDC token. For more information
8405        /// on setting up authentication, see
8406        /// [Push subscriptions](https://cloud.google.com/pubsub/docs/push).
8407        pub service_account_email: std::string::String,
8408
8409        /// Optional. Audience to be used when generating OIDC token. The audience
8410        /// claim identifies the recipients that the JWT is intended for. The
8411        /// audience value is a single case-sensitive string. Having multiple values
8412        /// (array) for the audience field is not supported. More info about the OIDC
8413        /// JWT token audience here:
8414        /// <https://tools.ietf.org/html/rfc7519#section-4.1.3> Note: if not specified,
8415        /// the Push endpoint URL will be used.
8416        pub audience: std::string::String,
8417
8418        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8419    }
8420
8421    impl OidcToken {
8422        pub fn new() -> Self {
8423            std::default::Default::default()
8424        }
8425
8426        /// Sets the value of [service_account_email][crate::model::push_config::OidcToken::service_account_email].
8427        ///
8428        /// # Example
8429        /// ```ignore,no_run
8430        /// # use google_cloud_bigquery_analyticshub_v1::model::push_config::OidcToken;
8431        /// let x = OidcToken::new().set_service_account_email("example");
8432        /// ```
8433        pub fn set_service_account_email<T: std::convert::Into<std::string::String>>(
8434            mut self,
8435            v: T,
8436        ) -> Self {
8437            self.service_account_email = v.into();
8438            self
8439        }
8440
8441        /// Sets the value of [audience][crate::model::push_config::OidcToken::audience].
8442        ///
8443        /// # Example
8444        /// ```ignore,no_run
8445        /// # use google_cloud_bigquery_analyticshub_v1::model::push_config::OidcToken;
8446        /// let x = OidcToken::new().set_audience("example");
8447        /// ```
8448        pub fn set_audience<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8449            self.audience = v.into();
8450            self
8451        }
8452    }
8453
8454    impl wkt::message::Message for OidcToken {
8455        fn typename() -> &'static str {
8456            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig.OidcToken"
8457        }
8458    }
8459
8460    /// The payload to the push endpoint is in the form of the JSON representation
8461    /// of a PubsubMessage
8462    /// (<https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage>).
8463    #[derive(Clone, Default, PartialEq)]
8464    #[non_exhaustive]
8465    pub struct PubsubWrapper {
8466        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8467    }
8468
8469    impl PubsubWrapper {
8470        pub fn new() -> Self {
8471            std::default::Default::default()
8472        }
8473    }
8474
8475    impl wkt::message::Message for PubsubWrapper {
8476        fn typename() -> &'static str {
8477            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig.PubsubWrapper"
8478        }
8479    }
8480
8481    /// Sets the `data` field as the HTTP body for delivery.
8482    #[derive(Clone, Default, PartialEq)]
8483    #[non_exhaustive]
8484    pub struct NoWrapper {
8485        /// Optional. When true, writes the Pub/Sub message metadata to
8486        /// `x-goog-pubsub-<KEY>:<VAL>` headers of the HTTP request. Writes the
8487        /// Pub/Sub message attributes to `<KEY>:<VAL>` headers of the HTTP request.
8488        pub write_metadata: bool,
8489
8490        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8491    }
8492
8493    impl NoWrapper {
8494        pub fn new() -> Self {
8495            std::default::Default::default()
8496        }
8497
8498        /// Sets the value of [write_metadata][crate::model::push_config::NoWrapper::write_metadata].
8499        ///
8500        /// # Example
8501        /// ```ignore,no_run
8502        /// # use google_cloud_bigquery_analyticshub_v1::model::push_config::NoWrapper;
8503        /// let x = NoWrapper::new().set_write_metadata(true);
8504        /// ```
8505        pub fn set_write_metadata<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8506            self.write_metadata = v.into();
8507            self
8508        }
8509    }
8510
8511    impl wkt::message::Message for NoWrapper {
8512        fn typename() -> &'static str {
8513            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig.NoWrapper"
8514        }
8515    }
8516
8517    /// An authentication method used by push endpoints to verify the source of
8518    /// push requests. This can be used with push endpoints that are private by
8519    /// default to allow requests only from the Pub/Sub system, for example.
8520    /// This field is optional and should be set only by users interested in
8521    /// authenticated push.
8522    #[derive(Clone, Debug, PartialEq)]
8523    #[non_exhaustive]
8524    pub enum AuthenticationMethod {
8525        /// Optional. If specified, Pub/Sub will generate and attach an OIDC JWT
8526        /// token as an `Authorization` header in the HTTP request for every pushed
8527        /// message.
8528        OidcToken(std::boxed::Box<crate::model::push_config::OidcToken>),
8529    }
8530
8531    /// The format of the delivered message to the push endpoint is defined by
8532    /// the chosen wrapper. When unset, `PubsubWrapper` is used.
8533    #[derive(Clone, Debug, PartialEq)]
8534    #[non_exhaustive]
8535    pub enum Wrapper {
8536        /// Optional. When set, the payload to the push endpoint is in the form of
8537        /// the JSON representation of a PubsubMessage
8538        /// (<https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage>).
8539        PubsubWrapper(std::boxed::Box<crate::model::push_config::PubsubWrapper>),
8540        /// Optional. When set, the payload to the push endpoint is not wrapped.
8541        NoWrapper(std::boxed::Box<crate::model::push_config::NoWrapper>),
8542    }
8543}
8544
8545/// Configuration for a BigQuery subscription.
8546#[derive(Clone, Default, PartialEq)]
8547#[non_exhaustive]
8548pub struct BigQueryConfig {
8549    /// Optional. The name of the table to which to write data, of the form
8550    /// {projectId}.{datasetId}.{tableId}
8551    pub table: std::string::String,
8552
8553    /// Optional. When true, use the topic's schema as the columns to write to in
8554    /// BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
8555    /// enabled at the same time.
8556    pub use_topic_schema: bool,
8557
8558    /// Optional. When true, write the subscription name, message_id, publish_time,
8559    /// attributes, and ordering_key to additional columns in the table. The
8560    /// subscription name, message_id, and publish_time fields are put in their own
8561    /// columns while all other message properties (other than data) are written to
8562    /// a JSON object in the attributes column.
8563    pub write_metadata: bool,
8564
8565    /// Optional. When true and use_topic_schema is true, any fields that are a
8566    /// part of the topic schema that are not part of the BigQuery table schema are
8567    /// dropped when writing to BigQuery. Otherwise, the schemas must be kept in
8568    /// sync and any messages with extra fields are not written and remain in the
8569    /// subscription's backlog.
8570    pub drop_unknown_fields: bool,
8571
8572    /// Optional. When true, use the BigQuery table's schema as the columns to
8573    /// write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
8574    /// enabled at the same time.
8575    pub use_table_schema: bool,
8576
8577    /// Optional. The service account to use to write to BigQuery. The subscription
8578    /// creator or updater that specifies this field must have
8579    /// `iam.serviceAccounts.actAs` permission on the service account. If not
8580    /// specified, the Pub/Sub [service
8581    /// agent](https://cloud.google.com/iam/docs/service-agents),
8582    /// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
8583    pub service_account_email: std::string::String,
8584
8585    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8586}
8587
8588impl BigQueryConfig {
8589    pub fn new() -> Self {
8590        std::default::Default::default()
8591    }
8592
8593    /// Sets the value of [table][crate::model::BigQueryConfig::table].
8594    ///
8595    /// # Example
8596    /// ```ignore,no_run
8597    /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8598    /// let x = BigQueryConfig::new().set_table("example");
8599    /// ```
8600    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8601        self.table = v.into();
8602        self
8603    }
8604
8605    /// Sets the value of [use_topic_schema][crate::model::BigQueryConfig::use_topic_schema].
8606    ///
8607    /// # Example
8608    /// ```ignore,no_run
8609    /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8610    /// let x = BigQueryConfig::new().set_use_topic_schema(true);
8611    /// ```
8612    pub fn set_use_topic_schema<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8613        self.use_topic_schema = v.into();
8614        self
8615    }
8616
8617    /// Sets the value of [write_metadata][crate::model::BigQueryConfig::write_metadata].
8618    ///
8619    /// # Example
8620    /// ```ignore,no_run
8621    /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8622    /// let x = BigQueryConfig::new().set_write_metadata(true);
8623    /// ```
8624    pub fn set_write_metadata<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8625        self.write_metadata = v.into();
8626        self
8627    }
8628
8629    /// Sets the value of [drop_unknown_fields][crate::model::BigQueryConfig::drop_unknown_fields].
8630    ///
8631    /// # Example
8632    /// ```ignore,no_run
8633    /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8634    /// let x = BigQueryConfig::new().set_drop_unknown_fields(true);
8635    /// ```
8636    pub fn set_drop_unknown_fields<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8637        self.drop_unknown_fields = v.into();
8638        self
8639    }
8640
8641    /// Sets the value of [use_table_schema][crate::model::BigQueryConfig::use_table_schema].
8642    ///
8643    /// # Example
8644    /// ```ignore,no_run
8645    /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8646    /// let x = BigQueryConfig::new().set_use_table_schema(true);
8647    /// ```
8648    pub fn set_use_table_schema<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8649        self.use_table_schema = v.into();
8650        self
8651    }
8652
8653    /// Sets the value of [service_account_email][crate::model::BigQueryConfig::service_account_email].
8654    ///
8655    /// # Example
8656    /// ```ignore,no_run
8657    /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8658    /// let x = BigQueryConfig::new().set_service_account_email("example");
8659    /// ```
8660    pub fn set_service_account_email<T: std::convert::Into<std::string::String>>(
8661        mut self,
8662        v: T,
8663    ) -> Self {
8664        self.service_account_email = v.into();
8665        self
8666    }
8667}
8668
8669impl wkt::message::Message for BigQueryConfig {
8670    fn typename() -> &'static str {
8671        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.BigQueryConfig"
8672    }
8673}
8674
8675/// Configuration for a Cloud Storage subscription.
8676#[derive(Clone, Default, PartialEq)]
8677#[non_exhaustive]
8678pub struct CloudStorageConfig {
8679    /// Required. User-provided name for the Cloud Storage bucket.
8680    /// The bucket must be created by the user. The bucket name must be without
8681    /// any prefix like "gs://". See the [bucket naming
8682    /// requirements] (<https://cloud.google.com/storage/docs/buckets#naming>).
8683    pub bucket: std::string::String,
8684
8685    /// Optional. User-provided prefix for Cloud Storage filename. See the [object
8686    /// naming requirements](https://cloud.google.com/storage/docs/objects#naming).
8687    pub filename_prefix: std::string::String,
8688
8689    /// Optional. User-provided suffix for Cloud Storage filename. See the [object
8690    /// naming requirements](https://cloud.google.com/storage/docs/objects#naming).
8691    /// Must not end in "/".
8692    pub filename_suffix: std::string::String,
8693
8694    /// Optional. User-provided format string specifying how to represent datetimes
8695    /// in Cloud Storage filenames. See the [datetime format
8696    /// guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names).
8697    pub filename_datetime_format: std::string::String,
8698
8699    /// Optional. File batching settings.
8700    /// If no max_duration setting is specified, a max_duration of 5 minutes will
8701    /// be set by default. max_duration is required regardless of whether other
8702    /// file batching settings are specified.
8703    ///
8704    /// The maximum duration that can elapse before a new Cloud Storage file is
8705    /// created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
8706    /// the subscription's acknowledgement deadline.
8707    pub max_duration: std::option::Option<wkt::Duration>,
8708
8709    /// Optional. The maximum bytes that can be written to a Cloud Storage file
8710    /// before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may
8711    /// be exceeded in cases where messages are larger than the limit.
8712    pub max_bytes: i64,
8713
8714    /// Optional. The maximum number of messages that can be written to a Cloud
8715    /// Storage file before a new file is created. Min 1000 messages.
8716    pub max_messages: i64,
8717
8718    /// Optional. The service account to use to write to Cloud Storage. The
8719    /// subscription creator or updater that specifies this field must have
8720    /// `iam.serviceAccounts.actAs` permission on the service account. If not
8721    /// specified, the Pub/Sub
8722    /// [service agent](https://cloud.google.com/iam/docs/service-agents),
8723    /// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
8724    pub service_account_email: std::string::String,
8725
8726    /// Defaults to text format.
8727    pub output_format: std::option::Option<crate::model::cloud_storage_config::OutputFormat>,
8728
8729    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8730}
8731
8732impl CloudStorageConfig {
8733    pub fn new() -> Self {
8734        std::default::Default::default()
8735    }
8736
8737    /// Sets the value of [bucket][crate::model::CloudStorageConfig::bucket].
8738    ///
8739    /// # Example
8740    /// ```ignore,no_run
8741    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8742    /// let x = CloudStorageConfig::new().set_bucket("example");
8743    /// ```
8744    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8745        self.bucket = v.into();
8746        self
8747    }
8748
8749    /// Sets the value of [filename_prefix][crate::model::CloudStorageConfig::filename_prefix].
8750    ///
8751    /// # Example
8752    /// ```ignore,no_run
8753    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8754    /// let x = CloudStorageConfig::new().set_filename_prefix("example");
8755    /// ```
8756    pub fn set_filename_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8757        self.filename_prefix = v.into();
8758        self
8759    }
8760
8761    /// Sets the value of [filename_suffix][crate::model::CloudStorageConfig::filename_suffix].
8762    ///
8763    /// # Example
8764    /// ```ignore,no_run
8765    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8766    /// let x = CloudStorageConfig::new().set_filename_suffix("example");
8767    /// ```
8768    pub fn set_filename_suffix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8769        self.filename_suffix = v.into();
8770        self
8771    }
8772
8773    /// Sets the value of [filename_datetime_format][crate::model::CloudStorageConfig::filename_datetime_format].
8774    ///
8775    /// # Example
8776    /// ```ignore,no_run
8777    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8778    /// let x = CloudStorageConfig::new().set_filename_datetime_format("example");
8779    /// ```
8780    pub fn set_filename_datetime_format<T: std::convert::Into<std::string::String>>(
8781        mut self,
8782        v: T,
8783    ) -> Self {
8784        self.filename_datetime_format = v.into();
8785        self
8786    }
8787
8788    /// Sets the value of [max_duration][crate::model::CloudStorageConfig::max_duration].
8789    ///
8790    /// # Example
8791    /// ```ignore,no_run
8792    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8793    /// use wkt::Duration;
8794    /// let x = CloudStorageConfig::new().set_max_duration(Duration::default()/* use setters */);
8795    /// ```
8796    pub fn set_max_duration<T>(mut self, v: T) -> Self
8797    where
8798        T: std::convert::Into<wkt::Duration>,
8799    {
8800        self.max_duration = std::option::Option::Some(v.into());
8801        self
8802    }
8803
8804    /// Sets or clears the value of [max_duration][crate::model::CloudStorageConfig::max_duration].
8805    ///
8806    /// # Example
8807    /// ```ignore,no_run
8808    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8809    /// use wkt::Duration;
8810    /// let x = CloudStorageConfig::new().set_or_clear_max_duration(Some(Duration::default()/* use setters */));
8811    /// let x = CloudStorageConfig::new().set_or_clear_max_duration(None::<Duration>);
8812    /// ```
8813    pub fn set_or_clear_max_duration<T>(mut self, v: std::option::Option<T>) -> Self
8814    where
8815        T: std::convert::Into<wkt::Duration>,
8816    {
8817        self.max_duration = v.map(|x| x.into());
8818        self
8819    }
8820
8821    /// Sets the value of [max_bytes][crate::model::CloudStorageConfig::max_bytes].
8822    ///
8823    /// # Example
8824    /// ```ignore,no_run
8825    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8826    /// let x = CloudStorageConfig::new().set_max_bytes(42);
8827    /// ```
8828    pub fn set_max_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8829        self.max_bytes = v.into();
8830        self
8831    }
8832
8833    /// Sets the value of [max_messages][crate::model::CloudStorageConfig::max_messages].
8834    ///
8835    /// # Example
8836    /// ```ignore,no_run
8837    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8838    /// let x = CloudStorageConfig::new().set_max_messages(42);
8839    /// ```
8840    pub fn set_max_messages<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8841        self.max_messages = v.into();
8842        self
8843    }
8844
8845    /// Sets the value of [service_account_email][crate::model::CloudStorageConfig::service_account_email].
8846    ///
8847    /// # Example
8848    /// ```ignore,no_run
8849    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8850    /// let x = CloudStorageConfig::new().set_service_account_email("example");
8851    /// ```
8852    pub fn set_service_account_email<T: std::convert::Into<std::string::String>>(
8853        mut self,
8854        v: T,
8855    ) -> Self {
8856        self.service_account_email = v.into();
8857        self
8858    }
8859
8860    /// Sets the value of [output_format][crate::model::CloudStorageConfig::output_format].
8861    ///
8862    /// Note that all the setters affecting `output_format` are mutually
8863    /// exclusive.
8864    ///
8865    /// # Example
8866    /// ```ignore,no_run
8867    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8868    /// use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::TextConfig;
8869    /// let x = CloudStorageConfig::new().set_output_format(Some(
8870    ///     google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::OutputFormat::TextConfig(TextConfig::default().into())));
8871    /// ```
8872    pub fn set_output_format<
8873        T: std::convert::Into<std::option::Option<crate::model::cloud_storage_config::OutputFormat>>,
8874    >(
8875        mut self,
8876        v: T,
8877    ) -> Self {
8878        self.output_format = v.into();
8879        self
8880    }
8881
8882    /// The value of [output_format][crate::model::CloudStorageConfig::output_format]
8883    /// if it holds a `TextConfig`, `None` if the field is not set or
8884    /// holds a different branch.
8885    pub fn text_config(
8886        &self,
8887    ) -> std::option::Option<&std::boxed::Box<crate::model::cloud_storage_config::TextConfig>> {
8888        #[allow(unreachable_patterns)]
8889        self.output_format.as_ref().and_then(|v| match v {
8890            crate::model::cloud_storage_config::OutputFormat::TextConfig(v) => {
8891                std::option::Option::Some(v)
8892            }
8893            _ => std::option::Option::None,
8894        })
8895    }
8896
8897    /// Sets the value of [output_format][crate::model::CloudStorageConfig::output_format]
8898    /// to hold a `TextConfig`.
8899    ///
8900    /// Note that all the setters affecting `output_format` are
8901    /// mutually exclusive.
8902    ///
8903    /// # Example
8904    /// ```ignore,no_run
8905    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8906    /// use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::TextConfig;
8907    /// let x = CloudStorageConfig::new().set_text_config(TextConfig::default()/* use setters */);
8908    /// assert!(x.text_config().is_some());
8909    /// assert!(x.avro_config().is_none());
8910    /// ```
8911    pub fn set_text_config<
8912        T: std::convert::Into<std::boxed::Box<crate::model::cloud_storage_config::TextConfig>>,
8913    >(
8914        mut self,
8915        v: T,
8916    ) -> Self {
8917        self.output_format = std::option::Option::Some(
8918            crate::model::cloud_storage_config::OutputFormat::TextConfig(v.into()),
8919        );
8920        self
8921    }
8922
8923    /// The value of [output_format][crate::model::CloudStorageConfig::output_format]
8924    /// if it holds a `AvroConfig`, `None` if the field is not set or
8925    /// holds a different branch.
8926    pub fn avro_config(
8927        &self,
8928    ) -> std::option::Option<&std::boxed::Box<crate::model::cloud_storage_config::AvroConfig>> {
8929        #[allow(unreachable_patterns)]
8930        self.output_format.as_ref().and_then(|v| match v {
8931            crate::model::cloud_storage_config::OutputFormat::AvroConfig(v) => {
8932                std::option::Option::Some(v)
8933            }
8934            _ => std::option::Option::None,
8935        })
8936    }
8937
8938    /// Sets the value of [output_format][crate::model::CloudStorageConfig::output_format]
8939    /// to hold a `AvroConfig`.
8940    ///
8941    /// Note that all the setters affecting `output_format` are
8942    /// mutually exclusive.
8943    ///
8944    /// # Example
8945    /// ```ignore,no_run
8946    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8947    /// use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::AvroConfig;
8948    /// let x = CloudStorageConfig::new().set_avro_config(AvroConfig::default()/* use setters */);
8949    /// assert!(x.avro_config().is_some());
8950    /// assert!(x.text_config().is_none());
8951    /// ```
8952    pub fn set_avro_config<
8953        T: std::convert::Into<std::boxed::Box<crate::model::cloud_storage_config::AvroConfig>>,
8954    >(
8955        mut self,
8956        v: T,
8957    ) -> Self {
8958        self.output_format = std::option::Option::Some(
8959            crate::model::cloud_storage_config::OutputFormat::AvroConfig(v.into()),
8960        );
8961        self
8962    }
8963}
8964
8965impl wkt::message::Message for CloudStorageConfig {
8966    fn typename() -> &'static str {
8967        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CloudStorageConfig"
8968    }
8969}
8970
8971/// Defines additional types related to [CloudStorageConfig].
8972pub mod cloud_storage_config {
8973    #[allow(unused_imports)]
8974    use super::*;
8975
8976    /// Configuration for writing message data in text format.
8977    /// Message payloads will be written to files as raw text, separated by a
8978    /// newline.
8979    #[derive(Clone, Default, PartialEq)]
8980    #[non_exhaustive]
8981    pub struct TextConfig {
8982        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8983    }
8984
8985    impl TextConfig {
8986        pub fn new() -> Self {
8987            std::default::Default::default()
8988        }
8989    }
8990
8991    impl wkt::message::Message for TextConfig {
8992        fn typename() -> &'static str {
8993            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CloudStorageConfig.TextConfig"
8994        }
8995    }
8996
8997    /// Configuration for writing message data in Avro format.
8998    /// Message payloads and metadata will be written to files as an Avro binary.
8999    #[derive(Clone, Default, PartialEq)]
9000    #[non_exhaustive]
9001    pub struct AvroConfig {
9002        /// Optional. When true, write the subscription name, message_id,
9003        /// publish_time, attributes, and ordering_key as additional fields in the
9004        /// output. The subscription name, message_id, and publish_time fields are
9005        /// put in their own fields while all other message properties other than
9006        /// data (for example, an ordering_key, if present) are added as entries in
9007        /// the attributes map.
9008        pub write_metadata: bool,
9009
9010        /// Optional. When true, the output Cloud Storage file will be serialized
9011        /// using the topic schema, if it exists.
9012        pub use_topic_schema: bool,
9013
9014        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9015    }
9016
9017    impl AvroConfig {
9018        pub fn new() -> Self {
9019            std::default::Default::default()
9020        }
9021
9022        /// Sets the value of [write_metadata][crate::model::cloud_storage_config::AvroConfig::write_metadata].
9023        ///
9024        /// # Example
9025        /// ```ignore,no_run
9026        /// # use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::AvroConfig;
9027        /// let x = AvroConfig::new().set_write_metadata(true);
9028        /// ```
9029        pub fn set_write_metadata<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9030            self.write_metadata = v.into();
9031            self
9032        }
9033
9034        /// Sets the value of [use_topic_schema][crate::model::cloud_storage_config::AvroConfig::use_topic_schema].
9035        ///
9036        /// # Example
9037        /// ```ignore,no_run
9038        /// # use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::AvroConfig;
9039        /// let x = AvroConfig::new().set_use_topic_schema(true);
9040        /// ```
9041        pub fn set_use_topic_schema<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9042            self.use_topic_schema = v.into();
9043            self
9044        }
9045    }
9046
9047    impl wkt::message::Message for AvroConfig {
9048        fn typename() -> &'static str {
9049            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CloudStorageConfig.AvroConfig"
9050        }
9051    }
9052
9053    /// Defaults to text format.
9054    #[derive(Clone, Debug, PartialEq)]
9055    #[non_exhaustive]
9056    pub enum OutputFormat {
9057        /// Optional. If set, message data will be written to Cloud Storage in text
9058        /// format.
9059        TextConfig(std::boxed::Box<crate::model::cloud_storage_config::TextConfig>),
9060        /// Optional. If set, message data will be written to Cloud Storage in Avro
9061        /// format.
9062        AvroConfig(std::boxed::Box<crate::model::cloud_storage_config::AvroConfig>),
9063    }
9064}
9065
9066/// All supported message transforms types.
9067#[derive(Clone, Default, PartialEq)]
9068#[non_exhaustive]
9069pub struct MessageTransform {
9070    /// Optional. This field is deprecated, use the `disabled` field to disable
9071    /// transforms.
9072    #[deprecated]
9073    pub enabled: bool,
9074
9075    /// Optional. If true, the transform is disabled and will not be applied to
9076    /// messages. Defaults to `false`.
9077    pub disabled: bool,
9078
9079    /// The type of transform to apply to messages.
9080    pub transform: std::option::Option<crate::model::message_transform::Transform>,
9081
9082    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9083}
9084
9085impl MessageTransform {
9086    pub fn new() -> Self {
9087        std::default::Default::default()
9088    }
9089
9090    /// Sets the value of [enabled][crate::model::MessageTransform::enabled].
9091    ///
9092    /// # Example
9093    /// ```ignore,no_run
9094    /// # use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
9095    /// let x = MessageTransform::new().set_enabled(true);
9096    /// ```
9097    #[deprecated]
9098    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9099        self.enabled = v.into();
9100        self
9101    }
9102
9103    /// Sets the value of [disabled][crate::model::MessageTransform::disabled].
9104    ///
9105    /// # Example
9106    /// ```ignore,no_run
9107    /// # use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
9108    /// let x = MessageTransform::new().set_disabled(true);
9109    /// ```
9110    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9111        self.disabled = v.into();
9112        self
9113    }
9114
9115    /// Sets the value of [transform][crate::model::MessageTransform::transform].
9116    ///
9117    /// Note that all the setters affecting `transform` are mutually
9118    /// exclusive.
9119    ///
9120    /// # Example
9121    /// ```ignore,no_run
9122    /// # use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
9123    /// use google_cloud_bigquery_analyticshub_v1::model::JavaScriptUDF;
9124    /// let x = MessageTransform::new().set_transform(Some(
9125    ///     google_cloud_bigquery_analyticshub_v1::model::message_transform::Transform::JavascriptUdf(JavaScriptUDF::default().into())));
9126    /// ```
9127    pub fn set_transform<
9128        T: std::convert::Into<std::option::Option<crate::model::message_transform::Transform>>,
9129    >(
9130        mut self,
9131        v: T,
9132    ) -> Self {
9133        self.transform = v.into();
9134        self
9135    }
9136
9137    /// The value of [transform][crate::model::MessageTransform::transform]
9138    /// if it holds a `JavascriptUdf`, `None` if the field is not set or
9139    /// holds a different branch.
9140    pub fn javascript_udf(
9141        &self,
9142    ) -> std::option::Option<&std::boxed::Box<crate::model::JavaScriptUDF>> {
9143        #[allow(unreachable_patterns)]
9144        self.transform.as_ref().and_then(|v| match v {
9145            crate::model::message_transform::Transform::JavascriptUdf(v) => {
9146                std::option::Option::Some(v)
9147            }
9148            _ => std::option::Option::None,
9149        })
9150    }
9151
9152    /// Sets the value of [transform][crate::model::MessageTransform::transform]
9153    /// to hold a `JavascriptUdf`.
9154    ///
9155    /// Note that all the setters affecting `transform` are
9156    /// mutually exclusive.
9157    ///
9158    /// # Example
9159    /// ```ignore,no_run
9160    /// # use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
9161    /// use google_cloud_bigquery_analyticshub_v1::model::JavaScriptUDF;
9162    /// let x = MessageTransform::new().set_javascript_udf(JavaScriptUDF::default()/* use setters */);
9163    /// assert!(x.javascript_udf().is_some());
9164    /// ```
9165    pub fn set_javascript_udf<
9166        T: std::convert::Into<std::boxed::Box<crate::model::JavaScriptUDF>>,
9167    >(
9168        mut self,
9169        v: T,
9170    ) -> Self {
9171        self.transform = std::option::Option::Some(
9172            crate::model::message_transform::Transform::JavascriptUdf(v.into()),
9173        );
9174        self
9175    }
9176}
9177
9178impl wkt::message::Message for MessageTransform {
9179    fn typename() -> &'static str {
9180        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.MessageTransform"
9181    }
9182}
9183
9184/// Defines additional types related to [MessageTransform].
9185pub mod message_transform {
9186    #[allow(unused_imports)]
9187    use super::*;
9188
9189    /// The type of transform to apply to messages.
9190    #[derive(Clone, Debug, PartialEq)]
9191    #[non_exhaustive]
9192    pub enum Transform {
9193        /// Optional. JavaScript User Defined Function. If multiple JavaScriptUDF's
9194        /// are specified on a resource, each must have a unique `function_name`.
9195        JavascriptUdf(std::boxed::Box<crate::model::JavaScriptUDF>),
9196    }
9197}
9198
9199/// User-defined JavaScript function that can transform or filter a Pub/Sub
9200/// message.
9201#[derive(Clone, Default, PartialEq)]
9202#[non_exhaustive]
9203pub struct JavaScriptUDF {
9204    /// Required. Name of the JavasScript function that should applied to Pub/Sub
9205    /// messages.
9206    pub function_name: std::string::String,
9207
9208    /// Required. JavaScript code that contains a function `function_name` with the
9209    /// below signature:
9210    ///
9211    /// ```norust
9212    ///   /**
9213    ///   * Transforms a Pub/Sub message.
9214    ///
9215    ///   * @return {(Object<string, (string | Object<string, string>)>|null)} - To
9216    ///   * filter a message, return `null`. To transform a message return a map
9217    ///   * with the following keys:
9218    ///   *   - (required) 'data' : {string}
9219    ///   *   - (optional) 'attributes' : {Object<string, string>}
9220    ///   * Returning empty `attributes` will remove all attributes from the
9221    ///   * message.
9222    ///   *
9223    ///   * @param  {(Object<string, (string | Object<string, string>)>} Pub/Sub
9224    ///   * message. Keys:
9225    ///   *   - (required) 'data' : {string}
9226    ///   *   - (required) 'attributes' : {Object<string, string>}
9227    ///   *
9228    ///   * @param  {Object<string, any>} metadata - Pub/Sub message metadata.
9229    ///   * Keys:
9230    ///   *   - (required) 'message_id'  : {string}
9231    ///   *   - (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format
9232    ///   *   - (optional) 'ordering_key': {string}
9233    ///   */
9234    ///
9235    ///   function <function_name>(message, metadata) {
9236    ///   }
9237    /// ```
9238    pub code: std::string::String,
9239
9240    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9241}
9242
9243impl JavaScriptUDF {
9244    pub fn new() -> Self {
9245        std::default::Default::default()
9246    }
9247
9248    /// Sets the value of [function_name][crate::model::JavaScriptUDF::function_name].
9249    ///
9250    /// # Example
9251    /// ```ignore,no_run
9252    /// # use google_cloud_bigquery_analyticshub_v1::model::JavaScriptUDF;
9253    /// let x = JavaScriptUDF::new().set_function_name("example");
9254    /// ```
9255    pub fn set_function_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9256        self.function_name = v.into();
9257        self
9258    }
9259
9260    /// Sets the value of [code][crate::model::JavaScriptUDF::code].
9261    ///
9262    /// # Example
9263    /// ```ignore,no_run
9264    /// # use google_cloud_bigquery_analyticshub_v1::model::JavaScriptUDF;
9265    /// let x = JavaScriptUDF::new().set_code("example");
9266    /// ```
9267    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9268        self.code = v.into();
9269        self
9270    }
9271}
9272
9273impl wkt::message::Message for JavaScriptUDF {
9274    fn typename() -> &'static str {
9275        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.JavaScriptUDF"
9276    }
9277}
9278
9279/// Specifies the type of discovery on the discovery page. Note that
9280/// this does not control the visibility of the exchange/listing which is
9281/// defined by IAM permission.
9282///
9283/// # Working with unknown values
9284///
9285/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9286/// additional enum variants at any time. Adding new variants is not considered
9287/// a breaking change. Applications should write their code in anticipation of:
9288///
9289/// - New values appearing in future releases of the client library, **and**
9290/// - New values received dynamically, without application changes.
9291///
9292/// Please consult the [Working with enums] section in the user guide for some
9293/// guidelines.
9294///
9295/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9296#[derive(Clone, Debug, PartialEq)]
9297#[non_exhaustive]
9298pub enum DiscoveryType {
9299    /// Unspecified. Defaults to DISCOVERY_TYPE_PRIVATE.
9300    Unspecified,
9301    /// The Data exchange/listing can be discovered in the 'Private' results
9302    /// list.
9303    Private,
9304    /// The Data exchange/listing can be discovered in the 'Public' results
9305    /// list.
9306    Public,
9307    /// If set, the enum was initialized with an unknown value.
9308    ///
9309    /// Applications can examine the value using [DiscoveryType::value] or
9310    /// [DiscoveryType::name].
9311    UnknownValue(discovery_type::UnknownValue),
9312}
9313
9314#[doc(hidden)]
9315pub mod discovery_type {
9316    #[allow(unused_imports)]
9317    use super::*;
9318    #[derive(Clone, Debug, PartialEq)]
9319    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9320}
9321
9322impl DiscoveryType {
9323    /// Gets the enum value.
9324    ///
9325    /// Returns `None` if the enum contains an unknown value deserialized from
9326    /// the string representation of enums.
9327    pub fn value(&self) -> std::option::Option<i32> {
9328        match self {
9329            Self::Unspecified => std::option::Option::Some(0),
9330            Self::Private => std::option::Option::Some(1),
9331            Self::Public => std::option::Option::Some(2),
9332            Self::UnknownValue(u) => u.0.value(),
9333        }
9334    }
9335
9336    /// Gets the enum value as a string.
9337    ///
9338    /// Returns `None` if the enum contains an unknown value deserialized from
9339    /// the integer representation of enums.
9340    pub fn name(&self) -> std::option::Option<&str> {
9341        match self {
9342            Self::Unspecified => std::option::Option::Some("DISCOVERY_TYPE_UNSPECIFIED"),
9343            Self::Private => std::option::Option::Some("DISCOVERY_TYPE_PRIVATE"),
9344            Self::Public => std::option::Option::Some("DISCOVERY_TYPE_PUBLIC"),
9345            Self::UnknownValue(u) => u.0.name(),
9346        }
9347    }
9348}
9349
9350impl std::default::Default for DiscoveryType {
9351    fn default() -> Self {
9352        use std::convert::From;
9353        Self::from(0)
9354    }
9355}
9356
9357impl std::fmt::Display for DiscoveryType {
9358    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9359        wkt::internal::display_enum(f, self.name(), self.value())
9360    }
9361}
9362
9363impl std::convert::From<i32> for DiscoveryType {
9364    fn from(value: i32) -> Self {
9365        match value {
9366            0 => Self::Unspecified,
9367            1 => Self::Private,
9368            2 => Self::Public,
9369            _ => Self::UnknownValue(discovery_type::UnknownValue(
9370                wkt::internal::UnknownEnumValue::Integer(value),
9371            )),
9372        }
9373    }
9374}
9375
9376impl std::convert::From<&str> for DiscoveryType {
9377    fn from(value: &str) -> Self {
9378        use std::string::ToString;
9379        match value {
9380            "DISCOVERY_TYPE_UNSPECIFIED" => Self::Unspecified,
9381            "DISCOVERY_TYPE_PRIVATE" => Self::Private,
9382            "DISCOVERY_TYPE_PUBLIC" => Self::Public,
9383            _ => Self::UnknownValue(discovery_type::UnknownValue(
9384                wkt::internal::UnknownEnumValue::String(value.to_string()),
9385            )),
9386        }
9387    }
9388}
9389
9390impl serde::ser::Serialize for DiscoveryType {
9391    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9392    where
9393        S: serde::Serializer,
9394    {
9395        match self {
9396            Self::Unspecified => serializer.serialize_i32(0),
9397            Self::Private => serializer.serialize_i32(1),
9398            Self::Public => serializer.serialize_i32(2),
9399            Self::UnknownValue(u) => u.0.serialize(serializer),
9400        }
9401    }
9402}
9403
9404impl<'de> serde::de::Deserialize<'de> for DiscoveryType {
9405    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9406    where
9407        D: serde::Deserializer<'de>,
9408    {
9409        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DiscoveryType>::new(
9410            ".google.cloud.bigquery.analyticshub.v1.DiscoveryType",
9411        ))
9412    }
9413}
9414
9415/// The underlying shared asset type shared in a listing by a publisher.
9416///
9417/// # Working with unknown values
9418///
9419/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9420/// additional enum variants at any time. Adding new variants is not considered
9421/// a breaking change. Applications should write their code in anticipation of:
9422///
9423/// - New values appearing in future releases of the client library, **and**
9424/// - New values received dynamically, without application changes.
9425///
9426/// Please consult the [Working with enums] section in the user guide for some
9427/// guidelines.
9428///
9429/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9430#[derive(Clone, Debug, PartialEq)]
9431#[non_exhaustive]
9432pub enum SharedResourceType {
9433    /// Not specified.
9434    Unspecified,
9435    /// BigQuery Dataset Asset.
9436    BigqueryDataset,
9437    /// Pub/Sub Topic Asset.
9438    PubsubTopic,
9439    /// If set, the enum was initialized with an unknown value.
9440    ///
9441    /// Applications can examine the value using [SharedResourceType::value] or
9442    /// [SharedResourceType::name].
9443    UnknownValue(shared_resource_type::UnknownValue),
9444}
9445
9446#[doc(hidden)]
9447pub mod shared_resource_type {
9448    #[allow(unused_imports)]
9449    use super::*;
9450    #[derive(Clone, Debug, PartialEq)]
9451    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9452}
9453
9454impl SharedResourceType {
9455    /// Gets the enum value.
9456    ///
9457    /// Returns `None` if the enum contains an unknown value deserialized from
9458    /// the string representation of enums.
9459    pub fn value(&self) -> std::option::Option<i32> {
9460        match self {
9461            Self::Unspecified => std::option::Option::Some(0),
9462            Self::BigqueryDataset => std::option::Option::Some(1),
9463            Self::PubsubTopic => std::option::Option::Some(2),
9464            Self::UnknownValue(u) => u.0.value(),
9465        }
9466    }
9467
9468    /// Gets the enum value as a string.
9469    ///
9470    /// Returns `None` if the enum contains an unknown value deserialized from
9471    /// the integer representation of enums.
9472    pub fn name(&self) -> std::option::Option<&str> {
9473        match self {
9474            Self::Unspecified => std::option::Option::Some("SHARED_RESOURCE_TYPE_UNSPECIFIED"),
9475            Self::BigqueryDataset => std::option::Option::Some("BIGQUERY_DATASET"),
9476            Self::PubsubTopic => std::option::Option::Some("PUBSUB_TOPIC"),
9477            Self::UnknownValue(u) => u.0.name(),
9478        }
9479    }
9480}
9481
9482impl std::default::Default for SharedResourceType {
9483    fn default() -> Self {
9484        use std::convert::From;
9485        Self::from(0)
9486    }
9487}
9488
9489impl std::fmt::Display for SharedResourceType {
9490    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9491        wkt::internal::display_enum(f, self.name(), self.value())
9492    }
9493}
9494
9495impl std::convert::From<i32> for SharedResourceType {
9496    fn from(value: i32) -> Self {
9497        match value {
9498            0 => Self::Unspecified,
9499            1 => Self::BigqueryDataset,
9500            2 => Self::PubsubTopic,
9501            _ => Self::UnknownValue(shared_resource_type::UnknownValue(
9502                wkt::internal::UnknownEnumValue::Integer(value),
9503            )),
9504        }
9505    }
9506}
9507
9508impl std::convert::From<&str> for SharedResourceType {
9509    fn from(value: &str) -> Self {
9510        use std::string::ToString;
9511        match value {
9512            "SHARED_RESOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
9513            "BIGQUERY_DATASET" => Self::BigqueryDataset,
9514            "PUBSUB_TOPIC" => Self::PubsubTopic,
9515            _ => Self::UnknownValue(shared_resource_type::UnknownValue(
9516                wkt::internal::UnknownEnumValue::String(value.to_string()),
9517            )),
9518        }
9519    }
9520}
9521
9522impl serde::ser::Serialize for SharedResourceType {
9523    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9524    where
9525        S: serde::Serializer,
9526    {
9527        match self {
9528            Self::Unspecified => serializer.serialize_i32(0),
9529            Self::BigqueryDataset => serializer.serialize_i32(1),
9530            Self::PubsubTopic => serializer.serialize_i32(2),
9531            Self::UnknownValue(u) => u.0.serialize(serializer),
9532        }
9533    }
9534}
9535
9536impl<'de> serde::de::Deserialize<'de> for SharedResourceType {
9537    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9538    where
9539        D: serde::Deserializer<'de>,
9540    {
9541        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SharedResourceType>::new(
9542            ".google.cloud.bigquery.analyticshub.v1.SharedResourceType",
9543        ))
9544    }
9545}