Skip to main content

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 gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// A data exchange is a container that lets you share data. Along with the
39/// descriptive information about the data exchange, it contains listings that
40/// reference shared datasets.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct DataExchange {
44    /// Output only. The resource name of the data exchange.
45    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
46    pub name: std::string::String,
47
48    /// Required. Human-readable display name of the data exchange. The display
49    /// name must contain only Unicode letters, numbers (0-9), underscores (_),
50    /// dashes (-), spaces ( ), ampersands (&) and must not start or end with
51    /// spaces. Default value is an empty string. Max length: 63 bytes.
52    pub display_name: std::string::String,
53
54    /// Optional. Description of the data exchange. The description must not
55    /// contain Unicode non-characters as well as C0 and C1 control codes except
56    /// tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF).
57    /// Default value is an empty string.
58    /// Max length: 2000 bytes.
59    pub description: std::string::String,
60
61    /// Optional. Email or URL of the primary point of contact of the data
62    /// exchange. Max Length: 1000 bytes.
63    pub primary_contact: std::string::String,
64
65    /// Optional. Documentation describing the data exchange.
66    pub documentation: std::string::String,
67
68    /// Output only. Number of listings contained in the data exchange.
69    pub listing_count: i32,
70
71    /// Optional. Base64 encoded image representing the data exchange. Max
72    /// Size: 3.0MiB Expected image dimensions are 512x512 pixels, however the API
73    /// only performs validation on size of the encoded data. Note: For byte
74    /// fields, the content of the fields are base64-encoded (which increases the
75    /// size of the data by 33-36%) when using JSON on the wire.
76    pub icon: ::bytes::Bytes,
77
78    /// Optional. Configurable data sharing environment option for a data exchange.
79    pub sharing_environment_config: std::option::Option<crate::model::SharingEnvironmentConfig>,
80
81    /// Optional. Type of discovery on the discovery page for all the listings
82    /// under this exchange. Updating this field also updates (overwrites) the
83    /// discovery_type field for all the listings under this exchange.
84    pub discovery_type: std::option::Option<crate::model::DiscoveryType>,
85
86    /// Optional. By default, false.
87    /// If true, the DataExchange has an email sharing mandate enabled.
88    pub log_linked_dataset_query_user_email: std::option::Option<bool>,
89
90    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
91}
92
93impl DataExchange {
94    pub fn new() -> Self {
95        std::default::Default::default()
96    }
97
98    /// Sets the value of [name][crate::model::DataExchange::name].
99    ///
100    /// # Example
101    /// ```ignore,no_run
102    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
103    /// let x = DataExchange::new().set_name("example");
104    /// ```
105    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
106        self.name = v.into();
107        self
108    }
109
110    /// Sets the value of [display_name][crate::model::DataExchange::display_name].
111    ///
112    /// # Example
113    /// ```ignore,no_run
114    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
115    /// let x = DataExchange::new().set_display_name("example");
116    /// ```
117    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
118        self.display_name = v.into();
119        self
120    }
121
122    /// Sets the value of [description][crate::model::DataExchange::description].
123    ///
124    /// # Example
125    /// ```ignore,no_run
126    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
127    /// let x = DataExchange::new().set_description("example");
128    /// ```
129    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
130        self.description = v.into();
131        self
132    }
133
134    /// Sets the value of [primary_contact][crate::model::DataExchange::primary_contact].
135    ///
136    /// # Example
137    /// ```ignore,no_run
138    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
139    /// let x = DataExchange::new().set_primary_contact("example");
140    /// ```
141    pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
142        self.primary_contact = v.into();
143        self
144    }
145
146    /// Sets the value of [documentation][crate::model::DataExchange::documentation].
147    ///
148    /// # Example
149    /// ```ignore,no_run
150    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
151    /// let x = DataExchange::new().set_documentation("example");
152    /// ```
153    pub fn set_documentation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
154        self.documentation = v.into();
155        self
156    }
157
158    /// Sets the value of [listing_count][crate::model::DataExchange::listing_count].
159    ///
160    /// # Example
161    /// ```ignore,no_run
162    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
163    /// let x = DataExchange::new().set_listing_count(42);
164    /// ```
165    pub fn set_listing_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
166        self.listing_count = v.into();
167        self
168    }
169
170    /// Sets the value of [icon][crate::model::DataExchange::icon].
171    ///
172    /// # Example
173    /// ```ignore,no_run
174    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
175    /// let x = DataExchange::new().set_icon(bytes::Bytes::from_static(b"example"));
176    /// ```
177    pub fn set_icon<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
178        self.icon = v.into();
179        self
180    }
181
182    /// Sets the value of [sharing_environment_config][crate::model::DataExchange::sharing_environment_config].
183    ///
184    /// # Example
185    /// ```ignore,no_run
186    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
187    /// use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
188    /// let x = DataExchange::new().set_sharing_environment_config(SharingEnvironmentConfig::default()/* use setters */);
189    /// ```
190    pub fn set_sharing_environment_config<T>(mut self, v: T) -> Self
191    where
192        T: std::convert::Into<crate::model::SharingEnvironmentConfig>,
193    {
194        self.sharing_environment_config = std::option::Option::Some(v.into());
195        self
196    }
197
198    /// Sets or clears the value of [sharing_environment_config][crate::model::DataExchange::sharing_environment_config].
199    ///
200    /// # Example
201    /// ```ignore,no_run
202    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
203    /// use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
204    /// let x = DataExchange::new().set_or_clear_sharing_environment_config(Some(SharingEnvironmentConfig::default()/* use setters */));
205    /// let x = DataExchange::new().set_or_clear_sharing_environment_config(None::<SharingEnvironmentConfig>);
206    /// ```
207    pub fn set_or_clear_sharing_environment_config<T>(mut self, v: std::option::Option<T>) -> Self
208    where
209        T: std::convert::Into<crate::model::SharingEnvironmentConfig>,
210    {
211        self.sharing_environment_config = v.map(|x| x.into());
212        self
213    }
214
215    /// Sets the value of [discovery_type][crate::model::DataExchange::discovery_type].
216    ///
217    /// # Example
218    /// ```ignore,no_run
219    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
220    /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
221    /// let x0 = DataExchange::new().set_discovery_type(DiscoveryType::Private);
222    /// let x1 = DataExchange::new().set_discovery_type(DiscoveryType::Public);
223    /// ```
224    pub fn set_discovery_type<T>(mut self, v: T) -> Self
225    where
226        T: std::convert::Into<crate::model::DiscoveryType>,
227    {
228        self.discovery_type = std::option::Option::Some(v.into());
229        self
230    }
231
232    /// Sets or clears the value of [discovery_type][crate::model::DataExchange::discovery_type].
233    ///
234    /// # Example
235    /// ```ignore,no_run
236    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
237    /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
238    /// let x0 = DataExchange::new().set_or_clear_discovery_type(Some(DiscoveryType::Private));
239    /// let x1 = DataExchange::new().set_or_clear_discovery_type(Some(DiscoveryType::Public));
240    /// let x_none = DataExchange::new().set_or_clear_discovery_type(None::<DiscoveryType>);
241    /// ```
242    pub fn set_or_clear_discovery_type<T>(mut self, v: std::option::Option<T>) -> Self
243    where
244        T: std::convert::Into<crate::model::DiscoveryType>,
245    {
246        self.discovery_type = v.map(|x| x.into());
247        self
248    }
249
250    /// Sets the value of [log_linked_dataset_query_user_email][crate::model::DataExchange::log_linked_dataset_query_user_email].
251    ///
252    /// # Example
253    /// ```ignore,no_run
254    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
255    /// let x = DataExchange::new().set_log_linked_dataset_query_user_email(true);
256    /// ```
257    pub fn set_log_linked_dataset_query_user_email<T>(mut self, v: T) -> Self
258    where
259        T: std::convert::Into<bool>,
260    {
261        self.log_linked_dataset_query_user_email = std::option::Option::Some(v.into());
262        self
263    }
264
265    /// Sets or clears the value of [log_linked_dataset_query_user_email][crate::model::DataExchange::log_linked_dataset_query_user_email].
266    ///
267    /// # Example
268    /// ```ignore,no_run
269    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
270    /// let x = DataExchange::new().set_or_clear_log_linked_dataset_query_user_email(Some(false));
271    /// let x = DataExchange::new().set_or_clear_log_linked_dataset_query_user_email(None::<bool>);
272    /// ```
273    pub fn set_or_clear_log_linked_dataset_query_user_email<T>(
274        mut self,
275        v: std::option::Option<T>,
276    ) -> Self
277    where
278        T: std::convert::Into<bool>,
279    {
280        self.log_linked_dataset_query_user_email = v.map(|x| x.into());
281        self
282    }
283}
284
285impl wkt::message::Message for DataExchange {
286    fn typename() -> &'static str {
287        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DataExchange"
288    }
289}
290
291/// A query template is a container for sharing table-valued functions defined by
292/// contributors in a data clean room.
293#[derive(Clone, Default, PartialEq)]
294#[non_exhaustive]
295pub struct QueryTemplate {
296    /// Output only. The resource name of the QueryTemplate.
297    /// e.g. `projects/myproject/locations/us/dataExchanges/123/queryTemplates/456`
298    pub name: std::string::String,
299
300    /// Required. Human-readable display name of the QueryTemplate. The display
301    /// name must contain only Unicode letters, numbers (0-9), underscores (_),
302    /// dashes (-), spaces ( ), ampersands (&) and can't start or end with spaces.
303    /// Default value is an empty string. Max length: 63 bytes.
304    pub display_name: std::string::String,
305
306    /// Optional. Short description of the QueryTemplate. The description must not
307    /// contain Unicode non-characters and C0 and C1 control codes except tabs
308    /// (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default
309    /// value is an empty string. Max length: 2000 bytes.
310    pub description: std::string::String,
311
312    /// Optional. Will be deprecated.
313    /// Email or URL of the primary point of contact of the QueryTemplate.
314    /// Max Length: 1000 bytes.
315    pub proposer: std::string::String,
316
317    /// Optional. Email or URL of the primary point of contact of the
318    /// QueryTemplate. Max Length: 1000 bytes.
319    pub primary_contact: std::string::String,
320
321    /// Optional. Documentation describing the QueryTemplate.
322    pub documentation: std::string::String,
323
324    /// Output only. The QueryTemplate lifecycle state.
325    pub state: crate::model::query_template::State,
326
327    /// Optional. The routine associated with the QueryTemplate.
328    pub routine: std::option::Option<crate::model::Routine>,
329
330    /// Output only. Timestamp when the QueryTemplate was created.
331    pub create_time: std::option::Option<wkt::Timestamp>,
332
333    /// Output only. Timestamp when the QueryTemplate was last modified.
334    pub update_time: std::option::Option<wkt::Timestamp>,
335
336    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
337}
338
339impl QueryTemplate {
340    pub fn new() -> Self {
341        std::default::Default::default()
342    }
343
344    /// Sets the value of [name][crate::model::QueryTemplate::name].
345    ///
346    /// # Example
347    /// ```ignore,no_run
348    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
349    /// let x = QueryTemplate::new().set_name("example");
350    /// ```
351    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
352        self.name = v.into();
353        self
354    }
355
356    /// Sets the value of [display_name][crate::model::QueryTemplate::display_name].
357    ///
358    /// # Example
359    /// ```ignore,no_run
360    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
361    /// let x = QueryTemplate::new().set_display_name("example");
362    /// ```
363    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
364        self.display_name = v.into();
365        self
366    }
367
368    /// Sets the value of [description][crate::model::QueryTemplate::description].
369    ///
370    /// # Example
371    /// ```ignore,no_run
372    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
373    /// let x = QueryTemplate::new().set_description("example");
374    /// ```
375    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
376        self.description = v.into();
377        self
378    }
379
380    /// Sets the value of [proposer][crate::model::QueryTemplate::proposer].
381    ///
382    /// # Example
383    /// ```ignore,no_run
384    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
385    /// let x = QueryTemplate::new().set_proposer("example");
386    /// ```
387    pub fn set_proposer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
388        self.proposer = v.into();
389        self
390    }
391
392    /// Sets the value of [primary_contact][crate::model::QueryTemplate::primary_contact].
393    ///
394    /// # Example
395    /// ```ignore,no_run
396    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
397    /// let x = QueryTemplate::new().set_primary_contact("example");
398    /// ```
399    pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
400        self.primary_contact = v.into();
401        self
402    }
403
404    /// Sets the value of [documentation][crate::model::QueryTemplate::documentation].
405    ///
406    /// # Example
407    /// ```ignore,no_run
408    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
409    /// let x = QueryTemplate::new().set_documentation("example");
410    /// ```
411    pub fn set_documentation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
412        self.documentation = v.into();
413        self
414    }
415
416    /// Sets the value of [state][crate::model::QueryTemplate::state].
417    ///
418    /// # Example
419    /// ```ignore,no_run
420    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
421    /// use google_cloud_bigquery_analyticshub_v1::model::query_template::State;
422    /// let x0 = QueryTemplate::new().set_state(State::Drafted);
423    /// let x1 = QueryTemplate::new().set_state(State::Pending);
424    /// let x2 = QueryTemplate::new().set_state(State::Deleted);
425    /// ```
426    pub fn set_state<T: std::convert::Into<crate::model::query_template::State>>(
427        mut self,
428        v: T,
429    ) -> Self {
430        self.state = v.into();
431        self
432    }
433
434    /// Sets the value of [routine][crate::model::QueryTemplate::routine].
435    ///
436    /// # Example
437    /// ```ignore,no_run
438    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
439    /// use google_cloud_bigquery_analyticshub_v1::model::Routine;
440    /// let x = QueryTemplate::new().set_routine(Routine::default()/* use setters */);
441    /// ```
442    pub fn set_routine<T>(mut self, v: T) -> Self
443    where
444        T: std::convert::Into<crate::model::Routine>,
445    {
446        self.routine = std::option::Option::Some(v.into());
447        self
448    }
449
450    /// Sets or clears the value of [routine][crate::model::QueryTemplate::routine].
451    ///
452    /// # Example
453    /// ```ignore,no_run
454    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
455    /// use google_cloud_bigquery_analyticshub_v1::model::Routine;
456    /// let x = QueryTemplate::new().set_or_clear_routine(Some(Routine::default()/* use setters */));
457    /// let x = QueryTemplate::new().set_or_clear_routine(None::<Routine>);
458    /// ```
459    pub fn set_or_clear_routine<T>(mut self, v: std::option::Option<T>) -> Self
460    where
461        T: std::convert::Into<crate::model::Routine>,
462    {
463        self.routine = v.map(|x| x.into());
464        self
465    }
466
467    /// Sets the value of [create_time][crate::model::QueryTemplate::create_time].
468    ///
469    /// # Example
470    /// ```ignore,no_run
471    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
472    /// use wkt::Timestamp;
473    /// let x = QueryTemplate::new().set_create_time(Timestamp::default()/* use setters */);
474    /// ```
475    pub fn set_create_time<T>(mut self, v: T) -> Self
476    where
477        T: std::convert::Into<wkt::Timestamp>,
478    {
479        self.create_time = std::option::Option::Some(v.into());
480        self
481    }
482
483    /// Sets or clears the value of [create_time][crate::model::QueryTemplate::create_time].
484    ///
485    /// # Example
486    /// ```ignore,no_run
487    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
488    /// use wkt::Timestamp;
489    /// let x = QueryTemplate::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
490    /// let x = QueryTemplate::new().set_or_clear_create_time(None::<Timestamp>);
491    /// ```
492    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
493    where
494        T: std::convert::Into<wkt::Timestamp>,
495    {
496        self.create_time = v.map(|x| x.into());
497        self
498    }
499
500    /// Sets the value of [update_time][crate::model::QueryTemplate::update_time].
501    ///
502    /// # Example
503    /// ```ignore,no_run
504    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
505    /// use wkt::Timestamp;
506    /// let x = QueryTemplate::new().set_update_time(Timestamp::default()/* use setters */);
507    /// ```
508    pub fn set_update_time<T>(mut self, v: T) -> Self
509    where
510        T: std::convert::Into<wkt::Timestamp>,
511    {
512        self.update_time = std::option::Option::Some(v.into());
513        self
514    }
515
516    /// Sets or clears the value of [update_time][crate::model::QueryTemplate::update_time].
517    ///
518    /// # Example
519    /// ```ignore,no_run
520    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
521    /// use wkt::Timestamp;
522    /// let x = QueryTemplate::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
523    /// let x = QueryTemplate::new().set_or_clear_update_time(None::<Timestamp>);
524    /// ```
525    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
526    where
527        T: std::convert::Into<wkt::Timestamp>,
528    {
529        self.update_time = v.map(|x| x.into());
530        self
531    }
532}
533
534impl wkt::message::Message for QueryTemplate {
535    fn typename() -> &'static str {
536        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.QueryTemplate"
537    }
538}
539
540/// Defines additional types related to [QueryTemplate].
541pub mod query_template {
542    #[allow(unused_imports)]
543    use super::*;
544
545    /// The QueryTemplate lifecycle state.
546    ///
547    /// # Working with unknown values
548    ///
549    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
550    /// additional enum variants at any time. Adding new variants is not considered
551    /// a breaking change. Applications should write their code in anticipation of:
552    ///
553    /// - New values appearing in future releases of the client library, **and**
554    /// - New values received dynamically, without application changes.
555    ///
556    /// Please consult the [Working with enums] section in the user guide for some
557    /// guidelines.
558    ///
559    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
560    #[derive(Clone, Debug, PartialEq)]
561    #[non_exhaustive]
562    pub enum State {
563        /// Default value. This value is unused.
564        Unspecified,
565        /// The QueryTemplate is in draft state.
566        Drafted,
567        /// The QueryTemplate is in pending state.
568        Pending,
569        /// The QueryTemplate is in deleted state.
570        Deleted,
571        /// The QueryTemplate is in approved state.
572        Approved,
573        /// If set, the enum was initialized with an unknown value.
574        ///
575        /// Applications can examine the value using [State::value] or
576        /// [State::name].
577        UnknownValue(state::UnknownValue),
578    }
579
580    #[doc(hidden)]
581    pub mod state {
582        #[allow(unused_imports)]
583        use super::*;
584        #[derive(Clone, Debug, PartialEq)]
585        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
586    }
587
588    impl State {
589        /// Gets the enum value.
590        ///
591        /// Returns `None` if the enum contains an unknown value deserialized from
592        /// the string representation of enums.
593        pub fn value(&self) -> std::option::Option<i32> {
594            match self {
595                Self::Unspecified => std::option::Option::Some(0),
596                Self::Drafted => std::option::Option::Some(1),
597                Self::Pending => std::option::Option::Some(2),
598                Self::Deleted => std::option::Option::Some(3),
599                Self::Approved => std::option::Option::Some(4),
600                Self::UnknownValue(u) => u.0.value(),
601            }
602        }
603
604        /// Gets the enum value as a string.
605        ///
606        /// Returns `None` if the enum contains an unknown value deserialized from
607        /// the integer representation of enums.
608        pub fn name(&self) -> std::option::Option<&str> {
609            match self {
610                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
611                Self::Drafted => std::option::Option::Some("DRAFTED"),
612                Self::Pending => std::option::Option::Some("PENDING"),
613                Self::Deleted => std::option::Option::Some("DELETED"),
614                Self::Approved => std::option::Option::Some("APPROVED"),
615                Self::UnknownValue(u) => u.0.name(),
616            }
617        }
618    }
619
620    impl std::default::Default for State {
621        fn default() -> Self {
622            use std::convert::From;
623            Self::from(0)
624        }
625    }
626
627    impl std::fmt::Display for State {
628        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
629            wkt::internal::display_enum(f, self.name(), self.value())
630        }
631    }
632
633    impl std::convert::From<i32> for State {
634        fn from(value: i32) -> Self {
635            match value {
636                0 => Self::Unspecified,
637                1 => Self::Drafted,
638                2 => Self::Pending,
639                3 => Self::Deleted,
640                4 => Self::Approved,
641                _ => Self::UnknownValue(state::UnknownValue(
642                    wkt::internal::UnknownEnumValue::Integer(value),
643                )),
644            }
645        }
646    }
647
648    impl std::convert::From<&str> for State {
649        fn from(value: &str) -> Self {
650            use std::string::ToString;
651            match value {
652                "STATE_UNSPECIFIED" => Self::Unspecified,
653                "DRAFTED" => Self::Drafted,
654                "PENDING" => Self::Pending,
655                "DELETED" => Self::Deleted,
656                "APPROVED" => Self::Approved,
657                _ => Self::UnknownValue(state::UnknownValue(
658                    wkt::internal::UnknownEnumValue::String(value.to_string()),
659                )),
660            }
661        }
662    }
663
664    impl serde::ser::Serialize for State {
665        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
666        where
667            S: serde::Serializer,
668        {
669            match self {
670                Self::Unspecified => serializer.serialize_i32(0),
671                Self::Drafted => serializer.serialize_i32(1),
672                Self::Pending => serializer.serialize_i32(2),
673                Self::Deleted => serializer.serialize_i32(3),
674                Self::Approved => serializer.serialize_i32(4),
675                Self::UnknownValue(u) => u.0.serialize(serializer),
676            }
677        }
678    }
679
680    impl<'de> serde::de::Deserialize<'de> for State {
681        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
682        where
683            D: serde::Deserializer<'de>,
684        {
685            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
686                ".google.cloud.bigquery.analyticshub.v1.QueryTemplate.State",
687            ))
688        }
689    }
690}
691
692/// Represents a bigquery routine.
693#[derive(Clone, Default, PartialEq)]
694#[non_exhaustive]
695pub struct Routine {
696    /// Required. The type of routine.
697    pub routine_type: crate::model::routine::RoutineType,
698
699    /// Optional. The definition body of the routine.
700    pub definition_body: std::string::String,
701
702    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
703}
704
705impl Routine {
706    pub fn new() -> Self {
707        std::default::Default::default()
708    }
709
710    /// Sets the value of [routine_type][crate::model::Routine::routine_type].
711    ///
712    /// # Example
713    /// ```ignore,no_run
714    /// # use google_cloud_bigquery_analyticshub_v1::model::Routine;
715    /// use google_cloud_bigquery_analyticshub_v1::model::routine::RoutineType;
716    /// let x0 = Routine::new().set_routine_type(RoutineType::TableValuedFunction);
717    /// ```
718    pub fn set_routine_type<T: std::convert::Into<crate::model::routine::RoutineType>>(
719        mut self,
720        v: T,
721    ) -> Self {
722        self.routine_type = v.into();
723        self
724    }
725
726    /// Sets the value of [definition_body][crate::model::Routine::definition_body].
727    ///
728    /// # Example
729    /// ```ignore,no_run
730    /// # use google_cloud_bigquery_analyticshub_v1::model::Routine;
731    /// let x = Routine::new().set_definition_body("example");
732    /// ```
733    pub fn set_definition_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
734        self.definition_body = v.into();
735        self
736    }
737}
738
739impl wkt::message::Message for Routine {
740    fn typename() -> &'static str {
741        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Routine"
742    }
743}
744
745/// Defines additional types related to [Routine].
746pub mod routine {
747    #[allow(unused_imports)]
748    use super::*;
749
750    /// Represents the type of a given routine.
751    ///
752    /// # Working with unknown values
753    ///
754    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
755    /// additional enum variants at any time. Adding new variants is not considered
756    /// a breaking change. Applications should write their code in anticipation of:
757    ///
758    /// - New values appearing in future releases of the client library, **and**
759    /// - New values received dynamically, without application changes.
760    ///
761    /// Please consult the [Working with enums] section in the user guide for some
762    /// guidelines.
763    ///
764    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
765    #[derive(Clone, Debug, PartialEq)]
766    #[non_exhaustive]
767    pub enum RoutineType {
768        /// Default value.
769        Unspecified,
770        /// Non-built-in persistent TVF.
771        TableValuedFunction,
772        /// If set, the enum was initialized with an unknown value.
773        ///
774        /// Applications can examine the value using [RoutineType::value] or
775        /// [RoutineType::name].
776        UnknownValue(routine_type::UnknownValue),
777    }
778
779    #[doc(hidden)]
780    pub mod routine_type {
781        #[allow(unused_imports)]
782        use super::*;
783        #[derive(Clone, Debug, PartialEq)]
784        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
785    }
786
787    impl RoutineType {
788        /// Gets the enum value.
789        ///
790        /// Returns `None` if the enum contains an unknown value deserialized from
791        /// the string representation of enums.
792        pub fn value(&self) -> std::option::Option<i32> {
793            match self {
794                Self::Unspecified => std::option::Option::Some(0),
795                Self::TableValuedFunction => std::option::Option::Some(1),
796                Self::UnknownValue(u) => u.0.value(),
797            }
798        }
799
800        /// Gets the enum value as a string.
801        ///
802        /// Returns `None` if the enum contains an unknown value deserialized from
803        /// the integer representation of enums.
804        pub fn name(&self) -> std::option::Option<&str> {
805            match self {
806                Self::Unspecified => std::option::Option::Some("ROUTINE_TYPE_UNSPECIFIED"),
807                Self::TableValuedFunction => std::option::Option::Some("TABLE_VALUED_FUNCTION"),
808                Self::UnknownValue(u) => u.0.name(),
809            }
810        }
811    }
812
813    impl std::default::Default for RoutineType {
814        fn default() -> Self {
815            use std::convert::From;
816            Self::from(0)
817        }
818    }
819
820    impl std::fmt::Display for RoutineType {
821        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
822            wkt::internal::display_enum(f, self.name(), self.value())
823        }
824    }
825
826    impl std::convert::From<i32> for RoutineType {
827        fn from(value: i32) -> Self {
828            match value {
829                0 => Self::Unspecified,
830                1 => Self::TableValuedFunction,
831                _ => Self::UnknownValue(routine_type::UnknownValue(
832                    wkt::internal::UnknownEnumValue::Integer(value),
833                )),
834            }
835        }
836    }
837
838    impl std::convert::From<&str> for RoutineType {
839        fn from(value: &str) -> Self {
840            use std::string::ToString;
841            match value {
842                "ROUTINE_TYPE_UNSPECIFIED" => Self::Unspecified,
843                "TABLE_VALUED_FUNCTION" => Self::TableValuedFunction,
844                _ => Self::UnknownValue(routine_type::UnknownValue(
845                    wkt::internal::UnknownEnumValue::String(value.to_string()),
846                )),
847            }
848        }
849    }
850
851    impl serde::ser::Serialize for RoutineType {
852        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
853        where
854            S: serde::Serializer,
855        {
856            match self {
857                Self::Unspecified => serializer.serialize_i32(0),
858                Self::TableValuedFunction => serializer.serialize_i32(1),
859                Self::UnknownValue(u) => u.0.serialize(serializer),
860            }
861        }
862    }
863
864    impl<'de> serde::de::Deserialize<'de> for RoutineType {
865        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
866        where
867            D: serde::Deserializer<'de>,
868        {
869            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutineType>::new(
870                ".google.cloud.bigquery.analyticshub.v1.Routine.RoutineType",
871            ))
872        }
873    }
874}
875
876/// Message for creating a QueryTemplate.
877#[derive(Clone, Default, PartialEq)]
878#[non_exhaustive]
879pub struct CreateQueryTemplateRequest {
880    /// Required. The parent resource path of the QueryTemplate.
881    /// e.g.
882    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myQueryTemplate`.
883    pub parent: std::string::String,
884
885    /// Required. The ID of the QueryTemplate to create.
886    /// Must contain only Unicode letters, numbers (0-9), underscores (_).
887    /// Max length: 100 bytes.
888    pub query_template_id: std::string::String,
889
890    /// Required. The QueryTemplate to create.
891    pub query_template: std::option::Option<crate::model::QueryTemplate>,
892
893    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
894}
895
896impl CreateQueryTemplateRequest {
897    pub fn new() -> Self {
898        std::default::Default::default()
899    }
900
901    /// Sets the value of [parent][crate::model::CreateQueryTemplateRequest::parent].
902    ///
903    /// # Example
904    /// ```ignore,no_run
905    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateQueryTemplateRequest;
906    /// let x = CreateQueryTemplateRequest::new().set_parent("example");
907    /// ```
908    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
909        self.parent = v.into();
910        self
911    }
912
913    /// Sets the value of [query_template_id][crate::model::CreateQueryTemplateRequest::query_template_id].
914    ///
915    /// # Example
916    /// ```ignore,no_run
917    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateQueryTemplateRequest;
918    /// let x = CreateQueryTemplateRequest::new().set_query_template_id("example");
919    /// ```
920    pub fn set_query_template_id<T: std::convert::Into<std::string::String>>(
921        mut self,
922        v: T,
923    ) -> Self {
924        self.query_template_id = v.into();
925        self
926    }
927
928    /// Sets the value of [query_template][crate::model::CreateQueryTemplateRequest::query_template].
929    ///
930    /// # Example
931    /// ```ignore,no_run
932    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateQueryTemplateRequest;
933    /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
934    /// let x = CreateQueryTemplateRequest::new().set_query_template(QueryTemplate::default()/* use setters */);
935    /// ```
936    pub fn set_query_template<T>(mut self, v: T) -> Self
937    where
938        T: std::convert::Into<crate::model::QueryTemplate>,
939    {
940        self.query_template = std::option::Option::Some(v.into());
941        self
942    }
943
944    /// Sets or clears the value of [query_template][crate::model::CreateQueryTemplateRequest::query_template].
945    ///
946    /// # Example
947    /// ```ignore,no_run
948    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateQueryTemplateRequest;
949    /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
950    /// let x = CreateQueryTemplateRequest::new().set_or_clear_query_template(Some(QueryTemplate::default()/* use setters */));
951    /// let x = CreateQueryTemplateRequest::new().set_or_clear_query_template(None::<QueryTemplate>);
952    /// ```
953    pub fn set_or_clear_query_template<T>(mut self, v: std::option::Option<T>) -> Self
954    where
955        T: std::convert::Into<crate::model::QueryTemplate>,
956    {
957        self.query_template = v.map(|x| x.into());
958        self
959    }
960}
961
962impl wkt::message::Message for CreateQueryTemplateRequest {
963    fn typename() -> &'static str {
964        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CreateQueryTemplateRequest"
965    }
966}
967
968/// Message for creating a QueryTemplate.
969#[derive(Clone, Default, PartialEq)]
970#[non_exhaustive]
971pub struct GetQueryTemplateRequest {
972    /// Required. The parent resource path of the QueryTemplate.
973    /// e.g.
974    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
975    pub name: std::string::String,
976
977    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
978}
979
980impl GetQueryTemplateRequest {
981    pub fn new() -> Self {
982        std::default::Default::default()
983    }
984
985    /// Sets the value of [name][crate::model::GetQueryTemplateRequest::name].
986    ///
987    /// # Example
988    /// ```ignore,no_run
989    /// # use google_cloud_bigquery_analyticshub_v1::model::GetQueryTemplateRequest;
990    /// let x = GetQueryTemplateRequest::new().set_name("example");
991    /// ```
992    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
993        self.name = v.into();
994        self
995    }
996}
997
998impl wkt::message::Message for GetQueryTemplateRequest {
999    fn typename() -> &'static str {
1000        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetQueryTemplateRequest"
1001    }
1002}
1003
1004/// Message for requesting the list of QueryTemplates.
1005#[derive(Clone, Default, PartialEq)]
1006#[non_exhaustive]
1007pub struct ListQueryTemplatesRequest {
1008    /// Required. The parent resource path of the QueryTemplates.
1009    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
1010    pub parent: std::string::String,
1011
1012    /// Optional. The maximum number of results to return in a single response
1013    /// page. Leverage the page tokens to iterate through the entire collection.
1014    pub page_size: i32,
1015
1016    /// Optional. Page token, returned by a previous call, to request the next page
1017    /// of results.
1018    pub page_token: std::string::String,
1019
1020    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1021}
1022
1023impl ListQueryTemplatesRequest {
1024    pub fn new() -> Self {
1025        std::default::Default::default()
1026    }
1027
1028    /// Sets the value of [parent][crate::model::ListQueryTemplatesRequest::parent].
1029    ///
1030    /// # Example
1031    /// ```ignore,no_run
1032    /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesRequest;
1033    /// let x = ListQueryTemplatesRequest::new().set_parent("example");
1034    /// ```
1035    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1036        self.parent = v.into();
1037        self
1038    }
1039
1040    /// Sets the value of [page_size][crate::model::ListQueryTemplatesRequest::page_size].
1041    ///
1042    /// # Example
1043    /// ```ignore,no_run
1044    /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesRequest;
1045    /// let x = ListQueryTemplatesRequest::new().set_page_size(42);
1046    /// ```
1047    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1048        self.page_size = v.into();
1049        self
1050    }
1051
1052    /// Sets the value of [page_token][crate::model::ListQueryTemplatesRequest::page_token].
1053    ///
1054    /// # Example
1055    /// ```ignore,no_run
1056    /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesRequest;
1057    /// let x = ListQueryTemplatesRequest::new().set_page_token("example");
1058    /// ```
1059    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1060        self.page_token = v.into();
1061        self
1062    }
1063}
1064
1065impl wkt::message::Message for ListQueryTemplatesRequest {
1066    fn typename() -> &'static str {
1067        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListQueryTemplatesRequest"
1068    }
1069}
1070
1071/// Message for response to the list of QueryTemplates.
1072#[derive(Clone, Default, PartialEq)]
1073#[non_exhaustive]
1074pub struct ListQueryTemplatesResponse {
1075    /// The list of QueryTemplates.
1076    pub query_templates: std::vec::Vec<crate::model::QueryTemplate>,
1077
1078    /// A token to request the next page of results.
1079    pub next_page_token: std::string::String,
1080
1081    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1082}
1083
1084impl ListQueryTemplatesResponse {
1085    pub fn new() -> Self {
1086        std::default::Default::default()
1087    }
1088
1089    /// Sets the value of [query_templates][crate::model::ListQueryTemplatesResponse::query_templates].
1090    ///
1091    /// # Example
1092    /// ```ignore,no_run
1093    /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesResponse;
1094    /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
1095    /// let x = ListQueryTemplatesResponse::new()
1096    ///     .set_query_templates([
1097    ///         QueryTemplate::default()/* use setters */,
1098    ///         QueryTemplate::default()/* use (different) setters */,
1099    ///     ]);
1100    /// ```
1101    pub fn set_query_templates<T, V>(mut self, v: T) -> Self
1102    where
1103        T: std::iter::IntoIterator<Item = V>,
1104        V: std::convert::Into<crate::model::QueryTemplate>,
1105    {
1106        use std::iter::Iterator;
1107        self.query_templates = v.into_iter().map(|i| i.into()).collect();
1108        self
1109    }
1110
1111    /// Sets the value of [next_page_token][crate::model::ListQueryTemplatesResponse::next_page_token].
1112    ///
1113    /// # Example
1114    /// ```ignore,no_run
1115    /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesResponse;
1116    /// let x = ListQueryTemplatesResponse::new().set_next_page_token("example");
1117    /// ```
1118    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1119        self.next_page_token = v.into();
1120        self
1121    }
1122}
1123
1124impl wkt::message::Message for ListQueryTemplatesResponse {
1125    fn typename() -> &'static str {
1126        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListQueryTemplatesResponse"
1127    }
1128}
1129
1130#[doc(hidden)]
1131impl google_cloud_gax::paginator::internal::PageableResponse for ListQueryTemplatesResponse {
1132    type PageItem = crate::model::QueryTemplate;
1133
1134    fn items(self) -> std::vec::Vec<Self::PageItem> {
1135        self.query_templates
1136    }
1137
1138    fn next_page_token(&self) -> std::string::String {
1139        use std::clone::Clone;
1140        self.next_page_token.clone()
1141    }
1142}
1143
1144/// Message for updating a QueryTemplate.
1145#[derive(Clone, Default, PartialEq)]
1146#[non_exhaustive]
1147pub struct UpdateQueryTemplateRequest {
1148    /// Optional. Field mask specifies the fields to update in the query template
1149    /// resource. The fields specified in the `updateMask` are relative to the
1150    /// resource and are not a full request.
1151    pub update_mask: std::option::Option<wkt::FieldMask>,
1152
1153    /// Required. The QueryTemplate to update.
1154    pub query_template: std::option::Option<crate::model::QueryTemplate>,
1155
1156    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1157}
1158
1159impl UpdateQueryTemplateRequest {
1160    pub fn new() -> Self {
1161        std::default::Default::default()
1162    }
1163
1164    /// Sets the value of [update_mask][crate::model::UpdateQueryTemplateRequest::update_mask].
1165    ///
1166    /// # Example
1167    /// ```ignore,no_run
1168    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1169    /// use wkt::FieldMask;
1170    /// let x = UpdateQueryTemplateRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1171    /// ```
1172    pub fn set_update_mask<T>(mut self, v: T) -> Self
1173    where
1174        T: std::convert::Into<wkt::FieldMask>,
1175    {
1176        self.update_mask = std::option::Option::Some(v.into());
1177        self
1178    }
1179
1180    /// Sets or clears the value of [update_mask][crate::model::UpdateQueryTemplateRequest::update_mask].
1181    ///
1182    /// # Example
1183    /// ```ignore,no_run
1184    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1185    /// use wkt::FieldMask;
1186    /// let x = UpdateQueryTemplateRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1187    /// let x = UpdateQueryTemplateRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1188    /// ```
1189    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1190    where
1191        T: std::convert::Into<wkt::FieldMask>,
1192    {
1193        self.update_mask = v.map(|x| x.into());
1194        self
1195    }
1196
1197    /// Sets the value of [query_template][crate::model::UpdateQueryTemplateRequest::query_template].
1198    ///
1199    /// # Example
1200    /// ```ignore,no_run
1201    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1202    /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
1203    /// let x = UpdateQueryTemplateRequest::new().set_query_template(QueryTemplate::default()/* use setters */);
1204    /// ```
1205    pub fn set_query_template<T>(mut self, v: T) -> Self
1206    where
1207        T: std::convert::Into<crate::model::QueryTemplate>,
1208    {
1209        self.query_template = std::option::Option::Some(v.into());
1210        self
1211    }
1212
1213    /// Sets or clears the value of [query_template][crate::model::UpdateQueryTemplateRequest::query_template].
1214    ///
1215    /// # Example
1216    /// ```ignore,no_run
1217    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1218    /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
1219    /// let x = UpdateQueryTemplateRequest::new().set_or_clear_query_template(Some(QueryTemplate::default()/* use setters */));
1220    /// let x = UpdateQueryTemplateRequest::new().set_or_clear_query_template(None::<QueryTemplate>);
1221    /// ```
1222    pub fn set_or_clear_query_template<T>(mut self, v: std::option::Option<T>) -> Self
1223    where
1224        T: std::convert::Into<crate::model::QueryTemplate>,
1225    {
1226        self.query_template = v.map(|x| x.into());
1227        self
1228    }
1229}
1230
1231impl wkt::message::Message for UpdateQueryTemplateRequest {
1232    fn typename() -> &'static str {
1233        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.UpdateQueryTemplateRequest"
1234    }
1235}
1236
1237/// Message for deleting a QueryTemplate.
1238#[derive(Clone, Default, PartialEq)]
1239#[non_exhaustive]
1240pub struct DeleteQueryTemplateRequest {
1241    /// Required. The resource path of the QueryTemplate.
1242    /// e.g.
1243    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
1244    pub name: std::string::String,
1245
1246    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1247}
1248
1249impl DeleteQueryTemplateRequest {
1250    pub fn new() -> Self {
1251        std::default::Default::default()
1252    }
1253
1254    /// Sets the value of [name][crate::model::DeleteQueryTemplateRequest::name].
1255    ///
1256    /// # Example
1257    /// ```ignore,no_run
1258    /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteQueryTemplateRequest;
1259    /// let x = DeleteQueryTemplateRequest::new().set_name("example");
1260    /// ```
1261    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1262        self.name = v.into();
1263        self
1264    }
1265}
1266
1267impl wkt::message::Message for DeleteQueryTemplateRequest {
1268    fn typename() -> &'static str {
1269        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteQueryTemplateRequest"
1270    }
1271}
1272
1273/// Message for submitting a QueryTemplate.
1274#[derive(Clone, Default, PartialEq)]
1275#[non_exhaustive]
1276pub struct SubmitQueryTemplateRequest {
1277    /// Required. The resource path of the QueryTemplate.
1278    /// e.g.
1279    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
1280    pub name: std::string::String,
1281
1282    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1283}
1284
1285impl SubmitQueryTemplateRequest {
1286    pub fn new() -> Self {
1287        std::default::Default::default()
1288    }
1289
1290    /// Sets the value of [name][crate::model::SubmitQueryTemplateRequest::name].
1291    ///
1292    /// # Example
1293    /// ```ignore,no_run
1294    /// # use google_cloud_bigquery_analyticshub_v1::model::SubmitQueryTemplateRequest;
1295    /// let x = SubmitQueryTemplateRequest::new().set_name("example");
1296    /// ```
1297    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1298        self.name = v.into();
1299        self
1300    }
1301}
1302
1303impl wkt::message::Message for SubmitQueryTemplateRequest {
1304    fn typename() -> &'static str {
1305        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubmitQueryTemplateRequest"
1306    }
1307}
1308
1309/// Message for approving a QueryTemplate.
1310#[derive(Clone, Default, PartialEq)]
1311#[non_exhaustive]
1312pub struct ApproveQueryTemplateRequest {
1313    /// Required. The resource path of the QueryTemplate.
1314    /// e.g.
1315    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
1316    pub name: std::string::String,
1317
1318    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1319}
1320
1321impl ApproveQueryTemplateRequest {
1322    pub fn new() -> Self {
1323        std::default::Default::default()
1324    }
1325
1326    /// Sets the value of [name][crate::model::ApproveQueryTemplateRequest::name].
1327    ///
1328    /// # Example
1329    /// ```ignore,no_run
1330    /// # use google_cloud_bigquery_analyticshub_v1::model::ApproveQueryTemplateRequest;
1331    /// let x = ApproveQueryTemplateRequest::new().set_name("example");
1332    /// ```
1333    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1334        self.name = v.into();
1335        self
1336    }
1337}
1338
1339impl wkt::message::Message for ApproveQueryTemplateRequest {
1340    fn typename() -> &'static str {
1341        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ApproveQueryTemplateRequest"
1342    }
1343}
1344
1345/// Sharing environment is a behavior model for sharing data within a
1346/// data exchange. This option is configurable for a data exchange.
1347#[derive(Clone, Default, PartialEq)]
1348#[non_exhaustive]
1349pub struct SharingEnvironmentConfig {
1350    pub environment: std::option::Option<crate::model::sharing_environment_config::Environment>,
1351
1352    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1353}
1354
1355impl SharingEnvironmentConfig {
1356    pub fn new() -> Self {
1357        std::default::Default::default()
1358    }
1359
1360    /// Sets the value of [environment][crate::model::SharingEnvironmentConfig::environment].
1361    ///
1362    /// Note that all the setters affecting `environment` are mutually
1363    /// exclusive.
1364    ///
1365    /// # Example
1366    /// ```ignore,no_run
1367    /// # use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
1368    /// use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DefaultExchangeConfig;
1369    /// let x = SharingEnvironmentConfig::new().set_environment(Some(
1370    ///     google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::Environment::DefaultExchangeConfig(DefaultExchangeConfig::default().into())));
1371    /// ```
1372    pub fn set_environment<
1373        T: std::convert::Into<
1374                std::option::Option<crate::model::sharing_environment_config::Environment>,
1375            >,
1376    >(
1377        mut self,
1378        v: T,
1379    ) -> Self {
1380        self.environment = v.into();
1381        self
1382    }
1383
1384    /// The value of [environment][crate::model::SharingEnvironmentConfig::environment]
1385    /// if it holds a `DefaultExchangeConfig`, `None` if the field is not set or
1386    /// holds a different branch.
1387    pub fn default_exchange_config(
1388        &self,
1389    ) -> std::option::Option<
1390        &std::boxed::Box<crate::model::sharing_environment_config::DefaultExchangeConfig>,
1391    > {
1392        #[allow(unreachable_patterns)]
1393        self.environment.as_ref().and_then(|v| match v {
1394            crate::model::sharing_environment_config::Environment::DefaultExchangeConfig(v) => {
1395                std::option::Option::Some(v)
1396            }
1397            _ => std::option::Option::None,
1398        })
1399    }
1400
1401    /// Sets the value of [environment][crate::model::SharingEnvironmentConfig::environment]
1402    /// to hold a `DefaultExchangeConfig`.
1403    ///
1404    /// Note that all the setters affecting `environment` are
1405    /// mutually exclusive.
1406    ///
1407    /// # Example
1408    /// ```ignore,no_run
1409    /// # use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
1410    /// use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DefaultExchangeConfig;
1411    /// let x = SharingEnvironmentConfig::new().set_default_exchange_config(DefaultExchangeConfig::default()/* use setters */);
1412    /// assert!(x.default_exchange_config().is_some());
1413    /// assert!(x.dcr_exchange_config().is_none());
1414    /// ```
1415    pub fn set_default_exchange_config<
1416        T: std::convert::Into<
1417                std::boxed::Box<crate::model::sharing_environment_config::DefaultExchangeConfig>,
1418            >,
1419    >(
1420        mut self,
1421        v: T,
1422    ) -> Self {
1423        self.environment = std::option::Option::Some(
1424            crate::model::sharing_environment_config::Environment::DefaultExchangeConfig(v.into()),
1425        );
1426        self
1427    }
1428
1429    /// The value of [environment][crate::model::SharingEnvironmentConfig::environment]
1430    /// if it holds a `DcrExchangeConfig`, `None` if the field is not set or
1431    /// holds a different branch.
1432    pub fn dcr_exchange_config(
1433        &self,
1434    ) -> std::option::Option<
1435        &std::boxed::Box<crate::model::sharing_environment_config::DcrExchangeConfig>,
1436    > {
1437        #[allow(unreachable_patterns)]
1438        self.environment.as_ref().and_then(|v| match v {
1439            crate::model::sharing_environment_config::Environment::DcrExchangeConfig(v) => {
1440                std::option::Option::Some(v)
1441            }
1442            _ => std::option::Option::None,
1443        })
1444    }
1445
1446    /// Sets the value of [environment][crate::model::SharingEnvironmentConfig::environment]
1447    /// to hold a `DcrExchangeConfig`.
1448    ///
1449    /// Note that all the setters affecting `environment` are
1450    /// mutually exclusive.
1451    ///
1452    /// # Example
1453    /// ```ignore,no_run
1454    /// # use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
1455    /// use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1456    /// let x = SharingEnvironmentConfig::new().set_dcr_exchange_config(DcrExchangeConfig::default()/* use setters */);
1457    /// assert!(x.dcr_exchange_config().is_some());
1458    /// assert!(x.default_exchange_config().is_none());
1459    /// ```
1460    pub fn set_dcr_exchange_config<
1461        T: std::convert::Into<
1462                std::boxed::Box<crate::model::sharing_environment_config::DcrExchangeConfig>,
1463            >,
1464    >(
1465        mut self,
1466        v: T,
1467    ) -> Self {
1468        self.environment = std::option::Option::Some(
1469            crate::model::sharing_environment_config::Environment::DcrExchangeConfig(v.into()),
1470        );
1471        self
1472    }
1473}
1474
1475impl wkt::message::Message for SharingEnvironmentConfig {
1476    fn typename() -> &'static str {
1477        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig"
1478    }
1479}
1480
1481/// Defines additional types related to [SharingEnvironmentConfig].
1482pub mod sharing_environment_config {
1483    #[allow(unused_imports)]
1484    use super::*;
1485
1486    /// Default Analytics Hub data exchange, used for secured data sharing.
1487    #[derive(Clone, Default, PartialEq)]
1488    #[non_exhaustive]
1489    pub struct DefaultExchangeConfig {
1490        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1491    }
1492
1493    impl DefaultExchangeConfig {
1494        pub fn new() -> Self {
1495            std::default::Default::default()
1496        }
1497    }
1498
1499    impl wkt::message::Message for DefaultExchangeConfig {
1500        fn typename() -> &'static str {
1501            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig.DefaultExchangeConfig"
1502        }
1503    }
1504
1505    /// Data Clean Room (DCR), used for privacy-safe and secured data sharing.
1506    #[derive(Clone, Default, PartialEq)]
1507    #[non_exhaustive]
1508    pub struct DcrExchangeConfig {
1509        /// Output only. If True, this DCR restricts the contributors to sharing
1510        /// only a single resource in a Listing. And no two resources should have the
1511        /// same IDs. So if a contributor adds a view with a conflicting name, the
1512        /// CreateListing API will reject the request. if False, the data contributor
1513        /// can publish an entire dataset (as before). This is not configurable, and
1514        /// by default, all new DCRs will have the restriction set to True.
1515        pub single_selected_resource_sharing_restriction: std::option::Option<bool>,
1516
1517        /// Output only. If True, when subscribing to this DCR, it will create only
1518        /// one linked dataset containing all resources shared within the
1519        /// cleanroom. If False, when subscribing to this DCR, it will
1520        /// create 1 linked dataset per listing. This is not configurable, and by
1521        /// default, all new DCRs will have the restriction set to True.
1522        pub single_linked_dataset_per_cleanroom: std::option::Option<bool>,
1523
1524        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1525    }
1526
1527    impl DcrExchangeConfig {
1528        pub fn new() -> Self {
1529            std::default::Default::default()
1530        }
1531
1532        /// Sets the value of [single_selected_resource_sharing_restriction][crate::model::sharing_environment_config::DcrExchangeConfig::single_selected_resource_sharing_restriction].
1533        ///
1534        /// # Example
1535        /// ```ignore,no_run
1536        /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1537        /// let x = DcrExchangeConfig::new().set_single_selected_resource_sharing_restriction(true);
1538        /// ```
1539        pub fn set_single_selected_resource_sharing_restriction<T>(mut self, v: T) -> Self
1540        where
1541            T: std::convert::Into<bool>,
1542        {
1543            self.single_selected_resource_sharing_restriction = std::option::Option::Some(v.into());
1544            self
1545        }
1546
1547        /// Sets or clears the value of [single_selected_resource_sharing_restriction][crate::model::sharing_environment_config::DcrExchangeConfig::single_selected_resource_sharing_restriction].
1548        ///
1549        /// # Example
1550        /// ```ignore,no_run
1551        /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1552        /// let x = DcrExchangeConfig::new().set_or_clear_single_selected_resource_sharing_restriction(Some(false));
1553        /// let x = DcrExchangeConfig::new().set_or_clear_single_selected_resource_sharing_restriction(None::<bool>);
1554        /// ```
1555        pub fn set_or_clear_single_selected_resource_sharing_restriction<T>(
1556            mut self,
1557            v: std::option::Option<T>,
1558        ) -> Self
1559        where
1560            T: std::convert::Into<bool>,
1561        {
1562            self.single_selected_resource_sharing_restriction = v.map(|x| x.into());
1563            self
1564        }
1565
1566        /// Sets the value of [single_linked_dataset_per_cleanroom][crate::model::sharing_environment_config::DcrExchangeConfig::single_linked_dataset_per_cleanroom].
1567        ///
1568        /// # Example
1569        /// ```ignore,no_run
1570        /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1571        /// let x = DcrExchangeConfig::new().set_single_linked_dataset_per_cleanroom(true);
1572        /// ```
1573        pub fn set_single_linked_dataset_per_cleanroom<T>(mut self, v: T) -> Self
1574        where
1575            T: std::convert::Into<bool>,
1576        {
1577            self.single_linked_dataset_per_cleanroom = std::option::Option::Some(v.into());
1578            self
1579        }
1580
1581        /// Sets or clears the value of [single_linked_dataset_per_cleanroom][crate::model::sharing_environment_config::DcrExchangeConfig::single_linked_dataset_per_cleanroom].
1582        ///
1583        /// # Example
1584        /// ```ignore,no_run
1585        /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1586        /// let x = DcrExchangeConfig::new().set_or_clear_single_linked_dataset_per_cleanroom(Some(false));
1587        /// let x = DcrExchangeConfig::new().set_or_clear_single_linked_dataset_per_cleanroom(None::<bool>);
1588        /// ```
1589        pub fn set_or_clear_single_linked_dataset_per_cleanroom<T>(
1590            mut self,
1591            v: std::option::Option<T>,
1592        ) -> Self
1593        where
1594            T: std::convert::Into<bool>,
1595        {
1596            self.single_linked_dataset_per_cleanroom = v.map(|x| x.into());
1597            self
1598        }
1599    }
1600
1601    impl wkt::message::Message for DcrExchangeConfig {
1602        fn typename() -> &'static str {
1603            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig.DcrExchangeConfig"
1604        }
1605    }
1606
1607    #[derive(Clone, Debug, PartialEq)]
1608    #[non_exhaustive]
1609    pub enum Environment {
1610        /// Default Analytics Hub data exchange, used for secured data sharing.
1611        DefaultExchangeConfig(
1612            std::boxed::Box<crate::model::sharing_environment_config::DefaultExchangeConfig>,
1613        ),
1614        /// Data Clean Room (DCR), used for privacy-safe and secured data sharing.
1615        DcrExchangeConfig(
1616            std::boxed::Box<crate::model::sharing_environment_config::DcrExchangeConfig>,
1617        ),
1618    }
1619}
1620
1621/// Contains details of the data provider.
1622#[derive(Clone, Default, PartialEq)]
1623#[non_exhaustive]
1624pub struct DataProvider {
1625    /// Optional. Name of the data provider.
1626    pub name: std::string::String,
1627
1628    /// Optional. Email or URL of the data provider.
1629    /// Max Length: 1000 bytes.
1630    pub primary_contact: std::string::String,
1631
1632    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1633}
1634
1635impl DataProvider {
1636    pub fn new() -> Self {
1637        std::default::Default::default()
1638    }
1639
1640    /// Sets the value of [name][crate::model::DataProvider::name].
1641    ///
1642    /// # Example
1643    /// ```ignore,no_run
1644    /// # use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
1645    /// let x = DataProvider::new().set_name("example");
1646    /// ```
1647    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1648        self.name = v.into();
1649        self
1650    }
1651
1652    /// Sets the value of [primary_contact][crate::model::DataProvider::primary_contact].
1653    ///
1654    /// # Example
1655    /// ```ignore,no_run
1656    /// # use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
1657    /// let x = DataProvider::new().set_primary_contact("example");
1658    /// ```
1659    pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1660        self.primary_contact = v.into();
1661        self
1662    }
1663}
1664
1665impl wkt::message::Message for DataProvider {
1666    fn typename() -> &'static str {
1667        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DataProvider"
1668    }
1669}
1670
1671/// Contains details of the listing publisher.
1672#[derive(Clone, Default, PartialEq)]
1673#[non_exhaustive]
1674pub struct Publisher {
1675    /// Optional. Name of the listing publisher.
1676    pub name: std::string::String,
1677
1678    /// Optional. Email or URL of the listing publisher.
1679    /// Max Length: 1000 bytes.
1680    pub primary_contact: std::string::String,
1681
1682    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1683}
1684
1685impl Publisher {
1686    pub fn new() -> Self {
1687        std::default::Default::default()
1688    }
1689
1690    /// Sets the value of [name][crate::model::Publisher::name].
1691    ///
1692    /// # Example
1693    /// ```ignore,no_run
1694    /// # use google_cloud_bigquery_analyticshub_v1::model::Publisher;
1695    /// let x = Publisher::new().set_name("example");
1696    /// ```
1697    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1698        self.name = v.into();
1699        self
1700    }
1701
1702    /// Sets the value of [primary_contact][crate::model::Publisher::primary_contact].
1703    ///
1704    /// # Example
1705    /// ```ignore,no_run
1706    /// # use google_cloud_bigquery_analyticshub_v1::model::Publisher;
1707    /// let x = Publisher::new().set_primary_contact("example");
1708    /// ```
1709    pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1710        self.primary_contact = v.into();
1711        self
1712    }
1713}
1714
1715impl wkt::message::Message for Publisher {
1716    fn typename() -> &'static str {
1717        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Publisher"
1718    }
1719}
1720
1721#[derive(Clone, Default, PartialEq)]
1722#[non_exhaustive]
1723pub struct DestinationDatasetReference {
1724    /// Required. A unique ID for this dataset, without the project name. The ID
1725    /// must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_).
1726    /// The maximum length is 1,024 characters.
1727    pub dataset_id: std::string::String,
1728
1729    /// Required. The ID of the project containing this dataset.
1730    pub project_id: std::string::String,
1731
1732    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1733}
1734
1735impl DestinationDatasetReference {
1736    pub fn new() -> Self {
1737        std::default::Default::default()
1738    }
1739
1740    /// Sets the value of [dataset_id][crate::model::DestinationDatasetReference::dataset_id].
1741    ///
1742    /// # Example
1743    /// ```ignore,no_run
1744    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1745    /// let x = DestinationDatasetReference::new().set_dataset_id("example");
1746    /// ```
1747    pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1748        self.dataset_id = v.into();
1749        self
1750    }
1751
1752    /// Sets the value of [project_id][crate::model::DestinationDatasetReference::project_id].
1753    ///
1754    /// # Example
1755    /// ```ignore,no_run
1756    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1757    /// let x = DestinationDatasetReference::new().set_project_id("example");
1758    /// ```
1759    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1760        self.project_id = v.into();
1761        self
1762    }
1763}
1764
1765impl wkt::message::Message for DestinationDatasetReference {
1766    fn typename() -> &'static str {
1767        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference"
1768    }
1769}
1770
1771/// Defines the destination bigquery dataset.
1772#[derive(Clone, Default, PartialEq)]
1773#[non_exhaustive]
1774pub struct DestinationDataset {
1775    /// Required. A reference that identifies the destination dataset.
1776    pub dataset_reference: std::option::Option<crate::model::DestinationDatasetReference>,
1777
1778    /// Optional. A descriptive name for the dataset.
1779    pub friendly_name: std::option::Option<wkt::StringValue>,
1780
1781    /// Optional. A user-friendly description of the dataset.
1782    pub description: std::option::Option<wkt::StringValue>,
1783
1784    /// Optional. The labels associated with this dataset. You can use these
1785    /// to organize and group your datasets.
1786    /// You can set this property when inserting or updating a dataset.
1787    /// See <https://cloud.google.com/resource-manager/docs/creating-managing-labels>
1788    /// for more information.
1789    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1790
1791    /// Required. The geographic location where the dataset should reside. See
1792    /// <https://cloud.google.com/bigquery/docs/locations> for supported
1793    /// locations.
1794    pub location: std::string::String,
1795
1796    /// Optional. The geographic locations where the dataset should be replicated.
1797    /// See [BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
1798    /// for supported locations.
1799    pub replica_locations: std::vec::Vec<std::string::String>,
1800
1801    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1802}
1803
1804impl DestinationDataset {
1805    pub fn new() -> Self {
1806        std::default::Default::default()
1807    }
1808
1809    /// Sets the value of [dataset_reference][crate::model::DestinationDataset::dataset_reference].
1810    ///
1811    /// # Example
1812    /// ```ignore,no_run
1813    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1814    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1815    /// let x = DestinationDataset::new().set_dataset_reference(DestinationDatasetReference::default()/* use setters */);
1816    /// ```
1817    pub fn set_dataset_reference<T>(mut self, v: T) -> Self
1818    where
1819        T: std::convert::Into<crate::model::DestinationDatasetReference>,
1820    {
1821        self.dataset_reference = std::option::Option::Some(v.into());
1822        self
1823    }
1824
1825    /// Sets or clears the value of [dataset_reference][crate::model::DestinationDataset::dataset_reference].
1826    ///
1827    /// # Example
1828    /// ```ignore,no_run
1829    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1830    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1831    /// let x = DestinationDataset::new().set_or_clear_dataset_reference(Some(DestinationDatasetReference::default()/* use setters */));
1832    /// let x = DestinationDataset::new().set_or_clear_dataset_reference(None::<DestinationDatasetReference>);
1833    /// ```
1834    pub fn set_or_clear_dataset_reference<T>(mut self, v: std::option::Option<T>) -> Self
1835    where
1836        T: std::convert::Into<crate::model::DestinationDatasetReference>,
1837    {
1838        self.dataset_reference = v.map(|x| x.into());
1839        self
1840    }
1841
1842    /// Sets the value of [friendly_name][crate::model::DestinationDataset::friendly_name].
1843    ///
1844    /// # Example
1845    /// ```ignore,no_run
1846    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1847    /// use wkt::StringValue;
1848    /// let x = DestinationDataset::new().set_friendly_name(StringValue::default()/* use setters */);
1849    /// ```
1850    pub fn set_friendly_name<T>(mut self, v: T) -> Self
1851    where
1852        T: std::convert::Into<wkt::StringValue>,
1853    {
1854        self.friendly_name = std::option::Option::Some(v.into());
1855        self
1856    }
1857
1858    /// Sets or clears the value of [friendly_name][crate::model::DestinationDataset::friendly_name].
1859    ///
1860    /// # Example
1861    /// ```ignore,no_run
1862    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1863    /// use wkt::StringValue;
1864    /// let x = DestinationDataset::new().set_or_clear_friendly_name(Some(StringValue::default()/* use setters */));
1865    /// let x = DestinationDataset::new().set_or_clear_friendly_name(None::<StringValue>);
1866    /// ```
1867    pub fn set_or_clear_friendly_name<T>(mut self, v: std::option::Option<T>) -> Self
1868    where
1869        T: std::convert::Into<wkt::StringValue>,
1870    {
1871        self.friendly_name = v.map(|x| x.into());
1872        self
1873    }
1874
1875    /// Sets the value of [description][crate::model::DestinationDataset::description].
1876    ///
1877    /// # Example
1878    /// ```ignore,no_run
1879    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1880    /// use wkt::StringValue;
1881    /// let x = DestinationDataset::new().set_description(StringValue::default()/* use setters */);
1882    /// ```
1883    pub fn set_description<T>(mut self, v: T) -> Self
1884    where
1885        T: std::convert::Into<wkt::StringValue>,
1886    {
1887        self.description = std::option::Option::Some(v.into());
1888        self
1889    }
1890
1891    /// Sets or clears the value of [description][crate::model::DestinationDataset::description].
1892    ///
1893    /// # Example
1894    /// ```ignore,no_run
1895    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1896    /// use wkt::StringValue;
1897    /// let x = DestinationDataset::new().set_or_clear_description(Some(StringValue::default()/* use setters */));
1898    /// let x = DestinationDataset::new().set_or_clear_description(None::<StringValue>);
1899    /// ```
1900    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
1901    where
1902        T: std::convert::Into<wkt::StringValue>,
1903    {
1904        self.description = v.map(|x| x.into());
1905        self
1906    }
1907
1908    /// Sets the value of [labels][crate::model::DestinationDataset::labels].
1909    ///
1910    /// # Example
1911    /// ```ignore,no_run
1912    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1913    /// let x = DestinationDataset::new().set_labels([
1914    ///     ("key0", "abc"),
1915    ///     ("key1", "xyz"),
1916    /// ]);
1917    /// ```
1918    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1919    where
1920        T: std::iter::IntoIterator<Item = (K, V)>,
1921        K: std::convert::Into<std::string::String>,
1922        V: std::convert::Into<std::string::String>,
1923    {
1924        use std::iter::Iterator;
1925        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1926        self
1927    }
1928
1929    /// Sets the value of [location][crate::model::DestinationDataset::location].
1930    ///
1931    /// # Example
1932    /// ```ignore,no_run
1933    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1934    /// let x = DestinationDataset::new().set_location("example");
1935    /// ```
1936    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1937        self.location = v.into();
1938        self
1939    }
1940
1941    /// Sets the value of [replica_locations][crate::model::DestinationDataset::replica_locations].
1942    ///
1943    /// # Example
1944    /// ```ignore,no_run
1945    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1946    /// let x = DestinationDataset::new().set_replica_locations(["a", "b", "c"]);
1947    /// ```
1948    pub fn set_replica_locations<T, V>(mut self, v: T) -> Self
1949    where
1950        T: std::iter::IntoIterator<Item = V>,
1951        V: std::convert::Into<std::string::String>,
1952    {
1953        use std::iter::Iterator;
1954        self.replica_locations = v.into_iter().map(|i| i.into()).collect();
1955        self
1956    }
1957}
1958
1959impl wkt::message::Message for DestinationDataset {
1960    fn typename() -> &'static str {
1961        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DestinationDataset"
1962    }
1963}
1964
1965/// Defines the destination Pub/Sub subscription.
1966#[derive(Clone, Default, PartialEq)]
1967#[non_exhaustive]
1968pub struct DestinationPubSubSubscription {
1969    /// Required. Destination Pub/Sub subscription resource.
1970    pub pubsub_subscription: std::option::Option<crate::model::PubSubSubscription>,
1971
1972    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1973}
1974
1975impl DestinationPubSubSubscription {
1976    pub fn new() -> Self {
1977        std::default::Default::default()
1978    }
1979
1980    /// Sets the value of [pubsub_subscription][crate::model::DestinationPubSubSubscription::pubsub_subscription].
1981    ///
1982    /// # Example
1983    /// ```ignore,no_run
1984    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationPubSubSubscription;
1985    /// use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
1986    /// let x = DestinationPubSubSubscription::new().set_pubsub_subscription(PubSubSubscription::default()/* use setters */);
1987    /// ```
1988    pub fn set_pubsub_subscription<T>(mut self, v: T) -> Self
1989    where
1990        T: std::convert::Into<crate::model::PubSubSubscription>,
1991    {
1992        self.pubsub_subscription = std::option::Option::Some(v.into());
1993        self
1994    }
1995
1996    /// Sets or clears the value of [pubsub_subscription][crate::model::DestinationPubSubSubscription::pubsub_subscription].
1997    ///
1998    /// # Example
1999    /// ```ignore,no_run
2000    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationPubSubSubscription;
2001    /// use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
2002    /// let x = DestinationPubSubSubscription::new().set_or_clear_pubsub_subscription(Some(PubSubSubscription::default()/* use setters */));
2003    /// let x = DestinationPubSubSubscription::new().set_or_clear_pubsub_subscription(None::<PubSubSubscription>);
2004    /// ```
2005    pub fn set_or_clear_pubsub_subscription<T>(mut self, v: std::option::Option<T>) -> Self
2006    where
2007        T: std::convert::Into<crate::model::PubSubSubscription>,
2008    {
2009        self.pubsub_subscription = v.map(|x| x.into());
2010        self
2011    }
2012}
2013
2014impl wkt::message::Message for DestinationPubSubSubscription {
2015    fn typename() -> &'static str {
2016        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DestinationPubSubSubscription"
2017    }
2018}
2019
2020/// A listing is what gets published into a data exchange that a subscriber can
2021/// subscribe to. It contains a reference to the data source along with
2022/// descriptive information that will help subscribers find and subscribe the
2023/// data.
2024#[derive(Clone, Default, PartialEq)]
2025#[non_exhaustive]
2026pub struct Listing {
2027    /// Output only. The resource name of the listing.
2028    /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`
2029    pub name: std::string::String,
2030
2031    /// Required. Human-readable display name of the listing. The display name must
2032    /// contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
2033    /// spaces ( ), ampersands (&) and can't start or end with spaces. Default
2034    /// value is an empty string. Max length: 63 bytes.
2035    pub display_name: std::string::String,
2036
2037    /// Optional. Short description of the listing. The description must not
2038    /// contain Unicode non-characters and C0 and C1 control codes except tabs
2039    /// (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default
2040    /// value is an empty string. Max length: 2000 bytes.
2041    pub description: std::string::String,
2042
2043    /// Optional. Email or URL of the primary point of contact of the listing.
2044    /// Max Length: 1000 bytes.
2045    pub primary_contact: std::string::String,
2046
2047    /// Optional. Documentation describing the listing.
2048    pub documentation: std::string::String,
2049
2050    /// Output only. Current state of the listing.
2051    pub state: crate::model::listing::State,
2052
2053    /// Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB
2054    /// Expected image dimensions are 512x512 pixels, however the API only
2055    /// performs validation on size of the encoded data.
2056    /// Note: For byte fields, the contents of the field are base64-encoded (which
2057    /// increases the size of the data by 33-36%) when using JSON on the wire.
2058    pub icon: ::bytes::Bytes,
2059
2060    /// Optional. Details of the data provider who owns the source data.
2061    pub data_provider: std::option::Option<crate::model::DataProvider>,
2062
2063    /// Optional. Categories of the listing. Up to five categories are allowed.
2064    pub categories: std::vec::Vec<crate::model::listing::Category>,
2065
2066    /// Optional. Details of the publisher who owns the listing and who can share
2067    /// the source data.
2068    pub publisher: std::option::Option<crate::model::Publisher>,
2069
2070    /// Optional. Email or URL of the request access of the listing.
2071    /// Subscribers can use this reference to request access.
2072    /// Max Length: 1000 bytes.
2073    pub request_access: std::string::String,
2074
2075    /// Optional. If set, restricted export configuration will be propagated and
2076    /// enforced on the linked dataset.
2077    pub restricted_export_config:
2078        std::option::Option<crate::model::listing::RestrictedExportConfig>,
2079
2080    /// Optional. If set, stored procedure configuration will be propagated and
2081    /// enforced on the linked dataset.
2082    pub stored_procedure_config: std::option::Option<crate::model::StoredProcedureConfig>,
2083
2084    /// Optional. Type of discovery of the listing on the discovery page.
2085    pub discovery_type: std::option::Option<crate::model::DiscoveryType>,
2086
2087    /// Output only. Listing shared asset type.
2088    pub resource_type: crate::model::SharedResourceType,
2089
2090    /// Output only. Commercial info contains the information about the commercial
2091    /// data products associated with the listing.
2092    pub commercial_info: std::option::Option<crate::model::listing::CommercialInfo>,
2093
2094    /// Optional. By default, false.
2095    /// If true, the Listing has an email sharing mandate enabled.
2096    pub log_linked_dataset_query_user_email: std::option::Option<bool>,
2097
2098    /// Optional. If true, the listing is only available to get the resource
2099    /// metadata. Listing is non subscribable.
2100    pub allow_only_metadata_sharing: std::option::Option<bool>,
2101
2102    /// Listing source.
2103    pub source: std::option::Option<crate::model::listing::Source>,
2104
2105    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2106}
2107
2108impl Listing {
2109    pub fn new() -> Self {
2110        std::default::Default::default()
2111    }
2112
2113    /// Sets the value of [name][crate::model::Listing::name].
2114    ///
2115    /// # Example
2116    /// ```ignore,no_run
2117    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2118    /// let x = Listing::new().set_name("example");
2119    /// ```
2120    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2121        self.name = v.into();
2122        self
2123    }
2124
2125    /// Sets the value of [display_name][crate::model::Listing::display_name].
2126    ///
2127    /// # Example
2128    /// ```ignore,no_run
2129    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2130    /// let x = Listing::new().set_display_name("example");
2131    /// ```
2132    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2133        self.display_name = v.into();
2134        self
2135    }
2136
2137    /// Sets the value of [description][crate::model::Listing::description].
2138    ///
2139    /// # Example
2140    /// ```ignore,no_run
2141    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2142    /// let x = Listing::new().set_description("example");
2143    /// ```
2144    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2145        self.description = v.into();
2146        self
2147    }
2148
2149    /// Sets the value of [primary_contact][crate::model::Listing::primary_contact].
2150    ///
2151    /// # Example
2152    /// ```ignore,no_run
2153    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2154    /// let x = Listing::new().set_primary_contact("example");
2155    /// ```
2156    pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2157        self.primary_contact = v.into();
2158        self
2159    }
2160
2161    /// Sets the value of [documentation][crate::model::Listing::documentation].
2162    ///
2163    /// # Example
2164    /// ```ignore,no_run
2165    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2166    /// let x = Listing::new().set_documentation("example");
2167    /// ```
2168    pub fn set_documentation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2169        self.documentation = v.into();
2170        self
2171    }
2172
2173    /// Sets the value of [state][crate::model::Listing::state].
2174    ///
2175    /// # Example
2176    /// ```ignore,no_run
2177    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2178    /// use google_cloud_bigquery_analyticshub_v1::model::listing::State;
2179    /// let x0 = Listing::new().set_state(State::Active);
2180    /// ```
2181    pub fn set_state<T: std::convert::Into<crate::model::listing::State>>(mut self, v: T) -> Self {
2182        self.state = v.into();
2183        self
2184    }
2185
2186    /// Sets the value of [icon][crate::model::Listing::icon].
2187    ///
2188    /// # Example
2189    /// ```ignore,no_run
2190    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2191    /// let x = Listing::new().set_icon(bytes::Bytes::from_static(b"example"));
2192    /// ```
2193    pub fn set_icon<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2194        self.icon = v.into();
2195        self
2196    }
2197
2198    /// Sets the value of [data_provider][crate::model::Listing::data_provider].
2199    ///
2200    /// # Example
2201    /// ```ignore,no_run
2202    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2203    /// use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
2204    /// let x = Listing::new().set_data_provider(DataProvider::default()/* use setters */);
2205    /// ```
2206    pub fn set_data_provider<T>(mut self, v: T) -> Self
2207    where
2208        T: std::convert::Into<crate::model::DataProvider>,
2209    {
2210        self.data_provider = std::option::Option::Some(v.into());
2211        self
2212    }
2213
2214    /// Sets or clears the value of [data_provider][crate::model::Listing::data_provider].
2215    ///
2216    /// # Example
2217    /// ```ignore,no_run
2218    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2219    /// use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
2220    /// let x = Listing::new().set_or_clear_data_provider(Some(DataProvider::default()/* use setters */));
2221    /// let x = Listing::new().set_or_clear_data_provider(None::<DataProvider>);
2222    /// ```
2223    pub fn set_or_clear_data_provider<T>(mut self, v: std::option::Option<T>) -> Self
2224    where
2225        T: std::convert::Into<crate::model::DataProvider>,
2226    {
2227        self.data_provider = v.map(|x| x.into());
2228        self
2229    }
2230
2231    /// Sets the value of [categories][crate::model::Listing::categories].
2232    ///
2233    /// # Example
2234    /// ```ignore,no_run
2235    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2236    /// use google_cloud_bigquery_analyticshub_v1::model::listing::Category;
2237    /// let x = Listing::new().set_categories([
2238    ///     Category::Others,
2239    ///     Category::AdvertisingAndMarketing,
2240    ///     Category::Commerce,
2241    /// ]);
2242    /// ```
2243    pub fn set_categories<T, V>(mut self, v: T) -> Self
2244    where
2245        T: std::iter::IntoIterator<Item = V>,
2246        V: std::convert::Into<crate::model::listing::Category>,
2247    {
2248        use std::iter::Iterator;
2249        self.categories = v.into_iter().map(|i| i.into()).collect();
2250        self
2251    }
2252
2253    /// Sets the value of [publisher][crate::model::Listing::publisher].
2254    ///
2255    /// # Example
2256    /// ```ignore,no_run
2257    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2258    /// use google_cloud_bigquery_analyticshub_v1::model::Publisher;
2259    /// let x = Listing::new().set_publisher(Publisher::default()/* use setters */);
2260    /// ```
2261    pub fn set_publisher<T>(mut self, v: T) -> Self
2262    where
2263        T: std::convert::Into<crate::model::Publisher>,
2264    {
2265        self.publisher = std::option::Option::Some(v.into());
2266        self
2267    }
2268
2269    /// Sets or clears the value of [publisher][crate::model::Listing::publisher].
2270    ///
2271    /// # Example
2272    /// ```ignore,no_run
2273    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2274    /// use google_cloud_bigquery_analyticshub_v1::model::Publisher;
2275    /// let x = Listing::new().set_or_clear_publisher(Some(Publisher::default()/* use setters */));
2276    /// let x = Listing::new().set_or_clear_publisher(None::<Publisher>);
2277    /// ```
2278    pub fn set_or_clear_publisher<T>(mut self, v: std::option::Option<T>) -> Self
2279    where
2280        T: std::convert::Into<crate::model::Publisher>,
2281    {
2282        self.publisher = v.map(|x| x.into());
2283        self
2284    }
2285
2286    /// Sets the value of [request_access][crate::model::Listing::request_access].
2287    ///
2288    /// # Example
2289    /// ```ignore,no_run
2290    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2291    /// let x = Listing::new().set_request_access("example");
2292    /// ```
2293    pub fn set_request_access<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2294        self.request_access = v.into();
2295        self
2296    }
2297
2298    /// Sets the value of [restricted_export_config][crate::model::Listing::restricted_export_config].
2299    ///
2300    /// # Example
2301    /// ```ignore,no_run
2302    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2303    /// use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
2304    /// let x = Listing::new().set_restricted_export_config(RestrictedExportConfig::default()/* use setters */);
2305    /// ```
2306    pub fn set_restricted_export_config<T>(mut self, v: T) -> Self
2307    where
2308        T: std::convert::Into<crate::model::listing::RestrictedExportConfig>,
2309    {
2310        self.restricted_export_config = std::option::Option::Some(v.into());
2311        self
2312    }
2313
2314    /// Sets or clears the value of [restricted_export_config][crate::model::Listing::restricted_export_config].
2315    ///
2316    /// # Example
2317    /// ```ignore,no_run
2318    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2319    /// use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
2320    /// let x = Listing::new().set_or_clear_restricted_export_config(Some(RestrictedExportConfig::default()/* use setters */));
2321    /// let x = Listing::new().set_or_clear_restricted_export_config(None::<RestrictedExportConfig>);
2322    /// ```
2323    pub fn set_or_clear_restricted_export_config<T>(mut self, v: std::option::Option<T>) -> Self
2324    where
2325        T: std::convert::Into<crate::model::listing::RestrictedExportConfig>,
2326    {
2327        self.restricted_export_config = v.map(|x| x.into());
2328        self
2329    }
2330
2331    /// Sets the value of [stored_procedure_config][crate::model::Listing::stored_procedure_config].
2332    ///
2333    /// # Example
2334    /// ```ignore,no_run
2335    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2336    /// use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
2337    /// let x = Listing::new().set_stored_procedure_config(StoredProcedureConfig::default()/* use setters */);
2338    /// ```
2339    pub fn set_stored_procedure_config<T>(mut self, v: T) -> Self
2340    where
2341        T: std::convert::Into<crate::model::StoredProcedureConfig>,
2342    {
2343        self.stored_procedure_config = std::option::Option::Some(v.into());
2344        self
2345    }
2346
2347    /// Sets or clears the value of [stored_procedure_config][crate::model::Listing::stored_procedure_config].
2348    ///
2349    /// # Example
2350    /// ```ignore,no_run
2351    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2352    /// use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
2353    /// let x = Listing::new().set_or_clear_stored_procedure_config(Some(StoredProcedureConfig::default()/* use setters */));
2354    /// let x = Listing::new().set_or_clear_stored_procedure_config(None::<StoredProcedureConfig>);
2355    /// ```
2356    pub fn set_or_clear_stored_procedure_config<T>(mut self, v: std::option::Option<T>) -> Self
2357    where
2358        T: std::convert::Into<crate::model::StoredProcedureConfig>,
2359    {
2360        self.stored_procedure_config = v.map(|x| x.into());
2361        self
2362    }
2363
2364    /// Sets the value of [discovery_type][crate::model::Listing::discovery_type].
2365    ///
2366    /// # Example
2367    /// ```ignore,no_run
2368    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2369    /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
2370    /// let x0 = Listing::new().set_discovery_type(DiscoveryType::Private);
2371    /// let x1 = Listing::new().set_discovery_type(DiscoveryType::Public);
2372    /// ```
2373    pub fn set_discovery_type<T>(mut self, v: T) -> Self
2374    where
2375        T: std::convert::Into<crate::model::DiscoveryType>,
2376    {
2377        self.discovery_type = std::option::Option::Some(v.into());
2378        self
2379    }
2380
2381    /// Sets or clears the value of [discovery_type][crate::model::Listing::discovery_type].
2382    ///
2383    /// # Example
2384    /// ```ignore,no_run
2385    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2386    /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
2387    /// let x0 = Listing::new().set_or_clear_discovery_type(Some(DiscoveryType::Private));
2388    /// let x1 = Listing::new().set_or_clear_discovery_type(Some(DiscoveryType::Public));
2389    /// let x_none = Listing::new().set_or_clear_discovery_type(None::<DiscoveryType>);
2390    /// ```
2391    pub fn set_or_clear_discovery_type<T>(mut self, v: std::option::Option<T>) -> Self
2392    where
2393        T: std::convert::Into<crate::model::DiscoveryType>,
2394    {
2395        self.discovery_type = v.map(|x| x.into());
2396        self
2397    }
2398
2399    /// Sets the value of [resource_type][crate::model::Listing::resource_type].
2400    ///
2401    /// # Example
2402    /// ```ignore,no_run
2403    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2404    /// use google_cloud_bigquery_analyticshub_v1::model::SharedResourceType;
2405    /// let x0 = Listing::new().set_resource_type(SharedResourceType::BigqueryDataset);
2406    /// let x1 = Listing::new().set_resource_type(SharedResourceType::PubsubTopic);
2407    /// ```
2408    pub fn set_resource_type<T: std::convert::Into<crate::model::SharedResourceType>>(
2409        mut self,
2410        v: T,
2411    ) -> Self {
2412        self.resource_type = v.into();
2413        self
2414    }
2415
2416    /// Sets the value of [commercial_info][crate::model::Listing::commercial_info].
2417    ///
2418    /// # Example
2419    /// ```ignore,no_run
2420    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2421    /// use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
2422    /// let x = Listing::new().set_commercial_info(CommercialInfo::default()/* use setters */);
2423    /// ```
2424    pub fn set_commercial_info<T>(mut self, v: T) -> Self
2425    where
2426        T: std::convert::Into<crate::model::listing::CommercialInfo>,
2427    {
2428        self.commercial_info = std::option::Option::Some(v.into());
2429        self
2430    }
2431
2432    /// Sets or clears the value of [commercial_info][crate::model::Listing::commercial_info].
2433    ///
2434    /// # Example
2435    /// ```ignore,no_run
2436    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2437    /// use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
2438    /// let x = Listing::new().set_or_clear_commercial_info(Some(CommercialInfo::default()/* use setters */));
2439    /// let x = Listing::new().set_or_clear_commercial_info(None::<CommercialInfo>);
2440    /// ```
2441    pub fn set_or_clear_commercial_info<T>(mut self, v: std::option::Option<T>) -> Self
2442    where
2443        T: std::convert::Into<crate::model::listing::CommercialInfo>,
2444    {
2445        self.commercial_info = v.map(|x| x.into());
2446        self
2447    }
2448
2449    /// Sets the value of [log_linked_dataset_query_user_email][crate::model::Listing::log_linked_dataset_query_user_email].
2450    ///
2451    /// # Example
2452    /// ```ignore,no_run
2453    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2454    /// let x = Listing::new().set_log_linked_dataset_query_user_email(true);
2455    /// ```
2456    pub fn set_log_linked_dataset_query_user_email<T>(mut self, v: T) -> Self
2457    where
2458        T: std::convert::Into<bool>,
2459    {
2460        self.log_linked_dataset_query_user_email = std::option::Option::Some(v.into());
2461        self
2462    }
2463
2464    /// Sets or clears the value of [log_linked_dataset_query_user_email][crate::model::Listing::log_linked_dataset_query_user_email].
2465    ///
2466    /// # Example
2467    /// ```ignore,no_run
2468    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2469    /// let x = Listing::new().set_or_clear_log_linked_dataset_query_user_email(Some(false));
2470    /// let x = Listing::new().set_or_clear_log_linked_dataset_query_user_email(None::<bool>);
2471    /// ```
2472    pub fn set_or_clear_log_linked_dataset_query_user_email<T>(
2473        mut self,
2474        v: std::option::Option<T>,
2475    ) -> Self
2476    where
2477        T: std::convert::Into<bool>,
2478    {
2479        self.log_linked_dataset_query_user_email = v.map(|x| x.into());
2480        self
2481    }
2482
2483    /// Sets the value of [allow_only_metadata_sharing][crate::model::Listing::allow_only_metadata_sharing].
2484    ///
2485    /// # Example
2486    /// ```ignore,no_run
2487    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2488    /// let x = Listing::new().set_allow_only_metadata_sharing(true);
2489    /// ```
2490    pub fn set_allow_only_metadata_sharing<T>(mut self, v: T) -> Self
2491    where
2492        T: std::convert::Into<bool>,
2493    {
2494        self.allow_only_metadata_sharing = std::option::Option::Some(v.into());
2495        self
2496    }
2497
2498    /// Sets or clears the value of [allow_only_metadata_sharing][crate::model::Listing::allow_only_metadata_sharing].
2499    ///
2500    /// # Example
2501    /// ```ignore,no_run
2502    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2503    /// let x = Listing::new().set_or_clear_allow_only_metadata_sharing(Some(false));
2504    /// let x = Listing::new().set_or_clear_allow_only_metadata_sharing(None::<bool>);
2505    /// ```
2506    pub fn set_or_clear_allow_only_metadata_sharing<T>(mut self, v: std::option::Option<T>) -> Self
2507    where
2508        T: std::convert::Into<bool>,
2509    {
2510        self.allow_only_metadata_sharing = v.map(|x| x.into());
2511        self
2512    }
2513
2514    /// Sets the value of [source][crate::model::Listing::source].
2515    ///
2516    /// Note that all the setters affecting `source` are mutually
2517    /// exclusive.
2518    ///
2519    /// # Example
2520    /// ```ignore,no_run
2521    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2522    /// use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2523    /// let x = Listing::new().set_source(Some(
2524    ///     google_cloud_bigquery_analyticshub_v1::model::listing::Source::BigqueryDataset(BigQueryDatasetSource::default().into())));
2525    /// ```
2526    pub fn set_source<T: std::convert::Into<std::option::Option<crate::model::listing::Source>>>(
2527        mut self,
2528        v: T,
2529    ) -> Self {
2530        self.source = v.into();
2531        self
2532    }
2533
2534    /// The value of [source][crate::model::Listing::source]
2535    /// if it holds a `BigqueryDataset`, `None` if the field is not set or
2536    /// holds a different branch.
2537    pub fn bigquery_dataset(
2538        &self,
2539    ) -> std::option::Option<&std::boxed::Box<crate::model::listing::BigQueryDatasetSource>> {
2540        #[allow(unreachable_patterns)]
2541        self.source.as_ref().and_then(|v| match v {
2542            crate::model::listing::Source::BigqueryDataset(v) => std::option::Option::Some(v),
2543            _ => std::option::Option::None,
2544        })
2545    }
2546
2547    /// Sets the value of [source][crate::model::Listing::source]
2548    /// to hold a `BigqueryDataset`.
2549    ///
2550    /// Note that all the setters affecting `source` are
2551    /// mutually exclusive.
2552    ///
2553    /// # Example
2554    /// ```ignore,no_run
2555    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2556    /// use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2557    /// let x = Listing::new().set_bigquery_dataset(BigQueryDatasetSource::default()/* use setters */);
2558    /// assert!(x.bigquery_dataset().is_some());
2559    /// assert!(x.pubsub_topic().is_none());
2560    /// ```
2561    pub fn set_bigquery_dataset<
2562        T: std::convert::Into<std::boxed::Box<crate::model::listing::BigQueryDatasetSource>>,
2563    >(
2564        mut self,
2565        v: T,
2566    ) -> Self {
2567        self.source =
2568            std::option::Option::Some(crate::model::listing::Source::BigqueryDataset(v.into()));
2569        self
2570    }
2571
2572    /// The value of [source][crate::model::Listing::source]
2573    /// if it holds a `PubsubTopic`, `None` if the field is not set or
2574    /// holds a different branch.
2575    pub fn pubsub_topic(
2576        &self,
2577    ) -> std::option::Option<&std::boxed::Box<crate::model::listing::PubSubTopicSource>> {
2578        #[allow(unreachable_patterns)]
2579        self.source.as_ref().and_then(|v| match v {
2580            crate::model::listing::Source::PubsubTopic(v) => std::option::Option::Some(v),
2581            _ => std::option::Option::None,
2582        })
2583    }
2584
2585    /// Sets the value of [source][crate::model::Listing::source]
2586    /// to hold a `PubsubTopic`.
2587    ///
2588    /// Note that all the setters affecting `source` are
2589    /// mutually exclusive.
2590    ///
2591    /// # Example
2592    /// ```ignore,no_run
2593    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2594    /// use google_cloud_bigquery_analyticshub_v1::model::listing::PubSubTopicSource;
2595    /// let x = Listing::new().set_pubsub_topic(PubSubTopicSource::default()/* use setters */);
2596    /// assert!(x.pubsub_topic().is_some());
2597    /// assert!(x.bigquery_dataset().is_none());
2598    /// ```
2599    pub fn set_pubsub_topic<
2600        T: std::convert::Into<std::boxed::Box<crate::model::listing::PubSubTopicSource>>,
2601    >(
2602        mut self,
2603        v: T,
2604    ) -> Self {
2605        self.source =
2606            std::option::Option::Some(crate::model::listing::Source::PubsubTopic(v.into()));
2607        self
2608    }
2609}
2610
2611impl wkt::message::Message for Listing {
2612    fn typename() -> &'static str {
2613        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing"
2614    }
2615}
2616
2617/// Defines additional types related to [Listing].
2618pub mod listing {
2619    #[allow(unused_imports)]
2620    use super::*;
2621
2622    /// A reference to a shared dataset. It is an existing BigQuery dataset with a
2623    /// collection of objects such as tables and views that you want to share
2624    /// with subscribers.
2625    /// When subscriber's subscribe to a listing, Analytics Hub creates a linked
2626    /// dataset in
2627    /// the subscriber's project. A Linked dataset is an opaque, read-only BigQuery
2628    /// dataset that serves as a _symbolic link_ to a shared dataset.
2629    #[derive(Clone, Default, PartialEq)]
2630    #[non_exhaustive]
2631    pub struct BigQueryDatasetSource {
2632        /// Optional. Resource name of the dataset source for this listing.
2633        /// e.g. `projects/myproject/datasets/123`
2634        pub dataset: std::string::String,
2635
2636        /// Optional. Resource in this dataset that is selectively shared.
2637        /// This field is required for data clean room exchanges.
2638        pub selected_resources:
2639            std::vec::Vec<crate::model::listing::big_query_dataset_source::SelectedResource>,
2640
2641        /// Optional. If set, restricted export policy will be propagated and
2642        /// enforced on the linked dataset.
2643        pub restricted_export_policy: std::option::Option<
2644            crate::model::listing::big_query_dataset_source::RestrictedExportPolicy,
2645        >,
2646
2647        /// Optional. A list of regions where the publisher has created shared
2648        /// dataset replicas.
2649        pub replica_locations: std::vec::Vec<std::string::String>,
2650
2651        /// Output only. Server-owned effective state of replicas.
2652        /// Contains both primary and secondary replicas.
2653        /// Each replica includes a system-computed (output-only) state and primary
2654        /// designation.
2655        pub effective_replicas:
2656            std::vec::Vec<crate::model::listing::big_query_dataset_source::Replica>,
2657
2658        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2659    }
2660
2661    impl BigQueryDatasetSource {
2662        pub fn new() -> Self {
2663            std::default::Default::default()
2664        }
2665
2666        /// Sets the value of [dataset][crate::model::listing::BigQueryDatasetSource::dataset].
2667        ///
2668        /// # Example
2669        /// ```ignore,no_run
2670        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2671        /// let x = BigQueryDatasetSource::new().set_dataset("example");
2672        /// ```
2673        pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2674            self.dataset = v.into();
2675            self
2676        }
2677
2678        /// Sets the value of [selected_resources][crate::model::listing::BigQueryDatasetSource::selected_resources].
2679        ///
2680        /// # Example
2681        /// ```ignore,no_run
2682        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2683        /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2684        /// let x = BigQueryDatasetSource::new()
2685        ///     .set_selected_resources([
2686        ///         SelectedResource::default()/* use setters */,
2687        ///         SelectedResource::default()/* use (different) setters */,
2688        ///     ]);
2689        /// ```
2690        pub fn set_selected_resources<T, V>(mut self, v: T) -> Self
2691        where
2692            T: std::iter::IntoIterator<Item = V>,
2693            V: std::convert::Into<
2694                    crate::model::listing::big_query_dataset_source::SelectedResource,
2695                >,
2696        {
2697            use std::iter::Iterator;
2698            self.selected_resources = v.into_iter().map(|i| i.into()).collect();
2699            self
2700        }
2701
2702        /// Sets the value of [restricted_export_policy][crate::model::listing::BigQueryDatasetSource::restricted_export_policy].
2703        ///
2704        /// # Example
2705        /// ```ignore,no_run
2706        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2707        /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2708        /// let x = BigQueryDatasetSource::new().set_restricted_export_policy(RestrictedExportPolicy::default()/* use setters */);
2709        /// ```
2710        pub fn set_restricted_export_policy<T>(mut self, v: T) -> Self
2711        where
2712            T: std::convert::Into<
2713                    crate::model::listing::big_query_dataset_source::RestrictedExportPolicy,
2714                >,
2715        {
2716            self.restricted_export_policy = std::option::Option::Some(v.into());
2717            self
2718        }
2719
2720        /// Sets or clears the value of [restricted_export_policy][crate::model::listing::BigQueryDatasetSource::restricted_export_policy].
2721        ///
2722        /// # Example
2723        /// ```ignore,no_run
2724        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2725        /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2726        /// let x = BigQueryDatasetSource::new().set_or_clear_restricted_export_policy(Some(RestrictedExportPolicy::default()/* use setters */));
2727        /// let x = BigQueryDatasetSource::new().set_or_clear_restricted_export_policy(None::<RestrictedExportPolicy>);
2728        /// ```
2729        pub fn set_or_clear_restricted_export_policy<T>(mut self, v: std::option::Option<T>) -> Self
2730        where
2731            T: std::convert::Into<
2732                    crate::model::listing::big_query_dataset_source::RestrictedExportPolicy,
2733                >,
2734        {
2735            self.restricted_export_policy = v.map(|x| x.into());
2736            self
2737        }
2738
2739        /// Sets the value of [replica_locations][crate::model::listing::BigQueryDatasetSource::replica_locations].
2740        ///
2741        /// # Example
2742        /// ```ignore,no_run
2743        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2744        /// let x = BigQueryDatasetSource::new().set_replica_locations(["a", "b", "c"]);
2745        /// ```
2746        pub fn set_replica_locations<T, V>(mut self, v: T) -> Self
2747        where
2748            T: std::iter::IntoIterator<Item = V>,
2749            V: std::convert::Into<std::string::String>,
2750        {
2751            use std::iter::Iterator;
2752            self.replica_locations = v.into_iter().map(|i| i.into()).collect();
2753            self
2754        }
2755
2756        /// Sets the value of [effective_replicas][crate::model::listing::BigQueryDatasetSource::effective_replicas].
2757        ///
2758        /// # Example
2759        /// ```ignore,no_run
2760        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2761        /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
2762        /// let x = BigQueryDatasetSource::new()
2763        ///     .set_effective_replicas([
2764        ///         Replica::default()/* use setters */,
2765        ///         Replica::default()/* use (different) setters */,
2766        ///     ]);
2767        /// ```
2768        pub fn set_effective_replicas<T, V>(mut self, v: T) -> Self
2769        where
2770            T: std::iter::IntoIterator<Item = V>,
2771            V: std::convert::Into<crate::model::listing::big_query_dataset_source::Replica>,
2772        {
2773            use std::iter::Iterator;
2774            self.effective_replicas = v.into_iter().map(|i| i.into()).collect();
2775            self
2776        }
2777    }
2778
2779    impl wkt::message::Message for BigQueryDatasetSource {
2780        fn typename() -> &'static str {
2781            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource"
2782        }
2783    }
2784
2785    /// Defines additional types related to [BigQueryDatasetSource].
2786    pub mod big_query_dataset_source {
2787        #[allow(unused_imports)]
2788        use super::*;
2789
2790        /// Resource in this dataset that is selectively shared.
2791        #[derive(Clone, Default, PartialEq)]
2792        #[non_exhaustive]
2793        pub struct SelectedResource {
2794            pub resource: std::option::Option<
2795                crate::model::listing::big_query_dataset_source::selected_resource::Resource,
2796            >,
2797
2798            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2799        }
2800
2801        impl SelectedResource {
2802            pub fn new() -> Self {
2803                std::default::Default::default()
2804            }
2805
2806            /// Sets the value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource].
2807            ///
2808            /// Note that all the setters affecting `resource` are mutually
2809            /// exclusive.
2810            ///
2811            /// # Example
2812            /// ```ignore,no_run
2813            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2814            /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::selected_resource::Resource;
2815            /// let x = SelectedResource::new().set_resource(Some(Resource::Table("example".to_string())));
2816            /// ```
2817            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
2818            {
2819                self.resource = v.into();
2820                self
2821            }
2822
2823            /// The value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2824            /// if it holds a `Table`, `None` if the field is not set or
2825            /// holds a different branch.
2826            pub fn table(&self) -> std::option::Option<&std::string::String> {
2827                #[allow(unreachable_patterns)]
2828                self.resource.as_ref().and_then(|v| match v {
2829                    crate::model::listing::big_query_dataset_source::selected_resource::Resource::Table(v) => std::option::Option::Some(v),
2830                    _ => std::option::Option::None,
2831                })
2832            }
2833
2834            /// Sets the value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2835            /// to hold a `Table`.
2836            ///
2837            /// Note that all the setters affecting `resource` are
2838            /// mutually exclusive.
2839            ///
2840            /// # Example
2841            /// ```ignore,no_run
2842            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2843            /// let x = SelectedResource::new().set_table("example");
2844            /// assert!(x.table().is_some());
2845            /// assert!(x.routine().is_none());
2846            /// ```
2847            pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2848                self.resource = std::option::Option::Some(
2849                    crate::model::listing::big_query_dataset_source::selected_resource::Resource::Table(
2850                        v.into()
2851                    )
2852                );
2853                self
2854            }
2855
2856            /// The value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2857            /// if it holds a `Routine`, `None` if the field is not set or
2858            /// holds a different branch.
2859            pub fn routine(&self) -> std::option::Option<&std::string::String> {
2860                #[allow(unreachable_patterns)]
2861                self.resource.as_ref().and_then(|v| match v {
2862                    crate::model::listing::big_query_dataset_source::selected_resource::Resource::Routine(v) => std::option::Option::Some(v),
2863                    _ => std::option::Option::None,
2864                })
2865            }
2866
2867            /// Sets the value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2868            /// to hold a `Routine`.
2869            ///
2870            /// Note that all the setters affecting `resource` are
2871            /// mutually exclusive.
2872            ///
2873            /// # Example
2874            /// ```ignore,no_run
2875            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2876            /// let x = SelectedResource::new().set_routine("example");
2877            /// assert!(x.routine().is_some());
2878            /// assert!(x.table().is_none());
2879            /// ```
2880            pub fn set_routine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2881                self.resource = std::option::Option::Some(
2882                    crate::model::listing::big_query_dataset_source::selected_resource::Resource::Routine(
2883                        v.into()
2884                    )
2885                );
2886                self
2887            }
2888        }
2889
2890        impl wkt::message::Message for SelectedResource {
2891            fn typename() -> &'static str {
2892                "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.SelectedResource"
2893            }
2894        }
2895
2896        /// Defines additional types related to [SelectedResource].
2897        pub mod selected_resource {
2898            #[allow(unused_imports)]
2899            use super::*;
2900
2901            #[derive(Clone, Debug, PartialEq)]
2902            #[non_exhaustive]
2903            pub enum Resource {
2904                /// Optional. Format:
2905                /// For table:
2906                /// `projects/{projectId}/datasets/{datasetId}/tables/{tableId}`
2907                /// Example:"projects/test_project/datasets/test_dataset/tables/test_table"
2908                Table(std::string::String),
2909                /// Optional. Format:
2910                /// For routine:
2911                /// `projects/{projectId}/datasets/{datasetId}/routines/{routineId}`
2912                /// Example:"projects/test_project/datasets/test_dataset/routines/test_routine"
2913                Routine(std::string::String),
2914            }
2915        }
2916
2917        /// Restricted export policy used to configure restricted export on linked
2918        /// dataset.
2919        #[derive(Clone, Default, PartialEq)]
2920        #[non_exhaustive]
2921        pub struct RestrictedExportPolicy {
2922            /// Optional. If true, enable restricted export.
2923            pub enabled: std::option::Option<wkt::BoolValue>,
2924
2925            /// Optional. If true, restrict direct table access (read
2926            /// api/tabledata.list) on linked table.
2927            pub restrict_direct_table_access: std::option::Option<wkt::BoolValue>,
2928
2929            /// Optional. If true, restrict export of query result derived from
2930            /// restricted linked dataset table.
2931            pub restrict_query_result: std::option::Option<wkt::BoolValue>,
2932
2933            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2934        }
2935
2936        impl RestrictedExportPolicy {
2937            pub fn new() -> Self {
2938                std::default::Default::default()
2939            }
2940
2941            /// Sets the value of [enabled][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::enabled].
2942            ///
2943            /// # Example
2944            /// ```ignore,no_run
2945            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2946            /// use wkt::BoolValue;
2947            /// let x = RestrictedExportPolicy::new().set_enabled(BoolValue::default()/* use setters */);
2948            /// ```
2949            pub fn set_enabled<T>(mut self, v: T) -> Self
2950            where
2951                T: std::convert::Into<wkt::BoolValue>,
2952            {
2953                self.enabled = std::option::Option::Some(v.into());
2954                self
2955            }
2956
2957            /// Sets or clears the value of [enabled][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::enabled].
2958            ///
2959            /// # Example
2960            /// ```ignore,no_run
2961            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2962            /// use wkt::BoolValue;
2963            /// let x = RestrictedExportPolicy::new().set_or_clear_enabled(Some(BoolValue::default()/* use setters */));
2964            /// let x = RestrictedExportPolicy::new().set_or_clear_enabled(None::<BoolValue>);
2965            /// ```
2966            pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
2967            where
2968                T: std::convert::Into<wkt::BoolValue>,
2969            {
2970                self.enabled = v.map(|x| x.into());
2971                self
2972            }
2973
2974            /// Sets the value of [restrict_direct_table_access][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_direct_table_access].
2975            ///
2976            /// # Example
2977            /// ```ignore,no_run
2978            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2979            /// use wkt::BoolValue;
2980            /// let x = RestrictedExportPolicy::new().set_restrict_direct_table_access(BoolValue::default()/* use setters */);
2981            /// ```
2982            pub fn set_restrict_direct_table_access<T>(mut self, v: T) -> Self
2983            where
2984                T: std::convert::Into<wkt::BoolValue>,
2985            {
2986                self.restrict_direct_table_access = std::option::Option::Some(v.into());
2987                self
2988            }
2989
2990            /// Sets or clears the value of [restrict_direct_table_access][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_direct_table_access].
2991            ///
2992            /// # Example
2993            /// ```ignore,no_run
2994            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2995            /// use wkt::BoolValue;
2996            /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_direct_table_access(Some(BoolValue::default()/* use setters */));
2997            /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_direct_table_access(None::<BoolValue>);
2998            /// ```
2999            pub fn set_or_clear_restrict_direct_table_access<T>(
3000                mut self,
3001                v: std::option::Option<T>,
3002            ) -> Self
3003            where
3004                T: std::convert::Into<wkt::BoolValue>,
3005            {
3006                self.restrict_direct_table_access = v.map(|x| x.into());
3007                self
3008            }
3009
3010            /// Sets the value of [restrict_query_result][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_query_result].
3011            ///
3012            /// # Example
3013            /// ```ignore,no_run
3014            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
3015            /// use wkt::BoolValue;
3016            /// let x = RestrictedExportPolicy::new().set_restrict_query_result(BoolValue::default()/* use setters */);
3017            /// ```
3018            pub fn set_restrict_query_result<T>(mut self, v: T) -> Self
3019            where
3020                T: std::convert::Into<wkt::BoolValue>,
3021            {
3022                self.restrict_query_result = std::option::Option::Some(v.into());
3023                self
3024            }
3025
3026            /// Sets or clears the value of [restrict_query_result][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_query_result].
3027            ///
3028            /// # Example
3029            /// ```ignore,no_run
3030            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
3031            /// use wkt::BoolValue;
3032            /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_query_result(Some(BoolValue::default()/* use setters */));
3033            /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_query_result(None::<BoolValue>);
3034            /// ```
3035            pub fn set_or_clear_restrict_query_result<T>(
3036                mut self,
3037                v: std::option::Option<T>,
3038            ) -> Self
3039            where
3040                T: std::convert::Into<wkt::BoolValue>,
3041            {
3042                self.restrict_query_result = v.map(|x| x.into());
3043                self
3044            }
3045        }
3046
3047        impl wkt::message::Message for RestrictedExportPolicy {
3048            fn typename() -> &'static str {
3049                "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.RestrictedExportPolicy"
3050            }
3051        }
3052
3053        /// Represents the state of a replica of a shared dataset.
3054        /// It includes the geographic location of the replica and
3055        /// system-computed, output-only fields indicating its replication state and
3056        /// whether it is the primary replica.
3057        #[derive(Clone, Default, PartialEq)]
3058        #[non_exhaustive]
3059        pub struct Replica {
3060            /// Output only. The geographic location where the replica resides. See
3061            /// [BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
3062            /// for supported locations. Eg. "us-central1".
3063            pub location: std::string::String,
3064
3065            /// Output only. Assigned by Analytics Hub based on real BigQuery
3066            /// replication state.
3067            pub replica_state:
3068                crate::model::listing::big_query_dataset_source::replica::ReplicaState,
3069
3070            /// Output only. Indicates that this replica is the primary replica.
3071            pub primary_state: std::option::Option<
3072                crate::model::listing::big_query_dataset_source::replica::PrimaryState,
3073            >,
3074
3075            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3076        }
3077
3078        impl Replica {
3079            pub fn new() -> Self {
3080                std::default::Default::default()
3081            }
3082
3083            /// Sets the value of [location][crate::model::listing::big_query_dataset_source::Replica::location].
3084            ///
3085            /// # Example
3086            /// ```ignore,no_run
3087            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3088            /// let x = Replica::new().set_location("example");
3089            /// ```
3090            pub fn set_location<T: std::convert::Into<std::string::String>>(
3091                mut self,
3092                v: T,
3093            ) -> Self {
3094                self.location = v.into();
3095                self
3096            }
3097
3098            /// Sets the value of [replica_state][crate::model::listing::big_query_dataset_source::Replica::replica_state].
3099            ///
3100            /// # Example
3101            /// ```ignore,no_run
3102            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3103            /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::replica::ReplicaState;
3104            /// let x0 = Replica::new().set_replica_state(ReplicaState::ReadyToUse);
3105            /// let x1 = Replica::new().set_replica_state(ReplicaState::Unavailable);
3106            /// ```
3107            pub fn set_replica_state<
3108                T: std::convert::Into<
3109                        crate::model::listing::big_query_dataset_source::replica::ReplicaState,
3110                    >,
3111            >(
3112                mut self,
3113                v: T,
3114            ) -> Self {
3115                self.replica_state = v.into();
3116                self
3117            }
3118
3119            /// Sets the value of [primary_state][crate::model::listing::big_query_dataset_source::Replica::primary_state].
3120            ///
3121            /// # Example
3122            /// ```ignore,no_run
3123            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3124            /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::replica::PrimaryState;
3125            /// let x0 = Replica::new().set_primary_state(PrimaryState::PrimaryReplica);
3126            /// ```
3127            pub fn set_primary_state<T>(mut self, v: T) -> Self
3128            where
3129                T: std::convert::Into<
3130                        crate::model::listing::big_query_dataset_source::replica::PrimaryState,
3131                    >,
3132            {
3133                self.primary_state = std::option::Option::Some(v.into());
3134                self
3135            }
3136
3137            /// Sets or clears the value of [primary_state][crate::model::listing::big_query_dataset_source::Replica::primary_state].
3138            ///
3139            /// # Example
3140            /// ```ignore,no_run
3141            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3142            /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::replica::PrimaryState;
3143            /// let x0 = Replica::new().set_or_clear_primary_state(Some(PrimaryState::PrimaryReplica));
3144            /// let x_none = Replica::new().set_or_clear_primary_state(None::<PrimaryState>);
3145            /// ```
3146            pub fn set_or_clear_primary_state<T>(mut self, v: std::option::Option<T>) -> Self
3147            where
3148                T: std::convert::Into<
3149                        crate::model::listing::big_query_dataset_source::replica::PrimaryState,
3150                    >,
3151            {
3152                self.primary_state = v.map(|x| x.into());
3153                self
3154            }
3155        }
3156
3157        impl wkt::message::Message for Replica {
3158            fn typename() -> &'static str {
3159                "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica"
3160            }
3161        }
3162
3163        /// Defines additional types related to [Replica].
3164        pub mod replica {
3165            #[allow(unused_imports)]
3166            use super::*;
3167
3168            /// Replica state of the shared dataset.
3169            ///
3170            /// # Working with unknown values
3171            ///
3172            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3173            /// additional enum variants at any time. Adding new variants is not considered
3174            /// a breaking change. Applications should write their code in anticipation of:
3175            ///
3176            /// - New values appearing in future releases of the client library, **and**
3177            /// - New values received dynamically, without application changes.
3178            ///
3179            /// Please consult the [Working with enums] section in the user guide for some
3180            /// guidelines.
3181            ///
3182            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3183            #[derive(Clone, Debug, PartialEq)]
3184            #[non_exhaustive]
3185            pub enum ReplicaState {
3186                /// Default value. This value is unused.
3187                Unspecified,
3188                /// The replica is backfilled and ready to use.
3189                ReadyToUse,
3190                /// The replica is unavailable, does not exist, or has not been
3191                /// backfilled yet.
3192                Unavailable,
3193                /// If set, the enum was initialized with an unknown value.
3194                ///
3195                /// Applications can examine the value using [ReplicaState::value] or
3196                /// [ReplicaState::name].
3197                UnknownValue(replica_state::UnknownValue),
3198            }
3199
3200            #[doc(hidden)]
3201            pub mod replica_state {
3202                #[allow(unused_imports)]
3203                use super::*;
3204                #[derive(Clone, Debug, PartialEq)]
3205                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3206            }
3207
3208            impl ReplicaState {
3209                /// Gets the enum value.
3210                ///
3211                /// Returns `None` if the enum contains an unknown value deserialized from
3212                /// the string representation of enums.
3213                pub fn value(&self) -> std::option::Option<i32> {
3214                    match self {
3215                        Self::Unspecified => std::option::Option::Some(0),
3216                        Self::ReadyToUse => std::option::Option::Some(1),
3217                        Self::Unavailable => std::option::Option::Some(2),
3218                        Self::UnknownValue(u) => u.0.value(),
3219                    }
3220                }
3221
3222                /// Gets the enum value as a string.
3223                ///
3224                /// Returns `None` if the enum contains an unknown value deserialized from
3225                /// the integer representation of enums.
3226                pub fn name(&self) -> std::option::Option<&str> {
3227                    match self {
3228                        Self::Unspecified => std::option::Option::Some("REPLICA_STATE_UNSPECIFIED"),
3229                        Self::ReadyToUse => std::option::Option::Some("READY_TO_USE"),
3230                        Self::Unavailable => std::option::Option::Some("UNAVAILABLE"),
3231                        Self::UnknownValue(u) => u.0.name(),
3232                    }
3233                }
3234            }
3235
3236            impl std::default::Default for ReplicaState {
3237                fn default() -> Self {
3238                    use std::convert::From;
3239                    Self::from(0)
3240                }
3241            }
3242
3243            impl std::fmt::Display for ReplicaState {
3244                fn fmt(
3245                    &self,
3246                    f: &mut std::fmt::Formatter<'_>,
3247                ) -> std::result::Result<(), std::fmt::Error> {
3248                    wkt::internal::display_enum(f, self.name(), self.value())
3249                }
3250            }
3251
3252            impl std::convert::From<i32> for ReplicaState {
3253                fn from(value: i32) -> Self {
3254                    match value {
3255                        0 => Self::Unspecified,
3256                        1 => Self::ReadyToUse,
3257                        2 => Self::Unavailable,
3258                        _ => Self::UnknownValue(replica_state::UnknownValue(
3259                            wkt::internal::UnknownEnumValue::Integer(value),
3260                        )),
3261                    }
3262                }
3263            }
3264
3265            impl std::convert::From<&str> for ReplicaState {
3266                fn from(value: &str) -> Self {
3267                    use std::string::ToString;
3268                    match value {
3269                        "REPLICA_STATE_UNSPECIFIED" => Self::Unspecified,
3270                        "READY_TO_USE" => Self::ReadyToUse,
3271                        "UNAVAILABLE" => Self::Unavailable,
3272                        _ => Self::UnknownValue(replica_state::UnknownValue(
3273                            wkt::internal::UnknownEnumValue::String(value.to_string()),
3274                        )),
3275                    }
3276                }
3277            }
3278
3279            impl serde::ser::Serialize for ReplicaState {
3280                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3281                where
3282                    S: serde::Serializer,
3283                {
3284                    match self {
3285                        Self::Unspecified => serializer.serialize_i32(0),
3286                        Self::ReadyToUse => serializer.serialize_i32(1),
3287                        Self::Unavailable => serializer.serialize_i32(2),
3288                        Self::UnknownValue(u) => u.0.serialize(serializer),
3289                    }
3290                }
3291            }
3292
3293            impl<'de> serde::de::Deserialize<'de> for ReplicaState {
3294                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3295                where
3296                    D: serde::Deserializer<'de>,
3297                {
3298                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicaState>::new(
3299                        ".google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.ReplicaState"))
3300                }
3301            }
3302
3303            /// Primary state of the replica. Set only for the primary replica.
3304            ///
3305            /// # Working with unknown values
3306            ///
3307            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3308            /// additional enum variants at any time. Adding new variants is not considered
3309            /// a breaking change. Applications should write their code in anticipation of:
3310            ///
3311            /// - New values appearing in future releases of the client library, **and**
3312            /// - New values received dynamically, without application changes.
3313            ///
3314            /// Please consult the [Working with enums] section in the user guide for some
3315            /// guidelines.
3316            ///
3317            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3318            #[derive(Clone, Debug, PartialEq)]
3319            #[non_exhaustive]
3320            pub enum PrimaryState {
3321                /// Default value. This value is unused.
3322                Unspecified,
3323                /// The replica is the primary replica.
3324                PrimaryReplica,
3325                /// If set, the enum was initialized with an unknown value.
3326                ///
3327                /// Applications can examine the value using [PrimaryState::value] or
3328                /// [PrimaryState::name].
3329                UnknownValue(primary_state::UnknownValue),
3330            }
3331
3332            #[doc(hidden)]
3333            pub mod primary_state {
3334                #[allow(unused_imports)]
3335                use super::*;
3336                #[derive(Clone, Debug, PartialEq)]
3337                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3338            }
3339
3340            impl PrimaryState {
3341                /// Gets the enum value.
3342                ///
3343                /// Returns `None` if the enum contains an unknown value deserialized from
3344                /// the string representation of enums.
3345                pub fn value(&self) -> std::option::Option<i32> {
3346                    match self {
3347                        Self::Unspecified => std::option::Option::Some(0),
3348                        Self::PrimaryReplica => std::option::Option::Some(1),
3349                        Self::UnknownValue(u) => u.0.value(),
3350                    }
3351                }
3352
3353                /// Gets the enum value as a string.
3354                ///
3355                /// Returns `None` if the enum contains an unknown value deserialized from
3356                /// the integer representation of enums.
3357                pub fn name(&self) -> std::option::Option<&str> {
3358                    match self {
3359                        Self::Unspecified => std::option::Option::Some("PRIMARY_STATE_UNSPECIFIED"),
3360                        Self::PrimaryReplica => std::option::Option::Some("PRIMARY_REPLICA"),
3361                        Self::UnknownValue(u) => u.0.name(),
3362                    }
3363                }
3364            }
3365
3366            impl std::default::Default for PrimaryState {
3367                fn default() -> Self {
3368                    use std::convert::From;
3369                    Self::from(0)
3370                }
3371            }
3372
3373            impl std::fmt::Display for PrimaryState {
3374                fn fmt(
3375                    &self,
3376                    f: &mut std::fmt::Formatter<'_>,
3377                ) -> std::result::Result<(), std::fmt::Error> {
3378                    wkt::internal::display_enum(f, self.name(), self.value())
3379                }
3380            }
3381
3382            impl std::convert::From<i32> for PrimaryState {
3383                fn from(value: i32) -> Self {
3384                    match value {
3385                        0 => Self::Unspecified,
3386                        1 => Self::PrimaryReplica,
3387                        _ => Self::UnknownValue(primary_state::UnknownValue(
3388                            wkt::internal::UnknownEnumValue::Integer(value),
3389                        )),
3390                    }
3391                }
3392            }
3393
3394            impl std::convert::From<&str> for PrimaryState {
3395                fn from(value: &str) -> Self {
3396                    use std::string::ToString;
3397                    match value {
3398                        "PRIMARY_STATE_UNSPECIFIED" => Self::Unspecified,
3399                        "PRIMARY_REPLICA" => Self::PrimaryReplica,
3400                        _ => Self::UnknownValue(primary_state::UnknownValue(
3401                            wkt::internal::UnknownEnumValue::String(value.to_string()),
3402                        )),
3403                    }
3404                }
3405            }
3406
3407            impl serde::ser::Serialize for PrimaryState {
3408                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3409                where
3410                    S: serde::Serializer,
3411                {
3412                    match self {
3413                        Self::Unspecified => serializer.serialize_i32(0),
3414                        Self::PrimaryReplica => serializer.serialize_i32(1),
3415                        Self::UnknownValue(u) => u.0.serialize(serializer),
3416                    }
3417                }
3418            }
3419
3420            impl<'de> serde::de::Deserialize<'de> for PrimaryState {
3421                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3422                where
3423                    D: serde::Deserializer<'de>,
3424                {
3425                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<PrimaryState>::new(
3426                        ".google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.PrimaryState"))
3427                }
3428            }
3429        }
3430    }
3431
3432    /// Pub/Sub topic source.
3433    #[derive(Clone, Default, PartialEq)]
3434    #[non_exhaustive]
3435    pub struct PubSubTopicSource {
3436        /// Required. Resource name of the Pub/Sub topic source for this listing.
3437        /// e.g. projects/myproject/topics/topicId
3438        pub topic: std::string::String,
3439
3440        /// Optional. Region hint on where the data might be published. Data affinity
3441        /// regions are modifiable. See <https://cloud.google.com/about/locations> for
3442        /// full listing of possible Cloud regions.
3443        pub data_affinity_regions: std::vec::Vec<std::string::String>,
3444
3445        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3446    }
3447
3448    impl PubSubTopicSource {
3449        pub fn new() -> Self {
3450            std::default::Default::default()
3451        }
3452
3453        /// Sets the value of [topic][crate::model::listing::PubSubTopicSource::topic].
3454        ///
3455        /// # Example
3456        /// ```ignore,no_run
3457        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::PubSubTopicSource;
3458        /// let x = PubSubTopicSource::new().set_topic("example");
3459        /// ```
3460        pub fn set_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3461            self.topic = v.into();
3462            self
3463        }
3464
3465        /// Sets the value of [data_affinity_regions][crate::model::listing::PubSubTopicSource::data_affinity_regions].
3466        ///
3467        /// # Example
3468        /// ```ignore,no_run
3469        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::PubSubTopicSource;
3470        /// let x = PubSubTopicSource::new().set_data_affinity_regions(["a", "b", "c"]);
3471        /// ```
3472        pub fn set_data_affinity_regions<T, V>(mut self, v: T) -> Self
3473        where
3474            T: std::iter::IntoIterator<Item = V>,
3475            V: std::convert::Into<std::string::String>,
3476        {
3477            use std::iter::Iterator;
3478            self.data_affinity_regions = v.into_iter().map(|i| i.into()).collect();
3479            self
3480        }
3481    }
3482
3483    impl wkt::message::Message for PubSubTopicSource {
3484        fn typename() -> &'static str {
3485            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.PubSubTopicSource"
3486        }
3487    }
3488
3489    /// Restricted export config, used to configure restricted export on linked
3490    /// dataset.
3491    #[derive(Clone, Default, PartialEq)]
3492    #[non_exhaustive]
3493    pub struct RestrictedExportConfig {
3494        /// Optional. If true, enable restricted export.
3495        pub enabled: bool,
3496
3497        /// Output only. If true, restrict direct table access(read
3498        /// api/tabledata.list) on linked table.
3499        pub restrict_direct_table_access: bool,
3500
3501        /// Optional. If true, restrict export of query result derived from
3502        /// restricted linked dataset table.
3503        pub restrict_query_result: bool,
3504
3505        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3506    }
3507
3508    impl RestrictedExportConfig {
3509        pub fn new() -> Self {
3510            std::default::Default::default()
3511        }
3512
3513        /// Sets the value of [enabled][crate::model::listing::RestrictedExportConfig::enabled].
3514        ///
3515        /// # Example
3516        /// ```ignore,no_run
3517        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
3518        /// let x = RestrictedExportConfig::new().set_enabled(true);
3519        /// ```
3520        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3521            self.enabled = v.into();
3522            self
3523        }
3524
3525        /// Sets the value of [restrict_direct_table_access][crate::model::listing::RestrictedExportConfig::restrict_direct_table_access].
3526        ///
3527        /// # Example
3528        /// ```ignore,no_run
3529        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
3530        /// let x = RestrictedExportConfig::new().set_restrict_direct_table_access(true);
3531        /// ```
3532        pub fn set_restrict_direct_table_access<T: std::convert::Into<bool>>(
3533            mut self,
3534            v: T,
3535        ) -> Self {
3536            self.restrict_direct_table_access = v.into();
3537            self
3538        }
3539
3540        /// Sets the value of [restrict_query_result][crate::model::listing::RestrictedExportConfig::restrict_query_result].
3541        ///
3542        /// # Example
3543        /// ```ignore,no_run
3544        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
3545        /// let x = RestrictedExportConfig::new().set_restrict_query_result(true);
3546        /// ```
3547        pub fn set_restrict_query_result<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3548            self.restrict_query_result = v.into();
3549            self
3550        }
3551    }
3552
3553    impl wkt::message::Message for RestrictedExportConfig {
3554        fn typename() -> &'static str {
3555            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.RestrictedExportConfig"
3556        }
3557    }
3558
3559    /// Commercial info contains the information about the commercial data products
3560    /// associated with the listing.
3561    #[derive(Clone, Default, PartialEq)]
3562    #[non_exhaustive]
3563    pub struct CommercialInfo {
3564        /// Output only. Details of the Marketplace Data Product associated with the
3565        /// Listing.
3566        pub cloud_marketplace:
3567            std::option::Option<crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo>,
3568
3569        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3570    }
3571
3572    impl CommercialInfo {
3573        pub fn new() -> Self {
3574            std::default::Default::default()
3575        }
3576
3577        /// Sets the value of [cloud_marketplace][crate::model::listing::CommercialInfo::cloud_marketplace].
3578        ///
3579        /// # Example
3580        /// ```ignore,no_run
3581        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
3582        /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3583        /// let x = CommercialInfo::new().set_cloud_marketplace(GoogleCloudMarketplaceInfo::default()/* use setters */);
3584        /// ```
3585        pub fn set_cloud_marketplace<T>(mut self, v: T) -> Self
3586        where
3587            T: std::convert::Into<
3588                    crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo,
3589                >,
3590        {
3591            self.cloud_marketplace = std::option::Option::Some(v.into());
3592            self
3593        }
3594
3595        /// Sets or clears the value of [cloud_marketplace][crate::model::listing::CommercialInfo::cloud_marketplace].
3596        ///
3597        /// # Example
3598        /// ```ignore,no_run
3599        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
3600        /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3601        /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(Some(GoogleCloudMarketplaceInfo::default()/* use setters */));
3602        /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(None::<GoogleCloudMarketplaceInfo>);
3603        /// ```
3604        pub fn set_or_clear_cloud_marketplace<T>(mut self, v: std::option::Option<T>) -> Self
3605        where
3606            T: std::convert::Into<
3607                    crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo,
3608                >,
3609        {
3610            self.cloud_marketplace = v.map(|x| x.into());
3611            self
3612        }
3613    }
3614
3615    impl wkt::message::Message for CommercialInfo {
3616        fn typename() -> &'static str {
3617            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.CommercialInfo"
3618        }
3619    }
3620
3621    /// Defines additional types related to [CommercialInfo].
3622    pub mod commercial_info {
3623        #[allow(unused_imports)]
3624        use super::*;
3625
3626        /// Specifies the details of the Marketplace Data Product associated with the
3627        /// Listing.
3628        #[derive(Clone, Default, PartialEq)]
3629        #[non_exhaustive]
3630        pub struct GoogleCloudMarketplaceInfo {
3631
3632            /// Output only. Resource name of the commercial service associated with
3633            /// the Marketplace Data Product. e.g. example.com
3634            pub service: std::option::Option<std::string::String>,
3635
3636            /// Output only. Commercial state of the Marketplace Data Product.
3637            pub commercial_state: std::option::Option<crate::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState>,
3638
3639            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3640        }
3641
3642        impl GoogleCloudMarketplaceInfo {
3643            pub fn new() -> Self {
3644                std::default::Default::default()
3645            }
3646
3647            /// Sets the value of [service][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::service].
3648            ///
3649            /// # Example
3650            /// ```ignore,no_run
3651            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3652            /// let x = GoogleCloudMarketplaceInfo::new().set_service("example");
3653            /// ```
3654            pub fn set_service<T>(mut self, v: T) -> Self
3655            where
3656                T: std::convert::Into<std::string::String>,
3657            {
3658                self.service = std::option::Option::Some(v.into());
3659                self
3660            }
3661
3662            /// Sets or clears the value of [service][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::service].
3663            ///
3664            /// # Example
3665            /// ```ignore,no_run
3666            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3667            /// let x = GoogleCloudMarketplaceInfo::new().set_or_clear_service(Some("example"));
3668            /// let x = GoogleCloudMarketplaceInfo::new().set_or_clear_service(None::<String>);
3669            /// ```
3670            pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
3671            where
3672                T: std::convert::Into<std::string::String>,
3673            {
3674                self.service = v.map(|x| x.into());
3675                self
3676            }
3677
3678            /// Sets the value of [commercial_state][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::commercial_state].
3679            ///
3680            /// # Example
3681            /// ```ignore,no_run
3682            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3683            /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState;
3684            /// let x0 = GoogleCloudMarketplaceInfo::new().set_commercial_state(CommercialState::Onboarding);
3685            /// let x1 = GoogleCloudMarketplaceInfo::new().set_commercial_state(CommercialState::Active);
3686            /// ```
3687            pub fn set_commercial_state<T>(mut self, v: T) -> Self
3688            where T: std::convert::Into<crate::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState>
3689            {
3690                self.commercial_state = std::option::Option::Some(v.into());
3691                self
3692            }
3693
3694            /// Sets or clears the value of [commercial_state][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::commercial_state].
3695            ///
3696            /// # Example
3697            /// ```ignore,no_run
3698            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3699            /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState;
3700            /// let x0 = GoogleCloudMarketplaceInfo::new().set_or_clear_commercial_state(Some(CommercialState::Onboarding));
3701            /// let x1 = GoogleCloudMarketplaceInfo::new().set_or_clear_commercial_state(Some(CommercialState::Active));
3702            /// let x_none = GoogleCloudMarketplaceInfo::new().set_or_clear_commercial_state(None::<CommercialState>);
3703            /// ```
3704            pub fn set_or_clear_commercial_state<T>(mut self, v: std::option::Option<T>) -> Self
3705            where T: std::convert::Into<crate::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState>
3706            {
3707                self.commercial_state = v.map(|x| x.into());
3708                self
3709            }
3710        }
3711
3712        impl wkt::message::Message for GoogleCloudMarketplaceInfo {
3713            fn typename() -> &'static str {
3714                "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.CommercialInfo.GoogleCloudMarketplaceInfo"
3715            }
3716        }
3717
3718        /// Defines additional types related to [GoogleCloudMarketplaceInfo].
3719        pub mod google_cloud_marketplace_info {
3720            #[allow(unused_imports)]
3721            use super::*;
3722
3723            /// Indicates whether this commercial access is currently active.
3724            ///
3725            /// # Working with unknown values
3726            ///
3727            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3728            /// additional enum variants at any time. Adding new variants is not considered
3729            /// a breaking change. Applications should write their code in anticipation of:
3730            ///
3731            /// - New values appearing in future releases of the client library, **and**
3732            /// - New values received dynamically, without application changes.
3733            ///
3734            /// Please consult the [Working with enums] section in the user guide for some
3735            /// guidelines.
3736            ///
3737            /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3738            #[derive(Clone, Debug, PartialEq)]
3739            #[non_exhaustive]
3740            pub enum CommercialState {
3741                /// Commercialization is incomplete and cannot be used.
3742                Unspecified,
3743                /// Commercialization has been initialized.
3744                Onboarding,
3745                /// Commercialization is complete and available for use.
3746                Active,
3747                /// If set, the enum was initialized with an unknown value.
3748                ///
3749                /// Applications can examine the value using [CommercialState::value] or
3750                /// [CommercialState::name].
3751                UnknownValue(commercial_state::UnknownValue),
3752            }
3753
3754            #[doc(hidden)]
3755            pub mod commercial_state {
3756                #[allow(unused_imports)]
3757                use super::*;
3758                #[derive(Clone, Debug, PartialEq)]
3759                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3760            }
3761
3762            impl CommercialState {
3763                /// Gets the enum value.
3764                ///
3765                /// Returns `None` if the enum contains an unknown value deserialized from
3766                /// the string representation of enums.
3767                pub fn value(&self) -> std::option::Option<i32> {
3768                    match self {
3769                        Self::Unspecified => std::option::Option::Some(0),
3770                        Self::Onboarding => std::option::Option::Some(1),
3771                        Self::Active => std::option::Option::Some(2),
3772                        Self::UnknownValue(u) => u.0.value(),
3773                    }
3774                }
3775
3776                /// Gets the enum value as a string.
3777                ///
3778                /// Returns `None` if the enum contains an unknown value deserialized from
3779                /// the integer representation of enums.
3780                pub fn name(&self) -> std::option::Option<&str> {
3781                    match self {
3782                        Self::Unspecified => {
3783                            std::option::Option::Some("COMMERCIAL_STATE_UNSPECIFIED")
3784                        }
3785                        Self::Onboarding => std::option::Option::Some("ONBOARDING"),
3786                        Self::Active => std::option::Option::Some("ACTIVE"),
3787                        Self::UnknownValue(u) => u.0.name(),
3788                    }
3789                }
3790            }
3791
3792            impl std::default::Default for CommercialState {
3793                fn default() -> Self {
3794                    use std::convert::From;
3795                    Self::from(0)
3796                }
3797            }
3798
3799            impl std::fmt::Display for CommercialState {
3800                fn fmt(
3801                    &self,
3802                    f: &mut std::fmt::Formatter<'_>,
3803                ) -> std::result::Result<(), std::fmt::Error> {
3804                    wkt::internal::display_enum(f, self.name(), self.value())
3805                }
3806            }
3807
3808            impl std::convert::From<i32> for CommercialState {
3809                fn from(value: i32) -> Self {
3810                    match value {
3811                        0 => Self::Unspecified,
3812                        1 => Self::Onboarding,
3813                        2 => Self::Active,
3814                        _ => Self::UnknownValue(commercial_state::UnknownValue(
3815                            wkt::internal::UnknownEnumValue::Integer(value),
3816                        )),
3817                    }
3818                }
3819            }
3820
3821            impl std::convert::From<&str> for CommercialState {
3822                fn from(value: &str) -> Self {
3823                    use std::string::ToString;
3824                    match value {
3825                        "COMMERCIAL_STATE_UNSPECIFIED" => Self::Unspecified,
3826                        "ONBOARDING" => Self::Onboarding,
3827                        "ACTIVE" => Self::Active,
3828                        _ => Self::UnknownValue(commercial_state::UnknownValue(
3829                            wkt::internal::UnknownEnumValue::String(value.to_string()),
3830                        )),
3831                    }
3832                }
3833            }
3834
3835            impl serde::ser::Serialize for CommercialState {
3836                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3837                where
3838                    S: serde::Serializer,
3839                {
3840                    match self {
3841                        Self::Unspecified => serializer.serialize_i32(0),
3842                        Self::Onboarding => serializer.serialize_i32(1),
3843                        Self::Active => serializer.serialize_i32(2),
3844                        Self::UnknownValue(u) => u.0.serialize(serializer),
3845                    }
3846                }
3847            }
3848
3849            impl<'de> serde::de::Deserialize<'de> for CommercialState {
3850                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3851                where
3852                    D: serde::Deserializer<'de>,
3853                {
3854                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<CommercialState>::new(
3855                        ".google.cloud.bigquery.analyticshub.v1.Listing.CommercialInfo.GoogleCloudMarketplaceInfo.CommercialState"))
3856                }
3857            }
3858        }
3859    }
3860
3861    /// State of the listing.
3862    ///
3863    /// # Working with unknown values
3864    ///
3865    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3866    /// additional enum variants at any time. Adding new variants is not considered
3867    /// a breaking change. Applications should write their code in anticipation of:
3868    ///
3869    /// - New values appearing in future releases of the client library, **and**
3870    /// - New values received dynamically, without application changes.
3871    ///
3872    /// Please consult the [Working with enums] section in the user guide for some
3873    /// guidelines.
3874    ///
3875    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3876    #[derive(Clone, Debug, PartialEq)]
3877    #[non_exhaustive]
3878    pub enum State {
3879        /// Default value. This value is unused.
3880        Unspecified,
3881        /// Subscribable state. Users with dataexchange.listings.subscribe permission
3882        /// can subscribe to this listing.
3883        Active,
3884        /// If set, the enum was initialized with an unknown value.
3885        ///
3886        /// Applications can examine the value using [State::value] or
3887        /// [State::name].
3888        UnknownValue(state::UnknownValue),
3889    }
3890
3891    #[doc(hidden)]
3892    pub mod state {
3893        #[allow(unused_imports)]
3894        use super::*;
3895        #[derive(Clone, Debug, PartialEq)]
3896        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3897    }
3898
3899    impl State {
3900        /// Gets the enum value.
3901        ///
3902        /// Returns `None` if the enum contains an unknown value deserialized from
3903        /// the string representation of enums.
3904        pub fn value(&self) -> std::option::Option<i32> {
3905            match self {
3906                Self::Unspecified => std::option::Option::Some(0),
3907                Self::Active => std::option::Option::Some(1),
3908                Self::UnknownValue(u) => u.0.value(),
3909            }
3910        }
3911
3912        /// Gets the enum value as a string.
3913        ///
3914        /// Returns `None` if the enum contains an unknown value deserialized from
3915        /// the integer representation of enums.
3916        pub fn name(&self) -> std::option::Option<&str> {
3917            match self {
3918                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3919                Self::Active => std::option::Option::Some("ACTIVE"),
3920                Self::UnknownValue(u) => u.0.name(),
3921            }
3922        }
3923    }
3924
3925    impl std::default::Default for State {
3926        fn default() -> Self {
3927            use std::convert::From;
3928            Self::from(0)
3929        }
3930    }
3931
3932    impl std::fmt::Display for State {
3933        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3934            wkt::internal::display_enum(f, self.name(), self.value())
3935        }
3936    }
3937
3938    impl std::convert::From<i32> for State {
3939        fn from(value: i32) -> Self {
3940            match value {
3941                0 => Self::Unspecified,
3942                1 => Self::Active,
3943                _ => Self::UnknownValue(state::UnknownValue(
3944                    wkt::internal::UnknownEnumValue::Integer(value),
3945                )),
3946            }
3947        }
3948    }
3949
3950    impl std::convert::From<&str> for State {
3951        fn from(value: &str) -> Self {
3952            use std::string::ToString;
3953            match value {
3954                "STATE_UNSPECIFIED" => Self::Unspecified,
3955                "ACTIVE" => Self::Active,
3956                _ => Self::UnknownValue(state::UnknownValue(
3957                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3958                )),
3959            }
3960        }
3961    }
3962
3963    impl serde::ser::Serialize for State {
3964        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3965        where
3966            S: serde::Serializer,
3967        {
3968            match self {
3969                Self::Unspecified => serializer.serialize_i32(0),
3970                Self::Active => serializer.serialize_i32(1),
3971                Self::UnknownValue(u) => u.0.serialize(serializer),
3972            }
3973        }
3974    }
3975
3976    impl<'de> serde::de::Deserialize<'de> for State {
3977        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3978        where
3979            D: serde::Deserializer<'de>,
3980        {
3981            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3982                ".google.cloud.bigquery.analyticshub.v1.Listing.State",
3983            ))
3984        }
3985    }
3986
3987    /// Listing categories.
3988    ///
3989    /// # Working with unknown values
3990    ///
3991    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3992    /// additional enum variants at any time. Adding new variants is not considered
3993    /// a breaking change. Applications should write their code in anticipation of:
3994    ///
3995    /// - New values appearing in future releases of the client library, **and**
3996    /// - New values received dynamically, without application changes.
3997    ///
3998    /// Please consult the [Working with enums] section in the user guide for some
3999    /// guidelines.
4000    ///
4001    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4002    #[derive(Clone, Debug, PartialEq)]
4003    #[non_exhaustive]
4004    pub enum Category {
4005        Unspecified,
4006        Others,
4007        AdvertisingAndMarketing,
4008        Commerce,
4009        ClimateAndEnvironment,
4010        Demographics,
4011        Economics,
4012        Education,
4013        Energy,
4014        Financial,
4015        Gaming,
4016        Geospatial,
4017        HealthcareAndLifeScience,
4018        Media,
4019        PublicSector,
4020        Retail,
4021        Sports,
4022        ScienceAndResearch,
4023        TransportationAndLogistics,
4024        TravelAndTourism,
4025        GoogleEarthEngine,
4026        /// If set, the enum was initialized with an unknown value.
4027        ///
4028        /// Applications can examine the value using [Category::value] or
4029        /// [Category::name].
4030        UnknownValue(category::UnknownValue),
4031    }
4032
4033    #[doc(hidden)]
4034    pub mod category {
4035        #[allow(unused_imports)]
4036        use super::*;
4037        #[derive(Clone, Debug, PartialEq)]
4038        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4039    }
4040
4041    impl Category {
4042        /// Gets the enum value.
4043        ///
4044        /// Returns `None` if the enum contains an unknown value deserialized from
4045        /// the string representation of enums.
4046        pub fn value(&self) -> std::option::Option<i32> {
4047            match self {
4048                Self::Unspecified => std::option::Option::Some(0),
4049                Self::Others => std::option::Option::Some(1),
4050                Self::AdvertisingAndMarketing => std::option::Option::Some(2),
4051                Self::Commerce => std::option::Option::Some(3),
4052                Self::ClimateAndEnvironment => std::option::Option::Some(4),
4053                Self::Demographics => std::option::Option::Some(5),
4054                Self::Economics => std::option::Option::Some(6),
4055                Self::Education => std::option::Option::Some(7),
4056                Self::Energy => std::option::Option::Some(8),
4057                Self::Financial => std::option::Option::Some(9),
4058                Self::Gaming => std::option::Option::Some(10),
4059                Self::Geospatial => std::option::Option::Some(11),
4060                Self::HealthcareAndLifeScience => std::option::Option::Some(12),
4061                Self::Media => std::option::Option::Some(13),
4062                Self::PublicSector => std::option::Option::Some(14),
4063                Self::Retail => std::option::Option::Some(15),
4064                Self::Sports => std::option::Option::Some(16),
4065                Self::ScienceAndResearch => std::option::Option::Some(17),
4066                Self::TransportationAndLogistics => std::option::Option::Some(18),
4067                Self::TravelAndTourism => std::option::Option::Some(19),
4068                Self::GoogleEarthEngine => std::option::Option::Some(20),
4069                Self::UnknownValue(u) => u.0.value(),
4070            }
4071        }
4072
4073        /// Gets the enum value as a string.
4074        ///
4075        /// Returns `None` if the enum contains an unknown value deserialized from
4076        /// the integer representation of enums.
4077        pub fn name(&self) -> std::option::Option<&str> {
4078            match self {
4079                Self::Unspecified => std::option::Option::Some("CATEGORY_UNSPECIFIED"),
4080                Self::Others => std::option::Option::Some("CATEGORY_OTHERS"),
4081                Self::AdvertisingAndMarketing => {
4082                    std::option::Option::Some("CATEGORY_ADVERTISING_AND_MARKETING")
4083                }
4084                Self::Commerce => std::option::Option::Some("CATEGORY_COMMERCE"),
4085                Self::ClimateAndEnvironment => {
4086                    std::option::Option::Some("CATEGORY_CLIMATE_AND_ENVIRONMENT")
4087                }
4088                Self::Demographics => std::option::Option::Some("CATEGORY_DEMOGRAPHICS"),
4089                Self::Economics => std::option::Option::Some("CATEGORY_ECONOMICS"),
4090                Self::Education => std::option::Option::Some("CATEGORY_EDUCATION"),
4091                Self::Energy => std::option::Option::Some("CATEGORY_ENERGY"),
4092                Self::Financial => std::option::Option::Some("CATEGORY_FINANCIAL"),
4093                Self::Gaming => std::option::Option::Some("CATEGORY_GAMING"),
4094                Self::Geospatial => std::option::Option::Some("CATEGORY_GEOSPATIAL"),
4095                Self::HealthcareAndLifeScience => {
4096                    std::option::Option::Some("CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE")
4097                }
4098                Self::Media => std::option::Option::Some("CATEGORY_MEDIA"),
4099                Self::PublicSector => std::option::Option::Some("CATEGORY_PUBLIC_SECTOR"),
4100                Self::Retail => std::option::Option::Some("CATEGORY_RETAIL"),
4101                Self::Sports => std::option::Option::Some("CATEGORY_SPORTS"),
4102                Self::ScienceAndResearch => {
4103                    std::option::Option::Some("CATEGORY_SCIENCE_AND_RESEARCH")
4104                }
4105                Self::TransportationAndLogistics => {
4106                    std::option::Option::Some("CATEGORY_TRANSPORTATION_AND_LOGISTICS")
4107                }
4108                Self::TravelAndTourism => std::option::Option::Some("CATEGORY_TRAVEL_AND_TOURISM"),
4109                Self::GoogleEarthEngine => {
4110                    std::option::Option::Some("CATEGORY_GOOGLE_EARTH_ENGINE")
4111                }
4112                Self::UnknownValue(u) => u.0.name(),
4113            }
4114        }
4115    }
4116
4117    impl std::default::Default for Category {
4118        fn default() -> Self {
4119            use std::convert::From;
4120            Self::from(0)
4121        }
4122    }
4123
4124    impl std::fmt::Display for Category {
4125        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4126            wkt::internal::display_enum(f, self.name(), self.value())
4127        }
4128    }
4129
4130    impl std::convert::From<i32> for Category {
4131        fn from(value: i32) -> Self {
4132            match value {
4133                0 => Self::Unspecified,
4134                1 => Self::Others,
4135                2 => Self::AdvertisingAndMarketing,
4136                3 => Self::Commerce,
4137                4 => Self::ClimateAndEnvironment,
4138                5 => Self::Demographics,
4139                6 => Self::Economics,
4140                7 => Self::Education,
4141                8 => Self::Energy,
4142                9 => Self::Financial,
4143                10 => Self::Gaming,
4144                11 => Self::Geospatial,
4145                12 => Self::HealthcareAndLifeScience,
4146                13 => Self::Media,
4147                14 => Self::PublicSector,
4148                15 => Self::Retail,
4149                16 => Self::Sports,
4150                17 => Self::ScienceAndResearch,
4151                18 => Self::TransportationAndLogistics,
4152                19 => Self::TravelAndTourism,
4153                20 => Self::GoogleEarthEngine,
4154                _ => Self::UnknownValue(category::UnknownValue(
4155                    wkt::internal::UnknownEnumValue::Integer(value),
4156                )),
4157            }
4158        }
4159    }
4160
4161    impl std::convert::From<&str> for Category {
4162        fn from(value: &str) -> Self {
4163            use std::string::ToString;
4164            match value {
4165                "CATEGORY_UNSPECIFIED" => Self::Unspecified,
4166                "CATEGORY_OTHERS" => Self::Others,
4167                "CATEGORY_ADVERTISING_AND_MARKETING" => Self::AdvertisingAndMarketing,
4168                "CATEGORY_COMMERCE" => Self::Commerce,
4169                "CATEGORY_CLIMATE_AND_ENVIRONMENT" => Self::ClimateAndEnvironment,
4170                "CATEGORY_DEMOGRAPHICS" => Self::Demographics,
4171                "CATEGORY_ECONOMICS" => Self::Economics,
4172                "CATEGORY_EDUCATION" => Self::Education,
4173                "CATEGORY_ENERGY" => Self::Energy,
4174                "CATEGORY_FINANCIAL" => Self::Financial,
4175                "CATEGORY_GAMING" => Self::Gaming,
4176                "CATEGORY_GEOSPATIAL" => Self::Geospatial,
4177                "CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE" => Self::HealthcareAndLifeScience,
4178                "CATEGORY_MEDIA" => Self::Media,
4179                "CATEGORY_PUBLIC_SECTOR" => Self::PublicSector,
4180                "CATEGORY_RETAIL" => Self::Retail,
4181                "CATEGORY_SPORTS" => Self::Sports,
4182                "CATEGORY_SCIENCE_AND_RESEARCH" => Self::ScienceAndResearch,
4183                "CATEGORY_TRANSPORTATION_AND_LOGISTICS" => Self::TransportationAndLogistics,
4184                "CATEGORY_TRAVEL_AND_TOURISM" => Self::TravelAndTourism,
4185                "CATEGORY_GOOGLE_EARTH_ENGINE" => Self::GoogleEarthEngine,
4186                _ => Self::UnknownValue(category::UnknownValue(
4187                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4188                )),
4189            }
4190        }
4191    }
4192
4193    impl serde::ser::Serialize for Category {
4194        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4195        where
4196            S: serde::Serializer,
4197        {
4198            match self {
4199                Self::Unspecified => serializer.serialize_i32(0),
4200                Self::Others => serializer.serialize_i32(1),
4201                Self::AdvertisingAndMarketing => serializer.serialize_i32(2),
4202                Self::Commerce => serializer.serialize_i32(3),
4203                Self::ClimateAndEnvironment => serializer.serialize_i32(4),
4204                Self::Demographics => serializer.serialize_i32(5),
4205                Self::Economics => serializer.serialize_i32(6),
4206                Self::Education => serializer.serialize_i32(7),
4207                Self::Energy => serializer.serialize_i32(8),
4208                Self::Financial => serializer.serialize_i32(9),
4209                Self::Gaming => serializer.serialize_i32(10),
4210                Self::Geospatial => serializer.serialize_i32(11),
4211                Self::HealthcareAndLifeScience => serializer.serialize_i32(12),
4212                Self::Media => serializer.serialize_i32(13),
4213                Self::PublicSector => serializer.serialize_i32(14),
4214                Self::Retail => serializer.serialize_i32(15),
4215                Self::Sports => serializer.serialize_i32(16),
4216                Self::ScienceAndResearch => serializer.serialize_i32(17),
4217                Self::TransportationAndLogistics => serializer.serialize_i32(18),
4218                Self::TravelAndTourism => serializer.serialize_i32(19),
4219                Self::GoogleEarthEngine => serializer.serialize_i32(20),
4220                Self::UnknownValue(u) => u.0.serialize(serializer),
4221            }
4222        }
4223    }
4224
4225    impl<'de> serde::de::Deserialize<'de> for Category {
4226        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4227        where
4228            D: serde::Deserializer<'de>,
4229        {
4230            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Category>::new(
4231                ".google.cloud.bigquery.analyticshub.v1.Listing.Category",
4232            ))
4233        }
4234    }
4235
4236    /// Listing source.
4237    #[derive(Clone, Debug, PartialEq)]
4238    #[non_exhaustive]
4239    pub enum Source {
4240        /// Shared dataset i.e. BigQuery dataset source.
4241        BigqueryDataset(std::boxed::Box<crate::model::listing::BigQueryDatasetSource>),
4242        /// Pub/Sub topic source.
4243        PubsubTopic(std::boxed::Box<crate::model::listing::PubSubTopicSource>),
4244    }
4245}
4246
4247/// Stored procedure configuration, used to configure stored procedure sharing
4248/// on linked dataset.
4249#[derive(Clone, Default, PartialEq)]
4250#[non_exhaustive]
4251pub struct StoredProcedureConfig {
4252    /// Optional. If true, enable sharing of stored procedure.
4253    pub enabled: bool,
4254
4255    /// Output only. Types of stored procedure supported to share.
4256    pub allowed_stored_procedure_types:
4257        std::vec::Vec<crate::model::stored_procedure_config::StoredProcedureType>,
4258
4259    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4260}
4261
4262impl StoredProcedureConfig {
4263    pub fn new() -> Self {
4264        std::default::Default::default()
4265    }
4266
4267    /// Sets the value of [enabled][crate::model::StoredProcedureConfig::enabled].
4268    ///
4269    /// # Example
4270    /// ```ignore,no_run
4271    /// # use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
4272    /// let x = StoredProcedureConfig::new().set_enabled(true);
4273    /// ```
4274    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4275        self.enabled = v.into();
4276        self
4277    }
4278
4279    /// Sets the value of [allowed_stored_procedure_types][crate::model::StoredProcedureConfig::allowed_stored_procedure_types].
4280    ///
4281    /// # Example
4282    /// ```ignore,no_run
4283    /// # use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
4284    /// use google_cloud_bigquery_analyticshub_v1::model::stored_procedure_config::StoredProcedureType;
4285    /// let x = StoredProcedureConfig::new().set_allowed_stored_procedure_types([
4286    ///     StoredProcedureType::SqlProcedure,
4287    /// ]);
4288    /// ```
4289    pub fn set_allowed_stored_procedure_types<T, V>(mut self, v: T) -> Self
4290    where
4291        T: std::iter::IntoIterator<Item = V>,
4292        V: std::convert::Into<crate::model::stored_procedure_config::StoredProcedureType>,
4293    {
4294        use std::iter::Iterator;
4295        self.allowed_stored_procedure_types = v.into_iter().map(|i| i.into()).collect();
4296        self
4297    }
4298}
4299
4300impl wkt::message::Message for StoredProcedureConfig {
4301    fn typename() -> &'static str {
4302        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.StoredProcedureConfig"
4303    }
4304}
4305
4306/// Defines additional types related to [StoredProcedureConfig].
4307pub mod stored_procedure_config {
4308    #[allow(unused_imports)]
4309    use super::*;
4310
4311    /// Enum to specify the type of stored procedure to share.
4312    ///
4313    /// # Working with unknown values
4314    ///
4315    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4316    /// additional enum variants at any time. Adding new variants is not considered
4317    /// a breaking change. Applications should write their code in anticipation of:
4318    ///
4319    /// - New values appearing in future releases of the client library, **and**
4320    /// - New values received dynamically, without application changes.
4321    ///
4322    /// Please consult the [Working with enums] section in the user guide for some
4323    /// guidelines.
4324    ///
4325    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4326    #[derive(Clone, Debug, PartialEq)]
4327    #[non_exhaustive]
4328    pub enum StoredProcedureType {
4329        /// Default value. This value is unused.
4330        Unspecified,
4331        /// SQL stored procedure.
4332        SqlProcedure,
4333        /// If set, the enum was initialized with an unknown value.
4334        ///
4335        /// Applications can examine the value using [StoredProcedureType::value] or
4336        /// [StoredProcedureType::name].
4337        UnknownValue(stored_procedure_type::UnknownValue),
4338    }
4339
4340    #[doc(hidden)]
4341    pub mod stored_procedure_type {
4342        #[allow(unused_imports)]
4343        use super::*;
4344        #[derive(Clone, Debug, PartialEq)]
4345        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4346    }
4347
4348    impl StoredProcedureType {
4349        /// Gets the enum value.
4350        ///
4351        /// Returns `None` if the enum contains an unknown value deserialized from
4352        /// the string representation of enums.
4353        pub fn value(&self) -> std::option::Option<i32> {
4354            match self {
4355                Self::Unspecified => std::option::Option::Some(0),
4356                Self::SqlProcedure => std::option::Option::Some(1),
4357                Self::UnknownValue(u) => u.0.value(),
4358            }
4359        }
4360
4361        /// Gets the enum value as a string.
4362        ///
4363        /// Returns `None` if the enum contains an unknown value deserialized from
4364        /// the integer representation of enums.
4365        pub fn name(&self) -> std::option::Option<&str> {
4366            match self {
4367                Self::Unspecified => std::option::Option::Some("STORED_PROCEDURE_TYPE_UNSPECIFIED"),
4368                Self::SqlProcedure => std::option::Option::Some("SQL_PROCEDURE"),
4369                Self::UnknownValue(u) => u.0.name(),
4370            }
4371        }
4372    }
4373
4374    impl std::default::Default for StoredProcedureType {
4375        fn default() -> Self {
4376            use std::convert::From;
4377            Self::from(0)
4378        }
4379    }
4380
4381    impl std::fmt::Display for StoredProcedureType {
4382        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4383            wkt::internal::display_enum(f, self.name(), self.value())
4384        }
4385    }
4386
4387    impl std::convert::From<i32> for StoredProcedureType {
4388        fn from(value: i32) -> Self {
4389            match value {
4390                0 => Self::Unspecified,
4391                1 => Self::SqlProcedure,
4392                _ => Self::UnknownValue(stored_procedure_type::UnknownValue(
4393                    wkt::internal::UnknownEnumValue::Integer(value),
4394                )),
4395            }
4396        }
4397    }
4398
4399    impl std::convert::From<&str> for StoredProcedureType {
4400        fn from(value: &str) -> Self {
4401            use std::string::ToString;
4402            match value {
4403                "STORED_PROCEDURE_TYPE_UNSPECIFIED" => Self::Unspecified,
4404                "SQL_PROCEDURE" => Self::SqlProcedure,
4405                _ => Self::UnknownValue(stored_procedure_type::UnknownValue(
4406                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4407                )),
4408            }
4409        }
4410    }
4411
4412    impl serde::ser::Serialize for StoredProcedureType {
4413        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4414        where
4415            S: serde::Serializer,
4416        {
4417            match self {
4418                Self::Unspecified => serializer.serialize_i32(0),
4419                Self::SqlProcedure => serializer.serialize_i32(1),
4420                Self::UnknownValue(u) => u.0.serialize(serializer),
4421            }
4422        }
4423    }
4424
4425    impl<'de> serde::de::Deserialize<'de> for StoredProcedureType {
4426        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4427        where
4428            D: serde::Deserializer<'de>,
4429        {
4430            deserializer.deserialize_any(wkt::internal::EnumVisitor::<StoredProcedureType>::new(
4431                ".google.cloud.bigquery.analyticshub.v1.StoredProcedureConfig.StoredProcedureType",
4432            ))
4433        }
4434    }
4435}
4436
4437/// A subscription represents a subscribers' access to a particular set of
4438/// published data. It contains references to associated listings,
4439/// data exchanges, and linked datasets.
4440#[derive(Clone, Default, PartialEq)]
4441#[non_exhaustive]
4442pub struct Subscription {
4443    /// Output only. The resource name of the subscription.
4444    /// e.g. `projects/myproject/locations/us/subscriptions/123`.
4445    pub name: std::string::String,
4446
4447    /// Output only. Timestamp when the subscription was created.
4448    pub creation_time: std::option::Option<wkt::Timestamp>,
4449
4450    /// Output only. Timestamp when the subscription was last modified.
4451    pub last_modify_time: std::option::Option<wkt::Timestamp>,
4452
4453    /// Output only. Organization of the project this subscription belongs to.
4454    pub organization_id: std::string::String,
4455
4456    /// Output only. Display name of the project of this subscription.
4457    pub organization_display_name: std::string::String,
4458
4459    /// Output only. Current state of the subscription.
4460    pub state: crate::model::subscription::State,
4461
4462    /// Output only. Map of listing resource names to associated linked resource,
4463    /// e.g. projects/123/locations/us/dataExchanges/456/listings/789
4464    /// ->
4465    /// projects/123/datasets/my_dataset
4466    ///
4467    /// For listing-level subscriptions, this is a map of size 1.
4468    /// Only contains values if state == STATE_ACTIVE.
4469    pub linked_dataset_map:
4470        std::collections::HashMap<std::string::String, crate::model::subscription::LinkedResource>,
4471
4472    /// Output only. Email of the subscriber.
4473    pub subscriber_contact: std::string::String,
4474
4475    /// Output only. Linked resources created in the subscription. Only contains
4476    /// values if state = STATE_ACTIVE.
4477    pub linked_resources: std::vec::Vec<crate::model::subscription::LinkedResource>,
4478
4479    /// Output only. Listing shared asset type.
4480    pub resource_type: crate::model::SharedResourceType,
4481
4482    /// Output only. This is set if this is a commercial subscription i.e. if this
4483    /// subscription was created from subscribing to a commercial listing.
4484    pub commercial_info: std::option::Option<crate::model::subscription::CommercialInfo>,
4485
4486    /// Output only. By default, false.
4487    /// If true, the Subscriber agreed to the email sharing mandate
4488    /// that is enabled for DataExchange/Listing.
4489    pub log_linked_dataset_query_user_email: std::option::Option<bool>,
4490
4491    /// Optional. BigQuery destination dataset to create for the subscriber.
4492    pub destination_dataset: std::option::Option<crate::model::DestinationDataset>,
4493
4494    pub resource_name: std::option::Option<crate::model::subscription::ResourceName>,
4495
4496    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4497}
4498
4499impl Subscription {
4500    pub fn new() -> Self {
4501        std::default::Default::default()
4502    }
4503
4504    /// Sets the value of [name][crate::model::Subscription::name].
4505    ///
4506    /// # Example
4507    /// ```ignore,no_run
4508    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4509    /// let x = Subscription::new().set_name("example");
4510    /// ```
4511    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4512        self.name = v.into();
4513        self
4514    }
4515
4516    /// Sets the value of [creation_time][crate::model::Subscription::creation_time].
4517    ///
4518    /// # Example
4519    /// ```ignore,no_run
4520    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4521    /// use wkt::Timestamp;
4522    /// let x = Subscription::new().set_creation_time(Timestamp::default()/* use setters */);
4523    /// ```
4524    pub fn set_creation_time<T>(mut self, v: T) -> Self
4525    where
4526        T: std::convert::Into<wkt::Timestamp>,
4527    {
4528        self.creation_time = std::option::Option::Some(v.into());
4529        self
4530    }
4531
4532    /// Sets or clears the value of [creation_time][crate::model::Subscription::creation_time].
4533    ///
4534    /// # Example
4535    /// ```ignore,no_run
4536    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4537    /// use wkt::Timestamp;
4538    /// let x = Subscription::new().set_or_clear_creation_time(Some(Timestamp::default()/* use setters */));
4539    /// let x = Subscription::new().set_or_clear_creation_time(None::<Timestamp>);
4540    /// ```
4541    pub fn set_or_clear_creation_time<T>(mut self, v: std::option::Option<T>) -> Self
4542    where
4543        T: std::convert::Into<wkt::Timestamp>,
4544    {
4545        self.creation_time = v.map(|x| x.into());
4546        self
4547    }
4548
4549    /// Sets the value of [last_modify_time][crate::model::Subscription::last_modify_time].
4550    ///
4551    /// # Example
4552    /// ```ignore,no_run
4553    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4554    /// use wkt::Timestamp;
4555    /// let x = Subscription::new().set_last_modify_time(Timestamp::default()/* use setters */);
4556    /// ```
4557    pub fn set_last_modify_time<T>(mut self, v: T) -> Self
4558    where
4559        T: std::convert::Into<wkt::Timestamp>,
4560    {
4561        self.last_modify_time = std::option::Option::Some(v.into());
4562        self
4563    }
4564
4565    /// Sets or clears the value of [last_modify_time][crate::model::Subscription::last_modify_time].
4566    ///
4567    /// # Example
4568    /// ```ignore,no_run
4569    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4570    /// use wkt::Timestamp;
4571    /// let x = Subscription::new().set_or_clear_last_modify_time(Some(Timestamp::default()/* use setters */));
4572    /// let x = Subscription::new().set_or_clear_last_modify_time(None::<Timestamp>);
4573    /// ```
4574    pub fn set_or_clear_last_modify_time<T>(mut self, v: std::option::Option<T>) -> Self
4575    where
4576        T: std::convert::Into<wkt::Timestamp>,
4577    {
4578        self.last_modify_time = v.map(|x| x.into());
4579        self
4580    }
4581
4582    /// Sets the value of [organization_id][crate::model::Subscription::organization_id].
4583    ///
4584    /// # Example
4585    /// ```ignore,no_run
4586    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4587    /// let x = Subscription::new().set_organization_id("example");
4588    /// ```
4589    pub fn set_organization_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4590        self.organization_id = v.into();
4591        self
4592    }
4593
4594    /// Sets the value of [organization_display_name][crate::model::Subscription::organization_display_name].
4595    ///
4596    /// # Example
4597    /// ```ignore,no_run
4598    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4599    /// let x = Subscription::new().set_organization_display_name("example");
4600    /// ```
4601    pub fn set_organization_display_name<T: std::convert::Into<std::string::String>>(
4602        mut self,
4603        v: T,
4604    ) -> Self {
4605        self.organization_display_name = v.into();
4606        self
4607    }
4608
4609    /// Sets the value of [state][crate::model::Subscription::state].
4610    ///
4611    /// # Example
4612    /// ```ignore,no_run
4613    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4614    /// use google_cloud_bigquery_analyticshub_v1::model::subscription::State;
4615    /// let x0 = Subscription::new().set_state(State::Active);
4616    /// let x1 = Subscription::new().set_state(State::Stale);
4617    /// let x2 = Subscription::new().set_state(State::Inactive);
4618    /// ```
4619    pub fn set_state<T: std::convert::Into<crate::model::subscription::State>>(
4620        mut self,
4621        v: T,
4622    ) -> Self {
4623        self.state = v.into();
4624        self
4625    }
4626
4627    /// Sets the value of [linked_dataset_map][crate::model::Subscription::linked_dataset_map].
4628    ///
4629    /// # Example
4630    /// ```ignore,no_run
4631    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4632    /// use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
4633    /// let x = Subscription::new().set_linked_dataset_map([
4634    ///     ("key0", LinkedResource::default()/* use setters */),
4635    ///     ("key1", LinkedResource::default()/* use (different) setters */),
4636    /// ]);
4637    /// ```
4638    pub fn set_linked_dataset_map<T, K, V>(mut self, v: T) -> Self
4639    where
4640        T: std::iter::IntoIterator<Item = (K, V)>,
4641        K: std::convert::Into<std::string::String>,
4642        V: std::convert::Into<crate::model::subscription::LinkedResource>,
4643    {
4644        use std::iter::Iterator;
4645        self.linked_dataset_map = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4646        self
4647    }
4648
4649    /// Sets the value of [subscriber_contact][crate::model::Subscription::subscriber_contact].
4650    ///
4651    /// # Example
4652    /// ```ignore,no_run
4653    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4654    /// let x = Subscription::new().set_subscriber_contact("example");
4655    /// ```
4656    pub fn set_subscriber_contact<T: std::convert::Into<std::string::String>>(
4657        mut self,
4658        v: T,
4659    ) -> Self {
4660        self.subscriber_contact = v.into();
4661        self
4662    }
4663
4664    /// Sets the value of [linked_resources][crate::model::Subscription::linked_resources].
4665    ///
4666    /// # Example
4667    /// ```ignore,no_run
4668    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4669    /// use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
4670    /// let x = Subscription::new()
4671    ///     .set_linked_resources([
4672    ///         LinkedResource::default()/* use setters */,
4673    ///         LinkedResource::default()/* use (different) setters */,
4674    ///     ]);
4675    /// ```
4676    pub fn set_linked_resources<T, V>(mut self, v: T) -> Self
4677    where
4678        T: std::iter::IntoIterator<Item = V>,
4679        V: std::convert::Into<crate::model::subscription::LinkedResource>,
4680    {
4681        use std::iter::Iterator;
4682        self.linked_resources = v.into_iter().map(|i| i.into()).collect();
4683        self
4684    }
4685
4686    /// Sets the value of [resource_type][crate::model::Subscription::resource_type].
4687    ///
4688    /// # Example
4689    /// ```ignore,no_run
4690    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4691    /// use google_cloud_bigquery_analyticshub_v1::model::SharedResourceType;
4692    /// let x0 = Subscription::new().set_resource_type(SharedResourceType::BigqueryDataset);
4693    /// let x1 = Subscription::new().set_resource_type(SharedResourceType::PubsubTopic);
4694    /// ```
4695    pub fn set_resource_type<T: std::convert::Into<crate::model::SharedResourceType>>(
4696        mut self,
4697        v: T,
4698    ) -> Self {
4699        self.resource_type = v.into();
4700        self
4701    }
4702
4703    /// Sets the value of [commercial_info][crate::model::Subscription::commercial_info].
4704    ///
4705    /// # Example
4706    /// ```ignore,no_run
4707    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4708    /// use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
4709    /// let x = Subscription::new().set_commercial_info(CommercialInfo::default()/* use setters */);
4710    /// ```
4711    pub fn set_commercial_info<T>(mut self, v: T) -> Self
4712    where
4713        T: std::convert::Into<crate::model::subscription::CommercialInfo>,
4714    {
4715        self.commercial_info = std::option::Option::Some(v.into());
4716        self
4717    }
4718
4719    /// Sets or clears the value of [commercial_info][crate::model::Subscription::commercial_info].
4720    ///
4721    /// # Example
4722    /// ```ignore,no_run
4723    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4724    /// use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
4725    /// let x = Subscription::new().set_or_clear_commercial_info(Some(CommercialInfo::default()/* use setters */));
4726    /// let x = Subscription::new().set_or_clear_commercial_info(None::<CommercialInfo>);
4727    /// ```
4728    pub fn set_or_clear_commercial_info<T>(mut self, v: std::option::Option<T>) -> Self
4729    where
4730        T: std::convert::Into<crate::model::subscription::CommercialInfo>,
4731    {
4732        self.commercial_info = v.map(|x| x.into());
4733        self
4734    }
4735
4736    /// Sets the value of [log_linked_dataset_query_user_email][crate::model::Subscription::log_linked_dataset_query_user_email].
4737    ///
4738    /// # Example
4739    /// ```ignore,no_run
4740    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4741    /// let x = Subscription::new().set_log_linked_dataset_query_user_email(true);
4742    /// ```
4743    pub fn set_log_linked_dataset_query_user_email<T>(mut self, v: T) -> Self
4744    where
4745        T: std::convert::Into<bool>,
4746    {
4747        self.log_linked_dataset_query_user_email = std::option::Option::Some(v.into());
4748        self
4749    }
4750
4751    /// Sets or clears the value of [log_linked_dataset_query_user_email][crate::model::Subscription::log_linked_dataset_query_user_email].
4752    ///
4753    /// # Example
4754    /// ```ignore,no_run
4755    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4756    /// let x = Subscription::new().set_or_clear_log_linked_dataset_query_user_email(Some(false));
4757    /// let x = Subscription::new().set_or_clear_log_linked_dataset_query_user_email(None::<bool>);
4758    /// ```
4759    pub fn set_or_clear_log_linked_dataset_query_user_email<T>(
4760        mut self,
4761        v: std::option::Option<T>,
4762    ) -> Self
4763    where
4764        T: std::convert::Into<bool>,
4765    {
4766        self.log_linked_dataset_query_user_email = v.map(|x| x.into());
4767        self
4768    }
4769
4770    /// Sets the value of [destination_dataset][crate::model::Subscription::destination_dataset].
4771    ///
4772    /// # Example
4773    /// ```ignore,no_run
4774    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4775    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
4776    /// let x = Subscription::new().set_destination_dataset(DestinationDataset::default()/* use setters */);
4777    /// ```
4778    pub fn set_destination_dataset<T>(mut self, v: T) -> Self
4779    where
4780        T: std::convert::Into<crate::model::DestinationDataset>,
4781    {
4782        self.destination_dataset = std::option::Option::Some(v.into());
4783        self
4784    }
4785
4786    /// Sets or clears the value of [destination_dataset][crate::model::Subscription::destination_dataset].
4787    ///
4788    /// # Example
4789    /// ```ignore,no_run
4790    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4791    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
4792    /// let x = Subscription::new().set_or_clear_destination_dataset(Some(DestinationDataset::default()/* use setters */));
4793    /// let x = Subscription::new().set_or_clear_destination_dataset(None::<DestinationDataset>);
4794    /// ```
4795    pub fn set_or_clear_destination_dataset<T>(mut self, v: std::option::Option<T>) -> Self
4796    where
4797        T: std::convert::Into<crate::model::DestinationDataset>,
4798    {
4799        self.destination_dataset = v.map(|x| x.into());
4800        self
4801    }
4802
4803    /// Sets the value of [resource_name][crate::model::Subscription::resource_name].
4804    ///
4805    /// Note that all the setters affecting `resource_name` are mutually
4806    /// exclusive.
4807    ///
4808    /// # Example
4809    /// ```ignore,no_run
4810    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4811    /// use google_cloud_bigquery_analyticshub_v1::model::subscription::ResourceName;
4812    /// let x = Subscription::new().set_resource_name(Some(ResourceName::Listing("example".to_string())));
4813    /// ```
4814    pub fn set_resource_name<
4815        T: std::convert::Into<std::option::Option<crate::model::subscription::ResourceName>>,
4816    >(
4817        mut self,
4818        v: T,
4819    ) -> Self {
4820        self.resource_name = v.into();
4821        self
4822    }
4823
4824    /// The value of [resource_name][crate::model::Subscription::resource_name]
4825    /// if it holds a `Listing`, `None` if the field is not set or
4826    /// holds a different branch.
4827    pub fn listing(&self) -> std::option::Option<&std::string::String> {
4828        #[allow(unreachable_patterns)]
4829        self.resource_name.as_ref().and_then(|v| match v {
4830            crate::model::subscription::ResourceName::Listing(v) => std::option::Option::Some(v),
4831            _ => std::option::Option::None,
4832        })
4833    }
4834
4835    /// Sets the value of [resource_name][crate::model::Subscription::resource_name]
4836    /// to hold a `Listing`.
4837    ///
4838    /// Note that all the setters affecting `resource_name` are
4839    /// mutually exclusive.
4840    ///
4841    /// # Example
4842    /// ```ignore,no_run
4843    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4844    /// let x = Subscription::new().set_listing("example");
4845    /// assert!(x.listing().is_some());
4846    /// assert!(x.data_exchange().is_none());
4847    /// ```
4848    pub fn set_listing<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4849        self.resource_name =
4850            std::option::Option::Some(crate::model::subscription::ResourceName::Listing(v.into()));
4851        self
4852    }
4853
4854    /// The value of [resource_name][crate::model::Subscription::resource_name]
4855    /// if it holds a `DataExchange`, `None` if the field is not set or
4856    /// holds a different branch.
4857    pub fn data_exchange(&self) -> std::option::Option<&std::string::String> {
4858        #[allow(unreachable_patterns)]
4859        self.resource_name.as_ref().and_then(|v| match v {
4860            crate::model::subscription::ResourceName::DataExchange(v) => {
4861                std::option::Option::Some(v)
4862            }
4863            _ => std::option::Option::None,
4864        })
4865    }
4866
4867    /// Sets the value of [resource_name][crate::model::Subscription::resource_name]
4868    /// to hold a `DataExchange`.
4869    ///
4870    /// Note that all the setters affecting `resource_name` are
4871    /// mutually exclusive.
4872    ///
4873    /// # Example
4874    /// ```ignore,no_run
4875    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4876    /// let x = Subscription::new().set_data_exchange("example");
4877    /// assert!(x.data_exchange().is_some());
4878    /// assert!(x.listing().is_none());
4879    /// ```
4880    pub fn set_data_exchange<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4881        self.resource_name = std::option::Option::Some(
4882            crate::model::subscription::ResourceName::DataExchange(v.into()),
4883        );
4884        self
4885    }
4886}
4887
4888impl wkt::message::Message for Subscription {
4889    fn typename() -> &'static str {
4890        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription"
4891    }
4892}
4893
4894/// Defines additional types related to [Subscription].
4895pub mod subscription {
4896    #[allow(unused_imports)]
4897    use super::*;
4898
4899    /// Reference to a linked resource tracked by this Subscription.
4900    #[derive(Clone, Default, PartialEq)]
4901    #[non_exhaustive]
4902    pub struct LinkedResource {
4903        /// Output only. Listing for which linked resource is created.
4904        pub listing: std::string::String,
4905
4906        pub reference: std::option::Option<crate::model::subscription::linked_resource::Reference>,
4907
4908        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4909    }
4910
4911    impl LinkedResource {
4912        pub fn new() -> Self {
4913            std::default::Default::default()
4914        }
4915
4916        /// Sets the value of [listing][crate::model::subscription::LinkedResource::listing].
4917        ///
4918        /// # Example
4919        /// ```ignore,no_run
4920        /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
4921        /// let x = LinkedResource::new().set_listing("example");
4922        /// ```
4923        pub fn set_listing<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4924            self.listing = v.into();
4925            self
4926        }
4927
4928        /// Sets the value of [reference][crate::model::subscription::LinkedResource::reference].
4929        ///
4930        /// Note that all the setters affecting `reference` are mutually
4931        /// exclusive.
4932        ///
4933        /// # Example
4934        /// ```ignore,no_run
4935        /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
4936        /// use google_cloud_bigquery_analyticshub_v1::model::subscription::linked_resource::Reference;
4937        /// let x = LinkedResource::new().set_reference(Some(Reference::LinkedDataset("example".to_string())));
4938        /// ```
4939        pub fn set_reference<
4940            T: std::convert::Into<
4941                    std::option::Option<crate::model::subscription::linked_resource::Reference>,
4942                >,
4943        >(
4944            mut self,
4945            v: T,
4946        ) -> Self {
4947            self.reference = v.into();
4948            self
4949        }
4950
4951        /// The value of [reference][crate::model::subscription::LinkedResource::reference]
4952        /// if it holds a `LinkedDataset`, `None` if the field is not set or
4953        /// holds a different branch.
4954        pub fn linked_dataset(&self) -> std::option::Option<&std::string::String> {
4955            #[allow(unreachable_patterns)]
4956            self.reference.as_ref().and_then(|v| match v {
4957                crate::model::subscription::linked_resource::Reference::LinkedDataset(v) => {
4958                    std::option::Option::Some(v)
4959                }
4960                _ => std::option::Option::None,
4961            })
4962        }
4963
4964        /// Sets the value of [reference][crate::model::subscription::LinkedResource::reference]
4965        /// to hold a `LinkedDataset`.
4966        ///
4967        /// Note that all the setters affecting `reference` are
4968        /// mutually exclusive.
4969        ///
4970        /// # Example
4971        /// ```ignore,no_run
4972        /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
4973        /// let x = LinkedResource::new().set_linked_dataset("example");
4974        /// assert!(x.linked_dataset().is_some());
4975        /// assert!(x.linked_pubsub_subscription().is_none());
4976        /// ```
4977        pub fn set_linked_dataset<T: std::convert::Into<std::string::String>>(
4978            mut self,
4979            v: T,
4980        ) -> Self {
4981            self.reference = std::option::Option::Some(
4982                crate::model::subscription::linked_resource::Reference::LinkedDataset(v.into()),
4983            );
4984            self
4985        }
4986
4987        /// The value of [reference][crate::model::subscription::LinkedResource::reference]
4988        /// if it holds a `LinkedPubsubSubscription`, `None` if the field is not set or
4989        /// holds a different branch.
4990        pub fn linked_pubsub_subscription(&self) -> std::option::Option<&std::string::String> {
4991            #[allow(unreachable_patterns)]
4992            self.reference.as_ref().and_then(|v| match v {
4993                crate::model::subscription::linked_resource::Reference::LinkedPubsubSubscription(v) => std::option::Option::Some(v),
4994                _ => std::option::Option::None,
4995            })
4996        }
4997
4998        /// Sets the value of [reference][crate::model::subscription::LinkedResource::reference]
4999        /// to hold a `LinkedPubsubSubscription`.
5000        ///
5001        /// Note that all the setters affecting `reference` are
5002        /// mutually exclusive.
5003        ///
5004        /// # Example
5005        /// ```ignore,no_run
5006        /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
5007        /// let x = LinkedResource::new().set_linked_pubsub_subscription("example");
5008        /// assert!(x.linked_pubsub_subscription().is_some());
5009        /// assert!(x.linked_dataset().is_none());
5010        /// ```
5011        pub fn set_linked_pubsub_subscription<T: std::convert::Into<std::string::String>>(
5012            mut self,
5013            v: T,
5014        ) -> Self {
5015            self.reference = std::option::Option::Some(
5016                crate::model::subscription::linked_resource::Reference::LinkedPubsubSubscription(
5017                    v.into(),
5018                ),
5019            );
5020            self
5021        }
5022    }
5023
5024    impl wkt::message::Message for LinkedResource {
5025        fn typename() -> &'static str {
5026            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription.LinkedResource"
5027        }
5028    }
5029
5030    /// Defines additional types related to [LinkedResource].
5031    pub mod linked_resource {
5032        #[allow(unused_imports)]
5033        use super::*;
5034
5035        #[derive(Clone, Debug, PartialEq)]
5036        #[non_exhaustive]
5037        pub enum Reference {
5038            /// Output only. Name of the linked dataset, e.g.
5039            /// projects/subscriberproject/datasets/linked_dataset
5040            LinkedDataset(std::string::String),
5041            /// Output only. Name of the Pub/Sub subscription, e.g.
5042            /// projects/subscriberproject/subscriptions/subscriptions/sub_id
5043            LinkedPubsubSubscription(std::string::String),
5044        }
5045    }
5046
5047    /// Commercial info metadata for this subscription.
5048    #[derive(Clone, Default, PartialEq)]
5049    #[non_exhaustive]
5050    pub struct CommercialInfo {
5051        /// Output only. This is set when the subscription is commercialised via
5052        /// Cloud Marketplace.
5053        pub cloud_marketplace: std::option::Option<
5054            crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo,
5055        >,
5056
5057        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5058    }
5059
5060    impl CommercialInfo {
5061        pub fn new() -> Self {
5062            std::default::Default::default()
5063        }
5064
5065        /// Sets the value of [cloud_marketplace][crate::model::subscription::CommercialInfo::cloud_marketplace].
5066        ///
5067        /// # Example
5068        /// ```ignore,no_run
5069        /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
5070        /// use google_cloud_bigquery_analyticshub_v1::model::subscription::commercial_info::GoogleCloudMarketplaceInfo;
5071        /// let x = CommercialInfo::new().set_cloud_marketplace(GoogleCloudMarketplaceInfo::default()/* use setters */);
5072        /// ```
5073        pub fn set_cloud_marketplace<T>(mut self, v: T) -> Self
5074        where
5075            T: std::convert::Into<
5076                    crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo,
5077                >,
5078        {
5079            self.cloud_marketplace = std::option::Option::Some(v.into());
5080            self
5081        }
5082
5083        /// Sets or clears the value of [cloud_marketplace][crate::model::subscription::CommercialInfo::cloud_marketplace].
5084        ///
5085        /// # Example
5086        /// ```ignore,no_run
5087        /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
5088        /// use google_cloud_bigquery_analyticshub_v1::model::subscription::commercial_info::GoogleCloudMarketplaceInfo;
5089        /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(Some(GoogleCloudMarketplaceInfo::default()/* use setters */));
5090        /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(None::<GoogleCloudMarketplaceInfo>);
5091        /// ```
5092        pub fn set_or_clear_cloud_marketplace<T>(mut self, v: std::option::Option<T>) -> Self
5093        where
5094            T: std::convert::Into<
5095                    crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo,
5096                >,
5097        {
5098            self.cloud_marketplace = v.map(|x| x.into());
5099            self
5100        }
5101    }
5102
5103    impl wkt::message::Message for CommercialInfo {
5104        fn typename() -> &'static str {
5105            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription.CommercialInfo"
5106        }
5107    }
5108
5109    /// Defines additional types related to [CommercialInfo].
5110    pub mod commercial_info {
5111        #[allow(unused_imports)]
5112        use super::*;
5113
5114        /// Cloud Marketplace commercial metadata for this subscription.
5115        #[derive(Clone, Default, PartialEq)]
5116        #[non_exhaustive]
5117        pub struct GoogleCloudMarketplaceInfo {
5118            /// Resource name of the Marketplace Order.
5119            pub order: std::string::String,
5120
5121            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5122        }
5123
5124        impl GoogleCloudMarketplaceInfo {
5125            pub fn new() -> Self {
5126                std::default::Default::default()
5127            }
5128
5129            /// Sets the value of [order][crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo::order].
5130            ///
5131            /// # Example
5132            /// ```ignore,no_run
5133            /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::commercial_info::GoogleCloudMarketplaceInfo;
5134            /// let x = GoogleCloudMarketplaceInfo::new().set_order("example");
5135            /// ```
5136            pub fn set_order<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5137                self.order = v.into();
5138                self
5139            }
5140        }
5141
5142        impl wkt::message::Message for GoogleCloudMarketplaceInfo {
5143            fn typename() -> &'static str {
5144                "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription.CommercialInfo.GoogleCloudMarketplaceInfo"
5145            }
5146        }
5147    }
5148
5149    /// State of the subscription.
5150    ///
5151    /// # Working with unknown values
5152    ///
5153    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5154    /// additional enum variants at any time. Adding new variants is not considered
5155    /// a breaking change. Applications should write their code in anticipation of:
5156    ///
5157    /// - New values appearing in future releases of the client library, **and**
5158    /// - New values received dynamically, without application changes.
5159    ///
5160    /// Please consult the [Working with enums] section in the user guide for some
5161    /// guidelines.
5162    ///
5163    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5164    #[derive(Clone, Debug, PartialEq)]
5165    #[non_exhaustive]
5166    pub enum State {
5167        /// Default value. This value is unused.
5168        Unspecified,
5169        /// This subscription is active and the data is accessible.
5170        Active,
5171        /// The data referenced by this subscription is out of date and should be
5172        /// refreshed. This can happen when a data provider adds or removes datasets.
5173        Stale,
5174        /// This subscription has been cancelled or revoked and the data is no longer
5175        /// accessible.
5176        Inactive,
5177        /// If set, the enum was initialized with an unknown value.
5178        ///
5179        /// Applications can examine the value using [State::value] or
5180        /// [State::name].
5181        UnknownValue(state::UnknownValue),
5182    }
5183
5184    #[doc(hidden)]
5185    pub mod state {
5186        #[allow(unused_imports)]
5187        use super::*;
5188        #[derive(Clone, Debug, PartialEq)]
5189        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5190    }
5191
5192    impl State {
5193        /// Gets the enum value.
5194        ///
5195        /// Returns `None` if the enum contains an unknown value deserialized from
5196        /// the string representation of enums.
5197        pub fn value(&self) -> std::option::Option<i32> {
5198            match self {
5199                Self::Unspecified => std::option::Option::Some(0),
5200                Self::Active => std::option::Option::Some(1),
5201                Self::Stale => std::option::Option::Some(2),
5202                Self::Inactive => std::option::Option::Some(3),
5203                Self::UnknownValue(u) => u.0.value(),
5204            }
5205        }
5206
5207        /// Gets the enum value as a string.
5208        ///
5209        /// Returns `None` if the enum contains an unknown value deserialized from
5210        /// the integer representation of enums.
5211        pub fn name(&self) -> std::option::Option<&str> {
5212            match self {
5213                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5214                Self::Active => std::option::Option::Some("STATE_ACTIVE"),
5215                Self::Stale => std::option::Option::Some("STATE_STALE"),
5216                Self::Inactive => std::option::Option::Some("STATE_INACTIVE"),
5217                Self::UnknownValue(u) => u.0.name(),
5218            }
5219        }
5220    }
5221
5222    impl std::default::Default for State {
5223        fn default() -> Self {
5224            use std::convert::From;
5225            Self::from(0)
5226        }
5227    }
5228
5229    impl std::fmt::Display for State {
5230        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5231            wkt::internal::display_enum(f, self.name(), self.value())
5232        }
5233    }
5234
5235    impl std::convert::From<i32> for State {
5236        fn from(value: i32) -> Self {
5237            match value {
5238                0 => Self::Unspecified,
5239                1 => Self::Active,
5240                2 => Self::Stale,
5241                3 => Self::Inactive,
5242                _ => Self::UnknownValue(state::UnknownValue(
5243                    wkt::internal::UnknownEnumValue::Integer(value),
5244                )),
5245            }
5246        }
5247    }
5248
5249    impl std::convert::From<&str> for State {
5250        fn from(value: &str) -> Self {
5251            use std::string::ToString;
5252            match value {
5253                "STATE_UNSPECIFIED" => Self::Unspecified,
5254                "STATE_ACTIVE" => Self::Active,
5255                "STATE_STALE" => Self::Stale,
5256                "STATE_INACTIVE" => Self::Inactive,
5257                _ => Self::UnknownValue(state::UnknownValue(
5258                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5259                )),
5260            }
5261        }
5262    }
5263
5264    impl serde::ser::Serialize for State {
5265        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5266        where
5267            S: serde::Serializer,
5268        {
5269            match self {
5270                Self::Unspecified => serializer.serialize_i32(0),
5271                Self::Active => serializer.serialize_i32(1),
5272                Self::Stale => serializer.serialize_i32(2),
5273                Self::Inactive => serializer.serialize_i32(3),
5274                Self::UnknownValue(u) => u.0.serialize(serializer),
5275            }
5276        }
5277    }
5278
5279    impl<'de> serde::de::Deserialize<'de> for State {
5280        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5281        where
5282            D: serde::Deserializer<'de>,
5283        {
5284            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5285                ".google.cloud.bigquery.analyticshub.v1.Subscription.State",
5286            ))
5287        }
5288    }
5289
5290    #[derive(Clone, Debug, PartialEq)]
5291    #[non_exhaustive]
5292    pub enum ResourceName {
5293        /// Output only. Resource name of the source Listing.
5294        /// e.g. projects/123/locations/us/dataExchanges/456/listings/789
5295        Listing(std::string::String),
5296        /// Output only. Resource name of the source Data Exchange.
5297        /// e.g. projects/123/locations/us/dataExchanges/456
5298        DataExchange(std::string::String),
5299    }
5300}
5301
5302/// Message for requesting the list of data exchanges.
5303#[derive(Clone, Default, PartialEq)]
5304#[non_exhaustive]
5305pub struct ListDataExchangesRequest {
5306    /// Required. The parent resource path of the data exchanges.
5307    /// e.g. `projects/myproject/locations/us`.
5308    pub parent: std::string::String,
5309
5310    /// The maximum number of results to return in a single response page. Leverage
5311    /// the page tokens to iterate through the entire collection.
5312    pub page_size: i32,
5313
5314    /// Page token, returned by a previous call, to request the next page of
5315    /// results.
5316    pub page_token: std::string::String,
5317
5318    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5319}
5320
5321impl ListDataExchangesRequest {
5322    pub fn new() -> Self {
5323        std::default::Default::default()
5324    }
5325
5326    /// Sets the value of [parent][crate::model::ListDataExchangesRequest::parent].
5327    ///
5328    /// # Example
5329    /// ```ignore,no_run
5330    /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesRequest;
5331    /// let x = ListDataExchangesRequest::new().set_parent("example");
5332    /// ```
5333    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5334        self.parent = v.into();
5335        self
5336    }
5337
5338    /// Sets the value of [page_size][crate::model::ListDataExchangesRequest::page_size].
5339    ///
5340    /// # Example
5341    /// ```ignore,no_run
5342    /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesRequest;
5343    /// let x = ListDataExchangesRequest::new().set_page_size(42);
5344    /// ```
5345    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5346        self.page_size = v.into();
5347        self
5348    }
5349
5350    /// Sets the value of [page_token][crate::model::ListDataExchangesRequest::page_token].
5351    ///
5352    /// # Example
5353    /// ```ignore,no_run
5354    /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesRequest;
5355    /// let x = ListDataExchangesRequest::new().set_page_token("example");
5356    /// ```
5357    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5358        self.page_token = v.into();
5359        self
5360    }
5361}
5362
5363impl wkt::message::Message for ListDataExchangesRequest {
5364    fn typename() -> &'static str {
5365        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest"
5366    }
5367}
5368
5369/// Message for response to the list of data exchanges.
5370#[derive(Clone, Default, PartialEq)]
5371#[non_exhaustive]
5372pub struct ListDataExchangesResponse {
5373    /// The list of data exchanges.
5374    pub data_exchanges: std::vec::Vec<crate::model::DataExchange>,
5375
5376    /// A token to request the next page of results.
5377    pub next_page_token: std::string::String,
5378
5379    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5380}
5381
5382impl ListDataExchangesResponse {
5383    pub fn new() -> Self {
5384        std::default::Default::default()
5385    }
5386
5387    /// Sets the value of [data_exchanges][crate::model::ListDataExchangesResponse::data_exchanges].
5388    ///
5389    /// # Example
5390    /// ```ignore,no_run
5391    /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesResponse;
5392    /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5393    /// let x = ListDataExchangesResponse::new()
5394    ///     .set_data_exchanges([
5395    ///         DataExchange::default()/* use setters */,
5396    ///         DataExchange::default()/* use (different) setters */,
5397    ///     ]);
5398    /// ```
5399    pub fn set_data_exchanges<T, V>(mut self, v: T) -> Self
5400    where
5401        T: std::iter::IntoIterator<Item = V>,
5402        V: std::convert::Into<crate::model::DataExchange>,
5403    {
5404        use std::iter::Iterator;
5405        self.data_exchanges = v.into_iter().map(|i| i.into()).collect();
5406        self
5407    }
5408
5409    /// Sets the value of [next_page_token][crate::model::ListDataExchangesResponse::next_page_token].
5410    ///
5411    /// # Example
5412    /// ```ignore,no_run
5413    /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesResponse;
5414    /// let x = ListDataExchangesResponse::new().set_next_page_token("example");
5415    /// ```
5416    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5417        self.next_page_token = v.into();
5418        self
5419    }
5420}
5421
5422impl wkt::message::Message for ListDataExchangesResponse {
5423    fn typename() -> &'static str {
5424        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse"
5425    }
5426}
5427
5428#[doc(hidden)]
5429impl google_cloud_gax::paginator::internal::PageableResponse for ListDataExchangesResponse {
5430    type PageItem = crate::model::DataExchange;
5431
5432    fn items(self) -> std::vec::Vec<Self::PageItem> {
5433        self.data_exchanges
5434    }
5435
5436    fn next_page_token(&self) -> std::string::String {
5437        use std::clone::Clone;
5438        self.next_page_token.clone()
5439    }
5440}
5441
5442/// Message for requesting the list of data exchanges from projects in an
5443/// organization and location.
5444#[derive(Clone, Default, PartialEq)]
5445#[non_exhaustive]
5446pub struct ListOrgDataExchangesRequest {
5447    /// Required. The organization resource path of the projects containing
5448    /// DataExchanges. e.g. `organizations/myorg/locations/us`.
5449    pub organization: std::string::String,
5450
5451    /// The maximum number of results to return in a single response page. Leverage
5452    /// the page tokens to iterate through the entire collection.
5453    pub page_size: i32,
5454
5455    /// Page token, returned by a previous call, to request the next page of
5456    /// results.
5457    pub page_token: std::string::String,
5458
5459    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5460}
5461
5462impl ListOrgDataExchangesRequest {
5463    pub fn new() -> Self {
5464        std::default::Default::default()
5465    }
5466
5467    /// Sets the value of [organization][crate::model::ListOrgDataExchangesRequest::organization].
5468    ///
5469    /// # Example
5470    /// ```ignore,no_run
5471    /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesRequest;
5472    /// let x = ListOrgDataExchangesRequest::new().set_organization("example");
5473    /// ```
5474    pub fn set_organization<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5475        self.organization = v.into();
5476        self
5477    }
5478
5479    /// Sets the value of [page_size][crate::model::ListOrgDataExchangesRequest::page_size].
5480    ///
5481    /// # Example
5482    /// ```ignore,no_run
5483    /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesRequest;
5484    /// let x = ListOrgDataExchangesRequest::new().set_page_size(42);
5485    /// ```
5486    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5487        self.page_size = v.into();
5488        self
5489    }
5490
5491    /// Sets the value of [page_token][crate::model::ListOrgDataExchangesRequest::page_token].
5492    ///
5493    /// # Example
5494    /// ```ignore,no_run
5495    /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesRequest;
5496    /// let x = ListOrgDataExchangesRequest::new().set_page_token("example");
5497    /// ```
5498    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5499        self.page_token = v.into();
5500        self
5501    }
5502}
5503
5504impl wkt::message::Message for ListOrgDataExchangesRequest {
5505    fn typename() -> &'static str {
5506        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest"
5507    }
5508}
5509
5510/// Message for response to listing data exchanges in an organization and
5511/// location.
5512#[derive(Clone, Default, PartialEq)]
5513#[non_exhaustive]
5514pub struct ListOrgDataExchangesResponse {
5515    /// The list of data exchanges.
5516    pub data_exchanges: std::vec::Vec<crate::model::DataExchange>,
5517
5518    /// A token to request the next page of results.
5519    pub next_page_token: std::string::String,
5520
5521    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5522}
5523
5524impl ListOrgDataExchangesResponse {
5525    pub fn new() -> Self {
5526        std::default::Default::default()
5527    }
5528
5529    /// Sets the value of [data_exchanges][crate::model::ListOrgDataExchangesResponse::data_exchanges].
5530    ///
5531    /// # Example
5532    /// ```ignore,no_run
5533    /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesResponse;
5534    /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5535    /// let x = ListOrgDataExchangesResponse::new()
5536    ///     .set_data_exchanges([
5537    ///         DataExchange::default()/* use setters */,
5538    ///         DataExchange::default()/* use (different) setters */,
5539    ///     ]);
5540    /// ```
5541    pub fn set_data_exchanges<T, V>(mut self, v: T) -> Self
5542    where
5543        T: std::iter::IntoIterator<Item = V>,
5544        V: std::convert::Into<crate::model::DataExchange>,
5545    {
5546        use std::iter::Iterator;
5547        self.data_exchanges = v.into_iter().map(|i| i.into()).collect();
5548        self
5549    }
5550
5551    /// Sets the value of [next_page_token][crate::model::ListOrgDataExchangesResponse::next_page_token].
5552    ///
5553    /// # Example
5554    /// ```ignore,no_run
5555    /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesResponse;
5556    /// let x = ListOrgDataExchangesResponse::new().set_next_page_token("example");
5557    /// ```
5558    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5559        self.next_page_token = v.into();
5560        self
5561    }
5562}
5563
5564impl wkt::message::Message for ListOrgDataExchangesResponse {
5565    fn typename() -> &'static str {
5566        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse"
5567    }
5568}
5569
5570#[doc(hidden)]
5571impl google_cloud_gax::paginator::internal::PageableResponse for ListOrgDataExchangesResponse {
5572    type PageItem = crate::model::DataExchange;
5573
5574    fn items(self) -> std::vec::Vec<Self::PageItem> {
5575        self.data_exchanges
5576    }
5577
5578    fn next_page_token(&self) -> std::string::String {
5579        use std::clone::Clone;
5580        self.next_page_token.clone()
5581    }
5582}
5583
5584/// Message for getting a data exchange.
5585#[derive(Clone, Default, PartialEq)]
5586#[non_exhaustive]
5587pub struct GetDataExchangeRequest {
5588    /// Required. The resource name of the data exchange.
5589    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
5590    pub name: std::string::String,
5591
5592    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5593}
5594
5595impl GetDataExchangeRequest {
5596    pub fn new() -> Self {
5597        std::default::Default::default()
5598    }
5599
5600    /// Sets the value of [name][crate::model::GetDataExchangeRequest::name].
5601    ///
5602    /// # Example
5603    /// ```ignore,no_run
5604    /// # use google_cloud_bigquery_analyticshub_v1::model::GetDataExchangeRequest;
5605    /// let x = GetDataExchangeRequest::new().set_name("example");
5606    /// ```
5607    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5608        self.name = v.into();
5609        self
5610    }
5611}
5612
5613impl wkt::message::Message for GetDataExchangeRequest {
5614    fn typename() -> &'static str {
5615        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest"
5616    }
5617}
5618
5619/// Message for creating a data exchange.
5620#[derive(Clone, Default, PartialEq)]
5621#[non_exhaustive]
5622pub struct CreateDataExchangeRequest {
5623    /// Required. The parent resource path of the data exchange.
5624    /// e.g. `projects/myproject/locations/us`.
5625    pub parent: std::string::String,
5626
5627    /// Required. The ID of the data exchange.
5628    /// Must contain only Unicode letters, numbers (0-9), underscores (_).
5629    /// Max length: 100 bytes.
5630    pub data_exchange_id: std::string::String,
5631
5632    /// Required. The data exchange to create.
5633    pub data_exchange: std::option::Option<crate::model::DataExchange>,
5634
5635    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5636}
5637
5638impl CreateDataExchangeRequest {
5639    pub fn new() -> Self {
5640        std::default::Default::default()
5641    }
5642
5643    /// Sets the value of [parent][crate::model::CreateDataExchangeRequest::parent].
5644    ///
5645    /// # Example
5646    /// ```ignore,no_run
5647    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5648    /// let x = CreateDataExchangeRequest::new().set_parent("example");
5649    /// ```
5650    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5651        self.parent = v.into();
5652        self
5653    }
5654
5655    /// Sets the value of [data_exchange_id][crate::model::CreateDataExchangeRequest::data_exchange_id].
5656    ///
5657    /// # Example
5658    /// ```ignore,no_run
5659    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5660    /// let x = CreateDataExchangeRequest::new().set_data_exchange_id("example");
5661    /// ```
5662    pub fn set_data_exchange_id<T: std::convert::Into<std::string::String>>(
5663        mut self,
5664        v: T,
5665    ) -> Self {
5666        self.data_exchange_id = v.into();
5667        self
5668    }
5669
5670    /// Sets the value of [data_exchange][crate::model::CreateDataExchangeRequest::data_exchange].
5671    ///
5672    /// # Example
5673    /// ```ignore,no_run
5674    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5675    /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5676    /// let x = CreateDataExchangeRequest::new().set_data_exchange(DataExchange::default()/* use setters */);
5677    /// ```
5678    pub fn set_data_exchange<T>(mut self, v: T) -> Self
5679    where
5680        T: std::convert::Into<crate::model::DataExchange>,
5681    {
5682        self.data_exchange = std::option::Option::Some(v.into());
5683        self
5684    }
5685
5686    /// Sets or clears the value of [data_exchange][crate::model::CreateDataExchangeRequest::data_exchange].
5687    ///
5688    /// # Example
5689    /// ```ignore,no_run
5690    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5691    /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5692    /// let x = CreateDataExchangeRequest::new().set_or_clear_data_exchange(Some(DataExchange::default()/* use setters */));
5693    /// let x = CreateDataExchangeRequest::new().set_or_clear_data_exchange(None::<DataExchange>);
5694    /// ```
5695    pub fn set_or_clear_data_exchange<T>(mut self, v: std::option::Option<T>) -> Self
5696    where
5697        T: std::convert::Into<crate::model::DataExchange>,
5698    {
5699        self.data_exchange = v.map(|x| x.into());
5700        self
5701    }
5702}
5703
5704impl wkt::message::Message for CreateDataExchangeRequest {
5705    fn typename() -> &'static str {
5706        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest"
5707    }
5708}
5709
5710/// Message for updating a data exchange.
5711#[derive(Clone, Default, PartialEq)]
5712#[non_exhaustive]
5713pub struct UpdateDataExchangeRequest {
5714    /// Required. Field mask specifies the fields to update in the data exchange
5715    /// resource. The fields specified in the
5716    /// `updateMask` are relative to the resource and are not a full request.
5717    pub update_mask: std::option::Option<wkt::FieldMask>,
5718
5719    /// Required. The data exchange to update.
5720    pub data_exchange: std::option::Option<crate::model::DataExchange>,
5721
5722    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5723}
5724
5725impl UpdateDataExchangeRequest {
5726    pub fn new() -> Self {
5727        std::default::Default::default()
5728    }
5729
5730    /// Sets the value of [update_mask][crate::model::UpdateDataExchangeRequest::update_mask].
5731    ///
5732    /// # Example
5733    /// ```ignore,no_run
5734    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5735    /// use wkt::FieldMask;
5736    /// let x = UpdateDataExchangeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5737    /// ```
5738    pub fn set_update_mask<T>(mut self, v: T) -> Self
5739    where
5740        T: std::convert::Into<wkt::FieldMask>,
5741    {
5742        self.update_mask = std::option::Option::Some(v.into());
5743        self
5744    }
5745
5746    /// Sets or clears the value of [update_mask][crate::model::UpdateDataExchangeRequest::update_mask].
5747    ///
5748    /// # Example
5749    /// ```ignore,no_run
5750    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5751    /// use wkt::FieldMask;
5752    /// let x = UpdateDataExchangeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5753    /// let x = UpdateDataExchangeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5754    /// ```
5755    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5756    where
5757        T: std::convert::Into<wkt::FieldMask>,
5758    {
5759        self.update_mask = v.map(|x| x.into());
5760        self
5761    }
5762
5763    /// Sets the value of [data_exchange][crate::model::UpdateDataExchangeRequest::data_exchange].
5764    ///
5765    /// # Example
5766    /// ```ignore,no_run
5767    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5768    /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5769    /// let x = UpdateDataExchangeRequest::new().set_data_exchange(DataExchange::default()/* use setters */);
5770    /// ```
5771    pub fn set_data_exchange<T>(mut self, v: T) -> Self
5772    where
5773        T: std::convert::Into<crate::model::DataExchange>,
5774    {
5775        self.data_exchange = std::option::Option::Some(v.into());
5776        self
5777    }
5778
5779    /// Sets or clears the value of [data_exchange][crate::model::UpdateDataExchangeRequest::data_exchange].
5780    ///
5781    /// # Example
5782    /// ```ignore,no_run
5783    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5784    /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5785    /// let x = UpdateDataExchangeRequest::new().set_or_clear_data_exchange(Some(DataExchange::default()/* use setters */));
5786    /// let x = UpdateDataExchangeRequest::new().set_or_clear_data_exchange(None::<DataExchange>);
5787    /// ```
5788    pub fn set_or_clear_data_exchange<T>(mut self, v: std::option::Option<T>) -> Self
5789    where
5790        T: std::convert::Into<crate::model::DataExchange>,
5791    {
5792        self.data_exchange = v.map(|x| x.into());
5793        self
5794    }
5795}
5796
5797impl wkt::message::Message for UpdateDataExchangeRequest {
5798    fn typename() -> &'static str {
5799        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest"
5800    }
5801}
5802
5803/// Message for deleting a data exchange.
5804#[derive(Clone, Default, PartialEq)]
5805#[non_exhaustive]
5806pub struct DeleteDataExchangeRequest {
5807    /// Required. The full name of the data exchange resource that you want to
5808    /// delete. For example, `projects/myproject/locations/us/dataExchanges/123`.
5809    pub name: std::string::String,
5810
5811    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5812}
5813
5814impl DeleteDataExchangeRequest {
5815    pub fn new() -> Self {
5816        std::default::Default::default()
5817    }
5818
5819    /// Sets the value of [name][crate::model::DeleteDataExchangeRequest::name].
5820    ///
5821    /// # Example
5822    /// ```ignore,no_run
5823    /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteDataExchangeRequest;
5824    /// let x = DeleteDataExchangeRequest::new().set_name("example");
5825    /// ```
5826    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5827        self.name = v.into();
5828        self
5829    }
5830}
5831
5832impl wkt::message::Message for DeleteDataExchangeRequest {
5833    fn typename() -> &'static str {
5834        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest"
5835    }
5836}
5837
5838/// Message for requesting the list of listings.
5839#[derive(Clone, Default, PartialEq)]
5840#[non_exhaustive]
5841pub struct ListListingsRequest {
5842    /// Required. The parent resource path of the listing.
5843    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
5844    pub parent: std::string::String,
5845
5846    /// The maximum number of results to return in a single response page. Leverage
5847    /// the page tokens to iterate through the entire collection.
5848    pub page_size: i32,
5849
5850    /// Page token, returned by a previous call, to request the next page of
5851    /// results.
5852    pub page_token: std::string::String,
5853
5854    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5855}
5856
5857impl ListListingsRequest {
5858    pub fn new() -> Self {
5859        std::default::Default::default()
5860    }
5861
5862    /// Sets the value of [parent][crate::model::ListListingsRequest::parent].
5863    ///
5864    /// # Example
5865    /// ```ignore,no_run
5866    /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsRequest;
5867    /// let x = ListListingsRequest::new().set_parent("example");
5868    /// ```
5869    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5870        self.parent = v.into();
5871        self
5872    }
5873
5874    /// Sets the value of [page_size][crate::model::ListListingsRequest::page_size].
5875    ///
5876    /// # Example
5877    /// ```ignore,no_run
5878    /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsRequest;
5879    /// let x = ListListingsRequest::new().set_page_size(42);
5880    /// ```
5881    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5882        self.page_size = v.into();
5883        self
5884    }
5885
5886    /// Sets the value of [page_token][crate::model::ListListingsRequest::page_token].
5887    ///
5888    /// # Example
5889    /// ```ignore,no_run
5890    /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsRequest;
5891    /// let x = ListListingsRequest::new().set_page_token("example");
5892    /// ```
5893    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5894        self.page_token = v.into();
5895        self
5896    }
5897}
5898
5899impl wkt::message::Message for ListListingsRequest {
5900    fn typename() -> &'static str {
5901        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListListingsRequest"
5902    }
5903}
5904
5905/// Message for response to the list of Listings.
5906#[derive(Clone, Default, PartialEq)]
5907#[non_exhaustive]
5908pub struct ListListingsResponse {
5909    /// The list of Listing.
5910    pub listings: std::vec::Vec<crate::model::Listing>,
5911
5912    /// A token to request the next page of results.
5913    pub next_page_token: std::string::String,
5914
5915    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5916}
5917
5918impl ListListingsResponse {
5919    pub fn new() -> Self {
5920        std::default::Default::default()
5921    }
5922
5923    /// Sets the value of [listings][crate::model::ListListingsResponse::listings].
5924    ///
5925    /// # Example
5926    /// ```ignore,no_run
5927    /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsResponse;
5928    /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
5929    /// let x = ListListingsResponse::new()
5930    ///     .set_listings([
5931    ///         Listing::default()/* use setters */,
5932    ///         Listing::default()/* use (different) setters */,
5933    ///     ]);
5934    /// ```
5935    pub fn set_listings<T, V>(mut self, v: T) -> Self
5936    where
5937        T: std::iter::IntoIterator<Item = V>,
5938        V: std::convert::Into<crate::model::Listing>,
5939    {
5940        use std::iter::Iterator;
5941        self.listings = v.into_iter().map(|i| i.into()).collect();
5942        self
5943    }
5944
5945    /// Sets the value of [next_page_token][crate::model::ListListingsResponse::next_page_token].
5946    ///
5947    /// # Example
5948    /// ```ignore,no_run
5949    /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsResponse;
5950    /// let x = ListListingsResponse::new().set_next_page_token("example");
5951    /// ```
5952    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5953        self.next_page_token = v.into();
5954        self
5955    }
5956}
5957
5958impl wkt::message::Message for ListListingsResponse {
5959    fn typename() -> &'static str {
5960        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListListingsResponse"
5961    }
5962}
5963
5964#[doc(hidden)]
5965impl google_cloud_gax::paginator::internal::PageableResponse for ListListingsResponse {
5966    type PageItem = crate::model::Listing;
5967
5968    fn items(self) -> std::vec::Vec<Self::PageItem> {
5969        self.listings
5970    }
5971
5972    fn next_page_token(&self) -> std::string::String {
5973        use std::clone::Clone;
5974        self.next_page_token.clone()
5975    }
5976}
5977
5978/// Message for getting a listing.
5979#[derive(Clone, Default, PartialEq)]
5980#[non_exhaustive]
5981pub struct GetListingRequest {
5982    /// Required. The resource name of the listing.
5983    /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`.
5984    pub name: std::string::String,
5985
5986    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5987}
5988
5989impl GetListingRequest {
5990    pub fn new() -> Self {
5991        std::default::Default::default()
5992    }
5993
5994    /// Sets the value of [name][crate::model::GetListingRequest::name].
5995    ///
5996    /// # Example
5997    /// ```ignore,no_run
5998    /// # use google_cloud_bigquery_analyticshub_v1::model::GetListingRequest;
5999    /// let x = GetListingRequest::new().set_name("example");
6000    /// ```
6001    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6002        self.name = v.into();
6003        self
6004    }
6005}
6006
6007impl wkt::message::Message for GetListingRequest {
6008    fn typename() -> &'static str {
6009        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetListingRequest"
6010    }
6011}
6012
6013/// Message for creating a listing.
6014#[derive(Clone, Default, PartialEq)]
6015#[non_exhaustive]
6016pub struct CreateListingRequest {
6017    /// Required. The parent resource path of the listing.
6018    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
6019    pub parent: std::string::String,
6020
6021    /// Required. The ID of the listing to create.
6022    /// Must contain only Unicode letters, numbers (0-9), underscores (_).
6023    /// Max length: 100 bytes.
6024    pub listing_id: std::string::String,
6025
6026    /// Required. The listing to create.
6027    pub listing: std::option::Option<crate::model::Listing>,
6028
6029    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6030}
6031
6032impl CreateListingRequest {
6033    pub fn new() -> Self {
6034        std::default::Default::default()
6035    }
6036
6037    /// Sets the value of [parent][crate::model::CreateListingRequest::parent].
6038    ///
6039    /// # Example
6040    /// ```ignore,no_run
6041    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6042    /// let x = CreateListingRequest::new().set_parent("example");
6043    /// ```
6044    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6045        self.parent = v.into();
6046        self
6047    }
6048
6049    /// Sets the value of [listing_id][crate::model::CreateListingRequest::listing_id].
6050    ///
6051    /// # Example
6052    /// ```ignore,no_run
6053    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6054    /// let x = CreateListingRequest::new().set_listing_id("example");
6055    /// ```
6056    pub fn set_listing_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6057        self.listing_id = v.into();
6058        self
6059    }
6060
6061    /// Sets the value of [listing][crate::model::CreateListingRequest::listing].
6062    ///
6063    /// # Example
6064    /// ```ignore,no_run
6065    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6066    /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6067    /// let x = CreateListingRequest::new().set_listing(Listing::default()/* use setters */);
6068    /// ```
6069    pub fn set_listing<T>(mut self, v: T) -> Self
6070    where
6071        T: std::convert::Into<crate::model::Listing>,
6072    {
6073        self.listing = std::option::Option::Some(v.into());
6074        self
6075    }
6076
6077    /// Sets or clears the value of [listing][crate::model::CreateListingRequest::listing].
6078    ///
6079    /// # Example
6080    /// ```ignore,no_run
6081    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6082    /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6083    /// let x = CreateListingRequest::new().set_or_clear_listing(Some(Listing::default()/* use setters */));
6084    /// let x = CreateListingRequest::new().set_or_clear_listing(None::<Listing>);
6085    /// ```
6086    pub fn set_or_clear_listing<T>(mut self, v: std::option::Option<T>) -> Self
6087    where
6088        T: std::convert::Into<crate::model::Listing>,
6089    {
6090        self.listing = v.map(|x| x.into());
6091        self
6092    }
6093}
6094
6095impl wkt::message::Message for CreateListingRequest {
6096    fn typename() -> &'static str {
6097        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CreateListingRequest"
6098    }
6099}
6100
6101/// Message for updating a Listing.
6102#[derive(Clone, Default, PartialEq)]
6103#[non_exhaustive]
6104pub struct UpdateListingRequest {
6105    /// Required. Field mask specifies the fields to update in the listing
6106    /// resource. The fields specified in the `updateMask` are relative to the
6107    /// resource and are not a full request.
6108    pub update_mask: std::option::Option<wkt::FieldMask>,
6109
6110    /// Required. The listing to update.
6111    pub listing: std::option::Option<crate::model::Listing>,
6112
6113    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6114}
6115
6116impl UpdateListingRequest {
6117    pub fn new() -> Self {
6118        std::default::Default::default()
6119    }
6120
6121    /// Sets the value of [update_mask][crate::model::UpdateListingRequest::update_mask].
6122    ///
6123    /// # Example
6124    /// ```ignore,no_run
6125    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6126    /// use wkt::FieldMask;
6127    /// let x = UpdateListingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6128    /// ```
6129    pub fn set_update_mask<T>(mut self, v: T) -> Self
6130    where
6131        T: std::convert::Into<wkt::FieldMask>,
6132    {
6133        self.update_mask = std::option::Option::Some(v.into());
6134        self
6135    }
6136
6137    /// Sets or clears the value of [update_mask][crate::model::UpdateListingRequest::update_mask].
6138    ///
6139    /// # Example
6140    /// ```ignore,no_run
6141    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6142    /// use wkt::FieldMask;
6143    /// let x = UpdateListingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6144    /// let x = UpdateListingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6145    /// ```
6146    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6147    where
6148        T: std::convert::Into<wkt::FieldMask>,
6149    {
6150        self.update_mask = v.map(|x| x.into());
6151        self
6152    }
6153
6154    /// Sets the value of [listing][crate::model::UpdateListingRequest::listing].
6155    ///
6156    /// # Example
6157    /// ```ignore,no_run
6158    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6159    /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6160    /// let x = UpdateListingRequest::new().set_listing(Listing::default()/* use setters */);
6161    /// ```
6162    pub fn set_listing<T>(mut self, v: T) -> Self
6163    where
6164        T: std::convert::Into<crate::model::Listing>,
6165    {
6166        self.listing = std::option::Option::Some(v.into());
6167        self
6168    }
6169
6170    /// Sets or clears the value of [listing][crate::model::UpdateListingRequest::listing].
6171    ///
6172    /// # Example
6173    /// ```ignore,no_run
6174    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6175    /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6176    /// let x = UpdateListingRequest::new().set_or_clear_listing(Some(Listing::default()/* use setters */));
6177    /// let x = UpdateListingRequest::new().set_or_clear_listing(None::<Listing>);
6178    /// ```
6179    pub fn set_or_clear_listing<T>(mut self, v: std::option::Option<T>) -> Self
6180    where
6181        T: std::convert::Into<crate::model::Listing>,
6182    {
6183        self.listing = v.map(|x| x.into());
6184        self
6185    }
6186}
6187
6188impl wkt::message::Message for UpdateListingRequest {
6189    fn typename() -> &'static str {
6190        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.UpdateListingRequest"
6191    }
6192}
6193
6194/// Message for deleting a listing.
6195#[derive(Clone, Default, PartialEq)]
6196#[non_exhaustive]
6197pub struct DeleteListingRequest {
6198    /// Required. Resource name of the listing to delete.
6199    /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`.
6200    pub name: std::string::String,
6201
6202    /// Optional. If the listing is commercial then this field must be set to true,
6203    /// otherwise a failure is thrown. This acts as a safety guard to avoid
6204    /// deleting commercial listings accidentally.
6205    pub delete_commercial: bool,
6206
6207    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6208}
6209
6210impl DeleteListingRequest {
6211    pub fn new() -> Self {
6212        std::default::Default::default()
6213    }
6214
6215    /// Sets the value of [name][crate::model::DeleteListingRequest::name].
6216    ///
6217    /// # Example
6218    /// ```ignore,no_run
6219    /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteListingRequest;
6220    /// let x = DeleteListingRequest::new().set_name("example");
6221    /// ```
6222    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6223        self.name = v.into();
6224        self
6225    }
6226
6227    /// Sets the value of [delete_commercial][crate::model::DeleteListingRequest::delete_commercial].
6228    ///
6229    /// # Example
6230    /// ```ignore,no_run
6231    /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteListingRequest;
6232    /// let x = DeleteListingRequest::new().set_delete_commercial(true);
6233    /// ```
6234    pub fn set_delete_commercial<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6235        self.delete_commercial = v.into();
6236        self
6237    }
6238}
6239
6240impl wkt::message::Message for DeleteListingRequest {
6241    fn typename() -> &'static str {
6242        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteListingRequest"
6243    }
6244}
6245
6246/// Message for subscribing to a listing.
6247#[derive(Clone, Default, PartialEq)]
6248#[non_exhaustive]
6249pub struct SubscribeListingRequest {
6250    /// Required. Resource name of the listing that you want to subscribe to.
6251    /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`.
6252    pub name: std::string::String,
6253
6254    /// Resulting destination of the listing that you subscribed to.
6255    pub destination: std::option::Option<crate::model::subscribe_listing_request::Destination>,
6256
6257    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6258}
6259
6260impl SubscribeListingRequest {
6261    pub fn new() -> Self {
6262        std::default::Default::default()
6263    }
6264
6265    /// Sets the value of [name][crate::model::SubscribeListingRequest::name].
6266    ///
6267    /// # Example
6268    /// ```ignore,no_run
6269    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6270    /// let x = SubscribeListingRequest::new().set_name("example");
6271    /// ```
6272    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6273        self.name = v.into();
6274        self
6275    }
6276
6277    /// Sets the value of [destination][crate::model::SubscribeListingRequest::destination].
6278    ///
6279    /// Note that all the setters affecting `destination` are mutually
6280    /// exclusive.
6281    ///
6282    /// # Example
6283    /// ```ignore,no_run
6284    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6285    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6286    /// let x = SubscribeListingRequest::new().set_destination(Some(
6287    ///     google_cloud_bigquery_analyticshub_v1::model::subscribe_listing_request::Destination::DestinationDataset(DestinationDataset::default().into())));
6288    /// ```
6289    pub fn set_destination<
6290        T: std::convert::Into<
6291                std::option::Option<crate::model::subscribe_listing_request::Destination>,
6292            >,
6293    >(
6294        mut self,
6295        v: T,
6296    ) -> Self {
6297        self.destination = v.into();
6298        self
6299    }
6300
6301    /// The value of [destination][crate::model::SubscribeListingRequest::destination]
6302    /// if it holds a `DestinationDataset`, `None` if the field is not set or
6303    /// holds a different branch.
6304    pub fn destination_dataset(
6305        &self,
6306    ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationDataset>> {
6307        #[allow(unreachable_patterns)]
6308        self.destination.as_ref().and_then(|v| match v {
6309            crate::model::subscribe_listing_request::Destination::DestinationDataset(v) => {
6310                std::option::Option::Some(v)
6311            }
6312            _ => std::option::Option::None,
6313        })
6314    }
6315
6316    /// Sets the value of [destination][crate::model::SubscribeListingRequest::destination]
6317    /// to hold a `DestinationDataset`.
6318    ///
6319    /// Note that all the setters affecting `destination` are
6320    /// mutually exclusive.
6321    ///
6322    /// # Example
6323    /// ```ignore,no_run
6324    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6325    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6326    /// let x = SubscribeListingRequest::new().set_destination_dataset(DestinationDataset::default()/* use setters */);
6327    /// assert!(x.destination_dataset().is_some());
6328    /// assert!(x.destination_pubsub_subscription().is_none());
6329    /// ```
6330    pub fn set_destination_dataset<
6331        T: std::convert::Into<std::boxed::Box<crate::model::DestinationDataset>>,
6332    >(
6333        mut self,
6334        v: T,
6335    ) -> Self {
6336        self.destination = std::option::Option::Some(
6337            crate::model::subscribe_listing_request::Destination::DestinationDataset(v.into()),
6338        );
6339        self
6340    }
6341
6342    /// The value of [destination][crate::model::SubscribeListingRequest::destination]
6343    /// if it holds a `DestinationPubsubSubscription`, `None` if the field is not set or
6344    /// holds a different branch.
6345    pub fn destination_pubsub_subscription(
6346        &self,
6347    ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationPubSubSubscription>> {
6348        #[allow(unreachable_patterns)]
6349        self.destination.as_ref().and_then(|v| match v {
6350            crate::model::subscribe_listing_request::Destination::DestinationPubsubSubscription(
6351                v,
6352            ) => std::option::Option::Some(v),
6353            _ => std::option::Option::None,
6354        })
6355    }
6356
6357    /// Sets the value of [destination][crate::model::SubscribeListingRequest::destination]
6358    /// to hold a `DestinationPubsubSubscription`.
6359    ///
6360    /// Note that all the setters affecting `destination` are
6361    /// mutually exclusive.
6362    ///
6363    /// # Example
6364    /// ```ignore,no_run
6365    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6366    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationPubSubSubscription;
6367    /// let x = SubscribeListingRequest::new().set_destination_pubsub_subscription(DestinationPubSubSubscription::default()/* use setters */);
6368    /// assert!(x.destination_pubsub_subscription().is_some());
6369    /// assert!(x.destination_dataset().is_none());
6370    /// ```
6371    pub fn set_destination_pubsub_subscription<
6372        T: std::convert::Into<std::boxed::Box<crate::model::DestinationPubSubSubscription>>,
6373    >(
6374        mut self,
6375        v: T,
6376    ) -> Self {
6377        self.destination = std::option::Option::Some(
6378            crate::model::subscribe_listing_request::Destination::DestinationPubsubSubscription(
6379                v.into(),
6380            ),
6381        );
6382        self
6383    }
6384}
6385
6386impl wkt::message::Message for SubscribeListingRequest {
6387    fn typename() -> &'static str {
6388        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest"
6389    }
6390}
6391
6392/// Defines additional types related to [SubscribeListingRequest].
6393pub mod subscribe_listing_request {
6394    #[allow(unused_imports)]
6395    use super::*;
6396
6397    /// Resulting destination of the listing that you subscribed to.
6398    #[derive(Clone, Debug, PartialEq)]
6399    #[non_exhaustive]
6400    pub enum Destination {
6401        /// Input only. BigQuery destination dataset to create for the subscriber.
6402        DestinationDataset(std::boxed::Box<crate::model::DestinationDataset>),
6403        /// Input only. Destination Pub/Sub subscription to create for the
6404        /// subscriber.
6405        DestinationPubsubSubscription(std::boxed::Box<crate::model::DestinationPubSubSubscription>),
6406    }
6407}
6408
6409/// Message for response when you subscribe to a listing.
6410#[derive(Clone, Default, PartialEq)]
6411#[non_exhaustive]
6412pub struct SubscribeListingResponse {
6413    /// Subscription object created from this subscribe action.
6414    pub subscription: std::option::Option<crate::model::Subscription>,
6415
6416    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6417}
6418
6419impl SubscribeListingResponse {
6420    pub fn new() -> Self {
6421        std::default::Default::default()
6422    }
6423
6424    /// Sets the value of [subscription][crate::model::SubscribeListingResponse::subscription].
6425    ///
6426    /// # Example
6427    /// ```ignore,no_run
6428    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingResponse;
6429    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6430    /// let x = SubscribeListingResponse::new().set_subscription(Subscription::default()/* use setters */);
6431    /// ```
6432    pub fn set_subscription<T>(mut self, v: T) -> Self
6433    where
6434        T: std::convert::Into<crate::model::Subscription>,
6435    {
6436        self.subscription = std::option::Option::Some(v.into());
6437        self
6438    }
6439
6440    /// Sets or clears the value of [subscription][crate::model::SubscribeListingResponse::subscription].
6441    ///
6442    /// # Example
6443    /// ```ignore,no_run
6444    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingResponse;
6445    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6446    /// let x = SubscribeListingResponse::new().set_or_clear_subscription(Some(Subscription::default()/* use setters */));
6447    /// let x = SubscribeListingResponse::new().set_or_clear_subscription(None::<Subscription>);
6448    /// ```
6449    pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
6450    where
6451        T: std::convert::Into<crate::model::Subscription>,
6452    {
6453        self.subscription = v.map(|x| x.into());
6454        self
6455    }
6456}
6457
6458impl wkt::message::Message for SubscribeListingResponse {
6459    fn typename() -> &'static str {
6460        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse"
6461    }
6462}
6463
6464/// Message for subscribing to a Data Exchange.
6465#[derive(Clone, Default, PartialEq)]
6466#[non_exhaustive]
6467pub struct SubscribeDataExchangeRequest {
6468    /// Required. Resource name of the Data Exchange.
6469    /// e.g. `projects/publisherproject/locations/us/dataExchanges/123`
6470    pub name: std::string::String,
6471
6472    /// Required. The parent resource path of the Subscription.
6473    /// e.g. `projects/subscriberproject/locations/us`
6474    pub destination: std::string::String,
6475
6476    /// Optional. BigQuery destination dataset to create for the subscriber.
6477    pub destination_dataset: std::option::Option<crate::model::DestinationDataset>,
6478
6479    /// Required. Name of the subscription to create.
6480    /// e.g. `subscription1`
6481    pub subscription: std::string::String,
6482
6483    /// Email of the subscriber.
6484    pub subscriber_contact: std::string::String,
6485
6486    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6487}
6488
6489impl SubscribeDataExchangeRequest {
6490    pub fn new() -> Self {
6491        std::default::Default::default()
6492    }
6493
6494    /// Sets the value of [name][crate::model::SubscribeDataExchangeRequest::name].
6495    ///
6496    /// # Example
6497    /// ```ignore,no_run
6498    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6499    /// let x = SubscribeDataExchangeRequest::new().set_name("example");
6500    /// ```
6501    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6502        self.name = v.into();
6503        self
6504    }
6505
6506    /// Sets the value of [destination][crate::model::SubscribeDataExchangeRequest::destination].
6507    ///
6508    /// # Example
6509    /// ```ignore,no_run
6510    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6511    /// let x = SubscribeDataExchangeRequest::new().set_destination("example");
6512    /// ```
6513    pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6514        self.destination = v.into();
6515        self
6516    }
6517
6518    /// Sets the value of [destination_dataset][crate::model::SubscribeDataExchangeRequest::destination_dataset].
6519    ///
6520    /// # Example
6521    /// ```ignore,no_run
6522    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6523    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6524    /// let x = SubscribeDataExchangeRequest::new().set_destination_dataset(DestinationDataset::default()/* use setters */);
6525    /// ```
6526    pub fn set_destination_dataset<T>(mut self, v: T) -> Self
6527    where
6528        T: std::convert::Into<crate::model::DestinationDataset>,
6529    {
6530        self.destination_dataset = std::option::Option::Some(v.into());
6531        self
6532    }
6533
6534    /// Sets or clears the value of [destination_dataset][crate::model::SubscribeDataExchangeRequest::destination_dataset].
6535    ///
6536    /// # Example
6537    /// ```ignore,no_run
6538    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6539    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6540    /// let x = SubscribeDataExchangeRequest::new().set_or_clear_destination_dataset(Some(DestinationDataset::default()/* use setters */));
6541    /// let x = SubscribeDataExchangeRequest::new().set_or_clear_destination_dataset(None::<DestinationDataset>);
6542    /// ```
6543    pub fn set_or_clear_destination_dataset<T>(mut self, v: std::option::Option<T>) -> Self
6544    where
6545        T: std::convert::Into<crate::model::DestinationDataset>,
6546    {
6547        self.destination_dataset = v.map(|x| x.into());
6548        self
6549    }
6550
6551    /// Sets the value of [subscription][crate::model::SubscribeDataExchangeRequest::subscription].
6552    ///
6553    /// # Example
6554    /// ```ignore,no_run
6555    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6556    /// let x = SubscribeDataExchangeRequest::new().set_subscription("example");
6557    /// ```
6558    pub fn set_subscription<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6559        self.subscription = v.into();
6560        self
6561    }
6562
6563    /// Sets the value of [subscriber_contact][crate::model::SubscribeDataExchangeRequest::subscriber_contact].
6564    ///
6565    /// # Example
6566    /// ```ignore,no_run
6567    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6568    /// let x = SubscribeDataExchangeRequest::new().set_subscriber_contact("example");
6569    /// ```
6570    pub fn set_subscriber_contact<T: std::convert::Into<std::string::String>>(
6571        mut self,
6572        v: T,
6573    ) -> Self {
6574        self.subscriber_contact = v.into();
6575        self
6576    }
6577}
6578
6579impl wkt::message::Message for SubscribeDataExchangeRequest {
6580    fn typename() -> &'static str {
6581        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeDataExchangeRequest"
6582    }
6583}
6584
6585/// Message for response when you subscribe to a Data Exchange.
6586#[derive(Clone, Default, PartialEq)]
6587#[non_exhaustive]
6588pub struct SubscribeDataExchangeResponse {
6589    /// Subscription object created from this subscribe action.
6590    pub subscription: std::option::Option<crate::model::Subscription>,
6591
6592    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6593}
6594
6595impl SubscribeDataExchangeResponse {
6596    pub fn new() -> Self {
6597        std::default::Default::default()
6598    }
6599
6600    /// Sets the value of [subscription][crate::model::SubscribeDataExchangeResponse::subscription].
6601    ///
6602    /// # Example
6603    /// ```ignore,no_run
6604    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeResponse;
6605    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6606    /// let x = SubscribeDataExchangeResponse::new().set_subscription(Subscription::default()/* use setters */);
6607    /// ```
6608    pub fn set_subscription<T>(mut self, v: T) -> Self
6609    where
6610        T: std::convert::Into<crate::model::Subscription>,
6611    {
6612        self.subscription = std::option::Option::Some(v.into());
6613        self
6614    }
6615
6616    /// Sets or clears the value of [subscription][crate::model::SubscribeDataExchangeResponse::subscription].
6617    ///
6618    /// # Example
6619    /// ```ignore,no_run
6620    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeResponse;
6621    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6622    /// let x = SubscribeDataExchangeResponse::new().set_or_clear_subscription(Some(Subscription::default()/* use setters */));
6623    /// let x = SubscribeDataExchangeResponse::new().set_or_clear_subscription(None::<Subscription>);
6624    /// ```
6625    pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
6626    where
6627        T: std::convert::Into<crate::model::Subscription>,
6628    {
6629        self.subscription = v.map(|x| x.into());
6630        self
6631    }
6632}
6633
6634impl wkt::message::Message for SubscribeDataExchangeResponse {
6635    fn typename() -> &'static str {
6636        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeDataExchangeResponse"
6637    }
6638}
6639
6640/// Message for refreshing a subscription.
6641#[derive(Clone, Default, PartialEq)]
6642#[non_exhaustive]
6643pub struct RefreshSubscriptionRequest {
6644    /// Required. Resource name of the Subscription to refresh.
6645    /// e.g. `projects/subscriberproject/locations/us/subscriptions/123`
6646    pub name: std::string::String,
6647
6648    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6649}
6650
6651impl RefreshSubscriptionRequest {
6652    pub fn new() -> Self {
6653        std::default::Default::default()
6654    }
6655
6656    /// Sets the value of [name][crate::model::RefreshSubscriptionRequest::name].
6657    ///
6658    /// # Example
6659    /// ```ignore,no_run
6660    /// # use google_cloud_bigquery_analyticshub_v1::model::RefreshSubscriptionRequest;
6661    /// let x = RefreshSubscriptionRequest::new().set_name("example");
6662    /// ```
6663    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6664        self.name = v.into();
6665        self
6666    }
6667}
6668
6669impl wkt::message::Message for RefreshSubscriptionRequest {
6670    fn typename() -> &'static str {
6671        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RefreshSubscriptionRequest"
6672    }
6673}
6674
6675/// Message for response when you refresh a subscription.
6676#[derive(Clone, Default, PartialEq)]
6677#[non_exhaustive]
6678pub struct RefreshSubscriptionResponse {
6679    /// The refreshed subscription resource.
6680    pub subscription: std::option::Option<crate::model::Subscription>,
6681
6682    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6683}
6684
6685impl RefreshSubscriptionResponse {
6686    pub fn new() -> Self {
6687        std::default::Default::default()
6688    }
6689
6690    /// Sets the value of [subscription][crate::model::RefreshSubscriptionResponse::subscription].
6691    ///
6692    /// # Example
6693    /// ```ignore,no_run
6694    /// # use google_cloud_bigquery_analyticshub_v1::model::RefreshSubscriptionResponse;
6695    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6696    /// let x = RefreshSubscriptionResponse::new().set_subscription(Subscription::default()/* use setters */);
6697    /// ```
6698    pub fn set_subscription<T>(mut self, v: T) -> Self
6699    where
6700        T: std::convert::Into<crate::model::Subscription>,
6701    {
6702        self.subscription = std::option::Option::Some(v.into());
6703        self
6704    }
6705
6706    /// Sets or clears the value of [subscription][crate::model::RefreshSubscriptionResponse::subscription].
6707    ///
6708    /// # Example
6709    /// ```ignore,no_run
6710    /// # use google_cloud_bigquery_analyticshub_v1::model::RefreshSubscriptionResponse;
6711    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6712    /// let x = RefreshSubscriptionResponse::new().set_or_clear_subscription(Some(Subscription::default()/* use setters */));
6713    /// let x = RefreshSubscriptionResponse::new().set_or_clear_subscription(None::<Subscription>);
6714    /// ```
6715    pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
6716    where
6717        T: std::convert::Into<crate::model::Subscription>,
6718    {
6719        self.subscription = v.map(|x| x.into());
6720        self
6721    }
6722}
6723
6724impl wkt::message::Message for RefreshSubscriptionResponse {
6725    fn typename() -> &'static str {
6726        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RefreshSubscriptionResponse"
6727    }
6728}
6729
6730/// Message for getting a subscription.
6731#[derive(Clone, Default, PartialEq)]
6732#[non_exhaustive]
6733pub struct GetSubscriptionRequest {
6734    /// Required. Resource name of the subscription.
6735    /// e.g. projects/123/locations/us/subscriptions/456
6736    pub name: std::string::String,
6737
6738    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6739}
6740
6741impl GetSubscriptionRequest {
6742    pub fn new() -> Self {
6743        std::default::Default::default()
6744    }
6745
6746    /// Sets the value of [name][crate::model::GetSubscriptionRequest::name].
6747    ///
6748    /// # Example
6749    /// ```ignore,no_run
6750    /// # use google_cloud_bigquery_analyticshub_v1::model::GetSubscriptionRequest;
6751    /// let x = GetSubscriptionRequest::new().set_name("example");
6752    /// ```
6753    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6754        self.name = v.into();
6755        self
6756    }
6757}
6758
6759impl wkt::message::Message for GetSubscriptionRequest {
6760    fn typename() -> &'static str {
6761        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetSubscriptionRequest"
6762    }
6763}
6764
6765/// Message for listing subscriptions.
6766#[derive(Clone, Default, PartialEq)]
6767#[non_exhaustive]
6768pub struct ListSubscriptionsRequest {
6769    /// Required. The parent resource path of the subscription.
6770    /// e.g. projects/myproject/locations/us
6771    pub parent: std::string::String,
6772
6773    /// An expression for filtering the results of the request. Eligible
6774    /// fields for filtering are:
6775    ///
6776    /// + `listing`
6777    /// + `data_exchange`
6778    ///
6779    /// Alternatively, a literal wrapped in double quotes may be provided.
6780    /// This will be checked for an exact match against both fields above.
6781    ///
6782    /// In all cases, the full Data Exchange or Listing resource name must
6783    /// be provided. Some example of using filters:
6784    ///
6785    /// + data_exchange="projects/myproject/locations/us/dataExchanges/123"
6786    /// + listing="projects/123/locations/us/dataExchanges/456/listings/789"
6787    /// + "projects/myproject/locations/us/dataExchanges/123"
6788    pub filter: std::string::String,
6789
6790    /// The maximum number of results to return in a single response page.
6791    pub page_size: i32,
6792
6793    /// Page token, returned by a previous call.
6794    pub page_token: std::string::String,
6795
6796    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6797}
6798
6799impl ListSubscriptionsRequest {
6800    pub fn new() -> Self {
6801        std::default::Default::default()
6802    }
6803
6804    /// Sets the value of [parent][crate::model::ListSubscriptionsRequest::parent].
6805    ///
6806    /// # Example
6807    /// ```ignore,no_run
6808    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
6809    /// let x = ListSubscriptionsRequest::new().set_parent("example");
6810    /// ```
6811    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6812        self.parent = v.into();
6813        self
6814    }
6815
6816    /// Sets the value of [filter][crate::model::ListSubscriptionsRequest::filter].
6817    ///
6818    /// # Example
6819    /// ```ignore,no_run
6820    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
6821    /// let x = ListSubscriptionsRequest::new().set_filter("example");
6822    /// ```
6823    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6824        self.filter = v.into();
6825        self
6826    }
6827
6828    /// Sets the value of [page_size][crate::model::ListSubscriptionsRequest::page_size].
6829    ///
6830    /// # Example
6831    /// ```ignore,no_run
6832    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
6833    /// let x = ListSubscriptionsRequest::new().set_page_size(42);
6834    /// ```
6835    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6836        self.page_size = v.into();
6837        self
6838    }
6839
6840    /// Sets the value of [page_token][crate::model::ListSubscriptionsRequest::page_token].
6841    ///
6842    /// # Example
6843    /// ```ignore,no_run
6844    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
6845    /// let x = ListSubscriptionsRequest::new().set_page_token("example");
6846    /// ```
6847    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6848        self.page_token = v.into();
6849        self
6850    }
6851}
6852
6853impl wkt::message::Message for ListSubscriptionsRequest {
6854    fn typename() -> &'static str {
6855        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSubscriptionsRequest"
6856    }
6857}
6858
6859/// Message for response to the listing of subscriptions.
6860#[derive(Clone, Default, PartialEq)]
6861#[non_exhaustive]
6862pub struct ListSubscriptionsResponse {
6863    /// The list of subscriptions.
6864    pub subscriptions: std::vec::Vec<crate::model::Subscription>,
6865
6866    /// Next page token.
6867    pub next_page_token: std::string::String,
6868
6869    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6870}
6871
6872impl ListSubscriptionsResponse {
6873    pub fn new() -> Self {
6874        std::default::Default::default()
6875    }
6876
6877    /// Sets the value of [subscriptions][crate::model::ListSubscriptionsResponse::subscriptions].
6878    ///
6879    /// # Example
6880    /// ```ignore,no_run
6881    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsResponse;
6882    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6883    /// let x = ListSubscriptionsResponse::new()
6884    ///     .set_subscriptions([
6885    ///         Subscription::default()/* use setters */,
6886    ///         Subscription::default()/* use (different) setters */,
6887    ///     ]);
6888    /// ```
6889    pub fn set_subscriptions<T, V>(mut self, v: T) -> Self
6890    where
6891        T: std::iter::IntoIterator<Item = V>,
6892        V: std::convert::Into<crate::model::Subscription>,
6893    {
6894        use std::iter::Iterator;
6895        self.subscriptions = v.into_iter().map(|i| i.into()).collect();
6896        self
6897    }
6898
6899    /// Sets the value of [next_page_token][crate::model::ListSubscriptionsResponse::next_page_token].
6900    ///
6901    /// # Example
6902    /// ```ignore,no_run
6903    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsResponse;
6904    /// let x = ListSubscriptionsResponse::new().set_next_page_token("example");
6905    /// ```
6906    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6907        self.next_page_token = v.into();
6908        self
6909    }
6910}
6911
6912impl wkt::message::Message for ListSubscriptionsResponse {
6913    fn typename() -> &'static str {
6914        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSubscriptionsResponse"
6915    }
6916}
6917
6918#[doc(hidden)]
6919impl google_cloud_gax::paginator::internal::PageableResponse for ListSubscriptionsResponse {
6920    type PageItem = crate::model::Subscription;
6921
6922    fn items(self) -> std::vec::Vec<Self::PageItem> {
6923        self.subscriptions
6924    }
6925
6926    fn next_page_token(&self) -> std::string::String {
6927        use std::clone::Clone;
6928        self.next_page_token.clone()
6929    }
6930}
6931
6932/// Message for listing subscriptions of a shared resource.
6933#[derive(Clone, Default, PartialEq)]
6934#[non_exhaustive]
6935pub struct ListSharedResourceSubscriptionsRequest {
6936    /// Required. Resource name of the requested target. This resource may be
6937    /// either a Listing or a DataExchange. e.g.
6938    /// projects/123/locations/us/dataExchanges/456 OR e.g.
6939    /// projects/123/locations/us/dataExchanges/456/listings/789
6940    pub resource: std::string::String,
6941
6942    /// If selected, includes deleted subscriptions in the response
6943    /// (up to 63 days after deletion).
6944    pub include_deleted_subscriptions: bool,
6945
6946    /// The maximum number of results to return in a single response page.
6947    pub page_size: i32,
6948
6949    /// Page token, returned by a previous call.
6950    pub page_token: std::string::String,
6951
6952    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6953}
6954
6955impl ListSharedResourceSubscriptionsRequest {
6956    pub fn new() -> Self {
6957        std::default::Default::default()
6958    }
6959
6960    /// Sets the value of [resource][crate::model::ListSharedResourceSubscriptionsRequest::resource].
6961    ///
6962    /// # Example
6963    /// ```ignore,no_run
6964    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
6965    /// let x = ListSharedResourceSubscriptionsRequest::new().set_resource("example");
6966    /// ```
6967    pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6968        self.resource = v.into();
6969        self
6970    }
6971
6972    /// Sets the value of [include_deleted_subscriptions][crate::model::ListSharedResourceSubscriptionsRequest::include_deleted_subscriptions].
6973    ///
6974    /// # Example
6975    /// ```ignore,no_run
6976    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
6977    /// let x = ListSharedResourceSubscriptionsRequest::new().set_include_deleted_subscriptions(true);
6978    /// ```
6979    pub fn set_include_deleted_subscriptions<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6980        self.include_deleted_subscriptions = v.into();
6981        self
6982    }
6983
6984    /// Sets the value of [page_size][crate::model::ListSharedResourceSubscriptionsRequest::page_size].
6985    ///
6986    /// # Example
6987    /// ```ignore,no_run
6988    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
6989    /// let x = ListSharedResourceSubscriptionsRequest::new().set_page_size(42);
6990    /// ```
6991    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6992        self.page_size = v.into();
6993        self
6994    }
6995
6996    /// Sets the value of [page_token][crate::model::ListSharedResourceSubscriptionsRequest::page_token].
6997    ///
6998    /// # Example
6999    /// ```ignore,no_run
7000    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
7001    /// let x = ListSharedResourceSubscriptionsRequest::new().set_page_token("example");
7002    /// ```
7003    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7004        self.page_token = v.into();
7005        self
7006    }
7007}
7008
7009impl wkt::message::Message for ListSharedResourceSubscriptionsRequest {
7010    fn typename() -> &'static str {
7011        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSharedResourceSubscriptionsRequest"
7012    }
7013}
7014
7015/// Message for response to the listing of shared resource subscriptions.
7016#[derive(Clone, Default, PartialEq)]
7017#[non_exhaustive]
7018pub struct ListSharedResourceSubscriptionsResponse {
7019    /// The list of subscriptions.
7020    pub shared_resource_subscriptions: std::vec::Vec<crate::model::Subscription>,
7021
7022    /// Next page token.
7023    pub next_page_token: std::string::String,
7024
7025    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7026}
7027
7028impl ListSharedResourceSubscriptionsResponse {
7029    pub fn new() -> Self {
7030        std::default::Default::default()
7031    }
7032
7033    /// Sets the value of [shared_resource_subscriptions][crate::model::ListSharedResourceSubscriptionsResponse::shared_resource_subscriptions].
7034    ///
7035    /// # Example
7036    /// ```ignore,no_run
7037    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsResponse;
7038    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
7039    /// let x = ListSharedResourceSubscriptionsResponse::new()
7040    ///     .set_shared_resource_subscriptions([
7041    ///         Subscription::default()/* use setters */,
7042    ///         Subscription::default()/* use (different) setters */,
7043    ///     ]);
7044    /// ```
7045    pub fn set_shared_resource_subscriptions<T, V>(mut self, v: T) -> Self
7046    where
7047        T: std::iter::IntoIterator<Item = V>,
7048        V: std::convert::Into<crate::model::Subscription>,
7049    {
7050        use std::iter::Iterator;
7051        self.shared_resource_subscriptions = v.into_iter().map(|i| i.into()).collect();
7052        self
7053    }
7054
7055    /// Sets the value of [next_page_token][crate::model::ListSharedResourceSubscriptionsResponse::next_page_token].
7056    ///
7057    /// # Example
7058    /// ```ignore,no_run
7059    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsResponse;
7060    /// let x = ListSharedResourceSubscriptionsResponse::new().set_next_page_token("example");
7061    /// ```
7062    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7063        self.next_page_token = v.into();
7064        self
7065    }
7066}
7067
7068impl wkt::message::Message for ListSharedResourceSubscriptionsResponse {
7069    fn typename() -> &'static str {
7070        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSharedResourceSubscriptionsResponse"
7071    }
7072}
7073
7074#[doc(hidden)]
7075impl google_cloud_gax::paginator::internal::PageableResponse
7076    for ListSharedResourceSubscriptionsResponse
7077{
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]: google_cloud_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}