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::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_iam_v1;
27extern crate google_cloud_longrunning;
28extern crate google_cloud_lro;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// A data exchange is a container that lets you share data. Along with the
41/// descriptive information about the data exchange, it contains listings that
42/// reference shared datasets.
43#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct DataExchange {
46    /// Output only. The resource name of the data exchange.
47    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
48    pub name: std::string::String,
49
50    /// Required. Human-readable display name of the data exchange. The display
51    /// name must contain only Unicode letters, numbers (0-9), underscores (_),
52    /// dashes (-), spaces ( ), ampersands (&) and must not start or end with
53    /// spaces. Default value is an empty string. Max length: 63 bytes.
54    pub display_name: std::string::String,
55
56    /// Optional. Description of the data exchange. The description must not
57    /// contain Unicode non-characters as well as C0 and C1 control codes except
58    /// tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF).
59    /// Default value is an empty string.
60    /// Max length: 2000 bytes.
61    pub description: std::string::String,
62
63    /// Optional. Email or URL of the primary point of contact of the data
64    /// exchange. Max Length: 1000 bytes.
65    pub primary_contact: std::string::String,
66
67    /// Optional. Documentation describing the data exchange.
68    pub documentation: std::string::String,
69
70    /// Output only. Number of listings contained in the data exchange.
71    pub listing_count: i32,
72
73    /// Optional. Base64 encoded image representing the data exchange. Max
74    /// Size: 3.0MiB Expected image dimensions are 512x512 pixels, however the API
75    /// only performs validation on size of the encoded data. Note: For byte
76    /// fields, the content of the fields are base64-encoded (which increases the
77    /// size of the data by 33-36%) when using JSON on the wire.
78    pub icon: ::bytes::Bytes,
79
80    /// Optional. Configurable data sharing environment option for a data exchange.
81    pub sharing_environment_config: std::option::Option<crate::model::SharingEnvironmentConfig>,
82
83    /// Optional. Type of discovery on the discovery page for all the listings
84    /// under this exchange. Updating this field also updates (overwrites) the
85    /// discovery_type field for all the listings under this exchange.
86    pub discovery_type: std::option::Option<crate::model::DiscoveryType>,
87
88    /// Optional. By default, false.
89    /// If true, the DataExchange has an email sharing mandate enabled.
90    pub log_linked_dataset_query_user_email: std::option::Option<bool>,
91
92    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
93}
94
95impl DataExchange {
96    /// Creates a new default instance.
97    pub fn new() -> Self {
98        std::default::Default::default()
99    }
100
101    /// Sets the value of [name][crate::model::DataExchange::name].
102    ///
103    /// # Example
104    /// ```ignore,no_run
105    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
106    /// # let project_id = "project_id";
107    /// # let location_id = "location_id";
108    /// # let data_exchange_id = "data_exchange_id";
109    /// let x = DataExchange::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}"));
110    /// ```
111    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
112        self.name = v.into();
113        self
114    }
115
116    /// Sets the value of [display_name][crate::model::DataExchange::display_name].
117    ///
118    /// # Example
119    /// ```ignore,no_run
120    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
121    /// let x = DataExchange::new().set_display_name("example");
122    /// ```
123    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
124        self.display_name = v.into();
125        self
126    }
127
128    /// Sets the value of [description][crate::model::DataExchange::description].
129    ///
130    /// # Example
131    /// ```ignore,no_run
132    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
133    /// let x = DataExchange::new().set_description("example");
134    /// ```
135    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
136        self.description = v.into();
137        self
138    }
139
140    /// Sets the value of [primary_contact][crate::model::DataExchange::primary_contact].
141    ///
142    /// # Example
143    /// ```ignore,no_run
144    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
145    /// let x = DataExchange::new().set_primary_contact("example");
146    /// ```
147    pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
148        self.primary_contact = v.into();
149        self
150    }
151
152    /// Sets the value of [documentation][crate::model::DataExchange::documentation].
153    ///
154    /// # Example
155    /// ```ignore,no_run
156    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
157    /// let x = DataExchange::new().set_documentation("example");
158    /// ```
159    pub fn set_documentation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
160        self.documentation = v.into();
161        self
162    }
163
164    /// Sets the value of [listing_count][crate::model::DataExchange::listing_count].
165    ///
166    /// # Example
167    /// ```ignore,no_run
168    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
169    /// let x = DataExchange::new().set_listing_count(42);
170    /// ```
171    pub fn set_listing_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
172        self.listing_count = v.into();
173        self
174    }
175
176    /// Sets the value of [icon][crate::model::DataExchange::icon].
177    ///
178    /// # Example
179    /// ```ignore,no_run
180    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
181    /// let x = DataExchange::new().set_icon(bytes::Bytes::from_static(b"example"));
182    /// ```
183    pub fn set_icon<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
184        self.icon = v.into();
185        self
186    }
187
188    /// Sets the value of [sharing_environment_config][crate::model::DataExchange::sharing_environment_config].
189    ///
190    /// # Example
191    /// ```ignore,no_run
192    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
193    /// use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
194    /// let x = DataExchange::new().set_sharing_environment_config(SharingEnvironmentConfig::default()/* use setters */);
195    /// ```
196    pub fn set_sharing_environment_config<T>(mut self, v: T) -> Self
197    where
198        T: std::convert::Into<crate::model::SharingEnvironmentConfig>,
199    {
200        self.sharing_environment_config = std::option::Option::Some(v.into());
201        self
202    }
203
204    /// Sets or clears the value of [sharing_environment_config][crate::model::DataExchange::sharing_environment_config].
205    ///
206    /// # Example
207    /// ```ignore,no_run
208    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
209    /// use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
210    /// let x = DataExchange::new().set_or_clear_sharing_environment_config(Some(SharingEnvironmentConfig::default()/* use setters */));
211    /// let x = DataExchange::new().set_or_clear_sharing_environment_config(None::<SharingEnvironmentConfig>);
212    /// ```
213    pub fn set_or_clear_sharing_environment_config<T>(mut self, v: std::option::Option<T>) -> Self
214    where
215        T: std::convert::Into<crate::model::SharingEnvironmentConfig>,
216    {
217        self.sharing_environment_config = v.map(|x| x.into());
218        self
219    }
220
221    /// Sets the value of [discovery_type][crate::model::DataExchange::discovery_type].
222    ///
223    /// # Example
224    /// ```ignore,no_run
225    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
226    /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
227    /// let x0 = DataExchange::new().set_discovery_type(DiscoveryType::Private);
228    /// let x1 = DataExchange::new().set_discovery_type(DiscoveryType::Public);
229    /// ```
230    pub fn set_discovery_type<T>(mut self, v: T) -> Self
231    where
232        T: std::convert::Into<crate::model::DiscoveryType>,
233    {
234        self.discovery_type = std::option::Option::Some(v.into());
235        self
236    }
237
238    /// Sets or clears the value of [discovery_type][crate::model::DataExchange::discovery_type].
239    ///
240    /// # Example
241    /// ```ignore,no_run
242    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
243    /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
244    /// let x0 = DataExchange::new().set_or_clear_discovery_type(Some(DiscoveryType::Private));
245    /// let x1 = DataExchange::new().set_or_clear_discovery_type(Some(DiscoveryType::Public));
246    /// let x_none = DataExchange::new().set_or_clear_discovery_type(None::<DiscoveryType>);
247    /// ```
248    pub fn set_or_clear_discovery_type<T>(mut self, v: std::option::Option<T>) -> Self
249    where
250        T: std::convert::Into<crate::model::DiscoveryType>,
251    {
252        self.discovery_type = v.map(|x| x.into());
253        self
254    }
255
256    /// Sets the value of [log_linked_dataset_query_user_email][crate::model::DataExchange::log_linked_dataset_query_user_email].
257    ///
258    /// # Example
259    /// ```ignore,no_run
260    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
261    /// let x = DataExchange::new().set_log_linked_dataset_query_user_email(true);
262    /// ```
263    pub fn set_log_linked_dataset_query_user_email<T>(mut self, v: T) -> Self
264    where
265        T: std::convert::Into<bool>,
266    {
267        self.log_linked_dataset_query_user_email = std::option::Option::Some(v.into());
268        self
269    }
270
271    /// Sets or clears the value of [log_linked_dataset_query_user_email][crate::model::DataExchange::log_linked_dataset_query_user_email].
272    ///
273    /// # Example
274    /// ```ignore,no_run
275    /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
276    /// let x = DataExchange::new().set_or_clear_log_linked_dataset_query_user_email(Some(false));
277    /// let x = DataExchange::new().set_or_clear_log_linked_dataset_query_user_email(None::<bool>);
278    /// ```
279    pub fn set_or_clear_log_linked_dataset_query_user_email<T>(
280        mut self,
281        v: std::option::Option<T>,
282    ) -> Self
283    where
284        T: std::convert::Into<bool>,
285    {
286        self.log_linked_dataset_query_user_email = v.map(|x| x.into());
287        self
288    }
289}
290
291impl wkt::message::Message for DataExchange {
292    fn typename() -> &'static str {
293        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DataExchange"
294    }
295}
296
297/// A query template is a container for sharing table-valued functions defined by
298/// contributors in a data clean room.
299#[derive(Clone, Default, PartialEq)]
300#[non_exhaustive]
301pub struct QueryTemplate {
302    /// Output only. The resource name of the QueryTemplate.
303    /// e.g. `projects/myproject/locations/us/dataExchanges/123/queryTemplates/456`
304    pub name: std::string::String,
305
306    /// Required. Human-readable display name of the QueryTemplate. The display
307    /// name must contain only Unicode letters, numbers (0-9), underscores (_),
308    /// dashes (-), spaces ( ), ampersands (&) and can't start or end with spaces.
309    /// Default value is an empty string. Max length: 63 bytes.
310    pub display_name: std::string::String,
311
312    /// Optional. Short description of the QueryTemplate. The description must not
313    /// contain Unicode non-characters and C0 and C1 control codes except tabs
314    /// (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default
315    /// value is an empty string. Max length: 2000 bytes.
316    pub description: std::string::String,
317
318    /// Optional. Will be deprecated.
319    /// Email or URL of the primary point of contact of the QueryTemplate.
320    /// Max Length: 1000 bytes.
321    pub proposer: std::string::String,
322
323    /// Optional. Email or URL of the primary point of contact of the
324    /// QueryTemplate. Max Length: 1000 bytes.
325    pub primary_contact: std::string::String,
326
327    /// Optional. Documentation describing the QueryTemplate.
328    pub documentation: std::string::String,
329
330    /// Output only. The QueryTemplate lifecycle state.
331    pub state: crate::model::query_template::State,
332
333    /// Optional. The routine associated with the QueryTemplate.
334    pub routine: std::option::Option<crate::model::Routine>,
335
336    /// Output only. Timestamp when the QueryTemplate was created.
337    pub create_time: std::option::Option<wkt::Timestamp>,
338
339    /// Output only. Timestamp when the QueryTemplate was last modified.
340    pub update_time: std::option::Option<wkt::Timestamp>,
341
342    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
343}
344
345impl QueryTemplate {
346    /// Creates a new default instance.
347    pub fn new() -> Self {
348        std::default::Default::default()
349    }
350
351    /// Sets the value of [name][crate::model::QueryTemplate::name].
352    ///
353    /// # Example
354    /// ```ignore,no_run
355    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
356    /// # let project_id = "project_id";
357    /// # let location_id = "location_id";
358    /// # let data_exchange_id = "data_exchange_id";
359    /// # let query_template_id = "query_template_id";
360    /// let x = QueryTemplate::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}/queryTemplates/{query_template_id}"));
361    /// ```
362    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
363        self.name = v.into();
364        self
365    }
366
367    /// Sets the value of [display_name][crate::model::QueryTemplate::display_name].
368    ///
369    /// # Example
370    /// ```ignore,no_run
371    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
372    /// let x = QueryTemplate::new().set_display_name("example");
373    /// ```
374    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
375        self.display_name = v.into();
376        self
377    }
378
379    /// Sets the value of [description][crate::model::QueryTemplate::description].
380    ///
381    /// # Example
382    /// ```ignore,no_run
383    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
384    /// let x = QueryTemplate::new().set_description("example");
385    /// ```
386    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
387        self.description = v.into();
388        self
389    }
390
391    /// Sets the value of [proposer][crate::model::QueryTemplate::proposer].
392    ///
393    /// # Example
394    /// ```ignore,no_run
395    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
396    /// let x = QueryTemplate::new().set_proposer("example");
397    /// ```
398    pub fn set_proposer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
399        self.proposer = v.into();
400        self
401    }
402
403    /// Sets the value of [primary_contact][crate::model::QueryTemplate::primary_contact].
404    ///
405    /// # Example
406    /// ```ignore,no_run
407    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
408    /// let x = QueryTemplate::new().set_primary_contact("example");
409    /// ```
410    pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
411        self.primary_contact = v.into();
412        self
413    }
414
415    /// Sets the value of [documentation][crate::model::QueryTemplate::documentation].
416    ///
417    /// # Example
418    /// ```ignore,no_run
419    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
420    /// let x = QueryTemplate::new().set_documentation("example");
421    /// ```
422    pub fn set_documentation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
423        self.documentation = v.into();
424        self
425    }
426
427    /// Sets the value of [state][crate::model::QueryTemplate::state].
428    ///
429    /// # Example
430    /// ```ignore,no_run
431    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
432    /// use google_cloud_bigquery_analyticshub_v1::model::query_template::State;
433    /// let x0 = QueryTemplate::new().set_state(State::Drafted);
434    /// let x1 = QueryTemplate::new().set_state(State::Pending);
435    /// let x2 = QueryTemplate::new().set_state(State::Deleted);
436    /// ```
437    pub fn set_state<T: std::convert::Into<crate::model::query_template::State>>(
438        mut self,
439        v: T,
440    ) -> Self {
441        self.state = v.into();
442        self
443    }
444
445    /// Sets the value of [routine][crate::model::QueryTemplate::routine].
446    ///
447    /// # Example
448    /// ```ignore,no_run
449    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
450    /// use google_cloud_bigquery_analyticshub_v1::model::Routine;
451    /// let x = QueryTemplate::new().set_routine(Routine::default()/* use setters */);
452    /// ```
453    pub fn set_routine<T>(mut self, v: T) -> Self
454    where
455        T: std::convert::Into<crate::model::Routine>,
456    {
457        self.routine = std::option::Option::Some(v.into());
458        self
459    }
460
461    /// Sets or clears the value of [routine][crate::model::QueryTemplate::routine].
462    ///
463    /// # Example
464    /// ```ignore,no_run
465    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
466    /// use google_cloud_bigquery_analyticshub_v1::model::Routine;
467    /// let x = QueryTemplate::new().set_or_clear_routine(Some(Routine::default()/* use setters */));
468    /// let x = QueryTemplate::new().set_or_clear_routine(None::<Routine>);
469    /// ```
470    pub fn set_or_clear_routine<T>(mut self, v: std::option::Option<T>) -> Self
471    where
472        T: std::convert::Into<crate::model::Routine>,
473    {
474        self.routine = v.map(|x| x.into());
475        self
476    }
477
478    /// Sets the value of [create_time][crate::model::QueryTemplate::create_time].
479    ///
480    /// # Example
481    /// ```ignore,no_run
482    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
483    /// use wkt::Timestamp;
484    /// let x = QueryTemplate::new().set_create_time(Timestamp::default()/* use setters */);
485    /// ```
486    pub fn set_create_time<T>(mut self, v: T) -> Self
487    where
488        T: std::convert::Into<wkt::Timestamp>,
489    {
490        self.create_time = std::option::Option::Some(v.into());
491        self
492    }
493
494    /// Sets or clears the value of [create_time][crate::model::QueryTemplate::create_time].
495    ///
496    /// # Example
497    /// ```ignore,no_run
498    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
499    /// use wkt::Timestamp;
500    /// let x = QueryTemplate::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
501    /// let x = QueryTemplate::new().set_or_clear_create_time(None::<Timestamp>);
502    /// ```
503    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
504    where
505        T: std::convert::Into<wkt::Timestamp>,
506    {
507        self.create_time = v.map(|x| x.into());
508        self
509    }
510
511    /// Sets the value of [update_time][crate::model::QueryTemplate::update_time].
512    ///
513    /// # Example
514    /// ```ignore,no_run
515    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
516    /// use wkt::Timestamp;
517    /// let x = QueryTemplate::new().set_update_time(Timestamp::default()/* use setters */);
518    /// ```
519    pub fn set_update_time<T>(mut self, v: T) -> Self
520    where
521        T: std::convert::Into<wkt::Timestamp>,
522    {
523        self.update_time = std::option::Option::Some(v.into());
524        self
525    }
526
527    /// Sets or clears the value of [update_time][crate::model::QueryTemplate::update_time].
528    ///
529    /// # Example
530    /// ```ignore,no_run
531    /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
532    /// use wkt::Timestamp;
533    /// let x = QueryTemplate::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
534    /// let x = QueryTemplate::new().set_or_clear_update_time(None::<Timestamp>);
535    /// ```
536    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
537    where
538        T: std::convert::Into<wkt::Timestamp>,
539    {
540        self.update_time = v.map(|x| x.into());
541        self
542    }
543}
544
545impl wkt::message::Message for QueryTemplate {
546    fn typename() -> &'static str {
547        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.QueryTemplate"
548    }
549}
550
551/// Defines additional types related to [QueryTemplate].
552pub mod query_template {
553    #[allow(unused_imports)]
554    use super::*;
555
556    /// The QueryTemplate lifecycle state.
557    ///
558    /// # Working with unknown values
559    ///
560    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
561    /// additional enum variants at any time. Adding new variants is not considered
562    /// a breaking change. Applications should write their code in anticipation of:
563    ///
564    /// - New values appearing in future releases of the client library, **and**
565    /// - New values received dynamically, without application changes.
566    ///
567    /// Please consult the [Working with enums] section in the user guide for some
568    /// guidelines.
569    ///
570    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
571    #[derive(Clone, Debug, PartialEq)]
572    #[non_exhaustive]
573    pub enum State {
574        /// Default value. This value is unused.
575        Unspecified,
576        /// The QueryTemplate is in draft state.
577        Drafted,
578        /// The QueryTemplate is in pending state.
579        Pending,
580        /// The QueryTemplate is in deleted state.
581        Deleted,
582        /// The QueryTemplate is in approved state.
583        Approved,
584        /// If set, the enum was initialized with an unknown value.
585        ///
586        /// Applications can examine the value using [State::value] or
587        /// [State::name].
588        UnknownValue(state::UnknownValue),
589    }
590
591    #[doc(hidden)]
592    pub mod state {
593        #[allow(unused_imports)]
594        use super::*;
595        #[derive(Clone, Debug, PartialEq)]
596        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
597    }
598
599    impl State {
600        /// Gets the enum value.
601        ///
602        /// Returns `None` if the enum contains an unknown value deserialized from
603        /// the string representation of enums.
604        pub fn value(&self) -> std::option::Option<i32> {
605            match self {
606                Self::Unspecified => std::option::Option::Some(0),
607                Self::Drafted => std::option::Option::Some(1),
608                Self::Pending => std::option::Option::Some(2),
609                Self::Deleted => std::option::Option::Some(3),
610                Self::Approved => std::option::Option::Some(4),
611                Self::UnknownValue(u) => u.0.value(),
612            }
613        }
614
615        /// Gets the enum value as a string.
616        ///
617        /// Returns `None` if the enum contains an unknown value deserialized from
618        /// the integer representation of enums.
619        pub fn name(&self) -> std::option::Option<&str> {
620            match self {
621                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
622                Self::Drafted => std::option::Option::Some("DRAFTED"),
623                Self::Pending => std::option::Option::Some("PENDING"),
624                Self::Deleted => std::option::Option::Some("DELETED"),
625                Self::Approved => std::option::Option::Some("APPROVED"),
626                Self::UnknownValue(u) => u.0.name(),
627            }
628        }
629    }
630
631    impl std::default::Default for State {
632        fn default() -> Self {
633            use std::convert::From;
634            Self::from(0)
635        }
636    }
637
638    impl std::fmt::Display for State {
639        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
640            wkt::internal::display_enum(f, self.name(), self.value())
641        }
642    }
643
644    impl std::convert::From<i32> for State {
645        fn from(value: i32) -> Self {
646            match value {
647                0 => Self::Unspecified,
648                1 => Self::Drafted,
649                2 => Self::Pending,
650                3 => Self::Deleted,
651                4 => Self::Approved,
652                _ => Self::UnknownValue(state::UnknownValue(
653                    wkt::internal::UnknownEnumValue::Integer(value),
654                )),
655            }
656        }
657    }
658
659    impl std::convert::From<&str> for State {
660        fn from(value: &str) -> Self {
661            use std::string::ToString;
662            match value {
663                "STATE_UNSPECIFIED" => Self::Unspecified,
664                "DRAFTED" => Self::Drafted,
665                "PENDING" => Self::Pending,
666                "DELETED" => Self::Deleted,
667                "APPROVED" => Self::Approved,
668                _ => Self::UnknownValue(state::UnknownValue(
669                    wkt::internal::UnknownEnumValue::String(value.to_string()),
670                )),
671            }
672        }
673    }
674
675    impl serde::ser::Serialize for State {
676        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
677        where
678            S: serde::Serializer,
679        {
680            match self {
681                Self::Unspecified => serializer.serialize_i32(0),
682                Self::Drafted => serializer.serialize_i32(1),
683                Self::Pending => serializer.serialize_i32(2),
684                Self::Deleted => serializer.serialize_i32(3),
685                Self::Approved => serializer.serialize_i32(4),
686                Self::UnknownValue(u) => u.0.serialize(serializer),
687            }
688        }
689    }
690
691    impl<'de> serde::de::Deserialize<'de> for State {
692        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
693        where
694            D: serde::Deserializer<'de>,
695        {
696            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
697                ".google.cloud.bigquery.analyticshub.v1.QueryTemplate.State",
698            ))
699        }
700    }
701}
702
703/// Represents a bigquery routine.
704#[derive(Clone, Default, PartialEq)]
705#[non_exhaustive]
706pub struct Routine {
707    /// Required. The type of routine.
708    pub routine_type: crate::model::routine::RoutineType,
709
710    /// Optional. The definition body of the routine.
711    pub definition_body: std::string::String,
712
713    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
714}
715
716impl Routine {
717    /// Creates a new default instance.
718    pub fn new() -> Self {
719        std::default::Default::default()
720    }
721
722    /// Sets the value of [routine_type][crate::model::Routine::routine_type].
723    ///
724    /// # Example
725    /// ```ignore,no_run
726    /// # use google_cloud_bigquery_analyticshub_v1::model::Routine;
727    /// use google_cloud_bigquery_analyticshub_v1::model::routine::RoutineType;
728    /// let x0 = Routine::new().set_routine_type(RoutineType::TableValuedFunction);
729    /// ```
730    pub fn set_routine_type<T: std::convert::Into<crate::model::routine::RoutineType>>(
731        mut self,
732        v: T,
733    ) -> Self {
734        self.routine_type = v.into();
735        self
736    }
737
738    /// Sets the value of [definition_body][crate::model::Routine::definition_body].
739    ///
740    /// # Example
741    /// ```ignore,no_run
742    /// # use google_cloud_bigquery_analyticshub_v1::model::Routine;
743    /// let x = Routine::new().set_definition_body("example");
744    /// ```
745    pub fn set_definition_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
746        self.definition_body = v.into();
747        self
748    }
749}
750
751impl wkt::message::Message for Routine {
752    fn typename() -> &'static str {
753        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Routine"
754    }
755}
756
757/// Defines additional types related to [Routine].
758pub mod routine {
759    #[allow(unused_imports)]
760    use super::*;
761
762    /// Represents the type of a given routine.
763    ///
764    /// # Working with unknown values
765    ///
766    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
767    /// additional enum variants at any time. Adding new variants is not considered
768    /// a breaking change. Applications should write their code in anticipation of:
769    ///
770    /// - New values appearing in future releases of the client library, **and**
771    /// - New values received dynamically, without application changes.
772    ///
773    /// Please consult the [Working with enums] section in the user guide for some
774    /// guidelines.
775    ///
776    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
777    #[derive(Clone, Debug, PartialEq)]
778    #[non_exhaustive]
779    pub enum RoutineType {
780        /// Default value.
781        Unspecified,
782        /// Non-built-in persistent TVF.
783        TableValuedFunction,
784        /// If set, the enum was initialized with an unknown value.
785        ///
786        /// Applications can examine the value using [RoutineType::value] or
787        /// [RoutineType::name].
788        UnknownValue(routine_type::UnknownValue),
789    }
790
791    #[doc(hidden)]
792    pub mod routine_type {
793        #[allow(unused_imports)]
794        use super::*;
795        #[derive(Clone, Debug, PartialEq)]
796        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
797    }
798
799    impl RoutineType {
800        /// Gets the enum value.
801        ///
802        /// Returns `None` if the enum contains an unknown value deserialized from
803        /// the string representation of enums.
804        pub fn value(&self) -> std::option::Option<i32> {
805            match self {
806                Self::Unspecified => std::option::Option::Some(0),
807                Self::TableValuedFunction => std::option::Option::Some(1),
808                Self::UnknownValue(u) => u.0.value(),
809            }
810        }
811
812        /// Gets the enum value as a string.
813        ///
814        /// Returns `None` if the enum contains an unknown value deserialized from
815        /// the integer representation of enums.
816        pub fn name(&self) -> std::option::Option<&str> {
817            match self {
818                Self::Unspecified => std::option::Option::Some("ROUTINE_TYPE_UNSPECIFIED"),
819                Self::TableValuedFunction => std::option::Option::Some("TABLE_VALUED_FUNCTION"),
820                Self::UnknownValue(u) => u.0.name(),
821            }
822        }
823    }
824
825    impl std::default::Default for RoutineType {
826        fn default() -> Self {
827            use std::convert::From;
828            Self::from(0)
829        }
830    }
831
832    impl std::fmt::Display for RoutineType {
833        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
834            wkt::internal::display_enum(f, self.name(), self.value())
835        }
836    }
837
838    impl std::convert::From<i32> for RoutineType {
839        fn from(value: i32) -> Self {
840            match value {
841                0 => Self::Unspecified,
842                1 => Self::TableValuedFunction,
843                _ => Self::UnknownValue(routine_type::UnknownValue(
844                    wkt::internal::UnknownEnumValue::Integer(value),
845                )),
846            }
847        }
848    }
849
850    impl std::convert::From<&str> for RoutineType {
851        fn from(value: &str) -> Self {
852            use std::string::ToString;
853            match value {
854                "ROUTINE_TYPE_UNSPECIFIED" => Self::Unspecified,
855                "TABLE_VALUED_FUNCTION" => Self::TableValuedFunction,
856                _ => Self::UnknownValue(routine_type::UnknownValue(
857                    wkt::internal::UnknownEnumValue::String(value.to_string()),
858                )),
859            }
860        }
861    }
862
863    impl serde::ser::Serialize for RoutineType {
864        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
865        where
866            S: serde::Serializer,
867        {
868            match self {
869                Self::Unspecified => serializer.serialize_i32(0),
870                Self::TableValuedFunction => serializer.serialize_i32(1),
871                Self::UnknownValue(u) => u.0.serialize(serializer),
872            }
873        }
874    }
875
876    impl<'de> serde::de::Deserialize<'de> for RoutineType {
877        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
878        where
879            D: serde::Deserializer<'de>,
880        {
881            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutineType>::new(
882                ".google.cloud.bigquery.analyticshub.v1.Routine.RoutineType",
883            ))
884        }
885    }
886}
887
888/// Message for creating a QueryTemplate.
889#[derive(Clone, Default, PartialEq)]
890#[non_exhaustive]
891pub struct CreateQueryTemplateRequest {
892    /// Required. The parent resource path of the QueryTemplate.
893    /// e.g.
894    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myQueryTemplate`.
895    pub parent: std::string::String,
896
897    /// Required. The ID of the QueryTemplate to create.
898    /// Must contain only Unicode letters, numbers (0-9), underscores (_).
899    /// Max length: 100 bytes.
900    pub query_template_id: std::string::String,
901
902    /// Required. The QueryTemplate to create.
903    pub query_template: std::option::Option<crate::model::QueryTemplate>,
904
905    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
906}
907
908impl CreateQueryTemplateRequest {
909    /// Creates a new default instance.
910    pub fn new() -> Self {
911        std::default::Default::default()
912    }
913
914    /// Sets the value of [parent][crate::model::CreateQueryTemplateRequest::parent].
915    ///
916    /// # Example
917    /// ```ignore,no_run
918    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateQueryTemplateRequest;
919    /// # let project_id = "project_id";
920    /// # let location_id = "location_id";
921    /// # let data_exchange_id = "data_exchange_id";
922    /// let x = CreateQueryTemplateRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}"));
923    /// ```
924    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
925        self.parent = v.into();
926        self
927    }
928
929    /// Sets the value of [query_template_id][crate::model::CreateQueryTemplateRequest::query_template_id].
930    ///
931    /// # Example
932    /// ```ignore,no_run
933    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateQueryTemplateRequest;
934    /// let x = CreateQueryTemplateRequest::new().set_query_template_id("example");
935    /// ```
936    pub fn set_query_template_id<T: std::convert::Into<std::string::String>>(
937        mut self,
938        v: T,
939    ) -> Self {
940        self.query_template_id = v.into();
941        self
942    }
943
944    /// Sets 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_query_template(QueryTemplate::default()/* use setters */);
951    /// ```
952    pub fn set_query_template<T>(mut self, v: T) -> Self
953    where
954        T: std::convert::Into<crate::model::QueryTemplate>,
955    {
956        self.query_template = std::option::Option::Some(v.into());
957        self
958    }
959
960    /// Sets or clears the value of [query_template][crate::model::CreateQueryTemplateRequest::query_template].
961    ///
962    /// # Example
963    /// ```ignore,no_run
964    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateQueryTemplateRequest;
965    /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
966    /// let x = CreateQueryTemplateRequest::new().set_or_clear_query_template(Some(QueryTemplate::default()/* use setters */));
967    /// let x = CreateQueryTemplateRequest::new().set_or_clear_query_template(None::<QueryTemplate>);
968    /// ```
969    pub fn set_or_clear_query_template<T>(mut self, v: std::option::Option<T>) -> Self
970    where
971        T: std::convert::Into<crate::model::QueryTemplate>,
972    {
973        self.query_template = v.map(|x| x.into());
974        self
975    }
976}
977
978impl wkt::message::Message for CreateQueryTemplateRequest {
979    fn typename() -> &'static str {
980        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CreateQueryTemplateRequest"
981    }
982}
983
984/// Message for creating a QueryTemplate.
985#[derive(Clone, Default, PartialEq)]
986#[non_exhaustive]
987pub struct GetQueryTemplateRequest {
988    /// Required. The parent resource path of the QueryTemplate.
989    /// e.g.
990    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
991    pub name: std::string::String,
992
993    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
994}
995
996impl GetQueryTemplateRequest {
997    /// Creates a new default instance.
998    pub fn new() -> Self {
999        std::default::Default::default()
1000    }
1001
1002    /// Sets the value of [name][crate::model::GetQueryTemplateRequest::name].
1003    ///
1004    /// # Example
1005    /// ```ignore,no_run
1006    /// # use google_cloud_bigquery_analyticshub_v1::model::GetQueryTemplateRequest;
1007    /// # let project_id = "project_id";
1008    /// # let location_id = "location_id";
1009    /// # let data_exchange_id = "data_exchange_id";
1010    /// # let query_template_id = "query_template_id";
1011    /// let x = GetQueryTemplateRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}/queryTemplates/{query_template_id}"));
1012    /// ```
1013    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1014        self.name = v.into();
1015        self
1016    }
1017}
1018
1019impl wkt::message::Message for GetQueryTemplateRequest {
1020    fn typename() -> &'static str {
1021        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetQueryTemplateRequest"
1022    }
1023}
1024
1025/// Message for requesting the list of QueryTemplates.
1026#[derive(Clone, Default, PartialEq)]
1027#[non_exhaustive]
1028pub struct ListQueryTemplatesRequest {
1029    /// Required. The parent resource path of the QueryTemplates.
1030    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
1031    pub parent: std::string::String,
1032
1033    /// Optional. The maximum number of results to return in a single response
1034    /// page. Leverage the page tokens to iterate through the entire collection.
1035    pub page_size: i32,
1036
1037    /// Optional. Page token, returned by a previous call, to request the next page
1038    /// of results.
1039    pub page_token: std::string::String,
1040
1041    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1042}
1043
1044impl ListQueryTemplatesRequest {
1045    /// Creates a new default instance.
1046    pub fn new() -> Self {
1047        std::default::Default::default()
1048    }
1049
1050    /// Sets the value of [parent][crate::model::ListQueryTemplatesRequest::parent].
1051    ///
1052    /// # Example
1053    /// ```ignore,no_run
1054    /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesRequest;
1055    /// # let project_id = "project_id";
1056    /// # let location_id = "location_id";
1057    /// # let data_exchange_id = "data_exchange_id";
1058    /// let x = ListQueryTemplatesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}"));
1059    /// ```
1060    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1061        self.parent = v.into();
1062        self
1063    }
1064
1065    /// Sets the value of [page_size][crate::model::ListQueryTemplatesRequest::page_size].
1066    ///
1067    /// # Example
1068    /// ```ignore,no_run
1069    /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesRequest;
1070    /// let x = ListQueryTemplatesRequest::new().set_page_size(42);
1071    /// ```
1072    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1073        self.page_size = v.into();
1074        self
1075    }
1076
1077    /// Sets the value of [page_token][crate::model::ListQueryTemplatesRequest::page_token].
1078    ///
1079    /// # Example
1080    /// ```ignore,no_run
1081    /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesRequest;
1082    /// let x = ListQueryTemplatesRequest::new().set_page_token("example");
1083    /// ```
1084    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1085        self.page_token = v.into();
1086        self
1087    }
1088}
1089
1090impl wkt::message::Message for ListQueryTemplatesRequest {
1091    fn typename() -> &'static str {
1092        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListQueryTemplatesRequest"
1093    }
1094}
1095
1096/// Message for response to the list of QueryTemplates.
1097#[derive(Clone, Default, PartialEq)]
1098#[non_exhaustive]
1099pub struct ListQueryTemplatesResponse {
1100    /// The list of QueryTemplates.
1101    pub query_templates: std::vec::Vec<crate::model::QueryTemplate>,
1102
1103    /// A token to request the next page of results.
1104    pub next_page_token: std::string::String,
1105
1106    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1107}
1108
1109impl ListQueryTemplatesResponse {
1110    /// Creates a new default instance.
1111    pub fn new() -> Self {
1112        std::default::Default::default()
1113    }
1114
1115    /// Sets the value of [query_templates][crate::model::ListQueryTemplatesResponse::query_templates].
1116    ///
1117    /// # Example
1118    /// ```ignore,no_run
1119    /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesResponse;
1120    /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
1121    /// let x = ListQueryTemplatesResponse::new()
1122    ///     .set_query_templates([
1123    ///         QueryTemplate::default()/* use setters */,
1124    ///         QueryTemplate::default()/* use (different) setters */,
1125    ///     ]);
1126    /// ```
1127    pub fn set_query_templates<T, V>(mut self, v: T) -> Self
1128    where
1129        T: std::iter::IntoIterator<Item = V>,
1130        V: std::convert::Into<crate::model::QueryTemplate>,
1131    {
1132        use std::iter::Iterator;
1133        self.query_templates = v.into_iter().map(|i| i.into()).collect();
1134        self
1135    }
1136
1137    /// Sets the value of [next_page_token][crate::model::ListQueryTemplatesResponse::next_page_token].
1138    ///
1139    /// # Example
1140    /// ```ignore,no_run
1141    /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesResponse;
1142    /// let x = ListQueryTemplatesResponse::new().set_next_page_token("example");
1143    /// ```
1144    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1145        self.next_page_token = v.into();
1146        self
1147    }
1148}
1149
1150impl wkt::message::Message for ListQueryTemplatesResponse {
1151    fn typename() -> &'static str {
1152        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListQueryTemplatesResponse"
1153    }
1154}
1155
1156#[doc(hidden)]
1157impl google_cloud_gax::paginator::internal::PageableResponse for ListQueryTemplatesResponse {
1158    type PageItem = crate::model::QueryTemplate;
1159
1160    fn items(self) -> std::vec::Vec<Self::PageItem> {
1161        self.query_templates
1162    }
1163
1164    fn next_page_token(&self) -> std::string::String {
1165        use std::clone::Clone;
1166        self.next_page_token.clone()
1167    }
1168}
1169
1170/// Message for updating a QueryTemplate.
1171#[derive(Clone, Default, PartialEq)]
1172#[non_exhaustive]
1173pub struct UpdateQueryTemplateRequest {
1174    /// Optional. Field mask specifies the fields to update in the query template
1175    /// resource. The fields specified in the `updateMask` are relative to the
1176    /// resource and are not a full request.
1177    pub update_mask: std::option::Option<wkt::FieldMask>,
1178
1179    /// Required. The QueryTemplate to update.
1180    pub query_template: std::option::Option<crate::model::QueryTemplate>,
1181
1182    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1183}
1184
1185impl UpdateQueryTemplateRequest {
1186    /// Creates a new default instance.
1187    pub fn new() -> Self {
1188        std::default::Default::default()
1189    }
1190
1191    /// Sets the value of [update_mask][crate::model::UpdateQueryTemplateRequest::update_mask].
1192    ///
1193    /// # Example
1194    /// ```ignore,no_run
1195    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1196    /// use wkt::FieldMask;
1197    /// let x = UpdateQueryTemplateRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1198    /// ```
1199    pub fn set_update_mask<T>(mut self, v: T) -> Self
1200    where
1201        T: std::convert::Into<wkt::FieldMask>,
1202    {
1203        self.update_mask = std::option::Option::Some(v.into());
1204        self
1205    }
1206
1207    /// Sets or clears the value of [update_mask][crate::model::UpdateQueryTemplateRequest::update_mask].
1208    ///
1209    /// # Example
1210    /// ```ignore,no_run
1211    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1212    /// use wkt::FieldMask;
1213    /// let x = UpdateQueryTemplateRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1214    /// let x = UpdateQueryTemplateRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1215    /// ```
1216    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1217    where
1218        T: std::convert::Into<wkt::FieldMask>,
1219    {
1220        self.update_mask = v.map(|x| x.into());
1221        self
1222    }
1223
1224    /// Sets the value of [query_template][crate::model::UpdateQueryTemplateRequest::query_template].
1225    ///
1226    /// # Example
1227    /// ```ignore,no_run
1228    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1229    /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
1230    /// let x = UpdateQueryTemplateRequest::new().set_query_template(QueryTemplate::default()/* use setters */);
1231    /// ```
1232    pub fn set_query_template<T>(mut self, v: T) -> Self
1233    where
1234        T: std::convert::Into<crate::model::QueryTemplate>,
1235    {
1236        self.query_template = std::option::Option::Some(v.into());
1237        self
1238    }
1239
1240    /// Sets or clears the value of [query_template][crate::model::UpdateQueryTemplateRequest::query_template].
1241    ///
1242    /// # Example
1243    /// ```ignore,no_run
1244    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1245    /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
1246    /// let x = UpdateQueryTemplateRequest::new().set_or_clear_query_template(Some(QueryTemplate::default()/* use setters */));
1247    /// let x = UpdateQueryTemplateRequest::new().set_or_clear_query_template(None::<QueryTemplate>);
1248    /// ```
1249    pub fn set_or_clear_query_template<T>(mut self, v: std::option::Option<T>) -> Self
1250    where
1251        T: std::convert::Into<crate::model::QueryTemplate>,
1252    {
1253        self.query_template = v.map(|x| x.into());
1254        self
1255    }
1256}
1257
1258impl wkt::message::Message for UpdateQueryTemplateRequest {
1259    fn typename() -> &'static str {
1260        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.UpdateQueryTemplateRequest"
1261    }
1262}
1263
1264/// Message for deleting a QueryTemplate.
1265#[derive(Clone, Default, PartialEq)]
1266#[non_exhaustive]
1267pub struct DeleteQueryTemplateRequest {
1268    /// Required. The resource path of the QueryTemplate.
1269    /// e.g.
1270    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
1271    pub name: std::string::String,
1272
1273    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1274}
1275
1276impl DeleteQueryTemplateRequest {
1277    /// Creates a new default instance.
1278    pub fn new() -> Self {
1279        std::default::Default::default()
1280    }
1281
1282    /// Sets the value of [name][crate::model::DeleteQueryTemplateRequest::name].
1283    ///
1284    /// # Example
1285    /// ```ignore,no_run
1286    /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteQueryTemplateRequest;
1287    /// # let project_id = "project_id";
1288    /// # let location_id = "location_id";
1289    /// # let data_exchange_id = "data_exchange_id";
1290    /// # let query_template_id = "query_template_id";
1291    /// let x = DeleteQueryTemplateRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}/queryTemplates/{query_template_id}"));
1292    /// ```
1293    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1294        self.name = v.into();
1295        self
1296    }
1297}
1298
1299impl wkt::message::Message for DeleteQueryTemplateRequest {
1300    fn typename() -> &'static str {
1301        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteQueryTemplateRequest"
1302    }
1303}
1304
1305/// Message for submitting a QueryTemplate.
1306#[derive(Clone, Default, PartialEq)]
1307#[non_exhaustive]
1308pub struct SubmitQueryTemplateRequest {
1309    /// Required. The resource path of the QueryTemplate.
1310    /// e.g.
1311    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
1312    pub name: std::string::String,
1313
1314    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1315}
1316
1317impl SubmitQueryTemplateRequest {
1318    /// Creates a new default instance.
1319    pub fn new() -> Self {
1320        std::default::Default::default()
1321    }
1322
1323    /// Sets the value of [name][crate::model::SubmitQueryTemplateRequest::name].
1324    ///
1325    /// # Example
1326    /// ```ignore,no_run
1327    /// # use google_cloud_bigquery_analyticshub_v1::model::SubmitQueryTemplateRequest;
1328    /// # let project_id = "project_id";
1329    /// # let location_id = "location_id";
1330    /// # let data_exchange_id = "data_exchange_id";
1331    /// # let query_template_id = "query_template_id";
1332    /// let x = SubmitQueryTemplateRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}/queryTemplates/{query_template_id}"));
1333    /// ```
1334    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1335        self.name = v.into();
1336        self
1337    }
1338}
1339
1340impl wkt::message::Message for SubmitQueryTemplateRequest {
1341    fn typename() -> &'static str {
1342        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubmitQueryTemplateRequest"
1343    }
1344}
1345
1346/// Message for approving a QueryTemplate.
1347#[derive(Clone, Default, PartialEq)]
1348#[non_exhaustive]
1349pub struct ApproveQueryTemplateRequest {
1350    /// Required. The resource path of the QueryTemplate.
1351    /// e.g.
1352    /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
1353    pub name: std::string::String,
1354
1355    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1356}
1357
1358impl ApproveQueryTemplateRequest {
1359    /// Creates a new default instance.
1360    pub fn new() -> Self {
1361        std::default::Default::default()
1362    }
1363
1364    /// Sets the value of [name][crate::model::ApproveQueryTemplateRequest::name].
1365    ///
1366    /// # Example
1367    /// ```ignore,no_run
1368    /// # use google_cloud_bigquery_analyticshub_v1::model::ApproveQueryTemplateRequest;
1369    /// # let project_id = "project_id";
1370    /// # let location_id = "location_id";
1371    /// # let data_exchange_id = "data_exchange_id";
1372    /// # let query_template_id = "query_template_id";
1373    /// let x = ApproveQueryTemplateRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}/queryTemplates/{query_template_id}"));
1374    /// ```
1375    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1376        self.name = v.into();
1377        self
1378    }
1379}
1380
1381impl wkt::message::Message for ApproveQueryTemplateRequest {
1382    fn typename() -> &'static str {
1383        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ApproveQueryTemplateRequest"
1384    }
1385}
1386
1387/// Sharing environment is a behavior model for sharing data within a
1388/// data exchange. This option is configurable for a data exchange.
1389#[derive(Clone, Default, PartialEq)]
1390#[non_exhaustive]
1391pub struct SharingEnvironmentConfig {
1392    #[allow(missing_docs)]
1393    pub environment: std::option::Option<crate::model::sharing_environment_config::Environment>,
1394
1395    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1396}
1397
1398impl SharingEnvironmentConfig {
1399    /// Creates a new default instance.
1400    pub fn new() -> Self {
1401        std::default::Default::default()
1402    }
1403
1404    /// Sets the value of [environment][crate::model::SharingEnvironmentConfig::environment].
1405    ///
1406    /// Note that all the setters affecting `environment` are mutually
1407    /// exclusive.
1408    ///
1409    /// # Example
1410    /// ```ignore,no_run
1411    /// # use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
1412    /// use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DefaultExchangeConfig;
1413    /// let x = SharingEnvironmentConfig::new().set_environment(Some(
1414    ///     google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::Environment::DefaultExchangeConfig(DefaultExchangeConfig::default().into())));
1415    /// ```
1416    pub fn set_environment<
1417        T: std::convert::Into<
1418                std::option::Option<crate::model::sharing_environment_config::Environment>,
1419            >,
1420    >(
1421        mut self,
1422        v: T,
1423    ) -> Self {
1424        self.environment = v.into();
1425        self
1426    }
1427
1428    /// The value of [environment][crate::model::SharingEnvironmentConfig::environment]
1429    /// if it holds a `DefaultExchangeConfig`, `None` if the field is not set or
1430    /// holds a different branch.
1431    pub fn default_exchange_config(
1432        &self,
1433    ) -> std::option::Option<
1434        &std::boxed::Box<crate::model::sharing_environment_config::DefaultExchangeConfig>,
1435    > {
1436        #[allow(unreachable_patterns)]
1437        self.environment.as_ref().and_then(|v| match v {
1438            crate::model::sharing_environment_config::Environment::DefaultExchangeConfig(v) => {
1439                std::option::Option::Some(v)
1440            }
1441            _ => std::option::Option::None,
1442        })
1443    }
1444
1445    /// Sets the value of [environment][crate::model::SharingEnvironmentConfig::environment]
1446    /// to hold a `DefaultExchangeConfig`.
1447    ///
1448    /// Note that all the setters affecting `environment` are
1449    /// mutually exclusive.
1450    ///
1451    /// # Example
1452    /// ```ignore,no_run
1453    /// # use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
1454    /// use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DefaultExchangeConfig;
1455    /// let x = SharingEnvironmentConfig::new().set_default_exchange_config(DefaultExchangeConfig::default()/* use setters */);
1456    /// assert!(x.default_exchange_config().is_some());
1457    /// assert!(x.dcr_exchange_config().is_none());
1458    /// ```
1459    pub fn set_default_exchange_config<
1460        T: std::convert::Into<
1461                std::boxed::Box<crate::model::sharing_environment_config::DefaultExchangeConfig>,
1462            >,
1463    >(
1464        mut self,
1465        v: T,
1466    ) -> Self {
1467        self.environment = std::option::Option::Some(
1468            crate::model::sharing_environment_config::Environment::DefaultExchangeConfig(v.into()),
1469        );
1470        self
1471    }
1472
1473    /// The value of [environment][crate::model::SharingEnvironmentConfig::environment]
1474    /// if it holds a `DcrExchangeConfig`, `None` if the field is not set or
1475    /// holds a different branch.
1476    pub fn dcr_exchange_config(
1477        &self,
1478    ) -> std::option::Option<
1479        &std::boxed::Box<crate::model::sharing_environment_config::DcrExchangeConfig>,
1480    > {
1481        #[allow(unreachable_patterns)]
1482        self.environment.as_ref().and_then(|v| match v {
1483            crate::model::sharing_environment_config::Environment::DcrExchangeConfig(v) => {
1484                std::option::Option::Some(v)
1485            }
1486            _ => std::option::Option::None,
1487        })
1488    }
1489
1490    /// Sets the value of [environment][crate::model::SharingEnvironmentConfig::environment]
1491    /// to hold a `DcrExchangeConfig`.
1492    ///
1493    /// Note that all the setters affecting `environment` are
1494    /// mutually exclusive.
1495    ///
1496    /// # Example
1497    /// ```ignore,no_run
1498    /// # use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
1499    /// use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1500    /// let x = SharingEnvironmentConfig::new().set_dcr_exchange_config(DcrExchangeConfig::default()/* use setters */);
1501    /// assert!(x.dcr_exchange_config().is_some());
1502    /// assert!(x.default_exchange_config().is_none());
1503    /// ```
1504    pub fn set_dcr_exchange_config<
1505        T: std::convert::Into<
1506                std::boxed::Box<crate::model::sharing_environment_config::DcrExchangeConfig>,
1507            >,
1508    >(
1509        mut self,
1510        v: T,
1511    ) -> Self {
1512        self.environment = std::option::Option::Some(
1513            crate::model::sharing_environment_config::Environment::DcrExchangeConfig(v.into()),
1514        );
1515        self
1516    }
1517}
1518
1519impl wkt::message::Message for SharingEnvironmentConfig {
1520    fn typename() -> &'static str {
1521        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig"
1522    }
1523}
1524
1525/// Defines additional types related to [SharingEnvironmentConfig].
1526pub mod sharing_environment_config {
1527    #[allow(unused_imports)]
1528    use super::*;
1529
1530    /// Default Analytics Hub data exchange, used for secured data sharing.
1531    #[derive(Clone, Default, PartialEq)]
1532    #[non_exhaustive]
1533    pub struct DefaultExchangeConfig {
1534        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1535    }
1536
1537    impl DefaultExchangeConfig {
1538        /// Creates a new default instance.
1539        pub fn new() -> Self {
1540            std::default::Default::default()
1541        }
1542    }
1543
1544    impl wkt::message::Message for DefaultExchangeConfig {
1545        fn typename() -> &'static str {
1546            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig.DefaultExchangeConfig"
1547        }
1548    }
1549
1550    /// Data Clean Room (DCR), used for privacy-safe and secured data sharing.
1551    #[derive(Clone, Default, PartialEq)]
1552    #[non_exhaustive]
1553    pub struct DcrExchangeConfig {
1554        /// Output only. If True, this DCR restricts the contributors to sharing
1555        /// only a single resource in a Listing. And no two resources should have the
1556        /// same IDs. So if a contributor adds a view with a conflicting name, the
1557        /// CreateListing API will reject the request. if False, the data contributor
1558        /// can publish an entire dataset (as before). This is not configurable, and
1559        /// by default, all new DCRs will have the restriction set to True.
1560        pub single_selected_resource_sharing_restriction: std::option::Option<bool>,
1561
1562        /// Output only. If True, when subscribing to this DCR, it will create only
1563        /// one linked dataset containing all resources shared within the
1564        /// cleanroom. If False, when subscribing to this DCR, it will
1565        /// create 1 linked dataset per listing. This is not configurable, and by
1566        /// default, all new DCRs will have the restriction set to True.
1567        pub single_linked_dataset_per_cleanroom: std::option::Option<bool>,
1568
1569        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1570    }
1571
1572    impl DcrExchangeConfig {
1573        /// Creates a new default instance.
1574        pub fn new() -> Self {
1575            std::default::Default::default()
1576        }
1577
1578        /// Sets the value of [single_selected_resource_sharing_restriction][crate::model::sharing_environment_config::DcrExchangeConfig::single_selected_resource_sharing_restriction].
1579        ///
1580        /// # Example
1581        /// ```ignore,no_run
1582        /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1583        /// let x = DcrExchangeConfig::new().set_single_selected_resource_sharing_restriction(true);
1584        /// ```
1585        pub fn set_single_selected_resource_sharing_restriction<T>(mut self, v: T) -> Self
1586        where
1587            T: std::convert::Into<bool>,
1588        {
1589            self.single_selected_resource_sharing_restriction = std::option::Option::Some(v.into());
1590            self
1591        }
1592
1593        /// Sets or clears the value of [single_selected_resource_sharing_restriction][crate::model::sharing_environment_config::DcrExchangeConfig::single_selected_resource_sharing_restriction].
1594        ///
1595        /// # Example
1596        /// ```ignore,no_run
1597        /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1598        /// let x = DcrExchangeConfig::new().set_or_clear_single_selected_resource_sharing_restriction(Some(false));
1599        /// let x = DcrExchangeConfig::new().set_or_clear_single_selected_resource_sharing_restriction(None::<bool>);
1600        /// ```
1601        pub fn set_or_clear_single_selected_resource_sharing_restriction<T>(
1602            mut self,
1603            v: std::option::Option<T>,
1604        ) -> Self
1605        where
1606            T: std::convert::Into<bool>,
1607        {
1608            self.single_selected_resource_sharing_restriction = v.map(|x| x.into());
1609            self
1610        }
1611
1612        /// Sets the value of [single_linked_dataset_per_cleanroom][crate::model::sharing_environment_config::DcrExchangeConfig::single_linked_dataset_per_cleanroom].
1613        ///
1614        /// # Example
1615        /// ```ignore,no_run
1616        /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1617        /// let x = DcrExchangeConfig::new().set_single_linked_dataset_per_cleanroom(true);
1618        /// ```
1619        pub fn set_single_linked_dataset_per_cleanroom<T>(mut self, v: T) -> Self
1620        where
1621            T: std::convert::Into<bool>,
1622        {
1623            self.single_linked_dataset_per_cleanroom = std::option::Option::Some(v.into());
1624            self
1625        }
1626
1627        /// Sets or clears the value of [single_linked_dataset_per_cleanroom][crate::model::sharing_environment_config::DcrExchangeConfig::single_linked_dataset_per_cleanroom].
1628        ///
1629        /// # Example
1630        /// ```ignore,no_run
1631        /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1632        /// let x = DcrExchangeConfig::new().set_or_clear_single_linked_dataset_per_cleanroom(Some(false));
1633        /// let x = DcrExchangeConfig::new().set_or_clear_single_linked_dataset_per_cleanroom(None::<bool>);
1634        /// ```
1635        pub fn set_or_clear_single_linked_dataset_per_cleanroom<T>(
1636            mut self,
1637            v: std::option::Option<T>,
1638        ) -> Self
1639        where
1640            T: std::convert::Into<bool>,
1641        {
1642            self.single_linked_dataset_per_cleanroom = v.map(|x| x.into());
1643            self
1644        }
1645    }
1646
1647    impl wkt::message::Message for DcrExchangeConfig {
1648        fn typename() -> &'static str {
1649            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig.DcrExchangeConfig"
1650        }
1651    }
1652
1653    #[allow(missing_docs)]
1654    #[derive(Clone, Debug, PartialEq)]
1655    #[non_exhaustive]
1656    pub enum Environment {
1657        /// Default Analytics Hub data exchange, used for secured data sharing.
1658        DefaultExchangeConfig(
1659            std::boxed::Box<crate::model::sharing_environment_config::DefaultExchangeConfig>,
1660        ),
1661        /// Data Clean Room (DCR), used for privacy-safe and secured data sharing.
1662        DcrExchangeConfig(
1663            std::boxed::Box<crate::model::sharing_environment_config::DcrExchangeConfig>,
1664        ),
1665    }
1666}
1667
1668/// Contains details of the data provider.
1669#[derive(Clone, Default, PartialEq)]
1670#[non_exhaustive]
1671pub struct DataProvider {
1672    /// Optional. Name of the data provider.
1673    pub name: std::string::String,
1674
1675    /// Optional. Email or URL of the data provider.
1676    /// Max Length: 1000 bytes.
1677    pub primary_contact: std::string::String,
1678
1679    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1680}
1681
1682impl DataProvider {
1683    /// Creates a new default instance.
1684    pub fn new() -> Self {
1685        std::default::Default::default()
1686    }
1687
1688    /// Sets the value of [name][crate::model::DataProvider::name].
1689    ///
1690    /// # Example
1691    /// ```ignore,no_run
1692    /// # use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
1693    /// let x = DataProvider::new().set_name("example");
1694    /// ```
1695    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1696        self.name = v.into();
1697        self
1698    }
1699
1700    /// Sets the value of [primary_contact][crate::model::DataProvider::primary_contact].
1701    ///
1702    /// # Example
1703    /// ```ignore,no_run
1704    /// # use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
1705    /// let x = DataProvider::new().set_primary_contact("example");
1706    /// ```
1707    pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1708        self.primary_contact = v.into();
1709        self
1710    }
1711}
1712
1713impl wkt::message::Message for DataProvider {
1714    fn typename() -> &'static str {
1715        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DataProvider"
1716    }
1717}
1718
1719/// Contains details of the listing publisher.
1720#[derive(Clone, Default, PartialEq)]
1721#[non_exhaustive]
1722pub struct Publisher {
1723    /// Optional. Name of the listing publisher.
1724    pub name: std::string::String,
1725
1726    /// Optional. Email or URL of the listing publisher.
1727    /// Max Length: 1000 bytes.
1728    pub primary_contact: std::string::String,
1729
1730    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1731}
1732
1733impl Publisher {
1734    /// Creates a new default instance.
1735    pub fn new() -> Self {
1736        std::default::Default::default()
1737    }
1738
1739    /// Sets the value of [name][crate::model::Publisher::name].
1740    ///
1741    /// # Example
1742    /// ```ignore,no_run
1743    /// # use google_cloud_bigquery_analyticshub_v1::model::Publisher;
1744    /// let x = Publisher::new().set_name("example");
1745    /// ```
1746    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1747        self.name = v.into();
1748        self
1749    }
1750
1751    /// Sets the value of [primary_contact][crate::model::Publisher::primary_contact].
1752    ///
1753    /// # Example
1754    /// ```ignore,no_run
1755    /// # use google_cloud_bigquery_analyticshub_v1::model::Publisher;
1756    /// let x = Publisher::new().set_primary_contact("example");
1757    /// ```
1758    pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1759        self.primary_contact = v.into();
1760        self
1761    }
1762}
1763
1764impl wkt::message::Message for Publisher {
1765    fn typename() -> &'static str {
1766        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Publisher"
1767    }
1768}
1769
1770#[allow(missing_docs)]
1771#[derive(Clone, Default, PartialEq)]
1772#[non_exhaustive]
1773pub struct DestinationDatasetReference {
1774    /// Required. A unique ID for this dataset, without the project name. The ID
1775    /// must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_).
1776    /// The maximum length is 1,024 characters.
1777    pub dataset_id: std::string::String,
1778
1779    /// Required. The ID of the project containing this dataset.
1780    pub project_id: std::string::String,
1781
1782    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1783}
1784
1785impl DestinationDatasetReference {
1786    /// Creates a new default instance.
1787    pub fn new() -> Self {
1788        std::default::Default::default()
1789    }
1790
1791    /// Sets the value of [dataset_id][crate::model::DestinationDatasetReference::dataset_id].
1792    ///
1793    /// # Example
1794    /// ```ignore,no_run
1795    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1796    /// let x = DestinationDatasetReference::new().set_dataset_id("example");
1797    /// ```
1798    pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1799        self.dataset_id = v.into();
1800        self
1801    }
1802
1803    /// Sets the value of [project_id][crate::model::DestinationDatasetReference::project_id].
1804    ///
1805    /// # Example
1806    /// ```ignore,no_run
1807    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1808    /// let x = DestinationDatasetReference::new().set_project_id("example");
1809    /// ```
1810    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1811        self.project_id = v.into();
1812        self
1813    }
1814}
1815
1816impl wkt::message::Message for DestinationDatasetReference {
1817    fn typename() -> &'static str {
1818        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference"
1819    }
1820}
1821
1822/// Defines the destination bigquery dataset.
1823#[derive(Clone, Default, PartialEq)]
1824#[non_exhaustive]
1825pub struct DestinationDataset {
1826    /// Required. A reference that identifies the destination dataset.
1827    pub dataset_reference: std::option::Option<crate::model::DestinationDatasetReference>,
1828
1829    /// Optional. A descriptive name for the dataset.
1830    pub friendly_name: std::option::Option<wkt::StringValue>,
1831
1832    /// Optional. A user-friendly description of the dataset.
1833    pub description: std::option::Option<wkt::StringValue>,
1834
1835    /// Optional. The labels associated with this dataset. You can use these
1836    /// to organize and group your datasets.
1837    /// You can set this property when inserting or updating a dataset.
1838    /// See <https://cloud.google.com/resource-manager/docs/creating-managing-labels>
1839    /// for more information.
1840    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1841
1842    /// Required. The geographic location where the dataset should reside. See
1843    /// <https://cloud.google.com/bigquery/docs/locations> for supported
1844    /// locations.
1845    pub location: std::string::String,
1846
1847    /// Optional. The geographic locations where the dataset should be replicated.
1848    /// See [BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
1849    /// for supported locations.
1850    pub replica_locations: std::vec::Vec<std::string::String>,
1851
1852    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1853}
1854
1855impl DestinationDataset {
1856    /// Creates a new default instance.
1857    pub fn new() -> Self {
1858        std::default::Default::default()
1859    }
1860
1861    /// Sets the value of [dataset_reference][crate::model::DestinationDataset::dataset_reference].
1862    ///
1863    /// # Example
1864    /// ```ignore,no_run
1865    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1866    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1867    /// let x = DestinationDataset::new().set_dataset_reference(DestinationDatasetReference::default()/* use setters */);
1868    /// ```
1869    pub fn set_dataset_reference<T>(mut self, v: T) -> Self
1870    where
1871        T: std::convert::Into<crate::model::DestinationDatasetReference>,
1872    {
1873        self.dataset_reference = std::option::Option::Some(v.into());
1874        self
1875    }
1876
1877    /// Sets or clears the value of [dataset_reference][crate::model::DestinationDataset::dataset_reference].
1878    ///
1879    /// # Example
1880    /// ```ignore,no_run
1881    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1882    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1883    /// let x = DestinationDataset::new().set_or_clear_dataset_reference(Some(DestinationDatasetReference::default()/* use setters */));
1884    /// let x = DestinationDataset::new().set_or_clear_dataset_reference(None::<DestinationDatasetReference>);
1885    /// ```
1886    pub fn set_or_clear_dataset_reference<T>(mut self, v: std::option::Option<T>) -> Self
1887    where
1888        T: std::convert::Into<crate::model::DestinationDatasetReference>,
1889    {
1890        self.dataset_reference = v.map(|x| x.into());
1891        self
1892    }
1893
1894    /// Sets the value of [friendly_name][crate::model::DestinationDataset::friendly_name].
1895    ///
1896    /// # Example
1897    /// ```ignore,no_run
1898    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1899    /// use wkt::StringValue;
1900    /// let x = DestinationDataset::new().set_friendly_name(StringValue::default()/* use setters */);
1901    /// ```
1902    pub fn set_friendly_name<T>(mut self, v: T) -> Self
1903    where
1904        T: std::convert::Into<wkt::StringValue>,
1905    {
1906        self.friendly_name = std::option::Option::Some(v.into());
1907        self
1908    }
1909
1910    /// Sets or clears the value of [friendly_name][crate::model::DestinationDataset::friendly_name].
1911    ///
1912    /// # Example
1913    /// ```ignore,no_run
1914    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1915    /// use wkt::StringValue;
1916    /// let x = DestinationDataset::new().set_or_clear_friendly_name(Some(StringValue::default()/* use setters */));
1917    /// let x = DestinationDataset::new().set_or_clear_friendly_name(None::<StringValue>);
1918    /// ```
1919    pub fn set_or_clear_friendly_name<T>(mut self, v: std::option::Option<T>) -> Self
1920    where
1921        T: std::convert::Into<wkt::StringValue>,
1922    {
1923        self.friendly_name = v.map(|x| x.into());
1924        self
1925    }
1926
1927    /// Sets the value of [description][crate::model::DestinationDataset::description].
1928    ///
1929    /// # Example
1930    /// ```ignore,no_run
1931    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1932    /// use wkt::StringValue;
1933    /// let x = DestinationDataset::new().set_description(StringValue::default()/* use setters */);
1934    /// ```
1935    pub fn set_description<T>(mut self, v: T) -> Self
1936    where
1937        T: std::convert::Into<wkt::StringValue>,
1938    {
1939        self.description = std::option::Option::Some(v.into());
1940        self
1941    }
1942
1943    /// Sets or clears the value of [description][crate::model::DestinationDataset::description].
1944    ///
1945    /// # Example
1946    /// ```ignore,no_run
1947    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1948    /// use wkt::StringValue;
1949    /// let x = DestinationDataset::new().set_or_clear_description(Some(StringValue::default()/* use setters */));
1950    /// let x = DestinationDataset::new().set_or_clear_description(None::<StringValue>);
1951    /// ```
1952    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
1953    where
1954        T: std::convert::Into<wkt::StringValue>,
1955    {
1956        self.description = v.map(|x| x.into());
1957        self
1958    }
1959
1960    /// Sets the value of [labels][crate::model::DestinationDataset::labels].
1961    ///
1962    /// # Example
1963    /// ```ignore,no_run
1964    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1965    /// let x = DestinationDataset::new().set_labels([
1966    ///     ("key0", "abc"),
1967    ///     ("key1", "xyz"),
1968    /// ]);
1969    /// ```
1970    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1971    where
1972        T: std::iter::IntoIterator<Item = (K, V)>,
1973        K: std::convert::Into<std::string::String>,
1974        V: std::convert::Into<std::string::String>,
1975    {
1976        use std::iter::Iterator;
1977        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1978        self
1979    }
1980
1981    /// Sets the value of [location][crate::model::DestinationDataset::location].
1982    ///
1983    /// # Example
1984    /// ```ignore,no_run
1985    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1986    /// let x = DestinationDataset::new().set_location("example");
1987    /// ```
1988    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1989        self.location = v.into();
1990        self
1991    }
1992
1993    /// Sets the value of [replica_locations][crate::model::DestinationDataset::replica_locations].
1994    ///
1995    /// # Example
1996    /// ```ignore,no_run
1997    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1998    /// let x = DestinationDataset::new().set_replica_locations(["a", "b", "c"]);
1999    /// ```
2000    pub fn set_replica_locations<T, V>(mut self, v: T) -> Self
2001    where
2002        T: std::iter::IntoIterator<Item = V>,
2003        V: std::convert::Into<std::string::String>,
2004    {
2005        use std::iter::Iterator;
2006        self.replica_locations = v.into_iter().map(|i| i.into()).collect();
2007        self
2008    }
2009}
2010
2011impl wkt::message::Message for DestinationDataset {
2012    fn typename() -> &'static str {
2013        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DestinationDataset"
2014    }
2015}
2016
2017/// Defines the destination Pub/Sub subscription.
2018#[derive(Clone, Default, PartialEq)]
2019#[non_exhaustive]
2020pub struct DestinationPubSubSubscription {
2021    /// Required. Destination Pub/Sub subscription resource.
2022    pub pubsub_subscription: std::option::Option<crate::model::PubSubSubscription>,
2023
2024    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2025}
2026
2027impl DestinationPubSubSubscription {
2028    /// Creates a new default instance.
2029    pub fn new() -> Self {
2030        std::default::Default::default()
2031    }
2032
2033    /// Sets the value of [pubsub_subscription][crate::model::DestinationPubSubSubscription::pubsub_subscription].
2034    ///
2035    /// # Example
2036    /// ```ignore,no_run
2037    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationPubSubSubscription;
2038    /// use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
2039    /// let x = DestinationPubSubSubscription::new().set_pubsub_subscription(PubSubSubscription::default()/* use setters */);
2040    /// ```
2041    pub fn set_pubsub_subscription<T>(mut self, v: T) -> Self
2042    where
2043        T: std::convert::Into<crate::model::PubSubSubscription>,
2044    {
2045        self.pubsub_subscription = std::option::Option::Some(v.into());
2046        self
2047    }
2048
2049    /// Sets or clears the value of [pubsub_subscription][crate::model::DestinationPubSubSubscription::pubsub_subscription].
2050    ///
2051    /// # Example
2052    /// ```ignore,no_run
2053    /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationPubSubSubscription;
2054    /// use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
2055    /// let x = DestinationPubSubSubscription::new().set_or_clear_pubsub_subscription(Some(PubSubSubscription::default()/* use setters */));
2056    /// let x = DestinationPubSubSubscription::new().set_or_clear_pubsub_subscription(None::<PubSubSubscription>);
2057    /// ```
2058    pub fn set_or_clear_pubsub_subscription<T>(mut self, v: std::option::Option<T>) -> Self
2059    where
2060        T: std::convert::Into<crate::model::PubSubSubscription>,
2061    {
2062        self.pubsub_subscription = v.map(|x| x.into());
2063        self
2064    }
2065}
2066
2067impl wkt::message::Message for DestinationPubSubSubscription {
2068    fn typename() -> &'static str {
2069        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DestinationPubSubSubscription"
2070    }
2071}
2072
2073/// A listing is what gets published into a data exchange that a subscriber can
2074/// subscribe to. It contains a reference to the data source along with
2075/// descriptive information that will help subscribers find and subscribe the
2076/// data.
2077#[derive(Clone, Default, PartialEq)]
2078#[non_exhaustive]
2079pub struct Listing {
2080    /// Output only. The resource name of the listing.
2081    /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`
2082    pub name: std::string::String,
2083
2084    /// Required. Human-readable display name of the listing. The display name must
2085    /// contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
2086    /// spaces ( ), ampersands (&) and can't start or end with spaces. Default
2087    /// value is an empty string. Max length: 63 bytes.
2088    pub display_name: std::string::String,
2089
2090    /// Optional. Short description of the listing. The description must not
2091    /// contain Unicode non-characters and C0 and C1 control codes except tabs
2092    /// (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default
2093    /// value is an empty string. Max length: 2000 bytes.
2094    pub description: std::string::String,
2095
2096    /// Optional. Email or URL of the primary point of contact of the listing.
2097    /// Max Length: 1000 bytes.
2098    pub primary_contact: std::string::String,
2099
2100    /// Optional. Documentation describing the listing.
2101    pub documentation: std::string::String,
2102
2103    /// Output only. Current state of the listing.
2104    pub state: crate::model::listing::State,
2105
2106    /// Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB
2107    /// Expected image dimensions are 512x512 pixels, however the API only
2108    /// performs validation on size of the encoded data.
2109    /// Note: For byte fields, the contents of the field are base64-encoded (which
2110    /// increases the size of the data by 33-36%) when using JSON on the wire.
2111    pub icon: ::bytes::Bytes,
2112
2113    /// Optional. Details of the data provider who owns the source data.
2114    pub data_provider: std::option::Option<crate::model::DataProvider>,
2115
2116    /// Optional. Categories of the listing. Up to five categories are allowed.
2117    pub categories: std::vec::Vec<crate::model::listing::Category>,
2118
2119    /// Optional. Details of the publisher who owns the listing and who can share
2120    /// the source data.
2121    pub publisher: std::option::Option<crate::model::Publisher>,
2122
2123    /// Optional. Email or URL of the request access of the listing.
2124    /// Subscribers can use this reference to request access.
2125    /// Max Length: 1000 bytes.
2126    pub request_access: std::string::String,
2127
2128    /// Optional. If set, restricted export configuration will be propagated and
2129    /// enforced on the linked dataset.
2130    pub restricted_export_config:
2131        std::option::Option<crate::model::listing::RestrictedExportConfig>,
2132
2133    /// Optional. If set, stored procedure configuration will be propagated and
2134    /// enforced on the linked dataset.
2135    pub stored_procedure_config: std::option::Option<crate::model::StoredProcedureConfig>,
2136
2137    /// Optional. Type of discovery of the listing on the discovery page.
2138    pub discovery_type: std::option::Option<crate::model::DiscoveryType>,
2139
2140    /// Output only. Listing shared asset type.
2141    pub resource_type: crate::model::SharedResourceType,
2142
2143    /// Output only. Commercial info contains the information about the commercial
2144    /// data products associated with the listing.
2145    pub commercial_info: std::option::Option<crate::model::listing::CommercialInfo>,
2146
2147    /// Optional. By default, false.
2148    /// If true, the Listing has an email sharing mandate enabled.
2149    pub log_linked_dataset_query_user_email: std::option::Option<bool>,
2150
2151    /// Optional. If true, the listing is only available to get the resource
2152    /// metadata. Listing is non subscribable.
2153    pub allow_only_metadata_sharing: std::option::Option<bool>,
2154
2155    /// Listing source.
2156    pub source: std::option::Option<crate::model::listing::Source>,
2157
2158    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2159}
2160
2161impl Listing {
2162    /// Creates a new default instance.
2163    pub fn new() -> Self {
2164        std::default::Default::default()
2165    }
2166
2167    /// Sets the value of [name][crate::model::Listing::name].
2168    ///
2169    /// # Example
2170    /// ```ignore,no_run
2171    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2172    /// # let project_id = "project_id";
2173    /// # let location_id = "location_id";
2174    /// # let data_exchange_id = "data_exchange_id";
2175    /// # let listing_id = "listing_id";
2176    /// let x = Listing::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}/listings/{listing_id}"));
2177    /// ```
2178    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2179        self.name = v.into();
2180        self
2181    }
2182
2183    /// Sets the value of [display_name][crate::model::Listing::display_name].
2184    ///
2185    /// # Example
2186    /// ```ignore,no_run
2187    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2188    /// let x = Listing::new().set_display_name("example");
2189    /// ```
2190    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2191        self.display_name = v.into();
2192        self
2193    }
2194
2195    /// Sets the value of [description][crate::model::Listing::description].
2196    ///
2197    /// # Example
2198    /// ```ignore,no_run
2199    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2200    /// let x = Listing::new().set_description("example");
2201    /// ```
2202    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2203        self.description = v.into();
2204        self
2205    }
2206
2207    /// Sets the value of [primary_contact][crate::model::Listing::primary_contact].
2208    ///
2209    /// # Example
2210    /// ```ignore,no_run
2211    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2212    /// let x = Listing::new().set_primary_contact("example");
2213    /// ```
2214    pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2215        self.primary_contact = v.into();
2216        self
2217    }
2218
2219    /// Sets the value of [documentation][crate::model::Listing::documentation].
2220    ///
2221    /// # Example
2222    /// ```ignore,no_run
2223    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2224    /// let x = Listing::new().set_documentation("example");
2225    /// ```
2226    pub fn set_documentation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2227        self.documentation = v.into();
2228        self
2229    }
2230
2231    /// Sets the value of [state][crate::model::Listing::state].
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::State;
2237    /// let x0 = Listing::new().set_state(State::Active);
2238    /// ```
2239    pub fn set_state<T: std::convert::Into<crate::model::listing::State>>(mut self, v: T) -> Self {
2240        self.state = v.into();
2241        self
2242    }
2243
2244    /// Sets the value of [icon][crate::model::Listing::icon].
2245    ///
2246    /// # Example
2247    /// ```ignore,no_run
2248    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2249    /// let x = Listing::new().set_icon(bytes::Bytes::from_static(b"example"));
2250    /// ```
2251    pub fn set_icon<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2252        self.icon = v.into();
2253        self
2254    }
2255
2256    /// Sets the value of [data_provider][crate::model::Listing::data_provider].
2257    ///
2258    /// # Example
2259    /// ```ignore,no_run
2260    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2261    /// use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
2262    /// let x = Listing::new().set_data_provider(DataProvider::default()/* use setters */);
2263    /// ```
2264    pub fn set_data_provider<T>(mut self, v: T) -> Self
2265    where
2266        T: std::convert::Into<crate::model::DataProvider>,
2267    {
2268        self.data_provider = std::option::Option::Some(v.into());
2269        self
2270    }
2271
2272    /// Sets or clears the value of [data_provider][crate::model::Listing::data_provider].
2273    ///
2274    /// # Example
2275    /// ```ignore,no_run
2276    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2277    /// use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
2278    /// let x = Listing::new().set_or_clear_data_provider(Some(DataProvider::default()/* use setters */));
2279    /// let x = Listing::new().set_or_clear_data_provider(None::<DataProvider>);
2280    /// ```
2281    pub fn set_or_clear_data_provider<T>(mut self, v: std::option::Option<T>) -> Self
2282    where
2283        T: std::convert::Into<crate::model::DataProvider>,
2284    {
2285        self.data_provider = v.map(|x| x.into());
2286        self
2287    }
2288
2289    /// Sets the value of [categories][crate::model::Listing::categories].
2290    ///
2291    /// # Example
2292    /// ```ignore,no_run
2293    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2294    /// use google_cloud_bigquery_analyticshub_v1::model::listing::Category;
2295    /// let x = Listing::new().set_categories([
2296    ///     Category::Others,
2297    ///     Category::AdvertisingAndMarketing,
2298    ///     Category::Commerce,
2299    /// ]);
2300    /// ```
2301    pub fn set_categories<T, V>(mut self, v: T) -> Self
2302    where
2303        T: std::iter::IntoIterator<Item = V>,
2304        V: std::convert::Into<crate::model::listing::Category>,
2305    {
2306        use std::iter::Iterator;
2307        self.categories = v.into_iter().map(|i| i.into()).collect();
2308        self
2309    }
2310
2311    /// Sets the value of [publisher][crate::model::Listing::publisher].
2312    ///
2313    /// # Example
2314    /// ```ignore,no_run
2315    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2316    /// use google_cloud_bigquery_analyticshub_v1::model::Publisher;
2317    /// let x = Listing::new().set_publisher(Publisher::default()/* use setters */);
2318    /// ```
2319    pub fn set_publisher<T>(mut self, v: T) -> Self
2320    where
2321        T: std::convert::Into<crate::model::Publisher>,
2322    {
2323        self.publisher = std::option::Option::Some(v.into());
2324        self
2325    }
2326
2327    /// Sets or clears the value of [publisher][crate::model::Listing::publisher].
2328    ///
2329    /// # Example
2330    /// ```ignore,no_run
2331    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2332    /// use google_cloud_bigquery_analyticshub_v1::model::Publisher;
2333    /// let x = Listing::new().set_or_clear_publisher(Some(Publisher::default()/* use setters */));
2334    /// let x = Listing::new().set_or_clear_publisher(None::<Publisher>);
2335    /// ```
2336    pub fn set_or_clear_publisher<T>(mut self, v: std::option::Option<T>) -> Self
2337    where
2338        T: std::convert::Into<crate::model::Publisher>,
2339    {
2340        self.publisher = v.map(|x| x.into());
2341        self
2342    }
2343
2344    /// Sets the value of [request_access][crate::model::Listing::request_access].
2345    ///
2346    /// # Example
2347    /// ```ignore,no_run
2348    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2349    /// let x = Listing::new().set_request_access("example");
2350    /// ```
2351    pub fn set_request_access<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2352        self.request_access = v.into();
2353        self
2354    }
2355
2356    /// Sets the value of [restricted_export_config][crate::model::Listing::restricted_export_config].
2357    ///
2358    /// # Example
2359    /// ```ignore,no_run
2360    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2361    /// use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
2362    /// let x = Listing::new().set_restricted_export_config(RestrictedExportConfig::default()/* use setters */);
2363    /// ```
2364    pub fn set_restricted_export_config<T>(mut self, v: T) -> Self
2365    where
2366        T: std::convert::Into<crate::model::listing::RestrictedExportConfig>,
2367    {
2368        self.restricted_export_config = std::option::Option::Some(v.into());
2369        self
2370    }
2371
2372    /// Sets or clears the value of [restricted_export_config][crate::model::Listing::restricted_export_config].
2373    ///
2374    /// # Example
2375    /// ```ignore,no_run
2376    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2377    /// use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
2378    /// let x = Listing::new().set_or_clear_restricted_export_config(Some(RestrictedExportConfig::default()/* use setters */));
2379    /// let x = Listing::new().set_or_clear_restricted_export_config(None::<RestrictedExportConfig>);
2380    /// ```
2381    pub fn set_or_clear_restricted_export_config<T>(mut self, v: std::option::Option<T>) -> Self
2382    where
2383        T: std::convert::Into<crate::model::listing::RestrictedExportConfig>,
2384    {
2385        self.restricted_export_config = v.map(|x| x.into());
2386        self
2387    }
2388
2389    /// Sets the value of [stored_procedure_config][crate::model::Listing::stored_procedure_config].
2390    ///
2391    /// # Example
2392    /// ```ignore,no_run
2393    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2394    /// use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
2395    /// let x = Listing::new().set_stored_procedure_config(StoredProcedureConfig::default()/* use setters */);
2396    /// ```
2397    pub fn set_stored_procedure_config<T>(mut self, v: T) -> Self
2398    where
2399        T: std::convert::Into<crate::model::StoredProcedureConfig>,
2400    {
2401        self.stored_procedure_config = std::option::Option::Some(v.into());
2402        self
2403    }
2404
2405    /// Sets or clears the value of [stored_procedure_config][crate::model::Listing::stored_procedure_config].
2406    ///
2407    /// # Example
2408    /// ```ignore,no_run
2409    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2410    /// use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
2411    /// let x = Listing::new().set_or_clear_stored_procedure_config(Some(StoredProcedureConfig::default()/* use setters */));
2412    /// let x = Listing::new().set_or_clear_stored_procedure_config(None::<StoredProcedureConfig>);
2413    /// ```
2414    pub fn set_or_clear_stored_procedure_config<T>(mut self, v: std::option::Option<T>) -> Self
2415    where
2416        T: std::convert::Into<crate::model::StoredProcedureConfig>,
2417    {
2418        self.stored_procedure_config = v.map(|x| x.into());
2419        self
2420    }
2421
2422    /// Sets the value of [discovery_type][crate::model::Listing::discovery_type].
2423    ///
2424    /// # Example
2425    /// ```ignore,no_run
2426    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2427    /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
2428    /// let x0 = Listing::new().set_discovery_type(DiscoveryType::Private);
2429    /// let x1 = Listing::new().set_discovery_type(DiscoveryType::Public);
2430    /// ```
2431    pub fn set_discovery_type<T>(mut self, v: T) -> Self
2432    where
2433        T: std::convert::Into<crate::model::DiscoveryType>,
2434    {
2435        self.discovery_type = std::option::Option::Some(v.into());
2436        self
2437    }
2438
2439    /// Sets or clears the value of [discovery_type][crate::model::Listing::discovery_type].
2440    ///
2441    /// # Example
2442    /// ```ignore,no_run
2443    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2444    /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
2445    /// let x0 = Listing::new().set_or_clear_discovery_type(Some(DiscoveryType::Private));
2446    /// let x1 = Listing::new().set_or_clear_discovery_type(Some(DiscoveryType::Public));
2447    /// let x_none = Listing::new().set_or_clear_discovery_type(None::<DiscoveryType>);
2448    /// ```
2449    pub fn set_or_clear_discovery_type<T>(mut self, v: std::option::Option<T>) -> Self
2450    where
2451        T: std::convert::Into<crate::model::DiscoveryType>,
2452    {
2453        self.discovery_type = v.map(|x| x.into());
2454        self
2455    }
2456
2457    /// Sets the value of [resource_type][crate::model::Listing::resource_type].
2458    ///
2459    /// # Example
2460    /// ```ignore,no_run
2461    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2462    /// use google_cloud_bigquery_analyticshub_v1::model::SharedResourceType;
2463    /// let x0 = Listing::new().set_resource_type(SharedResourceType::BigqueryDataset);
2464    /// let x1 = Listing::new().set_resource_type(SharedResourceType::PubsubTopic);
2465    /// ```
2466    pub fn set_resource_type<T: std::convert::Into<crate::model::SharedResourceType>>(
2467        mut self,
2468        v: T,
2469    ) -> Self {
2470        self.resource_type = v.into();
2471        self
2472    }
2473
2474    /// Sets the value of [commercial_info][crate::model::Listing::commercial_info].
2475    ///
2476    /// # Example
2477    /// ```ignore,no_run
2478    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2479    /// use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
2480    /// let x = Listing::new().set_commercial_info(CommercialInfo::default()/* use setters */);
2481    /// ```
2482    pub fn set_commercial_info<T>(mut self, v: T) -> Self
2483    where
2484        T: std::convert::Into<crate::model::listing::CommercialInfo>,
2485    {
2486        self.commercial_info = std::option::Option::Some(v.into());
2487        self
2488    }
2489
2490    /// Sets or clears the value of [commercial_info][crate::model::Listing::commercial_info].
2491    ///
2492    /// # Example
2493    /// ```ignore,no_run
2494    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2495    /// use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
2496    /// let x = Listing::new().set_or_clear_commercial_info(Some(CommercialInfo::default()/* use setters */));
2497    /// let x = Listing::new().set_or_clear_commercial_info(None::<CommercialInfo>);
2498    /// ```
2499    pub fn set_or_clear_commercial_info<T>(mut self, v: std::option::Option<T>) -> Self
2500    where
2501        T: std::convert::Into<crate::model::listing::CommercialInfo>,
2502    {
2503        self.commercial_info = v.map(|x| x.into());
2504        self
2505    }
2506
2507    /// Sets the value of [log_linked_dataset_query_user_email][crate::model::Listing::log_linked_dataset_query_user_email].
2508    ///
2509    /// # Example
2510    /// ```ignore,no_run
2511    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2512    /// let x = Listing::new().set_log_linked_dataset_query_user_email(true);
2513    /// ```
2514    pub fn set_log_linked_dataset_query_user_email<T>(mut self, v: T) -> Self
2515    where
2516        T: std::convert::Into<bool>,
2517    {
2518        self.log_linked_dataset_query_user_email = std::option::Option::Some(v.into());
2519        self
2520    }
2521
2522    /// Sets or clears the value of [log_linked_dataset_query_user_email][crate::model::Listing::log_linked_dataset_query_user_email].
2523    ///
2524    /// # Example
2525    /// ```ignore,no_run
2526    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2527    /// let x = Listing::new().set_or_clear_log_linked_dataset_query_user_email(Some(false));
2528    /// let x = Listing::new().set_or_clear_log_linked_dataset_query_user_email(None::<bool>);
2529    /// ```
2530    pub fn set_or_clear_log_linked_dataset_query_user_email<T>(
2531        mut self,
2532        v: std::option::Option<T>,
2533    ) -> Self
2534    where
2535        T: std::convert::Into<bool>,
2536    {
2537        self.log_linked_dataset_query_user_email = v.map(|x| x.into());
2538        self
2539    }
2540
2541    /// Sets the value of [allow_only_metadata_sharing][crate::model::Listing::allow_only_metadata_sharing].
2542    ///
2543    /// # Example
2544    /// ```ignore,no_run
2545    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2546    /// let x = Listing::new().set_allow_only_metadata_sharing(true);
2547    /// ```
2548    pub fn set_allow_only_metadata_sharing<T>(mut self, v: T) -> Self
2549    where
2550        T: std::convert::Into<bool>,
2551    {
2552        self.allow_only_metadata_sharing = std::option::Option::Some(v.into());
2553        self
2554    }
2555
2556    /// Sets or clears the value of [allow_only_metadata_sharing][crate::model::Listing::allow_only_metadata_sharing].
2557    ///
2558    /// # Example
2559    /// ```ignore,no_run
2560    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2561    /// let x = Listing::new().set_or_clear_allow_only_metadata_sharing(Some(false));
2562    /// let x = Listing::new().set_or_clear_allow_only_metadata_sharing(None::<bool>);
2563    /// ```
2564    pub fn set_or_clear_allow_only_metadata_sharing<T>(mut self, v: std::option::Option<T>) -> Self
2565    where
2566        T: std::convert::Into<bool>,
2567    {
2568        self.allow_only_metadata_sharing = v.map(|x| x.into());
2569        self
2570    }
2571
2572    /// Sets the value of [source][crate::model::Listing::source].
2573    ///
2574    /// Note that all the setters affecting `source` are mutually
2575    /// exclusive.
2576    ///
2577    /// # Example
2578    /// ```ignore,no_run
2579    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2580    /// use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2581    /// let x = Listing::new().set_source(Some(
2582    ///     google_cloud_bigquery_analyticshub_v1::model::listing::Source::BigqueryDataset(BigQueryDatasetSource::default().into())));
2583    /// ```
2584    pub fn set_source<T: std::convert::Into<std::option::Option<crate::model::listing::Source>>>(
2585        mut self,
2586        v: T,
2587    ) -> Self {
2588        self.source = v.into();
2589        self
2590    }
2591
2592    /// The value of [source][crate::model::Listing::source]
2593    /// if it holds a `BigqueryDataset`, `None` if the field is not set or
2594    /// holds a different branch.
2595    pub fn bigquery_dataset(
2596        &self,
2597    ) -> std::option::Option<&std::boxed::Box<crate::model::listing::BigQueryDatasetSource>> {
2598        #[allow(unreachable_patterns)]
2599        self.source.as_ref().and_then(|v| match v {
2600            crate::model::listing::Source::BigqueryDataset(v) => std::option::Option::Some(v),
2601            _ => std::option::Option::None,
2602        })
2603    }
2604
2605    /// Sets the value of [source][crate::model::Listing::source]
2606    /// to hold a `BigqueryDataset`.
2607    ///
2608    /// Note that all the setters affecting `source` are
2609    /// mutually exclusive.
2610    ///
2611    /// # Example
2612    /// ```ignore,no_run
2613    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2614    /// use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2615    /// let x = Listing::new().set_bigquery_dataset(BigQueryDatasetSource::default()/* use setters */);
2616    /// assert!(x.bigquery_dataset().is_some());
2617    /// assert!(x.pubsub_topic().is_none());
2618    /// ```
2619    pub fn set_bigquery_dataset<
2620        T: std::convert::Into<std::boxed::Box<crate::model::listing::BigQueryDatasetSource>>,
2621    >(
2622        mut self,
2623        v: T,
2624    ) -> Self {
2625        self.source =
2626            std::option::Option::Some(crate::model::listing::Source::BigqueryDataset(v.into()));
2627        self
2628    }
2629
2630    /// The value of [source][crate::model::Listing::source]
2631    /// if it holds a `PubsubTopic`, `None` if the field is not set or
2632    /// holds a different branch.
2633    pub fn pubsub_topic(
2634        &self,
2635    ) -> std::option::Option<&std::boxed::Box<crate::model::listing::PubSubTopicSource>> {
2636        #[allow(unreachable_patterns)]
2637        self.source.as_ref().and_then(|v| match v {
2638            crate::model::listing::Source::PubsubTopic(v) => std::option::Option::Some(v),
2639            _ => std::option::Option::None,
2640        })
2641    }
2642
2643    /// Sets the value of [source][crate::model::Listing::source]
2644    /// to hold a `PubsubTopic`.
2645    ///
2646    /// Note that all the setters affecting `source` are
2647    /// mutually exclusive.
2648    ///
2649    /// # Example
2650    /// ```ignore,no_run
2651    /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2652    /// use google_cloud_bigquery_analyticshub_v1::model::listing::PubSubTopicSource;
2653    /// let x = Listing::new().set_pubsub_topic(PubSubTopicSource::default()/* use setters */);
2654    /// assert!(x.pubsub_topic().is_some());
2655    /// assert!(x.bigquery_dataset().is_none());
2656    /// ```
2657    pub fn set_pubsub_topic<
2658        T: std::convert::Into<std::boxed::Box<crate::model::listing::PubSubTopicSource>>,
2659    >(
2660        mut self,
2661        v: T,
2662    ) -> Self {
2663        self.source =
2664            std::option::Option::Some(crate::model::listing::Source::PubsubTopic(v.into()));
2665        self
2666    }
2667}
2668
2669impl wkt::message::Message for Listing {
2670    fn typename() -> &'static str {
2671        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing"
2672    }
2673}
2674
2675/// Defines additional types related to [Listing].
2676pub mod listing {
2677    #[allow(unused_imports)]
2678    use super::*;
2679
2680    /// A reference to a shared dataset. It is an existing BigQuery dataset with a
2681    /// collection of objects such as tables and views that you want to share
2682    /// with subscribers.
2683    /// When subscriber's subscribe to a listing, Analytics Hub creates a linked
2684    /// dataset in
2685    /// the subscriber's project. A Linked dataset is an opaque, read-only BigQuery
2686    /// dataset that serves as a _symbolic link_ to a shared dataset.
2687    #[derive(Clone, Default, PartialEq)]
2688    #[non_exhaustive]
2689    pub struct BigQueryDatasetSource {
2690        /// Optional. Resource name of the dataset source for this listing.
2691        /// e.g. `projects/myproject/datasets/123`
2692        pub dataset: std::string::String,
2693
2694        /// Optional. Resource in this dataset that is selectively shared.
2695        /// This field is required for data clean room exchanges.
2696        pub selected_resources:
2697            std::vec::Vec<crate::model::listing::big_query_dataset_source::SelectedResource>,
2698
2699        /// Optional. If set, restricted export policy will be propagated and
2700        /// enforced on the linked dataset.
2701        pub restricted_export_policy: std::option::Option<
2702            crate::model::listing::big_query_dataset_source::RestrictedExportPolicy,
2703        >,
2704
2705        /// Optional. A list of regions where the publisher has created shared
2706        /// dataset replicas.
2707        pub replica_locations: std::vec::Vec<std::string::String>,
2708
2709        /// Output only. Server-owned effective state of replicas.
2710        /// Contains both primary and secondary replicas.
2711        /// Each replica includes a system-computed (output-only) state and primary
2712        /// designation.
2713        pub effective_replicas:
2714            std::vec::Vec<crate::model::listing::big_query_dataset_source::Replica>,
2715
2716        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2717    }
2718
2719    impl BigQueryDatasetSource {
2720        /// Creates a new default instance.
2721        pub fn new() -> Self {
2722            std::default::Default::default()
2723        }
2724
2725        /// Sets the value of [dataset][crate::model::listing::BigQueryDatasetSource::dataset].
2726        ///
2727        /// # Example
2728        /// ```ignore,no_run
2729        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2730        /// let x = BigQueryDatasetSource::new().set_dataset("example");
2731        /// ```
2732        pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2733            self.dataset = v.into();
2734            self
2735        }
2736
2737        /// Sets the value of [selected_resources][crate::model::listing::BigQueryDatasetSource::selected_resources].
2738        ///
2739        /// # Example
2740        /// ```ignore,no_run
2741        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2742        /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2743        /// let x = BigQueryDatasetSource::new()
2744        ///     .set_selected_resources([
2745        ///         SelectedResource::default()/* use setters */,
2746        ///         SelectedResource::default()/* use (different) setters */,
2747        ///     ]);
2748        /// ```
2749        pub fn set_selected_resources<T, V>(mut self, v: T) -> Self
2750        where
2751            T: std::iter::IntoIterator<Item = V>,
2752            V: std::convert::Into<
2753                    crate::model::listing::big_query_dataset_source::SelectedResource,
2754                >,
2755        {
2756            use std::iter::Iterator;
2757            self.selected_resources = v.into_iter().map(|i| i.into()).collect();
2758            self
2759        }
2760
2761        /// Sets the value of [restricted_export_policy][crate::model::listing::BigQueryDatasetSource::restricted_export_policy].
2762        ///
2763        /// # Example
2764        /// ```ignore,no_run
2765        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2766        /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2767        /// let x = BigQueryDatasetSource::new().set_restricted_export_policy(RestrictedExportPolicy::default()/* use setters */);
2768        /// ```
2769        pub fn set_restricted_export_policy<T>(mut self, v: T) -> Self
2770        where
2771            T: std::convert::Into<
2772                    crate::model::listing::big_query_dataset_source::RestrictedExportPolicy,
2773                >,
2774        {
2775            self.restricted_export_policy = std::option::Option::Some(v.into());
2776            self
2777        }
2778
2779        /// Sets or clears the value of [restricted_export_policy][crate::model::listing::BigQueryDatasetSource::restricted_export_policy].
2780        ///
2781        /// # Example
2782        /// ```ignore,no_run
2783        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2784        /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2785        /// let x = BigQueryDatasetSource::new().set_or_clear_restricted_export_policy(Some(RestrictedExportPolicy::default()/* use setters */));
2786        /// let x = BigQueryDatasetSource::new().set_or_clear_restricted_export_policy(None::<RestrictedExportPolicy>);
2787        /// ```
2788        pub fn set_or_clear_restricted_export_policy<T>(mut self, v: std::option::Option<T>) -> Self
2789        where
2790            T: std::convert::Into<
2791                    crate::model::listing::big_query_dataset_source::RestrictedExportPolicy,
2792                >,
2793        {
2794            self.restricted_export_policy = v.map(|x| x.into());
2795            self
2796        }
2797
2798        /// Sets the value of [replica_locations][crate::model::listing::BigQueryDatasetSource::replica_locations].
2799        ///
2800        /// # Example
2801        /// ```ignore,no_run
2802        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2803        /// let x = BigQueryDatasetSource::new().set_replica_locations(["a", "b", "c"]);
2804        /// ```
2805        pub fn set_replica_locations<T, V>(mut self, v: T) -> Self
2806        where
2807            T: std::iter::IntoIterator<Item = V>,
2808            V: std::convert::Into<std::string::String>,
2809        {
2810            use std::iter::Iterator;
2811            self.replica_locations = v.into_iter().map(|i| i.into()).collect();
2812            self
2813        }
2814
2815        /// Sets the value of [effective_replicas][crate::model::listing::BigQueryDatasetSource::effective_replicas].
2816        ///
2817        /// # Example
2818        /// ```ignore,no_run
2819        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2820        /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
2821        /// let x = BigQueryDatasetSource::new()
2822        ///     .set_effective_replicas([
2823        ///         Replica::default()/* use setters */,
2824        ///         Replica::default()/* use (different) setters */,
2825        ///     ]);
2826        /// ```
2827        pub fn set_effective_replicas<T, V>(mut self, v: T) -> Self
2828        where
2829            T: std::iter::IntoIterator<Item = V>,
2830            V: std::convert::Into<crate::model::listing::big_query_dataset_source::Replica>,
2831        {
2832            use std::iter::Iterator;
2833            self.effective_replicas = v.into_iter().map(|i| i.into()).collect();
2834            self
2835        }
2836    }
2837
2838    impl wkt::message::Message for BigQueryDatasetSource {
2839        fn typename() -> &'static str {
2840            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource"
2841        }
2842    }
2843
2844    /// Defines additional types related to [BigQueryDatasetSource].
2845    pub mod big_query_dataset_source {
2846        #[allow(unused_imports)]
2847        use super::*;
2848
2849        /// Resource in this dataset that is selectively shared.
2850        #[derive(Clone, Default, PartialEq)]
2851        #[non_exhaustive]
2852        pub struct SelectedResource {
2853            #[allow(missing_docs)]
2854            pub resource: std::option::Option<
2855                crate::model::listing::big_query_dataset_source::selected_resource::Resource,
2856            >,
2857
2858            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2859        }
2860
2861        impl SelectedResource {
2862            /// Creates a new default instance.
2863            pub fn new() -> Self {
2864                std::default::Default::default()
2865            }
2866
2867            /// Sets the value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource].
2868            ///
2869            /// Note that all the setters affecting `resource` are mutually
2870            /// exclusive.
2871            ///
2872            /// # Example
2873            /// ```ignore,no_run
2874            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2875            /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::selected_resource::Resource;
2876            /// let x = SelectedResource::new().set_resource(Some(Resource::Table("example".to_string())));
2877            /// ```
2878            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
2879            {
2880                self.resource = v.into();
2881                self
2882            }
2883
2884            /// The value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2885            /// if it holds a `Table`, `None` if the field is not set or
2886            /// holds a different branch.
2887            pub fn table(&self) -> std::option::Option<&std::string::String> {
2888                #[allow(unreachable_patterns)]
2889                self.resource.as_ref().and_then(|v| match v {
2890                    crate::model::listing::big_query_dataset_source::selected_resource::Resource::Table(v) => std::option::Option::Some(v),
2891                    _ => std::option::Option::None,
2892                })
2893            }
2894
2895            /// Sets the value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2896            /// to hold a `Table`.
2897            ///
2898            /// Note that all the setters affecting `resource` are
2899            /// mutually exclusive.
2900            ///
2901            /// # Example
2902            /// ```ignore,no_run
2903            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2904            /// let x = SelectedResource::new().set_table("example");
2905            /// assert!(x.table().is_some());
2906            /// assert!(x.routine().is_none());
2907            /// ```
2908            pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2909                self.resource = std::option::Option::Some(
2910                    crate::model::listing::big_query_dataset_source::selected_resource::Resource::Table(
2911                        v.into()
2912                    )
2913                );
2914                self
2915            }
2916
2917            /// The value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2918            /// if it holds a `Routine`, `None` if the field is not set or
2919            /// holds a different branch.
2920            pub fn routine(&self) -> std::option::Option<&std::string::String> {
2921                #[allow(unreachable_patterns)]
2922                self.resource.as_ref().and_then(|v| match v {
2923                    crate::model::listing::big_query_dataset_source::selected_resource::Resource::Routine(v) => std::option::Option::Some(v),
2924                    _ => std::option::Option::None,
2925                })
2926            }
2927
2928            /// Sets the value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2929            /// to hold a `Routine`.
2930            ///
2931            /// Note that all the setters affecting `resource` are
2932            /// mutually exclusive.
2933            ///
2934            /// # Example
2935            /// ```ignore,no_run
2936            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2937            /// let x = SelectedResource::new().set_routine("example");
2938            /// assert!(x.routine().is_some());
2939            /// assert!(x.table().is_none());
2940            /// ```
2941            pub fn set_routine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2942                self.resource = std::option::Option::Some(
2943                    crate::model::listing::big_query_dataset_source::selected_resource::Resource::Routine(
2944                        v.into()
2945                    )
2946                );
2947                self
2948            }
2949        }
2950
2951        impl wkt::message::Message for SelectedResource {
2952            fn typename() -> &'static str {
2953                "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.SelectedResource"
2954            }
2955        }
2956
2957        /// Defines additional types related to [SelectedResource].
2958        pub mod selected_resource {
2959            #[allow(unused_imports)]
2960            use super::*;
2961
2962            #[allow(missing_docs)]
2963            #[derive(Clone, Debug, PartialEq)]
2964            #[non_exhaustive]
2965            pub enum Resource {
2966                /// Optional. Format:
2967                /// For table:
2968                /// `projects/{projectId}/datasets/{datasetId}/tables/{tableId}`
2969                /// Example:"projects/test_project/datasets/test_dataset/tables/test_table"
2970                Table(std::string::String),
2971                /// Optional. Format:
2972                /// For routine:
2973                /// `projects/{projectId}/datasets/{datasetId}/routines/{routineId}`
2974                /// Example:"projects/test_project/datasets/test_dataset/routines/test_routine"
2975                Routine(std::string::String),
2976            }
2977        }
2978
2979        /// Restricted export policy used to configure restricted export on linked
2980        /// dataset.
2981        #[derive(Clone, Default, PartialEq)]
2982        #[non_exhaustive]
2983        pub struct RestrictedExportPolicy {
2984            /// Optional. If true, enable restricted export.
2985            pub enabled: std::option::Option<wkt::BoolValue>,
2986
2987            /// Optional. If true, restrict direct table access (read
2988            /// api/tabledata.list) on linked table.
2989            pub restrict_direct_table_access: std::option::Option<wkt::BoolValue>,
2990
2991            /// Optional. If true, restrict export of query result derived from
2992            /// restricted linked dataset table.
2993            pub restrict_query_result: std::option::Option<wkt::BoolValue>,
2994
2995            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2996        }
2997
2998        impl RestrictedExportPolicy {
2999            /// Creates a new default instance.
3000            pub fn new() -> Self {
3001                std::default::Default::default()
3002            }
3003
3004            /// Sets the value of [enabled][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::enabled].
3005            ///
3006            /// # Example
3007            /// ```ignore,no_run
3008            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
3009            /// use wkt::BoolValue;
3010            /// let x = RestrictedExportPolicy::new().set_enabled(BoolValue::default()/* use setters */);
3011            /// ```
3012            pub fn set_enabled<T>(mut self, v: T) -> Self
3013            where
3014                T: std::convert::Into<wkt::BoolValue>,
3015            {
3016                self.enabled = std::option::Option::Some(v.into());
3017                self
3018            }
3019
3020            /// Sets or clears the value of [enabled][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::enabled].
3021            ///
3022            /// # Example
3023            /// ```ignore,no_run
3024            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
3025            /// use wkt::BoolValue;
3026            /// let x = RestrictedExportPolicy::new().set_or_clear_enabled(Some(BoolValue::default()/* use setters */));
3027            /// let x = RestrictedExportPolicy::new().set_or_clear_enabled(None::<BoolValue>);
3028            /// ```
3029            pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
3030            where
3031                T: std::convert::Into<wkt::BoolValue>,
3032            {
3033                self.enabled = v.map(|x| x.into());
3034                self
3035            }
3036
3037            /// Sets the value of [restrict_direct_table_access][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_direct_table_access].
3038            ///
3039            /// # Example
3040            /// ```ignore,no_run
3041            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
3042            /// use wkt::BoolValue;
3043            /// let x = RestrictedExportPolicy::new().set_restrict_direct_table_access(BoolValue::default()/* use setters */);
3044            /// ```
3045            pub fn set_restrict_direct_table_access<T>(mut self, v: T) -> Self
3046            where
3047                T: std::convert::Into<wkt::BoolValue>,
3048            {
3049                self.restrict_direct_table_access = std::option::Option::Some(v.into());
3050                self
3051            }
3052
3053            /// Sets or clears the value of [restrict_direct_table_access][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_direct_table_access].
3054            ///
3055            /// # Example
3056            /// ```ignore,no_run
3057            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
3058            /// use wkt::BoolValue;
3059            /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_direct_table_access(Some(BoolValue::default()/* use setters */));
3060            /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_direct_table_access(None::<BoolValue>);
3061            /// ```
3062            pub fn set_or_clear_restrict_direct_table_access<T>(
3063                mut self,
3064                v: std::option::Option<T>,
3065            ) -> Self
3066            where
3067                T: std::convert::Into<wkt::BoolValue>,
3068            {
3069                self.restrict_direct_table_access = v.map(|x| x.into());
3070                self
3071            }
3072
3073            /// Sets the value of [restrict_query_result][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_query_result].
3074            ///
3075            /// # Example
3076            /// ```ignore,no_run
3077            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
3078            /// use wkt::BoolValue;
3079            /// let x = RestrictedExportPolicy::new().set_restrict_query_result(BoolValue::default()/* use setters */);
3080            /// ```
3081            pub fn set_restrict_query_result<T>(mut self, v: T) -> Self
3082            where
3083                T: std::convert::Into<wkt::BoolValue>,
3084            {
3085                self.restrict_query_result = std::option::Option::Some(v.into());
3086                self
3087            }
3088
3089            /// Sets or clears the value of [restrict_query_result][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_query_result].
3090            ///
3091            /// # Example
3092            /// ```ignore,no_run
3093            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
3094            /// use wkt::BoolValue;
3095            /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_query_result(Some(BoolValue::default()/* use setters */));
3096            /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_query_result(None::<BoolValue>);
3097            /// ```
3098            pub fn set_or_clear_restrict_query_result<T>(
3099                mut self,
3100                v: std::option::Option<T>,
3101            ) -> Self
3102            where
3103                T: std::convert::Into<wkt::BoolValue>,
3104            {
3105                self.restrict_query_result = v.map(|x| x.into());
3106                self
3107            }
3108        }
3109
3110        impl wkt::message::Message for RestrictedExportPolicy {
3111            fn typename() -> &'static str {
3112                "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.RestrictedExportPolicy"
3113            }
3114        }
3115
3116        /// Represents the state of a replica of a shared dataset.
3117        /// It includes the geographic location of the replica and
3118        /// system-computed, output-only fields indicating its replication state and
3119        /// whether it is the primary replica.
3120        #[derive(Clone, Default, PartialEq)]
3121        #[non_exhaustive]
3122        pub struct Replica {
3123            /// Output only. The geographic location where the replica resides. See
3124            /// [BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
3125            /// for supported locations. Eg. "us-central1".
3126            pub location: std::string::String,
3127
3128            /// Output only. Assigned by Analytics Hub based on real BigQuery
3129            /// replication state.
3130            pub replica_state:
3131                crate::model::listing::big_query_dataset_source::replica::ReplicaState,
3132
3133            /// Output only. Indicates that this replica is the primary replica.
3134            pub primary_state: std::option::Option<
3135                crate::model::listing::big_query_dataset_source::replica::PrimaryState,
3136            >,
3137
3138            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3139        }
3140
3141        impl Replica {
3142            /// Creates a new default instance.
3143            pub fn new() -> Self {
3144                std::default::Default::default()
3145            }
3146
3147            /// Sets the value of [location][crate::model::listing::big_query_dataset_source::Replica::location].
3148            ///
3149            /// # Example
3150            /// ```ignore,no_run
3151            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3152            /// let x = Replica::new().set_location("example");
3153            /// ```
3154            pub fn set_location<T: std::convert::Into<std::string::String>>(
3155                mut self,
3156                v: T,
3157            ) -> Self {
3158                self.location = v.into();
3159                self
3160            }
3161
3162            /// Sets the value of [replica_state][crate::model::listing::big_query_dataset_source::Replica::replica_state].
3163            ///
3164            /// # Example
3165            /// ```ignore,no_run
3166            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3167            /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::replica::ReplicaState;
3168            /// let x0 = Replica::new().set_replica_state(ReplicaState::ReadyToUse);
3169            /// let x1 = Replica::new().set_replica_state(ReplicaState::Unavailable);
3170            /// ```
3171            pub fn set_replica_state<
3172                T: std::convert::Into<
3173                        crate::model::listing::big_query_dataset_source::replica::ReplicaState,
3174                    >,
3175            >(
3176                mut self,
3177                v: T,
3178            ) -> Self {
3179                self.replica_state = v.into();
3180                self
3181            }
3182
3183            /// Sets the value of [primary_state][crate::model::listing::big_query_dataset_source::Replica::primary_state].
3184            ///
3185            /// # Example
3186            /// ```ignore,no_run
3187            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3188            /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::replica::PrimaryState;
3189            /// let x0 = Replica::new().set_primary_state(PrimaryState::PrimaryReplica);
3190            /// ```
3191            pub fn set_primary_state<T>(mut self, v: T) -> Self
3192            where
3193                T: std::convert::Into<
3194                        crate::model::listing::big_query_dataset_source::replica::PrimaryState,
3195                    >,
3196            {
3197                self.primary_state = std::option::Option::Some(v.into());
3198                self
3199            }
3200
3201            /// Sets or clears the value of [primary_state][crate::model::listing::big_query_dataset_source::Replica::primary_state].
3202            ///
3203            /// # Example
3204            /// ```ignore,no_run
3205            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3206            /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::replica::PrimaryState;
3207            /// let x0 = Replica::new().set_or_clear_primary_state(Some(PrimaryState::PrimaryReplica));
3208            /// let x_none = Replica::new().set_or_clear_primary_state(None::<PrimaryState>);
3209            /// ```
3210            pub fn set_or_clear_primary_state<T>(mut self, v: std::option::Option<T>) -> Self
3211            where
3212                T: std::convert::Into<
3213                        crate::model::listing::big_query_dataset_source::replica::PrimaryState,
3214                    >,
3215            {
3216                self.primary_state = v.map(|x| x.into());
3217                self
3218            }
3219        }
3220
3221        impl wkt::message::Message for Replica {
3222            fn typename() -> &'static str {
3223                "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica"
3224            }
3225        }
3226
3227        /// Defines additional types related to [Replica].
3228        pub mod replica {
3229            #[allow(unused_imports)]
3230            use super::*;
3231
3232            /// Replica state of the shared dataset.
3233            ///
3234            /// # Working with unknown values
3235            ///
3236            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3237            /// additional enum variants at any time. Adding new variants is not considered
3238            /// a breaking change. Applications should write their code in anticipation of:
3239            ///
3240            /// - New values appearing in future releases of the client library, **and**
3241            /// - New values received dynamically, without application changes.
3242            ///
3243            /// Please consult the [Working with enums] section in the user guide for some
3244            /// guidelines.
3245            ///
3246            /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3247            #[derive(Clone, Debug, PartialEq)]
3248            #[non_exhaustive]
3249            pub enum ReplicaState {
3250                /// Default value. This value is unused.
3251                Unspecified,
3252                /// The replica is backfilled and ready to use.
3253                ReadyToUse,
3254                /// The replica is unavailable, does not exist, or has not been
3255                /// backfilled yet.
3256                Unavailable,
3257                /// If set, the enum was initialized with an unknown value.
3258                ///
3259                /// Applications can examine the value using [ReplicaState::value] or
3260                /// [ReplicaState::name].
3261                UnknownValue(replica_state::UnknownValue),
3262            }
3263
3264            #[doc(hidden)]
3265            pub mod replica_state {
3266                #[allow(unused_imports)]
3267                use super::*;
3268                #[derive(Clone, Debug, PartialEq)]
3269                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3270            }
3271
3272            impl ReplicaState {
3273                /// Gets the enum value.
3274                ///
3275                /// Returns `None` if the enum contains an unknown value deserialized from
3276                /// the string representation of enums.
3277                pub fn value(&self) -> std::option::Option<i32> {
3278                    match self {
3279                        Self::Unspecified => std::option::Option::Some(0),
3280                        Self::ReadyToUse => std::option::Option::Some(1),
3281                        Self::Unavailable => std::option::Option::Some(2),
3282                        Self::UnknownValue(u) => u.0.value(),
3283                    }
3284                }
3285
3286                /// Gets the enum value as a string.
3287                ///
3288                /// Returns `None` if the enum contains an unknown value deserialized from
3289                /// the integer representation of enums.
3290                pub fn name(&self) -> std::option::Option<&str> {
3291                    match self {
3292                        Self::Unspecified => std::option::Option::Some("REPLICA_STATE_UNSPECIFIED"),
3293                        Self::ReadyToUse => std::option::Option::Some("READY_TO_USE"),
3294                        Self::Unavailable => std::option::Option::Some("UNAVAILABLE"),
3295                        Self::UnknownValue(u) => u.0.name(),
3296                    }
3297                }
3298            }
3299
3300            impl std::default::Default for ReplicaState {
3301                fn default() -> Self {
3302                    use std::convert::From;
3303                    Self::from(0)
3304                }
3305            }
3306
3307            impl std::fmt::Display for ReplicaState {
3308                fn fmt(
3309                    &self,
3310                    f: &mut std::fmt::Formatter<'_>,
3311                ) -> std::result::Result<(), std::fmt::Error> {
3312                    wkt::internal::display_enum(f, self.name(), self.value())
3313                }
3314            }
3315
3316            impl std::convert::From<i32> for ReplicaState {
3317                fn from(value: i32) -> Self {
3318                    match value {
3319                        0 => Self::Unspecified,
3320                        1 => Self::ReadyToUse,
3321                        2 => Self::Unavailable,
3322                        _ => Self::UnknownValue(replica_state::UnknownValue(
3323                            wkt::internal::UnknownEnumValue::Integer(value),
3324                        )),
3325                    }
3326                }
3327            }
3328
3329            impl std::convert::From<&str> for ReplicaState {
3330                fn from(value: &str) -> Self {
3331                    use std::string::ToString;
3332                    match value {
3333                        "REPLICA_STATE_UNSPECIFIED" => Self::Unspecified,
3334                        "READY_TO_USE" => Self::ReadyToUse,
3335                        "UNAVAILABLE" => Self::Unavailable,
3336                        _ => Self::UnknownValue(replica_state::UnknownValue(
3337                            wkt::internal::UnknownEnumValue::String(value.to_string()),
3338                        )),
3339                    }
3340                }
3341            }
3342
3343            impl serde::ser::Serialize for ReplicaState {
3344                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3345                where
3346                    S: serde::Serializer,
3347                {
3348                    match self {
3349                        Self::Unspecified => serializer.serialize_i32(0),
3350                        Self::ReadyToUse => serializer.serialize_i32(1),
3351                        Self::Unavailable => serializer.serialize_i32(2),
3352                        Self::UnknownValue(u) => u.0.serialize(serializer),
3353                    }
3354                }
3355            }
3356
3357            impl<'de> serde::de::Deserialize<'de> for ReplicaState {
3358                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3359                where
3360                    D: serde::Deserializer<'de>,
3361                {
3362                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicaState>::new(
3363                        ".google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.ReplicaState"))
3364                }
3365            }
3366
3367            /// Primary state of the replica. Set only for the primary replica.
3368            ///
3369            /// # Working with unknown values
3370            ///
3371            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3372            /// additional enum variants at any time. Adding new variants is not considered
3373            /// a breaking change. Applications should write their code in anticipation of:
3374            ///
3375            /// - New values appearing in future releases of the client library, **and**
3376            /// - New values received dynamically, without application changes.
3377            ///
3378            /// Please consult the [Working with enums] section in the user guide for some
3379            /// guidelines.
3380            ///
3381            /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3382            #[derive(Clone, Debug, PartialEq)]
3383            #[non_exhaustive]
3384            pub enum PrimaryState {
3385                /// Default value. This value is unused.
3386                Unspecified,
3387                /// The replica is the primary replica.
3388                PrimaryReplica,
3389                /// If set, the enum was initialized with an unknown value.
3390                ///
3391                /// Applications can examine the value using [PrimaryState::value] or
3392                /// [PrimaryState::name].
3393                UnknownValue(primary_state::UnknownValue),
3394            }
3395
3396            #[doc(hidden)]
3397            pub mod primary_state {
3398                #[allow(unused_imports)]
3399                use super::*;
3400                #[derive(Clone, Debug, PartialEq)]
3401                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3402            }
3403
3404            impl PrimaryState {
3405                /// Gets the enum value.
3406                ///
3407                /// Returns `None` if the enum contains an unknown value deserialized from
3408                /// the string representation of enums.
3409                pub fn value(&self) -> std::option::Option<i32> {
3410                    match self {
3411                        Self::Unspecified => std::option::Option::Some(0),
3412                        Self::PrimaryReplica => std::option::Option::Some(1),
3413                        Self::UnknownValue(u) => u.0.value(),
3414                    }
3415                }
3416
3417                /// Gets the enum value as a string.
3418                ///
3419                /// Returns `None` if the enum contains an unknown value deserialized from
3420                /// the integer representation of enums.
3421                pub fn name(&self) -> std::option::Option<&str> {
3422                    match self {
3423                        Self::Unspecified => std::option::Option::Some("PRIMARY_STATE_UNSPECIFIED"),
3424                        Self::PrimaryReplica => std::option::Option::Some("PRIMARY_REPLICA"),
3425                        Self::UnknownValue(u) => u.0.name(),
3426                    }
3427                }
3428            }
3429
3430            impl std::default::Default for PrimaryState {
3431                fn default() -> Self {
3432                    use std::convert::From;
3433                    Self::from(0)
3434                }
3435            }
3436
3437            impl std::fmt::Display for PrimaryState {
3438                fn fmt(
3439                    &self,
3440                    f: &mut std::fmt::Formatter<'_>,
3441                ) -> std::result::Result<(), std::fmt::Error> {
3442                    wkt::internal::display_enum(f, self.name(), self.value())
3443                }
3444            }
3445
3446            impl std::convert::From<i32> for PrimaryState {
3447                fn from(value: i32) -> Self {
3448                    match value {
3449                        0 => Self::Unspecified,
3450                        1 => Self::PrimaryReplica,
3451                        _ => Self::UnknownValue(primary_state::UnknownValue(
3452                            wkt::internal::UnknownEnumValue::Integer(value),
3453                        )),
3454                    }
3455                }
3456            }
3457
3458            impl std::convert::From<&str> for PrimaryState {
3459                fn from(value: &str) -> Self {
3460                    use std::string::ToString;
3461                    match value {
3462                        "PRIMARY_STATE_UNSPECIFIED" => Self::Unspecified,
3463                        "PRIMARY_REPLICA" => Self::PrimaryReplica,
3464                        _ => Self::UnknownValue(primary_state::UnknownValue(
3465                            wkt::internal::UnknownEnumValue::String(value.to_string()),
3466                        )),
3467                    }
3468                }
3469            }
3470
3471            impl serde::ser::Serialize for PrimaryState {
3472                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3473                where
3474                    S: serde::Serializer,
3475                {
3476                    match self {
3477                        Self::Unspecified => serializer.serialize_i32(0),
3478                        Self::PrimaryReplica => serializer.serialize_i32(1),
3479                        Self::UnknownValue(u) => u.0.serialize(serializer),
3480                    }
3481                }
3482            }
3483
3484            impl<'de> serde::de::Deserialize<'de> for PrimaryState {
3485                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3486                where
3487                    D: serde::Deserializer<'de>,
3488                {
3489                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<PrimaryState>::new(
3490                        ".google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.PrimaryState"))
3491                }
3492            }
3493        }
3494    }
3495
3496    /// Pub/Sub topic source.
3497    #[derive(Clone, Default, PartialEq)]
3498    #[non_exhaustive]
3499    pub struct PubSubTopicSource {
3500        /// Required. Resource name of the Pub/Sub topic source for this listing.
3501        /// e.g. projects/myproject/topics/topicId
3502        pub topic: std::string::String,
3503
3504        /// Optional. Region hint on where the data might be published. Data affinity
3505        /// regions are modifiable. See <https://cloud.google.com/about/locations> for
3506        /// full listing of possible Cloud regions.
3507        pub data_affinity_regions: std::vec::Vec<std::string::String>,
3508
3509        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3510    }
3511
3512    impl PubSubTopicSource {
3513        /// Creates a new default instance.
3514        pub fn new() -> Self {
3515            std::default::Default::default()
3516        }
3517
3518        /// Sets the value of [topic][crate::model::listing::PubSubTopicSource::topic].
3519        ///
3520        /// # Example
3521        /// ```ignore,no_run
3522        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::PubSubTopicSource;
3523        /// let x = PubSubTopicSource::new().set_topic("example");
3524        /// ```
3525        pub fn set_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3526            self.topic = v.into();
3527            self
3528        }
3529
3530        /// Sets the value of [data_affinity_regions][crate::model::listing::PubSubTopicSource::data_affinity_regions].
3531        ///
3532        /// # Example
3533        /// ```ignore,no_run
3534        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::PubSubTopicSource;
3535        /// let x = PubSubTopicSource::new().set_data_affinity_regions(["a", "b", "c"]);
3536        /// ```
3537        pub fn set_data_affinity_regions<T, V>(mut self, v: T) -> Self
3538        where
3539            T: std::iter::IntoIterator<Item = V>,
3540            V: std::convert::Into<std::string::String>,
3541        {
3542            use std::iter::Iterator;
3543            self.data_affinity_regions = v.into_iter().map(|i| i.into()).collect();
3544            self
3545        }
3546    }
3547
3548    impl wkt::message::Message for PubSubTopicSource {
3549        fn typename() -> &'static str {
3550            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.PubSubTopicSource"
3551        }
3552    }
3553
3554    /// Restricted export config, used to configure restricted export on linked
3555    /// dataset.
3556    #[derive(Clone, Default, PartialEq)]
3557    #[non_exhaustive]
3558    pub struct RestrictedExportConfig {
3559        /// Optional. If true, enable restricted export.
3560        pub enabled: bool,
3561
3562        /// Output only. If true, restrict direct table access(read
3563        /// api/tabledata.list) on linked table.
3564        pub restrict_direct_table_access: bool,
3565
3566        /// Optional. If true, restrict export of query result derived from
3567        /// restricted linked dataset table.
3568        pub restrict_query_result: bool,
3569
3570        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3571    }
3572
3573    impl RestrictedExportConfig {
3574        /// Creates a new default instance.
3575        pub fn new() -> Self {
3576            std::default::Default::default()
3577        }
3578
3579        /// Sets the value of [enabled][crate::model::listing::RestrictedExportConfig::enabled].
3580        ///
3581        /// # Example
3582        /// ```ignore,no_run
3583        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
3584        /// let x = RestrictedExportConfig::new().set_enabled(true);
3585        /// ```
3586        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3587            self.enabled = v.into();
3588            self
3589        }
3590
3591        /// Sets the value of [restrict_direct_table_access][crate::model::listing::RestrictedExportConfig::restrict_direct_table_access].
3592        ///
3593        /// # Example
3594        /// ```ignore,no_run
3595        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
3596        /// let x = RestrictedExportConfig::new().set_restrict_direct_table_access(true);
3597        /// ```
3598        pub fn set_restrict_direct_table_access<T: std::convert::Into<bool>>(
3599            mut self,
3600            v: T,
3601        ) -> Self {
3602            self.restrict_direct_table_access = v.into();
3603            self
3604        }
3605
3606        /// Sets the value of [restrict_query_result][crate::model::listing::RestrictedExportConfig::restrict_query_result].
3607        ///
3608        /// # Example
3609        /// ```ignore,no_run
3610        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
3611        /// let x = RestrictedExportConfig::new().set_restrict_query_result(true);
3612        /// ```
3613        pub fn set_restrict_query_result<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3614            self.restrict_query_result = v.into();
3615            self
3616        }
3617    }
3618
3619    impl wkt::message::Message for RestrictedExportConfig {
3620        fn typename() -> &'static str {
3621            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.RestrictedExportConfig"
3622        }
3623    }
3624
3625    /// Commercial info contains the information about the commercial data products
3626    /// associated with the listing.
3627    #[derive(Clone, Default, PartialEq)]
3628    #[non_exhaustive]
3629    pub struct CommercialInfo {
3630        /// Output only. Details of the Marketplace Data Product associated with the
3631        /// Listing.
3632        pub cloud_marketplace:
3633            std::option::Option<crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo>,
3634
3635        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3636    }
3637
3638    impl CommercialInfo {
3639        /// Creates a new default instance.
3640        pub fn new() -> Self {
3641            std::default::Default::default()
3642        }
3643
3644        /// Sets the value of [cloud_marketplace][crate::model::listing::CommercialInfo::cloud_marketplace].
3645        ///
3646        /// # Example
3647        /// ```ignore,no_run
3648        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
3649        /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3650        /// let x = CommercialInfo::new().set_cloud_marketplace(GoogleCloudMarketplaceInfo::default()/* use setters */);
3651        /// ```
3652        pub fn set_cloud_marketplace<T>(mut self, v: T) -> Self
3653        where
3654            T: std::convert::Into<
3655                    crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo,
3656                >,
3657        {
3658            self.cloud_marketplace = std::option::Option::Some(v.into());
3659            self
3660        }
3661
3662        /// Sets or clears the value of [cloud_marketplace][crate::model::listing::CommercialInfo::cloud_marketplace].
3663        ///
3664        /// # Example
3665        /// ```ignore,no_run
3666        /// # use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
3667        /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3668        /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(Some(GoogleCloudMarketplaceInfo::default()/* use setters */));
3669        /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(None::<GoogleCloudMarketplaceInfo>);
3670        /// ```
3671        pub fn set_or_clear_cloud_marketplace<T>(mut self, v: std::option::Option<T>) -> Self
3672        where
3673            T: std::convert::Into<
3674                    crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo,
3675                >,
3676        {
3677            self.cloud_marketplace = v.map(|x| x.into());
3678            self
3679        }
3680    }
3681
3682    impl wkt::message::Message for CommercialInfo {
3683        fn typename() -> &'static str {
3684            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.CommercialInfo"
3685        }
3686    }
3687
3688    /// Defines additional types related to [CommercialInfo].
3689    pub mod commercial_info {
3690        #[allow(unused_imports)]
3691        use super::*;
3692
3693        /// Specifies the details of the Marketplace Data Product associated with the
3694        /// Listing.
3695        #[derive(Clone, Default, PartialEq)]
3696        #[non_exhaustive]
3697        pub struct GoogleCloudMarketplaceInfo {
3698
3699            /// Output only. Resource name of the commercial service associated with
3700            /// the Marketplace Data Product. e.g. example.com
3701            pub service: std::option::Option<std::string::String>,
3702
3703            /// Output only. Commercial state of the Marketplace Data Product.
3704            pub commercial_state: std::option::Option<crate::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState>,
3705
3706            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3707        }
3708
3709        impl GoogleCloudMarketplaceInfo {
3710            /// Creates a new default instance.
3711            pub fn new() -> Self {
3712                std::default::Default::default()
3713            }
3714
3715            /// Sets the value of [service][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::service].
3716            ///
3717            /// # Example
3718            /// ```ignore,no_run
3719            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3720            /// let x = GoogleCloudMarketplaceInfo::new().set_service("example");
3721            /// ```
3722            pub fn set_service<T>(mut self, v: T) -> Self
3723            where
3724                T: std::convert::Into<std::string::String>,
3725            {
3726                self.service = std::option::Option::Some(v.into());
3727                self
3728            }
3729
3730            /// Sets or clears the value of [service][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::service].
3731            ///
3732            /// # Example
3733            /// ```ignore,no_run
3734            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3735            /// let x = GoogleCloudMarketplaceInfo::new().set_or_clear_service(Some("example"));
3736            /// let x = GoogleCloudMarketplaceInfo::new().set_or_clear_service(None::<String>);
3737            /// ```
3738            pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
3739            where
3740                T: std::convert::Into<std::string::String>,
3741            {
3742                self.service = v.map(|x| x.into());
3743                self
3744            }
3745
3746            /// Sets the value of [commercial_state][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::commercial_state].
3747            ///
3748            /// # Example
3749            /// ```ignore,no_run
3750            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3751            /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState;
3752            /// let x0 = GoogleCloudMarketplaceInfo::new().set_commercial_state(CommercialState::Onboarding);
3753            /// let x1 = GoogleCloudMarketplaceInfo::new().set_commercial_state(CommercialState::Active);
3754            /// ```
3755            pub fn set_commercial_state<T>(mut self, v: T) -> Self
3756            where T: std::convert::Into<crate::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState>
3757            {
3758                self.commercial_state = std::option::Option::Some(v.into());
3759                self
3760            }
3761
3762            /// Sets or clears the value of [commercial_state][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::commercial_state].
3763            ///
3764            /// # Example
3765            /// ```ignore,no_run
3766            /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3767            /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState;
3768            /// let x0 = GoogleCloudMarketplaceInfo::new().set_or_clear_commercial_state(Some(CommercialState::Onboarding));
3769            /// let x1 = GoogleCloudMarketplaceInfo::new().set_or_clear_commercial_state(Some(CommercialState::Active));
3770            /// let x_none = GoogleCloudMarketplaceInfo::new().set_or_clear_commercial_state(None::<CommercialState>);
3771            /// ```
3772            pub fn set_or_clear_commercial_state<T>(mut self, v: std::option::Option<T>) -> Self
3773            where T: std::convert::Into<crate::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState>
3774            {
3775                self.commercial_state = v.map(|x| x.into());
3776                self
3777            }
3778        }
3779
3780        impl wkt::message::Message for GoogleCloudMarketplaceInfo {
3781            fn typename() -> &'static str {
3782                "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.CommercialInfo.GoogleCloudMarketplaceInfo"
3783            }
3784        }
3785
3786        /// Defines additional types related to [GoogleCloudMarketplaceInfo].
3787        pub mod google_cloud_marketplace_info {
3788            #[allow(unused_imports)]
3789            use super::*;
3790
3791            /// Indicates whether this commercial access is currently active.
3792            ///
3793            /// # Working with unknown values
3794            ///
3795            /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3796            /// additional enum variants at any time. Adding new variants is not considered
3797            /// a breaking change. Applications should write their code in anticipation of:
3798            ///
3799            /// - New values appearing in future releases of the client library, **and**
3800            /// - New values received dynamically, without application changes.
3801            ///
3802            /// Please consult the [Working with enums] section in the user guide for some
3803            /// guidelines.
3804            ///
3805            /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3806            #[derive(Clone, Debug, PartialEq)]
3807            #[non_exhaustive]
3808            pub enum CommercialState {
3809                /// Commercialization is incomplete and cannot be used.
3810                Unspecified,
3811                /// Commercialization has been initialized.
3812                Onboarding,
3813                /// Commercialization is complete and available for use.
3814                Active,
3815                /// If set, the enum was initialized with an unknown value.
3816                ///
3817                /// Applications can examine the value using [CommercialState::value] or
3818                /// [CommercialState::name].
3819                UnknownValue(commercial_state::UnknownValue),
3820            }
3821
3822            #[doc(hidden)]
3823            pub mod commercial_state {
3824                #[allow(unused_imports)]
3825                use super::*;
3826                #[derive(Clone, Debug, PartialEq)]
3827                pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3828            }
3829
3830            impl CommercialState {
3831                /// Gets the enum value.
3832                ///
3833                /// Returns `None` if the enum contains an unknown value deserialized from
3834                /// the string representation of enums.
3835                pub fn value(&self) -> std::option::Option<i32> {
3836                    match self {
3837                        Self::Unspecified => std::option::Option::Some(0),
3838                        Self::Onboarding => std::option::Option::Some(1),
3839                        Self::Active => std::option::Option::Some(2),
3840                        Self::UnknownValue(u) => u.0.value(),
3841                    }
3842                }
3843
3844                /// Gets the enum value as a string.
3845                ///
3846                /// Returns `None` if the enum contains an unknown value deserialized from
3847                /// the integer representation of enums.
3848                pub fn name(&self) -> std::option::Option<&str> {
3849                    match self {
3850                        Self::Unspecified => {
3851                            std::option::Option::Some("COMMERCIAL_STATE_UNSPECIFIED")
3852                        }
3853                        Self::Onboarding => std::option::Option::Some("ONBOARDING"),
3854                        Self::Active => std::option::Option::Some("ACTIVE"),
3855                        Self::UnknownValue(u) => u.0.name(),
3856                    }
3857                }
3858            }
3859
3860            impl std::default::Default for CommercialState {
3861                fn default() -> Self {
3862                    use std::convert::From;
3863                    Self::from(0)
3864                }
3865            }
3866
3867            impl std::fmt::Display for CommercialState {
3868                fn fmt(
3869                    &self,
3870                    f: &mut std::fmt::Formatter<'_>,
3871                ) -> std::result::Result<(), std::fmt::Error> {
3872                    wkt::internal::display_enum(f, self.name(), self.value())
3873                }
3874            }
3875
3876            impl std::convert::From<i32> for CommercialState {
3877                fn from(value: i32) -> Self {
3878                    match value {
3879                        0 => Self::Unspecified,
3880                        1 => Self::Onboarding,
3881                        2 => Self::Active,
3882                        _ => Self::UnknownValue(commercial_state::UnknownValue(
3883                            wkt::internal::UnknownEnumValue::Integer(value),
3884                        )),
3885                    }
3886                }
3887            }
3888
3889            impl std::convert::From<&str> for CommercialState {
3890                fn from(value: &str) -> Self {
3891                    use std::string::ToString;
3892                    match value {
3893                        "COMMERCIAL_STATE_UNSPECIFIED" => Self::Unspecified,
3894                        "ONBOARDING" => Self::Onboarding,
3895                        "ACTIVE" => Self::Active,
3896                        _ => Self::UnknownValue(commercial_state::UnknownValue(
3897                            wkt::internal::UnknownEnumValue::String(value.to_string()),
3898                        )),
3899                    }
3900                }
3901            }
3902
3903            impl serde::ser::Serialize for CommercialState {
3904                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3905                where
3906                    S: serde::Serializer,
3907                {
3908                    match self {
3909                        Self::Unspecified => serializer.serialize_i32(0),
3910                        Self::Onboarding => serializer.serialize_i32(1),
3911                        Self::Active => serializer.serialize_i32(2),
3912                        Self::UnknownValue(u) => u.0.serialize(serializer),
3913                    }
3914                }
3915            }
3916
3917            impl<'de> serde::de::Deserialize<'de> for CommercialState {
3918                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3919                where
3920                    D: serde::Deserializer<'de>,
3921                {
3922                    deserializer.deserialize_any(wkt::internal::EnumVisitor::<CommercialState>::new(
3923                        ".google.cloud.bigquery.analyticshub.v1.Listing.CommercialInfo.GoogleCloudMarketplaceInfo.CommercialState"))
3924                }
3925            }
3926        }
3927    }
3928
3929    /// State of the listing.
3930    ///
3931    /// # Working with unknown values
3932    ///
3933    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3934    /// additional enum variants at any time. Adding new variants is not considered
3935    /// a breaking change. Applications should write their code in anticipation of:
3936    ///
3937    /// - New values appearing in future releases of the client library, **and**
3938    /// - New values received dynamically, without application changes.
3939    ///
3940    /// Please consult the [Working with enums] section in the user guide for some
3941    /// guidelines.
3942    ///
3943    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3944    #[derive(Clone, Debug, PartialEq)]
3945    #[non_exhaustive]
3946    pub enum State {
3947        /// Default value. This value is unused.
3948        Unspecified,
3949        /// Subscribable state. Users with dataexchange.listings.subscribe permission
3950        /// can subscribe to this listing.
3951        Active,
3952        /// If set, the enum was initialized with an unknown value.
3953        ///
3954        /// Applications can examine the value using [State::value] or
3955        /// [State::name].
3956        UnknownValue(state::UnknownValue),
3957    }
3958
3959    #[doc(hidden)]
3960    pub mod state {
3961        #[allow(unused_imports)]
3962        use super::*;
3963        #[derive(Clone, Debug, PartialEq)]
3964        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3965    }
3966
3967    impl State {
3968        /// Gets the enum value.
3969        ///
3970        /// Returns `None` if the enum contains an unknown value deserialized from
3971        /// the string representation of enums.
3972        pub fn value(&self) -> std::option::Option<i32> {
3973            match self {
3974                Self::Unspecified => std::option::Option::Some(0),
3975                Self::Active => std::option::Option::Some(1),
3976                Self::UnknownValue(u) => u.0.value(),
3977            }
3978        }
3979
3980        /// Gets the enum value as a string.
3981        ///
3982        /// Returns `None` if the enum contains an unknown value deserialized from
3983        /// the integer representation of enums.
3984        pub fn name(&self) -> std::option::Option<&str> {
3985            match self {
3986                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3987                Self::Active => std::option::Option::Some("ACTIVE"),
3988                Self::UnknownValue(u) => u.0.name(),
3989            }
3990        }
3991    }
3992
3993    impl std::default::Default for State {
3994        fn default() -> Self {
3995            use std::convert::From;
3996            Self::from(0)
3997        }
3998    }
3999
4000    impl std::fmt::Display for State {
4001        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4002            wkt::internal::display_enum(f, self.name(), self.value())
4003        }
4004    }
4005
4006    impl std::convert::From<i32> for State {
4007        fn from(value: i32) -> Self {
4008            match value {
4009                0 => Self::Unspecified,
4010                1 => Self::Active,
4011                _ => Self::UnknownValue(state::UnknownValue(
4012                    wkt::internal::UnknownEnumValue::Integer(value),
4013                )),
4014            }
4015        }
4016    }
4017
4018    impl std::convert::From<&str> for State {
4019        fn from(value: &str) -> Self {
4020            use std::string::ToString;
4021            match value {
4022                "STATE_UNSPECIFIED" => Self::Unspecified,
4023                "ACTIVE" => Self::Active,
4024                _ => Self::UnknownValue(state::UnknownValue(
4025                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4026                )),
4027            }
4028        }
4029    }
4030
4031    impl serde::ser::Serialize for State {
4032        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4033        where
4034            S: serde::Serializer,
4035        {
4036            match self {
4037                Self::Unspecified => serializer.serialize_i32(0),
4038                Self::Active => serializer.serialize_i32(1),
4039                Self::UnknownValue(u) => u.0.serialize(serializer),
4040            }
4041        }
4042    }
4043
4044    impl<'de> serde::de::Deserialize<'de> for State {
4045        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4046        where
4047            D: serde::Deserializer<'de>,
4048        {
4049            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4050                ".google.cloud.bigquery.analyticshub.v1.Listing.State",
4051            ))
4052        }
4053    }
4054
4055    /// Listing categories.
4056    ///
4057    /// # Working with unknown values
4058    ///
4059    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4060    /// additional enum variants at any time. Adding new variants is not considered
4061    /// a breaking change. Applications should write their code in anticipation of:
4062    ///
4063    /// - New values appearing in future releases of the client library, **and**
4064    /// - New values received dynamically, without application changes.
4065    ///
4066    /// Please consult the [Working with enums] section in the user guide for some
4067    /// guidelines.
4068    ///
4069    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4070    #[derive(Clone, Debug, PartialEq)]
4071    #[non_exhaustive]
4072    pub enum Category {
4073        #[allow(missing_docs)]
4074        Unspecified,
4075        #[allow(missing_docs)]
4076        Others,
4077        #[allow(missing_docs)]
4078        AdvertisingAndMarketing,
4079        #[allow(missing_docs)]
4080        Commerce,
4081        #[allow(missing_docs)]
4082        ClimateAndEnvironment,
4083        #[allow(missing_docs)]
4084        Demographics,
4085        #[allow(missing_docs)]
4086        Economics,
4087        #[allow(missing_docs)]
4088        Education,
4089        #[allow(missing_docs)]
4090        Energy,
4091        #[allow(missing_docs)]
4092        Financial,
4093        #[allow(missing_docs)]
4094        Gaming,
4095        #[allow(missing_docs)]
4096        Geospatial,
4097        #[allow(missing_docs)]
4098        HealthcareAndLifeScience,
4099        #[allow(missing_docs)]
4100        Media,
4101        #[allow(missing_docs)]
4102        PublicSector,
4103        #[allow(missing_docs)]
4104        Retail,
4105        #[allow(missing_docs)]
4106        Sports,
4107        #[allow(missing_docs)]
4108        ScienceAndResearch,
4109        #[allow(missing_docs)]
4110        TransportationAndLogistics,
4111        #[allow(missing_docs)]
4112        TravelAndTourism,
4113        #[allow(missing_docs)]
4114        GoogleEarthEngine,
4115        /// If set, the enum was initialized with an unknown value.
4116        ///
4117        /// Applications can examine the value using [Category::value] or
4118        /// [Category::name].
4119        UnknownValue(category::UnknownValue),
4120    }
4121
4122    #[doc(hidden)]
4123    pub mod category {
4124        #[allow(unused_imports)]
4125        use super::*;
4126        #[derive(Clone, Debug, PartialEq)]
4127        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4128    }
4129
4130    impl Category {
4131        /// Gets the enum value.
4132        ///
4133        /// Returns `None` if the enum contains an unknown value deserialized from
4134        /// the string representation of enums.
4135        pub fn value(&self) -> std::option::Option<i32> {
4136            match self {
4137                Self::Unspecified => std::option::Option::Some(0),
4138                Self::Others => std::option::Option::Some(1),
4139                Self::AdvertisingAndMarketing => std::option::Option::Some(2),
4140                Self::Commerce => std::option::Option::Some(3),
4141                Self::ClimateAndEnvironment => std::option::Option::Some(4),
4142                Self::Demographics => std::option::Option::Some(5),
4143                Self::Economics => std::option::Option::Some(6),
4144                Self::Education => std::option::Option::Some(7),
4145                Self::Energy => std::option::Option::Some(8),
4146                Self::Financial => std::option::Option::Some(9),
4147                Self::Gaming => std::option::Option::Some(10),
4148                Self::Geospatial => std::option::Option::Some(11),
4149                Self::HealthcareAndLifeScience => std::option::Option::Some(12),
4150                Self::Media => std::option::Option::Some(13),
4151                Self::PublicSector => std::option::Option::Some(14),
4152                Self::Retail => std::option::Option::Some(15),
4153                Self::Sports => std::option::Option::Some(16),
4154                Self::ScienceAndResearch => std::option::Option::Some(17),
4155                Self::TransportationAndLogistics => std::option::Option::Some(18),
4156                Self::TravelAndTourism => std::option::Option::Some(19),
4157                Self::GoogleEarthEngine => std::option::Option::Some(20),
4158                Self::UnknownValue(u) => u.0.value(),
4159            }
4160        }
4161
4162        /// Gets the enum value as a string.
4163        ///
4164        /// Returns `None` if the enum contains an unknown value deserialized from
4165        /// the integer representation of enums.
4166        pub fn name(&self) -> std::option::Option<&str> {
4167            match self {
4168                Self::Unspecified => std::option::Option::Some("CATEGORY_UNSPECIFIED"),
4169                Self::Others => std::option::Option::Some("CATEGORY_OTHERS"),
4170                Self::AdvertisingAndMarketing => {
4171                    std::option::Option::Some("CATEGORY_ADVERTISING_AND_MARKETING")
4172                }
4173                Self::Commerce => std::option::Option::Some("CATEGORY_COMMERCE"),
4174                Self::ClimateAndEnvironment => {
4175                    std::option::Option::Some("CATEGORY_CLIMATE_AND_ENVIRONMENT")
4176                }
4177                Self::Demographics => std::option::Option::Some("CATEGORY_DEMOGRAPHICS"),
4178                Self::Economics => std::option::Option::Some("CATEGORY_ECONOMICS"),
4179                Self::Education => std::option::Option::Some("CATEGORY_EDUCATION"),
4180                Self::Energy => std::option::Option::Some("CATEGORY_ENERGY"),
4181                Self::Financial => std::option::Option::Some("CATEGORY_FINANCIAL"),
4182                Self::Gaming => std::option::Option::Some("CATEGORY_GAMING"),
4183                Self::Geospatial => std::option::Option::Some("CATEGORY_GEOSPATIAL"),
4184                Self::HealthcareAndLifeScience => {
4185                    std::option::Option::Some("CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE")
4186                }
4187                Self::Media => std::option::Option::Some("CATEGORY_MEDIA"),
4188                Self::PublicSector => std::option::Option::Some("CATEGORY_PUBLIC_SECTOR"),
4189                Self::Retail => std::option::Option::Some("CATEGORY_RETAIL"),
4190                Self::Sports => std::option::Option::Some("CATEGORY_SPORTS"),
4191                Self::ScienceAndResearch => {
4192                    std::option::Option::Some("CATEGORY_SCIENCE_AND_RESEARCH")
4193                }
4194                Self::TransportationAndLogistics => {
4195                    std::option::Option::Some("CATEGORY_TRANSPORTATION_AND_LOGISTICS")
4196                }
4197                Self::TravelAndTourism => std::option::Option::Some("CATEGORY_TRAVEL_AND_TOURISM"),
4198                Self::GoogleEarthEngine => {
4199                    std::option::Option::Some("CATEGORY_GOOGLE_EARTH_ENGINE")
4200                }
4201                Self::UnknownValue(u) => u.0.name(),
4202            }
4203        }
4204    }
4205
4206    impl std::default::Default for Category {
4207        fn default() -> Self {
4208            use std::convert::From;
4209            Self::from(0)
4210        }
4211    }
4212
4213    impl std::fmt::Display for Category {
4214        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4215            wkt::internal::display_enum(f, self.name(), self.value())
4216        }
4217    }
4218
4219    impl std::convert::From<i32> for Category {
4220        fn from(value: i32) -> Self {
4221            match value {
4222                0 => Self::Unspecified,
4223                1 => Self::Others,
4224                2 => Self::AdvertisingAndMarketing,
4225                3 => Self::Commerce,
4226                4 => Self::ClimateAndEnvironment,
4227                5 => Self::Demographics,
4228                6 => Self::Economics,
4229                7 => Self::Education,
4230                8 => Self::Energy,
4231                9 => Self::Financial,
4232                10 => Self::Gaming,
4233                11 => Self::Geospatial,
4234                12 => Self::HealthcareAndLifeScience,
4235                13 => Self::Media,
4236                14 => Self::PublicSector,
4237                15 => Self::Retail,
4238                16 => Self::Sports,
4239                17 => Self::ScienceAndResearch,
4240                18 => Self::TransportationAndLogistics,
4241                19 => Self::TravelAndTourism,
4242                20 => Self::GoogleEarthEngine,
4243                _ => Self::UnknownValue(category::UnknownValue(
4244                    wkt::internal::UnknownEnumValue::Integer(value),
4245                )),
4246            }
4247        }
4248    }
4249
4250    impl std::convert::From<&str> for Category {
4251        fn from(value: &str) -> Self {
4252            use std::string::ToString;
4253            match value {
4254                "CATEGORY_UNSPECIFIED" => Self::Unspecified,
4255                "CATEGORY_OTHERS" => Self::Others,
4256                "CATEGORY_ADVERTISING_AND_MARKETING" => Self::AdvertisingAndMarketing,
4257                "CATEGORY_COMMERCE" => Self::Commerce,
4258                "CATEGORY_CLIMATE_AND_ENVIRONMENT" => Self::ClimateAndEnvironment,
4259                "CATEGORY_DEMOGRAPHICS" => Self::Demographics,
4260                "CATEGORY_ECONOMICS" => Self::Economics,
4261                "CATEGORY_EDUCATION" => Self::Education,
4262                "CATEGORY_ENERGY" => Self::Energy,
4263                "CATEGORY_FINANCIAL" => Self::Financial,
4264                "CATEGORY_GAMING" => Self::Gaming,
4265                "CATEGORY_GEOSPATIAL" => Self::Geospatial,
4266                "CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE" => Self::HealthcareAndLifeScience,
4267                "CATEGORY_MEDIA" => Self::Media,
4268                "CATEGORY_PUBLIC_SECTOR" => Self::PublicSector,
4269                "CATEGORY_RETAIL" => Self::Retail,
4270                "CATEGORY_SPORTS" => Self::Sports,
4271                "CATEGORY_SCIENCE_AND_RESEARCH" => Self::ScienceAndResearch,
4272                "CATEGORY_TRANSPORTATION_AND_LOGISTICS" => Self::TransportationAndLogistics,
4273                "CATEGORY_TRAVEL_AND_TOURISM" => Self::TravelAndTourism,
4274                "CATEGORY_GOOGLE_EARTH_ENGINE" => Self::GoogleEarthEngine,
4275                _ => Self::UnknownValue(category::UnknownValue(
4276                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4277                )),
4278            }
4279        }
4280    }
4281
4282    impl serde::ser::Serialize for Category {
4283        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4284        where
4285            S: serde::Serializer,
4286        {
4287            match self {
4288                Self::Unspecified => serializer.serialize_i32(0),
4289                Self::Others => serializer.serialize_i32(1),
4290                Self::AdvertisingAndMarketing => serializer.serialize_i32(2),
4291                Self::Commerce => serializer.serialize_i32(3),
4292                Self::ClimateAndEnvironment => serializer.serialize_i32(4),
4293                Self::Demographics => serializer.serialize_i32(5),
4294                Self::Economics => serializer.serialize_i32(6),
4295                Self::Education => serializer.serialize_i32(7),
4296                Self::Energy => serializer.serialize_i32(8),
4297                Self::Financial => serializer.serialize_i32(9),
4298                Self::Gaming => serializer.serialize_i32(10),
4299                Self::Geospatial => serializer.serialize_i32(11),
4300                Self::HealthcareAndLifeScience => serializer.serialize_i32(12),
4301                Self::Media => serializer.serialize_i32(13),
4302                Self::PublicSector => serializer.serialize_i32(14),
4303                Self::Retail => serializer.serialize_i32(15),
4304                Self::Sports => serializer.serialize_i32(16),
4305                Self::ScienceAndResearch => serializer.serialize_i32(17),
4306                Self::TransportationAndLogistics => serializer.serialize_i32(18),
4307                Self::TravelAndTourism => serializer.serialize_i32(19),
4308                Self::GoogleEarthEngine => serializer.serialize_i32(20),
4309                Self::UnknownValue(u) => u.0.serialize(serializer),
4310            }
4311        }
4312    }
4313
4314    impl<'de> serde::de::Deserialize<'de> for Category {
4315        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4316        where
4317            D: serde::Deserializer<'de>,
4318        {
4319            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Category>::new(
4320                ".google.cloud.bigquery.analyticshub.v1.Listing.Category",
4321            ))
4322        }
4323    }
4324
4325    /// Listing source.
4326    #[derive(Clone, Debug, PartialEq)]
4327    #[non_exhaustive]
4328    pub enum Source {
4329        /// Shared dataset i.e. BigQuery dataset source.
4330        BigqueryDataset(std::boxed::Box<crate::model::listing::BigQueryDatasetSource>),
4331        /// Pub/Sub topic source.
4332        PubsubTopic(std::boxed::Box<crate::model::listing::PubSubTopicSource>),
4333    }
4334}
4335
4336/// Stored procedure configuration, used to configure stored procedure sharing
4337/// on linked dataset.
4338#[derive(Clone, Default, PartialEq)]
4339#[non_exhaustive]
4340pub struct StoredProcedureConfig {
4341    /// Optional. If true, enable sharing of stored procedure.
4342    pub enabled: bool,
4343
4344    /// Output only. Types of stored procedure supported to share.
4345    pub allowed_stored_procedure_types:
4346        std::vec::Vec<crate::model::stored_procedure_config::StoredProcedureType>,
4347
4348    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4349}
4350
4351impl StoredProcedureConfig {
4352    /// Creates a new default instance.
4353    pub fn new() -> Self {
4354        std::default::Default::default()
4355    }
4356
4357    /// Sets the value of [enabled][crate::model::StoredProcedureConfig::enabled].
4358    ///
4359    /// # Example
4360    /// ```ignore,no_run
4361    /// # use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
4362    /// let x = StoredProcedureConfig::new().set_enabled(true);
4363    /// ```
4364    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4365        self.enabled = v.into();
4366        self
4367    }
4368
4369    /// Sets the value of [allowed_stored_procedure_types][crate::model::StoredProcedureConfig::allowed_stored_procedure_types].
4370    ///
4371    /// # Example
4372    /// ```ignore,no_run
4373    /// # use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
4374    /// use google_cloud_bigquery_analyticshub_v1::model::stored_procedure_config::StoredProcedureType;
4375    /// let x = StoredProcedureConfig::new().set_allowed_stored_procedure_types([
4376    ///     StoredProcedureType::SqlProcedure,
4377    /// ]);
4378    /// ```
4379    pub fn set_allowed_stored_procedure_types<T, V>(mut self, v: T) -> Self
4380    where
4381        T: std::iter::IntoIterator<Item = V>,
4382        V: std::convert::Into<crate::model::stored_procedure_config::StoredProcedureType>,
4383    {
4384        use std::iter::Iterator;
4385        self.allowed_stored_procedure_types = v.into_iter().map(|i| i.into()).collect();
4386        self
4387    }
4388}
4389
4390impl wkt::message::Message for StoredProcedureConfig {
4391    fn typename() -> &'static str {
4392        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.StoredProcedureConfig"
4393    }
4394}
4395
4396/// Defines additional types related to [StoredProcedureConfig].
4397pub mod stored_procedure_config {
4398    #[allow(unused_imports)]
4399    use super::*;
4400
4401    /// Enum to specify the type of stored procedure to share.
4402    ///
4403    /// # Working with unknown values
4404    ///
4405    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4406    /// additional enum variants at any time. Adding new variants is not considered
4407    /// a breaking change. Applications should write their code in anticipation of:
4408    ///
4409    /// - New values appearing in future releases of the client library, **and**
4410    /// - New values received dynamically, without application changes.
4411    ///
4412    /// Please consult the [Working with enums] section in the user guide for some
4413    /// guidelines.
4414    ///
4415    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4416    #[derive(Clone, Debug, PartialEq)]
4417    #[non_exhaustive]
4418    pub enum StoredProcedureType {
4419        /// Default value. This value is unused.
4420        Unspecified,
4421        /// SQL stored procedure.
4422        SqlProcedure,
4423        /// If set, the enum was initialized with an unknown value.
4424        ///
4425        /// Applications can examine the value using [StoredProcedureType::value] or
4426        /// [StoredProcedureType::name].
4427        UnknownValue(stored_procedure_type::UnknownValue),
4428    }
4429
4430    #[doc(hidden)]
4431    pub mod stored_procedure_type {
4432        #[allow(unused_imports)]
4433        use super::*;
4434        #[derive(Clone, Debug, PartialEq)]
4435        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4436    }
4437
4438    impl StoredProcedureType {
4439        /// Gets the enum value.
4440        ///
4441        /// Returns `None` if the enum contains an unknown value deserialized from
4442        /// the string representation of enums.
4443        pub fn value(&self) -> std::option::Option<i32> {
4444            match self {
4445                Self::Unspecified => std::option::Option::Some(0),
4446                Self::SqlProcedure => std::option::Option::Some(1),
4447                Self::UnknownValue(u) => u.0.value(),
4448            }
4449        }
4450
4451        /// Gets the enum value as a string.
4452        ///
4453        /// Returns `None` if the enum contains an unknown value deserialized from
4454        /// the integer representation of enums.
4455        pub fn name(&self) -> std::option::Option<&str> {
4456            match self {
4457                Self::Unspecified => std::option::Option::Some("STORED_PROCEDURE_TYPE_UNSPECIFIED"),
4458                Self::SqlProcedure => std::option::Option::Some("SQL_PROCEDURE"),
4459                Self::UnknownValue(u) => u.0.name(),
4460            }
4461        }
4462    }
4463
4464    impl std::default::Default for StoredProcedureType {
4465        fn default() -> Self {
4466            use std::convert::From;
4467            Self::from(0)
4468        }
4469    }
4470
4471    impl std::fmt::Display for StoredProcedureType {
4472        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4473            wkt::internal::display_enum(f, self.name(), self.value())
4474        }
4475    }
4476
4477    impl std::convert::From<i32> for StoredProcedureType {
4478        fn from(value: i32) -> Self {
4479            match value {
4480                0 => Self::Unspecified,
4481                1 => Self::SqlProcedure,
4482                _ => Self::UnknownValue(stored_procedure_type::UnknownValue(
4483                    wkt::internal::UnknownEnumValue::Integer(value),
4484                )),
4485            }
4486        }
4487    }
4488
4489    impl std::convert::From<&str> for StoredProcedureType {
4490        fn from(value: &str) -> Self {
4491            use std::string::ToString;
4492            match value {
4493                "STORED_PROCEDURE_TYPE_UNSPECIFIED" => Self::Unspecified,
4494                "SQL_PROCEDURE" => Self::SqlProcedure,
4495                _ => Self::UnknownValue(stored_procedure_type::UnknownValue(
4496                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4497                )),
4498            }
4499        }
4500    }
4501
4502    impl serde::ser::Serialize for StoredProcedureType {
4503        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4504        where
4505            S: serde::Serializer,
4506        {
4507            match self {
4508                Self::Unspecified => serializer.serialize_i32(0),
4509                Self::SqlProcedure => serializer.serialize_i32(1),
4510                Self::UnknownValue(u) => u.0.serialize(serializer),
4511            }
4512        }
4513    }
4514
4515    impl<'de> serde::de::Deserialize<'de> for StoredProcedureType {
4516        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4517        where
4518            D: serde::Deserializer<'de>,
4519        {
4520            deserializer.deserialize_any(wkt::internal::EnumVisitor::<StoredProcedureType>::new(
4521                ".google.cloud.bigquery.analyticshub.v1.StoredProcedureConfig.StoredProcedureType",
4522            ))
4523        }
4524    }
4525}
4526
4527/// A subscription represents a subscribers' access to a particular set of
4528/// published data. It contains references to associated listings,
4529/// data exchanges, and linked datasets.
4530#[derive(Clone, Default, PartialEq)]
4531#[non_exhaustive]
4532pub struct Subscription {
4533    /// Output only. The resource name of the subscription.
4534    /// e.g. `projects/myproject/locations/us/subscriptions/123`.
4535    pub name: std::string::String,
4536
4537    /// Output only. Timestamp when the subscription was created.
4538    pub creation_time: std::option::Option<wkt::Timestamp>,
4539
4540    /// Output only. Timestamp when the subscription was last modified.
4541    pub last_modify_time: std::option::Option<wkt::Timestamp>,
4542
4543    /// Output only. Organization of the project this subscription belongs to.
4544    pub organization_id: std::string::String,
4545
4546    /// Output only. Display name of the project of this subscription.
4547    pub organization_display_name: std::string::String,
4548
4549    /// Output only. Current state of the subscription.
4550    pub state: crate::model::subscription::State,
4551
4552    /// Output only. Map of listing resource names to associated linked resource,
4553    /// e.g. projects/123/locations/us/dataExchanges/456/listings/789
4554    /// ->
4555    /// projects/123/datasets/my_dataset
4556    ///
4557    /// For listing-level subscriptions, this is a map of size 1.
4558    /// Only contains values if state == STATE_ACTIVE.
4559    pub linked_dataset_map:
4560        std::collections::HashMap<std::string::String, crate::model::subscription::LinkedResource>,
4561
4562    /// Output only. Email of the subscriber.
4563    pub subscriber_contact: std::string::String,
4564
4565    /// Output only. Linked resources created in the subscription. Only contains
4566    /// values if state = STATE_ACTIVE.
4567    pub linked_resources: std::vec::Vec<crate::model::subscription::LinkedResource>,
4568
4569    /// Output only. Listing shared asset type.
4570    pub resource_type: crate::model::SharedResourceType,
4571
4572    /// Output only. This is set if this is a commercial subscription i.e. if this
4573    /// subscription was created from subscribing to a commercial listing.
4574    pub commercial_info: std::option::Option<crate::model::subscription::CommercialInfo>,
4575
4576    /// Output only. By default, false.
4577    /// If true, the Subscriber agreed to the email sharing mandate
4578    /// that is enabled for DataExchange/Listing.
4579    pub log_linked_dataset_query_user_email: std::option::Option<bool>,
4580
4581    /// Optional. BigQuery destination dataset to create for the subscriber.
4582    pub destination_dataset: std::option::Option<crate::model::DestinationDataset>,
4583
4584    #[allow(missing_docs)]
4585    pub resource_name: std::option::Option<crate::model::subscription::ResourceName>,
4586
4587    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4588}
4589
4590impl Subscription {
4591    /// Creates a new default instance.
4592    pub fn new() -> Self {
4593        std::default::Default::default()
4594    }
4595
4596    /// Sets the value of [name][crate::model::Subscription::name].
4597    ///
4598    /// # Example
4599    /// ```ignore,no_run
4600    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4601    /// # let project_id = "project_id";
4602    /// # let location_id = "location_id";
4603    /// # let subscription_id = "subscription_id";
4604    /// let x = Subscription::new().set_name(format!("projects/{project_id}/locations/{location_id}/subscriptions/{subscription_id}"));
4605    /// ```
4606    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4607        self.name = v.into();
4608        self
4609    }
4610
4611    /// Sets the value of [creation_time][crate::model::Subscription::creation_time].
4612    ///
4613    /// # Example
4614    /// ```ignore,no_run
4615    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4616    /// use wkt::Timestamp;
4617    /// let x = Subscription::new().set_creation_time(Timestamp::default()/* use setters */);
4618    /// ```
4619    pub fn set_creation_time<T>(mut self, v: T) -> Self
4620    where
4621        T: std::convert::Into<wkt::Timestamp>,
4622    {
4623        self.creation_time = std::option::Option::Some(v.into());
4624        self
4625    }
4626
4627    /// Sets or clears the value of [creation_time][crate::model::Subscription::creation_time].
4628    ///
4629    /// # Example
4630    /// ```ignore,no_run
4631    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4632    /// use wkt::Timestamp;
4633    /// let x = Subscription::new().set_or_clear_creation_time(Some(Timestamp::default()/* use setters */));
4634    /// let x = Subscription::new().set_or_clear_creation_time(None::<Timestamp>);
4635    /// ```
4636    pub fn set_or_clear_creation_time<T>(mut self, v: std::option::Option<T>) -> Self
4637    where
4638        T: std::convert::Into<wkt::Timestamp>,
4639    {
4640        self.creation_time = v.map(|x| x.into());
4641        self
4642    }
4643
4644    /// Sets the value of [last_modify_time][crate::model::Subscription::last_modify_time].
4645    ///
4646    /// # Example
4647    /// ```ignore,no_run
4648    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4649    /// use wkt::Timestamp;
4650    /// let x = Subscription::new().set_last_modify_time(Timestamp::default()/* use setters */);
4651    /// ```
4652    pub fn set_last_modify_time<T>(mut self, v: T) -> Self
4653    where
4654        T: std::convert::Into<wkt::Timestamp>,
4655    {
4656        self.last_modify_time = std::option::Option::Some(v.into());
4657        self
4658    }
4659
4660    /// Sets or clears the value of [last_modify_time][crate::model::Subscription::last_modify_time].
4661    ///
4662    /// # Example
4663    /// ```ignore,no_run
4664    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4665    /// use wkt::Timestamp;
4666    /// let x = Subscription::new().set_or_clear_last_modify_time(Some(Timestamp::default()/* use setters */));
4667    /// let x = Subscription::new().set_or_clear_last_modify_time(None::<Timestamp>);
4668    /// ```
4669    pub fn set_or_clear_last_modify_time<T>(mut self, v: std::option::Option<T>) -> Self
4670    where
4671        T: std::convert::Into<wkt::Timestamp>,
4672    {
4673        self.last_modify_time = v.map(|x| x.into());
4674        self
4675    }
4676
4677    /// Sets the value of [organization_id][crate::model::Subscription::organization_id].
4678    ///
4679    /// # Example
4680    /// ```ignore,no_run
4681    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4682    /// let x = Subscription::new().set_organization_id("example");
4683    /// ```
4684    pub fn set_organization_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4685        self.organization_id = v.into();
4686        self
4687    }
4688
4689    /// Sets the value of [organization_display_name][crate::model::Subscription::organization_display_name].
4690    ///
4691    /// # Example
4692    /// ```ignore,no_run
4693    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4694    /// let x = Subscription::new().set_organization_display_name("example");
4695    /// ```
4696    pub fn set_organization_display_name<T: std::convert::Into<std::string::String>>(
4697        mut self,
4698        v: T,
4699    ) -> Self {
4700        self.organization_display_name = v.into();
4701        self
4702    }
4703
4704    /// Sets the value of [state][crate::model::Subscription::state].
4705    ///
4706    /// # Example
4707    /// ```ignore,no_run
4708    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4709    /// use google_cloud_bigquery_analyticshub_v1::model::subscription::State;
4710    /// let x0 = Subscription::new().set_state(State::Active);
4711    /// let x1 = Subscription::new().set_state(State::Stale);
4712    /// let x2 = Subscription::new().set_state(State::Inactive);
4713    /// ```
4714    pub fn set_state<T: std::convert::Into<crate::model::subscription::State>>(
4715        mut self,
4716        v: T,
4717    ) -> Self {
4718        self.state = v.into();
4719        self
4720    }
4721
4722    /// Sets the value of [linked_dataset_map][crate::model::Subscription::linked_dataset_map].
4723    ///
4724    /// # Example
4725    /// ```ignore,no_run
4726    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4727    /// use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
4728    /// let x = Subscription::new().set_linked_dataset_map([
4729    ///     ("key0", LinkedResource::default()/* use setters */),
4730    ///     ("key1", LinkedResource::default()/* use (different) setters */),
4731    /// ]);
4732    /// ```
4733    pub fn set_linked_dataset_map<T, K, V>(mut self, v: T) -> Self
4734    where
4735        T: std::iter::IntoIterator<Item = (K, V)>,
4736        K: std::convert::Into<std::string::String>,
4737        V: std::convert::Into<crate::model::subscription::LinkedResource>,
4738    {
4739        use std::iter::Iterator;
4740        self.linked_dataset_map = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4741        self
4742    }
4743
4744    /// Sets the value of [subscriber_contact][crate::model::Subscription::subscriber_contact].
4745    ///
4746    /// # Example
4747    /// ```ignore,no_run
4748    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4749    /// let x = Subscription::new().set_subscriber_contact("example");
4750    /// ```
4751    pub fn set_subscriber_contact<T: std::convert::Into<std::string::String>>(
4752        mut self,
4753        v: T,
4754    ) -> Self {
4755        self.subscriber_contact = v.into();
4756        self
4757    }
4758
4759    /// Sets the value of [linked_resources][crate::model::Subscription::linked_resources].
4760    ///
4761    /// # Example
4762    /// ```ignore,no_run
4763    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4764    /// use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
4765    /// let x = Subscription::new()
4766    ///     .set_linked_resources([
4767    ///         LinkedResource::default()/* use setters */,
4768    ///         LinkedResource::default()/* use (different) setters */,
4769    ///     ]);
4770    /// ```
4771    pub fn set_linked_resources<T, V>(mut self, v: T) -> Self
4772    where
4773        T: std::iter::IntoIterator<Item = V>,
4774        V: std::convert::Into<crate::model::subscription::LinkedResource>,
4775    {
4776        use std::iter::Iterator;
4777        self.linked_resources = v.into_iter().map(|i| i.into()).collect();
4778        self
4779    }
4780
4781    /// Sets the value of [resource_type][crate::model::Subscription::resource_type].
4782    ///
4783    /// # Example
4784    /// ```ignore,no_run
4785    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4786    /// use google_cloud_bigquery_analyticshub_v1::model::SharedResourceType;
4787    /// let x0 = Subscription::new().set_resource_type(SharedResourceType::BigqueryDataset);
4788    /// let x1 = Subscription::new().set_resource_type(SharedResourceType::PubsubTopic);
4789    /// ```
4790    pub fn set_resource_type<T: std::convert::Into<crate::model::SharedResourceType>>(
4791        mut self,
4792        v: T,
4793    ) -> Self {
4794        self.resource_type = v.into();
4795        self
4796    }
4797
4798    /// Sets the value of [commercial_info][crate::model::Subscription::commercial_info].
4799    ///
4800    /// # Example
4801    /// ```ignore,no_run
4802    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4803    /// use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
4804    /// let x = Subscription::new().set_commercial_info(CommercialInfo::default()/* use setters */);
4805    /// ```
4806    pub fn set_commercial_info<T>(mut self, v: T) -> Self
4807    where
4808        T: std::convert::Into<crate::model::subscription::CommercialInfo>,
4809    {
4810        self.commercial_info = std::option::Option::Some(v.into());
4811        self
4812    }
4813
4814    /// Sets or clears the value of [commercial_info][crate::model::Subscription::commercial_info].
4815    ///
4816    /// # Example
4817    /// ```ignore,no_run
4818    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4819    /// use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
4820    /// let x = Subscription::new().set_or_clear_commercial_info(Some(CommercialInfo::default()/* use setters */));
4821    /// let x = Subscription::new().set_or_clear_commercial_info(None::<CommercialInfo>);
4822    /// ```
4823    pub fn set_or_clear_commercial_info<T>(mut self, v: std::option::Option<T>) -> Self
4824    where
4825        T: std::convert::Into<crate::model::subscription::CommercialInfo>,
4826    {
4827        self.commercial_info = v.map(|x| x.into());
4828        self
4829    }
4830
4831    /// Sets the value of [log_linked_dataset_query_user_email][crate::model::Subscription::log_linked_dataset_query_user_email].
4832    ///
4833    /// # Example
4834    /// ```ignore,no_run
4835    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4836    /// let x = Subscription::new().set_log_linked_dataset_query_user_email(true);
4837    /// ```
4838    pub fn set_log_linked_dataset_query_user_email<T>(mut self, v: T) -> Self
4839    where
4840        T: std::convert::Into<bool>,
4841    {
4842        self.log_linked_dataset_query_user_email = std::option::Option::Some(v.into());
4843        self
4844    }
4845
4846    /// Sets or clears the value of [log_linked_dataset_query_user_email][crate::model::Subscription::log_linked_dataset_query_user_email].
4847    ///
4848    /// # Example
4849    /// ```ignore,no_run
4850    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4851    /// let x = Subscription::new().set_or_clear_log_linked_dataset_query_user_email(Some(false));
4852    /// let x = Subscription::new().set_or_clear_log_linked_dataset_query_user_email(None::<bool>);
4853    /// ```
4854    pub fn set_or_clear_log_linked_dataset_query_user_email<T>(
4855        mut self,
4856        v: std::option::Option<T>,
4857    ) -> Self
4858    where
4859        T: std::convert::Into<bool>,
4860    {
4861        self.log_linked_dataset_query_user_email = v.map(|x| x.into());
4862        self
4863    }
4864
4865    /// Sets the value of [destination_dataset][crate::model::Subscription::destination_dataset].
4866    ///
4867    /// # Example
4868    /// ```ignore,no_run
4869    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4870    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
4871    /// let x = Subscription::new().set_destination_dataset(DestinationDataset::default()/* use setters */);
4872    /// ```
4873    pub fn set_destination_dataset<T>(mut self, v: T) -> Self
4874    where
4875        T: std::convert::Into<crate::model::DestinationDataset>,
4876    {
4877        self.destination_dataset = std::option::Option::Some(v.into());
4878        self
4879    }
4880
4881    /// Sets or clears the value of [destination_dataset][crate::model::Subscription::destination_dataset].
4882    ///
4883    /// # Example
4884    /// ```ignore,no_run
4885    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4886    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
4887    /// let x = Subscription::new().set_or_clear_destination_dataset(Some(DestinationDataset::default()/* use setters */));
4888    /// let x = Subscription::new().set_or_clear_destination_dataset(None::<DestinationDataset>);
4889    /// ```
4890    pub fn set_or_clear_destination_dataset<T>(mut self, v: std::option::Option<T>) -> Self
4891    where
4892        T: std::convert::Into<crate::model::DestinationDataset>,
4893    {
4894        self.destination_dataset = v.map(|x| x.into());
4895        self
4896    }
4897
4898    /// Sets the value of [resource_name][crate::model::Subscription::resource_name].
4899    ///
4900    /// Note that all the setters affecting `resource_name` are mutually
4901    /// exclusive.
4902    ///
4903    /// # Example
4904    /// ```ignore,no_run
4905    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4906    /// use google_cloud_bigquery_analyticshub_v1::model::subscription::ResourceName;
4907    /// let x = Subscription::new().set_resource_name(Some(ResourceName::Listing("example".to_string())));
4908    /// ```
4909    pub fn set_resource_name<
4910        T: std::convert::Into<std::option::Option<crate::model::subscription::ResourceName>>,
4911    >(
4912        mut self,
4913        v: T,
4914    ) -> Self {
4915        self.resource_name = v.into();
4916        self
4917    }
4918
4919    /// The value of [resource_name][crate::model::Subscription::resource_name]
4920    /// if it holds a `Listing`, `None` if the field is not set or
4921    /// holds a different branch.
4922    pub fn listing(&self) -> std::option::Option<&std::string::String> {
4923        #[allow(unreachable_patterns)]
4924        self.resource_name.as_ref().and_then(|v| match v {
4925            crate::model::subscription::ResourceName::Listing(v) => std::option::Option::Some(v),
4926            _ => std::option::Option::None,
4927        })
4928    }
4929
4930    /// Sets the value of [resource_name][crate::model::Subscription::resource_name]
4931    /// to hold a `Listing`.
4932    ///
4933    /// Note that all the setters affecting `resource_name` are
4934    /// mutually exclusive.
4935    ///
4936    /// # Example
4937    /// ```ignore,no_run
4938    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4939    /// let x = Subscription::new().set_listing("example");
4940    /// assert!(x.listing().is_some());
4941    /// assert!(x.data_exchange().is_none());
4942    /// ```
4943    pub fn set_listing<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4944        self.resource_name =
4945            std::option::Option::Some(crate::model::subscription::ResourceName::Listing(v.into()));
4946        self
4947    }
4948
4949    /// The value of [resource_name][crate::model::Subscription::resource_name]
4950    /// if it holds a `DataExchange`, `None` if the field is not set or
4951    /// holds a different branch.
4952    pub fn data_exchange(&self) -> std::option::Option<&std::string::String> {
4953        #[allow(unreachable_patterns)]
4954        self.resource_name.as_ref().and_then(|v| match v {
4955            crate::model::subscription::ResourceName::DataExchange(v) => {
4956                std::option::Option::Some(v)
4957            }
4958            _ => std::option::Option::None,
4959        })
4960    }
4961
4962    /// Sets the value of [resource_name][crate::model::Subscription::resource_name]
4963    /// to hold a `DataExchange`.
4964    ///
4965    /// Note that all the setters affecting `resource_name` are
4966    /// mutually exclusive.
4967    ///
4968    /// # Example
4969    /// ```ignore,no_run
4970    /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4971    /// let x = Subscription::new().set_data_exchange("example");
4972    /// assert!(x.data_exchange().is_some());
4973    /// assert!(x.listing().is_none());
4974    /// ```
4975    pub fn set_data_exchange<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4976        self.resource_name = std::option::Option::Some(
4977            crate::model::subscription::ResourceName::DataExchange(v.into()),
4978        );
4979        self
4980    }
4981}
4982
4983impl wkt::message::Message for Subscription {
4984    fn typename() -> &'static str {
4985        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription"
4986    }
4987}
4988
4989/// Defines additional types related to [Subscription].
4990pub mod subscription {
4991    #[allow(unused_imports)]
4992    use super::*;
4993
4994    /// Reference to a linked resource tracked by this Subscription.
4995    #[derive(Clone, Default, PartialEq)]
4996    #[non_exhaustive]
4997    pub struct LinkedResource {
4998        /// Output only. Listing for which linked resource is created.
4999        pub listing: std::string::String,
5000
5001        #[allow(missing_docs)]
5002        pub reference: std::option::Option<crate::model::subscription::linked_resource::Reference>,
5003
5004        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5005    }
5006
5007    impl LinkedResource {
5008        /// Creates a new default instance.
5009        pub fn new() -> Self {
5010            std::default::Default::default()
5011        }
5012
5013        /// Sets the value of [listing][crate::model::subscription::LinkedResource::listing].
5014        ///
5015        /// # Example
5016        /// ```ignore,no_run
5017        /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
5018        /// let x = LinkedResource::new().set_listing("example");
5019        /// ```
5020        pub fn set_listing<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5021            self.listing = v.into();
5022            self
5023        }
5024
5025        /// Sets the value of [reference][crate::model::subscription::LinkedResource::reference].
5026        ///
5027        /// Note that all the setters affecting `reference` are mutually
5028        /// exclusive.
5029        ///
5030        /// # Example
5031        /// ```ignore,no_run
5032        /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
5033        /// use google_cloud_bigquery_analyticshub_v1::model::subscription::linked_resource::Reference;
5034        /// let x = LinkedResource::new().set_reference(Some(Reference::LinkedDataset("example".to_string())));
5035        /// ```
5036        pub fn set_reference<
5037            T: std::convert::Into<
5038                    std::option::Option<crate::model::subscription::linked_resource::Reference>,
5039                >,
5040        >(
5041            mut self,
5042            v: T,
5043        ) -> Self {
5044            self.reference = v.into();
5045            self
5046        }
5047
5048        /// The value of [reference][crate::model::subscription::LinkedResource::reference]
5049        /// if it holds a `LinkedDataset`, `None` if the field is not set or
5050        /// holds a different branch.
5051        pub fn linked_dataset(&self) -> std::option::Option<&std::string::String> {
5052            #[allow(unreachable_patterns)]
5053            self.reference.as_ref().and_then(|v| match v {
5054                crate::model::subscription::linked_resource::Reference::LinkedDataset(v) => {
5055                    std::option::Option::Some(v)
5056                }
5057                _ => std::option::Option::None,
5058            })
5059        }
5060
5061        /// Sets the value of [reference][crate::model::subscription::LinkedResource::reference]
5062        /// to hold a `LinkedDataset`.
5063        ///
5064        /// Note that all the setters affecting `reference` are
5065        /// mutually exclusive.
5066        ///
5067        /// # Example
5068        /// ```ignore,no_run
5069        /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
5070        /// let x = LinkedResource::new().set_linked_dataset("example");
5071        /// assert!(x.linked_dataset().is_some());
5072        /// assert!(x.linked_pubsub_subscription().is_none());
5073        /// ```
5074        pub fn set_linked_dataset<T: std::convert::Into<std::string::String>>(
5075            mut self,
5076            v: T,
5077        ) -> Self {
5078            self.reference = std::option::Option::Some(
5079                crate::model::subscription::linked_resource::Reference::LinkedDataset(v.into()),
5080            );
5081            self
5082        }
5083
5084        /// The value of [reference][crate::model::subscription::LinkedResource::reference]
5085        /// if it holds a `LinkedPubsubSubscription`, `None` if the field is not set or
5086        /// holds a different branch.
5087        pub fn linked_pubsub_subscription(&self) -> std::option::Option<&std::string::String> {
5088            #[allow(unreachable_patterns)]
5089            self.reference.as_ref().and_then(|v| match v {
5090                crate::model::subscription::linked_resource::Reference::LinkedPubsubSubscription(v) => std::option::Option::Some(v),
5091                _ => std::option::Option::None,
5092            })
5093        }
5094
5095        /// Sets the value of [reference][crate::model::subscription::LinkedResource::reference]
5096        /// to hold a `LinkedPubsubSubscription`.
5097        ///
5098        /// Note that all the setters affecting `reference` are
5099        /// mutually exclusive.
5100        ///
5101        /// # Example
5102        /// ```ignore,no_run
5103        /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
5104        /// let x = LinkedResource::new().set_linked_pubsub_subscription("example");
5105        /// assert!(x.linked_pubsub_subscription().is_some());
5106        /// assert!(x.linked_dataset().is_none());
5107        /// ```
5108        pub fn set_linked_pubsub_subscription<T: std::convert::Into<std::string::String>>(
5109            mut self,
5110            v: T,
5111        ) -> Self {
5112            self.reference = std::option::Option::Some(
5113                crate::model::subscription::linked_resource::Reference::LinkedPubsubSubscription(
5114                    v.into(),
5115                ),
5116            );
5117            self
5118        }
5119    }
5120
5121    impl wkt::message::Message for LinkedResource {
5122        fn typename() -> &'static str {
5123            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription.LinkedResource"
5124        }
5125    }
5126
5127    /// Defines additional types related to [LinkedResource].
5128    pub mod linked_resource {
5129        #[allow(unused_imports)]
5130        use super::*;
5131
5132        #[allow(missing_docs)]
5133        #[derive(Clone, Debug, PartialEq)]
5134        #[non_exhaustive]
5135        pub enum Reference {
5136            /// Output only. Name of the linked dataset, e.g.
5137            /// projects/subscriberproject/datasets/linked_dataset
5138            LinkedDataset(std::string::String),
5139            /// Output only. Name of the Pub/Sub subscription, e.g.
5140            /// projects/subscriberproject/subscriptions/subscriptions/sub_id
5141            LinkedPubsubSubscription(std::string::String),
5142        }
5143    }
5144
5145    /// Commercial info metadata for this subscription.
5146    #[derive(Clone, Default, PartialEq)]
5147    #[non_exhaustive]
5148    pub struct CommercialInfo {
5149        /// Output only. This is set when the subscription is commercialised via
5150        /// Cloud Marketplace.
5151        pub cloud_marketplace: std::option::Option<
5152            crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo,
5153        >,
5154
5155        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5156    }
5157
5158    impl CommercialInfo {
5159        /// Creates a new default instance.
5160        pub fn new() -> Self {
5161            std::default::Default::default()
5162        }
5163
5164        /// Sets the value of [cloud_marketplace][crate::model::subscription::CommercialInfo::cloud_marketplace].
5165        ///
5166        /// # Example
5167        /// ```ignore,no_run
5168        /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
5169        /// use google_cloud_bigquery_analyticshub_v1::model::subscription::commercial_info::GoogleCloudMarketplaceInfo;
5170        /// let x = CommercialInfo::new().set_cloud_marketplace(GoogleCloudMarketplaceInfo::default()/* use setters */);
5171        /// ```
5172        pub fn set_cloud_marketplace<T>(mut self, v: T) -> Self
5173        where
5174            T: std::convert::Into<
5175                    crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo,
5176                >,
5177        {
5178            self.cloud_marketplace = std::option::Option::Some(v.into());
5179            self
5180        }
5181
5182        /// Sets or clears the value of [cloud_marketplace][crate::model::subscription::CommercialInfo::cloud_marketplace].
5183        ///
5184        /// # Example
5185        /// ```ignore,no_run
5186        /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
5187        /// use google_cloud_bigquery_analyticshub_v1::model::subscription::commercial_info::GoogleCloudMarketplaceInfo;
5188        /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(Some(GoogleCloudMarketplaceInfo::default()/* use setters */));
5189        /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(None::<GoogleCloudMarketplaceInfo>);
5190        /// ```
5191        pub fn set_or_clear_cloud_marketplace<T>(mut self, v: std::option::Option<T>) -> Self
5192        where
5193            T: std::convert::Into<
5194                    crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo,
5195                >,
5196        {
5197            self.cloud_marketplace = v.map(|x| x.into());
5198            self
5199        }
5200    }
5201
5202    impl wkt::message::Message for CommercialInfo {
5203        fn typename() -> &'static str {
5204            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription.CommercialInfo"
5205        }
5206    }
5207
5208    /// Defines additional types related to [CommercialInfo].
5209    pub mod commercial_info {
5210        #[allow(unused_imports)]
5211        use super::*;
5212
5213        /// Cloud Marketplace commercial metadata for this subscription.
5214        #[derive(Clone, Default, PartialEq)]
5215        #[non_exhaustive]
5216        pub struct GoogleCloudMarketplaceInfo {
5217            /// Resource name of the Marketplace Order.
5218            pub order: std::string::String,
5219
5220            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5221        }
5222
5223        impl GoogleCloudMarketplaceInfo {
5224            /// Creates a new default instance.
5225            pub fn new() -> Self {
5226                std::default::Default::default()
5227            }
5228
5229            /// Sets the value of [order][crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo::order].
5230            ///
5231            /// # Example
5232            /// ```ignore,no_run
5233            /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::commercial_info::GoogleCloudMarketplaceInfo;
5234            /// let x = GoogleCloudMarketplaceInfo::new().set_order("example");
5235            /// ```
5236            pub fn set_order<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5237                self.order = v.into();
5238                self
5239            }
5240        }
5241
5242        impl wkt::message::Message for GoogleCloudMarketplaceInfo {
5243            fn typename() -> &'static str {
5244                "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription.CommercialInfo.GoogleCloudMarketplaceInfo"
5245            }
5246        }
5247    }
5248
5249    /// State of the subscription.
5250    ///
5251    /// # Working with unknown values
5252    ///
5253    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5254    /// additional enum variants at any time. Adding new variants is not considered
5255    /// a breaking change. Applications should write their code in anticipation of:
5256    ///
5257    /// - New values appearing in future releases of the client library, **and**
5258    /// - New values received dynamically, without application changes.
5259    ///
5260    /// Please consult the [Working with enums] section in the user guide for some
5261    /// guidelines.
5262    ///
5263    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5264    #[derive(Clone, Debug, PartialEq)]
5265    #[non_exhaustive]
5266    pub enum State {
5267        /// Default value. This value is unused.
5268        Unspecified,
5269        /// This subscription is active and the data is accessible.
5270        Active,
5271        /// The data referenced by this subscription is out of date and should be
5272        /// refreshed. This can happen when a data provider adds or removes datasets.
5273        Stale,
5274        /// This subscription has been cancelled or revoked and the data is no longer
5275        /// accessible.
5276        Inactive,
5277        /// If set, the enum was initialized with an unknown value.
5278        ///
5279        /// Applications can examine the value using [State::value] or
5280        /// [State::name].
5281        UnknownValue(state::UnknownValue),
5282    }
5283
5284    #[doc(hidden)]
5285    pub mod state {
5286        #[allow(unused_imports)]
5287        use super::*;
5288        #[derive(Clone, Debug, PartialEq)]
5289        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5290    }
5291
5292    impl State {
5293        /// Gets the enum value.
5294        ///
5295        /// Returns `None` if the enum contains an unknown value deserialized from
5296        /// the string representation of enums.
5297        pub fn value(&self) -> std::option::Option<i32> {
5298            match self {
5299                Self::Unspecified => std::option::Option::Some(0),
5300                Self::Active => std::option::Option::Some(1),
5301                Self::Stale => std::option::Option::Some(2),
5302                Self::Inactive => std::option::Option::Some(3),
5303                Self::UnknownValue(u) => u.0.value(),
5304            }
5305        }
5306
5307        /// Gets the enum value as a string.
5308        ///
5309        /// Returns `None` if the enum contains an unknown value deserialized from
5310        /// the integer representation of enums.
5311        pub fn name(&self) -> std::option::Option<&str> {
5312            match self {
5313                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5314                Self::Active => std::option::Option::Some("STATE_ACTIVE"),
5315                Self::Stale => std::option::Option::Some("STATE_STALE"),
5316                Self::Inactive => std::option::Option::Some("STATE_INACTIVE"),
5317                Self::UnknownValue(u) => u.0.name(),
5318            }
5319        }
5320    }
5321
5322    impl std::default::Default for State {
5323        fn default() -> Self {
5324            use std::convert::From;
5325            Self::from(0)
5326        }
5327    }
5328
5329    impl std::fmt::Display for State {
5330        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5331            wkt::internal::display_enum(f, self.name(), self.value())
5332        }
5333    }
5334
5335    impl std::convert::From<i32> for State {
5336        fn from(value: i32) -> Self {
5337            match value {
5338                0 => Self::Unspecified,
5339                1 => Self::Active,
5340                2 => Self::Stale,
5341                3 => Self::Inactive,
5342                _ => Self::UnknownValue(state::UnknownValue(
5343                    wkt::internal::UnknownEnumValue::Integer(value),
5344                )),
5345            }
5346        }
5347    }
5348
5349    impl std::convert::From<&str> for State {
5350        fn from(value: &str) -> Self {
5351            use std::string::ToString;
5352            match value {
5353                "STATE_UNSPECIFIED" => Self::Unspecified,
5354                "STATE_ACTIVE" => Self::Active,
5355                "STATE_STALE" => Self::Stale,
5356                "STATE_INACTIVE" => Self::Inactive,
5357                _ => Self::UnknownValue(state::UnknownValue(
5358                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5359                )),
5360            }
5361        }
5362    }
5363
5364    impl serde::ser::Serialize for State {
5365        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5366        where
5367            S: serde::Serializer,
5368        {
5369            match self {
5370                Self::Unspecified => serializer.serialize_i32(0),
5371                Self::Active => serializer.serialize_i32(1),
5372                Self::Stale => serializer.serialize_i32(2),
5373                Self::Inactive => serializer.serialize_i32(3),
5374                Self::UnknownValue(u) => u.0.serialize(serializer),
5375            }
5376        }
5377    }
5378
5379    impl<'de> serde::de::Deserialize<'de> for State {
5380        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5381        where
5382            D: serde::Deserializer<'de>,
5383        {
5384            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5385                ".google.cloud.bigquery.analyticshub.v1.Subscription.State",
5386            ))
5387        }
5388    }
5389
5390    #[allow(missing_docs)]
5391    #[derive(Clone, Debug, PartialEq)]
5392    #[non_exhaustive]
5393    pub enum ResourceName {
5394        /// Output only. Resource name of the source Listing.
5395        /// e.g. projects/123/locations/us/dataExchanges/456/listings/789
5396        Listing(std::string::String),
5397        /// Output only. Resource name of the source Data Exchange.
5398        /// e.g. projects/123/locations/us/dataExchanges/456
5399        DataExchange(std::string::String),
5400    }
5401}
5402
5403/// Message for requesting the list of data exchanges.
5404#[derive(Clone, Default, PartialEq)]
5405#[non_exhaustive]
5406pub struct ListDataExchangesRequest {
5407    /// Required. The parent resource path of the data exchanges.
5408    /// e.g. `projects/myproject/locations/us`.
5409    pub parent: std::string::String,
5410
5411    /// The maximum number of results to return in a single response page. Leverage
5412    /// the page tokens to iterate through the entire collection.
5413    pub page_size: i32,
5414
5415    /// Page token, returned by a previous call, to request the next page of
5416    /// results.
5417    pub page_token: std::string::String,
5418
5419    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5420}
5421
5422impl ListDataExchangesRequest {
5423    /// Creates a new default instance.
5424    pub fn new() -> Self {
5425        std::default::Default::default()
5426    }
5427
5428    /// Sets the value of [parent][crate::model::ListDataExchangesRequest::parent].
5429    ///
5430    /// # Example
5431    /// ```ignore,no_run
5432    /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesRequest;
5433    /// # let project_id = "project_id";
5434    /// # let location_id = "location_id";
5435    /// let x = ListDataExchangesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5436    /// ```
5437    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5438        self.parent = v.into();
5439        self
5440    }
5441
5442    /// Sets the value of [page_size][crate::model::ListDataExchangesRequest::page_size].
5443    ///
5444    /// # Example
5445    /// ```ignore,no_run
5446    /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesRequest;
5447    /// let x = ListDataExchangesRequest::new().set_page_size(42);
5448    /// ```
5449    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5450        self.page_size = v.into();
5451        self
5452    }
5453
5454    /// Sets the value of [page_token][crate::model::ListDataExchangesRequest::page_token].
5455    ///
5456    /// # Example
5457    /// ```ignore,no_run
5458    /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesRequest;
5459    /// let x = ListDataExchangesRequest::new().set_page_token("example");
5460    /// ```
5461    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5462        self.page_token = v.into();
5463        self
5464    }
5465}
5466
5467impl wkt::message::Message for ListDataExchangesRequest {
5468    fn typename() -> &'static str {
5469        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest"
5470    }
5471}
5472
5473/// Message for response to the list of data exchanges.
5474#[derive(Clone, Default, PartialEq)]
5475#[non_exhaustive]
5476pub struct ListDataExchangesResponse {
5477    /// The list of data exchanges.
5478    pub data_exchanges: std::vec::Vec<crate::model::DataExchange>,
5479
5480    /// A token to request the next page of results.
5481    pub next_page_token: std::string::String,
5482
5483    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5484}
5485
5486impl ListDataExchangesResponse {
5487    /// Creates a new default instance.
5488    pub fn new() -> Self {
5489        std::default::Default::default()
5490    }
5491
5492    /// Sets the value of [data_exchanges][crate::model::ListDataExchangesResponse::data_exchanges].
5493    ///
5494    /// # Example
5495    /// ```ignore,no_run
5496    /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesResponse;
5497    /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5498    /// let x = ListDataExchangesResponse::new()
5499    ///     .set_data_exchanges([
5500    ///         DataExchange::default()/* use setters */,
5501    ///         DataExchange::default()/* use (different) setters */,
5502    ///     ]);
5503    /// ```
5504    pub fn set_data_exchanges<T, V>(mut self, v: T) -> Self
5505    where
5506        T: std::iter::IntoIterator<Item = V>,
5507        V: std::convert::Into<crate::model::DataExchange>,
5508    {
5509        use std::iter::Iterator;
5510        self.data_exchanges = v.into_iter().map(|i| i.into()).collect();
5511        self
5512    }
5513
5514    /// Sets the value of [next_page_token][crate::model::ListDataExchangesResponse::next_page_token].
5515    ///
5516    /// # Example
5517    /// ```ignore,no_run
5518    /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesResponse;
5519    /// let x = ListDataExchangesResponse::new().set_next_page_token("example");
5520    /// ```
5521    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5522        self.next_page_token = v.into();
5523        self
5524    }
5525}
5526
5527impl wkt::message::Message for ListDataExchangesResponse {
5528    fn typename() -> &'static str {
5529        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse"
5530    }
5531}
5532
5533#[doc(hidden)]
5534impl google_cloud_gax::paginator::internal::PageableResponse for ListDataExchangesResponse {
5535    type PageItem = crate::model::DataExchange;
5536
5537    fn items(self) -> std::vec::Vec<Self::PageItem> {
5538        self.data_exchanges
5539    }
5540
5541    fn next_page_token(&self) -> std::string::String {
5542        use std::clone::Clone;
5543        self.next_page_token.clone()
5544    }
5545}
5546
5547/// Message for requesting the list of data exchanges from projects in an
5548/// organization and location.
5549#[derive(Clone, Default, PartialEq)]
5550#[non_exhaustive]
5551pub struct ListOrgDataExchangesRequest {
5552    /// Required. The organization resource path of the projects containing
5553    /// DataExchanges. e.g. `organizations/myorg/locations/us`.
5554    pub organization: std::string::String,
5555
5556    /// The maximum number of results to return in a single response page. Leverage
5557    /// the page tokens to iterate through the entire collection.
5558    pub page_size: i32,
5559
5560    /// Page token, returned by a previous call, to request the next page of
5561    /// results.
5562    pub page_token: std::string::String,
5563
5564    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5565}
5566
5567impl ListOrgDataExchangesRequest {
5568    /// Creates a new default instance.
5569    pub fn new() -> Self {
5570        std::default::Default::default()
5571    }
5572
5573    /// Sets the value of [organization][crate::model::ListOrgDataExchangesRequest::organization].
5574    ///
5575    /// # Example
5576    /// ```ignore,no_run
5577    /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesRequest;
5578    /// let x = ListOrgDataExchangesRequest::new().set_organization("example");
5579    /// ```
5580    pub fn set_organization<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5581        self.organization = v.into();
5582        self
5583    }
5584
5585    /// Sets the value of [page_size][crate::model::ListOrgDataExchangesRequest::page_size].
5586    ///
5587    /// # Example
5588    /// ```ignore,no_run
5589    /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesRequest;
5590    /// let x = ListOrgDataExchangesRequest::new().set_page_size(42);
5591    /// ```
5592    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5593        self.page_size = v.into();
5594        self
5595    }
5596
5597    /// Sets the value of [page_token][crate::model::ListOrgDataExchangesRequest::page_token].
5598    ///
5599    /// # Example
5600    /// ```ignore,no_run
5601    /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesRequest;
5602    /// let x = ListOrgDataExchangesRequest::new().set_page_token("example");
5603    /// ```
5604    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5605        self.page_token = v.into();
5606        self
5607    }
5608}
5609
5610impl wkt::message::Message for ListOrgDataExchangesRequest {
5611    fn typename() -> &'static str {
5612        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest"
5613    }
5614}
5615
5616/// Message for response to listing data exchanges in an organization and
5617/// location.
5618#[derive(Clone, Default, PartialEq)]
5619#[non_exhaustive]
5620pub struct ListOrgDataExchangesResponse {
5621    /// The list of data exchanges.
5622    pub data_exchanges: std::vec::Vec<crate::model::DataExchange>,
5623
5624    /// A token to request the next page of results.
5625    pub next_page_token: std::string::String,
5626
5627    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5628}
5629
5630impl ListOrgDataExchangesResponse {
5631    /// Creates a new default instance.
5632    pub fn new() -> Self {
5633        std::default::Default::default()
5634    }
5635
5636    /// Sets the value of [data_exchanges][crate::model::ListOrgDataExchangesResponse::data_exchanges].
5637    ///
5638    /// # Example
5639    /// ```ignore,no_run
5640    /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesResponse;
5641    /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5642    /// let x = ListOrgDataExchangesResponse::new()
5643    ///     .set_data_exchanges([
5644    ///         DataExchange::default()/* use setters */,
5645    ///         DataExchange::default()/* use (different) setters */,
5646    ///     ]);
5647    /// ```
5648    pub fn set_data_exchanges<T, V>(mut self, v: T) -> Self
5649    where
5650        T: std::iter::IntoIterator<Item = V>,
5651        V: std::convert::Into<crate::model::DataExchange>,
5652    {
5653        use std::iter::Iterator;
5654        self.data_exchanges = v.into_iter().map(|i| i.into()).collect();
5655        self
5656    }
5657
5658    /// Sets the value of [next_page_token][crate::model::ListOrgDataExchangesResponse::next_page_token].
5659    ///
5660    /// # Example
5661    /// ```ignore,no_run
5662    /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesResponse;
5663    /// let x = ListOrgDataExchangesResponse::new().set_next_page_token("example");
5664    /// ```
5665    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5666        self.next_page_token = v.into();
5667        self
5668    }
5669}
5670
5671impl wkt::message::Message for ListOrgDataExchangesResponse {
5672    fn typename() -> &'static str {
5673        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse"
5674    }
5675}
5676
5677#[doc(hidden)]
5678impl google_cloud_gax::paginator::internal::PageableResponse for ListOrgDataExchangesResponse {
5679    type PageItem = crate::model::DataExchange;
5680
5681    fn items(self) -> std::vec::Vec<Self::PageItem> {
5682        self.data_exchanges
5683    }
5684
5685    fn next_page_token(&self) -> std::string::String {
5686        use std::clone::Clone;
5687        self.next_page_token.clone()
5688    }
5689}
5690
5691/// Message for getting a data exchange.
5692#[derive(Clone, Default, PartialEq)]
5693#[non_exhaustive]
5694pub struct GetDataExchangeRequest {
5695    /// Required. The resource name of the data exchange.
5696    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
5697    pub name: std::string::String,
5698
5699    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5700}
5701
5702impl GetDataExchangeRequest {
5703    /// Creates a new default instance.
5704    pub fn new() -> Self {
5705        std::default::Default::default()
5706    }
5707
5708    /// Sets the value of [name][crate::model::GetDataExchangeRequest::name].
5709    ///
5710    /// # Example
5711    /// ```ignore,no_run
5712    /// # use google_cloud_bigquery_analyticshub_v1::model::GetDataExchangeRequest;
5713    /// # let project_id = "project_id";
5714    /// # let location_id = "location_id";
5715    /// # let data_exchange_id = "data_exchange_id";
5716    /// let x = GetDataExchangeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}"));
5717    /// ```
5718    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5719        self.name = v.into();
5720        self
5721    }
5722}
5723
5724impl wkt::message::Message for GetDataExchangeRequest {
5725    fn typename() -> &'static str {
5726        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest"
5727    }
5728}
5729
5730/// Message for creating a data exchange.
5731#[derive(Clone, Default, PartialEq)]
5732#[non_exhaustive]
5733pub struct CreateDataExchangeRequest {
5734    /// Required. The parent resource path of the data exchange.
5735    /// e.g. `projects/myproject/locations/us`.
5736    pub parent: std::string::String,
5737
5738    /// Required. The ID of the data exchange.
5739    /// Must contain only Unicode letters, numbers (0-9), underscores (_).
5740    /// Max length: 100 bytes.
5741    pub data_exchange_id: std::string::String,
5742
5743    /// Required. The data exchange to create.
5744    pub data_exchange: std::option::Option<crate::model::DataExchange>,
5745
5746    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5747}
5748
5749impl CreateDataExchangeRequest {
5750    /// Creates a new default instance.
5751    pub fn new() -> Self {
5752        std::default::Default::default()
5753    }
5754
5755    /// Sets the value of [parent][crate::model::CreateDataExchangeRequest::parent].
5756    ///
5757    /// # Example
5758    /// ```ignore,no_run
5759    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5760    /// # let project_id = "project_id";
5761    /// # let location_id = "location_id";
5762    /// let x = CreateDataExchangeRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5763    /// ```
5764    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5765        self.parent = v.into();
5766        self
5767    }
5768
5769    /// Sets the value of [data_exchange_id][crate::model::CreateDataExchangeRequest::data_exchange_id].
5770    ///
5771    /// # Example
5772    /// ```ignore,no_run
5773    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5774    /// let x = CreateDataExchangeRequest::new().set_data_exchange_id("example");
5775    /// ```
5776    pub fn set_data_exchange_id<T: std::convert::Into<std::string::String>>(
5777        mut self,
5778        v: T,
5779    ) -> Self {
5780        self.data_exchange_id = v.into();
5781        self
5782    }
5783
5784    /// Sets the value of [data_exchange][crate::model::CreateDataExchangeRequest::data_exchange].
5785    ///
5786    /// # Example
5787    /// ```ignore,no_run
5788    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5789    /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5790    /// let x = CreateDataExchangeRequest::new().set_data_exchange(DataExchange::default()/* use setters */);
5791    /// ```
5792    pub fn set_data_exchange<T>(mut self, v: T) -> Self
5793    where
5794        T: std::convert::Into<crate::model::DataExchange>,
5795    {
5796        self.data_exchange = std::option::Option::Some(v.into());
5797        self
5798    }
5799
5800    /// Sets or clears the value of [data_exchange][crate::model::CreateDataExchangeRequest::data_exchange].
5801    ///
5802    /// # Example
5803    /// ```ignore,no_run
5804    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5805    /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5806    /// let x = CreateDataExchangeRequest::new().set_or_clear_data_exchange(Some(DataExchange::default()/* use setters */));
5807    /// let x = CreateDataExchangeRequest::new().set_or_clear_data_exchange(None::<DataExchange>);
5808    /// ```
5809    pub fn set_or_clear_data_exchange<T>(mut self, v: std::option::Option<T>) -> Self
5810    where
5811        T: std::convert::Into<crate::model::DataExchange>,
5812    {
5813        self.data_exchange = v.map(|x| x.into());
5814        self
5815    }
5816}
5817
5818impl wkt::message::Message for CreateDataExchangeRequest {
5819    fn typename() -> &'static str {
5820        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest"
5821    }
5822}
5823
5824/// Message for updating a data exchange.
5825#[derive(Clone, Default, PartialEq)]
5826#[non_exhaustive]
5827pub struct UpdateDataExchangeRequest {
5828    /// Required. Field mask specifies the fields to update in the data exchange
5829    /// resource. The fields specified in the
5830    /// `updateMask` are relative to the resource and are not a full request.
5831    pub update_mask: std::option::Option<wkt::FieldMask>,
5832
5833    /// Required. The data exchange to update.
5834    pub data_exchange: std::option::Option<crate::model::DataExchange>,
5835
5836    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5837}
5838
5839impl UpdateDataExchangeRequest {
5840    /// Creates a new default instance.
5841    pub fn new() -> Self {
5842        std::default::Default::default()
5843    }
5844
5845    /// Sets the value of [update_mask][crate::model::UpdateDataExchangeRequest::update_mask].
5846    ///
5847    /// # Example
5848    /// ```ignore,no_run
5849    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5850    /// use wkt::FieldMask;
5851    /// let x = UpdateDataExchangeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5852    /// ```
5853    pub fn set_update_mask<T>(mut self, v: T) -> Self
5854    where
5855        T: std::convert::Into<wkt::FieldMask>,
5856    {
5857        self.update_mask = std::option::Option::Some(v.into());
5858        self
5859    }
5860
5861    /// Sets or clears the value of [update_mask][crate::model::UpdateDataExchangeRequest::update_mask].
5862    ///
5863    /// # Example
5864    /// ```ignore,no_run
5865    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5866    /// use wkt::FieldMask;
5867    /// let x = UpdateDataExchangeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5868    /// let x = UpdateDataExchangeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5869    /// ```
5870    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5871    where
5872        T: std::convert::Into<wkt::FieldMask>,
5873    {
5874        self.update_mask = v.map(|x| x.into());
5875        self
5876    }
5877
5878    /// Sets the value of [data_exchange][crate::model::UpdateDataExchangeRequest::data_exchange].
5879    ///
5880    /// # Example
5881    /// ```ignore,no_run
5882    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5883    /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5884    /// let x = UpdateDataExchangeRequest::new().set_data_exchange(DataExchange::default()/* use setters */);
5885    /// ```
5886    pub fn set_data_exchange<T>(mut self, v: T) -> Self
5887    where
5888        T: std::convert::Into<crate::model::DataExchange>,
5889    {
5890        self.data_exchange = std::option::Option::Some(v.into());
5891        self
5892    }
5893
5894    /// Sets or clears the value of [data_exchange][crate::model::UpdateDataExchangeRequest::data_exchange].
5895    ///
5896    /// # Example
5897    /// ```ignore,no_run
5898    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5899    /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5900    /// let x = UpdateDataExchangeRequest::new().set_or_clear_data_exchange(Some(DataExchange::default()/* use setters */));
5901    /// let x = UpdateDataExchangeRequest::new().set_or_clear_data_exchange(None::<DataExchange>);
5902    /// ```
5903    pub fn set_or_clear_data_exchange<T>(mut self, v: std::option::Option<T>) -> Self
5904    where
5905        T: std::convert::Into<crate::model::DataExchange>,
5906    {
5907        self.data_exchange = v.map(|x| x.into());
5908        self
5909    }
5910}
5911
5912impl wkt::message::Message for UpdateDataExchangeRequest {
5913    fn typename() -> &'static str {
5914        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest"
5915    }
5916}
5917
5918/// Message for deleting a data exchange.
5919#[derive(Clone, Default, PartialEq)]
5920#[non_exhaustive]
5921pub struct DeleteDataExchangeRequest {
5922    /// Required. The full name of the data exchange resource that you want to
5923    /// delete. For example, `projects/myproject/locations/us/dataExchanges/123`.
5924    pub name: std::string::String,
5925
5926    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5927}
5928
5929impl DeleteDataExchangeRequest {
5930    /// Creates a new default instance.
5931    pub fn new() -> Self {
5932        std::default::Default::default()
5933    }
5934
5935    /// Sets the value of [name][crate::model::DeleteDataExchangeRequest::name].
5936    ///
5937    /// # Example
5938    /// ```ignore,no_run
5939    /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteDataExchangeRequest;
5940    /// # let project_id = "project_id";
5941    /// # let location_id = "location_id";
5942    /// # let data_exchange_id = "data_exchange_id";
5943    /// let x = DeleteDataExchangeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}"));
5944    /// ```
5945    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5946        self.name = v.into();
5947        self
5948    }
5949}
5950
5951impl wkt::message::Message for DeleteDataExchangeRequest {
5952    fn typename() -> &'static str {
5953        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest"
5954    }
5955}
5956
5957/// Message for requesting the list of listings.
5958#[derive(Clone, Default, PartialEq)]
5959#[non_exhaustive]
5960pub struct ListListingsRequest {
5961    /// Required. The parent resource path of the listing.
5962    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
5963    pub parent: std::string::String,
5964
5965    /// The maximum number of results to return in a single response page. Leverage
5966    /// the page tokens to iterate through the entire collection.
5967    pub page_size: i32,
5968
5969    /// Page token, returned by a previous call, to request the next page of
5970    /// results.
5971    pub page_token: std::string::String,
5972
5973    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5974}
5975
5976impl ListListingsRequest {
5977    /// Creates a new default instance.
5978    pub fn new() -> Self {
5979        std::default::Default::default()
5980    }
5981
5982    /// Sets the value of [parent][crate::model::ListListingsRequest::parent].
5983    ///
5984    /// # Example
5985    /// ```ignore,no_run
5986    /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsRequest;
5987    /// # let project_id = "project_id";
5988    /// # let location_id = "location_id";
5989    /// # let data_exchange_id = "data_exchange_id";
5990    /// let x = ListListingsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}"));
5991    /// ```
5992    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5993        self.parent = v.into();
5994        self
5995    }
5996
5997    /// Sets the value of [page_size][crate::model::ListListingsRequest::page_size].
5998    ///
5999    /// # Example
6000    /// ```ignore,no_run
6001    /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsRequest;
6002    /// let x = ListListingsRequest::new().set_page_size(42);
6003    /// ```
6004    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6005        self.page_size = v.into();
6006        self
6007    }
6008
6009    /// Sets the value of [page_token][crate::model::ListListingsRequest::page_token].
6010    ///
6011    /// # Example
6012    /// ```ignore,no_run
6013    /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsRequest;
6014    /// let x = ListListingsRequest::new().set_page_token("example");
6015    /// ```
6016    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6017        self.page_token = v.into();
6018        self
6019    }
6020}
6021
6022impl wkt::message::Message for ListListingsRequest {
6023    fn typename() -> &'static str {
6024        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListListingsRequest"
6025    }
6026}
6027
6028/// Message for response to the list of Listings.
6029#[derive(Clone, Default, PartialEq)]
6030#[non_exhaustive]
6031pub struct ListListingsResponse {
6032    /// The list of Listing.
6033    pub listings: std::vec::Vec<crate::model::Listing>,
6034
6035    /// A token to request the next page of results.
6036    pub next_page_token: std::string::String,
6037
6038    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6039}
6040
6041impl ListListingsResponse {
6042    /// Creates a new default instance.
6043    pub fn new() -> Self {
6044        std::default::Default::default()
6045    }
6046
6047    /// Sets the value of [listings][crate::model::ListListingsResponse::listings].
6048    ///
6049    /// # Example
6050    /// ```ignore,no_run
6051    /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsResponse;
6052    /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6053    /// let x = ListListingsResponse::new()
6054    ///     .set_listings([
6055    ///         Listing::default()/* use setters */,
6056    ///         Listing::default()/* use (different) setters */,
6057    ///     ]);
6058    /// ```
6059    pub fn set_listings<T, V>(mut self, v: T) -> Self
6060    where
6061        T: std::iter::IntoIterator<Item = V>,
6062        V: std::convert::Into<crate::model::Listing>,
6063    {
6064        use std::iter::Iterator;
6065        self.listings = v.into_iter().map(|i| i.into()).collect();
6066        self
6067    }
6068
6069    /// Sets the value of [next_page_token][crate::model::ListListingsResponse::next_page_token].
6070    ///
6071    /// # Example
6072    /// ```ignore,no_run
6073    /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsResponse;
6074    /// let x = ListListingsResponse::new().set_next_page_token("example");
6075    /// ```
6076    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6077        self.next_page_token = v.into();
6078        self
6079    }
6080}
6081
6082impl wkt::message::Message for ListListingsResponse {
6083    fn typename() -> &'static str {
6084        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListListingsResponse"
6085    }
6086}
6087
6088#[doc(hidden)]
6089impl google_cloud_gax::paginator::internal::PageableResponse for ListListingsResponse {
6090    type PageItem = crate::model::Listing;
6091
6092    fn items(self) -> std::vec::Vec<Self::PageItem> {
6093        self.listings
6094    }
6095
6096    fn next_page_token(&self) -> std::string::String {
6097        use std::clone::Clone;
6098        self.next_page_token.clone()
6099    }
6100}
6101
6102/// Message for getting a listing.
6103#[derive(Clone, Default, PartialEq)]
6104#[non_exhaustive]
6105pub struct GetListingRequest {
6106    /// Required. The resource name of the listing.
6107    /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`.
6108    pub name: std::string::String,
6109
6110    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6111}
6112
6113impl GetListingRequest {
6114    /// Creates a new default instance.
6115    pub fn new() -> Self {
6116        std::default::Default::default()
6117    }
6118
6119    /// Sets the value of [name][crate::model::GetListingRequest::name].
6120    ///
6121    /// # Example
6122    /// ```ignore,no_run
6123    /// # use google_cloud_bigquery_analyticshub_v1::model::GetListingRequest;
6124    /// # let project_id = "project_id";
6125    /// # let location_id = "location_id";
6126    /// # let data_exchange_id = "data_exchange_id";
6127    /// # let listing_id = "listing_id";
6128    /// let x = GetListingRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}/listings/{listing_id}"));
6129    /// ```
6130    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6131        self.name = v.into();
6132        self
6133    }
6134}
6135
6136impl wkt::message::Message for GetListingRequest {
6137    fn typename() -> &'static str {
6138        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetListingRequest"
6139    }
6140}
6141
6142/// Message for creating a listing.
6143#[derive(Clone, Default, PartialEq)]
6144#[non_exhaustive]
6145pub struct CreateListingRequest {
6146    /// Required. The parent resource path of the listing.
6147    /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
6148    pub parent: std::string::String,
6149
6150    /// Required. The ID of the listing to create.
6151    /// Must contain only Unicode letters, numbers (0-9), underscores (_).
6152    /// Max length: 100 bytes.
6153    pub listing_id: std::string::String,
6154
6155    /// Required. The listing to create.
6156    pub listing: std::option::Option<crate::model::Listing>,
6157
6158    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6159}
6160
6161impl CreateListingRequest {
6162    /// Creates a new default instance.
6163    pub fn new() -> Self {
6164        std::default::Default::default()
6165    }
6166
6167    /// Sets the value of [parent][crate::model::CreateListingRequest::parent].
6168    ///
6169    /// # Example
6170    /// ```ignore,no_run
6171    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6172    /// # let project_id = "project_id";
6173    /// # let location_id = "location_id";
6174    /// # let data_exchange_id = "data_exchange_id";
6175    /// let x = CreateListingRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}"));
6176    /// ```
6177    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6178        self.parent = v.into();
6179        self
6180    }
6181
6182    /// Sets the value of [listing_id][crate::model::CreateListingRequest::listing_id].
6183    ///
6184    /// # Example
6185    /// ```ignore,no_run
6186    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6187    /// let x = CreateListingRequest::new().set_listing_id("example");
6188    /// ```
6189    pub fn set_listing_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6190        self.listing_id = v.into();
6191        self
6192    }
6193
6194    /// Sets the value of [listing][crate::model::CreateListingRequest::listing].
6195    ///
6196    /// # Example
6197    /// ```ignore,no_run
6198    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6199    /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6200    /// let x = CreateListingRequest::new().set_listing(Listing::default()/* use setters */);
6201    /// ```
6202    pub fn set_listing<T>(mut self, v: T) -> Self
6203    where
6204        T: std::convert::Into<crate::model::Listing>,
6205    {
6206        self.listing = std::option::Option::Some(v.into());
6207        self
6208    }
6209
6210    /// Sets or clears the value of [listing][crate::model::CreateListingRequest::listing].
6211    ///
6212    /// # Example
6213    /// ```ignore,no_run
6214    /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6215    /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6216    /// let x = CreateListingRequest::new().set_or_clear_listing(Some(Listing::default()/* use setters */));
6217    /// let x = CreateListingRequest::new().set_or_clear_listing(None::<Listing>);
6218    /// ```
6219    pub fn set_or_clear_listing<T>(mut self, v: std::option::Option<T>) -> Self
6220    where
6221        T: std::convert::Into<crate::model::Listing>,
6222    {
6223        self.listing = v.map(|x| x.into());
6224        self
6225    }
6226}
6227
6228impl wkt::message::Message for CreateListingRequest {
6229    fn typename() -> &'static str {
6230        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CreateListingRequest"
6231    }
6232}
6233
6234/// Message for updating a Listing.
6235#[derive(Clone, Default, PartialEq)]
6236#[non_exhaustive]
6237pub struct UpdateListingRequest {
6238    /// Required. Field mask specifies the fields to update in the listing
6239    /// resource. The fields specified in the `updateMask` are relative to the
6240    /// resource and are not a full request.
6241    pub update_mask: std::option::Option<wkt::FieldMask>,
6242
6243    /// Required. The listing to update.
6244    pub listing: std::option::Option<crate::model::Listing>,
6245
6246    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6247}
6248
6249impl UpdateListingRequest {
6250    /// Creates a new default instance.
6251    pub fn new() -> Self {
6252        std::default::Default::default()
6253    }
6254
6255    /// Sets the value of [update_mask][crate::model::UpdateListingRequest::update_mask].
6256    ///
6257    /// # Example
6258    /// ```ignore,no_run
6259    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6260    /// use wkt::FieldMask;
6261    /// let x = UpdateListingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6262    /// ```
6263    pub fn set_update_mask<T>(mut self, v: T) -> Self
6264    where
6265        T: std::convert::Into<wkt::FieldMask>,
6266    {
6267        self.update_mask = std::option::Option::Some(v.into());
6268        self
6269    }
6270
6271    /// Sets or clears the value of [update_mask][crate::model::UpdateListingRequest::update_mask].
6272    ///
6273    /// # Example
6274    /// ```ignore,no_run
6275    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6276    /// use wkt::FieldMask;
6277    /// let x = UpdateListingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6278    /// let x = UpdateListingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6279    /// ```
6280    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6281    where
6282        T: std::convert::Into<wkt::FieldMask>,
6283    {
6284        self.update_mask = v.map(|x| x.into());
6285        self
6286    }
6287
6288    /// Sets the value of [listing][crate::model::UpdateListingRequest::listing].
6289    ///
6290    /// # Example
6291    /// ```ignore,no_run
6292    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6293    /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6294    /// let x = UpdateListingRequest::new().set_listing(Listing::default()/* use setters */);
6295    /// ```
6296    pub fn set_listing<T>(mut self, v: T) -> Self
6297    where
6298        T: std::convert::Into<crate::model::Listing>,
6299    {
6300        self.listing = std::option::Option::Some(v.into());
6301        self
6302    }
6303
6304    /// Sets or clears the value of [listing][crate::model::UpdateListingRequest::listing].
6305    ///
6306    /// # Example
6307    /// ```ignore,no_run
6308    /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6309    /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6310    /// let x = UpdateListingRequest::new().set_or_clear_listing(Some(Listing::default()/* use setters */));
6311    /// let x = UpdateListingRequest::new().set_or_clear_listing(None::<Listing>);
6312    /// ```
6313    pub fn set_or_clear_listing<T>(mut self, v: std::option::Option<T>) -> Self
6314    where
6315        T: std::convert::Into<crate::model::Listing>,
6316    {
6317        self.listing = v.map(|x| x.into());
6318        self
6319    }
6320}
6321
6322impl wkt::message::Message for UpdateListingRequest {
6323    fn typename() -> &'static str {
6324        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.UpdateListingRequest"
6325    }
6326}
6327
6328/// Message for deleting a listing.
6329#[derive(Clone, Default, PartialEq)]
6330#[non_exhaustive]
6331pub struct DeleteListingRequest {
6332    /// Required. Resource name of the listing to delete.
6333    /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`.
6334    pub name: std::string::String,
6335
6336    /// Optional. If the listing is commercial then this field must be set to true,
6337    /// otherwise a failure is thrown. This acts as a safety guard to avoid
6338    /// deleting commercial listings accidentally.
6339    pub delete_commercial: bool,
6340
6341    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6342}
6343
6344impl DeleteListingRequest {
6345    /// Creates a new default instance.
6346    pub fn new() -> Self {
6347        std::default::Default::default()
6348    }
6349
6350    /// Sets the value of [name][crate::model::DeleteListingRequest::name].
6351    ///
6352    /// # Example
6353    /// ```ignore,no_run
6354    /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteListingRequest;
6355    /// # let project_id = "project_id";
6356    /// # let location_id = "location_id";
6357    /// # let data_exchange_id = "data_exchange_id";
6358    /// # let listing_id = "listing_id";
6359    /// let x = DeleteListingRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}/listings/{listing_id}"));
6360    /// ```
6361    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6362        self.name = v.into();
6363        self
6364    }
6365
6366    /// Sets the value of [delete_commercial][crate::model::DeleteListingRequest::delete_commercial].
6367    ///
6368    /// # Example
6369    /// ```ignore,no_run
6370    /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteListingRequest;
6371    /// let x = DeleteListingRequest::new().set_delete_commercial(true);
6372    /// ```
6373    pub fn set_delete_commercial<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6374        self.delete_commercial = v.into();
6375        self
6376    }
6377}
6378
6379impl wkt::message::Message for DeleteListingRequest {
6380    fn typename() -> &'static str {
6381        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteListingRequest"
6382    }
6383}
6384
6385/// Message for subscribing to a listing.
6386#[derive(Clone, Default, PartialEq)]
6387#[non_exhaustive]
6388pub struct SubscribeListingRequest {
6389    /// Required. Resource name of the listing that you want to subscribe to.
6390    /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`.
6391    pub name: std::string::String,
6392
6393    /// Resulting destination of the listing that you subscribed to.
6394    pub destination: std::option::Option<crate::model::subscribe_listing_request::Destination>,
6395
6396    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6397}
6398
6399impl SubscribeListingRequest {
6400    /// Creates a new default instance.
6401    pub fn new() -> Self {
6402        std::default::Default::default()
6403    }
6404
6405    /// Sets the value of [name][crate::model::SubscribeListingRequest::name].
6406    ///
6407    /// # Example
6408    /// ```ignore,no_run
6409    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6410    /// # let project_id = "project_id";
6411    /// # let location_id = "location_id";
6412    /// # let data_exchange_id = "data_exchange_id";
6413    /// # let listing_id = "listing_id";
6414    /// let x = SubscribeListingRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}/listings/{listing_id}"));
6415    /// ```
6416    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6417        self.name = v.into();
6418        self
6419    }
6420
6421    /// Sets the value of [destination][crate::model::SubscribeListingRequest::destination].
6422    ///
6423    /// Note that all the setters affecting `destination` are mutually
6424    /// exclusive.
6425    ///
6426    /// # Example
6427    /// ```ignore,no_run
6428    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6429    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6430    /// let x = SubscribeListingRequest::new().set_destination(Some(
6431    ///     google_cloud_bigquery_analyticshub_v1::model::subscribe_listing_request::Destination::DestinationDataset(DestinationDataset::default().into())));
6432    /// ```
6433    pub fn set_destination<
6434        T: std::convert::Into<
6435                std::option::Option<crate::model::subscribe_listing_request::Destination>,
6436            >,
6437    >(
6438        mut self,
6439        v: T,
6440    ) -> Self {
6441        self.destination = v.into();
6442        self
6443    }
6444
6445    /// The value of [destination][crate::model::SubscribeListingRequest::destination]
6446    /// if it holds a `DestinationDataset`, `None` if the field is not set or
6447    /// holds a different branch.
6448    pub fn destination_dataset(
6449        &self,
6450    ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationDataset>> {
6451        #[allow(unreachable_patterns)]
6452        self.destination.as_ref().and_then(|v| match v {
6453            crate::model::subscribe_listing_request::Destination::DestinationDataset(v) => {
6454                std::option::Option::Some(v)
6455            }
6456            _ => std::option::Option::None,
6457        })
6458    }
6459
6460    /// Sets the value of [destination][crate::model::SubscribeListingRequest::destination]
6461    /// to hold a `DestinationDataset`.
6462    ///
6463    /// Note that all the setters affecting `destination` are
6464    /// mutually exclusive.
6465    ///
6466    /// # Example
6467    /// ```ignore,no_run
6468    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6469    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6470    /// let x = SubscribeListingRequest::new().set_destination_dataset(DestinationDataset::default()/* use setters */);
6471    /// assert!(x.destination_dataset().is_some());
6472    /// assert!(x.destination_pubsub_subscription().is_none());
6473    /// ```
6474    pub fn set_destination_dataset<
6475        T: std::convert::Into<std::boxed::Box<crate::model::DestinationDataset>>,
6476    >(
6477        mut self,
6478        v: T,
6479    ) -> Self {
6480        self.destination = std::option::Option::Some(
6481            crate::model::subscribe_listing_request::Destination::DestinationDataset(v.into()),
6482        );
6483        self
6484    }
6485
6486    /// The value of [destination][crate::model::SubscribeListingRequest::destination]
6487    /// if it holds a `DestinationPubsubSubscription`, `None` if the field is not set or
6488    /// holds a different branch.
6489    pub fn destination_pubsub_subscription(
6490        &self,
6491    ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationPubSubSubscription>> {
6492        #[allow(unreachable_patterns)]
6493        self.destination.as_ref().and_then(|v| match v {
6494            crate::model::subscribe_listing_request::Destination::DestinationPubsubSubscription(
6495                v,
6496            ) => std::option::Option::Some(v),
6497            _ => std::option::Option::None,
6498        })
6499    }
6500
6501    /// Sets the value of [destination][crate::model::SubscribeListingRequest::destination]
6502    /// to hold a `DestinationPubsubSubscription`.
6503    ///
6504    /// Note that all the setters affecting `destination` are
6505    /// mutually exclusive.
6506    ///
6507    /// # Example
6508    /// ```ignore,no_run
6509    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6510    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationPubSubSubscription;
6511    /// let x = SubscribeListingRequest::new().set_destination_pubsub_subscription(DestinationPubSubSubscription::default()/* use setters */);
6512    /// assert!(x.destination_pubsub_subscription().is_some());
6513    /// assert!(x.destination_dataset().is_none());
6514    /// ```
6515    pub fn set_destination_pubsub_subscription<
6516        T: std::convert::Into<std::boxed::Box<crate::model::DestinationPubSubSubscription>>,
6517    >(
6518        mut self,
6519        v: T,
6520    ) -> Self {
6521        self.destination = std::option::Option::Some(
6522            crate::model::subscribe_listing_request::Destination::DestinationPubsubSubscription(
6523                v.into(),
6524            ),
6525        );
6526        self
6527    }
6528}
6529
6530impl wkt::message::Message for SubscribeListingRequest {
6531    fn typename() -> &'static str {
6532        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest"
6533    }
6534}
6535
6536/// Defines additional types related to [SubscribeListingRequest].
6537pub mod subscribe_listing_request {
6538    #[allow(unused_imports)]
6539    use super::*;
6540
6541    /// Resulting destination of the listing that you subscribed to.
6542    #[derive(Clone, Debug, PartialEq)]
6543    #[non_exhaustive]
6544    pub enum Destination {
6545        /// Input only. BigQuery destination dataset to create for the subscriber.
6546        DestinationDataset(std::boxed::Box<crate::model::DestinationDataset>),
6547        /// Input only. Destination Pub/Sub subscription to create for the
6548        /// subscriber.
6549        DestinationPubsubSubscription(std::boxed::Box<crate::model::DestinationPubSubSubscription>),
6550    }
6551}
6552
6553/// Message for response when you subscribe to a listing.
6554#[derive(Clone, Default, PartialEq)]
6555#[non_exhaustive]
6556pub struct SubscribeListingResponse {
6557    /// Subscription object created from this subscribe action.
6558    pub subscription: std::option::Option<crate::model::Subscription>,
6559
6560    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6561}
6562
6563impl SubscribeListingResponse {
6564    /// Creates a new default instance.
6565    pub fn new() -> Self {
6566        std::default::Default::default()
6567    }
6568
6569    /// Sets the value of [subscription][crate::model::SubscribeListingResponse::subscription].
6570    ///
6571    /// # Example
6572    /// ```ignore,no_run
6573    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingResponse;
6574    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6575    /// let x = SubscribeListingResponse::new().set_subscription(Subscription::default()/* use setters */);
6576    /// ```
6577    pub fn set_subscription<T>(mut self, v: T) -> Self
6578    where
6579        T: std::convert::Into<crate::model::Subscription>,
6580    {
6581        self.subscription = std::option::Option::Some(v.into());
6582        self
6583    }
6584
6585    /// Sets or clears the value of [subscription][crate::model::SubscribeListingResponse::subscription].
6586    ///
6587    /// # Example
6588    /// ```ignore,no_run
6589    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingResponse;
6590    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6591    /// let x = SubscribeListingResponse::new().set_or_clear_subscription(Some(Subscription::default()/* use setters */));
6592    /// let x = SubscribeListingResponse::new().set_or_clear_subscription(None::<Subscription>);
6593    /// ```
6594    pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
6595    where
6596        T: std::convert::Into<crate::model::Subscription>,
6597    {
6598        self.subscription = v.map(|x| x.into());
6599        self
6600    }
6601}
6602
6603impl wkt::message::Message for SubscribeListingResponse {
6604    fn typename() -> &'static str {
6605        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse"
6606    }
6607}
6608
6609/// Message for subscribing to a Data Exchange.
6610#[derive(Clone, Default, PartialEq)]
6611#[non_exhaustive]
6612pub struct SubscribeDataExchangeRequest {
6613    /// Required. Resource name of the Data Exchange.
6614    /// e.g. `projects/publisherproject/locations/us/dataExchanges/123`
6615    pub name: std::string::String,
6616
6617    /// Required. The parent resource path of the Subscription.
6618    /// e.g. `projects/subscriberproject/locations/us`
6619    pub destination: std::string::String,
6620
6621    /// Optional. BigQuery destination dataset to create for the subscriber.
6622    pub destination_dataset: std::option::Option<crate::model::DestinationDataset>,
6623
6624    /// Required. Name of the subscription to create.
6625    /// e.g. `subscription1`
6626    pub subscription: std::string::String,
6627
6628    /// Email of the subscriber.
6629    pub subscriber_contact: std::string::String,
6630
6631    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6632}
6633
6634impl SubscribeDataExchangeRequest {
6635    /// Creates a new default instance.
6636    pub fn new() -> Self {
6637        std::default::Default::default()
6638    }
6639
6640    /// Sets the value of [name][crate::model::SubscribeDataExchangeRequest::name].
6641    ///
6642    /// # Example
6643    /// ```ignore,no_run
6644    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6645    /// # let project_id = "project_id";
6646    /// # let location_id = "location_id";
6647    /// # let data_exchange_id = "data_exchange_id";
6648    /// let x = SubscribeDataExchangeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/dataExchanges/{data_exchange_id}"));
6649    /// ```
6650    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6651        self.name = v.into();
6652        self
6653    }
6654
6655    /// Sets the value of [destination][crate::model::SubscribeDataExchangeRequest::destination].
6656    ///
6657    /// # Example
6658    /// ```ignore,no_run
6659    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6660    /// let x = SubscribeDataExchangeRequest::new().set_destination("example");
6661    /// ```
6662    pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6663        self.destination = v.into();
6664        self
6665    }
6666
6667    /// Sets the value of [destination_dataset][crate::model::SubscribeDataExchangeRequest::destination_dataset].
6668    ///
6669    /// # Example
6670    /// ```ignore,no_run
6671    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6672    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6673    /// let x = SubscribeDataExchangeRequest::new().set_destination_dataset(DestinationDataset::default()/* use setters */);
6674    /// ```
6675    pub fn set_destination_dataset<T>(mut self, v: T) -> Self
6676    where
6677        T: std::convert::Into<crate::model::DestinationDataset>,
6678    {
6679        self.destination_dataset = std::option::Option::Some(v.into());
6680        self
6681    }
6682
6683    /// Sets or clears the value of [destination_dataset][crate::model::SubscribeDataExchangeRequest::destination_dataset].
6684    ///
6685    /// # Example
6686    /// ```ignore,no_run
6687    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6688    /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6689    /// let x = SubscribeDataExchangeRequest::new().set_or_clear_destination_dataset(Some(DestinationDataset::default()/* use setters */));
6690    /// let x = SubscribeDataExchangeRequest::new().set_or_clear_destination_dataset(None::<DestinationDataset>);
6691    /// ```
6692    pub fn set_or_clear_destination_dataset<T>(mut self, v: std::option::Option<T>) -> Self
6693    where
6694        T: std::convert::Into<crate::model::DestinationDataset>,
6695    {
6696        self.destination_dataset = v.map(|x| x.into());
6697        self
6698    }
6699
6700    /// Sets the value of [subscription][crate::model::SubscribeDataExchangeRequest::subscription].
6701    ///
6702    /// # Example
6703    /// ```ignore,no_run
6704    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6705    /// let x = SubscribeDataExchangeRequest::new().set_subscription("example");
6706    /// ```
6707    pub fn set_subscription<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6708        self.subscription = v.into();
6709        self
6710    }
6711
6712    /// Sets the value of [subscriber_contact][crate::model::SubscribeDataExchangeRequest::subscriber_contact].
6713    ///
6714    /// # Example
6715    /// ```ignore,no_run
6716    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6717    /// let x = SubscribeDataExchangeRequest::new().set_subscriber_contact("example");
6718    /// ```
6719    pub fn set_subscriber_contact<T: std::convert::Into<std::string::String>>(
6720        mut self,
6721        v: T,
6722    ) -> Self {
6723        self.subscriber_contact = v.into();
6724        self
6725    }
6726}
6727
6728impl wkt::message::Message for SubscribeDataExchangeRequest {
6729    fn typename() -> &'static str {
6730        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeDataExchangeRequest"
6731    }
6732}
6733
6734/// Message for response when you subscribe to a Data Exchange.
6735#[derive(Clone, Default, PartialEq)]
6736#[non_exhaustive]
6737pub struct SubscribeDataExchangeResponse {
6738    /// Subscription object created from this subscribe action.
6739    pub subscription: std::option::Option<crate::model::Subscription>,
6740
6741    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6742}
6743
6744impl SubscribeDataExchangeResponse {
6745    /// Creates a new default instance.
6746    pub fn new() -> Self {
6747        std::default::Default::default()
6748    }
6749
6750    /// Sets the value of [subscription][crate::model::SubscribeDataExchangeResponse::subscription].
6751    ///
6752    /// # Example
6753    /// ```ignore,no_run
6754    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeResponse;
6755    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6756    /// let x = SubscribeDataExchangeResponse::new().set_subscription(Subscription::default()/* use setters */);
6757    /// ```
6758    pub fn set_subscription<T>(mut self, v: T) -> Self
6759    where
6760        T: std::convert::Into<crate::model::Subscription>,
6761    {
6762        self.subscription = std::option::Option::Some(v.into());
6763        self
6764    }
6765
6766    /// Sets or clears the value of [subscription][crate::model::SubscribeDataExchangeResponse::subscription].
6767    ///
6768    /// # Example
6769    /// ```ignore,no_run
6770    /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeResponse;
6771    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6772    /// let x = SubscribeDataExchangeResponse::new().set_or_clear_subscription(Some(Subscription::default()/* use setters */));
6773    /// let x = SubscribeDataExchangeResponse::new().set_or_clear_subscription(None::<Subscription>);
6774    /// ```
6775    pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
6776    where
6777        T: std::convert::Into<crate::model::Subscription>,
6778    {
6779        self.subscription = v.map(|x| x.into());
6780        self
6781    }
6782}
6783
6784impl wkt::message::Message for SubscribeDataExchangeResponse {
6785    fn typename() -> &'static str {
6786        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeDataExchangeResponse"
6787    }
6788}
6789
6790/// Message for refreshing a subscription.
6791#[derive(Clone, Default, PartialEq)]
6792#[non_exhaustive]
6793pub struct RefreshSubscriptionRequest {
6794    /// Required. Resource name of the Subscription to refresh.
6795    /// e.g. `projects/subscriberproject/locations/us/subscriptions/123`
6796    pub name: std::string::String,
6797
6798    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6799}
6800
6801impl RefreshSubscriptionRequest {
6802    /// Creates a new default instance.
6803    pub fn new() -> Self {
6804        std::default::Default::default()
6805    }
6806
6807    /// Sets the value of [name][crate::model::RefreshSubscriptionRequest::name].
6808    ///
6809    /// # Example
6810    /// ```ignore,no_run
6811    /// # use google_cloud_bigquery_analyticshub_v1::model::RefreshSubscriptionRequest;
6812    /// # let project_id = "project_id";
6813    /// # let location_id = "location_id";
6814    /// # let subscription_id = "subscription_id";
6815    /// let x = RefreshSubscriptionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/subscriptions/{subscription_id}"));
6816    /// ```
6817    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6818        self.name = v.into();
6819        self
6820    }
6821}
6822
6823impl wkt::message::Message for RefreshSubscriptionRequest {
6824    fn typename() -> &'static str {
6825        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RefreshSubscriptionRequest"
6826    }
6827}
6828
6829/// Message for response when you refresh a subscription.
6830#[derive(Clone, Default, PartialEq)]
6831#[non_exhaustive]
6832pub struct RefreshSubscriptionResponse {
6833    /// The refreshed subscription resource.
6834    pub subscription: std::option::Option<crate::model::Subscription>,
6835
6836    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6837}
6838
6839impl RefreshSubscriptionResponse {
6840    /// Creates a new default instance.
6841    pub fn new() -> Self {
6842        std::default::Default::default()
6843    }
6844
6845    /// Sets the value of [subscription][crate::model::RefreshSubscriptionResponse::subscription].
6846    ///
6847    /// # Example
6848    /// ```ignore,no_run
6849    /// # use google_cloud_bigquery_analyticshub_v1::model::RefreshSubscriptionResponse;
6850    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6851    /// let x = RefreshSubscriptionResponse::new().set_subscription(Subscription::default()/* use setters */);
6852    /// ```
6853    pub fn set_subscription<T>(mut self, v: T) -> Self
6854    where
6855        T: std::convert::Into<crate::model::Subscription>,
6856    {
6857        self.subscription = std::option::Option::Some(v.into());
6858        self
6859    }
6860
6861    /// Sets or clears the value of [subscription][crate::model::RefreshSubscriptionResponse::subscription].
6862    ///
6863    /// # Example
6864    /// ```ignore,no_run
6865    /// # use google_cloud_bigquery_analyticshub_v1::model::RefreshSubscriptionResponse;
6866    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6867    /// let x = RefreshSubscriptionResponse::new().set_or_clear_subscription(Some(Subscription::default()/* use setters */));
6868    /// let x = RefreshSubscriptionResponse::new().set_or_clear_subscription(None::<Subscription>);
6869    /// ```
6870    pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
6871    where
6872        T: std::convert::Into<crate::model::Subscription>,
6873    {
6874        self.subscription = v.map(|x| x.into());
6875        self
6876    }
6877}
6878
6879impl wkt::message::Message for RefreshSubscriptionResponse {
6880    fn typename() -> &'static str {
6881        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RefreshSubscriptionResponse"
6882    }
6883}
6884
6885/// Message for getting a subscription.
6886#[derive(Clone, Default, PartialEq)]
6887#[non_exhaustive]
6888pub struct GetSubscriptionRequest {
6889    /// Required. Resource name of the subscription.
6890    /// e.g. projects/123/locations/us/subscriptions/456
6891    pub name: std::string::String,
6892
6893    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6894}
6895
6896impl GetSubscriptionRequest {
6897    /// Creates a new default instance.
6898    pub fn new() -> Self {
6899        std::default::Default::default()
6900    }
6901
6902    /// Sets the value of [name][crate::model::GetSubscriptionRequest::name].
6903    ///
6904    /// # Example
6905    /// ```ignore,no_run
6906    /// # use google_cloud_bigquery_analyticshub_v1::model::GetSubscriptionRequest;
6907    /// # let project_id = "project_id";
6908    /// # let location_id = "location_id";
6909    /// # let subscription_id = "subscription_id";
6910    /// let x = GetSubscriptionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/subscriptions/{subscription_id}"));
6911    /// ```
6912    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6913        self.name = v.into();
6914        self
6915    }
6916}
6917
6918impl wkt::message::Message for GetSubscriptionRequest {
6919    fn typename() -> &'static str {
6920        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetSubscriptionRequest"
6921    }
6922}
6923
6924/// Message for listing subscriptions.
6925#[derive(Clone, Default, PartialEq)]
6926#[non_exhaustive]
6927pub struct ListSubscriptionsRequest {
6928    /// Required. The parent resource path of the subscription.
6929    /// e.g. projects/myproject/locations/us
6930    pub parent: std::string::String,
6931
6932    /// An expression for filtering the results of the request. Eligible
6933    /// fields for filtering are:
6934    ///
6935    /// + `listing`
6936    /// + `data_exchange`
6937    ///
6938    /// Alternatively, a literal wrapped in double quotes may be provided.
6939    /// This will be checked for an exact match against both fields above.
6940    ///
6941    /// In all cases, the full Data Exchange or Listing resource name must
6942    /// be provided. Some example of using filters:
6943    ///
6944    /// + data_exchange="projects/myproject/locations/us/dataExchanges/123"
6945    /// + listing="projects/123/locations/us/dataExchanges/456/listings/789"
6946    /// + "projects/myproject/locations/us/dataExchanges/123"
6947    pub filter: std::string::String,
6948
6949    /// The maximum number of results to return in a single response page.
6950    pub page_size: i32,
6951
6952    /// Page token, returned by a previous call.
6953    pub page_token: std::string::String,
6954
6955    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6956}
6957
6958impl ListSubscriptionsRequest {
6959    /// Creates a new default instance.
6960    pub fn new() -> Self {
6961        std::default::Default::default()
6962    }
6963
6964    /// Sets the value of [parent][crate::model::ListSubscriptionsRequest::parent].
6965    ///
6966    /// # Example
6967    /// ```ignore,no_run
6968    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
6969    /// # let project_id = "project_id";
6970    /// # let location_id = "location_id";
6971    /// let x = ListSubscriptionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
6972    /// ```
6973    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6974        self.parent = v.into();
6975        self
6976    }
6977
6978    /// Sets the value of [filter][crate::model::ListSubscriptionsRequest::filter].
6979    ///
6980    /// # Example
6981    /// ```ignore,no_run
6982    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
6983    /// let x = ListSubscriptionsRequest::new().set_filter("example");
6984    /// ```
6985    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6986        self.filter = v.into();
6987        self
6988    }
6989
6990    /// Sets the value of [page_size][crate::model::ListSubscriptionsRequest::page_size].
6991    ///
6992    /// # Example
6993    /// ```ignore,no_run
6994    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
6995    /// let x = ListSubscriptionsRequest::new().set_page_size(42);
6996    /// ```
6997    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6998        self.page_size = v.into();
6999        self
7000    }
7001
7002    /// Sets the value of [page_token][crate::model::ListSubscriptionsRequest::page_token].
7003    ///
7004    /// # Example
7005    /// ```ignore,no_run
7006    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
7007    /// let x = ListSubscriptionsRequest::new().set_page_token("example");
7008    /// ```
7009    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7010        self.page_token = v.into();
7011        self
7012    }
7013}
7014
7015impl wkt::message::Message for ListSubscriptionsRequest {
7016    fn typename() -> &'static str {
7017        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSubscriptionsRequest"
7018    }
7019}
7020
7021/// Message for response to the listing of subscriptions.
7022#[derive(Clone, Default, PartialEq)]
7023#[non_exhaustive]
7024pub struct ListSubscriptionsResponse {
7025    /// The list of subscriptions.
7026    pub subscriptions: std::vec::Vec<crate::model::Subscription>,
7027
7028    /// Next page token.
7029    pub next_page_token: std::string::String,
7030
7031    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7032}
7033
7034impl ListSubscriptionsResponse {
7035    /// Creates a new default instance.
7036    pub fn new() -> Self {
7037        std::default::Default::default()
7038    }
7039
7040    /// Sets the value of [subscriptions][crate::model::ListSubscriptionsResponse::subscriptions].
7041    ///
7042    /// # Example
7043    /// ```ignore,no_run
7044    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsResponse;
7045    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
7046    /// let x = ListSubscriptionsResponse::new()
7047    ///     .set_subscriptions([
7048    ///         Subscription::default()/* use setters */,
7049    ///         Subscription::default()/* use (different) setters */,
7050    ///     ]);
7051    /// ```
7052    pub fn set_subscriptions<T, V>(mut self, v: T) -> Self
7053    where
7054        T: std::iter::IntoIterator<Item = V>,
7055        V: std::convert::Into<crate::model::Subscription>,
7056    {
7057        use std::iter::Iterator;
7058        self.subscriptions = v.into_iter().map(|i| i.into()).collect();
7059        self
7060    }
7061
7062    /// Sets the value of [next_page_token][crate::model::ListSubscriptionsResponse::next_page_token].
7063    ///
7064    /// # Example
7065    /// ```ignore,no_run
7066    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsResponse;
7067    /// let x = ListSubscriptionsResponse::new().set_next_page_token("example");
7068    /// ```
7069    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7070        self.next_page_token = v.into();
7071        self
7072    }
7073}
7074
7075impl wkt::message::Message for ListSubscriptionsResponse {
7076    fn typename() -> &'static str {
7077        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSubscriptionsResponse"
7078    }
7079}
7080
7081#[doc(hidden)]
7082impl google_cloud_gax::paginator::internal::PageableResponse for ListSubscriptionsResponse {
7083    type PageItem = crate::model::Subscription;
7084
7085    fn items(self) -> std::vec::Vec<Self::PageItem> {
7086        self.subscriptions
7087    }
7088
7089    fn next_page_token(&self) -> std::string::String {
7090        use std::clone::Clone;
7091        self.next_page_token.clone()
7092    }
7093}
7094
7095/// Message for listing subscriptions of a shared resource.
7096#[derive(Clone, Default, PartialEq)]
7097#[non_exhaustive]
7098pub struct ListSharedResourceSubscriptionsRequest {
7099    /// Required. Resource name of the requested target. This resource may be
7100    /// either a Listing or a DataExchange. e.g.
7101    /// projects/123/locations/us/dataExchanges/456 OR e.g.
7102    /// projects/123/locations/us/dataExchanges/456/listings/789
7103    pub resource: std::string::String,
7104
7105    /// If selected, includes deleted subscriptions in the response
7106    /// (up to 63 days after deletion).
7107    pub include_deleted_subscriptions: bool,
7108
7109    /// The maximum number of results to return in a single response page.
7110    pub page_size: i32,
7111
7112    /// Page token, returned by a previous call.
7113    pub page_token: std::string::String,
7114
7115    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7116}
7117
7118impl ListSharedResourceSubscriptionsRequest {
7119    /// Creates a new default instance.
7120    pub fn new() -> Self {
7121        std::default::Default::default()
7122    }
7123
7124    /// Sets the value of [resource][crate::model::ListSharedResourceSubscriptionsRequest::resource].
7125    ///
7126    /// # Example
7127    /// ```ignore,no_run
7128    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
7129    /// let x = ListSharedResourceSubscriptionsRequest::new().set_resource("example");
7130    /// ```
7131    pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7132        self.resource = v.into();
7133        self
7134    }
7135
7136    /// Sets the value of [include_deleted_subscriptions][crate::model::ListSharedResourceSubscriptionsRequest::include_deleted_subscriptions].
7137    ///
7138    /// # Example
7139    /// ```ignore,no_run
7140    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
7141    /// let x = ListSharedResourceSubscriptionsRequest::new().set_include_deleted_subscriptions(true);
7142    /// ```
7143    pub fn set_include_deleted_subscriptions<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7144        self.include_deleted_subscriptions = v.into();
7145        self
7146    }
7147
7148    /// Sets the value of [page_size][crate::model::ListSharedResourceSubscriptionsRequest::page_size].
7149    ///
7150    /// # Example
7151    /// ```ignore,no_run
7152    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
7153    /// let x = ListSharedResourceSubscriptionsRequest::new().set_page_size(42);
7154    /// ```
7155    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7156        self.page_size = v.into();
7157        self
7158    }
7159
7160    /// Sets the value of [page_token][crate::model::ListSharedResourceSubscriptionsRequest::page_token].
7161    ///
7162    /// # Example
7163    /// ```ignore,no_run
7164    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
7165    /// let x = ListSharedResourceSubscriptionsRequest::new().set_page_token("example");
7166    /// ```
7167    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7168        self.page_token = v.into();
7169        self
7170    }
7171}
7172
7173impl wkt::message::Message for ListSharedResourceSubscriptionsRequest {
7174    fn typename() -> &'static str {
7175        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSharedResourceSubscriptionsRequest"
7176    }
7177}
7178
7179/// Message for response to the listing of shared resource subscriptions.
7180#[derive(Clone, Default, PartialEq)]
7181#[non_exhaustive]
7182pub struct ListSharedResourceSubscriptionsResponse {
7183    /// The list of subscriptions.
7184    pub shared_resource_subscriptions: std::vec::Vec<crate::model::Subscription>,
7185
7186    /// Next page token.
7187    pub next_page_token: std::string::String,
7188
7189    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7190}
7191
7192impl ListSharedResourceSubscriptionsResponse {
7193    /// Creates a new default instance.
7194    pub fn new() -> Self {
7195        std::default::Default::default()
7196    }
7197
7198    /// Sets the value of [shared_resource_subscriptions][crate::model::ListSharedResourceSubscriptionsResponse::shared_resource_subscriptions].
7199    ///
7200    /// # Example
7201    /// ```ignore,no_run
7202    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsResponse;
7203    /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
7204    /// let x = ListSharedResourceSubscriptionsResponse::new()
7205    ///     .set_shared_resource_subscriptions([
7206    ///         Subscription::default()/* use setters */,
7207    ///         Subscription::default()/* use (different) setters */,
7208    ///     ]);
7209    /// ```
7210    pub fn set_shared_resource_subscriptions<T, V>(mut self, v: T) -> Self
7211    where
7212        T: std::iter::IntoIterator<Item = V>,
7213        V: std::convert::Into<crate::model::Subscription>,
7214    {
7215        use std::iter::Iterator;
7216        self.shared_resource_subscriptions = v.into_iter().map(|i| i.into()).collect();
7217        self
7218    }
7219
7220    /// Sets the value of [next_page_token][crate::model::ListSharedResourceSubscriptionsResponse::next_page_token].
7221    ///
7222    /// # Example
7223    /// ```ignore,no_run
7224    /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsResponse;
7225    /// let x = ListSharedResourceSubscriptionsResponse::new().set_next_page_token("example");
7226    /// ```
7227    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7228        self.next_page_token = v.into();
7229        self
7230    }
7231}
7232
7233impl wkt::message::Message for ListSharedResourceSubscriptionsResponse {
7234    fn typename() -> &'static str {
7235        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSharedResourceSubscriptionsResponse"
7236    }
7237}
7238
7239#[doc(hidden)]
7240impl google_cloud_gax::paginator::internal::PageableResponse
7241    for ListSharedResourceSubscriptionsResponse
7242{
7243    type PageItem = crate::model::Subscription;
7244
7245    fn items(self) -> std::vec::Vec<Self::PageItem> {
7246        self.shared_resource_subscriptions
7247    }
7248
7249    fn next_page_token(&self) -> std::string::String {
7250        use std::clone::Clone;
7251        self.next_page_token.clone()
7252    }
7253}
7254
7255/// Message for revoking a subscription.
7256#[derive(Clone, Default, PartialEq)]
7257#[non_exhaustive]
7258pub struct RevokeSubscriptionRequest {
7259    /// Required. Resource name of the subscription to revoke.
7260    /// e.g. projects/123/locations/us/subscriptions/456
7261    pub name: std::string::String,
7262
7263    /// Optional. If the subscription is commercial then this field must be set to
7264    /// true, otherwise a failure is thrown. This acts as a safety guard to avoid
7265    /// revoking commercial subscriptions accidentally.
7266    pub revoke_commercial: bool,
7267
7268    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7269}
7270
7271impl RevokeSubscriptionRequest {
7272    /// Creates a new default instance.
7273    pub fn new() -> Self {
7274        std::default::Default::default()
7275    }
7276
7277    /// Sets the value of [name][crate::model::RevokeSubscriptionRequest::name].
7278    ///
7279    /// # Example
7280    /// ```ignore,no_run
7281    /// # use google_cloud_bigquery_analyticshub_v1::model::RevokeSubscriptionRequest;
7282    /// # let project_id = "project_id";
7283    /// # let location_id = "location_id";
7284    /// # let subscription_id = "subscription_id";
7285    /// let x = RevokeSubscriptionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/subscriptions/{subscription_id}"));
7286    /// ```
7287    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7288        self.name = v.into();
7289        self
7290    }
7291
7292    /// Sets the value of [revoke_commercial][crate::model::RevokeSubscriptionRequest::revoke_commercial].
7293    ///
7294    /// # Example
7295    /// ```ignore,no_run
7296    /// # use google_cloud_bigquery_analyticshub_v1::model::RevokeSubscriptionRequest;
7297    /// let x = RevokeSubscriptionRequest::new().set_revoke_commercial(true);
7298    /// ```
7299    pub fn set_revoke_commercial<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7300        self.revoke_commercial = v.into();
7301        self
7302    }
7303}
7304
7305impl wkt::message::Message for RevokeSubscriptionRequest {
7306    fn typename() -> &'static str {
7307        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RevokeSubscriptionRequest"
7308    }
7309}
7310
7311/// Message for response when you revoke a subscription.
7312/// Empty for now.
7313#[derive(Clone, Default, PartialEq)]
7314#[non_exhaustive]
7315pub struct RevokeSubscriptionResponse {
7316    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7317}
7318
7319impl RevokeSubscriptionResponse {
7320    /// Creates a new default instance.
7321    pub fn new() -> Self {
7322        std::default::Default::default()
7323    }
7324}
7325
7326impl wkt::message::Message for RevokeSubscriptionResponse {
7327    fn typename() -> &'static str {
7328        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RevokeSubscriptionResponse"
7329    }
7330}
7331
7332/// Message for deleting a subscription.
7333#[derive(Clone, Default, PartialEq)]
7334#[non_exhaustive]
7335pub struct DeleteSubscriptionRequest {
7336    /// Required. Resource name of the subscription to delete.
7337    /// e.g. projects/123/locations/us/subscriptions/456
7338    pub name: std::string::String,
7339
7340    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7341}
7342
7343impl DeleteSubscriptionRequest {
7344    /// Creates a new default instance.
7345    pub fn new() -> Self {
7346        std::default::Default::default()
7347    }
7348
7349    /// Sets the value of [name][crate::model::DeleteSubscriptionRequest::name].
7350    ///
7351    /// # Example
7352    /// ```ignore,no_run
7353    /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteSubscriptionRequest;
7354    /// # let project_id = "project_id";
7355    /// # let location_id = "location_id";
7356    /// # let subscription_id = "subscription_id";
7357    /// let x = DeleteSubscriptionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/subscriptions/{subscription_id}"));
7358    /// ```
7359    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7360        self.name = v.into();
7361        self
7362    }
7363}
7364
7365impl wkt::message::Message for DeleteSubscriptionRequest {
7366    fn typename() -> &'static str {
7367        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteSubscriptionRequest"
7368    }
7369}
7370
7371/// Represents the metadata of a long-running operation in Analytics Hub.
7372#[derive(Clone, Default, PartialEq)]
7373#[non_exhaustive]
7374pub struct OperationMetadata {
7375    /// Output only. The time the operation was created.
7376    pub create_time: std::option::Option<wkt::Timestamp>,
7377
7378    /// Output only. The time the operation finished running.
7379    pub end_time: std::option::Option<wkt::Timestamp>,
7380
7381    /// Output only. Server-defined resource path for the target of the operation.
7382    pub target: std::string::String,
7383
7384    /// Output only. Name of the verb executed by the operation.
7385    pub verb: std::string::String,
7386
7387    /// Output only. Human-readable status of the operation, if any.
7388    pub status_message: std::string::String,
7389
7390    /// Output only. Identifies whether the user has requested cancellation
7391    /// of the operation. Operations that have successfully been cancelled
7392    /// have [Operation.error][] value with a
7393    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
7394    /// `Code.CANCELLED`.
7395    pub requested_cancellation: bool,
7396
7397    /// Output only. API version used to start the operation.
7398    pub api_version: std::string::String,
7399
7400    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7401}
7402
7403impl OperationMetadata {
7404    /// Creates a new default instance.
7405    pub fn new() -> Self {
7406        std::default::Default::default()
7407    }
7408
7409    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
7410    ///
7411    /// # Example
7412    /// ```ignore,no_run
7413    /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7414    /// use wkt::Timestamp;
7415    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
7416    /// ```
7417    pub fn set_create_time<T>(mut self, v: T) -> Self
7418    where
7419        T: std::convert::Into<wkt::Timestamp>,
7420    {
7421        self.create_time = std::option::Option::Some(v.into());
7422        self
7423    }
7424
7425    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
7426    ///
7427    /// # Example
7428    /// ```ignore,no_run
7429    /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7430    /// use wkt::Timestamp;
7431    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7432    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
7433    /// ```
7434    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7435    where
7436        T: std::convert::Into<wkt::Timestamp>,
7437    {
7438        self.create_time = v.map(|x| x.into());
7439        self
7440    }
7441
7442    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
7443    ///
7444    /// # Example
7445    /// ```ignore,no_run
7446    /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7447    /// use wkt::Timestamp;
7448    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
7449    /// ```
7450    pub fn set_end_time<T>(mut self, v: T) -> Self
7451    where
7452        T: std::convert::Into<wkt::Timestamp>,
7453    {
7454        self.end_time = std::option::Option::Some(v.into());
7455        self
7456    }
7457
7458    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
7459    ///
7460    /// # Example
7461    /// ```ignore,no_run
7462    /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7463    /// use wkt::Timestamp;
7464    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
7465    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
7466    /// ```
7467    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7468    where
7469        T: std::convert::Into<wkt::Timestamp>,
7470    {
7471        self.end_time = v.map(|x| x.into());
7472        self
7473    }
7474
7475    /// Sets the value of [target][crate::model::OperationMetadata::target].
7476    ///
7477    /// # Example
7478    /// ```ignore,no_run
7479    /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7480    /// let x = OperationMetadata::new().set_target("example");
7481    /// ```
7482    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7483        self.target = v.into();
7484        self
7485    }
7486
7487    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
7488    ///
7489    /// # Example
7490    /// ```ignore,no_run
7491    /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7492    /// let x = OperationMetadata::new().set_verb("example");
7493    /// ```
7494    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7495        self.verb = v.into();
7496        self
7497    }
7498
7499    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
7500    ///
7501    /// # Example
7502    /// ```ignore,no_run
7503    /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7504    /// let x = OperationMetadata::new().set_status_message("example");
7505    /// ```
7506    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7507        self.status_message = v.into();
7508        self
7509    }
7510
7511    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
7512    ///
7513    /// # Example
7514    /// ```ignore,no_run
7515    /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7516    /// let x = OperationMetadata::new().set_requested_cancellation(true);
7517    /// ```
7518    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7519        self.requested_cancellation = v.into();
7520        self
7521    }
7522
7523    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
7524    ///
7525    /// # Example
7526    /// ```ignore,no_run
7527    /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7528    /// let x = OperationMetadata::new().set_api_version("example");
7529    /// ```
7530    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7531        self.api_version = v.into();
7532        self
7533    }
7534}
7535
7536impl wkt::message::Message for OperationMetadata {
7537    fn typename() -> &'static str {
7538        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.OperationMetadata"
7539    }
7540}
7541
7542/// Defines the destination Pub/Sub subscription.
7543/// If none of `push_config`, `bigquery_config`, `cloud_storage_config`,
7544/// `pubsub_export_config`, or `pubsublite_export_config`
7545/// is set, then the subscriber will pull and ack messages using API methods. At
7546/// most one of these fields may be set.
7547#[derive(Clone, Default, PartialEq)]
7548#[non_exhaustive]
7549pub struct PubSubSubscription {
7550    /// Required. Name of the subscription.
7551    /// Format is `projects/{project}/subscriptions/{sub}`.
7552    pub name: std::string::String,
7553
7554    /// Optional. If push delivery is used with this subscription, this field is
7555    /// used to configure it.
7556    pub push_config: std::option::Option<crate::model::PushConfig>,
7557
7558    /// Optional. If delivery to BigQuery is used with this subscription, this
7559    /// field is used to configure it.
7560    pub bigquery_config: std::option::Option<crate::model::BigQueryConfig>,
7561
7562    /// Optional. If delivery to Google Cloud Storage is used with this
7563    /// subscription, this field is used to configure it.
7564    pub cloud_storage_config: std::option::Option<crate::model::CloudStorageConfig>,
7565
7566    /// Optional. The approximate amount of time (on a best-effort basis) Pub/Sub
7567    /// waits for the subscriber to acknowledge receipt before resending the
7568    /// message. In the interval after the message is delivered and before it is
7569    /// acknowledged, it is considered to be _outstanding_. During that time
7570    /// period, the message will not be redelivered (on a best-effort basis).
7571    ///
7572    /// For pull subscriptions, this value is used as the initial value for the ack
7573    /// deadline. To override this value for a given message, call
7574    /// `ModifyAckDeadline` with the corresponding `ack_id` if using
7575    /// non-streaming pull or send the `ack_id` in a
7576    /// `StreamingModifyAckDeadlineRequest` if using streaming pull.
7577    /// The minimum custom deadline you can specify is 10 seconds.
7578    /// The maximum custom deadline you can specify is 600 seconds (10 minutes).
7579    /// If this parameter is 0, a default value of 10 seconds is used.
7580    ///
7581    /// For push delivery, this value is also used to set the request timeout for
7582    /// the call to the push endpoint.
7583    ///
7584    /// If the subscriber never acknowledges the message, the Pub/Sub
7585    /// system will eventually redeliver the message.
7586    pub ack_deadline_seconds: i32,
7587
7588    /// Optional. Indicates whether to retain acknowledged messages. If true, then
7589    /// messages are not expunged from the subscription's backlog, even if they are
7590    /// acknowledged, until they fall out of the `message_retention_duration`
7591    /// window. This must be true if you would like to [`Seek` to a timestamp]
7592    /// (<https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time>) in
7593    /// the past to replay previously-acknowledged messages.
7594    pub retain_acked_messages: bool,
7595
7596    /// Optional. How long to retain unacknowledged messages in the subscription's
7597    /// backlog, from the moment a message is published. If `retain_acked_messages`
7598    /// is true, then this also configures the retention of acknowledged messages,
7599    /// and thus configures how far back in time a `Seek` can be done. Defaults to
7600    /// 7 days. Cannot be more than 31 days or less than 10 minutes.
7601    pub message_retention_duration: std::option::Option<wkt::Duration>,
7602
7603    /// Optional. See [Creating and managing
7604    /// labels](https://cloud.google.com/pubsub/docs/labels).
7605    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7606
7607    /// Optional. If true, messages published with the same `ordering_key` in
7608    /// `PubsubMessage` will be delivered to the subscribers in the order in which
7609    /// they are received by the Pub/Sub system. Otherwise, they may be delivered
7610    /// in any order.
7611    pub enable_message_ordering: bool,
7612
7613    /// Optional. A policy that specifies the conditions for this subscription's
7614    /// expiration. A subscription is considered active as long as any connected
7615    /// subscriber is successfully consuming messages from the subscription or is
7616    /// issuing operations on the subscription. If `expiration_policy` is not set,
7617    /// a *default policy* with `ttl` of 31 days will be used. The minimum allowed
7618    /// value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
7619    /// but `expiration_policy.ttl` is not set, the subscription never expires.
7620    pub expiration_policy: std::option::Option<crate::model::ExpirationPolicy>,
7621
7622    /// Optional. An expression written in the Pub/Sub [filter
7623    /// language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
7624    /// then only `PubsubMessage`s whose `attributes` field matches the filter are
7625    /// delivered on this subscription. If empty, then no messages are filtered
7626    /// out.
7627    pub filter: std::string::String,
7628
7629    /// Optional. A policy that specifies the conditions for dead lettering
7630    /// messages in this subscription. If dead_letter_policy is not set, dead
7631    /// lettering is disabled.
7632    ///
7633    /// The Pub/Sub service account associated with this subscriptions's
7634    /// parent project (i.e.,
7635    /// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
7636    /// permission to Acknowledge() messages on this subscription.
7637    pub dead_letter_policy: std::option::Option<crate::model::DeadLetterPolicy>,
7638
7639    /// Optional. A policy that specifies how Pub/Sub retries message delivery for
7640    /// this subscription.
7641    ///
7642    /// If not set, the default retry policy is applied. This generally implies
7643    /// that messages will be retried as soon as possible for healthy subscribers.
7644    /// RetryPolicy will be triggered on NACKs or acknowledgement deadline
7645    /// exceeded events for a given message.
7646    pub retry_policy: std::option::Option<crate::model::RetryPolicy>,
7647
7648    /// Optional. Indicates whether the subscription is detached from its topic.
7649    /// Detached subscriptions don't receive messages from their topic and don't
7650    /// retain any backlog. `Pull` and `StreamingPull` requests will return
7651    /// FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
7652    /// the endpoint will not be made.
7653    pub detached: bool,
7654
7655    /// Optional. If true, Pub/Sub provides the following guarantees for the
7656    /// delivery of a message with a given value of `message_id` on this
7657    /// subscription:
7658    ///
7659    /// * The message sent to a subscriber is guaranteed not to be resent
7660    ///   before the message's acknowledgement deadline expires.
7661    /// * An acknowledged message will not be resent to a subscriber.
7662    ///
7663    /// Note that subscribers may still receive multiple copies of a message
7664    /// when `enable_exactly_once_delivery` is true if the message was published
7665    /// multiple times by a publisher client. These copies are  considered distinct
7666    /// by Pub/Sub and have distinct `message_id` values.
7667    pub enable_exactly_once_delivery: bool,
7668
7669    /// Optional. Transforms to be applied to messages before they are delivered to
7670    /// subscribers. Transforms are applied in the order specified.
7671    pub message_transforms: std::vec::Vec<crate::model::MessageTransform>,
7672
7673    /// Optional. Input only. Immutable. Tag keys/values directly bound to this
7674    /// resource. For example:
7675    /// "123/environment": "production",
7676    /// "123/costCenter": "marketing"
7677    pub tags: std::collections::HashMap<std::string::String, std::string::String>,
7678
7679    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7680}
7681
7682impl PubSubSubscription {
7683    /// Creates a new default instance.
7684    pub fn new() -> Self {
7685        std::default::Default::default()
7686    }
7687
7688    /// Sets the value of [name][crate::model::PubSubSubscription::name].
7689    ///
7690    /// # Example
7691    /// ```ignore,no_run
7692    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7693    /// let x = PubSubSubscription::new().set_name("example");
7694    /// ```
7695    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7696        self.name = v.into();
7697        self
7698    }
7699
7700    /// Sets the value of [push_config][crate::model::PubSubSubscription::push_config].
7701    ///
7702    /// # Example
7703    /// ```ignore,no_run
7704    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7705    /// use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
7706    /// let x = PubSubSubscription::new().set_push_config(PushConfig::default()/* use setters */);
7707    /// ```
7708    pub fn set_push_config<T>(mut self, v: T) -> Self
7709    where
7710        T: std::convert::Into<crate::model::PushConfig>,
7711    {
7712        self.push_config = std::option::Option::Some(v.into());
7713        self
7714    }
7715
7716    /// Sets or clears the value of [push_config][crate::model::PubSubSubscription::push_config].
7717    ///
7718    /// # Example
7719    /// ```ignore,no_run
7720    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7721    /// use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
7722    /// let x = PubSubSubscription::new().set_or_clear_push_config(Some(PushConfig::default()/* use setters */));
7723    /// let x = PubSubSubscription::new().set_or_clear_push_config(None::<PushConfig>);
7724    /// ```
7725    pub fn set_or_clear_push_config<T>(mut self, v: std::option::Option<T>) -> Self
7726    where
7727        T: std::convert::Into<crate::model::PushConfig>,
7728    {
7729        self.push_config = v.map(|x| x.into());
7730        self
7731    }
7732
7733    /// Sets the value of [bigquery_config][crate::model::PubSubSubscription::bigquery_config].
7734    ///
7735    /// # Example
7736    /// ```ignore,no_run
7737    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7738    /// use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
7739    /// let x = PubSubSubscription::new().set_bigquery_config(BigQueryConfig::default()/* use setters */);
7740    /// ```
7741    pub fn set_bigquery_config<T>(mut self, v: T) -> Self
7742    where
7743        T: std::convert::Into<crate::model::BigQueryConfig>,
7744    {
7745        self.bigquery_config = std::option::Option::Some(v.into());
7746        self
7747    }
7748
7749    /// Sets or clears the value of [bigquery_config][crate::model::PubSubSubscription::bigquery_config].
7750    ///
7751    /// # Example
7752    /// ```ignore,no_run
7753    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7754    /// use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
7755    /// let x = PubSubSubscription::new().set_or_clear_bigquery_config(Some(BigQueryConfig::default()/* use setters */));
7756    /// let x = PubSubSubscription::new().set_or_clear_bigquery_config(None::<BigQueryConfig>);
7757    /// ```
7758    pub fn set_or_clear_bigquery_config<T>(mut self, v: std::option::Option<T>) -> Self
7759    where
7760        T: std::convert::Into<crate::model::BigQueryConfig>,
7761    {
7762        self.bigquery_config = v.map(|x| x.into());
7763        self
7764    }
7765
7766    /// Sets the value of [cloud_storage_config][crate::model::PubSubSubscription::cloud_storage_config].
7767    ///
7768    /// # Example
7769    /// ```ignore,no_run
7770    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7771    /// use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
7772    /// let x = PubSubSubscription::new().set_cloud_storage_config(CloudStorageConfig::default()/* use setters */);
7773    /// ```
7774    pub fn set_cloud_storage_config<T>(mut self, v: T) -> Self
7775    where
7776        T: std::convert::Into<crate::model::CloudStorageConfig>,
7777    {
7778        self.cloud_storage_config = std::option::Option::Some(v.into());
7779        self
7780    }
7781
7782    /// Sets or clears the value of [cloud_storage_config][crate::model::PubSubSubscription::cloud_storage_config].
7783    ///
7784    /// # Example
7785    /// ```ignore,no_run
7786    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7787    /// use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
7788    /// let x = PubSubSubscription::new().set_or_clear_cloud_storage_config(Some(CloudStorageConfig::default()/* use setters */));
7789    /// let x = PubSubSubscription::new().set_or_clear_cloud_storage_config(None::<CloudStorageConfig>);
7790    /// ```
7791    pub fn set_or_clear_cloud_storage_config<T>(mut self, v: std::option::Option<T>) -> Self
7792    where
7793        T: std::convert::Into<crate::model::CloudStorageConfig>,
7794    {
7795        self.cloud_storage_config = v.map(|x| x.into());
7796        self
7797    }
7798
7799    /// Sets the value of [ack_deadline_seconds][crate::model::PubSubSubscription::ack_deadline_seconds].
7800    ///
7801    /// # Example
7802    /// ```ignore,no_run
7803    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7804    /// let x = PubSubSubscription::new().set_ack_deadline_seconds(42);
7805    /// ```
7806    pub fn set_ack_deadline_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7807        self.ack_deadline_seconds = v.into();
7808        self
7809    }
7810
7811    /// Sets the value of [retain_acked_messages][crate::model::PubSubSubscription::retain_acked_messages].
7812    ///
7813    /// # Example
7814    /// ```ignore,no_run
7815    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7816    /// let x = PubSubSubscription::new().set_retain_acked_messages(true);
7817    /// ```
7818    pub fn set_retain_acked_messages<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7819        self.retain_acked_messages = v.into();
7820        self
7821    }
7822
7823    /// Sets the value of [message_retention_duration][crate::model::PubSubSubscription::message_retention_duration].
7824    ///
7825    /// # Example
7826    /// ```ignore,no_run
7827    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7828    /// use wkt::Duration;
7829    /// let x = PubSubSubscription::new().set_message_retention_duration(Duration::default()/* use setters */);
7830    /// ```
7831    pub fn set_message_retention_duration<T>(mut self, v: T) -> Self
7832    where
7833        T: std::convert::Into<wkt::Duration>,
7834    {
7835        self.message_retention_duration = std::option::Option::Some(v.into());
7836        self
7837    }
7838
7839    /// Sets or clears the value of [message_retention_duration][crate::model::PubSubSubscription::message_retention_duration].
7840    ///
7841    /// # Example
7842    /// ```ignore,no_run
7843    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7844    /// use wkt::Duration;
7845    /// let x = PubSubSubscription::new().set_or_clear_message_retention_duration(Some(Duration::default()/* use setters */));
7846    /// let x = PubSubSubscription::new().set_or_clear_message_retention_duration(None::<Duration>);
7847    /// ```
7848    pub fn set_or_clear_message_retention_duration<T>(mut self, v: std::option::Option<T>) -> Self
7849    where
7850        T: std::convert::Into<wkt::Duration>,
7851    {
7852        self.message_retention_duration = v.map(|x| x.into());
7853        self
7854    }
7855
7856    /// Sets the value of [labels][crate::model::PubSubSubscription::labels].
7857    ///
7858    /// # Example
7859    /// ```ignore,no_run
7860    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7861    /// let x = PubSubSubscription::new().set_labels([
7862    ///     ("key0", "abc"),
7863    ///     ("key1", "xyz"),
7864    /// ]);
7865    /// ```
7866    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7867    where
7868        T: std::iter::IntoIterator<Item = (K, V)>,
7869        K: std::convert::Into<std::string::String>,
7870        V: std::convert::Into<std::string::String>,
7871    {
7872        use std::iter::Iterator;
7873        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7874        self
7875    }
7876
7877    /// Sets the value of [enable_message_ordering][crate::model::PubSubSubscription::enable_message_ordering].
7878    ///
7879    /// # Example
7880    /// ```ignore,no_run
7881    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7882    /// let x = PubSubSubscription::new().set_enable_message_ordering(true);
7883    /// ```
7884    pub fn set_enable_message_ordering<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7885        self.enable_message_ordering = v.into();
7886        self
7887    }
7888
7889    /// Sets the value of [expiration_policy][crate::model::PubSubSubscription::expiration_policy].
7890    ///
7891    /// # Example
7892    /// ```ignore,no_run
7893    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7894    /// use google_cloud_bigquery_analyticshub_v1::model::ExpirationPolicy;
7895    /// let x = PubSubSubscription::new().set_expiration_policy(ExpirationPolicy::default()/* use setters */);
7896    /// ```
7897    pub fn set_expiration_policy<T>(mut self, v: T) -> Self
7898    where
7899        T: std::convert::Into<crate::model::ExpirationPolicy>,
7900    {
7901        self.expiration_policy = std::option::Option::Some(v.into());
7902        self
7903    }
7904
7905    /// Sets or clears the value of [expiration_policy][crate::model::PubSubSubscription::expiration_policy].
7906    ///
7907    /// # Example
7908    /// ```ignore,no_run
7909    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7910    /// use google_cloud_bigquery_analyticshub_v1::model::ExpirationPolicy;
7911    /// let x = PubSubSubscription::new().set_or_clear_expiration_policy(Some(ExpirationPolicy::default()/* use setters */));
7912    /// let x = PubSubSubscription::new().set_or_clear_expiration_policy(None::<ExpirationPolicy>);
7913    /// ```
7914    pub fn set_or_clear_expiration_policy<T>(mut self, v: std::option::Option<T>) -> Self
7915    where
7916        T: std::convert::Into<crate::model::ExpirationPolicy>,
7917    {
7918        self.expiration_policy = v.map(|x| x.into());
7919        self
7920    }
7921
7922    /// Sets the value of [filter][crate::model::PubSubSubscription::filter].
7923    ///
7924    /// # Example
7925    /// ```ignore,no_run
7926    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7927    /// let x = PubSubSubscription::new().set_filter("example");
7928    /// ```
7929    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7930        self.filter = v.into();
7931        self
7932    }
7933
7934    /// Sets the value of [dead_letter_policy][crate::model::PubSubSubscription::dead_letter_policy].
7935    ///
7936    /// # Example
7937    /// ```ignore,no_run
7938    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7939    /// use google_cloud_bigquery_analyticshub_v1::model::DeadLetterPolicy;
7940    /// let x = PubSubSubscription::new().set_dead_letter_policy(DeadLetterPolicy::default()/* use setters */);
7941    /// ```
7942    pub fn set_dead_letter_policy<T>(mut self, v: T) -> Self
7943    where
7944        T: std::convert::Into<crate::model::DeadLetterPolicy>,
7945    {
7946        self.dead_letter_policy = std::option::Option::Some(v.into());
7947        self
7948    }
7949
7950    /// Sets or clears the value of [dead_letter_policy][crate::model::PubSubSubscription::dead_letter_policy].
7951    ///
7952    /// # Example
7953    /// ```ignore,no_run
7954    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7955    /// use google_cloud_bigquery_analyticshub_v1::model::DeadLetterPolicy;
7956    /// let x = PubSubSubscription::new().set_or_clear_dead_letter_policy(Some(DeadLetterPolicy::default()/* use setters */));
7957    /// let x = PubSubSubscription::new().set_or_clear_dead_letter_policy(None::<DeadLetterPolicy>);
7958    /// ```
7959    pub fn set_or_clear_dead_letter_policy<T>(mut self, v: std::option::Option<T>) -> Self
7960    where
7961        T: std::convert::Into<crate::model::DeadLetterPolicy>,
7962    {
7963        self.dead_letter_policy = v.map(|x| x.into());
7964        self
7965    }
7966
7967    /// Sets the value of [retry_policy][crate::model::PubSubSubscription::retry_policy].
7968    ///
7969    /// # Example
7970    /// ```ignore,no_run
7971    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7972    /// use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
7973    /// let x = PubSubSubscription::new().set_retry_policy(RetryPolicy::default()/* use setters */);
7974    /// ```
7975    pub fn set_retry_policy<T>(mut self, v: T) -> Self
7976    where
7977        T: std::convert::Into<crate::model::RetryPolicy>,
7978    {
7979        self.retry_policy = std::option::Option::Some(v.into());
7980        self
7981    }
7982
7983    /// Sets or clears the value of [retry_policy][crate::model::PubSubSubscription::retry_policy].
7984    ///
7985    /// # Example
7986    /// ```ignore,no_run
7987    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7988    /// use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
7989    /// let x = PubSubSubscription::new().set_or_clear_retry_policy(Some(RetryPolicy::default()/* use setters */));
7990    /// let x = PubSubSubscription::new().set_or_clear_retry_policy(None::<RetryPolicy>);
7991    /// ```
7992    pub fn set_or_clear_retry_policy<T>(mut self, v: std::option::Option<T>) -> Self
7993    where
7994        T: std::convert::Into<crate::model::RetryPolicy>,
7995    {
7996        self.retry_policy = v.map(|x| x.into());
7997        self
7998    }
7999
8000    /// Sets the value of [detached][crate::model::PubSubSubscription::detached].
8001    ///
8002    /// # Example
8003    /// ```ignore,no_run
8004    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
8005    /// let x = PubSubSubscription::new().set_detached(true);
8006    /// ```
8007    pub fn set_detached<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8008        self.detached = v.into();
8009        self
8010    }
8011
8012    /// Sets the value of [enable_exactly_once_delivery][crate::model::PubSubSubscription::enable_exactly_once_delivery].
8013    ///
8014    /// # Example
8015    /// ```ignore,no_run
8016    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
8017    /// let x = PubSubSubscription::new().set_enable_exactly_once_delivery(true);
8018    /// ```
8019    pub fn set_enable_exactly_once_delivery<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8020        self.enable_exactly_once_delivery = v.into();
8021        self
8022    }
8023
8024    /// Sets the value of [message_transforms][crate::model::PubSubSubscription::message_transforms].
8025    ///
8026    /// # Example
8027    /// ```ignore,no_run
8028    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
8029    /// use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
8030    /// let x = PubSubSubscription::new()
8031    ///     .set_message_transforms([
8032    ///         MessageTransform::default()/* use setters */,
8033    ///         MessageTransform::default()/* use (different) setters */,
8034    ///     ]);
8035    /// ```
8036    pub fn set_message_transforms<T, V>(mut self, v: T) -> Self
8037    where
8038        T: std::iter::IntoIterator<Item = V>,
8039        V: std::convert::Into<crate::model::MessageTransform>,
8040    {
8041        use std::iter::Iterator;
8042        self.message_transforms = v.into_iter().map(|i| i.into()).collect();
8043        self
8044    }
8045
8046    /// Sets the value of [tags][crate::model::PubSubSubscription::tags].
8047    ///
8048    /// # Example
8049    /// ```ignore,no_run
8050    /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
8051    /// let x = PubSubSubscription::new().set_tags([
8052    ///     ("key0", "abc"),
8053    ///     ("key1", "xyz"),
8054    /// ]);
8055    /// ```
8056    pub fn set_tags<T, K, V>(mut self, v: T) -> Self
8057    where
8058        T: std::iter::IntoIterator<Item = (K, V)>,
8059        K: std::convert::Into<std::string::String>,
8060        V: std::convert::Into<std::string::String>,
8061    {
8062        use std::iter::Iterator;
8063        self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8064        self
8065    }
8066}
8067
8068impl wkt::message::Message for PubSubSubscription {
8069    fn typename() -> &'static str {
8070        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PubSubSubscription"
8071    }
8072}
8073
8074/// A policy that specifies how Pub/Sub retries message delivery.
8075///
8076/// Retry delay will be exponential based on provided minimum and maximum
8077/// backoffs. <https://en.wikipedia.org/wiki/Exponential_backoff>.
8078///
8079/// RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded
8080/// events for a given message.
8081///
8082/// Retry Policy is implemented on a best effort basis. At times, the delay
8083/// between consecutive deliveries may not match the configuration. That is,
8084/// delay can be more or less than configured backoff.
8085#[derive(Clone, Default, PartialEq)]
8086#[non_exhaustive]
8087pub struct RetryPolicy {
8088    /// Optional. The minimum delay between consecutive deliveries of a given
8089    /// message. Value should be between 0 and 600 seconds. Defaults to 10 seconds.
8090    pub minimum_backoff: std::option::Option<wkt::Duration>,
8091
8092    /// Optional. The maximum delay between consecutive deliveries of a given
8093    /// message. Value should be between 0 and 600 seconds. Defaults to 600
8094    /// seconds.
8095    pub maximum_backoff: std::option::Option<wkt::Duration>,
8096
8097    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8098}
8099
8100impl RetryPolicy {
8101    /// Creates a new default instance.
8102    pub fn new() -> Self {
8103        std::default::Default::default()
8104    }
8105
8106    /// Sets the value of [minimum_backoff][crate::model::RetryPolicy::minimum_backoff].
8107    ///
8108    /// # Example
8109    /// ```ignore,no_run
8110    /// # use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
8111    /// use wkt::Duration;
8112    /// let x = RetryPolicy::new().set_minimum_backoff(Duration::default()/* use setters */);
8113    /// ```
8114    pub fn set_minimum_backoff<T>(mut self, v: T) -> Self
8115    where
8116        T: std::convert::Into<wkt::Duration>,
8117    {
8118        self.minimum_backoff = std::option::Option::Some(v.into());
8119        self
8120    }
8121
8122    /// Sets or clears the value of [minimum_backoff][crate::model::RetryPolicy::minimum_backoff].
8123    ///
8124    /// # Example
8125    /// ```ignore,no_run
8126    /// # use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
8127    /// use wkt::Duration;
8128    /// let x = RetryPolicy::new().set_or_clear_minimum_backoff(Some(Duration::default()/* use setters */));
8129    /// let x = RetryPolicy::new().set_or_clear_minimum_backoff(None::<Duration>);
8130    /// ```
8131    pub fn set_or_clear_minimum_backoff<T>(mut self, v: std::option::Option<T>) -> Self
8132    where
8133        T: std::convert::Into<wkt::Duration>,
8134    {
8135        self.minimum_backoff = v.map(|x| x.into());
8136        self
8137    }
8138
8139    /// Sets the value of [maximum_backoff][crate::model::RetryPolicy::maximum_backoff].
8140    ///
8141    /// # Example
8142    /// ```ignore,no_run
8143    /// # use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
8144    /// use wkt::Duration;
8145    /// let x = RetryPolicy::new().set_maximum_backoff(Duration::default()/* use setters */);
8146    /// ```
8147    pub fn set_maximum_backoff<T>(mut self, v: T) -> Self
8148    where
8149        T: std::convert::Into<wkt::Duration>,
8150    {
8151        self.maximum_backoff = std::option::Option::Some(v.into());
8152        self
8153    }
8154
8155    /// Sets or clears the value of [maximum_backoff][crate::model::RetryPolicy::maximum_backoff].
8156    ///
8157    /// # Example
8158    /// ```ignore,no_run
8159    /// # use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
8160    /// use wkt::Duration;
8161    /// let x = RetryPolicy::new().set_or_clear_maximum_backoff(Some(Duration::default()/* use setters */));
8162    /// let x = RetryPolicy::new().set_or_clear_maximum_backoff(None::<Duration>);
8163    /// ```
8164    pub fn set_or_clear_maximum_backoff<T>(mut self, v: std::option::Option<T>) -> Self
8165    where
8166        T: std::convert::Into<wkt::Duration>,
8167    {
8168        self.maximum_backoff = v.map(|x| x.into());
8169        self
8170    }
8171}
8172
8173impl wkt::message::Message for RetryPolicy {
8174    fn typename() -> &'static str {
8175        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RetryPolicy"
8176    }
8177}
8178
8179/// Dead lettering is done on a best effort basis. The same message might be
8180/// dead lettered multiple times.
8181///
8182/// If validation on any of the fields fails at subscription creation/updation,
8183/// the create/update subscription request will fail.
8184#[derive(Clone, Default, PartialEq)]
8185#[non_exhaustive]
8186pub struct DeadLetterPolicy {
8187    /// Optional. The name of the topic to which dead letter messages should be
8188    /// published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub
8189    /// service account associated with the enclosing subscription's parent project
8190    /// (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must
8191    /// have permission to Publish() to this topic.
8192    ///
8193    /// The operation will fail if the topic does not exist.
8194    /// Users should ensure that there is a subscription attached to this topic
8195    /// since messages published to a topic with no subscriptions are lost.
8196    pub dead_letter_topic: std::string::String,
8197
8198    /// Optional. The maximum number of delivery attempts for any message. The
8199    /// value must be between 5 and 100.
8200    ///
8201    /// The number of delivery attempts is defined as 1 + (the sum of number of
8202    /// NACKs and number of times the acknowledgement deadline has been exceeded
8203    /// for the message).
8204    ///
8205    /// A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
8206    /// client libraries may automatically extend ack_deadlines.
8207    ///
8208    /// This field will be honored on a best effort basis.
8209    ///
8210    /// If this parameter is 0, a default value of 5 is used.
8211    pub max_delivery_attempts: i32,
8212
8213    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8214}
8215
8216impl DeadLetterPolicy {
8217    /// Creates a new default instance.
8218    pub fn new() -> Self {
8219        std::default::Default::default()
8220    }
8221
8222    /// Sets the value of [dead_letter_topic][crate::model::DeadLetterPolicy::dead_letter_topic].
8223    ///
8224    /// # Example
8225    /// ```ignore,no_run
8226    /// # use google_cloud_bigquery_analyticshub_v1::model::DeadLetterPolicy;
8227    /// let x = DeadLetterPolicy::new().set_dead_letter_topic("example");
8228    /// ```
8229    pub fn set_dead_letter_topic<T: std::convert::Into<std::string::String>>(
8230        mut self,
8231        v: T,
8232    ) -> Self {
8233        self.dead_letter_topic = v.into();
8234        self
8235    }
8236
8237    /// Sets the value of [max_delivery_attempts][crate::model::DeadLetterPolicy::max_delivery_attempts].
8238    ///
8239    /// # Example
8240    /// ```ignore,no_run
8241    /// # use google_cloud_bigquery_analyticshub_v1::model::DeadLetterPolicy;
8242    /// let x = DeadLetterPolicy::new().set_max_delivery_attempts(42);
8243    /// ```
8244    pub fn set_max_delivery_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8245        self.max_delivery_attempts = v.into();
8246        self
8247    }
8248}
8249
8250impl wkt::message::Message for DeadLetterPolicy {
8251    fn typename() -> &'static str {
8252        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeadLetterPolicy"
8253    }
8254}
8255
8256/// A policy that specifies the conditions for resource expiration (i.e.,
8257/// automatic resource deletion).
8258#[derive(Clone, Default, PartialEq)]
8259#[non_exhaustive]
8260pub struct ExpirationPolicy {
8261    /// Optional. Specifies the "time-to-live" duration for an associated resource.
8262    /// The resource expires if it is not active for a period of `ttl`. The
8263    /// definition of "activity" depends on the type of the associated resource.
8264    /// The minimum and maximum allowed values for `ttl` depend on the type of the
8265    /// associated resource, as well. If `ttl` is not set, the associated resource
8266    /// never expires.
8267    pub ttl: std::option::Option<wkt::Duration>,
8268
8269    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8270}
8271
8272impl ExpirationPolicy {
8273    /// Creates a new default instance.
8274    pub fn new() -> Self {
8275        std::default::Default::default()
8276    }
8277
8278    /// Sets the value of [ttl][crate::model::ExpirationPolicy::ttl].
8279    ///
8280    /// # Example
8281    /// ```ignore,no_run
8282    /// # use google_cloud_bigquery_analyticshub_v1::model::ExpirationPolicy;
8283    /// use wkt::Duration;
8284    /// let x = ExpirationPolicy::new().set_ttl(Duration::default()/* use setters */);
8285    /// ```
8286    pub fn set_ttl<T>(mut self, v: T) -> Self
8287    where
8288        T: std::convert::Into<wkt::Duration>,
8289    {
8290        self.ttl = std::option::Option::Some(v.into());
8291        self
8292    }
8293
8294    /// Sets or clears the value of [ttl][crate::model::ExpirationPolicy::ttl].
8295    ///
8296    /// # Example
8297    /// ```ignore,no_run
8298    /// # use google_cloud_bigquery_analyticshub_v1::model::ExpirationPolicy;
8299    /// use wkt::Duration;
8300    /// let x = ExpirationPolicy::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
8301    /// let x = ExpirationPolicy::new().set_or_clear_ttl(None::<Duration>);
8302    /// ```
8303    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
8304    where
8305        T: std::convert::Into<wkt::Duration>,
8306    {
8307        self.ttl = v.map(|x| x.into());
8308        self
8309    }
8310}
8311
8312impl wkt::message::Message for ExpirationPolicy {
8313    fn typename() -> &'static str {
8314        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ExpirationPolicy"
8315    }
8316}
8317
8318/// Configuration for a push delivery endpoint.
8319#[derive(Clone, Default, PartialEq)]
8320#[non_exhaustive]
8321pub struct PushConfig {
8322    /// Optional. A URL locating the endpoint to which messages should be pushed.
8323    /// For example, a Webhook endpoint might use `<https://example.com/push>`.
8324    pub push_endpoint: std::string::String,
8325
8326    /// Optional. Endpoint configuration attributes that can be used to control
8327    /// different aspects of the message delivery.
8328    ///
8329    /// The only currently supported attribute is `x-goog-version`, which you can
8330    /// use to change the format of the pushed message. This attribute
8331    /// indicates the version of the data expected by the endpoint. This
8332    /// controls the shape of the pushed message (i.e., its fields and metadata).
8333    ///
8334    /// If not present during the `CreateSubscription` call, it will default to
8335    /// the version of the Pub/Sub API used to make such call. If not present in a
8336    /// `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
8337    /// calls will always return a valid version, even if the subscription was
8338    /// created without this attribute.
8339    ///
8340    /// The only supported values for the `x-goog-version` attribute are:
8341    ///
8342    /// * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
8343    /// * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
8344    ///
8345    /// For example:
8346    /// `attributes { "x-goog-version": "v1" }`
8347    pub attributes: std::collections::HashMap<std::string::String, std::string::String>,
8348
8349    /// An authentication method used by push endpoints to verify the source of
8350    /// push requests. This can be used with push endpoints that are private by
8351    /// default to allow requests only from the Pub/Sub system, for example.
8352    /// This field is optional and should be set only by users interested in
8353    /// authenticated push.
8354    pub authentication_method: std::option::Option<crate::model::push_config::AuthenticationMethod>,
8355
8356    /// The format of the delivered message to the push endpoint is defined by
8357    /// the chosen wrapper. When unset, `PubsubWrapper` is used.
8358    pub wrapper: std::option::Option<crate::model::push_config::Wrapper>,
8359
8360    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8361}
8362
8363impl PushConfig {
8364    /// Creates a new default instance.
8365    pub fn new() -> Self {
8366        std::default::Default::default()
8367    }
8368
8369    /// Sets the value of [push_endpoint][crate::model::PushConfig::push_endpoint].
8370    ///
8371    /// # Example
8372    /// ```ignore,no_run
8373    /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8374    /// let x = PushConfig::new().set_push_endpoint("example");
8375    /// ```
8376    pub fn set_push_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8377        self.push_endpoint = v.into();
8378        self
8379    }
8380
8381    /// Sets the value of [attributes][crate::model::PushConfig::attributes].
8382    ///
8383    /// # Example
8384    /// ```ignore,no_run
8385    /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8386    /// let x = PushConfig::new().set_attributes([
8387    ///     ("key0", "abc"),
8388    ///     ("key1", "xyz"),
8389    /// ]);
8390    /// ```
8391    pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
8392    where
8393        T: std::iter::IntoIterator<Item = (K, V)>,
8394        K: std::convert::Into<std::string::String>,
8395        V: std::convert::Into<std::string::String>,
8396    {
8397        use std::iter::Iterator;
8398        self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8399        self
8400    }
8401
8402    /// Sets the value of [authentication_method][crate::model::PushConfig::authentication_method].
8403    ///
8404    /// Note that all the setters affecting `authentication_method` are mutually
8405    /// exclusive.
8406    ///
8407    /// # Example
8408    /// ```ignore,no_run
8409    /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8410    /// use google_cloud_bigquery_analyticshub_v1::model::push_config::OidcToken;
8411    /// let x = PushConfig::new().set_authentication_method(Some(
8412    ///     google_cloud_bigquery_analyticshub_v1::model::push_config::AuthenticationMethod::OidcToken(OidcToken::default().into())));
8413    /// ```
8414    pub fn set_authentication_method<
8415        T: std::convert::Into<std::option::Option<crate::model::push_config::AuthenticationMethod>>,
8416    >(
8417        mut self,
8418        v: T,
8419    ) -> Self {
8420        self.authentication_method = v.into();
8421        self
8422    }
8423
8424    /// The value of [authentication_method][crate::model::PushConfig::authentication_method]
8425    /// if it holds a `OidcToken`, `None` if the field is not set or
8426    /// holds a different branch.
8427    pub fn oidc_token(
8428        &self,
8429    ) -> std::option::Option<&std::boxed::Box<crate::model::push_config::OidcToken>> {
8430        #[allow(unreachable_patterns)]
8431        self.authentication_method.as_ref().and_then(|v| match v {
8432            crate::model::push_config::AuthenticationMethod::OidcToken(v) => {
8433                std::option::Option::Some(v)
8434            }
8435            _ => std::option::Option::None,
8436        })
8437    }
8438
8439    /// Sets the value of [authentication_method][crate::model::PushConfig::authentication_method]
8440    /// to hold a `OidcToken`.
8441    ///
8442    /// Note that all the setters affecting `authentication_method` are
8443    /// mutually exclusive.
8444    ///
8445    /// # Example
8446    /// ```ignore,no_run
8447    /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8448    /// use google_cloud_bigquery_analyticshub_v1::model::push_config::OidcToken;
8449    /// let x = PushConfig::new().set_oidc_token(OidcToken::default()/* use setters */);
8450    /// assert!(x.oidc_token().is_some());
8451    /// ```
8452    pub fn set_oidc_token<
8453        T: std::convert::Into<std::boxed::Box<crate::model::push_config::OidcToken>>,
8454    >(
8455        mut self,
8456        v: T,
8457    ) -> Self {
8458        self.authentication_method = std::option::Option::Some(
8459            crate::model::push_config::AuthenticationMethod::OidcToken(v.into()),
8460        );
8461        self
8462    }
8463
8464    /// Sets the value of [wrapper][crate::model::PushConfig::wrapper].
8465    ///
8466    /// Note that all the setters affecting `wrapper` are mutually
8467    /// exclusive.
8468    ///
8469    /// # Example
8470    /// ```ignore,no_run
8471    /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8472    /// use google_cloud_bigquery_analyticshub_v1::model::push_config::PubsubWrapper;
8473    /// let x = PushConfig::new().set_wrapper(Some(
8474    ///     google_cloud_bigquery_analyticshub_v1::model::push_config::Wrapper::PubsubWrapper(PubsubWrapper::default().into())));
8475    /// ```
8476    pub fn set_wrapper<
8477        T: std::convert::Into<std::option::Option<crate::model::push_config::Wrapper>>,
8478    >(
8479        mut self,
8480        v: T,
8481    ) -> Self {
8482        self.wrapper = v.into();
8483        self
8484    }
8485
8486    /// The value of [wrapper][crate::model::PushConfig::wrapper]
8487    /// if it holds a `PubsubWrapper`, `None` if the field is not set or
8488    /// holds a different branch.
8489    pub fn pubsub_wrapper(
8490        &self,
8491    ) -> std::option::Option<&std::boxed::Box<crate::model::push_config::PubsubWrapper>> {
8492        #[allow(unreachable_patterns)]
8493        self.wrapper.as_ref().and_then(|v| match v {
8494            crate::model::push_config::Wrapper::PubsubWrapper(v) => std::option::Option::Some(v),
8495            _ => std::option::Option::None,
8496        })
8497    }
8498
8499    /// Sets the value of [wrapper][crate::model::PushConfig::wrapper]
8500    /// to hold a `PubsubWrapper`.
8501    ///
8502    /// Note that all the setters affecting `wrapper` are
8503    /// mutually exclusive.
8504    ///
8505    /// # Example
8506    /// ```ignore,no_run
8507    /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8508    /// use google_cloud_bigquery_analyticshub_v1::model::push_config::PubsubWrapper;
8509    /// let x = PushConfig::new().set_pubsub_wrapper(PubsubWrapper::default()/* use setters */);
8510    /// assert!(x.pubsub_wrapper().is_some());
8511    /// assert!(x.no_wrapper().is_none());
8512    /// ```
8513    pub fn set_pubsub_wrapper<
8514        T: std::convert::Into<std::boxed::Box<crate::model::push_config::PubsubWrapper>>,
8515    >(
8516        mut self,
8517        v: T,
8518    ) -> Self {
8519        self.wrapper =
8520            std::option::Option::Some(crate::model::push_config::Wrapper::PubsubWrapper(v.into()));
8521        self
8522    }
8523
8524    /// The value of [wrapper][crate::model::PushConfig::wrapper]
8525    /// if it holds a `NoWrapper`, `None` if the field is not set or
8526    /// holds a different branch.
8527    pub fn no_wrapper(
8528        &self,
8529    ) -> std::option::Option<&std::boxed::Box<crate::model::push_config::NoWrapper>> {
8530        #[allow(unreachable_patterns)]
8531        self.wrapper.as_ref().and_then(|v| match v {
8532            crate::model::push_config::Wrapper::NoWrapper(v) => std::option::Option::Some(v),
8533            _ => std::option::Option::None,
8534        })
8535    }
8536
8537    /// Sets the value of [wrapper][crate::model::PushConfig::wrapper]
8538    /// to hold a `NoWrapper`.
8539    ///
8540    /// Note that all the setters affecting `wrapper` are
8541    /// mutually exclusive.
8542    ///
8543    /// # Example
8544    /// ```ignore,no_run
8545    /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8546    /// use google_cloud_bigquery_analyticshub_v1::model::push_config::NoWrapper;
8547    /// let x = PushConfig::new().set_no_wrapper(NoWrapper::default()/* use setters */);
8548    /// assert!(x.no_wrapper().is_some());
8549    /// assert!(x.pubsub_wrapper().is_none());
8550    /// ```
8551    pub fn set_no_wrapper<
8552        T: std::convert::Into<std::boxed::Box<crate::model::push_config::NoWrapper>>,
8553    >(
8554        mut self,
8555        v: T,
8556    ) -> Self {
8557        self.wrapper =
8558            std::option::Option::Some(crate::model::push_config::Wrapper::NoWrapper(v.into()));
8559        self
8560    }
8561}
8562
8563impl wkt::message::Message for PushConfig {
8564    fn typename() -> &'static str {
8565        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig"
8566    }
8567}
8568
8569/// Defines additional types related to [PushConfig].
8570pub mod push_config {
8571    #[allow(unused_imports)]
8572    use super::*;
8573
8574    /// Contains information needed for generating an
8575    /// [OpenID Connect
8576    /// token](https://developers.google.com/identity/protocols/OpenIDConnect).
8577    #[derive(Clone, Default, PartialEq)]
8578    #[non_exhaustive]
8579    pub struct OidcToken {
8580        /// Optional. [Service account
8581        /// email](https://cloud.google.com/iam/docs/service-accounts)
8582        /// used for generating the OIDC token. For more information
8583        /// on setting up authentication, see
8584        /// [Push subscriptions](https://cloud.google.com/pubsub/docs/push).
8585        pub service_account_email: std::string::String,
8586
8587        /// Optional. Audience to be used when generating OIDC token. The audience
8588        /// claim identifies the recipients that the JWT is intended for. The
8589        /// audience value is a single case-sensitive string. Having multiple values
8590        /// (array) for the audience field is not supported. More info about the OIDC
8591        /// JWT token audience here:
8592        /// <https://tools.ietf.org/html/rfc7519#section-4.1.3> Note: if not specified,
8593        /// the Push endpoint URL will be used.
8594        pub audience: std::string::String,
8595
8596        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8597    }
8598
8599    impl OidcToken {
8600        /// Creates a new default instance.
8601        pub fn new() -> Self {
8602            std::default::Default::default()
8603        }
8604
8605        /// Sets the value of [service_account_email][crate::model::push_config::OidcToken::service_account_email].
8606        ///
8607        /// # Example
8608        /// ```ignore,no_run
8609        /// # use google_cloud_bigquery_analyticshub_v1::model::push_config::OidcToken;
8610        /// let x = OidcToken::new().set_service_account_email("example");
8611        /// ```
8612        pub fn set_service_account_email<T: std::convert::Into<std::string::String>>(
8613            mut self,
8614            v: T,
8615        ) -> Self {
8616            self.service_account_email = v.into();
8617            self
8618        }
8619
8620        /// Sets the value of [audience][crate::model::push_config::OidcToken::audience].
8621        ///
8622        /// # Example
8623        /// ```ignore,no_run
8624        /// # use google_cloud_bigquery_analyticshub_v1::model::push_config::OidcToken;
8625        /// let x = OidcToken::new().set_audience("example");
8626        /// ```
8627        pub fn set_audience<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8628            self.audience = v.into();
8629            self
8630        }
8631    }
8632
8633    impl wkt::message::Message for OidcToken {
8634        fn typename() -> &'static str {
8635            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig.OidcToken"
8636        }
8637    }
8638
8639    /// The payload to the push endpoint is in the form of the JSON representation
8640    /// of a PubsubMessage
8641    /// (<https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage>).
8642    #[derive(Clone, Default, PartialEq)]
8643    #[non_exhaustive]
8644    pub struct PubsubWrapper {
8645        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8646    }
8647
8648    impl PubsubWrapper {
8649        /// Creates a new default instance.
8650        pub fn new() -> Self {
8651            std::default::Default::default()
8652        }
8653    }
8654
8655    impl wkt::message::Message for PubsubWrapper {
8656        fn typename() -> &'static str {
8657            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig.PubsubWrapper"
8658        }
8659    }
8660
8661    /// Sets the `data` field as the HTTP body for delivery.
8662    #[derive(Clone, Default, PartialEq)]
8663    #[non_exhaustive]
8664    pub struct NoWrapper {
8665        /// Optional. When true, writes the Pub/Sub message metadata to
8666        /// `x-goog-pubsub-<KEY>:<VAL>` headers of the HTTP request. Writes the
8667        /// Pub/Sub message attributes to `<KEY>:<VAL>` headers of the HTTP request.
8668        pub write_metadata: bool,
8669
8670        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8671    }
8672
8673    impl NoWrapper {
8674        /// Creates a new default instance.
8675        pub fn new() -> Self {
8676            std::default::Default::default()
8677        }
8678
8679        /// Sets the value of [write_metadata][crate::model::push_config::NoWrapper::write_metadata].
8680        ///
8681        /// # Example
8682        /// ```ignore,no_run
8683        /// # use google_cloud_bigquery_analyticshub_v1::model::push_config::NoWrapper;
8684        /// let x = NoWrapper::new().set_write_metadata(true);
8685        /// ```
8686        pub fn set_write_metadata<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8687            self.write_metadata = v.into();
8688            self
8689        }
8690    }
8691
8692    impl wkt::message::Message for NoWrapper {
8693        fn typename() -> &'static str {
8694            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig.NoWrapper"
8695        }
8696    }
8697
8698    /// An authentication method used by push endpoints to verify the source of
8699    /// push requests. This can be used with push endpoints that are private by
8700    /// default to allow requests only from the Pub/Sub system, for example.
8701    /// This field is optional and should be set only by users interested in
8702    /// authenticated push.
8703    #[derive(Clone, Debug, PartialEq)]
8704    #[non_exhaustive]
8705    pub enum AuthenticationMethod {
8706        /// Optional. If specified, Pub/Sub will generate and attach an OIDC JWT
8707        /// token as an `Authorization` header in the HTTP request for every pushed
8708        /// message.
8709        OidcToken(std::boxed::Box<crate::model::push_config::OidcToken>),
8710    }
8711
8712    /// The format of the delivered message to the push endpoint is defined by
8713    /// the chosen wrapper. When unset, `PubsubWrapper` is used.
8714    #[derive(Clone, Debug, PartialEq)]
8715    #[non_exhaustive]
8716    pub enum Wrapper {
8717        /// Optional. When set, the payload to the push endpoint is in the form of
8718        /// the JSON representation of a PubsubMessage
8719        /// (<https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage>).
8720        PubsubWrapper(std::boxed::Box<crate::model::push_config::PubsubWrapper>),
8721        /// Optional. When set, the payload to the push endpoint is not wrapped.
8722        NoWrapper(std::boxed::Box<crate::model::push_config::NoWrapper>),
8723    }
8724}
8725
8726/// Configuration for a BigQuery subscription.
8727#[derive(Clone, Default, PartialEq)]
8728#[non_exhaustive]
8729pub struct BigQueryConfig {
8730    /// Optional. The name of the table to which to write data, of the form
8731    /// {projectId}.{datasetId}.{tableId}
8732    pub table: std::string::String,
8733
8734    /// Optional. When true, use the topic's schema as the columns to write to in
8735    /// BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
8736    /// enabled at the same time.
8737    pub use_topic_schema: bool,
8738
8739    /// Optional. When true, write the subscription name, message_id, publish_time,
8740    /// attributes, and ordering_key to additional columns in the table. The
8741    /// subscription name, message_id, and publish_time fields are put in their own
8742    /// columns while all other message properties (other than data) are written to
8743    /// a JSON object in the attributes column.
8744    pub write_metadata: bool,
8745
8746    /// Optional. When true and use_topic_schema is true, any fields that are a
8747    /// part of the topic schema that are not part of the BigQuery table schema are
8748    /// dropped when writing to BigQuery. Otherwise, the schemas must be kept in
8749    /// sync and any messages with extra fields are not written and remain in the
8750    /// subscription's backlog.
8751    pub drop_unknown_fields: bool,
8752
8753    /// Optional. When true, use the BigQuery table's schema as the columns to
8754    /// write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
8755    /// enabled at the same time.
8756    pub use_table_schema: bool,
8757
8758    /// Optional. The service account to use to write to BigQuery. The subscription
8759    /// creator or updater that specifies this field must have
8760    /// `iam.serviceAccounts.actAs` permission on the service account. If not
8761    /// specified, the Pub/Sub [service
8762    /// agent](https://cloud.google.com/iam/docs/service-agents),
8763    /// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
8764    pub service_account_email: std::string::String,
8765
8766    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8767}
8768
8769impl BigQueryConfig {
8770    /// Creates a new default instance.
8771    pub fn new() -> Self {
8772        std::default::Default::default()
8773    }
8774
8775    /// Sets the value of [table][crate::model::BigQueryConfig::table].
8776    ///
8777    /// # Example
8778    /// ```ignore,no_run
8779    /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8780    /// let x = BigQueryConfig::new().set_table("example");
8781    /// ```
8782    pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8783        self.table = v.into();
8784        self
8785    }
8786
8787    /// Sets the value of [use_topic_schema][crate::model::BigQueryConfig::use_topic_schema].
8788    ///
8789    /// # Example
8790    /// ```ignore,no_run
8791    /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8792    /// let x = BigQueryConfig::new().set_use_topic_schema(true);
8793    /// ```
8794    pub fn set_use_topic_schema<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8795        self.use_topic_schema = v.into();
8796        self
8797    }
8798
8799    /// Sets the value of [write_metadata][crate::model::BigQueryConfig::write_metadata].
8800    ///
8801    /// # Example
8802    /// ```ignore,no_run
8803    /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8804    /// let x = BigQueryConfig::new().set_write_metadata(true);
8805    /// ```
8806    pub fn set_write_metadata<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8807        self.write_metadata = v.into();
8808        self
8809    }
8810
8811    /// Sets the value of [drop_unknown_fields][crate::model::BigQueryConfig::drop_unknown_fields].
8812    ///
8813    /// # Example
8814    /// ```ignore,no_run
8815    /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8816    /// let x = BigQueryConfig::new().set_drop_unknown_fields(true);
8817    /// ```
8818    pub fn set_drop_unknown_fields<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8819        self.drop_unknown_fields = v.into();
8820        self
8821    }
8822
8823    /// Sets the value of [use_table_schema][crate::model::BigQueryConfig::use_table_schema].
8824    ///
8825    /// # Example
8826    /// ```ignore,no_run
8827    /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8828    /// let x = BigQueryConfig::new().set_use_table_schema(true);
8829    /// ```
8830    pub fn set_use_table_schema<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8831        self.use_table_schema = v.into();
8832        self
8833    }
8834
8835    /// Sets the value of [service_account_email][crate::model::BigQueryConfig::service_account_email].
8836    ///
8837    /// # Example
8838    /// ```ignore,no_run
8839    /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8840    /// let x = BigQueryConfig::new().set_service_account_email("example");
8841    /// ```
8842    pub fn set_service_account_email<T: std::convert::Into<std::string::String>>(
8843        mut self,
8844        v: T,
8845    ) -> Self {
8846        self.service_account_email = v.into();
8847        self
8848    }
8849}
8850
8851impl wkt::message::Message for BigQueryConfig {
8852    fn typename() -> &'static str {
8853        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.BigQueryConfig"
8854    }
8855}
8856
8857/// Configuration for a Cloud Storage subscription.
8858#[derive(Clone, Default, PartialEq)]
8859#[non_exhaustive]
8860pub struct CloudStorageConfig {
8861    /// Required. User-provided name for the Cloud Storage bucket.
8862    /// The bucket must be created by the user. The bucket name must be without
8863    /// any prefix like "gs://". See the [bucket naming
8864    /// requirements] (<https://cloud.google.com/storage/docs/buckets#naming>).
8865    pub bucket: std::string::String,
8866
8867    /// Optional. User-provided prefix for Cloud Storage filename. See the [object
8868    /// naming requirements](https://cloud.google.com/storage/docs/objects#naming).
8869    pub filename_prefix: std::string::String,
8870
8871    /// Optional. User-provided suffix for Cloud Storage filename. See the [object
8872    /// naming requirements](https://cloud.google.com/storage/docs/objects#naming).
8873    /// Must not end in "/".
8874    pub filename_suffix: std::string::String,
8875
8876    /// Optional. User-provided format string specifying how to represent datetimes
8877    /// in Cloud Storage filenames. See the [datetime format
8878    /// guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names).
8879    pub filename_datetime_format: std::string::String,
8880
8881    /// Optional. File batching settings.
8882    /// If no max_duration setting is specified, a max_duration of 5 minutes will
8883    /// be set by default. max_duration is required regardless of whether other
8884    /// file batching settings are specified.
8885    ///
8886    /// The maximum duration that can elapse before a new Cloud Storage file is
8887    /// created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
8888    /// the subscription's acknowledgement deadline.
8889    pub max_duration: std::option::Option<wkt::Duration>,
8890
8891    /// Optional. The maximum bytes that can be written to a Cloud Storage file
8892    /// before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may
8893    /// be exceeded in cases where messages are larger than the limit.
8894    pub max_bytes: i64,
8895
8896    /// Optional. The maximum number of messages that can be written to a Cloud
8897    /// Storage file before a new file is created. Min 1000 messages.
8898    pub max_messages: i64,
8899
8900    /// Optional. The service account to use to write to Cloud Storage. The
8901    /// subscription creator or updater that specifies this field must have
8902    /// `iam.serviceAccounts.actAs` permission on the service account. If not
8903    /// specified, the Pub/Sub
8904    /// [service agent](https://cloud.google.com/iam/docs/service-agents),
8905    /// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
8906    pub service_account_email: std::string::String,
8907
8908    /// Defaults to text format.
8909    pub output_format: std::option::Option<crate::model::cloud_storage_config::OutputFormat>,
8910
8911    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8912}
8913
8914impl CloudStorageConfig {
8915    /// Creates a new default instance.
8916    pub fn new() -> Self {
8917        std::default::Default::default()
8918    }
8919
8920    /// Sets the value of [bucket][crate::model::CloudStorageConfig::bucket].
8921    ///
8922    /// # Example
8923    /// ```ignore,no_run
8924    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8925    /// let x = CloudStorageConfig::new().set_bucket("example");
8926    /// ```
8927    pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8928        self.bucket = v.into();
8929        self
8930    }
8931
8932    /// Sets the value of [filename_prefix][crate::model::CloudStorageConfig::filename_prefix].
8933    ///
8934    /// # Example
8935    /// ```ignore,no_run
8936    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8937    /// let x = CloudStorageConfig::new().set_filename_prefix("example");
8938    /// ```
8939    pub fn set_filename_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8940        self.filename_prefix = v.into();
8941        self
8942    }
8943
8944    /// Sets the value of [filename_suffix][crate::model::CloudStorageConfig::filename_suffix].
8945    ///
8946    /// # Example
8947    /// ```ignore,no_run
8948    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8949    /// let x = CloudStorageConfig::new().set_filename_suffix("example");
8950    /// ```
8951    pub fn set_filename_suffix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8952        self.filename_suffix = v.into();
8953        self
8954    }
8955
8956    /// Sets the value of [filename_datetime_format][crate::model::CloudStorageConfig::filename_datetime_format].
8957    ///
8958    /// # Example
8959    /// ```ignore,no_run
8960    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8961    /// let x = CloudStorageConfig::new().set_filename_datetime_format("example");
8962    /// ```
8963    pub fn set_filename_datetime_format<T: std::convert::Into<std::string::String>>(
8964        mut self,
8965        v: T,
8966    ) -> Self {
8967        self.filename_datetime_format = v.into();
8968        self
8969    }
8970
8971    /// Sets the value of [max_duration][crate::model::CloudStorageConfig::max_duration].
8972    ///
8973    /// # Example
8974    /// ```ignore,no_run
8975    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8976    /// use wkt::Duration;
8977    /// let x = CloudStorageConfig::new().set_max_duration(Duration::default()/* use setters */);
8978    /// ```
8979    pub fn set_max_duration<T>(mut self, v: T) -> Self
8980    where
8981        T: std::convert::Into<wkt::Duration>,
8982    {
8983        self.max_duration = std::option::Option::Some(v.into());
8984        self
8985    }
8986
8987    /// Sets or clears the value of [max_duration][crate::model::CloudStorageConfig::max_duration].
8988    ///
8989    /// # Example
8990    /// ```ignore,no_run
8991    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8992    /// use wkt::Duration;
8993    /// let x = CloudStorageConfig::new().set_or_clear_max_duration(Some(Duration::default()/* use setters */));
8994    /// let x = CloudStorageConfig::new().set_or_clear_max_duration(None::<Duration>);
8995    /// ```
8996    pub fn set_or_clear_max_duration<T>(mut self, v: std::option::Option<T>) -> Self
8997    where
8998        T: std::convert::Into<wkt::Duration>,
8999    {
9000        self.max_duration = v.map(|x| x.into());
9001        self
9002    }
9003
9004    /// Sets the value of [max_bytes][crate::model::CloudStorageConfig::max_bytes].
9005    ///
9006    /// # Example
9007    /// ```ignore,no_run
9008    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
9009    /// let x = CloudStorageConfig::new().set_max_bytes(42);
9010    /// ```
9011    pub fn set_max_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9012        self.max_bytes = v.into();
9013        self
9014    }
9015
9016    /// Sets the value of [max_messages][crate::model::CloudStorageConfig::max_messages].
9017    ///
9018    /// # Example
9019    /// ```ignore,no_run
9020    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
9021    /// let x = CloudStorageConfig::new().set_max_messages(42);
9022    /// ```
9023    pub fn set_max_messages<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9024        self.max_messages = v.into();
9025        self
9026    }
9027
9028    /// Sets the value of [service_account_email][crate::model::CloudStorageConfig::service_account_email].
9029    ///
9030    /// # Example
9031    /// ```ignore,no_run
9032    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
9033    /// let x = CloudStorageConfig::new().set_service_account_email("example");
9034    /// ```
9035    pub fn set_service_account_email<T: std::convert::Into<std::string::String>>(
9036        mut self,
9037        v: T,
9038    ) -> Self {
9039        self.service_account_email = v.into();
9040        self
9041    }
9042
9043    /// Sets the value of [output_format][crate::model::CloudStorageConfig::output_format].
9044    ///
9045    /// Note that all the setters affecting `output_format` are mutually
9046    /// exclusive.
9047    ///
9048    /// # Example
9049    /// ```ignore,no_run
9050    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
9051    /// use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::TextConfig;
9052    /// let x = CloudStorageConfig::new().set_output_format(Some(
9053    ///     google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::OutputFormat::TextConfig(TextConfig::default().into())));
9054    /// ```
9055    pub fn set_output_format<
9056        T: std::convert::Into<std::option::Option<crate::model::cloud_storage_config::OutputFormat>>,
9057    >(
9058        mut self,
9059        v: T,
9060    ) -> Self {
9061        self.output_format = v.into();
9062        self
9063    }
9064
9065    /// The value of [output_format][crate::model::CloudStorageConfig::output_format]
9066    /// if it holds a `TextConfig`, `None` if the field is not set or
9067    /// holds a different branch.
9068    pub fn text_config(
9069        &self,
9070    ) -> std::option::Option<&std::boxed::Box<crate::model::cloud_storage_config::TextConfig>> {
9071        #[allow(unreachable_patterns)]
9072        self.output_format.as_ref().and_then(|v| match v {
9073            crate::model::cloud_storage_config::OutputFormat::TextConfig(v) => {
9074                std::option::Option::Some(v)
9075            }
9076            _ => std::option::Option::None,
9077        })
9078    }
9079
9080    /// Sets the value of [output_format][crate::model::CloudStorageConfig::output_format]
9081    /// to hold a `TextConfig`.
9082    ///
9083    /// Note that all the setters affecting `output_format` are
9084    /// mutually exclusive.
9085    ///
9086    /// # Example
9087    /// ```ignore,no_run
9088    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
9089    /// use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::TextConfig;
9090    /// let x = CloudStorageConfig::new().set_text_config(TextConfig::default()/* use setters */);
9091    /// assert!(x.text_config().is_some());
9092    /// assert!(x.avro_config().is_none());
9093    /// ```
9094    pub fn set_text_config<
9095        T: std::convert::Into<std::boxed::Box<crate::model::cloud_storage_config::TextConfig>>,
9096    >(
9097        mut self,
9098        v: T,
9099    ) -> Self {
9100        self.output_format = std::option::Option::Some(
9101            crate::model::cloud_storage_config::OutputFormat::TextConfig(v.into()),
9102        );
9103        self
9104    }
9105
9106    /// The value of [output_format][crate::model::CloudStorageConfig::output_format]
9107    /// if it holds a `AvroConfig`, `None` if the field is not set or
9108    /// holds a different branch.
9109    pub fn avro_config(
9110        &self,
9111    ) -> std::option::Option<&std::boxed::Box<crate::model::cloud_storage_config::AvroConfig>> {
9112        #[allow(unreachable_patterns)]
9113        self.output_format.as_ref().and_then(|v| match v {
9114            crate::model::cloud_storage_config::OutputFormat::AvroConfig(v) => {
9115                std::option::Option::Some(v)
9116            }
9117            _ => std::option::Option::None,
9118        })
9119    }
9120
9121    /// Sets the value of [output_format][crate::model::CloudStorageConfig::output_format]
9122    /// to hold a `AvroConfig`.
9123    ///
9124    /// Note that all the setters affecting `output_format` are
9125    /// mutually exclusive.
9126    ///
9127    /// # Example
9128    /// ```ignore,no_run
9129    /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
9130    /// use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::AvroConfig;
9131    /// let x = CloudStorageConfig::new().set_avro_config(AvroConfig::default()/* use setters */);
9132    /// assert!(x.avro_config().is_some());
9133    /// assert!(x.text_config().is_none());
9134    /// ```
9135    pub fn set_avro_config<
9136        T: std::convert::Into<std::boxed::Box<crate::model::cloud_storage_config::AvroConfig>>,
9137    >(
9138        mut self,
9139        v: T,
9140    ) -> Self {
9141        self.output_format = std::option::Option::Some(
9142            crate::model::cloud_storage_config::OutputFormat::AvroConfig(v.into()),
9143        );
9144        self
9145    }
9146}
9147
9148impl wkt::message::Message for CloudStorageConfig {
9149    fn typename() -> &'static str {
9150        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CloudStorageConfig"
9151    }
9152}
9153
9154/// Defines additional types related to [CloudStorageConfig].
9155pub mod cloud_storage_config {
9156    #[allow(unused_imports)]
9157    use super::*;
9158
9159    /// Configuration for writing message data in text format.
9160    /// Message payloads will be written to files as raw text, separated by a
9161    /// newline.
9162    #[derive(Clone, Default, PartialEq)]
9163    #[non_exhaustive]
9164    pub struct TextConfig {
9165        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9166    }
9167
9168    impl TextConfig {
9169        /// Creates a new default instance.
9170        pub fn new() -> Self {
9171            std::default::Default::default()
9172        }
9173    }
9174
9175    impl wkt::message::Message for TextConfig {
9176        fn typename() -> &'static str {
9177            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CloudStorageConfig.TextConfig"
9178        }
9179    }
9180
9181    /// Configuration for writing message data in Avro format.
9182    /// Message payloads and metadata will be written to files as an Avro binary.
9183    #[derive(Clone, Default, PartialEq)]
9184    #[non_exhaustive]
9185    pub struct AvroConfig {
9186        /// Optional. When true, write the subscription name, message_id,
9187        /// publish_time, attributes, and ordering_key as additional fields in the
9188        /// output. The subscription name, message_id, and publish_time fields are
9189        /// put in their own fields while all other message properties other than
9190        /// data (for example, an ordering_key, if present) are added as entries in
9191        /// the attributes map.
9192        pub write_metadata: bool,
9193
9194        /// Optional. When true, the output Cloud Storage file will be serialized
9195        /// using the topic schema, if it exists.
9196        pub use_topic_schema: bool,
9197
9198        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9199    }
9200
9201    impl AvroConfig {
9202        /// Creates a new default instance.
9203        pub fn new() -> Self {
9204            std::default::Default::default()
9205        }
9206
9207        /// Sets the value of [write_metadata][crate::model::cloud_storage_config::AvroConfig::write_metadata].
9208        ///
9209        /// # Example
9210        /// ```ignore,no_run
9211        /// # use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::AvroConfig;
9212        /// let x = AvroConfig::new().set_write_metadata(true);
9213        /// ```
9214        pub fn set_write_metadata<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9215            self.write_metadata = v.into();
9216            self
9217        }
9218
9219        /// Sets the value of [use_topic_schema][crate::model::cloud_storage_config::AvroConfig::use_topic_schema].
9220        ///
9221        /// # Example
9222        /// ```ignore,no_run
9223        /// # use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::AvroConfig;
9224        /// let x = AvroConfig::new().set_use_topic_schema(true);
9225        /// ```
9226        pub fn set_use_topic_schema<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9227            self.use_topic_schema = v.into();
9228            self
9229        }
9230    }
9231
9232    impl wkt::message::Message for AvroConfig {
9233        fn typename() -> &'static str {
9234            "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CloudStorageConfig.AvroConfig"
9235        }
9236    }
9237
9238    /// Defaults to text format.
9239    #[derive(Clone, Debug, PartialEq)]
9240    #[non_exhaustive]
9241    pub enum OutputFormat {
9242        /// Optional. If set, message data will be written to Cloud Storage in text
9243        /// format.
9244        TextConfig(std::boxed::Box<crate::model::cloud_storage_config::TextConfig>),
9245        /// Optional. If set, message data will be written to Cloud Storage in Avro
9246        /// format.
9247        AvroConfig(std::boxed::Box<crate::model::cloud_storage_config::AvroConfig>),
9248    }
9249}
9250
9251/// All supported message transforms types.
9252#[derive(Clone, Default, PartialEq)]
9253#[non_exhaustive]
9254pub struct MessageTransform {
9255    /// Optional. This field is deprecated, use the `disabled` field to disable
9256    /// transforms.
9257    #[deprecated]
9258    pub enabled: bool,
9259
9260    /// Optional. If true, the transform is disabled and will not be applied to
9261    /// messages. Defaults to `false`.
9262    pub disabled: bool,
9263
9264    /// The type of transform to apply to messages.
9265    pub transform: std::option::Option<crate::model::message_transform::Transform>,
9266
9267    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9268}
9269
9270impl MessageTransform {
9271    /// Creates a new default instance.
9272    pub fn new() -> Self {
9273        std::default::Default::default()
9274    }
9275
9276    /// Sets the value of [enabled][crate::model::MessageTransform::enabled].
9277    ///
9278    /// # Example
9279    /// ```ignore,no_run
9280    /// # use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
9281    /// let x = MessageTransform::new().set_enabled(true);
9282    /// ```
9283    #[deprecated]
9284    pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9285        self.enabled = v.into();
9286        self
9287    }
9288
9289    /// Sets the value of [disabled][crate::model::MessageTransform::disabled].
9290    ///
9291    /// # Example
9292    /// ```ignore,no_run
9293    /// # use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
9294    /// let x = MessageTransform::new().set_disabled(true);
9295    /// ```
9296    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9297        self.disabled = v.into();
9298        self
9299    }
9300
9301    /// Sets the value of [transform][crate::model::MessageTransform::transform].
9302    ///
9303    /// Note that all the setters affecting `transform` are mutually
9304    /// exclusive.
9305    ///
9306    /// # Example
9307    /// ```ignore,no_run
9308    /// # use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
9309    /// use google_cloud_bigquery_analyticshub_v1::model::JavaScriptUDF;
9310    /// let x = MessageTransform::new().set_transform(Some(
9311    ///     google_cloud_bigquery_analyticshub_v1::model::message_transform::Transform::JavascriptUdf(JavaScriptUDF::default().into())));
9312    /// ```
9313    pub fn set_transform<
9314        T: std::convert::Into<std::option::Option<crate::model::message_transform::Transform>>,
9315    >(
9316        mut self,
9317        v: T,
9318    ) -> Self {
9319        self.transform = v.into();
9320        self
9321    }
9322
9323    /// The value of [transform][crate::model::MessageTransform::transform]
9324    /// if it holds a `JavascriptUdf`, `None` if the field is not set or
9325    /// holds a different branch.
9326    pub fn javascript_udf(
9327        &self,
9328    ) -> std::option::Option<&std::boxed::Box<crate::model::JavaScriptUDF>> {
9329        #[allow(unreachable_patterns)]
9330        self.transform.as_ref().and_then(|v| match v {
9331            crate::model::message_transform::Transform::JavascriptUdf(v) => {
9332                std::option::Option::Some(v)
9333            }
9334            _ => std::option::Option::None,
9335        })
9336    }
9337
9338    /// Sets the value of [transform][crate::model::MessageTransform::transform]
9339    /// to hold a `JavascriptUdf`.
9340    ///
9341    /// Note that all the setters affecting `transform` are
9342    /// mutually exclusive.
9343    ///
9344    /// # Example
9345    /// ```ignore,no_run
9346    /// # use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
9347    /// use google_cloud_bigquery_analyticshub_v1::model::JavaScriptUDF;
9348    /// let x = MessageTransform::new().set_javascript_udf(JavaScriptUDF::default()/* use setters */);
9349    /// assert!(x.javascript_udf().is_some());
9350    /// ```
9351    pub fn set_javascript_udf<
9352        T: std::convert::Into<std::boxed::Box<crate::model::JavaScriptUDF>>,
9353    >(
9354        mut self,
9355        v: T,
9356    ) -> Self {
9357        self.transform = std::option::Option::Some(
9358            crate::model::message_transform::Transform::JavascriptUdf(v.into()),
9359        );
9360        self
9361    }
9362}
9363
9364impl wkt::message::Message for MessageTransform {
9365    fn typename() -> &'static str {
9366        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.MessageTransform"
9367    }
9368}
9369
9370/// Defines additional types related to [MessageTransform].
9371pub mod message_transform {
9372    #[allow(unused_imports)]
9373    use super::*;
9374
9375    /// The type of transform to apply to messages.
9376    #[derive(Clone, Debug, PartialEq)]
9377    #[non_exhaustive]
9378    pub enum Transform {
9379        /// Optional. JavaScript User Defined Function. If multiple JavaScriptUDF's
9380        /// are specified on a resource, each must have a unique `function_name`.
9381        JavascriptUdf(std::boxed::Box<crate::model::JavaScriptUDF>),
9382    }
9383}
9384
9385/// User-defined JavaScript function that can transform or filter a Pub/Sub
9386/// message.
9387#[derive(Clone, Default, PartialEq)]
9388#[non_exhaustive]
9389pub struct JavaScriptUDF {
9390    /// Required. Name of the JavasScript function that should applied to Pub/Sub
9391    /// messages.
9392    pub function_name: std::string::String,
9393
9394    /// Required. JavaScript code that contains a function `function_name` with the
9395    /// below signature:
9396    ///
9397    /// ```norust
9398    ///   /**
9399    ///   * Transforms a Pub/Sub message.
9400    ///
9401    ///   * @return {(Object<string, (string | Object<string, string>)>|null)} - To
9402    ///   * filter a message, return `null`. To transform a message return a map
9403    ///   * with the following keys:
9404    ///   *   - (required) 'data' : {string}
9405    ///   *   - (optional) 'attributes' : {Object<string, string>}
9406    ///   * Returning empty `attributes` will remove all attributes from the
9407    ///   * message.
9408    ///   *
9409    ///   * @param  {(Object<string, (string | Object<string, string>)>} Pub/Sub
9410    ///   * message. Keys:
9411    ///   *   - (required) 'data' : {string}
9412    ///   *   - (required) 'attributes' : {Object<string, string>}
9413    ///   *
9414    ///   * @param  {Object<string, any>} metadata - Pub/Sub message metadata.
9415    ///   * Keys:
9416    ///   *   - (required) 'message_id'  : {string}
9417    ///   *   - (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format
9418    ///   *   - (optional) 'ordering_key': {string}
9419    ///   */
9420    ///
9421    ///   function <function_name>(message, metadata) {
9422    ///   }
9423    /// ```
9424    pub code: std::string::String,
9425
9426    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9427}
9428
9429impl JavaScriptUDF {
9430    /// Creates a new default instance.
9431    pub fn new() -> Self {
9432        std::default::Default::default()
9433    }
9434
9435    /// Sets the value of [function_name][crate::model::JavaScriptUDF::function_name].
9436    ///
9437    /// # Example
9438    /// ```ignore,no_run
9439    /// # use google_cloud_bigquery_analyticshub_v1::model::JavaScriptUDF;
9440    /// let x = JavaScriptUDF::new().set_function_name("example");
9441    /// ```
9442    pub fn set_function_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9443        self.function_name = v.into();
9444        self
9445    }
9446
9447    /// Sets the value of [code][crate::model::JavaScriptUDF::code].
9448    ///
9449    /// # Example
9450    /// ```ignore,no_run
9451    /// # use google_cloud_bigquery_analyticshub_v1::model::JavaScriptUDF;
9452    /// let x = JavaScriptUDF::new().set_code("example");
9453    /// ```
9454    pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9455        self.code = v.into();
9456        self
9457    }
9458}
9459
9460impl wkt::message::Message for JavaScriptUDF {
9461    fn typename() -> &'static str {
9462        "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.JavaScriptUDF"
9463    }
9464}
9465
9466/// Specifies the type of discovery on the discovery page. Note that
9467/// this does not control the visibility of the exchange/listing which is
9468/// defined by IAM permission.
9469///
9470/// # Working with unknown values
9471///
9472/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9473/// additional enum variants at any time. Adding new variants is not considered
9474/// a breaking change. Applications should write their code in anticipation of:
9475///
9476/// - New values appearing in future releases of the client library, **and**
9477/// - New values received dynamically, without application changes.
9478///
9479/// Please consult the [Working with enums] section in the user guide for some
9480/// guidelines.
9481///
9482/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9483#[derive(Clone, Debug, PartialEq)]
9484#[non_exhaustive]
9485pub enum DiscoveryType {
9486    /// Unspecified. Defaults to DISCOVERY_TYPE_PRIVATE.
9487    Unspecified,
9488    /// The Data exchange/listing can be discovered in the 'Private' results
9489    /// list.
9490    Private,
9491    /// The Data exchange/listing can be discovered in the 'Public' results
9492    /// list.
9493    Public,
9494    /// If set, the enum was initialized with an unknown value.
9495    ///
9496    /// Applications can examine the value using [DiscoveryType::value] or
9497    /// [DiscoveryType::name].
9498    UnknownValue(discovery_type::UnknownValue),
9499}
9500
9501#[doc(hidden)]
9502pub mod discovery_type {
9503    #[allow(unused_imports)]
9504    use super::*;
9505    #[derive(Clone, Debug, PartialEq)]
9506    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9507}
9508
9509impl DiscoveryType {
9510    /// Gets the enum value.
9511    ///
9512    /// Returns `None` if the enum contains an unknown value deserialized from
9513    /// the string representation of enums.
9514    pub fn value(&self) -> std::option::Option<i32> {
9515        match self {
9516            Self::Unspecified => std::option::Option::Some(0),
9517            Self::Private => std::option::Option::Some(1),
9518            Self::Public => std::option::Option::Some(2),
9519            Self::UnknownValue(u) => u.0.value(),
9520        }
9521    }
9522
9523    /// Gets the enum value as a string.
9524    ///
9525    /// Returns `None` if the enum contains an unknown value deserialized from
9526    /// the integer representation of enums.
9527    pub fn name(&self) -> std::option::Option<&str> {
9528        match self {
9529            Self::Unspecified => std::option::Option::Some("DISCOVERY_TYPE_UNSPECIFIED"),
9530            Self::Private => std::option::Option::Some("DISCOVERY_TYPE_PRIVATE"),
9531            Self::Public => std::option::Option::Some("DISCOVERY_TYPE_PUBLIC"),
9532            Self::UnknownValue(u) => u.0.name(),
9533        }
9534    }
9535}
9536
9537impl std::default::Default for DiscoveryType {
9538    fn default() -> Self {
9539        use std::convert::From;
9540        Self::from(0)
9541    }
9542}
9543
9544impl std::fmt::Display for DiscoveryType {
9545    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9546        wkt::internal::display_enum(f, self.name(), self.value())
9547    }
9548}
9549
9550impl std::convert::From<i32> for DiscoveryType {
9551    fn from(value: i32) -> Self {
9552        match value {
9553            0 => Self::Unspecified,
9554            1 => Self::Private,
9555            2 => Self::Public,
9556            _ => Self::UnknownValue(discovery_type::UnknownValue(
9557                wkt::internal::UnknownEnumValue::Integer(value),
9558            )),
9559        }
9560    }
9561}
9562
9563impl std::convert::From<&str> for DiscoveryType {
9564    fn from(value: &str) -> Self {
9565        use std::string::ToString;
9566        match value {
9567            "DISCOVERY_TYPE_UNSPECIFIED" => Self::Unspecified,
9568            "DISCOVERY_TYPE_PRIVATE" => Self::Private,
9569            "DISCOVERY_TYPE_PUBLIC" => Self::Public,
9570            _ => Self::UnknownValue(discovery_type::UnknownValue(
9571                wkt::internal::UnknownEnumValue::String(value.to_string()),
9572            )),
9573        }
9574    }
9575}
9576
9577impl serde::ser::Serialize for DiscoveryType {
9578    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9579    where
9580        S: serde::Serializer,
9581    {
9582        match self {
9583            Self::Unspecified => serializer.serialize_i32(0),
9584            Self::Private => serializer.serialize_i32(1),
9585            Self::Public => serializer.serialize_i32(2),
9586            Self::UnknownValue(u) => u.0.serialize(serializer),
9587        }
9588    }
9589}
9590
9591impl<'de> serde::de::Deserialize<'de> for DiscoveryType {
9592    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9593    where
9594        D: serde::Deserializer<'de>,
9595    {
9596        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DiscoveryType>::new(
9597            ".google.cloud.bigquery.analyticshub.v1.DiscoveryType",
9598        ))
9599    }
9600}
9601
9602/// The underlying shared asset type shared in a listing by a publisher.
9603///
9604/// # Working with unknown values
9605///
9606/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9607/// additional enum variants at any time. Adding new variants is not considered
9608/// a breaking change. Applications should write their code in anticipation of:
9609///
9610/// - New values appearing in future releases of the client library, **and**
9611/// - New values received dynamically, without application changes.
9612///
9613/// Please consult the [Working with enums] section in the user guide for some
9614/// guidelines.
9615///
9616/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9617#[derive(Clone, Debug, PartialEq)]
9618#[non_exhaustive]
9619pub enum SharedResourceType {
9620    /// Not specified.
9621    Unspecified,
9622    /// BigQuery Dataset Asset.
9623    BigqueryDataset,
9624    /// Pub/Sub Topic Asset.
9625    PubsubTopic,
9626    /// If set, the enum was initialized with an unknown value.
9627    ///
9628    /// Applications can examine the value using [SharedResourceType::value] or
9629    /// [SharedResourceType::name].
9630    UnknownValue(shared_resource_type::UnknownValue),
9631}
9632
9633#[doc(hidden)]
9634pub mod shared_resource_type {
9635    #[allow(unused_imports)]
9636    use super::*;
9637    #[derive(Clone, Debug, PartialEq)]
9638    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9639}
9640
9641impl SharedResourceType {
9642    /// Gets the enum value.
9643    ///
9644    /// Returns `None` if the enum contains an unknown value deserialized from
9645    /// the string representation of enums.
9646    pub fn value(&self) -> std::option::Option<i32> {
9647        match self {
9648            Self::Unspecified => std::option::Option::Some(0),
9649            Self::BigqueryDataset => std::option::Option::Some(1),
9650            Self::PubsubTopic => std::option::Option::Some(2),
9651            Self::UnknownValue(u) => u.0.value(),
9652        }
9653    }
9654
9655    /// Gets the enum value as a string.
9656    ///
9657    /// Returns `None` if the enum contains an unknown value deserialized from
9658    /// the integer representation of enums.
9659    pub fn name(&self) -> std::option::Option<&str> {
9660        match self {
9661            Self::Unspecified => std::option::Option::Some("SHARED_RESOURCE_TYPE_UNSPECIFIED"),
9662            Self::BigqueryDataset => std::option::Option::Some("BIGQUERY_DATASET"),
9663            Self::PubsubTopic => std::option::Option::Some("PUBSUB_TOPIC"),
9664            Self::UnknownValue(u) => u.0.name(),
9665        }
9666    }
9667}
9668
9669impl std::default::Default for SharedResourceType {
9670    fn default() -> Self {
9671        use std::convert::From;
9672        Self::from(0)
9673    }
9674}
9675
9676impl std::fmt::Display for SharedResourceType {
9677    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9678        wkt::internal::display_enum(f, self.name(), self.value())
9679    }
9680}
9681
9682impl std::convert::From<i32> for SharedResourceType {
9683    fn from(value: i32) -> Self {
9684        match value {
9685            0 => Self::Unspecified,
9686            1 => Self::BigqueryDataset,
9687            2 => Self::PubsubTopic,
9688            _ => Self::UnknownValue(shared_resource_type::UnknownValue(
9689                wkt::internal::UnknownEnumValue::Integer(value),
9690            )),
9691        }
9692    }
9693}
9694
9695impl std::convert::From<&str> for SharedResourceType {
9696    fn from(value: &str) -> Self {
9697        use std::string::ToString;
9698        match value {
9699            "SHARED_RESOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
9700            "BIGQUERY_DATASET" => Self::BigqueryDataset,
9701            "PUBSUB_TOPIC" => Self::PubsubTopic,
9702            _ => Self::UnknownValue(shared_resource_type::UnknownValue(
9703                wkt::internal::UnknownEnumValue::String(value.to_string()),
9704            )),
9705        }
9706    }
9707}
9708
9709impl serde::ser::Serialize for SharedResourceType {
9710    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9711    where
9712        S: serde::Serializer,
9713    {
9714        match self {
9715            Self::Unspecified => serializer.serialize_i32(0),
9716            Self::BigqueryDataset => serializer.serialize_i32(1),
9717            Self::PubsubTopic => serializer.serialize_i32(2),
9718            Self::UnknownValue(u) => u.0.serialize(serializer),
9719        }
9720    }
9721}
9722
9723impl<'de> serde::de::Deserialize<'de> for SharedResourceType {
9724    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9725    where
9726        D: serde::Deserializer<'de>,
9727    {
9728        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SharedResourceType>::new(
9729            ".google.cloud.bigquery.analyticshub.v1.SharedResourceType",
9730        ))
9731    }
9732}