google_cloud_bigquery_analyticshub_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate lazy_static;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// A data exchange is a container that lets you share data. Along with the
40/// descriptive information about the data exchange, it contains listings that
41/// reference shared datasets.
42#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct DataExchange {
45 /// Output only. The resource name of the data exchange.
46 /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
47 pub name: std::string::String,
48
49 /// Required. Human-readable display name of the data exchange. The display
50 /// name must contain only Unicode letters, numbers (0-9), underscores (_),
51 /// dashes (-), spaces ( ), ampersands (&) and must not start or end with
52 /// spaces. Default value is an empty string. Max length: 63 bytes.
53 pub display_name: std::string::String,
54
55 /// Optional. Description of the data exchange. The description must not
56 /// contain Unicode non-characters as well as C0 and C1 control codes except
57 /// tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF).
58 /// Default value is an empty string.
59 /// Max length: 2000 bytes.
60 pub description: std::string::String,
61
62 /// Optional. Email or URL of the primary point of contact of the data
63 /// exchange. Max Length: 1000 bytes.
64 pub primary_contact: std::string::String,
65
66 /// Optional. Documentation describing the data exchange.
67 pub documentation: std::string::String,
68
69 /// Output only. Number of listings contained in the data exchange.
70 pub listing_count: i32,
71
72 /// Optional. Base64 encoded image representing the data exchange. Max
73 /// Size: 3.0MiB Expected image dimensions are 512x512 pixels, however the API
74 /// only performs validation on size of the encoded data. Note: For byte
75 /// fields, the content of the fields are base64-encoded (which increases the
76 /// size of the data by 33-36%) when using JSON on the wire.
77 pub icon: ::bytes::Bytes,
78
79 /// Optional. Configurable data sharing environment option for a data exchange.
80 pub sharing_environment_config: std::option::Option<crate::model::SharingEnvironmentConfig>,
81
82 /// Optional. Type of discovery on the discovery page for all the listings
83 /// under this exchange. Updating this field also updates (overwrites) the
84 /// discovery_type field for all the listings under this exchange.
85 pub discovery_type: std::option::Option<crate::model::DiscoveryType>,
86
87 /// Optional. By default, false.
88 /// If true, the DataExchange has an email sharing mandate enabled.
89 pub log_linked_dataset_query_user_email: std::option::Option<bool>,
90
91 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
92}
93
94impl DataExchange {
95 pub fn new() -> Self {
96 std::default::Default::default()
97 }
98
99 /// Sets the value of [name][crate::model::DataExchange::name].
100 ///
101 /// # Example
102 /// ```ignore,no_run
103 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
104 /// let x = DataExchange::new().set_name("example");
105 /// ```
106 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
107 self.name = v.into();
108 self
109 }
110
111 /// Sets the value of [display_name][crate::model::DataExchange::display_name].
112 ///
113 /// # Example
114 /// ```ignore,no_run
115 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
116 /// let x = DataExchange::new().set_display_name("example");
117 /// ```
118 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
119 self.display_name = v.into();
120 self
121 }
122
123 /// Sets the value of [description][crate::model::DataExchange::description].
124 ///
125 /// # Example
126 /// ```ignore,no_run
127 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
128 /// let x = DataExchange::new().set_description("example");
129 /// ```
130 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
131 self.description = v.into();
132 self
133 }
134
135 /// Sets the value of [primary_contact][crate::model::DataExchange::primary_contact].
136 ///
137 /// # Example
138 /// ```ignore,no_run
139 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
140 /// let x = DataExchange::new().set_primary_contact("example");
141 /// ```
142 pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
143 self.primary_contact = v.into();
144 self
145 }
146
147 /// Sets the value of [documentation][crate::model::DataExchange::documentation].
148 ///
149 /// # Example
150 /// ```ignore,no_run
151 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
152 /// let x = DataExchange::new().set_documentation("example");
153 /// ```
154 pub fn set_documentation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
155 self.documentation = v.into();
156 self
157 }
158
159 /// Sets the value of [listing_count][crate::model::DataExchange::listing_count].
160 ///
161 /// # Example
162 /// ```ignore,no_run
163 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
164 /// let x = DataExchange::new().set_listing_count(42);
165 /// ```
166 pub fn set_listing_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
167 self.listing_count = v.into();
168 self
169 }
170
171 /// Sets the value of [icon][crate::model::DataExchange::icon].
172 ///
173 /// # Example
174 /// ```ignore,no_run
175 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
176 /// let x = DataExchange::new().set_icon(bytes::Bytes::from_static(b"example"));
177 /// ```
178 pub fn set_icon<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
179 self.icon = v.into();
180 self
181 }
182
183 /// Sets the value of [sharing_environment_config][crate::model::DataExchange::sharing_environment_config].
184 ///
185 /// # Example
186 /// ```ignore,no_run
187 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
188 /// use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
189 /// let x = DataExchange::new().set_sharing_environment_config(SharingEnvironmentConfig::default()/* use setters */);
190 /// ```
191 pub fn set_sharing_environment_config<T>(mut self, v: T) -> Self
192 where
193 T: std::convert::Into<crate::model::SharingEnvironmentConfig>,
194 {
195 self.sharing_environment_config = std::option::Option::Some(v.into());
196 self
197 }
198
199 /// Sets or clears the value of [sharing_environment_config][crate::model::DataExchange::sharing_environment_config].
200 ///
201 /// # Example
202 /// ```ignore,no_run
203 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
204 /// use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
205 /// let x = DataExchange::new().set_or_clear_sharing_environment_config(Some(SharingEnvironmentConfig::default()/* use setters */));
206 /// let x = DataExchange::new().set_or_clear_sharing_environment_config(None::<SharingEnvironmentConfig>);
207 /// ```
208 pub fn set_or_clear_sharing_environment_config<T>(mut self, v: std::option::Option<T>) -> Self
209 where
210 T: std::convert::Into<crate::model::SharingEnvironmentConfig>,
211 {
212 self.sharing_environment_config = v.map(|x| x.into());
213 self
214 }
215
216 /// Sets the value of [discovery_type][crate::model::DataExchange::discovery_type].
217 ///
218 /// # Example
219 /// ```ignore,no_run
220 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
221 /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
222 /// let x0 = DataExchange::new().set_discovery_type(DiscoveryType::Private);
223 /// let x1 = DataExchange::new().set_discovery_type(DiscoveryType::Public);
224 /// ```
225 pub fn set_discovery_type<T>(mut self, v: T) -> Self
226 where
227 T: std::convert::Into<crate::model::DiscoveryType>,
228 {
229 self.discovery_type = std::option::Option::Some(v.into());
230 self
231 }
232
233 /// Sets or clears the value of [discovery_type][crate::model::DataExchange::discovery_type].
234 ///
235 /// # Example
236 /// ```ignore,no_run
237 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
238 /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
239 /// let x0 = DataExchange::new().set_or_clear_discovery_type(Some(DiscoveryType::Private));
240 /// let x1 = DataExchange::new().set_or_clear_discovery_type(Some(DiscoveryType::Public));
241 /// let x_none = DataExchange::new().set_or_clear_discovery_type(None::<DiscoveryType>);
242 /// ```
243 pub fn set_or_clear_discovery_type<T>(mut self, v: std::option::Option<T>) -> Self
244 where
245 T: std::convert::Into<crate::model::DiscoveryType>,
246 {
247 self.discovery_type = v.map(|x| x.into());
248 self
249 }
250
251 /// Sets the value of [log_linked_dataset_query_user_email][crate::model::DataExchange::log_linked_dataset_query_user_email].
252 ///
253 /// # Example
254 /// ```ignore,no_run
255 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
256 /// let x = DataExchange::new().set_log_linked_dataset_query_user_email(true);
257 /// ```
258 pub fn set_log_linked_dataset_query_user_email<T>(mut self, v: T) -> Self
259 where
260 T: std::convert::Into<bool>,
261 {
262 self.log_linked_dataset_query_user_email = std::option::Option::Some(v.into());
263 self
264 }
265
266 /// Sets or clears the value of [log_linked_dataset_query_user_email][crate::model::DataExchange::log_linked_dataset_query_user_email].
267 ///
268 /// # Example
269 /// ```ignore,no_run
270 /// # use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
271 /// let x = DataExchange::new().set_or_clear_log_linked_dataset_query_user_email(Some(false));
272 /// let x = DataExchange::new().set_or_clear_log_linked_dataset_query_user_email(None::<bool>);
273 /// ```
274 pub fn set_or_clear_log_linked_dataset_query_user_email<T>(
275 mut self,
276 v: std::option::Option<T>,
277 ) -> Self
278 where
279 T: std::convert::Into<bool>,
280 {
281 self.log_linked_dataset_query_user_email = v.map(|x| x.into());
282 self
283 }
284}
285
286impl wkt::message::Message for DataExchange {
287 fn typename() -> &'static str {
288 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DataExchange"
289 }
290}
291
292/// A query template is a container for sharing table-valued functions defined by
293/// contributors in a data clean room.
294#[derive(Clone, Default, PartialEq)]
295#[non_exhaustive]
296pub struct QueryTemplate {
297 /// Output only. The resource name of the QueryTemplate.
298 /// e.g. `projects/myproject/locations/us/dataExchanges/123/queryTemplates/456`
299 pub name: std::string::String,
300
301 /// Required. Human-readable display name of the QueryTemplate. The display
302 /// name must contain only Unicode letters, numbers (0-9), underscores (_),
303 /// dashes (-), spaces ( ), ampersands (&) and can't start or end with spaces.
304 /// Default value is an empty string. Max length: 63 bytes.
305 pub display_name: std::string::String,
306
307 /// Optional. Short description of the QueryTemplate. The description must not
308 /// contain Unicode non-characters and C0 and C1 control codes except tabs
309 /// (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default
310 /// value is an empty string. Max length: 2000 bytes.
311 pub description: std::string::String,
312
313 /// Optional. Will be deprecated.
314 /// Email or URL of the primary point of contact of the QueryTemplate.
315 /// Max Length: 1000 bytes.
316 pub proposer: std::string::String,
317
318 /// Optional. Email or URL of the primary point of contact of the
319 /// QueryTemplate. Max Length: 1000 bytes.
320 pub primary_contact: std::string::String,
321
322 /// Optional. Documentation describing the QueryTemplate.
323 pub documentation: std::string::String,
324
325 /// Output only. The QueryTemplate lifecycle state.
326 pub state: crate::model::query_template::State,
327
328 /// Optional. The routine associated with the QueryTemplate.
329 pub routine: std::option::Option<crate::model::Routine>,
330
331 /// Output only. Timestamp when the QueryTemplate was created.
332 pub create_time: std::option::Option<wkt::Timestamp>,
333
334 /// Output only. Timestamp when the QueryTemplate was last modified.
335 pub update_time: std::option::Option<wkt::Timestamp>,
336
337 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
338}
339
340impl QueryTemplate {
341 pub fn new() -> Self {
342 std::default::Default::default()
343 }
344
345 /// Sets the value of [name][crate::model::QueryTemplate::name].
346 ///
347 /// # Example
348 /// ```ignore,no_run
349 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
350 /// let x = QueryTemplate::new().set_name("example");
351 /// ```
352 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
353 self.name = v.into();
354 self
355 }
356
357 /// Sets the value of [display_name][crate::model::QueryTemplate::display_name].
358 ///
359 /// # Example
360 /// ```ignore,no_run
361 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
362 /// let x = QueryTemplate::new().set_display_name("example");
363 /// ```
364 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
365 self.display_name = v.into();
366 self
367 }
368
369 /// Sets the value of [description][crate::model::QueryTemplate::description].
370 ///
371 /// # Example
372 /// ```ignore,no_run
373 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
374 /// let x = QueryTemplate::new().set_description("example");
375 /// ```
376 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
377 self.description = v.into();
378 self
379 }
380
381 /// Sets the value of [proposer][crate::model::QueryTemplate::proposer].
382 ///
383 /// # Example
384 /// ```ignore,no_run
385 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
386 /// let x = QueryTemplate::new().set_proposer("example");
387 /// ```
388 pub fn set_proposer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
389 self.proposer = v.into();
390 self
391 }
392
393 /// Sets the value of [primary_contact][crate::model::QueryTemplate::primary_contact].
394 ///
395 /// # Example
396 /// ```ignore,no_run
397 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
398 /// let x = QueryTemplate::new().set_primary_contact("example");
399 /// ```
400 pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
401 self.primary_contact = v.into();
402 self
403 }
404
405 /// Sets the value of [documentation][crate::model::QueryTemplate::documentation].
406 ///
407 /// # Example
408 /// ```ignore,no_run
409 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
410 /// let x = QueryTemplate::new().set_documentation("example");
411 /// ```
412 pub fn set_documentation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
413 self.documentation = v.into();
414 self
415 }
416
417 /// Sets the value of [state][crate::model::QueryTemplate::state].
418 ///
419 /// # Example
420 /// ```ignore,no_run
421 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
422 /// use google_cloud_bigquery_analyticshub_v1::model::query_template::State;
423 /// let x0 = QueryTemplate::new().set_state(State::Drafted);
424 /// let x1 = QueryTemplate::new().set_state(State::Pending);
425 /// let x2 = QueryTemplate::new().set_state(State::Deleted);
426 /// ```
427 pub fn set_state<T: std::convert::Into<crate::model::query_template::State>>(
428 mut self,
429 v: T,
430 ) -> Self {
431 self.state = v.into();
432 self
433 }
434
435 /// Sets the value of [routine][crate::model::QueryTemplate::routine].
436 ///
437 /// # Example
438 /// ```ignore,no_run
439 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
440 /// use google_cloud_bigquery_analyticshub_v1::model::Routine;
441 /// let x = QueryTemplate::new().set_routine(Routine::default()/* use setters */);
442 /// ```
443 pub fn set_routine<T>(mut self, v: T) -> Self
444 where
445 T: std::convert::Into<crate::model::Routine>,
446 {
447 self.routine = std::option::Option::Some(v.into());
448 self
449 }
450
451 /// Sets or clears the value of [routine][crate::model::QueryTemplate::routine].
452 ///
453 /// # Example
454 /// ```ignore,no_run
455 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
456 /// use google_cloud_bigquery_analyticshub_v1::model::Routine;
457 /// let x = QueryTemplate::new().set_or_clear_routine(Some(Routine::default()/* use setters */));
458 /// let x = QueryTemplate::new().set_or_clear_routine(None::<Routine>);
459 /// ```
460 pub fn set_or_clear_routine<T>(mut self, v: std::option::Option<T>) -> Self
461 where
462 T: std::convert::Into<crate::model::Routine>,
463 {
464 self.routine = v.map(|x| x.into());
465 self
466 }
467
468 /// Sets the value of [create_time][crate::model::QueryTemplate::create_time].
469 ///
470 /// # Example
471 /// ```ignore,no_run
472 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
473 /// use wkt::Timestamp;
474 /// let x = QueryTemplate::new().set_create_time(Timestamp::default()/* use setters */);
475 /// ```
476 pub fn set_create_time<T>(mut self, v: T) -> Self
477 where
478 T: std::convert::Into<wkt::Timestamp>,
479 {
480 self.create_time = std::option::Option::Some(v.into());
481 self
482 }
483
484 /// Sets or clears the value of [create_time][crate::model::QueryTemplate::create_time].
485 ///
486 /// # Example
487 /// ```ignore,no_run
488 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
489 /// use wkt::Timestamp;
490 /// let x = QueryTemplate::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
491 /// let x = QueryTemplate::new().set_or_clear_create_time(None::<Timestamp>);
492 /// ```
493 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
494 where
495 T: std::convert::Into<wkt::Timestamp>,
496 {
497 self.create_time = v.map(|x| x.into());
498 self
499 }
500
501 /// Sets the value of [update_time][crate::model::QueryTemplate::update_time].
502 ///
503 /// # Example
504 /// ```ignore,no_run
505 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
506 /// use wkt::Timestamp;
507 /// let x = QueryTemplate::new().set_update_time(Timestamp::default()/* use setters */);
508 /// ```
509 pub fn set_update_time<T>(mut self, v: T) -> Self
510 where
511 T: std::convert::Into<wkt::Timestamp>,
512 {
513 self.update_time = std::option::Option::Some(v.into());
514 self
515 }
516
517 /// Sets or clears the value of [update_time][crate::model::QueryTemplate::update_time].
518 ///
519 /// # Example
520 /// ```ignore,no_run
521 /// # use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
522 /// use wkt::Timestamp;
523 /// let x = QueryTemplate::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
524 /// let x = QueryTemplate::new().set_or_clear_update_time(None::<Timestamp>);
525 /// ```
526 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
527 where
528 T: std::convert::Into<wkt::Timestamp>,
529 {
530 self.update_time = v.map(|x| x.into());
531 self
532 }
533}
534
535impl wkt::message::Message for QueryTemplate {
536 fn typename() -> &'static str {
537 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.QueryTemplate"
538 }
539}
540
541/// Defines additional types related to [QueryTemplate].
542pub mod query_template {
543 #[allow(unused_imports)]
544 use super::*;
545
546 /// The QueryTemplate lifecycle state.
547 ///
548 /// # Working with unknown values
549 ///
550 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
551 /// additional enum variants at any time. Adding new variants is not considered
552 /// a breaking change. Applications should write their code in anticipation of:
553 ///
554 /// - New values appearing in future releases of the client library, **and**
555 /// - New values received dynamically, without application changes.
556 ///
557 /// Please consult the [Working with enums] section in the user guide for some
558 /// guidelines.
559 ///
560 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
561 #[derive(Clone, Debug, PartialEq)]
562 #[non_exhaustive]
563 pub enum State {
564 /// Default value. This value is unused.
565 Unspecified,
566 /// The QueryTemplate is in draft state.
567 Drafted,
568 /// The QueryTemplate is in pending state.
569 Pending,
570 /// The QueryTemplate is in deleted state.
571 Deleted,
572 /// The QueryTemplate is in approved state.
573 Approved,
574 /// If set, the enum was initialized with an unknown value.
575 ///
576 /// Applications can examine the value using [State::value] or
577 /// [State::name].
578 UnknownValue(state::UnknownValue),
579 }
580
581 #[doc(hidden)]
582 pub mod state {
583 #[allow(unused_imports)]
584 use super::*;
585 #[derive(Clone, Debug, PartialEq)]
586 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
587 }
588
589 impl State {
590 /// Gets the enum value.
591 ///
592 /// Returns `None` if the enum contains an unknown value deserialized from
593 /// the string representation of enums.
594 pub fn value(&self) -> std::option::Option<i32> {
595 match self {
596 Self::Unspecified => std::option::Option::Some(0),
597 Self::Drafted => std::option::Option::Some(1),
598 Self::Pending => std::option::Option::Some(2),
599 Self::Deleted => std::option::Option::Some(3),
600 Self::Approved => std::option::Option::Some(4),
601 Self::UnknownValue(u) => u.0.value(),
602 }
603 }
604
605 /// Gets the enum value as a string.
606 ///
607 /// Returns `None` if the enum contains an unknown value deserialized from
608 /// the integer representation of enums.
609 pub fn name(&self) -> std::option::Option<&str> {
610 match self {
611 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
612 Self::Drafted => std::option::Option::Some("DRAFTED"),
613 Self::Pending => std::option::Option::Some("PENDING"),
614 Self::Deleted => std::option::Option::Some("DELETED"),
615 Self::Approved => std::option::Option::Some("APPROVED"),
616 Self::UnknownValue(u) => u.0.name(),
617 }
618 }
619 }
620
621 impl std::default::Default for State {
622 fn default() -> Self {
623 use std::convert::From;
624 Self::from(0)
625 }
626 }
627
628 impl std::fmt::Display for State {
629 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
630 wkt::internal::display_enum(f, self.name(), self.value())
631 }
632 }
633
634 impl std::convert::From<i32> for State {
635 fn from(value: i32) -> Self {
636 match value {
637 0 => Self::Unspecified,
638 1 => Self::Drafted,
639 2 => Self::Pending,
640 3 => Self::Deleted,
641 4 => Self::Approved,
642 _ => Self::UnknownValue(state::UnknownValue(
643 wkt::internal::UnknownEnumValue::Integer(value),
644 )),
645 }
646 }
647 }
648
649 impl std::convert::From<&str> for State {
650 fn from(value: &str) -> Self {
651 use std::string::ToString;
652 match value {
653 "STATE_UNSPECIFIED" => Self::Unspecified,
654 "DRAFTED" => Self::Drafted,
655 "PENDING" => Self::Pending,
656 "DELETED" => Self::Deleted,
657 "APPROVED" => Self::Approved,
658 _ => Self::UnknownValue(state::UnknownValue(
659 wkt::internal::UnknownEnumValue::String(value.to_string()),
660 )),
661 }
662 }
663 }
664
665 impl serde::ser::Serialize for State {
666 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
667 where
668 S: serde::Serializer,
669 {
670 match self {
671 Self::Unspecified => serializer.serialize_i32(0),
672 Self::Drafted => serializer.serialize_i32(1),
673 Self::Pending => serializer.serialize_i32(2),
674 Self::Deleted => serializer.serialize_i32(3),
675 Self::Approved => serializer.serialize_i32(4),
676 Self::UnknownValue(u) => u.0.serialize(serializer),
677 }
678 }
679 }
680
681 impl<'de> serde::de::Deserialize<'de> for State {
682 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
683 where
684 D: serde::Deserializer<'de>,
685 {
686 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
687 ".google.cloud.bigquery.analyticshub.v1.QueryTemplate.State",
688 ))
689 }
690 }
691}
692
693/// Represents a bigquery routine.
694#[derive(Clone, Default, PartialEq)]
695#[non_exhaustive]
696pub struct Routine {
697 /// Required. The type of routine.
698 pub routine_type: crate::model::routine::RoutineType,
699
700 /// Optional. The definition body of the routine.
701 pub definition_body: std::string::String,
702
703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
704}
705
706impl Routine {
707 pub fn new() -> Self {
708 std::default::Default::default()
709 }
710
711 /// Sets the value of [routine_type][crate::model::Routine::routine_type].
712 ///
713 /// # Example
714 /// ```ignore,no_run
715 /// # use google_cloud_bigquery_analyticshub_v1::model::Routine;
716 /// use google_cloud_bigquery_analyticshub_v1::model::routine::RoutineType;
717 /// let x0 = Routine::new().set_routine_type(RoutineType::TableValuedFunction);
718 /// ```
719 pub fn set_routine_type<T: std::convert::Into<crate::model::routine::RoutineType>>(
720 mut self,
721 v: T,
722 ) -> Self {
723 self.routine_type = v.into();
724 self
725 }
726
727 /// Sets the value of [definition_body][crate::model::Routine::definition_body].
728 ///
729 /// # Example
730 /// ```ignore,no_run
731 /// # use google_cloud_bigquery_analyticshub_v1::model::Routine;
732 /// let x = Routine::new().set_definition_body("example");
733 /// ```
734 pub fn set_definition_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
735 self.definition_body = v.into();
736 self
737 }
738}
739
740impl wkt::message::Message for Routine {
741 fn typename() -> &'static str {
742 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Routine"
743 }
744}
745
746/// Defines additional types related to [Routine].
747pub mod routine {
748 #[allow(unused_imports)]
749 use super::*;
750
751 /// Represents the type of a given routine.
752 ///
753 /// # Working with unknown values
754 ///
755 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
756 /// additional enum variants at any time. Adding new variants is not considered
757 /// a breaking change. Applications should write their code in anticipation of:
758 ///
759 /// - New values appearing in future releases of the client library, **and**
760 /// - New values received dynamically, without application changes.
761 ///
762 /// Please consult the [Working with enums] section in the user guide for some
763 /// guidelines.
764 ///
765 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
766 #[derive(Clone, Debug, PartialEq)]
767 #[non_exhaustive]
768 pub enum RoutineType {
769 /// Default value.
770 Unspecified,
771 /// Non-built-in persistent TVF.
772 TableValuedFunction,
773 /// If set, the enum was initialized with an unknown value.
774 ///
775 /// Applications can examine the value using [RoutineType::value] or
776 /// [RoutineType::name].
777 UnknownValue(routine_type::UnknownValue),
778 }
779
780 #[doc(hidden)]
781 pub mod routine_type {
782 #[allow(unused_imports)]
783 use super::*;
784 #[derive(Clone, Debug, PartialEq)]
785 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
786 }
787
788 impl RoutineType {
789 /// Gets the enum value.
790 ///
791 /// Returns `None` if the enum contains an unknown value deserialized from
792 /// the string representation of enums.
793 pub fn value(&self) -> std::option::Option<i32> {
794 match self {
795 Self::Unspecified => std::option::Option::Some(0),
796 Self::TableValuedFunction => std::option::Option::Some(1),
797 Self::UnknownValue(u) => u.0.value(),
798 }
799 }
800
801 /// Gets the enum value as a string.
802 ///
803 /// Returns `None` if the enum contains an unknown value deserialized from
804 /// the integer representation of enums.
805 pub fn name(&self) -> std::option::Option<&str> {
806 match self {
807 Self::Unspecified => std::option::Option::Some("ROUTINE_TYPE_UNSPECIFIED"),
808 Self::TableValuedFunction => std::option::Option::Some("TABLE_VALUED_FUNCTION"),
809 Self::UnknownValue(u) => u.0.name(),
810 }
811 }
812 }
813
814 impl std::default::Default for RoutineType {
815 fn default() -> Self {
816 use std::convert::From;
817 Self::from(0)
818 }
819 }
820
821 impl std::fmt::Display for RoutineType {
822 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
823 wkt::internal::display_enum(f, self.name(), self.value())
824 }
825 }
826
827 impl std::convert::From<i32> for RoutineType {
828 fn from(value: i32) -> Self {
829 match value {
830 0 => Self::Unspecified,
831 1 => Self::TableValuedFunction,
832 _ => Self::UnknownValue(routine_type::UnknownValue(
833 wkt::internal::UnknownEnumValue::Integer(value),
834 )),
835 }
836 }
837 }
838
839 impl std::convert::From<&str> for RoutineType {
840 fn from(value: &str) -> Self {
841 use std::string::ToString;
842 match value {
843 "ROUTINE_TYPE_UNSPECIFIED" => Self::Unspecified,
844 "TABLE_VALUED_FUNCTION" => Self::TableValuedFunction,
845 _ => Self::UnknownValue(routine_type::UnknownValue(
846 wkt::internal::UnknownEnumValue::String(value.to_string()),
847 )),
848 }
849 }
850 }
851
852 impl serde::ser::Serialize for RoutineType {
853 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
854 where
855 S: serde::Serializer,
856 {
857 match self {
858 Self::Unspecified => serializer.serialize_i32(0),
859 Self::TableValuedFunction => serializer.serialize_i32(1),
860 Self::UnknownValue(u) => u.0.serialize(serializer),
861 }
862 }
863 }
864
865 impl<'de> serde::de::Deserialize<'de> for RoutineType {
866 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
867 where
868 D: serde::Deserializer<'de>,
869 {
870 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoutineType>::new(
871 ".google.cloud.bigquery.analyticshub.v1.Routine.RoutineType",
872 ))
873 }
874 }
875}
876
877/// Message for creating a QueryTemplate.
878#[derive(Clone, Default, PartialEq)]
879#[non_exhaustive]
880pub struct CreateQueryTemplateRequest {
881 /// Required. The parent resource path of the QueryTemplate.
882 /// e.g.
883 /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myQueryTemplate`.
884 pub parent: std::string::String,
885
886 /// Required. The ID of the QueryTemplate to create.
887 /// Must contain only Unicode letters, numbers (0-9), underscores (_).
888 /// Max length: 100 bytes.
889 pub query_template_id: std::string::String,
890
891 /// Required. The QueryTemplate to create.
892 pub query_template: std::option::Option<crate::model::QueryTemplate>,
893
894 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
895}
896
897impl CreateQueryTemplateRequest {
898 pub fn new() -> Self {
899 std::default::Default::default()
900 }
901
902 /// Sets the value of [parent][crate::model::CreateQueryTemplateRequest::parent].
903 ///
904 /// # Example
905 /// ```ignore,no_run
906 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateQueryTemplateRequest;
907 /// let x = CreateQueryTemplateRequest::new().set_parent("example");
908 /// ```
909 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
910 self.parent = v.into();
911 self
912 }
913
914 /// Sets the value of [query_template_id][crate::model::CreateQueryTemplateRequest::query_template_id].
915 ///
916 /// # Example
917 /// ```ignore,no_run
918 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateQueryTemplateRequest;
919 /// let x = CreateQueryTemplateRequest::new().set_query_template_id("example");
920 /// ```
921 pub fn set_query_template_id<T: std::convert::Into<std::string::String>>(
922 mut self,
923 v: T,
924 ) -> Self {
925 self.query_template_id = v.into();
926 self
927 }
928
929 /// Sets the value of [query_template][crate::model::CreateQueryTemplateRequest::query_template].
930 ///
931 /// # Example
932 /// ```ignore,no_run
933 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateQueryTemplateRequest;
934 /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
935 /// let x = CreateQueryTemplateRequest::new().set_query_template(QueryTemplate::default()/* use setters */);
936 /// ```
937 pub fn set_query_template<T>(mut self, v: T) -> Self
938 where
939 T: std::convert::Into<crate::model::QueryTemplate>,
940 {
941 self.query_template = std::option::Option::Some(v.into());
942 self
943 }
944
945 /// Sets or clears the value of [query_template][crate::model::CreateQueryTemplateRequest::query_template].
946 ///
947 /// # Example
948 /// ```ignore,no_run
949 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateQueryTemplateRequest;
950 /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
951 /// let x = CreateQueryTemplateRequest::new().set_or_clear_query_template(Some(QueryTemplate::default()/* use setters */));
952 /// let x = CreateQueryTemplateRequest::new().set_or_clear_query_template(None::<QueryTemplate>);
953 /// ```
954 pub fn set_or_clear_query_template<T>(mut self, v: std::option::Option<T>) -> Self
955 where
956 T: std::convert::Into<crate::model::QueryTemplate>,
957 {
958 self.query_template = v.map(|x| x.into());
959 self
960 }
961}
962
963impl wkt::message::Message for CreateQueryTemplateRequest {
964 fn typename() -> &'static str {
965 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CreateQueryTemplateRequest"
966 }
967}
968
969/// Message for creating a QueryTemplate.
970#[derive(Clone, Default, PartialEq)]
971#[non_exhaustive]
972pub struct GetQueryTemplateRequest {
973 /// Required. The parent resource path of the QueryTemplate.
974 /// e.g.
975 /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
976 pub name: std::string::String,
977
978 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
979}
980
981impl GetQueryTemplateRequest {
982 pub fn new() -> Self {
983 std::default::Default::default()
984 }
985
986 /// Sets the value of [name][crate::model::GetQueryTemplateRequest::name].
987 ///
988 /// # Example
989 /// ```ignore,no_run
990 /// # use google_cloud_bigquery_analyticshub_v1::model::GetQueryTemplateRequest;
991 /// let x = GetQueryTemplateRequest::new().set_name("example");
992 /// ```
993 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
994 self.name = v.into();
995 self
996 }
997}
998
999impl wkt::message::Message for GetQueryTemplateRequest {
1000 fn typename() -> &'static str {
1001 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetQueryTemplateRequest"
1002 }
1003}
1004
1005/// Message for requesting the list of QueryTemplates.
1006#[derive(Clone, Default, PartialEq)]
1007#[non_exhaustive]
1008pub struct ListQueryTemplatesRequest {
1009 /// Required. The parent resource path of the QueryTemplates.
1010 /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
1011 pub parent: std::string::String,
1012
1013 /// Optional. The maximum number of results to return in a single response
1014 /// page. Leverage the page tokens to iterate through the entire collection.
1015 pub page_size: i32,
1016
1017 /// Optional. Page token, returned by a previous call, to request the next page
1018 /// of results.
1019 pub page_token: std::string::String,
1020
1021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1022}
1023
1024impl ListQueryTemplatesRequest {
1025 pub fn new() -> Self {
1026 std::default::Default::default()
1027 }
1028
1029 /// Sets the value of [parent][crate::model::ListQueryTemplatesRequest::parent].
1030 ///
1031 /// # Example
1032 /// ```ignore,no_run
1033 /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesRequest;
1034 /// let x = ListQueryTemplatesRequest::new().set_parent("example");
1035 /// ```
1036 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1037 self.parent = v.into();
1038 self
1039 }
1040
1041 /// Sets the value of [page_size][crate::model::ListQueryTemplatesRequest::page_size].
1042 ///
1043 /// # Example
1044 /// ```ignore,no_run
1045 /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesRequest;
1046 /// let x = ListQueryTemplatesRequest::new().set_page_size(42);
1047 /// ```
1048 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1049 self.page_size = v.into();
1050 self
1051 }
1052
1053 /// Sets the value of [page_token][crate::model::ListQueryTemplatesRequest::page_token].
1054 ///
1055 /// # Example
1056 /// ```ignore,no_run
1057 /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesRequest;
1058 /// let x = ListQueryTemplatesRequest::new().set_page_token("example");
1059 /// ```
1060 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1061 self.page_token = v.into();
1062 self
1063 }
1064}
1065
1066impl wkt::message::Message for ListQueryTemplatesRequest {
1067 fn typename() -> &'static str {
1068 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListQueryTemplatesRequest"
1069 }
1070}
1071
1072/// Message for response to the list of QueryTemplates.
1073#[derive(Clone, Default, PartialEq)]
1074#[non_exhaustive]
1075pub struct ListQueryTemplatesResponse {
1076 /// The list of QueryTemplates.
1077 pub query_templates: std::vec::Vec<crate::model::QueryTemplate>,
1078
1079 /// A token to request the next page of results.
1080 pub next_page_token: std::string::String,
1081
1082 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1083}
1084
1085impl ListQueryTemplatesResponse {
1086 pub fn new() -> Self {
1087 std::default::Default::default()
1088 }
1089
1090 /// Sets the value of [query_templates][crate::model::ListQueryTemplatesResponse::query_templates].
1091 ///
1092 /// # Example
1093 /// ```ignore,no_run
1094 /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesResponse;
1095 /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
1096 /// let x = ListQueryTemplatesResponse::new()
1097 /// .set_query_templates([
1098 /// QueryTemplate::default()/* use setters */,
1099 /// QueryTemplate::default()/* use (different) setters */,
1100 /// ]);
1101 /// ```
1102 pub fn set_query_templates<T, V>(mut self, v: T) -> Self
1103 where
1104 T: std::iter::IntoIterator<Item = V>,
1105 V: std::convert::Into<crate::model::QueryTemplate>,
1106 {
1107 use std::iter::Iterator;
1108 self.query_templates = v.into_iter().map(|i| i.into()).collect();
1109 self
1110 }
1111
1112 /// Sets the value of [next_page_token][crate::model::ListQueryTemplatesResponse::next_page_token].
1113 ///
1114 /// # Example
1115 /// ```ignore,no_run
1116 /// # use google_cloud_bigquery_analyticshub_v1::model::ListQueryTemplatesResponse;
1117 /// let x = ListQueryTemplatesResponse::new().set_next_page_token("example");
1118 /// ```
1119 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1120 self.next_page_token = v.into();
1121 self
1122 }
1123}
1124
1125impl wkt::message::Message for ListQueryTemplatesResponse {
1126 fn typename() -> &'static str {
1127 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListQueryTemplatesResponse"
1128 }
1129}
1130
1131#[doc(hidden)]
1132impl google_cloud_gax::paginator::internal::PageableResponse for ListQueryTemplatesResponse {
1133 type PageItem = crate::model::QueryTemplate;
1134
1135 fn items(self) -> std::vec::Vec<Self::PageItem> {
1136 self.query_templates
1137 }
1138
1139 fn next_page_token(&self) -> std::string::String {
1140 use std::clone::Clone;
1141 self.next_page_token.clone()
1142 }
1143}
1144
1145/// Message for updating a QueryTemplate.
1146#[derive(Clone, Default, PartialEq)]
1147#[non_exhaustive]
1148pub struct UpdateQueryTemplateRequest {
1149 /// Optional. Field mask specifies the fields to update in the query template
1150 /// resource. The fields specified in the `updateMask` are relative to the
1151 /// resource and are not a full request.
1152 pub update_mask: std::option::Option<wkt::FieldMask>,
1153
1154 /// Required. The QueryTemplate to update.
1155 pub query_template: std::option::Option<crate::model::QueryTemplate>,
1156
1157 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1158}
1159
1160impl UpdateQueryTemplateRequest {
1161 pub fn new() -> Self {
1162 std::default::Default::default()
1163 }
1164
1165 /// Sets the value of [update_mask][crate::model::UpdateQueryTemplateRequest::update_mask].
1166 ///
1167 /// # Example
1168 /// ```ignore,no_run
1169 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1170 /// use wkt::FieldMask;
1171 /// let x = UpdateQueryTemplateRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1172 /// ```
1173 pub fn set_update_mask<T>(mut self, v: T) -> Self
1174 where
1175 T: std::convert::Into<wkt::FieldMask>,
1176 {
1177 self.update_mask = std::option::Option::Some(v.into());
1178 self
1179 }
1180
1181 /// Sets or clears the value of [update_mask][crate::model::UpdateQueryTemplateRequest::update_mask].
1182 ///
1183 /// # Example
1184 /// ```ignore,no_run
1185 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1186 /// use wkt::FieldMask;
1187 /// let x = UpdateQueryTemplateRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1188 /// let x = UpdateQueryTemplateRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1189 /// ```
1190 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1191 where
1192 T: std::convert::Into<wkt::FieldMask>,
1193 {
1194 self.update_mask = v.map(|x| x.into());
1195 self
1196 }
1197
1198 /// Sets the value of [query_template][crate::model::UpdateQueryTemplateRequest::query_template].
1199 ///
1200 /// # Example
1201 /// ```ignore,no_run
1202 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1203 /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
1204 /// let x = UpdateQueryTemplateRequest::new().set_query_template(QueryTemplate::default()/* use setters */);
1205 /// ```
1206 pub fn set_query_template<T>(mut self, v: T) -> Self
1207 where
1208 T: std::convert::Into<crate::model::QueryTemplate>,
1209 {
1210 self.query_template = std::option::Option::Some(v.into());
1211 self
1212 }
1213
1214 /// Sets or clears the value of [query_template][crate::model::UpdateQueryTemplateRequest::query_template].
1215 ///
1216 /// # Example
1217 /// ```ignore,no_run
1218 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateQueryTemplateRequest;
1219 /// use google_cloud_bigquery_analyticshub_v1::model::QueryTemplate;
1220 /// let x = UpdateQueryTemplateRequest::new().set_or_clear_query_template(Some(QueryTemplate::default()/* use setters */));
1221 /// let x = UpdateQueryTemplateRequest::new().set_or_clear_query_template(None::<QueryTemplate>);
1222 /// ```
1223 pub fn set_or_clear_query_template<T>(mut self, v: std::option::Option<T>) -> Self
1224 where
1225 T: std::convert::Into<crate::model::QueryTemplate>,
1226 {
1227 self.query_template = v.map(|x| x.into());
1228 self
1229 }
1230}
1231
1232impl wkt::message::Message for UpdateQueryTemplateRequest {
1233 fn typename() -> &'static str {
1234 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.UpdateQueryTemplateRequest"
1235 }
1236}
1237
1238/// Message for deleting a QueryTemplate.
1239#[derive(Clone, Default, PartialEq)]
1240#[non_exhaustive]
1241pub struct DeleteQueryTemplateRequest {
1242 /// Required. The resource path of the QueryTemplate.
1243 /// e.g.
1244 /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
1245 pub name: std::string::String,
1246
1247 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1248}
1249
1250impl DeleteQueryTemplateRequest {
1251 pub fn new() -> Self {
1252 std::default::Default::default()
1253 }
1254
1255 /// Sets the value of [name][crate::model::DeleteQueryTemplateRequest::name].
1256 ///
1257 /// # Example
1258 /// ```ignore,no_run
1259 /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteQueryTemplateRequest;
1260 /// let x = DeleteQueryTemplateRequest::new().set_name("example");
1261 /// ```
1262 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1263 self.name = v.into();
1264 self
1265 }
1266}
1267
1268impl wkt::message::Message for DeleteQueryTemplateRequest {
1269 fn typename() -> &'static str {
1270 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteQueryTemplateRequest"
1271 }
1272}
1273
1274/// Message for submitting a QueryTemplate.
1275#[derive(Clone, Default, PartialEq)]
1276#[non_exhaustive]
1277pub struct SubmitQueryTemplateRequest {
1278 /// Required. The resource path of the QueryTemplate.
1279 /// e.g.
1280 /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
1281 pub name: std::string::String,
1282
1283 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1284}
1285
1286impl SubmitQueryTemplateRequest {
1287 pub fn new() -> Self {
1288 std::default::Default::default()
1289 }
1290
1291 /// Sets the value of [name][crate::model::SubmitQueryTemplateRequest::name].
1292 ///
1293 /// # Example
1294 /// ```ignore,no_run
1295 /// # use google_cloud_bigquery_analyticshub_v1::model::SubmitQueryTemplateRequest;
1296 /// let x = SubmitQueryTemplateRequest::new().set_name("example");
1297 /// ```
1298 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1299 self.name = v.into();
1300 self
1301 }
1302}
1303
1304impl wkt::message::Message for SubmitQueryTemplateRequest {
1305 fn typename() -> &'static str {
1306 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubmitQueryTemplateRequest"
1307 }
1308}
1309
1310/// Message for approving a QueryTemplate.
1311#[derive(Clone, Default, PartialEq)]
1312#[non_exhaustive]
1313pub struct ApproveQueryTemplateRequest {
1314 /// Required. The resource path of the QueryTemplate.
1315 /// e.g.
1316 /// `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
1317 pub name: std::string::String,
1318
1319 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1320}
1321
1322impl ApproveQueryTemplateRequest {
1323 pub fn new() -> Self {
1324 std::default::Default::default()
1325 }
1326
1327 /// Sets the value of [name][crate::model::ApproveQueryTemplateRequest::name].
1328 ///
1329 /// # Example
1330 /// ```ignore,no_run
1331 /// # use google_cloud_bigquery_analyticshub_v1::model::ApproveQueryTemplateRequest;
1332 /// let x = ApproveQueryTemplateRequest::new().set_name("example");
1333 /// ```
1334 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1335 self.name = v.into();
1336 self
1337 }
1338}
1339
1340impl wkt::message::Message for ApproveQueryTemplateRequest {
1341 fn typename() -> &'static str {
1342 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ApproveQueryTemplateRequest"
1343 }
1344}
1345
1346/// Sharing environment is a behavior model for sharing data within a
1347/// data exchange. This option is configurable for a data exchange.
1348#[derive(Clone, Default, PartialEq)]
1349#[non_exhaustive]
1350pub struct SharingEnvironmentConfig {
1351 pub environment: std::option::Option<crate::model::sharing_environment_config::Environment>,
1352
1353 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1354}
1355
1356impl SharingEnvironmentConfig {
1357 pub fn new() -> Self {
1358 std::default::Default::default()
1359 }
1360
1361 /// Sets the value of [environment][crate::model::SharingEnvironmentConfig::environment].
1362 ///
1363 /// Note that all the setters affecting `environment` are mutually
1364 /// exclusive.
1365 ///
1366 /// # Example
1367 /// ```ignore,no_run
1368 /// # use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
1369 /// use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DefaultExchangeConfig;
1370 /// let x = SharingEnvironmentConfig::new().set_environment(Some(
1371 /// google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::Environment::DefaultExchangeConfig(DefaultExchangeConfig::default().into())));
1372 /// ```
1373 pub fn set_environment<
1374 T: std::convert::Into<
1375 std::option::Option<crate::model::sharing_environment_config::Environment>,
1376 >,
1377 >(
1378 mut self,
1379 v: T,
1380 ) -> Self {
1381 self.environment = v.into();
1382 self
1383 }
1384
1385 /// The value of [environment][crate::model::SharingEnvironmentConfig::environment]
1386 /// if it holds a `DefaultExchangeConfig`, `None` if the field is not set or
1387 /// holds a different branch.
1388 pub fn default_exchange_config(
1389 &self,
1390 ) -> std::option::Option<
1391 &std::boxed::Box<crate::model::sharing_environment_config::DefaultExchangeConfig>,
1392 > {
1393 #[allow(unreachable_patterns)]
1394 self.environment.as_ref().and_then(|v| match v {
1395 crate::model::sharing_environment_config::Environment::DefaultExchangeConfig(v) => {
1396 std::option::Option::Some(v)
1397 }
1398 _ => std::option::Option::None,
1399 })
1400 }
1401
1402 /// Sets the value of [environment][crate::model::SharingEnvironmentConfig::environment]
1403 /// to hold a `DefaultExchangeConfig`.
1404 ///
1405 /// Note that all the setters affecting `environment` are
1406 /// mutually exclusive.
1407 ///
1408 /// # Example
1409 /// ```ignore,no_run
1410 /// # use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
1411 /// use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DefaultExchangeConfig;
1412 /// let x = SharingEnvironmentConfig::new().set_default_exchange_config(DefaultExchangeConfig::default()/* use setters */);
1413 /// assert!(x.default_exchange_config().is_some());
1414 /// assert!(x.dcr_exchange_config().is_none());
1415 /// ```
1416 pub fn set_default_exchange_config<
1417 T: std::convert::Into<
1418 std::boxed::Box<crate::model::sharing_environment_config::DefaultExchangeConfig>,
1419 >,
1420 >(
1421 mut self,
1422 v: T,
1423 ) -> Self {
1424 self.environment = std::option::Option::Some(
1425 crate::model::sharing_environment_config::Environment::DefaultExchangeConfig(v.into()),
1426 );
1427 self
1428 }
1429
1430 /// The value of [environment][crate::model::SharingEnvironmentConfig::environment]
1431 /// if it holds a `DcrExchangeConfig`, `None` if the field is not set or
1432 /// holds a different branch.
1433 pub fn dcr_exchange_config(
1434 &self,
1435 ) -> std::option::Option<
1436 &std::boxed::Box<crate::model::sharing_environment_config::DcrExchangeConfig>,
1437 > {
1438 #[allow(unreachable_patterns)]
1439 self.environment.as_ref().and_then(|v| match v {
1440 crate::model::sharing_environment_config::Environment::DcrExchangeConfig(v) => {
1441 std::option::Option::Some(v)
1442 }
1443 _ => std::option::Option::None,
1444 })
1445 }
1446
1447 /// Sets the value of [environment][crate::model::SharingEnvironmentConfig::environment]
1448 /// to hold a `DcrExchangeConfig`.
1449 ///
1450 /// Note that all the setters affecting `environment` are
1451 /// mutually exclusive.
1452 ///
1453 /// # Example
1454 /// ```ignore,no_run
1455 /// # use google_cloud_bigquery_analyticshub_v1::model::SharingEnvironmentConfig;
1456 /// use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1457 /// let x = SharingEnvironmentConfig::new().set_dcr_exchange_config(DcrExchangeConfig::default()/* use setters */);
1458 /// assert!(x.dcr_exchange_config().is_some());
1459 /// assert!(x.default_exchange_config().is_none());
1460 /// ```
1461 pub fn set_dcr_exchange_config<
1462 T: std::convert::Into<
1463 std::boxed::Box<crate::model::sharing_environment_config::DcrExchangeConfig>,
1464 >,
1465 >(
1466 mut self,
1467 v: T,
1468 ) -> Self {
1469 self.environment = std::option::Option::Some(
1470 crate::model::sharing_environment_config::Environment::DcrExchangeConfig(v.into()),
1471 );
1472 self
1473 }
1474}
1475
1476impl wkt::message::Message for SharingEnvironmentConfig {
1477 fn typename() -> &'static str {
1478 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig"
1479 }
1480}
1481
1482/// Defines additional types related to [SharingEnvironmentConfig].
1483pub mod sharing_environment_config {
1484 #[allow(unused_imports)]
1485 use super::*;
1486
1487 /// Default Analytics Hub data exchange, used for secured data sharing.
1488 #[derive(Clone, Default, PartialEq)]
1489 #[non_exhaustive]
1490 pub struct DefaultExchangeConfig {
1491 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1492 }
1493
1494 impl DefaultExchangeConfig {
1495 pub fn new() -> Self {
1496 std::default::Default::default()
1497 }
1498 }
1499
1500 impl wkt::message::Message for DefaultExchangeConfig {
1501 fn typename() -> &'static str {
1502 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig.DefaultExchangeConfig"
1503 }
1504 }
1505
1506 /// Data Clean Room (DCR), used for privacy-safe and secured data sharing.
1507 #[derive(Clone, Default, PartialEq)]
1508 #[non_exhaustive]
1509 pub struct DcrExchangeConfig {
1510 /// Output only. If True, this DCR restricts the contributors to sharing
1511 /// only a single resource in a Listing. And no two resources should have the
1512 /// same IDs. So if a contributor adds a view with a conflicting name, the
1513 /// CreateListing API will reject the request. if False, the data contributor
1514 /// can publish an entire dataset (as before). This is not configurable, and
1515 /// by default, all new DCRs will have the restriction set to True.
1516 pub single_selected_resource_sharing_restriction: std::option::Option<bool>,
1517
1518 /// Output only. If True, when subscribing to this DCR, it will create only
1519 /// one linked dataset containing all resources shared within the
1520 /// cleanroom. If False, when subscribing to this DCR, it will
1521 /// create 1 linked dataset per listing. This is not configurable, and by
1522 /// default, all new DCRs will have the restriction set to True.
1523 pub single_linked_dataset_per_cleanroom: std::option::Option<bool>,
1524
1525 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1526 }
1527
1528 impl DcrExchangeConfig {
1529 pub fn new() -> Self {
1530 std::default::Default::default()
1531 }
1532
1533 /// Sets the value of [single_selected_resource_sharing_restriction][crate::model::sharing_environment_config::DcrExchangeConfig::single_selected_resource_sharing_restriction].
1534 ///
1535 /// # Example
1536 /// ```ignore,no_run
1537 /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1538 /// let x = DcrExchangeConfig::new().set_single_selected_resource_sharing_restriction(true);
1539 /// ```
1540 pub fn set_single_selected_resource_sharing_restriction<T>(mut self, v: T) -> Self
1541 where
1542 T: std::convert::Into<bool>,
1543 {
1544 self.single_selected_resource_sharing_restriction = std::option::Option::Some(v.into());
1545 self
1546 }
1547
1548 /// Sets or clears the value of [single_selected_resource_sharing_restriction][crate::model::sharing_environment_config::DcrExchangeConfig::single_selected_resource_sharing_restriction].
1549 ///
1550 /// # Example
1551 /// ```ignore,no_run
1552 /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1553 /// let x = DcrExchangeConfig::new().set_or_clear_single_selected_resource_sharing_restriction(Some(false));
1554 /// let x = DcrExchangeConfig::new().set_or_clear_single_selected_resource_sharing_restriction(None::<bool>);
1555 /// ```
1556 pub fn set_or_clear_single_selected_resource_sharing_restriction<T>(
1557 mut self,
1558 v: std::option::Option<T>,
1559 ) -> Self
1560 where
1561 T: std::convert::Into<bool>,
1562 {
1563 self.single_selected_resource_sharing_restriction = v.map(|x| x.into());
1564 self
1565 }
1566
1567 /// Sets the value of [single_linked_dataset_per_cleanroom][crate::model::sharing_environment_config::DcrExchangeConfig::single_linked_dataset_per_cleanroom].
1568 ///
1569 /// # Example
1570 /// ```ignore,no_run
1571 /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1572 /// let x = DcrExchangeConfig::new().set_single_linked_dataset_per_cleanroom(true);
1573 /// ```
1574 pub fn set_single_linked_dataset_per_cleanroom<T>(mut self, v: T) -> Self
1575 where
1576 T: std::convert::Into<bool>,
1577 {
1578 self.single_linked_dataset_per_cleanroom = std::option::Option::Some(v.into());
1579 self
1580 }
1581
1582 /// Sets or clears the value of [single_linked_dataset_per_cleanroom][crate::model::sharing_environment_config::DcrExchangeConfig::single_linked_dataset_per_cleanroom].
1583 ///
1584 /// # Example
1585 /// ```ignore,no_run
1586 /// # use google_cloud_bigquery_analyticshub_v1::model::sharing_environment_config::DcrExchangeConfig;
1587 /// let x = DcrExchangeConfig::new().set_or_clear_single_linked_dataset_per_cleanroom(Some(false));
1588 /// let x = DcrExchangeConfig::new().set_or_clear_single_linked_dataset_per_cleanroom(None::<bool>);
1589 /// ```
1590 pub fn set_or_clear_single_linked_dataset_per_cleanroom<T>(
1591 mut self,
1592 v: std::option::Option<T>,
1593 ) -> Self
1594 where
1595 T: std::convert::Into<bool>,
1596 {
1597 self.single_linked_dataset_per_cleanroom = v.map(|x| x.into());
1598 self
1599 }
1600 }
1601
1602 impl wkt::message::Message for DcrExchangeConfig {
1603 fn typename() -> &'static str {
1604 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SharingEnvironmentConfig.DcrExchangeConfig"
1605 }
1606 }
1607
1608 #[derive(Clone, Debug, PartialEq)]
1609 #[non_exhaustive]
1610 pub enum Environment {
1611 /// Default Analytics Hub data exchange, used for secured data sharing.
1612 DefaultExchangeConfig(
1613 std::boxed::Box<crate::model::sharing_environment_config::DefaultExchangeConfig>,
1614 ),
1615 /// Data Clean Room (DCR), used for privacy-safe and secured data sharing.
1616 DcrExchangeConfig(
1617 std::boxed::Box<crate::model::sharing_environment_config::DcrExchangeConfig>,
1618 ),
1619 }
1620}
1621
1622/// Contains details of the data provider.
1623#[derive(Clone, Default, PartialEq)]
1624#[non_exhaustive]
1625pub struct DataProvider {
1626 /// Optional. Name of the data provider.
1627 pub name: std::string::String,
1628
1629 /// Optional. Email or URL of the data provider.
1630 /// Max Length: 1000 bytes.
1631 pub primary_contact: std::string::String,
1632
1633 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1634}
1635
1636impl DataProvider {
1637 pub fn new() -> Self {
1638 std::default::Default::default()
1639 }
1640
1641 /// Sets the value of [name][crate::model::DataProvider::name].
1642 ///
1643 /// # Example
1644 /// ```ignore,no_run
1645 /// # use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
1646 /// let x = DataProvider::new().set_name("example");
1647 /// ```
1648 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1649 self.name = v.into();
1650 self
1651 }
1652
1653 /// Sets the value of [primary_contact][crate::model::DataProvider::primary_contact].
1654 ///
1655 /// # Example
1656 /// ```ignore,no_run
1657 /// # use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
1658 /// let x = DataProvider::new().set_primary_contact("example");
1659 /// ```
1660 pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1661 self.primary_contact = v.into();
1662 self
1663 }
1664}
1665
1666impl wkt::message::Message for DataProvider {
1667 fn typename() -> &'static str {
1668 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DataProvider"
1669 }
1670}
1671
1672/// Contains details of the listing publisher.
1673#[derive(Clone, Default, PartialEq)]
1674#[non_exhaustive]
1675pub struct Publisher {
1676 /// Optional. Name of the listing publisher.
1677 pub name: std::string::String,
1678
1679 /// Optional. Email or URL of the listing publisher.
1680 /// Max Length: 1000 bytes.
1681 pub primary_contact: std::string::String,
1682
1683 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1684}
1685
1686impl Publisher {
1687 pub fn new() -> Self {
1688 std::default::Default::default()
1689 }
1690
1691 /// Sets the value of [name][crate::model::Publisher::name].
1692 ///
1693 /// # Example
1694 /// ```ignore,no_run
1695 /// # use google_cloud_bigquery_analyticshub_v1::model::Publisher;
1696 /// let x = Publisher::new().set_name("example");
1697 /// ```
1698 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1699 self.name = v.into();
1700 self
1701 }
1702
1703 /// Sets the value of [primary_contact][crate::model::Publisher::primary_contact].
1704 ///
1705 /// # Example
1706 /// ```ignore,no_run
1707 /// # use google_cloud_bigquery_analyticshub_v1::model::Publisher;
1708 /// let x = Publisher::new().set_primary_contact("example");
1709 /// ```
1710 pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1711 self.primary_contact = v.into();
1712 self
1713 }
1714}
1715
1716impl wkt::message::Message for Publisher {
1717 fn typename() -> &'static str {
1718 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Publisher"
1719 }
1720}
1721
1722#[derive(Clone, Default, PartialEq)]
1723#[non_exhaustive]
1724pub struct DestinationDatasetReference {
1725 /// Required. A unique ID for this dataset, without the project name. The ID
1726 /// must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_).
1727 /// The maximum length is 1,024 characters.
1728 pub dataset_id: std::string::String,
1729
1730 /// Required. The ID of the project containing this dataset.
1731 pub project_id: std::string::String,
1732
1733 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1734}
1735
1736impl DestinationDatasetReference {
1737 pub fn new() -> Self {
1738 std::default::Default::default()
1739 }
1740
1741 /// Sets the value of [dataset_id][crate::model::DestinationDatasetReference::dataset_id].
1742 ///
1743 /// # Example
1744 /// ```ignore,no_run
1745 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1746 /// let x = DestinationDatasetReference::new().set_dataset_id("example");
1747 /// ```
1748 pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1749 self.dataset_id = v.into();
1750 self
1751 }
1752
1753 /// Sets the value of [project_id][crate::model::DestinationDatasetReference::project_id].
1754 ///
1755 /// # Example
1756 /// ```ignore,no_run
1757 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1758 /// let x = DestinationDatasetReference::new().set_project_id("example");
1759 /// ```
1760 pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1761 self.project_id = v.into();
1762 self
1763 }
1764}
1765
1766impl wkt::message::Message for DestinationDatasetReference {
1767 fn typename() -> &'static str {
1768 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DestinationDatasetReference"
1769 }
1770}
1771
1772/// Defines the destination bigquery dataset.
1773#[derive(Clone, Default, PartialEq)]
1774#[non_exhaustive]
1775pub struct DestinationDataset {
1776 /// Required. A reference that identifies the destination dataset.
1777 pub dataset_reference: std::option::Option<crate::model::DestinationDatasetReference>,
1778
1779 /// Optional. A descriptive name for the dataset.
1780 pub friendly_name: std::option::Option<wkt::StringValue>,
1781
1782 /// Optional. A user-friendly description of the dataset.
1783 pub description: std::option::Option<wkt::StringValue>,
1784
1785 /// Optional. The labels associated with this dataset. You can use these
1786 /// to organize and group your datasets.
1787 /// You can set this property when inserting or updating a dataset.
1788 /// See <https://cloud.google.com/resource-manager/docs/creating-managing-labels>
1789 /// for more information.
1790 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1791
1792 /// Required. The geographic location where the dataset should reside. See
1793 /// <https://cloud.google.com/bigquery/docs/locations> for supported
1794 /// locations.
1795 pub location: std::string::String,
1796
1797 /// Optional. The geographic locations where the dataset should be replicated.
1798 /// See [BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
1799 /// for supported locations.
1800 pub replica_locations: std::vec::Vec<std::string::String>,
1801
1802 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1803}
1804
1805impl DestinationDataset {
1806 pub fn new() -> Self {
1807 std::default::Default::default()
1808 }
1809
1810 /// Sets the value of [dataset_reference][crate::model::DestinationDataset::dataset_reference].
1811 ///
1812 /// # Example
1813 /// ```ignore,no_run
1814 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1815 /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1816 /// let x = DestinationDataset::new().set_dataset_reference(DestinationDatasetReference::default()/* use setters */);
1817 /// ```
1818 pub fn set_dataset_reference<T>(mut self, v: T) -> Self
1819 where
1820 T: std::convert::Into<crate::model::DestinationDatasetReference>,
1821 {
1822 self.dataset_reference = std::option::Option::Some(v.into());
1823 self
1824 }
1825
1826 /// Sets or clears the value of [dataset_reference][crate::model::DestinationDataset::dataset_reference].
1827 ///
1828 /// # Example
1829 /// ```ignore,no_run
1830 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1831 /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDatasetReference;
1832 /// let x = DestinationDataset::new().set_or_clear_dataset_reference(Some(DestinationDatasetReference::default()/* use setters */));
1833 /// let x = DestinationDataset::new().set_or_clear_dataset_reference(None::<DestinationDatasetReference>);
1834 /// ```
1835 pub fn set_or_clear_dataset_reference<T>(mut self, v: std::option::Option<T>) -> Self
1836 where
1837 T: std::convert::Into<crate::model::DestinationDatasetReference>,
1838 {
1839 self.dataset_reference = v.map(|x| x.into());
1840 self
1841 }
1842
1843 /// Sets the value of [friendly_name][crate::model::DestinationDataset::friendly_name].
1844 ///
1845 /// # Example
1846 /// ```ignore,no_run
1847 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1848 /// use wkt::StringValue;
1849 /// let x = DestinationDataset::new().set_friendly_name(StringValue::default()/* use setters */);
1850 /// ```
1851 pub fn set_friendly_name<T>(mut self, v: T) -> Self
1852 where
1853 T: std::convert::Into<wkt::StringValue>,
1854 {
1855 self.friendly_name = std::option::Option::Some(v.into());
1856 self
1857 }
1858
1859 /// Sets or clears the value of [friendly_name][crate::model::DestinationDataset::friendly_name].
1860 ///
1861 /// # Example
1862 /// ```ignore,no_run
1863 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1864 /// use wkt::StringValue;
1865 /// let x = DestinationDataset::new().set_or_clear_friendly_name(Some(StringValue::default()/* use setters */));
1866 /// let x = DestinationDataset::new().set_or_clear_friendly_name(None::<StringValue>);
1867 /// ```
1868 pub fn set_or_clear_friendly_name<T>(mut self, v: std::option::Option<T>) -> Self
1869 where
1870 T: std::convert::Into<wkt::StringValue>,
1871 {
1872 self.friendly_name = v.map(|x| x.into());
1873 self
1874 }
1875
1876 /// Sets the value of [description][crate::model::DestinationDataset::description].
1877 ///
1878 /// # Example
1879 /// ```ignore,no_run
1880 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1881 /// use wkt::StringValue;
1882 /// let x = DestinationDataset::new().set_description(StringValue::default()/* use setters */);
1883 /// ```
1884 pub fn set_description<T>(mut self, v: T) -> Self
1885 where
1886 T: std::convert::Into<wkt::StringValue>,
1887 {
1888 self.description = std::option::Option::Some(v.into());
1889 self
1890 }
1891
1892 /// Sets or clears the value of [description][crate::model::DestinationDataset::description].
1893 ///
1894 /// # Example
1895 /// ```ignore,no_run
1896 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1897 /// use wkt::StringValue;
1898 /// let x = DestinationDataset::new().set_or_clear_description(Some(StringValue::default()/* use setters */));
1899 /// let x = DestinationDataset::new().set_or_clear_description(None::<StringValue>);
1900 /// ```
1901 pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
1902 where
1903 T: std::convert::Into<wkt::StringValue>,
1904 {
1905 self.description = v.map(|x| x.into());
1906 self
1907 }
1908
1909 /// Sets the value of [labels][crate::model::DestinationDataset::labels].
1910 ///
1911 /// # Example
1912 /// ```ignore,no_run
1913 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1914 /// let x = DestinationDataset::new().set_labels([
1915 /// ("key0", "abc"),
1916 /// ("key1", "xyz"),
1917 /// ]);
1918 /// ```
1919 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1920 where
1921 T: std::iter::IntoIterator<Item = (K, V)>,
1922 K: std::convert::Into<std::string::String>,
1923 V: std::convert::Into<std::string::String>,
1924 {
1925 use std::iter::Iterator;
1926 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1927 self
1928 }
1929
1930 /// Sets the value of [location][crate::model::DestinationDataset::location].
1931 ///
1932 /// # Example
1933 /// ```ignore,no_run
1934 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1935 /// let x = DestinationDataset::new().set_location("example");
1936 /// ```
1937 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1938 self.location = v.into();
1939 self
1940 }
1941
1942 /// Sets the value of [replica_locations][crate::model::DestinationDataset::replica_locations].
1943 ///
1944 /// # Example
1945 /// ```ignore,no_run
1946 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
1947 /// let x = DestinationDataset::new().set_replica_locations(["a", "b", "c"]);
1948 /// ```
1949 pub fn set_replica_locations<T, V>(mut self, v: T) -> Self
1950 where
1951 T: std::iter::IntoIterator<Item = V>,
1952 V: std::convert::Into<std::string::String>,
1953 {
1954 use std::iter::Iterator;
1955 self.replica_locations = v.into_iter().map(|i| i.into()).collect();
1956 self
1957 }
1958}
1959
1960impl wkt::message::Message for DestinationDataset {
1961 fn typename() -> &'static str {
1962 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DestinationDataset"
1963 }
1964}
1965
1966/// Defines the destination Pub/Sub subscription.
1967#[derive(Clone, Default, PartialEq)]
1968#[non_exhaustive]
1969pub struct DestinationPubSubSubscription {
1970 /// Required. Destination Pub/Sub subscription resource.
1971 pub pubsub_subscription: std::option::Option<crate::model::PubSubSubscription>,
1972
1973 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1974}
1975
1976impl DestinationPubSubSubscription {
1977 pub fn new() -> Self {
1978 std::default::Default::default()
1979 }
1980
1981 /// Sets the value of [pubsub_subscription][crate::model::DestinationPubSubSubscription::pubsub_subscription].
1982 ///
1983 /// # Example
1984 /// ```ignore,no_run
1985 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationPubSubSubscription;
1986 /// use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
1987 /// let x = DestinationPubSubSubscription::new().set_pubsub_subscription(PubSubSubscription::default()/* use setters */);
1988 /// ```
1989 pub fn set_pubsub_subscription<T>(mut self, v: T) -> Self
1990 where
1991 T: std::convert::Into<crate::model::PubSubSubscription>,
1992 {
1993 self.pubsub_subscription = std::option::Option::Some(v.into());
1994 self
1995 }
1996
1997 /// Sets or clears the value of [pubsub_subscription][crate::model::DestinationPubSubSubscription::pubsub_subscription].
1998 ///
1999 /// # Example
2000 /// ```ignore,no_run
2001 /// # use google_cloud_bigquery_analyticshub_v1::model::DestinationPubSubSubscription;
2002 /// use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
2003 /// let x = DestinationPubSubSubscription::new().set_or_clear_pubsub_subscription(Some(PubSubSubscription::default()/* use setters */));
2004 /// let x = DestinationPubSubSubscription::new().set_or_clear_pubsub_subscription(None::<PubSubSubscription>);
2005 /// ```
2006 pub fn set_or_clear_pubsub_subscription<T>(mut self, v: std::option::Option<T>) -> Self
2007 where
2008 T: std::convert::Into<crate::model::PubSubSubscription>,
2009 {
2010 self.pubsub_subscription = v.map(|x| x.into());
2011 self
2012 }
2013}
2014
2015impl wkt::message::Message for DestinationPubSubSubscription {
2016 fn typename() -> &'static str {
2017 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DestinationPubSubSubscription"
2018 }
2019}
2020
2021/// A listing is what gets published into a data exchange that a subscriber can
2022/// subscribe to. It contains a reference to the data source along with
2023/// descriptive information that will help subscribers find and subscribe the
2024/// data.
2025#[derive(Clone, Default, PartialEq)]
2026#[non_exhaustive]
2027pub struct Listing {
2028 /// Output only. The resource name of the listing.
2029 /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`
2030 pub name: std::string::String,
2031
2032 /// Required. Human-readable display name of the listing. The display name must
2033 /// contain only Unicode letters, numbers (0-9), underscores (_), dashes (-),
2034 /// spaces ( ), ampersands (&) and can't start or end with spaces. Default
2035 /// value is an empty string. Max length: 63 bytes.
2036 pub display_name: std::string::String,
2037
2038 /// Optional. Short description of the listing. The description must not
2039 /// contain Unicode non-characters and C0 and C1 control codes except tabs
2040 /// (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default
2041 /// value is an empty string. Max length: 2000 bytes.
2042 pub description: std::string::String,
2043
2044 /// Optional. Email or URL of the primary point of contact of the listing.
2045 /// Max Length: 1000 bytes.
2046 pub primary_contact: std::string::String,
2047
2048 /// Optional. Documentation describing the listing.
2049 pub documentation: std::string::String,
2050
2051 /// Output only. Current state of the listing.
2052 pub state: crate::model::listing::State,
2053
2054 /// Optional. Base64 encoded image representing the listing. Max Size: 3.0MiB
2055 /// Expected image dimensions are 512x512 pixels, however the API only
2056 /// performs validation on size of the encoded data.
2057 /// Note: For byte fields, the contents of the field are base64-encoded (which
2058 /// increases the size of the data by 33-36%) when using JSON on the wire.
2059 pub icon: ::bytes::Bytes,
2060
2061 /// Optional. Details of the data provider who owns the source data.
2062 pub data_provider: std::option::Option<crate::model::DataProvider>,
2063
2064 /// Optional. Categories of the listing. Up to five categories are allowed.
2065 pub categories: std::vec::Vec<crate::model::listing::Category>,
2066
2067 /// Optional. Details of the publisher who owns the listing and who can share
2068 /// the source data.
2069 pub publisher: std::option::Option<crate::model::Publisher>,
2070
2071 /// Optional. Email or URL of the request access of the listing.
2072 /// Subscribers can use this reference to request access.
2073 /// Max Length: 1000 bytes.
2074 pub request_access: std::string::String,
2075
2076 /// Optional. If set, restricted export configuration will be propagated and
2077 /// enforced on the linked dataset.
2078 pub restricted_export_config:
2079 std::option::Option<crate::model::listing::RestrictedExportConfig>,
2080
2081 /// Optional. If set, stored procedure configuration will be propagated and
2082 /// enforced on the linked dataset.
2083 pub stored_procedure_config: std::option::Option<crate::model::StoredProcedureConfig>,
2084
2085 /// Optional. Type of discovery of the listing on the discovery page.
2086 pub discovery_type: std::option::Option<crate::model::DiscoveryType>,
2087
2088 /// Output only. Listing shared asset type.
2089 pub resource_type: crate::model::SharedResourceType,
2090
2091 /// Output only. Commercial info contains the information about the commercial
2092 /// data products associated with the listing.
2093 pub commercial_info: std::option::Option<crate::model::listing::CommercialInfo>,
2094
2095 /// Optional. By default, false.
2096 /// If true, the Listing has an email sharing mandate enabled.
2097 pub log_linked_dataset_query_user_email: std::option::Option<bool>,
2098
2099 /// Optional. If true, the listing is only available to get the resource
2100 /// metadata. Listing is non subscribable.
2101 pub allow_only_metadata_sharing: std::option::Option<bool>,
2102
2103 /// Listing source.
2104 pub source: std::option::Option<crate::model::listing::Source>,
2105
2106 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2107}
2108
2109impl Listing {
2110 pub fn new() -> Self {
2111 std::default::Default::default()
2112 }
2113
2114 /// Sets the value of [name][crate::model::Listing::name].
2115 ///
2116 /// # Example
2117 /// ```ignore,no_run
2118 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2119 /// let x = Listing::new().set_name("example");
2120 /// ```
2121 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2122 self.name = v.into();
2123 self
2124 }
2125
2126 /// Sets the value of [display_name][crate::model::Listing::display_name].
2127 ///
2128 /// # Example
2129 /// ```ignore,no_run
2130 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2131 /// let x = Listing::new().set_display_name("example");
2132 /// ```
2133 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2134 self.display_name = v.into();
2135 self
2136 }
2137
2138 /// Sets the value of [description][crate::model::Listing::description].
2139 ///
2140 /// # Example
2141 /// ```ignore,no_run
2142 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2143 /// let x = Listing::new().set_description("example");
2144 /// ```
2145 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2146 self.description = v.into();
2147 self
2148 }
2149
2150 /// Sets the value of [primary_contact][crate::model::Listing::primary_contact].
2151 ///
2152 /// # Example
2153 /// ```ignore,no_run
2154 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2155 /// let x = Listing::new().set_primary_contact("example");
2156 /// ```
2157 pub fn set_primary_contact<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2158 self.primary_contact = v.into();
2159 self
2160 }
2161
2162 /// Sets the value of [documentation][crate::model::Listing::documentation].
2163 ///
2164 /// # Example
2165 /// ```ignore,no_run
2166 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2167 /// let x = Listing::new().set_documentation("example");
2168 /// ```
2169 pub fn set_documentation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2170 self.documentation = v.into();
2171 self
2172 }
2173
2174 /// Sets the value of [state][crate::model::Listing::state].
2175 ///
2176 /// # Example
2177 /// ```ignore,no_run
2178 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2179 /// use google_cloud_bigquery_analyticshub_v1::model::listing::State;
2180 /// let x0 = Listing::new().set_state(State::Active);
2181 /// ```
2182 pub fn set_state<T: std::convert::Into<crate::model::listing::State>>(mut self, v: T) -> Self {
2183 self.state = v.into();
2184 self
2185 }
2186
2187 /// Sets the value of [icon][crate::model::Listing::icon].
2188 ///
2189 /// # Example
2190 /// ```ignore,no_run
2191 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2192 /// let x = Listing::new().set_icon(bytes::Bytes::from_static(b"example"));
2193 /// ```
2194 pub fn set_icon<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2195 self.icon = v.into();
2196 self
2197 }
2198
2199 /// Sets the value of [data_provider][crate::model::Listing::data_provider].
2200 ///
2201 /// # Example
2202 /// ```ignore,no_run
2203 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2204 /// use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
2205 /// let x = Listing::new().set_data_provider(DataProvider::default()/* use setters */);
2206 /// ```
2207 pub fn set_data_provider<T>(mut self, v: T) -> Self
2208 where
2209 T: std::convert::Into<crate::model::DataProvider>,
2210 {
2211 self.data_provider = std::option::Option::Some(v.into());
2212 self
2213 }
2214
2215 /// Sets or clears the value of [data_provider][crate::model::Listing::data_provider].
2216 ///
2217 /// # Example
2218 /// ```ignore,no_run
2219 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2220 /// use google_cloud_bigquery_analyticshub_v1::model::DataProvider;
2221 /// let x = Listing::new().set_or_clear_data_provider(Some(DataProvider::default()/* use setters */));
2222 /// let x = Listing::new().set_or_clear_data_provider(None::<DataProvider>);
2223 /// ```
2224 pub fn set_or_clear_data_provider<T>(mut self, v: std::option::Option<T>) -> Self
2225 where
2226 T: std::convert::Into<crate::model::DataProvider>,
2227 {
2228 self.data_provider = v.map(|x| x.into());
2229 self
2230 }
2231
2232 /// Sets the value of [categories][crate::model::Listing::categories].
2233 ///
2234 /// # Example
2235 /// ```ignore,no_run
2236 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2237 /// use google_cloud_bigquery_analyticshub_v1::model::listing::Category;
2238 /// let x = Listing::new().set_categories([
2239 /// Category::Others,
2240 /// Category::AdvertisingAndMarketing,
2241 /// Category::Commerce,
2242 /// ]);
2243 /// ```
2244 pub fn set_categories<T, V>(mut self, v: T) -> Self
2245 where
2246 T: std::iter::IntoIterator<Item = V>,
2247 V: std::convert::Into<crate::model::listing::Category>,
2248 {
2249 use std::iter::Iterator;
2250 self.categories = v.into_iter().map(|i| i.into()).collect();
2251 self
2252 }
2253
2254 /// Sets the value of [publisher][crate::model::Listing::publisher].
2255 ///
2256 /// # Example
2257 /// ```ignore,no_run
2258 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2259 /// use google_cloud_bigquery_analyticshub_v1::model::Publisher;
2260 /// let x = Listing::new().set_publisher(Publisher::default()/* use setters */);
2261 /// ```
2262 pub fn set_publisher<T>(mut self, v: T) -> Self
2263 where
2264 T: std::convert::Into<crate::model::Publisher>,
2265 {
2266 self.publisher = std::option::Option::Some(v.into());
2267 self
2268 }
2269
2270 /// Sets or clears the value of [publisher][crate::model::Listing::publisher].
2271 ///
2272 /// # Example
2273 /// ```ignore,no_run
2274 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2275 /// use google_cloud_bigquery_analyticshub_v1::model::Publisher;
2276 /// let x = Listing::new().set_or_clear_publisher(Some(Publisher::default()/* use setters */));
2277 /// let x = Listing::new().set_or_clear_publisher(None::<Publisher>);
2278 /// ```
2279 pub fn set_or_clear_publisher<T>(mut self, v: std::option::Option<T>) -> Self
2280 where
2281 T: std::convert::Into<crate::model::Publisher>,
2282 {
2283 self.publisher = v.map(|x| x.into());
2284 self
2285 }
2286
2287 /// Sets the value of [request_access][crate::model::Listing::request_access].
2288 ///
2289 /// # Example
2290 /// ```ignore,no_run
2291 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2292 /// let x = Listing::new().set_request_access("example");
2293 /// ```
2294 pub fn set_request_access<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2295 self.request_access = v.into();
2296 self
2297 }
2298
2299 /// Sets the value of [restricted_export_config][crate::model::Listing::restricted_export_config].
2300 ///
2301 /// # Example
2302 /// ```ignore,no_run
2303 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2304 /// use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
2305 /// let x = Listing::new().set_restricted_export_config(RestrictedExportConfig::default()/* use setters */);
2306 /// ```
2307 pub fn set_restricted_export_config<T>(mut self, v: T) -> Self
2308 where
2309 T: std::convert::Into<crate::model::listing::RestrictedExportConfig>,
2310 {
2311 self.restricted_export_config = std::option::Option::Some(v.into());
2312 self
2313 }
2314
2315 /// Sets or clears the value of [restricted_export_config][crate::model::Listing::restricted_export_config].
2316 ///
2317 /// # Example
2318 /// ```ignore,no_run
2319 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2320 /// use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
2321 /// let x = Listing::new().set_or_clear_restricted_export_config(Some(RestrictedExportConfig::default()/* use setters */));
2322 /// let x = Listing::new().set_or_clear_restricted_export_config(None::<RestrictedExportConfig>);
2323 /// ```
2324 pub fn set_or_clear_restricted_export_config<T>(mut self, v: std::option::Option<T>) -> Self
2325 where
2326 T: std::convert::Into<crate::model::listing::RestrictedExportConfig>,
2327 {
2328 self.restricted_export_config = v.map(|x| x.into());
2329 self
2330 }
2331
2332 /// Sets the value of [stored_procedure_config][crate::model::Listing::stored_procedure_config].
2333 ///
2334 /// # Example
2335 /// ```ignore,no_run
2336 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2337 /// use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
2338 /// let x = Listing::new().set_stored_procedure_config(StoredProcedureConfig::default()/* use setters */);
2339 /// ```
2340 pub fn set_stored_procedure_config<T>(mut self, v: T) -> Self
2341 where
2342 T: std::convert::Into<crate::model::StoredProcedureConfig>,
2343 {
2344 self.stored_procedure_config = std::option::Option::Some(v.into());
2345 self
2346 }
2347
2348 /// Sets or clears the value of [stored_procedure_config][crate::model::Listing::stored_procedure_config].
2349 ///
2350 /// # Example
2351 /// ```ignore,no_run
2352 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2353 /// use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
2354 /// let x = Listing::new().set_or_clear_stored_procedure_config(Some(StoredProcedureConfig::default()/* use setters */));
2355 /// let x = Listing::new().set_or_clear_stored_procedure_config(None::<StoredProcedureConfig>);
2356 /// ```
2357 pub fn set_or_clear_stored_procedure_config<T>(mut self, v: std::option::Option<T>) -> Self
2358 where
2359 T: std::convert::Into<crate::model::StoredProcedureConfig>,
2360 {
2361 self.stored_procedure_config = v.map(|x| x.into());
2362 self
2363 }
2364
2365 /// Sets the value of [discovery_type][crate::model::Listing::discovery_type].
2366 ///
2367 /// # Example
2368 /// ```ignore,no_run
2369 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2370 /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
2371 /// let x0 = Listing::new().set_discovery_type(DiscoveryType::Private);
2372 /// let x1 = Listing::new().set_discovery_type(DiscoveryType::Public);
2373 /// ```
2374 pub fn set_discovery_type<T>(mut self, v: T) -> Self
2375 where
2376 T: std::convert::Into<crate::model::DiscoveryType>,
2377 {
2378 self.discovery_type = std::option::Option::Some(v.into());
2379 self
2380 }
2381
2382 /// Sets or clears the value of [discovery_type][crate::model::Listing::discovery_type].
2383 ///
2384 /// # Example
2385 /// ```ignore,no_run
2386 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2387 /// use google_cloud_bigquery_analyticshub_v1::model::DiscoveryType;
2388 /// let x0 = Listing::new().set_or_clear_discovery_type(Some(DiscoveryType::Private));
2389 /// let x1 = Listing::new().set_or_clear_discovery_type(Some(DiscoveryType::Public));
2390 /// let x_none = Listing::new().set_or_clear_discovery_type(None::<DiscoveryType>);
2391 /// ```
2392 pub fn set_or_clear_discovery_type<T>(mut self, v: std::option::Option<T>) -> Self
2393 where
2394 T: std::convert::Into<crate::model::DiscoveryType>,
2395 {
2396 self.discovery_type = v.map(|x| x.into());
2397 self
2398 }
2399
2400 /// Sets the value of [resource_type][crate::model::Listing::resource_type].
2401 ///
2402 /// # Example
2403 /// ```ignore,no_run
2404 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2405 /// use google_cloud_bigquery_analyticshub_v1::model::SharedResourceType;
2406 /// let x0 = Listing::new().set_resource_type(SharedResourceType::BigqueryDataset);
2407 /// let x1 = Listing::new().set_resource_type(SharedResourceType::PubsubTopic);
2408 /// ```
2409 pub fn set_resource_type<T: std::convert::Into<crate::model::SharedResourceType>>(
2410 mut self,
2411 v: T,
2412 ) -> Self {
2413 self.resource_type = v.into();
2414 self
2415 }
2416
2417 /// Sets the value of [commercial_info][crate::model::Listing::commercial_info].
2418 ///
2419 /// # Example
2420 /// ```ignore,no_run
2421 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2422 /// use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
2423 /// let x = Listing::new().set_commercial_info(CommercialInfo::default()/* use setters */);
2424 /// ```
2425 pub fn set_commercial_info<T>(mut self, v: T) -> Self
2426 where
2427 T: std::convert::Into<crate::model::listing::CommercialInfo>,
2428 {
2429 self.commercial_info = std::option::Option::Some(v.into());
2430 self
2431 }
2432
2433 /// Sets or clears the value of [commercial_info][crate::model::Listing::commercial_info].
2434 ///
2435 /// # Example
2436 /// ```ignore,no_run
2437 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2438 /// use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
2439 /// let x = Listing::new().set_or_clear_commercial_info(Some(CommercialInfo::default()/* use setters */));
2440 /// let x = Listing::new().set_or_clear_commercial_info(None::<CommercialInfo>);
2441 /// ```
2442 pub fn set_or_clear_commercial_info<T>(mut self, v: std::option::Option<T>) -> Self
2443 where
2444 T: std::convert::Into<crate::model::listing::CommercialInfo>,
2445 {
2446 self.commercial_info = v.map(|x| x.into());
2447 self
2448 }
2449
2450 /// Sets the value of [log_linked_dataset_query_user_email][crate::model::Listing::log_linked_dataset_query_user_email].
2451 ///
2452 /// # Example
2453 /// ```ignore,no_run
2454 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2455 /// let x = Listing::new().set_log_linked_dataset_query_user_email(true);
2456 /// ```
2457 pub fn set_log_linked_dataset_query_user_email<T>(mut self, v: T) -> Self
2458 where
2459 T: std::convert::Into<bool>,
2460 {
2461 self.log_linked_dataset_query_user_email = std::option::Option::Some(v.into());
2462 self
2463 }
2464
2465 /// Sets or clears the value of [log_linked_dataset_query_user_email][crate::model::Listing::log_linked_dataset_query_user_email].
2466 ///
2467 /// # Example
2468 /// ```ignore,no_run
2469 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2470 /// let x = Listing::new().set_or_clear_log_linked_dataset_query_user_email(Some(false));
2471 /// let x = Listing::new().set_or_clear_log_linked_dataset_query_user_email(None::<bool>);
2472 /// ```
2473 pub fn set_or_clear_log_linked_dataset_query_user_email<T>(
2474 mut self,
2475 v: std::option::Option<T>,
2476 ) -> Self
2477 where
2478 T: std::convert::Into<bool>,
2479 {
2480 self.log_linked_dataset_query_user_email = v.map(|x| x.into());
2481 self
2482 }
2483
2484 /// Sets the value of [allow_only_metadata_sharing][crate::model::Listing::allow_only_metadata_sharing].
2485 ///
2486 /// # Example
2487 /// ```ignore,no_run
2488 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2489 /// let x = Listing::new().set_allow_only_metadata_sharing(true);
2490 /// ```
2491 pub fn set_allow_only_metadata_sharing<T>(mut self, v: T) -> Self
2492 where
2493 T: std::convert::Into<bool>,
2494 {
2495 self.allow_only_metadata_sharing = std::option::Option::Some(v.into());
2496 self
2497 }
2498
2499 /// Sets or clears the value of [allow_only_metadata_sharing][crate::model::Listing::allow_only_metadata_sharing].
2500 ///
2501 /// # Example
2502 /// ```ignore,no_run
2503 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2504 /// let x = Listing::new().set_or_clear_allow_only_metadata_sharing(Some(false));
2505 /// let x = Listing::new().set_or_clear_allow_only_metadata_sharing(None::<bool>);
2506 /// ```
2507 pub fn set_or_clear_allow_only_metadata_sharing<T>(mut self, v: std::option::Option<T>) -> Self
2508 where
2509 T: std::convert::Into<bool>,
2510 {
2511 self.allow_only_metadata_sharing = v.map(|x| x.into());
2512 self
2513 }
2514
2515 /// Sets the value of [source][crate::model::Listing::source].
2516 ///
2517 /// Note that all the setters affecting `source` are mutually
2518 /// exclusive.
2519 ///
2520 /// # Example
2521 /// ```ignore,no_run
2522 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2523 /// use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2524 /// let x = Listing::new().set_source(Some(
2525 /// google_cloud_bigquery_analyticshub_v1::model::listing::Source::BigqueryDataset(BigQueryDatasetSource::default().into())));
2526 /// ```
2527 pub fn set_source<T: std::convert::Into<std::option::Option<crate::model::listing::Source>>>(
2528 mut self,
2529 v: T,
2530 ) -> Self {
2531 self.source = v.into();
2532 self
2533 }
2534
2535 /// The value of [source][crate::model::Listing::source]
2536 /// if it holds a `BigqueryDataset`, `None` if the field is not set or
2537 /// holds a different branch.
2538 pub fn bigquery_dataset(
2539 &self,
2540 ) -> std::option::Option<&std::boxed::Box<crate::model::listing::BigQueryDatasetSource>> {
2541 #[allow(unreachable_patterns)]
2542 self.source.as_ref().and_then(|v| match v {
2543 crate::model::listing::Source::BigqueryDataset(v) => std::option::Option::Some(v),
2544 _ => std::option::Option::None,
2545 })
2546 }
2547
2548 /// Sets the value of [source][crate::model::Listing::source]
2549 /// to hold a `BigqueryDataset`.
2550 ///
2551 /// Note that all the setters affecting `source` are
2552 /// mutually exclusive.
2553 ///
2554 /// # Example
2555 /// ```ignore,no_run
2556 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2557 /// use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2558 /// let x = Listing::new().set_bigquery_dataset(BigQueryDatasetSource::default()/* use setters */);
2559 /// assert!(x.bigquery_dataset().is_some());
2560 /// assert!(x.pubsub_topic().is_none());
2561 /// ```
2562 pub fn set_bigquery_dataset<
2563 T: std::convert::Into<std::boxed::Box<crate::model::listing::BigQueryDatasetSource>>,
2564 >(
2565 mut self,
2566 v: T,
2567 ) -> Self {
2568 self.source =
2569 std::option::Option::Some(crate::model::listing::Source::BigqueryDataset(v.into()));
2570 self
2571 }
2572
2573 /// The value of [source][crate::model::Listing::source]
2574 /// if it holds a `PubsubTopic`, `None` if the field is not set or
2575 /// holds a different branch.
2576 pub fn pubsub_topic(
2577 &self,
2578 ) -> std::option::Option<&std::boxed::Box<crate::model::listing::PubSubTopicSource>> {
2579 #[allow(unreachable_patterns)]
2580 self.source.as_ref().and_then(|v| match v {
2581 crate::model::listing::Source::PubsubTopic(v) => std::option::Option::Some(v),
2582 _ => std::option::Option::None,
2583 })
2584 }
2585
2586 /// Sets the value of [source][crate::model::Listing::source]
2587 /// to hold a `PubsubTopic`.
2588 ///
2589 /// Note that all the setters affecting `source` are
2590 /// mutually exclusive.
2591 ///
2592 /// # Example
2593 /// ```ignore,no_run
2594 /// # use google_cloud_bigquery_analyticshub_v1::model::Listing;
2595 /// use google_cloud_bigquery_analyticshub_v1::model::listing::PubSubTopicSource;
2596 /// let x = Listing::new().set_pubsub_topic(PubSubTopicSource::default()/* use setters */);
2597 /// assert!(x.pubsub_topic().is_some());
2598 /// assert!(x.bigquery_dataset().is_none());
2599 /// ```
2600 pub fn set_pubsub_topic<
2601 T: std::convert::Into<std::boxed::Box<crate::model::listing::PubSubTopicSource>>,
2602 >(
2603 mut self,
2604 v: T,
2605 ) -> Self {
2606 self.source =
2607 std::option::Option::Some(crate::model::listing::Source::PubsubTopic(v.into()));
2608 self
2609 }
2610}
2611
2612impl wkt::message::Message for Listing {
2613 fn typename() -> &'static str {
2614 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing"
2615 }
2616}
2617
2618/// Defines additional types related to [Listing].
2619pub mod listing {
2620 #[allow(unused_imports)]
2621 use super::*;
2622
2623 /// A reference to a shared dataset. It is an existing BigQuery dataset with a
2624 /// collection of objects such as tables and views that you want to share
2625 /// with subscribers.
2626 /// When subscriber's subscribe to a listing, Analytics Hub creates a linked
2627 /// dataset in
2628 /// the subscriber's project. A Linked dataset is an opaque, read-only BigQuery
2629 /// dataset that serves as a _symbolic link_ to a shared dataset.
2630 #[derive(Clone, Default, PartialEq)]
2631 #[non_exhaustive]
2632 pub struct BigQueryDatasetSource {
2633 /// Optional. Resource name of the dataset source for this listing.
2634 /// e.g. `projects/myproject/datasets/123`
2635 pub dataset: std::string::String,
2636
2637 /// Optional. Resource in this dataset that is selectively shared.
2638 /// This field is required for data clean room exchanges.
2639 pub selected_resources:
2640 std::vec::Vec<crate::model::listing::big_query_dataset_source::SelectedResource>,
2641
2642 /// Optional. If set, restricted export policy will be propagated and
2643 /// enforced on the linked dataset.
2644 pub restricted_export_policy: std::option::Option<
2645 crate::model::listing::big_query_dataset_source::RestrictedExportPolicy,
2646 >,
2647
2648 /// Optional. A list of regions where the publisher has created shared
2649 /// dataset replicas.
2650 pub replica_locations: std::vec::Vec<std::string::String>,
2651
2652 /// Output only. Server-owned effective state of replicas.
2653 /// Contains both primary and secondary replicas.
2654 /// Each replica includes a system-computed (output-only) state and primary
2655 /// designation.
2656 pub effective_replicas:
2657 std::vec::Vec<crate::model::listing::big_query_dataset_source::Replica>,
2658
2659 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2660 }
2661
2662 impl BigQueryDatasetSource {
2663 pub fn new() -> Self {
2664 std::default::Default::default()
2665 }
2666
2667 /// Sets the value of [dataset][crate::model::listing::BigQueryDatasetSource::dataset].
2668 ///
2669 /// # Example
2670 /// ```ignore,no_run
2671 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2672 /// let x = BigQueryDatasetSource::new().set_dataset("example");
2673 /// ```
2674 pub fn set_dataset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2675 self.dataset = v.into();
2676 self
2677 }
2678
2679 /// Sets the value of [selected_resources][crate::model::listing::BigQueryDatasetSource::selected_resources].
2680 ///
2681 /// # Example
2682 /// ```ignore,no_run
2683 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2684 /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2685 /// let x = BigQueryDatasetSource::new()
2686 /// .set_selected_resources([
2687 /// SelectedResource::default()/* use setters */,
2688 /// SelectedResource::default()/* use (different) setters */,
2689 /// ]);
2690 /// ```
2691 pub fn set_selected_resources<T, V>(mut self, v: T) -> Self
2692 where
2693 T: std::iter::IntoIterator<Item = V>,
2694 V: std::convert::Into<
2695 crate::model::listing::big_query_dataset_source::SelectedResource,
2696 >,
2697 {
2698 use std::iter::Iterator;
2699 self.selected_resources = v.into_iter().map(|i| i.into()).collect();
2700 self
2701 }
2702
2703 /// Sets the value of [restricted_export_policy][crate::model::listing::BigQueryDatasetSource::restricted_export_policy].
2704 ///
2705 /// # Example
2706 /// ```ignore,no_run
2707 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2708 /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2709 /// let x = BigQueryDatasetSource::new().set_restricted_export_policy(RestrictedExportPolicy::default()/* use setters */);
2710 /// ```
2711 pub fn set_restricted_export_policy<T>(mut self, v: T) -> Self
2712 where
2713 T: std::convert::Into<
2714 crate::model::listing::big_query_dataset_source::RestrictedExportPolicy,
2715 >,
2716 {
2717 self.restricted_export_policy = std::option::Option::Some(v.into());
2718 self
2719 }
2720
2721 /// Sets or clears the value of [restricted_export_policy][crate::model::listing::BigQueryDatasetSource::restricted_export_policy].
2722 ///
2723 /// # Example
2724 /// ```ignore,no_run
2725 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2726 /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2727 /// let x = BigQueryDatasetSource::new().set_or_clear_restricted_export_policy(Some(RestrictedExportPolicy::default()/* use setters */));
2728 /// let x = BigQueryDatasetSource::new().set_or_clear_restricted_export_policy(None::<RestrictedExportPolicy>);
2729 /// ```
2730 pub fn set_or_clear_restricted_export_policy<T>(mut self, v: std::option::Option<T>) -> Self
2731 where
2732 T: std::convert::Into<
2733 crate::model::listing::big_query_dataset_source::RestrictedExportPolicy,
2734 >,
2735 {
2736 self.restricted_export_policy = v.map(|x| x.into());
2737 self
2738 }
2739
2740 /// Sets the value of [replica_locations][crate::model::listing::BigQueryDatasetSource::replica_locations].
2741 ///
2742 /// # Example
2743 /// ```ignore,no_run
2744 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2745 /// let x = BigQueryDatasetSource::new().set_replica_locations(["a", "b", "c"]);
2746 /// ```
2747 pub fn set_replica_locations<T, V>(mut self, v: T) -> Self
2748 where
2749 T: std::iter::IntoIterator<Item = V>,
2750 V: std::convert::Into<std::string::String>,
2751 {
2752 use std::iter::Iterator;
2753 self.replica_locations = v.into_iter().map(|i| i.into()).collect();
2754 self
2755 }
2756
2757 /// Sets the value of [effective_replicas][crate::model::listing::BigQueryDatasetSource::effective_replicas].
2758 ///
2759 /// # Example
2760 /// ```ignore,no_run
2761 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::BigQueryDatasetSource;
2762 /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
2763 /// let x = BigQueryDatasetSource::new()
2764 /// .set_effective_replicas([
2765 /// Replica::default()/* use setters */,
2766 /// Replica::default()/* use (different) setters */,
2767 /// ]);
2768 /// ```
2769 pub fn set_effective_replicas<T, V>(mut self, v: T) -> Self
2770 where
2771 T: std::iter::IntoIterator<Item = V>,
2772 V: std::convert::Into<crate::model::listing::big_query_dataset_source::Replica>,
2773 {
2774 use std::iter::Iterator;
2775 self.effective_replicas = v.into_iter().map(|i| i.into()).collect();
2776 self
2777 }
2778 }
2779
2780 impl wkt::message::Message for BigQueryDatasetSource {
2781 fn typename() -> &'static str {
2782 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource"
2783 }
2784 }
2785
2786 /// Defines additional types related to [BigQueryDatasetSource].
2787 pub mod big_query_dataset_source {
2788 #[allow(unused_imports)]
2789 use super::*;
2790
2791 /// Resource in this dataset that is selectively shared.
2792 #[derive(Clone, Default, PartialEq)]
2793 #[non_exhaustive]
2794 pub struct SelectedResource {
2795 pub resource: std::option::Option<
2796 crate::model::listing::big_query_dataset_source::selected_resource::Resource,
2797 >,
2798
2799 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2800 }
2801
2802 impl SelectedResource {
2803 pub fn new() -> Self {
2804 std::default::Default::default()
2805 }
2806
2807 /// Sets the value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource].
2808 ///
2809 /// Note that all the setters affecting `resource` are mutually
2810 /// exclusive.
2811 ///
2812 /// # Example
2813 /// ```ignore,no_run
2814 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2815 /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::selected_resource::Resource;
2816 /// let x = SelectedResource::new().set_resource(Some(Resource::Table("example".to_string())));
2817 /// ```
2818 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
2819 {
2820 self.resource = v.into();
2821 self
2822 }
2823
2824 /// The value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2825 /// if it holds a `Table`, `None` if the field is not set or
2826 /// holds a different branch.
2827 pub fn table(&self) -> std::option::Option<&std::string::String> {
2828 #[allow(unreachable_patterns)]
2829 self.resource.as_ref().and_then(|v| match v {
2830 crate::model::listing::big_query_dataset_source::selected_resource::Resource::Table(v) => std::option::Option::Some(v),
2831 _ => std::option::Option::None,
2832 })
2833 }
2834
2835 /// Sets the value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2836 /// to hold a `Table`.
2837 ///
2838 /// Note that all the setters affecting `resource` are
2839 /// mutually exclusive.
2840 ///
2841 /// # Example
2842 /// ```ignore,no_run
2843 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2844 /// let x = SelectedResource::new().set_table("example");
2845 /// assert!(x.table().is_some());
2846 /// assert!(x.routine().is_none());
2847 /// ```
2848 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2849 self.resource = std::option::Option::Some(
2850 crate::model::listing::big_query_dataset_source::selected_resource::Resource::Table(
2851 v.into()
2852 )
2853 );
2854 self
2855 }
2856
2857 /// The value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2858 /// if it holds a `Routine`, `None` if the field is not set or
2859 /// holds a different branch.
2860 pub fn routine(&self) -> std::option::Option<&std::string::String> {
2861 #[allow(unreachable_patterns)]
2862 self.resource.as_ref().and_then(|v| match v {
2863 crate::model::listing::big_query_dataset_source::selected_resource::Resource::Routine(v) => std::option::Option::Some(v),
2864 _ => std::option::Option::None,
2865 })
2866 }
2867
2868 /// Sets the value of [resource][crate::model::listing::big_query_dataset_source::SelectedResource::resource]
2869 /// to hold a `Routine`.
2870 ///
2871 /// Note that all the setters affecting `resource` are
2872 /// mutually exclusive.
2873 ///
2874 /// # Example
2875 /// ```ignore,no_run
2876 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::SelectedResource;
2877 /// let x = SelectedResource::new().set_routine("example");
2878 /// assert!(x.routine().is_some());
2879 /// assert!(x.table().is_none());
2880 /// ```
2881 pub fn set_routine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2882 self.resource = std::option::Option::Some(
2883 crate::model::listing::big_query_dataset_source::selected_resource::Resource::Routine(
2884 v.into()
2885 )
2886 );
2887 self
2888 }
2889 }
2890
2891 impl wkt::message::Message for SelectedResource {
2892 fn typename() -> &'static str {
2893 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.SelectedResource"
2894 }
2895 }
2896
2897 /// Defines additional types related to [SelectedResource].
2898 pub mod selected_resource {
2899 #[allow(unused_imports)]
2900 use super::*;
2901
2902 #[derive(Clone, Debug, PartialEq)]
2903 #[non_exhaustive]
2904 pub enum Resource {
2905 /// Optional. Format:
2906 /// For table:
2907 /// `projects/{projectId}/datasets/{datasetId}/tables/{tableId}`
2908 /// Example:"projects/test_project/datasets/test_dataset/tables/test_table"
2909 Table(std::string::String),
2910 /// Optional. Format:
2911 /// For routine:
2912 /// `projects/{projectId}/datasets/{datasetId}/routines/{routineId}`
2913 /// Example:"projects/test_project/datasets/test_dataset/routines/test_routine"
2914 Routine(std::string::String),
2915 }
2916 }
2917
2918 /// Restricted export policy used to configure restricted export on linked
2919 /// dataset.
2920 #[derive(Clone, Default, PartialEq)]
2921 #[non_exhaustive]
2922 pub struct RestrictedExportPolicy {
2923 /// Optional. If true, enable restricted export.
2924 pub enabled: std::option::Option<wkt::BoolValue>,
2925
2926 /// Optional. If true, restrict direct table access (read
2927 /// api/tabledata.list) on linked table.
2928 pub restrict_direct_table_access: std::option::Option<wkt::BoolValue>,
2929
2930 /// Optional. If true, restrict export of query result derived from
2931 /// restricted linked dataset table.
2932 pub restrict_query_result: std::option::Option<wkt::BoolValue>,
2933
2934 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2935 }
2936
2937 impl RestrictedExportPolicy {
2938 pub fn new() -> Self {
2939 std::default::Default::default()
2940 }
2941
2942 /// Sets the value of [enabled][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::enabled].
2943 ///
2944 /// # Example
2945 /// ```ignore,no_run
2946 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2947 /// use wkt::BoolValue;
2948 /// let x = RestrictedExportPolicy::new().set_enabled(BoolValue::default()/* use setters */);
2949 /// ```
2950 pub fn set_enabled<T>(mut self, v: T) -> Self
2951 where
2952 T: std::convert::Into<wkt::BoolValue>,
2953 {
2954 self.enabled = std::option::Option::Some(v.into());
2955 self
2956 }
2957
2958 /// Sets or clears the value of [enabled][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::enabled].
2959 ///
2960 /// # Example
2961 /// ```ignore,no_run
2962 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2963 /// use wkt::BoolValue;
2964 /// let x = RestrictedExportPolicy::new().set_or_clear_enabled(Some(BoolValue::default()/* use setters */));
2965 /// let x = RestrictedExportPolicy::new().set_or_clear_enabled(None::<BoolValue>);
2966 /// ```
2967 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
2968 where
2969 T: std::convert::Into<wkt::BoolValue>,
2970 {
2971 self.enabled = v.map(|x| x.into());
2972 self
2973 }
2974
2975 /// Sets the value of [restrict_direct_table_access][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_direct_table_access].
2976 ///
2977 /// # Example
2978 /// ```ignore,no_run
2979 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2980 /// use wkt::BoolValue;
2981 /// let x = RestrictedExportPolicy::new().set_restrict_direct_table_access(BoolValue::default()/* use setters */);
2982 /// ```
2983 pub fn set_restrict_direct_table_access<T>(mut self, v: T) -> Self
2984 where
2985 T: std::convert::Into<wkt::BoolValue>,
2986 {
2987 self.restrict_direct_table_access = std::option::Option::Some(v.into());
2988 self
2989 }
2990
2991 /// Sets or clears the value of [restrict_direct_table_access][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_direct_table_access].
2992 ///
2993 /// # Example
2994 /// ```ignore,no_run
2995 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
2996 /// use wkt::BoolValue;
2997 /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_direct_table_access(Some(BoolValue::default()/* use setters */));
2998 /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_direct_table_access(None::<BoolValue>);
2999 /// ```
3000 pub fn set_or_clear_restrict_direct_table_access<T>(
3001 mut self,
3002 v: std::option::Option<T>,
3003 ) -> Self
3004 where
3005 T: std::convert::Into<wkt::BoolValue>,
3006 {
3007 self.restrict_direct_table_access = v.map(|x| x.into());
3008 self
3009 }
3010
3011 /// Sets the value of [restrict_query_result][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_query_result].
3012 ///
3013 /// # Example
3014 /// ```ignore,no_run
3015 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
3016 /// use wkt::BoolValue;
3017 /// let x = RestrictedExportPolicy::new().set_restrict_query_result(BoolValue::default()/* use setters */);
3018 /// ```
3019 pub fn set_restrict_query_result<T>(mut self, v: T) -> Self
3020 where
3021 T: std::convert::Into<wkt::BoolValue>,
3022 {
3023 self.restrict_query_result = std::option::Option::Some(v.into());
3024 self
3025 }
3026
3027 /// Sets or clears the value of [restrict_query_result][crate::model::listing::big_query_dataset_source::RestrictedExportPolicy::restrict_query_result].
3028 ///
3029 /// # Example
3030 /// ```ignore,no_run
3031 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::RestrictedExportPolicy;
3032 /// use wkt::BoolValue;
3033 /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_query_result(Some(BoolValue::default()/* use setters */));
3034 /// let x = RestrictedExportPolicy::new().set_or_clear_restrict_query_result(None::<BoolValue>);
3035 /// ```
3036 pub fn set_or_clear_restrict_query_result<T>(
3037 mut self,
3038 v: std::option::Option<T>,
3039 ) -> Self
3040 where
3041 T: std::convert::Into<wkt::BoolValue>,
3042 {
3043 self.restrict_query_result = v.map(|x| x.into());
3044 self
3045 }
3046 }
3047
3048 impl wkt::message::Message for RestrictedExportPolicy {
3049 fn typename() -> &'static str {
3050 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.RestrictedExportPolicy"
3051 }
3052 }
3053
3054 /// Represents the state of a replica of a shared dataset.
3055 /// It includes the geographic location of the replica and
3056 /// system-computed, output-only fields indicating its replication state and
3057 /// whether it is the primary replica.
3058 #[derive(Clone, Default, PartialEq)]
3059 #[non_exhaustive]
3060 pub struct Replica {
3061 /// Output only. The geographic location where the replica resides. See
3062 /// [BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
3063 /// for supported locations. Eg. "us-central1".
3064 pub location: std::string::String,
3065
3066 /// Output only. Assigned by Analytics Hub based on real BigQuery
3067 /// replication state.
3068 pub replica_state:
3069 crate::model::listing::big_query_dataset_source::replica::ReplicaState,
3070
3071 /// Output only. Indicates that this replica is the primary replica.
3072 pub primary_state: std::option::Option<
3073 crate::model::listing::big_query_dataset_source::replica::PrimaryState,
3074 >,
3075
3076 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3077 }
3078
3079 impl Replica {
3080 pub fn new() -> Self {
3081 std::default::Default::default()
3082 }
3083
3084 /// Sets the value of [location][crate::model::listing::big_query_dataset_source::Replica::location].
3085 ///
3086 /// # Example
3087 /// ```ignore,no_run
3088 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3089 /// let x = Replica::new().set_location("example");
3090 /// ```
3091 pub fn set_location<T: std::convert::Into<std::string::String>>(
3092 mut self,
3093 v: T,
3094 ) -> Self {
3095 self.location = v.into();
3096 self
3097 }
3098
3099 /// Sets the value of [replica_state][crate::model::listing::big_query_dataset_source::Replica::replica_state].
3100 ///
3101 /// # Example
3102 /// ```ignore,no_run
3103 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3104 /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::replica::ReplicaState;
3105 /// let x0 = Replica::new().set_replica_state(ReplicaState::ReadyToUse);
3106 /// let x1 = Replica::new().set_replica_state(ReplicaState::Unavailable);
3107 /// ```
3108 pub fn set_replica_state<
3109 T: std::convert::Into<
3110 crate::model::listing::big_query_dataset_source::replica::ReplicaState,
3111 >,
3112 >(
3113 mut self,
3114 v: T,
3115 ) -> Self {
3116 self.replica_state = v.into();
3117 self
3118 }
3119
3120 /// Sets the value of [primary_state][crate::model::listing::big_query_dataset_source::Replica::primary_state].
3121 ///
3122 /// # Example
3123 /// ```ignore,no_run
3124 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3125 /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::replica::PrimaryState;
3126 /// let x0 = Replica::new().set_primary_state(PrimaryState::PrimaryReplica);
3127 /// ```
3128 pub fn set_primary_state<T>(mut self, v: T) -> Self
3129 where
3130 T: std::convert::Into<
3131 crate::model::listing::big_query_dataset_source::replica::PrimaryState,
3132 >,
3133 {
3134 self.primary_state = std::option::Option::Some(v.into());
3135 self
3136 }
3137
3138 /// Sets or clears the value of [primary_state][crate::model::listing::big_query_dataset_source::Replica::primary_state].
3139 ///
3140 /// # Example
3141 /// ```ignore,no_run
3142 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::Replica;
3143 /// use google_cloud_bigquery_analyticshub_v1::model::listing::big_query_dataset_source::replica::PrimaryState;
3144 /// let x0 = Replica::new().set_or_clear_primary_state(Some(PrimaryState::PrimaryReplica));
3145 /// let x_none = Replica::new().set_or_clear_primary_state(None::<PrimaryState>);
3146 /// ```
3147 pub fn set_or_clear_primary_state<T>(mut self, v: std::option::Option<T>) -> Self
3148 where
3149 T: std::convert::Into<
3150 crate::model::listing::big_query_dataset_source::replica::PrimaryState,
3151 >,
3152 {
3153 self.primary_state = v.map(|x| x.into());
3154 self
3155 }
3156 }
3157
3158 impl wkt::message::Message for Replica {
3159 fn typename() -> &'static str {
3160 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica"
3161 }
3162 }
3163
3164 /// Defines additional types related to [Replica].
3165 pub mod replica {
3166 #[allow(unused_imports)]
3167 use super::*;
3168
3169 /// Replica state of the shared dataset.
3170 ///
3171 /// # Working with unknown values
3172 ///
3173 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3174 /// additional enum variants at any time. Adding new variants is not considered
3175 /// a breaking change. Applications should write their code in anticipation of:
3176 ///
3177 /// - New values appearing in future releases of the client library, **and**
3178 /// - New values received dynamically, without application changes.
3179 ///
3180 /// Please consult the [Working with enums] section in the user guide for some
3181 /// guidelines.
3182 ///
3183 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3184 #[derive(Clone, Debug, PartialEq)]
3185 #[non_exhaustive]
3186 pub enum ReplicaState {
3187 /// Default value. This value is unused.
3188 Unspecified,
3189 /// The replica is backfilled and ready to use.
3190 ReadyToUse,
3191 /// The replica is unavailable, does not exist, or has not been
3192 /// backfilled yet.
3193 Unavailable,
3194 /// If set, the enum was initialized with an unknown value.
3195 ///
3196 /// Applications can examine the value using [ReplicaState::value] or
3197 /// [ReplicaState::name].
3198 UnknownValue(replica_state::UnknownValue),
3199 }
3200
3201 #[doc(hidden)]
3202 pub mod replica_state {
3203 #[allow(unused_imports)]
3204 use super::*;
3205 #[derive(Clone, Debug, PartialEq)]
3206 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3207 }
3208
3209 impl ReplicaState {
3210 /// Gets the enum value.
3211 ///
3212 /// Returns `None` if the enum contains an unknown value deserialized from
3213 /// the string representation of enums.
3214 pub fn value(&self) -> std::option::Option<i32> {
3215 match self {
3216 Self::Unspecified => std::option::Option::Some(0),
3217 Self::ReadyToUse => std::option::Option::Some(1),
3218 Self::Unavailable => std::option::Option::Some(2),
3219 Self::UnknownValue(u) => u.0.value(),
3220 }
3221 }
3222
3223 /// Gets the enum value as a string.
3224 ///
3225 /// Returns `None` if the enum contains an unknown value deserialized from
3226 /// the integer representation of enums.
3227 pub fn name(&self) -> std::option::Option<&str> {
3228 match self {
3229 Self::Unspecified => std::option::Option::Some("REPLICA_STATE_UNSPECIFIED"),
3230 Self::ReadyToUse => std::option::Option::Some("READY_TO_USE"),
3231 Self::Unavailable => std::option::Option::Some("UNAVAILABLE"),
3232 Self::UnknownValue(u) => u.0.name(),
3233 }
3234 }
3235 }
3236
3237 impl std::default::Default for ReplicaState {
3238 fn default() -> Self {
3239 use std::convert::From;
3240 Self::from(0)
3241 }
3242 }
3243
3244 impl std::fmt::Display for ReplicaState {
3245 fn fmt(
3246 &self,
3247 f: &mut std::fmt::Formatter<'_>,
3248 ) -> std::result::Result<(), std::fmt::Error> {
3249 wkt::internal::display_enum(f, self.name(), self.value())
3250 }
3251 }
3252
3253 impl std::convert::From<i32> for ReplicaState {
3254 fn from(value: i32) -> Self {
3255 match value {
3256 0 => Self::Unspecified,
3257 1 => Self::ReadyToUse,
3258 2 => Self::Unavailable,
3259 _ => Self::UnknownValue(replica_state::UnknownValue(
3260 wkt::internal::UnknownEnumValue::Integer(value),
3261 )),
3262 }
3263 }
3264 }
3265
3266 impl std::convert::From<&str> for ReplicaState {
3267 fn from(value: &str) -> Self {
3268 use std::string::ToString;
3269 match value {
3270 "REPLICA_STATE_UNSPECIFIED" => Self::Unspecified,
3271 "READY_TO_USE" => Self::ReadyToUse,
3272 "UNAVAILABLE" => Self::Unavailable,
3273 _ => Self::UnknownValue(replica_state::UnknownValue(
3274 wkt::internal::UnknownEnumValue::String(value.to_string()),
3275 )),
3276 }
3277 }
3278 }
3279
3280 impl serde::ser::Serialize for ReplicaState {
3281 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3282 where
3283 S: serde::Serializer,
3284 {
3285 match self {
3286 Self::Unspecified => serializer.serialize_i32(0),
3287 Self::ReadyToUse => serializer.serialize_i32(1),
3288 Self::Unavailable => serializer.serialize_i32(2),
3289 Self::UnknownValue(u) => u.0.serialize(serializer),
3290 }
3291 }
3292 }
3293
3294 impl<'de> serde::de::Deserialize<'de> for ReplicaState {
3295 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3296 where
3297 D: serde::Deserializer<'de>,
3298 {
3299 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicaState>::new(
3300 ".google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.ReplicaState"))
3301 }
3302 }
3303
3304 /// Primary state of the replica. Set only for the primary replica.
3305 ///
3306 /// # Working with unknown values
3307 ///
3308 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3309 /// additional enum variants at any time. Adding new variants is not considered
3310 /// a breaking change. Applications should write their code in anticipation of:
3311 ///
3312 /// - New values appearing in future releases of the client library, **and**
3313 /// - New values received dynamically, without application changes.
3314 ///
3315 /// Please consult the [Working with enums] section in the user guide for some
3316 /// guidelines.
3317 ///
3318 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3319 #[derive(Clone, Debug, PartialEq)]
3320 #[non_exhaustive]
3321 pub enum PrimaryState {
3322 /// Default value. This value is unused.
3323 Unspecified,
3324 /// The replica is the primary replica.
3325 PrimaryReplica,
3326 /// If set, the enum was initialized with an unknown value.
3327 ///
3328 /// Applications can examine the value using [PrimaryState::value] or
3329 /// [PrimaryState::name].
3330 UnknownValue(primary_state::UnknownValue),
3331 }
3332
3333 #[doc(hidden)]
3334 pub mod primary_state {
3335 #[allow(unused_imports)]
3336 use super::*;
3337 #[derive(Clone, Debug, PartialEq)]
3338 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3339 }
3340
3341 impl PrimaryState {
3342 /// Gets the enum value.
3343 ///
3344 /// Returns `None` if the enum contains an unknown value deserialized from
3345 /// the string representation of enums.
3346 pub fn value(&self) -> std::option::Option<i32> {
3347 match self {
3348 Self::Unspecified => std::option::Option::Some(0),
3349 Self::PrimaryReplica => std::option::Option::Some(1),
3350 Self::UnknownValue(u) => u.0.value(),
3351 }
3352 }
3353
3354 /// Gets the enum value as a string.
3355 ///
3356 /// Returns `None` if the enum contains an unknown value deserialized from
3357 /// the integer representation of enums.
3358 pub fn name(&self) -> std::option::Option<&str> {
3359 match self {
3360 Self::Unspecified => std::option::Option::Some("PRIMARY_STATE_UNSPECIFIED"),
3361 Self::PrimaryReplica => std::option::Option::Some("PRIMARY_REPLICA"),
3362 Self::UnknownValue(u) => u.0.name(),
3363 }
3364 }
3365 }
3366
3367 impl std::default::Default for PrimaryState {
3368 fn default() -> Self {
3369 use std::convert::From;
3370 Self::from(0)
3371 }
3372 }
3373
3374 impl std::fmt::Display for PrimaryState {
3375 fn fmt(
3376 &self,
3377 f: &mut std::fmt::Formatter<'_>,
3378 ) -> std::result::Result<(), std::fmt::Error> {
3379 wkt::internal::display_enum(f, self.name(), self.value())
3380 }
3381 }
3382
3383 impl std::convert::From<i32> for PrimaryState {
3384 fn from(value: i32) -> Self {
3385 match value {
3386 0 => Self::Unspecified,
3387 1 => Self::PrimaryReplica,
3388 _ => Self::UnknownValue(primary_state::UnknownValue(
3389 wkt::internal::UnknownEnumValue::Integer(value),
3390 )),
3391 }
3392 }
3393 }
3394
3395 impl std::convert::From<&str> for PrimaryState {
3396 fn from(value: &str) -> Self {
3397 use std::string::ToString;
3398 match value {
3399 "PRIMARY_STATE_UNSPECIFIED" => Self::Unspecified,
3400 "PRIMARY_REPLICA" => Self::PrimaryReplica,
3401 _ => Self::UnknownValue(primary_state::UnknownValue(
3402 wkt::internal::UnknownEnumValue::String(value.to_string()),
3403 )),
3404 }
3405 }
3406 }
3407
3408 impl serde::ser::Serialize for PrimaryState {
3409 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3410 where
3411 S: serde::Serializer,
3412 {
3413 match self {
3414 Self::Unspecified => serializer.serialize_i32(0),
3415 Self::PrimaryReplica => serializer.serialize_i32(1),
3416 Self::UnknownValue(u) => u.0.serialize(serializer),
3417 }
3418 }
3419 }
3420
3421 impl<'de> serde::de::Deserialize<'de> for PrimaryState {
3422 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3423 where
3424 D: serde::Deserializer<'de>,
3425 {
3426 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PrimaryState>::new(
3427 ".google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.PrimaryState"))
3428 }
3429 }
3430 }
3431 }
3432
3433 /// Pub/Sub topic source.
3434 #[derive(Clone, Default, PartialEq)]
3435 #[non_exhaustive]
3436 pub struct PubSubTopicSource {
3437 /// Required. Resource name of the Pub/Sub topic source for this listing.
3438 /// e.g. projects/myproject/topics/topicId
3439 pub topic: std::string::String,
3440
3441 /// Optional. Region hint on where the data might be published. Data affinity
3442 /// regions are modifiable. See <https://cloud.google.com/about/locations> for
3443 /// full listing of possible Cloud regions.
3444 pub data_affinity_regions: std::vec::Vec<std::string::String>,
3445
3446 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3447 }
3448
3449 impl PubSubTopicSource {
3450 pub fn new() -> Self {
3451 std::default::Default::default()
3452 }
3453
3454 /// Sets the value of [topic][crate::model::listing::PubSubTopicSource::topic].
3455 ///
3456 /// # Example
3457 /// ```ignore,no_run
3458 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::PubSubTopicSource;
3459 /// let x = PubSubTopicSource::new().set_topic("example");
3460 /// ```
3461 pub fn set_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3462 self.topic = v.into();
3463 self
3464 }
3465
3466 /// Sets the value of [data_affinity_regions][crate::model::listing::PubSubTopicSource::data_affinity_regions].
3467 ///
3468 /// # Example
3469 /// ```ignore,no_run
3470 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::PubSubTopicSource;
3471 /// let x = PubSubTopicSource::new().set_data_affinity_regions(["a", "b", "c"]);
3472 /// ```
3473 pub fn set_data_affinity_regions<T, V>(mut self, v: T) -> Self
3474 where
3475 T: std::iter::IntoIterator<Item = V>,
3476 V: std::convert::Into<std::string::String>,
3477 {
3478 use std::iter::Iterator;
3479 self.data_affinity_regions = v.into_iter().map(|i| i.into()).collect();
3480 self
3481 }
3482 }
3483
3484 impl wkt::message::Message for PubSubTopicSource {
3485 fn typename() -> &'static str {
3486 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.PubSubTopicSource"
3487 }
3488 }
3489
3490 /// Restricted export config, used to configure restricted export on linked
3491 /// dataset.
3492 #[derive(Clone, Default, PartialEq)]
3493 #[non_exhaustive]
3494 pub struct RestrictedExportConfig {
3495 /// Optional. If true, enable restricted export.
3496 pub enabled: bool,
3497
3498 /// Output only. If true, restrict direct table access(read
3499 /// api/tabledata.list) on linked table.
3500 pub restrict_direct_table_access: bool,
3501
3502 /// Optional. If true, restrict export of query result derived from
3503 /// restricted linked dataset table.
3504 pub restrict_query_result: bool,
3505
3506 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3507 }
3508
3509 impl RestrictedExportConfig {
3510 pub fn new() -> Self {
3511 std::default::Default::default()
3512 }
3513
3514 /// Sets the value of [enabled][crate::model::listing::RestrictedExportConfig::enabled].
3515 ///
3516 /// # Example
3517 /// ```ignore,no_run
3518 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
3519 /// let x = RestrictedExportConfig::new().set_enabled(true);
3520 /// ```
3521 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3522 self.enabled = v.into();
3523 self
3524 }
3525
3526 /// Sets the value of [restrict_direct_table_access][crate::model::listing::RestrictedExportConfig::restrict_direct_table_access].
3527 ///
3528 /// # Example
3529 /// ```ignore,no_run
3530 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
3531 /// let x = RestrictedExportConfig::new().set_restrict_direct_table_access(true);
3532 /// ```
3533 pub fn set_restrict_direct_table_access<T: std::convert::Into<bool>>(
3534 mut self,
3535 v: T,
3536 ) -> Self {
3537 self.restrict_direct_table_access = v.into();
3538 self
3539 }
3540
3541 /// Sets the value of [restrict_query_result][crate::model::listing::RestrictedExportConfig::restrict_query_result].
3542 ///
3543 /// # Example
3544 /// ```ignore,no_run
3545 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::RestrictedExportConfig;
3546 /// let x = RestrictedExportConfig::new().set_restrict_query_result(true);
3547 /// ```
3548 pub fn set_restrict_query_result<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3549 self.restrict_query_result = v.into();
3550 self
3551 }
3552 }
3553
3554 impl wkt::message::Message for RestrictedExportConfig {
3555 fn typename() -> &'static str {
3556 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.RestrictedExportConfig"
3557 }
3558 }
3559
3560 /// Commercial info contains the information about the commercial data products
3561 /// associated with the listing.
3562 #[derive(Clone, Default, PartialEq)]
3563 #[non_exhaustive]
3564 pub struct CommercialInfo {
3565 /// Output only. Details of the Marketplace Data Product associated with the
3566 /// Listing.
3567 pub cloud_marketplace:
3568 std::option::Option<crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo>,
3569
3570 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3571 }
3572
3573 impl CommercialInfo {
3574 pub fn new() -> Self {
3575 std::default::Default::default()
3576 }
3577
3578 /// Sets the value of [cloud_marketplace][crate::model::listing::CommercialInfo::cloud_marketplace].
3579 ///
3580 /// # Example
3581 /// ```ignore,no_run
3582 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
3583 /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3584 /// let x = CommercialInfo::new().set_cloud_marketplace(GoogleCloudMarketplaceInfo::default()/* use setters */);
3585 /// ```
3586 pub fn set_cloud_marketplace<T>(mut self, v: T) -> Self
3587 where
3588 T: std::convert::Into<
3589 crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo,
3590 >,
3591 {
3592 self.cloud_marketplace = std::option::Option::Some(v.into());
3593 self
3594 }
3595
3596 /// Sets or clears the value of [cloud_marketplace][crate::model::listing::CommercialInfo::cloud_marketplace].
3597 ///
3598 /// # Example
3599 /// ```ignore,no_run
3600 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::CommercialInfo;
3601 /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3602 /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(Some(GoogleCloudMarketplaceInfo::default()/* use setters */));
3603 /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(None::<GoogleCloudMarketplaceInfo>);
3604 /// ```
3605 pub fn set_or_clear_cloud_marketplace<T>(mut self, v: std::option::Option<T>) -> Self
3606 where
3607 T: std::convert::Into<
3608 crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo,
3609 >,
3610 {
3611 self.cloud_marketplace = v.map(|x| x.into());
3612 self
3613 }
3614 }
3615
3616 impl wkt::message::Message for CommercialInfo {
3617 fn typename() -> &'static str {
3618 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.CommercialInfo"
3619 }
3620 }
3621
3622 /// Defines additional types related to [CommercialInfo].
3623 pub mod commercial_info {
3624 #[allow(unused_imports)]
3625 use super::*;
3626
3627 /// Specifies the details of the Marketplace Data Product associated with the
3628 /// Listing.
3629 #[derive(Clone, Default, PartialEq)]
3630 #[non_exhaustive]
3631 pub struct GoogleCloudMarketplaceInfo {
3632
3633 /// Output only. Resource name of the commercial service associated with
3634 /// the Marketplace Data Product. e.g. example.com
3635 pub service: std::option::Option<std::string::String>,
3636
3637 /// Output only. Commercial state of the Marketplace Data Product.
3638 pub commercial_state: std::option::Option<crate::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState>,
3639
3640 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3641 }
3642
3643 impl GoogleCloudMarketplaceInfo {
3644 pub fn new() -> Self {
3645 std::default::Default::default()
3646 }
3647
3648 /// Sets the value of [service][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::service].
3649 ///
3650 /// # Example
3651 /// ```ignore,no_run
3652 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3653 /// let x = GoogleCloudMarketplaceInfo::new().set_service("example");
3654 /// ```
3655 pub fn set_service<T>(mut self, v: T) -> Self
3656 where
3657 T: std::convert::Into<std::string::String>,
3658 {
3659 self.service = std::option::Option::Some(v.into());
3660 self
3661 }
3662
3663 /// Sets or clears the value of [service][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::service].
3664 ///
3665 /// # Example
3666 /// ```ignore,no_run
3667 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3668 /// let x = GoogleCloudMarketplaceInfo::new().set_or_clear_service(Some("example"));
3669 /// let x = GoogleCloudMarketplaceInfo::new().set_or_clear_service(None::<String>);
3670 /// ```
3671 pub fn set_or_clear_service<T>(mut self, v: std::option::Option<T>) -> Self
3672 where
3673 T: std::convert::Into<std::string::String>,
3674 {
3675 self.service = v.map(|x| x.into());
3676 self
3677 }
3678
3679 /// Sets the value of [commercial_state][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::commercial_state].
3680 ///
3681 /// # Example
3682 /// ```ignore,no_run
3683 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3684 /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState;
3685 /// let x0 = GoogleCloudMarketplaceInfo::new().set_commercial_state(CommercialState::Onboarding);
3686 /// let x1 = GoogleCloudMarketplaceInfo::new().set_commercial_state(CommercialState::Active);
3687 /// ```
3688 pub fn set_commercial_state<T>(mut self, v: T) -> Self
3689 where T: std::convert::Into<crate::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState>
3690 {
3691 self.commercial_state = std::option::Option::Some(v.into());
3692 self
3693 }
3694
3695 /// Sets or clears the value of [commercial_state][crate::model::listing::commercial_info::GoogleCloudMarketplaceInfo::commercial_state].
3696 ///
3697 /// # Example
3698 /// ```ignore,no_run
3699 /// # use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::GoogleCloudMarketplaceInfo;
3700 /// use google_cloud_bigquery_analyticshub_v1::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState;
3701 /// let x0 = GoogleCloudMarketplaceInfo::new().set_or_clear_commercial_state(Some(CommercialState::Onboarding));
3702 /// let x1 = GoogleCloudMarketplaceInfo::new().set_or_clear_commercial_state(Some(CommercialState::Active));
3703 /// let x_none = GoogleCloudMarketplaceInfo::new().set_or_clear_commercial_state(None::<CommercialState>);
3704 /// ```
3705 pub fn set_or_clear_commercial_state<T>(mut self, v: std::option::Option<T>) -> Self
3706 where T: std::convert::Into<crate::model::listing::commercial_info::google_cloud_marketplace_info::CommercialState>
3707 {
3708 self.commercial_state = v.map(|x| x.into());
3709 self
3710 }
3711 }
3712
3713 impl wkt::message::Message for GoogleCloudMarketplaceInfo {
3714 fn typename() -> &'static str {
3715 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Listing.CommercialInfo.GoogleCloudMarketplaceInfo"
3716 }
3717 }
3718
3719 /// Defines additional types related to [GoogleCloudMarketplaceInfo].
3720 pub mod google_cloud_marketplace_info {
3721 #[allow(unused_imports)]
3722 use super::*;
3723
3724 /// Indicates whether this commercial access is currently active.
3725 ///
3726 /// # Working with unknown values
3727 ///
3728 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3729 /// additional enum variants at any time. Adding new variants is not considered
3730 /// a breaking change. Applications should write their code in anticipation of:
3731 ///
3732 /// - New values appearing in future releases of the client library, **and**
3733 /// - New values received dynamically, without application changes.
3734 ///
3735 /// Please consult the [Working with enums] section in the user guide for some
3736 /// guidelines.
3737 ///
3738 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3739 #[derive(Clone, Debug, PartialEq)]
3740 #[non_exhaustive]
3741 pub enum CommercialState {
3742 /// Commercialization is incomplete and cannot be used.
3743 Unspecified,
3744 /// Commercialization has been initialized.
3745 Onboarding,
3746 /// Commercialization is complete and available for use.
3747 Active,
3748 /// If set, the enum was initialized with an unknown value.
3749 ///
3750 /// Applications can examine the value using [CommercialState::value] or
3751 /// [CommercialState::name].
3752 UnknownValue(commercial_state::UnknownValue),
3753 }
3754
3755 #[doc(hidden)]
3756 pub mod commercial_state {
3757 #[allow(unused_imports)]
3758 use super::*;
3759 #[derive(Clone, Debug, PartialEq)]
3760 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3761 }
3762
3763 impl CommercialState {
3764 /// Gets the enum value.
3765 ///
3766 /// Returns `None` if the enum contains an unknown value deserialized from
3767 /// the string representation of enums.
3768 pub fn value(&self) -> std::option::Option<i32> {
3769 match self {
3770 Self::Unspecified => std::option::Option::Some(0),
3771 Self::Onboarding => std::option::Option::Some(1),
3772 Self::Active => std::option::Option::Some(2),
3773 Self::UnknownValue(u) => u.0.value(),
3774 }
3775 }
3776
3777 /// Gets the enum value as a string.
3778 ///
3779 /// Returns `None` if the enum contains an unknown value deserialized from
3780 /// the integer representation of enums.
3781 pub fn name(&self) -> std::option::Option<&str> {
3782 match self {
3783 Self::Unspecified => {
3784 std::option::Option::Some("COMMERCIAL_STATE_UNSPECIFIED")
3785 }
3786 Self::Onboarding => std::option::Option::Some("ONBOARDING"),
3787 Self::Active => std::option::Option::Some("ACTIVE"),
3788 Self::UnknownValue(u) => u.0.name(),
3789 }
3790 }
3791 }
3792
3793 impl std::default::Default for CommercialState {
3794 fn default() -> Self {
3795 use std::convert::From;
3796 Self::from(0)
3797 }
3798 }
3799
3800 impl std::fmt::Display for CommercialState {
3801 fn fmt(
3802 &self,
3803 f: &mut std::fmt::Formatter<'_>,
3804 ) -> std::result::Result<(), std::fmt::Error> {
3805 wkt::internal::display_enum(f, self.name(), self.value())
3806 }
3807 }
3808
3809 impl std::convert::From<i32> for CommercialState {
3810 fn from(value: i32) -> Self {
3811 match value {
3812 0 => Self::Unspecified,
3813 1 => Self::Onboarding,
3814 2 => Self::Active,
3815 _ => Self::UnknownValue(commercial_state::UnknownValue(
3816 wkt::internal::UnknownEnumValue::Integer(value),
3817 )),
3818 }
3819 }
3820 }
3821
3822 impl std::convert::From<&str> for CommercialState {
3823 fn from(value: &str) -> Self {
3824 use std::string::ToString;
3825 match value {
3826 "COMMERCIAL_STATE_UNSPECIFIED" => Self::Unspecified,
3827 "ONBOARDING" => Self::Onboarding,
3828 "ACTIVE" => Self::Active,
3829 _ => Self::UnknownValue(commercial_state::UnknownValue(
3830 wkt::internal::UnknownEnumValue::String(value.to_string()),
3831 )),
3832 }
3833 }
3834 }
3835
3836 impl serde::ser::Serialize for CommercialState {
3837 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3838 where
3839 S: serde::Serializer,
3840 {
3841 match self {
3842 Self::Unspecified => serializer.serialize_i32(0),
3843 Self::Onboarding => serializer.serialize_i32(1),
3844 Self::Active => serializer.serialize_i32(2),
3845 Self::UnknownValue(u) => u.0.serialize(serializer),
3846 }
3847 }
3848 }
3849
3850 impl<'de> serde::de::Deserialize<'de> for CommercialState {
3851 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3852 where
3853 D: serde::Deserializer<'de>,
3854 {
3855 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CommercialState>::new(
3856 ".google.cloud.bigquery.analyticshub.v1.Listing.CommercialInfo.GoogleCloudMarketplaceInfo.CommercialState"))
3857 }
3858 }
3859 }
3860 }
3861
3862 /// State of the listing.
3863 ///
3864 /// # Working with unknown values
3865 ///
3866 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3867 /// additional enum variants at any time. Adding new variants is not considered
3868 /// a breaking change. Applications should write their code in anticipation of:
3869 ///
3870 /// - New values appearing in future releases of the client library, **and**
3871 /// - New values received dynamically, without application changes.
3872 ///
3873 /// Please consult the [Working with enums] section in the user guide for some
3874 /// guidelines.
3875 ///
3876 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3877 #[derive(Clone, Debug, PartialEq)]
3878 #[non_exhaustive]
3879 pub enum State {
3880 /// Default value. This value is unused.
3881 Unspecified,
3882 /// Subscribable state. Users with dataexchange.listings.subscribe permission
3883 /// can subscribe to this listing.
3884 Active,
3885 /// If set, the enum was initialized with an unknown value.
3886 ///
3887 /// Applications can examine the value using [State::value] or
3888 /// [State::name].
3889 UnknownValue(state::UnknownValue),
3890 }
3891
3892 #[doc(hidden)]
3893 pub mod state {
3894 #[allow(unused_imports)]
3895 use super::*;
3896 #[derive(Clone, Debug, PartialEq)]
3897 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3898 }
3899
3900 impl State {
3901 /// Gets the enum value.
3902 ///
3903 /// Returns `None` if the enum contains an unknown value deserialized from
3904 /// the string representation of enums.
3905 pub fn value(&self) -> std::option::Option<i32> {
3906 match self {
3907 Self::Unspecified => std::option::Option::Some(0),
3908 Self::Active => std::option::Option::Some(1),
3909 Self::UnknownValue(u) => u.0.value(),
3910 }
3911 }
3912
3913 /// Gets the enum value as a string.
3914 ///
3915 /// Returns `None` if the enum contains an unknown value deserialized from
3916 /// the integer representation of enums.
3917 pub fn name(&self) -> std::option::Option<&str> {
3918 match self {
3919 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3920 Self::Active => std::option::Option::Some("ACTIVE"),
3921 Self::UnknownValue(u) => u.0.name(),
3922 }
3923 }
3924 }
3925
3926 impl std::default::Default for State {
3927 fn default() -> Self {
3928 use std::convert::From;
3929 Self::from(0)
3930 }
3931 }
3932
3933 impl std::fmt::Display for State {
3934 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3935 wkt::internal::display_enum(f, self.name(), self.value())
3936 }
3937 }
3938
3939 impl std::convert::From<i32> for State {
3940 fn from(value: i32) -> Self {
3941 match value {
3942 0 => Self::Unspecified,
3943 1 => Self::Active,
3944 _ => Self::UnknownValue(state::UnknownValue(
3945 wkt::internal::UnknownEnumValue::Integer(value),
3946 )),
3947 }
3948 }
3949 }
3950
3951 impl std::convert::From<&str> for State {
3952 fn from(value: &str) -> Self {
3953 use std::string::ToString;
3954 match value {
3955 "STATE_UNSPECIFIED" => Self::Unspecified,
3956 "ACTIVE" => Self::Active,
3957 _ => Self::UnknownValue(state::UnknownValue(
3958 wkt::internal::UnknownEnumValue::String(value.to_string()),
3959 )),
3960 }
3961 }
3962 }
3963
3964 impl serde::ser::Serialize for State {
3965 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3966 where
3967 S: serde::Serializer,
3968 {
3969 match self {
3970 Self::Unspecified => serializer.serialize_i32(0),
3971 Self::Active => serializer.serialize_i32(1),
3972 Self::UnknownValue(u) => u.0.serialize(serializer),
3973 }
3974 }
3975 }
3976
3977 impl<'de> serde::de::Deserialize<'de> for State {
3978 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3979 where
3980 D: serde::Deserializer<'de>,
3981 {
3982 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3983 ".google.cloud.bigquery.analyticshub.v1.Listing.State",
3984 ))
3985 }
3986 }
3987
3988 /// Listing categories.
3989 ///
3990 /// # Working with unknown values
3991 ///
3992 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3993 /// additional enum variants at any time. Adding new variants is not considered
3994 /// a breaking change. Applications should write their code in anticipation of:
3995 ///
3996 /// - New values appearing in future releases of the client library, **and**
3997 /// - New values received dynamically, without application changes.
3998 ///
3999 /// Please consult the [Working with enums] section in the user guide for some
4000 /// guidelines.
4001 ///
4002 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4003 #[derive(Clone, Debug, PartialEq)]
4004 #[non_exhaustive]
4005 pub enum Category {
4006 Unspecified,
4007 Others,
4008 AdvertisingAndMarketing,
4009 Commerce,
4010 ClimateAndEnvironment,
4011 Demographics,
4012 Economics,
4013 Education,
4014 Energy,
4015 Financial,
4016 Gaming,
4017 Geospatial,
4018 HealthcareAndLifeScience,
4019 Media,
4020 PublicSector,
4021 Retail,
4022 Sports,
4023 ScienceAndResearch,
4024 TransportationAndLogistics,
4025 TravelAndTourism,
4026 GoogleEarthEngine,
4027 /// If set, the enum was initialized with an unknown value.
4028 ///
4029 /// Applications can examine the value using [Category::value] or
4030 /// [Category::name].
4031 UnknownValue(category::UnknownValue),
4032 }
4033
4034 #[doc(hidden)]
4035 pub mod category {
4036 #[allow(unused_imports)]
4037 use super::*;
4038 #[derive(Clone, Debug, PartialEq)]
4039 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4040 }
4041
4042 impl Category {
4043 /// Gets the enum value.
4044 ///
4045 /// Returns `None` if the enum contains an unknown value deserialized from
4046 /// the string representation of enums.
4047 pub fn value(&self) -> std::option::Option<i32> {
4048 match self {
4049 Self::Unspecified => std::option::Option::Some(0),
4050 Self::Others => std::option::Option::Some(1),
4051 Self::AdvertisingAndMarketing => std::option::Option::Some(2),
4052 Self::Commerce => std::option::Option::Some(3),
4053 Self::ClimateAndEnvironment => std::option::Option::Some(4),
4054 Self::Demographics => std::option::Option::Some(5),
4055 Self::Economics => std::option::Option::Some(6),
4056 Self::Education => std::option::Option::Some(7),
4057 Self::Energy => std::option::Option::Some(8),
4058 Self::Financial => std::option::Option::Some(9),
4059 Self::Gaming => std::option::Option::Some(10),
4060 Self::Geospatial => std::option::Option::Some(11),
4061 Self::HealthcareAndLifeScience => std::option::Option::Some(12),
4062 Self::Media => std::option::Option::Some(13),
4063 Self::PublicSector => std::option::Option::Some(14),
4064 Self::Retail => std::option::Option::Some(15),
4065 Self::Sports => std::option::Option::Some(16),
4066 Self::ScienceAndResearch => std::option::Option::Some(17),
4067 Self::TransportationAndLogistics => std::option::Option::Some(18),
4068 Self::TravelAndTourism => std::option::Option::Some(19),
4069 Self::GoogleEarthEngine => std::option::Option::Some(20),
4070 Self::UnknownValue(u) => u.0.value(),
4071 }
4072 }
4073
4074 /// Gets the enum value as a string.
4075 ///
4076 /// Returns `None` if the enum contains an unknown value deserialized from
4077 /// the integer representation of enums.
4078 pub fn name(&self) -> std::option::Option<&str> {
4079 match self {
4080 Self::Unspecified => std::option::Option::Some("CATEGORY_UNSPECIFIED"),
4081 Self::Others => std::option::Option::Some("CATEGORY_OTHERS"),
4082 Self::AdvertisingAndMarketing => {
4083 std::option::Option::Some("CATEGORY_ADVERTISING_AND_MARKETING")
4084 }
4085 Self::Commerce => std::option::Option::Some("CATEGORY_COMMERCE"),
4086 Self::ClimateAndEnvironment => {
4087 std::option::Option::Some("CATEGORY_CLIMATE_AND_ENVIRONMENT")
4088 }
4089 Self::Demographics => std::option::Option::Some("CATEGORY_DEMOGRAPHICS"),
4090 Self::Economics => std::option::Option::Some("CATEGORY_ECONOMICS"),
4091 Self::Education => std::option::Option::Some("CATEGORY_EDUCATION"),
4092 Self::Energy => std::option::Option::Some("CATEGORY_ENERGY"),
4093 Self::Financial => std::option::Option::Some("CATEGORY_FINANCIAL"),
4094 Self::Gaming => std::option::Option::Some("CATEGORY_GAMING"),
4095 Self::Geospatial => std::option::Option::Some("CATEGORY_GEOSPATIAL"),
4096 Self::HealthcareAndLifeScience => {
4097 std::option::Option::Some("CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE")
4098 }
4099 Self::Media => std::option::Option::Some("CATEGORY_MEDIA"),
4100 Self::PublicSector => std::option::Option::Some("CATEGORY_PUBLIC_SECTOR"),
4101 Self::Retail => std::option::Option::Some("CATEGORY_RETAIL"),
4102 Self::Sports => std::option::Option::Some("CATEGORY_SPORTS"),
4103 Self::ScienceAndResearch => {
4104 std::option::Option::Some("CATEGORY_SCIENCE_AND_RESEARCH")
4105 }
4106 Self::TransportationAndLogistics => {
4107 std::option::Option::Some("CATEGORY_TRANSPORTATION_AND_LOGISTICS")
4108 }
4109 Self::TravelAndTourism => std::option::Option::Some("CATEGORY_TRAVEL_AND_TOURISM"),
4110 Self::GoogleEarthEngine => {
4111 std::option::Option::Some("CATEGORY_GOOGLE_EARTH_ENGINE")
4112 }
4113 Self::UnknownValue(u) => u.0.name(),
4114 }
4115 }
4116 }
4117
4118 impl std::default::Default for Category {
4119 fn default() -> Self {
4120 use std::convert::From;
4121 Self::from(0)
4122 }
4123 }
4124
4125 impl std::fmt::Display for Category {
4126 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4127 wkt::internal::display_enum(f, self.name(), self.value())
4128 }
4129 }
4130
4131 impl std::convert::From<i32> for Category {
4132 fn from(value: i32) -> Self {
4133 match value {
4134 0 => Self::Unspecified,
4135 1 => Self::Others,
4136 2 => Self::AdvertisingAndMarketing,
4137 3 => Self::Commerce,
4138 4 => Self::ClimateAndEnvironment,
4139 5 => Self::Demographics,
4140 6 => Self::Economics,
4141 7 => Self::Education,
4142 8 => Self::Energy,
4143 9 => Self::Financial,
4144 10 => Self::Gaming,
4145 11 => Self::Geospatial,
4146 12 => Self::HealthcareAndLifeScience,
4147 13 => Self::Media,
4148 14 => Self::PublicSector,
4149 15 => Self::Retail,
4150 16 => Self::Sports,
4151 17 => Self::ScienceAndResearch,
4152 18 => Self::TransportationAndLogistics,
4153 19 => Self::TravelAndTourism,
4154 20 => Self::GoogleEarthEngine,
4155 _ => Self::UnknownValue(category::UnknownValue(
4156 wkt::internal::UnknownEnumValue::Integer(value),
4157 )),
4158 }
4159 }
4160 }
4161
4162 impl std::convert::From<&str> for Category {
4163 fn from(value: &str) -> Self {
4164 use std::string::ToString;
4165 match value {
4166 "CATEGORY_UNSPECIFIED" => Self::Unspecified,
4167 "CATEGORY_OTHERS" => Self::Others,
4168 "CATEGORY_ADVERTISING_AND_MARKETING" => Self::AdvertisingAndMarketing,
4169 "CATEGORY_COMMERCE" => Self::Commerce,
4170 "CATEGORY_CLIMATE_AND_ENVIRONMENT" => Self::ClimateAndEnvironment,
4171 "CATEGORY_DEMOGRAPHICS" => Self::Demographics,
4172 "CATEGORY_ECONOMICS" => Self::Economics,
4173 "CATEGORY_EDUCATION" => Self::Education,
4174 "CATEGORY_ENERGY" => Self::Energy,
4175 "CATEGORY_FINANCIAL" => Self::Financial,
4176 "CATEGORY_GAMING" => Self::Gaming,
4177 "CATEGORY_GEOSPATIAL" => Self::Geospatial,
4178 "CATEGORY_HEALTHCARE_AND_LIFE_SCIENCE" => Self::HealthcareAndLifeScience,
4179 "CATEGORY_MEDIA" => Self::Media,
4180 "CATEGORY_PUBLIC_SECTOR" => Self::PublicSector,
4181 "CATEGORY_RETAIL" => Self::Retail,
4182 "CATEGORY_SPORTS" => Self::Sports,
4183 "CATEGORY_SCIENCE_AND_RESEARCH" => Self::ScienceAndResearch,
4184 "CATEGORY_TRANSPORTATION_AND_LOGISTICS" => Self::TransportationAndLogistics,
4185 "CATEGORY_TRAVEL_AND_TOURISM" => Self::TravelAndTourism,
4186 "CATEGORY_GOOGLE_EARTH_ENGINE" => Self::GoogleEarthEngine,
4187 _ => Self::UnknownValue(category::UnknownValue(
4188 wkt::internal::UnknownEnumValue::String(value.to_string()),
4189 )),
4190 }
4191 }
4192 }
4193
4194 impl serde::ser::Serialize for Category {
4195 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4196 where
4197 S: serde::Serializer,
4198 {
4199 match self {
4200 Self::Unspecified => serializer.serialize_i32(0),
4201 Self::Others => serializer.serialize_i32(1),
4202 Self::AdvertisingAndMarketing => serializer.serialize_i32(2),
4203 Self::Commerce => serializer.serialize_i32(3),
4204 Self::ClimateAndEnvironment => serializer.serialize_i32(4),
4205 Self::Demographics => serializer.serialize_i32(5),
4206 Self::Economics => serializer.serialize_i32(6),
4207 Self::Education => serializer.serialize_i32(7),
4208 Self::Energy => serializer.serialize_i32(8),
4209 Self::Financial => serializer.serialize_i32(9),
4210 Self::Gaming => serializer.serialize_i32(10),
4211 Self::Geospatial => serializer.serialize_i32(11),
4212 Self::HealthcareAndLifeScience => serializer.serialize_i32(12),
4213 Self::Media => serializer.serialize_i32(13),
4214 Self::PublicSector => serializer.serialize_i32(14),
4215 Self::Retail => serializer.serialize_i32(15),
4216 Self::Sports => serializer.serialize_i32(16),
4217 Self::ScienceAndResearch => serializer.serialize_i32(17),
4218 Self::TransportationAndLogistics => serializer.serialize_i32(18),
4219 Self::TravelAndTourism => serializer.serialize_i32(19),
4220 Self::GoogleEarthEngine => serializer.serialize_i32(20),
4221 Self::UnknownValue(u) => u.0.serialize(serializer),
4222 }
4223 }
4224 }
4225
4226 impl<'de> serde::de::Deserialize<'de> for Category {
4227 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4228 where
4229 D: serde::Deserializer<'de>,
4230 {
4231 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Category>::new(
4232 ".google.cloud.bigquery.analyticshub.v1.Listing.Category",
4233 ))
4234 }
4235 }
4236
4237 /// Listing source.
4238 #[derive(Clone, Debug, PartialEq)]
4239 #[non_exhaustive]
4240 pub enum Source {
4241 /// Shared dataset i.e. BigQuery dataset source.
4242 BigqueryDataset(std::boxed::Box<crate::model::listing::BigQueryDatasetSource>),
4243 /// Pub/Sub topic source.
4244 PubsubTopic(std::boxed::Box<crate::model::listing::PubSubTopicSource>),
4245 }
4246}
4247
4248/// Stored procedure configuration, used to configure stored procedure sharing
4249/// on linked dataset.
4250#[derive(Clone, Default, PartialEq)]
4251#[non_exhaustive]
4252pub struct StoredProcedureConfig {
4253 /// Optional. If true, enable sharing of stored procedure.
4254 pub enabled: bool,
4255
4256 /// Output only. Types of stored procedure supported to share.
4257 pub allowed_stored_procedure_types:
4258 std::vec::Vec<crate::model::stored_procedure_config::StoredProcedureType>,
4259
4260 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4261}
4262
4263impl StoredProcedureConfig {
4264 pub fn new() -> Self {
4265 std::default::Default::default()
4266 }
4267
4268 /// Sets the value of [enabled][crate::model::StoredProcedureConfig::enabled].
4269 ///
4270 /// # Example
4271 /// ```ignore,no_run
4272 /// # use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
4273 /// let x = StoredProcedureConfig::new().set_enabled(true);
4274 /// ```
4275 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4276 self.enabled = v.into();
4277 self
4278 }
4279
4280 /// Sets the value of [allowed_stored_procedure_types][crate::model::StoredProcedureConfig::allowed_stored_procedure_types].
4281 ///
4282 /// # Example
4283 /// ```ignore,no_run
4284 /// # use google_cloud_bigquery_analyticshub_v1::model::StoredProcedureConfig;
4285 /// use google_cloud_bigquery_analyticshub_v1::model::stored_procedure_config::StoredProcedureType;
4286 /// let x = StoredProcedureConfig::new().set_allowed_stored_procedure_types([
4287 /// StoredProcedureType::SqlProcedure,
4288 /// ]);
4289 /// ```
4290 pub fn set_allowed_stored_procedure_types<T, V>(mut self, v: T) -> Self
4291 where
4292 T: std::iter::IntoIterator<Item = V>,
4293 V: std::convert::Into<crate::model::stored_procedure_config::StoredProcedureType>,
4294 {
4295 use std::iter::Iterator;
4296 self.allowed_stored_procedure_types = v.into_iter().map(|i| i.into()).collect();
4297 self
4298 }
4299}
4300
4301impl wkt::message::Message for StoredProcedureConfig {
4302 fn typename() -> &'static str {
4303 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.StoredProcedureConfig"
4304 }
4305}
4306
4307/// Defines additional types related to [StoredProcedureConfig].
4308pub mod stored_procedure_config {
4309 #[allow(unused_imports)]
4310 use super::*;
4311
4312 /// Enum to specify the type of stored procedure to share.
4313 ///
4314 /// # Working with unknown values
4315 ///
4316 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4317 /// additional enum variants at any time. Adding new variants is not considered
4318 /// a breaking change. Applications should write their code in anticipation of:
4319 ///
4320 /// - New values appearing in future releases of the client library, **and**
4321 /// - New values received dynamically, without application changes.
4322 ///
4323 /// Please consult the [Working with enums] section in the user guide for some
4324 /// guidelines.
4325 ///
4326 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4327 #[derive(Clone, Debug, PartialEq)]
4328 #[non_exhaustive]
4329 pub enum StoredProcedureType {
4330 /// Default value. This value is unused.
4331 Unspecified,
4332 /// SQL stored procedure.
4333 SqlProcedure,
4334 /// If set, the enum was initialized with an unknown value.
4335 ///
4336 /// Applications can examine the value using [StoredProcedureType::value] or
4337 /// [StoredProcedureType::name].
4338 UnknownValue(stored_procedure_type::UnknownValue),
4339 }
4340
4341 #[doc(hidden)]
4342 pub mod stored_procedure_type {
4343 #[allow(unused_imports)]
4344 use super::*;
4345 #[derive(Clone, Debug, PartialEq)]
4346 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4347 }
4348
4349 impl StoredProcedureType {
4350 /// Gets the enum value.
4351 ///
4352 /// Returns `None` if the enum contains an unknown value deserialized from
4353 /// the string representation of enums.
4354 pub fn value(&self) -> std::option::Option<i32> {
4355 match self {
4356 Self::Unspecified => std::option::Option::Some(0),
4357 Self::SqlProcedure => std::option::Option::Some(1),
4358 Self::UnknownValue(u) => u.0.value(),
4359 }
4360 }
4361
4362 /// Gets the enum value as a string.
4363 ///
4364 /// Returns `None` if the enum contains an unknown value deserialized from
4365 /// the integer representation of enums.
4366 pub fn name(&self) -> std::option::Option<&str> {
4367 match self {
4368 Self::Unspecified => std::option::Option::Some("STORED_PROCEDURE_TYPE_UNSPECIFIED"),
4369 Self::SqlProcedure => std::option::Option::Some("SQL_PROCEDURE"),
4370 Self::UnknownValue(u) => u.0.name(),
4371 }
4372 }
4373 }
4374
4375 impl std::default::Default for StoredProcedureType {
4376 fn default() -> Self {
4377 use std::convert::From;
4378 Self::from(0)
4379 }
4380 }
4381
4382 impl std::fmt::Display for StoredProcedureType {
4383 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4384 wkt::internal::display_enum(f, self.name(), self.value())
4385 }
4386 }
4387
4388 impl std::convert::From<i32> for StoredProcedureType {
4389 fn from(value: i32) -> Self {
4390 match value {
4391 0 => Self::Unspecified,
4392 1 => Self::SqlProcedure,
4393 _ => Self::UnknownValue(stored_procedure_type::UnknownValue(
4394 wkt::internal::UnknownEnumValue::Integer(value),
4395 )),
4396 }
4397 }
4398 }
4399
4400 impl std::convert::From<&str> for StoredProcedureType {
4401 fn from(value: &str) -> Self {
4402 use std::string::ToString;
4403 match value {
4404 "STORED_PROCEDURE_TYPE_UNSPECIFIED" => Self::Unspecified,
4405 "SQL_PROCEDURE" => Self::SqlProcedure,
4406 _ => Self::UnknownValue(stored_procedure_type::UnknownValue(
4407 wkt::internal::UnknownEnumValue::String(value.to_string()),
4408 )),
4409 }
4410 }
4411 }
4412
4413 impl serde::ser::Serialize for StoredProcedureType {
4414 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4415 where
4416 S: serde::Serializer,
4417 {
4418 match self {
4419 Self::Unspecified => serializer.serialize_i32(0),
4420 Self::SqlProcedure => serializer.serialize_i32(1),
4421 Self::UnknownValue(u) => u.0.serialize(serializer),
4422 }
4423 }
4424 }
4425
4426 impl<'de> serde::de::Deserialize<'de> for StoredProcedureType {
4427 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4428 where
4429 D: serde::Deserializer<'de>,
4430 {
4431 deserializer.deserialize_any(wkt::internal::EnumVisitor::<StoredProcedureType>::new(
4432 ".google.cloud.bigquery.analyticshub.v1.StoredProcedureConfig.StoredProcedureType",
4433 ))
4434 }
4435 }
4436}
4437
4438/// A subscription represents a subscribers' access to a particular set of
4439/// published data. It contains references to associated listings,
4440/// data exchanges, and linked datasets.
4441#[derive(Clone, Default, PartialEq)]
4442#[non_exhaustive]
4443pub struct Subscription {
4444 /// Output only. The resource name of the subscription.
4445 /// e.g. `projects/myproject/locations/us/subscriptions/123`.
4446 pub name: std::string::String,
4447
4448 /// Output only. Timestamp when the subscription was created.
4449 pub creation_time: std::option::Option<wkt::Timestamp>,
4450
4451 /// Output only. Timestamp when the subscription was last modified.
4452 pub last_modify_time: std::option::Option<wkt::Timestamp>,
4453
4454 /// Output only. Organization of the project this subscription belongs to.
4455 pub organization_id: std::string::String,
4456
4457 /// Output only. Display name of the project of this subscription.
4458 pub organization_display_name: std::string::String,
4459
4460 /// Output only. Current state of the subscription.
4461 pub state: crate::model::subscription::State,
4462
4463 /// Output only. Map of listing resource names to associated linked resource,
4464 /// e.g. projects/123/locations/us/dataExchanges/456/listings/789
4465 /// ->
4466 /// projects/123/datasets/my_dataset
4467 ///
4468 /// For listing-level subscriptions, this is a map of size 1.
4469 /// Only contains values if state == STATE_ACTIVE.
4470 pub linked_dataset_map:
4471 std::collections::HashMap<std::string::String, crate::model::subscription::LinkedResource>,
4472
4473 /// Output only. Email of the subscriber.
4474 pub subscriber_contact: std::string::String,
4475
4476 /// Output only. Linked resources created in the subscription. Only contains
4477 /// values if state = STATE_ACTIVE.
4478 pub linked_resources: std::vec::Vec<crate::model::subscription::LinkedResource>,
4479
4480 /// Output only. Listing shared asset type.
4481 pub resource_type: crate::model::SharedResourceType,
4482
4483 /// Output only. This is set if this is a commercial subscription i.e. if this
4484 /// subscription was created from subscribing to a commercial listing.
4485 pub commercial_info: std::option::Option<crate::model::subscription::CommercialInfo>,
4486
4487 /// Output only. By default, false.
4488 /// If true, the Subscriber agreed to the email sharing mandate
4489 /// that is enabled for DataExchange/Listing.
4490 pub log_linked_dataset_query_user_email: std::option::Option<bool>,
4491
4492 /// Optional. BigQuery destination dataset to create for the subscriber.
4493 pub destination_dataset: std::option::Option<crate::model::DestinationDataset>,
4494
4495 pub resource_name: std::option::Option<crate::model::subscription::ResourceName>,
4496
4497 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4498}
4499
4500impl Subscription {
4501 pub fn new() -> Self {
4502 std::default::Default::default()
4503 }
4504
4505 /// Sets the value of [name][crate::model::Subscription::name].
4506 ///
4507 /// # Example
4508 /// ```ignore,no_run
4509 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4510 /// let x = Subscription::new().set_name("example");
4511 /// ```
4512 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4513 self.name = v.into();
4514 self
4515 }
4516
4517 /// Sets the value of [creation_time][crate::model::Subscription::creation_time].
4518 ///
4519 /// # Example
4520 /// ```ignore,no_run
4521 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4522 /// use wkt::Timestamp;
4523 /// let x = Subscription::new().set_creation_time(Timestamp::default()/* use setters */);
4524 /// ```
4525 pub fn set_creation_time<T>(mut self, v: T) -> Self
4526 where
4527 T: std::convert::Into<wkt::Timestamp>,
4528 {
4529 self.creation_time = std::option::Option::Some(v.into());
4530 self
4531 }
4532
4533 /// Sets or clears the value of [creation_time][crate::model::Subscription::creation_time].
4534 ///
4535 /// # Example
4536 /// ```ignore,no_run
4537 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4538 /// use wkt::Timestamp;
4539 /// let x = Subscription::new().set_or_clear_creation_time(Some(Timestamp::default()/* use setters */));
4540 /// let x = Subscription::new().set_or_clear_creation_time(None::<Timestamp>);
4541 /// ```
4542 pub fn set_or_clear_creation_time<T>(mut self, v: std::option::Option<T>) -> Self
4543 where
4544 T: std::convert::Into<wkt::Timestamp>,
4545 {
4546 self.creation_time = v.map(|x| x.into());
4547 self
4548 }
4549
4550 /// Sets the value of [last_modify_time][crate::model::Subscription::last_modify_time].
4551 ///
4552 /// # Example
4553 /// ```ignore,no_run
4554 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4555 /// use wkt::Timestamp;
4556 /// let x = Subscription::new().set_last_modify_time(Timestamp::default()/* use setters */);
4557 /// ```
4558 pub fn set_last_modify_time<T>(mut self, v: T) -> Self
4559 where
4560 T: std::convert::Into<wkt::Timestamp>,
4561 {
4562 self.last_modify_time = std::option::Option::Some(v.into());
4563 self
4564 }
4565
4566 /// Sets or clears the value of [last_modify_time][crate::model::Subscription::last_modify_time].
4567 ///
4568 /// # Example
4569 /// ```ignore,no_run
4570 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4571 /// use wkt::Timestamp;
4572 /// let x = Subscription::new().set_or_clear_last_modify_time(Some(Timestamp::default()/* use setters */));
4573 /// let x = Subscription::new().set_or_clear_last_modify_time(None::<Timestamp>);
4574 /// ```
4575 pub fn set_or_clear_last_modify_time<T>(mut self, v: std::option::Option<T>) -> Self
4576 where
4577 T: std::convert::Into<wkt::Timestamp>,
4578 {
4579 self.last_modify_time = v.map(|x| x.into());
4580 self
4581 }
4582
4583 /// Sets the value of [organization_id][crate::model::Subscription::organization_id].
4584 ///
4585 /// # Example
4586 /// ```ignore,no_run
4587 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4588 /// let x = Subscription::new().set_organization_id("example");
4589 /// ```
4590 pub fn set_organization_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4591 self.organization_id = v.into();
4592 self
4593 }
4594
4595 /// Sets the value of [organization_display_name][crate::model::Subscription::organization_display_name].
4596 ///
4597 /// # Example
4598 /// ```ignore,no_run
4599 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4600 /// let x = Subscription::new().set_organization_display_name("example");
4601 /// ```
4602 pub fn set_organization_display_name<T: std::convert::Into<std::string::String>>(
4603 mut self,
4604 v: T,
4605 ) -> Self {
4606 self.organization_display_name = v.into();
4607 self
4608 }
4609
4610 /// Sets the value of [state][crate::model::Subscription::state].
4611 ///
4612 /// # Example
4613 /// ```ignore,no_run
4614 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4615 /// use google_cloud_bigquery_analyticshub_v1::model::subscription::State;
4616 /// let x0 = Subscription::new().set_state(State::Active);
4617 /// let x1 = Subscription::new().set_state(State::Stale);
4618 /// let x2 = Subscription::new().set_state(State::Inactive);
4619 /// ```
4620 pub fn set_state<T: std::convert::Into<crate::model::subscription::State>>(
4621 mut self,
4622 v: T,
4623 ) -> Self {
4624 self.state = v.into();
4625 self
4626 }
4627
4628 /// Sets the value of [linked_dataset_map][crate::model::Subscription::linked_dataset_map].
4629 ///
4630 /// # Example
4631 /// ```ignore,no_run
4632 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4633 /// use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
4634 /// let x = Subscription::new().set_linked_dataset_map([
4635 /// ("key0", LinkedResource::default()/* use setters */),
4636 /// ("key1", LinkedResource::default()/* use (different) setters */),
4637 /// ]);
4638 /// ```
4639 pub fn set_linked_dataset_map<T, K, V>(mut self, v: T) -> Self
4640 where
4641 T: std::iter::IntoIterator<Item = (K, V)>,
4642 K: std::convert::Into<std::string::String>,
4643 V: std::convert::Into<crate::model::subscription::LinkedResource>,
4644 {
4645 use std::iter::Iterator;
4646 self.linked_dataset_map = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4647 self
4648 }
4649
4650 /// Sets the value of [subscriber_contact][crate::model::Subscription::subscriber_contact].
4651 ///
4652 /// # Example
4653 /// ```ignore,no_run
4654 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4655 /// let x = Subscription::new().set_subscriber_contact("example");
4656 /// ```
4657 pub fn set_subscriber_contact<T: std::convert::Into<std::string::String>>(
4658 mut self,
4659 v: T,
4660 ) -> Self {
4661 self.subscriber_contact = v.into();
4662 self
4663 }
4664
4665 /// Sets the value of [linked_resources][crate::model::Subscription::linked_resources].
4666 ///
4667 /// # Example
4668 /// ```ignore,no_run
4669 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4670 /// use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
4671 /// let x = Subscription::new()
4672 /// .set_linked_resources([
4673 /// LinkedResource::default()/* use setters */,
4674 /// LinkedResource::default()/* use (different) setters */,
4675 /// ]);
4676 /// ```
4677 pub fn set_linked_resources<T, V>(mut self, v: T) -> Self
4678 where
4679 T: std::iter::IntoIterator<Item = V>,
4680 V: std::convert::Into<crate::model::subscription::LinkedResource>,
4681 {
4682 use std::iter::Iterator;
4683 self.linked_resources = v.into_iter().map(|i| i.into()).collect();
4684 self
4685 }
4686
4687 /// Sets the value of [resource_type][crate::model::Subscription::resource_type].
4688 ///
4689 /// # Example
4690 /// ```ignore,no_run
4691 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4692 /// use google_cloud_bigquery_analyticshub_v1::model::SharedResourceType;
4693 /// let x0 = Subscription::new().set_resource_type(SharedResourceType::BigqueryDataset);
4694 /// let x1 = Subscription::new().set_resource_type(SharedResourceType::PubsubTopic);
4695 /// ```
4696 pub fn set_resource_type<T: std::convert::Into<crate::model::SharedResourceType>>(
4697 mut self,
4698 v: T,
4699 ) -> Self {
4700 self.resource_type = v.into();
4701 self
4702 }
4703
4704 /// Sets the value of [commercial_info][crate::model::Subscription::commercial_info].
4705 ///
4706 /// # Example
4707 /// ```ignore,no_run
4708 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4709 /// use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
4710 /// let x = Subscription::new().set_commercial_info(CommercialInfo::default()/* use setters */);
4711 /// ```
4712 pub fn set_commercial_info<T>(mut self, v: T) -> Self
4713 where
4714 T: std::convert::Into<crate::model::subscription::CommercialInfo>,
4715 {
4716 self.commercial_info = std::option::Option::Some(v.into());
4717 self
4718 }
4719
4720 /// Sets or clears the value of [commercial_info][crate::model::Subscription::commercial_info].
4721 ///
4722 /// # Example
4723 /// ```ignore,no_run
4724 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4725 /// use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
4726 /// let x = Subscription::new().set_or_clear_commercial_info(Some(CommercialInfo::default()/* use setters */));
4727 /// let x = Subscription::new().set_or_clear_commercial_info(None::<CommercialInfo>);
4728 /// ```
4729 pub fn set_or_clear_commercial_info<T>(mut self, v: std::option::Option<T>) -> Self
4730 where
4731 T: std::convert::Into<crate::model::subscription::CommercialInfo>,
4732 {
4733 self.commercial_info = v.map(|x| x.into());
4734 self
4735 }
4736
4737 /// Sets the value of [log_linked_dataset_query_user_email][crate::model::Subscription::log_linked_dataset_query_user_email].
4738 ///
4739 /// # Example
4740 /// ```ignore,no_run
4741 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4742 /// let x = Subscription::new().set_log_linked_dataset_query_user_email(true);
4743 /// ```
4744 pub fn set_log_linked_dataset_query_user_email<T>(mut self, v: T) -> Self
4745 where
4746 T: std::convert::Into<bool>,
4747 {
4748 self.log_linked_dataset_query_user_email = std::option::Option::Some(v.into());
4749 self
4750 }
4751
4752 /// Sets or clears the value of [log_linked_dataset_query_user_email][crate::model::Subscription::log_linked_dataset_query_user_email].
4753 ///
4754 /// # Example
4755 /// ```ignore,no_run
4756 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4757 /// let x = Subscription::new().set_or_clear_log_linked_dataset_query_user_email(Some(false));
4758 /// let x = Subscription::new().set_or_clear_log_linked_dataset_query_user_email(None::<bool>);
4759 /// ```
4760 pub fn set_or_clear_log_linked_dataset_query_user_email<T>(
4761 mut self,
4762 v: std::option::Option<T>,
4763 ) -> Self
4764 where
4765 T: std::convert::Into<bool>,
4766 {
4767 self.log_linked_dataset_query_user_email = v.map(|x| x.into());
4768 self
4769 }
4770
4771 /// Sets the value of [destination_dataset][crate::model::Subscription::destination_dataset].
4772 ///
4773 /// # Example
4774 /// ```ignore,no_run
4775 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4776 /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
4777 /// let x = Subscription::new().set_destination_dataset(DestinationDataset::default()/* use setters */);
4778 /// ```
4779 pub fn set_destination_dataset<T>(mut self, v: T) -> Self
4780 where
4781 T: std::convert::Into<crate::model::DestinationDataset>,
4782 {
4783 self.destination_dataset = std::option::Option::Some(v.into());
4784 self
4785 }
4786
4787 /// Sets or clears the value of [destination_dataset][crate::model::Subscription::destination_dataset].
4788 ///
4789 /// # Example
4790 /// ```ignore,no_run
4791 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4792 /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
4793 /// let x = Subscription::new().set_or_clear_destination_dataset(Some(DestinationDataset::default()/* use setters */));
4794 /// let x = Subscription::new().set_or_clear_destination_dataset(None::<DestinationDataset>);
4795 /// ```
4796 pub fn set_or_clear_destination_dataset<T>(mut self, v: std::option::Option<T>) -> Self
4797 where
4798 T: std::convert::Into<crate::model::DestinationDataset>,
4799 {
4800 self.destination_dataset = v.map(|x| x.into());
4801 self
4802 }
4803
4804 /// Sets the value of [resource_name][crate::model::Subscription::resource_name].
4805 ///
4806 /// Note that all the setters affecting `resource_name` are mutually
4807 /// exclusive.
4808 ///
4809 /// # Example
4810 /// ```ignore,no_run
4811 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4812 /// use google_cloud_bigquery_analyticshub_v1::model::subscription::ResourceName;
4813 /// let x = Subscription::new().set_resource_name(Some(ResourceName::Listing("example".to_string())));
4814 /// ```
4815 pub fn set_resource_name<
4816 T: std::convert::Into<std::option::Option<crate::model::subscription::ResourceName>>,
4817 >(
4818 mut self,
4819 v: T,
4820 ) -> Self {
4821 self.resource_name = v.into();
4822 self
4823 }
4824
4825 /// The value of [resource_name][crate::model::Subscription::resource_name]
4826 /// if it holds a `Listing`, `None` if the field is not set or
4827 /// holds a different branch.
4828 pub fn listing(&self) -> std::option::Option<&std::string::String> {
4829 #[allow(unreachable_patterns)]
4830 self.resource_name.as_ref().and_then(|v| match v {
4831 crate::model::subscription::ResourceName::Listing(v) => std::option::Option::Some(v),
4832 _ => std::option::Option::None,
4833 })
4834 }
4835
4836 /// Sets the value of [resource_name][crate::model::Subscription::resource_name]
4837 /// to hold a `Listing`.
4838 ///
4839 /// Note that all the setters affecting `resource_name` are
4840 /// mutually exclusive.
4841 ///
4842 /// # Example
4843 /// ```ignore,no_run
4844 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4845 /// let x = Subscription::new().set_listing("example");
4846 /// assert!(x.listing().is_some());
4847 /// assert!(x.data_exchange().is_none());
4848 /// ```
4849 pub fn set_listing<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4850 self.resource_name =
4851 std::option::Option::Some(crate::model::subscription::ResourceName::Listing(v.into()));
4852 self
4853 }
4854
4855 /// The value of [resource_name][crate::model::Subscription::resource_name]
4856 /// if it holds a `DataExchange`, `None` if the field is not set or
4857 /// holds a different branch.
4858 pub fn data_exchange(&self) -> std::option::Option<&std::string::String> {
4859 #[allow(unreachable_patterns)]
4860 self.resource_name.as_ref().and_then(|v| match v {
4861 crate::model::subscription::ResourceName::DataExchange(v) => {
4862 std::option::Option::Some(v)
4863 }
4864 _ => std::option::Option::None,
4865 })
4866 }
4867
4868 /// Sets the value of [resource_name][crate::model::Subscription::resource_name]
4869 /// to hold a `DataExchange`.
4870 ///
4871 /// Note that all the setters affecting `resource_name` are
4872 /// mutually exclusive.
4873 ///
4874 /// # Example
4875 /// ```ignore,no_run
4876 /// # use google_cloud_bigquery_analyticshub_v1::model::Subscription;
4877 /// let x = Subscription::new().set_data_exchange("example");
4878 /// assert!(x.data_exchange().is_some());
4879 /// assert!(x.listing().is_none());
4880 /// ```
4881 pub fn set_data_exchange<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4882 self.resource_name = std::option::Option::Some(
4883 crate::model::subscription::ResourceName::DataExchange(v.into()),
4884 );
4885 self
4886 }
4887}
4888
4889impl wkt::message::Message for Subscription {
4890 fn typename() -> &'static str {
4891 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription"
4892 }
4893}
4894
4895/// Defines additional types related to [Subscription].
4896pub mod subscription {
4897 #[allow(unused_imports)]
4898 use super::*;
4899
4900 /// Reference to a linked resource tracked by this Subscription.
4901 #[derive(Clone, Default, PartialEq)]
4902 #[non_exhaustive]
4903 pub struct LinkedResource {
4904 /// Output only. Listing for which linked resource is created.
4905 pub listing: std::string::String,
4906
4907 pub reference: std::option::Option<crate::model::subscription::linked_resource::Reference>,
4908
4909 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4910 }
4911
4912 impl LinkedResource {
4913 pub fn new() -> Self {
4914 std::default::Default::default()
4915 }
4916
4917 /// Sets the value of [listing][crate::model::subscription::LinkedResource::listing].
4918 ///
4919 /// # Example
4920 /// ```ignore,no_run
4921 /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
4922 /// let x = LinkedResource::new().set_listing("example");
4923 /// ```
4924 pub fn set_listing<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4925 self.listing = v.into();
4926 self
4927 }
4928
4929 /// Sets the value of [reference][crate::model::subscription::LinkedResource::reference].
4930 ///
4931 /// Note that all the setters affecting `reference` are mutually
4932 /// exclusive.
4933 ///
4934 /// # Example
4935 /// ```ignore,no_run
4936 /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
4937 /// use google_cloud_bigquery_analyticshub_v1::model::subscription::linked_resource::Reference;
4938 /// let x = LinkedResource::new().set_reference(Some(Reference::LinkedDataset("example".to_string())));
4939 /// ```
4940 pub fn set_reference<
4941 T: std::convert::Into<
4942 std::option::Option<crate::model::subscription::linked_resource::Reference>,
4943 >,
4944 >(
4945 mut self,
4946 v: T,
4947 ) -> Self {
4948 self.reference = v.into();
4949 self
4950 }
4951
4952 /// The value of [reference][crate::model::subscription::LinkedResource::reference]
4953 /// if it holds a `LinkedDataset`, `None` if the field is not set or
4954 /// holds a different branch.
4955 pub fn linked_dataset(&self) -> std::option::Option<&std::string::String> {
4956 #[allow(unreachable_patterns)]
4957 self.reference.as_ref().and_then(|v| match v {
4958 crate::model::subscription::linked_resource::Reference::LinkedDataset(v) => {
4959 std::option::Option::Some(v)
4960 }
4961 _ => std::option::Option::None,
4962 })
4963 }
4964
4965 /// Sets the value of [reference][crate::model::subscription::LinkedResource::reference]
4966 /// to hold a `LinkedDataset`.
4967 ///
4968 /// Note that all the setters affecting `reference` are
4969 /// mutually exclusive.
4970 ///
4971 /// # Example
4972 /// ```ignore,no_run
4973 /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
4974 /// let x = LinkedResource::new().set_linked_dataset("example");
4975 /// assert!(x.linked_dataset().is_some());
4976 /// assert!(x.linked_pubsub_subscription().is_none());
4977 /// ```
4978 pub fn set_linked_dataset<T: std::convert::Into<std::string::String>>(
4979 mut self,
4980 v: T,
4981 ) -> Self {
4982 self.reference = std::option::Option::Some(
4983 crate::model::subscription::linked_resource::Reference::LinkedDataset(v.into()),
4984 );
4985 self
4986 }
4987
4988 /// The value of [reference][crate::model::subscription::LinkedResource::reference]
4989 /// if it holds a `LinkedPubsubSubscription`, `None` if the field is not set or
4990 /// holds a different branch.
4991 pub fn linked_pubsub_subscription(&self) -> std::option::Option<&std::string::String> {
4992 #[allow(unreachable_patterns)]
4993 self.reference.as_ref().and_then(|v| match v {
4994 crate::model::subscription::linked_resource::Reference::LinkedPubsubSubscription(v) => std::option::Option::Some(v),
4995 _ => std::option::Option::None,
4996 })
4997 }
4998
4999 /// Sets the value of [reference][crate::model::subscription::LinkedResource::reference]
5000 /// to hold a `LinkedPubsubSubscription`.
5001 ///
5002 /// Note that all the setters affecting `reference` are
5003 /// mutually exclusive.
5004 ///
5005 /// # Example
5006 /// ```ignore,no_run
5007 /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::LinkedResource;
5008 /// let x = LinkedResource::new().set_linked_pubsub_subscription("example");
5009 /// assert!(x.linked_pubsub_subscription().is_some());
5010 /// assert!(x.linked_dataset().is_none());
5011 /// ```
5012 pub fn set_linked_pubsub_subscription<T: std::convert::Into<std::string::String>>(
5013 mut self,
5014 v: T,
5015 ) -> Self {
5016 self.reference = std::option::Option::Some(
5017 crate::model::subscription::linked_resource::Reference::LinkedPubsubSubscription(
5018 v.into(),
5019 ),
5020 );
5021 self
5022 }
5023 }
5024
5025 impl wkt::message::Message for LinkedResource {
5026 fn typename() -> &'static str {
5027 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription.LinkedResource"
5028 }
5029 }
5030
5031 /// Defines additional types related to [LinkedResource].
5032 pub mod linked_resource {
5033 #[allow(unused_imports)]
5034 use super::*;
5035
5036 #[derive(Clone, Debug, PartialEq)]
5037 #[non_exhaustive]
5038 pub enum Reference {
5039 /// Output only. Name of the linked dataset, e.g.
5040 /// projects/subscriberproject/datasets/linked_dataset
5041 LinkedDataset(std::string::String),
5042 /// Output only. Name of the Pub/Sub subscription, e.g.
5043 /// projects/subscriberproject/subscriptions/subscriptions/sub_id
5044 LinkedPubsubSubscription(std::string::String),
5045 }
5046 }
5047
5048 /// Commercial info metadata for this subscription.
5049 #[derive(Clone, Default, PartialEq)]
5050 #[non_exhaustive]
5051 pub struct CommercialInfo {
5052 /// Output only. This is set when the subscription is commercialised via
5053 /// Cloud Marketplace.
5054 pub cloud_marketplace: std::option::Option<
5055 crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo,
5056 >,
5057
5058 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5059 }
5060
5061 impl CommercialInfo {
5062 pub fn new() -> Self {
5063 std::default::Default::default()
5064 }
5065
5066 /// Sets the value of [cloud_marketplace][crate::model::subscription::CommercialInfo::cloud_marketplace].
5067 ///
5068 /// # Example
5069 /// ```ignore,no_run
5070 /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
5071 /// use google_cloud_bigquery_analyticshub_v1::model::subscription::commercial_info::GoogleCloudMarketplaceInfo;
5072 /// let x = CommercialInfo::new().set_cloud_marketplace(GoogleCloudMarketplaceInfo::default()/* use setters */);
5073 /// ```
5074 pub fn set_cloud_marketplace<T>(mut self, v: T) -> Self
5075 where
5076 T: std::convert::Into<
5077 crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo,
5078 >,
5079 {
5080 self.cloud_marketplace = std::option::Option::Some(v.into());
5081 self
5082 }
5083
5084 /// Sets or clears the value of [cloud_marketplace][crate::model::subscription::CommercialInfo::cloud_marketplace].
5085 ///
5086 /// # Example
5087 /// ```ignore,no_run
5088 /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::CommercialInfo;
5089 /// use google_cloud_bigquery_analyticshub_v1::model::subscription::commercial_info::GoogleCloudMarketplaceInfo;
5090 /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(Some(GoogleCloudMarketplaceInfo::default()/* use setters */));
5091 /// let x = CommercialInfo::new().set_or_clear_cloud_marketplace(None::<GoogleCloudMarketplaceInfo>);
5092 /// ```
5093 pub fn set_or_clear_cloud_marketplace<T>(mut self, v: std::option::Option<T>) -> Self
5094 where
5095 T: std::convert::Into<
5096 crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo,
5097 >,
5098 {
5099 self.cloud_marketplace = v.map(|x| x.into());
5100 self
5101 }
5102 }
5103
5104 impl wkt::message::Message for CommercialInfo {
5105 fn typename() -> &'static str {
5106 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription.CommercialInfo"
5107 }
5108 }
5109
5110 /// Defines additional types related to [CommercialInfo].
5111 pub mod commercial_info {
5112 #[allow(unused_imports)]
5113 use super::*;
5114
5115 /// Cloud Marketplace commercial metadata for this subscription.
5116 #[derive(Clone, Default, PartialEq)]
5117 #[non_exhaustive]
5118 pub struct GoogleCloudMarketplaceInfo {
5119 /// Resource name of the Marketplace Order.
5120 pub order: std::string::String,
5121
5122 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5123 }
5124
5125 impl GoogleCloudMarketplaceInfo {
5126 pub fn new() -> Self {
5127 std::default::Default::default()
5128 }
5129
5130 /// Sets the value of [order][crate::model::subscription::commercial_info::GoogleCloudMarketplaceInfo::order].
5131 ///
5132 /// # Example
5133 /// ```ignore,no_run
5134 /// # use google_cloud_bigquery_analyticshub_v1::model::subscription::commercial_info::GoogleCloudMarketplaceInfo;
5135 /// let x = GoogleCloudMarketplaceInfo::new().set_order("example");
5136 /// ```
5137 pub fn set_order<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5138 self.order = v.into();
5139 self
5140 }
5141 }
5142
5143 impl wkt::message::Message for GoogleCloudMarketplaceInfo {
5144 fn typename() -> &'static str {
5145 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.Subscription.CommercialInfo.GoogleCloudMarketplaceInfo"
5146 }
5147 }
5148 }
5149
5150 /// State of the subscription.
5151 ///
5152 /// # Working with unknown values
5153 ///
5154 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5155 /// additional enum variants at any time. Adding new variants is not considered
5156 /// a breaking change. Applications should write their code in anticipation of:
5157 ///
5158 /// - New values appearing in future releases of the client library, **and**
5159 /// - New values received dynamically, without application changes.
5160 ///
5161 /// Please consult the [Working with enums] section in the user guide for some
5162 /// guidelines.
5163 ///
5164 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5165 #[derive(Clone, Debug, PartialEq)]
5166 #[non_exhaustive]
5167 pub enum State {
5168 /// Default value. This value is unused.
5169 Unspecified,
5170 /// This subscription is active and the data is accessible.
5171 Active,
5172 /// The data referenced by this subscription is out of date and should be
5173 /// refreshed. This can happen when a data provider adds or removes datasets.
5174 Stale,
5175 /// This subscription has been cancelled or revoked and the data is no longer
5176 /// accessible.
5177 Inactive,
5178 /// If set, the enum was initialized with an unknown value.
5179 ///
5180 /// Applications can examine the value using [State::value] or
5181 /// [State::name].
5182 UnknownValue(state::UnknownValue),
5183 }
5184
5185 #[doc(hidden)]
5186 pub mod state {
5187 #[allow(unused_imports)]
5188 use super::*;
5189 #[derive(Clone, Debug, PartialEq)]
5190 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5191 }
5192
5193 impl State {
5194 /// Gets the enum value.
5195 ///
5196 /// Returns `None` if the enum contains an unknown value deserialized from
5197 /// the string representation of enums.
5198 pub fn value(&self) -> std::option::Option<i32> {
5199 match self {
5200 Self::Unspecified => std::option::Option::Some(0),
5201 Self::Active => std::option::Option::Some(1),
5202 Self::Stale => std::option::Option::Some(2),
5203 Self::Inactive => std::option::Option::Some(3),
5204 Self::UnknownValue(u) => u.0.value(),
5205 }
5206 }
5207
5208 /// Gets the enum value as a string.
5209 ///
5210 /// Returns `None` if the enum contains an unknown value deserialized from
5211 /// the integer representation of enums.
5212 pub fn name(&self) -> std::option::Option<&str> {
5213 match self {
5214 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5215 Self::Active => std::option::Option::Some("STATE_ACTIVE"),
5216 Self::Stale => std::option::Option::Some("STATE_STALE"),
5217 Self::Inactive => std::option::Option::Some("STATE_INACTIVE"),
5218 Self::UnknownValue(u) => u.0.name(),
5219 }
5220 }
5221 }
5222
5223 impl std::default::Default for State {
5224 fn default() -> Self {
5225 use std::convert::From;
5226 Self::from(0)
5227 }
5228 }
5229
5230 impl std::fmt::Display for State {
5231 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5232 wkt::internal::display_enum(f, self.name(), self.value())
5233 }
5234 }
5235
5236 impl std::convert::From<i32> for State {
5237 fn from(value: i32) -> Self {
5238 match value {
5239 0 => Self::Unspecified,
5240 1 => Self::Active,
5241 2 => Self::Stale,
5242 3 => Self::Inactive,
5243 _ => Self::UnknownValue(state::UnknownValue(
5244 wkt::internal::UnknownEnumValue::Integer(value),
5245 )),
5246 }
5247 }
5248 }
5249
5250 impl std::convert::From<&str> for State {
5251 fn from(value: &str) -> Self {
5252 use std::string::ToString;
5253 match value {
5254 "STATE_UNSPECIFIED" => Self::Unspecified,
5255 "STATE_ACTIVE" => Self::Active,
5256 "STATE_STALE" => Self::Stale,
5257 "STATE_INACTIVE" => Self::Inactive,
5258 _ => Self::UnknownValue(state::UnknownValue(
5259 wkt::internal::UnknownEnumValue::String(value.to_string()),
5260 )),
5261 }
5262 }
5263 }
5264
5265 impl serde::ser::Serialize for State {
5266 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5267 where
5268 S: serde::Serializer,
5269 {
5270 match self {
5271 Self::Unspecified => serializer.serialize_i32(0),
5272 Self::Active => serializer.serialize_i32(1),
5273 Self::Stale => serializer.serialize_i32(2),
5274 Self::Inactive => serializer.serialize_i32(3),
5275 Self::UnknownValue(u) => u.0.serialize(serializer),
5276 }
5277 }
5278 }
5279
5280 impl<'de> serde::de::Deserialize<'de> for State {
5281 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5282 where
5283 D: serde::Deserializer<'de>,
5284 {
5285 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5286 ".google.cloud.bigquery.analyticshub.v1.Subscription.State",
5287 ))
5288 }
5289 }
5290
5291 #[derive(Clone, Debug, PartialEq)]
5292 #[non_exhaustive]
5293 pub enum ResourceName {
5294 /// Output only. Resource name of the source Listing.
5295 /// e.g. projects/123/locations/us/dataExchanges/456/listings/789
5296 Listing(std::string::String),
5297 /// Output only. Resource name of the source Data Exchange.
5298 /// e.g. projects/123/locations/us/dataExchanges/456
5299 DataExchange(std::string::String),
5300 }
5301}
5302
5303/// Message for requesting the list of data exchanges.
5304#[derive(Clone, Default, PartialEq)]
5305#[non_exhaustive]
5306pub struct ListDataExchangesRequest {
5307 /// Required. The parent resource path of the data exchanges.
5308 /// e.g. `projects/myproject/locations/us`.
5309 pub parent: std::string::String,
5310
5311 /// The maximum number of results to return in a single response page. Leverage
5312 /// the page tokens to iterate through the entire collection.
5313 pub page_size: i32,
5314
5315 /// Page token, returned by a previous call, to request the next page of
5316 /// results.
5317 pub page_token: std::string::String,
5318
5319 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5320}
5321
5322impl ListDataExchangesRequest {
5323 pub fn new() -> Self {
5324 std::default::Default::default()
5325 }
5326
5327 /// Sets the value of [parent][crate::model::ListDataExchangesRequest::parent].
5328 ///
5329 /// # Example
5330 /// ```ignore,no_run
5331 /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesRequest;
5332 /// let x = ListDataExchangesRequest::new().set_parent("example");
5333 /// ```
5334 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5335 self.parent = v.into();
5336 self
5337 }
5338
5339 /// Sets the value of [page_size][crate::model::ListDataExchangesRequest::page_size].
5340 ///
5341 /// # Example
5342 /// ```ignore,no_run
5343 /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesRequest;
5344 /// let x = ListDataExchangesRequest::new().set_page_size(42);
5345 /// ```
5346 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5347 self.page_size = v.into();
5348 self
5349 }
5350
5351 /// Sets the value of [page_token][crate::model::ListDataExchangesRequest::page_token].
5352 ///
5353 /// # Example
5354 /// ```ignore,no_run
5355 /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesRequest;
5356 /// let x = ListDataExchangesRequest::new().set_page_token("example");
5357 /// ```
5358 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5359 self.page_token = v.into();
5360 self
5361 }
5362}
5363
5364impl wkt::message::Message for ListDataExchangesRequest {
5365 fn typename() -> &'static str {
5366 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListDataExchangesRequest"
5367 }
5368}
5369
5370/// Message for response to the list of data exchanges.
5371#[derive(Clone, Default, PartialEq)]
5372#[non_exhaustive]
5373pub struct ListDataExchangesResponse {
5374 /// The list of data exchanges.
5375 pub data_exchanges: std::vec::Vec<crate::model::DataExchange>,
5376
5377 /// A token to request the next page of results.
5378 pub next_page_token: std::string::String,
5379
5380 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5381}
5382
5383impl ListDataExchangesResponse {
5384 pub fn new() -> Self {
5385 std::default::Default::default()
5386 }
5387
5388 /// Sets the value of [data_exchanges][crate::model::ListDataExchangesResponse::data_exchanges].
5389 ///
5390 /// # Example
5391 /// ```ignore,no_run
5392 /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesResponse;
5393 /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5394 /// let x = ListDataExchangesResponse::new()
5395 /// .set_data_exchanges([
5396 /// DataExchange::default()/* use setters */,
5397 /// DataExchange::default()/* use (different) setters */,
5398 /// ]);
5399 /// ```
5400 pub fn set_data_exchanges<T, V>(mut self, v: T) -> Self
5401 where
5402 T: std::iter::IntoIterator<Item = V>,
5403 V: std::convert::Into<crate::model::DataExchange>,
5404 {
5405 use std::iter::Iterator;
5406 self.data_exchanges = v.into_iter().map(|i| i.into()).collect();
5407 self
5408 }
5409
5410 /// Sets the value of [next_page_token][crate::model::ListDataExchangesResponse::next_page_token].
5411 ///
5412 /// # Example
5413 /// ```ignore,no_run
5414 /// # use google_cloud_bigquery_analyticshub_v1::model::ListDataExchangesResponse;
5415 /// let x = ListDataExchangesResponse::new().set_next_page_token("example");
5416 /// ```
5417 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5418 self.next_page_token = v.into();
5419 self
5420 }
5421}
5422
5423impl wkt::message::Message for ListDataExchangesResponse {
5424 fn typename() -> &'static str {
5425 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListDataExchangesResponse"
5426 }
5427}
5428
5429#[doc(hidden)]
5430impl google_cloud_gax::paginator::internal::PageableResponse for ListDataExchangesResponse {
5431 type PageItem = crate::model::DataExchange;
5432
5433 fn items(self) -> std::vec::Vec<Self::PageItem> {
5434 self.data_exchanges
5435 }
5436
5437 fn next_page_token(&self) -> std::string::String {
5438 use std::clone::Clone;
5439 self.next_page_token.clone()
5440 }
5441}
5442
5443/// Message for requesting the list of data exchanges from projects in an
5444/// organization and location.
5445#[derive(Clone, Default, PartialEq)]
5446#[non_exhaustive]
5447pub struct ListOrgDataExchangesRequest {
5448 /// Required. The organization resource path of the projects containing
5449 /// DataExchanges. e.g. `organizations/myorg/locations/us`.
5450 pub organization: std::string::String,
5451
5452 /// The maximum number of results to return in a single response page. Leverage
5453 /// the page tokens to iterate through the entire collection.
5454 pub page_size: i32,
5455
5456 /// Page token, returned by a previous call, to request the next page of
5457 /// results.
5458 pub page_token: std::string::String,
5459
5460 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5461}
5462
5463impl ListOrgDataExchangesRequest {
5464 pub fn new() -> Self {
5465 std::default::Default::default()
5466 }
5467
5468 /// Sets the value of [organization][crate::model::ListOrgDataExchangesRequest::organization].
5469 ///
5470 /// # Example
5471 /// ```ignore,no_run
5472 /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesRequest;
5473 /// let x = ListOrgDataExchangesRequest::new().set_organization("example");
5474 /// ```
5475 pub fn set_organization<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5476 self.organization = v.into();
5477 self
5478 }
5479
5480 /// Sets the value of [page_size][crate::model::ListOrgDataExchangesRequest::page_size].
5481 ///
5482 /// # Example
5483 /// ```ignore,no_run
5484 /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesRequest;
5485 /// let x = ListOrgDataExchangesRequest::new().set_page_size(42);
5486 /// ```
5487 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5488 self.page_size = v.into();
5489 self
5490 }
5491
5492 /// Sets the value of [page_token][crate::model::ListOrgDataExchangesRequest::page_token].
5493 ///
5494 /// # Example
5495 /// ```ignore,no_run
5496 /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesRequest;
5497 /// let x = ListOrgDataExchangesRequest::new().set_page_token("example");
5498 /// ```
5499 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5500 self.page_token = v.into();
5501 self
5502 }
5503}
5504
5505impl wkt::message::Message for ListOrgDataExchangesRequest {
5506 fn typename() -> &'static str {
5507 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesRequest"
5508 }
5509}
5510
5511/// Message for response to listing data exchanges in an organization and
5512/// location.
5513#[derive(Clone, Default, PartialEq)]
5514#[non_exhaustive]
5515pub struct ListOrgDataExchangesResponse {
5516 /// The list of data exchanges.
5517 pub data_exchanges: std::vec::Vec<crate::model::DataExchange>,
5518
5519 /// A token to request the next page of results.
5520 pub next_page_token: std::string::String,
5521
5522 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5523}
5524
5525impl ListOrgDataExchangesResponse {
5526 pub fn new() -> Self {
5527 std::default::Default::default()
5528 }
5529
5530 /// Sets the value of [data_exchanges][crate::model::ListOrgDataExchangesResponse::data_exchanges].
5531 ///
5532 /// # Example
5533 /// ```ignore,no_run
5534 /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesResponse;
5535 /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5536 /// let x = ListOrgDataExchangesResponse::new()
5537 /// .set_data_exchanges([
5538 /// DataExchange::default()/* use setters */,
5539 /// DataExchange::default()/* use (different) setters */,
5540 /// ]);
5541 /// ```
5542 pub fn set_data_exchanges<T, V>(mut self, v: T) -> Self
5543 where
5544 T: std::iter::IntoIterator<Item = V>,
5545 V: std::convert::Into<crate::model::DataExchange>,
5546 {
5547 use std::iter::Iterator;
5548 self.data_exchanges = v.into_iter().map(|i| i.into()).collect();
5549 self
5550 }
5551
5552 /// Sets the value of [next_page_token][crate::model::ListOrgDataExchangesResponse::next_page_token].
5553 ///
5554 /// # Example
5555 /// ```ignore,no_run
5556 /// # use google_cloud_bigquery_analyticshub_v1::model::ListOrgDataExchangesResponse;
5557 /// let x = ListOrgDataExchangesResponse::new().set_next_page_token("example");
5558 /// ```
5559 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5560 self.next_page_token = v.into();
5561 self
5562 }
5563}
5564
5565impl wkt::message::Message for ListOrgDataExchangesResponse {
5566 fn typename() -> &'static str {
5567 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListOrgDataExchangesResponse"
5568 }
5569}
5570
5571#[doc(hidden)]
5572impl google_cloud_gax::paginator::internal::PageableResponse for ListOrgDataExchangesResponse {
5573 type PageItem = crate::model::DataExchange;
5574
5575 fn items(self) -> std::vec::Vec<Self::PageItem> {
5576 self.data_exchanges
5577 }
5578
5579 fn next_page_token(&self) -> std::string::String {
5580 use std::clone::Clone;
5581 self.next_page_token.clone()
5582 }
5583}
5584
5585/// Message for getting a data exchange.
5586#[derive(Clone, Default, PartialEq)]
5587#[non_exhaustive]
5588pub struct GetDataExchangeRequest {
5589 /// Required. The resource name of the data exchange.
5590 /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
5591 pub name: std::string::String,
5592
5593 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5594}
5595
5596impl GetDataExchangeRequest {
5597 pub fn new() -> Self {
5598 std::default::Default::default()
5599 }
5600
5601 /// Sets the value of [name][crate::model::GetDataExchangeRequest::name].
5602 ///
5603 /// # Example
5604 /// ```ignore,no_run
5605 /// # use google_cloud_bigquery_analyticshub_v1::model::GetDataExchangeRequest;
5606 /// let x = GetDataExchangeRequest::new().set_name("example");
5607 /// ```
5608 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5609 self.name = v.into();
5610 self
5611 }
5612}
5613
5614impl wkt::message::Message for GetDataExchangeRequest {
5615 fn typename() -> &'static str {
5616 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetDataExchangeRequest"
5617 }
5618}
5619
5620/// Message for creating a data exchange.
5621#[derive(Clone, Default, PartialEq)]
5622#[non_exhaustive]
5623pub struct CreateDataExchangeRequest {
5624 /// Required. The parent resource path of the data exchange.
5625 /// e.g. `projects/myproject/locations/us`.
5626 pub parent: std::string::String,
5627
5628 /// Required. The ID of the data exchange.
5629 /// Must contain only Unicode letters, numbers (0-9), underscores (_).
5630 /// Max length: 100 bytes.
5631 pub data_exchange_id: std::string::String,
5632
5633 /// Required. The data exchange to create.
5634 pub data_exchange: std::option::Option<crate::model::DataExchange>,
5635
5636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5637}
5638
5639impl CreateDataExchangeRequest {
5640 pub fn new() -> Self {
5641 std::default::Default::default()
5642 }
5643
5644 /// Sets the value of [parent][crate::model::CreateDataExchangeRequest::parent].
5645 ///
5646 /// # Example
5647 /// ```ignore,no_run
5648 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5649 /// let x = CreateDataExchangeRequest::new().set_parent("example");
5650 /// ```
5651 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5652 self.parent = v.into();
5653 self
5654 }
5655
5656 /// Sets the value of [data_exchange_id][crate::model::CreateDataExchangeRequest::data_exchange_id].
5657 ///
5658 /// # Example
5659 /// ```ignore,no_run
5660 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5661 /// let x = CreateDataExchangeRequest::new().set_data_exchange_id("example");
5662 /// ```
5663 pub fn set_data_exchange_id<T: std::convert::Into<std::string::String>>(
5664 mut self,
5665 v: T,
5666 ) -> Self {
5667 self.data_exchange_id = v.into();
5668 self
5669 }
5670
5671 /// Sets the value of [data_exchange][crate::model::CreateDataExchangeRequest::data_exchange].
5672 ///
5673 /// # Example
5674 /// ```ignore,no_run
5675 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5676 /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5677 /// let x = CreateDataExchangeRequest::new().set_data_exchange(DataExchange::default()/* use setters */);
5678 /// ```
5679 pub fn set_data_exchange<T>(mut self, v: T) -> Self
5680 where
5681 T: std::convert::Into<crate::model::DataExchange>,
5682 {
5683 self.data_exchange = std::option::Option::Some(v.into());
5684 self
5685 }
5686
5687 /// Sets or clears the value of [data_exchange][crate::model::CreateDataExchangeRequest::data_exchange].
5688 ///
5689 /// # Example
5690 /// ```ignore,no_run
5691 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateDataExchangeRequest;
5692 /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5693 /// let x = CreateDataExchangeRequest::new().set_or_clear_data_exchange(Some(DataExchange::default()/* use setters */));
5694 /// let x = CreateDataExchangeRequest::new().set_or_clear_data_exchange(None::<DataExchange>);
5695 /// ```
5696 pub fn set_or_clear_data_exchange<T>(mut self, v: std::option::Option<T>) -> Self
5697 where
5698 T: std::convert::Into<crate::model::DataExchange>,
5699 {
5700 self.data_exchange = v.map(|x| x.into());
5701 self
5702 }
5703}
5704
5705impl wkt::message::Message for CreateDataExchangeRequest {
5706 fn typename() -> &'static str {
5707 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CreateDataExchangeRequest"
5708 }
5709}
5710
5711/// Message for updating a data exchange.
5712#[derive(Clone, Default, PartialEq)]
5713#[non_exhaustive]
5714pub struct UpdateDataExchangeRequest {
5715 /// Required. Field mask specifies the fields to update in the data exchange
5716 /// resource. The fields specified in the
5717 /// `updateMask` are relative to the resource and are not a full request.
5718 pub update_mask: std::option::Option<wkt::FieldMask>,
5719
5720 /// Required. The data exchange to update.
5721 pub data_exchange: std::option::Option<crate::model::DataExchange>,
5722
5723 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5724}
5725
5726impl UpdateDataExchangeRequest {
5727 pub fn new() -> Self {
5728 std::default::Default::default()
5729 }
5730
5731 /// Sets the value of [update_mask][crate::model::UpdateDataExchangeRequest::update_mask].
5732 ///
5733 /// # Example
5734 /// ```ignore,no_run
5735 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5736 /// use wkt::FieldMask;
5737 /// let x = UpdateDataExchangeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5738 /// ```
5739 pub fn set_update_mask<T>(mut self, v: T) -> Self
5740 where
5741 T: std::convert::Into<wkt::FieldMask>,
5742 {
5743 self.update_mask = std::option::Option::Some(v.into());
5744 self
5745 }
5746
5747 /// Sets or clears the value of [update_mask][crate::model::UpdateDataExchangeRequest::update_mask].
5748 ///
5749 /// # Example
5750 /// ```ignore,no_run
5751 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5752 /// use wkt::FieldMask;
5753 /// let x = UpdateDataExchangeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5754 /// let x = UpdateDataExchangeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5755 /// ```
5756 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5757 where
5758 T: std::convert::Into<wkt::FieldMask>,
5759 {
5760 self.update_mask = v.map(|x| x.into());
5761 self
5762 }
5763
5764 /// Sets the value of [data_exchange][crate::model::UpdateDataExchangeRequest::data_exchange].
5765 ///
5766 /// # Example
5767 /// ```ignore,no_run
5768 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5769 /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5770 /// let x = UpdateDataExchangeRequest::new().set_data_exchange(DataExchange::default()/* use setters */);
5771 /// ```
5772 pub fn set_data_exchange<T>(mut self, v: T) -> Self
5773 where
5774 T: std::convert::Into<crate::model::DataExchange>,
5775 {
5776 self.data_exchange = std::option::Option::Some(v.into());
5777 self
5778 }
5779
5780 /// Sets or clears the value of [data_exchange][crate::model::UpdateDataExchangeRequest::data_exchange].
5781 ///
5782 /// # Example
5783 /// ```ignore,no_run
5784 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateDataExchangeRequest;
5785 /// use google_cloud_bigquery_analyticshub_v1::model::DataExchange;
5786 /// let x = UpdateDataExchangeRequest::new().set_or_clear_data_exchange(Some(DataExchange::default()/* use setters */));
5787 /// let x = UpdateDataExchangeRequest::new().set_or_clear_data_exchange(None::<DataExchange>);
5788 /// ```
5789 pub fn set_or_clear_data_exchange<T>(mut self, v: std::option::Option<T>) -> Self
5790 where
5791 T: std::convert::Into<crate::model::DataExchange>,
5792 {
5793 self.data_exchange = v.map(|x| x.into());
5794 self
5795 }
5796}
5797
5798impl wkt::message::Message for UpdateDataExchangeRequest {
5799 fn typename() -> &'static str {
5800 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.UpdateDataExchangeRequest"
5801 }
5802}
5803
5804/// Message for deleting a data exchange.
5805#[derive(Clone, Default, PartialEq)]
5806#[non_exhaustive]
5807pub struct DeleteDataExchangeRequest {
5808 /// Required. The full name of the data exchange resource that you want to
5809 /// delete. For example, `projects/myproject/locations/us/dataExchanges/123`.
5810 pub name: std::string::String,
5811
5812 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5813}
5814
5815impl DeleteDataExchangeRequest {
5816 pub fn new() -> Self {
5817 std::default::Default::default()
5818 }
5819
5820 /// Sets the value of [name][crate::model::DeleteDataExchangeRequest::name].
5821 ///
5822 /// # Example
5823 /// ```ignore,no_run
5824 /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteDataExchangeRequest;
5825 /// let x = DeleteDataExchangeRequest::new().set_name("example");
5826 /// ```
5827 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5828 self.name = v.into();
5829 self
5830 }
5831}
5832
5833impl wkt::message::Message for DeleteDataExchangeRequest {
5834 fn typename() -> &'static str {
5835 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteDataExchangeRequest"
5836 }
5837}
5838
5839/// Message for requesting the list of listings.
5840#[derive(Clone, Default, PartialEq)]
5841#[non_exhaustive]
5842pub struct ListListingsRequest {
5843 /// Required. The parent resource path of the listing.
5844 /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
5845 pub parent: std::string::String,
5846
5847 /// The maximum number of results to return in a single response page. Leverage
5848 /// the page tokens to iterate through the entire collection.
5849 pub page_size: i32,
5850
5851 /// Page token, returned by a previous call, to request the next page of
5852 /// results.
5853 pub page_token: std::string::String,
5854
5855 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5856}
5857
5858impl ListListingsRequest {
5859 pub fn new() -> Self {
5860 std::default::Default::default()
5861 }
5862
5863 /// Sets the value of [parent][crate::model::ListListingsRequest::parent].
5864 ///
5865 /// # Example
5866 /// ```ignore,no_run
5867 /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsRequest;
5868 /// let x = ListListingsRequest::new().set_parent("example");
5869 /// ```
5870 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5871 self.parent = v.into();
5872 self
5873 }
5874
5875 /// Sets the value of [page_size][crate::model::ListListingsRequest::page_size].
5876 ///
5877 /// # Example
5878 /// ```ignore,no_run
5879 /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsRequest;
5880 /// let x = ListListingsRequest::new().set_page_size(42);
5881 /// ```
5882 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5883 self.page_size = v.into();
5884 self
5885 }
5886
5887 /// Sets the value of [page_token][crate::model::ListListingsRequest::page_token].
5888 ///
5889 /// # Example
5890 /// ```ignore,no_run
5891 /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsRequest;
5892 /// let x = ListListingsRequest::new().set_page_token("example");
5893 /// ```
5894 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5895 self.page_token = v.into();
5896 self
5897 }
5898}
5899
5900impl wkt::message::Message for ListListingsRequest {
5901 fn typename() -> &'static str {
5902 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListListingsRequest"
5903 }
5904}
5905
5906/// Message for response to the list of Listings.
5907#[derive(Clone, Default, PartialEq)]
5908#[non_exhaustive]
5909pub struct ListListingsResponse {
5910 /// The list of Listing.
5911 pub listings: std::vec::Vec<crate::model::Listing>,
5912
5913 /// A token to request the next page of results.
5914 pub next_page_token: std::string::String,
5915
5916 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5917}
5918
5919impl ListListingsResponse {
5920 pub fn new() -> Self {
5921 std::default::Default::default()
5922 }
5923
5924 /// Sets the value of [listings][crate::model::ListListingsResponse::listings].
5925 ///
5926 /// # Example
5927 /// ```ignore,no_run
5928 /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsResponse;
5929 /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
5930 /// let x = ListListingsResponse::new()
5931 /// .set_listings([
5932 /// Listing::default()/* use setters */,
5933 /// Listing::default()/* use (different) setters */,
5934 /// ]);
5935 /// ```
5936 pub fn set_listings<T, V>(mut self, v: T) -> Self
5937 where
5938 T: std::iter::IntoIterator<Item = V>,
5939 V: std::convert::Into<crate::model::Listing>,
5940 {
5941 use std::iter::Iterator;
5942 self.listings = v.into_iter().map(|i| i.into()).collect();
5943 self
5944 }
5945
5946 /// Sets the value of [next_page_token][crate::model::ListListingsResponse::next_page_token].
5947 ///
5948 /// # Example
5949 /// ```ignore,no_run
5950 /// # use google_cloud_bigquery_analyticshub_v1::model::ListListingsResponse;
5951 /// let x = ListListingsResponse::new().set_next_page_token("example");
5952 /// ```
5953 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5954 self.next_page_token = v.into();
5955 self
5956 }
5957}
5958
5959impl wkt::message::Message for ListListingsResponse {
5960 fn typename() -> &'static str {
5961 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListListingsResponse"
5962 }
5963}
5964
5965#[doc(hidden)]
5966impl google_cloud_gax::paginator::internal::PageableResponse for ListListingsResponse {
5967 type PageItem = crate::model::Listing;
5968
5969 fn items(self) -> std::vec::Vec<Self::PageItem> {
5970 self.listings
5971 }
5972
5973 fn next_page_token(&self) -> std::string::String {
5974 use std::clone::Clone;
5975 self.next_page_token.clone()
5976 }
5977}
5978
5979/// Message for getting a listing.
5980#[derive(Clone, Default, PartialEq)]
5981#[non_exhaustive]
5982pub struct GetListingRequest {
5983 /// Required. The resource name of the listing.
5984 /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`.
5985 pub name: std::string::String,
5986
5987 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5988}
5989
5990impl GetListingRequest {
5991 pub fn new() -> Self {
5992 std::default::Default::default()
5993 }
5994
5995 /// Sets the value of [name][crate::model::GetListingRequest::name].
5996 ///
5997 /// # Example
5998 /// ```ignore,no_run
5999 /// # use google_cloud_bigquery_analyticshub_v1::model::GetListingRequest;
6000 /// let x = GetListingRequest::new().set_name("example");
6001 /// ```
6002 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6003 self.name = v.into();
6004 self
6005 }
6006}
6007
6008impl wkt::message::Message for GetListingRequest {
6009 fn typename() -> &'static str {
6010 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetListingRequest"
6011 }
6012}
6013
6014/// Message for creating a listing.
6015#[derive(Clone, Default, PartialEq)]
6016#[non_exhaustive]
6017pub struct CreateListingRequest {
6018 /// Required. The parent resource path of the listing.
6019 /// e.g. `projects/myproject/locations/us/dataExchanges/123`.
6020 pub parent: std::string::String,
6021
6022 /// Required. The ID of the listing to create.
6023 /// Must contain only Unicode letters, numbers (0-9), underscores (_).
6024 /// Max length: 100 bytes.
6025 pub listing_id: std::string::String,
6026
6027 /// Required. The listing to create.
6028 pub listing: std::option::Option<crate::model::Listing>,
6029
6030 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6031}
6032
6033impl CreateListingRequest {
6034 pub fn new() -> Self {
6035 std::default::Default::default()
6036 }
6037
6038 /// Sets the value of [parent][crate::model::CreateListingRequest::parent].
6039 ///
6040 /// # Example
6041 /// ```ignore,no_run
6042 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6043 /// let x = CreateListingRequest::new().set_parent("example");
6044 /// ```
6045 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6046 self.parent = v.into();
6047 self
6048 }
6049
6050 /// Sets the value of [listing_id][crate::model::CreateListingRequest::listing_id].
6051 ///
6052 /// # Example
6053 /// ```ignore,no_run
6054 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6055 /// let x = CreateListingRequest::new().set_listing_id("example");
6056 /// ```
6057 pub fn set_listing_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6058 self.listing_id = v.into();
6059 self
6060 }
6061
6062 /// Sets the value of [listing][crate::model::CreateListingRequest::listing].
6063 ///
6064 /// # Example
6065 /// ```ignore,no_run
6066 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6067 /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6068 /// let x = CreateListingRequest::new().set_listing(Listing::default()/* use setters */);
6069 /// ```
6070 pub fn set_listing<T>(mut self, v: T) -> Self
6071 where
6072 T: std::convert::Into<crate::model::Listing>,
6073 {
6074 self.listing = std::option::Option::Some(v.into());
6075 self
6076 }
6077
6078 /// Sets or clears the value of [listing][crate::model::CreateListingRequest::listing].
6079 ///
6080 /// # Example
6081 /// ```ignore,no_run
6082 /// # use google_cloud_bigquery_analyticshub_v1::model::CreateListingRequest;
6083 /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6084 /// let x = CreateListingRequest::new().set_or_clear_listing(Some(Listing::default()/* use setters */));
6085 /// let x = CreateListingRequest::new().set_or_clear_listing(None::<Listing>);
6086 /// ```
6087 pub fn set_or_clear_listing<T>(mut self, v: std::option::Option<T>) -> Self
6088 where
6089 T: std::convert::Into<crate::model::Listing>,
6090 {
6091 self.listing = v.map(|x| x.into());
6092 self
6093 }
6094}
6095
6096impl wkt::message::Message for CreateListingRequest {
6097 fn typename() -> &'static str {
6098 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CreateListingRequest"
6099 }
6100}
6101
6102/// Message for updating a Listing.
6103#[derive(Clone, Default, PartialEq)]
6104#[non_exhaustive]
6105pub struct UpdateListingRequest {
6106 /// Required. Field mask specifies the fields to update in the listing
6107 /// resource. The fields specified in the `updateMask` are relative to the
6108 /// resource and are not a full request.
6109 pub update_mask: std::option::Option<wkt::FieldMask>,
6110
6111 /// Required. The listing to update.
6112 pub listing: std::option::Option<crate::model::Listing>,
6113
6114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6115}
6116
6117impl UpdateListingRequest {
6118 pub fn new() -> Self {
6119 std::default::Default::default()
6120 }
6121
6122 /// Sets the value of [update_mask][crate::model::UpdateListingRequest::update_mask].
6123 ///
6124 /// # Example
6125 /// ```ignore,no_run
6126 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6127 /// use wkt::FieldMask;
6128 /// let x = UpdateListingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6129 /// ```
6130 pub fn set_update_mask<T>(mut self, v: T) -> Self
6131 where
6132 T: std::convert::Into<wkt::FieldMask>,
6133 {
6134 self.update_mask = std::option::Option::Some(v.into());
6135 self
6136 }
6137
6138 /// Sets or clears the value of [update_mask][crate::model::UpdateListingRequest::update_mask].
6139 ///
6140 /// # Example
6141 /// ```ignore,no_run
6142 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6143 /// use wkt::FieldMask;
6144 /// let x = UpdateListingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6145 /// let x = UpdateListingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6146 /// ```
6147 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6148 where
6149 T: std::convert::Into<wkt::FieldMask>,
6150 {
6151 self.update_mask = v.map(|x| x.into());
6152 self
6153 }
6154
6155 /// Sets the value of [listing][crate::model::UpdateListingRequest::listing].
6156 ///
6157 /// # Example
6158 /// ```ignore,no_run
6159 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6160 /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6161 /// let x = UpdateListingRequest::new().set_listing(Listing::default()/* use setters */);
6162 /// ```
6163 pub fn set_listing<T>(mut self, v: T) -> Self
6164 where
6165 T: std::convert::Into<crate::model::Listing>,
6166 {
6167 self.listing = std::option::Option::Some(v.into());
6168 self
6169 }
6170
6171 /// Sets or clears the value of [listing][crate::model::UpdateListingRequest::listing].
6172 ///
6173 /// # Example
6174 /// ```ignore,no_run
6175 /// # use google_cloud_bigquery_analyticshub_v1::model::UpdateListingRequest;
6176 /// use google_cloud_bigquery_analyticshub_v1::model::Listing;
6177 /// let x = UpdateListingRequest::new().set_or_clear_listing(Some(Listing::default()/* use setters */));
6178 /// let x = UpdateListingRequest::new().set_or_clear_listing(None::<Listing>);
6179 /// ```
6180 pub fn set_or_clear_listing<T>(mut self, v: std::option::Option<T>) -> Self
6181 where
6182 T: std::convert::Into<crate::model::Listing>,
6183 {
6184 self.listing = v.map(|x| x.into());
6185 self
6186 }
6187}
6188
6189impl wkt::message::Message for UpdateListingRequest {
6190 fn typename() -> &'static str {
6191 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.UpdateListingRequest"
6192 }
6193}
6194
6195/// Message for deleting a listing.
6196#[derive(Clone, Default, PartialEq)]
6197#[non_exhaustive]
6198pub struct DeleteListingRequest {
6199 /// Required. Resource name of the listing to delete.
6200 /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`.
6201 pub name: std::string::String,
6202
6203 /// Optional. If the listing is commercial then this field must be set to true,
6204 /// otherwise a failure is thrown. This acts as a safety guard to avoid
6205 /// deleting commercial listings accidentally.
6206 pub delete_commercial: bool,
6207
6208 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6209}
6210
6211impl DeleteListingRequest {
6212 pub fn new() -> Self {
6213 std::default::Default::default()
6214 }
6215
6216 /// Sets the value of [name][crate::model::DeleteListingRequest::name].
6217 ///
6218 /// # Example
6219 /// ```ignore,no_run
6220 /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteListingRequest;
6221 /// let x = DeleteListingRequest::new().set_name("example");
6222 /// ```
6223 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6224 self.name = v.into();
6225 self
6226 }
6227
6228 /// Sets the value of [delete_commercial][crate::model::DeleteListingRequest::delete_commercial].
6229 ///
6230 /// # Example
6231 /// ```ignore,no_run
6232 /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteListingRequest;
6233 /// let x = DeleteListingRequest::new().set_delete_commercial(true);
6234 /// ```
6235 pub fn set_delete_commercial<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6236 self.delete_commercial = v.into();
6237 self
6238 }
6239}
6240
6241impl wkt::message::Message for DeleteListingRequest {
6242 fn typename() -> &'static str {
6243 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteListingRequest"
6244 }
6245}
6246
6247/// Message for subscribing to a listing.
6248#[derive(Clone, Default, PartialEq)]
6249#[non_exhaustive]
6250pub struct SubscribeListingRequest {
6251 /// Required. Resource name of the listing that you want to subscribe to.
6252 /// e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`.
6253 pub name: std::string::String,
6254
6255 /// Resulting destination of the listing that you subscribed to.
6256 pub destination: std::option::Option<crate::model::subscribe_listing_request::Destination>,
6257
6258 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6259}
6260
6261impl SubscribeListingRequest {
6262 pub fn new() -> Self {
6263 std::default::Default::default()
6264 }
6265
6266 /// Sets the value of [name][crate::model::SubscribeListingRequest::name].
6267 ///
6268 /// # Example
6269 /// ```ignore,no_run
6270 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6271 /// let x = SubscribeListingRequest::new().set_name("example");
6272 /// ```
6273 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6274 self.name = v.into();
6275 self
6276 }
6277
6278 /// Sets the value of [destination][crate::model::SubscribeListingRequest::destination].
6279 ///
6280 /// Note that all the setters affecting `destination` are mutually
6281 /// exclusive.
6282 ///
6283 /// # Example
6284 /// ```ignore,no_run
6285 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6286 /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6287 /// let x = SubscribeListingRequest::new().set_destination(Some(
6288 /// google_cloud_bigquery_analyticshub_v1::model::subscribe_listing_request::Destination::DestinationDataset(DestinationDataset::default().into())));
6289 /// ```
6290 pub fn set_destination<
6291 T: std::convert::Into<
6292 std::option::Option<crate::model::subscribe_listing_request::Destination>,
6293 >,
6294 >(
6295 mut self,
6296 v: T,
6297 ) -> Self {
6298 self.destination = v.into();
6299 self
6300 }
6301
6302 /// The value of [destination][crate::model::SubscribeListingRequest::destination]
6303 /// if it holds a `DestinationDataset`, `None` if the field is not set or
6304 /// holds a different branch.
6305 pub fn destination_dataset(
6306 &self,
6307 ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationDataset>> {
6308 #[allow(unreachable_patterns)]
6309 self.destination.as_ref().and_then(|v| match v {
6310 crate::model::subscribe_listing_request::Destination::DestinationDataset(v) => {
6311 std::option::Option::Some(v)
6312 }
6313 _ => std::option::Option::None,
6314 })
6315 }
6316
6317 /// Sets the value of [destination][crate::model::SubscribeListingRequest::destination]
6318 /// to hold a `DestinationDataset`.
6319 ///
6320 /// Note that all the setters affecting `destination` are
6321 /// mutually exclusive.
6322 ///
6323 /// # Example
6324 /// ```ignore,no_run
6325 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6326 /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6327 /// let x = SubscribeListingRequest::new().set_destination_dataset(DestinationDataset::default()/* use setters */);
6328 /// assert!(x.destination_dataset().is_some());
6329 /// assert!(x.destination_pubsub_subscription().is_none());
6330 /// ```
6331 pub fn set_destination_dataset<
6332 T: std::convert::Into<std::boxed::Box<crate::model::DestinationDataset>>,
6333 >(
6334 mut self,
6335 v: T,
6336 ) -> Self {
6337 self.destination = std::option::Option::Some(
6338 crate::model::subscribe_listing_request::Destination::DestinationDataset(v.into()),
6339 );
6340 self
6341 }
6342
6343 /// The value of [destination][crate::model::SubscribeListingRequest::destination]
6344 /// if it holds a `DestinationPubsubSubscription`, `None` if the field is not set or
6345 /// holds a different branch.
6346 pub fn destination_pubsub_subscription(
6347 &self,
6348 ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationPubSubSubscription>> {
6349 #[allow(unreachable_patterns)]
6350 self.destination.as_ref().and_then(|v| match v {
6351 crate::model::subscribe_listing_request::Destination::DestinationPubsubSubscription(
6352 v,
6353 ) => std::option::Option::Some(v),
6354 _ => std::option::Option::None,
6355 })
6356 }
6357
6358 /// Sets the value of [destination][crate::model::SubscribeListingRequest::destination]
6359 /// to hold a `DestinationPubsubSubscription`.
6360 ///
6361 /// Note that all the setters affecting `destination` are
6362 /// mutually exclusive.
6363 ///
6364 /// # Example
6365 /// ```ignore,no_run
6366 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingRequest;
6367 /// use google_cloud_bigquery_analyticshub_v1::model::DestinationPubSubSubscription;
6368 /// let x = SubscribeListingRequest::new().set_destination_pubsub_subscription(DestinationPubSubSubscription::default()/* use setters */);
6369 /// assert!(x.destination_pubsub_subscription().is_some());
6370 /// assert!(x.destination_dataset().is_none());
6371 /// ```
6372 pub fn set_destination_pubsub_subscription<
6373 T: std::convert::Into<std::boxed::Box<crate::model::DestinationPubSubSubscription>>,
6374 >(
6375 mut self,
6376 v: T,
6377 ) -> Self {
6378 self.destination = std::option::Option::Some(
6379 crate::model::subscribe_listing_request::Destination::DestinationPubsubSubscription(
6380 v.into(),
6381 ),
6382 );
6383 self
6384 }
6385}
6386
6387impl wkt::message::Message for SubscribeListingRequest {
6388 fn typename() -> &'static str {
6389 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeListingRequest"
6390 }
6391}
6392
6393/// Defines additional types related to [SubscribeListingRequest].
6394pub mod subscribe_listing_request {
6395 #[allow(unused_imports)]
6396 use super::*;
6397
6398 /// Resulting destination of the listing that you subscribed to.
6399 #[derive(Clone, Debug, PartialEq)]
6400 #[non_exhaustive]
6401 pub enum Destination {
6402 /// Input only. BigQuery destination dataset to create for the subscriber.
6403 DestinationDataset(std::boxed::Box<crate::model::DestinationDataset>),
6404 /// Input only. Destination Pub/Sub subscription to create for the
6405 /// subscriber.
6406 DestinationPubsubSubscription(std::boxed::Box<crate::model::DestinationPubSubSubscription>),
6407 }
6408}
6409
6410/// Message for response when you subscribe to a listing.
6411#[derive(Clone, Default, PartialEq)]
6412#[non_exhaustive]
6413pub struct SubscribeListingResponse {
6414 /// Subscription object created from this subscribe action.
6415 pub subscription: std::option::Option<crate::model::Subscription>,
6416
6417 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6418}
6419
6420impl SubscribeListingResponse {
6421 pub fn new() -> Self {
6422 std::default::Default::default()
6423 }
6424
6425 /// Sets the value of [subscription][crate::model::SubscribeListingResponse::subscription].
6426 ///
6427 /// # Example
6428 /// ```ignore,no_run
6429 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingResponse;
6430 /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6431 /// let x = SubscribeListingResponse::new().set_subscription(Subscription::default()/* use setters */);
6432 /// ```
6433 pub fn set_subscription<T>(mut self, v: T) -> Self
6434 where
6435 T: std::convert::Into<crate::model::Subscription>,
6436 {
6437 self.subscription = std::option::Option::Some(v.into());
6438 self
6439 }
6440
6441 /// Sets or clears the value of [subscription][crate::model::SubscribeListingResponse::subscription].
6442 ///
6443 /// # Example
6444 /// ```ignore,no_run
6445 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeListingResponse;
6446 /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6447 /// let x = SubscribeListingResponse::new().set_or_clear_subscription(Some(Subscription::default()/* use setters */));
6448 /// let x = SubscribeListingResponse::new().set_or_clear_subscription(None::<Subscription>);
6449 /// ```
6450 pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
6451 where
6452 T: std::convert::Into<crate::model::Subscription>,
6453 {
6454 self.subscription = v.map(|x| x.into());
6455 self
6456 }
6457}
6458
6459impl wkt::message::Message for SubscribeListingResponse {
6460 fn typename() -> &'static str {
6461 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse"
6462 }
6463}
6464
6465/// Message for subscribing to a Data Exchange.
6466#[derive(Clone, Default, PartialEq)]
6467#[non_exhaustive]
6468pub struct SubscribeDataExchangeRequest {
6469 /// Required. Resource name of the Data Exchange.
6470 /// e.g. `projects/publisherproject/locations/us/dataExchanges/123`
6471 pub name: std::string::String,
6472
6473 /// Required. The parent resource path of the Subscription.
6474 /// e.g. `projects/subscriberproject/locations/us`
6475 pub destination: std::string::String,
6476
6477 /// Optional. BigQuery destination dataset to create for the subscriber.
6478 pub destination_dataset: std::option::Option<crate::model::DestinationDataset>,
6479
6480 /// Required. Name of the subscription to create.
6481 /// e.g. `subscription1`
6482 pub subscription: std::string::String,
6483
6484 /// Email of the subscriber.
6485 pub subscriber_contact: std::string::String,
6486
6487 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6488}
6489
6490impl SubscribeDataExchangeRequest {
6491 pub fn new() -> Self {
6492 std::default::Default::default()
6493 }
6494
6495 /// Sets the value of [name][crate::model::SubscribeDataExchangeRequest::name].
6496 ///
6497 /// # Example
6498 /// ```ignore,no_run
6499 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6500 /// let x = SubscribeDataExchangeRequest::new().set_name("example");
6501 /// ```
6502 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6503 self.name = v.into();
6504 self
6505 }
6506
6507 /// Sets the value of [destination][crate::model::SubscribeDataExchangeRequest::destination].
6508 ///
6509 /// # Example
6510 /// ```ignore,no_run
6511 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6512 /// let x = SubscribeDataExchangeRequest::new().set_destination("example");
6513 /// ```
6514 pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6515 self.destination = v.into();
6516 self
6517 }
6518
6519 /// Sets the value of [destination_dataset][crate::model::SubscribeDataExchangeRequest::destination_dataset].
6520 ///
6521 /// # Example
6522 /// ```ignore,no_run
6523 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6524 /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6525 /// let x = SubscribeDataExchangeRequest::new().set_destination_dataset(DestinationDataset::default()/* use setters */);
6526 /// ```
6527 pub fn set_destination_dataset<T>(mut self, v: T) -> Self
6528 where
6529 T: std::convert::Into<crate::model::DestinationDataset>,
6530 {
6531 self.destination_dataset = std::option::Option::Some(v.into());
6532 self
6533 }
6534
6535 /// Sets or clears the value of [destination_dataset][crate::model::SubscribeDataExchangeRequest::destination_dataset].
6536 ///
6537 /// # Example
6538 /// ```ignore,no_run
6539 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6540 /// use google_cloud_bigquery_analyticshub_v1::model::DestinationDataset;
6541 /// let x = SubscribeDataExchangeRequest::new().set_or_clear_destination_dataset(Some(DestinationDataset::default()/* use setters */));
6542 /// let x = SubscribeDataExchangeRequest::new().set_or_clear_destination_dataset(None::<DestinationDataset>);
6543 /// ```
6544 pub fn set_or_clear_destination_dataset<T>(mut self, v: std::option::Option<T>) -> Self
6545 where
6546 T: std::convert::Into<crate::model::DestinationDataset>,
6547 {
6548 self.destination_dataset = v.map(|x| x.into());
6549 self
6550 }
6551
6552 /// Sets the value of [subscription][crate::model::SubscribeDataExchangeRequest::subscription].
6553 ///
6554 /// # Example
6555 /// ```ignore,no_run
6556 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6557 /// let x = SubscribeDataExchangeRequest::new().set_subscription("example");
6558 /// ```
6559 pub fn set_subscription<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6560 self.subscription = v.into();
6561 self
6562 }
6563
6564 /// Sets the value of [subscriber_contact][crate::model::SubscribeDataExchangeRequest::subscriber_contact].
6565 ///
6566 /// # Example
6567 /// ```ignore,no_run
6568 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeRequest;
6569 /// let x = SubscribeDataExchangeRequest::new().set_subscriber_contact("example");
6570 /// ```
6571 pub fn set_subscriber_contact<T: std::convert::Into<std::string::String>>(
6572 mut self,
6573 v: T,
6574 ) -> Self {
6575 self.subscriber_contact = v.into();
6576 self
6577 }
6578}
6579
6580impl wkt::message::Message for SubscribeDataExchangeRequest {
6581 fn typename() -> &'static str {
6582 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeDataExchangeRequest"
6583 }
6584}
6585
6586/// Message for response when you subscribe to a Data Exchange.
6587#[derive(Clone, Default, PartialEq)]
6588#[non_exhaustive]
6589pub struct SubscribeDataExchangeResponse {
6590 /// Subscription object created from this subscribe action.
6591 pub subscription: std::option::Option<crate::model::Subscription>,
6592
6593 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6594}
6595
6596impl SubscribeDataExchangeResponse {
6597 pub fn new() -> Self {
6598 std::default::Default::default()
6599 }
6600
6601 /// Sets the value of [subscription][crate::model::SubscribeDataExchangeResponse::subscription].
6602 ///
6603 /// # Example
6604 /// ```ignore,no_run
6605 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeResponse;
6606 /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6607 /// let x = SubscribeDataExchangeResponse::new().set_subscription(Subscription::default()/* use setters */);
6608 /// ```
6609 pub fn set_subscription<T>(mut self, v: T) -> Self
6610 where
6611 T: std::convert::Into<crate::model::Subscription>,
6612 {
6613 self.subscription = std::option::Option::Some(v.into());
6614 self
6615 }
6616
6617 /// Sets or clears the value of [subscription][crate::model::SubscribeDataExchangeResponse::subscription].
6618 ///
6619 /// # Example
6620 /// ```ignore,no_run
6621 /// # use google_cloud_bigquery_analyticshub_v1::model::SubscribeDataExchangeResponse;
6622 /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6623 /// let x = SubscribeDataExchangeResponse::new().set_or_clear_subscription(Some(Subscription::default()/* use setters */));
6624 /// let x = SubscribeDataExchangeResponse::new().set_or_clear_subscription(None::<Subscription>);
6625 /// ```
6626 pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
6627 where
6628 T: std::convert::Into<crate::model::Subscription>,
6629 {
6630 self.subscription = v.map(|x| x.into());
6631 self
6632 }
6633}
6634
6635impl wkt::message::Message for SubscribeDataExchangeResponse {
6636 fn typename() -> &'static str {
6637 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.SubscribeDataExchangeResponse"
6638 }
6639}
6640
6641/// Message for refreshing a subscription.
6642#[derive(Clone, Default, PartialEq)]
6643#[non_exhaustive]
6644pub struct RefreshSubscriptionRequest {
6645 /// Required. Resource name of the Subscription to refresh.
6646 /// e.g. `projects/subscriberproject/locations/us/subscriptions/123`
6647 pub name: std::string::String,
6648
6649 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6650}
6651
6652impl RefreshSubscriptionRequest {
6653 pub fn new() -> Self {
6654 std::default::Default::default()
6655 }
6656
6657 /// Sets the value of [name][crate::model::RefreshSubscriptionRequest::name].
6658 ///
6659 /// # Example
6660 /// ```ignore,no_run
6661 /// # use google_cloud_bigquery_analyticshub_v1::model::RefreshSubscriptionRequest;
6662 /// let x = RefreshSubscriptionRequest::new().set_name("example");
6663 /// ```
6664 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6665 self.name = v.into();
6666 self
6667 }
6668}
6669
6670impl wkt::message::Message for RefreshSubscriptionRequest {
6671 fn typename() -> &'static str {
6672 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RefreshSubscriptionRequest"
6673 }
6674}
6675
6676/// Message for response when you refresh a subscription.
6677#[derive(Clone, Default, PartialEq)]
6678#[non_exhaustive]
6679pub struct RefreshSubscriptionResponse {
6680 /// The refreshed subscription resource.
6681 pub subscription: std::option::Option<crate::model::Subscription>,
6682
6683 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6684}
6685
6686impl RefreshSubscriptionResponse {
6687 pub fn new() -> Self {
6688 std::default::Default::default()
6689 }
6690
6691 /// Sets the value of [subscription][crate::model::RefreshSubscriptionResponse::subscription].
6692 ///
6693 /// # Example
6694 /// ```ignore,no_run
6695 /// # use google_cloud_bigquery_analyticshub_v1::model::RefreshSubscriptionResponse;
6696 /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6697 /// let x = RefreshSubscriptionResponse::new().set_subscription(Subscription::default()/* use setters */);
6698 /// ```
6699 pub fn set_subscription<T>(mut self, v: T) -> Self
6700 where
6701 T: std::convert::Into<crate::model::Subscription>,
6702 {
6703 self.subscription = std::option::Option::Some(v.into());
6704 self
6705 }
6706
6707 /// Sets or clears the value of [subscription][crate::model::RefreshSubscriptionResponse::subscription].
6708 ///
6709 /// # Example
6710 /// ```ignore,no_run
6711 /// # use google_cloud_bigquery_analyticshub_v1::model::RefreshSubscriptionResponse;
6712 /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6713 /// let x = RefreshSubscriptionResponse::new().set_or_clear_subscription(Some(Subscription::default()/* use setters */));
6714 /// let x = RefreshSubscriptionResponse::new().set_or_clear_subscription(None::<Subscription>);
6715 /// ```
6716 pub fn set_or_clear_subscription<T>(mut self, v: std::option::Option<T>) -> Self
6717 where
6718 T: std::convert::Into<crate::model::Subscription>,
6719 {
6720 self.subscription = v.map(|x| x.into());
6721 self
6722 }
6723}
6724
6725impl wkt::message::Message for RefreshSubscriptionResponse {
6726 fn typename() -> &'static str {
6727 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RefreshSubscriptionResponse"
6728 }
6729}
6730
6731/// Message for getting a subscription.
6732#[derive(Clone, Default, PartialEq)]
6733#[non_exhaustive]
6734pub struct GetSubscriptionRequest {
6735 /// Required. Resource name of the subscription.
6736 /// e.g. projects/123/locations/us/subscriptions/456
6737 pub name: std::string::String,
6738
6739 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6740}
6741
6742impl GetSubscriptionRequest {
6743 pub fn new() -> Self {
6744 std::default::Default::default()
6745 }
6746
6747 /// Sets the value of [name][crate::model::GetSubscriptionRequest::name].
6748 ///
6749 /// # Example
6750 /// ```ignore,no_run
6751 /// # use google_cloud_bigquery_analyticshub_v1::model::GetSubscriptionRequest;
6752 /// let x = GetSubscriptionRequest::new().set_name("example");
6753 /// ```
6754 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6755 self.name = v.into();
6756 self
6757 }
6758}
6759
6760impl wkt::message::Message for GetSubscriptionRequest {
6761 fn typename() -> &'static str {
6762 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.GetSubscriptionRequest"
6763 }
6764}
6765
6766/// Message for listing subscriptions.
6767#[derive(Clone, Default, PartialEq)]
6768#[non_exhaustive]
6769pub struct ListSubscriptionsRequest {
6770 /// Required. The parent resource path of the subscription.
6771 /// e.g. projects/myproject/locations/us
6772 pub parent: std::string::String,
6773
6774 /// An expression for filtering the results of the request. Eligible
6775 /// fields for filtering are:
6776 ///
6777 /// + `listing`
6778 /// + `data_exchange`
6779 ///
6780 /// Alternatively, a literal wrapped in double quotes may be provided.
6781 /// This will be checked for an exact match against both fields above.
6782 ///
6783 /// In all cases, the full Data Exchange or Listing resource name must
6784 /// be provided. Some example of using filters:
6785 ///
6786 /// + data_exchange="projects/myproject/locations/us/dataExchanges/123"
6787 /// + listing="projects/123/locations/us/dataExchanges/456/listings/789"
6788 /// + "projects/myproject/locations/us/dataExchanges/123"
6789 pub filter: std::string::String,
6790
6791 /// The maximum number of results to return in a single response page.
6792 pub page_size: i32,
6793
6794 /// Page token, returned by a previous call.
6795 pub page_token: std::string::String,
6796
6797 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6798}
6799
6800impl ListSubscriptionsRequest {
6801 pub fn new() -> Self {
6802 std::default::Default::default()
6803 }
6804
6805 /// Sets the value of [parent][crate::model::ListSubscriptionsRequest::parent].
6806 ///
6807 /// # Example
6808 /// ```ignore,no_run
6809 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
6810 /// let x = ListSubscriptionsRequest::new().set_parent("example");
6811 /// ```
6812 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6813 self.parent = v.into();
6814 self
6815 }
6816
6817 /// Sets the value of [filter][crate::model::ListSubscriptionsRequest::filter].
6818 ///
6819 /// # Example
6820 /// ```ignore,no_run
6821 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
6822 /// let x = ListSubscriptionsRequest::new().set_filter("example");
6823 /// ```
6824 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6825 self.filter = v.into();
6826 self
6827 }
6828
6829 /// Sets the value of [page_size][crate::model::ListSubscriptionsRequest::page_size].
6830 ///
6831 /// # Example
6832 /// ```ignore,no_run
6833 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
6834 /// let x = ListSubscriptionsRequest::new().set_page_size(42);
6835 /// ```
6836 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6837 self.page_size = v.into();
6838 self
6839 }
6840
6841 /// Sets the value of [page_token][crate::model::ListSubscriptionsRequest::page_token].
6842 ///
6843 /// # Example
6844 /// ```ignore,no_run
6845 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsRequest;
6846 /// let x = ListSubscriptionsRequest::new().set_page_token("example");
6847 /// ```
6848 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6849 self.page_token = v.into();
6850 self
6851 }
6852}
6853
6854impl wkt::message::Message for ListSubscriptionsRequest {
6855 fn typename() -> &'static str {
6856 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSubscriptionsRequest"
6857 }
6858}
6859
6860/// Message for response to the listing of subscriptions.
6861#[derive(Clone, Default, PartialEq)]
6862#[non_exhaustive]
6863pub struct ListSubscriptionsResponse {
6864 /// The list of subscriptions.
6865 pub subscriptions: std::vec::Vec<crate::model::Subscription>,
6866
6867 /// Next page token.
6868 pub next_page_token: std::string::String,
6869
6870 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6871}
6872
6873impl ListSubscriptionsResponse {
6874 pub fn new() -> Self {
6875 std::default::Default::default()
6876 }
6877
6878 /// Sets the value of [subscriptions][crate::model::ListSubscriptionsResponse::subscriptions].
6879 ///
6880 /// # Example
6881 /// ```ignore,no_run
6882 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsResponse;
6883 /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
6884 /// let x = ListSubscriptionsResponse::new()
6885 /// .set_subscriptions([
6886 /// Subscription::default()/* use setters */,
6887 /// Subscription::default()/* use (different) setters */,
6888 /// ]);
6889 /// ```
6890 pub fn set_subscriptions<T, V>(mut self, v: T) -> Self
6891 where
6892 T: std::iter::IntoIterator<Item = V>,
6893 V: std::convert::Into<crate::model::Subscription>,
6894 {
6895 use std::iter::Iterator;
6896 self.subscriptions = v.into_iter().map(|i| i.into()).collect();
6897 self
6898 }
6899
6900 /// Sets the value of [next_page_token][crate::model::ListSubscriptionsResponse::next_page_token].
6901 ///
6902 /// # Example
6903 /// ```ignore,no_run
6904 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSubscriptionsResponse;
6905 /// let x = ListSubscriptionsResponse::new().set_next_page_token("example");
6906 /// ```
6907 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6908 self.next_page_token = v.into();
6909 self
6910 }
6911}
6912
6913impl wkt::message::Message for ListSubscriptionsResponse {
6914 fn typename() -> &'static str {
6915 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSubscriptionsResponse"
6916 }
6917}
6918
6919#[doc(hidden)]
6920impl google_cloud_gax::paginator::internal::PageableResponse for ListSubscriptionsResponse {
6921 type PageItem = crate::model::Subscription;
6922
6923 fn items(self) -> std::vec::Vec<Self::PageItem> {
6924 self.subscriptions
6925 }
6926
6927 fn next_page_token(&self) -> std::string::String {
6928 use std::clone::Clone;
6929 self.next_page_token.clone()
6930 }
6931}
6932
6933/// Message for listing subscriptions of a shared resource.
6934#[derive(Clone, Default, PartialEq)]
6935#[non_exhaustive]
6936pub struct ListSharedResourceSubscriptionsRequest {
6937 /// Required. Resource name of the requested target. This resource may be
6938 /// either a Listing or a DataExchange. e.g.
6939 /// projects/123/locations/us/dataExchanges/456 OR e.g.
6940 /// projects/123/locations/us/dataExchanges/456/listings/789
6941 pub resource: std::string::String,
6942
6943 /// If selected, includes deleted subscriptions in the response
6944 /// (up to 63 days after deletion).
6945 pub include_deleted_subscriptions: bool,
6946
6947 /// The maximum number of results to return in a single response page.
6948 pub page_size: i32,
6949
6950 /// Page token, returned by a previous call.
6951 pub page_token: std::string::String,
6952
6953 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6954}
6955
6956impl ListSharedResourceSubscriptionsRequest {
6957 pub fn new() -> Self {
6958 std::default::Default::default()
6959 }
6960
6961 /// Sets the value of [resource][crate::model::ListSharedResourceSubscriptionsRequest::resource].
6962 ///
6963 /// # Example
6964 /// ```ignore,no_run
6965 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
6966 /// let x = ListSharedResourceSubscriptionsRequest::new().set_resource("example");
6967 /// ```
6968 pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6969 self.resource = v.into();
6970 self
6971 }
6972
6973 /// Sets the value of [include_deleted_subscriptions][crate::model::ListSharedResourceSubscriptionsRequest::include_deleted_subscriptions].
6974 ///
6975 /// # Example
6976 /// ```ignore,no_run
6977 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
6978 /// let x = ListSharedResourceSubscriptionsRequest::new().set_include_deleted_subscriptions(true);
6979 /// ```
6980 pub fn set_include_deleted_subscriptions<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6981 self.include_deleted_subscriptions = v.into();
6982 self
6983 }
6984
6985 /// Sets the value of [page_size][crate::model::ListSharedResourceSubscriptionsRequest::page_size].
6986 ///
6987 /// # Example
6988 /// ```ignore,no_run
6989 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
6990 /// let x = ListSharedResourceSubscriptionsRequest::new().set_page_size(42);
6991 /// ```
6992 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6993 self.page_size = v.into();
6994 self
6995 }
6996
6997 /// Sets the value of [page_token][crate::model::ListSharedResourceSubscriptionsRequest::page_token].
6998 ///
6999 /// # Example
7000 /// ```ignore,no_run
7001 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsRequest;
7002 /// let x = ListSharedResourceSubscriptionsRequest::new().set_page_token("example");
7003 /// ```
7004 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7005 self.page_token = v.into();
7006 self
7007 }
7008}
7009
7010impl wkt::message::Message for ListSharedResourceSubscriptionsRequest {
7011 fn typename() -> &'static str {
7012 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSharedResourceSubscriptionsRequest"
7013 }
7014}
7015
7016/// Message for response to the listing of shared resource subscriptions.
7017#[derive(Clone, Default, PartialEq)]
7018#[non_exhaustive]
7019pub struct ListSharedResourceSubscriptionsResponse {
7020 /// The list of subscriptions.
7021 pub shared_resource_subscriptions: std::vec::Vec<crate::model::Subscription>,
7022
7023 /// Next page token.
7024 pub next_page_token: std::string::String,
7025
7026 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7027}
7028
7029impl ListSharedResourceSubscriptionsResponse {
7030 pub fn new() -> Self {
7031 std::default::Default::default()
7032 }
7033
7034 /// Sets the value of [shared_resource_subscriptions][crate::model::ListSharedResourceSubscriptionsResponse::shared_resource_subscriptions].
7035 ///
7036 /// # Example
7037 /// ```ignore,no_run
7038 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsResponse;
7039 /// use google_cloud_bigquery_analyticshub_v1::model::Subscription;
7040 /// let x = ListSharedResourceSubscriptionsResponse::new()
7041 /// .set_shared_resource_subscriptions([
7042 /// Subscription::default()/* use setters */,
7043 /// Subscription::default()/* use (different) setters */,
7044 /// ]);
7045 /// ```
7046 pub fn set_shared_resource_subscriptions<T, V>(mut self, v: T) -> Self
7047 where
7048 T: std::iter::IntoIterator<Item = V>,
7049 V: std::convert::Into<crate::model::Subscription>,
7050 {
7051 use std::iter::Iterator;
7052 self.shared_resource_subscriptions = v.into_iter().map(|i| i.into()).collect();
7053 self
7054 }
7055
7056 /// Sets the value of [next_page_token][crate::model::ListSharedResourceSubscriptionsResponse::next_page_token].
7057 ///
7058 /// # Example
7059 /// ```ignore,no_run
7060 /// # use google_cloud_bigquery_analyticshub_v1::model::ListSharedResourceSubscriptionsResponse;
7061 /// let x = ListSharedResourceSubscriptionsResponse::new().set_next_page_token("example");
7062 /// ```
7063 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7064 self.next_page_token = v.into();
7065 self
7066 }
7067}
7068
7069impl wkt::message::Message for ListSharedResourceSubscriptionsResponse {
7070 fn typename() -> &'static str {
7071 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ListSharedResourceSubscriptionsResponse"
7072 }
7073}
7074
7075#[doc(hidden)]
7076impl google_cloud_gax::paginator::internal::PageableResponse
7077 for ListSharedResourceSubscriptionsResponse
7078{
7079 type PageItem = crate::model::Subscription;
7080
7081 fn items(self) -> std::vec::Vec<Self::PageItem> {
7082 self.shared_resource_subscriptions
7083 }
7084
7085 fn next_page_token(&self) -> std::string::String {
7086 use std::clone::Clone;
7087 self.next_page_token.clone()
7088 }
7089}
7090
7091/// Message for revoking a subscription.
7092#[derive(Clone, Default, PartialEq)]
7093#[non_exhaustive]
7094pub struct RevokeSubscriptionRequest {
7095 /// Required. Resource name of the subscription to revoke.
7096 /// e.g. projects/123/locations/us/subscriptions/456
7097 pub name: std::string::String,
7098
7099 /// Optional. If the subscription is commercial then this field must be set to
7100 /// true, otherwise a failure is thrown. This acts as a safety guard to avoid
7101 /// revoking commercial subscriptions accidentally.
7102 pub revoke_commercial: bool,
7103
7104 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7105}
7106
7107impl RevokeSubscriptionRequest {
7108 pub fn new() -> Self {
7109 std::default::Default::default()
7110 }
7111
7112 /// Sets the value of [name][crate::model::RevokeSubscriptionRequest::name].
7113 ///
7114 /// # Example
7115 /// ```ignore,no_run
7116 /// # use google_cloud_bigquery_analyticshub_v1::model::RevokeSubscriptionRequest;
7117 /// let x = RevokeSubscriptionRequest::new().set_name("example");
7118 /// ```
7119 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7120 self.name = v.into();
7121 self
7122 }
7123
7124 /// Sets the value of [revoke_commercial][crate::model::RevokeSubscriptionRequest::revoke_commercial].
7125 ///
7126 /// # Example
7127 /// ```ignore,no_run
7128 /// # use google_cloud_bigquery_analyticshub_v1::model::RevokeSubscriptionRequest;
7129 /// let x = RevokeSubscriptionRequest::new().set_revoke_commercial(true);
7130 /// ```
7131 pub fn set_revoke_commercial<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7132 self.revoke_commercial = v.into();
7133 self
7134 }
7135}
7136
7137impl wkt::message::Message for RevokeSubscriptionRequest {
7138 fn typename() -> &'static str {
7139 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RevokeSubscriptionRequest"
7140 }
7141}
7142
7143/// Message for response when you revoke a subscription.
7144/// Empty for now.
7145#[derive(Clone, Default, PartialEq)]
7146#[non_exhaustive]
7147pub struct RevokeSubscriptionResponse {
7148 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7149}
7150
7151impl RevokeSubscriptionResponse {
7152 pub fn new() -> Self {
7153 std::default::Default::default()
7154 }
7155}
7156
7157impl wkt::message::Message for RevokeSubscriptionResponse {
7158 fn typename() -> &'static str {
7159 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RevokeSubscriptionResponse"
7160 }
7161}
7162
7163/// Message for deleting a subscription.
7164#[derive(Clone, Default, PartialEq)]
7165#[non_exhaustive]
7166pub struct DeleteSubscriptionRequest {
7167 /// Required. Resource name of the subscription to delete.
7168 /// e.g. projects/123/locations/us/subscriptions/456
7169 pub name: std::string::String,
7170
7171 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7172}
7173
7174impl DeleteSubscriptionRequest {
7175 pub fn new() -> Self {
7176 std::default::Default::default()
7177 }
7178
7179 /// Sets the value of [name][crate::model::DeleteSubscriptionRequest::name].
7180 ///
7181 /// # Example
7182 /// ```ignore,no_run
7183 /// # use google_cloud_bigquery_analyticshub_v1::model::DeleteSubscriptionRequest;
7184 /// let x = DeleteSubscriptionRequest::new().set_name("example");
7185 /// ```
7186 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7187 self.name = v.into();
7188 self
7189 }
7190}
7191
7192impl wkt::message::Message for DeleteSubscriptionRequest {
7193 fn typename() -> &'static str {
7194 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeleteSubscriptionRequest"
7195 }
7196}
7197
7198/// Represents the metadata of a long-running operation in Analytics Hub.
7199#[derive(Clone, Default, PartialEq)]
7200#[non_exhaustive]
7201pub struct OperationMetadata {
7202 /// Output only. The time the operation was created.
7203 pub create_time: std::option::Option<wkt::Timestamp>,
7204
7205 /// Output only. The time the operation finished running.
7206 pub end_time: std::option::Option<wkt::Timestamp>,
7207
7208 /// Output only. Server-defined resource path for the target of the operation.
7209 pub target: std::string::String,
7210
7211 /// Output only. Name of the verb executed by the operation.
7212 pub verb: std::string::String,
7213
7214 /// Output only. Human-readable status of the operation, if any.
7215 pub status_message: std::string::String,
7216
7217 /// Output only. Identifies whether the user has requested cancellation
7218 /// of the operation. Operations that have successfully been cancelled
7219 /// have [Operation.error][] value with a
7220 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
7221 /// `Code.CANCELLED`.
7222 ///
7223 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
7224 pub requested_cancellation: bool,
7225
7226 /// Output only. API version used to start the operation.
7227 pub api_version: std::string::String,
7228
7229 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7230}
7231
7232impl OperationMetadata {
7233 pub fn new() -> Self {
7234 std::default::Default::default()
7235 }
7236
7237 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
7238 ///
7239 /// # Example
7240 /// ```ignore,no_run
7241 /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7242 /// use wkt::Timestamp;
7243 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
7244 /// ```
7245 pub fn set_create_time<T>(mut self, v: T) -> Self
7246 where
7247 T: std::convert::Into<wkt::Timestamp>,
7248 {
7249 self.create_time = std::option::Option::Some(v.into());
7250 self
7251 }
7252
7253 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
7254 ///
7255 /// # Example
7256 /// ```ignore,no_run
7257 /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7258 /// use wkt::Timestamp;
7259 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7260 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
7261 /// ```
7262 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7263 where
7264 T: std::convert::Into<wkt::Timestamp>,
7265 {
7266 self.create_time = v.map(|x| x.into());
7267 self
7268 }
7269
7270 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
7271 ///
7272 /// # Example
7273 /// ```ignore,no_run
7274 /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7275 /// use wkt::Timestamp;
7276 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
7277 /// ```
7278 pub fn set_end_time<T>(mut self, v: T) -> Self
7279 where
7280 T: std::convert::Into<wkt::Timestamp>,
7281 {
7282 self.end_time = std::option::Option::Some(v.into());
7283 self
7284 }
7285
7286 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
7287 ///
7288 /// # Example
7289 /// ```ignore,no_run
7290 /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7291 /// use wkt::Timestamp;
7292 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
7293 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
7294 /// ```
7295 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7296 where
7297 T: std::convert::Into<wkt::Timestamp>,
7298 {
7299 self.end_time = v.map(|x| x.into());
7300 self
7301 }
7302
7303 /// Sets the value of [target][crate::model::OperationMetadata::target].
7304 ///
7305 /// # Example
7306 /// ```ignore,no_run
7307 /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7308 /// let x = OperationMetadata::new().set_target("example");
7309 /// ```
7310 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7311 self.target = v.into();
7312 self
7313 }
7314
7315 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
7316 ///
7317 /// # Example
7318 /// ```ignore,no_run
7319 /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7320 /// let x = OperationMetadata::new().set_verb("example");
7321 /// ```
7322 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7323 self.verb = v.into();
7324 self
7325 }
7326
7327 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
7328 ///
7329 /// # Example
7330 /// ```ignore,no_run
7331 /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7332 /// let x = OperationMetadata::new().set_status_message("example");
7333 /// ```
7334 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7335 self.status_message = v.into();
7336 self
7337 }
7338
7339 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
7340 ///
7341 /// # Example
7342 /// ```ignore,no_run
7343 /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7344 /// let x = OperationMetadata::new().set_requested_cancellation(true);
7345 /// ```
7346 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7347 self.requested_cancellation = v.into();
7348 self
7349 }
7350
7351 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
7352 ///
7353 /// # Example
7354 /// ```ignore,no_run
7355 /// # use google_cloud_bigquery_analyticshub_v1::model::OperationMetadata;
7356 /// let x = OperationMetadata::new().set_api_version("example");
7357 /// ```
7358 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7359 self.api_version = v.into();
7360 self
7361 }
7362}
7363
7364impl wkt::message::Message for OperationMetadata {
7365 fn typename() -> &'static str {
7366 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.OperationMetadata"
7367 }
7368}
7369
7370/// Defines the destination Pub/Sub subscription.
7371/// If none of `push_config`, `bigquery_config`, `cloud_storage_config`,
7372/// `pubsub_export_config`, or `pubsublite_export_config`
7373/// is set, then the subscriber will pull and ack messages using API methods. At
7374/// most one of these fields may be set.
7375#[derive(Clone, Default, PartialEq)]
7376#[non_exhaustive]
7377pub struct PubSubSubscription {
7378 /// Required. Name of the subscription.
7379 /// Format is `projects/{project}/subscriptions/{sub}`.
7380 pub name: std::string::String,
7381
7382 /// Optional. If push delivery is used with this subscription, this field is
7383 /// used to configure it.
7384 pub push_config: std::option::Option<crate::model::PushConfig>,
7385
7386 /// Optional. If delivery to BigQuery is used with this subscription, this
7387 /// field is used to configure it.
7388 pub bigquery_config: std::option::Option<crate::model::BigQueryConfig>,
7389
7390 /// Optional. If delivery to Google Cloud Storage is used with this
7391 /// subscription, this field is used to configure it.
7392 pub cloud_storage_config: std::option::Option<crate::model::CloudStorageConfig>,
7393
7394 /// Optional. The approximate amount of time (on a best-effort basis) Pub/Sub
7395 /// waits for the subscriber to acknowledge receipt before resending the
7396 /// message. In the interval after the message is delivered and before it is
7397 /// acknowledged, it is considered to be _outstanding_. During that time
7398 /// period, the message will not be redelivered (on a best-effort basis).
7399 ///
7400 /// For pull subscriptions, this value is used as the initial value for the ack
7401 /// deadline. To override this value for a given message, call
7402 /// `ModifyAckDeadline` with the corresponding `ack_id` if using
7403 /// non-streaming pull or send the `ack_id` in a
7404 /// `StreamingModifyAckDeadlineRequest` if using streaming pull.
7405 /// The minimum custom deadline you can specify is 10 seconds.
7406 /// The maximum custom deadline you can specify is 600 seconds (10 minutes).
7407 /// If this parameter is 0, a default value of 10 seconds is used.
7408 ///
7409 /// For push delivery, this value is also used to set the request timeout for
7410 /// the call to the push endpoint.
7411 ///
7412 /// If the subscriber never acknowledges the message, the Pub/Sub
7413 /// system will eventually redeliver the message.
7414 pub ack_deadline_seconds: i32,
7415
7416 /// Optional. Indicates whether to retain acknowledged messages. If true, then
7417 /// messages are not expunged from the subscription's backlog, even if they are
7418 /// acknowledged, until they fall out of the `message_retention_duration`
7419 /// window. This must be true if you would like to [`Seek` to a timestamp]
7420 /// (<https://cloud.google.com/pubsub/docs/replay-overview#seek_to_a_time>) in
7421 /// the past to replay previously-acknowledged messages.
7422 pub retain_acked_messages: bool,
7423
7424 /// Optional. How long to retain unacknowledged messages in the subscription's
7425 /// backlog, from the moment a message is published. If `retain_acked_messages`
7426 /// is true, then this also configures the retention of acknowledged messages,
7427 /// and thus configures how far back in time a `Seek` can be done. Defaults to
7428 /// 7 days. Cannot be more than 31 days or less than 10 minutes.
7429 pub message_retention_duration: std::option::Option<wkt::Duration>,
7430
7431 /// Optional. See [Creating and managing
7432 /// labels](https://cloud.google.com/pubsub/docs/labels).
7433 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7434
7435 /// Optional. If true, messages published with the same `ordering_key` in
7436 /// `PubsubMessage` will be delivered to the subscribers in the order in which
7437 /// they are received by the Pub/Sub system. Otherwise, they may be delivered
7438 /// in any order.
7439 pub enable_message_ordering: bool,
7440
7441 /// Optional. A policy that specifies the conditions for this subscription's
7442 /// expiration. A subscription is considered active as long as any connected
7443 /// subscriber is successfully consuming messages from the subscription or is
7444 /// issuing operations on the subscription. If `expiration_policy` is not set,
7445 /// a *default policy* with `ttl` of 31 days will be used. The minimum allowed
7446 /// value for `expiration_policy.ttl` is 1 day. If `expiration_policy` is set,
7447 /// but `expiration_policy.ttl` is not set, the subscription never expires.
7448 pub expiration_policy: std::option::Option<crate::model::ExpirationPolicy>,
7449
7450 /// Optional. An expression written in the Pub/Sub [filter
7451 /// language](https://cloud.google.com/pubsub/docs/filtering). If non-empty,
7452 /// then only `PubsubMessage`s whose `attributes` field matches the filter are
7453 /// delivered on this subscription. If empty, then no messages are filtered
7454 /// out.
7455 pub filter: std::string::String,
7456
7457 /// Optional. A policy that specifies the conditions for dead lettering
7458 /// messages in this subscription. If dead_letter_policy is not set, dead
7459 /// lettering is disabled.
7460 ///
7461 /// The Pub/Sub service account associated with this subscriptions's
7462 /// parent project (i.e.,
7463 /// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
7464 /// permission to Acknowledge() messages on this subscription.
7465 pub dead_letter_policy: std::option::Option<crate::model::DeadLetterPolicy>,
7466
7467 /// Optional. A policy that specifies how Pub/Sub retries message delivery for
7468 /// this subscription.
7469 ///
7470 /// If not set, the default retry policy is applied. This generally implies
7471 /// that messages will be retried as soon as possible for healthy subscribers.
7472 /// RetryPolicy will be triggered on NACKs or acknowledgement deadline
7473 /// exceeded events for a given message.
7474 pub retry_policy: std::option::Option<crate::model::RetryPolicy>,
7475
7476 /// Optional. Indicates whether the subscription is detached from its topic.
7477 /// Detached subscriptions don't receive messages from their topic and don't
7478 /// retain any backlog. `Pull` and `StreamingPull` requests will return
7479 /// FAILED_PRECONDITION. If the subscription is a push subscription, pushes to
7480 /// the endpoint will not be made.
7481 pub detached: bool,
7482
7483 /// Optional. If true, Pub/Sub provides the following guarantees for the
7484 /// delivery of a message with a given value of `message_id` on this
7485 /// subscription:
7486 ///
7487 /// * The message sent to a subscriber is guaranteed not to be resent
7488 /// before the message's acknowledgement deadline expires.
7489 /// * An acknowledged message will not be resent to a subscriber.
7490 ///
7491 /// Note that subscribers may still receive multiple copies of a message
7492 /// when `enable_exactly_once_delivery` is true if the message was published
7493 /// multiple times by a publisher client. These copies are considered distinct
7494 /// by Pub/Sub and have distinct `message_id` values.
7495 pub enable_exactly_once_delivery: bool,
7496
7497 /// Optional. Transforms to be applied to messages before they are delivered to
7498 /// subscribers. Transforms are applied in the order specified.
7499 pub message_transforms: std::vec::Vec<crate::model::MessageTransform>,
7500
7501 /// Optional. Input only. Immutable. Tag keys/values directly bound to this
7502 /// resource. For example:
7503 /// "123/environment": "production",
7504 /// "123/costCenter": "marketing"
7505 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
7506
7507 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7508}
7509
7510impl PubSubSubscription {
7511 pub fn new() -> Self {
7512 std::default::Default::default()
7513 }
7514
7515 /// Sets the value of [name][crate::model::PubSubSubscription::name].
7516 ///
7517 /// # Example
7518 /// ```ignore,no_run
7519 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7520 /// let x = PubSubSubscription::new().set_name("example");
7521 /// ```
7522 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7523 self.name = v.into();
7524 self
7525 }
7526
7527 /// Sets the value of [push_config][crate::model::PubSubSubscription::push_config].
7528 ///
7529 /// # Example
7530 /// ```ignore,no_run
7531 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7532 /// use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
7533 /// let x = PubSubSubscription::new().set_push_config(PushConfig::default()/* use setters */);
7534 /// ```
7535 pub fn set_push_config<T>(mut self, v: T) -> Self
7536 where
7537 T: std::convert::Into<crate::model::PushConfig>,
7538 {
7539 self.push_config = std::option::Option::Some(v.into());
7540 self
7541 }
7542
7543 /// Sets or clears the value of [push_config][crate::model::PubSubSubscription::push_config].
7544 ///
7545 /// # Example
7546 /// ```ignore,no_run
7547 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7548 /// use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
7549 /// let x = PubSubSubscription::new().set_or_clear_push_config(Some(PushConfig::default()/* use setters */));
7550 /// let x = PubSubSubscription::new().set_or_clear_push_config(None::<PushConfig>);
7551 /// ```
7552 pub fn set_or_clear_push_config<T>(mut self, v: std::option::Option<T>) -> Self
7553 where
7554 T: std::convert::Into<crate::model::PushConfig>,
7555 {
7556 self.push_config = v.map(|x| x.into());
7557 self
7558 }
7559
7560 /// Sets the value of [bigquery_config][crate::model::PubSubSubscription::bigquery_config].
7561 ///
7562 /// # Example
7563 /// ```ignore,no_run
7564 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7565 /// use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
7566 /// let x = PubSubSubscription::new().set_bigquery_config(BigQueryConfig::default()/* use setters */);
7567 /// ```
7568 pub fn set_bigquery_config<T>(mut self, v: T) -> Self
7569 where
7570 T: std::convert::Into<crate::model::BigQueryConfig>,
7571 {
7572 self.bigquery_config = std::option::Option::Some(v.into());
7573 self
7574 }
7575
7576 /// Sets or clears the value of [bigquery_config][crate::model::PubSubSubscription::bigquery_config].
7577 ///
7578 /// # Example
7579 /// ```ignore,no_run
7580 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7581 /// use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
7582 /// let x = PubSubSubscription::new().set_or_clear_bigquery_config(Some(BigQueryConfig::default()/* use setters */));
7583 /// let x = PubSubSubscription::new().set_or_clear_bigquery_config(None::<BigQueryConfig>);
7584 /// ```
7585 pub fn set_or_clear_bigquery_config<T>(mut self, v: std::option::Option<T>) -> Self
7586 where
7587 T: std::convert::Into<crate::model::BigQueryConfig>,
7588 {
7589 self.bigquery_config = v.map(|x| x.into());
7590 self
7591 }
7592
7593 /// Sets the value of [cloud_storage_config][crate::model::PubSubSubscription::cloud_storage_config].
7594 ///
7595 /// # Example
7596 /// ```ignore,no_run
7597 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7598 /// use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
7599 /// let x = PubSubSubscription::new().set_cloud_storage_config(CloudStorageConfig::default()/* use setters */);
7600 /// ```
7601 pub fn set_cloud_storage_config<T>(mut self, v: T) -> Self
7602 where
7603 T: std::convert::Into<crate::model::CloudStorageConfig>,
7604 {
7605 self.cloud_storage_config = std::option::Option::Some(v.into());
7606 self
7607 }
7608
7609 /// Sets or clears the value of [cloud_storage_config][crate::model::PubSubSubscription::cloud_storage_config].
7610 ///
7611 /// # Example
7612 /// ```ignore,no_run
7613 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7614 /// use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
7615 /// let x = PubSubSubscription::new().set_or_clear_cloud_storage_config(Some(CloudStorageConfig::default()/* use setters */));
7616 /// let x = PubSubSubscription::new().set_or_clear_cloud_storage_config(None::<CloudStorageConfig>);
7617 /// ```
7618 pub fn set_or_clear_cloud_storage_config<T>(mut self, v: std::option::Option<T>) -> Self
7619 where
7620 T: std::convert::Into<crate::model::CloudStorageConfig>,
7621 {
7622 self.cloud_storage_config = v.map(|x| x.into());
7623 self
7624 }
7625
7626 /// Sets the value of [ack_deadline_seconds][crate::model::PubSubSubscription::ack_deadline_seconds].
7627 ///
7628 /// # Example
7629 /// ```ignore,no_run
7630 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7631 /// let x = PubSubSubscription::new().set_ack_deadline_seconds(42);
7632 /// ```
7633 pub fn set_ack_deadline_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7634 self.ack_deadline_seconds = v.into();
7635 self
7636 }
7637
7638 /// Sets the value of [retain_acked_messages][crate::model::PubSubSubscription::retain_acked_messages].
7639 ///
7640 /// # Example
7641 /// ```ignore,no_run
7642 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7643 /// let x = PubSubSubscription::new().set_retain_acked_messages(true);
7644 /// ```
7645 pub fn set_retain_acked_messages<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7646 self.retain_acked_messages = v.into();
7647 self
7648 }
7649
7650 /// Sets the value of [message_retention_duration][crate::model::PubSubSubscription::message_retention_duration].
7651 ///
7652 /// # Example
7653 /// ```ignore,no_run
7654 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7655 /// use wkt::Duration;
7656 /// let x = PubSubSubscription::new().set_message_retention_duration(Duration::default()/* use setters */);
7657 /// ```
7658 pub fn set_message_retention_duration<T>(mut self, v: T) -> Self
7659 where
7660 T: std::convert::Into<wkt::Duration>,
7661 {
7662 self.message_retention_duration = std::option::Option::Some(v.into());
7663 self
7664 }
7665
7666 /// Sets or clears the value of [message_retention_duration][crate::model::PubSubSubscription::message_retention_duration].
7667 ///
7668 /// # Example
7669 /// ```ignore,no_run
7670 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7671 /// use wkt::Duration;
7672 /// let x = PubSubSubscription::new().set_or_clear_message_retention_duration(Some(Duration::default()/* use setters */));
7673 /// let x = PubSubSubscription::new().set_or_clear_message_retention_duration(None::<Duration>);
7674 /// ```
7675 pub fn set_or_clear_message_retention_duration<T>(mut self, v: std::option::Option<T>) -> Self
7676 where
7677 T: std::convert::Into<wkt::Duration>,
7678 {
7679 self.message_retention_duration = v.map(|x| x.into());
7680 self
7681 }
7682
7683 /// Sets the value of [labels][crate::model::PubSubSubscription::labels].
7684 ///
7685 /// # Example
7686 /// ```ignore,no_run
7687 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7688 /// let x = PubSubSubscription::new().set_labels([
7689 /// ("key0", "abc"),
7690 /// ("key1", "xyz"),
7691 /// ]);
7692 /// ```
7693 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7694 where
7695 T: std::iter::IntoIterator<Item = (K, V)>,
7696 K: std::convert::Into<std::string::String>,
7697 V: std::convert::Into<std::string::String>,
7698 {
7699 use std::iter::Iterator;
7700 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7701 self
7702 }
7703
7704 /// Sets the value of [enable_message_ordering][crate::model::PubSubSubscription::enable_message_ordering].
7705 ///
7706 /// # Example
7707 /// ```ignore,no_run
7708 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7709 /// let x = PubSubSubscription::new().set_enable_message_ordering(true);
7710 /// ```
7711 pub fn set_enable_message_ordering<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7712 self.enable_message_ordering = v.into();
7713 self
7714 }
7715
7716 /// Sets the value of [expiration_policy][crate::model::PubSubSubscription::expiration_policy].
7717 ///
7718 /// # Example
7719 /// ```ignore,no_run
7720 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7721 /// use google_cloud_bigquery_analyticshub_v1::model::ExpirationPolicy;
7722 /// let x = PubSubSubscription::new().set_expiration_policy(ExpirationPolicy::default()/* use setters */);
7723 /// ```
7724 pub fn set_expiration_policy<T>(mut self, v: T) -> Self
7725 where
7726 T: std::convert::Into<crate::model::ExpirationPolicy>,
7727 {
7728 self.expiration_policy = std::option::Option::Some(v.into());
7729 self
7730 }
7731
7732 /// Sets or clears the value of [expiration_policy][crate::model::PubSubSubscription::expiration_policy].
7733 ///
7734 /// # Example
7735 /// ```ignore,no_run
7736 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7737 /// use google_cloud_bigquery_analyticshub_v1::model::ExpirationPolicy;
7738 /// let x = PubSubSubscription::new().set_or_clear_expiration_policy(Some(ExpirationPolicy::default()/* use setters */));
7739 /// let x = PubSubSubscription::new().set_or_clear_expiration_policy(None::<ExpirationPolicy>);
7740 /// ```
7741 pub fn set_or_clear_expiration_policy<T>(mut self, v: std::option::Option<T>) -> Self
7742 where
7743 T: std::convert::Into<crate::model::ExpirationPolicy>,
7744 {
7745 self.expiration_policy = v.map(|x| x.into());
7746 self
7747 }
7748
7749 /// Sets the value of [filter][crate::model::PubSubSubscription::filter].
7750 ///
7751 /// # Example
7752 /// ```ignore,no_run
7753 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7754 /// let x = PubSubSubscription::new().set_filter("example");
7755 /// ```
7756 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7757 self.filter = v.into();
7758 self
7759 }
7760
7761 /// Sets the value of [dead_letter_policy][crate::model::PubSubSubscription::dead_letter_policy].
7762 ///
7763 /// # Example
7764 /// ```ignore,no_run
7765 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7766 /// use google_cloud_bigquery_analyticshub_v1::model::DeadLetterPolicy;
7767 /// let x = PubSubSubscription::new().set_dead_letter_policy(DeadLetterPolicy::default()/* use setters */);
7768 /// ```
7769 pub fn set_dead_letter_policy<T>(mut self, v: T) -> Self
7770 where
7771 T: std::convert::Into<crate::model::DeadLetterPolicy>,
7772 {
7773 self.dead_letter_policy = std::option::Option::Some(v.into());
7774 self
7775 }
7776
7777 /// Sets or clears the value of [dead_letter_policy][crate::model::PubSubSubscription::dead_letter_policy].
7778 ///
7779 /// # Example
7780 /// ```ignore,no_run
7781 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7782 /// use google_cloud_bigquery_analyticshub_v1::model::DeadLetterPolicy;
7783 /// let x = PubSubSubscription::new().set_or_clear_dead_letter_policy(Some(DeadLetterPolicy::default()/* use setters */));
7784 /// let x = PubSubSubscription::new().set_or_clear_dead_letter_policy(None::<DeadLetterPolicy>);
7785 /// ```
7786 pub fn set_or_clear_dead_letter_policy<T>(mut self, v: std::option::Option<T>) -> Self
7787 where
7788 T: std::convert::Into<crate::model::DeadLetterPolicy>,
7789 {
7790 self.dead_letter_policy = v.map(|x| x.into());
7791 self
7792 }
7793
7794 /// Sets the value of [retry_policy][crate::model::PubSubSubscription::retry_policy].
7795 ///
7796 /// # Example
7797 /// ```ignore,no_run
7798 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7799 /// use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
7800 /// let x = PubSubSubscription::new().set_retry_policy(RetryPolicy::default()/* use setters */);
7801 /// ```
7802 pub fn set_retry_policy<T>(mut self, v: T) -> Self
7803 where
7804 T: std::convert::Into<crate::model::RetryPolicy>,
7805 {
7806 self.retry_policy = std::option::Option::Some(v.into());
7807 self
7808 }
7809
7810 /// Sets or clears the value of [retry_policy][crate::model::PubSubSubscription::retry_policy].
7811 ///
7812 /// # Example
7813 /// ```ignore,no_run
7814 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7815 /// use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
7816 /// let x = PubSubSubscription::new().set_or_clear_retry_policy(Some(RetryPolicy::default()/* use setters */));
7817 /// let x = PubSubSubscription::new().set_or_clear_retry_policy(None::<RetryPolicy>);
7818 /// ```
7819 pub fn set_or_clear_retry_policy<T>(mut self, v: std::option::Option<T>) -> Self
7820 where
7821 T: std::convert::Into<crate::model::RetryPolicy>,
7822 {
7823 self.retry_policy = v.map(|x| x.into());
7824 self
7825 }
7826
7827 /// Sets the value of [detached][crate::model::PubSubSubscription::detached].
7828 ///
7829 /// # Example
7830 /// ```ignore,no_run
7831 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7832 /// let x = PubSubSubscription::new().set_detached(true);
7833 /// ```
7834 pub fn set_detached<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7835 self.detached = v.into();
7836 self
7837 }
7838
7839 /// Sets the value of [enable_exactly_once_delivery][crate::model::PubSubSubscription::enable_exactly_once_delivery].
7840 ///
7841 /// # Example
7842 /// ```ignore,no_run
7843 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7844 /// let x = PubSubSubscription::new().set_enable_exactly_once_delivery(true);
7845 /// ```
7846 pub fn set_enable_exactly_once_delivery<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7847 self.enable_exactly_once_delivery = v.into();
7848 self
7849 }
7850
7851 /// Sets the value of [message_transforms][crate::model::PubSubSubscription::message_transforms].
7852 ///
7853 /// # Example
7854 /// ```ignore,no_run
7855 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7856 /// use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
7857 /// let x = PubSubSubscription::new()
7858 /// .set_message_transforms([
7859 /// MessageTransform::default()/* use setters */,
7860 /// MessageTransform::default()/* use (different) setters */,
7861 /// ]);
7862 /// ```
7863 pub fn set_message_transforms<T, V>(mut self, v: T) -> Self
7864 where
7865 T: std::iter::IntoIterator<Item = V>,
7866 V: std::convert::Into<crate::model::MessageTransform>,
7867 {
7868 use std::iter::Iterator;
7869 self.message_transforms = v.into_iter().map(|i| i.into()).collect();
7870 self
7871 }
7872
7873 /// Sets the value of [tags][crate::model::PubSubSubscription::tags].
7874 ///
7875 /// # Example
7876 /// ```ignore,no_run
7877 /// # use google_cloud_bigquery_analyticshub_v1::model::PubSubSubscription;
7878 /// let x = PubSubSubscription::new().set_tags([
7879 /// ("key0", "abc"),
7880 /// ("key1", "xyz"),
7881 /// ]);
7882 /// ```
7883 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
7884 where
7885 T: std::iter::IntoIterator<Item = (K, V)>,
7886 K: std::convert::Into<std::string::String>,
7887 V: std::convert::Into<std::string::String>,
7888 {
7889 use std::iter::Iterator;
7890 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7891 self
7892 }
7893}
7894
7895impl wkt::message::Message for PubSubSubscription {
7896 fn typename() -> &'static str {
7897 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PubSubSubscription"
7898 }
7899}
7900
7901/// A policy that specifies how Pub/Sub retries message delivery.
7902///
7903/// Retry delay will be exponential based on provided minimum and maximum
7904/// backoffs. <https://en.wikipedia.org/wiki/Exponential_backoff>.
7905///
7906/// RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded
7907/// events for a given message.
7908///
7909/// Retry Policy is implemented on a best effort basis. At times, the delay
7910/// between consecutive deliveries may not match the configuration. That is,
7911/// delay can be more or less than configured backoff.
7912#[derive(Clone, Default, PartialEq)]
7913#[non_exhaustive]
7914pub struct RetryPolicy {
7915 /// Optional. The minimum delay between consecutive deliveries of a given
7916 /// message. Value should be between 0 and 600 seconds. Defaults to 10 seconds.
7917 pub minimum_backoff: std::option::Option<wkt::Duration>,
7918
7919 /// Optional. The maximum delay between consecutive deliveries of a given
7920 /// message. Value should be between 0 and 600 seconds. Defaults to 600
7921 /// seconds.
7922 pub maximum_backoff: std::option::Option<wkt::Duration>,
7923
7924 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7925}
7926
7927impl RetryPolicy {
7928 pub fn new() -> Self {
7929 std::default::Default::default()
7930 }
7931
7932 /// Sets the value of [minimum_backoff][crate::model::RetryPolicy::minimum_backoff].
7933 ///
7934 /// # Example
7935 /// ```ignore,no_run
7936 /// # use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
7937 /// use wkt::Duration;
7938 /// let x = RetryPolicy::new().set_minimum_backoff(Duration::default()/* use setters */);
7939 /// ```
7940 pub fn set_minimum_backoff<T>(mut self, v: T) -> Self
7941 where
7942 T: std::convert::Into<wkt::Duration>,
7943 {
7944 self.minimum_backoff = std::option::Option::Some(v.into());
7945 self
7946 }
7947
7948 /// Sets or clears the value of [minimum_backoff][crate::model::RetryPolicy::minimum_backoff].
7949 ///
7950 /// # Example
7951 /// ```ignore,no_run
7952 /// # use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
7953 /// use wkt::Duration;
7954 /// let x = RetryPolicy::new().set_or_clear_minimum_backoff(Some(Duration::default()/* use setters */));
7955 /// let x = RetryPolicy::new().set_or_clear_minimum_backoff(None::<Duration>);
7956 /// ```
7957 pub fn set_or_clear_minimum_backoff<T>(mut self, v: std::option::Option<T>) -> Self
7958 where
7959 T: std::convert::Into<wkt::Duration>,
7960 {
7961 self.minimum_backoff = v.map(|x| x.into());
7962 self
7963 }
7964
7965 /// Sets the value of [maximum_backoff][crate::model::RetryPolicy::maximum_backoff].
7966 ///
7967 /// # Example
7968 /// ```ignore,no_run
7969 /// # use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
7970 /// use wkt::Duration;
7971 /// let x = RetryPolicy::new().set_maximum_backoff(Duration::default()/* use setters */);
7972 /// ```
7973 pub fn set_maximum_backoff<T>(mut self, v: T) -> Self
7974 where
7975 T: std::convert::Into<wkt::Duration>,
7976 {
7977 self.maximum_backoff = std::option::Option::Some(v.into());
7978 self
7979 }
7980
7981 /// Sets or clears the value of [maximum_backoff][crate::model::RetryPolicy::maximum_backoff].
7982 ///
7983 /// # Example
7984 /// ```ignore,no_run
7985 /// # use google_cloud_bigquery_analyticshub_v1::model::RetryPolicy;
7986 /// use wkt::Duration;
7987 /// let x = RetryPolicy::new().set_or_clear_maximum_backoff(Some(Duration::default()/* use setters */));
7988 /// let x = RetryPolicy::new().set_or_clear_maximum_backoff(None::<Duration>);
7989 /// ```
7990 pub fn set_or_clear_maximum_backoff<T>(mut self, v: std::option::Option<T>) -> Self
7991 where
7992 T: std::convert::Into<wkt::Duration>,
7993 {
7994 self.maximum_backoff = v.map(|x| x.into());
7995 self
7996 }
7997}
7998
7999impl wkt::message::Message for RetryPolicy {
8000 fn typename() -> &'static str {
8001 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.RetryPolicy"
8002 }
8003}
8004
8005/// Dead lettering is done on a best effort basis. The same message might be
8006/// dead lettered multiple times.
8007///
8008/// If validation on any of the fields fails at subscription creation/updation,
8009/// the create/update subscription request will fail.
8010#[derive(Clone, Default, PartialEq)]
8011#[non_exhaustive]
8012pub struct DeadLetterPolicy {
8013 /// Optional. The name of the topic to which dead letter messages should be
8014 /// published. Format is `projects/{project}/topics/{topic}`.The Pub/Sub
8015 /// service account associated with the enclosing subscription's parent project
8016 /// (i.e., service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must
8017 /// have permission to Publish() to this topic.
8018 ///
8019 /// The operation will fail if the topic does not exist.
8020 /// Users should ensure that there is a subscription attached to this topic
8021 /// since messages published to a topic with no subscriptions are lost.
8022 pub dead_letter_topic: std::string::String,
8023
8024 /// Optional. The maximum number of delivery attempts for any message. The
8025 /// value must be between 5 and 100.
8026 ///
8027 /// The number of delivery attempts is defined as 1 + (the sum of number of
8028 /// NACKs and number of times the acknowledgement deadline has been exceeded
8029 /// for the message).
8030 ///
8031 /// A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
8032 /// client libraries may automatically extend ack_deadlines.
8033 ///
8034 /// This field will be honored on a best effort basis.
8035 ///
8036 /// If this parameter is 0, a default value of 5 is used.
8037 pub max_delivery_attempts: i32,
8038
8039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8040}
8041
8042impl DeadLetterPolicy {
8043 pub fn new() -> Self {
8044 std::default::Default::default()
8045 }
8046
8047 /// Sets the value of [dead_letter_topic][crate::model::DeadLetterPolicy::dead_letter_topic].
8048 ///
8049 /// # Example
8050 /// ```ignore,no_run
8051 /// # use google_cloud_bigquery_analyticshub_v1::model::DeadLetterPolicy;
8052 /// let x = DeadLetterPolicy::new().set_dead_letter_topic("example");
8053 /// ```
8054 pub fn set_dead_letter_topic<T: std::convert::Into<std::string::String>>(
8055 mut self,
8056 v: T,
8057 ) -> Self {
8058 self.dead_letter_topic = v.into();
8059 self
8060 }
8061
8062 /// Sets the value of [max_delivery_attempts][crate::model::DeadLetterPolicy::max_delivery_attempts].
8063 ///
8064 /// # Example
8065 /// ```ignore,no_run
8066 /// # use google_cloud_bigquery_analyticshub_v1::model::DeadLetterPolicy;
8067 /// let x = DeadLetterPolicy::new().set_max_delivery_attempts(42);
8068 /// ```
8069 pub fn set_max_delivery_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8070 self.max_delivery_attempts = v.into();
8071 self
8072 }
8073}
8074
8075impl wkt::message::Message for DeadLetterPolicy {
8076 fn typename() -> &'static str {
8077 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.DeadLetterPolicy"
8078 }
8079}
8080
8081/// A policy that specifies the conditions for resource expiration (i.e.,
8082/// automatic resource deletion).
8083#[derive(Clone, Default, PartialEq)]
8084#[non_exhaustive]
8085pub struct ExpirationPolicy {
8086 /// Optional. Specifies the "time-to-live" duration for an associated resource.
8087 /// The resource expires if it is not active for a period of `ttl`. The
8088 /// definition of "activity" depends on the type of the associated resource.
8089 /// The minimum and maximum allowed values for `ttl` depend on the type of the
8090 /// associated resource, as well. If `ttl` is not set, the associated resource
8091 /// never expires.
8092 pub ttl: std::option::Option<wkt::Duration>,
8093
8094 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8095}
8096
8097impl ExpirationPolicy {
8098 pub fn new() -> Self {
8099 std::default::Default::default()
8100 }
8101
8102 /// Sets the value of [ttl][crate::model::ExpirationPolicy::ttl].
8103 ///
8104 /// # Example
8105 /// ```ignore,no_run
8106 /// # use google_cloud_bigquery_analyticshub_v1::model::ExpirationPolicy;
8107 /// use wkt::Duration;
8108 /// let x = ExpirationPolicy::new().set_ttl(Duration::default()/* use setters */);
8109 /// ```
8110 pub fn set_ttl<T>(mut self, v: T) -> Self
8111 where
8112 T: std::convert::Into<wkt::Duration>,
8113 {
8114 self.ttl = std::option::Option::Some(v.into());
8115 self
8116 }
8117
8118 /// Sets or clears the value of [ttl][crate::model::ExpirationPolicy::ttl].
8119 ///
8120 /// # Example
8121 /// ```ignore,no_run
8122 /// # use google_cloud_bigquery_analyticshub_v1::model::ExpirationPolicy;
8123 /// use wkt::Duration;
8124 /// let x = ExpirationPolicy::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
8125 /// let x = ExpirationPolicy::new().set_or_clear_ttl(None::<Duration>);
8126 /// ```
8127 pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
8128 where
8129 T: std::convert::Into<wkt::Duration>,
8130 {
8131 self.ttl = v.map(|x| x.into());
8132 self
8133 }
8134}
8135
8136impl wkt::message::Message for ExpirationPolicy {
8137 fn typename() -> &'static str {
8138 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.ExpirationPolicy"
8139 }
8140}
8141
8142/// Configuration for a push delivery endpoint.
8143#[derive(Clone, Default, PartialEq)]
8144#[non_exhaustive]
8145pub struct PushConfig {
8146 /// Optional. A URL locating the endpoint to which messages should be pushed.
8147 /// For example, a Webhook endpoint might use `<https://example.com/push>`.
8148 pub push_endpoint: std::string::String,
8149
8150 /// Optional. Endpoint configuration attributes that can be used to control
8151 /// different aspects of the message delivery.
8152 ///
8153 /// The only currently supported attribute is `x-goog-version`, which you can
8154 /// use to change the format of the pushed message. This attribute
8155 /// indicates the version of the data expected by the endpoint. This
8156 /// controls the shape of the pushed message (i.e., its fields and metadata).
8157 ///
8158 /// If not present during the `CreateSubscription` call, it will default to
8159 /// the version of the Pub/Sub API used to make such call. If not present in a
8160 /// `ModifyPushConfig` call, its value will not be changed. `GetSubscription`
8161 /// calls will always return a valid version, even if the subscription was
8162 /// created without this attribute.
8163 ///
8164 /// The only supported values for the `x-goog-version` attribute are:
8165 ///
8166 /// * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API.
8167 /// * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API.
8168 ///
8169 /// For example:
8170 /// `attributes { "x-goog-version": "v1" }`
8171 pub attributes: std::collections::HashMap<std::string::String, std::string::String>,
8172
8173 /// An authentication method used by push endpoints to verify the source of
8174 /// push requests. This can be used with push endpoints that are private by
8175 /// default to allow requests only from the Pub/Sub system, for example.
8176 /// This field is optional and should be set only by users interested in
8177 /// authenticated push.
8178 pub authentication_method: std::option::Option<crate::model::push_config::AuthenticationMethod>,
8179
8180 /// The format of the delivered message to the push endpoint is defined by
8181 /// the chosen wrapper. When unset, `PubsubWrapper` is used.
8182 pub wrapper: std::option::Option<crate::model::push_config::Wrapper>,
8183
8184 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8185}
8186
8187impl PushConfig {
8188 pub fn new() -> Self {
8189 std::default::Default::default()
8190 }
8191
8192 /// Sets the value of [push_endpoint][crate::model::PushConfig::push_endpoint].
8193 ///
8194 /// # Example
8195 /// ```ignore,no_run
8196 /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8197 /// let x = PushConfig::new().set_push_endpoint("example");
8198 /// ```
8199 pub fn set_push_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8200 self.push_endpoint = v.into();
8201 self
8202 }
8203
8204 /// Sets the value of [attributes][crate::model::PushConfig::attributes].
8205 ///
8206 /// # Example
8207 /// ```ignore,no_run
8208 /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8209 /// let x = PushConfig::new().set_attributes([
8210 /// ("key0", "abc"),
8211 /// ("key1", "xyz"),
8212 /// ]);
8213 /// ```
8214 pub fn set_attributes<T, K, V>(mut self, v: T) -> Self
8215 where
8216 T: std::iter::IntoIterator<Item = (K, V)>,
8217 K: std::convert::Into<std::string::String>,
8218 V: std::convert::Into<std::string::String>,
8219 {
8220 use std::iter::Iterator;
8221 self.attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8222 self
8223 }
8224
8225 /// Sets the value of [authentication_method][crate::model::PushConfig::authentication_method].
8226 ///
8227 /// Note that all the setters affecting `authentication_method` are mutually
8228 /// exclusive.
8229 ///
8230 /// # Example
8231 /// ```ignore,no_run
8232 /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8233 /// use google_cloud_bigquery_analyticshub_v1::model::push_config::OidcToken;
8234 /// let x = PushConfig::new().set_authentication_method(Some(
8235 /// google_cloud_bigquery_analyticshub_v1::model::push_config::AuthenticationMethod::OidcToken(OidcToken::default().into())));
8236 /// ```
8237 pub fn set_authentication_method<
8238 T: std::convert::Into<std::option::Option<crate::model::push_config::AuthenticationMethod>>,
8239 >(
8240 mut self,
8241 v: T,
8242 ) -> Self {
8243 self.authentication_method = v.into();
8244 self
8245 }
8246
8247 /// The value of [authentication_method][crate::model::PushConfig::authentication_method]
8248 /// if it holds a `OidcToken`, `None` if the field is not set or
8249 /// holds a different branch.
8250 pub fn oidc_token(
8251 &self,
8252 ) -> std::option::Option<&std::boxed::Box<crate::model::push_config::OidcToken>> {
8253 #[allow(unreachable_patterns)]
8254 self.authentication_method.as_ref().and_then(|v| match v {
8255 crate::model::push_config::AuthenticationMethod::OidcToken(v) => {
8256 std::option::Option::Some(v)
8257 }
8258 _ => std::option::Option::None,
8259 })
8260 }
8261
8262 /// Sets the value of [authentication_method][crate::model::PushConfig::authentication_method]
8263 /// to hold a `OidcToken`.
8264 ///
8265 /// Note that all the setters affecting `authentication_method` are
8266 /// mutually exclusive.
8267 ///
8268 /// # Example
8269 /// ```ignore,no_run
8270 /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8271 /// use google_cloud_bigquery_analyticshub_v1::model::push_config::OidcToken;
8272 /// let x = PushConfig::new().set_oidc_token(OidcToken::default()/* use setters */);
8273 /// assert!(x.oidc_token().is_some());
8274 /// ```
8275 pub fn set_oidc_token<
8276 T: std::convert::Into<std::boxed::Box<crate::model::push_config::OidcToken>>,
8277 >(
8278 mut self,
8279 v: T,
8280 ) -> Self {
8281 self.authentication_method = std::option::Option::Some(
8282 crate::model::push_config::AuthenticationMethod::OidcToken(v.into()),
8283 );
8284 self
8285 }
8286
8287 /// Sets the value of [wrapper][crate::model::PushConfig::wrapper].
8288 ///
8289 /// Note that all the setters affecting `wrapper` are mutually
8290 /// exclusive.
8291 ///
8292 /// # Example
8293 /// ```ignore,no_run
8294 /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8295 /// use google_cloud_bigquery_analyticshub_v1::model::push_config::PubsubWrapper;
8296 /// let x = PushConfig::new().set_wrapper(Some(
8297 /// google_cloud_bigquery_analyticshub_v1::model::push_config::Wrapper::PubsubWrapper(PubsubWrapper::default().into())));
8298 /// ```
8299 pub fn set_wrapper<
8300 T: std::convert::Into<std::option::Option<crate::model::push_config::Wrapper>>,
8301 >(
8302 mut self,
8303 v: T,
8304 ) -> Self {
8305 self.wrapper = v.into();
8306 self
8307 }
8308
8309 /// The value of [wrapper][crate::model::PushConfig::wrapper]
8310 /// if it holds a `PubsubWrapper`, `None` if the field is not set or
8311 /// holds a different branch.
8312 pub fn pubsub_wrapper(
8313 &self,
8314 ) -> std::option::Option<&std::boxed::Box<crate::model::push_config::PubsubWrapper>> {
8315 #[allow(unreachable_patterns)]
8316 self.wrapper.as_ref().and_then(|v| match v {
8317 crate::model::push_config::Wrapper::PubsubWrapper(v) => std::option::Option::Some(v),
8318 _ => std::option::Option::None,
8319 })
8320 }
8321
8322 /// Sets the value of [wrapper][crate::model::PushConfig::wrapper]
8323 /// to hold a `PubsubWrapper`.
8324 ///
8325 /// Note that all the setters affecting `wrapper` are
8326 /// mutually exclusive.
8327 ///
8328 /// # Example
8329 /// ```ignore,no_run
8330 /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8331 /// use google_cloud_bigquery_analyticshub_v1::model::push_config::PubsubWrapper;
8332 /// let x = PushConfig::new().set_pubsub_wrapper(PubsubWrapper::default()/* use setters */);
8333 /// assert!(x.pubsub_wrapper().is_some());
8334 /// assert!(x.no_wrapper().is_none());
8335 /// ```
8336 pub fn set_pubsub_wrapper<
8337 T: std::convert::Into<std::boxed::Box<crate::model::push_config::PubsubWrapper>>,
8338 >(
8339 mut self,
8340 v: T,
8341 ) -> Self {
8342 self.wrapper =
8343 std::option::Option::Some(crate::model::push_config::Wrapper::PubsubWrapper(v.into()));
8344 self
8345 }
8346
8347 /// The value of [wrapper][crate::model::PushConfig::wrapper]
8348 /// if it holds a `NoWrapper`, `None` if the field is not set or
8349 /// holds a different branch.
8350 pub fn no_wrapper(
8351 &self,
8352 ) -> std::option::Option<&std::boxed::Box<crate::model::push_config::NoWrapper>> {
8353 #[allow(unreachable_patterns)]
8354 self.wrapper.as_ref().and_then(|v| match v {
8355 crate::model::push_config::Wrapper::NoWrapper(v) => std::option::Option::Some(v),
8356 _ => std::option::Option::None,
8357 })
8358 }
8359
8360 /// Sets the value of [wrapper][crate::model::PushConfig::wrapper]
8361 /// to hold a `NoWrapper`.
8362 ///
8363 /// Note that all the setters affecting `wrapper` are
8364 /// mutually exclusive.
8365 ///
8366 /// # Example
8367 /// ```ignore,no_run
8368 /// # use google_cloud_bigquery_analyticshub_v1::model::PushConfig;
8369 /// use google_cloud_bigquery_analyticshub_v1::model::push_config::NoWrapper;
8370 /// let x = PushConfig::new().set_no_wrapper(NoWrapper::default()/* use setters */);
8371 /// assert!(x.no_wrapper().is_some());
8372 /// assert!(x.pubsub_wrapper().is_none());
8373 /// ```
8374 pub fn set_no_wrapper<
8375 T: std::convert::Into<std::boxed::Box<crate::model::push_config::NoWrapper>>,
8376 >(
8377 mut self,
8378 v: T,
8379 ) -> Self {
8380 self.wrapper =
8381 std::option::Option::Some(crate::model::push_config::Wrapper::NoWrapper(v.into()));
8382 self
8383 }
8384}
8385
8386impl wkt::message::Message for PushConfig {
8387 fn typename() -> &'static str {
8388 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig"
8389 }
8390}
8391
8392/// Defines additional types related to [PushConfig].
8393pub mod push_config {
8394 #[allow(unused_imports)]
8395 use super::*;
8396
8397 /// Contains information needed for generating an
8398 /// [OpenID Connect
8399 /// token](https://developers.google.com/identity/protocols/OpenIDConnect).
8400 #[derive(Clone, Default, PartialEq)]
8401 #[non_exhaustive]
8402 pub struct OidcToken {
8403 /// Optional. [Service account
8404 /// email](https://cloud.google.com/iam/docs/service-accounts)
8405 /// used for generating the OIDC token. For more information
8406 /// on setting up authentication, see
8407 /// [Push subscriptions](https://cloud.google.com/pubsub/docs/push).
8408 pub service_account_email: std::string::String,
8409
8410 /// Optional. Audience to be used when generating OIDC token. The audience
8411 /// claim identifies the recipients that the JWT is intended for. The
8412 /// audience value is a single case-sensitive string. Having multiple values
8413 /// (array) for the audience field is not supported. More info about the OIDC
8414 /// JWT token audience here:
8415 /// <https://tools.ietf.org/html/rfc7519#section-4.1.3> Note: if not specified,
8416 /// the Push endpoint URL will be used.
8417 pub audience: std::string::String,
8418
8419 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8420 }
8421
8422 impl OidcToken {
8423 pub fn new() -> Self {
8424 std::default::Default::default()
8425 }
8426
8427 /// Sets the value of [service_account_email][crate::model::push_config::OidcToken::service_account_email].
8428 ///
8429 /// # Example
8430 /// ```ignore,no_run
8431 /// # use google_cloud_bigquery_analyticshub_v1::model::push_config::OidcToken;
8432 /// let x = OidcToken::new().set_service_account_email("example");
8433 /// ```
8434 pub fn set_service_account_email<T: std::convert::Into<std::string::String>>(
8435 mut self,
8436 v: T,
8437 ) -> Self {
8438 self.service_account_email = v.into();
8439 self
8440 }
8441
8442 /// Sets the value of [audience][crate::model::push_config::OidcToken::audience].
8443 ///
8444 /// # Example
8445 /// ```ignore,no_run
8446 /// # use google_cloud_bigquery_analyticshub_v1::model::push_config::OidcToken;
8447 /// let x = OidcToken::new().set_audience("example");
8448 /// ```
8449 pub fn set_audience<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8450 self.audience = v.into();
8451 self
8452 }
8453 }
8454
8455 impl wkt::message::Message for OidcToken {
8456 fn typename() -> &'static str {
8457 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig.OidcToken"
8458 }
8459 }
8460
8461 /// The payload to the push endpoint is in the form of the JSON representation
8462 /// of a PubsubMessage
8463 /// (<https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage>).
8464 #[derive(Clone, Default, PartialEq)]
8465 #[non_exhaustive]
8466 pub struct PubsubWrapper {
8467 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8468 }
8469
8470 impl PubsubWrapper {
8471 pub fn new() -> Self {
8472 std::default::Default::default()
8473 }
8474 }
8475
8476 impl wkt::message::Message for PubsubWrapper {
8477 fn typename() -> &'static str {
8478 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig.PubsubWrapper"
8479 }
8480 }
8481
8482 /// Sets the `data` field as the HTTP body for delivery.
8483 #[derive(Clone, Default, PartialEq)]
8484 #[non_exhaustive]
8485 pub struct NoWrapper {
8486 /// Optional. When true, writes the Pub/Sub message metadata to
8487 /// `x-goog-pubsub-<KEY>:<VAL>` headers of the HTTP request. Writes the
8488 /// Pub/Sub message attributes to `<KEY>:<VAL>` headers of the HTTP request.
8489 pub write_metadata: bool,
8490
8491 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8492 }
8493
8494 impl NoWrapper {
8495 pub fn new() -> Self {
8496 std::default::Default::default()
8497 }
8498
8499 /// Sets the value of [write_metadata][crate::model::push_config::NoWrapper::write_metadata].
8500 ///
8501 /// # Example
8502 /// ```ignore,no_run
8503 /// # use google_cloud_bigquery_analyticshub_v1::model::push_config::NoWrapper;
8504 /// let x = NoWrapper::new().set_write_metadata(true);
8505 /// ```
8506 pub fn set_write_metadata<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8507 self.write_metadata = v.into();
8508 self
8509 }
8510 }
8511
8512 impl wkt::message::Message for NoWrapper {
8513 fn typename() -> &'static str {
8514 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.PushConfig.NoWrapper"
8515 }
8516 }
8517
8518 /// An authentication method used by push endpoints to verify the source of
8519 /// push requests. This can be used with push endpoints that are private by
8520 /// default to allow requests only from the Pub/Sub system, for example.
8521 /// This field is optional and should be set only by users interested in
8522 /// authenticated push.
8523 #[derive(Clone, Debug, PartialEq)]
8524 #[non_exhaustive]
8525 pub enum AuthenticationMethod {
8526 /// Optional. If specified, Pub/Sub will generate and attach an OIDC JWT
8527 /// token as an `Authorization` header in the HTTP request for every pushed
8528 /// message.
8529 OidcToken(std::boxed::Box<crate::model::push_config::OidcToken>),
8530 }
8531
8532 /// The format of the delivered message to the push endpoint is defined by
8533 /// the chosen wrapper. When unset, `PubsubWrapper` is used.
8534 #[derive(Clone, Debug, PartialEq)]
8535 #[non_exhaustive]
8536 pub enum Wrapper {
8537 /// Optional. When set, the payload to the push endpoint is in the form of
8538 /// the JSON representation of a PubsubMessage
8539 /// (<https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage>).
8540 PubsubWrapper(std::boxed::Box<crate::model::push_config::PubsubWrapper>),
8541 /// Optional. When set, the payload to the push endpoint is not wrapped.
8542 NoWrapper(std::boxed::Box<crate::model::push_config::NoWrapper>),
8543 }
8544}
8545
8546/// Configuration for a BigQuery subscription.
8547#[derive(Clone, Default, PartialEq)]
8548#[non_exhaustive]
8549pub struct BigQueryConfig {
8550 /// Optional. The name of the table to which to write data, of the form
8551 /// {projectId}.{datasetId}.{tableId}
8552 pub table: std::string::String,
8553
8554 /// Optional. When true, use the topic's schema as the columns to write to in
8555 /// BigQuery, if it exists. `use_topic_schema` and `use_table_schema` cannot be
8556 /// enabled at the same time.
8557 pub use_topic_schema: bool,
8558
8559 /// Optional. When true, write the subscription name, message_id, publish_time,
8560 /// attributes, and ordering_key to additional columns in the table. The
8561 /// subscription name, message_id, and publish_time fields are put in their own
8562 /// columns while all other message properties (other than data) are written to
8563 /// a JSON object in the attributes column.
8564 pub write_metadata: bool,
8565
8566 /// Optional. When true and use_topic_schema is true, any fields that are a
8567 /// part of the topic schema that are not part of the BigQuery table schema are
8568 /// dropped when writing to BigQuery. Otherwise, the schemas must be kept in
8569 /// sync and any messages with extra fields are not written and remain in the
8570 /// subscription's backlog.
8571 pub drop_unknown_fields: bool,
8572
8573 /// Optional. When true, use the BigQuery table's schema as the columns to
8574 /// write to in BigQuery. `use_table_schema` and `use_topic_schema` cannot be
8575 /// enabled at the same time.
8576 pub use_table_schema: bool,
8577
8578 /// Optional. The service account to use to write to BigQuery. The subscription
8579 /// creator or updater that specifies this field must have
8580 /// `iam.serviceAccounts.actAs` permission on the service account. If not
8581 /// specified, the Pub/Sub [service
8582 /// agent](https://cloud.google.com/iam/docs/service-agents),
8583 /// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
8584 pub service_account_email: std::string::String,
8585
8586 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8587}
8588
8589impl BigQueryConfig {
8590 pub fn new() -> Self {
8591 std::default::Default::default()
8592 }
8593
8594 /// Sets the value of [table][crate::model::BigQueryConfig::table].
8595 ///
8596 /// # Example
8597 /// ```ignore,no_run
8598 /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8599 /// let x = BigQueryConfig::new().set_table("example");
8600 /// ```
8601 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8602 self.table = v.into();
8603 self
8604 }
8605
8606 /// Sets the value of [use_topic_schema][crate::model::BigQueryConfig::use_topic_schema].
8607 ///
8608 /// # Example
8609 /// ```ignore,no_run
8610 /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8611 /// let x = BigQueryConfig::new().set_use_topic_schema(true);
8612 /// ```
8613 pub fn set_use_topic_schema<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8614 self.use_topic_schema = v.into();
8615 self
8616 }
8617
8618 /// Sets the value of [write_metadata][crate::model::BigQueryConfig::write_metadata].
8619 ///
8620 /// # Example
8621 /// ```ignore,no_run
8622 /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8623 /// let x = BigQueryConfig::new().set_write_metadata(true);
8624 /// ```
8625 pub fn set_write_metadata<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8626 self.write_metadata = v.into();
8627 self
8628 }
8629
8630 /// Sets the value of [drop_unknown_fields][crate::model::BigQueryConfig::drop_unknown_fields].
8631 ///
8632 /// # Example
8633 /// ```ignore,no_run
8634 /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8635 /// let x = BigQueryConfig::new().set_drop_unknown_fields(true);
8636 /// ```
8637 pub fn set_drop_unknown_fields<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8638 self.drop_unknown_fields = v.into();
8639 self
8640 }
8641
8642 /// Sets the value of [use_table_schema][crate::model::BigQueryConfig::use_table_schema].
8643 ///
8644 /// # Example
8645 /// ```ignore,no_run
8646 /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8647 /// let x = BigQueryConfig::new().set_use_table_schema(true);
8648 /// ```
8649 pub fn set_use_table_schema<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8650 self.use_table_schema = v.into();
8651 self
8652 }
8653
8654 /// Sets the value of [service_account_email][crate::model::BigQueryConfig::service_account_email].
8655 ///
8656 /// # Example
8657 /// ```ignore,no_run
8658 /// # use google_cloud_bigquery_analyticshub_v1::model::BigQueryConfig;
8659 /// let x = BigQueryConfig::new().set_service_account_email("example");
8660 /// ```
8661 pub fn set_service_account_email<T: std::convert::Into<std::string::String>>(
8662 mut self,
8663 v: T,
8664 ) -> Self {
8665 self.service_account_email = v.into();
8666 self
8667 }
8668}
8669
8670impl wkt::message::Message for BigQueryConfig {
8671 fn typename() -> &'static str {
8672 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.BigQueryConfig"
8673 }
8674}
8675
8676/// Configuration for a Cloud Storage subscription.
8677#[derive(Clone, Default, PartialEq)]
8678#[non_exhaustive]
8679pub struct CloudStorageConfig {
8680 /// Required. User-provided name for the Cloud Storage bucket.
8681 /// The bucket must be created by the user. The bucket name must be without
8682 /// any prefix like "gs://". See the [bucket naming
8683 /// requirements] (<https://cloud.google.com/storage/docs/buckets#naming>).
8684 pub bucket: std::string::String,
8685
8686 /// Optional. User-provided prefix for Cloud Storage filename. See the [object
8687 /// naming requirements](https://cloud.google.com/storage/docs/objects#naming).
8688 pub filename_prefix: std::string::String,
8689
8690 /// Optional. User-provided suffix for Cloud Storage filename. See the [object
8691 /// naming requirements](https://cloud.google.com/storage/docs/objects#naming).
8692 /// Must not end in "/".
8693 pub filename_suffix: std::string::String,
8694
8695 /// Optional. User-provided format string specifying how to represent datetimes
8696 /// in Cloud Storage filenames. See the [datetime format
8697 /// guidance](https://cloud.google.com/pubsub/docs/create-cloudstorage-subscription#file_names).
8698 pub filename_datetime_format: std::string::String,
8699
8700 /// Optional. File batching settings.
8701 /// If no max_duration setting is specified, a max_duration of 5 minutes will
8702 /// be set by default. max_duration is required regardless of whether other
8703 /// file batching settings are specified.
8704 ///
8705 /// The maximum duration that can elapse before a new Cloud Storage file is
8706 /// created. Min 1 minute, max 10 minutes, default 5 minutes. May not exceed
8707 /// the subscription's acknowledgement deadline.
8708 pub max_duration: std::option::Option<wkt::Duration>,
8709
8710 /// Optional. The maximum bytes that can be written to a Cloud Storage file
8711 /// before a new file is created. Min 1 KB, max 10 GiB. The max_bytes limit may
8712 /// be exceeded in cases where messages are larger than the limit.
8713 pub max_bytes: i64,
8714
8715 /// Optional. The maximum number of messages that can be written to a Cloud
8716 /// Storage file before a new file is created. Min 1000 messages.
8717 pub max_messages: i64,
8718
8719 /// Optional. The service account to use to write to Cloud Storage. The
8720 /// subscription creator or updater that specifies this field must have
8721 /// `iam.serviceAccounts.actAs` permission on the service account. If not
8722 /// specified, the Pub/Sub
8723 /// [service agent](https://cloud.google.com/iam/docs/service-agents),
8724 /// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
8725 pub service_account_email: std::string::String,
8726
8727 /// Defaults to text format.
8728 pub output_format: std::option::Option<crate::model::cloud_storage_config::OutputFormat>,
8729
8730 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8731}
8732
8733impl CloudStorageConfig {
8734 pub fn new() -> Self {
8735 std::default::Default::default()
8736 }
8737
8738 /// Sets the value of [bucket][crate::model::CloudStorageConfig::bucket].
8739 ///
8740 /// # Example
8741 /// ```ignore,no_run
8742 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8743 /// let x = CloudStorageConfig::new().set_bucket("example");
8744 /// ```
8745 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8746 self.bucket = v.into();
8747 self
8748 }
8749
8750 /// Sets the value of [filename_prefix][crate::model::CloudStorageConfig::filename_prefix].
8751 ///
8752 /// # Example
8753 /// ```ignore,no_run
8754 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8755 /// let x = CloudStorageConfig::new().set_filename_prefix("example");
8756 /// ```
8757 pub fn set_filename_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8758 self.filename_prefix = v.into();
8759 self
8760 }
8761
8762 /// Sets the value of [filename_suffix][crate::model::CloudStorageConfig::filename_suffix].
8763 ///
8764 /// # Example
8765 /// ```ignore,no_run
8766 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8767 /// let x = CloudStorageConfig::new().set_filename_suffix("example");
8768 /// ```
8769 pub fn set_filename_suffix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8770 self.filename_suffix = v.into();
8771 self
8772 }
8773
8774 /// Sets the value of [filename_datetime_format][crate::model::CloudStorageConfig::filename_datetime_format].
8775 ///
8776 /// # Example
8777 /// ```ignore,no_run
8778 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8779 /// let x = CloudStorageConfig::new().set_filename_datetime_format("example");
8780 /// ```
8781 pub fn set_filename_datetime_format<T: std::convert::Into<std::string::String>>(
8782 mut self,
8783 v: T,
8784 ) -> Self {
8785 self.filename_datetime_format = v.into();
8786 self
8787 }
8788
8789 /// Sets the value of [max_duration][crate::model::CloudStorageConfig::max_duration].
8790 ///
8791 /// # Example
8792 /// ```ignore,no_run
8793 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8794 /// use wkt::Duration;
8795 /// let x = CloudStorageConfig::new().set_max_duration(Duration::default()/* use setters */);
8796 /// ```
8797 pub fn set_max_duration<T>(mut self, v: T) -> Self
8798 where
8799 T: std::convert::Into<wkt::Duration>,
8800 {
8801 self.max_duration = std::option::Option::Some(v.into());
8802 self
8803 }
8804
8805 /// Sets or clears the value of [max_duration][crate::model::CloudStorageConfig::max_duration].
8806 ///
8807 /// # Example
8808 /// ```ignore,no_run
8809 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8810 /// use wkt::Duration;
8811 /// let x = CloudStorageConfig::new().set_or_clear_max_duration(Some(Duration::default()/* use setters */));
8812 /// let x = CloudStorageConfig::new().set_or_clear_max_duration(None::<Duration>);
8813 /// ```
8814 pub fn set_or_clear_max_duration<T>(mut self, v: std::option::Option<T>) -> Self
8815 where
8816 T: std::convert::Into<wkt::Duration>,
8817 {
8818 self.max_duration = v.map(|x| x.into());
8819 self
8820 }
8821
8822 /// Sets the value of [max_bytes][crate::model::CloudStorageConfig::max_bytes].
8823 ///
8824 /// # Example
8825 /// ```ignore,no_run
8826 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8827 /// let x = CloudStorageConfig::new().set_max_bytes(42);
8828 /// ```
8829 pub fn set_max_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8830 self.max_bytes = v.into();
8831 self
8832 }
8833
8834 /// Sets the value of [max_messages][crate::model::CloudStorageConfig::max_messages].
8835 ///
8836 /// # Example
8837 /// ```ignore,no_run
8838 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8839 /// let x = CloudStorageConfig::new().set_max_messages(42);
8840 /// ```
8841 pub fn set_max_messages<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8842 self.max_messages = v.into();
8843 self
8844 }
8845
8846 /// Sets the value of [service_account_email][crate::model::CloudStorageConfig::service_account_email].
8847 ///
8848 /// # Example
8849 /// ```ignore,no_run
8850 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8851 /// let x = CloudStorageConfig::new().set_service_account_email("example");
8852 /// ```
8853 pub fn set_service_account_email<T: std::convert::Into<std::string::String>>(
8854 mut self,
8855 v: T,
8856 ) -> Self {
8857 self.service_account_email = v.into();
8858 self
8859 }
8860
8861 /// Sets the value of [output_format][crate::model::CloudStorageConfig::output_format].
8862 ///
8863 /// Note that all the setters affecting `output_format` are mutually
8864 /// exclusive.
8865 ///
8866 /// # Example
8867 /// ```ignore,no_run
8868 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8869 /// use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::TextConfig;
8870 /// let x = CloudStorageConfig::new().set_output_format(Some(
8871 /// google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::OutputFormat::TextConfig(TextConfig::default().into())));
8872 /// ```
8873 pub fn set_output_format<
8874 T: std::convert::Into<std::option::Option<crate::model::cloud_storage_config::OutputFormat>>,
8875 >(
8876 mut self,
8877 v: T,
8878 ) -> Self {
8879 self.output_format = v.into();
8880 self
8881 }
8882
8883 /// The value of [output_format][crate::model::CloudStorageConfig::output_format]
8884 /// if it holds a `TextConfig`, `None` if the field is not set or
8885 /// holds a different branch.
8886 pub fn text_config(
8887 &self,
8888 ) -> std::option::Option<&std::boxed::Box<crate::model::cloud_storage_config::TextConfig>> {
8889 #[allow(unreachable_patterns)]
8890 self.output_format.as_ref().and_then(|v| match v {
8891 crate::model::cloud_storage_config::OutputFormat::TextConfig(v) => {
8892 std::option::Option::Some(v)
8893 }
8894 _ => std::option::Option::None,
8895 })
8896 }
8897
8898 /// Sets the value of [output_format][crate::model::CloudStorageConfig::output_format]
8899 /// to hold a `TextConfig`.
8900 ///
8901 /// Note that all the setters affecting `output_format` are
8902 /// mutually exclusive.
8903 ///
8904 /// # Example
8905 /// ```ignore,no_run
8906 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8907 /// use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::TextConfig;
8908 /// let x = CloudStorageConfig::new().set_text_config(TextConfig::default()/* use setters */);
8909 /// assert!(x.text_config().is_some());
8910 /// assert!(x.avro_config().is_none());
8911 /// ```
8912 pub fn set_text_config<
8913 T: std::convert::Into<std::boxed::Box<crate::model::cloud_storage_config::TextConfig>>,
8914 >(
8915 mut self,
8916 v: T,
8917 ) -> Self {
8918 self.output_format = std::option::Option::Some(
8919 crate::model::cloud_storage_config::OutputFormat::TextConfig(v.into()),
8920 );
8921 self
8922 }
8923
8924 /// The value of [output_format][crate::model::CloudStorageConfig::output_format]
8925 /// if it holds a `AvroConfig`, `None` if the field is not set or
8926 /// holds a different branch.
8927 pub fn avro_config(
8928 &self,
8929 ) -> std::option::Option<&std::boxed::Box<crate::model::cloud_storage_config::AvroConfig>> {
8930 #[allow(unreachable_patterns)]
8931 self.output_format.as_ref().and_then(|v| match v {
8932 crate::model::cloud_storage_config::OutputFormat::AvroConfig(v) => {
8933 std::option::Option::Some(v)
8934 }
8935 _ => std::option::Option::None,
8936 })
8937 }
8938
8939 /// Sets the value of [output_format][crate::model::CloudStorageConfig::output_format]
8940 /// to hold a `AvroConfig`.
8941 ///
8942 /// Note that all the setters affecting `output_format` are
8943 /// mutually exclusive.
8944 ///
8945 /// # Example
8946 /// ```ignore,no_run
8947 /// # use google_cloud_bigquery_analyticshub_v1::model::CloudStorageConfig;
8948 /// use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::AvroConfig;
8949 /// let x = CloudStorageConfig::new().set_avro_config(AvroConfig::default()/* use setters */);
8950 /// assert!(x.avro_config().is_some());
8951 /// assert!(x.text_config().is_none());
8952 /// ```
8953 pub fn set_avro_config<
8954 T: std::convert::Into<std::boxed::Box<crate::model::cloud_storage_config::AvroConfig>>,
8955 >(
8956 mut self,
8957 v: T,
8958 ) -> Self {
8959 self.output_format = std::option::Option::Some(
8960 crate::model::cloud_storage_config::OutputFormat::AvroConfig(v.into()),
8961 );
8962 self
8963 }
8964}
8965
8966impl wkt::message::Message for CloudStorageConfig {
8967 fn typename() -> &'static str {
8968 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CloudStorageConfig"
8969 }
8970}
8971
8972/// Defines additional types related to [CloudStorageConfig].
8973pub mod cloud_storage_config {
8974 #[allow(unused_imports)]
8975 use super::*;
8976
8977 /// Configuration for writing message data in text format.
8978 /// Message payloads will be written to files as raw text, separated by a
8979 /// newline.
8980 #[derive(Clone, Default, PartialEq)]
8981 #[non_exhaustive]
8982 pub struct TextConfig {
8983 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8984 }
8985
8986 impl TextConfig {
8987 pub fn new() -> Self {
8988 std::default::Default::default()
8989 }
8990 }
8991
8992 impl wkt::message::Message for TextConfig {
8993 fn typename() -> &'static str {
8994 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CloudStorageConfig.TextConfig"
8995 }
8996 }
8997
8998 /// Configuration for writing message data in Avro format.
8999 /// Message payloads and metadata will be written to files as an Avro binary.
9000 #[derive(Clone, Default, PartialEq)]
9001 #[non_exhaustive]
9002 pub struct AvroConfig {
9003 /// Optional. When true, write the subscription name, message_id,
9004 /// publish_time, attributes, and ordering_key as additional fields in the
9005 /// output. The subscription name, message_id, and publish_time fields are
9006 /// put in their own fields while all other message properties other than
9007 /// data (for example, an ordering_key, if present) are added as entries in
9008 /// the attributes map.
9009 pub write_metadata: bool,
9010
9011 /// Optional. When true, the output Cloud Storage file will be serialized
9012 /// using the topic schema, if it exists.
9013 pub use_topic_schema: bool,
9014
9015 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9016 }
9017
9018 impl AvroConfig {
9019 pub fn new() -> Self {
9020 std::default::Default::default()
9021 }
9022
9023 /// Sets the value of [write_metadata][crate::model::cloud_storage_config::AvroConfig::write_metadata].
9024 ///
9025 /// # Example
9026 /// ```ignore,no_run
9027 /// # use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::AvroConfig;
9028 /// let x = AvroConfig::new().set_write_metadata(true);
9029 /// ```
9030 pub fn set_write_metadata<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9031 self.write_metadata = v.into();
9032 self
9033 }
9034
9035 /// Sets the value of [use_topic_schema][crate::model::cloud_storage_config::AvroConfig::use_topic_schema].
9036 ///
9037 /// # Example
9038 /// ```ignore,no_run
9039 /// # use google_cloud_bigquery_analyticshub_v1::model::cloud_storage_config::AvroConfig;
9040 /// let x = AvroConfig::new().set_use_topic_schema(true);
9041 /// ```
9042 pub fn set_use_topic_schema<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9043 self.use_topic_schema = v.into();
9044 self
9045 }
9046 }
9047
9048 impl wkt::message::Message for AvroConfig {
9049 fn typename() -> &'static str {
9050 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.CloudStorageConfig.AvroConfig"
9051 }
9052 }
9053
9054 /// Defaults to text format.
9055 #[derive(Clone, Debug, PartialEq)]
9056 #[non_exhaustive]
9057 pub enum OutputFormat {
9058 /// Optional. If set, message data will be written to Cloud Storage in text
9059 /// format.
9060 TextConfig(std::boxed::Box<crate::model::cloud_storage_config::TextConfig>),
9061 /// Optional. If set, message data will be written to Cloud Storage in Avro
9062 /// format.
9063 AvroConfig(std::boxed::Box<crate::model::cloud_storage_config::AvroConfig>),
9064 }
9065}
9066
9067/// All supported message transforms types.
9068#[derive(Clone, Default, PartialEq)]
9069#[non_exhaustive]
9070pub struct MessageTransform {
9071 /// Optional. This field is deprecated, use the `disabled` field to disable
9072 /// transforms.
9073 #[deprecated]
9074 pub enabled: bool,
9075
9076 /// Optional. If true, the transform is disabled and will not be applied to
9077 /// messages. Defaults to `false`.
9078 pub disabled: bool,
9079
9080 /// The type of transform to apply to messages.
9081 pub transform: std::option::Option<crate::model::message_transform::Transform>,
9082
9083 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9084}
9085
9086impl MessageTransform {
9087 pub fn new() -> Self {
9088 std::default::Default::default()
9089 }
9090
9091 /// Sets the value of [enabled][crate::model::MessageTransform::enabled].
9092 ///
9093 /// # Example
9094 /// ```ignore,no_run
9095 /// # use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
9096 /// let x = MessageTransform::new().set_enabled(true);
9097 /// ```
9098 #[deprecated]
9099 pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9100 self.enabled = v.into();
9101 self
9102 }
9103
9104 /// Sets the value of [disabled][crate::model::MessageTransform::disabled].
9105 ///
9106 /// # Example
9107 /// ```ignore,no_run
9108 /// # use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
9109 /// let x = MessageTransform::new().set_disabled(true);
9110 /// ```
9111 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9112 self.disabled = v.into();
9113 self
9114 }
9115
9116 /// Sets the value of [transform][crate::model::MessageTransform::transform].
9117 ///
9118 /// Note that all the setters affecting `transform` are mutually
9119 /// exclusive.
9120 ///
9121 /// # Example
9122 /// ```ignore,no_run
9123 /// # use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
9124 /// use google_cloud_bigquery_analyticshub_v1::model::JavaScriptUDF;
9125 /// let x = MessageTransform::new().set_transform(Some(
9126 /// google_cloud_bigquery_analyticshub_v1::model::message_transform::Transform::JavascriptUdf(JavaScriptUDF::default().into())));
9127 /// ```
9128 pub fn set_transform<
9129 T: std::convert::Into<std::option::Option<crate::model::message_transform::Transform>>,
9130 >(
9131 mut self,
9132 v: T,
9133 ) -> Self {
9134 self.transform = v.into();
9135 self
9136 }
9137
9138 /// The value of [transform][crate::model::MessageTransform::transform]
9139 /// if it holds a `JavascriptUdf`, `None` if the field is not set or
9140 /// holds a different branch.
9141 pub fn javascript_udf(
9142 &self,
9143 ) -> std::option::Option<&std::boxed::Box<crate::model::JavaScriptUDF>> {
9144 #[allow(unreachable_patterns)]
9145 self.transform.as_ref().and_then(|v| match v {
9146 crate::model::message_transform::Transform::JavascriptUdf(v) => {
9147 std::option::Option::Some(v)
9148 }
9149 _ => std::option::Option::None,
9150 })
9151 }
9152
9153 /// Sets the value of [transform][crate::model::MessageTransform::transform]
9154 /// to hold a `JavascriptUdf`.
9155 ///
9156 /// Note that all the setters affecting `transform` are
9157 /// mutually exclusive.
9158 ///
9159 /// # Example
9160 /// ```ignore,no_run
9161 /// # use google_cloud_bigquery_analyticshub_v1::model::MessageTransform;
9162 /// use google_cloud_bigquery_analyticshub_v1::model::JavaScriptUDF;
9163 /// let x = MessageTransform::new().set_javascript_udf(JavaScriptUDF::default()/* use setters */);
9164 /// assert!(x.javascript_udf().is_some());
9165 /// ```
9166 pub fn set_javascript_udf<
9167 T: std::convert::Into<std::boxed::Box<crate::model::JavaScriptUDF>>,
9168 >(
9169 mut self,
9170 v: T,
9171 ) -> Self {
9172 self.transform = std::option::Option::Some(
9173 crate::model::message_transform::Transform::JavascriptUdf(v.into()),
9174 );
9175 self
9176 }
9177}
9178
9179impl wkt::message::Message for MessageTransform {
9180 fn typename() -> &'static str {
9181 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.MessageTransform"
9182 }
9183}
9184
9185/// Defines additional types related to [MessageTransform].
9186pub mod message_transform {
9187 #[allow(unused_imports)]
9188 use super::*;
9189
9190 /// The type of transform to apply to messages.
9191 #[derive(Clone, Debug, PartialEq)]
9192 #[non_exhaustive]
9193 pub enum Transform {
9194 /// Optional. JavaScript User Defined Function. If multiple JavaScriptUDF's
9195 /// are specified on a resource, each must have a unique `function_name`.
9196 JavascriptUdf(std::boxed::Box<crate::model::JavaScriptUDF>),
9197 }
9198}
9199
9200/// User-defined JavaScript function that can transform or filter a Pub/Sub
9201/// message.
9202#[derive(Clone, Default, PartialEq)]
9203#[non_exhaustive]
9204pub struct JavaScriptUDF {
9205 /// Required. Name of the JavasScript function that should applied to Pub/Sub
9206 /// messages.
9207 pub function_name: std::string::String,
9208
9209 /// Required. JavaScript code that contains a function `function_name` with the
9210 /// below signature:
9211 ///
9212 /// ```norust
9213 /// /**
9214 /// * Transforms a Pub/Sub message.
9215 ///
9216 /// * @return {(Object<string, (string | Object<string, string>)>|null)} - To
9217 /// * filter a message, return `null`. To transform a message return a map
9218 /// * with the following keys:
9219 /// * - (required) 'data' : {string}
9220 /// * - (optional) 'attributes' : {Object<string, string>}
9221 /// * Returning empty `attributes` will remove all attributes from the
9222 /// * message.
9223 /// *
9224 /// * @param {(Object<string, (string | Object<string, string>)>} Pub/Sub
9225 /// * message. Keys:
9226 /// * - (required) 'data' : {string}
9227 /// * - (required) 'attributes' : {Object<string, string>}
9228 /// *
9229 /// * @param {Object<string, any>} metadata - Pub/Sub message metadata.
9230 /// * Keys:
9231 /// * - (required) 'message_id' : {string}
9232 /// * - (optional) 'publish_time': {string} YYYY-MM-DDTHH:MM:SSZ format
9233 /// * - (optional) 'ordering_key': {string}
9234 /// */
9235 ///
9236 /// function <function_name>(message, metadata) {
9237 /// }
9238 /// ```
9239 pub code: std::string::String,
9240
9241 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9242}
9243
9244impl JavaScriptUDF {
9245 pub fn new() -> Self {
9246 std::default::Default::default()
9247 }
9248
9249 /// Sets the value of [function_name][crate::model::JavaScriptUDF::function_name].
9250 ///
9251 /// # Example
9252 /// ```ignore,no_run
9253 /// # use google_cloud_bigquery_analyticshub_v1::model::JavaScriptUDF;
9254 /// let x = JavaScriptUDF::new().set_function_name("example");
9255 /// ```
9256 pub fn set_function_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9257 self.function_name = v.into();
9258 self
9259 }
9260
9261 /// Sets the value of [code][crate::model::JavaScriptUDF::code].
9262 ///
9263 /// # Example
9264 /// ```ignore,no_run
9265 /// # use google_cloud_bigquery_analyticshub_v1::model::JavaScriptUDF;
9266 /// let x = JavaScriptUDF::new().set_code("example");
9267 /// ```
9268 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9269 self.code = v.into();
9270 self
9271 }
9272}
9273
9274impl wkt::message::Message for JavaScriptUDF {
9275 fn typename() -> &'static str {
9276 "type.googleapis.com/google.cloud.bigquery.analyticshub.v1.JavaScriptUDF"
9277 }
9278}
9279
9280/// Specifies the type of discovery on the discovery page. Note that
9281/// this does not control the visibility of the exchange/listing which is
9282/// defined by IAM permission.
9283///
9284/// # Working with unknown values
9285///
9286/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9287/// additional enum variants at any time. Adding new variants is not considered
9288/// a breaking change. Applications should write their code in anticipation of:
9289///
9290/// - New values appearing in future releases of the client library, **and**
9291/// - New values received dynamically, without application changes.
9292///
9293/// Please consult the [Working with enums] section in the user guide for some
9294/// guidelines.
9295///
9296/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9297#[derive(Clone, Debug, PartialEq)]
9298#[non_exhaustive]
9299pub enum DiscoveryType {
9300 /// Unspecified. Defaults to DISCOVERY_TYPE_PRIVATE.
9301 Unspecified,
9302 /// The Data exchange/listing can be discovered in the 'Private' results
9303 /// list.
9304 Private,
9305 /// The Data exchange/listing can be discovered in the 'Public' results
9306 /// list.
9307 Public,
9308 /// If set, the enum was initialized with an unknown value.
9309 ///
9310 /// Applications can examine the value using [DiscoveryType::value] or
9311 /// [DiscoveryType::name].
9312 UnknownValue(discovery_type::UnknownValue),
9313}
9314
9315#[doc(hidden)]
9316pub mod discovery_type {
9317 #[allow(unused_imports)]
9318 use super::*;
9319 #[derive(Clone, Debug, PartialEq)]
9320 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9321}
9322
9323impl DiscoveryType {
9324 /// Gets the enum value.
9325 ///
9326 /// Returns `None` if the enum contains an unknown value deserialized from
9327 /// the string representation of enums.
9328 pub fn value(&self) -> std::option::Option<i32> {
9329 match self {
9330 Self::Unspecified => std::option::Option::Some(0),
9331 Self::Private => std::option::Option::Some(1),
9332 Self::Public => std::option::Option::Some(2),
9333 Self::UnknownValue(u) => u.0.value(),
9334 }
9335 }
9336
9337 /// Gets the enum value as a string.
9338 ///
9339 /// Returns `None` if the enum contains an unknown value deserialized from
9340 /// the integer representation of enums.
9341 pub fn name(&self) -> std::option::Option<&str> {
9342 match self {
9343 Self::Unspecified => std::option::Option::Some("DISCOVERY_TYPE_UNSPECIFIED"),
9344 Self::Private => std::option::Option::Some("DISCOVERY_TYPE_PRIVATE"),
9345 Self::Public => std::option::Option::Some("DISCOVERY_TYPE_PUBLIC"),
9346 Self::UnknownValue(u) => u.0.name(),
9347 }
9348 }
9349}
9350
9351impl std::default::Default for DiscoveryType {
9352 fn default() -> Self {
9353 use std::convert::From;
9354 Self::from(0)
9355 }
9356}
9357
9358impl std::fmt::Display for DiscoveryType {
9359 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9360 wkt::internal::display_enum(f, self.name(), self.value())
9361 }
9362}
9363
9364impl std::convert::From<i32> for DiscoveryType {
9365 fn from(value: i32) -> Self {
9366 match value {
9367 0 => Self::Unspecified,
9368 1 => Self::Private,
9369 2 => Self::Public,
9370 _ => Self::UnknownValue(discovery_type::UnknownValue(
9371 wkt::internal::UnknownEnumValue::Integer(value),
9372 )),
9373 }
9374 }
9375}
9376
9377impl std::convert::From<&str> for DiscoveryType {
9378 fn from(value: &str) -> Self {
9379 use std::string::ToString;
9380 match value {
9381 "DISCOVERY_TYPE_UNSPECIFIED" => Self::Unspecified,
9382 "DISCOVERY_TYPE_PRIVATE" => Self::Private,
9383 "DISCOVERY_TYPE_PUBLIC" => Self::Public,
9384 _ => Self::UnknownValue(discovery_type::UnknownValue(
9385 wkt::internal::UnknownEnumValue::String(value.to_string()),
9386 )),
9387 }
9388 }
9389}
9390
9391impl serde::ser::Serialize for DiscoveryType {
9392 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9393 where
9394 S: serde::Serializer,
9395 {
9396 match self {
9397 Self::Unspecified => serializer.serialize_i32(0),
9398 Self::Private => serializer.serialize_i32(1),
9399 Self::Public => serializer.serialize_i32(2),
9400 Self::UnknownValue(u) => u.0.serialize(serializer),
9401 }
9402 }
9403}
9404
9405impl<'de> serde::de::Deserialize<'de> for DiscoveryType {
9406 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9407 where
9408 D: serde::Deserializer<'de>,
9409 {
9410 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DiscoveryType>::new(
9411 ".google.cloud.bigquery.analyticshub.v1.DiscoveryType",
9412 ))
9413 }
9414}
9415
9416/// The underlying shared asset type shared in a listing by a publisher.
9417///
9418/// # Working with unknown values
9419///
9420/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9421/// additional enum variants at any time. Adding new variants is not considered
9422/// a breaking change. Applications should write their code in anticipation of:
9423///
9424/// - New values appearing in future releases of the client library, **and**
9425/// - New values received dynamically, without application changes.
9426///
9427/// Please consult the [Working with enums] section in the user guide for some
9428/// guidelines.
9429///
9430/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9431#[derive(Clone, Debug, PartialEq)]
9432#[non_exhaustive]
9433pub enum SharedResourceType {
9434 /// Not specified.
9435 Unspecified,
9436 /// BigQuery Dataset Asset.
9437 BigqueryDataset,
9438 /// Pub/Sub Topic Asset.
9439 PubsubTopic,
9440 /// If set, the enum was initialized with an unknown value.
9441 ///
9442 /// Applications can examine the value using [SharedResourceType::value] or
9443 /// [SharedResourceType::name].
9444 UnknownValue(shared_resource_type::UnknownValue),
9445}
9446
9447#[doc(hidden)]
9448pub mod shared_resource_type {
9449 #[allow(unused_imports)]
9450 use super::*;
9451 #[derive(Clone, Debug, PartialEq)]
9452 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9453}
9454
9455impl SharedResourceType {
9456 /// Gets the enum value.
9457 ///
9458 /// Returns `None` if the enum contains an unknown value deserialized from
9459 /// the string representation of enums.
9460 pub fn value(&self) -> std::option::Option<i32> {
9461 match self {
9462 Self::Unspecified => std::option::Option::Some(0),
9463 Self::BigqueryDataset => std::option::Option::Some(1),
9464 Self::PubsubTopic => std::option::Option::Some(2),
9465 Self::UnknownValue(u) => u.0.value(),
9466 }
9467 }
9468
9469 /// Gets the enum value as a string.
9470 ///
9471 /// Returns `None` if the enum contains an unknown value deserialized from
9472 /// the integer representation of enums.
9473 pub fn name(&self) -> std::option::Option<&str> {
9474 match self {
9475 Self::Unspecified => std::option::Option::Some("SHARED_RESOURCE_TYPE_UNSPECIFIED"),
9476 Self::BigqueryDataset => std::option::Option::Some("BIGQUERY_DATASET"),
9477 Self::PubsubTopic => std::option::Option::Some("PUBSUB_TOPIC"),
9478 Self::UnknownValue(u) => u.0.name(),
9479 }
9480 }
9481}
9482
9483impl std::default::Default for SharedResourceType {
9484 fn default() -> Self {
9485 use std::convert::From;
9486 Self::from(0)
9487 }
9488}
9489
9490impl std::fmt::Display for SharedResourceType {
9491 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9492 wkt::internal::display_enum(f, self.name(), self.value())
9493 }
9494}
9495
9496impl std::convert::From<i32> for SharedResourceType {
9497 fn from(value: i32) -> Self {
9498 match value {
9499 0 => Self::Unspecified,
9500 1 => Self::BigqueryDataset,
9501 2 => Self::PubsubTopic,
9502 _ => Self::UnknownValue(shared_resource_type::UnknownValue(
9503 wkt::internal::UnknownEnumValue::Integer(value),
9504 )),
9505 }
9506 }
9507}
9508
9509impl std::convert::From<&str> for SharedResourceType {
9510 fn from(value: &str) -> Self {
9511 use std::string::ToString;
9512 match value {
9513 "SHARED_RESOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
9514 "BIGQUERY_DATASET" => Self::BigqueryDataset,
9515 "PUBSUB_TOPIC" => Self::PubsubTopic,
9516 _ => Self::UnknownValue(shared_resource_type::UnknownValue(
9517 wkt::internal::UnknownEnumValue::String(value.to_string()),
9518 )),
9519 }
9520 }
9521}
9522
9523impl serde::ser::Serialize for SharedResourceType {
9524 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9525 where
9526 S: serde::Serializer,
9527 {
9528 match self {
9529 Self::Unspecified => serializer.serialize_i32(0),
9530 Self::BigqueryDataset => serializer.serialize_i32(1),
9531 Self::PubsubTopic => serializer.serialize_i32(2),
9532 Self::UnknownValue(u) => u.0.serialize(serializer),
9533 }
9534 }
9535}
9536
9537impl<'de> serde::de::Deserialize<'de> for SharedResourceType {
9538 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9539 where
9540 D: serde::Deserializer<'de>,
9541 {
9542 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SharedResourceType>::new(
9543 ".google.cloud.bigquery.analyticshub.v1.SharedResourceType",
9544 ))
9545 }
9546}