google_cloud_bigquery_analyticshub_v1/
model.rs

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